/* Karen OS: Team (team.js). Calm: plain-word tabs with an underline, white lists with soft
   dividers, rows that open in place, icon actions that show on hover or focus, one filled button
   per screen or open item, help behind a small ?. Built on styles.css tokens. No inline styles. */

.tm .msg:empty { display: none; }

.tm-tabsnav { margin-top: 4px; }
.tm-note .tm-gotit { color: var(--muted); font-weight: 500; font-size: 13px; }

#tmbody { margin-top: 18px; min-width: 0; }
.tm-loading { color: var(--muted); }
.tm-setup { background: var(--surface); border-radius: var(--r-card); padding: 14px 18px; border: 1px solid var(--line); }
.tm-setup p { margin: 0; color: var(--ink); }
.tm-setup p + p { margin-top: 8px; }

/* Sections: a heading line, then a white list */
.tm-cols { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 0 28px; align-items: start; }
.tm-sec { margin: 0 0 26px; min-width: 0; }
.tm-sechead { display: flex; align-items: center; gap: 4px 16px; flex-wrap: wrap; margin: 0 0 8px; min-height: 32px; }
.tm-sechead h2 { font-size: 17px; margin: 0; flex: 1 1 auto; }
.tm-sechead .link { min-height: 32px; text-decoration: none; }
.tm-sechead .link:hover { text-decoration: underline; }
.tm-list { background: var(--surface); border-radius: var(--r-card); overflow: hidden; }
.tm-pad { padding: 4px 0; }
.tm-sec > .tm-pad, .tm-sec > p.tm-pad { margin: 0; }
.tm-muted { color: var(--muted); font-weight: 400; }
.tm-body { color: var(--ink); margin: 2px 0; white-space: pre-line; font-size: 15px; }
.tm-sec h3, .tm-form h3 { font-size: 15px; margin: 4px 0 2px; }

/* Help behind a small ? */
.tm-q { flex: none; width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--line); background: transparent; color: var(--muted);
  font: 700 13px var(--font); cursor: pointer; display: inline-grid; place-items: center; padding: 0; }
.tm-q:hover, .tm-q[aria-expanded="true"] { color: var(--ink); border-color: var(--input); }
.tm-helptext { margin: -2px 0 10px; font-size: 14px; max-width: 680px; }

/* Rows */
.tm-row { position: relative; display: flex; align-items: center; gap: 12px; padding: 12px 16px; min-height: 60px; border-top: 1px solid var(--divider); cursor: pointer; min-width: 0; }
.tm-list > .tm-row:first-child, .tm-list > .tm-x:first-child + .tm-row { border-top: 0; }
.tm-row:hover { background: #FAFCFA; }
.tm-row:focus-visible { outline: 2px solid var(--green-700); outline-offset: -2px; }
.tm-row.sel { background: #F7FAF8; }
.tm-row.static { cursor: default; }
.tm-row.static:hover { background: transparent; }
.tm-what { flex: 1 1 auto; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tm-what > b { font-weight: 600; font-size: 15px; overflow-wrap: anywhere; }
.tm-what > span { font-size: 14px; overflow-wrap: anywhere; }
.tm-row .state { font-size: 14px; color: var(--grey-ink); }
.tm-row .state.bad { color: var(--red); font-weight: 600; }
.state.blue i { background: var(--blue); }
.tm-who { display: inline-flex; align-items: center; gap: 8px; min-width: 0; font-size: 14px; }
.tm-face { width: 32px; height: 32px; font-size: 12px; font-weight: 700; background: var(--green-100); color: var(--green-900); }
.tm-k { flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--green-900); color: #FFFFFF; font-weight: 800; font-size: 13px; }
.tm-inline { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 6px 16px; flex: none; }
.tm-inline .tm-muted svg { width: 14px; height: 14px; vertical-align: -2px; fill: none; stroke: currentColor; stroke-width: 2.4; }
.tm-new { flex: none; font-size: 13px; }

/* Icon actions: show on hover or keyboard focus; on touch they live inside the open item */
.tm-acts { flex: none; display: inline-flex; gap: 2px; opacity: 0; transition: opacity 0.12s; }
.tm-row:hover .tm-acts, .tm-row:focus-within .tm-acts, .tm-row:focus .tm-acts { opacity: 1; }
.tm-ib, .tm-close { width: 34px; height: 34px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; display: inline-grid; place-items: center; padding: 0; }
.tm-ib:hover, .tm-close:hover { background: var(--divider); color: var(--ink); }
.tm-ib svg, .tm-close svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* What's open under its row */
.tm-x { position: relative; padding: 6px 56px 16px 16px; background: #F7FAF8; border-top: 0; min-width: 0; }
.tm-x.tm-new { background: var(--surface); border-radius: var(--r-card); padding: 14px 56px 16px 16px; margin: 0 0 12px; border: 1px solid var(--line); }
.tm-list > .tm-x.tm-new { margin: 0; border: 0; border-radius: 0; border-bottom: 1px solid var(--divider); }
.tm-close { position: absolute; top: 6px; right: 8px; }
.tm-x > p:first-of-type { margin-top: 4px; }
.tm-x h3 { margin-top: 16px; }
.tm-x > form:first-of-type > h3:first-child { margin-top: 4px; }
.tm-days .link, .tm-duty .link { text-decoration: none; min-height: 32px; }
.tm-days .link:hover, .tm-duty .link:hover { text-decoration: underline; }
.tm-formacts { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 18px; margin-top: 12px; }
.tm-formacts .link, .tm-inline .link { text-decoration: none; min-height: 32px; }
.tm-formacts .link:hover, .tm-inline .link:hover { text-decoration: underline; }

/* Forms */
.tm-form { display: flex; flex-direction: column; gap: 10px; min-width: 0; max-width: 760px; }
.tm-f { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.tm-f > span { font-size: 13px; font-weight: 600; color: var(--grey-ink); }
.tm-form input[type=number] { height: 44px; border: 1px solid var(--input); border-radius: var(--r-ctl); background: var(--surface); padding: 0 12px;
  font: 400 15px var(--font); color: var(--ink); width: 100%; min-width: 0; }
.tm-form input[type=number]:focus { outline: 2px solid var(--green-700); outline-offset: -1px; border-color: var(--green-700); }
.tm-grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px 12px; align-items: end; }
.tm-grid4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px 12px; align-items: end; }
.tm-grid4 .wide { grid-column: span 2; }
.tm-fs { border: 0; padding: 0; margin: 0; min-width: 0; }
.tm-fs legend { font-size: 13px; font-weight: 600; color: var(--grey-ink); padding: 0; margin-bottom: 6px; }
.tm-choices { display: flex; flex-wrap: wrap; gap: 6px; }
.tm-choice { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 12px; border-radius: var(--r-ctl); border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-size: 14px; }
.tm-choice:hover { border-color: var(--input); }
.tm-choice:has(input:checked) { border-color: var(--green-700); color: var(--green-900); font-weight: 600; }
.tm-choice:has(input:focus-visible) { outline: 2px solid var(--green-700); outline-offset: 1px; }
.tm-check { display: flex; align-items: center; gap: 10px; min-height: 40px; font-size: 15px; cursor: pointer; }
.tm-check input:disabled + span { color: var(--muted); }
.tm-inlineform { flex-direction: row; align-items: flex-end; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.tm-inlineform .tm-f { flex: 0 1 220px; }
.tm-subform { margin: 8px 0 4px; flex-basis: 100%; }

/* Duty today */
.tm-plain { background: var(--surface); border-radius: var(--r-card); }
.tm-duty { display: flex; align-items: center; gap: 12px 18px; padding: 14px 16px; flex-wrap: wrap; }
.tm-duty + .tm-duty { border-top: 1px solid var(--divider); }
.tm-duty-what { flex: 1 1 220px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tm-duty-what b { font-size: 17px; }
.tm-duty .btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.tm-duty.done .tm-duty-what b { color: var(--muted); }

/* Notices */
.tm-note { display: flex; flex-direction: column; gap: 2px; padding: 12px 16px; border-top: 1px solid var(--divider); align-items: flex-start; }
.tm-note:first-child { border-top: 0; }
.tm-note .link { margin-top: 4px; min-height: 32px; text-decoration: none; }
.tm-noterow { align-items: flex-start; }

/* Wins, goals, encouragement */
.tm-wins { list-style: none; margin: 0; padding: 4px 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 0; background: var(--surface); border-radius: var(--r-card); overflow: hidden; }
.tm-wins li { padding: 10px 14px; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.tm-wins b { font-size: 24px; font-weight: 800; color: var(--green-900); line-height: 1.1; }
.tm-wins span { font-size: 14px; color: var(--ink); }
.tm-wins small { font-size: 12px; color: var(--muted); }
.tm-goal { display: flex; flex-direction: column; gap: 6px; padding: 12px 0; min-width: 0; flex: 1; }
.tm-row .tm-goal { padding: 0; }
.tm-sec > .tm-goal + .tm-goal, .tm-goals .tm-goal + .tm-goal { border-top: 1px solid var(--divider); }
.tm-goal-top { display: flex; gap: 10px; align-items: center; justify-content: space-between; }
.tm-goal-top b { font-weight: 600; }
.tm-goal > span.tm-muted { font-size: 13px; }
.tm-bar { display: block; height: 8px; border-radius: 99px; background: var(--divider); overflow: hidden; }
.tm-bar i { display: block; height: 100%; width: 0; background: var(--green-700); border-radius: 99px; transition: width 0.3s; }
.tm-what .tm-bar { margin-top: 6px; max-width: 320px; }
.tm-enc { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.tm-enc li { color: var(--ink); font-size: 15px; padding-left: 14px; position: relative; }
.tm-enc li::before { content: ""; position: absolute; left: 0; top: 8px; width: 6px; height: 6px; border-radius: 50%; background: var(--green-700); }
.tm-mine { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 15px; padding: 8px 0; border-top: 1px solid var(--divider); }
.tm-mine b { font-weight: 700; margin-left: 4px; }
.tm-mine .link { min-height: 32px; text-decoration: none; }

/* Roster days, bookings, template list */
.tm-days { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; }
.tm-days li { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 14px; padding: 8px 0; border-top: 1px solid var(--line); min-width: 0; }
.tm-days li:first-child { border-top: 0; }
.tm-days li.today .tm-date { color: var(--green-900); font-weight: 700; }
.tm-days li > span:nth-child(2) { flex: 1 1 200px; min-width: 0; }
.tm-date { flex: none; width: 92px; font-size: 14px; color: var(--grey-ink); font-weight: 600; }
.tm-fair { font-size: 13px; margin: 10px 0 0; }

/* Vehicles */
.tm-rego { flex: none; font-family: var(--mono); font-weight: 700; font-size: 14px; letter-spacing: 0.04em; color: var(--ink); border: 1px solid var(--input); border-radius: 6px; padding: 2px 7px; }
.tm-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 18px; margin: 6px 0 4px; }
.tm-facts div { min-width: 0; }
.tm-facts dt { font-size: 13px; color: var(--muted); font-weight: 600; }
.tm-facts dd { margin: 2px 0 0; font-size: 14px; color: var(--ink); overflow-wrap: anywhere; }

/* Time bank */
.tm-balance { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; background: var(--surface); border-radius: var(--r-card); padding: 14px 16px; }
.tm-balance > div { display: flex; flex-direction: column; gap: 2px; }
.tm-balance b { font-size: 28px; font-weight: 800; color: var(--green-900); line-height: 1.1; }
.tm-hm { flex: none; min-width: 72px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink); }
.tm-hm.minus { color: var(--grey-ink); }
.tm-sec .tm-balance + .tm-x.tm-new { margin-top: 10px; }

/* Checklists */
.tm-steps { list-style: none; margin: 4px 0 0; padding: 0; }
.tm-steps li { border-top: 1px solid var(--line); }
.tm-steps li:first-child { border-top: 0; }

/* Empty */
.tm-empty { display: flex; flex-direction: column; gap: 2px; padding: 22px 16px; text-align: center; background: var(--surface); border-radius: var(--r-card); }
.tm-empty b { font-size: 16px; color: var(--green-900); }
.tm-empty span { color: var(--muted); font-size: 14px; }

/* Touch: bigger targets, actions inside the open item */
@media (pointer: coarse) {
  .tm-acts { display: none; }
  .tm-q { width: 44px; height: 44px; border-color: transparent; position: relative; }
  .tm-q::after { content: ""; position: absolute; inset: 10px; border: 1px solid var(--line); border-radius: 50%; }
  .tm-close { width: 44px; height: 44px; top: 2px; right: 2px; }
  .tm-sechead .link, .tm-formacts .link, .tm-inline .link, .tm-note .link, .tm-mine .link { min-height: 44px; display: inline-flex; align-items: center; }
  .tm-choice, .tm-check { min-height: 44px; }
}

@media (max-width: 900px) {
  .tm-cols { grid-template-columns: minmax(0, 1fr); }
  .tm-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tm-grid4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .tm-row { flex-wrap: wrap; padding: 12px 14px; }
  .tm-row > .tm-what { flex-basis: calc(100% - 50px); }
  .tm-row > .tm-who, .tm-row > .tm-inline { margin-left: 44px; }
  .tm-row > .tm-rego + .tm-what { flex-basis: 100%; }
  .tm-x, .tm-x.tm-new { padding: 6px 48px 14px 14px; }
  .tm-grid2 { grid-template-columns: minmax(0, 1fr); }
  .tm-grid4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tm-grid4 .wide { grid-column: 1 / -1; }
  .tm-facts { grid-template-columns: minmax(0, 1fr); }
  .tm-date { width: auto; }
  .tm-duty .btn.primary { flex: 1 1 100%; }
  .tm-inlineform .tm-f { flex: 1 1 100%; }
}

/* ---------- Calm pass (Oct 2026): Phones (Peggy) setup pages ----------
   Admin pages, so they stay dense, but quieter: the explanations read as small print under each heading, and each
   card's Save is an outline button (no wall of filled buttons). The page's own main action (Add a person) stays filled. */
:is(#v-team, #v-computers, #v-desk, #v-calls, #v-phonebook, #v-hours, #v-logos, #v-ringtones, #v-trello, #v-calendar, #v-features) .lede {
  font-size: 14px; color: var(--muted); max-width: 72ch; }
:is(#v-team, #v-computers, #v-desk, #v-calls, #v-phonebook, #v-hours, #v-logos, #v-ringtones, #v-trello, #v-calendar, #v-features) .card > h2 + p {
  font-size: 13px; line-height: 1.5; color: var(--muted); max-width: 80ch; }
:is(#v-team, #v-computers, #v-desk, #v-calls, #v-phonebook, #v-hours, #v-logos, #v-ringtones, #v-trello, #v-calendar, #v-features, #v-music) .card .rowbtns .btn.primary {
  background: var(--surface); color: var(--green-700); border: 1px solid var(--green-700); }
:is(#v-team, #v-computers, #v-desk, #v-calls, #v-phonebook, #v-hours, #v-logos, #v-ringtones, #v-trello, #v-calendar, #v-features, #v-music) .card .rowbtns .btn.primary:hover {
  background: var(--green-100); color: var(--green-900); }

/* ---- Phones sub-nav (app.js drawPeggyNav): the four groups, then the open group's own pages ---- */
.pgnav .pg-groups a { font-size: 15px; }
.pgnav .pg-pages { border-bottom: 0; padding-top: 6px; gap: 0 6px; }
.pgnav .pg-pages a { min-height: 36px; padding: 0 12px; border-radius: 999px; font-size: 14px; box-shadow: none; }
.pgnav .pg-pages a.on { background: var(--green-100); color: var(--green-900); box-shadow: none; }
.pgnav:not([hidden]) ~ .view .view-in { padding-top: 24px; }
@media (pointer: coarse) { .pgnav .pg-pages a { min-height: 44px; } }
.pg-how { margin-top: -4px; }
.pg-how .fold-body p { margin: 6px 0 0; font-size: 14px; color: var(--grey-ink); }
