/* Layout: workbench split — editor rail left, the Reeleyes invoice sheet on the desk right; stacks on narrow screens.
   Palette and type are taken from the RE FINAL INVOICE TEMPLATE spreadsheet. */
:root {
  --bg: #ececec;
  --panel: #ffffff;
  --field: #f3f3f3;
  --fg: #111111;
  --muted: #5f6368;
  --line: #d6d6d6;
  --accent: #f1c232;       /* template gold */
  --accent-ink: #111111;
  --accent-soft: #fdf3d3;
  --bar: #000000;          /* template black band */
  --bar-fg: #ffffff;
  --danger: #b3261e;
  --ok: #137333; --ok-soft: #e6f4ea;
  --bad: #c5221f; --bad-soft: #fce8e6;
  --info: #1967d2; --info-soft: #e8f0fe;
  --sync: #0a6fa8; --sync-soft: #e1f3fd;   /* light blue "Sync" tag (4.8:1 on its tint) */
  --gold-text: #8a6400;                    /* gold that reads on a light background (5.4:1 on white) */
  --focus: #8a6400;
  --idle: #5f6368; --idle-soft: #f1f3f4;
  --chart-bar: #9c7000;          /* chart bars: darker gold that holds 4.4:1 on white */
  --shadow: 0 1px 2px rgba(0,0,0,.06), 0 14px 34px -14px rgba(0,0,0,.28);
  /* the invoice itself: fixed template colors in both themes */
  --paper: #ffffff;
  --p-gray: #f3f3f3;
  --p-gold: #f1c232;
  --p-pink: #f4cccc;
  --p-navy: #1f3864;
  --p-slate: #333f4f;
  --p-mid: #7f7f7f;
  --p-rule: #bfbfbf;
  --p-grid: #999999;
  --p-ink: #000000;
  --font-body: "Roboto", "Segoe UI", system-ui, sans-serif;
  --font-mono: "Roboto Mono", ui-monospace, Consolas, monospace;
  /* design system (DESIGN.md): type, spacing, corners, motion */
  --t-xs: 11px; --t-sm: 12px; --t-base: 13px; --t-md: 15px; --t-lg: 18px; --t-xl: 24px; --t-2xl: 40px; --t-3xl: 64px;
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-6: 24px; --s-8: 32px; --s-12: 48px; --s-16: 64px;
  --r-sm: 4px; --r-md: 8px; --r-lg: 12px; --r-pill: 999px;
  --dur-1: 150ms; --dur-2: 240ms; --dur-3: 400ms; --ease: cubic-bezier(.2, .7, .2, 1);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e0e0e; --panel: #181818; --field: #222222; --fg: #ededed; --muted: #a0a0a0;
    --line: #2f2f2f; --accent: #f1c232; --accent-ink: #111111; --accent-soft: #3a3010;
    --bar: #000000; --bar-fg: #ffffff; --danger: #f2b8b5;
    --ok: #81c995; --ok-soft: #15301e; --bad: #f28b82; --bad-soft: #3c1b19;
    --info: #8ab4f8; --info-soft: #172840; --idle: #b0b3b8; --idle-soft: #2a2b2d; --chart-bar: #f1c232;
    --sync: #7fd0ff; --sync-soft: #10293a; --gold-text: #f1c232; --focus: #f1c232;
    --shadow: 0 1px 2px rgba(0,0,0,.5), 0 18px 40px -16px rgba(0,0,0,.8);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e0e0e; --panel: #181818; --field: #222222; --fg: #ededed; --muted: #a0a0a0;
  --line: #2f2f2f; --accent: #f1c232; --accent-ink: #111111; --accent-soft: #3a3010;
  --bar: #000000; --bar-fg: #ffffff; --danger: #f2b8b5;
    --ok: #81c995; --ok-soft: #15301e; --bad: #f28b82; --bad-soft: #3c1b19;
    --info: #8ab4f8; --info-soft: #172840; --idle: #b0b3b8; --idle-soft: #2a2b2d; --chart-bar: #f1c232;
    --sync: #7fd0ff; --sync-soft: #10293a; --gold-text: #f1c232; --focus: #f1c232;
  --shadow: 0 1px 2px rgba(0,0,0,.5), 0 18px 40px -16px rgba(0,0,0,.8);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { background: var(--bg); color: var(--fg); font-family: var(--font-body); font-size: var(--t-md); line-height: 1.45; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- top bar ---------- */
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 30; background: var(--bar); }
.topbar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: var(--bar); color: var(--bar-fg); border-bottom: 3px solid var(--accent); }
.topbar-inner {
  display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; max-width: 1480px; margin: 0 auto;
  padding-block: 10px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.brand { display: flex; align-items: center; gap: var(--s-3); }
.topbar-inner > .tabs { margin-left: auto; }
@media (max-width: 720px) { .topbar-inner > .undo-btn { margin-left: auto; } }
/* logo: inverted to a white disc, cropped past the file's white margin, with a thin gold ring */
.brand-mark { width: 38px; height: 38px; border-radius: 50%; overflow: hidden; flex: none; display: grid; place-items: center; background: #fff; box-shadow: 0 0 0 2px var(--bar), 0 0 0 3.5px var(--accent); }
.brand-mark img { width: 112%; height: 112%; object-fit: cover; filter: invert(1); mix-blend-mode: normal; background: #000; }
/* BACKEND over A REELEYES TOOL, both exactly the same width (app.js spaces the letters of the second line to fit) */
.brand h1 { margin: 0; display: flex; flex-direction: column; align-items: flex-start; line-height: 1; gap: 5px; }
.brand-name { font-size: 24px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; line-height: 1; }
.brand-sub { display: block; font-size: var(--t-xs); font-weight: 300; letter-spacing: .24em; text-transform: uppercase; color: var(--accent); white-space: nowrap; }

.chip { font-size: var(--t-xs); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; padding: 3px 8px; border-radius: var(--r-pill); background: var(--accent); color: var(--accent-ink); }
.actions { display: flex; gap: var(--s-2); flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: var(--s-2); border: 1px solid var(--line); background: var(--panel);
  border-radius: var(--r-md); padding: 8px 13px; font-weight: 500; cursor: pointer; transition: border-color var(--dur-1), background var(--dur-1);
}
.btn:hover { border-color: var(--muted); }
.btn svg { width: 16px; height: 16px; flex: none; }
.topbar .btn { background: transparent; color: var(--bar-fg); border-color: #3a3a3a; }
.topbar .btn:hover { border-color: #8a8a8a; }
.topbar .btn-primary, .btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 700; }
.topbar .btn-primary:hover, .btn-primary:hover { filter: brightness(1.06); border-color: var(--accent); }
.btn-danger, .topbar .btn-danger { border-color: var(--bad); color: var(--bad); background: var(--bad-soft); }
.btn[disabled] { opacity: .6; cursor: progress; }
.btn-sm { padding: 5px 10px; font-size: var(--t-base); }

/* ---------- workbench ---------- */
.bench {
  display: grid; grid-template-columns: minmax(340px, 440px) minmax(0, 1fr); gap: var(--s-6); max-width: 1480px; margin: 0 auto;
  padding-block: 24px 48px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
@media (max-width: 980px) { .bench { grid-template-columns: minmax(0, 1fr); } }
.editor { display: flex; flex-direction: column; gap: var(--s-4); min-width: 0; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px; display: flex; flex-direction: column; gap: var(--s-3); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); }
.panel h2 { margin: 0; font-size: var(--t-xs); font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3); }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: var(--s-3); }
@media (max-width: 420px) { .grid2, .grid3 { grid-template-columns: 1fr; } }
.field { display: flex; flex-direction: column; gap: var(--s-1); min-width: 0; }
.field label { font-size: var(--t-sm); color: var(--muted); font-weight: 500; }
.field input, .field textarea, .field select {
  width: 100%; background: var(--field); border: 1px solid var(--line); border-radius: var(--r-md); padding: 8px 10px;
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--accent); background: var(--panel); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.field textarea { resize: vertical; min-height: 62px; }
/* date fields: phones (iOS especially) give them a fixed native width that ignores the box; let them shrink to fit */
.field input, input[type="date"] { min-width: 0; max-width: 100%; }
input[type="date"] { -webkit-appearance: none; appearance: none; display: block; min-height: 36px; }
input[type="date"]::-webkit-date-and-time-value { text-align: left; }
/* Ref No row on narrow screens: date across the top, code + project # side by side */
@media (max-width: 560px) {
  .ref-box .grid3 { grid-template-columns: 1fr 1fr; }
  .ref-box .grid3 > .field:first-child { grid-column: 1 / -1; }
}
.hint { font-size: var(--t-sm); color: var(--muted); }
.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.upper { text-transform: uppercase; }

/* Ref No builder */
.ref-box { display: flex; flex-direction: column; gap: var(--s-3); background: var(--accent-soft); border: 1px solid var(--accent); border-radius: var(--r-md); padding: 12px; }
.ref-out { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-3); flex-wrap: wrap; }
.ref-out .label { font-size: var(--t-xs); font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.ref-parts { font-family: var(--font-mono); font-size: var(--t-xl); font-weight: 500; letter-spacing: .02em; }
.ref-parts span { border-bottom: 2px solid transparent; }
.ref-parts .yy { border-color: #8ab4f8; }
.ref-parts .re { border-color: var(--muted); }
.ref-parts .cc { border-color: var(--accent); }
.ref-parts .pn { border-color: #f28b82; }
.ref-legend { display: flex; gap: var(--s-3); flex-wrap: wrap; font-size: var(--t-sm); color: var(--muted); }
.ref-legend i { display: inline-block; width: 10px; height: 3px; vertical-align: middle; margin-right: 4px; }

/* line items */
.items { display: flex; flex-direction: column; gap: var(--s-3); }
.item, .item-head { display: grid; grid-template-columns: minmax(0, 1fr) 60px 100px 30px; gap: var(--s-2); }
.item { align-items: start; padding-bottom: 10px; border-bottom: 1px dashed var(--line); }
.item:last-child { border-bottom: 0; padding-bottom: 0; }
.item-head { font-size: var(--t-sm); color: var(--muted); }
.item input { width: 100%; min-width: 0; background: var(--field); border: 1px solid var(--line); border-radius: var(--r-md); padding: 7px 8px; }
.item input:focus { border-color: var(--accent); background: var(--panel); outline: none; }
.item .amt { grid-column: 1 / -1; font-size: var(--t-sm); color: var(--muted); text-align: right; }
.icon-btn { width: 30px; height: 33px; border: 1px solid transparent; background: transparent; border-radius: var(--r-md); display: grid; place-items: center; cursor: pointer; color: var(--muted); }
.icon-btn:hover { color: var(--danger); border-color: var(--line); }
.icon-btn svg { width: 15px; height: 15px; }
.row-actions { display: flex; gap: var(--s-2); flex-wrap: wrap; align-items: center; }

/* ---------- desk / sheet ---------- */
.desk { min-width: 0; position: sticky; top: calc(env(safe-area-inset-top, 0px) + 76px); align-self: start; }
@media (max-width: 980px) { .desk { position: static; } }
.desk-actions { justify-content: flex-end; margin-bottom: 12px; }
.desk-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; gap: var(--s-2); flex-wrap: wrap; font-size: var(--t-sm); color: var(--muted); }
.stage { width: 100%; overflow: hidden; }
.sheet {
  width: 816px; min-height: 1056px; transform-origin: top left; background: var(--paper); color: #111;
  box-shadow: var(--shadow); display: flex; flex-direction: column; font-family: var(--font-body); font-size: 12.5px; line-height: 1.45;
}
.sh-band { height: 10px; background: #000; flex: none; }
.sh-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; padding: 40px 48px 0; }
.sh-from { display: flex; gap: 16px; align-items: flex-start; }
.sh-logo { width: 64px; height: 64px; flex: none; }
.sh-bizname { font-size: 20px; font-weight: 700; letter-spacing: -.01em; line-height: 1.2; margin-bottom: 4px; }
.sh-small { font-size: 11px; color: #5f6368; white-space: pre-line; line-height: 1.5; }
.sh-title { display: flex; flex-direction: column; align-items: flex-end; }
.sh-word { font-size: 40px; font-weight: 900; letter-spacing: -.02em; line-height: 1; }
.sh-accent { width: 48px; height: 5px; background: var(--p-gold); margin-top: 12px; border-radius: 3px; }
.sh-meta { margin: 30px 48px 0; display: grid; grid-template-columns: repeat(4, 1fr); background: var(--p-gray); border-radius: 8px; overflow: hidden; }
.sh-meta > div { padding: 13px 16px 12px; }
.sh-meta small, .sh-label, .sh-due small {
  display: block; font-size: 9.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #6b6b6b;
}
.sh-meta small { margin-bottom: 3px; }
.sh-meta b { font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.sh-meta .due { background: var(--p-pink); }
.sh-parties { display: grid; grid-template-columns: 400px minmax(0, 1fr); padding: 30px 48px 0; }
.sh-label { display: flex; align-items: center; gap: 7px; margin-bottom: 8px; }
.sh-label::before { content: ""; width: 8px; height: 8px; background: var(--p-gold); border-radius: 2px; }
.sh-client { font-size: 13px; line-height: 1.5; }
.sh-client .who { font-weight: 700; }
.sh-job { font-size: 15px; font-weight: 700; line-height: 1.35; }
.sh-table { width: calc(100% - 96px); margin: 28px 48px 0; border-collapse: collapse; font-size: 12.5px; }
.sh-table th { background: var(--p-gold); color: #111; font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; padding: 11px 16px; text-align: left; }
.sh-table td { padding: 12px 16px; border-bottom: 1px solid #e5e5e5; vertical-align: top; color: #111; font-size: 12.5px; }
.sh-table .c { text-align: center; }
.sh-table .r { text-align: right; }
.sh-table td.c, .sh-table td.r { font-variant-numeric: tabular-nums; white-space: nowrap; }
.sh-table .d { width: 400px; }
.sh-table .empty { color: #8a8a8a; font-style: italic; }
.sh-bottom { display: grid; grid-template-columns: 400px minmax(0, 1fr); padding: 24px 48px 0; }
.sh-pay { font-size: 11.5px; line-height: 1.5; padding-right: 40px; }
.sh-pay p { margin: 0; white-space: pre-line; }
.sh-pay .sh-memo { margin-top: 10px; padding: 7px 10px; border-left: 3px solid var(--p-gold); background: #fff8e1; font-size: 11px; }
.sh-totals { display: flex; flex-direction: column; }
.sh-row { display: flex; justify-content: space-between; padding: 5px 16px; font-size: 12.5px; }
.sh-row span:first-child { color: #5f6368; }
.sh-row span:last-child { font-variant-numeric: tabular-nums; }
.sh-due { margin-top: 8px; background: var(--p-pink); border-radius: 8px; padding: 16px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.sh-due small { color: var(--p-slate); letter-spacing: .1em; font-size: 10px; }
.sh-due b { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.sh-foot { margin: auto 48px 0; padding: 18px 0 22px; border-top: 1px solid #e5e5e5; display: flex; justify-content: space-between; gap: 16px; font-size: 11px; color: #5f6368; }
.sh-foot b { color: #111; }

/* past invoices */
.history { display: flex; flex-direction: column; gap: var(--s-2); border-top: 1px solid var(--line); padding-top: 12px; }
.hist-list { display: flex; flex-direction: column; }
.hist-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; align-items: center; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.hist-row:last-child { border-bottom: 0; }
.hist-main { min-width: 0; }
.hist-job { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hist-meta { font-size: var(--t-sm); color: var(--muted); }
.hist-side { display: flex; align-items: center; gap: var(--s-2); }
.hist-total { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: var(--t-base); }
.hist-side a { font-size: var(--t-sm); color: var(--muted); }
.hist-side a:hover { color: var(--fg); }

/* tabs */
.tabs { display: flex; gap: var(--s-1); background: #1c1c1c; border-radius: var(--r-md); padding: 3px; }
.tab { border: 0; background: transparent; color: #bdbdbd; padding: 6px 14px; border-radius: var(--r-md); font-weight: 500; cursor: pointer; display: inline-flex; align-items: center; gap: var(--s-2); }
.tab:hover { color: #fff; }
.tab[aria-selected="true"] { background: var(--accent); color: var(--accent-ink); font-weight: 700; }
/* Projects: the battle station, first and set apart with a gold edge and the eye */
.tab-hq { color: var(--accent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 55%, transparent); font-weight: 800; letter-spacing: .02em; }
.tab-hq svg { width: 16px; height: 16px; flex: none; }
.tab-hq:hover { color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.tab-hq[aria-selected="true"] { box-shadow: 0 0 0 1px var(--accent), 0 0 18px -4px var(--accent); }
.tab-hq + .tab { margin-left: var(--s-2); }
/* access level beside the name: what this person can do here */
.access-chip { font-size: var(--t-xs); font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); border: 1px solid var(--accent); border-radius: var(--r-pill); padding: 4px 10px; white-space: nowrap; }
.access-chip.limited { color: #bdbdbd; border-color: #555; }
@media (max-width: 720px) { #sampleChip { display: none; } }
.tab-badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: var(--r-md); background: #d93025; color: #fff; font-size: var(--t-xs); font-weight: 700; display: inline-grid; place-items: center; }
@media (max-width: 720px) { .tabs { order: 3; width: 100%; } .tab { flex: 1 1 auto; min-width: 0; justify-content: center; padding: 6px 8px; font-size: var(--t-base); white-space: nowrap; } }
@media (max-width: 360px) { .tab { padding: 6px 5px; font-size: var(--t-sm); } }
.t-short { display: none; }
@media (max-width: 560px) { .t-full { display: none; } .t-short { display: inline; } }

/* ledger */
.ledger {
  max-width: 1480px; margin: 0 auto; display: flex; flex-direction: column; gap: var(--s-4);
  padding-block: 24px 48px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.ledger-title { margin: 0; font-size: clamp(32px, 6vw, var(--t-2xl)); font-weight: 900; letter-spacing: -.025em; line-height: 1.05; }
.ledger-head .hint { margin: 2px 0 0; }
.ledger-off { padding: 14px 16px; border: 1px solid var(--accent); background: var(--accent-soft); border-radius: var(--r-md); }
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s-3); }
@media (max-width: 860px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px 16px; display: flex; flex-direction: column; gap: var(--s-1); min-width: 0; }
.tile .k { font-size: var(--t-xs); font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.tile .v { font-size: var(--t-xl); font-weight: 700; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.tile .s { font-size: var(--t-sm); color: var(--muted); }
.tile.bad { border-color: var(--bad); }
.tile.bad .v { color: var(--bad); }
.tile.ok .v { color: var(--ok); }
.year-pick { font: inherit; font-weight: 700; letter-spacing: .05em; color: var(--fg); background: var(--field); border: 1px solid var(--line); border-radius: var(--r-md); padding: 1px 4px; cursor: pointer; }
.tile .s .link-btn { font-size: var(--t-sm); }
.ledger-tools { display: flex; gap: var(--s-3); flex-wrap: wrap; align-items: center; }
.ledger-tools input { flex: 1 1 240px; min-width: 0; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-md); padding: 9px 12px; }
.ledger-tools input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.seg { display: inline-flex; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-md); padding: 3px; gap: var(--s-1); flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 6px 12px; border-radius: var(--r-md); cursor: pointer; color: var(--muted); font-weight: 500; }
.seg button[aria-pressed="true"] { background: var(--fg); color: var(--bg); }
.ledger-grid { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: var(--s-4); align-items: start; }
@media (max-width: 900px) { .ledger-grid { grid-template-columns: minmax(0, 1fr); } }
.client-list { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 6px; display: flex; flex-direction: column; max-height: 70vh; overflow-y: auto; }
@media (max-width: 900px) { .client-list { flex-direction: row; overflow-x: auto; overflow-y: hidden; max-height: none; } .client-item { flex: 0 0 auto; } }
.client-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 8px; text-align: left; border: 0; background: transparent; padding: 9px 10px; border-radius: var(--r-md); cursor: pointer; }
.client-item:hover { background: var(--field); }
.client-item[aria-pressed="true"] { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.client-item .n { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* client code (MO, BS…): gold chip so it reads at a glance */
.code-chip { display: inline-block; min-width: 2.6em; padding: 1px 6px; margin-right: 7px; border-radius: var(--r-sm); background: var(--accent); color: var(--accent-ink);
  font-family: var(--font-mono); font-size: var(--t-sm); font-weight: 700; letter-spacing: .06em; text-align: center; vertical-align: 1px; }
.client-card h3 .code-chip { font-size: var(--t-md); padding: 2px 8px; vertical-align: 3px; margin-right: 9px; }
.client-item .c { font-size: var(--t-sm); color: var(--muted); font-family: var(--font-mono); }
.client-item .o { font-size: var(--t-sm); font-variant-numeric: tabular-nums; text-align: right; color: var(--muted); }
.client-item .o.owing { color: var(--fg); font-weight: 600; }
.client-item .o.late { color: var(--bad); font-weight: 700; }
.ledger-main { display: flex; flex-direction: column; gap: var(--s-3); min-width: 0; }
.client-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--s-3); }
@media (max-width: 600px) { .client-card { grid-template-columns: minmax(0, 1fr); } }
.client-card h3 { margin: 0; font-size: var(--t-lg); font-weight: 700; }
.client-card .who { color: var(--muted); }
.client-card dl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 3px 12px; margin: 10px 0 0; font-size: var(--t-base); }
.client-card dt { color: var(--muted); }
.client-card dd { margin: 0; overflow-wrap: anywhere; }
.client-card .side { display: flex; flex-direction: column; gap: var(--s-2); align-items: flex-end; text-align: right; }
@media (max-width: 600px) { .client-card .side { align-items: flex-start; text-align: left; } }
.client-card .money { font-variant-numeric: tabular-nums; font-size: var(--t-base); color: var(--muted); }
.client-card .money b { color: var(--fg); font-size: var(--t-md); }
.inv-list { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.inv-row { display: grid; grid-template-columns: 34px minmax(0, 1fr) 120px 130px 110px 176px 124px; gap: var(--s-3); align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.inv-row.is-cxl .inv-job, .inv-row.is-cxl .inv-total { color: var(--muted); text-decoration: line-through; }
.inv-total small { display: block; font-size: var(--t-xs); font-weight: 400; color: var(--muted); }
.row-tools { display: flex; align-items: center; gap: var(--s-1); font-size: var(--t-sm); }
/* Payments column pills */
.pill { display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2); height: 26px; padding: 0 11px; border-radius: var(--r-pill); border: 1px solid var(--line);
  background: transparent; color: var(--fg); font: inherit; font-size: var(--t-sm); font-weight: 600; white-space: nowrap; cursor: pointer; text-decoration: none; }
.pill:hover { border-color: var(--muted); }
.pill svg { width: 13px; height: 13px; }
.pill.gold { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.pill.gold:hover { filter: brightness(1.05); }
.pill.gold-line { border-color: var(--accent); }
.pill.busy { color: var(--muted); cursor: default; }
.pay-redo { margin-top: 8px; }
.pay-none { text-align: center; }
#f-clientPick option.add-opt { color: var(--gold-text); font-weight: 700; }
/* × close on messages and panels */
.x-close { flex: none; display: inline-grid; place-items: center; width: 24px; height: 24px; margin-left: auto; padding: 0; border: 0; border-radius: var(--r-pill);
  background: transparent; color: var(--muted); font-size: var(--t-lg); line-height: 1; cursor: pointer; }
.x-close:hover { background: var(--field); color: var(--fg); }
.drive-status .btn ~ .x-close { margin-left: 0; }
.note-x { display: flex; align-items: flex-start; gap: var(--s-3); }
#f-clientPick.is-new { color: var(--gold-text); font-weight: 700; }
#f-clientPick.is-new option:not(.add-opt) { color: var(--fg); font-weight: 400; }
/* Backed up tile + its check */
.bk-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); }
.bk-check { display: inline-grid; place-items: center; width: 22px; height: 22px; padding: 0; border-radius: var(--r-pill); border: 1px solid var(--line); background: transparent; color: var(--muted); cursor: pointer; }
.bk-check svg { width: 13px; height: 13px; }
.bk-check:hover { border-color: var(--sync); color: var(--sync); }
.bk-check:disabled { opacity: .5; cursor: default; }
.bk-tile.ok .v { color: var(--ok); font-size: var(--t-lg); }
.bk-tile.warn .v { font-size: var(--t-lg); }
.bk-rows { display: flex; flex-wrap: wrap; gap: 2px 10px; }
.bk-rows b { color: var(--fg); font-variant-numeric: tabular-nums; }
.bk-rows .gap b { color: var(--bad); }
.bk-panel { font-size: var(--t-base); padding: 10px 14px; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--panel); display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: baseline; justify-content: space-between; }
.bk-panel[data-tone="ok"] { border-color: var(--ok); }
.bk-panel[data-tone="err"] { border-color: var(--bad); }
.bk-panel ul { flex-basis: 100%; margin: 0; padding-left: 18px; display: grid; gap: var(--s-1); }
.receipts-bar { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); flex-wrap: wrap; padding: 10px 14px; border: 1px solid var(--accent); border-radius: var(--r-lg); background: var(--panel); font-size: var(--t-base); }
.receipts-bar b { font-variant-numeric: tabular-nums; }
.link-btn { border: 0; background: transparent; padding: 0; color: var(--fg); font-weight: 600; font-size: var(--t-sm); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; text-decoration-color: var(--line); }
.link-btn:hover { text-decoration-color: currentColor; }
.link-btn.danger { color: var(--danger); font-weight: 500; }
.cxl-box { display: inline-flex; align-items: center; gap: var(--s-2); color: var(--muted); cursor: pointer; }
.cxl-box input { accent-color: var(--muted); }
.st.part { background: var(--info-soft); color: var(--info); }
.st.cxl { background: var(--idle-soft); color: var(--idle); }
.pay-form { grid-column: 1 / -1; background: var(--field); border-radius: var(--r-md); padding: 12px; display: flex; flex-direction: column; gap: var(--s-3); }
.pay-list { display: flex; flex-direction: column; }
.pay-item { display: grid; grid-template-columns: 100px 110px minmax(0, 1fr) auto; gap: var(--s-3); align-items: center; padding: 5px 0; border-bottom: 1px dashed var(--line); font-size: var(--t-base); }
.pay-add { display: grid; grid-template-columns: 120px 150px 130px minmax(0, 1fr) auto; gap: var(--s-3); align-items: end; }
.pay-add select { width: 100%; }
@media (max-width: 760px) { .pay-add { grid-template-columns: 1fr 1fr; } .pay-item { grid-template-columns: auto auto minmax(0, 1fr) auto; } }
.seg-sm { padding: 2px; }
.seg-sm button { padding: 4px 10px; font-size: var(--t-base); }
.seg-strong button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); font-weight: 700; }
.inv-row:last-child { border-bottom: 0; }
/* desktop table: every column header and its cells centred, except the Invoice/Quote text column which stays left-aligned under a centred header */
@media (min-width: 761px) {
  .inv-row.head > span { text-align: center; }
  .inv-row .inv-due, .inv-row .inv-total { text-align: center; }
  .inv-row .chips { justify-content: center; }
  /* symmetric: blank slot | pill | pencil, so the pill sits dead centre under the PAYMENTS heading */
  .inv-row .row-tools { display: grid; grid-template-columns: 28px minmax(0, 1fr) 28px; align-items: center; gap: var(--s-1); }
  .inv-row .row-tools > :first-child { grid-column: 2; }
  .inv-row .row-tools .pill { width: 100%; height: 28px; padding: 0 8px; }
  .inv-row .row-tools .opt { width: 28px; }
  .inv-row .row-opts { justify-content: center; }
}
.inv-job-row { display: flex; align-items: center; gap: var(--s-2); min-width: 0; }
.inv-job-row .inv-job { min-width: 0; }
.drv { flex: none; font-size: var(--t-xs); font-weight: 600; line-height: 1.5; padding: 0 5px; border-radius: var(--r-sm); border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.drv.on { border-color: transparent; background: var(--sync-soft); color: var(--sync); }
.inv-row.head { font-size: var(--t-xs); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); background: var(--field); padding-block: 8px; }
.inv-row.is-paid .inv-job { color: var(--muted); }
.inv-row.is-late { box-shadow: inset 3px 0 0 var(--bad); }
.paid-box { display: grid; place-items: center; cursor: pointer; }
.paid-box input { width: 20px; height: 20px; accent-color: var(--ok); cursor: pointer; }
/* cancelled invoices: a black box with an X where the paid tick would be */
.paid-box.cxl { cursor: default; }
.cxl-mark { display: grid; place-items: center; width: 20px; height: 20px; border-radius: var(--r-sm); background: #000; color: #fff; border: 1px solid var(--line); }
.cxl-mark svg { width: 13px; height: 13px; stroke-width: 3; }
.inv-info { min-width: 0; }
.inv-job { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inv-meta { font-size: var(--t-sm); color: var(--muted); font-family: var(--font-mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inv-due { font-size: var(--t-base); font-variant-numeric: tabular-nums; }
.inv-due small { display: block; color: var(--muted); font-size: var(--t-sm); }
.inv-due.late small { color: var(--bad); font-weight: 600; }
.chips { display: flex; gap: var(--s-2); flex-wrap: wrap; }
.st { display: inline-flex; align-items: center; gap: var(--s-2); font-size: var(--t-sm); font-weight: 600; padding: 3px 8px; border-radius: var(--r-pill); white-space: nowrap; }
.st::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.st.paid { background: var(--ok-soft); color: var(--ok); }
.st.late { background: var(--bad-soft); color: var(--bad); }
.st.open { background: var(--accent-soft); color: var(--fg); }
.st.drive { background: var(--info-soft); color: var(--info); }
.st.local { background: var(--idle-soft); color: var(--idle); }
.inv-total { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
/* three fixed slots (Open · Cancel · Delete) so each button sits in the same column on every row, under the header */
.row-opts { display: grid; grid-template-columns: repeat(4, 28px); gap: var(--s-1); align-items: center; justify-content: start; }
.row-opts .opt { width: 28px; padding: 0; }/* Open / Cancel / Delete: matching icon buttons, label on hover */
.opt { display: inline-grid; place-items: center; min-width: 28px; height: 28px; padding: 0 6px; border: 1px solid var(--line); border-radius: var(--r-md); background: transparent; color: var(--muted); cursor: pointer; text-decoration: none; font: inherit; font-size: var(--t-sm); font-weight: 600; white-space: nowrap; }
.opt svg { width: 15px; height: 15px; }
.opt:hover { color: var(--fg); border-color: var(--muted); }
.opt[aria-pressed="true"] { color: var(--fg); background: var(--idle-soft); border-color: var(--idle); }
.opt.danger:hover { color: var(--danger); border-color: var(--danger); }
.opt.danger.armed, .opt.danger.armed:hover { background: var(--danger); border-color: var(--danger); color: var(--bg); }
.inv-empty { padding: 28px 16px; text-align: center; color: var(--muted); }
/* rows stack by the list's own width (the client column takes space beside it on mid-size screens) */
.inv-list { container-type: inline-size; }
@container (max-width: 820px) {
  .inv-row { grid-template-columns: 34px minmax(0, 1fr) auto; grid-template-areas: "box info total" "box due due" "box chips chips" "box tools open" "pay pay pay"; row-gap: 6px; }
  .inv-row.head { display: none; }
  .paid-box { grid-area: box; align-self: start; padding-top: 2px; }
  .inv-info { grid-area: info; } .inv-total { grid-area: total; } .inv-due { grid-area: due; }
  .chips { grid-area: chips; } .row-opts { grid-area: open; flex-direction: row; flex-wrap: wrap; gap: 6px 14px; justify-content: flex-end; }
  .row-tools { grid-area: tools; flex-direction: row; gap: var(--s-4); } .pay-form { grid-area: pay; }
  .inv-due small { display: inline; margin-left: 6px; }
}

/* modal */
.modal-back { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.45); display: grid; place-items: center; padding: 16px; overflow-y: auto; overscroll-behavior: contain; }
/* while a pop-up is open the page behind it stays put, so a swipe on a phone scrolls the pop-up, never the page */
body:has(.modal-back:not([hidden])) { overflow: hidden; }
.modal { background: var(--panel); color: var(--fg); border-radius: var(--r-lg); padding: 20px; width: min(460px, 100%); box-shadow: 0 20px 60px rgba(0,0,0,.35); display: flex; flex-direction: column; gap: var(--s-2); }
.modal h3 { margin: 0 0 4px; font-size: var(--t-lg); }
.modal p { margin: 0; }
.modal-actions { display: flex; gap: var(--s-2); justify-content: flex-end; flex-wrap: wrap; margin-top: 14px; }
.del-what { margin: 6px 0 4px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--field); line-height: 1.5; overflow-wrap: anywhere; }
.btn-delete { background: var(--danger); border-color: var(--danger); color: var(--bg); font-weight: 700; }
.btn-delete:hover { border-color: var(--danger); filter: brightness(1.05); }
.btn-delete-ghost { color: var(--danger); }
.btn-delete-ghost:hover { border-color: var(--danger); }
.modal-wide { width: min(560px, 100%); max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow-y: auto; overscroll-behavior: contain; }
.modal .field { margin-top: 6px; }
.modal .check { display: flex; gap: var(--s-2); align-items: flex-start; margin-top: 10px; font-size: var(--t-base); }
.modal .check input { margin-top: 2px; accent-color: var(--accent); }
.modal-status { font-size: var(--t-base); padding: 8px 10px; border-radius: var(--r-md); border: 1px solid var(--line); margin-top: 8px; overflow-wrap: anywhere; }
.modal-status[data-tone="err"] { border-color: var(--bad); }
.modal-status[data-tone="ok"] { border-color: var(--ok); }

/* undo + add client */
.undo-btn[disabled] { opacity: .45; cursor: default; }
.add-client { display: flex; align-items: center; justify-content: center; gap: var(--s-2); border: 1px dashed var(--line); background: transparent; border-radius: var(--r-md); padding: 8px 10px; margin-bottom: 4px; cursor: pointer; font-weight: 600; color: var(--fg); }
.add-client:hover { border-color: var(--accent); background: var(--accent-soft); }
@media (max-width: 900px) { .add-client { flex: 0 0 auto; margin: 0 4px 0 0; } }

/* analytics */
.an-tiles .tile { text-align: left; font: inherit; color: inherit; cursor: pointer; transition: border-color var(--dur-1); }
.an-tiles .tile:hover { border-color: var(--muted); }
.an-tiles .tile[aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 0 3px 0 var(--accent); }
.an-card { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px; min-width: 0; }
.an-card-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s-3); flex-wrap: wrap; margin-bottom: 10px; }
.an-card h3 { margin: 0; font-size: var(--t-md); font-weight: 700; }
.an-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s-4); }
@media (max-width: 900px) { .an-grid { grid-template-columns: minmax(0, 1fr); } }
.an-chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.an-chart .grid { stroke: var(--line); stroke-width: 1; }
.an-chart .axis { fill: var(--muted); font-size: var(--t-xs); font-family: var(--font-body); font-variant-numeric: tabular-nums; }
.an-chart .bar { fill: var(--chart-bar); transition: opacity var(--dur-1); }
.an-chart.hovering .bar { opacity: .45; }
.an-chart.hovering .bar.hot, .an-chart .bar.sel { opacity: 1; }
.an-chart .sel-mark { fill: var(--fg); }
.an-chart .hit { fill: transparent; cursor: pointer; }
.an-chart .hit:focus-visible { outline: none; stroke: var(--accent); stroke-width: 2; }
.an-empty { padding: 28px 8px; text-align: center; color: var(--muted); }
.an-tip { position: absolute; z-index: 5; pointer-events: none; background: var(--fg); color: var(--bg); border-radius: var(--r-md); padding: 8px 10px; font-size: var(--t-base); line-height: 1.4; white-space: nowrap; transform: translate(-50%, calc(-100% - 8px)); box-shadow: 0 6px 18px rgba(0,0,0,.2); }
.an-tip b { font-size: var(--t-md); font-variant-numeric: tabular-nums; }
.an-table { width: 100%; border-collapse: collapse; font-size: var(--t-base); }
.an-table th, .an-table td { padding: 7px 8px; border-bottom: 1px solid var(--line); text-align: left; }
.an-table th { font-size: var(--t-xs); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.an-table td.r, .an-table th.r { text-align: right; font-variant-numeric: tabular-nums; }
.cl-row { display: grid; grid-template-columns: minmax(90px, 160px) minmax(0, 1fr) auto; gap: var(--s-3); align-items: center; width: 100%; border: 0; background: transparent; padding: 6px 4px; border-radius: var(--r-md); cursor: pointer; text-align: left; }
.cl-row:hover { background: var(--field); }
.cl-name { font-weight: 600; font-size: var(--t-base); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-track { height: 12px; background: var(--field); border-radius: 0 4px 4px 0; overflow: hidden; }
.cl-fill { height: 100%; background: var(--chart-bar); border-radius: 0 4px 4px 0; min-width: 2px; }
.cl-val { font-size: var(--t-base); font-variant-numeric: tabular-nums; text-align: right; min-width: 70px; }
.cl-val small { display: block; color: var(--muted); font-size: var(--t-xs); }
.dt-row { display: grid; grid-template-columns: 84px minmax(0, 1fr) auto; gap: var(--s-3); align-items: center; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: var(--t-base); }
.dt-row:last-child { border-bottom: 0; }
.dt-date { color: var(--muted); font-size: var(--t-sm); font-variant-numeric: tabular-nums; }
.dt-main { min-width: 0; }
.dt-main div { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dt-main small { color: var(--muted); font-size: var(--t-sm); }
.dt-val { font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }

/* ---------- Today (home) ---------- */
.brand { color: inherit; text-decoration: none; border-radius: var(--r-md); }
@media (hover: hover) { .brand:hover .brand-name { color: var(--accent); } }
.td-hero { display: flex; align-items: center; gap: var(--s-8); padding: 8px 0 4px; }
.td-hello { min-width: 0; display: flex; flex-direction: column; gap: var(--s-1); }
.td-date { margin: 0; font-size: var(--t-sm); font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--gold-text); }
.td-sum { margin: 0; color: var(--muted); font-size: var(--t-md); }
.td-sum b { color: var(--fg); }
.td-quick { margin-top: 8px; }
.td-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-4); }
@media (max-width: 900px) { .td-grid { grid-template-columns: minmax(0, 1fr); } }
.td-card { display: flex; flex-direction: column; }
.td-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; align-items: center; width: 100%; padding: 9px 8px; margin: 0 -8px; width: calc(100% + 16px);
  border: 0; border-bottom: 1px dashed var(--line); background: transparent; text-align: left; cursor: pointer; border-radius: var(--r-md); font: inherit; color: inherit; }
.td-row:last-child { border-bottom-color: transparent; }
.td-row:hover { background: var(--field); }
.td-main { min-width: 0; }
.td-main div { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.td-main small { display: block; color: var(--muted); font-size: var(--t-sm); font-family: var(--font-mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.td-side { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.td-side small { display: block; font-size: var(--t-sm); font-weight: 600; color: var(--muted); }
.td-side small.bad { color: var(--bad); }
.td-side small.warn { color: var(--gold-text); }
.td-side small.ok { color: var(--ok); }
.td-empty { padding: 18px 4px; color: var(--muted); display: flex; align-items: center; gap: var(--s-2); }
.td-empty::before { content: "✓"; display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); font-size: var(--t-sm); font-weight: 700; }
.td-house { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); padding: 10px 0; border-bottom: 1px dashed var(--line); }
.td-house:last-child { border-bottom: 0; }
.td-house b { font-variant-numeric: tabular-nums; }
.td-house .hint { display: block; }
.td-more { margin-top: 8px; align-self: flex-start; }

/* 3D RE logo: drawn on a canvas, drag or flick to spin */
/* the turning RE: the website's solid block, in the brand yellow on dark (a deeper gold that reads on light) */
.re3d { flex: none; width: 168px; height: 150px; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; color: var(--gold-text); }
.re3d.dragging { cursor: grabbing; }
@media (max-width: 600px) { .td-hero { gap: var(--s-4); } .re3d { width: 104px; height: 96px; } }

/* ---------- Projects ---------- */
.pj-search { flex: 1 1 220px; min-width: 0; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-md); padding: 9px 12px; }
.pj-search:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
/* Projects is an overview screen (DESIGN.md): display type, generous space, quiet motion */
.pj-hero .ledger-title { font-size: clamp(44px, 9vw, var(--t-3xl)); letter-spacing: -.035em; line-height: 1; }
.pj-hero .hint { font-size: var(--t-md); margin-top: var(--s-2); }
.pj-list { display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.pj-row { position: relative; display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) 120px 130px; gap: var(--s-6); align-items: center; width: 100%;
  padding: var(--s-6) var(--s-6); background: transparent; border: 0; border-top: 1px solid var(--line); text-align: left; font: inherit; color: inherit; cursor: pointer;
  transition: background var(--dur-1) var(--ease); }
.pj-row.enter { animation: pj-in var(--dur-3) var(--ease) both; animation-delay: calc(var(--i, 0) * 40ms); }
.pj-row:first-child { border-top: 0; }
.pj-row::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--accent); transform: scaleY(0); transition: transform var(--dur-2) var(--ease); }
.pj-row:hover { background: var(--field); }
.pj-row:hover::before, .pj-row:focus-visible::before { transform: scaleY(1); }
@keyframes pj-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.pj-main { min-width: 0; display: flex; align-items: center; gap: var(--s-4); }
.pj-main > span:last-child { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pj-main b { font-size: var(--t-xl); font-weight: 800; letter-spacing: -.02em; line-height: 1.15; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pj-main small, .pj-meta small { color: var(--muted); font-size: var(--t-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pj-meta { min-width: 0; display: flex; flex-direction: column; gap: var(--s-2); }
.pj-money { text-align: right; font-variant-numeric: tabular-nums; font-size: var(--t-md); font-weight: 700; display: flex; flex-direction: column; gap: 2px; }
.pj-money small { font-weight: 500; color: var(--muted); font-size: var(--t-sm); }
.pj-money small.bad { color: var(--bad); }
.pj-when { text-align: right; font-size: var(--t-base); font-variant-numeric: tabular-nums; display: flex; flex-direction: column; gap: 2px; }
.pj-when small { color: var(--muted); font-size: var(--t-sm); }
@media (max-width: 760px) { .pj-row { grid-template-columns: minmax(0, 1fr) auto; gap: var(--s-3) var(--s-4); padding: var(--s-4); } .pj-main b { font-size: var(--t-lg); } .pj-meta { grid-column: 1 / -1; order: 3; } .pj-when { display: none; } }
/* seven-step status bar: Quote → Booked → Pre-production → Shoot → Post-production → Complete / Awaiting Payment → Paid */
.pj-dots { display: flex; gap: 3px; }
.pj-dots i { flex: 1; height: 4px; border-radius: var(--r-sm); background: var(--line); }
.pj-dots i.on { background: var(--accent); }
.pj-dots i.paid { background: var(--ok); }
.pj-stage { font-size: var(--t-xs); font-weight: 700; letter-spacing: .08em; color: var(--gold-text); text-transform: uppercase; }
.pj-stage.paid { color: var(--ok); }
.pj-empty { padding: var(--s-12) var(--s-4); text-align: center; color: var(--muted); }
/* detail: the project's name in display type, its key figures, then the timeline */
/* same rhythm as the Ledger: 16 between every block */
#pjListView { display: flex; flex-direction: column; gap: var(--s-4); }
#pjListView[hidden], .pj-detail[hidden] { display: none; }
.pj-detail { display: flex; flex-direction: column; gap: var(--s-4); }
.pj-back { align-self: flex-start; }
.pj-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s-4); flex-wrap: wrap; }
.pj-head h2 { margin: 0; font-size: clamp(36px, 7vw, var(--t-3xl)); font-weight: 900; letter-spacing: -.035em; line-height: 1; overflow-wrap: anywhere; }
.pj-head p { margin: var(--s-3) 0 0; color: var(--muted); font-size: var(--t-md); display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; }
.pj-head .row-actions { justify-content: flex-end; }
.pj-figs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.pj-figs > div { padding: var(--s-4) var(--s-4) var(--s-4) 0; min-width: 0; }
.pj-figs > div + div { padding-left: var(--s-4); border-left: 1px solid var(--line); }
.pj-figs span { display: block; font-size: var(--t-xs); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.pj-figs b { display: block; margin-top: var(--s-1); font-size: var(--t-xl); font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pj-figs .bad b { color: var(--bad); } .pj-figs .good b { color: var(--ok); }
@media (max-width: 600px) { .pj-figs { grid-template-columns: repeat(2, minmax(0, 1fr)); } .pj-figs > div:nth-child(3) { padding-left: 0; border-left: 0; } .pj-figs > div:nth-child(n+3) { border-top: 1px solid var(--line); } }
.pj-steps { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: var(--s-1); }
.pj-step { display: flex; flex-direction: column; align-items: flex-start; gap: var(--s-2); padding: var(--s-2) var(--s-1) var(--s-1); border: 0; border-radius: var(--r-sm); background: transparent; color: var(--muted);
  font: inherit; font-size: var(--t-sm); font-weight: 600; cursor: pointer; text-align: left; min-width: 0; transition: color var(--dur-1) var(--ease); }
.pj-step:hover { color: var(--fg); }
.pj-step i { width: 100%; height: 6px; border-radius: var(--r-sm); background: var(--line); transition: background var(--dur-2) var(--ease), height var(--dur-2) var(--ease); }
.pj-step.done { color: var(--fg); } .pj-step.done i { background: var(--accent); }
.pj-step.now { color: var(--fg); font-size: var(--t-base); font-weight: 800; } .pj-step.now i { background: var(--accent); height: 10px; }
.pj-step.paid i { background: var(--ok); }
.pj-step span { max-width: 100%; text-align: left; line-height: 1.25; overflow-wrap: anywhere; }
@media (max-width: 900px) { .pj-steps { grid-template-columns: repeat(4, minmax(0, 1fr)); row-gap: var(--s-3); } }
@media (max-width: 600px) { .pj-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }.pj-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: var(--s-4); align-items: start; }
@media (max-width: 980px) { .pj-grid { grid-template-columns: minmax(0, 1fr); } }
.pj-col { display: flex; flex-direction: column; gap: var(--s-4); min-width: 0; }
.pj-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px; display: flex; flex-direction: column; gap: var(--s-3); min-width: 0; }
.pj-card > header { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); }
.pj-card h3 { margin: 0; font-size: var(--t-md); font-weight: 700; }
.pj-kv { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 14px; font-size: var(--t-base); margin: 0; }
.pj-kv dt { color: var(--muted); } .pj-kv dd { margin: 0; overflow-wrap: anywhere; }
.pj-kv a { color: var(--fg); }
.pj-money4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s-2); }
.pj-money4 div { background: var(--field); border-radius: var(--r-md); padding: 8px 10px; font-size: var(--t-xs); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); min-width: 0; }
.pj-money4 b { display: block; margin-top: 2px; font-size: var(--t-md); letter-spacing: 0; text-transform: none; color: var(--fg); font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; }
.pj-money4 .bad b { color: var(--bad); }
@media (max-width: 480px) { .pj-money4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.pj-docs { display: flex; flex-direction: column; }
.pj-doc { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: var(--s-3); align-items: center; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: var(--t-base); }
.pj-doc:last-child { border-bottom: 0; }
.pj-doc span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pj-doc .num { font-size: var(--t-sm); color: var(--muted); }
.pj-crew { display: flex; flex-direction: column; }
.pj-mate { display: grid; grid-template-columns: auto minmax(0, 1fr) 130px 92px 28px; gap: var(--s-2); align-items: center; padding: 7px 0; border-bottom: 1px dashed var(--line); }
.pj-mate:last-child { border-bottom: 0; }
.pj-mate .ct-avatar { width: 32px; height: 32px; font-size: var(--t-sm); }
.pj-mate b { display: block; font-size: var(--t-base); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pj-mate small { display: block; color: var(--muted); font-size: var(--t-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pj-in { width: 100%; min-width: 0; background: var(--field); border: 1px solid var(--line); border-radius: var(--r-md); padding: 6px 8px; font-size: var(--t-base); }
.pj-in:focus { outline: none; border-color: var(--accent); background: var(--panel); }
@media (max-width: 520px) { .pj-mate { grid-template-columns: auto minmax(0, 1fr) 28px; } .pj-mate > .pj-in { grid-column: 2 / 3; } }
/* rate line under each crew member: rate, per, how many, cost (only ever shown inside the project) */
.pj-rate { grid-column: 2 / -1; display: grid; grid-template-columns: 96px 84px 64px minmax(0, 1fr); gap: var(--s-2); align-items: center; }
.pj-rate .cost { text-align: right; font-size: var(--t-base); font-variant-numeric: tabular-nums; color: var(--muted); }
@media (max-width: 520px) { .pj-mate .pj-rate { grid-column: 2 / -1; } .pj-rate { grid-template-columns: 1fr 1fr 64px; } .pj-rate .cost { grid-column: 1 / -1; text-align: left; } }
select.pj-in { padding: 5px 6px; }
.pj-hint-sm { font-size: var(--t-sm); color: var(--muted); }
/* budget, deliverables and payments grids */
.bd-rows { display: flex; flex-direction: column; gap: var(--s-2); }
.bd-rows > .link-btn { align-self: flex-start; }
.bd-row { display: grid; gap: var(--s-2); align-items: center; }
.bd-row.rent { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) 92px 28px; }
.bd-row.rent .dates { grid-column: 1 / 4; display: grid; grid-template-columns: auto 1fr auto 1fr; gap: var(--s-2); align-items: center; font-size: var(--t-sm); color: var(--muted); }
.bd-row.rent + .bd-row.rent { border-top: 1px dashed var(--line); padding-top: 6px; }
.bd-row.design { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) 92px 28px; }
.bd-row.deliv { grid-template-columns: 22px minmax(0, 1fr) 140px 28px; }
.bd-row.deliv.done .pj-in[data-pr$="|name"] { text-decoration: line-through; color: var(--muted); }
@media (max-width: 480px) {
  .bd-row.rent, .bd-row.design { grid-template-columns: minmax(0, 1fr) 96px 28px; }
  .bd-row.rent [data-pr$="|item"], .bd-row.design [data-pr$="|item"] { grid-column: 1 / 3; grid-row: 1; }
  .bd-row.rent > .x-close, .bd-row.design > .x-close { grid-column: 3; grid-row: 1; }
  .bd-row.rent [data-pr$="|vendor"], .bd-row.design [data-pr$="|vendor"] { grid-column: 1; grid-row: 2; }
  .bd-row.rent [data-pr$="|cost"], .bd-row.design [data-pr$="|cost"] { grid-column: 2 / 4; grid-row: 2; }
  .bd-row.rent .dates { grid-column: 1 / -1; grid-row: 3; grid-template-columns: auto 1fr; }
  .bd-row.deliv { grid-template-columns: 22px minmax(0, 1fr) 28px; } .bd-row.deliv .pj-in[type="date"] { grid-column: 2 / 3; }
}
.bd-sum { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; font-size: var(--t-base); font-variant-numeric: tabular-nums; border-top: 1px solid var(--line); padding-top: 10px; }
.bd-sum span:nth-child(even) { text-align: right; }
.bd-sum .tot { font-weight: 700; }
.bd-sum .neg { color: var(--bad); }
/* regenerate documents */
.rg-list { display: flex; flex-direction: column; max-height: min(52vh, 460px); overflow-y: auto; border: 1px solid var(--line); border-radius: var(--r-md); margin: 10px 0; }
.rg-row { display: grid; grid-template-columns: 20px auto minmax(0, 1fr) auto; gap: var(--s-3); align-items: center; padding: 9px 12px; border-bottom: 1px solid var(--line); cursor: pointer; font-size: var(--t-base); }
.rg-row:last-child { border-bottom: 0; }
.rg-row.off { opacity: .55; cursor: default; }
.rg-main { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rg-main small { display: block; color: var(--muted); font-size: var(--t-sm); }
.rg-res { font-size: var(--t-sm); color: var(--muted); text-align: right; max-width: 220px; }
.rg-res.ok { color: var(--ok); font-weight: 600; } .rg-res.bad { color: var(--bad); }
@media (max-width: 560px) { .rg-row { grid-template-columns: 20px minmax(0, 1fr); } .rg-row .st { display: none; } .rg-res { grid-column: 2; text-align: left; max-width: none; } }
.regen-hint { display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; padding: 10px 12px; border: 1px solid var(--accent); background: var(--accent-soft); border-radius: var(--r-md); font-size: var(--t-base); }
.regen-hint span { flex: 1 1 220px; }
.pay-bar { height: 8px; border-radius: var(--r-sm); background: var(--field); border: 1px solid var(--line); overflow: hidden; }
.pay-bar i { display: block; height: 100%; background: var(--ok); }
.pay-rows { display: flex; flex-direction: column; }
.pay-rows > div { display: grid; grid-template-columns: 92px minmax(0, 1fr) auto; gap: var(--s-3); padding: 6px 0; border-bottom: 1px dashed var(--line); font-size: var(--t-base); align-items: baseline; }
.pay-rows > div:last-child { border-bottom: 0; }
.pay-rows .num { text-align: right; }
.pj-add { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--s-2); }
.pj-add select { background: var(--field); border: 1px solid var(--line); border-radius: var(--r-md); padding: 7px 8px; min-width: 0; }
/* call sheet builder */
.cs-ver { display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; font-size: var(--t-base); color: var(--muted); }
.cs-ver b { color: var(--fg); }
.cs-ver .ct-tag { background: var(--accent); color: var(--accent-ink); }
.pj-card details { border-top: 1px solid var(--line); padding-top: 10px; }
.pj-card summary { cursor: pointer; font-size: var(--t-sm); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); list-style: none; display: flex; justify-content: space-between; }
.pj-card summary::-webkit-details-marker { display: none; }
.pj-card summary::after { content: "+"; font-size: var(--t-md); line-height: 1; }
.pj-card details[open] summary::after { content: "–"; }
.pj-card details[open] summary { color: var(--fg); margin-bottom: 10px; }
.cs-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-3); }
.cs-fields .wide { grid-column: 1 / -1; }
@media (max-width: 480px) { .cs-fields { grid-template-columns: minmax(0, 1fr); } }
.cs-fields label { display: flex; flex-direction: column; gap: var(--s-1); font-size: var(--t-sm); color: var(--muted); min-width: 0; }
.cs-rows { display: flex; flex-direction: column; gap: var(--s-2); }
.cs-row { display: grid; gap: var(--s-2); align-items: center; }
.cs-row.sched { grid-template-columns: 110px minmax(0, 1fr) 28px; }
.cs-row.tal { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 84px 28px; }
.cs-row.tal .full { grid-column: 1 / 4; }
.cs-hist { display: flex; flex-direction: column; font-size: var(--t-base); }
.cs-hist a { display: flex; justify-content: space-between; gap: var(--s-3); padding: 5px 0; color: var(--fg); text-decoration: none; border-bottom: 1px dashed var(--line); }
.cs-hist a:hover span:first-child { text-decoration: underline; text-decoration-color: var(--accent); }
.cs-hist span:last-child { color: var(--muted); white-space: nowrap; }
.pn-crew { display: flex; flex-direction: column; max-height: 220px; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--r-md); margin-top: 6px; }
.pn-crew label { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: var(--s-3); align-items: center; padding: 7px 10px; border-bottom: 1px solid var(--line); cursor: pointer; font-size: var(--t-base); }
.pn-crew label:last-child { border-bottom: 0; }
.pn-crew label:hover { background: var(--field); }
.pn-crew input { accent-color: var(--accent); }
.pn-crew small { color: var(--muted); font-size: var(--t-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Contacts: clients + crew ---------- */
#ct-search { flex: 1 1 220px; min-width: 0; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-md); padding: 9px 12px; }
#ct-search:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.ct-select { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-md); padding: 8px 10px; max-width: 200px; }
/* compact cards: avatar, name, one line, one tag; every text line truncates instead of spilling */
.ct-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: var(--s-3); }
.ct-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: var(--s-3); min-width: 0; width: 100%; padding: 12px 14px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); text-align: left; font: inherit; color: inherit; cursor: pointer;
  transition: border-color var(--dur-1), transform var(--dur-1), box-shadow var(--dur-2); }
.ct-card:hover { border-color: var(--muted); transform: translateY(-1px); }
.ct-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ct-avatar { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: var(--t-md); letter-spacing: .02em;
  background: var(--accent); color: var(--accent-ink); }
.ct-avatar.crew { background: var(--field); color: var(--fg); border: 1px solid var(--line); }
.ct-avatar.lg { width: 56px; height: 56px; font-size: var(--t-lg); }
.ct-name { min-width: 0; display: flex; flex-direction: column; }
.ct-name b, .ct-name small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ct-name b { font-size: var(--t-md); font-weight: 700; }
.ct-name small { font-size: var(--t-base); color: var(--muted); }
.ct-tag { flex: none; font-size: var(--t-xs); font-weight: 700; padding: 2px 8px; border-radius: var(--r-pill); background: var(--field); color: var(--muted); white-space: nowrap; }
.ct-tag.warn { background: var(--accent-soft); color: var(--gold-text); }
.ct-tag.role { background: var(--accent-soft); color: var(--gold-text); min-width: 0; overflow: hidden; text-overflow: ellipsis; }
/* one row of role bubbles under the name; extra ones are clipped, never wrapped out of the card */
.ct-bubbles { display: flex; gap: var(--s-1); margin-top: 4px; min-width: 0; overflow: hidden; }
.ct-bubbles .ct-tag { font-size: var(--t-xs); padding: 1px 7px; }
.ct-tag.founder { background: var(--accent); color: var(--accent-ink); letter-spacing: .04em; }
/* founders: gold ring + soft glow */
.ct-card.founder { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 0 22px -4px color-mix(in srgb, var(--accent) 70%, transparent); }
.ct-card.founder:hover { box-shadow: 0 0 0 1px var(--accent), 0 0 30px -2px color-mix(in srgb, var(--accent) 85%, transparent); }
.ct-avatar.founder, .ct-card.founder .ct-avatar { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); box-shadow: 0 0 14px -2px var(--accent); }
/* detail pop-up */
/* one rhythm: 16px between sections, 8px between a section's title and its content, 6px between lines */
.ct-detail { position: relative; padding: 22px; }
#ctDetailBody { display: flex; flex-direction: column; gap: var(--s-4); }
#ctDetailBody > * { margin: 0; }
.cd-sec { display: flex; flex-direction: column; gap: var(--s-2); margin: 0; }
.ct-detail .ct-stats { padding: 12px 0; }
.ct-detail .modal-actions { margin-top: 0; padding-top: 16px; border-top: 1px solid var(--line); }
.cd-x { position: absolute; top: 14px; right: 14px; }
.cd-head { display: flex; align-items: center; gap: var(--s-4); padding-right: 30px; min-width: 0; }
.cd-title { min-width: 0; }
.cd-title h3 { margin: 0; font-size: var(--t-lg); overflow-wrap: anywhere; }
.cd-title p { margin: 2px 0 0; color: var(--muted); font-size: var(--t-base); display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; }
.ct-detail h4 { margin: 0; font-size: var(--t-xs); font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.cd-lines { display: grid; gap: var(--s-2); font-size: var(--t-md); }
.cd-lines a, .cd-lines > span { color: var(--fg); text-decoration: none; display: flex; gap: var(--s-3); align-items: flex-start; min-width: 0; }
.cd-lines span span { overflow-wrap: anywhere; min-width: 0; }
.cd-lines a:hover span { text-decoration: underline; text-decoration-color: var(--accent); }
.cd-lines svg { flex: none; width: 15px; height: 15px; margin-top: 2px; color: var(--muted); }
.ct-roles { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.ct-role { font-size: var(--t-sm); font-weight: 700; padding: 2px 9px; border-radius: var(--r-pill); background: var(--field); border: 1px solid var(--line); color: var(--fg); }
.ct-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-2); padding: 10px 0; border-top: 1px dashed var(--line); border-bottom: 1px dashed var(--line); }
.ct-stats div { font-size: var(--t-xs); color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 700; min-width: 0; }
.ct-stats b { display: block; font-size: var(--t-md); color: var(--fg); letter-spacing: 0; text-transform: none; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; }
.cd-list { display: grid; font-size: var(--t-base); max-height: 220px; overflow-y: auto; }
.cd-list div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--s-3); padding: 7px 0; border-bottom: 1px dashed var(--line); }
.cd-list div:first-child { padding-top: 0; }
.cd-list div:last-child { border-bottom: 0; }
.cd-list span:first-child { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cd-list span:last-child { color: var(--muted); white-space: nowrap; }
.cd-notes { margin: 0; font-size: var(--t-base); color: var(--muted); white-space: pre-line; overflow-wrap: anywhere; }
.cd-dl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 12px; margin: 0; font-size: var(--t-base); }
.cd-dl dt { color: var(--muted); } .cd-dl dd { margin: 0; overflow-wrap: anywhere; }
.ct-detail .modal-actions a.btn { text-decoration: none; color: var(--fg); }
.ct-detail .modal-actions a.btn-primary { color: var(--accent-ink); }
.ct-empty { grid-column: 1 / -1; padding: 28px 16px; text-align: center; color: var(--muted); background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); }

/* recently deleted + activity */
.dd-links { display: flex; gap: var(--s-2); flex-wrap: wrap; margin-top: 6px; }
.dd-links .dd-toggle { white-space: nowrap; }
@media (max-width: 600px) { .tiles .bk-tile { grid-column: 1 / -1; } }
.dd-toggle { align-self: flex-start; border: 1px solid var(--line); background: transparent; color: var(--fg); border-radius: var(--r-pill); padding: 3px 10px; font-size: var(--t-sm); font-weight: 600; cursor: pointer; }
.dd-toggle:hover { border-color: var(--fg); }
.dd-panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px; display: flex; flex-direction: column; gap: var(--s-1); }
.dd-panel .left { font-size: var(--t-sm); color: var(--muted); }
.dd-panel .left.due { color: var(--bad); font-weight: 600; }
.purge-bar { display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; padding: 10px 12px; border: 1px solid var(--bad); border-radius: var(--r-md); background: var(--bad-soft); font-size: var(--t-base); margin-bottom: 8px; }
.purge-bar span { flex: 1 1 220px; }
.au-row { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: var(--s-3); padding: 8px 0; border-top: 1px solid var(--line); font-size: var(--t-base); }
.au-row .when { color: var(--muted); font-size: var(--t-sm); }
.au-row .what { overflow-wrap: anywhere; }
.lbl-row { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s-2); }
.addr-grid { display: grid; grid-template-columns: 1fr 2.4fr; gap: 0 12px; }
.addr-grid3 { display: grid; grid-template-columns: 2fr 1fr 1.3fr; gap: 0 12px; }
@media (max-width: 600px) { .addr-grid3 { grid-template-columns: 1fr 1fr; } .addr-grid3 .field:first-child { grid-column: 1 / -1; } }
.addr-ok { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: var(--r-pill); background: var(--ok-soft); color: var(--ok); font-size: var(--t-xs); font-weight: 700; vertical-align: 1px; white-space: nowrap; }
.addr-flag { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: var(--r-pill); border: 1px solid var(--accent); background: var(--accent-soft); color: var(--fg); font-size: var(--t-xs); font-weight: 600; vertical-align: 1px; white-space: nowrap; }
.dd-head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--s-3); padding-bottom: 8px; }
.dd-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: var(--s-3); align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.dd-acts { display: flex; gap: var(--s-2); flex-wrap: wrap; justify-content: flex-end; }
.dd-acts a.btn { text-decoration: none; color: var(--fg); }
.dd-row > * { grid-area: auto; }
.dd-acts { align-items: center; }
@media (max-width: 600px) { .dd-row { grid-template-columns: minmax(0, 1fr); gap: var(--s-2); } .dd-row .st { justify-self: start; } .dd-acts { justify-content: space-between; } }

/* drive status */
.drive-status { display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; margin-bottom: 12px; padding: 10px 12px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--panel); font-size: var(--t-base); }
.drive-status[data-tone="ok"] { border-color: var(--ok); }
.drive-status[data-tone="warn"] { border-color: var(--accent); background: var(--accent-soft); }
.drive-status[data-tone="err"] { border-color: var(--bad); }
.drive-status .path { font-weight: 500; overflow-wrap: anywhere; min-width: 0; }
.drive-status a { color: inherit; font-weight: 700; }
.drive-status .btn { margin-left: auto; }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%) translateY(20px);
  background: var(--fg); color: var(--bg); padding: 10px 16px; border-radius: var(--r-md); font-weight: 500;
  opacity: 0; pointer-events: none; transition: opacity var(--dur-2), transform var(--dur-2); z-index: 50; max-width: calc(100% - 32px);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.capture-host { position: fixed; left: -10000px; top: 0; width: 816px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* keyboard focus (DESIGN.md): one gold ring on everything you can press or type in */
/* !important: older rules set outline: none on focus for their own border colour */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible { outline: 2px solid var(--focus) !important; outline-offset: 2px; }
:where(input, select, textarea):focus-visible { outline-offset: 0; }
@media (prefers-reduced-motion: reduce) { .pj-row.enter { animation: none; } }

/* ---------- stage screens (Phase 3) ---------- */
.pj-step.viewing { color: var(--fg); }
.pj-step.viewing span { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.pj-stagebar { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s-4); flex-wrap: wrap; padding: var(--s-4) 0 0; border-top: 1px solid var(--line); }
.pj-stagebar .k { font-size: var(--t-xs); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--gold-text); }
.pj-stagebar h3 { margin: var(--s-1) 0 0; font-size: var(--t-xl); font-weight: 900; letter-spacing: -.02em; }
.pj-stagebar p { margin: var(--s-1) 0 0; color: var(--muted); font-size: var(--t-md); }
.pj-label { font-size: var(--t-xs); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: var(--s-2); }
/* Shoot: the countdown is the hero */
.pj-count { display: flex; align-items: baseline; gap: var(--s-3); flex-wrap: wrap; }
.pj-count b { font-size: clamp(48px, 10vw, var(--t-3xl)); font-weight: 900; letter-spacing: -.04em; line-height: 1; color: var(--fg); font-variant-numeric: tabular-nums; }
.pj-count span { font-size: var(--t-lg); font-weight: 700; color: var(--muted); }
.pj-loc { font-size: var(--t-md); font-weight: 700; color: var(--fg); text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; overflow-wrap: anywhere; }
.pj-sched { display: flex; flex-direction: column; }
.pj-sched > div { display: grid; grid-template-columns: minmax(70px, auto) minmax(0, 1fr) auto; gap: var(--s-3); padding: var(--s-2) 0; border-bottom: 1px solid var(--line); font-size: var(--t-base); }
.pj-sched > div:last-child { border-bottom: 0; }
.pj-sched .num { color: var(--muted); }
.pj-heads { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: var(--s-2); }
.pj-headcard { display: flex; gap: var(--s-3); align-items: flex-start; padding: var(--s-3); background: var(--field); border-radius: var(--r-md); min-width: 0; }
.pj-headcard > div { min-width: 0; }
.pj-headcard .role { display: block; font-size: var(--t-xs); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--gold-text); }
.pj-headcard b { display: block; font-size: var(--t-md); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pj-headcard .links, .pj-ct .links { display: flex; gap: var(--s-3); flex-wrap: wrap; font-size: var(--t-sm); margin-top: 2px; }
.pj-ct { display: flex; justify-content: space-between; gap: var(--s-3); align-items: center; padding: var(--s-2) 0; border-bottom: 1px solid var(--line); font-size: var(--t-base); }
.pj-ct small { display: block; color: var(--muted); font-size: var(--t-sm); }
/* Post: exports */
.pj-export { display: flex; justify-content: space-between; align-items: center; gap: var(--s-3); flex-wrap: wrap; padding: var(--s-3) var(--s-4); background: var(--field); border-radius: var(--r-md); }
.pj-export b { display: block; font-size: var(--t-md); }
.pj-export small { display: block; color: var(--muted); font-size: var(--t-sm); margin-top: 2px; }
.pj-latest { font-size: var(--t-sm); color: var(--muted); }
.pj-latest:empty { display: none; }
.bd-row.deliv .dl-st { grid-column: 2 / 4; font-size: var(--t-xs); font-weight: 700; letter-spacing: .04em; color: var(--muted); margin-top: -2px; }
.dl-st.ok { color: var(--ok); } .dl-st.bad { color: var(--bad); }
/* ---------- call sheet builder (Phase 4): a spreadsheet, uniform grid lines and 34px rows ---------- */
.pj-wide { display: flex; flex-direction: column; gap: var(--s-4); }
.cs-builder { gap: var(--s-6); }
.cs-block { display: flex; flex-direction: column; min-width: 0; overflow-x: auto; }
.cs-grid { width: 100%; border-collapse: collapse; table-layout: auto; font-size: var(--t-base); border: 1px solid var(--line); }
.cs-grid th, .cs-grid td { border: 1px solid var(--line); height: 34px; padding: 0; vertical-align: middle; }
.cs-grid thead th { background: var(--accent); color: var(--accent-ink); font-size: var(--t-xs); font-weight: 800; letter-spacing: .08em; text-transform: uppercase; text-align: left; padding: 0 var(--s-2); white-space: nowrap; }
.cs-kv th[scope="row"] { width: 1%; white-space: nowrap; background: var(--field); color: var(--muted); font-size: var(--t-xs); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; text-align: left; padding: 0 var(--s-3); }
.cs-in { width: 100%; min-width: 72px; height: 34px; border: 0; background: transparent; color: var(--fg); padding: 0 var(--s-2); font: inherit; font-size: var(--t-base); border-radius: 0; }
select.cs-in { padding-right: var(--s-1); cursor: pointer; }
.cs-in:focus { outline: none; background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); }
.cs-in::placeholder { color: color-mix(in srgb, var(--muted) 70%, transparent); }
.cs-grid .cs-ro { padding: 0 var(--s-2); color: var(--fg); white-space: nowrap; }
.cs-grid .cs-email { max-width: 200px; overflow: hidden; text-overflow: ellipsis; }
.cs-grid .cs-n { width: 32px; text-align: center; color: var(--muted); font-variant-numeric: tabular-nums; }
.cs-grid .cs-time { width: 110px; }
.cs-grid .cs-act { width: 34px; text-align: center; }
.cs-grid thead th.cs-act { padding: 0; }
.cs-grid .cs-act .x-close { margin: 0 auto; }
.cs-mv { width: 28px; height: 28px; border: 0; background: transparent; color: var(--muted); border-radius: var(--r-sm); cursor: pointer; font-size: var(--t-md); }
.cs-mv:hover:not(:disabled) { color: var(--fg); background: var(--field); }
.cs-mv:disabled { opacity: .3; cursor: default; }
.cs-adds { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-4); margin-top: var(--s-2); }
.cs-map { display: flex; flex-direction: column; gap: var(--s-2); margin-top: var(--s-2); }
.cs-map label.btn { cursor: pointer; }
.cs-mapimg { max-width: 420px; width: 100%; border: 1px solid var(--line); border-radius: var(--r-md); }
.cs-builder .pj-add { margin-top: var(--s-2); }
@media (max-width: 600px) { .cs-kv, .cs-kv tbody, .cs-kv tr { display: block; } .cs-kv tr { display: grid; grid-template-columns: 110px minmax(0, 1fr); } .cs-kv th[scope="row"], .cs-kv td { display: flex; align-items: center; width: auto; } .cs-kv td[colspan] { grid-column: 2; } }
/* ---------- Tools & Resources ---------- */
.tools .bench { padding: 0; max-width: none; margin: 0; }
.tool-hub { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--s-3); }
@media (max-width: 1200px) { .tool-hub { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.tool-card { display: grid; grid-template-columns: 40px minmax(0, 1fr); grid-template-rows: auto auto; column-gap: var(--s-3); align-items: center; text-align: left; padding: var(--s-4); background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); color: var(--fg); font: inherit; cursor: pointer; transition: border-color var(--dur-1) var(--ease), transform var(--dur-1) var(--ease); }
.tool-card:hover { border-color: var(--muted); transform: translateY(-1px); }
.tool-card[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.tool-ic { grid-row: 1 / 3; width: 40px; height: 40px; border-radius: var(--r-md); display: grid; place-items: center; background: var(--field); font-size: var(--t-lg); font-weight: 800; }
.tool-card[aria-pressed="true"] .tool-ic { background: var(--accent); color: var(--accent-ink); }
.tool-card b { font-size: var(--t-md); }
.tool-card small { color: var(--muted); font-size: var(--t-sm); }
@media (max-width: 900px) { .tool-hub { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 420px) { .tool-card { grid-template-columns: 32px minmax(0, 1fr); padding: var(--s-3); } .tool-ic { width: 32px; height: 32px; font-size: var(--t-md); } .tool-card small { display: none; } }
.tool-pane { display: flex; flex-direction: column; gap: var(--s-4); min-width: 0; }
.tool-pane.bench { display: grid; }
.tool-pane[hidden] { display: none !important; }
.tl-head { display: flex; justify-content: space-between; align-items: flex-end; gap: var(--s-4); flex-wrap: wrap; }
.tl-head h3 { margin: 0; font-size: var(--t-xl); font-weight: 900; letter-spacing: -.02em; }
.tl-head p { margin: var(--s-1) 0 0; max-width: 640px; }
.tl-list { display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.tl-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: var(--s-4); align-items: center; padding: var(--s-3) var(--s-4); border-top: 1px solid var(--line); }
.tl-row:first-child { border-top: 0; }
.tl-main { display: flex; flex-direction: column; min-width: 0; }
.tl-main b { font-size: var(--t-md); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-main small, .tl-meta { color: var(--muted); font-size: var(--t-sm); }
.tl-meta { white-space: nowrap; }
@media (max-width: 640px) { .tl-row { grid-template-columns: auto minmax(0, 1fr); } .tl-meta { grid-column: 2; } .tl-row .row-actions { grid-column: 1 / -1; justify-content: flex-start; } }
.tl-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: var(--s-4); align-items: start; }
@media (max-width: 1100px) { .tl-split { grid-template-columns: minmax(0, 1fr); } }
/* preview: always white paper, like the PDF */
.pv-pane { position: sticky; top: 96px; background: var(--field); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s-4); max-height: calc(100vh - 120px); overflow: auto; }
.pv-paper { background: #fff; color: #111; border-radius: var(--r-sm); box-shadow: var(--shadow); }
.modal-preview { width: min(860px, 100%); max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); display: flex; flex-direction: column; }
.modal-preview .pv-paper { overflow: auto; flex: 1 1 auto; min-height: 0; border: 1px solid var(--line); }
.pv-doc { padding: 28px 32px 36px; font-size: 12.5px; line-height: 1.5; color: #111; }
.pv-doc h4 { margin: 18px 0 6px; font-size: 10.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: #5f6368; display: flex; align-items: center; gap: 6px; }
.pv-doc h4::before { content: ""; width: 7px; height: 7px; background: #f1c232; }
.pv-doc table { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.pv-doc th { background: #f1c232; text-align: left; padding: 5px 7px; font-size: 9.5px; letter-spacing: .06em; text-transform: uppercase; }
.pv-doc td { padding: 5px 7px; border-bottom: 1px solid #e2e2e2; vertical-align: top; }
.pv-doc tr.grp td { background: #f3f3f3; font-size: 9.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: #5f6368; }
.pv-band { height: 7px; background: #000; margin: -28px -32px 18px; border-radius: 4px 4px 0 0; }
.pv-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.pv-top small { display: block; color: #5f6368; font-size: 10.5px; }
.pv-top .r { text-align: right; } .pv-top h3 { margin: 0; font-size: 22px; font-weight: 900; }
.pv-title { display: flex; justify-content: space-between; gap: 12px; background: #111; color: #fff; padding: 9px 12px; margin: 14px 0; font-weight: 800; font-size: 13px; }
.pv-title .g { color: #f1c232; font-size: 11px; }
.pv-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pv-cols > div, .pv-loc > div { background: #f3f3f3; padding: 8px 10px; display: flex; flex-direction: column; gap: 6px; }
.pv-cols > div.gold { background: #fdf3d3; }
.pv-cols span, .pv-loc span { display: block; font-size: 8.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #5f6368; }
.pv-cols b, .pv-loc b { font-size: 11.5px; font-weight: 600; }
.pv-loc { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
.pv-loc img { width: 200px; border: 1px solid #ddd; }
@media (max-width: 600px) { .pv-cols { grid-template-columns: 1fr; } .pv-loc { grid-template-columns: 1fr; } .pv-doc { padding: 20px 18px 28px; } .pv-band { margin: -20px -18px 14px; } }
.pv-ct h2 { margin: 0 0 4px; font-size: 20px; font-weight: 900; }
.pv-ct h2::after { content: ""; display: block; width: 48px; height: 4px; background: #f1c232; margin-top: 8px; }
.pv-ct h4::before { display: none; }
.pv-ct h4 { color: #111; font-size: 12px; letter-spacing: 0; text-transform: none; }
.pv-ct p { margin: 0 0 8px; } .pv-ct .li { padding-left: 14px; margin-bottom: 4px; } .pv-ct .party { margin-bottom: 10px; }
.pv-ct .sigs { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 10px; line-height: 2; }
/* equipment */
.gear-tabs { align-self: flex-start; }
.gear-body { display: flex; flex-direction: column; gap: var(--s-4); }
.gear-body .pj-card { overflow-x: auto; }
.gear-body .cs-in { min-width: 56px; }
.gear-addrow { display: grid; grid-template-columns: minmax(0, 2fr) 70px minmax(0, 1fr) minmax(0, 1.2fr) auto; gap: var(--s-2); align-items: center; }
#wishAdd.gear-addrow { grid-template-columns: minmax(0, 2fr) 90px 110px minmax(0, 1.4fr) auto; margin-top: var(--s-3); }
@media (max-width: 640px) { .gear-addrow, #wishAdd.gear-addrow { grid-template-columns: 1fr 1fr; } .gear-addrow > :first-child { grid-column: 1 / -1; } }
.gr-pick { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r-md); max-height: 360px; overflow: auto; }
.gr-pick details { border-bottom: 1px solid var(--line); padding: var(--s-2) var(--s-3); }
.gr-pick details:last-child { border-bottom: 0; }
.gr-pick summary { display: flex; justify-content: space-between; align-items: center; cursor: pointer; font-weight: 700; font-size: var(--t-base); }
.gr-pick summary label { display: flex; gap: var(--s-2); align-items: center; }
.gr-item { display: flex; gap: var(--s-2); align-items: center; padding: 3px 0 3px 22px; font-size: var(--t-base); }
/* ---------- Analytics insights + Today extras ---------- */
.an-sub h3 { margin: var(--s-4) 0 0; font-size: var(--t-xl); font-weight: 900; letter-spacing: -.02em; }
.an-insights { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: var(--s-4); align-items: start; }
.in-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-2); }
.in-kpis > div { background: var(--field); border-radius: var(--r-md); padding: var(--s-2) var(--s-3); min-width: 0; }
.in-kpis b { display: block; font-size: var(--t-lg); font-weight: 800; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.in-kpis span { display: block; font-size: var(--t-xs); color: var(--muted); }
.td-nav { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: var(--s-2); }
.td-nav-btn { display: flex; align-items: center; gap: var(--s-2); padding: var(--s-3); background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-md); color: var(--fg); font: inherit; font-size: var(--t-base); font-weight: 600; cursor: pointer; transition: border-color var(--dur-1) var(--ease), transform var(--dur-1) var(--ease); }
.td-nav-btn:hover { border-color: var(--accent); transform: translateY(-1px); }
.td-nav-btn span { width: 24px; height: 24px; border-radius: var(--r-sm); display: grid; place-items: center; background: var(--accent-soft); color: var(--fg); font-weight: 800; flex: none; }
.td-tiles { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.td-tiles button.tile { text-align: left; font: inherit; color: inherit; cursor: pointer; }
.td-more { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.td-pipe { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s-2); }
.td-stage { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: var(--s-2) var(--s-3); background: var(--field); border: 1px solid transparent; border-radius: var(--r-md); color: var(--fg); font: inherit; cursor: pointer; text-align: left; min-width: 0; }
.td-stage:hover { border-color: var(--accent); }
.td-stage b { font-size: var(--t-xl); font-weight: 900; font-variant-numeric: tabular-nums; }
.td-stage span { font-size: var(--t-xs); color: var(--muted); line-height: 1.2; }
.td-stage.paid b { color: var(--ok); }
@media (max-width: 480px) { .td-pipe { grid-template-columns: repeat(2, minmax(0, 1fr)); } .an-insights, .td-more { grid-template-columns: minmax(0, 1fr); } }
/* document previews: logo lockup, labels, figures */
.pv-label { font-size: var(--t-xs, 11px); font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 var(--s-2); }
.pv-brand { display: flex; align-items: center; gap: 10px; }
.pv-brand img { width: 40px; height: 40px; object-fit: contain; flex: none; }
.pv-brand b { display: block; font-size: 14px; font-weight: 800; }
.pv-cols.two { grid-template-columns: repeat(2, 1fr); }
.pv-doc tr.meal td { background: #fdf3d3; }
.pv-doc tr.wrap td { background: #111; color: #fff; font-weight: 700; }
.pv-doc tr.move td { background: #eef3fb; }
.pv-doc mark.fig { background: #fdf3d3; color: #111; font-weight: 800; padding: 0 3px; border-radius: 2px; box-shadow: inset 0 -2px 0 #f1c232; }
.ct-terms { background: #fdf3d3; border-left: 5px solid #f1c232; padding: 10px 14px 12px; margin: 14px 0 6px; }
.ct-terms-h { font-size: 8.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: #5f6368; margin-bottom: 6px; }
.ct-terms > div:not(.ct-terms-h) { display: flex; justify-content: space-between; gap: 12px; padding: 2px 0; font-size: 12px; }
.ct-terms > div b { font-weight: 800; white-space: nowrap; }
.ct-terms > div.big { font-size: 12px; color: #5f6368; font-weight: 700; align-items: baseline; border-bottom: 1px solid rgba(0,0,0,.08); padding-bottom: 6px; margin-bottom: 4px; }
.ct-terms > div.big b { font-size: 22px; color: #111; font-weight: 900; }
.ct-amt { font-weight: 800; color: var(--accent); white-space: nowrap; font-variant-numeric: tabular-nums; }
/* modern call sheet / schedule form */
.csf { display: flex; flex-direction: column; gap: var(--s-3); }
.csf-sec { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--panel); padding: var(--s-4); display: flex; flex-direction: column; gap: var(--s-3); min-width: 0; }
.csf-sec > header { display: flex; align-items: center; gap: var(--s-2); }
.csf-sec h4 { margin: 0; font-size: var(--t-md); font-weight: 800; }
.csf-ic { width: 28px; height: 28px; border-radius: var(--r-md); display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); font-size: 14px; flex: none; }
.csf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--s-3); }
.csf-f { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.csf-f.wide { grid-column: 1 / -1; }
.csf-f > span { font-size: var(--t-xs, 11px); font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.csf-in { width: 100%; min-width: 0; box-sizing: border-box; font: inherit; font-size: var(--t-sm); color: var(--fg); background: var(--field); border: 1px solid transparent; border-radius: var(--r-md); padding: 9px 11px; transition: border-color var(--dur-1) var(--ease), background var(--dur-1) var(--ease); }
.csf-in:hover { border-color: var(--line); }
.csf-in:focus { outline: none; border-color: var(--accent); background: var(--panel); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.csf-in::placeholder { color: var(--muted); opacity: .7; }
.csf-rows { display: flex; flex-direction: column; gap: var(--s-2); }
.csf-row { display: grid; gap: var(--s-2); align-items: center; padding: var(--s-2); border-radius: var(--r-md); background: color-mix(in srgb, var(--field) 45%, transparent); }
.csf-row.tal { grid-template-columns: 24px 1.4fr 1.2fr .8fr .8fr .8fr 28px; }
.csf-row.tal .wide { grid-column: 2 / -2; }
.csf-row.crew { grid-template-columns: 32px minmax(0, 1.4fr) 1fr 1fr .8fr 28px; }
.csf-row.onset { grid-template-columns: 1.2fr 1fr 1fr .8fr 28px; }
.csf-row.sched { grid-template-columns: minmax(0, .9fr) minmax(0, .8fr) minmax(0, 2fr) auto 28px; }
.csf-row.sched.meal { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.csf-row.sched.wrap { background: color-mix(in srgb, var(--fg) 12%, transparent); }
.csf-row.sched.move { background: color-mix(in srgb, #5b8def 14%, transparent); }
.csf-n { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--field); font-size: 11px; font-weight: 800; color: var(--muted); }
.csf-who { display: flex; flex-direction: column; min-width: 0; }
.csf-who b, .csf-who small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.csf-who small { color: var(--muted); font-size: var(--t-xs, 11px); }
.csf-dept { font-size: var(--t-xs, 11px); font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-top: var(--s-2); }
.csf-dept:first-child { margin-top: 0; }
.csf-actions { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: center; }
.csf-foot { display: flex; flex-direction: column; gap: var(--s-2); padding-top: var(--s-2); }
.csf-move { display: flex; gap: 2px; }
.csf-move button { width: 26px; height: 26px; padding: 0; border: 1px solid var(--line); background: var(--panel); color: var(--fg); border-radius: var(--r-sm); cursor: pointer; font: inherit; font-size: 12px; }
.csf-move button:disabled { opacity: .35; cursor: default; }
@media (max-width: 700px) {
  .csf-sec { padding: var(--s-3); }
  .csf-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .csf-row.tal, .csf-row.onset { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .csf-row.tal .csf-n { display: none; } .csf-row.tal .wide { grid-column: 1 / -1; }
  .csf-row.crew { grid-template-columns: 32px minmax(0, 1fr) 28px; } .csf-row.crew .csf-in { grid-column: 1 / -1; }
  .csf-row.crew .x-close { grid-column: 3; grid-row: 1; }
  .csf-row.sched { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .csf-row.sched [data-sr$="|desc"] { grid-column: 1 / -1; } .csf-row.sched .x-close { justify-self: end; }
  .csf-row .x-close { justify-self: end; }
}/* row options: a quiet ⋯ until the row is hovered or focused, then the four buttons ease in, staggered, in the same fixed column */
@media (hover: hover) and (min-width: 761px) {
  .row-opts { position: relative; }
  .row-opts::before { content: "⋯"; position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 18px; letter-spacing: 1px; pointer-events: none; transition: opacity var(--dur-2, 220ms) var(--ease), transform var(--dur-2, 220ms) var(--ease); }
  .row-opts > * { opacity: 0; transform: translateX(8px) scale(.92); pointer-events: none; transition: opacity 220ms var(--ease), transform 260ms cubic-bezier(.2, .8, .2, 1); }
  .row-opts > :nth-child(2) { transition-delay: 30ms; } .row-opts > :nth-child(3) { transition-delay: 60ms; } .row-opts > :nth-child(4) { transition-delay: 90ms; }
  .inv-row:hover .row-opts::before, .inv-row:focus-within .row-opts::before, .row-opts:has(.armed)::before { opacity: 0; transform: scale(.6); }
  .inv-row:hover .row-opts > *, .inv-row:focus-within .row-opts > *, .row-opts:has(.armed) > * { opacity: 1; transform: none; pointer-events: auto; }
}

/* =====================================================================
   BOUTIQUE LAYER: the Reeleyes site's language (black, grotesk caps, yellow, mono captions, hairlines).
   Documents (invoice sheet, previews) keep the template's Roboto.
   ===================================================================== */
:root {
  --font-body: "Geist", "Segoe UI", system-ui, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, Consolas, monospace;
  --bg: #f4f3ef; --panel: #ffffff; --field: #f0efea; --fg: #0b0b0b; --muted: #66655f; --line: #e3e1d9;
  --accent: #ffd500; --accent-ink: #0b0b0b; --accent-soft: #fff6c2; --gold-text: #7a5c00; --focus: #7a5c00;
  --r-sm: 5px; --r-md: 9px; --r-lg: 14px;
  --shadow: 0 1px 0 rgba(0,0,0,.03), 0 24px 48px -28px rgba(0,0,0,.25);
  --ease: cubic-bezier(.2, .8, .2, 1);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000; --panel: #0a0a0a; --field: #141414; --fg: #e9e9e9; --muted: #8c8c8c; --line: #1e1e1e;
    --accent: #ffd500; --accent-soft: #241f00; --gold-text: #ffd500; --focus: #ffd500; --chart-bar: #ffd500;
    --shadow: 0 30px 60px -30px rgba(0,0,0,.9);
  }
}
:root[data-theme="dark"] {
  --bg: #000000; --panel: #0a0a0a; --field: #141414; --fg: #e9e9e9; --muted: #8c8c8c; --line: #1e1e1e;
  --accent: #ffd500; --accent-soft: #241f00; --gold-text: #ffd500; --focus: #ffd500; --chart-bar: #ffd500;
  --shadow: 0 30px 60px -30px rgba(0,0,0,.9);
}
body { font-feature-settings: "ss01", "tnum" 0; letter-spacing: -.003em; -webkit-font-smoothing: antialiased; }
.sheet, .pv-doc, .pv-paper { font-family: "Roboto", "Segoe UI", system-ui, sans-serif; letter-spacing: 0; }
::selection { background: var(--accent); color: #000; }

/* top bar: black, one gold hairline, dot navigation, Toronto clock */
.topbar { border-bottom: 0; box-shadow: inset 0 -1px 0 color-mix(in srgb, var(--accent) 70%, transparent); }
.topbar-inner { padding-block: 14px; gap: var(--s-4); }
.brand-name { font-weight: 800; letter-spacing: .02em; font-size: 23px; }
.brand-sub { font-family: var(--font-mono); font-weight: 400; letter-spacing: .22em; font-size: 10px; }
.access-chip { font-family: var(--font-mono); font-weight: 500; font-size: 10px; letter-spacing: .14em; border-radius: var(--r-pill); border-color: color-mix(in srgb, var(--accent) 60%, transparent); }
.tabs { background: transparent; padding: 0; gap: 2px; }
.tab { color: #8c8c8c; padding: 6px 10px; border-radius: var(--r-md); font-weight: 500; font-size: 13.5px; letter-spacing: -.005em; transition: color var(--dur-1) var(--ease); }
.tab::before { content: ""; width: 6px; height: 6px; border-radius: 50%; box-shadow: inset 0 0 0 1.25px currentColor; flex: none; transition: background var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease), transform var(--dur-2) var(--ease); }
.tab:hover { color: #fff; }
.tab[aria-selected="true"] { background: transparent; color: #fff; font-weight: 600; }
.tab[aria-selected="true"]::before { background: var(--accent); box-shadow: none; transform: scale(1.25); }
.tab-hq { color: var(--accent); box-shadow: none; font-weight: 700; letter-spacing: 0; }
.tab-hq::before { display: none; }
.tab-hq svg { width: 15px; height: 15px; }
.tab-hq:hover { background: transparent; color: var(--accent); }
.tab-hq[aria-selected="true"] { box-shadow: none; color: #000; background: var(--accent); }
.tab-hq + .tab { margin-left: var(--s-3); }
.tb-clock { font-family: var(--font-mono); font-size: 11px; color: #8c8c8c; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.tb-clock b { color: #fff; font-weight: 500; font-variant-numeric: tabular-nums; letter-spacing: .04em; }
@media (max-width: 1100px) { .tb-clock { display: none; } }
.topbar .btn { border-color: #262626; border-radius: var(--r-pill); }

/* buttons and fields: crisper corners, quieter borders */
.btn { border-radius: var(--r-md); font-weight: 500; letter-spacing: -.005em; transition: border-color var(--dur-1) var(--ease), background var(--dur-1) var(--ease), transform var(--dur-1) var(--ease); }
.btn:active { transform: translateY(1px); }
.btn-primary, .topbar .btn-primary { font-weight: 600; }
.pill { border-radius: var(--r-pill); }
.field input, .field textarea, .field select, .pj-in, .csf-in { border-radius: var(--r-md); }

/* editorial headings: heavy grotesk caps for page titles, mono captions for everything that labels */
.ledger-title { font-weight: 800; text-transform: uppercase; letter-spacing: -.025em; line-height: .92; font-size: clamp(34px, 5.2vw, 56px); }
.pj-hero .ledger-title { font-size: clamp(44px, 8vw, 76px); }
.ledger-head .hint, .pj-hero .hint { font-family: var(--font-mono); font-size: 12px; letter-spacing: .01em; margin-top: var(--s-2); }
.an-card h3, .pj-card h3, .panel h2, .pj-label, .tile .k, .csf-sec h4, .tl-head h3 + p, .td-sec-head h3, .an-card-head .hint, .pj-card header .hint {
  font-family: var(--font-mono); text-transform: uppercase; letter-spacing: .08em; font-size: 11px; font-weight: 500; color: var(--muted);
}
.an-card h3, .pj-card h3, .csf-sec h4, .td-sec-head h3 { color: var(--fg); }
.an-card-head .hint, .pj-card header .hint { text-transform: none; letter-spacing: .01em; }
.tl-head h3 { font-weight: 800; text-transform: uppercase; letter-spacing: -.02em; font-size: clamp(26px, 3.4vw, 36px); line-height: .95; }

/* surfaces: hairline cards, no heavy shadow */
.an-card, .pj-card, .panel, .csf-sec, .tool-card, .tl-list, .tile { border-radius: var(--r-lg); box-shadow: none; }
.an-card, .pj-card { padding: 18px 20px; }
.tool-card { padding: 18px; transition: border-color var(--dur-2) var(--ease), transform var(--dur-2) var(--ease), background var(--dur-2) var(--ease); }
.tool-card:hover { transform: translateY(-2px); }
.tool-ic { border-radius: 50%; }
.csf-ic { border-radius: 50%; width: 24px; height: 24px; font-size: 12px; }

/* headline numbers: a hairline grid, big numerals, no boxes */
.tiles { gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.tiles .tile { border: 0; border-radius: 0; background: var(--panel); padding: 18px 20px 20px; gap: 6px; }
.tile .v { font-size: clamp(24px, 2.6vw, 34px); font-weight: 700; letter-spacing: -.03em; line-height: 1; }
.tile .s { font-size: 12px; }
.tile.bad .v { color: var(--bad); } .tile.ok .v { color: var(--fg); }
.tile.ok .k::after { content: " ●"; color: var(--ok); }
.good { color: var(--ok); } .bad { color: var(--bad); }
.td-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 860px) { .td-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Today */
.td-hero { gap: var(--s-8); padding: 12px 0 8px; border-bottom: 1px solid var(--line); padding-bottom: var(--s-6); }
.td-date { font-family: var(--font-mono); text-transform: uppercase; letter-spacing: .1em; font-size: 11px; color: var(--gold-text); margin: 0 0 var(--s-2); }
.td-sum { font-size: var(--t-md); color: var(--muted); }
.td-sum b { color: var(--fg); }
.td-sec-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s-3); margin-bottom: var(--s-2); }
.td-sec-head h3 { margin: 0; }
.td-pipe { grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.td-stage { border-radius: 0; background: var(--panel); padding: 14px 14px 12px; gap: 4px; transition: background var(--dur-1) var(--ease); }
.td-stage:hover { border-color: transparent; background: var(--field); }
.td-stage b { font-size: 28px; font-weight: 700; letter-spacing: -.03em; line-height: 1; }
.td-stage span { font-family: var(--font-mono); font-size: 10px; text-transform: uppercase; letter-spacing: .06em; }
.td-stage small { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.td-stage.zero b { color: var(--muted); opacity: .45; }
@media (max-width: 900px) { .td-pipe { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 480px) { .td-pipe { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.td-board { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: var(--s-4); align-items: start; }
.td-col { display: flex; flex-direction: column; gap: var(--s-4); min-width: 0; }
@media (max-width: 900px) { .td-board { grid-template-columns: minmax(0, 1fr); } }
.td-ag { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: var(--s-3); align-items: center; width: 100%; padding: 10px 4px; border: 0; border-top: 1px solid var(--line); background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; transition: background var(--dur-1) var(--ease); }
.td-ag:first-child { border-top: 0; }
.td-ag:hover { background: var(--field); }
.td-ag-date { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 44px; border: 1px solid var(--line); border-radius: var(--r-md); line-height: 1; }
.td-ag-date b { font-size: 18px; font-weight: 700; letter-spacing: -.02em; }
.td-ag-date small { font-family: var(--font-mono); font-size: 9.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-top: 3px; }
.td-ag-date.soon { border-color: var(--accent); background: var(--accent-soft); }
.td-ag-date.bad { border-color: var(--bad); }
.td-tag { font-family: var(--font-mono); font-size: 9.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--gold-text); margin-right: 6px; }
.td-ag .td-main div { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.td-ag .td-main small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }

/* Insights: one band of headline numbers, then paired cards */
.an-insights { display: flex; flex-direction: column; gap: var(--s-4); }
.in-band { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.in-band > div { background: var(--panel); padding: 16px 18px; min-width: 0; }
.in-band b { display: block; font-size: clamp(22px, 2.4vw, 30px); font-weight: 700; letter-spacing: -.03em; line-height: 1.05; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.in-band b small { font-size: 13px; font-weight: 500; color: var(--muted); margin-left: 4px; letter-spacing: 0; }
.in-band span { display: block; margin-top: 6px; font-family: var(--font-mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
@media (max-width: 900px) { .in-band { grid-template-columns: repeat(2, minmax(0, 1fr)); } .in-band > div:last-child { grid-column: 1 / -1; } }
.in-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-4); align-items: stretch; }
@media (max-width: 860px) { .in-grid { grid-template-columns: minmax(0, 1fr); } }
.in-note { margin: 0 0 var(--s-2); font-size: var(--t-base); color: var(--muted); }
.in-note b { color: var(--fg); }
.cl-fill { border-radius: 0 !important; }

/* projects: modules panel, one-column screens, the new-project setup */
.pj-mods { display: grid; grid-template-columns: minmax(200px, 1fr) auto; gap: var(--s-3) var(--s-6); align-items: center; padding: 16px 20px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--panel); animation: pjModsIn var(--dur-2) var(--ease); }
@keyframes pjModsIn { from { opacity: 0; transform: translateY(-4px); } }
.pj-mods > div:first-child b { display: block; font-family: var(--font-mono); text-transform: uppercase; letter-spacing: .08em; font-size: 11px; font-weight: 500; }
.pj-mods > div:first-child small { display: block; color: var(--muted); font-size: 12px; margin-top: 4px; max-width: 460px; }
.pj-mod-list { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.pj-mod { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px 7px 9px; border: 1px solid var(--line); border-radius: var(--r-pill); background: transparent; color: var(--muted); font: inherit; font-size: 13px; cursor: pointer; transition: all var(--dur-2) var(--ease); }
.pj-mod i { width: 26px; height: 15px; border-radius: 99px; background: var(--field); box-shadow: inset 0 0 0 1px var(--line); position: relative; transition: background var(--dur-2) var(--ease); }
.pj-mod i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 11px; height: 11px; border-radius: 50%; background: var(--muted); transition: transform var(--dur-2) var(--ease), background var(--dur-2) var(--ease); }
.pj-mod[aria-pressed="true"] { color: var(--fg); border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); }
.pj-mod[aria-pressed="true"] i { background: var(--accent); box-shadow: none; }
.pj-mod[aria-pressed="true"] i::after { transform: translateX(11px); background: #000; }
.pj-mod-presets { grid-column: 1 / -1; display: flex; gap: var(--s-4); align-items: center; border-top: 1px solid var(--line); padding-top: var(--s-3); }
@media (max-width: 760px) { .pj-mods { grid-template-columns: minmax(0, 1fr); } }
.pj-grid.one { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 901px) { .pj-steps { grid-template-columns: repeat(var(--n, 7), minmax(0, 1fr)); } }
.pj-attach { margin-top: var(--s-2); width: 100%; }
.pj-doc .x-close { margin-left: 6px; vertical-align: middle; }
.pn-inv { max-height: 180px; }
.pn-kind { display: inline-flex; width: fit-content; }
.field .lbl { font-size: var(--t-sm); color: var(--muted); font-weight: 500; }
.pj-empty-stage { align-items: flex-start; }

/* invoice → project prompt */
.pj-offer { width: min(440px, 100%); gap: var(--s-3); }
.pj-offer .k { font-family: var(--font-mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--gold-text); }
.pj-offer h3 { font-size: 26px; font-weight: 800; text-transform: uppercase; letter-spacing: -.02em; line-height: 1; margin: 0; }
.pj-offer-acts { display: flex; flex-direction: column; gap: var(--s-2); margin-top: var(--s-2); }
.pj-offer-acts > .btn { justify-content: center; padding-block: 11px; }
.pj-offer-or { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--s-2); }
.pj-offer > .link-btn { align-self: center; color: var(--muted); }
.modal { border-radius: var(--r-lg); border: 1px solid var(--line); }
.modal-back { backdrop-filter: blur(6px); background: rgba(0,0,0,.55); }

/* signature footer */
.sig { display: flex; justify-content: space-between; gap: var(--s-4); flex-wrap: wrap; max-width: 1480px; margin: var(--s-12) auto 0; padding: var(--s-4) max(16px, env(safe-area-inset-left, 0px)) calc(var(--s-6) + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); font-family: var(--font-mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
@media (max-width: 720px) { .tab::before { display: none; } .tab { padding: 6px 8px; } .tab-hq + .tab { margin-left: var(--s-1); } }

/* project payments: past invoices and what's left to invoice */
.pj-attach-l { display: flex; flex-direction: column; gap: 4px; margin-top: var(--s-2); padding-top: var(--s-3); border-top: 1px solid var(--line); }
.pj-attach-l > span { font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.pj-attach-l small { color: var(--muted); font-size: 12px; }
.pj-attach-l .pj-attach { margin-top: 0; }
.pj-toinv { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 2px var(--s-3); padding: 10px 12px; border: 1px dashed color-mix(in srgb, var(--accent) 60%, var(--line)); border-radius: var(--r-md); background: var(--accent-soft); }
.pj-toinv span { font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.pj-toinv b { font-size: 18px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.pj-toinv small { grid-column: 1 / -1; color: var(--muted); font-size: 12px; }
/* project health colour: red → green with progress, red (deepening) when payment is overdue */
.pj-dots i.on, .pj-dots i.paid { background: var(--pj-tone, var(--accent)); }
.pj-steps .pj-step.done i, .pj-steps .pj-step.now i, .pj-steps .pj-step.paid i { background: var(--pj-tone, var(--accent)); }
.pj-row.late { box-shadow: inset 3px 0 0 var(--pj-tone); }
.pj-row.late .pj-dots i { background: var(--pj-tone); }
.pj-late { color: var(--pj-tone); font-weight: 700; }
.pj-steps.late .pj-step i { background: color-mix(in srgb, var(--pj-tone) 35%, var(--line)); }
.pj-steps.late .pj-step.done i, .pj-steps.late .pj-step.now i { background: var(--pj-tone); }
/* still to invoice: a button that makes the invoice */
button.pj-toinv { width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer; transition: border-color var(--dur-1) var(--ease), transform var(--dur-1) var(--ease); }
button.pj-toinv:hover { border-style: solid; border-color: var(--accent); transform: translateY(-1px); }
.pj-toinv em { grid-column: 1 / -1; font-style: normal; font-size: 12px; font-weight: 600; color: var(--gold-text); }
/* a quote kept as a proposal only */
.pj-est { margin-left: 8px; padding: 1px 7px; border: 1px solid var(--line); border-radius: var(--r-pill); background: transparent; color: var(--muted); font: inherit; font-family: var(--font-mono); font-size: 10px; text-transform: uppercase; letter-spacing: .05em; cursor: pointer; vertical-align: middle; }
.pj-est:hover { color: var(--fg); border-color: var(--muted); }
.pj-est[aria-pressed="true"] { color: var(--gold-text); border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }
.pj-doc.is-est .num { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line); }
/* Today greeting: calm sentence case, not a shout */
.td-greet { margin: 0; font-size: clamp(26px, 3.4vw, 40px); font-weight: 700; letter-spacing: -.03em; line-height: 1.05; }
.td-quip { margin: 6px 0 0; font-size: var(--t-md); color: var(--gold-text); font-style: italic; }
/* gear: values, links, and the asset total */
.gear-table .gear-val { width: 110px; }
.gear-table input.est { color: var(--gold-text); font-style: italic; }
.gear-linkcell { min-width: 190px; }
.gear-linkcell { display: table-cell; }
.gear-linkcell input { width: calc(100% - 74px); display: inline-block; vertical-align: middle; }
.gear-go { display: inline-block; width: 68px; margin-left: 4px; text-align: center; vertical-align: middle; font-size: 11px; font-weight: 600; white-space: nowrap; color: var(--gold-text); text-decoration: none; padding: 5px 4px; border: 1px solid var(--line); border-radius: var(--r-pill); }
.gear-go:hover { border-color: var(--accent); }
.gear-total { flex-direction: row; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: var(--s-4); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.gear-total-fig { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.gear-total-fig span { font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.gear-total-fig b { font-size: clamp(30px, 4vw, 44px); font-weight: 700; letter-spacing: -.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.gear-total-fig small { color: var(--muted); font-size: 12px; max-width: 520px; }
/* Today hero on phones: the logo tucks into the corner so the greeting and buttons get the full width */
@media (max-width: 600px) {
  .td-hero { position: relative; display: block; }
  .td-hero .re3d { position: absolute; top: 0; right: -6px; width: 84px; height: 78px; }
  .td-hello { width: 100%; }
  .td-date, .td-greet { padding-right: 88px; }
  .td-quick { flex-wrap: wrap; }
}@media (max-width: 900px) { .td-pipe > :last-child { grid-column: span 2; } }.gear-table { min-width: 620px; }
.gear-table th:first-child, .gear-table td:first-child { min-width: 200px; width: 26%; }
/* backup tile: the check button sits in the corner so its label lines up with the other tiles */
.bk-tile { position: relative; }
.bk-tile .bk-head { display: block; padding-right: 34px; }
.bk-tile .bk-check { position: absolute; top: 12px; right: 12px; margin: 0; }
.bk-tile .v { font-size: clamp(20px, 2.2vw, 26px) !important; line-height: 1.1; }

/* top nav: the sections in the Executive Dashboard type (Projects keeps its own) */
.tab:not(.tab-hq) { font-family: var(--font-mono); font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: .12em; }
.tab:not(.tab-hq)[aria-selected="true"] { font-weight: 600; }

/* project stages on phones: one clean row of segments; the stage name is in the bar below */
@media (max-width: 760px) {
  .pj-steps { display: grid; grid-template-columns: repeat(var(--n, 7), minmax(0, 1fr)) !important; gap: 4px; row-gap: 0; }
  .pj-step { padding: 10px 0 6px; gap: 0; }
  .pj-step span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .pj-step i, .pj-step.now i { height: 8px; border-radius: 99px; }
  .pj-step.viewing i { box-shadow: 0 0 0 2px var(--bg), 0 0 0 3.5px var(--fg); }
  .pj-stagebar { gap: var(--s-3); }
  .pj-stagebar .row-actions { width: 100%; }
  .pj-stagebar .row-actions .btn { flex: 1 1 auto; justify-content: center; }
}
@media (max-width: 720px) { .tab:not(.tab-hq) { letter-spacing: .03em; font-size: 10.5px; padding: 6px 5px; } .tabs { gap: 0; } }

/* tile labels with a control in them stay one line tall, so every value starts at the same height */
.tile .k { display: flex; align-items: center; gap: 6px; min-height: 16px; line-height: 16px; }
.tile .k .year-pick { height: 18px; padding: 0 16px 0 4px; font: inherit; font-size: 11px; line-height: 16px; border: 1px solid var(--line); border-radius: var(--r-sm); background-color: transparent; color: var(--fg); }
@media (max-width: 600px) { .tiles > :nth-last-child(2):nth-child(odd):has(+ .bk-tile) { grid-column: 1 / -1; } }
/* smoother, rounder: tables get rounded corners, controls ease between states */
.cs-grid { border-collapse: separate; border-spacing: 0; border-radius: var(--r-md); overflow: hidden; border: 1px solid var(--line); }
.cs-grid thead th:first-child { border-top-left-radius: var(--r-md); }
.cs-grid thead th:last-child { border-top-right-radius: var(--r-md); }
.cs-grid tbody tr:last-child td { border-bottom: 0; }
.cs-grid td, .cs-grid th { border-left: 0; border-right: 0; }
.pv-doc .cs-grid, .sheet table { border-radius: 0; overflow: visible; border: 0; }
.gear-body .pj-card { overflow-x: auto; scrollbar-width: thin; }
.btn, .pill, .opt, .tab, .seg button, .link-btn, .tool-card, .pj-row, .td-row, .td-ag, .td-stage, .cl-row, .x-close, .cs-mv, .pj-mod, .pj-est, .csf-in, .cs-in, .pj-in, .field input, .field select, .field textarea {
  transition: background-color 180ms var(--ease), border-color 180ms var(--ease), color 180ms var(--ease), box-shadow 220ms var(--ease), transform 220ms var(--ease), opacity 180ms var(--ease);
}
.cs-in, .pj-in { border-radius: var(--r-sm); }
.seg { border-radius: var(--r-pill); } .seg button { border-radius: var(--r-pill); }
.chip, .access-chip, .st, .ct-tag { border-radius: var(--r-pill); }
.pj-row { border-radius: var(--r-md); }
.modal { border-radius: var(--r-lg); }@media (max-width: 600px) {
  .gear-table { min-width: 0; }
  .gear-table th:nth-child(4), .gear-table td:nth-child(4) { display: none; }
  .gear-table th:first-child, .gear-table td:first-child { min-width: 0; width: auto; }
  .gear-table .cs-time { width: 52px; } .gear-table .gear-val { width: 92px; }
}
/* projects paid in full but not marked complete */
.pj-close { display: grid; gap: var(--s-3); padding: 16px 18px; margin-bottom: var(--s-3); border: 1px solid color-mix(in srgb, var(--ok) 45%, var(--line)); border-radius: var(--r-lg); background: color-mix(in srgb, var(--ok) 7%, var(--panel)); }
.pj-close b { display: block; font-size: var(--t-md); }
.pj-close small { color: var(--muted); font-size: 12px; }
.pj-close-list { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.pj-close-item { display: inline-flex; align-items: center; gap: 8px; padding: 4px 4px 4px 12px; border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--panel); font-size: 13px; font-weight: 600; }
.pj-close-item .pill { padding: 4px 10px; font-size: 12px; }
.pj-close > .link-btn { justify-self: start; }

/* gear table: clean column dividers, a status pill, values on the right in CAD */
.gear-table th + th, .gear-table td + td { border-left: 1px solid color-mix(in srgb, var(--line) 75%, transparent); }
.gear-table thead th + th { border-left-color: rgba(0, 0, 0, .12); }
.gear-table th.cs-act, .gear-table td.cs-act { border-left: 0; }
.gear-table .gear-val { width: 140px; text-align: right; }
.gear-table .gear-val input { text-align: right; font-variant-numeric: tabular-nums; }
.gear-table .gear-st { width: 118px; text-align: center; }
.gear-av { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border: 1px solid var(--line); border-radius: var(--r-pill); background: transparent; color: var(--muted); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.gear-av::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--bad); }
.gear-av.on { color: var(--fg); border-color: color-mix(in srgb, var(--ok) 45%, var(--line)); }
.gear-av.on::before { background: var(--ok); }
.gear-av:hover { border-color: var(--muted); }
.gear-table tr.is-out td input { opacity: .5; }
.gear-vtoggle { align-self: center; }
.gear-total-fig b { overflow-wrap: anywhere; }
@media (max-width: 600px) {
  .gear-table .gear-st { width: 44px; }
  .gear-av { padding: 4px; font-size: 0; gap: 0; } .gear-av::before { width: 10px; height: 10px; }
  .gear-table .gear-val { width: 104px; }
}@media (max-width: 600px) {
  .gear-table { table-layout: fixed; width: 100%; }
  .gear-table th:first-child, .gear-table td:first-child { width: auto; }
  .gear-table .cs-time { width: 38px; } .gear-table .gear-st { width: 34px; } .gear-table .gear-val { width: 92px; } .gear-table .cs-act { width: 26px; }
  .gear-table td, .gear-table th { padding-left: 4px; padding-right: 4px; }
  .gear-table th { font-size: 9px; letter-spacing: .02em; }
  .gear-table .gear-st { font-size: 0; } .gear-table th.gear-st::after { content: "•"; font-size: 12px; }
}
/* crew pay: a toggle on each crew row, the Crew pay card, and the Contacts card */
.in-band { grid-template-columns: repeat(6, minmax(0, 1fr)); }
@media (max-width: 1100px) { .in-band { grid-template-columns: repeat(3, minmax(0, 1fr)); } .in-band > div:last-child { grid-column: auto; } }
@media (max-width: 600px) { .in-band { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.crew-paid { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border: 1px solid var(--line); border-radius: var(--r-pill); background: transparent; color: var(--muted); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.crew-paid::before { content: ""; width: 12px; height: 12px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px currentColor; flex: none; }
.crew-paid:hover { color: var(--fg); border-color: var(--muted); }
.crew-paid.on { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 50%, var(--line)); background: color-mix(in srgb, var(--ok) 10%, transparent); }
.crew-paid.on::before { background: var(--ok); box-shadow: none; -webkit-mask: none; }
.pj-rate .crew-paid { margin-left: auto; }
.cp-rows { display: flex; flex-direction: column; }
.cp-row { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto auto; gap: var(--s-3); align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.cp-row:first-child { border-top: 0; }
.cp-row .num { font-weight: 700; font-variant-numeric: tabular-nums; }
.cp-row.is-paid .num { color: var(--muted); }
.cp-who { display: flex; flex-direction: column; min-width: 0; }
.cp-who b, .cp-who small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cp-who small { color: var(--muted); font-size: 12px; }
.cp-owing { display: flex; justify-content: space-between; align-items: baseline; padding: 10px 12px; border-radius: var(--r-md); background: color-mix(in srgb, var(--bad) 9%, transparent); }
.cp-owing span { font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.cp-owing b { font-size: 18px; letter-spacing: -.02em; }
.cp-owing.done { background: color-mix(in srgb, var(--ok) 10%, transparent); color: var(--ok); }
.cd-pay > div { display: grid !important; grid-template-columns: minmax(0, 1fr) auto auto; gap: var(--s-3); align-items: center; }
.cd-pay span small { display: block; color: var(--muted); font-size: 11.5px; }
.cd-pay .is-paid .num { color: var(--muted); }
.ct-stats .owed b { color: var(--bad); }
@media (max-width: 480px) { .cp-row { grid-template-columns: 28px minmax(0, 1fr) auto; } .cp-row .crew-paid { grid-column: 2 / -1; justify-self: start; } }
.pj-rate { grid-template-columns: 96px 84px 64px minmax(0, 1fr) auto; }
@media (max-width: 520px) { .pj-rate { grid-template-columns: 1fr 1fr 64px; } .pj-rate .crew-paid { grid-column: 1 / -1; justify-self: start; margin-left: 0; } }

/* profit: gain/loss colours validated against each surface (dataviz validator, both modes pass) */
:root { --pf-gain: #b58900; --pf-loss: #cc3d63; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --pf-gain: #ad8600; --pf-loss: #e0507a; } }
:root[data-theme="dark"] { --pf-gain: #ad8600; --pf-loss: #e0507a; }
.pf-card { display: flex; flex-direction: column; gap: var(--s-4); }
.pf-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.pf-kpis > div { background: var(--panel); padding: 12px 14px; min-width: 0; }
.pf-kpis span { display: block; font-family: var(--font-mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.pf-kpis b { display: block; margin-top: 4px; font-size: clamp(20px, 2.2vw, 28px); letter-spacing: -.03em; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pf-kpis b.neg, .pf-table td.neg { color: var(--bad); }
@media (max-width: 700px) { .pf-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.pf-chart { position: relative; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 2px; height: 220px; padding-top: 18px; }
.pf-plot::after { content: ""; position: absolute; left: -1px; right: -1px; top: var(--zero); border-top: 1px solid var(--line); }
.pf-col { position: relative; display: grid; grid-template-rows: minmax(0, 1fr) 22px; border: 0; padding: 0; background: transparent; color: inherit; font: inherit; cursor: default; border-radius: var(--r-sm); }
.pf-col[data-in-project] { cursor: pointer; }
.pf-col:hover, .pf-col:focus-visible { background: color-mix(in srgb, var(--fg) 5%, transparent); }
.pf-plot { position: relative; }
.pf-bar { position: absolute; left: 50%; width: min(26px, 56%); transform: translateX(-50%); bottom: calc(100% - var(--zero)); background: var(--pf-gain); border-radius: 4px 4px 0 0; }
.pf-bar.loss { bottom: auto; top: var(--zero); background: var(--pf-loss); border-radius: 0 0 4px 4px; background-image: repeating-linear-gradient(135deg, transparent 0 3px, rgba(255,255,255,.22) 3px 4.5px); }
.pf-lab { position: absolute; left: 50%; transform: translate(-50%, -100%); bottom: calc(100% - var(--zero)); margin-bottom: 0; font-style: normal; font-size: 11px; font-weight: 700; color: var(--fg); white-space: nowrap; padding-bottom: 3px; }
.pf-mon { align-self: center; font-family: var(--font-mono); font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.pf-tip { position: absolute; z-index: 5; bottom: calc(100% - 8px); left: 50%; transform: translateX(-50%); min-width: 150px; display: none; flex-direction: column; gap: 3px; padding: 10px 12px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow); text-align: left; font-size: 12px; pointer-events: none; }
.pf-tip > b { font-size: 12px; margin-bottom: 2px; } .pf-tip span { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); } .pf-tip span b { color: var(--fg); font-variant-numeric: tabular-nums; }
.pf-tip small { color: var(--muted); font-size: 11px; }
.pf-col:hover .pf-tip, .pf-col:focus-visible .pf-tip { display: flex; }
.pf-col:first-child .pf-tip { left: 0; transform: none; } .pf-col:last-child .pf-tip { left: auto; right: 0; transform: none; }
@media (max-width: 600px) { .pf-chart { height: 180px; } .pf-mon { font-size: 8.5px; letter-spacing: 0; } .pf-col:nth-child(-n+3) .pf-tip { left: 0; transform: none; } .pf-col:nth-last-child(-n+3) .pf-tip { left: auto; right: 0; transform: none; } }
.pf-note { margin: 0; font-size: 12px; color: var(--muted); }
.pf-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.pf-table th { font-family: var(--font-mono); font-size: 10px; font-weight: 500; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); text-align: left; padding: 0 6px 8px; border-bottom: 1px solid var(--line); }
.pf-table td { padding: 9px 6px; border-bottom: 1px solid var(--line); vertical-align: top; font-variant-numeric: tabular-nums; }
.pf-table tr:last-child td { border-bottom: 0; }
.pf-table .r { text-align: right; white-space: nowrap; }
.pf-table td small { display: block; color: var(--muted); font-size: 11.5px; margin-top: 2px; }
.pf-table tbody tr { cursor: pointer; transition: background-color 150ms var(--ease); }
.pf-table tbody tr:hover, .pf-table tbody tr:focus-visible { background: color-mix(in srgb, var(--fg) 5%, transparent); outline: none; }
@media (max-width: 600px) { .pf-table th:nth-child(2), .pf-table td:nth-child(2), .pf-table th:nth-child(3), .pf-table td:nth-child(3) { display: none; } }
.an-insights { align-items: stretch; }

/* Contacts: who you owe */
.ct-owed { grid-column: 1 / -1; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--s-4) var(--s-6); align-items: center; padding: 16px 18px; border: 1px solid color-mix(in srgb, var(--bad) 40%, var(--line)); border-radius: var(--r-lg); background: color-mix(in srgb, var(--bad) 6%, var(--panel)); }
.ct-owed > div:first-child span { display: block; font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.ct-owed > div:first-child b { display: block; font-size: clamp(26px, 3vw, 34px); letter-spacing: -.03em; line-height: 1.1; color: var(--bad); }
.ct-owed > div:first-child small { color: var(--muted); font-size: 12px; }
.ct-owed-list { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.ct-owed-chip { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--panel); color: var(--fg); font: inherit; font-size: 13px; cursor: pointer; transition: border-color 180ms var(--ease), transform 180ms var(--ease); }
.ct-owed-chip:hover { border-color: var(--muted); transform: translateY(-1px); }
.ct-owed-chip .ct-avatar { width: 26px; height: 26px; font-size: 10px; }
.ct-owed-chip b { font-variant-numeric: tabular-nums; }
@media (max-width: 640px) { .ct-owed { grid-template-columns: minmax(0, 1fr); } }
.ct-tag.owed { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 45%, var(--line)); background: color-mix(in srgb, var(--bad) 8%, transparent); white-space: nowrap; }
/* crew profile: what you owe, job by job */
.cd-owe { display: flex; flex-direction: column; gap: var(--s-3); padding: 14px; border-radius: var(--r-md); background: color-mix(in srgb, var(--bad) 7%, transparent); border: 1px solid color-mix(in srgb, var(--bad) 30%, var(--line)); }
.cd-owe-head { display: flex; justify-content: space-between; align-items: flex-end; gap: var(--s-3); flex-wrap: wrap; }
.cd-owe-head span { display: block; font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.cd-owe-head b { display: block; font-size: 28px; letter-spacing: -.03em; line-height: 1.1; color: var(--bad); }
.cd-owe-head small { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.cd-allpaid { padding: 10px 12px; border-radius: var(--r-md); background: color-mix(in srgb, var(--ok) 10%, transparent); color: var(--ok); font-weight: 600; font-size: 13px; }
.cp-jobs { display: flex; flex-direction: column; }
.cp-job { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: var(--s-3); align-items: center; padding: 9px 0; border-top: 1px solid var(--line); }
.cp-job:first-child { border-top: 0; }
.cp-job .num { font-weight: 700; font-variant-numeric: tabular-nums; }
.cp-job.is-paid .num { color: var(--muted); }
.cp-job-name { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; padding: 0; border: 0; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.cp-job-name b { font-size: 13.5px; } .cp-job-name:hover b { text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; }
.cp-job-name small { color: var(--muted); font-size: 11.5px; }
@media (max-width: 480px) { .cp-job { grid-template-columns: minmax(0, 1fr) auto; } .cp-job .crew-paid { grid-column: 1 / -1; justify-self: start; } }
/* info "i": explanations on hover, focus or tap */
.is-info { display: none !important; }
.info-i { position: relative; display: inline-grid; place-items: center; width: 16px; height: 16px; margin-left: 7px; padding: 0; vertical-align: 1px; border: 1px solid color-mix(in srgb, var(--muted) 70%, transparent); border-radius: 50%; background: transparent; color: var(--muted); font: italic 700 10px/1 Georgia, "Times New Roman", serif; letter-spacing: 0; text-transform: none; cursor: help; transition: color 160ms var(--ease), border-color 160ms var(--ease), background-color 160ms var(--ease); }
.info-i:hover, .info-i:focus-visible, .info-i:focus { color: #000; background: var(--accent); border-color: var(--accent); outline: none; }
.info-i::after { content: attr(data-tip); position: absolute; z-index: 40; top: calc(100% + 8px); left: var(--tip-x, -10px); box-sizing: border-box; width: max-content; max-width: var(--tip-w, min(280px, 80vw)); padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--panel); color: var(--fg); box-shadow: var(--shadow); font: 400 12.5px/1.45 var(--font-body); letter-spacing: 0; text-transform: none; text-align: left; white-space: pre-line; display: none; pointer-events: none; transition: opacity 160ms var(--ease), transform 160ms var(--ease); }
/* the explanation only takes up room while it shows: hidden, it would still stick out past the edge and let a phone
   scroll sideways (in a pop-up, or anywhere an "i" sits near the right) */
.info-i:hover::after, .info-i:focus::after { display: block; opacity: 1; transform: none; }
@starting-style { .info-i:hover::after, .info-i:focus::after { opacity: 0; transform: translateY(-4px); } }
.tl-head h3 .info-i { vertical-align: 6px; }
/* =====================================================================
   SIGN-IN AND PORTALS (portal.js): the gate, client and crew portals, Accounts & access
   ===================================================================== */
.gate { position: fixed; inset: 0; z-index: 1000; background: #000; color: #e9e9e9; display: grid; place-items: center; padding: 28px 16px; overflow-y: auto; transition: opacity .35s var(--ease); }
.gate.out { opacity: 0; pointer-events: none; }
body:has(.gate:not([hidden]):not(.out)) { overflow: hidden; }
.gate::before { content: ""; position: fixed; inset: 0 0 auto; height: 1px; background: linear-gradient(90deg, transparent, var(--accent), transparent); opacity: .75; }
.gate-in { width: min(440px, 100%); display: grid; gap: 28px; }
.gate-brand { display: grid; gap: 12px; }
.gate-mark { font-weight: 800; font-size: clamp(54px, 15vw, 96px); letter-spacing: -.04em; line-height: .84; color: #fff; }
.gate-sub { font-family: var(--font-mono); font-size: 11px; letter-spacing: .34em; text-transform: uppercase; color: var(--accent); }
.gate-card { background: #0a0a0a; border: 1px solid #1e1e1e; border-radius: var(--r-lg); padding: 24px; display: grid; gap: 16px; animation: gateIn .5s var(--ease) both; }
@keyframes gateIn { from { opacity: 0; transform: translateY(8px); } }
.gate-card h2 { font-size: 26px; font-weight: 700; letter-spacing: -.025em; line-height: 1.05; margin: 0; color: #fff; }
.gate-card p { margin: 0; color: #a3a3a3; font-size: 14px; line-height: 1.5; }
.gate-k, .pt-k { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: #8c8c8c; }
.gate-who { display: flex; align-items: center; gap: 12px; padding-bottom: 16px; border-bottom: 1px solid #1e1e1e; }
.gate-who b { display: block; color: #fff; font-weight: 600; font-size: 14.5px; margin-top: 2px; }
.gate-av { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; flex: none; }
.gate-role { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; color: #a3a3a3; }
.gate-chip { font-family: var(--font-mono); font-size: 10px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; padding: 4px 9px; border-radius: var(--r-pill); border: 1px solid color-mix(in srgb, var(--accent) 60%, transparent); color: var(--gold-text); white-space: nowrap; justify-self: start; }
.gate .gate-chip { color: var(--accent); }
.gate-chip.sm { padding: 2px 7px; font-size: 9px; }
.gate-acts { display: flex; gap: 10px; flex-wrap: wrap; }
.gate-go { flex: 1 1 auto; justify-content: center; padding-block: 11px; font-size: 15px; }
.gate .btn-primary { background: var(--accent); color: #000; border-color: var(--accent); }
.gate-ghost { background: transparent; color: #e9e9e9; border-color: #2a2a2a; }
.gate-ghost:hover { border-color: #555; background: transparent; }
.gate-skip { display: flex; gap: 8px; align-items: center; font-size: 12.5px; color: #8c8c8c; cursor: pointer; }
.gate-skip input { accent-color: var(--accent); }
.gate-form { display: flex; gap: 8px; }
.gate-code { flex: 1; min-width: 0; background: #141414; border: 1px solid #2a2a2a; border-radius: var(--r-md); color: #fff; font-family: var(--font-mono); font-size: 16px; letter-spacing: .12em; padding: 10px 12px; text-transform: uppercase; }
.gate-code::placeholder { color: #555; }
.gate-code:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.gate-note:empty { display: none; }
.gate-card p.gate-note.bad { color: #ff8a80; }
/* what linking is waiting on, live */
.gate-card p.gate-live { font-family: var(--font-mono); font-size: 12px; letter-spacing: .02em; color: #a3a3a3; padding-left: 16px; position: relative; }
.gate-card p.gate-live:empty { display: none; }
.gate-card p.gate-live::before { content: ""; position: absolute; left: 0; top: .45em; width: 7px; height: 7px; border-radius: 50%; background: #6b6b6b; }
.gate-card p.gate-live.ok { color: #e9e9e9; } .gate-card p.gate-live.ok::before { background: #ffd500; }
.gate-card p.gate-live.bad { color: #ff8a80; } .gate-card p.gate-live.bad::before { background: #ff8a80; }
.gate-bar { height: 2px; background: #1e1e1e; border-radius: 2px; overflow: hidden; }
.gate-bar i { display: block; height: 100%; width: 40%; background: var(--accent); animation: gateBar 1.3s var(--ease) infinite; }
@keyframes gateBar { from { transform: translateX(-100%); } to { transform: translateX(260%); } }
.gate .link-btn { color: #a3a3a3; justify-self: start; }
.gate-foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: #6b6b6b; }
@media (prefers-reduced-motion: reduce) { .gate { transition: none; } .gate-card { animation: none; } .gate-bar i { animation: none; width: 100%; opacity: .5; } }

/* the executive chip opens Accounts & access */
.access-chip[role="button"] { cursor: pointer; transition: border-color var(--dur-1) var(--ease); }
.access-chip[role="button"]:hover { border-color: var(--accent); }

/* portal mode: the dashboard's sections and controls are gone, only the portal shows */
body.portal-mode .tabs, body.portal-mode #undoBtn, body.portal-mode #sampleChip, body.portal-mode main.ledger:not(#view-portal) { display: none !important; }
.pt-hero .pt-k { color: var(--gold-text); display: block; margin-bottom: 6px; }
/* a small Beta tag under the portal's name, glowing slowly in and out (still when the device asks for less motion) */
.pt-beta { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 12px; font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--gold-text); animation: pt-beta 3.2s ease-in-out infinite; }
.pt-beta::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
@keyframes pt-beta { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }
@media (prefers-reduced-motion: reduce) { .pt-beta { animation: none; } }
.pt-sec { margin-block: 32px 0; }
.pt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 12px; margin-top: 12px; }
.pt-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px 20px; display: grid; gap: 16px; align-content: start; min-width: 0; }
.pt-card.done { background: transparent; }
.pt-card header { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.pt-card header b { display: block; font-size: 17px; font-weight: 700; letter-spacing: -.015em; line-height: 1.2; }
.pt-card header small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 4px; }
.pt-tag { font-family: var(--font-mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; padding: 4px 9px; border-radius: var(--r-pill); background: var(--accent); color: #000; white-space: nowrap; flex: none; }
.pt-tag.done { background: transparent; color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); }
.pt-progress { display: grid; gap: 8px; }
.pt-steps { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 4px; }
.pt-steps i { height: 4px; border-radius: 4px; background: var(--line); }
.pt-steps i.done { background: var(--fg); }
.pt-steps i.now { background: var(--accent); }
.pt-steps-cap { display: flex; justify-content: space-between; gap: 12px; font-family: var(--font-mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.pt-steps-cap span:last-child:not(:first-child) { text-align: right; }
/* crew steps: each its own colour, labelled under its bar. The set clears the colour-blind and normal-vision separation checks next to each other, in both themes */
:root { --cs-1: #1baf7a; --cs-2: #2a78d6; --cs-3: #e34948; --cs-4: #6250d6; --cs-5: #eda100; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --cs-1: #199e70; --cs-2: #3987e5; --cs-3: #e66767; --cs-4: #9085e9; --cs-5: #c98500; } }
:root[data-theme="dark"] { --cs-1: #199e70; --cs-2: #3987e5; --cs-3: #e66767; --cs-4: #9085e9; --cs-5: #c98500; }
.pt-steps-crew { gap: 6px; }
.pt-steps-crew > span { display: grid; gap: 7px; min-width: 0; }
.pt-steps-crew i { height: 6px; border-radius: 4px; background: color-mix(in srgb, var(--c, var(--accent)) 32%, var(--line)); }
.pt-steps-crew .done i, .pt-steps-crew .now i { background: var(--c, var(--accent)); }
.pt-steps-crew .now i { box-shadow: 0 0 0 3px color-mix(in srgb, var(--c, var(--accent)) 28%, transparent); }
.pt-steps-crew small { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pt-steps-crew .done small { color: var(--fg); }
.pt-steps-crew .now small { color: var(--fg); font-weight: 700; }
.pt-tag.tone { display: inline-flex; align-items: center; gap: 6px; background: color-mix(in srgb, var(--c, var(--accent)) 16%, transparent); color: var(--fg); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c, var(--accent)) 50%, transparent); }
.pt-tag.tone::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--c, var(--accent)); flex: none; }
/* footer name: "Reeleyes Inc · A Video Production Company" turning on a small drum, in the width the old line took (32 characters) */
.spin-txt { position: relative; display: inline-block; width: calc(32ch + 32 * var(--spin-ls, .1em)); overflow: hidden; white-space: nowrap; vertical-align: bottom;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); }
.gate-foot .spin-txt { --spin-ls: .12em; }
.spin-track { display: inline-flex; animation: spinTxt 12s linear infinite; }
.spin-track > span { flex: none; }
.spin-track > span::after { content: "\00a0·\00a0"; }
.spin-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@keyframes spinTxt { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) {
  .spin-txt { width: auto; -webkit-mask-image: none; mask-image: none; }
  .spin-track { animation: none; }
  .spin-track > span + span { display: none; }
  .spin-track > span::after { content: none; }
}
/* crew portal: On the go and Wrapped side by side where there's room, one list each; stacked on narrower screens */
@media (min-width: 1000px) {
  .pt-jobs.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; align-items: start; }
  .pt-jobs.two .pt-grid { grid-template-columns: minmax(0, 1fr); }
}
/* the crew portal's spinning logo sits beside the name, like Today's */
.pt-hero.has-logo { display: flex; align-items: center; gap: var(--s-6); }
.pt-hero .pt-logo { width: 132px; height: 118px; }
@media (max-width: 600px) {
  .pt-hero.has-logo { position: relative; display: block; }
  .pt-hero .pt-logo { position: absolute; top: -4px; right: -6px; width: 84px; height: 78px; }
  .pt-hero.has-logo .pt-k, .pt-hero.has-logo .ledger-title { padding-right: 84px; }
}
.pt-dl { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.pt-dl li { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.pt-dl i { width: 12px; height: 12px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--muted); }
.pt-dl .done i { background: var(--ok); box-shadow: none; }
.pt-dl .done span { color: var(--muted); }
.pt-dl small { color: var(--muted); font-size: 12px; white-space: nowrap; }
.pt-money { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--line); border-radius: var(--r-md); overflow: hidden; }
.pt-money span { background: var(--field); padding: 9px 12px; display: grid; gap: 3px; font-family: var(--font-mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); min-width: 0; }
.pt-money b { font-family: var(--font-body); font-size: 15px; letter-spacing: -.01em; text-transform: none; color: var(--fg); font-weight: 650; overflow: hidden; text-overflow: ellipsis; }
.pt-money .owe b { color: var(--bad); }
.pt-kv { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 7px 16px; margin: 0; font-size: 13.5px; }
.pt-kv dt { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding-top: 2px; }
.pt-kv dd { margin: 0; overflow-wrap: anywhere; }
.pt-pay { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--r-md); background: var(--accent-soft); }
.pt-pay.paid { background: var(--field); }
.pt-pay b { display: block; font-size: 22px; font-weight: 700; letter-spacing: -.02em; margin-top: 2px; }
.pt-pay small { color: var(--muted); font-size: 12px; }
.pt-pay .pt-k { color: var(--muted); }
.pt-chip { font-family: var(--font-mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; padding: 4px 8px; border-radius: var(--r-pill); white-space: nowrap; box-shadow: inset 0 0 0 1px var(--line); color: var(--muted); }
.pt-chip.paid { color: var(--ok); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ok) 45%, transparent); }
.pt-chip.late { color: var(--bad); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--bad) 45%, transparent); }
.pt-chip.part { color: var(--gold-text); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 60%, transparent); }
.pt-inv, .pt-chart-card { margin-top: 32px; }
.pt-table-wrap { overflow-x: auto; }
.pt-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.pt-table th { text-align: left; font-family: var(--font-mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 500; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.pt-table td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.pt-table tr:last-child td { border-bottom: 0; }
.pt-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pt-table .pt-ref { font-family: var(--font-mono); font-size: 12.5px; white-space: nowrap; }
/* an invoice number that opens its PDF in Google Drive (once it's shared with them) */
.pt-table .pt-ref a { color: var(--gold-text); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; display: inline-block; padding: 4px 0; }
.pt-table .pt-ref a:hover { text-decoration-thickness: 2px; }
.pt-table .pt-ref a:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 2px; }
@media (max-width: 640px) { .pt-table .pt-wide { display: none; } .pt-table th, .pt-table td { padding-inline: 6px; } }
.pt-chart { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); margin-top: 14px; }
.pt-col { display: grid; gap: 8px; justify-items: center; min-width: 0; }
.pt-plot { position: relative; width: 100%; height: 150px; display: flex; align-items: flex-end; justify-content: center; border-bottom: 1px solid var(--line); }
.pt-bar { position: relative; width: min(60%, 22px); height: var(--h); background: var(--chart-bar); border-radius: 4px 4px 0 0; outline: none; }
.pt-bar.zero { height: 0; }
.pt-bar::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%); background: var(--fg); color: var(--bg); font-family: var(--font-mono); font-size: 11px; padding: 5px 8px; border-radius: var(--r-sm); white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .15s; z-index: 2; }
.pt-col:first-child .pt-bar::after { left: 0; transform: none; }
.pt-col:last-child .pt-bar::after { left: auto; right: 0; transform: none; }
.pt-plot:hover .pt-bar::after, .pt-bar:focus-visible::after { opacity: 1; }
.pt-bar:focus-visible { box-shadow: 0 0 0 2px var(--focus); }
.pt-col small { font-family: var(--font-mono); font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
@media (max-width: 560px) { .pt-col:nth-child(even) small { visibility: hidden; } }
.pt-axis { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 10px 0 0; }
.an-card-head .pt-axis { margin: 0; }

/* an executive previewing someone's portal */
.pt-banner { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 900; display: flex; align-items: center; gap: 12px; background: var(--accent); color: #000; padding: 7px 7px 7px 16px; border-radius: var(--r-pill); font-size: 13.5px; font-weight: 600; box-shadow: 0 16px 40px -14px rgba(0,0,0,.55); max-width: calc(100vw - 32px); }
.pt-banner[hidden] { display: none; }
.pt-banner span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.pt-banner .btn { background: #000; color: #fff; border-color: #000; border-radius: var(--r-pill); flex: none; }
body.previewing #view-portal { padding-bottom: 96px; }

/* Accounts & access */
.modal.acct { width: min(700px, 100%); position: relative; display: grid; gap: 14px; }
.acct > .x-close { position: absolute; top: 14px; right: 14px; margin: 0; }
.acct > h3 { margin: 0; padding-right: 32px; }
.acct-types { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.acct-types > div { background: var(--panel); padding: 12px 14px; display: grid; gap: 6px; align-content: start; }
.acct-types p { margin: 0; font-size: 13px; line-height: 1.4; }
.acct-types small { color: var(--muted); font-size: 11.5px; }
@media (max-width: 640px) { .acct-types { grid-template-columns: 1fr; } }
.acct-sec { display: grid; gap: 10px; padding-top: 14px; border-top: 1px solid var(--line); }
.acct-sec h4 { margin: 0; font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; font-weight: 500; display: flex; align-items: center; gap: 8px; }
.acct-live { color: var(--ok); font-size: 10px; } .acct-live::before { content: "● "; }
.acct-status { margin: 6px 0 0; font-size: 13px; color: var(--muted); }
.acct-status.ok { color: var(--fg); } .acct-status.bad { color: var(--bad); }
.acct-hint { margin: 4px 0 0; font-size: 12.5px; color: var(--muted); }
.acct-invite { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.acct-invite select { flex: 1 1 180px; min-width: 0; }
.acct-code { background: var(--accent-soft); border-radius: var(--r-md); padding: 14px 16px; display: grid; gap: 8px; justify-items: start; }
.acct-code .pt-k { color: var(--gold-text); }
.acct-code > b { font-size: 26px; letter-spacing: .08em; font-weight: 700; }
.acct-code ol { margin: 0; padding-left: 18px; font-size: 13px; display: grid; gap: 4px; line-height: 1.45; }
.acct-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 0; border-bottom: 1px solid var(--line); }
.acct-row:last-child { border-bottom: 0; }
.acct-who { flex: 1 1 200px; min-width: 0; display: grid; gap: 4px; }
.acct-who small { color: var(--muted); font-size: 12px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.acct-acts { display: flex; gap: 6px; }
/* a linked client's invoice PDFs: how many they can open from their portal */
.acct-inv { order: 3; flex: 1 0 100%; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.acct-row select { flex: 0 1 200px; min-width: 0; }.pt-tiles .tile .v { white-space: nowrap; font-size: clamp(19px, 5.2vw, 34px); }

/* ---------- Firebase: sign out, and Inquiries from the website ---------- */
.signout-btn span { white-space: nowrap; }
@media (max-width: 720px) {
  .signout-btn span { display: none; }
  /* six tabs don't fit a phone's width: the row scrolls sideways instead of squeezing the names together */
  .tabs { overflow-x: auto; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { flex: 1 0 auto; }
  .tab:not(.tab-hq) { padding: 6px 8px; letter-spacing: .06em; }
}
/* on a narrow phone Undo is its icon (its name stays in the tooltip and for screen readers), so Sign out fits beside it */
@media (max-width: 480px) { .undo-btn span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; } }
.inq-list { display: grid; gap: var(--s-3); }
.inq { display: grid; gap: 10px; }
.inq.new { border-color: color-mix(in srgb, var(--accent) 60%, var(--line)); }
.inq.archived { opacity: .75; }
.inq-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; }
.inq-who { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; min-width: 0; }
.inq-who b { font-size: 16px; overflow-wrap: anywhere; }
.inq-who a { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.inq-when { font-family: var(--font-mono); font-size: 11px; color: var(--muted); letter-spacing: .04em; white-space: nowrap; }
.inq-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.inq-msg { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.5; max-width: 75ch; }
/* ---------- Import (import.html): copying the artifact's records into Firebase ---------- */
.imp { max-width: 760px; }
.imp .ledger-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.imp-step { display: grid; gap: 10px; margin-top: var(--s-3); }
.imp-step h3 { margin: 0; }
.imp-note { margin: 0; color: var(--muted); }
.imp-note.bad { color: var(--bad); }
.imp-counts { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 6px 16px; }
.imp-counts > div { display: flex; justify-content: space-between; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.imp-counts b { font-variant-numeric: tabular-nums; }
.imp-counts .imp-total { border-bottom: 0; font-weight: 700; }
.imp-bar { height: 6px; }
.imp-bar i { animation: none; width: 0; transition: width .2s linear; }
.imp-problems { margin: 0; padding-left: 18px; color: var(--bad); font-family: var(--font-mono); font-size: 12px; display: grid; gap: 2px; }
.imp-problems:empty { display: none; }
/* ---------- Shared files: the project card, and Files on the client and crew portals ---------- */
.sh-rows { display: grid; gap: 8px; }
.sh-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 6px 0; border-bottom: 1px solid var(--line); }
.sh-name { display: grid; gap: 2px; min-width: 0; }
.sh-name a { font-weight: 600; overflow-wrap: anywhere; }
.sh-name small { color: var(--muted); font-size: 12px; }
.sh-add { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1.4fr) auto auto; gap: 8px; margin-top: 10px; }
@media (max-width: 720px) { .sh-add { grid-template-columns: 1fr 1fr; } .sh-add input { grid-column: 1 / -1; } }
.pt-files { margin-top: var(--s-3); }
.pt-file-list { display: grid; gap: 6px; }
.pt-file { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-md); color: inherit; text-decoration: none; }
.pt-file:hover { border-color: var(--accent); }
.pt-file:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pt-file-name { display: grid; gap: 2px; min-width: 0; }
.pt-file-name b { overflow-wrap: anywhere; }
.pt-file-name small { color: var(--muted); font-size: 12px; }
.gate-notyou { margin-top: 12px; }
.imp-extra { display: grid; gap: 6px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-md); }
.imp-extra p { margin: 0; }
.imp-extra ul { margin: 0; padding-left: 18px; font-family: var(--font-mono); font-size: 12px; display: grid; gap: 2px; }