/* ====================================================================================================================================
   TACK'S OWN LOOK (stream F, Nov 25 2026; TACK-V1-SPEC.md sections 1 and 4.6). The suite family's frame (the dark left menu, the light
   canvas, white cards) in Tack's palette: deep moss and a lime signal (assets/css/tack-tokens.css over money-tokens.css). On light
   surfaces the accent is the signal INK (6.1:1 on white); the lime itself is only for the dark menu and the mark.
   Every class starts with tk- (or tack-app), so nothing here reaches another portal page. The editor's own screens are tack-editor.css.
   ==================================================================================================================================== */
.tack-app {
  --tk-bg: var(--money-canvas); --tk-card: var(--money-card); --tk-well: var(--money-card-2); --tk-track: var(--money-card-3);
  --tk-line: var(--money-border); --tk-line-strong: #A4B4AC;
  --tk-ink: var(--money-text-1); --tk-ink-2: var(--money-text-2); --tk-muted: var(--money-text-3);
  --tk-accent: var(--tack-signal-ink); --tk-solid: var(--tack-base); --tk-solid-2: var(--tack-base-2); --tk-signal: var(--tack-signal);
  --tk-soft: color-mix(in oklab, var(--tack-signal) 20%, white);
  --tk-neg: var(--money-pill-overdue-fg); --tk-neg-soft: var(--money-pill-overdue-bg);
  --tk-r-sm: var(--money-r-sm); --tk-r: var(--money-r-md); --tk-r-lg: var(--money-r-lg);
  --tk-shadow: var(--money-shadow-card); --tk-shadow-2: var(--money-shadow-raise);
  --tk-side-w: 272px; --tk-topbar-h: 64px;
  --tk-t: var(--money-d-fast) var(--money-ease);
  color-scheme: light; background: var(--tk-bg); color: var(--tk-ink-2); font-family: var(--money-font-ui); font-size: 15px; line-height: 1.55; overflow-wrap: break-word;
}
body.tack-app { margin: 0; min-height: 100vh; }
.tack-app #appHeader { display: none; }
.tack-app main.page { padding: 0; max-width: none; }
.tack-app [hidden] { display: none !important; }
.tack-app h1, .tack-app h2, .tack-app h3, .tack-app h4 { color: var(--tk-ink); font-family: var(--money-font-display); letter-spacing: -0.02em; text-wrap: balance; }
/* a link takes its own class's color; one with none reads as the words around it (zero weight, so any class wins) */
:where(.tack-app) a { color: inherit; }
.tack-app a.tk-btn { color: var(--tk-ink); }
.tack-app a.tk-btn-primary, .tack-app a.tk-btn-danger { color: #fff; }
.tack-app a.tk-link { color: var(--tk-accent); }
.tack-app a:focus-visible, .tack-app button:focus-visible, .tack-app input:focus-visible, .tack-app select:focus-visible, .tack-app textarea:focus-visible,
.tack-app summary:focus-visible, .tack-app [tabindex]:focus-visible { outline: 2px solid var(--tk-accent); outline-offset: 2px; }
.tk-sr, .tk-offscreen { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.tk-skip { position: absolute; left: 12px; top: -60px; z-index: 70; background: var(--tk-solid); color: #fff; padding: 10px 14px; border-radius: var(--tk-r-sm); font-weight: 700; }
.tk-skip:focus { top: 12px; }
.tk-ico { width: 20px; height: 20px; flex: none; }
.tk-loading { padding: 48px 20px; text-align: center; color: var(--tk-muted); font-weight: 600; }

/* ---------------------------------------------------------------------------------------------------------------------- the shell */
.tk-shell { display: grid; grid-template-columns: var(--tk-side-w) minmax(0, 1fr); min-height: 100vh; }
.tk-side { position: sticky; top: 0; height: 100vh; box-sizing: border-box; display: flex; flex-direction: column; gap: 6px; padding: 18px 14px 14px; overflow-y: auto;
  background: var(--tack-menu-bg); color: #fff; }
.tk-product { display: inline-flex; align-items: center; padding: 2px 8px 10px; color: #fff; text-decoration: none; font-family: var(--money-font-display); font-weight: 700; }
.tk-product img, .tk-product svg { display: block; height: 24px; width: auto; }
.tk-brand { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 10px 8px 16px; margin-bottom: 6px; border-bottom: 1px solid rgba(255, 255, 255, 0.10); text-decoration: none; }
.tk-brand__mark { width: 42px; height: 42px; flex: none; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; background: rgba(255, 255, 255, 0.08); }
.tk-brand__mark svg, .tk-brand__mark img { width: 26px; height: 26px; display: block; }
.tk-brand__text { display: grid; min-width: 0; }
.tk-brand__name { color: #fff; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tk-brand__sub { color: var(--tack-band-fg-2); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* MENU-FIT (hotfix, Nov 26 2026): the list SCROLLS inside its own room and the foot stays under it. It used to be allowed to shrink under
   its own rows (min-height: 0) with nothing to scroll, so at a short window the last rows were drawn over the foot ("Get help" on top of
   "My Business Suite" at 1536 by 782). The 4px of padding (taken back by the margin) keeps a row's focus ring from being cut by the scroll
   box; position: relative keeps a word folded away for a screen reader (absolute, 1px) inside the list, or it stays where the list would
   have put it unscrolled and makes the whole menu scroll as well (two bars, Money folded at 560 tall); under two rows of room the whole drawer scrolls instead (a phone on its side; the wide menu keeps overflow visible for its fold
   button, so a laptop window under about 380px tall is not covered). Gate: verify_tack.py T25 (suite_menu_fit.py). */
.tk-menu { position: relative; display: flex; flex-direction: column; gap: 2px; flex: 1; min-height: 88px; margin: -4px; padding: 4px; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain;
  scrollbar-color: rgba(255, 255, 255, 0.34) transparent; /* the portal's thin bar (app.css), light on the dark menu */ }
.tk-menu__item, .tk-side__link { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px; border-radius: var(--tk-r); color: rgba(255, 255, 255, 0.78); font-weight: 600;
  text-decoration: none; transition: background var(--tk-t), color var(--tk-t); position: relative; }
.tk-menu__item:hover, .tk-side__link:hover { background: rgba(255, 255, 255, 0.07); color: #fff; }
.tk-menu__item.is-on { background: rgba(255, 255, 255, 0.11); color: #fff; }
.tk-menu__item.is-on::before { content: ''; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 3px; background: var(--tk-signal); }
.tk-menu__item.is-on .tk-ico { color: var(--tk-signal); }
.tk-menu__badge { margin-left: auto; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--tk-signal); color: var(--tk-solid); font-size: 12px; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center; }
.tk-menu__help { margin-top: 14px; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, 0.10); display: flex; flex-direction: column; gap: 2px; }
.tk-menu__label { padding: 0 12px 4px; font-size: 11.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--tack-band-fg-2); }
.tk-side__foot { margin-top: auto; padding-top: 10px; border-top: 1px solid rgba(255, 255, 255, 0.10); display: flex; flex-direction: column; gap: 2px; }
.tk-powered { margin: 8px 12px 0; font-size: 12px; color: var(--tack-band-fg-2); }
.tk-fold { display: none; }
.tk-scrim { display: none; }
.tk-main { min-width: 0; display: flex; flex-direction: column; }
.tk-topbar { position: sticky; top: 0; z-index: 30; height: var(--tk-topbar-h); box-sizing: border-box; display: flex; align-items: center; gap: 12px; padding: 0 28px;
  background: color-mix(in oklab, var(--tk-bg) 92%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--tk-line); }
.tk-topbar__title { margin: 0; font-size: 20px; font-weight: 800; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tk-topbar__actions { display: flex; align-items: center; gap: 10px; }
.tk-menubtn { display: none; }
.tk-avatar { width: 40px; height: 40px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--tk-card); border: 1px solid var(--tk-line); color: var(--tk-ink-2); }
.tk-view { padding: 24px 28px 64px; min-width: 0; outline: none; }
.tk-section { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; max-width: 1180px; }
.tk-narrow { max-width: 560px; }
.tk-closed { max-width: 560px; padding: 24px 0; display: grid; gap: 12px; justify-items: start; }

@media (min-width: 961px) {
  .tk-fold { display: inline-flex; position: absolute; right: -13px; top: 22px; z-index: 5; width: 26px; height: 26px; border-radius: 50%; align-items: center; justify-content: center;
    background: var(--tk-card); color: var(--tk-ink-2); border: 1px solid var(--tk-line); box-shadow: var(--tk-shadow); cursor: pointer; padding: 0; }
  .tk-fold .tk-ico { width: 14px; height: 14px; transform: rotate(-90deg); }
  .tk-side { overflow: visible; z-index: 40; }
  html.rail-collapsed .tack-app { --tk-side-w: 72px; }
  html.rail-collapsed .tk-fold .tk-ico { transform: rotate(90deg); }
  html.rail-collapsed .tk-side { padding-left: 10px; padding-right: 10px; }
  html.rail-collapsed .tk-product, html.rail-collapsed .tk-brand__text, html.rail-collapsed .tk-menu__item > span:not(.tk-menu__badge), html.rail-collapsed .tk-side__link > span,
  html.rail-collapsed .tk-powered, html.rail-collapsed .tk-menu__label { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  html.rail-collapsed .tk-brand, html.rail-collapsed .tk-menu__item, html.rail-collapsed .tk-side__link { justify-content: center; gap: 0; padding-left: 0; padding-right: 0; }
  html.rail-collapsed .tk-menu__badge { position: absolute; top: 2px; right: 4px; min-width: 18px; height: 18px; font-size: 10.5px; }
}
@media (max-width: 960px) {
  .tk-shell { grid-template-columns: minmax(0, 1fr); }
  .tk-side { position: fixed; left: 0; top: 0; bottom: 0; z-index: 60; width: min(300px, 86vw); transform: translateX(-102%); transition: transform 200ms var(--money-ease); visibility: hidden; }
  .tk-shell.is-menu .tk-side { transform: none; visibility: visible; }
  .tk-shell.is-menu .tk-scrim { display: block; position: fixed; inset: 0; z-index: 50; background: rgba(5, 20, 15, 0.55); }
  .tk-menubtn { display: inline-flex; width: 44px; height: 44px; align-items: center; justify-content: center; border-radius: var(--tk-r-sm); background: var(--tk-card); border: 1px solid var(--tk-line);
    color: var(--tk-ink); cursor: pointer; padding: 0; flex: none; }
  .tk-topbar { padding: 0 14px; }
  .tk-topbar__title { font-size: 18px; }
  .tk-view { padding: 16px 14px 56px; }
}
@media (max-width: 520px) { .tk-topbar__actions .tk-btn span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); } .tk-topbar__actions .tk-btn { padding: 0; width: 44px; justify-content: center; } }

/* ---------------------------------------------------------------------------------------------------------------------- the kit */
.tk-h1 { margin: 0; font-size: 26px; line-height: 1.2; font-weight: 800; }
.tk-h2 { margin: 0; font-size: 17px; line-height: 1.3; font-weight: 700; }
.tk-lede { margin: 4px 0 0; max-width: 720px; color: var(--tk-ink-2); }
.tk-note { margin: 0; color: var(--tk-muted); font-size: 14px; }
.tk-hint { margin: 4px 0 0; color: var(--tk-muted); font-size: 13px; line-height: 1.45; }
.tk-err { margin: 0; color: var(--tk-neg); font-weight: 600; font-size: 14px; }
.tk-link { background: none; border: 0; padding: 0; font: inherit; font-weight: 700; color: var(--tk-accent); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.tk-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 20px; }
.tk-head__words { min-width: 0; flex: 1 1 320px; }
.tk-head__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.tk-panel { background: var(--tk-card); border: 1px solid var(--tk-line); border-radius: var(--tk-r-lg); padding: 20px 22px; box-shadow: var(--tk-shadow); min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; align-content: start; }
.tk-panel__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; }
.tk-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.tk-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.tk-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.tk-spread { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; }
.tk-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; box-sizing: border-box; border-radius: var(--tk-r); border: 1px solid var(--tk-line-strong);
  background: var(--tk-card); color: var(--tk-ink); font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; transition: background var(--tk-t), border-color var(--tk-t), transform var(--tk-t); white-space: nowrap; }
.tk-btn:hover { background: var(--tk-well); }
.tk-btn:active { transform: translateY(1px); }
.tk-btn[disabled] { opacity: 0.55; cursor: not-allowed; }
.tk-btn-primary { background: var(--tk-solid); border-color: var(--tk-solid); color: #fff; }
.tk-btn-primary:hover { background: var(--tk-solid-2); border-color: var(--tk-solid-2); }
.tk-btn-danger { background: var(--tk-neg); border-color: var(--tk-neg); color: #fff; }
.tk-btn-danger:hover { background: color-mix(in oklab, var(--tk-neg) 86%, black); }
.tk-btn-quiet { border-color: transparent; background: transparent; color: var(--tk-ink-2); }
.tk-btn-sm { min-height: 36px; padding: 0 12px; font-size: 14px; border-radius: var(--tk-r-sm); }
.tk-btn-block { width: 100%; }
.tk-btn .tk-ico { width: 18px; height: 18px; }
.tk-iconbtn { width: 40px; height: 40px; flex: none; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--tk-r-sm); border: 1px solid transparent; background: transparent;
  color: var(--tk-ink-2); cursor: pointer; padding: 0; }
.tk-iconbtn:hover { background: var(--tk-well); border-color: var(--tk-line); color: var(--tk-ink); }
.tk-iconbtn[disabled] { opacity: 0.4; cursor: not-allowed; }
.tk-pill { display: inline-flex; align-items: center; min-height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.tk-pill-pos { background: var(--money-pill-paid-bg); color: var(--money-pill-paid-fg); }
.tk-pill-info { background: var(--money-pill-due-bg); color: var(--money-pill-due-fg); }
.tk-pill-warn { background: var(--money-pill-partial-bg); color: var(--money-pill-partial-fg); }
.tk-pill-neg { background: var(--money-pill-overdue-bg); color: var(--money-pill-overdue-fg); }
.tk-pill-quiet { background: var(--money-pill-draft-bg); color: var(--money-pill-draft-fg); }
.tk-empty { padding: 28px 12px; text-align: center; display: grid; gap: 8px; justify-items: center; }
.tk-empty__title { margin: 0; font-size: 18px; }
.tk-empty__body { margin: 0; max-width: 520px; color: var(--tk-ink-2); }

/* forms */
.tk-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; align-items: start; }
.tk-form-1 { grid-template-columns: minmax(0, 1fr); }
.tk-form > .tk-h1, .tk-form > .tk-lede, .tk-form > .tk-hint, .tk-form > .tk-err, .tk-form > .tk-note, .tk-form__actions, .tk-field-wide, .tk-form > .tk-sub { grid-column: 1 / -1; }
.tk-form__actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tk-field { display: grid; gap: 6px; min-width: 0; align-content: start; }
.tk-label { font-size: 13.5px; font-weight: 700; color: var(--tk-ink); }
.tk-input { width: 100%; min-height: 44px; box-sizing: border-box; padding: 9px 12px; border-radius: var(--tk-r-sm); border: 1px solid var(--tk-line-strong); background: #fff; color: var(--tk-ink); font: inherit; }
.tk-input::placeholder { color: #6B7C74; }
.tk-area { min-height: 84px; resize: vertical; line-height: 1.5; }
.tk-select { appearance: auto; padding-right: 6px; }
.tk-code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; line-height: 1.5; white-space: pre-wrap; word-break: break-all; background: var(--tk-well); border: 1px solid var(--tk-line);
  border-radius: var(--tk-r-sm); padding: 12px; margin: 0; color: var(--tk-ink); max-height: 220px; overflow: auto; }
.tk-switch { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; font-weight: 600; color: var(--tk-ink); }
.tk-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.tk-switch__track { width: 42px; height: 24px; flex: none; border-radius: 999px; background: #8A9A92; position: relative; transition: background var(--tk-t); }
.tk-switch__track::after { content: ''; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform var(--tk-t); }
.tk-switch input:checked + .tk-switch__track { background: var(--tk-accent); }
.tk-switch input:checked + .tk-switch__track::after { transform: translateX(18px); }
.tk-switch input:focus-visible + .tk-switch__track { outline: 2px solid var(--tk-accent); outline-offset: 2px; }
.tk-meter { display: grid; gap: 6px; min-width: 0; }
.tk-meter__row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 10px; font-size: 14px; }
.tk-meter__label { font-weight: 700; color: var(--tk-ink); }
.tk-meter__n { color: var(--tk-ink-2); font-variant-numeric: tabular-nums; }
.tk-meter__track { height: 8px; border-radius: 999px; background: var(--tk-track); overflow: hidden; }
.tk-meter__track span { display: block; height: 100%; border-radius: 999px; background: var(--tk-accent); }
.tk-meter.is-near .tk-meter__track span { background: #B7791F; }
.tk-meter.is-full .tk-meter__track span { background: var(--tk-neg); }

/* tables: on a phone each row stacks with its labels */
.tk-tablewrap { overflow-x: auto; }
.tk-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.tk-table th { text-align: left; font-size: 11.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--tk-muted); padding: 8px 10px; border-bottom: 1px solid var(--tk-line); white-space: nowrap; }
.tk-table td { padding: 10px; border-bottom: 1px solid var(--money-grid); vertical-align: top; color: var(--tk-ink-2); }
.tk-table td.is-num, .tk-table th.is-num { text-align: right; font-variant-numeric: tabular-nums; }
.tk-table tr.is-unread td { color: var(--tk-ink); font-weight: 600; }
@media (max-width: 700px) {
  .tk-table.is-stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .tk-table.is-stack tr { display: grid; gap: 4px; padding: 12px 0; border-bottom: 1px solid var(--tk-line); }
  .tk-table.is-stack td { border: 0; padding: 0; display: flex; justify-content: space-between; gap: 12px; text-align: right; }
  .tk-table.is-stack td::before { content: attr(data-th); font-weight: 700; color: var(--tk-ink); text-align: left; flex: none; }
  .tk-table.is-stack td.is-wide { display: block; text-align: left; }
  .tk-table.is-stack td.is-wide::before { display: block; }
  .tk-grid-2, .tk-grid-3, .tk-form { grid-template-columns: minmax(0, 1fr); }
}

/* dialogs, the small menu and the toast */
.tk-modal { position: fixed; inset: 0; z-index: 90; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(5, 20, 15, 0.55); opacity: 0; transition: opacity 140ms; }
.tk-modal.is-open { opacity: 1; }
.tk-modal__panel { width: min(520px, 100%); max-height: calc(100vh - 32px); overflow: auto; box-sizing: border-box; background: var(--tk-card); border-radius: var(--tk-r-lg); padding: 22px; box-shadow: 0 28px 64px rgba(12, 31, 25, 0.30);
  display: grid; gap: 12px; color: var(--tk-ink-2); font-family: var(--money-font-ui); }
.tk-modal__panel-wide { width: min(860px, 100%); }
.tk-modal__title { margin: 0; font-size: 20px; font-weight: 800; color: var(--tk-ink); font-family: var(--money-font-display); }
.tk-modal__body { color: var(--tk-ink-2); white-space: pre-line; }
.tk-modal form { display: grid; gap: 12px; min-width: 0; }
.tk-modal__actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.tk-pop { position: absolute; z-index: 80; min-width: 190px; padding: 6px; background: var(--tk-card); border: 1px solid var(--tk-line); border-radius: var(--tk-r); box-shadow: var(--tk-shadow-2); display: grid; gap: 2px;
  font-family: var(--money-font-ui); }
.tk-pop__item { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 10px; border: 0; border-radius: var(--tk-r-sm); background: none; font: inherit; font-weight: 600; color: var(--money-text-1); cursor: pointer; text-align: left; }
.tk-pop__item:hover, .tk-pop__item:focus-visible { background: var(--money-card-2); }
.tk-pop__item.is-danger { color: var(--money-pill-overdue-fg); }
.tk-toast { position: fixed; left: 50%; top: calc(100% - 72px); z-index: 95; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; max-width: min(92vw, 520px); padding: 12px 16px; border-radius: var(--money-r-md);
  background: var(--tack-base); color: #fff; font: 600 14px/1.4 var(--money-font-ui); box-shadow: var(--money-shadow-raise); transition: opacity 160ms, transform 160ms; }
.tk-toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; cursor: pointer; }
@media (prefers-reduced-motion: reduce) { .tack-app *, .tk-modal, .tk-toast { transition: none !important; animation: none !important; } }
