/* Inopro HQ design system. One small file, self-hosted fonts, no build step.
   Brand: blue #1564FE, charcoal #252626, Montserrat for headings, Inter for the interface. */

@font-face { font-family: "Inter"; font-style: normal; font-weight: 400 700; font-display: swap;
    src: url("../fonts/inter-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215; }
@font-face { font-family: "Montserrat"; font-style: normal; font-weight: 600 800; font-display: swap;
    src: url("../fonts/montserrat-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215; }

:root {
    --r: 12px; --r-xs: 6px;      /* one corner shape for every box and control; the small one is only for tiny marks */
    --bg: #f5f7fa;
    --surface: #ffffff;
    --surface-2: #f1f4f9;
    --hover: #f6f8fc;
    --border: #e3e8ef;
    --border-strong: #ccd5e1;
    --text: #1a1d24;
    --muted: #596273;
    --faint: #8b94a5;
    --brand: #1564fe;
    --brand-hover: #0f52d6;
    --brand-soft: #eaf1ff;
    --brand-ink: #ffffff;
    --sky: #2d9cea;
    --ok: #12795a;
    --ok-soft: #e4f5ee;
    --warn: #9a5700;
    --warn-soft: #fdf1da;
    --bad: #c42b2b;
    --bad-soft: #fdeaea;
    --radius: var(--r);
    --radius-lg: var(--r);
    --ring: 0 0 0 3px rgba(21, 100, 254, .22);
    --shadow: 0 1px 2px rgba(16, 24, 40, .05);
    --sidebar-w: 236px;
    --topbar-h: 56px;
    --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", Arial, sans-serif;
    --font-head: "Montserrat", "Inter", system-ui, sans-serif;
}

:root[data-theme="dark"] {
    --bg: #0d1117;
    --surface: #141a23;
    --surface-2: #1b222d;
    --hover: #18202b;
    --border: #252e3b;
    --border-strong: #33404f;
    --text: #e7ebf2;
    --muted: #9ba5b6;
    --faint: #6e7a8c;
    --brand: #4d8dff;
    --brand-hover: #6fa1ff;
    --brand-soft: #14284f;
    --brand-ink: #0b1220;
    --ok: #4cc392;
    --ok-soft: #0f2a21;
    --warn: #f0b04a;
    --warn-soft: #2e2410;
    --bad: #ff7a7a;
    --bad-soft: #351718;
    --ring: 0 0 0 3px rgba(77, 141, 255, .3);
    --shadow: none;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--bg); color: var(--text); font: 400 14px/1.55 var(--font); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--font-head); letter-spacing: -.01em; margin: 0; color: var(--text); }
h1 { font-size: 22px; font-weight: 600; line-height: 1.25; }
h2 { font-size: 15px; font-weight: 600; margin-bottom: 12px; }
p { margin: 0 0 8px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12.5px; }
.num { font-variant-numeric: tabular-nums; text-align: right; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.i { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.i.sm { width: 16px; height: 16px; }

/* ------------------------------------------------------------ shell */
.shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }

.sidebar { background: var(--surface); border-right: 1px solid var(--border); position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; }
.sidebar-brand { height: var(--topbar-h); display: flex; align-items: center; padding: 0 18px; border-bottom: 1px solid var(--border); }
.sidebar-brand img { height: 26px; width: auto; display: block; }
.dark-logo { display: none !important; }
:root[data-theme="dark"] .light-logo { display: none !important; }
:root[data-theme="dark"] .dark-logo { display: block !important; }

.nav { padding: 10px; overflow-y: auto; flex: 1; }
.nav-label { font-size: 11px; font-weight: 600; color: var(--faint); padding: 16px 10px 6px; }
.nav a { display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 10px; border-radius: var(--radius); color: var(--muted); font-weight: 500; }
.nav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav a.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.nav a kbd { margin-left: auto; opacity: 0; transition: opacity .12s; }
.nav a:hover kbd { opacity: 1; }
.sidebar-foot { padding: 12px 18px; border-top: 1px solid var(--border); font-size: 12px; color: var(--faint); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { height: var(--topbar-h); background: var(--surface); border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 12px; padding: 0 24px; position: sticky; top: 0; z-index: 20; }
.search { position: relative; flex: 0 1 380px; }
.search .i { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.search input[type=search] { height: 36px; padding: 0 44px 0 36px; background: var(--surface-2); border-color: transparent; }
.search input[type=search]:hover { border-color: var(--border); }
.search input[type=search]:focus { background: var(--surface); }
.search kbd { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); }
.spacer { flex: 1; }
.btn.menu-btn { display: none; }

/* edge to edge: the page fills the window next to the sidebar, with padding that grows a little on big screens */
.content { padding: 28px clamp(16px, 2.2vw, 44px) 56px; width: 100%; max-width: none; }
.content > form.card:not(.flush) { max-width: 980px; }   /* forms stay readable; lists, boards and charts use the full width */
.page-head { display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head .titles { flex: 1 1 280px; min-width: 0; }
.page-head .sub { color: var(--muted); margin: 4px 0 0; }
.page-head .actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.crumbs { font-size: 12.5px; color: var(--faint); margin-bottom: 6px; }
.crumbs a { color: var(--muted); }

/* ------------------------------------------------------------ components */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 20px; margin-bottom: 16px; }
.card.flush { padding: 0; overflow: hidden; }
.card > h2:first-child { margin-top: 0; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: var(--radius); border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font: 500 13.5px/1 var(--font); cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:active { transform: translateY(.5px); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn-primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12.5px; }
.btn-icon { width: 36px; padding: 0; }
.btn:focus-visible, .nav a:focus-visible, summary:focus-visible { outline: none; box-shadow: var(--ring); }

label { display: block; font-weight: 500; font-size: 13px; margin-bottom: 5px; color: var(--text); }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=time], input[type=search], select, textarea {
    width: 100%; height: 36px; padding: 0 11px; border-radius: var(--radius); border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font: inherit; }
textarea { height: auto; padding: 9px 11px; line-height: 1.5; }
input::placeholder, textarea::placeholder { color: var(--faint); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: var(--ring); }
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--brand); }
.field { margin-bottom: 16px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.err { color: var(--bad); font-size: 12.5px; margin-top: 5px; }
.hint { color: var(--faint); font-size: 12.5px; margin-top: 4px; }
.form-actions { display: flex; gap: 8px; padding-top: 8px; }

.flash { display: flex; gap: 10px; align-items: center; padding: 10px 14px; border-radius: var(--radius); background: var(--ok-soft); color: var(--ok); font-weight: 500; margin-bottom: 16px; }
.flash.bad { background: var(--bad-soft); color: var(--bad); }
.flash.warn { background: var(--warn-soft); color: var(--warn); }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 0 16px; height: 46px; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { height: 38px; font-size: 12px; font-weight: 600; color: var(--muted); background: var(--surface-2); white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--hover); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td a.row-title { color: var(--text); font-weight: 600; }
td a.row-title:hover { color: var(--brand); }
.table-wrap { overflow-x: auto; }

.badge { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px; border-radius: var(--r); font-size: 12px; font-weight: 500; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.info { background: var(--brand-soft); color: var(--brand); }

kbd { font: 500 11px/1 var(--font); background: var(--surface); border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: var(--r-xs); padding: 3px 5px; color: var(--muted); }

.empty { text-align: center; padding: 44px 20px; }
.empty .icon { width: 44px; height: 44px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; margin: 0 auto 12px; }
.empty h3 { font-size: 15px; margin-bottom: 4px; }
.empty p { color: var(--muted); max-width: 380px; margin: 0 auto 14px; }

.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: end; margin-bottom: 14px; }
.toolbar .grow { flex: 1 1 240px; }
.toolbar select { width: auto; min-width: 140px; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px 18px; display: block; color: inherit; }
a.stat:hover { border-color: var(--brand); text-decoration: none; }
.stat .l { color: var(--muted); font-size: 12.5px; font-weight: 500; }
.stat .v { font: 600 26px/1.2 var(--font-head); font-variant-numeric: tabular-nums; margin-top: 4px; }
.stat .n { color: var(--faint); font-size: 12px; margin-top: 2px; }

.card .grid2 > div > .muted.small { font-size: 12px; font-weight: 600; text-transform: none; letter-spacing: .01em; margin-bottom: 2px; }
.card .grid2 > div > div:not(.muted) { margin-bottom: 14px; }
.timer-pill { display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 4px 0 12px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); }
.timer-pill time { font-variant-numeric: tabular-nums; font-weight: 600; min-width: 58px; }
.timer-proj { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.timer-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--bad); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.day-head td { background: var(--surface-2); font-weight: 600; height: 36px; color: var(--muted); border-bottom: 1px solid var(--border); }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 8px 16px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }

.perm-group { margin-bottom: 14px; }
.perm { display: flex; align-items: center; gap: 8px; font-weight: 400; margin-bottom: 6px; }
.perm input { width: auto; }
pre.json { margin: 0; font: 12px ui-monospace, Consolas, monospace; white-space: pre-wrap; word-break: break-word; max-width: 420px; color: var(--muted); }

/* dropdown menus (details/summary: no JS needed) */
.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-panel { position: absolute; right: 0; top: calc(100% + 6px); min-width: 220px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: 0 8px 24px rgba(16, 24, 40, .12); padding: 6px; z-index: 30; }
.menu-panel a, .menu-panel button { display: flex; width: 100%; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r-xs); color: var(--text); background: none; border: 0; font: inherit; cursor: pointer; text-align: left; }
.menu-panel a:hover, .menu-panel button:hover { background: var(--surface-2); text-decoration: none; }
.menu-panel .who { padding: 8px 10px 10px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.menu-panel .who strong { display: block; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; font-weight: 600; font-size: 12.5px; }

/* ------------------------------------------------------------ sign in */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); background: var(--surface); }
.auth-brand { background: #1564fe; color: #fff; padding: 48px 56px; display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; }
.auth-brand img { height: 34px; width: auto; }
.auth-brand h2 { color: #fff; font-size: 30px; line-height: 1.25; font-weight: 600; max-width: 440px; margin: 0 0 14px; }
.auth-brand p { color: rgba(255, 255, 255, .85); font-size: 15px; max-width: 420px; }
.auth-brand small { color: rgba(255, 255, 255, .7); }
.auth-form { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px; }

/* Sign in with Microsoft: white button, official four-square mark */
.btn-ms { width: 100%; height: 40px; background: #fff; color: #5e5e5e; border: 1px solid #8c8c8c; font-weight: 600; }
.btn-ms:hover { background: #f3f3f3; text-decoration: none; }
:root[data-theme="dark"] .btn-ms { background: #fff; color: #5e5e5e; }
.or-line { display: flex; align-items: center; gap: 10px; margin: 18px 0; color: var(--faint); font-size: 12.5px; }
.or-line::before, .or-line::after { content: ""; flex: 1; border-top: 1px solid var(--border); }

/* legal and privacy footer, public pages */
body.public { display: flex; flex-direction: column; min-height: 100vh; }
.public-top { display: flex; justify-content: space-between; align-items: center; padding: 14px 24px; background: var(--surface); border-bottom: 1px solid var(--border); }
.public-top img { height: 28px; width: auto; }
.public-main { flex: 1; padding: 36px 24px; }
.doc { max-width: 760px; margin: 0 auto; }
.doc h1 { font-size: 28px; margin-bottom: 4px; }
.doc h2 { font-size: 17px; margin: 28px 0 8px; }
.doc p, .doc li { font-size: 15px; line-height: 1.7; }
.doc ul { padding-left: 20px; margin: 0 0 10px; }
.auth-form form { width: 100%; max-width: 360px; }
.auth-form h1 { font-size: 24px; margin-bottom: 6px; }
.auth-form .mobile-logo { display: none; height: 28px; width: auto; max-width: 100%; object-fit: contain; margin-bottom: 28px; }

@media (max-width: 880px) {
    .shell { grid-template-columns: 1fr; }
    .sidebar { position: fixed; left: 0; top: 0; z-index: 40; width: 260px; transform: translateX(-100%); transition: transform .16s ease; }
    body.nav-open .sidebar { transform: none; box-shadow: 0 0 0 100vmax rgba(10, 15, 25, .45); }
    .btn.menu-btn { display: inline-flex; }
    .topbar { padding: 0 14px; }
    .content { padding: 20px 16px 48px; }
    .grid2 { grid-template-columns: 1fr; }
    .auth { grid-template-columns: 1fr; }
    .auth-brand { display: none; }
    .auth-form .mobile-logo { display: block; }
    .kv { grid-template-columns: 1fr; gap: 2px; }
    .kv dd { margin-bottom: 8px; }
}
@media (max-width: 560px) { .search kbd { display: none; } .search { flex-basis: 100%; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }


/* Appearance page: small live samples of each look */
.skin-pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; margin-bottom: 16px; }
.skin-opt { position: relative; display: block; border: 2px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); cursor: pointer; overflow: hidden; }
.skin-opt:has(input:checked) { border-color: var(--brand); box-shadow: var(--ring); }
.skin-opt input { position: absolute; opacity: 0; pointer-events: none; }
.skin-opt .meta { padding: 14px 16px; }
.skin-opt .meta b { font: 600 15px var(--font-head); }

/* ---------- Dashboard grid and charts (pure CSS and inline SVG, no scripts, nothing to load) ---------- */
:root { --ch1: #1564fe; --ch2: #0b8a7b; --ch3: #5b3bd1; --ch4: #d98a00; --ch5: #cc4326; --ch6: #64748b; }
:root[data-theme="dark"] { --ch1: #5b93ff; --ch2: #3cc7b5; --ch3: #a994ff; --ch4: #f0b04a; --ch5: #ff8f72; --ch6: #94a3b8; }
.ch-1 { --c: var(--ch1); } .ch-2 { --c: var(--ch2); } .ch-3 { --c: var(--ch3); }
.ch-4 { --c: var(--ch4); } .ch-5 { --c: var(--ch5); } .ch-6 { --c: var(--ch6); }

.seg { display: inline-flex; background: var(--surface-2); border-radius: var(--radius); padding: 3px; gap: 2px; }
.seg a { padding: 5px 11px; border-radius: var(--r-xs); font-size: 12.5px; font-weight: 600; color: var(--muted); }
.seg a:hover { text-decoration: none; color: var(--text); }
.seg a.on { background: var(--surface); color: var(--brand); box-shadow: var(--shadow); }

.dash { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; align-items: stretch; }
.wg { min-width: 0; position: relative; }
.wg > .card, .wg > .stat { margin: 0; height: 100%; min-width: 0; }
.w-2 { grid-column: span 2; } .w-3 { grid-column: span 3; } .w-4 { grid-column: span 4; } .w-6 { grid-column: span 6; } .w-8 { grid-column: span 8; } .w-12 { grid-column: span 12; }
[data-widget][hidden] { display: none !important; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.card-head.pad { padding: 18px 20px 0; margin-bottom: 4px; }
.card-head h2 { margin: 0; }
.card-head p { margin: 2px 0 0; }
.big { font: 600 26px/1 var(--font-head); font-variant-numeric: tabular-nums; white-space: nowrap; }
.big small { font-size: 13px; color: var(--muted); margin-left: 3px; font-weight: 500; }
.up { color: var(--ok); font-weight: 600; } .down { color: var(--bad); font-weight: 600; }
.dash .empty { padding: 28px 12px; }

/* vertical bars */
.bars { display: flex; align-items: stretch; gap: 6px; height: 230px; }
.bars .bar { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.bars .bv { font-size: 11px; color: var(--muted); height: 14px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.bars .bt { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; border-bottom: 1px solid var(--border-strong); }
.bars .bt i { display: block; width: min(100%, 44px); background: var(--c); border-radius: var(--r-xs) var(--r-xs) 0 0; transition: filter .12s; }
.bars .bt i.zero { background: transparent; }
.bars .bar:hover .bt i { filter: brightness(1.12); }
.bars .bl { font-size: 11px; color: var(--faint); height: 14px; overflow: hidden; white-space: nowrap; }
.bars.dense { gap: 2px; } .bars.dense .bl { font-size: 10px; }

/* horizontal bars */
.hbars { display: flex; flex-direction: column; gap: 12px; }
.hrow { display: grid; grid-template-columns: minmax(70px, 34%) minmax(0, 1fr) auto; gap: 10px; align-items: center; font-size: 13px; }
.hl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.ht { height: 10px; background: var(--surface-2); border-radius: var(--r); overflow: hidden; }
.ht i { display: block; height: 100%; background: var(--c); border-radius: var(--r); }
.hv { font-variant-numeric: tabular-nums; font-weight: 600; text-align: right; white-space: nowrap; }
.hv em { font-style: normal; font-weight: 500; font-size: 11.5px; color: var(--bad); margin-left: 6px; }

/* donut */
.donut-wrap { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.donut { position: relative; width: 148px; height: 148px; flex: none; }
.donut svg { width: 100%; height: 100%; transform: none; }
.donut circle { fill: none; stroke-width: 6; }
.donut .ring { stroke: var(--surface-2); }
.donut .seg { stroke: var(--c); }
.donut .mid { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.donut .mid b { font: 600 24px/1.1 var(--font-head); }
.donut .mid span { font-size: 11.5px; color: var(--muted); }
.legend { list-style: none; margin: 0; padding: 0; flex: 1 1 150px; display: flex; flex-direction: column; gap: 9px; font-size: 13px; }
.legend li { display: flex; align-items: center; gap: 9px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; background: var(--c); flex: none; }
.legend span { flex: 1; color: var(--muted); }
.legend b { font-variant-numeric: tabular-nums; }

/* activity feed */
.feed { list-style: none; margin: 0; padding: 6px 0 8px; }
.feed li { display: flex; align-items: center; gap: 12px; padding: 11px 20px; border-top: 1px solid var(--border); }
.feed li:first-child { border-top: 0; }
.feed li > div { flex: 1; min-width: 0; }
.feed li b { font-weight: 600; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ch1); flex: none; }
.feed .dot.late { background: var(--bad); }

@media (max-width: 1280px) { .w-2 { grid-column: span 4; } .w-3 { grid-column: span 4; } .w-4 { grid-column: span 6; } .w-8 { grid-column: span 12; } }
@media (max-width: 760px) { .w-2, .w-3 { grid-column: span 6; } .w-4, .w-6, .w-8 { grid-column: span 12; } .bars { height: 190px; } .page-head .actions { width: 100%; } }

/* phones: the top bar must never be wider than the screen */
@media (max-width: 560px) {
    .topbar { gap: 8px; padding: 0 12px; }
    .search { flex: 1 1 36px; min-width: 36px; }
    .search input[type=search] { padding-right: 6px; }
    .topbar .btn { padding: 0 10px; }
    .timer-proj { max-width: 70px; }
    .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 420px) { .search { display: none; } .topbar .spacer { flex: 1; } }

/* ---------- Dashboards: tabs, templates and the layout editor ---------- */
.dash-tabs { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin: -6px 0 18px; border-bottom: 1px solid var(--border); }
.dash-tabs > a { padding: 9px 14px; font-weight: 600; font-size: 13.5px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.dash-tabs > a:hover { text-decoration: none; color: var(--text); }
.dash-tabs > a.on { color: var(--brand); border-bottom-color: var(--brand); }
.dash-tabs .menu { margin-bottom: -1px; }
.dash-tabs .menu:first-of-type { margin-left: 6px; }
.tab-add { display: inline-flex; align-items: center; gap: 5px; padding: 9px 10px; font-size: 13px; font-weight: 600; color: var(--muted); }
.tab-add:hover { color: var(--brand); }
.dash-tabs .menu-panel { left: 0; right: auto; }
.tpl-panel { min-width: 320px; padding: 14px; }
.tpl { display: flex; gap: 10px; align-items: flex-start; padding: 8px 6px; border-radius: var(--r); cursor: pointer; font-weight: 400; }
.tpl:hover { background: var(--surface-2); }
.tpl input { width: auto; margin-top: 3px; }
.tpl b { display: block; font-weight: 600; }
.tpl em { display: block; font-style: normal; font-size: 12px; color: var(--muted); line-height: 1.4; }

.editbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 16px; margin-bottom: 16px; background: var(--brand-soft); border: 1px solid var(--brand); border-radius: var(--radius-lg); position: sticky; top: calc(var(--topbar-h) + 8px); z-index: 15; }
.editbar[hidden] { display: none; }
.editbar-text { flex: 1 1 260px; display: flex; flex-direction: column; gap: 2px; }
.editbar .menu-panel { left: 0; right: auto; }
.menu-panel .addrow { display: flex; justify-content: space-between; gap: 10px; }
.menu-panel .addrow small { color: var(--faint); }

.dash.editing .wg { outline: 2px dashed var(--border-strong); outline-offset: 3px; border-radius: var(--radius-lg); }
.dash.editing .wg > .card, .dash.editing .wg > .stat { pointer-events: none; opacity: .92; }
.dash.editing .wg.drag { opacity: .45; outline-color: var(--brand); }
.dash.editing .wg.over { outline: 2px solid var(--brand); }
.wg-bar { display: none; }
.dash.editing .wg-bar { display: flex; align-items: center; gap: 6px; position: absolute; top: 6px; left: 6px; right: 6px; z-index: 5; padding: 4px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r); box-shadow: 0 4px 14px rgba(16, 24, 40, .14); }
.wg-bar .grip { cursor: grab; touch-action: none; width: 30px; height: 28px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: var(--r-xs); background: var(--surface-2); color: var(--muted); font-size: 16px; line-height: 1; padding: 0; }
.wg-bar .grip:active { cursor: grabbing; }
.wg-bar .grip:focus-visible { outline: none; box-shadow: var(--ring); }
.wg-bar .ttl { flex: 1; min-width: 0; font-size: 12px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wg-bar select { width: auto; height: 28px; padding: 0 6px; font-size: 12px; }
.wg-bar .rm { width: 28px; height: 28px; border: 0; border-radius: var(--r-xs); background: transparent; color: var(--bad); font-size: 18px; line-height: 1; cursor: pointer; padding: 0; }
.wg-bar .rm:hover { background: var(--bad-soft); }
.dash.editing { padding-top: 6px; }
.dash.editing .wg { display: flex; flex-direction: column; padding-top: 42px; }
.dash.editing .wg > .card, .dash.editing .wg > .stat { flex: 1; height: auto; }
.wg-bar { top: 4px; }

/* ---------- Clock and notification bell in the top bar ---------- */
.clock { display: flex; flex-direction: column; align-items: flex-end; justify-content: center; line-height: 1.15; padding: 2px 8px; border-radius: var(--r); cursor: pointer; list-style: none; }
.clock::-webkit-details-marker { display: none; }
.clock:hover { background: var(--surface-2); }
.clock-time { font: 600 12px var(--font); font-variant-numeric: tabular-nums; color: var(--text); white-space: nowrap; }
.clock-date { font-size: 10.5px; color: var(--faint); white-space: nowrap; }
.clock-menu .menu-panel { right: 0; }
.bell-menu > summary { position: relative; }
.bell-count { position: absolute; top: 2px; right: 1px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: var(--r); background: var(--bad); color: #fff; font: 700 10px/17px var(--font); text-align: center; }
.bell-count[hidden] { display: none; }
.notice-panel { width: 340px; max-width: calc(100vw - 24px); padding: 0; overflow: hidden; }
.np-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.np-head form { margin: 0; }
.menu-panel .np-link { width: auto; padding: 2px 6px; font-size: 12px; color: var(--brand); font-weight: 600; }
.menu-panel a.np-item { flex-direction: column; align-items: flex-start; gap: 2px; border-radius: 0; padding: 10px 14px; border-bottom: 1px solid var(--border); white-space: normal; }
.np-item b { font-weight: 600; font-size: 13px; }
.np-item span { font-size: 12.5px; color: var(--muted); }
.np-item small { font-size: 11px; color: var(--faint); }
.np-item.unread { background: var(--brand-soft); }
.menu-panel a.np-all { justify-content: center; border-radius: 0; color: var(--brand); font-weight: 600; font-size: 13px; }
.np-row { display: flex; align-items: center; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--border); color: var(--text); }
.np-row:hover { background: var(--surface-2); text-decoration: none; }
.np-row > div { flex: 1; min-width: 0; }
.np-row .dot { width: 9px; height: 9px; border-radius: 50%; background: transparent; flex: none; }
.np-row.unread .dot { background: var(--brand); }
.np-row.unread b { font-weight: 700; }
@media (max-width: 560px) {
    .clock-date { display: none; }
    .clock { padding: 2px 4px; }
    .clock-time { font-size: 11px; }
    .notice-panel { position: fixed; left: 12px; right: 12px; top: calc(var(--topbar-h) + 6px); width: auto; max-width: none; }
}
@media (max-width: 420px) { .clock-menu { display: none; } }
.w-2 .wg-bar .ttl { display: none; }
@media (max-width: 420px) { .topbar { gap: 4px; padding: 0 8px; } .topbar .btn-icon { width: 32px; } }

/* ---------- Task page and kanban board ---------- */
.task-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.task-main > .card, .task-side > .card { margin-bottom: 16px; }
@media (max-width: 1000px) { .task-layout { grid-template-columns: minmax(0, 1fr); } }
.tlist { list-style: none; margin: 0; padding: 0; }
.tlist li { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.tlist li:last-child { border-bottom: 0; }
.tlist form { margin: 0; }
.grow { flex: 1; min-width: 0; }
.tick { width: 20px; height: 20px; border-radius: var(--r-xs); border: 2px solid var(--border-strong); background: var(--surface); padding: 0; cursor: pointer; flex: none; display: inline-block; position: relative; }
span.tick { cursor: default; }
.tick.on { background: var(--ok); border-color: var(--ok); }
.tick.on::after { content: ""; position: absolute; left: 4px; top: 0; width: 5px; height: 10px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.tick:focus-visible { outline: none; box-shadow: var(--ring); }
.is-done > a, .is-done > .grow { text-decoration: line-through; color: var(--muted); }
.x { border: 0; background: transparent; color: var(--faint); font-size: 18px; cursor: pointer; line-height: 1; padding: 2px 8px; border-radius: var(--r-xs); }
.x:hover { background: var(--bad-soft); color: var(--bad); }
.meter { width: 120px; height: 8px; background: var(--surface-2); border-radius: var(--r); overflow: hidden; flex: none; margin-top: 6px; }
.meter i { display: block; height: 100%; background: var(--ok); border-radius: var(--r); }
.inline-add { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.inline-add input[type=text] { flex: 1 1 200px; min-width: 0; }
.inline-add select, .inline-add input[type=date] { width: auto; max-width: 100%; }
.comments { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.comments li { display: flex; gap: 10px; align-items: flex-start; }
.comments form { margin: 0; }

.board { display: grid; grid-template-columns: repeat(3, minmax(260px, 1fr)); gap: 16px; align-items: start; overflow-x: auto; padding-bottom: 6px; }
.kcol { background: var(--surface-2); border-radius: var(--radius-lg); padding: 10px; min-height: 220px; }
.kcol header { display: flex; justify-content: space-between; align-items: center; padding: 4px 6px 10px; }
.kcol .count { background: var(--surface); border-radius: var(--r); padding: 1px 9px; font-size: 12px; font-weight: 600; color: var(--muted); }
.kbody { display: flex; flex-direction: column; gap: 8px; min-height: 140px; }
.kcard { position: relative; background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--border-strong); border-radius: var(--radius); padding: 10px 10px 10px 28px; box-shadow: var(--shadow); }
.kcard.prio-high { border-left-color: var(--bad); }
.kcard.prio-normal { border-left-color: var(--brand); }
.kcard.drag { opacity: .45; }
.kgrip { position: absolute; left: 3px; top: 8px; width: 20px; height: 26px; border: 0; background: transparent; cursor: grab; touch-action: none; color: var(--faint); padding: 0; font-size: 14px; line-height: 1; }
.kgrip:active { cursor: grabbing; }
.kgrip:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 4px; }
.ktitle { display: block; font-weight: 600; color: var(--text); margin-bottom: 6px; overflow-wrap: anywhere; }
.kmeta { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
@media (max-width: 880px) { .board { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Module tabs, project cards, priority tags ---------- */
.subtabs { display: flex; gap: 2px; margin: -8px 0 20px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.subtabs::-webkit-scrollbar { display: none; }
.subtabs a { padding: 10px 16px; font-weight: 600; font-size: 13.5px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; flex: none; }
.subtabs a:hover { color: var(--text); text-decoration: none; }
.subtabs a.on { color: var(--brand); border-bottom-color: var(--brand); }
.subtabs a:focus-visible { outline: none; box-shadow: var(--ring); border-radius: var(--r-xs); }

.pcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.pcard { display: flex; flex-direction: column; gap: 6px; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); color: var(--text); }
.pcard:hover { border-color: var(--brand); text-decoration: none; }
.pc-top { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.pc-top b { font-weight: 600; overflow-wrap: anywhere; }

.ptag { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: var(--r); font-size: 11.5px; font-weight: 600; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.ptag.p-high { background: var(--bad-soft); color: var(--bad); }
.ptag.p-normal { background: var(--brand-soft); color: var(--brand); }
.ptag.p-low { background: var(--surface-2); color: var(--faint); }
.board-pick select { height: 34px; min-width: 180px; }

/* ---------- Kanban, second pass: open columns, soft cards, progress, floating drag card ---------- */
.board { gap: 22px; grid-template-columns: repeat(3, minmax(280px, 1fr)); }
.kcol { background: transparent; padding: 0; min-height: 0; }
.kcol header { display: flex; align-items: center; gap: 8px; padding: 2px 4px 12px; }
.kcol header b { font-weight: 600; }
.kdot { width: 9px; height: 9px; border-radius: 50%; background: var(--faint); flex: none; }
.kdot.info { background: var(--ch1); }
.kdot.ok { background: var(--ok); }
.kcol .count { background: var(--surface-2); color: var(--muted); }
.kbody { gap: 12px; min-height: 90px; padding: 2px; border-radius: var(--radius-lg); }
.kcard { border: 1px solid var(--border); border-left-width: 1px; border-radius: var(--radius-lg); padding: 14px 14px 12px 26px; box-shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 6px 16px -10px rgba(16, 24, 40, .16); display: flex; flex-direction: column; gap: 10px; }
:root[data-theme="dark"] .kcard { box-shadow: none; }
.kcard:hover { border-color: var(--border-strong); }
.kgrip { left: 5px; top: 14px; }
.ktop { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.ktitle { margin: 0; font-size: 14.5px; line-height: 1.35; }
.kprog { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--muted); }
.kprog > span { font-weight: 600; font-size: 10.5px; }
.kprog .meter { flex: 1; width: auto; margin: 0; height: 6px; }
.kprog b { font-variant-numeric: tabular-nums; color: var(--text); font-weight: 600; }
.kfoot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; color: var(--muted); font-size: 12px; }
.kfoot > span { display: inline-flex; align-items: center; gap: 4px; }
.kfoot .spacer { flex: 1; }
.kfoot .i { width: 14px; height: 14px; }
.kfoot .down { color: var(--bad); font-weight: 600; }
.kcard.drag { background: transparent; border: 2px dashed var(--border-strong); box-shadow: none; }
.kcard.drag > * { visibility: hidden; }
.kclone { position: fixed; z-index: 70; margin: 0; pointer-events: none; transform: rotate(3deg); box-shadow: 0 22px 44px -12px rgba(16, 24, 40, .4); cursor: grabbing; }
.kadd { margin-top: 12px; }
.kadd input { width: 100%; height: 40px; border: 1px dashed var(--border-strong); background: transparent; border-radius: var(--radius-lg); text-align: center; color: var(--muted); }
.kadd input:hover { background: var(--surface); }
.kadd input:focus { background: var(--surface); text-align: left; color: var(--text); border-style: solid; }
.kcol header { justify-content: flex-start; } .kcol .count { margin-left: 2px; }
@media (max-width: 880px) { .board { grid-template-columns: minmax(0, 1fr); } .board-pick select { min-width: 0; width: 100%; } .board-pick { flex: 1; } }

/* ---------- Smooth dragging: the floating card moves by transform only, text is not selectable meanwhile ---------- */
body.dragging { user-select: none; -webkit-user-select: none; cursor: grabbing; }
body.dragging * { transition: none !important; }
.kclone { left: 0; top: 0; transform: translate3d(-9999px, 0, 0); will-change: transform; box-shadow: 0 14px 28px -10px rgba(16, 24, 40, .35); }

/* ---------- Files on a task ---------- */
.files { list-style: none; margin: 0 0 4px; padding: 0; }
.files li { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.files li:last-child { border-bottom: 0; }
.files form { margin: 0; }
.files .thumb { width: 44px; height: 44px; border-radius: var(--r); overflow: hidden; flex: none; background: var(--surface-2); display: grid; place-items: center; }
.files .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.files .thumb.ext { font: 700 11px var(--font); color: var(--muted); letter-spacing: .04em; }
.files a b { font-weight: 600; overflow-wrap: anywhere; }
.inline-add input[type=file] { flex: 1 1 220px; min-width: 0; padding: 6px; }

/* ---------- Phone app: bottom bar, thumb-sized controls, safe areas ---------- */
html { -webkit-tap-highlight-color: transparent; }
a, button, select, summary, label, input[type=checkbox], input[type=radio] { touch-action: manipulation; }

.tabbar { display: none; }
@media (max-width: 880px) {
    .tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 35; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--surface); border-top: 1px solid var(--border); padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); }
    .tabbar a, .tabbar button { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 52px; border: 0; background: transparent; color: var(--muted); font: 600 11px/1 var(--font); border-radius: var(--r); padding: 0; cursor: pointer; }
    .tabbar a:hover { text-decoration: none; }
    .tabbar .i { width: 22px; height: 22px; }
    .tabbar .on { color: var(--brand); }
    .tabbar .on .i { stroke-width: 2.1; }
    .tabbar a:focus-visible, .tabbar button:focus-visible { outline: none; box-shadow: var(--ring); }
    .dot-badge { position: absolute; top: 8px; left: calc(50% + 6px); width: 9px; height: 9px; border-radius: 50%; background: var(--bad); border: 2px solid var(--surface); }
    .content { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
    .btn.menu-btn { display: none; }                       /* the bottom bar has Menu */
    body.nav-open .tabbar { z-index: 30; }
    .sidebar { padding-bottom: env(safe-area-inset-bottom); }
    .topbar { padding-top: env(safe-area-inset-top); height: calc(var(--topbar-h) + env(safe-area-inset-top)); }

    /* thumb-sized controls, and 16px text in fields so phones do not zoom the page on focus */
    .btn { min-height: 44px; }
    .btn-sm { min-height: 38px; }
    .btn-icon { min-width: 44px; }
    input, select, textarea { font-size: 16px; min-height: 44px; }
    input[type=checkbox], input[type=radio] { min-height: 0; }
    .nav a { height: 46px; }
    .nav a kbd { display: none; }
    .menu-panel a, .menu-panel button { min-height: 44px; }
    .seg a { padding: 9px 14px; }
    .subtabs a, .dash-tabs > a, .tab-add { padding-top: 12px; padding-bottom: 12px; }
    .x { min-width: 40px; min-height: 40px; }
    .tick::before { content: ""; position: absolute; inset: -12px; }
    .kgrip { width: 32px; height: 40px; left: 0; top: 8px; font-size: 17px; }
    .kcard { padding-left: 34px; }
    .wg-bar .grip { width: 40px; height: 38px; }
    .wg-bar select, .wg-bar .rm { min-height: 38px; }
    .tlist li, .files li { min-height: 48px; }
}

/* installed as an app: no browser bar, so give the top a little room and hide what the app does not need */
@media (display-mode: standalone) {
    body { overscroll-behavior-y: contain; }
}
.topbar-mark { display: none; }
@media (max-width: 880px) { .topbar-mark { display: inline-flex; align-items: center; flex: none; } .topbar-mark img { width: 32px; height: 32px; display: block; } }

/* ---------- Phone, second pass: quiet header, card lists, one round quick-add button ---------- */
.topbar-title { display: none; }
.fab { display: none; }

@media (max-width: 880px) {
    /* header: logo mark, the page name, bell, you. Everything else lives in the bottom bar or the + button */
    .desk-only { display: none !important; }
    .topbar { gap: 10px; padding-left: 16px; padding-right: 10px; background: var(--surface); border-bottom: 0; box-shadow: 0 1px 0 var(--border); }
    .topbar-title { display: block; flex: 1; min-width: 0; font: 600 17px/1.2 var(--font-head); color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; letter-spacing: -.01em; }
    .topbar .spacer { display: none; }
    .timer-pill { height: 34px; padding: 0 3px 0 10px; gap: 8px; }
    .timer-proj { display: none; }
    .timer-pill .btn { min-height: 30px; padding: 0 10px; }
    .bell-menu > summary, .topbar details:last-child > summary { padding-left: 4px; padding-right: 4px; }

    /* pages: air, a calmer heading, no fine print under it */
    .content { padding-top: 18px; }
    .page-head { margin-bottom: 16px; gap: 10px; }
    .page-head h1 { font-size: 24px; letter-spacing: -.02em; }
    .page-head .sub { display: none; }
    .page-head .actions { width: 100%; }
    .page-head .actions .btn { flex: 1; }
    .crumbs { display: none; }

    /* filters: search on its own line, the choices side by side */
    .toolbar { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
    .toolbar .grow { grid-column: 1 / -1; }
    .toolbar select { width: 100%; min-width: 0; }
    .toolbar > button.btn { grid-column: 1 / -1; }

    /* lists as soft cards, one idea per card */
    .card.flush:has(> .table-wrap > table.cards), .card.flush:has(> .table-wrap table.cards) { background: transparent; border: 0; box-shadow: none; overflow: visible; }
    .table-wrap { overflow: visible; }
    table.cards, table.cards tbody { display: block; width: 100%; }
    table.cards thead { display: none; }
    table.cards tbody { display: flex; flex-direction: column; gap: 10px; }
    table.cards tr { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; padding: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); }
    table.cards td { display: block; height: auto; padding: 0; border: 0; text-align: left; min-width: 0; overflow-wrap: anywhere; }
    table.cards td:first-child { grid-column: 1 / -1; font-size: 15.5px; }
    table.cards td[data-label]::before { content: attr(data-label); display: block; margin-bottom: 2px; font-size: 10.5px; font-weight: 600; color: var(--faint); }
    table.cards td:first-child::before { display: none; }
    table.cards td:not([data-label]) { grid-column: 1 / -1; }
    table.cards td.num { text-align: left; }
    table.cards td:empty { display: none; }

    /* the round quick-add button above the bottom bar */
    .fab { display: block; position: fixed; right: 16px; bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 34; }
    .fab > summary { list-style: none; width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; background: var(--brand); color: var(--brand-ink); box-shadow: 0 10px 24px -8px rgba(21, 100, 254, .55); cursor: pointer; transition: transform .15s; }
    .fab > summary::-webkit-details-marker { display: none; }
    .fab > summary .i { width: 24px; height: 24px; stroke-width: 2.2; transition: transform .15s; }
    .fab[open] > summary .i { transform: rotate(45deg); }
    .fab-sheet { position: absolute; right: 0; bottom: 66px; width: min(320px, calc(100vw - 32px)); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: 0 18px 40px -12px rgba(16, 24, 40, .35); padding: 8px; display: flex; flex-direction: column; gap: 2px; }
    .fab-sheet a { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 12px; border-radius: var(--r); color: var(--text); font-weight: 600; }
    .fab-sheet a:hover { background: var(--surface-2); text-decoration: none; }
    .fab-timer { display: flex; flex-direction: column; gap: 8px; padding: 10px 10px 12px; margin-bottom: 4px; border-bottom: 1px solid var(--border); }
    body.nav-open .fab { display: none; }
}

/* ---------- Image preview ---------- */
.lb { position: fixed; inset: 0; z-index: 90; display: flex; flex-direction: column; background: rgba(8, 12, 20, .94); color: #fff; }
.lb[hidden] { display: none; }
body.lb-open { overflow: hidden; }
.lb-top { display: flex; align-items: center; gap: 12px; padding: calc(12px + env(safe-area-inset-top)) 16px 12px; }
.lb-name { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb .btn { background: rgba(255, 255, 255, .12); border-color: transparent; color: #fff; }
.lb .btn:hover { background: rgba(255, 255, 255, .2); }
.lb-x { width: 44px; height: 44px; border: 0; border-radius: var(--r); background: rgba(255, 255, 255, .12); color: #fff; font-size: 26px; line-height: 1; cursor: pointer; }
.lb-x:hover, .lb-nav:hover { background: rgba(255, 255, 255, .22); }
.lb-x:focus-visible, .lb-nav:focus-visible, .lb .btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.lb-stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; gap: 12px; padding: 0 12px; }
.lb-img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: var(--r-xs); background: rgba(255, 255, 255, .04); }
.lb-nav { flex: none; width: 48px; height: 48px; border: 0; border-radius: var(--r); background: rgba(255, 255, 255, .12); color: #fff; font-size: 32px; line-height: 1; cursor: pointer; padding-bottom: 4px; }
.lb.single .lb-nav { visibility: hidden; }
.lb-count { text-align: center; padding: 10px 0 calc(14px + env(safe-area-inset-bottom)); font-size: 13px; color: rgba(255, 255, 255, .7); min-height: 40px; }
@media (max-width: 700px) {
    .lb-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; background: rgba(0, 0, 0, .45); }
    .lb-prev { left: 8px; } .lb-next { right: 8px; }
    .lb-stage { padding: 0; }
}
@media (max-width: 880px) {
    table.cards td[data-empty] { display: none; }
    .page-head h1.dup-title { display: none; }
    .page-head:has(h1.dup-title) { margin-bottom: 4px; }
    .toolbar > button.btn { display: none; }                                  /* the choices apply as soon as they change; Enter searches */
    .page-head .actions a.btn-primary[href$="/create"] { display: none; }     /* the round + button already offers these */
}

/* project tabs: summary rows, wide meters, checkbox line */
.barrow { display: flex; align-items: center; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--border); }
.barrow:last-child { border-bottom: 0; }
.barrow > :first-child { flex: 0 1 38%; min-width: 0; overflow-wrap: anywhere; }
.barrow .meter.wide { flex: 1; width: auto; margin-top: 0; }
.barrow b { font-variant-numeric: tabular-nums; min-width: 2.2em; text-align: right; }
.check { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--muted); }
.check input { width: auto; }

/* global labels */
.lbl { --c: #3b82f6; display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: var(--r); font-size: 12px; font-weight: 600; white-space: nowrap; background: color-mix(in srgb, var(--c) 16%, transparent); color: color-mix(in srgb, var(--c) 72%, var(--text)); }
.lbl.c-green { --c: #16a34a; } .lbl.c-amber { --c: #d97706; } .lbl.c-red { --c: #dc2626; } .lbl.c-purple { --c: #8b5cf6; }
.lbl.c-teal { --c: #0d9488; } .lbl.c-pink { --c: #db2777; } .lbl.c-grey { --c: #6b7280; }
.lbls { display: inline-flex; flex-wrap: wrap; gap: 5px; vertical-align: middle; }
.lblpick { position: relative; display: inline-block; }
.lblpick > summary { list-style: none; cursor: pointer; }
.lblpick > summary::-webkit-details-marker { display: none; }
.lblpick form { position: absolute; z-index: 30; right: 0; top: calc(100% + 6px); width: 240px; max-width: 86vw; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg, 0 12px 32px rgba(0,0,0,.25)); padding: 12px; }
.lblpick label.perm { display: flex; align-items: center; gap: 8px; padding: 4px 0; }
.lblpick .btn { margin-top: 8px; width: 100%; }
.colorpick { display: flex; flex-wrap: wrap; gap: 8px; }
.colorpick label { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.colorpick input { width: auto; }

/* books: edge-to-edge report tables, Indian number columns, voucher entry */
.report { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.report th { text-align: left; font: 600 12px var(--font); letter-spacing: .02em; color: var(--muted); padding: 9px 12px; border-bottom: 2px solid var(--border-strong); white-space: nowrap; background: var(--surface); position: sticky; top: 0; }
.report td { padding: 7px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.report .n { text-align: right; white-space: nowrap; }
.report th.n { text-align: right; }
.report tr.g td { font-weight: 700; background: var(--surface-2); }
.report tr.l td:first-child { color: var(--text); }
.report tr.tot td { font-weight: 700; border-top: 2px solid var(--border-strong); border-bottom: 2px solid var(--border-strong); background: var(--surface-2); }
.report a { color: inherit; }
.report a:hover { color: var(--brand); }
.card.edge { padding: 0; overflow: hidden; }
.periodbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin-bottom: 14px; }
.periodbar > div { min-width: 0; }
.periodbar label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 3px; }
.vrows { display: grid; gap: 8px; }
.vrow { display: grid; grid-template-columns: minmax(0, 1fr) 150px 150px 34px; gap: 8px; align-items: center; }
.vrow.simple { grid-template-columns: minmax(0, 1fr) 170px 34px; }
.vtotal { display: flex; justify-content: flex-end; gap: 24px; font-weight: 700; padding: 10px 0; font-variant-numeric: tabular-nums; }
.vtotal .bad { color: var(--bad); }
.typepick { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.typepick a { padding: 7px 14px; border-radius: var(--r); border: 1px solid var(--border-strong); font-weight: 600; font-size: 13px; color: var(--muted); }
.typepick a.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.typepick a:hover { text-decoration: none; }
@media (max-width: 880px) {
    .vrow, .vrow.simple { grid-template-columns: 1fr 1fr 34px; }
    .vrow > :first-child { grid-column: 1 / -1; }
    .report th, .report td { padding: 7px 8px; }
}

/* invoices */
.irow { display: grid; grid-template-columns: minmax(0, 2.4fr) 100px 80px 70px 120px 84px 34px; gap: 8px; align-items: start; margin-bottom: 8px; }
.irow .grow2 { grid-column: 1; }
.irow .ititle { margin-bottom: 6px; font-weight: 600; }
.ihead { font-size: 12px; color: var(--muted); font-weight: 600; margin-bottom: 4px; }
/* service documents: title, description and amount only; goods documents: quantity, unit and rate */
[data-mode="service"] .m-prod, [data-mode="product"] .m-serv { display: none !important; }
[data-mode="service"] .irow { grid-template-columns: minmax(0, 2.4fr) 176px 130px 84px 34px; }
/* proposals */
.pdoc { --pacc: #1564fe; max-width: 800px; margin: 0 auto; line-height: 1.65; }
.pcover { border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; margin-bottom: 24px; background: linear-gradient(180deg, color-mix(in srgb, var(--pacc) 7%, transparent), transparent 70%); }
.plogo img { height: 46px; width: auto; display: block; }
.pkicker { letter-spacing: .22em; font-size: 12px; font-weight: 700; color: var(--pacc); margin-top: 30px; }
.pcover h1 { font-size: 32px; line-height: 1.2; margin: 6px 0 12px; }
.prule { height: 4px; width: 84px; background: var(--pacc); border-radius: 2px; margin-bottom: 18px; }
.pmeta { display: grid; grid-template-columns: 150px 1fr; gap: 4px 14px; margin: 0; }
.pmeta dt { color: var(--muted); } .pmeta dd { margin: 0; font-weight: 600; }
.pcover-foot { margin-top: 32px; padding-top: 12px; border-top: 1px solid var(--border); color: var(--muted); font-size: 12px; line-height: 1.6; }
.pcover-band { padding: 18px 22px; margin-bottom: 18px; } .pcover-band h1 { font-size: 24px; margin: 10px 0 6px; }
.pband-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; } .pband-top .pkicker { margin-top: 0; } .pcover-band .plogo img { height: 34px; }
.pband-meta { margin: 0; color: var(--muted); font-size: 13px; } .pband-meta b { color: var(--text); font-weight: 600; }
.pcover-none { margin-bottom: 14px; } .pcover-none h1 { font-size: 24px; margin: 0 0 6px; }
.pbody h2 { display: flex; gap: 12px; align-items: baseline; font-size: 18px; color: var(--pacc); margin: 30px 0 10px; padding-bottom: 6px; border-bottom: 2px solid color-mix(in srgb, var(--pacc) 25%, transparent); break-after: avoid; }
.pnum { font-weight: 700; opacity: .55; }
.ptiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin: 12px 0; }
.ptile { border: 1px solid var(--border); border-top: 3px solid var(--pacc); border-radius: var(--r); padding: 12px 14px; break-inside: avoid; }
.ptile b { display: block; font-size: 26px; line-height: 1.1; color: var(--pacc); } .ptile span { color: var(--muted); font-size: 12px; }
.psheet-head { margin-bottom: 18px; } .psheet-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 18px; }
.psheet-top .plogo img { height: 44px; } .psheet-addr { text-align: center; color: var(--muted); font-size: 12px; margin: 8px 0 14px; padding-bottom: 10px; border-bottom: 2px solid var(--pacc); }
.psheet-head h1 { text-align: center; font-size: 20px; letter-spacing: .06em; margin: 8px 0 12px; }
.psheet-meta { border-collapse: collapse; margin: 0 auto; font-size: 13px; } .psheet-meta th { text-align: left; color: var(--muted); font-weight: 500; padding: 2px 18px 2px 0; } .psheet-meta td { padding: 2px 0; font-weight: 600; }
.pdoc-L-sheet .pbody h2 { background: none; color: #1a2233; padding: 6px 0; border-bottom: 1px solid #8a93a6; border-radius: 0; font-size: 15px; } .pdoc-L-sheet .pnum { opacity: .8; }
.psheet-end { text-align: center; color: var(--muted); margin-top: 28px; font-size: 12px; }
.pdoc-L-social .pbody h2 { border-bottom: 3px solid var(--pacc); font-size: 20px; }
.pbody p { margin: 8px 0; } .pbody ul { margin: 8px 0 8px 22px; padding: 0; } .pbody li { margin: 3px 0; }
.ptable { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 13px; }
.ptable th, .ptable td { text-align: left; padding: 8px 10px; border: 1px solid var(--border); vertical-align: top; }
.ptable th { background: transparent; color: #1a2233; border-color: #8a93a6; border-width: 1px 1px 2px; }
.ptable tbody tr:nth-child(even) td { background: transparent; }
.ptable td:first-child { font-weight: 600; } .ptable .n { text-align: right; } .ptable .grand td { background: #f3f3f3; font-weight: 700; }
.ptable tr { break-inside: avoid; }
@media print {
    .pdoc-print .pcover-full { min-height: 255mm; display: flex; flex-direction: column; justify-content: space-between; border: 0; background: none; padding: 0; break-after: page; }
    .pdoc-print .pcover-full h1 { font-size: 40px; } .pdoc-print .pcover-full .plogo img { height: 60px; }
    .pdoc-print .pcover-band { border: 0; border-bottom: 3px solid var(--pacc); border-radius: 0; background: none; padding: 0 0 10px; margin-bottom: 14px; }
    .pdoc-print * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
@media (max-width: 760px) { .itemrow { grid-template-columns: 1fr 1fr !important; } }
/* special days calendar */
.calgrid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.calh { font-size: 12px; font-weight: 600; color: var(--muted); text-align: center; padding: 6px 0; }
.calc { min-height: 84px; border: 1px solid var(--border); border-radius: var(--r); padding: 6px; display: flex; flex-direction: column; gap: 3px; background: var(--surface); overflow: hidden; }
.calc.off { background: transparent; border-color: transparent; }
.calc.today { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.calc.has { background: var(--brand-soft); }
.caln { font-size: 12px; font-weight: 600; color: var(--muted); }
.calt { font-size: 11px; line-height: 1.25; padding: 2px 5px; border-radius: var(--r-xs); background: var(--surface); color: var(--text); border: 1px solid var(--border); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.calt.k-festival { border-color: #f0b04a; } .calt.k-national { border-color: #4caf7d; } .calt.k-commercial { border-color: #e0679a; } .calt.k-global, .calt.k-observance { border-color: #6c8cff; } .calt.k-industry { border-color: #9b7be0; }
.calmore { font-size: 11px; color: var(--muted); }
@media (max-width: 640px) { .calc { min-height: 56px; padding: 4px; } .calt { font-size: 10px; } }
/* pull finished project work into an invoice */
.pullbox { margin: 0 0 16px; padding: 10px 12px; background: var(--surface-2); border-radius: var(--radius); }
.pullfilters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 10px 0; }
.pullfilters label { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; }
.pullrow { display: flex; gap: 8px; align-items: baseline; padding: 4px 0; border-bottom: 1px solid var(--border); }
.pullrow .t { flex: 1; }
/* suggestions while typing */
.sug-list { position: absolute; left: 0; right: 0; z-index: 30; margin-top: 2px; background: var(--surface); border: 1px solid var(--border, #d9e0ec); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(15, 30, 60, .14); max-height: 260px; overflow-y: auto; }
.sug-item { display: flex; justify-content: space-between; gap: 12px; padding: 7px 10px; cursor: pointer; font-size: 13px; }
.sug-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sug-item small { color: var(--muted); flex: none; }
.sug-item:hover, .sug-item.on { background: var(--brand-soft); }
.sacbox { margin-top: 4px; line-height: 1.5; }
.sacbox button { display: block; width: 100%; text-align: left; border: 0; background: var(--brand-soft); color: var(--brand); border-radius: var(--r-xs); padding: 2px 6px; margin-top: 3px; font-size: 11.5px; cursor: pointer; }
.sacbox button:hover { filter: brightness(.96); }
.modepick { display: inline-flex; flex-wrap: wrap; background: var(--surface-2); border-radius: var(--radius); padding: 3px; gap: 2px; }
.modepick label { display: flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: var(--r-xs); font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; margin: 0; }
.modepick label:has(input:checked) { background: var(--surface); color: var(--brand); box-shadow: var(--shadow); }
.modepick input { width: auto; margin: 0; }
/* a light watermark behind a document on screen: Draft, Cancelled, or the text chosen in Invoice settings */
.wmark { position: relative; overflow: hidden; }
.wmark::after { content: attr(data-watermark); position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: clamp(44px, 9vw, 110px); font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--text); opacity: .045; transform: rotate(-24deg); pointer-events: none; user-select: none; white-space: nowrap; }
.itotals { margin-left: auto; width: min(100%, 360px); font-variant-numeric: tabular-nums; }
.itotals div { display: flex; justify-content: space-between; padding: 4px 0; }
.itotals .grand { font-weight: 700; font-size: 1.1em; border-top: 2px solid var(--border-strong); margin-top: 6px; padding-top: 8px; }
.badge.draft { background: var(--surface-2); }
.pdfframe { width: 100%; height: 78vh; border: 1px solid var(--border); border-radius: var(--radius-lg); background: #fff; }
@media (max-width: 880px) {
    .irow, [data-mode="service"] .irow { grid-template-columns: 1fr 1fr 1fr; }
    .irow .grow2 { grid-column: 1 / -1; }
    .ihead { display: none; }
}

/* "New" menu on the invoices page */
.lblpick .menu-pop { position: absolute; z-index: 30; right: 0; top: calc(100% + 6px); width: 260px; max-width: 86vw; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-lg); box-shadow: 0 12px 32px rgba(0,0,0,.25); padding: 6px; }
.lblpick .menu-pop a { display: block; padding: 8px 10px; border-radius: var(--r-xs); color: var(--text); font-weight: 600; }
.lblpick .menu-pop a:hover { background: var(--surface-2); text-decoration: none; }

/* receivables */
.report td.late { color: var(--bad); font-weight: 600; }

/* two-sided statements (profit & loss, balance sheet) */
.report.sides td.divl, .report.sides th.divl { border-left: 2px solid var(--border-strong); }
.report.sides td.g { font-weight: 700; }
.report.sides td.bal { font-weight: 700; background: var(--surface-2); }
.report.sides td.nt { font-style: italic; color: var(--muted); }
.report.sides td.l { padding-top: 5px; padding-bottom: 5px; }

/* supplier bills */
.brow { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1.4fr) 92px 120px 84px 130px 34px; gap: 8px; align-items: start; margin-bottom: 8px; }
.bhead { font-size: 12px; color: var(--muted); font-weight: 600; margin-bottom: 4px; }
@media (max-width: 880px) { .brow { grid-template-columns: 1fr 1fr 1fr; } .brow > :nth-child(1), .brow > :nth-child(2) { grid-column: 1 / -1; } .bhead { display: none; } }

/* the second row of a grouped tab bar: smaller, sits close under the headings */
.subtabs.sub { margin-top: -8px; }
.subtabs.sub a { font-size: 13px; padding-top: 7px; padding-bottom: 9px; color: var(--muted); }
.subtabs.sub a.on { color: var(--brand); }

.pimgs { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin: 12px 0; }
.pimgs figure { margin: 0; break-inside: avoid; } .pimgs img { width: 100%; height: auto; border: 1px solid var(--border); border-radius: var(--r-xs); display: block; } .pimgs figcaption { font-size: 11.5px; color: var(--muted); margin-top: 4px; }

/* =====================================================================================================================================
   Looks. Two of them, chosen by the super admin in Settings > Appearance, each with a light and a dark mode on top.
   Daylight: airy white cards, soft shadows, big rounded corners, pill navigation.
   Frost:    frosted glass over a pale sky (or a deep night), the look of the focus screen.
   ===================================================================================================================================== */

/* ---------- shared by both: grouped menu, pill controls, roomier cards ---------- */
:root {
    --radius: var(--r); --radius-lg: var(--r);
    --shadow: 0 1px 2px rgba(18, 30, 60, .04), 0 10px 28px -16px rgba(18, 30, 60, .18);
    --glass: #ffffff; --glass-line: var(--border);
}
.nav { padding: 12px 12px 18px; }
.nav-list > a, .nav-group > summary { display: flex; align-items: center; gap: 11px; height: 40px; padding: 0 12px; border-radius: var(--r); color: var(--muted); font-weight: 600; cursor: pointer; }
.nav-list > a:hover, .nav-group > summary:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav-list > a.active { background: var(--brand-soft); color: var(--brand); }
.nav a .i, .nav summary .i { width: 19px; height: 19px; }
.nav-group { margin: 6px 0 2px; }
.nav-group > summary { list-style: none; }
.nav-group > summary::-webkit-details-marker { display: none; }
.nav-group > summary span { flex: 1; }
.nav-group > summary .i:last-child { width: 14px; height: 14px; opacity: .55; transition: transform .15s; }
.nav-group[open] > summary .i:last-child { transform: rotate(180deg); }
.nav-group[open] > summary { color: var(--text); }
.nav-items { margin: 2px 0 4px 20px; padding-left: 12px; border-left: 2px solid var(--border); display: flex; flex-direction: column; gap: 1px; }
.nav-items a { height: 34px; border-radius: var(--r); font-weight: 500; gap: 9px; }
.nav-items a .i { width: 17px; height: 17px; opacity: .85; }
.nav-items a.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.nav-list > a.nav-single { margin-top: 12px; }
.nav a span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav a kbd { margin-left: auto; }

.card, .stat { border-radius: var(--radius-lg); }
.btn { border-radius: var(--r); height: 38px; }
.btn-sm { height: 32px; border-radius: var(--r); }
.btn-primary { box-shadow: 0 6px 16px -8px var(--brand); }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=time], input[type=search], select, textarea { border-radius: var(--r); height: 38px; }
textarea { height: auto; }
.badge { height: 24px; }
.flash { border-radius: var(--r); }
.seg { border-radius: var(--r); }
.dash-tabs { border-bottom: 0; gap: 8px; margin: 0 0 18px; }
.dash-tabs > a { border: 0; margin: 0; border-radius: var(--r); padding: 8px 16px; background: var(--surface); box-shadow: var(--shadow); color: var(--muted); }
.dash-tabs > a.on { background: var(--text); color: var(--bg); }
.page-head h1 { font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
th { background: transparent; font-size: 11px; color: var(--faint); }
.stat .v { font-size: 30px; font-weight: 700; letter-spacing: -.02em; }
.stat { padding: 18px 20px; box-shadow: var(--shadow); }
.menu-panel { border-radius: var(--r); }
.avatar { background: linear-gradient(135deg, var(--brand), var(--sky)); color: #fff; }
.topbar-title { font-weight: 700; }

/* ---------- Daylight ---------- */
:is([data-skin="daylight"], [data-skin="horizon"]) {
    --bg: #eef1f7; --surface: #ffffff; --surface-2: #f3f5fa; --hover: #f7f9fc; --border: #e6eaf2; --border-strong: #d3dae6;
}
:root[data-theme="dark"]:is([data-skin="daylight"], [data-skin="horizon"]) {
    --bg: #0c1018; --surface: #141a25; --surface-2: #1b2331; --hover: #19212e; --border: #232c3b; --border-strong: #324055;
    --shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 12px 28px -18px rgba(0, 0, 0, .7);
}
:is([data-skin="daylight"], [data-skin="horizon"]) .sidebar { background: var(--surface); border-right: 0; box-shadow: 1px 0 0 var(--border); }
:is([data-skin="daylight"], [data-skin="horizon"]) .topbar { background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(12px); border-bottom: 0; }
:is([data-skin="daylight"], [data-skin="horizon"]) .card, :is([data-skin="daylight"], [data-skin="horizon"]) .stat { border-color: transparent; }
:is([data-skin="daylight"], [data-skin="horizon"]) .stat { position: relative; overflow: hidden; }
:is([data-skin="daylight"], [data-skin="horizon"]) .stat::after { content: ""; position: absolute; right: -26px; top: -26px; width: 84px; height: 84px; border-radius: 50%; background: var(--brand-soft); opacity: .7; }
:is([data-skin="daylight"], [data-skin="horizon"]) .stat.t2::after { background: #efe8ff; } :is([data-skin="daylight"], [data-skin="horizon"]) .stat.t3::after { background: #dcf5ee; }
:is([data-skin="daylight"], [data-skin="horizon"]) .stat.t4::after { background: #fff0d6; } :is([data-skin="daylight"], [data-skin="horizon"]) .stat.t5::after { background: #ffe6df; }
:root[data-theme="dark"]:is([data-skin="daylight"], [data-skin="horizon"]) .stat::after { background: var(--brand); opacity: .1; } :root[data-theme="dark"]:is([data-skin="daylight"], [data-skin="horizon"]) .stat.t2::after, :root[data-theme="dark"]:is([data-skin="daylight"], [data-skin="horizon"]) .stat.t3::after, :root[data-theme="dark"]:is([data-skin="daylight"], [data-skin="horizon"]) .stat.t4::after, :root[data-theme="dark"]:is([data-skin="daylight"], [data-skin="horizon"]) .stat.t5::after { background: var(--brand); }
:is([data-skin="daylight"], [data-skin="horizon"]) .stat > * { position: relative; z-index: 1; }

/* ---------- Frost ---------- */
[data-skin="frost"] {
    --bg: #dbe6f1; --surface: rgba(255, 255, 255, .62); --surface-2: rgba(255, 255, 255, .55); --hover: rgba(255, 255, 255, .7);
    --border: rgba(255, 255, 255, .75); --border-strong: rgba(120, 140, 170, .35);
    --glass: rgba(255, 255, 255, .55); --glass-line: rgba(255, 255, 255, .8);
    --shadow: 0 1px 0 rgba(255, 255, 255, .9) inset, 0 14px 34px -20px rgba(40, 70, 110, .35);
    --text: #16202e; --muted: #50607a; --faint: #7b8aa3;
    --brand: #2b6df6; --brand-soft: rgba(43, 109, 246, .12);
}
:root[data-theme="dark"][data-skin="frost"] {
    --bg: #0a1220; --surface: rgba(255, 255, 255, .055); --surface-2: rgba(255, 255, 255, .07); --hover: rgba(255, 255, 255, .09);
    --border: rgba(255, 255, 255, .1); --border-strong: rgba(255, 255, 255, .2);
    --glass: rgba(255, 255, 255, .06); --glass-line: rgba(255, 255, 255, .12);
    --shadow: 0 1px 0 rgba(255, 255, 255, .06) inset, 0 18px 40px -22px rgba(0, 0, 0, .8);
    --text: #e8eef9; --muted: #a2b0c9; --faint: #74839f;
    --brand: #6ea0ff; --brand-soft: rgba(110, 160, 255, .16); --brand-ink: #07101f;
}
[data-skin="frost"] body {
    background-color: var(--bg);
    background-image: radial-gradient(900px 520px at 8% -8%, rgba(120, 180, 255, .55), transparent 62%), radial-gradient(800px 520px at 100% 0%, rgba(150, 230, 215, .5), transparent 60%), radial-gradient(900px 600px at 55% 115%, rgba(190, 200, 255, .55), transparent 62%);
    background-attachment: fixed;
}
:root[data-theme="dark"][data-skin="frost"] body {
    background-image: radial-gradient(900px 520px at 8% -8%, rgba(58, 110, 220, .38), transparent 62%), radial-gradient(800px 520px at 100% 0%, rgba(40, 170, 150, .26), transparent 60%), radial-gradient(900px 600px at 55% 115%, rgba(100, 80, 210, .3), transparent 62%);
}
[data-skin="frost"] .sidebar, [data-skin="frost"] .topbar, [data-skin="frost"] .card, [data-skin="frost"] .stat, [data-skin="frost"] .menu-panel, [data-skin="frost"] .wg > .card {
    -webkit-backdrop-filter: blur(18px) saturate(1.25); backdrop-filter: blur(18px) saturate(1.25);
}
[data-skin="frost"] .sidebar { background: var(--glass); border-right: 1px solid var(--glass-line); }
[data-skin="frost"] .topbar { background: var(--glass); border-bottom: 1px solid var(--glass-line); }
[data-skin="frost"] .card, [data-skin="frost"] .stat { background: var(--glass); border-color: var(--glass-line); }
[data-skin="frost"] .menu-panel { background: rgba(255, 255, 255, .86); }
:root[data-theme="dark"][data-skin="frost"] .menu-panel { background: rgba(18, 28, 46, .92); }
[data-skin="frost"] input[type=text], [data-skin="frost"] input[type=email], [data-skin="frost"] input[type=password], [data-skin="frost"] input[type=date], [data-skin="frost"] input[type=time], [data-skin="frost"] input[type=search], [data-skin="frost"] select, [data-skin="frost"] textarea { background: rgba(255, 255, 255, .6); }
:root[data-theme="dark"][data-skin="frost"] input[type=text], :root[data-theme="dark"][data-skin="frost"] input[type=email], :root[data-theme="dark"][data-skin="frost"] input[type=password], :root[data-theme="dark"][data-skin="frost"] input[type=date], :root[data-theme="dark"][data-skin="frost"] input[type=time], :root[data-theme="dark"][data-skin="frost"] input[type=search], :root[data-theme="dark"][data-skin="frost"] select, :root[data-theme="dark"][data-skin="frost"] textarea { background: rgba(255, 255, 255, .06); }
[data-skin="frost"] .btn { background: rgba(255, 255, 255, .55); }
[data-skin="frost"] .btn-primary { background: var(--brand); }
[data-skin="frost"] .btn-ghost { background: transparent; }
[data-skin="frost"] th { background: transparent; }
[data-skin="frost"] .table-wrap, [data-skin="frost"] .card.edge { background: var(--glass); }
[data-skin="frost"] .dash-tabs > a.on { background: var(--brand); color: #fff; }
[data-skin="frost"] .nav-items { border-left-color: var(--glass-line); }
[data-skin="frost"] .search input[type=search] { background: rgba(255, 255, 255, .5); }
@media (prefers-reduced-transparency: reduce) { [data-skin="frost"] .sidebar, [data-skin="frost"] .topbar, [data-skin="frost"] .card, [data-skin="frost"] .stat, [data-skin="frost"] .menu-panel { -webkit-backdrop-filter: none; backdrop-filter: none; } }

/* ---------- sign-in follows the look ---------- */
:is([data-skin="daylight"], [data-skin="horizon"]) .auth-brand { background: linear-gradient(150deg, #1564fe, #3b8bff 60%, #6cc4ff); }
[data-skin="frost"] .auth-brand { background: linear-gradient(150deg, #2b6df6, #5aa0ff 55%, #7be0d0); }

/* ---------- Appearance page: samples of the two looks ---------- */
.sample { display: grid; grid-template-columns: 72px 1fr; height: 180px; overflow: hidden; border-bottom: 1px solid var(--border); }
.sample .sb { padding: 12px 10px; display: flex; flex-direction: column; gap: 8px; }
.sample .sb i { display: block; height: 14px; border-radius: var(--r-xs); }
.sample .mn { padding: 14px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.sample .tl { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.sample .tl b { display: block; padding: 9px 10px; border-radius: var(--r); font-weight: 600; }
.sample .tl b span { display: block; font: 500 8.5px/1 var(--font); margin-bottom: 7px; opacity: .7; }
.sample .tl b em { font: 700 17px/1 var(--font-head); font-style: normal; }
.sample .ch { flex: 1; display: flex; align-items: flex-end; gap: 5px; border-radius: var(--r); padding: 8px 10px 0; }
.sample .ch i { flex: 1; border-radius: 4px 4px 0 0; }
.sample.daylight { background: #eef1f7; color: #16202e; }
.sample.daylight .sb { background: #fff; } .sample.daylight .sb i { background: #e9eef6; } .sample.daylight .sb i.on { background: #e6eeff; }
.sample.daylight .tl b, .sample.daylight .ch { background: #fff; box-shadow: 0 8px 18px -12px rgba(18, 30, 60, .25); }
.sample.daylight .ch i { background: #1564fe; }
.sample.frost { background: radial-gradient(120px 80px at 0 0, #9cc7ff, transparent), radial-gradient(140px 90px at 100% 0, #aef0e1, transparent), #dbe6f1; color: #16202e; }
.sample.frost .sb { background: rgba(255, 255, 255, .55); } .sample.frost .sb i { background: rgba(255, 255, 255, .8); } .sample.frost .sb i.on { background: rgba(43, 109, 246, .25); }
.sample.frost .tl b, .sample.frost .ch { background: rgba(255, 255, 255, .55); border: 1px solid rgba(255, 255, 255, .85); }
.sample.frost .ch i { background: linear-gradient(#5aa0ff, #2b6df6); }

/* ---------- the customize page ---------- */
.cust-top { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; margin-bottom: 16px; }
.cust-top .card { margin: 0; }
.cust-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 6px; }
.cust-list a { padding: 7px 14px; border-radius: var(--r); background: var(--surface-2); color: var(--muted); font-weight: 600; }
.cust-list a.on { background: var(--text); color: var(--bg); text-decoration: none; }

/* ---------- the focus screen: big clock, the day at a glance ---------- */
body.focus { min-height: 100vh; margin: 0; display: flex; flex-direction: column; align-items: center; padding: 28px clamp(16px, 4vw, 56px) 40px; color: var(--text); }
.focus-top { width: 100%; max-width: 1180px; display: flex; align-items: center; gap: 12px; }
.focus-top .hello { padding: 9px 16px; border-radius: var(--r); background: var(--glass); border: 1px solid var(--glass-line); backdrop-filter: blur(14px); font-weight: 600; }
.focus-top .spacer { flex: 1; }
.focus-top .pill { display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 14px; border-radius: var(--r); background: var(--glass); border: 1px solid var(--glass-line); backdrop-filter: blur(14px); color: var(--text); font-weight: 600; }
.focus-top .pill:hover { text-decoration: none; background: var(--hover); }
.focus-clock { text-align: center; margin: clamp(18px, 5vh, 56px) 0 8px; }
.focus-clock .time { font: 300 clamp(72px, 14vw, 168px)/1 var(--font-head); letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.focus-clock .time small { font-size: .28em; font-weight: 500; letter-spacing: 0; margin-left: .15em; color: var(--muted); }
.focus-clock .date { font-size: clamp(15px, 2vw, 20px); color: var(--muted); margin-top: 6px; }
.focus-search { width: min(620px, 100%); margin: 22px 0 28px; position: relative; }
.focus-search input { height: 54px; border-radius: var(--r); padding: 0 22px 0 52px; font-size: 16px; background: var(--glass); border: 1px solid var(--glass-line); backdrop-filter: blur(14px); }
.focus-search .i { position: absolute; left: 20px; top: 17px; color: var(--faint); width: 20px; height: 20px; z-index: 2; pointer-events: none; }
.focus-grid { width: 100%; max-width: 1180px; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; }
.fcard { grid-column: span 4; background: var(--glass); border: 1px solid var(--glass-line); border-radius: var(--r); padding: 18px 20px; backdrop-filter: blur(18px) saturate(1.2); box-shadow: var(--shadow); min-width: 0; }
.fcard.w6 { grid-column: span 6; } .fcard.w3 { grid-column: span 3; } .fcard.w12 { grid-column: span 12; }
.fcard h2 { font-size: 13px; color: var(--muted); margin: 0 0 12px; display: flex; justify-content: space-between; align-items: baseline; }
.fcard h2 a { font-size: 12px; text-transform: none; letter-spacing: 0; font-weight: 600; }
.fcard .big { font: 700 38px/1.1 var(--font-head); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.fcard .big small { font-size: 14px; color: var(--muted); font-weight: 500; margin-left: 4px; }
.fcard ul { list-style: none; margin: 0; padding: 0; }
.fcard li { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--glass-line); }
.fcard li:first-child { border-top: 0; }
.fcard li .n { min-width: 30px; height: 26px; border-radius: var(--r); display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); font-weight: 700; font-size: 12.5px; }
.fcard li a { color: var(--text); font-weight: 500; }
.fcard li .when { margin-left: auto; color: var(--faint); font-size: 12.5px; white-space: nowrap; }
.fcard .empty-line { color: var(--muted); margin: 0; }
.focus-hint { margin-top: 26px; color: var(--muted); font-size: 13px; }
.quick { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; }
.quick a { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 6px; border-radius: var(--r); background: var(--surface-2); color: var(--text); font-size: 12.5px; font-weight: 600; text-align: center; }
.quick a:hover { text-decoration: none; background: var(--hover); }
.quick a .i { width: 22px; height: 22px; color: var(--brand); }
@media (max-width: 880px) { .fcard, .fcard.w6, .fcard.w3 { grid-column: span 12; } .focus-clock .time { font-size: 22vw; } }
:root[data-theme="dark"][data-skin="frost"] .btn { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .16); }
:root[data-theme="dark"][data-skin="frost"] .btn:hover { background: rgba(255, 255, 255, .14); }
:root[data-theme="dark"][data-skin="frost"] .btn-primary { background: var(--brand); border-color: var(--brand); }
:root[data-theme="dark"][data-skin="frost"] .btn-ghost { background: transparent; border-color: transparent; }
[data-skin="frost"] .tabbar { background: rgba(255, 255, 255, .86); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); border-top-color: var(--glass-line); }
:root[data-theme="dark"][data-skin="frost"] .tabbar { background: rgba(12, 20, 36, .92); }
[data-skin="frost"] .fab > summary { box-shadow: 0 10px 24px -10px rgba(30, 80, 200, .6); }

/* ---------- dashboard panels, second pass: icon tiles, a priority list, rounder charts ---------- */
.stat { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "l ico" "v v" "n n"; align-items: start; gap: 2px 10px; }
.stat .l { grid-area: l; } .stat .v { grid-area: v; } .stat .n { grid-area: n; }
.stat .ico { grid-area: ico; width: 38px; height: 38px; border-radius: var(--r); display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); position: relative; z-index: 2; }
.stat .ico .i { width: 19px; height: 19px; }
.stat.t2 .ico { background: #efe8ff; color: #5b3bd1; } .stat.t3 .ico { background: #dcf5ee; color: #0b8a7b; }
.stat.t4 .ico { background: #fff0d6; color: #a85f00; } .stat.t5 .ico { background: #ffe6df; color: #cc4326; }
:root[data-theme="dark"] .stat.t2 .ico { background: rgba(169, 148, 255, .18); color: #b8a7ff; } :root[data-theme="dark"] .stat.t3 .ico { background: rgba(60, 199, 181, .16); color: #4fd6c4; }
:root[data-theme="dark"] .stat.t4 .ico { background: rgba(240, 176, 74, .16); color: #f0b04a; } :root[data-theme="dark"] .stat.t5 .ico { background: rgba(255, 143, 114, .16); color: #ff9c82; }
[data-skin] .stat::after { display: none; }                      /* the icon chip replaces the corner glow */
.stat .v { margin-top: 10px; }

.prio { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 18px 20px 12px; margin-bottom: 16px; }
:is([data-skin="daylight"], [data-skin="horizon"]) .prio { border-color: transparent; }
[data-skin="frost"] .prio { background: var(--glass); border-color: var(--glass-line); -webkit-backdrop-filter: blur(18px) saturate(1.25); backdrop-filter: blur(18px) saturate(1.25); }
.prio-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 2px 12px; margin-bottom: 8px; }
.prio-head h2 { margin: 0; }
.prio ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 0 28px; }
.prio li a { display: flex; align-items: center; gap: 12px; padding: 11px 4px; border-top: 1px solid var(--border); color: var(--text); border-radius: var(--r); }
.prio li a:hover { text-decoration: none; background: var(--hover); }
.prio .cnt { min-width: 34px; height: 28px; padding: 0 9px; border-radius: var(--r); display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums; }
.prio .ptxt { flex: 1; font-weight: 500; }
.prio li a .i { color: var(--faint); transform: rotate(-90deg); }

/* Settings, Home slideshow */
.gs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px 18px; align-items: end; }
.gs-grid.two { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); align-items: start; }
.gs-grid .field { margin-bottom: 0; }
.start-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.start-chip { height: 32px; padding: 0 14px; border-radius: var(--r); border: 1px solid var(--border-strong); background: var(--surface); color: var(--muted); font: 600 13px var(--font); cursor: pointer; }
.start-chip:hover { color: var(--text); }
@media (max-width: 880px) { .start-chips { flex-wrap: nowrap; overflow-x: auto; margin-right: -16px; padding-right: 16px; scrollbar-width: none; } .start-chip { flex: none; } }
.start-chip.on, .start-chip.on:hover { background: var(--text); border-color: var(--text); color: var(--bg); }
.starts { margin-bottom: 16px; }
.start-lane[hidden] { display: none; }
/* Accounts: the gateway and the key strip */
.gateway { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; margin-bottom: 14px; }
.gateway .card h2 { margin: 0 0 10px; }
.gw-list { list-style: none; margin: 0; padding: 0; }
.gw-list a { display: flex; align-items: center; gap: 12px; padding: 9px 4px; border-top: 1px solid var(--border); color: var(--text); border-radius: var(--r); }
.gw-list a:hover { text-decoration: none; background: var(--hover); }
.gw-list kbd, .gw-notes kbd, .keystrip kbd { display: inline-block; min-width: 26px; padding: 1px 6px; text-align: center; font: 600 12px var(--font); border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: var(--r-xs); background: var(--surface-2); color: var(--text); }
.gw-notes { margin: 0; padding-left: 18px; line-height: 1.9; }
.keystrip { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: -2px 0 14px; font-size: 12.5px; color: var(--muted); }
.keystrip a { color: var(--muted); white-space: nowrap; }
.keystrip a:hover { color: var(--brand); text-decoration: none; }
@media (max-width: 880px), (pointer: coarse) { .keystrip { display: none; } }
/* planning timeline */
.tl { padding: 14px 16px; overflow-x: auto; }
.tl-head { position: relative; height: 22px; margin-left: 190px; min-width: 520px; font-size: 12px; color: var(--muted); }
.tl-head span { position: absolute; top: 0; white-space: nowrap; }
.tl-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--border); min-width: 710px; }
.tl-name { flex: 0 0 180px; font-weight: 600; color: var(--text); line-height: 1.25; overflow-wrap: anywhere; }
.tl-name small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; }
.tl-lane { position: relative; flex: 1; height: 22px; min-width: 520px; }
.tl-bar { position: absolute; top: 4px; height: 14px; border-radius: var(--r); background: var(--brand); opacity: .85; }
.tl-bar.hold { background: var(--faint); }
.tl-mark { position: absolute; top: 2px; width: 10px; height: 10px; margin-left: -5px; transform: rotate(45deg); background: var(--surface); border: 2px solid var(--text); }
.tl-mark.done { background: var(--text); }
.tl-today { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; background: var(--bad); }
.jump-box { display: block; width: 100%; margin-bottom: 6px; }
/* Start here: a few plain tiles for what this person looks at first */
.starts { display: grid; gap: 14px; margin-bottom: 16px; }
.start-lane h2 { font-size: 13px; color: var(--muted); margin: 0 0 8px; }
.start-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.start-tile { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); color: var(--text); min-width: 0; }
.start-tile:hover { text-decoration: none; background: var(--hover); }
.start-tile .st-l { font-size: 12.5px; color: var(--muted); }
.start-tile .st-v { font-size: 24px; line-height: 1.15; letter-spacing: -.02em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.start-tile .st-h { font-size: 12.5px; color: var(--muted); }
.start-tile.tone-bad .st-v { color: var(--bad); }
.start-tile.tone-warn .st-v { color: var(--warn, #a85f00); }
[data-skin="frost"] .start-tile { background: var(--glass); border-color: var(--glass-line); -webkit-backdrop-filter: blur(18px) saturate(1.25); backdrop-filter: blur(18px) saturate(1.25); }
@media (max-width: 560px) { .start-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } .start-tile .st-v { font-size: 21px; } }

.bars .bt i { border-radius: var(--r) var(--r) 0 0; }
.bars .bt { border-bottom-color: var(--border); }
.donut circle { stroke-linecap: round; }
.feed li { border-radius: var(--r); }
.card-head h2 { font-size: 16px; }
.big { letter-spacing: -.02em; }

/* =====================================================================================================================================
   Pass 3: every field looks the same, one slim footer, pop-up messages, nothing jumps, phones never zoom
   ===================================================================================================================================== */
:root[data-theme="dark"] { color-scheme: dark; }
input:not([type]), input[type=number], input[type=tel], input[type=url], input[type=month], input[type=week], input[type=datetime-local] {
    width: 100%; height: 38px; padding: 0 12px; border-radius: var(--r); border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font: inherit;
}
input:not([type]):focus, input[type=number]:focus, input[type=tel]:focus, input[type=url]:focus, input[type=month]:focus, input[type=datetime-local]:focus { outline: none; border-color: var(--brand); box-shadow: var(--ring); }
input[type=date], input[type=time] { padding-right: 8px; }
input[type=date]::-webkit-calendar-picker-indicator, input[type=time]::-webkit-calendar-picker-indicator { opacity: .6; cursor: pointer; border-radius: var(--r-xs); }
[data-skin="frost"] input:not([type]), [data-skin="frost"] input[type=number], [data-skin="frost"] input[type=tel], [data-skin="frost"] input[type=url], [data-skin="frost"] input[type=month], [data-skin="frost"] input[type=datetime-local] { background: rgba(255, 255, 255, .6); }
:root[data-theme="dark"][data-skin="frost"] input:not([type]), :root[data-theme="dark"][data-skin="frost"] input[type=number], :root[data-theme="dark"][data-skin="frost"] input[type=tel], :root[data-theme="dark"][data-skin="frost"] input[type=url], :root[data-theme="dark"][data-skin="frost"] input[type=month], :root[data-theme="dark"][data-skin="frost"] input[type=datetime-local] { background: rgba(255, 255, 255, .06); }
td input:not([type]), td input[type=number], td input[type=text], td select { min-width: 0; }
select { appearance: none; -webkit-appearance: none; padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%238b94a5' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
select[multiple] { background-image: none; padding-right: 11px; height: auto; }

/* file choosers: a soft drop area and a button in the look's own colour */
input[type=file] { width: 100%; height: auto; padding: 9px; border-radius: var(--r); border: 1.5px dashed var(--border-strong); background: var(--surface-2); color: var(--muted); font: inherit; font-size: 13px; cursor: pointer; }
input[type=file]:hover { border-color: var(--brand); }
input[type=file]::file-selector-button { margin-right: 12px; border: 0; border-radius: var(--r); padding: 8px 14px; background: var(--brand); color: var(--brand-ink); font: 600 13px var(--font); cursor: pointer; }
input[type=file]::file-selector-button:hover { background: var(--brand-hover); }
[data-skin="frost"] input[type=file] { background: rgba(255, 255, 255, .45); }
:root[data-theme="dark"][data-skin="frost"] input[type=file] { background: rgba(255, 255, 255, .05); }
input[type=checkbox], input[type=radio] { accent-color: var(--brand); }
textarea { border-radius: var(--r); padding: 10px 12px; min-height: 76px; resize: vertical; }

/* one slim footer at the bottom of the window, never in the middle of a page */
.main { min-height: 100vh; }
.main > .content { flex: 1 0 auto; }

/* messages pop up top right, under the bell */
.toasts { position: fixed; top: calc(var(--topbar-h) + 10px); right: 16px; z-index: 90; display: flex; flex-direction: column; gap: 8px; width: min(380px, calc(100vw - 32px)); pointer-events: none; }
.toast { pointer-events: auto; position: relative; margin: 0 !important; padding: 12px 36px 12px 14px; border-radius: var(--r); background: var(--surface); color: var(--text); border: 1px solid var(--border); box-shadow: 0 16px 36px -14px rgba(18, 30, 60, .35); font-weight: 500; animation: toast-in .22s ease; }
.toast.bad { border-color: var(--bad); }
.toast.bad::before { content: ""; }
[data-skin="frost"] .toast { background: rgba(255, 255, 255, .9); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
:root[data-theme="dark"][data-skin="frost"] .toast { background: rgba(18, 28, 46, .94); }
.toast.out { opacity: 0; transform: translateY(-6px); transition: all .25s; }
.toast-x { position: absolute; top: 6px; right: 8px; width: 26px; height: 26px; border: 0; border-radius: var(--r); background: transparent; color: var(--faint); font-size: 18px; line-height: 1; cursor: pointer; }
.toast-x:hover { background: var(--surface-2); color: var(--text); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } }
.np-session { padding: 8px 12px 6px; border-bottom: 1px solid var(--border); }
.np-msg { font-size: 12.5px; padding: 4px 0; color: var(--text); } .np-msg.bad { color: var(--bad); }
@media (max-width: 880px) { .toasts { right: 12px; left: 12px; width: auto; top: calc(var(--topbar-h) + env(safe-area-inset-top, 0px) + 8px); } }

/* phones: fields never trigger the browser's zoom, taps do not double-tap zoom */
html { touch-action: manipulation; -webkit-text-size-adjust: 100%; }
@media (max-width: 880px) { input, select, textarea { font-size: 16px !important; } }

.seg { align-items: center; }
.seg-custom > summary { list-style: none; cursor: pointer; padding: 5px 11px; border-radius: var(--r); font-size: 12.5px; font-weight: 600; color: var(--muted); }
.seg-custom > summary::-webkit-details-marker { display: none; }
.seg-custom > summary.on { background: var(--surface); color: var(--brand); box-shadow: var(--shadow); }
.seg-custom .menu-panel { right: 0; }

/* ---------- glimpses: a slideshow that changes by itself. A soft tinted panel with a floating art tile, not a striped box ---------- */
.glimpses { --g1: #dfe9ff; --g2: #f3f6ff; position: relative; margin-bottom: 16px; border-radius: var(--radius-lg); overflow: hidden; isolation: isolate; box-shadow: var(--shadow); background: var(--surface); }
.gl-track { position: relative; display: grid; }
.gl-slide { --gc: var(--brand); --ga: #dfe9ff; --gb: #f2f6ff; grid-area: 1 / 1; display: grid; grid-template-columns: minmax(0, 1fr) 150px; align-items: center; gap: 12px; padding: 22px 26px 60px; min-height: 160px; background: linear-gradient(115deg, var(--ga), var(--gb) 70%); opacity: 0; visibility: hidden; transform: scale(1.015); transition: opacity .55s ease, transform .7s ease, visibility 0s .55s; }
.gl-slide.on { opacity: 1; visibility: visible; transform: none; transition: opacity .55s ease, transform .7s ease; }
.tone-green { --gc: #0f9d73; --ga: #d4f3e8; --gb: #effaf5; } .tone-red { --gc: #dc3f35; --ga: #ffe0dc; --gb: #fff4f2; } .tone-purple { --gc: #6d4be6; --ga: #e6defd; --gb: #f6f2ff; }
.tone-amber { --gc: #c9820a; --ga: #ffecc6; --gb: #fff7e6; } .tone-teal { --gc: #0b8f8a; --ga: #d0f1ef; --gb: #eefaf9; } .tone-blue { --gc: #1564fe; --ga: #dae6ff; --gb: #f1f6ff; }
:root[data-theme="dark"] .gl-slide { --ga: color-mix(in srgb, var(--gc) 22%, #101826); --gb: #121a29; }
[data-skin="frost"] .gl-slide { background: linear-gradient(115deg, color-mix(in srgb, var(--ga) 62%, transparent), color-mix(in srgb, var(--gb) 40%, transparent) 75%); }
[data-skin="frost"] .glimpses { background: var(--glass); border: 1px solid var(--glass-line); -webkit-backdrop-filter: blur(18px) saturate(1.25); backdrop-filter: blur(18px) saturate(1.25); }
.gl-copy { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; min-width: 0; position: relative; z-index: 1; }
.gl-kicker { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 11px; border-radius: var(--r); background: color-mix(in srgb, var(--gc) 14%, transparent); color: var(--gc); font-size: 11.5px; font-weight: 700; }
.gl-title { font: 700 clamp(18px, 2.2vw, 26px)/1.28 var(--font-head); letter-spacing: -.02em; max-width: 760px; color: var(--text); }
.gl-text { color: var(--muted); font-size: 14px; max-width: 640px; }
.gl-go { display: inline-flex; align-items: center; gap: 4px; margin-top: 10px; height: 34px; padding: 0 14px; border-radius: var(--r); background: var(--gc); color: #fff; font-size: 13px; font-weight: 700; box-shadow: 0 8px 18px -10px var(--gc); }
.gl-go:hover { text-decoration: none; filter: brightness(1.08); }
.gl-go .i { width: 14px; height: 14px; transform: rotate(-90deg); }
.gl-art { position: relative; height: 112px; justify-self: end; width: 150px; }
.gl-art i { position: absolute; border-radius: 50%; background: var(--gc); opacity: .14; animation: gl-float 9s ease-in-out infinite; }
.gl-art .b1 { width: 92px; height: 92px; right: 38px; top: 8px; }
.gl-art .b2 { width: 44px; height: 44px; right: 0; bottom: 6px; opacity: .22; animation-delay: -3s; }
.gl-art .b3 { width: 22px; height: 22px; left: 8px; bottom: 18px; opacity: .3; animation-delay: -6s; }
.gl-ico { position: absolute; right: 30px; top: 22px; width: 68px; height: 68px; border-radius: var(--r); display: grid; place-items: center; color: #fff; background: linear-gradient(145deg, var(--gc), color-mix(in srgb, var(--gc) 62%, #fff)); box-shadow: 0 18px 30px -16px var(--gc); transform: rotate(-6deg); }
.gl-ico .i { width: 32px; height: 32px; stroke-width: 1.6; }
.gl-slide.on .gl-ico { animation: gl-pop .7s cubic-bezier(.2, 1.2, .3, 1) both; }
@keyframes gl-pop { from { transform: scale(.6) rotate(-18deg); opacity: 0; } }
@keyframes gl-float { 50% { transform: translateY(-8px); } }
.gl-nav { position: absolute; left: 26px; bottom: 16px; display: flex; align-items: center; gap: 8px; z-index: 2; }
.gl-nav > button { width: 24px; height: 24px; border: 0; border-radius: var(--r); background: rgba(255, 255, 255, .7); color: #46526a; cursor: pointer; display: grid; place-items: center; padding: 0; }
:root[data-theme="dark"] .gl-nav > button { background: rgba(255, 255, 255, .12); color: #cfd8e8; }
.gl-nav > button:hover { background: #fff; color: var(--brand); }
.gl-nav .i { width: 13px; height: 13px; }
.gl-prev .i { transform: rotate(90deg); } .gl-next .i { transform: rotate(-90deg); }
.gl-dots { display: flex; gap: 5px; }
.gl-dots button { width: 7px; height: 7px; border-radius: 50%; border: 0; padding: 0; background: rgba(70, 82, 106, .25); cursor: pointer; transition: width .25s; }
.gl-dots button.on { background: var(--brand); width: 20px; border-radius: 4px; }
.gl-timer { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; transform-origin: left; background: color-mix(in srgb, var(--brand) 55%, transparent); animation: gl-time var(--gl-s, 7s) linear infinite; z-index: 2; }
.glimpses:hover .gl-timer, .glimpses:focus-within .gl-timer { animation-play-state: paused; }
@keyframes gl-time { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.glimpses.lg { margin: 0; border-radius: var(--r); }
.glimpses.lg .gl-slide { min-height: 200px; grid-template-columns: minmax(0, 1fr) 210px; padding: 30px 36px 66px; }
.glimpses.lg .gl-title { font-size: clamp(22px, 3vw, 34px); }
.glimpses.lg .gl-art { height: 150px; width: 210px; } .glimpses.lg .gl-ico { width: 92px; height: 92px; border-radius: var(--r); right: 46px; top: 28px; } .glimpses.lg .gl-ico .i { width: 44px; height: 44px; }
.glimpses.lg .gl-art .b1 { width: 128px; height: 128px; right: 56px; } .glimpses.lg .gl-nav { left: 36px; bottom: 20px; }
@media (max-width: 640px) {
    .gl-slide { grid-template-columns: 1fr; padding: 18px 18px 62px; min-height: 0; gap: 4px; }
    .gl-art { position: absolute; right: 8px; top: 6px; width: 84px; height: 70px; opacity: .9; } .gl-art .b1 { width: 52px; height: 52px; right: 20px; top: 4px; } .gl-art .b2, .gl-art .b3 { display: none; }
    .gl-ico { width: 40px; height: 40px; border-radius: var(--r); right: 14px; top: 10px; } .gl-ico .i { width: 20px; height: 20px; }
    .gl-copy { padding-right: 56px; } .gl-title { font-size: 17px; }
    .gl-nav { left: 18px; bottom: 14px; }
    .glimpses.lg .gl-slide { grid-template-columns: 1fr; padding: 18px 18px 62px; min-height: 0; } .glimpses.lg .gl-art { width: 84px; height: 70px; } .glimpses.lg .gl-ico { width: 40px; height: 40px; right: 14px; top: 10px; } .glimpses.lg .gl-ico .i { width: 20px; height: 20px; } .glimpses.lg .gl-title { font-size: 18px; } .glimpses.lg .gl-nav { left: 18px; }
}
@media (prefers-reduced-motion: reduce) { .gl-slide, .gl-art i, .gl-ico, .gl-timer { animation: none !important; transition: none; } .gl-timer { display: none; } }
.focus-logo { display: inline-flex; align-items: center; margin-right: 6px; }
.focus-logo img { height: 28px; width: auto; display: block; }
.focus-glimpses { width: 100%; max-width: 1180px; margin: 0 0 16px; }

/* ---------- Split: Daylight's colours with a two-column menu (an icon rail for the areas, a second column for what is in each) ---------- */
/* ---------- Daylight ---------- */
[data-skin="split"] {
    --bg: #eef1f7; --surface: #ffffff; --surface-2: #f3f5fa; --hover: #f7f9fc; --border: #e6eaf2; --border-strong: #d3dae6;
}
:root[data-theme="dark"][data-skin="split"] {
    --bg: #0c1018; --surface: #141a25; --surface-2: #1b2331; --hover: #19212e; --border: #232c3b; --border-strong: #324055;
    --shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 12px 28px -18px rgba(0, 0, 0, .7);
}
[data-skin="split"] .sidebar { background: var(--surface); border-right: 0; box-shadow: 1px 0 0 var(--border); }
[data-skin="split"] .topbar { background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(12px); border-bottom: 0; }
[data-skin="split"] .card, [data-skin="split"] .stat { border-color: transparent; }
[data-skin="split"] .stat { position: relative; overflow: hidden; }
[data-skin="split"] .stat::after { content: ""; position: absolute; right: -26px; top: -26px; width: 84px; height: 84px; border-radius: 50%; background: var(--brand-soft); opacity: .7; }
[data-skin="split"] .stat.t2::after { background: #efe8ff; } [data-skin="split"] .stat.t3::after { background: #dcf5ee; }
[data-skin="split"] .stat.t4::after { background: #fff0d6; } [data-skin="split"] .stat.t5::after { background: #ffe6df; }
:root[data-theme="dark"][data-skin="split"] .stat::after { background: var(--brand); opacity: .1; } :root[data-theme="dark"][data-skin="split"] .stat.t2::after, :root[data-theme="dark"][data-skin="split"] .stat.t3::after, :root[data-theme="dark"][data-skin="split"] .stat.t4::after, :root[data-theme="dark"][data-skin="split"] .stat.t5::after { background: var(--brand); }
[data-skin="split"] .stat > * { position: relative; z-index: 1; }

[data-skin="split"] .auth-brand { background: linear-gradient(150deg, #1564fe, #3b8bff 60%, #6cc4ff); }
[data-skin="split"] .prio { border-color: transparent; }
[data-skin="split"] .glimpses { border-color: transparent; }

.split-nav { display: none; }
[data-skin="split"] { --rail-w: 72px; --sub-w: 236px; --sidebar-w: 308px; --bg: #f3f5fa; }
:root[data-theme="dark"][data-skin="split"] { --bg: #0c1018; }
@media (min-width: 881px) {
    [data-skin="split"] .sidebar { background: transparent; box-shadow: none; border: 0; }
    [data-skin="split"] .sidebar > .sidebar-brand, [data-skin="split"] .sidebar > .sidebar-foot, [data-skin="split"] .nav-list { display: none; }
    [data-skin="split"] .sidebar > .nav { padding: 0; overflow: visible; flex: 1; }
    [data-skin="split"] .split-nav { display: grid; grid-template-columns: var(--rail-w) minmax(0, 1fr); height: 100vh; }
    .rail { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 0; background: var(--bg); }
    .rail-logo { width: 44px; height: 44px; border-radius: var(--r); display: grid; place-items: center; background: var(--surface); box-shadow: var(--shadow); margin-bottom: 12px; }
    .rail-logo img { width: 26px; height: 26px; }
    .rail-btn { position: relative; width: 44px; height: 44px; border: 0; border-radius: var(--r); background: transparent; color: var(--muted); display: grid; place-items: center; cursor: pointer; padding: 0; }
    .rail-btn:hover { background: var(--surface); color: var(--text); text-decoration: none; }
    .rail-btn.on { background: var(--surface); color: var(--brand); box-shadow: var(--shadow); }
    .rail-btn.on::before { content: ""; position: absolute; left: -14px; top: 12px; bottom: 12px; width: 3px; border-radius: 0 3px 3px 0; background: var(--brand); }
    .rail-btn .i { width: 21px; height: 21px; }
    .rail-gap { flex: 1; }
    .subnav { display: flex; flex-direction: column; background: var(--surface); border-radius: var(--r) 0 0 var(--r); margin: 8px 0 8px 0; padding: 18px 12px 10px; box-shadow: var(--shadow); overflow-y: auto; }
    .sub { display: none; flex-direction: column; gap: 2px; flex: 1; }
    .sub.on { display: flex; }
    .sub h3 { font: 700 18px/1.2 var(--font-head); padding: 2px 10px 0; }
    .sub-about { font-size: 12.5px; color: var(--muted); padding: 2px 10px 14px; margin: 0; }
    .sub a { display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 12px; border-radius: var(--r); color: var(--muted); font-weight: 600; }
    .sub a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
    .sub a.active { background: var(--brand-soft); color: var(--brand); }
    .sub a .i { width: 18px; height: 18px; }
    .sub-user { display: flex; align-items: center; gap: 10px; padding: 12px 8px 4px; margin-top: 10px; border-top: 1px solid var(--border); }
    .sub-user .who { display: flex; flex-direction: column; line-height: 1.25; flex: 1; min-width: 0; }
    .sub-user .who small { color: var(--faint); font-size: 11.5px; }
    .rail-mini { width: 32px; height: 32px; border-radius: var(--r); display: grid; place-items: center; color: var(--muted); }
    .rail-mini:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
    [data-skin="split"] .topbar-mark { display: none; }
}
.sample.split { grid-template-columns: 26px 52px 1fr; background: #f3f5fa; color: #16202e; }
.sample.split .rl { display: flex; flex-direction: column; gap: 6px; padding: 10px 5px; align-items: center; }
.sample.split .rl i { width: 14px; height: 14px; border-radius: var(--r-xs); background: #dfe5ef; } .sample.split .rl i.on { background: #1564fe; }
.sample.split .sl { background: #fff; border-radius: var(--r) 0 0 var(--r); margin: 6px 0; padding: 10px 6px; display: flex; flex-direction: column; gap: 6px; }
.sample.split .sl i { height: 9px; border-radius: 4px; background: #e9eef6; } .sample.split .sl i.on { background: #e6eeff; }
.sample.split .mn { padding: 10px; }
.sample.split .tl b, .sample.split .ch { background: #fff; box-shadow: 0 8px 18px -12px rgba(18, 30, 60, .25); }
.sample.split .ch i { background: #1564fe; }
@media (max-width: 640px) {
    body.focus { padding: calc(14px + env(safe-area-inset-top, 0px)) 14px calc(28px + env(safe-area-inset-bottom, 0px)); }
    .focus-top { flex-wrap: wrap; gap: 8px; }
    .focus-top .focus-logo { order: 1; } .focus-top .spacer { order: 2; } .focus-top .pill { order: 3; width: 40px; height: 40px; padding: 0; justify-content: center; }
    .focus-top .pill span { display: none; }
    .focus-top .hello { order: 4; flex: 1 1 100%; text-align: center; background: transparent; border: 0; padding: 4px 0 0; color: var(--muted); font-weight: 600; backdrop-filter: none; }
    .focus-clock { margin: 10px 0 4px; }
    .focus-clock .time { font-size: clamp(64px, 21vw, 92px); }
    .focus-clock .date { font-size: 15px; }
    .focus-search { margin: 14px 0 18px; }
    .focus-search input { height: 48px; font-size: 16px; }
    .focus-search .i { top: 14px; }
    .focus-glimpses { margin-bottom: 12px; }
    .focus-grid { gap: 12px; }
    .fcard { border-radius: var(--r); padding: 16px; }
    .fcard .big { font-size: 32px; }
    .fcard li { flex-wrap: wrap; } .fcard li .when { margin-left: 0; flex-basis: 100%; padding-left: 40px; }
    .quick { grid-template-columns: repeat(4, 1fr); gap: 8px; } .quick a { padding: 12px 4px; font-size: 11.5px; border-radius: var(--r); }
    .focus-hint { margin-top: 18px; text-align: center; }
}
@media (max-width: 380px) { .quick { grid-template-columns: repeat(3, 1fr); } }
.ptl .gl-go, .ptl .gl-go:hover { color: #fff; text-decoration: none; }
.ptl .gl-nav > button { color: #46526a; }
:root[data-theme="dark"]:not([data-skin="frost"]) { --glass: var(--surface); --glass-line: var(--border); }
.gl-copy, .gl-title, .gl-text { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 640px) { .gl-slide, .glimpses.lg .gl-slide { grid-template-columns: minmax(0, 1fr); } }
.gl-track { grid-template-columns: minmax(0, 1fr); }

/* printing a report straight from the browser: no tints, no coloured text, plain rules */
@media print {
    .report th { position: static; background: none; color: #111; border-bottom: 1.5px solid #555; }
    .report tr.g td, .report tr.tot td { background: none; }
    .report tr.tot td { border-top: 1.5px solid #555; border-bottom: 1.5px solid #555; }
    .report a { color: #111; text-decoration: none; }
    .card, .card.edge { box-shadow: none; border-color: #bbb; background: none; }
    .periodbar, .toolbar, .module-tabs, .sidebar, .topbar, .footbar, .toasts, .tabbar { display: none !important; }
}

/* check in and out: attendance is taken from here, so it is the one coloured button in the header (and on the phone bar) */
.att-pill { display: inline-flex; align-items: center; gap: 8px; margin: 0; }
.att-pill .att-btn { font-weight: 700; }
.att-pill.is-in { height: 36px; padding: 0 4px 0 12px; border: 1px solid var(--ok); border-radius: var(--radius); background: var(--ok-soft, rgba(30, 160, 100, .1)); }
.att-pill.is-in .att-txt { font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; }
.att-pill.is-in .att-btn { background: var(--ok); border-color: var(--ok); color: #fff; }
.att-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px rgba(30, 160, 100, .22); }
.att-pill.is-done { height: 36px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: var(--radius); color: var(--muted); font-size: 13px; }
.att-pill.is-done:hover { text-decoration: none; }
.tab-att { display: flex; margin: 0; }
.tab-att button { flex: 1; width: 100%; background: var(--brand) !important; color: #fff !important; border-radius: var(--r) !important; min-height: 46px !important; margin: 3px 4px; font-weight: 700; }
.tab-att button .i { stroke: #fff; }
@media (max-width: 880px) {
    .att-pill .att-btn { min-height: 34px; padding: 0 12px; }
    .att-pill.is-in { height: 34px; padding-left: 10px; }
    .att-pill.is-in .att-txt { font-size: 12px; }
    .att-pill.is-done { height: 34px; padding: 0 10px; font-size: 12px; }
    .att-pill.is-done .att-txt { max-width: 120px; overflow: hidden; text-overflow: ellipsis; }
}

/* ---------- calendars, one look everywhere: month grid, date boxes, and a phone list ---------- */
.calgrid { gap: 6px; }
.calh { font-size: 11.5px; color: var(--faint); }
.calh.we { color: var(--muted); }
.calc { min-height: 96px; border-radius: var(--r); padding: 8px; gap: 4px; border-color: var(--border); transition: border-color .15s, box-shadow .15s; }
.calc.we { background: var(--surface-2); }
.calc.has { background: var(--surface); border-color: var(--border-strong); }
.calc.today { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-soft); }
.caln { display: flex; align-items: baseline; gap: 6px; color: var(--text); }
.caln b { font-size: 14px; font-weight: 700; }
.calc.today .caln b { display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 5px; border-radius: var(--r); background: var(--brand); color: #fff; }
.cald { display: none; font-style: normal; font-size: 12px; color: var(--muted); }
.calt { border-radius: var(--r); padding: 3px 7px; border-width: 0 0 0 0; background: var(--surface-2); position: relative; padding-left: 14px; }
.calt::before { content: ""; position: absolute; left: 5px; top: 50%; width: 5px; height: 5px; margin-top: -2.5px; border-radius: 50%; background: var(--faint); }
.calt.k-festival::before { background: #f0b04a; } .calt.k-national::before { background: #4caf7d; } .calt.k-commercial::before { background: #e0679a; }
.calt.k-global::before, .calt.k-observance::before { background: #6c8cff; } .calt.k-industry::before { background: #9b7be0; }
.calkey { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 12px; font-size: 12px; color: var(--muted); }
.calkey i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; background: var(--faint); }
.calkey i.k-festival { background: #f0b04a; } .calkey i.k-national { background: #4caf7d; } .calkey i.k-commercial { background: #e0679a; }
.calkey i.k-observance { background: #6c8cff; } .calkey i.k-industry { background: #9b7be0; }
@media (max-width: 640px) {
    .calgrid { display: flex; flex-direction: column; gap: 8px; }
    .calh, .calc.off { display: none; }
    .calc:not(.has):not(.today) { display: none; }
    .calc { min-height: 0; flex-direction: column; padding: 10px 12px; }
    .calt { font-size: 13px; white-space: normal; padding-top: 5px; padding-bottom: 5px; }
    .cald { display: inline; }
    .calc.today .caln b { min-width: 26px; height: 26px; }
}

/* date and time boxes: the same height everywhere, a calendar icon, and a thumb-sized target on phones */
input[type=date], input[type=month], input[type=time], input[type=datetime-local] { min-height: 38px; color-scheme: light; }
:root[data-theme="dark"] input[type=date], :root[data-theme="dark"] input[type=month], :root[data-theme="dark"] input[type=time], :root[data-theme="dark"] input[type=datetime-local] { color-scheme: dark; }
input[type=date]::-webkit-calendar-picker-indicator, input[type=month]::-webkit-calendar-picker-indicator, input[type=datetime-local]::-webkit-calendar-picker-indicator { opacity: .7; padding: 4px; margin-left: 2px; }
@media (max-width: 880px) {
    input[type=date], input[type=month], input[type=time], input[type=datetime-local] { min-height: 44px; font-size: 16px; width: 100%; -webkit-appearance: none; appearance: none; background-color: var(--surface); }
    table.flow, table.flow tbody { display: block; width: 100%; }
    table.flow tr { display: flex; flex-wrap: wrap; gap: 3px 14px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
    table.flow tr { align-items: baseline; }
    table.flow td { display: block; height: auto !important; padding: 0 !important; border: 0 !important; min-width: 0; line-height: 1.35; overflow-wrap: anywhere; }
    table.flow td:first-child { flex: 1 0 100%; font-weight: 600; }
    table.flow td:empty { display: none; }
    table.flow td[colspan] { flex: 1 0 100%; }
    .toolbar > *, .periodbar > * { min-width: 0; }
    .toolbar input, .toolbar select, .periodbar input, .periodbar select { min-width: 0; max-width: 100%; }
    .periodbar { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
    .periodbar > div:first-child, .periodbar > .seg, .periodbar > button, .periodbar > .spacer { grid-column: 1 / -1; }
    .periodbar > .spacer { display: none; }
    .toolbar:has(input[type=date], input[type=month]) > button.btn { display: inline-flex; }   /* date choices need the button on phones too */
}
.start-one { font-size: 13px; color: var(--muted); margin: 0 0 8px; }

/* Home pictures: billed against received, month by month */
.duo { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; align-items: end; height: 170px; padding-top: 8px; }
.duo-m { display: flex; flex-direction: column; justify-content: flex-end; height: 100%; gap: 6px; min-width: 0; }
.duo-bars { flex: 1; display: flex; align-items: flex-end; justify-content: center; gap: 4px; border-bottom: 1px solid var(--border); }
.duo-bars i { display: block; width: 38%; max-width: 26px; border-radius: var(--r-xs) var(--r-xs) 0 0; }
.duo-bars i.b, .duo-key i.b { background: var(--ch1, var(--brand)); }
.duo-bars i.r, .duo-key i.r { background: var(--ch3, #3cc7b5); }
.duo .bl { text-align: center; font-size: 12px; color: var(--muted); }
.duo-key { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 12px 0 0; font-size: 12.5px; color: var(--muted); }
.duo-key i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; }
.big.sm { font-size: 22px; }

/* profile photos */
.avatar { overflow: hidden; flex: none; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 50%; }
.avatar.xl { width: 96px; height: 96px; font-size: 28px; }
.avatar.sm { width: 28px; height: 28px; font-size: 11px; }
.dot.on { background: var(--ok); box-shadow: 0 0 0 3px rgba(30, 160, 100, .22); }

/* a person's own choice of how roomy the pages are */
[data-density="compact"] .content { padding-top: 14px; padding-bottom: 36px; }
[data-density="compact"] .page-head { margin-bottom: 12px; }
[data-density="compact"] .card, [data-density="compact"] .ptl-card { padding: 12px 14px; margin-bottom: 10px; }
[data-density="compact"] .card.edge, [data-density="compact"] .card.flush { padding: 0; }
[data-density="compact"] .report td, [data-density="compact"] .report th, [data-density="compact"] td, [data-density="compact"] th { padding-top: 5px; padding-bottom: 5px; }
[data-density="compact"] .start-tile { padding: 9px 12px; }
[data-density="compact"] .start-tile .st-v { font-size: 20px; }
[data-density="compact"] .glimpses .gl-slide { min-height: 120px; padding-top: 14px; }
[data-density="compact"] .nav a, [data-density="compact"] .nav summary { padding-top: 6px; padding-bottom: 6px; }
[data-density="compact"] .prio li a { padding-top: 7px; padding-bottom: 7px; }
[data-density="compact"] .field { margin-bottom: 10px; }
[data-density="compact"] .btn { min-height: 32px; }

/* Home: Customize sits at the end of the dashboard tabs */
.dash-tabs .dash-custom { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: var(--r); font-weight: 600; font-size: 13.5px; color: var(--muted); background: transparent; border: 1px solid var(--border-strong); white-space: nowrap; }
.dash-tabs .dash-custom:hover { text-decoration: none; color: var(--text); background: var(--surface); }
.dash-tabs > a.dash-custom { box-shadow: none; padding: 0 14px; }

/* the customize page: one bar of dashboards, rename in place, a menu for the rest */
.cust-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.cust-bar .cust-list { flex: 1 1 320px; margin: 0; }
.cust-this { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 14px; margin-bottom: 14px; }
.cust-name { flex: 1 1 320px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0; }
.cust-name input { font-size: 18px; font-weight: 700; letter-spacing: -.01em; max-width: 360px; border-color: transparent; background: transparent; padding-left: 8px; }
.cust-name input:hover { border-color: var(--border-strong); }
.cust-name input:focus { border-color: var(--brand); background: var(--surface); }
.tpl-pick { display: block; width: 100%; text-align: left; padding: 9px 10px; border-radius: var(--r); background: none; border: 0; cursor: pointer; color: var(--text); }
.tpl-pick:hover { background: var(--surface-2); }
.tpl-pick b { display: block; font-weight: 600; }
.tpl-pick em { display: block; font-style: normal; font-size: 12px; color: var(--muted); line-height: 1.4; }
.cust-new .menu-panel { right: 0; left: auto; max-height: 70vh; overflow: auto; }
@media (max-width: 880px) { .cust-hint { display: none; } .dash-tabs .dash-custom { margin-left: 0; } }

/* module tabs that do not fit: arrows slide them */
.subtabs-wrap { position: relative; margin: -8px 0 20px; }
.subtabs-wrap.sub { margin-top: -8px; margin-bottom: 20px; }
.subtabs-wrap > .subtabs { margin: 0 !important; scroll-behavior: smooth; }
.st-arrow { position: absolute; top: 0; bottom: 1px; width: 38px; display: grid; place-items: center; border: 0; padding: 0; cursor: pointer; color: var(--text); z-index: 3; }
.st-arrow[hidden] { display: none; }
.st-arrow.prev { left: 0; background: linear-gradient(to right, var(--bg) 55%, transparent); justify-items: start; }
.st-arrow.next { right: 0; background: linear-gradient(to left, var(--bg) 55%, transparent); justify-items: end; }
.st-arrow span { width: 26px; height: 26px; border-radius: var(--r); display: grid; place-items: center; background: var(--surface); box-shadow: var(--shadow); border: 1px solid var(--border); }
.st-arrow .i { width: 14px; height: 14px; }
.st-arrow.prev .i { transform: rotate(90deg); } .st-arrow.next .i { transform: rotate(-90deg); }
.st-arrow:hover span { color: var(--brand); }

/* My profile: who I am and how complete it is on the left, the forms on the right */
.pf { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
@media (min-width: 1040px) { .pf { grid-template-columns: 280px minmax(0, 1fr); } .pf-side { position: sticky; top: 76px; } }
.pf-side, .pf-main { display: grid; gap: 14px; min-width: 0; }
.pf-main .card, .pf-side .card { margin: 0; }
.pf-id { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; }
.pf-id .avatar.xl { margin-bottom: 8px; }
.pf-name { font-size: 17px; }
.pf-mail { overflow-wrap: anywhere; }
.pf-photo { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; margin-top: 10px; }
.pf-photo form { margin: 0; }
.pf-photo label.btn { cursor: pointer; }
.pf-meter { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.pf-ring { --p: 0; width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; flex: none; background: conic-gradient(var(--ok) calc(var(--p) * 1%), var(--border) 0); position: relative; }
.pf-ring::before { content: ""; position: absolute; inset: 6px; border-radius: 50%; background: var(--surface); }
.pf-ring b { position: relative; font-size: 13px; }
.pf-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; font-size: 13.5px; }
.pf-steps li { display: flex; align-items: center; gap: 9px; color: var(--text); }
.pf-steps li.ok { color: var(--muted); }
.pf-tick { width: 20px; height: 20px; border-radius: 50%; flex: none; display: grid; place-items: center; border: 1.5px solid var(--border-strong); color: #fff; }
.pf-steps li.ok .pf-tick { background: var(--ok); border-color: var(--ok); }
.pf-tick .i { width: 12px; height: 12px; stroke-width: 3; }
.pf-nav { display: grid; gap: 2px; padding: 8px; }
.pf-nav a { padding: 8px 10px; border-radius: var(--r); font-weight: 600; font-size: 13.5px; color: var(--muted); }
.pf-nav a:hover { background: var(--hover); color: var(--text); text-decoration: none; }
@media (max-width: 1039px) { .pf-nav { grid-auto-flow: column; overflow-x: auto; grid-auto-columns: max-content; } .pf-side { gap: 10px; } }
.pf-form { padding: 0; overflow: visible; scroll-margin-top: 72px; }
.pf-sec { padding: 20px 22px; border-top: 1px solid var(--border); scroll-margin-top: 72px; }
.pf-form > .pf-sec:first-of-type { border-top: 0; }
.pf-sec h2 { margin: 0 0 12px; }
.pf-sec h3 { margin: 0 0 8px; font-size: 12.5px; font-weight: 700; color: var(--muted); }
.pf-group { margin-bottom: 18px; }
.pf-group:last-child { margin-bottom: 0; }
.pf-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; align-items: start; }
.pf-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pf-grid .field { margin: 0; min-width: 0; }
.pf-grid .field label { display: block; margin-bottom: 5px; }
.pf-grid .span2 { grid-column: span 2; } .pf-grid .span3 { grid-column: 1 / -1; }
.pf-grid input, .pf-grid select { width: 100%; }
@media (max-width: 760px) { .pf-grid, .pf-grid.three { grid-template-columns: minmax(0, 1fr); } .pf-grid .span2 { grid-column: auto; } }
.hint { margin: 5px 0 0; font-size: 12.5px; line-height: 1.45; color: var(--muted); }
.pf-sec .check { margin: 6px 0; }
.pf-save { position: sticky; bottom: 0; z-index: 4; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 22px; border-top: 1px solid var(--border); background: var(--surface); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.pf-upload { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.pf-more { cursor: pointer; padding: 4px 0; }
.pf-secrow { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; }
.pf-secrow > div:first-child { flex: 1 1 320px; }

/* the reminder to finish a profile: shown with a plain warning, a few times a day while someone is working */
.nudge { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.nudge .nudge-text { flex: 1 1 320px; display: grid; gap: 2px; }
.nudge .nudge-text span { font-size: 13px; }
.nudge .nudge-text a { color: inherit; text-decoration: underline; }
.nudge[hidden] { display: none; }

/* the focus screen slides down into place when it appears, and slides back up and away when you leave it */
@keyframes focus-in { from { transform: translateY(-100%); opacity: .4; } to { transform: none; opacity: 1; } }
@keyframes focus-out { from { transform: none; opacity: 1; } to { transform: translateY(-100%); opacity: .4; } }
@keyframes rise-in { from { transform: translateY(28px); opacity: 0; } to { transform: none; opacity: 1; } }
html:has(body.focus) { overflow-x: hidden; background: var(--bg); }
body.focus { animation: focus-in .62s cubic-bezier(.22, 1, .36, 1) both; will-change: transform; }
body.focus.focus-leaving { animation: focus-out .5s cubic-bezier(.55, 0, .75, .2) both; pointer-events: none; }
html.from-focus body:not(.focus) { animation: rise-in .55s cubic-bezier(.22, 1, .36, 1) both; }
@media (prefers-reduced-motion: reduce) { body.focus, body.focus.focus-leaving, html.from-focus body:not(.focus) { animation: none; } }

.keystrip .keygroup { font-weight: 600; color: var(--text); opacity: .7; font-size: 10.5px; align-self: center; }
.keystrip .keygroup:not(:first-child) { margin-left: 6px; padding-left: 14px; border-left: 1px solid var(--border); }

/* "you are here": Home > group > page, with a Back control (it replaces the per-page crumbs) */
.crumbs { display: none; }
.trail { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; font-size: 12.5px; color: var(--faint); min-width: 0; }
.trail ol { display: flex; align-items: center; flex-wrap: wrap; gap: 2px 0; list-style: none; margin: 0; padding: 0; min-width: 0; }
.trail li { display: inline-flex; align-items: center; }
.trail li + li::before { content: "\203A"; margin: 0 7px; color: var(--faint); }
.trail a { color: var(--muted); }
.trail a:hover { color: var(--brand); text-decoration: none; }
.trail li[aria-current] span { color: var(--text); font-weight: 600; }
.trail-back { display: inline-flex; align-items: center; gap: 4px; flex: none; padding: 3px 10px 3px 6px; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); color: var(--muted); }
.trail-back .i { transform: rotate(180deg); }
@media (max-width: 720px) { .trail { overflow-x: auto; white-space: nowrap; } .trail ol { flex-wrap: nowrap; } }
@media print { .trail { display: none; } }

/* plain bulleted insights on a card */
.tips { margin: 0; padding: 0 0 0 18px; display: grid; gap: 8px; font-size: 14px; line-height: 1.45; }

.fbar { display: block; height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.fbar i { display: block; height: 100%; background: var(--ch1, var(--brand)); border-radius: 4px; }
.fbar i.neg { background: var(--bad); }

/* the task calendar: a month by the day tasks are due */
.tcal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; background: var(--surface); }
.tcal-h { padding: 8px 10px; font-size: 12px; font-weight: 600; color: var(--muted); background: var(--surface-2); border-bottom: 1px solid var(--border); }
.tcal-d { min-height: 104px; padding: 6px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.tcal-d:nth-child(7n) { border-right: 0; }
.tcal-d.out { background: var(--surface-2); opacity: .6; }
.tcal-d.today { box-shadow: inset 0 0 0 2px var(--brand); }
.tcal-n { font-size: 12px; font-weight: 600; color: var(--muted); }
.tcal-t { display: block; padding: 2px 6px; font-size: 12px; line-height: 1.35; border-radius: var(--r-xs); background: var(--brand-soft, rgba(80,100,240,.12)); color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tcal-t:hover { text-decoration: none; filter: brightness(.96); }
.tcal-t.late { background: rgba(220,60,60,.14); color: var(--bad); }
.tcal-t.done { opacity: .5; text-decoration: line-through; }
.tcal-more { font-size: 11.5px; color: var(--muted); }
@media (max-width: 720px) { .tcal-d { min-height: 64px; padding: 4px; } .tcal-t { font-size: 10.5px; padding: 1px 3px; } }

/* My notes: a wall of small cards, in a few soft colours */
.notes-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin-top: 12px; align-items: start; }
.note { border: 1px solid var(--border); border-radius: var(--r); padding: 12px 14px; background: var(--surface); display: grid; gap: 6px; }
.note-body { white-space: pre-line; overflow-wrap: anywhere; }
.note-foot { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.note-yellow { background: #fff6c9; border-color: #ecd97a; color: #3a3200; }
.note-green { background: #dff5e1; border-color: #9fd5a6; color: #12341a; }
.note-blue { background: #dcecff; border-color: #9cc3f2; color: #10304f; }
.note-pink { background: #ffe0ec; border-color: #f0a9c4; color: #4a1330; }
.note[class*="note-"]:not(.note-plain) .muted, .note[class*="note-"]:not(.note-plain) .small { color: inherit; opacity: .75; }
.note[class*="note-"]:not(.note-plain) input, .note[class*="note-"]:not(.note-plain) textarea, .note[class*="note-"]:not(.note-plain) select { background: rgba(255,255,255,.7); color: #111; }
:root[data-mode="dark"] .note-yellow, :root[data-mode="dark"] .note-green, :root[data-mode="dark"] .note-blue, :root[data-mode="dark"] .note-pink { filter: brightness(.9); }

/* Home on a phone: the greeting and Focus share a line, the periods fill the next one */
@media (max-width: 640px) {
    .page-head.home-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px 10px; }
    .home-head .actions { display: contents; }
    .home-head h1 { font-size: 22px; overflow-wrap: anywhere; }
    .home-head .home-focus { grid-column: 2; grid-row: 1; flex: none; width: 44px; height: 44px; padding: 0; border-radius: var(--r); border: 1px solid var(--border-strong); background: var(--surface); }
    .home-head .home-focus span { display: none; }
    .home-head .seg { grid-column: 1 / -1; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
    .home-head .seg > a, .home-head .seg-custom > summary { display: flex; align-items: center; justify-content: center; min-height: 36px; padding: 0 4px; border-radius: var(--r); }
    .home-head .seg-custom { position: static; }
    .home-head .seg-custom .menu-panel { left: 16px; right: 16px; top: auto; margin-top: 6px; }
}

/* an odd number of number tiles at the top of a dashboard: the last one takes the whole row on a phone, so none is left on its own */
@media (max-width: 760px) { .dash:not(.editing) > .wg:nth-child(odd of :not([hidden])):has(> .stat):not(:has(~ .wg:not([hidden]) > .stat)) { grid-column: 1 / -1; } }

/* Home on a tablet: Focus keeps to the right of the periods instead of stretching */
@media (min-width: 641px) and (max-width: 880px) { .page-head .actions .home-focus { flex: none; margin-left: auto; } }
/* five number tiles on a middle-sized screen: three, then two that share the second row */
@media (min-width: 761px) and (max-width: 1280px) { .dash:not(.editing):has(> .wg:nth-child(5) > .stat):not(:has(> .wg:nth-child(6) > .stat)) > .wg:nth-child(n+4):nth-child(-n+5) { grid-column: span 6; } }

/* =====================================================================================================================================
   Home. Two surfaces only: a deep blue opening (greeting, the day in a sentence, the week as a picture) and one sheet under it where
   everything else sits, parted by hair lines instead of separate boxes.
   ===================================================================================================================================== */
.home { --sheet: #ffffff; --line: #e7ecf4; --ch1: #1564fe; --ch2: #0b8a7b; --ch3: #d98a00; --ch4: #7c4dda; --ch5: #d6455d; }
:root[data-theme="dark"] .home { --sheet: #131a26; --line: rgba(255, 255, 255, .085); --ch1: #3f7ff0; --ch2: #13a08c; --ch3: #c98500; --ch4: #8f6ae8; --ch5: #d9536f; }

/* ---------- the opening ---------- */
.home-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(250px, 330px); grid-template-areas: "top top" "hello week" "news news"; column-gap: 40px; padding: 26px 40px 46px; border-radius: var(--r); color: #fff;
    background: radial-gradient(520px 300px at 96% 4%, rgba(46, 214, 196, .42), transparent 70%), radial-gradient(640px 380px at -4% 108%, rgba(124, 77, 218, .45), transparent 70%), linear-gradient(128deg, #0a1433 0%, #112c75 54%, #1564fe 118%); }
.home-hero.solo { grid-template-areas: "top top" "hello hello" "news news"; }
.hero-top { grid-area: top; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }
.hero-date { margin: 0; font-size: 13px; font-weight: 500; color: #b9cbf5; }
.hero-actions { display: flex; align-items: center; gap: 10px; }
.home-hero .seg { background: rgba(255, 255, 255, .1); }
.home-hero .seg > a, .home-hero .seg-custom > summary { color: #cbd9fb; }
.home-hero .seg > a:hover, .home-hero .seg-custom > summary:hover { color: #fff; }
.home-hero .seg > a.on, .home-hero .seg-custom > summary.on { background: #fff; color: #0a1433; }
.home-hero .menu-panel { color: var(--text); }
.hero-focus { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 14px; border-radius: var(--r); border: 1px solid rgba(255, 255, 255, .24); color: #fff; font-size: 13px; font-weight: 600; }
.hero-focus:hover { text-decoration: none; background: rgba(255, 255, 255, .12); }
.hero-hello { grid-area: hello; align-self: center; padding: 34px 0 26px; }
.hero-hello h1 { margin: 0; font-size: clamp(28px, 3.6vw, 48px); line-height: 1.1; font-weight: 600; letter-spacing: -.025em; color: #fff; overflow-wrap: anywhere; }
.hero-hello h1 em { font-style: normal; font-weight: 700; color: #6ff0dc; }
.hero-line { margin: 14px 0 0; max-width: 34em; font-size: clamp(15px, 1.5vw, 18px); line-height: 1.65; color: #c7d6fa; }
.hero-line a { color: #fff; font-weight: 600; border-bottom: 2px solid rgba(111, 240, 220, .55); }
.hero-line a:hover { text-decoration: none; border-bottom-color: #6ff0dc; }

.hero-week { grid-area: week; align-self: end; display: flex; flex-direction: column; gap: 14px; padding: 26px 0 26px 32px; border-left: 1px solid rgba(255, 255, 255, .14); color: #fff; }
.hero-week:hover { text-decoration: none; }
.hw-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 13px; color: #b9cbf5; }
.hw-head b { font: 600 30px/1 var(--font-head); color: #fff; font-variant-numeric: tabular-nums; }
.hw-head small { font-size: 13px; color: #b9cbf5; margin-left: 3px; }
.hw-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; }
.hw-day { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.hw-track { display: flex; align-items: flex-end; width: 12px; height: 84px; border-radius: var(--r); background: rgba(255, 255, 255, .1); overflow: hidden; }
.hw-track i { display: block; width: 100%; border-radius: var(--r); background: #8fb4ff; }
.hw-day.today .hw-track { box-shadow: 0 0 0 1.5px #6ff0dc; }
.hw-day.today .hw-track i { background: #6ff0dc; }
.hw-day.future .hw-track { background: transparent; border: 1px dashed rgba(255, 255, 255, .2); }
.hw-day small { font-size: 11px; color: #a9bdee; }
.hw-day.today small { color: #6ff0dc; font-weight: 700; }

/* the slideshow becomes one quiet line at the foot of the opening */
.hero-news { grid-area: news; min-width: 0; }
.home .hero-news .glimpses { margin: 0; border: 0; border-top: 1px solid rgba(255, 255, 255, .14); border-radius: 0; background: transparent; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
.home .hero-news .gl-slide { display: block; min-height: 0; padding: 16px 130px 2px 0; background: transparent; }
.home .hero-news .gl-copy { display: flex; flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.home .hero-news .gl-kicker { margin: 0; padding: 0; height: auto; background: none; color: #6ff0dc; font-size: 11px; }
.home .hero-news .gl-title { margin: 0; font: 600 14px/1.5 var(--font); color: #fff; letter-spacing: 0; }
.home .hero-news .gl-text { margin: 0; font-size: 13px; color: #b9cbf5; }
.home .hero-news .gl-go { margin: 0; padding: 0; height: auto; background: none; box-shadow: none; color: #fff; font-size: 13px; text-decoration: underline; text-underline-offset: 3px; }
.home .hero-news .gl-art, .home .hero-news .gl-timer, .home .hero-news .gl-dots { display: none; }
.home .hero-news .gl-nav { left: auto; right: 0; bottom: auto; top: 14px; }
.home .hero-news .gl-nav > button { background: rgba(255, 255, 255, .12); color: #fff; }

/* ---------- the sheet ---------- */
.home-sheet { position: relative; margin: -24px 14px 0; background: var(--sheet); border-radius: var(--r); box-shadow: 0 30px 60px -44px rgba(14, 32, 78, .5); overflow: hidden; }
.home-sheet > * { margin: 0; }
.home-sheet > * + * { border-top: 1px solid var(--line); }
.home-sheet > #waiting:empty { display: none; }
.home .home-sheet .starts { padding: 22px 30px 12px; }
.home .starts .start-chips { gap: 22px; margin-bottom: 4px; }
.home .starts .start-chip { height: 30px; padding: 0; border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: none; color: var(--muted); }
.home .starts .start-chip.on { background: none; color: var(--text); border-bottom-color: var(--ch1); }
.home .starts .start-tiles { gap: 0; }
.home .starts .start-tile { padding: 14px 22px 12px; margin-left: -1px; border: 0; border-left: 1px solid var(--line); border-radius: 0; background: none; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
.home .starts .start-tile:first-child { padding-left: 0; border-left-color: transparent; }
.home .starts .start-tile:hover .st-l { color: var(--ch1); }
.home .starts .start-tile .st-v { font: 600 30px/1.25 var(--font-head); }
.home .starts .start-one { margin-bottom: 0; }
.home .home-sheet .prio { padding: 20px 30px 14px; margin: 0; border: 0; border-radius: 0; background: none; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
.home .prio li a { border-top: 0; padding: 9px 0; border-radius: 0; }
.home .prio li a:hover { background: none; }
.home .prio li a:hover .ptxt { color: var(--ch1); }
.home .prio .cnt { background: none; justify-content: start; min-width: 42px; padding: 0; color: var(--ch1); font: 700 24px/1 var(--font-head); }
.home .home-sheet .dash-tabs { margin: 0; padding: 0 30px; gap: 26px; }
.home .dash-tabs > a { padding: 17px 0 15px; border-radius: 0; background: none; box-shadow: none; color: var(--muted); border-bottom: 2px solid transparent; }
.home .dash-tabs > a.on { background: none; color: var(--text); border-bottom-color: var(--ch1); }
.home .dash-tabs > a.dash-custom { margin-left: auto; padding: 0 12px; height: 32px; align-self: center; border: 1px solid var(--line); border-radius: var(--r); }
.home-note { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding: 16px 30px; }
.home-note > div { flex: 1 1 280px; }
.home-note h2 { margin: 0 0 2px; font-size: 14.5px; }
.home-note p { margin: 0; font-size: 13px; }

/* panels share hair lines: no boxes, no gaps */
.home .dash-wrap { overflow: hidden; }
.home .dash { gap: 0; margin: -1px 0 0 -1px; }
.home .dash .wg { border-left: 1px solid var(--line); border-top: 1px solid var(--line); }
.home .dash .wg > .card, .home .dash .wg > .stat { margin: 0; padding: 24px 30px; border: 0; border-radius: 0; background: none; box-shadow: none; overflow: visible; -webkit-backdrop-filter: none; backdrop-filter: none; }
.home .dash .wg > .card.flush { padding: 0 0 8px; }
.home .dash .card-head.pad { padding: 24px 30px 0; }
.home .dash .feed li { padding-left: 30px; padding-right: 30px; border-radius: 0; border-top-color: var(--line); }
.home .dash .card h2 { font-size: 15px; }
.home .dash .wg > .stat { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "ico l" "v v" "n n"; align-content: start; align-items: center; column-gap: 9px; }
.home .dash .stat .ico { width: 24px; height: 24px; border-radius: var(--r); }
.home .dash .stat .ico .i { width: 14px; height: 14px; }
.home .dash .stat .v { margin-top: 12px; font: 600 40px/1 var(--font-head); letter-spacing: -.03em; }
.home .dash a.stat:hover { background: var(--hover); }
.home .big { font-size: 30px; }
.home .ht { height: 6px; }

/* ---------- area chart ---------- */
.area-plot { position: relative; height: 210px; }
.area-plot svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.area-grid { stroke: var(--line, var(--border)); stroke-width: 1; stroke-dasharray: 3 5; vector-effect: non-scaling-stroke; }
.area-base { stroke: var(--border-strong); stroke-width: 1; vector-effect: non-scaling-stroke; }
.area-line { fill: none; stroke: var(--c); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.area-from { stop-color: var(--c); stop-opacity: .24; }
.area-to { stop-color: var(--c); stop-opacity: 0; }
.area-max { position: absolute; left: 0; top: 0; font-size: 11px; color: var(--faint); font-variant-numeric: tabular-nums; }
.area-cols { position: absolute; inset: 0; display: flex; }
.area-col { position: relative; flex: 1 1 0; min-width: 0; outline: none; }
.area-col::before { content: ""; position: absolute; left: 50%; top: 8%; bottom: 0; border-left: 1px solid var(--border-strong); opacity: 0; }
.area-col > i { position: absolute; left: 50%; width: 9px; height: 9px; margin: 0 0 -4.5px -4.5px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 2px var(--sheet, var(--surface)); opacity: 0; }
.area-col.last > i, .area-col:hover > i, .area-col:focus > i, .area-col:hover::before, .area-col:focus::before { opacity: 1; }
.area-tip { position: absolute; z-index: 6; top: -6px; left: 50%; transform: translateX(-50%); display: none; flex-direction: column; gap: 3px; padding: 8px 11px; border-radius: var(--r); background: #0f1b33; color: #fff; font-size: 12px; white-space: nowrap; pointer-events: none; }
.area-col.near-start .area-tip { left: 0; transform: none; }
.area-col.near-end .area-tip { left: auto; right: 0; transform: none; }
.area-col:hover .area-tip, .area-col:focus .area-tip { display: flex; }
.area-tip > span { display: flex; align-items: center; gap: 6px; color: #c8d3ea; }
.area-tip u { width: 8px; height: 8px; border-radius: 3px; background: var(--c); text-decoration: none; }
.area-tip em { margin-left: auto; padding-left: 10px; font-style: normal; font-weight: 700; color: #fff; }
.area-labels { display: flex; margin-top: 8px; }
.area-labels span { flex: 1 1 0; min-width: 0; display: flex; justify-content: center; white-space: nowrap; font-size: 11px; color: var(--faint); }
.duo-key span.ch-1 i, .duo-key span.ch-2 i { background: var(--c); }

/* ---------- one bar split into parts ---------- */
.split-total { margin: 0 0 12px; display: flex; align-items: baseline; gap: 8px; }
.split-total b { font: 600 32px/1 var(--font-head); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.split-total span { font-size: 13px; color: var(--muted); }
.split-bar { display: flex; gap: 2px; height: 14px; margin-bottom: 14px; border-radius: var(--r); overflow: hidden; background: var(--surface-2); }
.split-bar i { display: block; flex-basis: 6px; background: var(--c); }
.split-list { list-style: none; margin: 0; padding: 0; }
.split-list li { display: flex; align-items: center; gap: 10px; padding: 7px 0; font-size: 13px; }
.split-list li + li { border-top: 1px solid var(--line, var(--border)); }
.split-list i { flex: none; width: 9px; height: 9px; border-radius: 3px; background: var(--c); }
.split-list span { flex: 1; color: var(--muted); }
.split-list b { font-variant-numeric: tabular-nums; }
.split-list small { min-width: 36px; text-align: right; color: var(--faint); font-variant-numeric: tabular-nums; }
.split-list li.none { opacity: .55; }
.od-1 { --c: #86b6ef; } .od-2 { --c: #5598e7; } .od-3 { --c: #2a78d6; } .od-4 { --c: #1c5cab; } .od-5 { --c: #104281; }
:root[data-theme="dark"] .od-1 { --c: #cde2fb; }
:root[data-theme="dark"] .od-2 { --c: #9ec5f4; }
:root[data-theme="dark"] .od-3 { --c: #6da7ec; }
:root[data-theme="dark"] .od-4 { --c: #3987e5; }
:root[data-theme="dark"] .od-5 { --c: #256abf; }
.people { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 14px; }
.people i { width: 22px; height: 22px; border-radius: 50%; background: var(--c); }
.people i.open, .split-list li.open i { background: transparent; box-shadow: inset 0 0 0 2px var(--border-strong); }

@media (max-width: 1040px) {
    .home-hero { grid-template-columns: minmax(0, 1fr); grid-template-areas: "top" "hello" "week" "news"; }
    .home-hero.solo { grid-template-areas: "top" "hello" "news"; }
    .hero-week { padding: 20px 0 22px; border-left: 0; border-top: 1px solid rgba(255, 255, 255, .14); }
    .hw-track { height: 56px; }
}
@media (max-width: 640px) {
    .home-hero { padding: 18px 18px 40px; border-radius: var(--r); }
    .hero-actions { width: 100%; }
    .home-hero .seg { flex: 1; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
    .home-hero .seg > a, .home-hero .seg-custom > summary { display: flex; align-items: center; justify-content: center; min-height: 36px; padding: 0 2px; border-radius: var(--r); }
    .home-hero .seg-custom { position: static; }
    .home-hero .seg-custom .menu-panel { left: 32px; right: 32px; top: auto; margin-top: 6px; }
    .hero-focus { width: 40px; height: 40px; padding: 0; justify-content: center; flex: none; }
    .hero-focus span { display: none; }
    .hero-hello { padding: 24px 0 18px; }
    .home .hero-news .gl-slide { padding-right: 0; padding-bottom: 40px; }
    .home .hero-news .gl-title, .home .hero-news .gl-text { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
    .home .hero-news .gl-nav { top: auto; bottom: 0; right: auto; left: 0; }
    .home-sheet { margin: -22px 6px 0; border-radius: var(--r); }
    .home .home-sheet .starts, .home .home-sheet .prio, .home-note { padding-left: 18px; padding-right: 18px; }
    .home .starts .start-chips { margin-right: -18px; padding-right: 18px; }
    .home .starts .start-tile { padding: 12px 14px 10px; }
    .home .starts .start-tile:nth-child(odd) { padding-left: 0; border-left-color: transparent; }
    .home .home-sheet .dash-tabs { padding: 0 18px; gap: 20px; }
    .home .dash .wg > .card, .home .dash .wg > .stat { padding: 20px 18px; }
    .home .dash .wg > .card.flush { padding: 0 0 8px; }
    .home .dash .card-head.pad { padding: 20px 18px 0; }
    .home .dash .feed li { padding-left: 18px; padding-right: 18px; }
    .home .dash .stat .v { font-size: 32px; }
    .area-plot { height: 170px; }
}

/* ---------- Horizon: Daylight's clear cards, with the deep blue of its Home ---------- */
[data-skin="horizon"] .nav-list > a.active, [data-skin="horizon"] .nav-items a.active { background: linear-gradient(120deg, #112c75, #1564fe); color: #fff; }
[data-skin="horizon"] .auth-brand { background: linear-gradient(150deg, #0a1433, #112c75 55%, #1564fe); }
.sample.horizon { background: #eef1f7; color: #16202e; }
.sample.horizon .sb { background: #fff; }
.sample.horizon .sb i { background: #e9eef6; }
.sample.horizon .sb i.on { background: #112c75; }
.sample.horizon .mn { gap: 0; }
.sample.horizon .tl { position: relative; padding: 12px 12px 22px; border-radius: var(--r); background: linear-gradient(128deg, #0a1433, #112c75 55%, #1564fe); color: #fff; }
.sample.horizon .tl b { padding: 4px 6px; }
.sample.horizon .ch { position: relative; margin: -12px 6px 0; background: #fff; box-shadow: 0 8px 18px -12px rgba(18, 30, 60, .3); }
.sample.horizon .ch i { background: #1564fe; }

/* ---------- legal links live in menus and pages, not in a footer bar ---------- */
.legal-menu { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 6px; padding: 10px 10px 4px; border-top: 1px solid var(--border); max-width: 260px; }
.menu-panel .legal-menu a { display: inline; min-height: 0; padding: 0; font-size: 11.5px; font-weight: 500; color: var(--faint); background: none; }
.menu-panel .legal-menu a:hover { color: var(--brand); background: none; }
.legal-menu.inline { max-width: none; margin: 18px 0 0; padding: 0; border: 0; font-size: 12.5px; }
.public-main > .legal-menu.inline { margin: 0 0 18px; }

/* ---------- find a page ---------- */
.nav-find { display: flex; align-items: center; gap: 8px; margin: 10px 12px 0; padding: 0 12px; border-radius: var(--r); background: var(--surface-2); color: var(--faint); }
.nav-find input[type=search] { flex: 1; min-width: 0; border: 0; background: transparent; padding: 0; height: 38px; color: var(--text); box-shadow: none; }
.nav-find input[type=search]:focus { outline: none; }
.nav-find:focus-within { box-shadow: var(--ring); }
@media (min-width: 881px) { [data-skin="split"] .nav-find { display: none; } }

/* ---------- quick picks: choose a category in one tap ---------- */
.picks { display: flex; gap: 8px; margin: 0 0 14px; overflow-x: auto; scrollbar-width: none; }
.picks a { flex: none; display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--border); color: var(--muted); font-weight: 600; font-size: 13.5px; }
.picks a:hover { text-decoration: none; color: var(--text); }
.picks a.on { background: var(--text); border-color: var(--text); color: var(--bg); }
.picks small { font-size: 12px; opacity: .7; font-variant-numeric: tabular-nums; }

/* ---------- projects as cards ---------- */
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 14px; margin-bottom: 16px; }
.pj { position: relative; display: flex; flex-direction: column; gap: 8px; min-width: 0; padding: 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); transition: transform .15s, border-color .15s; }
.pj:hover { transform: translateY(-2px); border-color: var(--brand); }
.pj:focus-within { box-shadow: var(--ring); }
.pj.late { border-color: color-mix(in srgb, var(--bad) 45%, var(--border)); }
.pj-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.pj-client { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11.5px; font-weight: 700; color: var(--faint); }
.pj h2 { margin: 0; font-size: 16.5px; line-height: 1.35; overflow-wrap: anywhere; }
.pj-link { color: var(--text); }
.pj-link:hover { text-decoration: none; }
.pj-link::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }   /* the whole card opens the project */
.pj-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.pj-progress { display: flex; align-items: center; gap: 12px; margin-top: auto; padding-top: 6px; }
.pj-bar { flex: 1; height: 6px; border-radius: var(--r); background: var(--surface-2); overflow: hidden; }
.pj-bar i { display: block; height: 100%; border-radius: var(--r); background: var(--brand); }
.pj-count { font-size: 12.5px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.pj-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 28px; }
.pj-date { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.pj-date.down { color: var(--bad); font-weight: 600; }
.pj-people { position: relative; z-index: 1; display: inline-flex; }
.pj-people i { width: 28px; height: 28px; margin-left: -7px; display: grid; place-items: center; border-radius: 50%; background: var(--brand-soft); color: var(--brand); border: 2px solid var(--surface); font: 700 10.5px/1 var(--font); font-style: normal; text-transform: uppercase; }

/* ---------- accounts: figures, things to record, reports ---------- */
.acc-figs { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 22px; }
.acc-fig { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); color: var(--text); min-width: 0; }
.acc-fig:hover { text-decoration: none; border-color: var(--brand); }
.acc-fig span { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.acc-fig b { font: 600 24px/1.2 var(--font-head); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.acc-fig small { font-size: 12px; color: var(--faint); }
.acc-fig.warn small { color: var(--bad); font-weight: 600; }
.acc-h { margin: 0 0 10px; font-size: 16px; }
.acc-do { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-bottom: 24px; }
.acc-do a { position: relative; display: flex; flex-direction: column; gap: 3px; padding: 16px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); color: var(--text); }
.acc-do a:hover { text-decoration: none; border-color: var(--brand); }
.acc-do .ico { width: 38px; height: 38px; margin-bottom: 8px; display: grid; place-items: center; border-radius: var(--r); background: var(--brand-soft); color: var(--brand); }
.acc-do small { color: var(--muted); font-size: 12.5px; }
.acc-do kbd, .acc-reports kbd { font: 600 11px var(--font); padding: 1px 7px; border-radius: var(--r-xs); border: 1px solid var(--border-strong); color: var(--faint); }
.acc-do kbd { position: absolute; right: 12px; top: 12px; }
.acc-reports { columns: 3 300px; column-gap: 14px; }
.acc-reports .card { break-inside: avoid; margin-bottom: 14px; padding: 16px 18px 8px; }
.acc-reports h3 { margin: 0 0 6px; font-size: 12px; color: var(--faint); }
.acc-reports ul { list-style: none; margin: 0; padding: 0; }
.acc-reports li + li { border-top: 1px solid var(--border); }
.acc-reports a { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; padding: 7px 0; color: var(--text); }
.acc-reports a:hover { text-decoration: none; }
.acc-reports a:hover b { color: var(--brand); }
.acc-reports a span { display: flex; flex-direction: column; }
.acc-reports b { font-size: 14px; }
.acc-reports small { font-size: 12.5px; color: var(--muted); }
.acc-keys { margin-top: 4px; }
.keyfold { margin: -6px 0 14px; }
.keyfold > summary { display: inline-flex; align-items: center; gap: 6px; list-style: none; cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--faint); }
.keyfold > summary::-webkit-details-marker { display: none; }
.keyfold > summary::after { content: "+"; }
.keyfold[open] > summary::after { content: "−"; }
.keyfold .keystrip { margin: 8px 0 0; }
@media (max-width: 880px), (pointer: coarse) { .keyfold, .acc-do kbd, .acc-reports kbd, .acc-keys { display: none; } }

/* ---------- phones: compact, so more fits and it is still easy to read and tap (applies to every screen, new ones included) ---------- */
@media (max-width: 640px) {
    .content { padding-left: 12px; padding-right: 12px; padding-top: 12px; }
    .card { padding: 14px; margin-bottom: 12px; border-radius: var(--r); }
    .card.flush { padding: 0; }
    .card h2 { font-size: 15px; }
    .page-head { margin-bottom: 12px; gap: 8px; }
    .page-head h1 { font-size: 20px; }
    .page-head .actions .btn { flex: 0 1 auto; }
    .page-head .actions .btn-primary { flex: 1; }
    .btn { min-height: 40px; padding: 0 12px; }
    .btn-sm { min-height: 34px; }
    input, select, textarea { min-height: 40px; }
    .subtabs { margin: -4px -12px 12px; padding: 0 12px; }
    .subtabs a { padding: 9px 11px; font-size: 13px; }
    .stats { gap: 8px; margin-bottom: 12px; }
    .stat { padding: 12px 14px; }
    .stat .v { font-size: 22px; margin-top: 4px; }
    table.cards tbody { gap: 8px; }
    table.cards tr { gap: 6px 12px; padding: 12px; border-radius: var(--r); }
    table.cards td:first-child { font-size: 14.5px; }
    .picks { margin: 0 -12px 10px; padding: 0 12px; }
    .picks a { height: 34px; padding: 0 12px; font-size: 13px; }
    .pgrid { gap: 10px; }
    .pj { padding: 14px; gap: 6px; }
    .pj h2 { font-size: 15.5px; }
    .acc-figs { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 16px; }
    .acc-fig { padding: 12px; }
    .acc-fig b { font-size: 18px; }
    .acc-do { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 16px; }
    .acc-do a { padding: 12px; }
    .acc-do .ico { width: 32px; height: 32px; margin-bottom: 6px; }
    .acc-reports .card { margin-bottom: 10px; padding: 12px 14px 4px; }
    .acc-reports a { min-height: 46px; }
}

/* the bulk change fields appear only once something is ticked */
body:not(:has([data-bulk-row]:checked)) form[data-bulk] > .card { background: transparent; border-color: transparent; box-shadow: none; padding-top: 0 !important; padding-bottom: 0 !important; -webkit-backdrop-filter: none; backdrop-filter: none; }
body:not(:has([data-bulk-row]:checked)) form[data-bulk] > .card > label:not(.check), body:not(:has([data-bulk-row]:checked)) form[data-bulk] > .card > button { display: none; }

@media (max-width: 880px) {
    /* a task as a card: the tick box beside its title, the rest in two columns */
    table.tasklist.cards tr { grid-template-columns: 26px 1fr 1fr; }
    table.tasklist.cards td:nth-child(1) { grid-column: 1; grid-row: 1; font-size: 14.5px; align-self: start; padding-top: 2px; }
    table.tasklist.cards td:nth-child(2) { grid-column: 2 / -1; grid-row: 1; font-size: 14.5px; }
    table.tasklist.cards td:nth-child(2)::before { display: none; }
    table.tasklist.cards td:nth-child(odd):not(:first-child) { grid-column: 2; }
    table.tasklist.cards td:nth-child(even):not(:nth-child(2)) { grid-column: 3; }
    table.tasklist.cards td[colspan] { grid-column: 1 / -1; grid-row: auto; }
}

@media (max-width: 640px) {
    /* the way back stays; the long path does not */
    .trail { margin-bottom: 8px; }
    .trail ol { display: none; }
    .page-head .actions { justify-content: flex-end; }
    .page-head:has(h1.dup-title) { margin-bottom: 8px; }
    .page-head .actions .seg a { padding: 6px 10px; font-size: 12px; }
    .toolbar > div:not(.grow):last-of-type:nth-of-type(even) { grid-column: 1 / -1; }
}

/* figures inside a phone card read from the left, under their label */
@media (max-width: 880px) { table.cards td.n, .report.cards td.n { text-align: left; } }
@media (max-width: 640px) { table.cards tr:has(> td:nth-child(4):last-child):not(:has(a[href^="mailto:"])) { grid-template-columns: repeat(3, minmax(0, 1fr)); } table.cards td:has(> a[href^="mailto:"]) { grid-column: 1 / -1; } }

/* ---------- quick money entry and the owner summary ---------- */
.qentry { display: grid; grid-template-columns: minmax(0, 520px) minmax(0, 1fr); gap: 14px; align-items: start; }
.quick-form h2 { margin-bottom: 2px; }
.quick-amount input[type=text] { height: 56px; font: 600 26px var(--font-head); font-variant-numeric: tabular-nums; }
.quick-go { display: flex; flex-wrap: wrap; gap: 8px; }
.quick-go .btn { flex: 1; }
.quick-recent a { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); color: var(--text); }
.quick-recent a:hover { text-decoration: none; }
.quick-recent a span { display: flex; flex-direction: column; min-width: 0; }
.quick-recent a small { color: var(--muted); font-size: 12.5px; }
.quick-recent a em { font-style: normal; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.sum-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: 14px; }
@media (max-width: 880px) { .qentry { grid-template-columns: minmax(0, 1fr); } }

/* ---------- messages: an inbox of four parts (boxes, threads, conversation, details); one at a time on a phone ---------- */
.msg-link { position: relative; }
.inbox { position: relative; display: grid; grid-template-columns: 210px minmax(240px, 320px) minmax(0, 1fr); height: calc(100vh - 128px); min-height: 480px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); overflow: hidden; }
.inbox.has-info { grid-template-columns: 210px minmax(240px, 300px) minmax(0, 1fr) 280px; }
.content:has(.inbox) > .trail { display: none; }

.face { flex: none; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; overflow: hidden; font-weight: 700; font-size: 13px; text-transform: uppercase; background: #e3ecff; color: #1b4fc4; }
.face img { width: 100%; height: 100%; object-fit: cover; }
.face.tone-1 { background: #d9f4ec; color: #0b6e5f; }
.face.tone-2 { background: #ece5ff; color: #5230b8; }
.face.tone-3 { background: #ffeccc; color: #8a5200; }
.face.tone-4 { background: #ffe0e6; color: #a8213f; }
.face.tone-5 { background: #dff0fb; color: #0b5e8a; }
.face.xs { width: 26px; height: 26px; font-size: 10px; }
.face.sm { width: 32px; height: 32px; font-size: 11px; }
.face.lg { width: 64px; height: 64px; font-size: 20px; }

.in-boxes { display: flex; flex-direction: column; min-height: 0; overflow-y: auto; padding: 14px 10px; border-right: 1px solid var(--border); }
.in-title { display: flex; align-items: center; justify-content: space-between; padding: 0 6px 12px; }
.in-title h1 { margin: 0; font-size: 18px; }
.in-new { width: 30px; height: 30px; display: grid; place-items: center; border-radius: var(--r); background: var(--text); color: var(--bg); }
.in-new .i { width: 16px; height: 16px; }
.in-filters { display: flex; flex-direction: column; gap: 2px; }
.in-filters a { display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 10px; border-radius: var(--r); color: var(--muted); font-weight: 600; font-size: 13.5px; }
.in-filters a:hover { background: var(--surface-2); text-decoration: none; }
.in-filters a.on { background: var(--brand-soft); color: var(--brand); }
.in-filters .i { width: 17px; height: 17px; }
.in-filters span { flex: 1; }
.in-filters em, .chat-when em { min-width: 20px; padding: 2px 6px; border-radius: var(--r); background: var(--brand); color: var(--brand-ink); font-style: normal; font-weight: 700; font-size: 11px; text-align: center; }
.in-boxes h2 { margin: 18px 0 6px; padding: 0 10px; font-size: 11px; font-weight: 700; color: var(--faint); }
.in-people button { display: flex; align-items: center; gap: 9px; width: 100%; padding: 5px 10px; border: 0; border-radius: var(--r); background: none; color: var(--text); font: 500 13px var(--font); text-align: left; cursor: pointer; }
.in-people button:hover { background: var(--surface-2); }
.in-people button span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.in-list { display: flex; flex-direction: column; min-width: 0; min-height: 0; border-right: 1px solid var(--border); }
.in-search { display: flex; align-items: center; gap: 8px; margin: 12px; padding: 0 12px; border-radius: var(--r); background: var(--surface-2); color: var(--faint); }
.in-search input[type=search] { flex: 1; min-width: 0; border: 0; background: transparent; padding: 0; box-shadow: none; }
.in-search input[type=search]:focus { outline: none; }
.in-search:focus-within { box-shadow: var(--ring); }
.chat-rows { flex: 1; overflow-y: auto; }
.chat-row { position: relative; display: flex; align-items: center; gap: 11px; padding: 12px 14px; border-top: 1px solid var(--border); color: var(--text); }
.chat-row:hover { text-decoration: none; background: var(--hover); }
.chat-row.on { background: var(--brand-soft); }
.chat-row.on::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--brand); }
.chat-sum { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.chat-sum b, .chat-sum small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-sum b { font-size: 13.5px; }
.chat-sum small { color: var(--muted); font-size: 12.5px; }
.chat-row.unread .chat-sum small { color: var(--text); font-weight: 600; }
.chat-tag { margin-left: 6px; padding: 1px 6px; border-radius: var(--r-xs); background: var(--ok-soft); color: var(--ok); font-style: normal; font-size: 10px; vertical-align: 1px; }
.chat-when { flex: none; align-self: stretch; display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; font-size: 11px; color: var(--faint); }
.chat-none { padding: 18px; }

.in-chat { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.chat-top { display: flex; align-items: center; gap: 11px; min-height: 64px; padding: 10px 16px; border-bottom: 1px solid var(--border); }
.chat-top > div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.chat-top > div b, .chat-top > div small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-top small { color: var(--muted); font-size: 12px; }
.chat-back, .chat-info, .in-close { display: none; width: 36px; height: 36px; flex: none; place-items: center; border: 0; border-radius: var(--r); background: none; color: var(--muted); cursor: pointer; }
.chat-back .i { transform: rotate(90deg); }
.chat-body { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; padding: 16px; overscroll-behavior: contain; }
.msg-day { display: flex; align-items: center; gap: 10px; color: var(--faint); font-size: 11px; font-weight: 700; }
.msg-day::before, .msg-day::after { content: ""; flex: 1; border-top: 1px solid var(--border); }
.msg { display: flex; align-items: flex-end; gap: 9px; align-self: flex-start; max-width: min(84%, 600px); }
.msg.mine { align-self: flex-end; }
.msg-box { min-width: 0; }
.msg-bubble { display: flex; flex-direction: column; gap: 6px; padding: 11px 14px; border-radius: var(--r) var(--r) var(--r) 4px; background: var(--brand-soft); }
.msg.mine .msg-bubble { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r) var(--r) 4px var(--r); }
.msg.named .msg-bubble { box-shadow: 0 0 0 2px var(--warn); }
.msg-head { display: flex; justify-content: space-between; align-items: baseline; gap: 18px; }
.msg-head b { font-size: 12.5px; }
.msg-head time { font-size: 11px; color: var(--faint); }
.msg p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.55; }
.msg mark { padding: 0 3px; border-radius: 4px; background: color-mix(in srgb, var(--brand) 18%, transparent); color: var(--brand); font-weight: 600; }
.msg-pic img { display: block; max-width: 100%; max-height: 260px; border-radius: var(--r); }
.msg-file { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--border); color: var(--text); font-weight: 600; font-size: 12.5px; overflow-wrap: anywhere; }
.msg-file small { font-weight: 400; color: var(--faint); white-space: nowrap; }
.msg-recs { display: flex; flex-direction: column; gap: 6px; }
.rec { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 8px 12px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--border); color: var(--text); }
a.rec:hover { text-decoration: none; border-color: var(--brand); }
.rec i { flex: none; width: 32px; height: 32px; display: grid; place-items: center; border-radius: var(--r); background: var(--brand-soft); color: var(--brand); }
.rec i .i { width: 16px; height: 16px; }
.rec span { min-width: 0; display: flex; flex-direction: column; }
.rec b { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rec small { font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rec.shut { border-style: dashed; opacity: .75; }
.chat-seen { margin: -8px 18px 4px; text-align: right; font-size: 11px; color: var(--faint); }
.chat-send { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 10px 14px 14px; }
.chat-compose { display: flex; align-items: flex-end; gap: 4px; padding: 5px 5px 5px 14px; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--border); }
.chat-compose:focus-within { border-color: var(--brand); box-shadow: var(--ring); }
.chat-compose textarea { flex: 1; min-width: 0; min-height: 38px; padding: 9px 0; border: 0; background: transparent; resize: none; box-shadow: none; }
.chat-compose textarea:focus { outline: none; box-shadow: none; }
.chat-tool { position: relative; flex: none; width: 36px; height: 38px; display: grid; place-items: center; border: 0; border-radius: var(--r); background: none; color: var(--muted); font: 700 17px var(--font); cursor: pointer; }
.chat-tool:hover { background: var(--surface); color: var(--brand); }
.chat-tool input { position: absolute; inset: 0; opacity: 0; cursor: pointer; min-height: 0; }
.chat-tool:focus-within { box-shadow: var(--ring); }
.chat-go { flex: none; width: 42px; height: 38px; display: grid; place-items: center; border: 0; border-radius: var(--r); background: var(--text); color: var(--bg); cursor: pointer; }
.chat-go:disabled { opacity: .5; }
.chat-picked:empty, .chat-chips:empty { display: none; }
.chat-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; padding: 4px 4px 4px 12px; border-radius: var(--r); background: var(--brand-soft); font-size: 12.5px; }
.chip b, .chip small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 180px; }
.chip small { color: var(--muted); }
.chip button { width: 24px; height: 24px; border: 0; border-radius: 50%; background: var(--surface); color: var(--muted); cursor: pointer; line-height: 1; }
.chat-suggest { position: absolute; left: 14px; right: 14px; bottom: 100%; z-index: 20; max-height: 260px; overflow-y: auto; padding: 6px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--border-strong); box-shadow: 0 18px 40px -14px rgba(16, 24, 40, .35); }
.chat-suggest[hidden] { display: none; }
.chat-suggest button { display: flex; flex-direction: column; align-items: flex-start; width: 100%; padding: 8px 10px; border: 0; border-radius: var(--r); background: none; color: var(--text); text-align: left; cursor: pointer; }
.chat-suggest button.on, .chat-suggest button:hover { background: var(--brand-soft); }
.chat-suggest small { color: var(--muted); font-size: 11.5px; }
.chat-suggest p { margin: 8px 10px; }
.chat-new { flex: 1; overflow-y: auto; padding: 16px; }
.chat-new fieldset { border: 0; padding: 0; margin: 0 0 14px; }
.chat-new legend { font-weight: 600; margin-bottom: 8px; padding: 0; }
.chat-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px 14px; max-height: 220px; overflow-y: auto; margin-bottom: 8px; }
.chat-empty { flex: 1; display: grid; place-content: center; justify-items: center; gap: 8px; color: var(--faint); }
.chat-empty .i { width: 40px; height: 40px; }

.in-info { min-height: 0; overflow-y: auto; padding: 18px 16px; border-left: 1px solid var(--border); background: var(--surface); }
.in-who { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; overflow-wrap: anywhere; }
.in-info h3 { margin: 20px 0 8px; font-size: 11px; font-weight: 700; color: var(--faint); }
.in-person { display: flex; align-items: center; gap: 10px; padding: 5px 0; }
.in-person span:last-child { display: flex; flex-direction: column; min-width: 0; }
.in-person b { font-size: 13px; }
.in-person small { font-size: 11.5px; color: var(--muted); }
.in-add > summary { cursor: pointer; padding: 6px 0; color: var(--brand); font-weight: 600; font-size: 13px; list-style: none; }
.in-add .chat-pick { grid-template-columns: 1fr; }
.in-info .rec { margin-bottom: 6px; }

/* narrower screens: the details slide over the conversation */
@media (max-width: 1320px) {
    .inbox.has-info { grid-template-columns: 200px minmax(230px, 290px) minmax(0, 1fr); }
    .chat-info { display: grid; }
    .in-info { position: absolute; top: 0; right: 0; bottom: 0; z-index: 15; width: min(320px, 100%); transform: translateX(105%); visibility: hidden; transition: transform .2s, visibility 0s .2s; box-shadow: -20px 0 40px -24px rgba(16, 24, 40, .35); }
    .inbox.info-open .in-info { transform: none; visibility: visible; transition: transform .2s; }
    .in-close { display: grid; position: absolute; top: 8px; right: 8px; font-size: 24px; }
}
@media (max-width: 1080px) {
    .inbox, .inbox.has-info { grid-template-columns: minmax(230px, 290px) minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
    .in-boxes { grid-column: 1 / -1; flex-direction: row; align-items: center; gap: 10px; padding: 8px 12px; border-right: 0; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
    .in-boxes h2, .in-people { display: none; }
    .in-title { padding: 0; gap: 10px; }
    .in-filters { flex-direction: row; gap: 4px; }
    .in-filters a { flex: none; height: 34px; border-radius: var(--r); }
}
@media (max-width: 880px) {
    .notes-link { display: none; }
    body:has(.inbox) .fab { display: none; }
    body:has(.inbox) .content { padding: 0 0 calc(62px + env(safe-area-inset-bottom)); }
    .inbox, .inbox.has-info { grid-template-columns: minmax(0, 1fr); height: calc(100dvh - var(--topbar-h) - env(safe-area-inset-top) - 62px - env(safe-area-inset-bottom)); min-height: 0; border: 0; border-radius: 0; box-shadow: none; }
    .inbox .in-chat { display: none; }
    .in-list { border-right: 0; }
    .in-boxes .in-title h1 { display: none; }
    .in-search { margin: 8px 12px; }
    /* an open conversation takes the whole screen, like a chat app */
    .inbox.reading { position: fixed; inset: 0; z-index: 45; height: 100dvh; grid-template-rows: minmax(0, 1fr); padding-top: env(safe-area-inset-top); }
    .inbox.reading .in-boxes, .inbox.reading .in-list { display: none; }
    .inbox.reading .in-chat { display: flex; }
    body:has(.inbox.reading) .tabbar, body:has(.inbox.reading) .ptl-tabbar { display: none; }
    .chat-back { display: grid; margin-left: -8px; }
    .chat-top { min-height: 56px; padding: 8px 12px; }
    .chat-body { padding: 12px; gap: 10px; }
    .msg { max-width: 90%; }
    .msg > .face { display: none; }
    .chat-send { padding: 8px 10px calc(10px + env(safe-area-inset-bottom)); }
    .chat-compose { padding-left: 12px; gap: 0; }
    .chat-compose textarea { min-height: 40px; }
    .chat-tool { width: 34px; }
    .chat-suggest { left: 10px; right: 10px; max-height: 40dvh; }
    .in-info { width: 100%; z-index: 20; }
}

/* ---------- cards for clients, leads and proposals ---------- */
.pj-face { width: 38px; height: 38px; display: grid; place-items: center; border-radius: var(--r); background: var(--brand-soft); color: var(--brand); font-weight: 700; font-size: 13px; text-transform: uppercase; }
.pj-facts { margin: 0; display: grid; gap: 4px; }
.pj-facts div { display: flex; justify-content: space-between; gap: 12px; font-size: 12.5px; }
.pj-facts dt { color: var(--faint); }
.pj-facts dd { margin: 0; min-width: 0; text-align: right; overflow-wrap: anywhere; }
.pj > .pj-foot { margin-top: auto; padding-top: 8px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.pj-value { font: 600 20px var(--font-head); font-variant-numeric: tabular-nums; }
.stages { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 16px; }
.stage { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--border); color: var(--text); }
.stage:hover { text-decoration: none; border-color: var(--brand); }
.stage.on { border-color: var(--brand); box-shadow: var(--ring); }
.stage span { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.stage b { font: 600 22px var(--font-head); }
.stage small { font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums; }
.stage.s-won b { color: var(--ok); }
.stage.s-lost b { color: var(--bad); }
@media (max-width: 640px) {
    .stages { display: flex; overflow-x: auto; margin: 0 -12px 12px; padding: 0 12px; scrollbar-width: none; }
    .stage { flex: 0 0 132px; }
}

.chat-compose textarea { overflow-y: auto; scrollbar-width: none; line-height: 1.4; }
.chat-compose textarea::placeholder { white-space: nowrap; }

/* =====================================================================================================================================
   Sheet: the default look. A quiet grey desk with the menu on it, and the page as one white sheet with thin lines. No drop shadows,
   no decoration; colour is kept for what can be pressed and what needs attention.
   ===================================================================================================================================== */
[data-skin="sheet"] {
    --bg: #eceef1; --surface: #ffffff; --surface-2: #f4f5f7; --hover: #f8f9fa; --border: #e5e7eb; --border-strong: #d4d8de;
    --text: #16181d; --muted: #565d69; --faint: #858c98; --shadow: none; --font-head: var(--font);
}
:root[data-theme="dark"][data-skin="sheet"] {
    --bg: #0d0e11; --surface: #16181d; --surface-2: #1f2228; --hover: #1b1e24; --border: #282c34; --border-strong: #3a404b;
    --text: #e9ebef; --muted: #a4abb7; --faint: #767e8b; --shadow: none;
}
[data-skin="sheet"] .card, [data-skin="sheet"] .stat, [data-skin="sheet"] .pj, [data-skin="sheet"] .acc-fig, [data-skin="sheet"] .acc-do a, [data-skin="sheet"] .start-tile { border-color: var(--border); box-shadow: none; }
[data-skin="sheet"] a.stat:hover, [data-skin="sheet"] .pj:hover, [data-skin="sheet"] .acc-do a:hover { border-color: var(--border-strong); background: var(--hover); transform: none; }
[data-skin="sheet"] .pj.late { border-color: color-mix(in srgb, var(--bad) 40%, var(--border)); }
[data-skin="sheet"] .page-head h1 { font-size: 22px; font-weight: 650; }
[data-skin="sheet"] .stat .v { font-size: 25px; font-weight: 650; }
[data-skin="sheet"] .btn-primary { box-shadow: none; }
[data-skin="sheet"] .avatar { background: var(--text); color: var(--surface); }
[data-skin="sheet"] th { background: var(--surface-2); font-size: 12px; color: var(--muted); }
[data-skin="sheet"] .dash-tabs { gap: 2px; border-bottom: 1px solid var(--border); flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
[data-skin="sheet"] .dash-tabs > a { background: none; box-shadow: none; border-radius: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; padding: 8px 12px; }
[data-skin="sheet"] .dash-tabs > a.on { background: none; color: var(--text); border-bottom-color: var(--brand); }
[data-skin="sheet"] .dash-tabs > a.dash-custom { border: 0; }
[data-skin="sheet"] .subtabs a.on { color: var(--text); border-bottom-color: var(--brand); }
[data-skin="sheet"] .nav-list > a:hover, [data-skin="sheet"] .nav-group > summary:hover, [data-skin="sheet"] .nav-items a:hover { background: color-mix(in srgb, var(--text) 5%, transparent); }
[data-skin="sheet"] .nav-list > a.active, [data-skin="sheet"] .nav-items a.active { background: var(--surface); color: var(--text); box-shadow: 0 0 0 1px var(--border), 0 1px 2px rgba(16, 24, 40, .06); }
[data-skin="sheet"] .nav a.active .i { color: var(--brand); opacity: 1; }
[data-skin="sheet"] .nav-items { border-left-width: 1px; }
[data-skin="sheet"] .nav-find { background: var(--surface); box-shadow: 0 0 0 1px var(--border); }
[data-skin="sheet"] .auth-brand { background: #14161b; }
[data-skin="sheet"] .glimpses { box-shadow: none; border: 1px solid var(--border); }
[data-skin="sheet"] .glimpses.lg .gl-slide { min-height: 0; padding: 16px 22px 46px; }
[data-skin="sheet"] .glimpses.lg .gl-art { height: 96px; }
[data-skin="sheet"] .glimpses .gl-go { box-shadow: none; }
@media (min-width: 881px) {
    [data-skin="sheet"] .sidebar { background: transparent; border: 0; box-shadow: none; }
    [data-skin="sheet"] .sidebar-brand { border-bottom: 0; }
    [data-skin="sheet"] .main { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); margin: 8px 8px 8px 0; min-height: calc(100vh - 16px); }
    [data-skin="sheet"] .topbar { top: 8px; background: var(--surface); border-bottom: 1px solid var(--border); border-radius: var(--r) var(--r) 0 0; }
    /* hides what scrolls past above the pinned header */
    [data-skin="sheet"] .topbar::before { content: ""; position: absolute; left: -1px; right: -1px; top: -9px; height: calc(9px + var(--r)); background: var(--bg); z-index: -1; }
    [data-skin="sheet"] .content { padding: 20px clamp(16px, 1.8vw, 32px) 40px; }
}
@media (max-width: 880px) { [data-skin="sheet"] body { background: var(--bg); } }
.sample.sheet { background: #eceef1; color: #16181d; }
.sample.sheet .sb i { background: #dde0e6; } .sample.sheet .sb i.on { background: #fff; box-shadow: 0 0 0 1px #d4d8de; }
.sample.sheet .mn { background: #fff; margin: 8px 8px 8px 0; border: 1px solid #e5e7eb; border-radius: var(--r); padding: 10px; }
.sample.sheet .tl b, .sample.sheet .ch { background: #fff; border: 1px solid #e5e7eb; }
.sample.sheet .ch i { background: #1564fe; }

/* =====================================================================================================================================
   Phones, third pass (every look, new screens included): less chrome, and two columns wherever the things are small enough to sit side by side.
   ===================================================================================================================================== */
@media (max-width: 640px) {
    :root { --topbar-h: 52px; }
    .content { padding: 10px 10px 24px; }
    .card { padding: 12px; margin-bottom: 8px; }
    .card.flush { padding: 0; }

    /* the way back sits in the header, in the place of the logo mark, instead of taking a line of its own */
    .trail { margin: 0; overflow: visible; }
    .trail-back { position: fixed; top: calc(env(safe-area-inset-top, 0px) + 8px); left: 8px; z-index: 22; width: 36px; height: 36px; padding: 0; justify-content: center; font-size: 0; }
    .trail-back .i { width: 18px; height: 18px; }
    body:has(.trail-back) .topbar-mark { visibility: hidden; }
    .subtabs, .subtabs-wrap { margin-top: -4px; margin-bottom: 10px; }
    .subtabs-wrap > .subtabs { margin: 0 !important; }
    .page-head { margin-bottom: 10px; }

    .flash { padding: 8px 10px; margin-bottom: 8px; font-size: 13px; }
    .nudge { flex-wrap: nowrap; gap: 8px; }
    .nudge .nudge-text { flex: 1 1 auto; min-width: 0; }
    .nudge .nudge-text span { display: none; }
    .nudge .btn { flex: none; font-size: 0; min-height: 34px; }
    .nudge .btn-primary::after { content: "Finish"; font-size: 12.5px; }
    .nudge .nudge-x::after { content: "Later"; font-size: 12.5px; }

    .toolbar { gap: 6px; margin-bottom: 10px; }
    /* rows that slide sideways run to the edge of the screen, never past it */
    .picks, .stages { gap: 6px; margin: 0 -10px 8px; padding: 0 10px; }
    .subtabs { margin-left: -10px; margin-right: -10px; padding: 0 10px; }
    .page-head .actions .btn:not(.btn-primary) { flex: 0 1 auto; }
    .page-head .actions .btn-ghost { border-color: var(--border); background: var(--surface); }

    /* cards two up */
    .pgrid, .pcards, .notes-grid, .start-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .pj { padding: 10px; gap: 5px; }
    .pcard { padding: 10px; gap: 4px; min-width: 0; }
    .pcard .pc-top { flex-wrap: wrap; gap: 4px; }
    .pcard .pc-top b { flex: 1 1 100%; overflow-wrap: anywhere; }
    .ptile { padding: 10px 12px; }
    .ptile b { font-size: 20px; }
    table.cards td form { display: flex !important; flex-wrap: wrap; gap: 6px; }
    table.cards td form :is(select, input:not([type=hidden]):not([type=checkbox]):not([type=radio])) { flex: 1 1 120px; width: auto; min-width: 0; }
    table.cards td:has(> form) { grid-column: 1 / -1; }
    .pj h2 { font-size: 14px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
    .pj-top { flex-wrap: wrap; gap: 4px 6px; justify-content: flex-start; }
    .pj-top > .pj-client { order: 2; flex: 1 1 100%; font-weight: 500; }
    .pj-top .badge { height: 21px; font-size: 11px; padding: 0 7px; }
    .pj-face { width: 30px; height: 30px; font-size: 11px; }
    .pj-client, .pj-count, .pj-date { font-size: 11.5px; }
    .pj-progress { flex-wrap: wrap; gap: 4px; }
    .pj-bar { flex: 1 1 100%; }
    .pj-count { white-space: normal; }
    .pj-foot { gap: 4px; flex-wrap: wrap; min-height: 0; }
    .pj-date { white-space: normal; }
    .pj-people i { width: 24px; height: 24px; font-size: 9.5px; }
    .pj-facts div { flex-direction: column; gap: 0; font-size: 12px; }
    .pj-facts dt { font-size: 11px; }
    .pj-facts dd { text-align: left; }
    .pj-value { font-size: 16px; }
    .start-tile { padding: 10px; }

    .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 10px; }
    .stats > :last-child:nth-child(odd) { grid-column: 1 / -1; }
    .stat { padding: 10px 12px; }
    .stat .v, [data-skin="sheet"] .stat .v { font-size: 20px; margin-top: 2px; }
    .acc-fig { padding: 10px; }
    .acc-do a { padding: 10px; }
    .acc-do .ico { width: 28px; height: 28px; margin-bottom: 4px; }

    /* short fields share a line, and one left on its own takes the whole line; names, notes and the like keep the full width */
    .grid2 { display: flex; flex-wrap: wrap; gap: 0 10px; }
    .grid2 > * { flex: 1 1 100%; min-width: 0; }
    .grid2 > .field:has(> input[type=date], > input[type=time], > input[type=number], > input[inputmode=decimal], > input[inputmode=numeric], > select):not(:has(> .hint)) { flex: 1 1 calc(50% - 5px); }
    .field { margin-bottom: 10px; }
    .kv { grid-template-columns: minmax(96px, 34%) minmax(0, 1fr); gap: 6px 10px; }

    /* table rows as cards: tighter */
    table.cards tbody { gap: 8px; }
    table.cards tr { gap: 5px 10px; padding: 10px 12px; }
    table.cards td:first-child { font-size: 14px; }
    table.cards td[data-label]::before { margin-bottom: 0; font-size: 11px; font-weight: 500; }
    /* a task needs no field names: a project, a person, a priority, a date and a status explain themselves */
    table.tasklist.cards td[data-label]::before { display: none; }
    table.tasklist.cards tr { position: relative; display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; padding: 10px 12px 10px 42px; }
    table.tasklist.cards td:nth-child(1) { position: absolute; left: 12px; top: 10px; }
    table.tasklist.cards td:nth-child(2) { flex: 1 1 100%; }
    table.tasklist.cards td[colspan] { flex: 1 1 100%; }
    /* long registers (a document and seven or more facts about it): three to a line, the first across */
    table.cards tr:has(> td:nth-child(7)):not(:has([data-bulk-row])) { grid-template-columns: repeat(3, minmax(0, 1fr)); font-size: 13px; }
    .typepick { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -10px 8px; padding: 0 10px; }
    .typepick a { flex: none; }

    .gl-slide, .glimpses.lg .gl-slide { padding: 12px 14px 44px; gap: 2px; }
    .gl-art, .glimpses.lg .gl-art { display: none; }

    .skin-pick { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .skin-opt .meta { padding: 8px 10px; }
    .skin-opt .meta p { display: none; }
    .sample { height: 104px; }

    .fab { bottom: calc(68px + env(safe-area-inset-bottom)); right: 12px; }
    .fab > summary { width: 48px; height: 48px; border-radius: var(--r); }
    .fab-sheet { bottom: 58px; }
}
@media (max-width: 339px) { .pgrid, .pcards, .notes-grid, .start-tiles, .skin-pick { grid-template-columns: minmax(0, 1fr); } }

/* =====================================================================================================================================
   Sheet, open layout: the page is the only container. Parts of it are separated by space and one thin line, never by boxes inside boxes,
   and everything starts on the same left edge (--gx). Tables and lists run to the edges of the sheet.
   ===================================================================================================================================== */
[data-skin="sheet"] { --gx: clamp(16px, 2vw, 32px); }
[data-skin="sheet"] .content { padding: 14px var(--gx) 40px; }

/* sections */
[data-skin="sheet"] .content .card { background: transparent; border: 0; border-bottom: 1px solid var(--border); border-radius: 0; box-shadow: none; padding: 18px 0; margin: 0; }
[data-skin="sheet"] .content .card:last-child { border-bottom: 0; }
[data-skin="sheet"] .content .card .card { padding: 12px 0; }
[data-skin="sheet"] .content .card.flush, [data-skin="sheet"] .content .card.edge { padding: 0; }
[data-skin="sheet"] .content > :is(.card.flush, .card.edge), [data-skin="sheet"] .content > form > :is(.card.flush, .card.edge) { margin: 0 calc(-1 * var(--gx)); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
[data-skin="sheet"] .content > :is(.card.flush, .card.edge) :is(th, td):first-child, [data-skin="sheet"] .content > form > :is(.card.flush, .card.edge) :is(th, td):first-child { padding-left: var(--gx); }
[data-skin="sheet"] .content > :is(.card.flush, .card.edge) :is(th, td):last-child, [data-skin="sheet"] .content > form > :is(.card.flush, .card.edge) :is(th, td):last-child { padding-right: var(--gx); }
[data-skin="sheet"] .content > .card.flush > .card-head.pad { padding: 16px var(--gx) 0; }
[data-skin="sheet"] .content > .card.flush > .empty { padding-left: var(--gx); padding-right: var(--gx); }
[data-skin="sheet"] .content .report th { background: var(--surface-2); border-bottom: 1px solid var(--border); }

/* number strips: one line of figures divided by rules */
[data-skin="sheet"] .content :is(.stats, .acc-figs, .ptiles, .stages) { gap: 0; margin: 0 calc(-1 * var(--gx)) 4px; padding: 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); overflow: hidden; }
[data-skin="sheet"] .content :is(.stat, .acc-fig, .ptile, .stage) { background: transparent; border: 0; border-radius: 0; box-shadow: 1px 0 0 var(--border), 0 1px 0 var(--border); padding: 14px var(--gx); margin: 0; }
[data-skin="sheet"] .content .stage.on { background: var(--surface-2); box-shadow: inset 0 -2px 0 var(--brand), 1px 0 0 var(--border); }
[data-skin="sheet"] .content .stat .ico { display: none; }
[data-skin="sheet"] .content .stat .v { margin-top: 4px; }
[data-skin="sheet"] .content a:is(.stat, .acc-fig, .stage):hover { background: var(--hover); }
[data-skin="sheet"] .content .dash .wg > .stat { padding: 14px 0; box-shadow: none; border-top: 1px solid var(--border); }

/* things people browse: a ruled grid, not separate boxes */
[data-skin="sheet"] .content :is(.pgrid, .pcards) { gap: 0; margin: 0 calc(-1 * var(--gx)); border-top: 1px solid var(--border); overflow: hidden; }
[data-skin="sheet"] .content :is(.pj, .pcard) { background: transparent; border: 0; border-radius: 0; box-shadow: 1px 0 0 var(--border), 0 1px 0 var(--border); padding: 16px var(--gx); }
[data-skin="sheet"] .content :is(.pj, a.pcard):hover { background: var(--hover); transform: none; }
[data-skin="sheet"] .content .pj.late { box-shadow: 1px 0 0 var(--border), 0 1px 0 var(--border), inset 3px 0 0 var(--bad); }
[data-skin="sheet"] .content .pj > .pj-foot { border-top: 0; }
[data-skin="sheet"] .content .card .pcards { margin: 0; }
[data-skin="sheet"] .content .card .pcard { padding: 12px 16px 12px 0; }
[data-skin="sheet"] .content .card .pcard:not(:first-child) { padding-left: 16px; }

/* dashboards: panels share the page, a rule above each */
[data-skin="sheet"] .content .dash { column-gap: calc(var(--gx) * 1.25); row-gap: 0; }
[data-skin="sheet"] .content .dash .wg > .card { border: 0; border-top: 1px solid var(--border); padding: 16px 0 20px; }
[data-skin="sheet"] .content .dash.editing .wg > .card { padding: 44px 10px 12px; }
[data-skin="sheet"] .content .prio { background: transparent; border: 0; border-radius: 0; box-shadow: none; padding: 12px 0 4px; margin: 0; }
[data-skin="sheet"] .content .prio li a { padding: 10px 0; border-radius: 0; }
[data-skin="sheet"] .content .start-tile { border: 0; border-top: 1px solid var(--border); border-radius: 0; padding: 12px 0; background: transparent; }

/* accounts: a list of things to do and a list of reports */
[data-skin="sheet"] .content .acc-figs { margin-bottom: 18px; }
[data-skin="sheet"] .content .acc-do { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 0 28px; }
[data-skin="sheet"] .content .acc-do a { display: grid; grid-template-columns: 36px minmax(0, 1fr); column-gap: 12px; align-content: center; padding: 11px 0; border: 0; border-bottom: 1px solid var(--border); border-radius: 0; background: transparent; box-shadow: none; }
[data-skin="sheet"] .content .acc-do .ico { grid-row: span 2; width: 36px; height: 36px; margin: 0; align-self: center; }
[data-skin="sheet"] .content .acc-do kbd { right: 0; }
[data-skin="sheet"] .content .acc-do a:hover b { color: var(--brand); }
[data-skin="sheet"] .content .acc-reports { column-gap: 28px; }
[data-skin="sheet"] .content .acc-reports .card { border: 0; padding: 0 0 14px; }
[data-skin="sheet"] .content .acc-reports h3 { font-size: 13px; font-weight: 600; color: var(--text); padding-bottom: 6px; border-bottom: 2px solid var(--text); margin: 0; }

/* one left edge: tabs, headings, filters and content line up */
[data-skin="sheet"] .content :is(.subtabs, .dash-tabs) { margin-left: calc(-1 * var(--gx)); margin-right: calc(-1 * var(--gx)); padding-left: var(--gx); padding-right: var(--gx); gap: 22px; }
[data-skin="sheet"] .content :is(.subtabs > a, .dash-tabs > a) { padding-left: 0; padding-right: 0; }
[data-skin="sheet"] .content .subtabs-wrap { margin-left: calc(-1 * var(--gx)); margin-right: calc(-1 * var(--gx)); }
[data-skin="sheet"] .content .subtabs-wrap > .subtabs { margin: 0 !important; }
[data-skin="sheet"] .content .page-head { align-items: center; margin-bottom: 14px; }

@media (max-width: 640px) {
    [data-skin="sheet"] { --gx: 14px; --bg: var(--surface); }
    [data-skin="sheet"] .content { padding: 8px var(--gx) 24px; }
    [data-skin="sheet"] .content .card { padding: 14px 0; }
    [data-skin="sheet"] .content .card.flush, [data-skin="sheet"] .content .card.edge { padding: 0; }
    [data-skin="sheet"] .content :is(.stat, .acc-fig, .ptile, .stage, .pj) { padding: 11px var(--gx); }
    [data-skin="sheet"] .content :is(.picks, .typepick) { margin-left: calc(-1 * var(--gx)); margin-right: calc(-1 * var(--gx)); padding: 0 var(--gx); }
    [data-skin="sheet"] .content .stages { display: flex; overflow-x: auto; }
    [data-skin="sheet"] .content :is(.subtabs, .dash-tabs) { gap: 18px; }
    /* table rows become a list, one rule between entries */
    [data-skin="sheet"] .content table.cards tbody { gap: 0; }
    [data-skin="sheet"] .content table.cards tr { border: 0; border-bottom: 1px solid var(--border); border-radius: 0; background: transparent; padding-left: 0; padding-right: 0; }
    [data-skin="sheet"] .content > :is(.card.flush, .card.edge) table.cards tr, [data-skin="sheet"] .content > form > :is(.card.flush, .card.edge) table.cards tr { padding-left: var(--gx); padding-right: var(--gx); }
    [data-skin="sheet"] .content table.cards td:first-child { padding-left: 0; }
    [data-skin="sheet"] .content table.cards td:last-child { padding-right: 0; }
    [data-skin="sheet"] .content > :is(.card.flush, .card.edge) table.tasklist.cards tr, [data-skin="sheet"] .content > form > :is(.card.flush, .card.edge) table.tasklist.cards tr { padding-left: calc(var(--gx) + 30px); }
    [data-skin="sheet"] .content > :is(.card.flush, .card.edge) table.tasklist.cards td:nth-child(1), [data-skin="sheet"] .content > form > :is(.card.flush, .card.edge) table.tasklist.cards td:nth-child(1) { left: var(--gx); }
    [data-skin="sheet"] .content > :is(.card.flush, .card.edge):has(table.cards), [data-skin="sheet"] .content > form > :is(.card.flush, .card.edge):has(table.cards) { border-bottom: 0; }
    [data-skin="sheet"] .content .acc-do { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
    [data-skin="sheet"] .content .acc-do a { grid-template-columns: 30px minmax(0, 1fr); column-gap: 8px; }
    [data-skin="sheet"] .content .acc-do .ico { width: 30px; height: 30px; }
    [data-skin="sheet"] .content .acc-do small { font-size: 11.5px; }
    [data-skin="sheet"] .content .acc-do kbd { display: none; }
}
[data-skin="sheet"] .content .dash .wg > .card.flush > .card-head.pad { padding: 0; }
[data-skin="sheet"] .content .dash .wg > .card.flush :is(th, td):first-child { padding-left: 0; }
[data-skin="sheet"] .content .dash .wg > .card.flush :is(th, td):last-child { padding-right: 0; }
@media (max-width: 640px) {
    /* inside a stacked row the row sets the edge, so its cells add none of their own */
    [data-skin="sheet"] .content table.cards tbody tr > td { padding-left: 0 !important; padding-right: 0 !important; }
}
