/* The staff app's shared pieces (app.html, body.tp): look "C, Calm", Nov 23 2026.
 * DESIGN.md says what each one is for and the "never do" list. Every screen uses these:
 * tp.css, schedule.css and app-shell.css only lay things out. Need something new? Add it
 * here and to DESIGN.md, don't style it in a screen's own file.
 * No hex colours (they live in skin-coscarella.css under body.tp); sizes in rem.
 * Loaded after app.css (the old demos' base, which this overrides for the app only). */

/* ---------- page and type ---------- */
body.tp { display: flex; flex-direction: column; min-height: 100vh; background: var(--page-bg); font-family: var(--font-sans); font-size: var(--fs-small); color: var(--ink); letter-spacing: 0; -webkit-font-smoothing: antialiased; }
#app { flex: 1; display: flex; flex-direction: column; }
.tp ::selection { background: var(--sel-bg); }
.tp * { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.tp .title { font-family: var(--font-sans); font-size: 1.75rem; font-weight: 700; letter-spacing: -0.015em; line-height: 1.15; }
.tp .h3 { font-family: var(--font-sans); font-size: 1.0625rem; font-weight: 600; letter-spacing: 0; line-height: 1.3; }
.tp .sub { color: var(--ink-3); font-size: var(--fs-body); }
.tp .fine { color: var(--ink-3); font-size: var(--fs-fine); }
.tp .strong { font-weight: 500; }
.tp .num, .tp .cd { font-variant-numeric: tabular-nums; }
.tp .cd { font-weight: 600; color: var(--ink-2); letter-spacing: 0.01em; }
.tp .bad { color: var(--bad); font-weight: 500; }
@media (prefers-reduced-motion: no-preference) {
  .tp .btn, .tp .input, .tp .icon-btn, .tp .seg button, .tp .office, .tp .menu-item, .tp .x { transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, color 0.15s ease; }
}

/* ---------- focus: one blue halo ---------- */
.tp :focus-visible { outline: 0.1875rem solid var(--focus); outline-offset: 0.0625rem; }
.tp .input:focus, .tp .input:focus-visible { outline: 0; border-color: var(--forest); box-shadow: 0 0 0 0.1875rem var(--focus); }

/* ---------- buttons: one primary, one secondary, one icon button ----------
 * .ghost, .quiet and .linkish are old names: they draw the secondary button. New code uses .secondary. */
.tp .btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); min-height: 2.5rem; padding: 0 1.25rem; border: 0.0625rem solid var(--forest); border-radius: var(--radius-pill); background: var(--forest); box-shadow: none; color: var(--on-primary); font-family: inherit; font-size: var(--fs-button); font-weight: 600; letter-spacing: 0; line-height: 1.2; white-space: nowrap; text-decoration: none; cursor: pointer; }
.tp .btn:hover { background: var(--forest-dk); border-color: var(--forest-dk); }
.tp .btn.secondary, .tp .btn.ghost, .tp .btn.quiet, .tp .linkish { border: 0.0625rem solid var(--sec-line); background: var(--surface); color: var(--forest-text); font-weight: 500; }
.tp .btn.secondary:hover, .tp .btn.ghost:hover, .tp .btn.quiet:hover, .tp .linkish:hover { background: var(--sel-bg); border-color: var(--sec-line); color: var(--sel-ink); }
.tp .btn.danger, .tp .btn.danger:hover { color: var(--bad); }
.tp .btn.sm, .tp .linkish { min-height: 2.125rem; padding: 0 0.875rem; font-size: var(--fs-fine); }
.tp .btn.wide { width: 100%; }
.tp .btn:active { transform: scale(0.98); }
.tp .btn[disabled] { opacity: 0.5; cursor: default; }
.tp .linkish { display: inline-flex; align-items: center; justify-content: center; border-radius: var(--radius-pill); font-family: inherit; text-decoration: none; cursor: pointer; white-space: nowrap; }
.tp .file-btn { display: inline-flex; align-items: center; justify-content: center; cursor: pointer; width: fit-content; }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }

/* an action on a row: an icon, no background until it's hovered or open */
.tp .icon-btn, .tp .x { flex: none; width: 2rem; height: 2rem; display: inline-grid; place-items: center; padding: 0; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--ink-3); font-size: 1.25rem; line-height: 1; cursor: pointer; }
.tp .icon-btn:hover, .tp .x:hover { background: var(--fill-hover); color: var(--ink); }
.tp .icon-btn[aria-expanded="true"], .tp .icon-btn.on { background: var(--sel-bg); color: var(--sel-ink); }
.tp .icon-btn .ico { width: 1.125rem; height: 1.125rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* a hover label: every icon button says what it does, on hover and on keyboard focus, right away
 * (data-tip; its aria-label says the same). Not shown while its menu is open. */
.tp [data-tip] { position: relative; }
.tp [data-tip]::after { content: attr(data-tip); position: absolute; z-index: 40; right: 0; bottom: calc(100% + 0.375rem); padding: 0.3125rem 0.625rem; border-radius: var(--radius-sm); background: var(--hud); color: var(--on-primary); font-family: var(--font-sans); font-size: var(--fs-fine); font-weight: 500; line-height: 1.3; white-space: nowrap; pointer-events: none; opacity: 0; transform: translateY(0.125rem); }
.tp [data-tip]:hover::after, .tp [data-tip]:focus-visible::after { opacity: 1; transform: none; }
.tp [data-tip][aria-expanded="true"]::after { opacity: 0; }
@media (prefers-reduced-motion: no-preference) { .tp [data-tip]::after { transition: opacity 0.12s ease 0.15s, transform 0.12s ease 0.15s; } }
@media (hover: none) { .tp [data-tip]::after { display: none; } }

/* the one exception to "no text buttons": quiet actions in the sidebar's foot (Lock, Sign out) */
.tp .btn.plain { border-color: transparent; background: transparent; color: var(--ink-2); font-weight: 500; padding: 0 0.625rem; }
.tp .btn.plain:hover { background: var(--fill-hover); border-color: transparent; color: var(--ink); }

/* ---------- fields ---------- */
.tp .input, .tp select.input, .tp textarea.input { min-height: 2.5rem; padding: 0.375rem 0.75rem; border: 0.0625rem solid transparent; border-radius: var(--radius-md); background-color: var(--fill); color: var(--ink); font-family: inherit; font-size: var(--fs-small); box-shadow: none; }
.tp .input:hover { background-color: var(--fill-hover); }
.tp .input:focus { background-color: var(--surface); }
.tp .input::placeholder { color: var(--ink-3); opacity: 1; }
.tp select.input { appearance: none; -webkit-appearance: none; padding-right: 2rem; background-image: var(--chevrons); background-repeat: no-repeat; background-position: right 0.75rem center; background-size: 0.625rem auto; }
.tp .input.sm { min-height: 2.125rem; padding: 0.25rem 0.625rem; border-radius: var(--radius-sm); font-size: var(--fs-fine); }
.tp .input.money, .tp .input.r { text-align: right; font-variant-numeric: tabular-nums; }
.tp .input.need, .tp .input.need:hover { border-color: var(--bad); background-color: var(--bad-bg); color: var(--ink); }
.tp .input.auto { color: var(--ink-2); }
.tp .field { display: grid; gap: 0.375rem; align-content: start; }
.tp .field > span, .tp .lbl { font-weight: 500; color: var(--ink-2); font-size: var(--fs-fine); }
.tp .bad-msg { display: block; color: var(--bad); font-size: var(--fs-fine); margin-top: 0.25rem; }
.tp .bad-msg[hidden] { display: none; }
.tp input[type="checkbox"], .tp input[type="radio"] { accent-color: var(--forest); }

/* a date: written out ("Tue, Dec 1, 2026"), the picker opens when it's tapped. The real
 * date input sits invisibly over it, so a click, a tap or the keyboard all open the picker. */
.tp .date-field { position: relative; display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); min-height: 2.5rem; padding: 0 0.75rem; border: 0.0625rem solid transparent; border-radius: var(--radius-md); background: var(--fill); color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; cursor: pointer; }
.tp .date-field:hover { background: var(--fill-hover); }
.tp .date-field:focus-within { border-color: var(--forest); box-shadow: 0 0 0 0.1875rem var(--focus); background: var(--surface); }
.tp .date-field.empty .date-txt { color: var(--ink-3); }
.tp .date-field .ico { flex: none; width: 1rem; height: 1rem; fill: none; stroke: var(--ink-3); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tp .date-field input[type="date"] { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0; border: 0; opacity: 0; cursor: pointer; font-size: 1rem; }
.tp .date-field input[type="date"]::-webkit-calendar-picker-indicator { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0; cursor: pointer; }
.tp .date-field.sm { min-height: 2.125rem; font-size: var(--fs-fine); }

/* ---------- panels ---------- */
.tp .card { border: 0; border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--card-shadow); }
.tp .card.pad { padding: var(--space-5) 1.25rem; }
.tp .card.warm { background: var(--peach-bg); box-shadow: inset 0 0 0 0.0625rem var(--peach-line); }
.tp .card.warm .input, .tp .card.warm .date-field { background-color: var(--surface); }
.tp .card.warm .input:hover, .tp .card.warm .date-field:hover { background-color: var(--surface); border-color: var(--peach-line); }
.tp .panel-h { margin: 0 0 var(--space-2); font-size: var(--fs-small); font-weight: 600; color: var(--peach-ink); }
.tp .card .rule, .tp .rule { border: 0; border-top: 0.0625rem solid var(--line); margin: 0; }
.tp .empty { color: var(--ink-3); }

/* ---------- choosing one of a few: the segmented control ----------
 * Tabs, the office, sub-tabs, filters. The chosen one is solid blue with white text.
 * Buttons keep their full label: when the row doesn't fit, it scrolls sideways (#10), and a
 * soft shadow at an edge (a scroll-driven animation) says there's more that way. */
@property --seg-l { syntax: "<color>"; inherits: false; initial-value: transparent; }
@property --seg-r { syntax: "<color>"; inherits: false; initial-value: transparent; }
.seg { display: inline-grid; grid-auto-flow: column; grid-auto-columns: auto; max-width: 100%; min-width: 0; overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; scrollbar-width: none; -webkit-overflow-scrolling: touch;
  gap: 0.125rem; padding: 0.25rem; border-radius: var(--radius-pill); background-color: var(--surface); box-shadow: var(--card-shadow); }
.card .seg, .tp .card .offices { background-color: var(--fill); box-shadow: none; }
@supports (animation-timeline: scroll()) {
  .seg {
    background-image:
      radial-gradient(farthest-side at 0 50%, var(--seg-l), transparent),
      radial-gradient(farthest-side at 100% 50%, var(--seg-r), transparent);
    background-position: left center, right center; background-size: 0.75rem 100%; background-repeat: no-repeat;
    animation: seg-cue linear both; animation-timeline: scroll(self inline);
  }
  @keyframes seg-cue {
    0% { --seg-l: transparent; --seg-r: color-mix(in srgb, var(--ink) 25%, transparent); }
    4% { --seg-l: color-mix(in srgb, var(--ink) 25%, transparent); }
    96% { --seg-r: color-mix(in srgb, var(--ink) 25%, transparent); }
    100% { --seg-l: color-mix(in srgb, var(--ink) 25%, transparent); --seg-r: transparent; }
  }
}
.seg::-webkit-scrollbar { display: none; }
.seg button, .tp .office { position: relative; min-height: 2.25rem; padding: 0 1rem; border: 0; border-radius: var(--radius-pill); background: transparent; color: var(--ink-2); font-family: inherit; font-weight: 500; font-size: var(--fs-fine); white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); cursor: pointer; }
.seg button:focus-visible { outline-offset: -0.1875rem; }
.seg button:hover, .tp .office:hover { background: var(--fill-hover); color: var(--ink); }
.seg button[aria-selected="true"], .seg button[aria-pressed="true"], .tp .office[aria-checked="true"], .tp .office[aria-checked="true"]:hover { background: var(--forest); color: var(--on-primary); box-shadow: none; }
.tp .offices { display: inline-flex; flex-wrap: wrap; gap: 0.125rem; padding: 0.25rem; border-radius: var(--radius-pill); background: var(--fill); }
.tp .office { min-height: 2.5rem; font-size: var(--fs-small); padding: 0 1rem; }

/* ---------- a highlighted row, a menu (a line's menus; the account menu, .menu-panel, uses the same rows) ---------- */
.menu-wrap { position: relative; }
.tp .menu { position: absolute; z-index: 30; min-width: 13rem; padding: 0.375rem; border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--sheet-shadow); display: grid; gap: 0.125rem; }
.tp .menu[hidden] { display: none; }
.tp .menu-item { display: flex; align-items: center; gap: var(--space-3); min-height: 2.5rem; padding: 0 0.75rem; border: 0; border-radius: var(--radius-sm); background: none; color: var(--ink); font-family: inherit; font-size: var(--fs-small); text-align: left; text-decoration: none; white-space: nowrap; cursor: pointer; }
.tp .menu-item .ico { width: 1.25rem; height: 1.25rem; flex: none; fill: none; stroke: var(--forest-text); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tp .menu-item span:not(.ico) { flex: 1; }
.tp .menu-item .nav-badge { flex: none; }
.tp .menu-item:hover, .tp .menu-item:focus-visible { background: var(--sel-bg); color: var(--sel-ink); outline: 0; }
.tp .menu-item[aria-current="page"] { background: var(--sel-bg); color: var(--sel-ink); }
.tp .menu-item[aria-current="true"], .tp .menu-item[disabled], .tp .menu-item[disabled]:hover { color: var(--ink-3); background: none; cursor: default; }

/* ---------- a row in a list that opens something (a follow-up, later others) ----------
 * The whole row is one button. Its open state: the highlighted-row colour plus a blue edge. */
.tp .row-btn { display: grid; align-items: center; gap: var(--space-3); width: 100%; padding: var(--space-2) 1.25rem; border: 0; border-radius: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.tp .row-btn:hover { background: var(--fill); }
.tp .row-btn[aria-expanded="true"], .tp .row-btn.on { background: var(--sel-bg); box-shadow: inset 0.1875rem 0 0 var(--forest); }
.tp .row-btn:focus-visible { outline-offset: -0.1875rem; }

/* ---------- tags, counts, notices ---------- */
.tp .tag, .tp .fam, .tp .pill, .draft-tag { display: inline-flex; align-items: center; padding: 0.0625rem 0.5rem; border: 0; border-radius: var(--radius-pill); background: var(--teal-bg); color: var(--teal-ink); font-family: inherit; font-size: var(--fs-fine); font-weight: 500; line-height: 1.45; white-space: nowrap; }
.tp .fam { cursor: pointer; margin-left: var(--space-1); }
.tp .fam:hover { background: var(--sel-bg); color: var(--sel-ink); }
.tp .tag.warn, .tp .pill.warn, .draft-tag { background: var(--warn-bg); color: var(--warn); }
/* late, said quietly: overdue is a peach tag, never red text */
.tp .tag.late { background: var(--peach-bg); color: var(--peach-ink); box-shadow: inset 0 0 0 0.0625rem var(--peach-line); }
.tp .badge { min-width: 1.25rem; height: 1.25rem; padding: 0 0.375rem; display: inline-grid; place-items: center; border-radius: var(--radius-pill); background: var(--peach); color: var(--peach-ink); font-size: 0.8125rem; font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; }
.tp .badge.bad { background: var(--bad); color: var(--on-primary); }
.tp .seg button[aria-selected="true"] .badge { background: var(--surface); color: var(--forest-text); }
.note-box { margin: 0; padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); background: var(--sel-bg); color: var(--ink); font-size: var(--fs-fine); display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); }
.note-box .btn { margin-left: auto; }
.tp .error { margin: 0; padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm); background: var(--bad-bg); color: var(--bad); font-size: var(--fs-fine); font-weight: 400; }
.offline-bar { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); background: var(--warn-bg); color: var(--ink); font-size: var(--fs-fine); }
.offline-bar .ico { width: 1.375rem; height: 1.375rem; flex: none; color: var(--warn); fill: none; stroke: currentColor; stroke-width: 1.8; }
.offline-bar[hidden] { display: none; }
.offline-bar.bad-bar { background: var(--bad-bg); }
.offline-bar.bad-bar .ico { color: var(--bad); }

/* a fold: grey words with a chevron that turns, never blue link text */
.tp details.fold > summary, .tp details.fu-notes > summary, .tp details.dates > summary { display: inline-flex; align-items: center; gap: 0.375rem; list-style: none; color: var(--ink-2); font-size: var(--fs-fine); font-weight: 500; cursor: pointer; padding: 0.25rem 0; }
.tp details.fold > summary::-webkit-details-marker, .tp details.fu-notes > summary::-webkit-details-marker, .tp details.dates > summary::-webkit-details-marker { display: none; }
.tp details.fold > summary::before, .tp details.fu-notes > summary::before, .tp details.dates > summary::before { content: ""; width: 0.5rem; height: 0.5rem; border: solid var(--ink-3); border-width: 0 0.125rem 0.125rem 0; transform: rotate(-45deg); margin-right: 0.125rem; }
.tp details[open].fold > summary::before, .tp details[open].fu-notes > summary::before, .tp details[open].dates > summary::before { transform: rotate(45deg) translate(-0.125rem, -0.125rem); }
.tp details > summary:hover { color: var(--ink); }

/* ---------- a choice with a tick (print options, phases paid in payments) ---------- */
.tp .choice { display: inline-flex; align-items: center; gap: var(--space-2); border: 0; border-radius: var(--radius-md); background: var(--fill); padding: var(--space-2) var(--space-4); cursor: pointer; }
.tp .choice:has(input:checked) { background: var(--sel-bg); color: var(--sel-ink); }
.tp .choice input { margin: 0; width: 1.125rem; height: 1.125rem; flex: none; }
.choice.sm { padding: var(--space-1) var(--space-3); font-size: var(--fs-fine); }

/* ---------- lists in a panel: rows split by a hairline ---------- */
.tp table { font-size: var(--fs-small); width: 100%; border-collapse: collapse; }
.tp th { font-size: var(--fs-fine); font-weight: 500; color: var(--ink-3); text-transform: none; letter-spacing: 0; border-bottom: 0.0625rem solid var(--line); padding: var(--space-3) var(--space-4) var(--space-2); text-align: left; background: none; }
.tp th.right, .tp td.right { text-align: right; }
.tp td { border-bottom: 0.0625rem solid var(--line); padding: var(--space-3) var(--space-4); vertical-align: top; }
.tp tr:last-child td { border-bottom: 0; }
.tp tbody tr:hover td { background: var(--fill); }

/* ---------- sheets (dialogs) and the toast ---------- */
.tp dialog { border: 0; border-radius: var(--radius-xl); box-shadow: var(--sheet-shadow); padding: 0; background: var(--surface); color: var(--ink); }
.tp dialog::backdrop { background: var(--scrim); }
.tp .toast { border-radius: var(--radius-pill); padding: 0.625rem 0.75rem 0.625rem 1.25rem; background: var(--hud); color: var(--on-primary); font-weight: 500; font-size: var(--fs-fine); box-shadow: var(--sheet-shadow); bottom: 5.5rem; }
@media (prefers-reduced-motion: no-preference) { .tp .toast:not([hidden]) { animation: hud-in 0.2s ease-out; } }
@keyframes hud-in { from { opacity: 0; transform: translate(-50%, 0.5rem); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ---------- touch screens: 44px targets, 16px text in fields (no iPhone zoom) (#12, #34) ---------- */
@media (pointer: coarse) {
  .tp .input, .tp select.input, .tp textarea.input, .tp .input.sm { font-size: 1rem; }
  .tp .input, .tp .input.sm, .tp .date-field, .tp .date-field.sm { min-height: 2.75rem; }
  .tp .btn, .tp .btn.sm, .tp .linkish, .seg button, .tp .office, .tp .menu-item { min-height: 2.75rem; }
  .tp .icon-btn, .tp .x { width: 2.75rem; height: 2.75rem; }
  .tp .choice input { width: 1.375rem; height: 1.375rem; }
}

/* ---------- phones (up to 640px) ---------- */
@media (max-width: 40em) {
  .tp .title { font-size: 1.5rem; overflow-wrap: anywhere; }
  .tp .h3 { overflow-wrap: anywhere; }
  .tp .card.pad { padding: var(--space-4); }
  .seg { display: flex; }
  .seg button { flex: none; padding: 0 var(--space-3); }
}
