/* Diagon brand: green #A3E635, black, grey */

/* Inter (SIL Open Font License, fonts/LICENSE-Inter.txt), stored with the app so it looks the same on Mac and Windows. */
@font-face {
  font-family: "Inter";
  src: url("/fonts/inter-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* Two looks, light (the default) and dark, picked with the switch at the bottom of the sidebar (theme.js).
   The lime is a fill (buttons, the active menu item); text and lines in the brand colour use --accent, a deeper
   green on light pages so it stays readable on white. */
:root {
  --lime: #A3E635;          /* matches the Diagon OS icon */
  --lime-hover: #BEF264;    /* lighter */
  --lime-pressed: #84CC16;  /* darker */
  --black: #111111;         /* brand black (text on lime) */
  --sidebar-width: 248px;
  --r-sm: 8px;              /* inputs, buttons */
  --r-md: 10px;             /* boxes inside cards */
  --r-lg: 12px;             /* cards, dialogs */
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* Light */
  --accent: #4D7C0F;        /* brand-green text, links, focus lines */
  --lime-soft: #EEF8DD;     /* tinted backgrounds (chips) */
  --lime-line: #CDEBA0;     /* tinted borders */
  --lime-wash: rgba(132, 204, 22, 0.07);  /* row hover */
  --bg: #F7F8F6;            /* page */
  --surface: #FFFFFF;       /* cards, dialogs */
  --surface-2: #F1F3EE;     /* hover, raised */
  --input: #FFFFFF;         /* inputs and boxes inside cards */
  --head-band: #FAFBF9;     /* table header band */
  --zebra: rgba(17, 17, 17, 0.018);
  --weekend: rgba(17, 17, 17, 0.03);
  --grey: #5F6359;
  --grey-dim: #85897F;
  --border: #E6E8E3;
  --border-strong: #D3D6CE;
  --text: #141414;
  --error: #C93B3B;
  --warn: #9A6200;
  --info: #2F6FD0;
  --error-soft: #FCECEC;
  --warn-soft: #FDF3DA;
  --info-soft: #E6EFFC;
  --error-line: #F3C4C4;
  --warn-line: #F1DA9E;
  --ring: 0 0 0 3px rgba(132, 204, 22, 0.25);
  --shadow: 0 1px 2px rgba(17, 17, 17, 0.03);
  --shadow-pop: 0 16px 40px -12px rgba(17, 17, 17, 0.22);
  --scrim: rgba(17, 17, 17, 0.35);
  color-scheme: light;
}
/* Dark */
:root[data-theme="dark"] {
  --accent: #A3E635;
  --lime-soft: rgba(163, 230, 53, 0.10);
  --lime-line: rgba(163, 230, 53, 0.28);
  --lime-wash: var(--lime-wash);
  --bg: #0E0F10;
  --surface: #16171A;
  --surface-2: #1E2023;
  --input: #0F1012;
  --head-band: #1A1B1E;
  --zebra: rgba(255, 255, 255, 0.032);
  --weekend: rgba(255, 255, 255, 0.025);
  --grey: #A1A1AA;
  --grey-dim: #71717A;
  --border: #26282C;
  --border-strong: #34373C;
  --text: #F4F4F5;
  --error: #F87171;
  --warn: #FBBF24;
  --info: #7FB2F5;
  --error-soft: rgba(248, 113, 113, 0.10);
  --warn-soft: rgba(251, 191, 36, 0.10);
  --info-soft: rgba(127, 178, 245, 0.10);
  --error-line: var(--error-line);
  --warn-line: var(--warn-line);
  --ring: 0 0 0 3px rgba(163, 230, 53, 0.18);
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 10px 30px -12px rgba(0, 0, 0, 0.6);
  --shadow-pop: 0 16px 40px -12px rgba(0, 0, 0, 0.8);
  --scrim: rgba(0, 0, 0, 0.6);
  color-scheme: dark;
}
/* The sidebar is black in both looks: it re-uses the dark colours for everything inside it. */
.sidebar {
  --accent: #A3E635; --text: #F4F4F5; --grey: #B4B4AE; --grey-dim: #7A7A75;
  --surface: #1C1C1C; --surface-2: #232323; --input: #101010; --border: #262626; --border-strong: #333333;
  --lime-soft: rgba(163, 230, 53, 0.10); --lime-line: rgba(163, 230, 53, 0.28);
  color-scheme: dark;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14.5px/1.55 "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--accent); }
::selection { background: rgba(163, 230, 53, 0.35); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.muted { color: var(--grey); font-weight: 400; }
.small { font-size: 13px; }
.lime { color: var(--accent); }

/* ---------- Shell: sidebar + content ---------- */

.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  background: #141414;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

/* Diagon OS logo (icon + DIAGON OS), transparent PNG from Brand/ */
.brand { align-self: flex-start; margin: 22px 20px 14px; display: block; }
.logo { height: 36px; width: auto; max-width: 100%; display: block; }

.nav-group { padding: 12px 10px 2px; }
/* The end of the menu: a line and the company name, at the bottom (or after the last item on a long menu). */
.sidebar-end { margin: auto 10px 0; padding: 16px 10px 18px; border-top: 1px solid var(--border); font-size: 11.5px; line-height: 1.5; color: var(--grey-dim); }
.sidebar-end b { display: block; font-size: 12px; font-weight: 600; color: var(--grey); }
#module-nav { padding-bottom: 16px; }
.nav-group-title {
  margin: 0; padding: 0 10px 6px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--grey-dim);
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  margin: 1px 0; padding: 7px 10px; border-radius: var(--r-sm);
  color: var(--grey); text-decoration: none; font-size: 14px; font-weight: 500;
  transition: background 0.12s ease, color 0.12s ease;
}
.nav-label { flex: 1; min-width: 0; }
.nav-icon {
  width: 18px; height: 18px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; opacity: 0.85;
}
a.nav-item:hover { color: var(--text); background: var(--surface-2); }
.nav-item.active { color: var(--black); font-weight: 600; background: var(--lime); }
.nav-item.active .nav-icon { color: var(--black); opacity: 1; }
a.nav-item.active:hover { color: var(--black); background: var(--lime-hover); }
.nav-item.disabled { color: var(--grey-dim); cursor: default; }
.nav-item.disabled .nav-icon { opacity: 0.5; }
.soon {
  font-size: 10px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
  padding: 1px 7px; border-radius: 999px; border: 1px solid var(--border); color: var(--grey-dim);
}

.theme-switch { display: flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--input); border: 1px solid var(--border); }
.theme-switch button {
  flex: 1; font: inherit; font-size: 12px; font-weight: 500; padding: 4px 10px; border: 0; border-radius: 999px;
  background: none; color: var(--grey); cursor: pointer;
}
.theme-switch button:hover { color: var(--text); }
.theme-switch button[aria-pressed="true"] { background: var(--surface-2); color: var(--text); font-weight: 600; }

.content { flex: 1; min-width: 0; }

/* ---------- Top bar (shell.js): search, "Waiting on you", who's signed in ---------- */
.appbar {
  position: sticky; top: 0; z-index: 8; display: flex; align-items: center; gap: 12px;
  height: 62px; padding: 0 40px; background: var(--surface); border-bottom: 1px solid var(--border);
}
.appbar svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.appbar-search { position: relative; flex: 1; min-width: 0; max-width: 460px; }
.search-box {
  display: flex; align-items: center; gap: 10px; margin: 0; padding: 0 10px 0 12px; height: 38px; font-weight: 400;
  color: var(--grey-dim); background: var(--input); border: 1px solid var(--border); border-radius: var(--r-sm); cursor: text;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.search-box:hover { border-color: var(--border-strong); }
.search-box:focus-within { border-color: var(--accent); box-shadow: var(--ring); }
.search-box input { flex: 1; min-width: 0; height: 100%; padding: 0; font: inherit; font-size: 14px; color: var(--text); background: none; border: 0; outline: none; }
.appbar .search-box input[type=search] { -webkit-appearance: none; appearance: none; background: none; padding: 0 !important; border: 0; box-shadow: none; } /* not the magnifier other search boxes get: the bar has its own */
.search-box input::-webkit-search-cancel-button, .search-box input::-webkit-search-decoration { -webkit-appearance: none; display: none; }
.search-box kbd {
  font: 600 11px/1 var(--mono); color: var(--grey-dim); padding: 3px 6px; border: 1px solid var(--border); border-radius: 5px;
}
.search-box:focus-within kbd { display: none; }
.appbar-pop {
  position: absolute; top: calc(100% + 8px); z-index: 20; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md); box-shadow: var(--shadow-pop); padding: 6px; max-height: min(70vh, 520px); overflow-y: auto;
}
.appbar-pop[hidden] { display: none; }
.search-results { left: 0; right: 0; min-width: 320px; }
.search-group { margin: 8px 10px 4px; font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--grey-dim); }
.search-group:first-child { margin-top: 4px; }
.appbar-pop a { display: block; padding: 8px 10px; border-radius: var(--r-sm); color: var(--text); text-decoration: none; font-size: 13.5px; line-height: 1.35; }
.appbar-pop a b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.appbar-pop a span { display: block; margin-top: 1px; font-size: 12.5px; color: var(--grey); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.appbar-pop a:hover, .appbar-pop a.active { background: var(--surface-2); }
.search-empty { margin: 0; padding: 12px 10px; font-size: 13.5px; color: var(--grey); }

.appbar-bell { position: relative; margin-left: auto; }
.icon-btn {
  position: relative; display: grid; place-items: center; width: 38px; height: 38px; padding: 0; color: var(--grey);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-sm); cursor: pointer;
}
.icon-btn:hover, .icon-btn[aria-expanded="true"] { color: var(--text); border-color: var(--border-strong); }
.bell-count {
  position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  font-size: 10.5px; font-weight: 700; line-height: 18px; text-align: center; color: var(--black); background: var(--lime);
  box-shadow: 0 0 0 2px var(--surface);
}
.bell-count.urgent { color: #fff; background: #E5484D; }
.bell-count[hidden] { display: none; }
.waiting-list { right: 0; width: 360px; }
.waiting-head { margin: 4px 10px 6px; font-size: 13px; font-weight: 700; }
.waiting-list a { position: relative; padding-left: 22px; }
.waiting-list a::before {
  content: ""; position: absolute; left: 10px; top: 14px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent);
}
.waiting-list a.urgent::before { background: var(--error); }
.waiting-list a span { white-space: normal; }

.appbar-user { position: relative; flex: none; }
.appbar-bell { flex: none; }
.user-btn {
  display: flex; align-items: center; gap: 10px; padding: 4px 8px 4px 4px; font: inherit; color: var(--text);
  background: none; border: 1px solid transparent; border-radius: 999px; cursor: pointer; text-align: left;
}
.user-btn:hover, .user-btn[aria-expanded="true"] { background: var(--surface-2); }
.user-btn .avatar { color: var(--lime); background: #141414; }
:root[data-theme="dark"] .user-btn .avatar { color: var(--black); background: var(--lime); }
.user-text { display: grid; line-height: 1.25; min-width: 0; }
.user-text b { font-size: 13.5px; font-weight: 600; white-space: nowrap; }
.user-text span { font-size: 12px; color: var(--grey); white-space: nowrap; max-width: 200px; overflow: hidden; text-overflow: ellipsis; }
.user-menu { right: 0; width: max-content; min-width: 240px; max-width: min(340px, calc(100vw - 24px)); padding: 8px; }
.user-menu-email { margin: 4px 6px 10px; font-size: 12.5px; color: var(--grey); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-menu-label { margin: 0 6px 4px; font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--grey-dim); }
.user-menu .theme-switch { margin: 0 0 8px; }
.user-menu a.user-menu-item { border-top: 1px solid var(--border); border-radius: 0 0 var(--r-sm) var(--r-sm); padding-top: 10px; }
.appbar.no-person .appbar-search, .appbar.no-person .appbar-bell { visibility: hidden; }

.topbar { display: flex; align-items: center; gap: 14px; padding: 28px 40px 0; }
.topbar-action { margin-left: auto; white-space: nowrap; }
.crumb { margin: 0; font-size: 12.5px; font-weight: 500; color: var(--grey-dim); }
h1 { margin: 4px 0 0; font-size: 26px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
h2 { margin: 0; font-size: 17px; font-weight: 650; letter-spacing: -0.01em; }
h3 { letter-spacing: -0.01em; }

.menu-btn {
  display: none;
  font-size: 18px; line-height: 1; padding: 8px 11px;
  background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: var(--r-sm); cursor: pointer;
}

/* ---------- Tabs ---------- */

.tabs {
  display: flex; gap: 2px; padding: 0 40px; margin-top: 18px; border-bottom: 1px solid var(--border);
  overflow-x: auto; overflow-y: hidden; scrollbar-width: none; /* still swipeable on narrow screens, no scrollbars */
}
.tabs::-webkit-scrollbar { display: none; }
.tabs a {
  padding: 10px 14px; color: var(--grey); text-decoration: none; font-size: 14px; font-weight: 500; white-space: nowrap;
  border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color 0.12s ease;
}
.tabs a:hover { color: var(--text); }
.tabs a.active { color: var(--text); font-weight: 600; border-bottom-color: var(--accent); }

main { max-width: 1120px; padding: 28px 40px 56px; }

/* ---------- Cards, chips, banners ---------- */

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 22px 24px;
  box-shadow: var(--shadow);
}
.card.empty { padding: 32px 24px; }
.card.empty p { margin: 8px 0 0; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

.chip {
  font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: 999px; border: 1px solid var(--lime-line); white-space: nowrap;
  color: var(--accent); background: var(--lime-soft);
}
/* Status chips start with a small dot in their own colour. */
.chip::before, .status-chip::before {
  content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; background: currentColor; vertical-align: 1px;
}

.banner {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  margin-top: 14px; padding: 11px 14px; border-radius: var(--r-md); font-size: 14px;
}
.banner[hidden] { display: none; }
.banner.error { background: var(--error-soft); border: 1px solid var(--error-line); color: var(--error); }
.banner.conflict { background: var(--warn-soft); border: 1px solid var(--warn-line); color: var(--warn); }

/* ---------- Form ---------- */

.field { margin-top: 18px; }
label { display: block; font-weight: 600; font-size: 13.5px; margin-bottom: 6px; }
.input-row { display: flex; align-items: center; gap: 10px; }
input[type=number] {
  width: 130px; padding: 8px 10px; font: inherit; color: var(--text);
  background: var(--input); border: 1px solid var(--border); border-radius: var(--r-sm);
}
input[type=number]:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
input.changed { border-color: var(--lime-pressed); }
input.invalid { border-color: var(--error); }
/* Every text box, list and date box: same height, same hover, same focus ring. */
input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=color]):not([type=range]), select, textarea {
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=color]):hover:not(:focus):not(:disabled):not(.invalid),
select:hover:not(:focus):not(:disabled):not(.invalid), textarea:hover:not(:focus):not(:disabled):not(.invalid) { border-color: var(--border-strong); }
input::placeholder, textarea::placeholder { color: var(--grey-dim); }
.unit { color: var(--grey); }
.hint { margin: 6px 0 0; color: var(--grey); font-size: 13px; }
.field-error { margin: 4px 0 0; color: var(--error); font-size: 13px; }
.field-error:empty { display: none; }

.actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 24px; }
.btn {
  font: inherit; font-size: 14px; font-weight: 600; padding: 8px 16px; border-radius: var(--r-sm); cursor: pointer;
  border: 1px solid transparent; transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease, transform 0.06s ease;
}
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn.primary { background: var(--lime); color: var(--black); }
.btn.primary:hover:not(:disabled) { background: var(--lime-hover); }
.btn.primary:active:not(:disabled) { background: var(--lime-pressed); }
.btn.secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn.secondary:hover:not(:disabled) { background: var(--surface); border-color: var(--grey-dim); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.status { color: var(--grey); font-size: 14px; }
.status.ok { color: var(--accent); }
.status.bad { color: var(--error); }

/* ---------- Table ---------- */

.table-wrap { overflow-x: auto; margin-top: 14px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th {
  text-align: left; color: var(--grey-dim); font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.06em;
}
th, td { padding: 11px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
thead th { padding-top: 10px; padding-bottom: 10px; background: var(--head-band); border-bottom-color: var(--border); }
td { font-variant-numeric: tabular-nums; }
tbody tr { transition: background 0.1s ease; }
/* Striped rows: every other row a shade lighter (to try out; delete the next two lines to go back). */
tbody tr:nth-child(even) td { background: var(--zebra); }
table.sof-rows tbody tr td { background: none; } /* Source of funds: each entry is two rows, so no stripes */
tbody tr:hover td { background: var(--lime-wash); }
/* A thin lime bar on the row you're pointing at (not on report rows already marked with a red bar). */
tbody tr:not(.flagged):hover td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
td.nowrap { white-space: nowrap; }
tbody tr:last-child td { border-bottom: none; }

/* ---------- Phone / narrow screens: sidebar slides in from the left ---------- */

.scrim { position: fixed; inset: 0; background: var(--scrim); backdrop-filter: blur(2px); z-index: 9; }
.scrim[hidden] { display: none; }

@media (max-width: 800px) {
  .sidebar {
    position: fixed; left: 0; top: 0; z-index: 10;
    transform: translateX(-100%); transition: transform 0.2s ease;
  }
  .sidebar.open { transform: translateX(0); box-shadow: 0 0 40px rgba(0, 0, 0, 0.35); }
  .menu-btn { display: inline-block; }
  .topbar { padding: 16px 16px 0; }
  .appbar { padding: 0 12px; gap: 8px; height: 58px; }
  .menu-btn { flex: none; height: 38px; padding: 0 11px; }
  .user-text, .search-box kbd { display: none; }
  .user-btn { padding: 0; }
  .search-box { gap: 6px; padding: 0 8px; }
  .waiting-list { position: fixed; top: 64px; left: 12px; right: 12px; width: auto; }
  .search-results { position: fixed; top: 64px; left: 12px; right: 12px; min-width: 0; }
  .user-menu { position: fixed; top: 64px; right: 12px; }
  h1 { font-size: 22px; }
  .tabs { padding: 0 16px; }
  main { padding: 20px 16px 40px; }
  .card { padding: 18px 16px; }
}

/* ---------- Check-ins ---------- */

.summary { display: flex; gap: 8px; flex-wrap: wrap; }
.status-chip {
  display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: 999px;
  border: 1px solid var(--border); white-space: nowrap;
}
.status-chip.completed { color: var(--accent); background: var(--lime-soft); border-color: var(--lime-line); }
.status-chip.missed { color: var(--error); background: var(--error-soft); border-color: var(--error-line); }
.status-chip.open { color: var(--warn); background: var(--warn-soft); border-color: var(--warn-line); }
.status-chip.closed { color: var(--grey); background: var(--input); border-color: var(--border); }
.cell-note { margin: 6px 0 0; font-size: 12px; color: var(--grey); max-width: 360px; }
.cell-note.review { color: var(--warn); }

/* ---------- Settings form (Part 4) ---------- */

#policy-form { display: grid; gap: 20px; }
#policy-form .card h2 + .field, #policy-form .card h2 + .off-note { margin-top: 12px; }
fieldset.field { border: 0; padding: 0; margin: 18px 0 0; min-width: 0; }
/* A fieldset that only groups fields so they can be switched off together (e.g. a read-only purchase order). */
fieldset.plain-fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
/* People › Edit: the person's confidential documents under the form. */
.person-docs { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--border); }
/* What has happened to a purchase order so far (purchase-orders.js showOutcome). */
.po-outcome { margin: 0 0 12px; }
.po-outcome .hint { margin: 0; }
/* "+ Create licence" under a typed PO line */
.inv-lines .line-licence { display: inline-block; margin-top: 6px; text-decoration: none; }
#po-table-view[hidden] { display: none; }
#po-pane-status { margin: 6px 0 0; min-height: 0; }
/* Purchase Orders' list + preview: a slightly narrower list so the preview gets the room; attached files as one
   short line each (name only) so they don't push the preview down or sideways. */
.inv-split.po-split { grid-template-columns: minmax(230px, 300px) minmax(0, 1fr); }
.po-pane-billed { margin: 6px 0 0; }
.po-pane-files { margin: 8px 0 0; display: flex; flex-wrap: wrap; gap: 4px 14px; }
.po-pane-files[hidden] { display: none; }
.po-pane-files li { padding: 0; border: 0; min-width: 0; max-width: 100%; font-size: 13px; }
.po-pane-files li::before { content: "📎"; margin-right: 2px; }
.po-pane-files .file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.po-pane-files .file-meta, .po-pane-files .file-download { display: none; }
legend { font-weight: 600; margin-bottom: 8px; padding: 0; }

.choice-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; }
.choice {
  display: flex; gap: 10px; align-items: flex-start; margin: 0; font-weight: 400; cursor: pointer;
  padding: 12px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--input);
}
.choice:has(input:checked) { border-color: var(--accent); }
.choice input { accent-color: var(--accent); margin-top: 3px; }
.choice strong { display: block; }
.choice small { display: block; color: var(--grey); font-size: 12px; margin-top: 2px; }
.choice-grid.changed .choice:has(input:checked) { box-shadow: 0 0 0 1px var(--lime-pressed); }

label.check { display: flex; align-items: center; gap: 8px; font-weight: 600; margin: 0; cursor: pointer; }
label.check input { accent-color: var(--accent); width: 16px; height: 16px; }
label.check.changed { color: var(--accent); }

input.wide[type=text] {
  width: 100%; max-width: 420px; padding: 8px 10px; font: inherit; color: var(--text);
  background: var(--input); border: 1px solid var(--border); border-radius: var(--r-sm);
}
input.wide[type=text]:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
input[type=time] {
  padding: 6px 8px; font: inherit; color: var(--text);
  background: var(--input); border: 1px solid var(--border); border-radius: var(--r-sm);
}
input[type=time]:disabled { opacity: 0.35; }
input.wide.changed, input[type=time].changed { border-color: var(--lime-pressed); }

.days { display: grid; gap: 6px; margin-top: 12px; }
.days[hidden] { display: none; }
.day-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.day-row label.check { width: 70px; font-weight: 400; }
.day-row .dash { color: var(--grey); }
.day-row .field-error { flex-basis: 100%; margin: 0 0 0 78px; }

.card.dimmed > :not(h2):not(.off-note) { opacity: 0.55; }

.save-bar {
  position: sticky; bottom: 0; margin-top: 0; padding: 14px 24px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
}

/* ---------- Work sessions (step 4.5) ---------- */
.choice-grid.three { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.choice.disabled { opacity: 0.45; cursor: not-allowed; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
[hidden] { display: none !important; }
.review-text { color: var(--warn); }
.cell-note.strong { color: var(--text); }
.cell-note.review { color: var(--warn); }
.ack-line { margin-bottom: 4px; white-space: nowrap; }

/* ---------- Company pages (People, Teams) ---------- */
main.page { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-content: start; } /* minmax: wide tables scroll inside their card on phones */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0 24px; }
.form-grid .span-2 { grid-column: 1 / -1; }
select.wide {
  width: 100%; max-width: 420px; padding: 8px 10px; font: inherit; color: var(--text);
  background: var(--input); border: 1px solid var(--border); border-radius: var(--r-sm);
}
select.wide:focus, input.wide:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
select.invalid, input.invalid { border-color: var(--error); }
input[type=email].wide, input[type=search].wide {
  width: 100%; max-width: 420px; padding: 8px 10px; font: inherit; color: var(--text);
  background: var(--input); border: 1px solid var(--border); border-radius: var(--r-sm);
}
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 14px 0 4px; }
.toolbar input[type=search] { max-width: 300px; }
.toolbar select {
  padding: 8px 10px; font: inherit; color: var(--text);
  background: var(--input); border: 1px solid var(--border); border-radius: var(--r-sm);
}
.toolbar .btn { margin-left: auto; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td, tr.clickable:focus td { background: var(--lime-wash); }
tr.clickable:focus td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
tr.clickable:focus { outline: none; }
tr.inactive td { color: var(--grey); }

/* ---------- Modal (add/edit forms) ---------- */
dialog.modal {
  width: min(760px, calc(100vw - 32px)); max-height: calc(100vh - 48px); overflow: auto;
  padding: 22px 26px; color: var(--text);
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r-lg);
  box-shadow: var(--shadow-pop);
}
dialog.modal::backdrop { background: var(--scrim); backdrop-filter: blur(3px); }
dialog.modal .card-head { align-items: center; }
dialog.modal h3 { margin: 22px 0 4px; font-size: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
.modal-close {
  margin-left: 8px; padding: 2px 8px; font-size: 14px; line-height: 1.4; cursor: pointer;
  color: var(--grey); background: transparent; border: 1px solid var(--border); border-radius: var(--r-sm);
}
.modal-close:hover { color: var(--text); background: var(--border); }
#notice { margin-left: auto; }
#notice:empty { display: none; }
#notice:not(:empty) + .btn { margin-left: 0; }

/* ---------- Devices: person column ---------- */
.cell-action { margin-top: 6px; }
.small-btn { padding: 3px 10px; font-size: 12px; }
#assign-history { white-space: pre-line; }

/* ---------- Clients ---------- */
.form-section { margin: 22px 0 4px; font-size: 13px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--grey); }
.form-section:first-child { margin-top: 4px; }
input.narrow, select.narrow { max-width: 200px; }
textarea.wide {
  width: 100%; padding: 8px 10px; font: inherit; color: var(--text); resize: vertical;
  background: var(--input); border: 1px solid var(--border); border-radius: var(--r-sm);
}
textarea.wide:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
.contacts { display: grid; gap: 8px; margin: 8px 0; }
.contact-row {
  display: grid; grid-template-columns: 1.3fr 1fr 1.4fr 1fr auto auto; gap: 8px; align-items: center;
  padding: 8px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--input);
}
.contact-row input[type=text], .contact-row input[type=email] {
  width: 100%; min-width: 0; padding: 6px 8px; font: inherit; font-size: 13px; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-sm);
}
.contact-row input:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
.contact-row label.check { font-weight: 400; font-size: 12px; white-space: nowrap; }
.contact-row .field-error { grid-column: 1 / -1; margin: 0; }
.contact-row .remove { padding: 2px 8px; }
.contact-ticks { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 4px 18px; }
.contact-ticks label[hidden] { display: none; }
@media (max-width: 800px) { .contact-row { grid-template-columns: 1fr 1fr; } }

/* ---------- Spreadsheet import ---------- */
.toolbar .btn + .btn { margin-left: 0; }
dialog.modal.import { width: min(900px, calc(100vw - 32px)); }
.import-steps { margin: 12px 0 0; padding-left: 20px; display: grid; gap: 8px; }
.import-steps .hint { display: block; margin-top: 2px; }
.import-columns { margin-top: 12px; font-size: 13px; color: var(--grey); }
.import-columns summary { cursor: pointer; color: var(--text); font-weight: 600; }
.import-columns ul { margin: 6px 0 0; padding-left: 20px; }
.import-pick { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; margin-top: 16px; }
.import-pick input[type=file] { font: inherit; font-size: 14px; color: var(--grey); }
.import-pick input[type=file]::file-selector-button {
  font: inherit; font-weight: 600; margin-right: 10px; padding: 6px 14px; cursor: pointer;
  color: var(--text); background: transparent; border: 1px solid var(--border); border-radius: var(--r-sm);
}
.import .summary { margin-top: 16px; }

/* ---------- Sign-in ---------- */
.session-banner {
  position: sticky; top: 0; z-index: 20; display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
  padding: 10px 16px; background: var(--warn-soft); border-bottom: 1px solid var(--warn-line); color: var(--warn); font-size: 14px;
}
.session-banner .btn { text-decoration: none; }
dialog .session-banner { position: static; margin: -4px 0 14px; border: 1px solid var(--warn-line); border-radius: var(--r-md); }
body.account-page { display: grid; place-items: center; min-height: 100vh; padding: 16px; }
.account-card {
  width: min(440px, 100%); padding: 28px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow);
}
.account-card .logo { height: 32px; display: block; margin-bottom: 18px; }
.account-card h1 { margin: 0 0 8px; font-size: 22px; }
.account-card a.btn { display: inline-block; text-decoration: none; }
.account-card form { display: grid; gap: 10px; }
.account-card input[type=email] {
  padding: 8px 10px; font: inherit; color: var(--text); background: var(--input); border: 1px solid var(--border); border-radius: var(--r-sm);
}
.account-card button { font: inherit; font-weight: 600; padding: 8px 18px; border-radius: var(--r-sm); border: 0; cursor: pointer; background: var(--lime); color: var(--black); }
.account-card .warning { color: var(--warn); font-size: 14px; }
.admin-warning { margin: 0; }
.signin-facts { margin: 12px 0 0; display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; font-size: 14px; }
.signin-facts dt { color: var(--grey); }
.signin-facts dd { margin: 0; }
.admin-warning a.btn { text-decoration: none; }
.howto { margin-top: 18px; font-size: 14px; }
.howto summary { cursor: pointer; font-weight: 600; }
.howto ol { margin: 10px 0 0; padding-left: 20px; display: grid; gap: 10px; }
.howto-os { margin: 8px 0 4px; font-size: 12px; color: var(--grey); text-transform: uppercase; letter-spacing: 0.04em; }
.copy-line { display: flex; gap: 8px; align-items: flex-start; }
.copy-line code {
  flex: 1; min-width: 0; padding: 6px 8px; font-size: 12px; overflow-wrap: anywhere;
  background: var(--input); border: 1px solid var(--border); border-radius: var(--r-sm);
}
input[type=date].wide { padding: 8px 10px; font: inherit; color: var(--text); background: var(--input); border: 1px solid var(--border); border-radius: var(--r-sm); }

/* ---------- My time ---------- */
.range-bar { margin-top: 0; }
.range-bar input[type=date] { padding: 6px 8px; font: inherit; color: var(--text); background: var(--input); border: 1px solid var(--border); border-radius: var(--r-sm); }
.stat-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; margin-top: 14px; }
.stat { padding: 12px 14px; background: var(--input); border: 1px solid var(--border); border-radius: var(--r-md); }
.stat-value { margin: 0; font-size: 24px; font-weight: 700; letter-spacing: -0.02em; color: var(--accent); font-variant-numeric: tabular-nums; }
.stat-label { margin: 2px 0 0; font-size: 13px; color: var(--grey); }
.stat.bad .stat-value { color: var(--error); }
.stat.warn .stat-value { color: var(--warn); }
.ack { padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.ack:last-child { border-bottom: 0; }
.ack summary { cursor: pointer; }
.ack p, .ack ul { margin: 8px 0 0; }
.ack-list-title { font-weight: 600; font-size: 13px; color: var(--grey); }
#editor-time { margin-left: auto; text-decoration: none; }
.decide { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.decide .field-error { flex-basis: 100%; margin: 0; }
.decide-reason { display: flex; gap: 6px; flex-basis: 100%; }
.decide-reason input { flex: 1; min-width: 0; padding: 4px 8px; font: inherit; font-size: 13px; color: var(--text); background: var(--input); border: 1px solid var(--border); border-radius: var(--r-sm); }

/* ---------- Shifts ---------- */
.shift-chip {
  display: block; width: 100%; margin: 0 0 4px; padding: 3px 6px; text-align: left; font: inherit; font-size: 12px; line-height: 1.3;
  color: var(--text); background: var(--input); border: 1px solid var(--border); border-left: 4px solid #9ca3af; border-radius: var(--r-sm);
}
button.shift-chip { cursor: pointer; }
button.shift-chip:hover { border-color: var(--accent); }
.shift-chip.cancelled { opacity: 0.5; text-decoration: line-through; }
.adjusted-tag { font-size: 10px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--warn); border: 1px solid var(--warn-line); border-radius: 3px; padding: 0 3px; white-space: nowrap; }
.now-line .shift-chip { display: inline-block; width: auto; margin: 0; }
/* In the rota's narrow day columns, a label wraps inside its own cell rather than spilling into the next day. */
.rota .shift-chip { white-space: normal; overflow-wrap: anywhere; }
td .shift-chip { white-space: nowrap; }
.rota td .shift-chip { white-space: normal; }
table.rota { table-layout: fixed; min-width: 860px; }
table.rota th:first-child, table.rota td:first-child { width: 150px; }
.rota th.today, .rota td.today { background: var(--lime-soft); }
.rota-day { vertical-align: top; }
.rota-add {
  display: block; width: 100%; padding: 1px 0; font: inherit; font-size: 13px; cursor: pointer; color: var(--grey);
  background: transparent; border: 1px dashed var(--border); border-radius: var(--r-sm);
}
.rota-add:hover { color: var(--accent); border-color: var(--accent); }
.time-input { padding: 6px 8px; font: inherit; color: var(--text); background: var(--input); border: 1px solid var(--border); border-radius: var(--r-sm); }
.type-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.type-row input[type=text] { flex: 1; min-width: 140px; padding: 6px 8px; font: inherit; color: var(--text); background: var(--input); border: 1px solid var(--border); border-radius: var(--r-sm); }
.type-row input[type=color] { width: 40px; height: 32px; padding: 0; background: none; border: 1px solid var(--border); border-radius: var(--r-sm); }
.swatch { display: inline-block; width: 18px; height: 18px; border-radius: var(--r-sm); vertical-align: middle; }
.btn.danger { color: var(--error); border-color: var(--error-line); margin-left: auto; }
.panel[hidden] { display: none; }
main.page.wide { max-width: 1280px; }

/* ---------- Handover notes ---------- */
/* Each note is its own box; the stripe on the left shows its state. */
.note {
  margin: 12px 0 0; padding: 14px 16px; background: var(--input);
  border: 1px solid var(--border); border-left: 4px solid var(--grey-dim); border-radius: var(--r-lg);
}
.note:first-child { margin-top: 4px; }
.note.unread { border-left-color: var(--warn); }
.note.open { border-left-color: var(--grey-dim); }
.note.resolved { border-left-color: var(--lime-pressed); }
.note.resolved .note-text { color: var(--grey); }
.note-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; flex-wrap: wrap; font-size: 14px; color: var(--grey); }
.note-head strong { color: var(--text); font-size: 15px; }
.note-shift { margin: 3px 0 0; font-size: 13px; color: var(--grey); }
.note-clients { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.note-text { margin: 10px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.55; }
.note-updates { margin: 12px 0 0 4px; padding-left: 12px; border-left: 2px solid var(--border); display: grid; gap: 10px; }
.note-update-by { margin: 0; font-size: 12px; color: var(--grey); }
.note-update .note-text { margin-top: 2px; }
.note-foot { margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--border); }
.note-foot .cell-note { max-width: none; margin: 2px 0 0; }
.note-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.to-read { border-color: var(--warn-line); margin-bottom: 20px; }
.still-open { margin-bottom: 20px; }
.update-form { flex-basis: 100%; }
.client-picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 4px 12px; max-height: 200px; overflow: auto; margin-top: 8px; padding: 8px; background: var(--input); border: 1px solid var(--border); border-radius: var(--r-sm); }
.client-picks label.check { font-weight: 400; font-size: 13px; }
.view-switch { display: inline-flex; gap: 0; }
.view-switch .btn { border-radius: 0; }
.view-switch .btn:first-child { border-radius: var(--r-sm) 0 0 4px; }
.view-switch .btn:last-child { border-radius: 0 var(--r-sm) var(--r-sm) 0; margin-left: -1px; }
/* License Tracking: a distributed license with the client licenses taking seats from it straight below */
tbody tr[class*="lic-"] td { background: var(--lime-wash); }
tbody tr[class*="lic-"] td:first-child { box-shadow: inset 3px 0 0 var(--lime-line); }
tr.lic-child > td:first-child, tr.lic-child-last > td:first-child { padding-left: 28px; }
.lic-tiles { grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); margin: 0 0 14px; }
.lic-tiles button.stat { text-align: left; font: inherit; color: inherit; cursor: pointer; }
.lic-tiles button.stat:hover { border-color: var(--border-strong); }
.lic-tiles button.stat[aria-pressed="true"] { border-color: var(--accent); box-shadow: var(--ring); }
.lic-tiles .stat-sub { margin: 2px 0 0; font-size: 12px; color: var(--grey-dim); }
.kind-switch .btn[aria-pressed="true"] { background: var(--lime); color: var(--black); border-color: var(--lime-pressed); }
.view-switch .btn.active { background: var(--border); color: var(--accent); }
.rota-shift-name { display: inline-block; padding-left: 8px; border-left: 4px solid #9ca3af; font-weight: 600; }
.toolbar .view-switch .btn { margin-left: 0; }
.toolbar .view-switch .btn:last-child { margin-left: -1px; }

/* ---------- Client page ---------- */
.crumb a { color: inherit; text-decoration: none; }
.crumb a:hover { color: var(--accent); }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 8px 20px; margin: 14px 0 0; }
.facts dt { color: var(--grey); font-size: 13px; }
.facts dd { margin: 0; white-space: pre-line; overflow-wrap: anywhere; }
.facts a { color: var(--accent); }
.note-form { margin: 12px 0; }
.note-form .actions { margin-top: 8px; }
.archived-toggle { display: inline-flex; margin-top: 16px; font-weight: 400; }
/* Client notes shown with a handover note */
.client-notes { margin-top: 14px; padding-top: 10px; border-top: 1px dashed var(--border); font-size: 14px; }
.client-notes summary { cursor: pointer; color: var(--grey); font-size: 13px; }
.client-notes .client-note { margin: 8px 0 0 4px; padding-left: 12px; border-left: 2px solid var(--border); }
.client-notes .client-note .note-text { margin-top: 2px; }
.note-clients a.chip-link { text-decoration: none; }
.note-clients a.chip-link:hover { border-color: var(--accent); }
@media (max-width: 600px) { .facts { grid-template-columns: 1fr; gap: 2px; } .facts dd { margin-bottom: 8px; } }

/* ---------- Checklist builder ---------- */
dialog.modal.wide-modal { width: min(960px, calc(100vw - 32px)); }

/* Change history: the clock icon at the top right of a page opens it in a panel (shell.js). */
.page-history-btn {
  margin-left: auto; flex: none; display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px;
  padding: 0; cursor: pointer; color: var(--grey); background: transparent; border: 1px solid var(--border); border-radius: var(--r-sm);
}
.page-history-btn[hidden] { display: none; }
.page-history-btn:hover, .page-history-btn:focus-visible { color: var(--text); background: var(--border); }
.topbar-action:not([hidden]) ~ .page-history-btn { margin-left: 8px; }
.history-modal > .card { padding: 0; background: none; border: 0; box-shadow: none; }
.check-list { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 6px 0; }
.check-list label.check { font-weight: 400; }
.cl-items { display: grid; gap: 10px; margin: 8px 0; }
.cl-item {
  display: grid; grid-template-columns: 130px 1fr auto auto; gap: 6px 8px; align-items: center;
  padding: 10px; background: var(--input); border: 1px solid var(--border); border-radius: var(--r-md);
}
.cl-item input[type=text], .cl-item select {
  width: 100%; padding: 7px 9px; font: inherit; font-size: 14px; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-sm);
}
.cl-item input:focus, .cl-item select:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
.cl-item .cl-help { grid-column: 2 / 3; font-size: 13px; }
.cl-item label.check { font-weight: 400; font-size: 13px; white-space: nowrap; }
.cl-tools { display: flex; gap: 4px; }
.cl-tools .modal-close { padding: 2px 8px; }
.cl-item .field-error { grid-column: 1 / -1; margin: 0; }
.cl-item .field-error:empty { display: none; }
@media (max-width: 700px) {
  .cl-item { grid-template-columns: 1fr auto; }
  .cl-item .cl-label, .cl-item .cl-help { grid-column: 1 / -1; }
}

/* ---------- A checklist form (preview, and later My Time) ---------- */
.cl-form { display: grid; gap: 12px; }
.cl-form-head h3 { margin: 0; font-size: 18px; }
.cl-form-head .hint { margin: 4px 0 0; }
.cl-q { padding: 12px 14px; background: var(--input); border: 1px solid var(--border); border-radius: var(--r-md); }
.cl-q.invalid { border-color: var(--error); }
.cl-q-label { margin: 0; font-weight: 600; }
.cl-q-req { font-weight: 400; font-size: 12px; color: var(--grey); }
.cl-q-help { margin: 2px 0 0; font-size: 13px; color: var(--grey); }
.cl-q-choices { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.cl-q-choice {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; font-size: 14px; cursor: pointer;
  border: 1px solid var(--border); border-radius: 999px;
}
.cl-q-choice:has(input:checked) { border-color: var(--accent); color: var(--accent); }
.cl-q-comment, .cl-q-text {
  width: 100%; margin-top: 8px; padding: 7px 9px; font: inherit; font-size: 14px; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-sm);
}
.cl-q-comment:focus, .cl-q-text:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
.cl-q .field-error { margin: 6px 0 0; }
.cl-q .field-error:empty { display: none; }

/* ---------- Reports ---------- */
.report-filters .inline-field { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--grey); }
.report-filters input[type=date] {
  padding: 6px 8px; font: inherit; font-size: 13px; color: var(--text);
  background: var(--input); border: 1px solid var(--border); border-radius: var(--r-sm);
}
main.page.full { max-width: none; }
table.report { font-size: 13px; }
table.report td:first-child { white-space: nowrap; }
table.report td { vertical-align: top; }
table.report tr.flagged td:first-child { box-shadow: inset 3px 0 0 var(--error); }
.flag-cell { min-width: 140px; }
.flag-chip { cursor: pointer; margin: 0 4px 4px 0; font: inherit; font-size: 12px; background: transparent; }
.flag-chip:hover { border-color: var(--accent); }
.flag-details { margin: 8px 0 0; padding-left: 18px; line-height: 1.6; }
table.report th { vertical-align: bottom; font-size: 11px; letter-spacing: 0; }
table.report th, table.report td { padding-left: 7px; padding-right: 7px; }
table.report td.nowrap .cell-note { white-space: nowrap; }
table.report.hours td.num { white-space: nowrap; font-variant-numeric: tabular-nums; }
table.report.hours td.short { color: var(--warn); }
table.report.hours td:first-child .cell-note { margin-top: 4px; white-space: pre-line; line-height: 1.4; }
table.report.hours tr.hours-day td { color: var(--grey); background: var(--input); }
table.report.hours tr.hours-day td:first-child { padding-left: 28px; }
table.report.hours tr.total-row td { font-weight: 600; border-top: 2px solid var(--border); }

/* Column explanations on the reports */
.help-btn {
  padding: 0 2px; font: inherit; font-size: 13px; line-height: 1; color: var(--grey); cursor: pointer;
  background: none; border: none; vertical-align: baseline;
}
.help-tail { white-space: nowrap; }
.help-btn:hover, .help-btn[aria-expanded="true"] { color: var(--accent); }
.help-pop {
  position: absolute; z-index: 50; padding: 10px 12px; font-size: 13px; font-weight: 400; line-height: 1.5;
  text-transform: none; letter-spacing: normal; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-top: 2px solid var(--lime); border-radius: var(--r-md);
  box-shadow: var(--shadow-pop);
}

/* ---------- Activity (My Time) ---------- */
.day-pick { display: flex; align-items: center; gap: 6px; }
.day-pick input { width: auto; }
.act-timeline { margin-top: 16px; }
.act-bar { position: relative; height: 34px; background: var(--input); border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; cursor: crosshair; }
.act-bar span { position: absolute; top: 0; bottom: 0; }
.act-bar .active, .act-legend .key.active { background: var(--lime); }
.act-bar .away, .act-legend .key.away { background: var(--grey-dim); }
.act-bar .hover { background: var(--text); z-index: 1; min-width: 2px; }
.act-axis { position: relative; height: 18px; margin-top: 4px; font-size: 11px; color: var(--grey); }
.act-axis span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.act-axis span:first-child { transform: none; }
.act-tip { min-height: 1.4em; margin: 6px 0 0; }
.act-legend { margin: 4px 0 0; }
.act-legend .key { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin: 0 4px 0 10px; vertical-align: -1px; }
.act-legend .key:first-child { margin-left: 0; }
.act-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.act-legend .key.none { background: var(--input); border: 1px solid var(--border); }
.act-tables { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; margin-top: 16px; }
td.num, th.num { text-align: right; white-space: nowrap; }
td.top-list { font-size: 12px; color: var(--grey); }
td.top-list div { display: flex; gap: 6px; padding: 1px 0; overflow-wrap: anywhere; }
td.top-list .top-time { flex: none; min-width: 30px; color: var(--text); font-variant-numeric: tabular-nums; }
.cell-link { display: inline-block; margin-top: 2px; font-size: 12px; color: var(--accent); }

/* ---------- Activity labels ---------- */
/* Project, backlog and info-kit statuses (project*.js set --c to one of these). */
:root { --st-grey: #7A7E75; --st-amber: #B7791F; --st-violet: #7C5CD6; --st-red: #D04444; --st-green: #4D8A0F; --st-neutral: #8A8F86; --st-dim: #A7ABA2; }
:root[data-theme="dark"] { --st-grey: #71717A; --st-amber: #FBBF24; --st-violet: #A78BFA; --st-red: #F87171; --st-green: #A3E635; --st-neutral: #A1A1AA; --st-dim: #52525B; }
:root { --label-work: #65A30D; --label-notwork: #DC4C4C; --label-neutral: #8A8F86; --label-none: #C9CCC4; }
:root[data-theme="dark"] { --label-work: #A3E635; --label-notwork: #F87171; --label-neutral: #9CA3AF; --label-none: #4B5563; }
.label-select { width: auto; min-width: 130px; }
.label-select.Work { border-color: var(--label-work); }
.label-select.NotWork { border-color: var(--label-notwork); }
.label-select.Neutral { border-color: var(--label-neutral); }
.label-teams { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.label-team-form { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.label-team-form select { width: auto; }
.label-chip { display: inline-flex; align-items: center; gap: 2px; padding: 2px 4px 2px 8px; border-radius: 999px; font-size: 12px; border: 1px solid var(--border); }
.label-chip.Work { border-color: var(--label-work); }
.label-chip.NotWork { border-color: var(--label-notwork); }
.label-chip.Neutral { border-color: var(--label-neutral); }
.chip-x { background: none; border: 0; color: var(--grey); cursor: pointer; font-size: 14px; padding: 0 4px; line-height: 1; }
.chip-x:hover { color: var(--text); }
.label-tag { display: inline-block; font-size: 11px; padding: 0 6px; border-radius: 999px; border: 1px solid var(--label-none); color: var(--grey); white-space: nowrap; }
.label-tag.Work { border-color: var(--label-work); color: var(--label-work); }
.label-tag.NotWork { border-color: var(--label-notwork); color: var(--label-notwork); }
.label-tag.Neutral { border-color: var(--label-neutral); color: var(--label-neutral); }
.act-bar .Work, .act-legend .key.Work { background: var(--label-work); }
.act-bar .NotWork, .act-legend .key.NotWork { background: var(--label-notwork); }
.act-bar .Neutral, .act-legend .key.Neutral { background: var(--label-neutral); }
.act-bar .NotLabelled, .act-legend .key.NotLabelled { background: var(--label-none); }
.act-colour { display: inline-flex; gap: 4px; margin-left: 8px; }
td.top-list .lab-Work .top-time { color: var(--label-work); }
td.top-list .lab-NotWork .top-time { color: var(--label-notwork); }
#lb-search, #lb-add-name { width: auto; min-width: 180px; padding: 8px 10px; font: inherit; color: var(--text); background: var(--input); border: 1px solid var(--border); border-radius: var(--r-md); }

/* ---------- A team's or person's own Time & Activity settings (policy-settings.js) ---------- */
.ps-group { border: 1px solid var(--border); border-radius: var(--r-md); padding: 10px 14px 12px; margin: 0 0 12px; }
.ps-group legend { padding: 0 6px; font-weight: 600; }
.ps-choice { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-bottom: 6px; }
.ps-follow { margin: 2px 0 0; }
.ps-row { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; margin-top: 6px; }
.ps-row select { width: auto; }
.ps-row input[type=number] { width: 80px; }
.ps-days { margin-top: 8px; }
.ps-now { margin-top: 4px; padding: 10px 14px; background: var(--input); border: 1px solid var(--border); border-radius: var(--r-md); }
.ps-now p { margin: 2px 0; }
#ps-list-card { margin-top: 16px; }
#ps-add { width: auto; max-width: 100%; }
.ps-field { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--grey); }

/* Finance › Bank accounts: my signature, on white like the paper form */
.signature-box { display: flex; align-items: center; min-height: 90px; max-width: 420px; padding: 10px 14px; background: #FFFFFF; border: 1px solid var(--border); border-radius: var(--r-md); }
.signature-box img { max-width: 100%; max-height: 120px; }
.signature-box .muted { color: #6B7280 !important; margin: 0; }
label.btn { display: inline-flex; align-items: center; cursor: pointer; }
label.btn:has(+ input[type=file]:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Finance › Source of funds: editable transaction rows */
table.sof-rows td { vertical-align: top; }
table.sof-rows select, table.sof-rows input[type=text], table.sof-rows input[type=date], table.sof-rows textarea { width: 100%; min-width: 0; padding: 6px 8px; font: inherit; color: var(--text); background: var(--input); border: 1px solid var(--border); border-radius: var(--r-sm); }
table.sof-rows select:focus, table.sof-rows input:focus, table.sof-rows textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
table.sof-rows .sof-main td { border-bottom: none; padding-bottom: 4px; }
table.sof-rows .sof-below td { padding-top: 0; }
table.sof-rows .sof-main td:nth-child(2) > select { width: 190px; }
table.sof-rows .sof-main td:nth-child(3) > input { width: 150px; }
table.sof-rows .sof-main td:nth-child(4) > input { width: 120px; text-align: right; }
table.sof-rows .sof-main td:nth-child(5) > select { width: 90px; }
table.sof-rows .sof-main td:nth-child(6) > select, table.sof-rows .sof-main td:nth-child(6) > input { width: 250px; }
table.sof-rows .sof-main td:nth-child(6) > input { margin-top: 6px; }
table.sof-rows .sof-description { resize: vertical; }
table.sof-rows .sof-label { display: block; margin-bottom: 4px; font-size: 12px; color: var(--grey); }
table.sof-rows .status-chip { display: block; margin-top: 6px; width: max-content; }
#setup-warning a { margin-left: auto; }
table.sof-rows .cell-note.warn { color: var(--warn); max-width: 90px; }

/* ---------- License Tracking ---------- */
.amount-pair { display: flex; gap: 6px; }
.amount-pair select {
  flex: 0 0 auto; padding: 8px 10px; font: inherit; color: var(--text);
  background: var(--input); border: 1px solid var(--border); border-radius: var(--r-sm);
}
.amount-pair select:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
.amount-pair input { flex: 1 1 auto; min-width: 0; width: auto; max-width: 300px; }
.contact-row.vendor-contact { grid-template-columns: 1.3fr 1fr 1.4fr 1fr auto; }
.contact-row.part-row { grid-template-columns: minmax(0, 1fr) 150px auto; }
.part-row select, .part-row input[type=number] {
  width: 100%; min-width: 0; padding: 6px 8px; font: inherit; font-size: 13px; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-sm);
}
.part-row select:focus, .part-row input:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
td a.cell-note { display: block; color: var(--accent); }
@media (max-width: 800px) { .contact-row.vendor-contact { grid-template-columns: 1fr 1fr; } .contact-row.part-row { grid-template-columns: 1fr auto; } .part-row select { grid-column: 1 / -1; } }
.new-type { display: flex; gap: 6px; align-items: center; margin-top: 6px; max-width: 420px; }
.new-type input { flex: 1 1 auto; min-width: 0; }

/* ---------- Finishing touches (UI refresh) ---------- */
/* Money and other number columns: a heading with class "num" right-aligns its whole column, so amounts line up. */
th.num { text-align: right; }
table:has(> thead th.num:nth-child(1)) > tbody > tr > td:nth-child(1),
table:has(> thead th.num:nth-child(2)) > tbody > tr > td:nth-child(2),
table:has(> thead th.num:nth-child(3)) > tbody > tr > td:nth-child(3),
table:has(> thead th.num:nth-child(4)) > tbody > tr > td:nth-child(4),
table:has(> thead th.num:nth-child(5)) > tbody > tr > td:nth-child(5),
table:has(> thead th.num:nth-child(6)) > tbody > tr > td:nth-child(6),
table:has(> thead th.num:nth-child(7)) > tbody > tr > td:nth-child(7),
table:has(> thead th.num:nth-child(8)) > tbody > tr > td:nth-child(8)
{ text-align: right; white-space: nowrap; }
/* Pills and other boxes under an amount sit on the right too. */
table:has(> thead th.num:nth-child(1)) > tbody > tr > td:nth-child(1) > *,
table:has(> thead th.num:nth-child(2)) > tbody > tr > td:nth-child(2) > *,
table:has(> thead th.num:nth-child(3)) > tbody > tr > td:nth-child(3) > *,
table:has(> thead th.num:nth-child(4)) > tbody > tr > td:nth-child(4) > *,
table:has(> thead th.num:nth-child(5)) > tbody > tr > td:nth-child(5) > *,
table:has(> thead th.num:nth-child(6)) > tbody > tr > td:nth-child(6) > *,
table:has(> thead th.num:nth-child(7)) > tbody > tr > td:nth-child(7) > *,
table:has(> thead th.num:nth-child(8)) > tbody > tr > td:nth-child(8) > *
{ margin-left: auto; }

/* A tile with nothing in it yet ("0 min", "0 of 0") is grey; lime is kept for numbers that mean something. */
.stat.zero .stat-value { color: var(--grey-dim); }

/* Dashboard tiles with an icon (dashboard.js): label on top, a small coloured icon on the right, the number below. */
.stat.has-icon { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; column-gap: 10px; padding: 14px 14px 14px 16px; }
.stat.has-icon .stat-label { grid-column: 1; grid-row: 1; margin: 0; padding-top: 2px; font-weight: 500; }
.stat.has-icon .stat-icon { grid-column: 2; grid-row: 1; }
.stat.has-icon .stat-value { grid-column: 1 / -1; grid-row: 2; margin-top: 6px; }
/* The icon carries the colour; the number stays black (white in Dark), red only when it's a problem, grey when 0. */
.stat.has-icon .stat-value, .stat.has-icon.warn .stat-value { color: var(--text); }
.stat.has-icon.bad .stat-value { color: var(--error); }
.stat.has-icon.zero .stat-value { color: var(--grey-dim); }
.stat-icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; }
.stat-icon svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.stat-icon.green { color: #3F8A12; background: #EAF6DA; }
.stat-icon.amber { color: #B7791F; background: #FDF0D5; }
.stat-icon.blue { color: #2F6FD0; background: #E3EDFB; }
.stat-icon.red { color: #C93B3B; background: #FCE8E8; }
.stat-icon.grey { color: var(--grey-dim); background: var(--surface-2); }
:root[data-theme="dark"] .stat-icon.green { color: #A3E635; background: rgba(163, 230, 53, 0.12); }
:root[data-theme="dark"] .stat-icon.amber { color: #FBBF24; background: rgba(251, 191, 36, 0.12); }
:root[data-theme="dark"] .stat-icon.blue { color: #7FB2F5; background: rgba(127, 178, 245, 0.12); }
:root[data-theme="dark"] .stat-icon.red { color: #F87171; background: rgba(248, 113, 113, 0.12); }

/* Search boxes: a magnifier inside, and room for the whole hint text. */
input[type=search][aria-label] { /* [aria-label] so this beats the ".wide" input rules above */
  padding-left: 34px !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2371717A' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 11px center; background-size: 16px 16px;
}
.toolbar input[type=search] { flex: 1 1 320px; max-width: 420px; }

/* The explanation under a card's title: smaller and quieter, so the title and the data come first. */
.card > p.hint, .card-head + p.hint { font-size: 12.5px; color: var(--grey-dim); max-width: 78ch; margin-top: 4px !important; }

/* Who's signed in: round initials badge beside the name. */
.avatar {
  flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  font-size: 12.5px; font-weight: 700; letter-spacing: 0.02em; color: var(--black); background: var(--lime);
}

/* ---------- Dashboard ---------- */
.dash { display: grid; gap: 32px; }
.dash-section[hidden] { display: none; }
.dash-title {
  display: flex; align-items: center; gap: 10px; margin: 0 0 12px;
  font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--grey-dim);
}
.dash-title .chip { text-transform: none; letter-spacing: 0; font-size: 11px; }
/* Two even columns; cards side by side are the same height. dashboard.js (balanceGrid) makes a card that
   would sit alone in a row full width. */
.dash-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: stretch; grid-auto-flow: row dense; }
.dash-grid > .wide { grid-column: 1 / -1; }
/* A full-width list card shows its lines in columns. */
.dash-card.wide .dash-list { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); column-gap: 24px; }
.dash-card { display: flex; flex-direction: column; min-width: 0; }
.dash-card h3 { margin: 0; font-size: 15px; font-weight: 650; }
.dash-card .card-head { align-items: center; }
.dash-card .stat-row { margin-top: 12px; }
.dash-card .table-wrap { margin-top: 16px; }
.dash-card .hint { margin-top: 6px; }
.dash-card.loading { opacity: 0.6; }
.dash-link { font-size: 13px; font-weight: 500; color: var(--grey); text-decoration: none; white-space: nowrap; }
.dash-link:hover { color: var(--accent); }
.dash-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 2px; }
.dash-item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: 0 -10px; padding: 9px 10px; border-radius: var(--r-sm); color: var(--text); text-decoration: none;
}
a.dash-item:hover { background: var(--surface-2); }
.dash-item-text { min-width: 0; }
.dash-item-text p { margin: 0; overflow-wrap: anywhere; }
.dash-item-sub { font-size: 12.5px; color: var(--grey); margin-top: 1px !important; }
.dash-empty { padding: 9px 0; font-size: 14px; color: var(--grey); }
.dash-empty a { color: var(--accent); text-decoration: none; }
.stat-row .stat-value { overflow-wrap: anywhere; }
.bad-text { color: var(--error); }
@media (max-width: 800px) { .dash-grid { grid-template-columns: minmax(0, 1fr); } }
.dash-card .stat-row { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.dash-card .stat-row.money-row { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.money-row .stat-value { font-size: 20px; white-space: nowrap; overflow-wrap: normal; }
@media (max-width: 800px) {
  .dash-card .stat-row:not(.money-row) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-card .stat-value { font-size: 20px; }
}
.money-row .stat-value span { display: block; }
.money-row .stat-value span + span { margin-top: 2px; }

/* ---------- Charts (charts.js) ---------- */
:root {
  --chart-in: var(--lime); /* received: the brand lime */
  --chart-out: #71717A;    /* paid out: neutral grey, so the chart stays black, lime and grey.
                              Checked on the card colour: the two are easy to tell apart, colour-blind included. */
  --chart-invoiced: var(--text); /* invoiced (project Money tab): ink — black in light, near-white in dark; checked
                              against lime and grey in both, colour-blind included */
}
.chart { position: relative; margin-top: 6px; }
.chart svg { display: block; overflow: visible; }
.chart-title { margin: 18px 0 0; font-size: 12.5px; font-weight: 600; color: var(--grey); }
.chart-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 18px; }
.chart-head .chart-title { margin: 0; }
.chart-grid { stroke: var(--border); stroke-width: 1; }
.chart-base { stroke: var(--border-strong); stroke-width: 1; }
.chart-axis { fill: var(--grey-dim); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart-label { fill: var(--text); font-size: 11.5px; font-weight: 600; }
.chart-hit { fill: transparent; cursor: default; outline: none; }
.chart-hit.on { fill: var(--lime-wash); }
.chart-hit:focus-visible { stroke: var(--accent); stroke-width: 1.5; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 4px 0 2px; font-size: 12.5px; color: var(--grey); }
.chart-legend > span { display: inline-flex; align-items: center; gap: 6px; }
.chart-swatch { width: 10px; height: 10px; border-radius: 3px; }
.chart-tip {
  position: fixed; z-index: 60; pointer-events: none; min-width: 140px; padding: 8px 10px;
  background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: var(--r-sm);
  box-shadow: var(--shadow-pop); font-size: 12.5px;
}
.chart-tip[hidden] { display: none; }
.chart-tip p { margin: 0; }
.chart-tip-title { color: var(--grey); margin-bottom: 4px !important; }
.chart-tip-row { display: flex; align-items: center; gap: 8px; }
.chart-tip-row + .chart-tip-row { margin-top: 2px; }
.chart-tip-key { width: 12px; height: 2px; border-radius: 1px; flex: none; }
.chart-tip-row strong { font-variant-numeric: tabular-nums; }
.chart-tip-row span:last-child { color: var(--grey); }
.view-switch .btn.small-btn.active { background: var(--border-strong); color: var(--text); }
/* Worked of scheduled, under the hours in a table cell */
.meter { width: 96px; height: 6px; margin: 6px 0 0 auto; border-radius: 999px; background: var(--lime-soft); overflow: hidden; }
.meter span { display: block; height: 100%; border-radius: 999px; background: var(--lime); }
.meter.short { background: var(--warn-soft); }
.meter.short span { background: var(--warn); }
/* A long line (e.g. a handover note) shows its first two lines here; the full text is a click away. */
.dash-clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.45; }
.dash-item:has(.dash-clamp) { align-items: flex-start; }
.dash-item:has(.dash-clamp) .status-chip { margin-top: 2px; }
/* A dashboard line can carry a colour stripe (e.g. the shift type's colour) and a right-hand column. */
.dash-stripe { align-self: stretch; width: 3px; flex: none; border-radius: 2px; }
.dash-item:has(.dash-stripe) { justify-content: flex-start; }
.dash-item:has(.dash-stripe) .dash-item-text { flex: 1; }
.dash-item-aside { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex: none; text-align: right; }
.dash-item-aside p { margin: 0; font-size: 12.5px; color: var(--grey); font-variant-numeric: tabular-nums; }

/* ---------- Landing page (welcome.html, signed-out visitors) ---------- */
body.landing {
  min-height: 100vh; display: flex; flex-direction: column; overflow-x: hidden;
  background:
    radial-gradient(900px 500px at 85% 20%, rgba(163, 230, 53, 0.10), transparent 60%),
    radial-gradient(700px 400px at 10% 90%, rgba(163, 230, 53, 0.05), transparent 60%),
    var(--bg);
}
.landing-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 24px 40px; }
.landing-top .logo { height: 34px; }
.landing-top .btn { text-decoration: none; }
.landing-main {
  flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); align-items: center; gap: 56px;
  width: 100%; max-width: 1240px; margin: 0 auto; padding: 32px 40px 64px;
}
.landing-eyebrow {
  display: inline-flex; align-items: center; gap: 8px; margin: 0 0 18px; padding: 5px 12px; border-radius: 999px;
  font-size: 12.5px; font-weight: 600; color: var(--accent); background: var(--lime-soft); border: 1px solid var(--lime-line);
}
.landing-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 4px rgba(163, 230, 53, 0.18); }
.landing-hero h1 { margin: 0; font-size: clamp(34px, 4.6vw, 54px); line-height: 1.06; letter-spacing: -0.035em; }
.landing-lead { margin: 20px 0 0; max-width: 46ch; font-size: 17px; line-height: 1.6; color: var(--grey); }
.landing-cta { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 32px; }
.landing-cta p { margin: 0; }
.landing-btn { display: inline-block; padding: 12px 22px; font-size: 15px; text-decoration: none; }
.landing-foot { padding: 20px 40px 28px; font-size: 12.5px; color: var(--grey-dim); }
.landing-foot p { margin: 0; }

/* The dashboard picture: a tilted window, all made with boxes. */
.landing-preview { margin: 0; perspective: 1600px; }
.pv-window {
  transform: rotateY(-9deg) rotateX(4deg); transform-origin: left center;
  border: 1px solid var(--border-strong); border-radius: 16px; overflow: hidden; background: #141414;
  box-shadow: 0 50px 100px -30px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(255, 255, 255, 0.02), 0 0 80px -20px rgba(163, 230, 53, 0.25);
}
.pv-bar { display: flex; gap: 6px; padding: 11px 14px; border-bottom: 1px solid var(--border); }
.pv-bar span { width: 9px; height: 9px; border-radius: 50%; background: var(--border-strong); }
.pv-body { display: flex; min-height: 340px; }
.pv-side { width: 54px; flex: none; display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 14px 0; border-right: 1px solid var(--border); }
.pv-side img { width: 24px; height: 24px; margin-bottom: 6px; }
.pv-side i { width: 22px; height: 6px; border-radius: 3px; background: var(--border-strong); }
.pv-side i.on { background: var(--lime); }
.pv-main { flex: 1; min-width: 0; padding: 16px 18px 18px; background: var(--bg); }
.pv-hello { margin: 0 0 12px; font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
.pv-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 10px; }
.pv-card { padding: 11px 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); }
.pv-wide { grid-column: 1 / -1; }
.pv-title { margin: 0 0 9px; font-size: 10.5px; font-weight: 600; color: var(--grey); }
.pv-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.pv-tiles b { padding: 7px 8px; border-radius: 7px; background: var(--input); border: 1px solid var(--border); color: var(--accent); font-size: 14px; letter-spacing: -0.01em; }
.pv-cols { display: flex; align-items: flex-end; gap: 7px; height: 64px; margin-top: 10px; padding: 0 2px; border-bottom: 1px solid var(--border-strong); }
.pv-cols span { flex: 1; border-radius: 3px 3px 0 0; background: var(--lime); }
.pv-cols span.dim { background: var(--border-strong); }
.pv-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; }
.pv-row i { width: 3px; height: 20px; border-radius: 2px; flex: none; }
.pv-row em { flex: 1; height: 7px; border-radius: 4px; background: var(--border-strong); }
.pv-row u {
  text-decoration: none; font-size: 9.5px; font-weight: 600; padding: 2px 7px; border-radius: 999px;
  color: var(--warn); background: var(--warn-soft); border: 1px solid var(--warn-line); white-space: nowrap;
}
.pv-pairs { display: flex; align-items: flex-end; justify-content: space-around; gap: 10px; height: 74px; border-bottom: 1px solid var(--border-strong); }
.pv-pairs span { display: flex; align-items: flex-end; gap: 2px; height: 100%; }
.pv-pairs b { width: 11px; border-radius: 3px 3px 0 0; background: var(--lime); }
.pv-pairs b + b { background: #71717A; }

@media (max-width: 960px) {
  .landing-main { grid-template-columns: minmax(0, 1fr); gap: 40px; padding: 16px 20px 48px; }
  .landing-top, .landing-foot { padding-left: 20px; padding-right: 20px; }
  .pv-window { transform: none; }
}
@media (max-width: 520px) {
  .pv-side { display: none; }
  .pv-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: no-preference) {
  .pv-window { animation: pv-in 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
  .landing-hero > * { animation: pv-up 0.6s ease both; }
  .landing-hero > :nth-child(2) { animation-delay: 0.06s; }
  .landing-hero > :nth-child(3) { animation-delay: 0.12s; }
  .landing-hero > :nth-child(4) { animation-delay: 0.18s; }
}
@keyframes pv-in { from { opacity: 0; transform: rotateY(-16deg) rotateX(8deg) translateY(20px); } }
@keyframes pv-up { from { opacity: 0; transform: translateY(10px); } }
@media (max-width: 960px) and (prefers-reduced-motion: no-preference) { @keyframes pv-in { from { opacity: 0; transform: translateY(16px); } } }
.dash-links { display: inline-flex; gap: 14px; }
#money-links { flex-wrap: wrap; margin: 12px 0 0; }
#money-stats.money-row { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }

/* Projects › Contracts ending: the boxes are buttons that filter the list */
.stat-button { display: block; width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.stat-button .stat-value, .stat-button .stat-label { display: block; }
.stat-button:hover { border-color: var(--border-strong); }
.stat-button:focus-visible { outline: none; box-shadow: var(--ring); }
.stat-button.picked { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.contract-tiles { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
td .cell-chip { display: inline-block; margin-top: 6px; }
.dash-card .stat-row#contract-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
label.check.end-contract { margin: 10px 0 0; font-weight: 500; }

/* ---------- Project workspace (project.html): team, work plan, backlog, information kit ---------- */
/* Wider than other pages: the work plan needs the room (and the Gantt chart more so). */
main.ws-page { max-width: 1400px; }
.ws-title { min-width: 0; }
.ws-facts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.ws-facts .chip { font-size: 12px; }
.ws-team-btn {
  display: inline-flex; align-items: center; gap: 10px; padding: 6px 12px 6px 8px; cursor: pointer; font: inherit; font-size: 13.5px; font-weight: 600;
  color: var(--text); background: var(--surface); border: 1px solid var(--border-strong); border-radius: 999px;
}
.ws-team-btn:hover { background: var(--surface-2); }
.avatar-stack { display: inline-flex; }
.avatar-stack .avatar { margin-left: -7px; box-shadow: 0 0 0 2px var(--surface); }
.avatar-stack .avatar:first-child { margin-left: 0; }
.avatar.mini { width: 24px; height: 24px; font-size: 10px; }

/* Areas: big tabs (Work plan / Backlog / Information kit); views: a segmented switch (List / Gantt / Calendar). */
.ws-areas { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin: -8px 0 16px; overflow-x: auto; scrollbar-width: none; }
.ws-areas button {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; margin-bottom: -1px; cursor: pointer; white-space: nowrap;
  font: inherit; font-size: 14.5px; font-weight: 550; color: var(--grey); background: none; border: 0; border-bottom: 2px solid transparent;
}
.ws-areas button:hover { color: var(--text); }
.ws-areas button[aria-pressed="true"] { color: var(--text); font-weight: 650; border-bottom-color: var(--accent); }
.ws-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 12px; }
.ws-bar input[type=search] { max-width: 240px; }
.ws-bar select { width: auto; }
.ws-bar .btn { margin-left: auto; }
.ws-bar #notice { margin-left: 0; }
.ws-views { display: inline-flex; padding: 3px; gap: 2px; background: var(--input); border: 1px solid var(--border); border-radius: var(--r-sm); }
.ws-views button {
  padding: 5px 14px; cursor: pointer; font: inherit; font-size: 13px; font-weight: 600; color: var(--grey);
  background: none; border: 0; border-radius: 6px;
}
.ws-views button:hover { color: var(--text); }
.ws-views button[aria-pressed="true"] { color: var(--black); background: var(--lime); }
.ws-progress { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 0 0 14px; font-size: 13.5px; }
.ws-progress:empty { display: none; }
.ws-progress .bar { width: 180px; }
.ws-none { margin: 16px 4px; }

/* Bars (progress) */
.bar { display: inline-block; height: 6px; width: 100%; border-radius: 999px; background: var(--border); overflow: hidden; vertical-align: middle; }
.bar-fill { display: block; height: 100%; background: var(--lime); border-radius: inherit; }

/* The list: one grid for the header and every row so the columns line up. */
.task-list { display: grid; gap: 14px; }
.task-row {
  display: grid; grid-template-columns: minmax(240px, 1fr) 120px 76px 76px 92px 130px; align-items: center; gap: 12px;
  padding: 0 12px; min-height: 40px; border-bottom: 1px solid var(--border); font-size: 13.5px;
}
.task-head { min-height: 30px; font-size: 11.5px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--grey-dim); border-bottom: 0; }
.task-group { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; }
.group-head {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; cursor: pointer; text-align: left;
  font: inherit; color: var(--text); background: none; border: 0; border-bottom: 1px solid var(--border);
}
.group-head[aria-expanded="false"] { border-bottom: 0; }
.group-pill {
  padding: 2px 10px; border-radius: 6px; font-size: 12px; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase;
  color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); border: 1px solid color-mix(in srgb, var(--c) 35%, transparent);
}
.caret { display: inline-block; width: 0; height: 0; border-left: 4.5px solid transparent; border-right: 4.5px solid transparent; border-top: 6px solid var(--grey); transition: transform 0.12s ease; }
[aria-expanded="false"] > .caret { transform: rotate(-90deg); }
.task-group .task-row:hover { background-color: var(--surface-2); }
.task-group .task-row:last-child { border-bottom: 0; }
.task-row.sub .task-name { padding-left: calc(var(--level, 1) * 26px); }
/* A faint line down the left of deeper subtasks, so the levels are easy to follow. */
.task-row.sub { background-image: linear-gradient(var(--border), var(--border)); background-size: 1px 100%; background-repeat: no-repeat; background-position: calc(var(--level) * 26px + 4px) 0; }
.task-row.is-done .task-title { color: var(--grey); text-decoration: line-through; text-decoration-color: var(--grey-dim); }
.task-name { display: flex; align-items: center; gap: 6px; min-width: 0; }
.grip { width: 12px; color: var(--grey-dim); cursor: grab; font-size: 11px; letter-spacing: -2px; opacity: 0; user-select: none; }
.task-row:hover .grip { opacity: 1; }
.caret-btn { display: grid; place-items: center; width: 18px; height: 18px; padding: 0; cursor: pointer; background: none; border: 0; border-radius: 4px; }
.caret-btn:hover { background: var(--border); }
.caret-space { width: 18px; flex: none; }
.dot-btn { display: grid; place-items: center; width: 22px; height: 22px; padding: 0; cursor: pointer; background: none; border: 0; border-radius: 50%; flex: none; }
.dot-btn:hover:not(:disabled) { background: var(--border); }
.dot-btn:disabled { cursor: default; }
.status-dot { display: inline-block; flex: none; width: 13px; height: 13px; border-radius: 50%; border: 2px solid var(--c); }
.status-dot.done { background: var(--c); }
.task-title {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 2px 0; cursor: pointer; text-align: left;
  font: inherit; font-weight: 500; color: var(--text); background: none; border: 0;
}
.task-title:hover { color: var(--accent); }
.sub-count { flex: none; padding: 0 7px; font-size: 11.5px; color: var(--grey); border: 1px solid var(--border); border-radius: 999px; }
.avatars { display: flex; align-items: center; }
.avatars .avatar { margin-left: -5px; box-shadow: 0 0 0 2px var(--surface); }
.avatars .avatar:first-child { margin-left: 0; }
.late { color: var(--error); font-weight: 600; }
.prio { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--c); }
.prio svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
.prio.none::before { content: "—"; color: var(--grey-dim); }
.progress { display: flex; align-items: center; gap: 8px; }
.progress .small { min-width: 34px; text-align: right; }
.quick-add { display: block; padding: 0; }
.quick-add input {
  width: 100%; min-height: 40px; padding: 0 14px 0 50px; font: inherit; font-size: 13.5px; color: var(--text);
  background: transparent; border: 0; outline: none;
}
.quick-add input::placeholder { color: var(--grey-dim); }
.quick-add input:focus { background: var(--input); box-shadow: inset 0 0 0 1px var(--lime-line); }
.task-row.dragging { opacity: 0.4; }
.task-row.drop-before { box-shadow: inset 0 2px 0 var(--lime); }

/* The status menu by a task's status button */
.pop-menu {
  position: absolute; z-index: 50; display: grid; min-width: 170px; padding: 5px;
  background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: var(--r-md); box-shadow: var(--shadow-pop);
}
.pop-menu button {
  display: flex; align-items: center; gap: 10px; padding: 7px 10px; cursor: pointer; text-align: left;
  font: inherit; font-size: 13.5px; color: var(--text); background: none; border: 0; border-radius: 6px;
}
.pop-menu button:hover, .pop-menu button:focus-visible { background: var(--border); outline: none; }
.pop-menu button.current { font-weight: 650; }

/* The task panel: slides in from the right, full height */
dialog.drawer {
  margin: 0 0 0 auto; height: 100vh; max-height: 100vh; width: min(560px, 100vw); padding: 18px 24px 24px; overflow: auto;
  color: var(--text); background: var(--surface); border: 0; border-left: 1px solid var(--border-strong); box-shadow: var(--shadow-pop);
}
dialog.drawer::backdrop { background: var(--scrim); }
@media (prefers-reduced-motion: no-preference) { dialog.drawer[open] { animation: drawer-in 0.16s ease-out; } }
@keyframes drawer-in { from { transform: translateX(40px); opacity: 0; } }
.drawer-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.task-title-input {
  width: 100%; padding: 6px 8px; margin-left: -8px; font: inherit; font-size: 21px; font-weight: 700; letter-spacing: -0.01em;
  color: var(--text); background: transparent; border: 1px solid transparent; border-radius: var(--r-sm);
}
.task-title-input:hover:not(:disabled), .task-title-input:focus { border-color: var(--border-strong); background: var(--input); outline: none; }
.task-title-input:disabled { opacity: 1; }
.task-fields { display: grid; grid-template-columns: 110px 1fr; gap: 10px 14px; align-items: center; margin: 14px 0 18px; }
.task-fields > label, .task-fields > .label-like { margin: 0; font-size: 13px; font-weight: 500; color: var(--grey); align-self: start; padding-top: 7px; }
.task-fields select { width: auto; min-width: 180px; }
.task-fields .field-error:empty { display: none; }
.task-fields > [hidden] { display: none; }
.assignee-picker { display: flex; flex-wrap: wrap; gap: 6px; }
.assignee-option {
  display: inline-flex; align-items: center; gap: 7px; margin: 0; padding: 3px 10px 3px 4px; cursor: pointer; font-size: 13px; font-weight: 500;
  border: 1px solid var(--border); border-radius: 999px;
}
.assignee-option:has(input:checked) { border-color: var(--lime-line); background: var(--lime-soft); }
.assignee-option input { position: absolute; opacity: 0; pointer-events: none; }
.assignee-option:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.assignee-option:has(input:disabled) { cursor: default; }
.assignee-option:has(input:disabled):not(:has(input:checked)) { display: none; }
.percent-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.percent-row input[type=range] { width: 200px; accent-color: var(--accent); }
.form-section-label { font-size: 13px; color: var(--grey); }
.subtask-list { display: grid; gap: 2px; }
.subtask {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; cursor: pointer; text-align: left;
  font: inherit; font-size: 13.5px; color: var(--text); background: var(--input); border: 1px solid var(--border); border-radius: var(--r-sm);
}
.subtask:hover { border-color: var(--border-strong); }
.subtask > span:nth-child(2) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.struck { text-decoration: line-through; color: var(--grey); }
.subtask-add { margin-top: 8px; }
#task-meta { margin-top: 18px; }

/* Team window */
.team-list { display: grid; gap: 4px; margin-top: 8px; }
.team-row { display: grid; grid-template-columns: 1fr 200px auto; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); }
.team-who { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.team-add { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.team-add select { width: auto; min-width: 180px; }
dialog.modal h3.team-group { display: flex; align-items: baseline; gap: 8px; }
dialog.modal h3.team-group.first { margin-top: 4px; padding-top: 0; border-top: 0; }
.team-add input { flex: 1; min-width: 200px; }
fieldset.new-contact { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.new-contact legend { padding: 0; margin-bottom: 4px; }
.team-who .team-sub { display: block; }
.team-row input { min-width: 0; }
@media (max-width: 560px) { fieldset.new-contact { grid-template-columns: 1fr; } }

/* Dropdowns in the workspace look like the other pages' toolbar dropdowns. */
.ws-bar select, .task-fields select, .team-add select, .team-row select, .team-add input, .team-row input, .new-contact input {
  padding: 8px 10px; font: inherit; color: var(--text);
  background: var(--input); border: 1px solid var(--border); border-radius: var(--r-sm);
}
.task-fields select:disabled { opacity: 0.7; }
/* The list fits its space (not the window, since the menu takes some): fewer columns when narrow. */
.task-list { container-type: inline-size; }
@container (max-width: 840px) {
  .task-row { grid-template-columns: minmax(200px, 1fr) 96px 70px 84px 110px; }
  .task-row > :nth-child(3) { display: none; } /* start */
}
@container (max-width: 620px) {
  .task-row { grid-template-columns: minmax(0, 1fr) 80px 64px; }
  .task-row > :nth-child(3), .task-row > :nth-child(5), .task-row > :nth-child(6) { display: none; }
}
@media (max-width: 900px) {
  .ws-bar .btn { margin-left: 0; }
  .team-row { grid-template-columns: 1fr; }
}
/* Team members (not administrators) on the Projects page: no money, no adding, no history. */
body.not-admin .admin-only { display: none !important; }
.roles-list .team-row { grid-template-columns: 1fr auto; }
.roles-list .team-who input { flex: 1; min-width: 180px; }
.budget-form { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 12px; }
#area-general .card, #area-money .card { margin-bottom: 16px; }
.value-progress { display: grid; gap: 6px; margin: 4px 0 14px; font-size: 13.5px; }
/* Project › Money (Chad 2026-11-22): five tiles in one row on a wide screen, the bar and chart under them,
   and the two settings cards (total value, budget) side by side at the bottom. */
#area-money .money-tiles { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
#area-money .money-tiles .stat-value { font-size: 20px; white-space: nowrap; overflow-wrap: normal; }
.stat.has-icon .stat-sub { grid-column: 1 / -1; }
#area-money #m-value-progress { margin: 16px 0 0; }
#area-money .chart-head { margin-top: 20px; }
#area-money #m-hint[hidden] { display: none; }
.money-settings { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; align-items: start; }
.money-settings > .card { margin: 0; }
.value-progress:empty { display: none; }
.value-progress .bar { height: 10px; }
.value-progress .bar-fill.over { background: var(--warn); }
#area-money tr.total-row td { font-weight: 650; border-top: 2px solid var(--border-strong); background: none; }
#area-money td:last-child, #area-money th:last-child { text-align: right; }
/* Financials boxes: wide enough for "TTD 1,234,567.89" on one line; extra currencies stack underneath. */
#m-stats { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
#m-stats .stat-value { font-size: 19px; white-space: nowrap; }
/* Per-currency amounts under a status box (e.g. Outstanding: TTD …, USD …): one per line, the rule above the first only. */
.stat-sub { display: block; margin: 6px 0 0; padding-top: 6px; font-size: 12.5px; font-weight: 600; color: var(--text); border-top: 1px dashed var(--border); }
.stat-button .stat-sub { white-space: nowrap; font-variant-numeric: tabular-nums; }
.stat-button .stat-sub + .stat-sub { margin-top: 2px; padding-top: 0; border-top: 0; }

/* ---------- Work plan: Gantt chart and calendar (project-views.js) ---------- */
.view-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 12px; }
.ws-views.small button { padding: 3px 11px; font-size: 12.5px; }

/* Gantt: names on the left, a timeline that scrolls sideways on the right. Rows are 38px on both sides. */
.gantt { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; }
.g-wrap { display: grid; grid-template-columns: minmax(200px, 300px) minmax(0, 1fr); }
.g-left { border-right: 1px solid var(--border-strong); min-width: 0; }
.g-head { position: relative; height: 54px; border-bottom: 1px solid var(--border); }
.g-corner { display: flex; align-items: flex-end; padding: 0 12px 8px; font-size: 11.5px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--grey-dim); }
.g-name { display: flex; align-items: center; gap: 6px; height: 38px; padding-right: 10px; border-bottom: 1px solid var(--border); font-size: 13.5px; min-width: 0; }
.g-name .task-title { flex: 1; }
.g-nodates { flex: none; }
.g-right { overflow-x: auto; overflow-y: hidden; }
.g-canvas { position: relative; }
.g-months { position: absolute; inset: 0 0 auto 0; height: 28px; }
.g-month {
  position: absolute; top: 0; height: 28px; padding: 6px 8px 0; overflow: hidden; white-space: nowrap;
  font-size: 12.5px; font-weight: 650; border-left: 1px solid var(--border);
}
.g-ticks { position: absolute; inset: 28px 0 0 0; }
.g-tick { position: absolute; top: 0; height: 26px; padding-top: 4px; text-align: center; font-size: 11.5px; color: var(--grey); white-space: nowrap; overflow: hidden; }
.g-tick.today { color: var(--accent); font-weight: 700; }
.g-body { position: relative; }
.g-weekend { position: absolute; top: 0; bottom: 0; background: var(--weekend); }
.g-monthline { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--border); }
.g-todayline { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--lime); opacity: 0.7; z-index: 3; }
.g-row { position: absolute; left: 0; right: 0; height: 38px; border-bottom: 1px solid var(--border); }
.g-row.g-empty { cursor: copy; }
.g-row.g-empty:hover { background: var(--lime-soft); }
.g-bar {
  position: absolute; top: 10px; height: 22px; z-index: 2; cursor: pointer; overflow: visible; touch-action: none; user-select: none;
  background: color-mix(in srgb, var(--c) 28%, var(--surface-2)); border: 1px solid color-mix(in srgb, var(--c) 70%, transparent); border-radius: 6px;
}
.g-bar:hover, .g-bar:focus-visible { border-color: var(--c); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 25%, transparent); outline: none; }
.g-bar.late { border-color: var(--error); }
.g-bar.dragging { cursor: grabbing; opacity: 0.85; z-index: 5; }
.g-fill { position: absolute; inset: 0 auto 0 0; background: color-mix(in srgb, var(--c) 60%, transparent); border-radius: 5px 0 0 5px; pointer-events: none; }
.g-label {
  position: relative; display: block; padding: 2px 8px; font-size: 12px; font-weight: 600; line-height: 16px; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none;
}
.g-bar.label-out .g-label, .g-milestone .g-label { position: absolute; left: 100%; top: 0; overflow: visible; color: var(--grey); font-weight: 500; }
.g-milestone .g-label { left: 14px; top: -1px; }
.g-handle { position: absolute; top: -1px; bottom: -1px; width: 8px; cursor: ew-resize; z-index: 3; }
.g-handle.start { left: -3px; }
.g-handle.end { right: -3px; }
.g-milestone {
  position: absolute; top: 13px; width: 14px; height: 14px; margin-left: -7px; z-index: 2; cursor: pointer; touch-action: none;
  background: var(--c); transform: rotate(45deg); border-radius: 2px;
}
.g-milestone .g-label { transform: rotate(-45deg); transform-origin: left top; }
.g-milestone.late { box-shadow: 0 0 0 2px var(--error); }

/* Calendar: a month of weeks; each week's tasks are bars from start to due, packed into lanes. */
.cal-title { margin: 0 6px; font-size: 17px; }
.cal { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; }
.cal-names, .cal-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-names span { padding: 8px 10px; font-size: 11.5px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--grey-dim); border-bottom: 1px solid var(--border); }
.cal-week { min-height: 112px; row-gap: 3px; border-bottom: 1px solid var(--border); }
.cal-week:last-child { border-bottom: 0; }
.cal-day { padding: 6px 8px; border-right: 1px solid var(--border); }
.cal-day:nth-child(7) { border-right: 0; }
.cal-day.weekend { background: var(--weekend); }
.cal-day.other .cal-num { color: var(--grey-dim); opacity: 0.6; }
.cal-day.drop { background: var(--lime-soft); box-shadow: inset 0 0 0 1px var(--lime-line); }
.cal-num { font-size: 12.5px; font-weight: 600; color: var(--grey); }
.cal-day.today .cal-num { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 5px; color: var(--black); background: var(--lime); border-radius: 999px; }
.cal-bar {
  z-index: 1; margin: 0 4px; min-width: 0; padding: 0 8px; cursor: pointer; text-align: left;
  font: inherit; font-size: 12px; font-weight: 600; color: var(--text);
  background: color-mix(in srgb, var(--c) 26%, var(--surface-2)); border: 1px solid color-mix(in srgb, var(--c) 65%, transparent);
  border-left: 3px solid var(--c); border-radius: 6px;
}
.cal-bar:hover { border-color: var(--c); }
.cal-bar.cont-left { margin-left: 0; border-top-left-radius: 0; border-bottom-left-radius: 0; border-left-width: 1px; }
.cal-bar.cont-right { margin-right: 0; border-top-right-radius: 0; border-bottom-right-radius: 0; }
.cal-bar.done .cal-bar-text { text-decoration: line-through; color: var(--grey); }
.cal-bar.late { border-color: var(--error); }
.cal-bar-text { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.cal.dragging .cal-bar { pointer-events: none; }
.cal-undated { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.cal-chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 4px 10px; cursor: pointer; font: inherit; font-size: 12.5px; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-radius: 999px;
}
.cal-chip:hover { border-color: var(--border-strong); }
@media (max-width: 700px) { .g-wrap { grid-template-columns: 150px minmax(0, 1fr); } .cal-bar { font-size: 11px; padding: 0 4px; } }
.small-select {
  padding: 5px 8px; font: inherit; font-size: 12.5px; color: var(--text);
  background: var(--input); border: 1px solid var(--border); border-radius: var(--r-sm);
}
/* Week labels sit at the start of their week, with a line down from there. */
.g-tick.week { text-align: center; border-left: 1px solid var(--border); }
.g-tick.weekend { color: var(--grey-dim); }
.g-weekline { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--border); }
/* A task whose dates come from its subtasks: striped, not draggable. */
.g-summary {
  cursor: pointer;
  background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--c) 30%, var(--surface-2)) 0 6px, color-mix(in srgb, var(--c) 16%, var(--surface-2)) 6px 12px);
  border-style: dashed;
}
/* "Shaded: weekends" key beside the Gantt and calendar tools */
.legend { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--grey); }
.legend-swatch { width: 14px; height: 14px; border-radius: 3px; background: var(--surface-2); border: 1px solid var(--border-strong); }

/* ---------- Backlog (project-backlog.js) ---------- */
.b-row { grid-template-columns: minmax(280px, 1fr) 96px 110px 130px 70px; }
.b-code { flex: none; font-size: 12px; font-weight: 600; color: var(--grey); font-variant-numeric: tabular-nums; min-width: 38px; }
.b-type { flex: none; font-size: 11px; padding: 1px 8px; }
.b-task { flex: none; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; color: var(--grey); }
.b-raised { overflow: hidden; text-overflow: ellipsis; }
.backlog-list .quick-add input { padding-left: 40px; }
/* Project issues (project-issues.js): Issue | Impact | Owner | Due | Updated, like the backlog's rows */
.i-row { grid-template-columns: minmax(260px, 1fr) 96px 170px 84px 96px 70px; }
.i-who { display: grid; gap: 2px; min-width: 0; }
.i-client { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip-btn { background: none; border: 0; padding: 0; font: inherit; cursor: pointer; border-radius: 999px; }
.chip-btn:focus-visible { outline: none; box-shadow: var(--ring); }
.issue-list .quick-add input { padding-left: 40px; }
.i-row .late { color: var(--error); font-weight: 600; }
@media (max-width: 900px) { .i-row { grid-template-columns: minmax(200px, 1fr) 90px 84px 96px; } .i-row > :nth-child(3), .i-row > :nth-child(6) { display: none; } }
@media (max-width: 600px) { .i-row { grid-template-columns: minmax(0, 1fr) 80px; } .i-row > :nth-child(n+3) { display: none; } }
.b-task-select { max-width: 100%; }
.area-count {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; font-size: 11.5px; font-weight: 700;
  color: var(--black); background: var(--lime); border-radius: 999px;
}
@container (max-width: 840px) {
  .b-row { grid-template-columns: minmax(200px, 1fr) 90px 96px 70px; }
  .b-row > :nth-child(4) { display: none; }
  .task-row.b-row > :nth-child(3) { display: flex; } /* the work plan hides its 3rd column here; the backlog's is "Assigned" */
}
@container (max-width: 620px) {
  .b-row { grid-template-columns: minmax(0, 1fr) 80px; }
  .task-row.b-row > :nth-child(3), .b-row > :nth-child(4), .b-row > :nth-child(5) { display: none; }
  .b-task { display: none; }
}

/* Status history: a small clock after "last changed", opening a short list underneath */
.history-btn {
  display: inline-grid; place-items: center; width: 22px; height: 22px; margin-left: 6px; padding: 0; vertical-align: middle; cursor: pointer;
  color: var(--grey); background: none; border: 1px solid var(--border); border-radius: 50%;
}
.history-btn:hover, .history-btn[aria-expanded="true"] { color: var(--accent); border-color: var(--lime-line); }
.history-btn svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.history-pop {
  margin-top: 8px; padding: 8px 10px; max-height: 220px; overflow-y: auto; font-size: 12.5px; color: var(--grey);
  background: var(--input); border: 1px solid var(--border); border-radius: var(--r-md);
}
/* A task's history in a project (project.js): when, what, who in columns. */
.history-pop .history-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.history-pop .history-list li { display: grid; grid-template-columns: 150px 1fr auto; gap: 10px; align-items: baseline; }
.history-what { color: var(--text); font-weight: 600; }
.history-who { text-align: right; }
@media (max-width: 520px) { .history-pop .history-list li { grid-template-columns: 1fr; gap: 0; } .history-who { text-align: left; } }

/* ---------- Information kit (project-kit.js) ---------- */
.k-row { grid-template-columns: minmax(240px, 1fr) 130px 76px 84px 84px 76px; }
.k-from { overflow: hidden; text-overflow: ellipsis; }
.kit-list .quick-add input { padding-left: 40px; }
.status-dot.half { background: linear-gradient(90deg, var(--c) 50%, transparent 50%); }
@container (max-width: 840px) {
  .k-row { grid-template-columns: minmax(200px, 1fr) 110px 80px 76px 70px; }
}
@container (max-width: 620px) {
  .k-row { grid-template-columns: minmax(0, 1fr) 70px; }
  .k-row > :nth-child(2) { display: none; }
}

/* "Export to Excel" buttons */
a.btn.export-btn { display: inline-flex; align-items: center; gap: 7px; text-decoration: none; }
.export-btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ws-bar .export-btn + .btn { margin-left: 0; }
#area-money .card-head .export-btn { margin-left: auto; }

/* Export window: pick and order the columns */
dialog.modal.export-modal { width: min(520px, calc(100vw - 32px)); }
.export-options { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; margin: 4px 0 14px; }
.export-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin: 6px 0 6px; font-size: 13px; font-weight: 600; color: var(--grey); }
.link-btn { padding: 0; font: inherit; font-weight: 500; color: var(--accent); background: none; border: 0; cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
.export-cols { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; max-height: 50vh; overflow-y: auto; }
.export-col {
  display: grid; grid-template-columns: 16px 1fr auto auto; align-items: center; gap: 8px; padding: 6px 8px;
  background: var(--input); border: 1px solid var(--border); border-radius: var(--r-sm); cursor: grab;
}
.export-col .grip { opacity: 1; }
.export-col label.check { margin: 0; font-weight: 500; }
.export-col.off label { color: var(--grey-dim); }
.export-col.dragging { opacity: 0.4; }
.export-col.drop-before { box-shadow: inset 0 2px 0 var(--lime); }
.arrow-btn { width: 26px; height: 24px; padding: 0; cursor: pointer; color: var(--grey); background: none; border: 1px solid var(--border); border-radius: 6px; font: inherit; }
.arrow-btn:hover:not(:disabled) { color: var(--text); border-color: var(--border-strong); }
.arrow-btn:disabled { opacity: 0.3; cursor: default; }

.view-tools .gantt-export { margin-left: auto; }

/* Finance › Disbursement requests */
.request-note { margin: 12px 0 0; padding: 10px 12px; border-radius: var(--r-sm); border: 1px solid var(--border); background: var(--input); font-size: 14px; white-space: pre-line; }
.request-note.bad { border-color: var(--error-line); background: var(--error-soft); }
.request-note.good { border-color: var(--lime-line); background: var(--lime-soft); }
.request-note strong { display: block; margin-bottom: 2px; font-size: 13px; }
.title-with-chip { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.decide-box { margin-top: 14px; }
.decide-box[hidden] { display: none; }
.history-list { list-style: none; margin: 8px 0 0; padding: 0; font-size: 13px; }
.history-list li { padding: 6px 0; border-top: 1px solid var(--border); }
.history-list .muted { display: block; font-size: 12px; }
.history-list .change-reason { display: block; margin-top: 2px; color: var(--text); font-style: italic; }
/* Finance entries may carry a reason on a second line ("…\nReason: …"). */
[data-history] td:last-child { white-space: pre-line; }
.plain-list { list-style: none; margin: 0; padding: 0; }
.plain-list li + li { margin-top: 4px; }
.attachments { margin-top: 16px; }
.attachments-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.attachments-head .form-section { margin: 0; }
.file-list { list-style: none; margin: 8px 0 0; padding: 0; }
.file-list li { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-top: 1px solid var(--border); font-size: 14px; }
.file-list li:first-child { border-top: 0; }
.file-list .file-name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.file-list a.file-name { color: var(--accent); text-decoration: none; }
.file-list a.file-name:hover { text-decoration: underline; }
.file-list .file-meta { color: var(--grey); font-size: 12px; white-space: nowrap; }
.file-list .file-problem { color: var(--error); font-size: 12px; }
.file-list .empty { color: var(--grey); }
.file-input { font: inherit; font-size: 14px; color: var(--grey); }
.attachments[hidden], .attachments-head .btn[hidden] { display: none; }
.file-input::file-selector-button {
  font: inherit; font-size: 13px; font-weight: 600; margin-right: 10px; padding: 6px 12px; cursor: pointer;
  color: var(--text); background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: var(--r-sm);
}
.file-input::file-selector-button:hover { border-color: var(--accent); }
.preview-modal { width: min(1100px, 94vw); max-width: none; height: 90vh; display: none; flex-direction: column; }
.preview-modal[open] { display: flex; }
.preview-modal .card-head { gap: 12px; }
.preview-modal #file-preview-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 16px; }
.preview-tools { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.preview-tools .modal-close { margin-left: 0; }
.preview-body { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; background: var(--input); border: 1px solid var(--border); border-radius: var(--r-md); overflow: auto; }
.preview-body iframe { width: 100%; height: 100%; border: 0; background: #fff; border-radius: var(--r-md); }
.preview-body img { max-width: 100%; max-height: 100%; object-fit: contain; }
.file-list .file-download { color: var(--grey); font-size: 12px; text-decoration: none; }
.file-list .file-download:hover { color: var(--text); text-decoration: underline; }
.request-note-link { display: block; margin-top: 6px; color: var(--accent); font-weight: 600; text-decoration: none; }
.request-note-link:hover { text-decoration: underline; }
.from-request { margin: 12px 0 14px; padding: 10px 12px; border: 1px solid var(--lime-line); background: var(--lime-soft); border-radius: var(--r-sm); font-size: 14px; }
.from-request[hidden] { display: none; }
.from-request-head { margin: 0; display: flex; gap: 10px; flex-wrap: wrap; align-items: baseline; }
.from-request-head a { color: var(--accent); font-size: 13px; text-decoration: none; }
.from-request-head a:hover { text-decoration: underline; }
.from-request-reason { margin: 4px 0 0; color: var(--grey); white-space: pre-line; }
.from-request .file-list { margin-top: 6px; }

/* Finance › Invoicing */
[data-panel][hidden] { display: none; }
.instruction { padding: 12px 0; border-top: 1px solid var(--border); }
.instruction:first-child { border-top: 0; padding-top: 4px; }
.instruction-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.instruction-head .chip, .instruction-head .status-chip { flex-shrink: 0; }
.instruction-opts { display: flex; gap: 18px; align-items: flex-end; padding-bottom: 10px; }
textarea.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }
#terms input.wide, #new-term-name { max-width: 240px; }
#new-term-days { max-width: 90px; }

/* Invoice editor */
.invoice-modal { width: min(1100px, 96vw); max-width: none; }
.inv-lines { min-width: 720px; }
.inv-lines td { vertical-align: top; }
.inv-lines textarea { width: 100%; min-width: 260px; resize: vertical; }
.inv-lines input[type=number] { width: 100px; text-align: right; }
.inv-lines td.inv-amount { padding-top: 14px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.inv-lines .cell-note { margin-top: 4px; }
.inv-line-actions { margin-top: 8px; }
.license-picker { margin-top: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--input); }
.license-picker[hidden] { display: none; }
.license-picker li { padding: 4px 0; }
.license-picker .muted { font-size: 12px; }
.inv-bottom { display: grid; grid-template-columns: 1fr minmax(280px, 360px); gap: 24px; margin-top: 18px; align-items: start; }
@media (max-width: 800px) { .inv-bottom { grid-template-columns: 1fr; } }
.inv-totals { padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--input); font-variant-numeric: tabular-nums; }
.inv-total-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 5px 0; }
.inv-discount-pick { display: flex; gap: 6px; align-items: center; }
.inv-discount-pick select, .inv-discount-pick input { padding: 4px 6px; font: inherit; font-size: 13px; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-sm); }
.inv-discount-pick input { width: 90px; }
.inv-discount-pick input[hidden] { display: none; }
.inv-grand { margin-top: 6px; padding-top: 10px; border-top: 1px solid var(--border-strong); font-weight: 700; }
.inv-lines textarea, .inv-lines select, .inv-lines input[type=number] { padding: 6px 8px; font: inherit; font-size: 14px; color: var(--text); background: var(--input); border: 1px solid var(--border); border-radius: var(--r-sm); }
.inv-lines textarea:focus, .inv-lines select:focus, .inv-lines input:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }

/* Invoices: list + preview (split view) */
.inv-view-switch, .qt-view-switch, .cn-view-switch { margin-left: auto; }
.inv-split { display: grid; grid-template-columns: minmax(260px, 340px) 1fr; gap: 14px; margin-top: 12px; height: calc(100vh - 260px); min-height: 520px; }
.inv-split[hidden], #inv-table-view[hidden], #qt-table-view[hidden], #cn-table-view[hidden] { display: none; }
.inv-split-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--r-md); }
.inv-split-list:focus { outline: none; box-shadow: var(--ring); }
.inv-split-list li { padding: 10px 12px; border-bottom: 1px solid var(--border); cursor: pointer; }
.inv-split-list li:hover { background: var(--lime-wash); }
.inv-split-list li.picked { background: var(--lime-soft); box-shadow: inset 3px 0 0 var(--accent); }
.inv-split-list .row1, .inv-split-list .row2 { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.inv-split-list .who { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inv-split-list .amt { font-variant-numeric: tabular-nums; white-space: nowrap; }
.inv-split-list .row2 { margin-top: 3px; font-size: 12px; color: var(--grey); }
.inv-split-list .row2 .late { font-weight: 600; }
.inv-split-list .empty { cursor: default; color: var(--grey); }
.inv-pane { display: flex; flex-direction: column; min-width: 0; border: 1px solid var(--border); border-radius: var(--r-md); padding: 12px; background: var(--input); }
.inv-pane-empty { margin: auto; }
.inv-pane-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.inv-pane-head[hidden], .inv-pane-pdf[hidden] { display: none; }
.inv-pane-head h3 { margin: 0; }
.inv-pane-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.inv-pane-actions [hidden] { display: none; }
#pane-status { margin: 6px 0 0; min-height: 0; }
.inv-pane-pdf { flex: 1; width: 100%; margin-top: 10px; border: 0; border-radius: var(--r-sm); background: #fff; }
@media (max-width: 900px) { .inv-view-switch, .qt-view-switch, .cn-view-switch, .po-view-switch { display: none; } }

/* Receipts: applied to invoices */
#invoice-split[hidden] { display: none; }
.invoice-split input[type=number] { width: 130px; text-align: right; padding: 6px 8px; font: inherit; font-size: 14px; color: var(--text); background: var(--input); border: 1px solid var(--border); border-radius: var(--r-sm); }
.invoice-split input[type=number]:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
.invoice-split td { vertical-align: middle; }
.paid-red { color: var(--error); }
#inv-paid-row[hidden], #inv-balance-row[hidden], .inv-payments[hidden], .inv-credits[hidden] { display: none; }
.inv-payments { margin-top: 18px; }
.inv-credit-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 4px 0; }
.inv-credit-row input { width: 120px; padding: 4px 6px; font: inherit; font-size: 13px; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-sm); text-align: right; }

/* ---------- My week (weekly plans): a timesheet-style grid ---------- */
.week-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.week-head .day-pick { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.week-head h2 { margin: 0; min-width: 170px; text-align: center; font-size: 18px; }
.week-head input[type=date] { width: auto; }
.week-state { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.week-flags { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.week-flags:empty { display: none; }
.week-flags li { padding: 7px 12px; border-radius: var(--r-sm); font-size: 13px; border: 1px solid var(--border); background: var(--input); color: var(--grey); }
.week-flags li.warn { color: var(--warn); background: var(--warn-soft); border-color: var(--warn-line); }
.week-flags li.bad { color: var(--error); background: var(--error-soft); border-color: var(--error-line); }
.week-grid { width: 100%; border-collapse: collapse; min-width: 980px; }
.week-grid th, .week-grid td { padding: 6px 6px; border-bottom: 1px solid var(--border); vertical-align: top; }
.week-grid th { font-size: 12px; font-weight: 600; color: var(--grey); text-align: left; }
.week-grid th.col-day { text-align: center; }
.week-grid th.col-day span { display: block; line-height: 1.25; }
.week-grid .col-target { width: 250px; }
.week-grid .col-day { width: 62px; text-align: center; }
.week-grid .col-total { width: 64px; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.week-grid .col-x { width: 28px; text-align: center; }
.week-grid .weekend { background: var(--weekend); }
.week-grid th.today { color: var(--accent); }
.week-grid td.today { box-shadow: inset 0 0 0 9999px var(--lime-wash); }
.week-grid select.week-target { width: 100%; }
.week-grid textarea.week-task { width: 100%; min-height: 36px; resize: none; overflow: hidden; line-height: 1.35; }
.week-grid .week-task-text { white-space: pre-wrap; }
.week-grid input.week-hours { width: 56px; text-align: center; padding-left: 4px; padding-right: 4px; -moz-appearance: textfield; }
.week-grid input.week-hours::-webkit-outer-spin-button, .week-grid input.week-hours::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.week-grid td.bad-cell input { border-color: var(--error); }
.week-grid.editing tbody td.line-total { padding-top: 14px; }
.week-grid tfoot td { font-weight: 600; font-variant-numeric: tabular-nums; border-bottom: 0; padding-top: 10px; }
.week-grid tfoot td.col-day { text-align: center; }
.week-grid tfoot .day-total { color: var(--accent); }
.week-grid tfoot .day-total.short { color: var(--error); }
.week-grid tfoot .week-planned td { color: var(--grey); font-weight: 400; font-size: 13px; padding-top: 2px; }
.week-grid tfoot .week-planned td.differs { color: var(--warn); }
.week-grid .week-empty { padding: 18px 6px; }
.week-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 14px; }
.week-actions .spacer { flex: 1; }

/* Quote "valid until": a period (1/3/6 months from the quote date) or a date typed in. */
.valid-for { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.valid-for input[hidden] { display: none; }
.week-grid select.week-target, .week-grid textarea.week-task, .week-head input[type=date] {
  padding: 8px 10px; font: inherit; font-size: 13.5px; color: var(--text);
  background: var(--input); border: 1px solid var(--border); border-radius: var(--r-sm);
}
.week-grid select.week-target:focus, .week-grid textarea.week-task:focus, .week-head input[type=date]:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
.week-grid select.week-target { height: 38px; }
.week-head input[type=date] { padding: 4px 8px; font-size: 13px; }
.week-grid .col-task { min-width: 280px; }
.week-grid td.col-day, .week-grid th.col-day { text-align: center; }
.week-grid .col-target { min-width: 240px; }
.week-grid .col-target { min-width: 190px; width: 200px; }
.week-grid .col-project { min-width: 210px; width: 230px; }
.week-grid select.week-target:disabled { opacity: 0.5; }
.week-grid { min-width: 1180px; }

/* ---------- Weekly plans (review): status boxes that filter, one row per person ---------- */
.review-stats { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
button.stat-btn { text-align: left; font: inherit; color: inherit; cursor: pointer; }
button.stat-btn:hover { border-color: var(--border-strong); }
button.stat-btn.active { border-color: var(--accent); box-shadow: var(--ring); }
button.stat-btn .stat-value { color: var(--text); }
button.stat-btn.bad .stat-value { color: var(--error); }
button.stat-btn.warn .stat-value { color: var(--warn); }
.review-grid { min-width: 1080px; margin-top: 4px; }
.review-grid .col-person { min-width: 180px; }
.review-grid .col-person .cell-note { margin-top: 2px; }
.review-grid .col-status { min-width: 170px; }
.review-grid .col-status .status-chip { margin: 0 4px 4px 0; }
.review-grid .col-changes { min-width: 130px; color: var(--grey); font-size: 13px; }
.review-grid tbody td.col-day { color: var(--text); font-variant-numeric: tabular-nums; }
.review-grid tbody td.col-day.short { color: var(--error); font-weight: 600; }
.review-grid tr.click-row { cursor: pointer; }
.review-grid tr.click-row:hover td, .review-grid tr.click-row:focus-visible td { background: var(--surface-2); }
.week-grid td.differs, .review-grid td.col-changes.differs { color: var(--warn); }
.week-grid tr.dropped td { color: var(--grey-dim); text-decoration: line-through; }
.week-grid tr.dropped td .status-chip { text-decoration: none; }
#person-box .week-grid { min-width: 940px; }
dialog.modal#person-box { width: min(1240px, calc(100vw - 32px)); }
/* Chargeable hours split (Weekly plans) */
.charge-table { width: 100%; border-collapse: collapse; }
.charge-table th, .charge-table td { padding: 8px 6px; border-bottom: 1px solid var(--border); text-align: left; font-variant-numeric: tabular-nums; }
.charge-table th { font-size: 12px; color: var(--grey); font-weight: 600; }
.charge-table tfoot td { font-weight: 700; border-bottom: 0; }
.charge-table .charge-bar-col { width: 40%; min-width: 160px; }
.charge-bar { display: flex; height: 12px; border-radius: 999px; overflow: hidden; background: var(--input); min-width: 4px; }
.charge-bar .charge-yes { background: var(--lime); }
.charge-bar .charge-no { background: var(--grey-dim); }
#person-charge { margin: 10px 0 0; }
.charge-table th.num, .charge-table td.num { text-align: right; }
/* Hours from weekly plans (project Hours tab, client page) */
.hours-section h3 { margin: 22px 0 6px; font-size: 15px; }
.hours-table { width: 100%; border-collapse: collapse; }
.hours-table th, .hours-table td { padding: 7px 6px; border-bottom: 1px solid var(--border); text-align: left; font-variant-numeric: tabular-nums; vertical-align: top; }
.hours-table th { font-size: 12px; color: var(--grey); font-weight: 600; }
.hours-table th.num, .hours-table td.num { text-align: right; white-space: nowrap; }
#hours-box .export-btn, #client-hours-box .export-btn { margin-left: auto; }
.week-head .export-pick { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.week-head .export-pick select { width: auto; padding: 6px 8px; font: inherit; font-size: 13px; color: var(--text); background: var(--input); border: 1px solid var(--border); border-radius: var(--r-sm); }

/* Credit notes: the refund form inside the editor. */
.cn-refund-form { margin-top: 8px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--input); }
.cn-refund-form[hidden] { display: none; }
.valid-for[hidden] { display: none; }
/* My week fits the card without scrolling sideways on a laptop screen (Chad 2026-11-13): fixed layout, the task
   column takes what's left, narrower day boxes. Only below ~900px of card does it scroll. */
#grid.week-grid { min-width: 860px; table-layout: fixed; }
#grid.week-grid th, #grid.week-grid td { padding: 6px 3px; }
#grid.week-grid .col-target { width: 16%; min-width: 0; }
#grid.week-grid .col-project { width: 19%; min-width: 0; }
#grid.week-grid .col-task { width: auto; min-width: 0; }
#grid.week-grid .col-day { width: 46px; }
#grid.week-grid .col-total { width: 46px; padding-right: 4px; }
#grid.week-grid .col-x { width: 26px; }
#grid.week-grid input.week-hours { width: 100%; max-width: 42px; padding-left: 2px; padding-right: 2px; }
#grid.week-grid select.week-target { padding-left: 6px; padding-right: 4px; text-overflow: ellipsis; }
#grid.week-grid textarea.week-task { padding-left: 8px; padding-right: 8px; }
#grid.week-grid td.col-target, #grid.week-grid td.col-project { overflow-wrap: anywhere; }
/* Move handle + copy button at the left of each line (my-week.js lineTools). */
#grid.week-grid .col-move { width: 44px; white-space: nowrap; padding-left: 0; padding-right: 0; }
#grid.week-grid td.col-move { padding-top: 9px; }
.week-grip, .week-copy { background: none; border: 0; color: var(--grey); padding: 2px 3px; font-size: 15px; line-height: 1; border-radius: var(--r-sm); }
.week-grip { cursor: grab; }
.week-copy { cursor: pointer; }
.week-grip:hover, .week-copy:hover { color: var(--text); }
.week-grip:focus-visible, .week-copy:focus-visible { outline: none; box-shadow: var(--ring); color: var(--text); }
#grid.week-grid tr.dragging { opacity: 0.45; }
#grid.week-grid tr.drop-before td { box-shadow: inset 0 2px 0 var(--accent); }
#grid.week-grid tr.drop-after td { box-shadow: inset 0 -2px 0 var(--accent); }

/* ---------- Client statements (Invoicing › Statements, statements.js) ---------- */
.st-form { margin-top: 8px; }
.st-date-pair { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
#st-download[aria-disabled="true"] { opacity: 0.5; pointer-events: none; }
.st-summary { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.st-summary:empty { display: none; }
.st-sum { padding: 10px 14px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-md); min-width: 200px; }
.st-sum .stat-label { display: block; font-size: 12px; color: var(--grey); }
.st-sum strong { font-size: 18px; }
.st-sum .small { display: block; margin-top: 2px; }
.st-preview { width: 100%; height: 75vh; min-height: 480px; margin-top: 14px; border: 1px solid var(--border); border-radius: var(--r-md); background: #fff; }

/* Buttons kept together at the right of a card's heading (e.g. a client's Statement and Edit details). */
.card-head .head-buttons { display: flex; gap: 8px; margin-left: auto; flex-wrap: wrap; }

/* ---------- Strategy › Goals: a team's goals matrix (goals.html) ---------- */
body:not(.goals-editor) .editor-only { display: none !important; }
.goals-toolbar { margin-top: 0; }
.goals-toolbar .year-switch { display: flex; align-items: center; gap: 4px; }
.goals-toolbar .goals-actions { display: flex; gap: 8px; margin-left: auto; flex-wrap: wrap; }
.goals-toolbar .goals-actions .btn { margin-left: 0; }
.goal-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; font-size: 13px; color: var(--grey); margin: 10px 0 14px; }
.goal-legend span { display: inline-flex; align-items: center; gap: 6px; }
.goal-legend .dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; border: 1px solid var(--border-strong); }
.dot.done { background: var(--lime); border-color: var(--accent); }
.dot.overdue { background: var(--error); border-color: var(--error); }
.dot.soon { background: var(--warn); border-color: var(--warn); }
.dot.later { background: var(--surface-2); }
.goals-empty { padding: 28px 8px; text-align: center; color: var(--grey); }
.goals-empty .actions { justify-content: center; margin-top: 14px; }

/* The grid scrolls inside the card; the goal column and the people's names stay in view. */
.goals-scroll { overflow: auto; max-height: calc(100vh - 250px); min-height: 200px; border: 1px solid var(--border); border-radius: var(--r-md); }
table.goals-matrix { border-collapse: separate; border-spacing: 0; width: max-content; min-width: 100%; font-size: 14px; }
.goals-matrix th, .goals-matrix td { border-bottom: 1px solid var(--border); padding: 0; background: var(--surface); }
.goals-matrix tbody th { text-transform: none; letter-spacing: normal; color: var(--text); font-size: 14px; }
.goals-matrix thead .person-col { text-transform: none; letter-spacing: normal; color: var(--text); }
.goals-matrix thead th { position: sticky; top: 0; z-index: 3; background: var(--surface-2); vertical-align: bottom; padding: 10px 8px; font-size: 13px; }
.goals-matrix thead th.goal-col { left: 0; z-index: 4; text-align: left; }
.goals-matrix .goal-col { position: sticky; left: 0; z-index: 2; min-width: 280px; max-width: 380px; width: 340px; text-align: left; font-weight: 400;
  padding: 8px 12px; border-right: 1px solid var(--border-strong); }
.goals-matrix .person-col { min-width: 104px; max-width: 140px; text-align: center; font-weight: 600; border-left: 1px solid var(--border); }
.goals-matrix .person-col.me .person-name { color: var(--accent); }
.person-name { display: block; line-height: 1.25; }
.person-tag { display: inline-block; margin-top: 4px; padding: 0 6px; border-radius: 999px; font-size: 11px; font-weight: 600; color: var(--grey);
  border: 1px solid var(--border-strong); }
.person-tag.lead { color: var(--accent); border-color: var(--lime-line); background: var(--lime-soft); }

.goals-matrix .cat-row th { background: var(--input); text-align: left; padding: 0; border-top: 1px solid var(--border-strong); }
.cat-inner { position: sticky; left: 0; display: inline-flex; align-items: center; gap: 10px; padding: 9px 12px; max-width: calc(100vw - 120px); flex-wrap: wrap; }
.cat-name { font-weight: 700; font-size: 15px; }
.cat-counts { font-size: 12px; }
.goals-matrix .fold { background: none; border: 0; color: var(--grey); cursor: pointer; font-size: 13px; width: 18px; padding: 0; }
.goals-matrix .fold:hover { color: var(--accent); }
.cat-tools, .goal-tools { display: inline-flex; gap: 4px; opacity: 0; transition: opacity .12s; }
.cat-row:hover .cat-tools, .cat-row:focus-within .cat-tools, .goal-row:hover .goal-tools, .goal-row:focus-within .goal-tools { opacity: 1; }
.goal-tools { margin-top: 4px; }
.goals-matrix .tool { padding: 1px 8px; }
.goals-matrix .no-goals { padding: 10px 12px 10px 40px; }

.goal-title { display: block; font-weight: 600; color: var(--text); line-height: 1.35; }
button.goal-title { background: none; border: 0; padding: 0; font: inherit; font-weight: 600; text-align: left; cursor: pointer; }
button.goal-title:hover { color: var(--accent); }
.goal-desc { margin: 2px 0 0; color: var(--grey); font-size: 12px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.goals-matrix .goal-row:hover > * { background: var(--surface-2); }
.goals-matrix td.goal-cell { padding: 5px 6px; text-align: center; border-left: 1px solid var(--border); vertical-align: middle; }

/* A deadline: coloured by how it stands. */
.goals-matrix .cell { display: block; width: 100%; padding: 6px 4px; border-radius: 6px; border: 1px solid transparent; font: inherit; font-size: 13px;
  font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; position: relative; }
.goals-matrix button.cell { cursor: pointer; }
.cell.st-done { color: var(--accent); background: var(--lime-soft); border-color: var(--lime-line); }
.cell.st-overdue { color: var(--error); background: var(--error-soft); border-color: var(--error-line); }
.cell.st-soon { color: var(--warn); background: var(--warn-soft); border-color: var(--warn-line); }
.cell.st-later { color: var(--text); background: var(--input); border-color: var(--border-strong); }
.cell.empty { color: transparent; background: none; }
.goal-row:hover .cell.empty, .cell.empty:focus-visible { color: var(--grey-dim); border: 1px dashed var(--border-strong); }
.goals-matrix button.cell:hover:not(.empty) { filter: brightness(1.25); }
.cell-note-dot { position: absolute; top: -2px; right: 3px; font-size: 14px; color: var(--grey); }

/* The goal dialog: one line per person, a tick and a date. */
.same-date { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 6px 0 12px; font-size: 13px; color: var(--grey); }
.same-date input { width: auto; }
.goal-people { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 6px 24px; }
.goal-person { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--input); }
.goal-person label.check { flex: 1; font-weight: 500; }
.goal-person input[type=date] { width: 150px; }
.goal-person input[type=date]:disabled { opacity: 0.35; }
#cell-box { width: min(440px, calc(100vw - 32px)); }
#cell-box label.check { margin: 6px 0 14px; }

/* Strategy › Goals: the By deadline and By person views */
.goals-views .btn:not(:first-child) { margin-left: -1px; }
.goals-toolbar .hide-done { font-weight: 500; color: var(--grey); }
.goals-none { padding: 24px 4px; }
.goal-chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--border-strong);
  font: inherit; font-size: 12.5px; font-weight: 600; white-space: nowrap; background: var(--input); color: var(--text); font-variant-numeric: tabular-nums; }
button.goal-chip { cursor: pointer; }
button.goal-chip:hover { filter: brightness(1.25); }
.goal-chip.st-done { color: var(--accent); background: var(--lime-soft); border-color: var(--lime-line); }
.goal-chip.st-overdue { color: var(--error); background: var(--error-soft); border-color: var(--error-line); }
.goal-chip.st-soon { color: var(--warn); background: var(--warn-soft); border-color: var(--warn-line); }
.goal-chip.me { box-shadow: 0 0 0 1px var(--lime-line); }
.goal-what { min-width: 0; }
.goal-cat { display: block; font-size: 12px; margin-top: 2px; }

.deadline-group { margin-bottom: 18px; }
.deadline-head { margin: 0 0 6px; font-size: 14px; padding-bottom: 6px; border-bottom: 1px solid var(--border-strong); }
.deadline-group.overdue .deadline-head { color: var(--error); border-bottom-color: var(--error-line); }
.deadline-row { display: grid; grid-template-columns: 56px minmax(0, 1fr) minmax(0, 1.2fr); gap: 14px; align-items: center; padding: 9px 4px;
  border-bottom: 1px solid var(--border); }
.deadline-date { text-align: center; line-height: 1.1; }
.deadline-date .day { display: block; font-size: 20px; font-weight: 700; }
.deadline-date .mon { display: block; font-size: 11px; color: var(--grey); text-transform: uppercase; letter-spacing: 0.04em; }
.deadline-who { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }

.goals-by-person { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.person-card { border: 1px solid var(--border); border-radius: var(--r-md); background: var(--input); padding: 14px 16px; }
.person-card.me { border-color: var(--lime-line); }
.person-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.person-head h3 { margin: 0; font-size: 15px; display: flex; gap: 6px; align-items: center; }
.person-head .person-tag { margin-top: 0; }
.person-progress { height: 4px; border-radius: 4px; background: var(--border); margin: 10px 0 6px; overflow: hidden; }
.person-progress span { display: block; height: 100%; background: var(--lime); }
.person-goal { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 10px; align-items: start; padding: 8px 0; border-bottom: 1px solid var(--border); }
.person-goal:last-child { border-bottom: 0; }
.person-goal .goal-chip { margin-top: 1px; }
.goal-note { grid-column: 2; margin: 0; font-size: 12px; color: var(--grey); white-space: pre-line; }
@media (max-width: 700px) {
  .deadline-row { grid-template-columns: 48px minmax(0, 1fr); }
  .deadline-who { grid-column: 2; justify-content: flex-start; }
}

/* ---------- My focus: goals, project tasks and to-do, side by side (focus.js: My Week, dashboard, Weekly Plans) ---------- */
.focus-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 1100px) { .focus-grid { grid-template-columns: 1fr; } }
.focus-col { border: 1px solid var(--border); border-radius: var(--r-md); background: var(--input); padding: 12px 14px; min-width: 0; display: flex; flex-direction: column; }
.focus-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.focus-head h3 { margin: 0; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.focus-head h3 .nav-icon { width: 16px; height: 16px; color: var(--accent); }
.focus-count { min-width: 20px; padding: 0 7px; border-radius: 999px; font-size: 12px; text-align: center; background: var(--lime-soft); color: var(--accent); border: 1px solid var(--lime-line); }
.focus-count:empty { display: none; }
.focus-list { list-style: none; margin: 0; padding: 0; max-height: 420px; overflow: auto; }
.focus-item { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto auto; gap: 4px 10px; align-items: start; padding: 8px 0; border-top: 1px solid var(--border); }
.focus-item:first-child { border-top: 0; }
.focus-empty { padding: 10px 0; }
.focus-body { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.focus-title { color: var(--text); font-weight: 600; font-size: 13.5px; line-height: 1.35; text-decoration: none; overflow-wrap: anywhere; }
a.focus-title[href]:hover { color: var(--accent); }
button.focus-title { background: none; border: 0; padding: 0; font: inherit; font-weight: 600; font-size: 13.5px; text-align: left; cursor: pointer; }
button.focus-title:hover { color: var(--accent); }
.focus-sub, .focus-note, .focus-status { font-size: 12px; color: var(--grey); }
.focus-note { white-space: pre-line; font-style: italic; }
.focus-meta { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.focus-flag { font-size: 11px; font-weight: 700; padding: 0 6px; border-radius: 999px; border: 1px solid; }
.focus-flag.high { color: var(--warn); border-color: var(--warn-line); }
.focus-flag.urgent { color: var(--error); border-color: var(--error-line); }
.focus-item.done .focus-title { color: var(--grey-dim); text-decoration: line-through; }
.focus-date { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--border-strong); white-space: nowrap; color: var(--grey); font-variant-numeric: tabular-nums; }
.focus-date.st-done { color: var(--accent); background: var(--lime-soft); border-color: var(--lime-line); }
.focus-date.st-overdue { color: var(--error); background: var(--error-soft); border-color: var(--error-line); }
.focus-date.st-soon { color: var(--warn); background: var(--warn-soft); border-color: var(--warn-line); }
.focus-tick, .focus-tick-space { width: 20px; height: 20px; margin-top: 1px; }
.focus-tick { border-radius: 50%; border: 1.5px solid var(--border-strong); background: none; color: var(--black); font-size: 12px; font-weight: 800; cursor: pointer; padding: 0; line-height: 1; }
.focus-tick:hover { border-color: var(--accent); }
.focus-tick.on { background: var(--lime); border-color: var(--accent); }
.focus-tick:disabled { opacity: 0.5; cursor: default; }
.focus-add { white-space: nowrap; }
.focus-new { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-bottom: 8px; }
.focus-new { gap: 8px; }
.focus-new input[type=text].wide { flex: 1 1 100%; min-width: 0; max-width: none; padding: 7px 10px; }
.focus-new input[type=date].wide { flex: 1 1 130px; min-width: 0; padding: 6px 8px; }
.focus-high { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--grey); cursor: pointer; }
.focus-high input { accent-color: var(--warn); }
.focus-edit { grid-column: 1 / -1; margin: 0; }
.dash .focus-card { padding: 14px; }
#person-focus .focus-list { max-height: 260px; }

/* My Diagon › My To-Do (my-todo.html): the whole list, with a filter, search and sorting */
.todo-add { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.todo-add input[type=text].wide { flex: 1 1 260px; min-width: 0; max-width: none; width: auto; }
.todo-add input[type=date].wide { width: 170px; }
.todo-add label.todo-high { font-weight: 500; color: var(--grey); font-size: 13px; }
.todo-toolbar { margin-top: 18px; }
.todo-toolbar input[type=search].wide { flex: 1 1 240px; max-width: 360px; }
.todo-toolbar #summary { margin-left: auto; }
.todo-list { list-style: none; margin: 8px 0 0; padding: 0; }
.todo-row { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 11px 4px; border-top: 1px solid var(--border); }
.todo-row:first-child { border-top: 0; }
.todo-row.done .focus-title { color: var(--grey-dim); text-decoration: line-through; }
.todo-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.todo-right { display: flex; gap: 8px; align-items: center; }
.todo-edit { grid-column: 1 / -1; }
.todo-empty { padding: 16px 4px; }
.focus-window #focus-window-box { margin-top: 8px; }
dialog.modal .focus-head h3 { margin: 0; padding-top: 0; border-top: 0; font-size: 14px; }
.agent-os { margin-bottom: 12px; }

/* Reports › Checklists: tick boxes for bulk reviews, and the review part of the answers window. */
.tick-col { width: 28px; text-align: center; }
.tick-col input { accent-color: var(--accent); width: 16px; height: 16px; }
.cl-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 14px 0 12px; }
.cl-actions-text { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; min-width: 0; }
.cl-actions-text .hint { margin: 0; }
.cl-actions-buttons { display: flex; gap: 8px; margin-left: auto; }
.cl-actions-buttons [hidden] { display: none; }
.cl-review-box { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); }
.cl-review-box h3 { margin: 0 0 4px; }
#cl-rows .cell-note { white-space: pre-line; }
.focus-reviews { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 0 0 14px; padding: 10px 14px;
  border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface-2, transparent); font-size: 14px; }
.focus-reviews[hidden] { display: none; }
.focus-reviews svg { color: var(--accent); }

/* ---------- People › Team Diagram (team-diagram.js) ----------
   A tree: the company at the top, curved branches down to each team (the classic org-chart lines, drawn with borders),
   each team a soft card in its own colour (--th, a hue) with the lead's big ringed avatar and the members as round
   avatars (--h, a hue per person). Light and dark both work from the same hues. */
.td-card { --td-line: var(--border-strong); }
.td-scroll { overflow-x: auto; padding: 8px 4px 16px; margin-top: 8px; }
.td-tree { display: flex; flex-direction: column; align-items: center; min-width: max-content; margin: 0 auto; }
.td-tree .td-none { margin-top: 24px; }

.td-root {
  display: flex; align-items: center; gap: 12px; padding: 10px 18px 10px 10px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border); box-shadow: 0 6px 20px rgba(20, 20, 20, 0.07);
}
.td-logo { height: 32px; width: auto; flex: none; }
.td-root-words { display: grid; line-height: 1.25; }

/* The branches: a line down from the company, then out to each team with rounded corners. */
.td-branches { position: relative; display: flex; justify-content: center; align-items: flex-start; padding-top: 30px; }
.td-branches::before { content: ""; position: absolute; top: 0; left: 50%; height: 30px; border-left: 2px solid var(--td-line); }
.td-team { position: relative; padding: 30px 12px 0; }
.td-team::before, .td-team::after { content: ""; position: absolute; top: 0; width: 50%; height: 30px; border-top: 2px solid var(--td-line); }
.td-team::before { right: 50%; }
.td-team::after { left: 50%; border-left: 2px solid var(--td-line); }
.td-team:first-child::before, .td-team:last-child::after { border: 0; }
.td-team:last-child::before { border-right: 2px solid var(--td-line); border-top-right-radius: 14px; }
.td-team:first-child::after { border-top-left-radius: 14px; }
.td-branches.one .td-team::before { border: 0; }
.td-branches.one .td-team::after { border-top: 0; border-radius: 0; }

.td-team-card {
  --tc: hsl(var(--th) 62% 40%);
  display: flex; flex-direction: column; align-items: center; width: 270px; padding: 16px 14px 18px;
  border-radius: 22px; background: linear-gradient(180deg, hsl(var(--th) 70% 96%), var(--surface) 70%);
  box-shadow: 0 1px 0 hsl(var(--th) 50% 85%) inset, 0 10px 28px rgba(20, 20, 20, 0.06); border: 1px solid hsl(var(--th) 45% 88%);
  transition: opacity 0.2s, transform 0.2s;
}
:root[data-theme="dark"] .td-team-card {
  --tc: hsl(var(--th) 75% 68%);
  background: linear-gradient(180deg, hsl(var(--th) 30% 16%), var(--surface) 75%); border-color: hsl(var(--th) 25% 26%);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}
.td-team-head { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; font-weight: 700; }
.td-team-line { margin: -10px 0 14px; font-size: 12px; color: var(--grey); }
.td-team-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--tc); box-shadow: 0 0 0 4px hsl(var(--th) 60% 50% / 0.18); }
.td-team-name { color: var(--text); }
.td-team-count { font-size: 12px; font-weight: 700; color: var(--tc); background: hsl(var(--th) 60% 50% / 0.12); padding: 1px 8px; border-radius: 999px; }
.td-nolead, .td-empty { margin: 4px 0 0; font-size: 12.5px; color: var(--grey); font-style: italic; }
.td-stem { width: 2px; height: 18px; margin: 10px 0 8px; background: linear-gradient(var(--tc), transparent); border-radius: 2px; opacity: 0.6; }
.td-members { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px 6px; }

/* A person: avatar, name, job title. */
.td-person {
  display: flex; flex-direction: column; align-items: center; width: 78px; text-align: center; border-radius: 12px; padding: 4px 2px;
  outline: none; transition: opacity 0.2s, transform 0.15s;
}
.td-person:hover, .td-person:focus-visible { transform: translateY(-2px); }
.td-person:focus-visible { box-shadow: var(--ring); }
.td-avatar {
  position: relative; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%;
  font-size: 15px; font-weight: 700; letter-spacing: 0.02em;
  color: hsl(var(--h) 45% 26%); background: linear-gradient(145deg, hsl(var(--h) 75% 88%), hsl(var(--h) 65% 80%));
  box-shadow: 0 0 0 3px var(--surface), 0 4px 10px rgba(20, 20, 20, 0.12);
}
:root[data-theme="dark"] .td-avatar { color: hsl(var(--h) 85% 88%); background: linear-gradient(145deg, hsl(var(--h) 35% 34%), hsl(var(--h) 35% 26%)); }
/* The figure: head and shoulders, cut to the circle, a deeper shade of the person's colour. */
.td-face { position: absolute; inset: 0; width: 100%; height: 100%; clip-path: circle(50%); fill: hsl(var(--h) 45% 32% / 0.72); }
:root[data-theme="dark"] .td-face { fill: hsl(var(--h) 70% 82% / 0.75); }
.td-name { margin-top: 6px; font-size: 12.5px; font-weight: 600; line-height: 1.2; color: var(--text); }
.td-title { margin-top: 2px; font-size: 11px; line-height: 1.2; color: var(--grey); }
.td-tree.no-titles .td-title { display: none; }

/* The lead: bigger, with a ring in the team's colour and a badge. */
.td-person.lead { width: 150px; }
.td-person.lead .td-avatar {
  width: 72px; height: 72px; font-size: 22px;
  box-shadow: 0 0 0 3px var(--surface), 0 0 0 6px var(--tc), 0 10px 22px rgba(20, 20, 20, 0.16);
}
.td-person.lead .td-name { margin-top: 12px; font-size: 14px; }
.td-person.lead .td-title { font-size: 12px; }
.td-badge {
  position: absolute; bottom: -9px; left: 50%; transform: translateX(-50%); white-space: nowrap;
  font-size: 10px; font-weight: 700; letter-spacing: 0.02em; padding: 2px 7px; border-radius: 999px;
  color: #fff; background: var(--tc); box-shadow: 0 0 0 2px var(--surface);
}
:root[data-theme="dark"] .td-badge { color: #111; }

/* You: a lime ring and a small tag. */
.td-person.is-me .td-avatar { box-shadow: 0 0 0 3px var(--surface), 0 0 0 6px var(--lime), 0 6px 14px rgba(20, 20, 20, 0.16); }
.td-person.lead.is-me .td-avatar { box-shadow: 0 0 0 3px var(--surface), 0 0 0 6px var(--lime), 0 0 0 9px var(--tc), 0 10px 22px rgba(20, 20, 20, 0.16); }
.td-you {
  position: absolute; top: -6px; right: -10px; font-size: 9.5px; font-weight: 800; padding: 1px 5px; border-radius: 999px;
  color: var(--black); background: var(--lime); box-shadow: 0 0 0 2px var(--surface);
}

/* People who aren't in a team. */
.td-loose { margin-top: 28px; padding: 14px 16px 16px; border: 2px dashed var(--border-strong); border-radius: 22px; max-width: 900px; }
.td-loose-title { margin: 0 0 12px; text-align: center; font-size: 12.5px; font-weight: 700; color: var(--grey); text-transform: uppercase; letter-spacing: 0.06em; }

/* Finding someone: they stand out, everyone else fades. */
.td-tree.searching .td-person:not(.hit) { opacity: 0.25; }
.td-tree.searching .td-team-card:not(:has(.hit)):not(.hit) { opacity: 0.45; }
.td-person.hit .td-avatar { box-shadow: 0 0 0 3px var(--surface), 0 0 0 6px var(--accent), 0 8px 18px rgba(20, 20, 20, 0.18); }

/* Phones and narrow windows: the teams stack, with a simple line down the side. */
@media (max-width: 760px) {
  .td-tree { min-width: 0; align-items: stretch; }
  .td-root { align-self: center; }
  .td-branches { flex-direction: column; align-items: stretch; padding-top: 18px; }
  .td-branches::before { left: 24px; height: 100%; }
  .td-team { padding: 12px 0 0 40px; }
  .td-team::before { display: none; }
  .td-team::after { left: 24px; width: 16px; height: 34px; border-top: 0; border-left: 0; border-bottom: 2px solid var(--td-line); border-radius: 0 0 0 10px; }
  .td-team:first-child::after { border-radius: 0 0 0 10px; }
  .td-team-card { width: auto; }
}
/* Project › Money › Invoices: the number on one line, the subject under it. */
.m-inv-label { min-width: 14rem; }
.m-inv-label a { white-space: nowrap; }

/* Project › Money: "New invoice" / "Record receipt" / "Record disbursement" at the right of each card's head. */
#area-money .card-head .m-new { margin-left: 8px; }
#area-money .card-head .m-new svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

/* ---------- The Email pop-up (email-dialog.js) ---------- */
dialog.modal.email-modal { width: min(680px, calc(100vw - 32px)); }
.email-facts { margin: 0 0 12px; display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; font-size: 14px; }
.email-facts dt { color: var(--grey); }
.email-facts dd { margin: 0; overflow-wrap: anywhere; }
.email-people { border: 0; padding: 0; margin: 0 0 12px; }
.email-people legend { font-weight: 600; margin-bottom: 6px; padding: 0; }
.email-recipients { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 6px; }
.email-recipients li { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.email-recipients .email-role { width: 72px; flex: none; }
.email-who { overflow-wrap: anywhere; }
.email-people label.check.email-me { font-weight: 400; margin-top: 8px; }
.email-modal textarea { font-family: inherit; line-height: 1.5; }

/* The formatted message box (richtext.js) */
.rich { border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); overflow: hidden; }
.rich:focus-within { border-color: var(--accent); box-shadow: var(--ring); }
.rich-bar { display: flex; flex-wrap: wrap; gap: 2px; padding: 4px; border-bottom: 1px solid var(--border); background: var(--input); }
.rich-btn { font: inherit; font-size: 13px; color: var(--text); background: transparent; border: 1px solid transparent; border-radius: var(--r-sm); padding: 3px 9px; cursor: pointer; }
.rich-btn:hover { background: var(--surface); border-color: var(--border); }
.rich-btn[aria-pressed="true"] { background: var(--surface); border-color: var(--accent); }
.rich-box { padding: 10px 12px; font-size: 14px; line-height: 1.55; color: var(--text); outline: none; max-height: 50vh; overflow: auto; word-wrap: break-word; }
.rich-box ul, .rich-box ol, .email-text ul, .email-text ol { margin: 0 0 10px; padding-left: 24px; }
.rich-box p, .email-text p { margin: 0 0 10px; }
.rich-box a, .email-text a { color: var(--accent); text-decoration: underline; }

/* Settings › Email: the signature and how it looks (always on white, like in an email) */
.sig-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.sig-preview { background: #ffffff; border: 1px solid var(--border); border-radius: var(--r-md); padding: 4px 16px 16px; min-height: 80px; }
/* The preview shows the signature as an email does: none of the app's table styling. */
.sig-preview table { width: auto; border: 0; background: transparent; margin-top: 12px !important; }
.sig-preview tr, .sig-preview tr:hover, .sig-preview td { background: transparent !important; border: 0 !important; padding: 0; }
@media (max-width: 800px) { .sig-grid { grid-template-columns: 1fr; } }
.sig-signers { display: grid; gap: 6px; }
.sig-signers { gap: 10px; }
.sig-signer { display: grid; gap: 4px; font-weight: 400; font-size: 12px; color: var(--grey); overflow-wrap: anywhere; }
.sig-signer input {
  width: 100%; min-width: 0; padding: 8px 10px; font: inherit; font-size: 14px; color: var(--text);
  background: var(--input); border: 1px solid var(--border); border-radius: var(--r-sm);
}
.sig-signer input:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
.sig-logo { background: #ffffff; border: 1px solid var(--border); border-radius: var(--r-md); padding: 12px; margin: 6px 0; min-height: 40px; }
.sig-logo img { display: block; max-width: 200px; max-height: 60px; }
.sig-preview { margin-top: 6px; }
/* Settings › Email › Signature per mailbox: one row per mailbox, its signature under it. */
.mb-sigs { display: grid; gap: 14px; }
.mb-sig { border: 1px solid var(--border); border-radius: var(--r-md); padding: 14px 16px; }
.mb-sig-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.mb-sig-head > div:first-child { display: grid; gap: 2px; flex: 1 1 260px; min-width: 0; overflow-wrap: anywhere; }
.mb-sig-head .actions { margin: 0; }
.email-detail { background: var(--input); }
.email-detail p { margin: 4px 0; }
.email-text { font-size: 13px; line-height: 1.5; margin: 8px 0; max-height: 260px; overflow: auto; }

/* Dashboard: the service line the money figures are for (next to the Company heading) */
.dash-line { margin-left: 10px; font-size: 13px; font-weight: 400; padding: 4px 8px; vertical-align: middle; }

/* ---------- Helpdesk (helpdesk.html, ticket.html, helpdesk-technologies.html) ---------- */
/* Formatted text shown on a page (descriptions, replies, notes, FAQ answers): cleaned by the server. */
.rich-view { line-height: 1.6; overflow-wrap: anywhere; }
.rich-view p, .rich-view div { margin: 0 0 8px; }
.rich-view > :last-child { margin-bottom: 0; }
.rich-view ul, .rich-view ol { margin: 0 0 8px; padding-left: 24px; }
.rich-view a { color: var(--accent); }
.note-text.rich-view { white-space: normal; }
.rich-box:empty::before { content: attr(data-placeholder); color: var(--grey-dim); pointer-events: none; }
/* The timer on a ticket */
.tk-timer-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; }
.tk-clock { font-family: var(--mono); font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--grey); }
.tk-timer.running { border-color: var(--lime-pressed); box-shadow: 0 0 0 1px var(--lime-pressed) inset; }
.tk-timer.running .tk-clock { color: var(--accent); }
.tk-timer-total { margin: 12px 0 0; padding-top: 10px; border-top: 1px solid var(--border); font-size: 14px; font-weight: 600; }
.tk-timer-note { color: var(--accent); }
.tk-timer-note[hidden] { display: none; }
/* A ticket: the description and conversation on the left, its facts, owner and files on the right. */
.tk-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.tk-layout[hidden] { display: none; }
.tk-main, .tk-side { display: grid; gap: 18px; min-width: 0; }
.tk-main > .card, .tk-side > .card { margin: 0; }
@media (max-width: 1240px) { .tk-layout { grid-template-columns: 1fr; } }
.tk-side .card { min-width: 0; }
.tk-side .file-list li { flex-wrap: wrap; }
.tk-owner select { width: 100%; }
.tk-description { margin-top: 0; }
.tk-timeline { display: grid; gap: 10px; }
.tk-entry { margin: 0; }
.tk-entry.tk-staff { border-left-color: var(--lime-pressed); }
.tk-entry.tk-client { border-left-color: var(--info); }
.tk-entry.tk-internal { border-left-color: var(--warn); background: var(--warn-soft); }
.tk-change { margin: 0; padding: 2px 0 2px 16px; font-size: 13px; color: var(--grey); }
.tk-change .tk-email { margin: 2px 0 0; }
.tk-email { margin-top: 8px; }
.tk-reply { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); display: grid; gap: 10px; }
.tk-reply[hidden] { display: none; }
.tk-reply.is-note textarea { background: var(--warn-soft); }
.tk-reply-row { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; }
.tk-reply-row .field { margin: 0; width: 200px; }
.tk-reply-row .field:first-child { width: 240px; }
.tk-reply-row label.check { margin-bottom: 10px; }
.tk-reply .actions { margin-top: 0; }
.tk-owner { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.tk-owner p { margin: 0 0 8px; }
.tk-owner .input-row { display: flex; gap: 8px; }
.tk-owner select { flex: 1; min-width: 0; }
.tk-pick { display: grid; gap: 2px; max-height: 260px; overflow: auto; margin-top: 8px; padding: 8px; background: var(--input); border: 1px solid var(--border); border-radius: var(--r-sm); }
.tk-pick-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 3px 0; }
.tk-pick-row label.check { font-weight: 400; font-size: 14px; }
#queues .btn.active { background: var(--lime); color: var(--black); border-color: var(--lime-pressed); }
#queues .sub-count { margin-left: 4px; }
#queues .sub-count[hidden] { display: none; }

/* Helpdesk › Tickets: the "Open now" cards, which filter the list */
.tk-tiles { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); margin-top: 12px; }
.tk-tiles button.stat { text-align: left; font: inherit; color: inherit; cursor: pointer; }
.tk-tiles button.stat:hover { border-color: var(--border-strong); }
.tk-tiles button.stat[aria-pressed="true"] { border-color: var(--accent); box-shadow: var(--ring); background: var(--lime-wash); }

/* Helpdesk › Settings (helpdesk-settings.html) */
.hd-hours { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.hd-hours input[type="time"] { width: auto; }
.hd-hours input[type="number"], .hd-hours input[type="number"].narrow { width: 80px; min-width: 0; flex: none; }
.hd-target { white-space: nowrap; }
.hd-target input { width: 72px; margin-right: 6px; }
.hd-target select { width: auto; min-width: 150px; }
/* The ticket page's "Insert standard reply…" */
.tk-std { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 8px 0; }
.tk-std select { width: auto; max-width: 100%; }
/* A ticket against its response targets: in the list (Due) and on the ticket page */
.hd-due { display: grid; gap: 2px; }
.hd-due small { color: var(--grey); font-size: 12px; }
.hd-targets-box { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.hd-targets-box > div { border: 1px solid var(--border); border-radius: var(--r-md); padding: 10px 12px; display: grid; gap: 4px; }
.hd-targets-box strong { font-size: 13px; }
.hd-targets-box span.hint { margin: 0; }

/* Helpdesk › Stats (helpdesk-stats.html) */
.hs-ratings { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 20px; align-items: center; margin-bottom: 12px; }
@media (max-width: 800px) { .hs-ratings { grid-template-columns: 1fr; } }
.hs-age-btn { width: 100%; font: inherit; color: inherit; background: none; border: 1px solid transparent; border-radius: var(--r-sm); padding: 3px 6px; cursor: pointer; text-align: left; }
.hs-age-btn:hover { background: var(--input); }
.hs-age-btn[aria-pressed="true"] { border-color: var(--accent); background: var(--lime-soft); }
.hs-age-btn:focus-visible { outline: none; box-shadow: var(--ring); }
.hs-rating-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.hs-stars { color: #F5A524; letter-spacing: 1px; }
#rating-list td:first-child > span { white-space: nowrap; }
#rating-list td:first-child { min-width: 130px; }
.hs-low .hs-stars { color: var(--error); }
.pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 12px; }
.hs-toolbar { margin-top: 0; }
.hs-range { display: inline-flex; align-items: center; gap: 8px; }
.hs-range[hidden] { display: none; }
.hs-range input[type=date] { padding: 7px 10px; font: inherit; font-size: 14px; color: var(--text); background: var(--input); border: 1px solid var(--border); border-radius: var(--r-sm); }
.hs-tiles { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.hs-tiles .stat-sub { margin: 4px 0 0; font-size: 12px; color: var(--grey-dim); }
.hs-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.hs-two > .card { margin: 0; }
@media (max-width: 1100px) { .hs-two { grid-template-columns: 1fr; } }
.hs-ages { display: grid; gap: 12px; margin-top: 14px; }
.hs-age { display: grid; grid-template-columns: 110px minmax(0, 1fr) 36px; align-items: center; gap: 12px; font-size: 14px; }
.hs-age-bar { height: 10px; border-radius: 999px; background: var(--border); overflow: hidden; }
.hs-age-bar span { display: block; height: 100%; min-width: 2px; border-radius: inherit; background: var(--st-green); }
.hs-age.late .hs-age-bar span { background: var(--st-amber); }
.hs-age:last-child.late .hs-age-bar span { background: var(--st-red); }
.hs-age-count { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.hs-trend { margin-top: 18px; }
#oldest .nowrap { white-space: nowrap; }

/* Column headings that sort the list when clicked (sortable.js) */
th[aria-sort] { padding: 0; }
.sort-btn {
  display: inline-flex; align-items: center; gap: 4px; width: 100%; padding: 10px 12px; font: inherit; font-size: inherit;
  font-weight: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit; text-align: left;
  background: none; border: 0; cursor: pointer;
}
.sort-btn:hover { color: var(--text); }
.sort-btn.on { color: var(--accent); }
.sort-btn:focus-visible { outline: none; box-shadow: var(--ring); border-radius: var(--r-sm); }
.sort-arrow { font-size: 9px; min-width: 9px; }
.tk-list th, .tk-list td { padding-left: 8px; padding-right: 8px; }
.tk-list .sort-btn { padding: 10px 8px; }
.sort-arrow:empty { display: none; }
th.num .sort-btn { justify-content: flex-end; text-align: right; }
/* A table only for screen readers (e.g. under a chart): tables ignore the 1px height unless they are blocks, which stretched the page below the menu. */
table.sr-only { display: block; height: 1px; overflow: hidden; }
