/*
 * FreelanceIQ: the tool's own components, styled in the site's design language (9 Nov 2026, on the UltraCompress Pro
 * template, after Where Did My Salary Go? and the tools before it, whose shared block the first part of this file copies).
 * Base: /libs/site-pages.css (tokens, Inter and Space Grotesk, buttons, theme toggle, focus rings) and /libs/shared-nav.css
 * (the site's header and footer). The second part is the original's components (the staircase, the client map, the projects,
 * the timer, the rates, the import) on the site's tokens, each part of a view a card. Light is the default; dark applies when
 * <html> has no data-theme.
 */

/* ----- Tokens the tool adds ----- */
:root {
    --surface: #ffffff;
    --surface-2: #f3f4f8;
    --ring: rgba(139, 92, 246, 0.18);
    --app-max: 1600px;
    --radius-lg: 16px;
    --line: rgba(0, 0, 0, 0.1);
    --line-strong: rgba(0, 0, 0, 0.24);
    --ok: #166534;
    --ok-soft: rgba(22, 101, 52, 0.09);
    --bad: #b91c1c;
    --bad-soft: rgba(185, 28, 28, 0.08);
    --warn: #92400e;
    --warn-soft: rgba(217, 119, 6, 0.1);
    --stage: #f3f4f8;
}
:root:not([data-theme="light"]) {
    --surface: #14141f;
    --surface-2: rgba(255, 255, 255, 0.05);
    --line: rgba(255, 255, 255, 0.1);
    --line-strong: rgba(255, 255, 255, 0.26);
    --ok: #4ade80;
    --ok-soft: rgba(74, 222, 128, 0.1);
    --bad: #f87171;
    --bad-soft: rgba(248, 113, 113, 0.1);
    --warn: #fbbf24;
    --warn-soft: rgba(251, 191, 36, 0.1);
    --stage: #1c1c2b;
}

/* ----- Page: full width, the page provides the side space ----- */
.container.app-container { max-width: calc(var(--app-max) + 2 * var(--content-gutter)); margin-top: 16px; }
@media (min-width: 640px) { .container.app-container { margin-top: 24px; } }

/* ----- The site header is the first thing on the page and stays at the top ----- */
body { padding-top: 0; }
body > header { position: sticky; top: 0; z-index: 50; }
header .site-nav { position: relative; top: auto; }
.theme-toggle { top: 90px; }
@media (max-width: 639.98px) { .theme-toggle { top: 75px; } } /* the header is 81 px tall from 640 px, 65 px below */
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ----- Hero ----- */
.app-hero { margin: 0 0 2rem; text-align: center; }
.app-brand { display: inline-flex; align-items: center; gap: 12px; margin-bottom: 1.25rem; font-family: 'Space Grotesk', 'Inter', sans-serif; font-weight: 700; font-size: 1.1rem; color: var(--text-strong); }
.app-brand img { width: 44px; height: 44px; border-radius: 12px; display: block; }
.app-hero h1 { margin-bottom: 0.75rem; }
.app-tagline { color: var(--text-2); font-size: 1.125rem; line-height: 1.6; max-width: 46rem; margin: 0 auto; }

/* ----- Small helpers ----- */
main [hidden], .dialog [hidden] { display: none !important; } /* the script hides fields that carry their own display */
.ico { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.muted { color: var(--text-2); }
.small { font-size: 0.9rem; }
.block { display: block; }
.hint { color: var(--text-3); font-size: 0.8rem; font-weight: 400; line-height: 1.45; }
.err { color: var(--bad); font-size: 0.85rem; font-weight: 600; }
.err:empty { display: none; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.link { background: none; border: 0; padding: 0; font: inherit; color: var(--link); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.link:hover { color: var(--link-hover); }
code { font-size: 0.85em; padding: 1px 6px; border-radius: 6px; background: var(--code-bg); color: var(--code-text); }
kbd { font-family: inherit; font-size: 0.72rem; font-weight: 700; padding: 1px 6px; border-radius: 6px; border: 1px solid var(--chip-border); background: var(--chip); color: var(--text-strong); }

/* ----- Buttons ----- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 9999px; font-family: inherit; font-weight: 600; font-size: 0.95rem; line-height: 1.2; padding: 12px 24px; cursor: pointer; text-decoration: none; white-space: nowrap; transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, color 0.2s ease, background 0.2s ease; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn .ico { width: 17px; height: 17px; }
.btn-primary { background: var(--gradient-brand); color: #fff; box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3); }
.btn-primary:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(139, 92, 246, 0.4); color: #fff; }
.btn-secondary { background: var(--surface); color: var(--text-strong); border: 1px solid var(--surface-border); padding: 11px 23px; }
.btn-secondary:hover:not(:disabled) { border-color: var(--brand); color: var(--link); transform: translateY(-2px); }
.btn-danger { background: var(--surface); color: var(--danger); border: 1px solid rgba(185, 28, 28, 0.35); padding: 11px 23px; }
.btn-danger:hover:not(:disabled) { background: var(--danger-strong); color: #fff; border-color: transparent; transform: translateY(-2px); }
.btn-sm { font-size: 0.85rem; padding: 9px 16px; }
.btn-secondary.btn-sm, .btn-danger.btn-sm { padding: 8px 15px; }
.btn-stack { display: flex; flex-wrap: wrap; gap: 8px; }
.icon-btn { width: 36px; height: 36px; border-radius: 10px; border: 1px solid transparent; background: transparent; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; color: var(--text-2); flex-shrink: 0; padding: 0; font-family: inherit; transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease; }
.icon-btn:hover { border-color: var(--brand); color: var(--link); background: var(--surface); }
.icon-btn.del:hover { border-color: var(--danger); color: var(--danger); }
.icon-btn:focus-visible, .link:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ----- Toolbar ----- */
.app-shell { margin: 0 0 3rem; scroll-margin-top: 90px; }
.app-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; margin: 0 0 1.25rem; }
.toolbar-left, .toolbar-right { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.status-pill { display: inline-flex; align-items: center; gap: 10px; padding: 6px 16px 6px 10px; border-radius: 9999px; border: 1px solid var(--tint-brand-border); background: var(--tint-brand); min-width: 220px; max-width: 100%; }
.status-icon { font-size: 1.3rem; line-height: 1; }
.status-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.status-main { font-weight: 700; font-size: 0.85rem; color: var(--text-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status-sub { font-size: 0.72rem; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.view-tabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: 9999px; background: var(--surface-2); max-width: 100%; }
.view-tab { padding: 8px 16px; border: 0; border-radius: 9999px; background: transparent; font-family: inherit; font-size: 0.85rem; font-weight: 600; color: var(--text-2); cursor: pointer; white-space: nowrap; transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease; }
.view-tab:hover { color: var(--link); }
.view-tab.active { background: var(--gradient-brand); color: #fff; box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3); }
.view-tab:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.view[hidden] { display: none; }
.shell-hint { margin-top: 14px; }

/* ----- Cards ----- */
.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-bottom: 20px; }
.card-grid:empty { display: none; }
.card--wide { grid-column: span 2; }
.card--full { grid-column: 1 / -1; }
.card { background: var(--surface); border: 1px solid var(--surface-border); border-radius: var(--radius-lg); box-shadow: var(--surface-shadow); overflow: hidden; display: flex; flex-direction: column; min-width: 0; margin-bottom: 0; }
.view > .card { margin-bottom: 20px; }
.card-header { padding: 14px 20px; border-bottom: 1px solid var(--surface-border); display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.card-title { margin: 0; font-size: 1.05rem; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.card-note { font-size: 0.8125rem; color: var(--text-3); }
.card-body { padding: 16px 20px 20px; flex: 1; min-width: 0; }
.card-body > * + * { margin-top: 16px; }
.form-hint { font-size: 0.8rem; color: var(--text-3); margin: 10px 0 0; line-height: 1.5; }

/* ----- Fields ----- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; border: 0; padding: 0; margin: 0; }
.label { font-weight: 600; font-size: 0.85rem; color: var(--text-strong); }
.input, .select { width: 100%; min-width: 0; min-height: 44px; padding: 10px 14px; background: var(--field); border: 1px solid var(--field-border); border-radius: 12px; font-family: inherit; font-size: 0.95rem; color: var(--text); outline: none; transition: border-color 0.2s ease, box-shadow 0.2s ease; }
.input:focus, .select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--ring); }
.input::placeholder { color: var(--placeholder); }
.input[aria-invalid="true"] { border-color: var(--bad); }
textarea.input { resize: vertical; min-height: 84px; line-height: 1.5; }
input[type="time"].input { color-scheme: light; width: 9em; }
:root:not([data-theme="light"]) input[type="time"].input { color-scheme: dark; }
.select { width: auto; max-width: 100%; appearance: none; -webkit-appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 14px; cursor: pointer; }
.select option { color: #0a0a14; background: #fff; }
.num-input { width: 7.5em; }
.num-input.wide { width: 10em; }
.check-row { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; font-size: 0.925rem; color: var(--text); padding: 4px 0; }
.check-row input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--brand); flex-shrink: 0; }
.seg { display: flex; flex-wrap: wrap; gap: 8px; }
.seg button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 14px; border-radius: 9999px; border: 1px solid var(--chip-border); background: var(--surface); font-family: inherit; font-size: 0.85rem; font-weight: 600; color: var(--text-2); cursor: pointer; transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease; }
.seg button:hover { border-color: var(--brand); color: var(--link); transform: translateY(-1px); }
.seg button[aria-checked="true"] { background: var(--gradient-brand); color: #fff; border-color: transparent; }
.seg button:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 9999px; border: 1px solid var(--chip-border); background: var(--chip); font-family: inherit; font-size: 0.8rem; font-weight: 600; color: var(--text-2); cursor: pointer; transition: border-color 0.2s ease, color 0.2s ease, transform 0.2s ease; }
.chip .ico { width: 15px; height: 15px; color: var(--link); }
.chip:hover { border-color: var(--brand); color: var(--link); transform: translateY(-1px); }
.chip:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ----- Windows ----- */
.dialog { margin: auto; border: 1px solid var(--surface-border); border-radius: 20px; padding: 0; width: min(520px, calc(100vw - 16px)); max-height: calc(100vh - 32px); background: var(--surface); color: var(--text); box-shadow: 0 24px 64px rgba(0, 0, 0, 0.35); }
.dialog--narrow { width: min(420px, calc(100vw - 16px)); }
.dialog--wide { width: min(680px, calc(100vw - 16px)); }
.dialog::backdrop { background: rgba(10, 10, 20, 0.6); backdrop-filter: blur(6px); }
.dialog[open] { animation: pop 0.2s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(10px); } }
.dialog-head { padding: 18px 20px; border-bottom: 1px solid var(--surface-border); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dialog-title { margin: 0; font-size: 1.15rem; }
.dialog-close { width: 36px; height: 36px; flex-shrink: 0; border-radius: 50%; border: 1px solid var(--chip-border); background: var(--chip); color: var(--text-strong); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; padding: 0; transition: border-color 0.2s ease, color 0.2s ease; }
.dialog-close:hover { border-color: var(--brand); color: var(--link); }
.dialog-body { padding: 20px; overflow-y: auto; max-height: calc(100vh - 210px); display: flex; flex-direction: column; gap: 14px; }
.dialog-actions { padding: 14px 20px; border-top: 1px solid var(--surface-border); display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.confirm-message { margin: 0; color: var(--text); }
.help-body h3 { margin: 6px 0 0; font-size: 1rem; }
.help-body p { margin: 0; color: var(--text-2); }

/* ----- Toasts ----- */
.toasts { position: fixed; bottom: 24px; right: 24px; z-index: 3000; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; max-width: calc(100vw - 32px); pointer-events: none; }
.toast { pointer-events: auto; background: #0a0a14; color: #fff; border: 1px solid rgba(255, 255, 255, 0.12); border-left: 4px solid var(--brand); border-radius: 14px; padding: 12px 16px; display: flex; align-items: center; gap: 14px; box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3); min-width: 260px; max-width: 420px; font-size: 0.875rem; font-weight: 500; overflow-wrap: anywhere; animation: slideIn 0.3s ease; transition: opacity 0.3s ease, transform 0.3s ease; }
.toast button { background: none; border: 0; padding: 0; color: #c4b5fd; font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; white-space: nowrap; }
.toast.leaving { opacity: 0; transform: translateX(40px); }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

.toast.good { border-left-color: #4ade80; }
.toast.bad { border-left-color: #f87171; }

/* ----- Information sections ----- */
.info-section { margin: 0 0 2.5rem; }
.info-section h2 { font-size: 1.75rem; margin: 0 0 1.25rem; }
.info-section .info-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.info-three { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 1rem 0 1.5rem; }
.info-stack { display: grid; gap: 12px; }
.info-card { background: var(--surface); border: 1px solid var(--surface-border); border-radius: 16px; box-shadow: var(--surface-shadow); padding: 20px; transition: transform 0.3s ease, box-shadow 0.3s ease; }
.info-card:hover { transform: translateY(-4px); box-shadow: var(--surface-hover-shadow); }
.info-card--small { padding: 16px; box-shadow: none; }
.info-card h3 { margin: 0 0 0.75rem; font-size: 1.15rem; }
.info-card p { color: var(--text-2); margin-bottom: 0.75rem; }
.info-card p:last-child { margin-bottom: 0; }
.step-card { position: relative; padding-top: 24px; }
.step-num { position: absolute; top: -16px; left: 20px; width: 34px; height: 34px; border-radius: 50%; background: var(--gradient-brand); color: #fff; font-weight: 700; font-size: 0.95rem; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3); }
.step-head { display: flex; align-items: center; gap: 12px; margin-bottom: 0.75rem; }
.step-head h3 { margin: 0; }
.step-emoji { font-size: 1.6rem; line-height: 1; }
.info-section details.info-card { padding: 0; }
.info-section details.info-card summary { cursor: pointer; padding: 16px 20px; font-weight: 600; color: var(--text-strong); list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.info-section details.info-card summary::-webkit-details-marker { display: none; }
.info-section details.info-card summary::after { content: '+'; color: var(--link); font-weight: 700; font-size: 1.2rem; line-height: 1; flex-shrink: 0; }
.info-section details.info-card[open] summary::after { content: '\2212'; }
.info-section details.info-card p { padding: 0 20px 16px; margin: 0; color: var(--text-2); }

/* ===== FreelanceIQ components ===== */

/* ----- The original's colours (both themes) and its names for the site's tokens ----- */
:root {
    --panel: var(--surface);
    --panel-2: var(--surface-2);
    --muted: var(--text-2);
    --faint: var(--text-3);
    --border: var(--surface-border);
    --border-strong: var(--line-strong);
    --good: var(--ok);
    --good-soft: var(--ok-soft);
    --info: #1d4ed8;
    --info-soft: rgba(29, 78, 216, 0.08);
    --grid: rgba(0, 0, 0, 0.07);
    --axis: var(--line-strong);
    /* one colour per client, in this fixed order (checked for colour-blind separation; the original's), then grey */
    --c0: #2a78d6;
    --c1: #eb6834;
    --c2: #1baf7a;
    --c3: #eda100;
    --c4: #e87ba4;
    --c5: #008300;
    --c6: #6250d6;
    --c7: #a3a9b3;
    --c-biz: #5b6270;
    --stair: #4c1d95;
    --ghost: #8a909b;
    --tip-bg: #0a0a14;
    --tip-text: #ffffff;
    --timer: #e34948;
}
:root:not([data-theme="light"]) {
    --info: #93c5fd;
    --info-soft: rgba(147, 197, 253, 0.12);
    --grid: rgba(255, 255, 255, 0.08);
    --c0: #3987e5;
    --c1: #d95926;
    --c2: #199e70;
    --c3: #c98500;
    --c4: #d55181;
    --c5: #008300;
    --c6: #9085e9;
    --c7: #6b7280;
    --c-biz: #a0a7b2;
    --stair: #c4b5fd;
    --ghost: #7d8592;
    --tip-bg: #f3f4f6;
    --tip-text: #0a0a14;
}

/* ----- The site's text rules (p, ul, li, table) must not reach the tool: same weight as the site's, loaded later ----- */
:where(.app-shell) p, :where(.app-shell) ul, :where(.app-shell) ol, :where(.app-shell) li, :where(.app-shell) dl,
:where(.app-shell) dd, :where(.app-shell) figure, :where(.dialog) p { margin: 0; line-height: 1.5; }
:where(.app-shell) ul, :where(.app-shell) ol { padding: 0; list-style: none; }
:where(.app-shell) table, :where(.dialog) table { margin: 0; background: none; border-radius: 0; overflow: visible; }
:where(.app-shell) th, :where(.app-shell) td { border: 0; padding: 0; }
.num { font-variant-numeric: tabular-nums; }
.pos { color: var(--good); }
.neg { color: var(--bad); }
.grow { flex: 1; }
.hint:empty { display: none; }
.hint a { color: var(--link); text-decoration: underline; text-underline-offset: 2px; }
.label .muted { font-weight: 400; }
legend.label { padding: 0; margin-bottom: 6px; }
.field > .seg { align-self: flex-start; }

/* ----- The script writes the original's button classes (btn, btn primary, btn danger, btn ghost, small-btn) ----- */
.btn { background: var(--surface); color: var(--text-strong); border: 1px solid var(--surface-border); padding: 11px 23px; }
.btn:hover:not(:disabled) { border-color: var(--brand); color: var(--link); transform: translateY(-2px); }
.btn.primary { background: var(--gradient-brand); color: #fff; border-color: transparent; box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3); }
.btn.primary:hover:not(:disabled) { color: #fff; box-shadow: 0 8px 25px rgba(139, 92, 246, 0.4); }
.btn.danger { color: var(--danger); border-color: rgba(185, 28, 28, 0.35); }
.btn.danger:hover:not(:disabled) { background: var(--danger-strong); color: #fff; border-color: transparent; }
.btn.small-btn { font-size: 0.85rem; padding: 8px 15px; }
.btn[aria-pressed="true"] { background: var(--gradient-brand); color: #fff; border-color: transparent; }
.btn:focus-visible, .chip:focus-visible, .sq-btn:focus-visible, details.more > summary:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ----- Toolbar: the status, the running timer, banner and tabs ----- */
.status-pill .status-main { font-size: 0.95rem; }
.pill { display: inline-flex; align-items: stretch; height: 44px; border-radius: 9999px; background: var(--gradient-brand); color: #fff; overflow: hidden; flex: none; box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3); }
.pill-main { display: inline-flex; align-items: center; gap: 8px; border: 0; background: transparent; color: inherit; padding: 0 12px 0 16px; min-width: 0; font-family: inherit; font-weight: 700; font-size: 0.95rem; cursor: pointer; }
.pill-dot { width: 8px; height: 8px; border-radius: 50%; background: #fff; flex: none; }
.pill-name { font-weight: 500; max-width: 14rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; opacity: 0.9; }
.pill-stop { border: 0; border-left: 1px solid rgba(255, 255, 255, 0.35); background: transparent; color: inherit; width: 46px; display: grid; place-items: center; padding: 0; cursor: pointer; }
.pill-stop .ico { width: 16px; height: 16px; }
.pill-main:hover, .pill-stop:hover { background: rgba(255, 255, 255, 0.16); }
.pill-main:focus-visible, .pill-stop:focus-visible { outline: 2px solid #fff; outline-offset: -4px; }
@media (prefers-reduced-motion: no-preference) {
    .pill-dot, .timer-dot { animation: blink 2s ease-in-out infinite; }
    @keyframes blink { 50% { opacity: 0.35; } }
}
.app-shell > .view-tabs { margin: 0 0 1.25rem; display: flex; width: max-content; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.view-tab .short { display: none; }
.banner { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; margin: 0 0 1.25rem; padding: 12px 16px; border-radius: 14px; border: 1px solid var(--tint-brand-border); background: var(--tint-brand); font-size: 0.925rem; color: var(--text); }
.banner .ico { color: var(--link); width: 20px; height: 20px; }
.banner .grow { min-width: 12px; }
.banner > span:not(.grow) { flex: 1 1 220px; min-width: 0; }
.banner.warn { background: var(--warn-soft); border-color: rgba(217, 119, 6, 0.35); }
.banner.warn .ico { color: var(--warn); }

/* ----- Views ----- */
.view > * + * { margin-top: 20px; }
.view-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; }
.head-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.view-title { margin: 0; font-size: 1.35rem; }
.lead { margin-top: 4px; color: var(--text-2); max-width: 72ch; }
.view-head .short { display: none; }
.view-body { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.view-body > .seg { align-self: flex-start; }
.two-col { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-items: start; }
@media (min-width: 1100px) { .two-col { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }

/* ----- Cards: each part of a view, the site's white card with a title strip ----- */
.section, .set-block, .rate-block, .hero, .start, .cgroup, .timer-box, .quick, .biz-strip, .view-body > .readouts > .ro {
    background: var(--surface); border: 1px solid var(--surface-border); border-radius: var(--radius-lg); box-shadow: var(--surface-shadow); min-width: 0;
}
.section, .set-block, .rate-block { display: flex; flex-direction: column; gap: 14px; padding: 0 20px 20px; }
.section > :first-child:not(.section-head), .set-block > :first-child:not(h2), .rate-block > :first-child:not(h2) { margin-top: 20px; }
.section-head { margin: 0 -20px; padding: 14px 20px; border-bottom: 1px solid var(--surface-border); display: flex; align-items: center; justify-content: space-between; gap: 6px 12px; flex-wrap: wrap; }
.section-head h2, .set-block > h2, .rate-block > h2 { font-size: 1.05rem; font-weight: 700; }
.section-head h2 { margin: 0; }
.set-block > h2, .rate-block > h2 { margin: 0 -20px; padding: 14px 20px; border-bottom: 1px solid var(--surface-border); }
.rate-block h3 { font-size: 1rem; margin: 6px 0 0; }
.section-head p { color: var(--text-3); font-size: 0.8125rem; }
.section-note { color: var(--text-2); font-size: 0.875rem; max-width: 72ch; }
.empty { color: var(--text-2); border: 1px dashed var(--line-strong); border-radius: 12px; padding: 22px 8px; text-align: center; font-size: 0.925rem; display: flex; flex-direction: column; align-items: center; gap: 12px; background: var(--surface); }
.empty b { color: var(--text-strong); }
.empty .actions { justify-content: center; }

/* ----- Amounts can be blurred for privacy ----- */
.private .m { filter: blur(7px); }
.private input.m:focus { filter: none; }
.private .tip .m { filter: blur(5px); }
.private svg text.m { filter: blur(4px); }
@media (prefers-reduced-motion: no-preference) { .m { transition: filter 0.2s; } }

/* ----- Client colour keys; unbilled time is the same colour, striped ----- */
.key { width: 10px; height: 10px; border-radius: 3px; background: var(--k); flex: none; display: inline-block; }
.k0 { --k: var(--c0); } .k1 { --k: var(--c1); } .k2 { --k: var(--c2); } .k3 { --k: var(--c3); }
.k4 { --k: var(--c4); } .k5 { --k: var(--c5); } .k6 { --k: var(--c6); } .k7 { --k: var(--c7); }
.kb { --k: var(--c-biz); }
.key.hatch, .stack i.hatch, .hbar i.hatch { background: repeating-linear-gradient(135deg, var(--k) 0 2px, transparent 2px 4.5px); box-shadow: inset 0 0 0 1px var(--k); }

/* ----- Start screen ----- */
.start { display: grid; gap: 28px; grid-template-columns: minmax(0, 1fr); padding: 24px; }
@media (min-width: 1024px) { .start { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 48px; align-items: start; } }
.start .start-title { font-size: clamp(1.6rem, 1.1rem + 2vw, 2.4rem); letter-spacing: -0.02em; line-height: 1.15; max-width: 18ch; margin: 0; }
.start .lead { font-size: 1.02rem; margin-top: 12px; }
.start .actions { margin-top: 20px; }
.start-steps { display: flex; flex-direction: column; counter-reset: step; }
.start-steps li { counter-increment: step; display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--surface-border); }
.start-steps li:last-child { border-bottom: 0; }
.start-steps li::before { content: counter(step); width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--gradient-brand); color: #fff; font-weight: 700; font-size: 0.85rem; }
.start-steps b { display: block; color: var(--text-strong); }
.start-steps span { color: var(--text-2); font-size: 0.9rem; }
.start-demo { display: flex; flex-direction: column; gap: 6px; margin-top: 28px; max-width: 34rem; }
.start-demo .sd { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; align-items: center; font-size: 0.85rem; color: var(--text-2); }
.start-demo .sd-bar { grid-column: 1 / -1; display: flex; height: 10px; }
.start-demo .sd-bar i { display: block; height: 100%; background: var(--stair); border-radius: 0 3px 3px 0; }
.start-demo .sd-bar b { display: block; height: 100%; background: repeating-linear-gradient(135deg, var(--ghost) 0 2px, transparent 2px 5px); box-shadow: inset 0 0 0 1px var(--ghost); border-radius: 0 3px 3px 0; opacity: 0.8; }
.start-demo .sd:last-child { color: var(--text-strong); font-weight: 600; }
.start-demo .sd:last-child .sd-bar i { background: var(--good); }

/* ----- The period switcher ----- */
.period { display: flex; align-items: center; gap: 8px 14px; flex-wrap: wrap; }
.period-nav { display: flex; align-items: center; gap: 6px; }
.period-nav .icon-btn { border-color: var(--surface-border); background: var(--surface); }
.period-nav .icon-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.period-label { font-weight: 600; min-width: 0; white-space: nowrap; color: var(--text-strong); }

/* ----- What an hour pays: the headline and the readouts ----- */
.hero { display: flex; flex-direction: column; gap: 10px; padding: 24px; }
.hero-title { font-family: 'Space Grotesk', 'Inter', sans-serif; font-size: clamp(1.8rem, 1.1rem + 3vw, 3.2rem); font-weight: 700; letter-spacing: -0.03em; line-height: 1.08; max-width: 22ch; overflow-wrap: anywhere; color: var(--text-strong); margin: 6px 0 0; }
.hero-sentence { font-size: clamp(1.02rem, 1.6vw, 1.18rem); line-height: 1.6; max-width: 64ch; color: var(--text); margin-top: 6px; }
.hero-sentence b { white-space: nowrap; color: var(--text-strong); }
.readouts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
@media (min-width: 900px) { .readouts { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.ro { padding: 16px 20px; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ro-label { color: var(--text-2); font-size: 0.85rem; font-weight: 600; }
.ro-val { font-family: 'Space Grotesk', 'Inter', sans-serif; font-size: clamp(1.15rem, 2.2vw, 1.45rem); font-weight: 700; overflow-wrap: anywhere; color: var(--text-strong); }
.ro-val.neg { color: var(--bad); }
.ro-val .link { color: inherit; font-weight: inherit; text-decoration-thickness: 1px; }
.ro-sub { color: var(--text-3); font-size: 0.82rem; }

/* ----- The rate staircase ----- */
.stairs { display: flex; flex-direction: column; min-width: 0; position: relative; }
.st-row { display: grid; grid-template-columns: minmax(12rem, 19rem) minmax(0, 1fr) 7.5rem; gap: 2px 18px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--surface-border); min-width: 0; }
.st-name { min-width: 0; display: flex; flex-direction: column; }
.st-name b { font-weight: 600; font-size: 0.95rem; color: var(--text-strong); }
.st-name small { color: var(--text-2); font-size: 0.8rem; line-height: 1.35; }
.st-name .mile { align-self: flex-start; margin-top: 4px; font-size: 0.72rem; font-weight: 700; padding: 1px 9px; border-radius: 9999px; background: var(--gradient-brand); color: #fff; }
.st-track { position: relative; min-height: 22px; min-width: 0; align-self: stretch; }
.st-bar, .st-cut { position: absolute; top: calc(50% - 11px); height: 22px; }
.st-bar { left: 0; background: var(--stair); border-radius: 0 6px 6px 0; }
.st-cut { background: repeating-linear-gradient(135deg, var(--ghost) 0 2px, transparent 2px 5px); box-shadow: inset 0 0 0 1px var(--ghost); border-radius: 0 6px 6px 0; opacity: 0.8; }
.st-row.last .st-bar { background: var(--good); }
.st-val { text-align: right; font-weight: 700; font-size: 1.02rem; font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--text-strong); }
.st-val small { display: block; color: var(--text-2); font-weight: 500; font-size: 0.8rem; }
.st-val .neg { color: var(--bad); }
.st-row.last .st-name b, .st-row.last .st-val { font-size: 1.12rem; }
.st-row.none .st-name b { color: var(--text-2); font-weight: 500; }
/* reference lines run through every step; a thin halo keeps them visible on the bars */
.st-ref { position: absolute; top: -11px; bottom: -11px; width: 2px; margin-left: -1px; background: var(--text-2); box-shadow: 0 0 0 1px var(--surface); font-style: normal; z-index: 1; }
.st-ref.need { background: var(--info); }
.st-row.first .st-ref { top: 0; }
.st-ref span { position: absolute; bottom: -22px; transform: translateX(-50%); font-size: 0.76rem; font-weight: 600; color: var(--text-2); white-space: nowrap; background: var(--surface); padding: 0 4px; }
.st-ref.flip span { transform: translateX(-100%); }
.st-ref.left span { transform: none; }
.st-row.st-axis { border-bottom: 0; padding: 2px 0 0; }
.st-axis .st-track { min-height: 20px; }
.st-axis .st-ref { background: none; box-shadow: none; top: 0; bottom: 0; }
.st-axis .st-ref span { top: 0; bottom: auto; }
.st-axis.two .st-track { min-height: 38px; }
.st-axis .st-ref.low span { top: 18px; }
@media (max-width: 900px) {
    .st-row { grid-template-columns: minmax(0, 1fr) auto; }
    .st-track { grid-column: 1 / -1; grid-row: 2; min-height: 16px; height: 16px; margin-top: 4px; align-self: auto; }
    .st-bar, .st-cut { top: 0; height: 16px; }
    .st-ref { top: -3px; bottom: -3px; }
    .st-axis .st-track { margin-top: 0; }
}
@media (prefers-reduced-motion: no-preference) {
    .stairs.intro .st-bar { animation: grow 0.7s cubic-bezier(0.25, 0.7, 0.2, 1) both; transform-origin: left center; }
    .stairs.intro .st-row:nth-child(2) .st-bar { animation-delay: 0.08s; }
    .stairs.intro .st-row:nth-child(3) .st-bar { animation-delay: 0.16s; }
    .stairs.intro .st-row:nth-child(4) .st-bar { animation-delay: 0.24s; }
    .stairs.intro .st-row:nth-child(5) .st-bar { animation-delay: 0.32s; }
    .stairs.intro .st-row:nth-child(6) .st-bar { animation-delay: 0.4s; }
    .stairs.intro .st-cut { animation: fadein 0.5s ease-out 0.55s both; }
    @keyframes grow { from { transform: scaleX(0); } }
    @keyframes fadein { from { opacity: 0; } }
}
.assume { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: flex-end; padding-top: 6px; border-top: 1px solid var(--surface-border); margin-top: 4px; }
.assume .field { flex: 0 1 auto; padding-top: 10px; }
.assume .input { width: 10rem; }
.assume .suffix-wrap .input { width: 9rem; }
.assume-note { color: var(--text-2); font-size: 0.85rem; flex: 1 1 16rem; padding-bottom: 8px; }

/* ----- What stands out ----- */
.checks { display: flex; flex-direction: column; }
.check { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; gap: 4px 12px; padding: 12px 0; border-bottom: 1px solid var(--surface-border); align-items: start; }
.check:last-child { border-bottom: 0; }
.check .ico { width: 22px; height: 22px; margin-top: 1px; }
.check-title { font-weight: 600; color: var(--text-strong); }
.check-text { color: var(--text-2); font-size: 0.9rem; grid-column: 2 / -1; max-width: 80ch; }
.check-foot { grid-column: 2 / -1; display: flex; gap: 8px 16px; flex-wrap: wrap; align-items: center; margin-top: 4px; }
.check-state { font-size: 0.8rem; font-weight: 700; padding: 2px 10px; border-radius: 9999px; white-space: nowrap; }
.check-money { font-size: 0.875rem; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--text-strong); }
.st-good .ico { color: var(--good); }
.st-good .check-state { background: var(--good-soft); color: var(--good); }
.st-fair .ico { color: var(--warn); }
.st-fair .check-state { background: var(--warn-soft); color: var(--warn); }
.st-bad .ico { color: var(--bad); }
.st-bad .check-state { background: var(--bad-soft); color: var(--bad); }
.st-info .ico { color: var(--info); }
.st-info .check-state { background: var(--info-soft); color: var(--info); }

/* ----- Which clients are worth the time ----- */
.map { position: relative; width: 100%; min-width: 0; touch-action: pan-y; }
.map svg { display: block; width: 100%; overflow: visible; }
.map .grid-line { stroke: var(--grid); stroke-width: 1; }
.map .base-line { stroke: var(--axis); stroke-width: 1; }
.map .tick { fill: var(--text-3); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.map .bub { fill: var(--k); fill-opacity: 0.82; stroke: var(--surface); stroke-width: 2; }
.map .bub-g { outline: none; cursor: default; }
.map .bub-g:hover .bub, .map .bub-g.on .bub { fill-opacity: 1; }
.map .bub-g:focus-visible .bub { stroke: var(--brand); stroke-width: 3; }
.map .bub-hit { fill: transparent; }
.map .bub-lbl { fill: var(--text-strong); font-size: 12.5px; font-weight: 600; paint-order: stroke; stroke: var(--surface); stroke-width: 4px; stroke-linejoin: round; }
.map .ref { stroke: var(--text-strong); stroke-width: 1.5; opacity: 0.5; }
.map .ref.need { stroke: var(--info); opacity: 0.85; }
.map .ref-lbl { fill: var(--text-2); font-size: 11.5px; font-weight: 600; paint-order: stroke; stroke: var(--surface); stroke-width: 4px; }
.map .zone { fill: var(--text-2); font-size: 11.5px; font-weight: 500; }
.map-note { font-size: 0.85rem; color: var(--text-2); max-width: 72ch; }
@media (min-width: 1100px) { .two-col > .map-section { position: sticky; top: 100px; } } /* the map stays beside the long list of checks */

/* ----- Tables ----- */
.tbl-wrap { overflow-x: auto; min-width: 0; }
.tbl-wrap:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 0.925rem; }
.tbl th { text-align: left; font-size: 0.8rem; color: var(--text-2); font-weight: 600; padding: 8px 10px 8px 0; border-bottom: 1px solid var(--line-strong); white-space: nowrap; }
.tbl th button { background: none; border: 0; padding: 0; color: inherit; font: inherit; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.tbl th button:hover { color: var(--link); }
.tbl th button:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
.tbl th button .ico { width: 14px; height: 14px; }
.tbl th[aria-sort="none"] button .ico { opacity: 0; }
.tbl td { padding: 9px 10px 9px 0; border-bottom: 1px solid var(--surface-border); vertical-align: top; color: var(--text); }
.tbl td.r, .tbl th.r { text-align: right; }
.tbl td.r { white-space: nowrap; font-variant-numeric: tabular-nums; }
.tbl .cname { display: flex; align-items: center; gap: 8px; min-width: 0; font-weight: 600; color: var(--text-strong); }
.tbl .cname .key { margin-top: 1px; }
.tbl small { color: var(--text-3); display: block; font-size: 0.78rem; font-weight: 400; }
.tbl tfoot td { font-weight: 700; border-bottom: 0; border-top: 2px solid var(--text-strong); color: var(--text-strong); }
.tbl .mob { display: none; }
.tbl .hb-cell { min-width: 9rem; }
@media (max-width: 900px) {
    .tbl .wide { display: none; }
    .tbl .mob { display: block; color: var(--text-3); font-size: 0.78rem; font-weight: 400; }
}
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: 0.74rem; font-weight: 600; padding: 1px 8px; border-radius: 9999px; background: var(--chip); border: 1px solid var(--chip-border); color: var(--text-2); white-space: nowrap; vertical-align: 1px; }
.tag.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.tag.fair { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.tag.good { background: var(--good-soft); color: var(--good); border-color: transparent; }
.tag.info { background: var(--info-soft); color: var(--info); border-color: transparent; }

/* ----- Hours as one bar: billed solid, unbilled striped ----- */
.hbar { position: relative; display: flex; gap: 2px; height: 10px; width: 100%; min-width: 0; }
.hbar i { display: block; height: 100%; background: var(--k, var(--stair)); min-width: 2px; }
.hbar i:first-child { border-radius: 3px 0 0 3px; }
.hbar i:last-of-type { border-radius: 0 3px 3px 0; }
.hbar i:only-of-type { border-radius: 3px; }
.hbar .rest { flex: 1; background: transparent; min-width: 0; }
.hbar .plan { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--text-strong); border-radius: 1px; }
.stack { display: flex; gap: 2px; height: 26px; width: 100%; }
.stack i { display: block; height: 100%; background: var(--k); min-width: 2px; }
.stack i:first-child { border-radius: 4px 0 0 4px; }
.stack i:last-child { border-radius: 0 4px 4px 0; }
.stack i:only-child { border-radius: 4px; }
.stack-legend { display: flex; flex-wrap: wrap; gap: 6px 20px; font-size: 0.875rem; color: var(--text-2); }
.stack-legend span { display: inline-flex; align-items: center; gap: 7px; }
.blist { display: flex; flex-direction: column; }
.brow { display: grid; grid-template-columns: minmax(0, 14rem) minmax(0, 1fr) auto; gap: 4px 14px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--surface-border); font-size: 0.925rem; }
.brow:last-child { border-bottom: 0; }
.brow-name { display: flex; align-items: center; gap: 8px; min-width: 0; }
.brow-name span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brow-bar { height: 12px; display: flex; }
.brow-bar i { display: block; height: 100%; background: var(--k); border-radius: 0 4px 4px 0; min-width: 2px; }
.brow-val { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--text-strong); }
.brow-val .muted { margin-left: 8px; }
@media (max-width: 560px) {
    .brow { grid-template-columns: minmax(0, 1fr) auto; }
    .brow-bar { grid-column: 1 / -1; grid-row: 2; }
}

/* ----- Charts and the tooltip ----- */
.charts3 { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px 32px; }
@media (min-width: 1100px) { .charts3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.chart-box { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.chart-box h3 { margin: 0; font-size: 0.95rem; }
.chart-box p { color: var(--text-2); font-size: 0.82rem; }
.chart { position: relative; width: 100%; min-width: 0; outline: none; border-radius: 12px; touch-action: pan-y; }
.chart:focus-visible { outline: 2px solid var(--brand); outline-offset: 4px; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart .grid-line { stroke: var(--grid); stroke-width: 1; }
.chart .base-line { stroke: var(--axis); stroke-width: 1; }
.chart .tick { fill: var(--text-3); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.chart .seg { fill: var(--k); }
.chart .col-hit { fill: transparent; cursor: pointer; }
.chart .col.on .seg { filter: brightness(1.1) saturate(1.1); }
.chart .line { fill: none; stroke: var(--stair); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.chart .dot { fill: var(--stair); stroke: var(--surface); stroke-width: 2; }
.chart .ref { stroke: var(--text-strong); stroke-width: 1.5; opacity: 0.5; }
.chart .cap { fill: var(--text-strong); font-size: 11.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 0.85rem; color: var(--text-2); }
.chart-legend span { display: inline-flex; align-items: center; gap: 7px; }
.tip { position: fixed; z-index: 70; pointer-events: none; max-width: 300px; background: var(--tip-bg); color: var(--tip-text); border-radius: 10px; padding: 8px 10px; font-size: 0.85rem; line-height: 1.4; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25); }
.tip b { display: block; margin-bottom: 2px; }
.tip .r { display: flex; justify-content: space-between; gap: 14px; font-variant-numeric: tabular-nums; }
.tip .r span:first-child { display: inline-flex; align-items: center; gap: 6px; }
.tip .lk { width: 10px; height: 10px; border-radius: 3px; background: var(--k); display: inline-block; }
.tip .v { font-weight: 700; }

/* ----- Clients and projects ----- */
.biz-strip { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 20px; padding: 18px 20px; }
@media (min-width: 900px) { .biz-strip { grid-template-columns: repeat(4, minmax(0, 1fr)) auto; align-items: end; } }
.biz-strip .hint { font-size: 0.78rem; }
.cgroups { display: flex; flex-direction: column; gap: 20px; }
.cgroup { display: flex; flex-direction: column; min-width: 0; padding: 0 20px 14px; }
.cgroup-head { margin: 0 -20px; padding: 12px 20px; border-bottom: 1px solid var(--surface-border); display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 4px 16px; }
.cg-meta { display: flex; align-items: baseline; gap: 4px 14px; flex-wrap: wrap; justify-content: flex-end; min-width: 0; }
.cg-acts { display: flex; gap: 4px; }
@media (max-width: 760px) {
    .cgroup-head { grid-template-columns: minmax(0, 1fr) auto; }
    .cg-meta { grid-column: 1 / -1; grid-row: 2; justify-content: flex-start; }
}
.cgroup-head h2 { display: inline-flex; align-items: center; gap: 10px; font-size: 1.05rem; min-width: 0; margin: 0; }
.cgroup-head h2 .key { width: 12px; height: 12px; }
.cgroup-head .cg-sub { color: var(--text-2); font-size: 0.85rem; }
.cg-total { font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--text-strong); }
.cg-total .muted { font-weight: 500; font-size: 0.875rem; margin-left: 6px; }
.prj { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(8rem, 1fr) 8.5rem 8.5rem auto; gap: 6px 18px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--surface-border); min-height: 64px; }
.cgroup > .prj:last-of-type { border-bottom: 0; }
.prj-name { min-width: 0; display: flex; flex-direction: column; }
.prj-name button { all: unset; cursor: pointer; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border-radius: 4px; color: var(--text-strong); }
.prj-name button:hover { color: var(--link); text-decoration: underline; text-underline-offset: 3px; }
.prj-name button:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.prj-name small { color: var(--text-2); font-size: 0.8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prj-hours { display: flex; flex-direction: column; gap: 5px; min-width: 0; font-size: 0.82rem; color: var(--text-2); }
.prj-hours b { color: var(--text-strong); font-weight: 600; }
.prj-hours .over { color: var(--bad); font-weight: 600; }
.prj-val, .prj-rate { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 600; color: var(--text-strong); }
.prj-val small, .prj-rate small { display: block; color: var(--text-2); font-weight: 500; font-size: 0.78rem; }
.prj-val small.overdue, .prj-rate small.bad { color: var(--bad); }
.prj-acts { display: flex; gap: 4px; justify-content: flex-end; }
.prj.done .prj-name button { color: var(--text-2); }
.sq-btn { width: 40px; height: 40px; border: 1px solid transparent; border-radius: 10px; background: transparent; color: var(--text-2); display: inline-grid; place-items: center; padding: 0; position: relative; cursor: pointer; transition: border-color 0.2s ease, color 0.2s ease; }
.sq-btn:hover { border-color: var(--brand); color: var(--link); }
.sq-btn[aria-expanded="true"] { background: var(--tint-brand); color: var(--link); }
.sq-btn[aria-expanded="true"] .ico { transform: rotate(180deg); }
.sq-btn.run { background: var(--gradient-brand); color: #fff; border-color: transparent; }
.sq-btn .ico { width: 18px; height: 18px; }
@media (max-width: 860px) {
    .prj { grid-template-columns: minmax(0, 1fr) auto auto; }
    .prj-name { grid-column: 1 / -1; }
    .prj-hours { grid-column: 1 / -1; grid-row: 2; }
    .prj-val { grid-column: 1; grid-row: 3; text-align: left; }
    .prj-rate { grid-column: 2; grid-row: 3; }
    .prj-acts { grid-column: 3; grid-row: 3; }
}
@media (max-width: 520px) {
    .prj { grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; }
    .prj-acts { grid-column: 1 / -1; grid-row: 4; justify-content: flex-start; }
}
.prj-open { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 14px; padding: 6px 0 10px 14px; border-left: 2px solid var(--k, var(--surface-border)); margin: 2px 0 4px; }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 24px; }
@media (min-width: 900px) { .facts { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.fact { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.fact span { color: var(--text-2); font-size: 0.8rem; }
.fact b { font-variant-numeric: tabular-nums; font-weight: 650; overflow-wrap: anywhere; color: var(--text-strong); }
.fact small { color: var(--text-3); font-size: 0.78rem; }
.mini-list { display: flex; flex-direction: column; }
.mini-list .erow:last-child { border-bottom: 0; }
.cg-finished { align-self: flex-start; margin-top: 10px; }
.cgroup > .section-note { padding: 10px 0; }
.biz-group .cgroup-head h2 .key { border-radius: 50%; }
.biz-group .prj-name small { white-space: normal; }

/* ----- Time and money ----- */
.log-top { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-items: start; }
@media (min-width: 1100px) { .log-top { grid-template-columns: minmax(320px, 0.85fr) minmax(0, 1.4fr); } }
.timer-box { display: flex; flex-direction: column; gap: 12px; padding: 18px 20px; min-width: 0; }
.timer-box h2 { font-size: 1.05rem; display: flex; align-items: center; gap: 8px; margin: 0; }
.timer-box h2 .ico { color: var(--link); }
.timer-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--timer); display: inline-block; }
.timer-clock { font-family: 'Space Grotesk', 'Inter', sans-serif; font-size: clamp(2.4rem, 6vw, 3.4rem); font-weight: 700; letter-spacing: -0.02em; line-height: 1; font-variant-numeric: tabular-nums; color: var(--text-strong); }
.timer-what { color: var(--text-2); font-size: 0.9rem; }
.timer-fields { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
@media (min-width: 520px) { .timer-fields { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); } }
.timer-fields .check-row { align-self: end; }
.timer-fields .wide { grid-column: 1 / -1; }
.quick { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(7rem, 0.8fr) minmax(0, 1fr) minmax(8.5rem, 0.8fr); gap: 12px; align-items: end; padding: 18px 20px; min-width: 0; }
.quick h2 { grid-column: 1 / -1; font-size: 1.05rem; margin: 0; }
.quick .q-note { grid-column: 1 / 3; }
.quick .q-bill { grid-column: 3; align-self: center; }
.quick .q-add { grid-column: 4; }
.quick .q-add .btn { width: 100%; }
@media (max-width: 760px) {
    .quick { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .quick .q-proj, .quick .q-note { grid-column: 1 / -1; }
    .quick .q-bill { grid-column: 1; }
    .quick .q-add { grid-column: 2; }
}
.week-head { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; }
.week-head .period-nav h2 { font-size: 1.05rem; white-space: nowrap; margin: 0; }
.week-head .period-nav h2 .muted { font-weight: 500; }
.week-head .input { width: auto; }
.days { display: flex; flex-direction: column; gap: 18px; }
.day { display: flex; flex-direction: column; }
.day-head { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line-strong); font-weight: 700; font-size: 0.95rem; color: var(--text-strong); }
.day-head span:last-child { font-variant-numeric: tabular-nums; }
.day > .section-note { padding: 10px 0; }
.erow { display: grid; grid-template-columns: minmax(0, 1fr) auto 40px; gap: 2px 12px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--surface-border); font-size: 0.925rem; min-height: 52px; }
.erow-name { min-width: 0; display: flex; flex-direction: column; }
.erow-name > span { display: flex; align-items: center; gap: 8px; min-width: 0; }
.erow-name b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-strong); }
.erow-name small { color: var(--text-2); font-size: 0.8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-left: 18px; }
.erow-val { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 600; color: var(--text-strong); }
.erow-val small { display: block; color: var(--text-2); font-weight: 500; font-size: 0.78rem; }
.erow .tag { margin-left: 2px; }
.money-groups { display: flex; flex-direction: column; gap: 24px; }
.money-total { display: flex; gap: 8px 24px; flex-wrap: wrap; font-size: 0.925rem; color: var(--text-2); }
.money-total b { font-variant-numeric: tabular-nums; color: var(--text-strong); }
.money-total b.neg { color: var(--bad); }

/* ----- What to charge ----- */
.rates-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-items: start; }
@media (min-width: 1100px) { .rates-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.rate-block > p.muted { font-size: 0.9rem; max-width: 70ch; }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr)); gap: 12px 16px; align-items: start; }
.receipt { display: flex; flex-direction: column; font-size: 0.925rem; }
.rc { display: flex; justify-content: space-between; gap: 16px; padding: 8px 0; border-bottom: 1px solid var(--surface-border); align-items: baseline; }
.rc span:first-child { color: var(--text-2); }
.rc b { font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 600; color: var(--text-strong); }
.rc.sum { border-bottom: 2px solid var(--text-strong); }
.rc.sum span:first-child { color: var(--text-strong); font-weight: 600; }
.answer { display: flex; flex-direction: column; gap: 4px; padding: 16px; border-radius: 14px; background: var(--tint-brand); border: 1px solid var(--tint-brand-border); }
.answer .big { font-family: 'Space Grotesk', 'Inter', sans-serif; font-size: clamp(1.8rem, 3.5vw, 2.5rem); font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; color: var(--text-strong); }
.answer .big.pos { color: var(--good); }
.answer .big.neg { color: var(--bad); }
.answer .sub { color: var(--text-2); }
.answer .cmp { font-size: 0.925rem; margin-top: 6px; color: var(--text); }
.slider-row { display: grid; grid-template-columns: minmax(0, 1fr) 5rem; gap: 6px 16px; align-items: center; }
.slider-row output { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text-strong); }
.range { width: 100%; accent-color: var(--brand); min-height: 32px; }

/* ----- Settings ----- */
.settings-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-items: start; }
@media (min-width: 1024px) { .settings-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.set-block .field > .input.num, .set-block .field > .suffix-wrap { max-width: 16rem; }
.set-block .field > .select { max-width: 22rem; }
.data-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.suffix-wrap { position: relative; display: block; }
.suffix-wrap .input { padding-right: 34px; }
.suffix-wrap .input:has(+ .suffix--word), .assume .suffix-wrap .input, .biz-strip .suffix-wrap .input { padding-right: 76px; }
.suffix { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }

/* ----- Windows: forms and the import ----- */
.dialog-form { margin: 0; }
.dialog-actions.split .grow { flex: 1; }
.form-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px 16px; }
@media (min-width: 520px) { .form-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .span-2 { grid-column: 1 / -1; } }
.form-grid .check-row { align-self: center; }
.dialog .select { width: 100%; }
.dialog .seg { align-self: flex-start; }
.drop { border: 2px dashed var(--tint-brand-border); border-radius: 16px; padding: 28px 16px; text-align: center; display: flex; flex-direction: column; gap: 10px; align-items: center; color: var(--text-2); background: var(--tint-brand); transition: border-color 0.2s ease, transform 0.2s ease; }
.drop .ico { width: 30px; height: 30px; color: var(--link); }
.drop b { color: var(--text-strong); font-size: 1.02rem; }
.drop.over { border-color: var(--brand); transform: translateY(-2px); }
#importStep { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
#importStep > .dialog-actions { margin: 0 -20px -20px; }
.imp-summary { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 0.925rem; color: var(--text); }
.imp-fx .input { max-width: 12rem; }
.imp-list { display: flex; flex-direction: column; max-height: min(48vh, 520px); overflow-y: auto; overscroll-behavior: contain; border-top: 1px solid var(--surface-border); border-bottom: 1px solid var(--surface-border); }
.imp-row { display: grid; grid-template-columns: minmax(0, 1fr) 7rem minmax(0, 14rem) 8rem; gap: 6px 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--surface-border); font-size: 0.9rem; }
.imp-row:last-child { border-bottom: 0; }
.imp-row .nm { min-width: 0; }
.imp-row .nm b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-strong); }
.imp-row .nm small { display: block; color: var(--text-3); font-size: 0.76rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.imp-row .v { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 640px) {
    .imp-row { grid-template-columns: minmax(0, 1fr) auto; }
    .imp-row select.input, .imp-row .rate-in { grid-column: 1 / -1; }
}
.colmap { display: grid; grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); gap: 10px 14px; }
details.more { border-top: 1px solid var(--surface-border); padding-top: 10px; }
details.more > summary { cursor: pointer; font-weight: 600; font-size: 0.9rem; color: var(--link); width: fit-content; }
details.more[open] > summary { margin-bottom: 10px; }
details.more .actions { margin-top: 8px; }
.plain-list { margin: 0; padding-left: 1.2em; }
.plain-list li { color: var(--text-2); margin-bottom: 6px; }
.help-body ul.plain-list, #importStep ul.plain-list { list-style: disc; }
@media (forced-colors: active) {
    .stack i, .brow-bar i, .hbar i, .key, .st-bar, .st-cut { forced-color-adjust: none; }
}

/* ----- The printed report: only the report, in black on white ----- */
.print-sheet { display: none; }
@media print {
    @page { margin: 16mm; }
    body { background: #fff; color: #000; }
    body:has(#printSheet:not(:empty)) > *:not(#printSheet) { display: none !important; }
    .print-sheet:not(:empty) { display: block !important; font-family: 'Inter', sans-serif; font-size: 10.5pt; color: #000; }
    .print-sheet h1 { font-size: 18pt; margin: 0 0 2pt; color: #000; }
    .print-sheet h2 { font-size: 12pt; border-bottom: 1.5pt solid #000; padding-bottom: 3pt; margin: 14pt 0 4pt; color: #000; }
    .print-sheet .sub { color: #444; margin: 0 0 12pt; }
    .print-sheet .facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10pt; }
    .print-sheet .facts div { border-top: 0.5pt solid #999; padding-top: 4pt; }
    .print-sheet .facts small { display: block; color: #444; }
    .print-sheet table { width: 100%; border-collapse: collapse; margin: 0; background: none; }
    .print-sheet td, .print-sheet th { padding: 3pt 0; border: 0; border-bottom: 0.5pt solid #ccc; color: #000; text-align: left; vertical-align: top; }
    .print-sheet th { font-size: 9pt; color: #444; border-bottom: 1pt solid #000; }
    .print-sheet td.v, .print-sheet th.v { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; padding-left: 8pt; }
    .print-sheet tr.t td { font-weight: 700; border-bottom: 0; padding-top: 6pt; }
    .print-sheet ul { padding-left: 1.2em; }
    .print-sheet li { margin-bottom: 4pt; color: #000; }
    .print-sheet .note { margin-top: 14pt; color: #555; font-size: 9pt; }
}

/* ----- Tablets ----- */
@media (max-width: 1023px) {
    .info-section .info-grid { grid-template-columns: repeat(2, 1fr); }
    .info-three { grid-template-columns: 1fr; }
}

/* ----- Phones ----- */
@media (max-width: 639px) {
    .app-hero { margin-bottom: 1.5rem; }
    .app-tagline { font-size: 1rem; }
    .app-toolbar { gap: 10px; }
    .toolbar-left, .toolbar-right { width: 100%; }
    .status-pill { flex: 1 1 100%; min-width: 0; }
    .pill { flex: 1 1 100%; }
    .pill-main { flex: 1; }
    .toolbar-right .btn { flex: 1 1 auto; }
    .app-shell > .view-tabs { width: 100%; }
    .app-shell > .view-tabs .view-tab { flex: 1 1 auto; justify-content: center; padding: 8px 6px; font-size: 0.85rem; }
    .view-tab .long, .view-head .long { display: none; }
    .view-tab .short, .view-head .short { display: inline; }
    .view-head .actions { width: 100%; }
    .view-head .actions .btn { flex: 1; padding: 9px 10px; }
    .section, .set-block, .rate-block { padding: 0 16px 16px; }
    .section-head, .set-block > h2, .rate-block > h2 { margin: 0 -16px; padding: 12px 16px; }
    .section > :first-child:not(.section-head), .set-block > :first-child:not(h2), .rate-block > :first-child:not(h2) { margin-top: 16px; }
    .cgroup { padding: 0 16px 12px; }
    .cgroup-head { margin: 0 -16px; padding: 12px 16px; }
    .hero, .start, .timer-box, .quick, .biz-strip { padding: 16px; }
    .ro { padding: 14px 16px; }
    .readouts { gap: 12px; }
    .assume .input, .assume .suffix-wrap .input { width: 100%; }
    .assume .field { flex: 1 1 calc(50% - 10px); min-width: 0; }
    .assume-note { flex-basis: 100%; }
    .biz-strip { grid-template-columns: minmax(0, 1fr); }
    .toasts { bottom: 16px; right: 16px; left: 16px; align-items: stretch; }
    .toast { min-width: 0; max-width: none; }
    .dialog-body, .dialog-head, .dialog-actions { padding-left: 16px; padding-right: 16px; }
    #importStep > .dialog-actions { margin: 0 -16px -20px; }
    .info-section h2 { font-size: 1.4rem; }
    .info-section .info-grid, .info-three { grid-template-columns: 1fr; }
    .info-card { padding: 16px; }
    .step-num { left: 16px; }
}

@media (prefers-reduced-motion: reduce) {
    .btn, .info-card, .dialog, .toast, .chip, .seg button, .view-tab, .sq-btn, .drop { transition: none; animation: none; }
}

/* Phones: 16 px text, 44 px tap targets (AdSense audit H-04, 8 Oct 2026). The staircase, the bars, the map and the charts
   are drawings and keep their own sizes; buttons inside a sentence read as links (WCAG 2.5.8). */
@media (max-width: 639.98px) {
    main button, main select, main summary, main [role="button"],
    main input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]):not([type="range"]) { min-height: 44px; }
    main .chip, main .seg button, main .view-tab, main .sq-btn, main .icon-btn { min-height: 44px; min-width: 44px; }
    main .sq-btn, main .icon-btn { width: 44px; height: 44px; }
    main .prj-name button { min-height: 44px; display: flex; align-items: center; }
    main .check-row input[type="checkbox"] { width: 24px; height: 24px; }
    main .check-row, .dialog .check-row { min-height: 44px; align-items: center; }
    main .range { min-height: 44px; }
    main .erow { grid-template-columns: minmax(0, 1fr) auto 44px; }
    main :is(p:not(.hero-title), li, td, th, .hint, .muted, .small, .label, .lead, .ro-label, .ro-sub, .st-name small, .st-val small,
        .check-text, .check-state, .check-money, .tag, .tbl small, .tbl .mob, .brow, .chart-legend, .stack-legend, .chart-box p,
        .prj-name small, .prj-hours, .prj-val small, .prj-rate small, .fact span, .fact small, .cg-sub, .cg-total .muted, .timer-what,
        .erow-name small, .erow-val small, .erow, .day-head, .money-total, .rc, .answer .sub, .answer .cmp, .map-note, .assume-note,
        .section-head p, .section-note, .start-steps span, .start-demo .sd, .status-sub, .form-hint, .err, .input, .select, kbd) { font-size: 1rem; }
    .dialog button, .dialog .btn, .dialog select, .dialog input:not([type="checkbox"]), .dialog summary { min-height: 44px; }
    .dialog .dialog-close { width: 44px; height: 44px; }
    .dialog :is(p, li, .form-hint, .hint, .input, .select, .label, .seg button, .check-row, .err, .imp-row, .imp-row .nm small, .imp-summary, .drop span) { font-size: 1rem; }
}
