/* Tech Teki Client Portal: the architect's white model.
   Foam-board planes on a cool table; the accent (Tech Teki blue or logo red) is the only "built" colour. */

@font-face { font-family: "Hanken Grotesk"; src: url("../fonts/HankenGrotesk-Variable.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Spline Sans Mono"; src: url("../fonts/SplineSansMono-Variable.woff2") format("woff2"); font-weight: 300 700; font-display: swap; }

:root {
	--ground: #eceef2;
	--ground-2: #e4e7ec;
	--plane: #ffffff;
	--plane-2: #f6f7f9;
	--plane-3: #eff1f4;
	--ink: #11151b;
	--ink-2: #343c48;
	--muted: #5c6674;
	--faint: #8a93a0;
	--line: #e1e4e9;
	--line-2: #cfd4db;
	--plate: #11151b;
	--plate-ink: #f4f6f8;
	--plate-muted: #aab2bd;

	--shadow-1: 0 1px 1px rgba(17, 21, 27, .04), 0 1px 3px rgba(17, 21, 27, .06);
	--shadow-2: 0 1px 2px rgba(17, 21, 27, .05), 0 10px 24px -10px rgba(17, 21, 27, .16);
	--shadow-3: 0 2px 6px rgba(17, 21, 27, .06), 0 28px 56px -18px rgba(17, 21, 27, .28);

	--ok: #18794e; --ok-soft: #e3f4ea;
	--warn: #975a00; --warn-soft: #fdf0d9;
	--crit: #b42318; --crit-soft: #fdebe9;
	--info: #44505e; --info-soft: #eef0f3;

	--font: "Hanken Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
	--mono: "Spline Sans Mono", ui-monospace, "SF Mono", Menlo, monospace;
	--r-1: 6px; --r-2: 10px; --r-3: 14px;
	--rail: 252px;
	--ease-out: cubic-bezier(.16, 1, .3, 1);
	color-scheme: light;
}

/* Accent: Tech Teki blue (default) */
:root, [data-accent="blue"] {
	--accent: #1b84ff;
	--accent-strong: #0b67d6;
	--accent-ink: #0a5fc4;
	--accent-soft: #e7f1ff;
	--accent-line: #b8d6fd;
	--accent-on: #ffffff;
}
/* Accent: Tech Teki red, sampled from the logo */
[data-accent="red"] {
	--accent: #bf2a2e;
	--accent-strong: #bf2a2e;
	--accent-ink: #a52226;
	--accent-soft: #fbecec;
	--accent-line: #efc3c4;
	--accent-on: #ffffff;
}

/* More accents. Each pair was contrast-checked: button text and link text at least 4.5:1 in both modes.
   Yellow is the one accent that takes dark text on its fills. */
[data-accent="yellow"] { --accent: #f2b200; --accent-strong: #f2b200; --accent-ink: #7a5800; --accent-soft: #fff6d6; --accent-line: #f0d98a; --accent-on: #1f1700; }
[data-accent="orange"] { --accent: #f97316; --accent-strong: #c2410c; --accent-ink: #b93d0b; --accent-soft: #fff1e6; --accent-line: #fbcfa9; --accent-on: #ffffff; }
[data-accent="purple"] { --accent: #8b5cf6; --accent-strong: #6d28d9; --accent-ink: #6d28d9; --accent-soft: #f1ebff; --accent-line: #d6c7fd; --accent-on: #ffffff; }
[data-accent="green"]  { --accent: #16a34a; --accent-strong: #15803d; --accent-ink: #15803d; --accent-soft: #e7f7ed; --accent-line: #b5e2c4; --accent-on: #ffffff; }
[data-accent="pink"]   { --accent: #ec4899; --accent-strong: #be185d; --accent-ink: #be185d; --accent-soft: #fdeaf3; --accent-line: #f7bfd9; --accent-on: #ffffff; }

/* Dark: the same model under a night work lamp. JS sets .dark from the user's choice or the OS setting. */
:root.dark {
	--ground: #0b0e12;
	--ground-2: #10141a;
	--plane: #151a21;
	--plane-2: #1a2028;
	--plane-3: #202731;
	--ink: #e9edf2;
	--ink-2: #c4cbd5;
	--muted: #97a1ae;
	--faint: #6c7684;
	--line: #242b35;
	--line-2: #313946;
	--plate: #f1f3f6;
	--plate-ink: #11151b;
	--plate-muted: #535d6a;
	--shadow-1: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 1px 2px rgba(0, 0, 0, .4);
	--shadow-2: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 12px 28px -12px rgba(0, 0, 0, .7);
	--shadow-3: 0 1px 0 rgba(255, 255, 255, .05) inset, 0 30px 60px -20px rgba(0, 0, 0, .85);
	--ok: #4ccf8f; --ok-soft: rgba(76, 207, 143, .12);
	--warn: #f2b54d; --warn-soft: rgba(242, 181, 77, .13);
	--crit: #ff8070; --crit-soft: rgba(255, 128, 112, .13);
	--info: #a7b1bf; --info-soft: rgba(167, 177, 191, .1);
	color-scheme: dark;
}
:root.dark[data-accent="blue"] {
	--accent: #3d95ff; --accent-strong: #1f74e6; --accent-ink: #78b4ff; --accent-soft: rgba(61, 149, 255, .14); --accent-line: rgba(61, 149, 255, .38);
}
:root.dark[data-accent="red"] {
	--accent: #e4484d; --accent-strong: #c93439; --accent-ink: #ff8a8d; --accent-soft: rgba(228, 72, 77, .15); --accent-line: rgba(228, 72, 77, .4);
}

:root.dark[data-accent="yellow"] { --accent: #ffc933; --accent-strong: #ffc933; --accent-ink: #ffd666; --accent-soft: rgba(255, 201, 51, .14); --accent-line: rgba(255, 201, 51, .4); --accent-on: #1f1700; }
:root.dark[data-accent="orange"] { --accent: #fb8a3c; --accent-strong: #c2410c; --accent-ink: #ffa766; --accent-soft: rgba(251, 138, 60, .15); --accent-line: rgba(251, 138, 60, .4); }
:root.dark[data-accent="purple"] { --accent: #a78bfa; --accent-strong: #7c3aed; --accent-ink: #c4b5fd; --accent-soft: rgba(167, 139, 250, .16); --accent-line: rgba(167, 139, 250, .42); }
:root.dark[data-accent="green"]  { --accent: #34c06a; --accent-strong: #15803d; --accent-ink: #6ee79b; --accent-soft: rgba(52, 192, 106, .14); --accent-line: rgba(52, 192, 106, .4); }
:root.dark[data-accent="pink"]   { --accent: #f472b6; --accent-strong: #be185d; --accent-ink: #f9a8d4; --accent-soft: rgba(244, 114, 182, .15); --accent-line: rgba(244, 114, 182, .4); }

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body.tt-body { margin: 0; background: var(--ground); color: var(--ink); font: 400 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
::selection { background: var(--accent); color: var(--accent-on); }
input, textarea { caret-color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent-ink); text-underline-offset: 3px; text-decoration-thickness: 1px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.015em; color: var(--ink); text-wrap: balance; }
p { margin: 0; }
.num, .mono { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: .92em; letter-spacing: -.01em; }
.tnum { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -48px; z-index: 100; background: var(--plate); color: var(--plate-ink); padding: 8px 12px; border-radius: var(--r-1); }
.skip:focus { top: 12px; }
#main:focus { outline: none; }
* { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 10px; border: 3px solid var(--ground); }
.boot { min-height: 100vh; display: grid; place-items: center; }
.boot img { animation: boot 1.2s ease-in-out infinite alternate; }
@keyframes boot { from { opacity: .35; } to { opacity: 1; } }
.noscript { padding: 40px; text-align: center; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); min-height: 100vh; }
.rail { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 20px 14px 16px; gap: 6px; overflow-y: auto; }
.rail-brand { display: flex; align-items: center; padding: 4px 10px 22px; }
.rail-brand img { height: 34px; width: auto; }
.rail-brand .logo-dark { display: none; }
.dark .rail-brand .logo-light { display: none; }
.dark .rail-brand .logo-dark { display: block; }
.nav-group { display: grid; gap: 1px; }
.nav-label { font-size: 11.5px; font-weight: 550; color: var(--faint); padding: 14px 12px 6px; }
.nav a { display: flex; align-items: center; gap: 11px; height: 36px; padding: 0 10px; border-radius: 8px; color: var(--ink-2); text-decoration: none; font-weight: 500; position: relative; transition: background .2s, color .2s, box-shadow .2s; }
.nav a svg { width: 17px; height: 17px; flex: none; color: var(--muted); transition: color .2s; }
.nav a:hover { background: var(--ground-2); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--plane); color: var(--ink); box-shadow: var(--shadow-1); }
.nav a[aria-current="page"] svg { color: var(--accent); }
.nav .count { margin-left: auto; font: 500 11.5px var(--mono); color: var(--muted); }
.nav .count.hot { color: var(--accent-ink); }
/* Blue dot for something new (Sales). Always blue, whatever the accent, so it reads as "new" and not as a brand colour. */
.new-dot { --new: #1b84ff; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--new); flex: none; }
.dark .new-dot { --new: #3d95ff; }
.nav .new-dot { margin-left: auto; }
.segmented .seg-link .new-dot { margin-left: 7px; }
.sales-tabs { margin: -6px 0 16px; }
.rail-spacer { flex: 1; min-height: 16px; }
.rail-org { display: flex; gap: 10px; align-items: center; padding: 10px; border-radius: 10px; background: var(--plane-2); border: 1px solid var(--line); }
.rail-org .org-cube { width: 30px; height: 30px; flex: none; }
.rail-org strong { display: block; font-size: 13px; font-weight: 600; line-height: 1.25; }
.rail-org small { color: var(--muted); font-size: 12px; }
.rail-tag { font-size: 11.5px; color: var(--faint); padding: 12px 10px 0; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; height: 60px; display: flex; align-items: center; gap: 12px; padding: 0 28px; background: color-mix(in srgb, var(--ground) 86%, transparent); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid transparent; transition: border-color .2s; }
.topbar.scrolled { border-bottom-color: var(--line); }
.crumbs { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; min-width: 0; }
.crumbs b { color: var(--ink); font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
/* Desktop: the menu button folds the sidebar away; on phones it opens the sidebar as a drawer. */
.shell { transition: grid-template-columns .3s var(--ease-out); }
/* The TT mark replaces the wordmark when the sidebar is folded down to icons. */
.rail-brand .mark-light, .rail-brand .mark-dark { display: none; }
@media (min-width: 961px) {
	.shell.rail-collapsed { grid-template-columns: 68px minmax(0, 1fr); }
	.shell.rail-collapsed .rail { padding: 20px 10px 16px; overflow-x: hidden; align-items: stretch; }
	.shell.rail-collapsed .rail-brand { justify-content: center; padding: 0 0 18px; }
	.shell.rail-collapsed .rail-brand .logo-light, .shell.rail-collapsed .rail-brand .logo-dark { display: none; }
	.shell.rail-collapsed .rail-brand .mark-light { display: block; width: 34px; height: 34px; }
	.dark .shell.rail-collapsed .rail-brand .mark-light { display: none; }
	.dark .shell.rail-collapsed .rail-brand .mark-dark { display: block; width: 34px; height: 34px; }
	.shell.rail-collapsed .nav-label { height: 1px; padding: 0; margin: 10px 8px; background: var(--line); overflow: hidden; color: transparent; }
	.shell.rail-collapsed .nav a { justify-content: center; padding: 0; height: 40px; }
	.shell.rail-collapsed .nav a svg { width: 19px; height: 19px; }
	/* Labels stay readable by screen readers; the link's title shows them on hover. */
	.shell.rail-collapsed .nav-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
	.shell.rail-collapsed .nav .count { position: absolute; top: 3px; right: 3px; margin: 0; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--accent); color: var(--accent-on, #fff); font-size: 10px; line-height: 16px; text-align: center; }
	.shell.rail-collapsed .nav .count.hot { font-size: 0; min-width: 8px; width: 8px; height: 8px; padding: 0; top: 7px; right: 9px; }
	.shell.rail-collapsed .nav .new-dot { position: absolute; top: 7px; right: 9px; margin: 0; }
	.shell.rail-collapsed .rail-org { justify-content: center; padding: 8px 0; }
	.shell.rail-collapsed .rail-org > div, .shell.rail-collapsed .rail-tag { display: none; }
}
@media (prefers-reduced-motion: reduce) { .shell { transition: none; } }
.content { padding: 8px 28px 48px; width: 100%; max-width: 1360px; }
.foot { margin-top: auto; padding: 20px 28px 28px; color: var(--faint); font-size: 12px; display: flex; gap: 16px; flex-wrap: wrap; justify-content: space-between; max-width: 1360px; }

/* ---------- page head ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; padding: 18px 0 22px; }
.page-head h1 { font-size: 28px; line-height: 1.15; letter-spacing: -.025em; }
.page-head p { color: var(--muted); margin-top: 6px; max-width: 64ch; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--plane); color: var(--ink); font-weight: 550; font-size: 13.5px; white-space: nowrap; text-decoration: none; box-shadow: var(--shadow-1); transition: background .15s, border-color .15s, transform .15s, box-shadow .2s; }
.btn:hover { border-color: var(--faint); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 16px; height: 16px; }
.btn.primary { background: var(--accent-strong); border-color: var(--accent-strong); color: var(--accent-on); box-shadow: 0 1px 2px rgba(0, 0, 0, .12), inset 0 1px 0 rgba(255, 255, 255, .14); }
.btn.primary:hover { background: color-mix(in srgb, var(--accent-strong) 88%, #000); }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--ink-2); }
.btn.ghost:hover { background: var(--ground-2); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12.5px; }
.btn.icon { width: 36px; padding: 0; }
.btn.danger { color: var(--crit); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; transform: none; }
.btn .spin { width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.link-btn { background: none; border: 0; padding: 0; color: var(--accent-ink); font-weight: 550; display: inline-flex; gap: 6px; align-items: center; }
.link-btn:hover { text-decoration: underline; }

.field { display: grid; gap: 6px; }
.field > label, .field > .label { font-size: 13px; font-weight: 550; color: var(--ink-2); }
.field .hint { font-size: 12.5px; color: var(--muted); }
.input, select.input, textarea.input { width: 100%; height: 38px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--plane); color: var(--ink); transition: border-color .15s, box-shadow .15s; }
textarea.input { height: auto; min-height: 104px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
select.input { appearance: none; padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%238a93a0' stroke-width='1.6' viewBox='0 0 12 12'%3E%3Cpath d='m3 4.5 3 3 3-3'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
.input::placeholder { color: var(--faint); }
.input:hover { border-color: var(--faint); }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input[aria-invalid="true"] { border-color: var(--crit); }
.input:disabled { background: var(--plane-2); color: var(--muted); }
.search { position: relative; }
.search svg { position: absolute; left: 11px; top: 50%; width: 15px; height: 15px; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.search .input { padding-left: 34px; min-width: 240px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
.form-error { color: var(--crit); font-size: 13px; display: flex; gap: 8px; align-items: flex-start; }

.switch { position: relative; display: inline-flex; flex: none; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.switch span { width: 36px; height: 21px; border-radius: 21px; background: var(--line-2); transition: background .2s; position: relative; }
.switch span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 17px; height: 17px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: transform .25s var(--ease-out); }
.switch input:checked + span { background: var(--accent-strong); }
.switch input:checked + span::after { transform: translateX(15px); }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch input:disabled { cursor: not-allowed; }
.switch input:disabled + span { opacity: .45; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; color: var(--ink-2); }
.check input { width: 16px; height: 16px; margin: 2px 0 0; accent-color: var(--accent-strong); flex: none; }

.segmented { display: inline-flex; padding: 3px; background: var(--ground-2); border-radius: 9px; gap: 2px; }
.segmented button { border: 0; background: transparent; height: 30px; padding: 0 12px; border-radius: 7px; font-size: 13px; font-weight: 550; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.segmented button[aria-pressed="true"] { background: var(--plane); color: var(--ink); box-shadow: var(--shadow-1); }
.segmented .n { font: 500 11.5px var(--mono); color: var(--faint); }

/* ---------- planes (surfaces) ---------- */
.plane { background: var(--plane); border: 1px solid var(--line); border-radius: var(--r-2); box-shadow: var(--shadow-1); }
.plane.pad { padding: 20px; }
.plane-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 20px; flex-wrap: wrap; }
.plane-head h2 { font-size: 15px; }
.plane-head p { color: var(--muted); font-size: 13px; margin-top: 2px; }
.section-title { font-size: 15px; font-weight: 600; }
.stack { display: grid; gap: 20px; }
.row { display: flex; gap: 12px; align-items: center; }
.row.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.grid-main { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 20px; align-items: start; }

/* ---------- status ---------- */
.status { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 550; color: var(--ink-2); white-space: nowrap; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--faint); flex: none; }
.status.ok::before { background: var(--ok); }
.status.warn::before { background: var(--warn); }
.status.crit::before { background: var(--crit); }
.status.accent::before { background: var(--accent); }
.status.ring::before { background: transparent; box-shadow: inset 0 0 0 2px var(--accent); }
.status.hollow::before { background: transparent; box-shadow: inset 0 0 0 1.5px var(--faint); }
.tag { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 12px; font-weight: 550; background: var(--plane-3); color: var(--ink-2); white-space: nowrap; }
.tag.accent { background: var(--accent-soft); color: var(--accent-ink); }
.tag.ok { background: var(--ok-soft); color: var(--ok); }
.tag.warn { background: var(--warn-soft); color: var(--warn); }
.tag.crit { background: var(--crit-soft); color: var(--crit); }
.tag.outline { background: transparent; box-shadow: inset 0 0 0 1px var(--line-2); color: var(--muted); }
/* Stamped states: revoked and expired items stay visible, struck through, never deleted. */
.stamped { text-decoration: line-through; text-decoration-color: var(--faint); color: var(--muted); }
.stamp { display: inline-flex; height: 20px; padding: 0 7px; align-items: center; border-radius: 4px; font: 600 11px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--crit); box-shadow: inset 0 0 0 1.5px currentColor; transform: rotate(-2deg); opacity: .85; }
.stamp.muted { color: var(--faint); }

/* Priority: fixed dot-size ramp */
.prio { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); }
.prio i { display: inline-block; border-radius: 50%; background: var(--ink-2); flex: none; }
.prio[data-p="Low"] i { width: 5px; height: 5px; background: var(--faint); }
.prio[data-p="Normal"] i { width: 7px; height: 7px; }
.prio[data-p="High"] i { width: 9px; height: 9px; background: var(--warn); }
.prio[data-p="Urgent"] i { width: 11px; height: 11px; background: var(--crit); box-shadow: 0 0 0 3px var(--crit-soft); }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table.data tr[hidden] { display: none !important; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--line); font-size: 13px; flex-wrap: wrap; }
.pager-pages { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.pager-pages .btn.sm { min-width: 30px; }
.pager-gap { padding: 0 4px; color: var(--muted); }
.pager-size { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; }
.pager-size select.input { height: 30px; width: auto; padding: 0 30px 0 10px; font-size: 12.5px; background-position: right 10px center; }
@media (max-width: 640px) {
	.pager { justify-content: center; padding: 12px 16px; }
	.pager > .muted { flex-basis: 100%; text-align: center; }
	.pager-size { margin-left: 0; }
	.pager-pages { gap: 8px; }
	.pager-pages .pager-gap, .pager-pages .btn[data-page]:not([aria-label$="ous page"]):not([aria-label="Next page"]) { display: none; }
}
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data th { text-align: left; font-size: 12px; font-weight: 550; color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--plane-2); white-space: nowrap; }
table.data th:first-child { padding-left: 20px; }
table.data td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data td:first-child { padding-left: 20px; }
table.data td:last-child, table.data th:last-child { padding-right: 20px; }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr { transition: background .15s; }
table.data tbody tr.clickable { cursor: pointer; }
table.data tbody tr.clickable:hover { background: var(--plane-2); }
table.data td.right, table.data th.right { text-align: right; }
.cell-title { font-weight: 550; color: var(--ink); }
.cell-sub { color: var(--muted); font-size: 12.5px; margin-top: 1px; }
/* Changed since you last looked: holds until the ticket is opened. */
tr.changed { background: var(--accent-soft); }
tr.changed:hover { background: color-mix(in srgb, var(--accent-soft) 70%, var(--plane-2)) !important; }
.changed-dot { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; color: var(--accent-ink); }
.changed-dot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 5px transparent; } }
.person { display: flex; gap: 11px; align-items: center; min-width: 0; }
.avatar { width: 32px; height: 32px; border-radius: 50%; flex: none; display: grid; place-items: center; font-size: 12px; font-weight: 600; background: var(--plane-3); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line); }
.avatar.accent { background: var(--accent-soft); color: var(--accent-ink); box-shadow: inset 0 0 0 1px var(--accent-line); }
.empty { padding: 40px 20px; text-align: center; color: var(--muted); display: grid; gap: 8px; justify-items: center; }
.empty strong { color: var(--ink); font-weight: 600; }
.empty svg { width: 28px; height: 28px; color: var(--faint); }

/* ---------- dashboard ---------- */
.dash-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 20px; align-items: stretch; margin-bottom: 20px; }
.welcome { display: flex; flex-direction: column; gap: 22px; padding: 26px; }
.welcome h1 { font-size: 30px; letter-spacing: -.03em; line-height: 1.1; }
.welcome .sub { color: var(--muted); margin-top: 8px; }
/* The one reversed plate per screen: what to do next. */
.next-plate { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; padding: 16px 18px; border-radius: 10px; background: var(--plate); color: var(--plate-ink); border: 0; box-shadow: var(--shadow-2); transition: transform .25s var(--ease-out), box-shadow .25s; }
.next-plate:hover { transform: translateY(-2px); box-shadow: var(--shadow-3); }
.next-plate small { display: block; color: var(--plate-muted); font-size: 12px; margin-bottom: 2px; }
.next-plate strong { font-weight: 550; font-size: 14.5px; }
.next-plate .go { margin-left: auto; width: 32px; height: 32px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--accent-on); }
.next-plate .go svg { width: 16px; height: 16px; }
.counts { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); margin: auto -26px -26px; }
.counts > a, .counts > div { padding: 16px 26px; text-decoration: none; color: inherit; border-right: 1px solid var(--line); display: block; transition: background .15s; }
.counts > :last-child { border-right: 0; }
.counts > a:hover { background: var(--plane-2); }
.counts .v { font: 500 26px/1 var(--font); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.counts .l { color: var(--muted); font-size: 12.5px; margin-top: 7px; }
.counts .l b { color: var(--accent-ink); font-weight: 600; }

/* ---------- the service model (signature) ---------- */
.model-plane { position: relative; overflow: hidden; min-height: 360px; height: 100%; display: flex; flex-direction: column; background: radial-gradient(120% 90% at 50% 100%, var(--plane-2), var(--plane) 70%); }
.dark .model-plane { background: radial-gradient(120% 90% at 50% 105%, var(--plane-3), var(--plane) 70%); }
.model-head { position: absolute; left: 20px; top: 16px; right: 20px; z-index: 2; display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; pointer-events: none; }
.model-head h2 { font-size: 15px; }
.model-head p { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.model-head a { pointer-events: auto; }
.model-canvas { position: absolute; inset: 0; }
.model-canvas canvas { display: block; width: 100%; height: 100%; outline: none; }
.model-legend { position: absolute; left: 20px; bottom: 14px; z-index: 2; display: flex; gap: 14px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.model-legend span { display: inline-flex; gap: 6px; align-items: center; }
.model-legend i { width: 10px; height: 10px; border-radius: 2px; }
.model-legend .k-current { background: var(--accent); }
.model-legend .k-rec { box-shadow: inset 0 0 0 1.5px var(--accent); }
.model-legend .k-avail { background: var(--plane-3); box-shadow: inset 0 0 0 1px var(--line-2); }
.model-tip { position: absolute; z-index: 3; pointer-events: none; padding: 8px 11px; border-radius: 8px; background: var(--plate); color: var(--plate-ink); font-size: 12.5px; box-shadow: var(--shadow-3); opacity: 0; transform: translate(-50%, calc(-100% - 14px)) scale(.96); transition: opacity .15s, transform .2s var(--ease-out); white-space: nowrap; }
.model-tip.on { opacity: 1; transform: translate(-50%, calc(-100% - 14px)) scale(1); }
.model-tip small { display: block; color: var(--plate-muted); font-size: 11.5px; }
.model-fallback { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; padding: 72px 20px 52px; position: relative; z-index: 1; }
.model-fallback button { text-align: left; border-radius: 8px; padding: 10px; font-size: 12.5px; border: 1px solid var(--line-2); background: var(--plane); }
.model-fallback button.current { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-ink); }
.model-fallback button.recommended { border-style: dashed; border-color: var(--accent); }

/* activity list */
.activity { display: grid; }
.activity button { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px 20px; border: 0; border-top: 1px solid var(--line); background: none; text-align: left; transition: background .15s; }
.activity button:hover { background: var(--plane-2); }
.activity button.changed { background: var(--accent-soft); }
.activity .id { font: 500 12.5px var(--mono); color: var(--muted); min-width: 46px; }

/* project dimension line (progress drawn like a measured drawing) */
.dim { position: relative; margin: 26px 4px 4px; height: 44px; }
.dim-track { position: absolute; left: 0; right: 0; top: 10px; height: 1px; background: var(--line-2); }
.dim-fill { position: absolute; left: 0; top: 9px; height: 3px; border-radius: 3px; background: var(--accent); width: 0; }
.dim-tick { position: absolute; top: 4px; width: 1px; height: 13px; background: var(--line-2); }
.dim-tick.done { background: var(--accent); }
.dim-tick.current::after { content: ""; position: absolute; left: -5px; top: 1px; width: 11px; height: 11px; border-radius: 50%; background: var(--plane); box-shadow: inset 0 0 0 2.5px var(--accent), 0 0 0 4px var(--accent-soft); }
.dim-label { position: absolute; top: 22px; transform: translateX(-50%); font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.dim-label.current { color: var(--ink); font-weight: 600; }
.dim-label.first { transform: none; }
.dim-label.last { transform: translateX(-100%); }
.dim-end { position: absolute; top: 0; width: 1px; height: 21px; background: var(--ink-2); }
.proj { padding: 18px 20px 16px; border-top: 1px solid var(--line); }
.proj:first-of-type { border-top: 0; }
.proj-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.proj-top h3 { font-size: 14.5px; font-weight: 600; }
.proj-top p { color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.proj-pct { font: 500 22px/1 var(--font); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.proj-pct small { font-size: 13px; color: var(--muted); }

/* ---------- services catalog ---------- */
.svc-hero { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); min-height: 380px; margin-bottom: 20px; overflow: hidden; }
.svc-hero .copy { padding: 30px; display: flex; flex-direction: column; gap: 14px; justify-content: center; position: relative; z-index: 2; }
.svc-hero h2 { font-size: 26px; letter-spacing: -.025em; line-height: 1.15; }
.svc-hero p { color: var(--muted); max-width: 46ch; }
.svc-hero .model-plane { border: 0; border-left: 1px solid var(--line); border-radius: 0; box-shadow: none; min-height: 380px; }
.svc-tools { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: center; margin: 4px 0 14px; }
/* Each card draws its right and bottom rule inside its own box; the grid overhangs the frame by 1px so the
   outermost rules are clipped and the frame's border shows instead. Empty trailing space stays clean. */
.svc-frame { background: var(--plane); border: 1px solid var(--line); border-radius: var(--r-2); overflow: hidden; box-shadow: var(--shadow-1); }
.svc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); margin: 0 -1px -1px 0; }
.svc { background: var(--plane); box-shadow: inset -1px 0 0 var(--line), inset 0 -1px 0 var(--line); padding: 20px; display: flex; flex-direction: column; gap: 10px; min-height: 230px; position: relative; transition: background .2s; }
.svc:hover, .svc.hl { background: var(--plane-2); }
.svc-cube { width: 34px; height: 34px; }
.svc .cat { font-size: 12px; color: var(--muted); }
.svc h3 { font-size: 15.5px; font-weight: 600; }
.svc p { color: var(--ink-2); font-size: 13.5px; }
.svc .foot-row { margin-top: auto; display: flex; gap: 8px; align-items: center; justify-content: space-between; padding-top: 8px; }
.svc .badge { position: absolute; top: 20px; right: 20px; }
.svc-empty { grid-column: 1 / -1; background: var(--plane); }

/* ---------- training ---------- */
.course-list { display: grid; }
.course { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 18px; align-items: center; padding: 18px 20px; border-top: 1px solid var(--line); }
.course:first-child { border-top: 0; }
.course-thumb { width: 56px; height: 56px; border-radius: 10px; display: grid; place-items: center; background: var(--plane-3); color: var(--ink-2); position: relative; overflow: hidden; }
.course-thumb svg { width: 22px; height: 22px; }
.course.done .course-thumb { background: var(--accent-soft); color: var(--accent-ink); }
.course h3 { font-size: 14.5px; font-weight: 600; }
.course p { color: var(--muted); font-size: 13px; margin-top: 2px; }
.course .meta { display: flex; gap: 12px; align-items: center; margin-top: 10px; font-size: 12.5px; color: var(--muted); }
.lesson-bar { display: flex; gap: 3px; }
.lesson-bar i { width: 18px; height: 5px; border-radius: 2px; background: var(--line-2); }
.lesson-bar i.on { background: var(--accent); }

/* ---------- settings ---------- */
.setting { display: flex; justify-content: space-between; gap: 20px; align-items: center; padding: 16px 20px; border-top: 1px solid var(--line); }
.setting:first-of-type { border-top: 0; }
.setting strong { font-weight: 550; font-size: 13.5px; }
.setting p { color: var(--muted); font-size: 12.5px; margin-top: 2px; max-width: 58ch; }
.lock { display: inline-flex; gap: 6px; align-items: center; font-size: 12px; color: var(--muted); }
.lock svg { width: 13px; height: 13px; }
.callout { display: flex; gap: 12px; padding: 14px 16px; border-radius: var(--r-2); background: var(--plane-2); border: 1px solid var(--line); color: var(--ink-2); font-size: 13.5px; }
.callout svg { width: 18px; height: 18px; color: var(--accent); flex: none; margin-top: 1px; }
.callout.warn svg { color: var(--warn); }

/* ---------- dialogs & sheets ---------- */
dialog { border: 0; padding: 0; color: var(--ink); background: transparent; max-width: none; max-height: none; }
dialog::backdrop { background: rgba(10, 13, 18, .42); backdrop-filter: blur(3px); }
.modal { width: min(560px, calc(100vw - 32px)); background: var(--plane); border-radius: var(--r-3); box-shadow: var(--shadow-3); border: 1px solid var(--line); display: flex; flex-direction: column; max-height: calc(100vh - 48px); max-height: calc(100dvh - 32px); }
.modal-head { padding: 20px 22px 0; display: flex; gap: 12px; justify-content: space-between; align-items: flex-start; }
.modal-head h2 { font-size: 18px; letter-spacing: -.02em; }
.modal-head p { color: var(--muted); font-size: 13px; margin-top: 4px; }
.modal-body { padding: 18px 22px; overflow-y: auto; display: grid; gap: 16px; }
.modal-foot { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; background: var(--plane-2); border-radius: 0 0 var(--r-3) var(--r-3); }
dialog.sheet { margin: 0 0 0 auto; height: 100vh; height: 100dvh; }
.sheet-panel { width: min(600px, 100vw); height: 100vh; height: 100dvh; background: var(--plane); border-left: 1px solid var(--line); box-shadow: var(--shadow-3); display: flex; flex-direction: column; }
.sheet-panel .modal-head { padding: 22px 24px 16px; border-bottom: 1px solid var(--line); }
.sheet-body { padding: 20px 24px; overflow-y: auto; flex: 1; display: grid; gap: 18px; align-content: start; }
.sheet-foot { padding: 14px 24px; border-top: 1px solid var(--line); background: var(--plane-2); }
.kv { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 10px 16px; font-size: 13.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.thread { display: grid; gap: 14px; }
.msg { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 12px; }
.msg .bubble { padding: 12px 14px; border-radius: 4px 12px 12px 12px; background: var(--plane-2); border: 1px solid var(--line); }
.msg.staff .bubble { background: var(--accent-soft); border-color: var(--accent-line); }
.msg .who { font-size: 12.5px; color: var(--muted); margin-bottom: 4px; }
.msg .who b { color: var(--ink); font-weight: 600; }
.msg.event { grid-template-columns: 32px 1fr; color: var(--muted); font-size: 12.5px; align-items: center; }
.msg.event::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--line-2); justify-self: center; }
.x { width: 32px; height: 32px; border-radius: 8px; border: 0; background: transparent; color: var(--muted); display: grid; place-items: center; flex: none; }
.x:hover { background: var(--plane-3); color: var(--ink); }
.x svg { width: 18px; height: 18px; }

/* menus */
.menu-wrap { position: relative; }
.menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 250px; background: var(--plane); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-3); padding: 6px; z-index: 40; display: none; }
.menu.open { display: block; }
.menu .menu-label { font-size: 12px; color: var(--muted); padding: 8px 10px 4px; }
.menu button.item, .menu a.item { display: flex; width: 100%; align-items: center; gap: 10px; padding: 8px 10px; border: 0; border-radius: 7px; background: none; text-align: left; font-size: 13.5px; text-decoration: none; color: var(--ink); }
.menu .item:hover { background: var(--plane-2); }
.menu .item svg { width: 16px; height: 16px; color: var(--muted); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }
.menu .who { padding: 10px; display: grid; gap: 2px; }
.menu .who small { color: var(--muted); }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 10px 8px; max-width: 250px; }
.swatch { width: 28px; height: 28px; border-radius: 50%; border: 0; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12); position: relative; }
.swatch[aria-pressed="true"]::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; box-shadow: 0 0 0 2px var(--ink); }
.org-switch select { height: 34px; min-width: 210px; }
.user-btn { display: flex; align-items: center; gap: 8px; border: 0; background: transparent; padding: 3px; border-radius: 30px; }
.user-btn:hover { background: var(--ground-2); }

/* toasts */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: grid; gap: 8px; }
.toast { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 10px; background: var(--plate); color: var(--plate-ink); box-shadow: var(--shadow-3); font-size: 13.5px; max-width: 380px; }
.toast svg { width: 17px; height: 17px; flex: none; margin-top: 1px; color: var(--accent); }
.toast.err svg { color: var(--crit); }
.toast a { color: inherit; }
.demo-link { word-break: break-all; font: 12px var(--mono); background: var(--plane-2); padding: 10px; border-radius: 8px; border: 1px dashed var(--line-2); }

.skeleton { border-radius: 8px; background: linear-gradient(90deg, var(--plane-2), var(--plane-3), var(--plane-2)); background-size: 200% 100%; animation: shimmer 1.4s ease-in-out infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }


/* ---------- lesson player (Cloudflare Stream) ---------- */
.lesson-stage { overflow: hidden; }
.player { aspect-ratio: 16 / 9; background: var(--plate); position: relative; }
.player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.play-cover { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 10px; width: 100%; border: 0; background: radial-gradient(80% 90% at 50% 40%, color-mix(in srgb, var(--plate) 82%, var(--accent)), var(--plate)); color: var(--plate-ink); font-weight: 550; font-size: 15px; }
.play-cover svg { width: 56px; height: 56px; padding: 15px; border-radius: 50%; background: var(--accent); color: var(--accent-on); box-shadow: 0 10px 30px -8px var(--accent); transition: transform .3s var(--ease-out); }
button.play-cover:hover svg { transform: scale(1.08); }
.play-cover.static svg { background: transparent; box-shadow: inset 0 0 0 1.5px var(--plate-muted); color: var(--plate-muted); }
.play-cover small { color: var(--plate-muted); font-weight: 400; font-size: 12.5px; }
.lesson-info { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; padding: 18px 20px; flex-wrap: wrap; }
.lesson-info h2 { font-size: 17px; }
.lesson-info p { margin-top: 4px; max-width: 64ch; }
.outline { list-style: none; margin: 0; padding: 0 8px 10px; }
.outline button { display: flex; gap: 12px; align-items: center; width: 100%; padding: 9px 12px; border: 0; border-radius: 8px; background: none; text-align: left; color: var(--ink-2); }
.outline button:hover { background: var(--plane-2); }
.outline button[aria-current="true"] { background: var(--accent-soft); color: var(--ink); }
.ol-mark { width: 24px; height: 24px; border-radius: 50%; flex: none; display: grid; place-items: center; font-size: 11.5px; box-shadow: inset 0 0 0 1.5px var(--line-2); color: var(--muted); }
.ol-mark svg { width: 14px; height: 14px; }
.outline button.done .ol-mark { background: var(--accent); box-shadow: none; color: var(--accent-on); }
.ol-text { display: grid; min-width: 0; font-size: 13.5px; font-weight: 500; }
.ol-text small { color: var(--muted); font-weight: 400; font-size: 12px; }
.materials { display: grid; padding: 0 8px 10px; }

/* ---------- Training Manager ---------- */
.cf-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); margin-bottom: 20px; overflow: hidden; }
.cf-item { padding: 14px 18px; box-shadow: 1px 0 0 var(--line), 0 1px 0 var(--line); display: grid; gap: 3px; }
.cf-item .status { white-space: normal; }
.cf-item small { color: var(--muted); font-size: 12px; }
.m-lessons { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.m-lesson { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 20px 12px 10px; border-bottom: 1px solid var(--line); }
.m-order { display: grid; }
.m-order .x { width: 26px; height: 22px; }
.m-order .x svg { width: 14px; height: 14px; }
.m-order .x[disabled] { opacity: .3; cursor: default; }
.m-main .cell-sub { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 3px; }
.up-bar { height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; margin-top: 8px; }
.up-bar i { display: block; height: 100%; background: var(--accent); transition: width .3s; }
.m-add { display: flex; gap: 8px; padding: 14px 20px; }
.audience { border: 0; padding: 0; margin: 0; display: grid; gap: 10px; }
.audience legend { margin-bottom: 4px; }
.aud-custom { display: grid; gap: 8px; padding: 12px 14px; border-radius: 10px; background: var(--plane-2); border: 1px solid var(--line); }
.aud-custom[hidden] { display: none; }
@media (max-width: 640px) { .m-lesson { grid-template-columns: auto minmax(0, 1fr); } .m-lesson > .row { grid-column: 1 / -1; justify-content: flex-start !important; } }


/* ---------- view tabs & team progress ---------- */
.segmented .seg-link { display: inline-flex; align-items: center; height: 30px; padding: 0 12px; border-radius: 7px; font-size: 13px; font-weight: 550; color: var(--muted); text-decoration: none; }
.segmented .seg-link[aria-current="page"] { background: var(--plane); color: var(--ink); box-shadow: var(--shadow-1); }
.segmented .seg-link:hover { color: var(--ink); }
.tp-table th { vertical-align: bottom; }
.tp-course { display: block; max-width: 132px; white-space: normal; line-height: 1.3; font-weight: 550; color: var(--ink-2); }
.tp-table td { white-space: nowrap; }
.tp-table td:first-child { position: sticky; left: 0; background: var(--plane); z-index: 1; }


/* ---------- document viewer & receipts ---------- */
.modal.viewer-modal { width: min(1040px, calc(100vw - 32px)) !important; }
.modal-foot { align-items: center; }
.viewer-frame { display: block; width: 100%; height: min(74vh, 900px); border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.viewer-image { display: grid; place-items: center; background: var(--plane-2); border-radius: 10px; padding: 12px; max-height: 74vh; overflow: auto; }
.viewer-image img { max-width: 100%; height: auto; border-radius: 6px; }
/* Phone PDF viewer: the dialog fills the screen and the pages scroll inside it. */
.modal.viewer-full { width: 100vw !important; max-width: none; height: 100vh; height: 100dvh; max-height: none; border-radius: 0; border: 0; }
.modal.viewer-full .modal-body { flex: 1; padding: 12px; background: var(--plane-2); align-content: start; }
.modal.viewer-full .modal-foot { border-radius: 0; }
.pdf-pages { display: grid; gap: 12px; }
.pdf-page { background: #fff; border-radius: 4px; box-shadow: var(--shadow-1); overflow: hidden; }
.pdf-page canvas { display: block; width: 100%; height: auto; }
@media (max-width: 640px) {
	.viewer-modal .modal-foot { flex-wrap: wrap; padding-bottom: max(14px, env(safe-area-inset-bottom)); }
	.viewer-modal .modal-foot > .muted { flex-basis: 100%; }
	.viewer-modal .modal-foot .btn { flex: 1; justify-content: center; }
}
.viewer-text .table-wrap { max-height: 70vh; border: 1px solid var(--line); border-radius: 10px; }
.viewer-pre { margin: 0; max-height: 70vh; overflow: auto; padding: 16px; border-radius: 10px; background: var(--plane-2); border: 1px solid var(--line); font: 13px/1.6 var(--mono); white-space: pre-wrap; }
.materials .material { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px; padding: 0; border-radius: 8px; }
.materials .material:hover { background: var(--plane-2); }
.material-main { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 12px; align-items: center; padding: 10px 12px; border: 0; background: none; text-align: left; color: inherit; }
.material-main svg { width: 18px; height: 18px; color: var(--muted); }

.receipt { position: relative; background: #fff; color: #11151b; border: 1px solid #e1e4e9; border-radius: 12px; padding: 32px; max-width: 760px; margin: 0 auto; }
.receipt .muted { color: #5c6674; }
.receipt-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding-bottom: 20px; border-bottom: 1px solid #e1e4e9; }
.receipt-top img { width: 120px; height: auto; }
.receipt-kind { text-align: right; display: grid; gap: 4px; }
.receipt-kind strong { font-size: 22px; letter-spacing: -.02em; }
.receipt-meta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; padding: 20px 0; font-size: 13.5px; }
.receipt-meta > div { display: grid; gap: 2px; align-content: start; }
.receipt-meta .muted { font-size: 12px; }
.receipt-stamp { position: absolute; top: 96px; right: 32px; transform: rotate(-8deg); padding: 6px 14px; border: 2.5px solid #18794e; color: #18794e; border-radius: 8px; font: 700 18px var(--mono); letter-spacing: .12em; text-transform: uppercase; opacity: .85; }
.receipt-lines { width: 100%; border-collapse: collapse; font-size: 13.5px; margin-top: 4px; }
.receipt-lines th { text-align: left; font-size: 12px; font-weight: 600; color: #5c6674; border-bottom: 1px solid #e1e4e9; padding: 8px 6px; }
.receipt-lines td { padding: 10px 6px; border-bottom: 1px solid #eff1f4; }
.receipt-lines .right { text-align: right; }
.receipt-totals { margin: 16px 0 0 auto; max-width: 280px; display: grid; gap: 6px; font-size: 13.5px; }
.receipt-totals > div { display: flex; justify-content: space-between; gap: 16px; }
.receipt-totals .grand { font-weight: 700; font-size: 15px; padding-top: 8px; border-top: 1px solid #e1e4e9; }
.receipt-totals .owed { font-weight: 700; color: #b42318; }
.receipt-notes { margin-top: 20px; padding: 12px 14px; background: #f6f7f9; border-radius: 8px; font-size: 13px; color: #343c48; }
.receipt-foot { margin-top: 24px; font-size: 12px; color: #8a93a0; text-align: center; }
.print-receipt .receipt { border: 0; padding: 0; }
@media print { .print-receipt { padding: 0 !important; } }
.receipt-stamp.void { border-color: #8a93a0; color: #5c6674; }
.receipt-h { font-size: 13px; font-weight: 600; margin: 22px 0 6px; }
.receipt-howto { margin-top: 8px; padding: 4px 16px 14px; border: 1px solid #e1e4e9; border-radius: 10px; display: grid; gap: 10px; font-size: 13.5px; }
.receipt-howto strong { display: block; font-size: 12.5px; margin-bottom: 2px; }
.receipt-howto p { white-space: pre-line; margin: 0; }

/* custom invoices */
.inv-line { display: grid; grid-template-columns: minmax(0, 1fr) 72px 104px 92px 28px; gap: 8px; align-items: center; }
.inv-line-head { font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.inv-line-head .right, .inv-line-total { text-align: right; }
.inv-line .x { width: 28px; height: 28px; }
.inv-line .x svg { width: 15px; height: 15px; }
.inv-sum { display: grid; grid-template-columns: auto 120px; gap: 8px 14px; align-items: center; justify-content: end; font-size: 13.5px; }
.inv-sum strong { font-size: 18px; text-align: right; letter-spacing: -.02em; }
.inv-foot { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; width: 100%; }

/* support hours */
.stat-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat-row > div { padding: 18px 22px; border-right: 1px solid var(--line); }
.stat-row > div:last-child { border-right: 0; }
.stat-row .v { font: 500 26px/1 var(--font); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.stat-row .l { color: var(--muted); font-size: 12.5px; margin-top: 7px; }
.meter { height: 4px; border-radius: 4px; background: var(--plane-3); margin-top: 12px; overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--accent); border-radius: inherit; }
.block-list { list-style: none; margin: 0; padding: 0 8px 10px; display: grid; }
.block-list li { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 8px; }
.block-list li + li { border-top: 1px solid var(--line); }
.block-list svg { width: 18px; height: 18px; color: var(--accent-ink); }

/* files on tickets and projects */
.sheet-files { margin: 18px 0 4px; padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.sheet-files .materials .material { margin: 0 -12px; }
.shared-link { display: flex; gap: 12px; align-items: center; margin: 0 16px 10px; padding: 10px 12px; border: 1px dashed var(--line-2); border-radius: 8px; color: inherit; text-decoration: none; font-size: 13.5px; }
.shared-link:hover { background: var(--plane-2); border-style: solid; }
.shared-link svg { width: 18px; height: 18px; color: var(--accent-ink); flex: none; }
.shared-link small { display: block; color: var(--muted); font-size: 12px; }
@media (max-width: 960px) { .stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } .stat-row > div:nth-child(2) { border-right: 0; } .stat-row > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); } }
@media (max-width: 640px) {
	.inv-line { grid-template-columns: minmax(0, 1fr) 64px 28px; }
	.inv-line [data-f=price] { grid-column: 1; }
	.inv-line .inv-line-total { grid-column: 2; }
	.inv-line-head { display: none; }
	.receipt-meta { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
	.receipt { padding: 20px; }
	.receipt-meta { grid-template-columns: 1fr 1fr; }
	.receipt-stamp { top: 70px; right: 16px; font-size: 14px; }
}

.mail-log { border-top: 1px solid var(--line); }
.mail-log summary { padding: 14px 20px; cursor: pointer; font-weight: 550; font-size: 13.5px; color: var(--ink-2); }
.mail-log summary:hover { color: var(--ink); }


/* ---------- projects ---------- */
.project-list { display: grid; gap: 16px; }
.project-card { display: block; color: inherit; text-decoration: none; transition: box-shadow .2s, transform .2s var(--ease-out); }
.project-card:hover { box-shadow: var(--shadow-2); transform: translateY(-1px); }
.project-card .proj { border-top: 0; }
.project-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 20px; border-top: 1px solid var(--line); font-size: 12.5px; }
.timeline { list-style: none; margin: 0; padding: 4px 20px 20px; display: grid; gap: 18px; }
.timeline > .empty { padding: 28px 0; }
.tl-item { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 12px; }
.tl-body h3 { font-size: 14.5px; margin: 2px 0 4px; }
.tl-body p { color: var(--ink-2); font-size: 13.5px; margin-top: 6px; }
.tl-who { font-size: 12.5px; color: var(--muted); }
.tl-who b { color: var(--ink); font-weight: 600; }
.tl-card { padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--plane-2); }
.tl-card.pending { border-color: var(--accent-line); background: var(--accent-soft); }
.tl-card .tag { margin-top: 6px; }
.tl-decision { display: flex; gap: 10px; align-items: flex-start; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 13px; }
.tl-decision svg { width: 16px; height: 16px; flex: none; margin-top: 2px; }
.tl-decision.ok svg { color: var(--ok); }
.tl-decision.warn svg { color: var(--warn); }
.tl-respond { margin-top: 12px; gap: 8px; }
.tl-event { display: grid; grid-template-columns: 32px 1fr; align-items: center; font-size: 12.5px; color: var(--muted); }
.tl-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--line-2); justify-self: center; }
.ms-view { list-style: none; margin: 0; padding: 0 20px 16px; display: grid; gap: 4px; }
.ms-view li { display: flex; gap: 12px; align-items: center; padding: 6px 0; }
.ms-mark { width: 22px; height: 22px; border-radius: 50%; flex: none; display: grid; place-items: center; box-shadow: inset 0 0 0 1.5px var(--line-2); }
.ms-mark svg { width: 13px; height: 13px; }
.ms-view li.done .ms-mark { background: var(--accent); box-shadow: none; color: var(--accent-on); }
.ms-view li.current .ms-mark { box-shadow: inset 0 0 0 2.5px var(--accent), 0 0 0 4px var(--accent-soft); }
.ms-text { display: grid; font-size: 13.5px; font-weight: 500; }
.ms-text small { color: var(--muted); font-weight: 400; font-size: 12px; }
.ms-list { display: grid; gap: 8px; }
.ms-row { display: grid; grid-template-columns: 20px minmax(0, 1fr) 150px 130px 28px 28px; gap: 8px; align-items: center; }
.ms-row .x { width: 28px; height: 28px; }
.ms-row .x svg { width: 15px; height: 15px; }
@media (max-width: 640px) { .ms-row { grid-template-columns: 20px minmax(0, 1fr) 28px 28px; } .ms-row input[type=date], .ms-row select { grid-column: 2; } }


/* ---------- file-type badges & view buttons ---------- */
.ftype { display: inline-grid; place-items: center; width: 34px; height: 40px; flex: none; border-radius: 4px 9px 4px 4px; font: 700 9.5px/1 var(--mono); letter-spacing: .03em; color: #fff; box-shadow: inset 0 -12px 0 rgba(0, 0, 0, .12), var(--shadow-1); }
.ftype-pdf { background: #d93a3a; }
.ftype-doc { background: #2f6fd6; }
.ftype-sheet { background: #1e8a4c; }
.ftype-slides { background: #e0731b; }
.ftype-image { background: #8250df; }
.ftype-other { background: #6b7482; }
.materials .material { grid-template-columns: minmax(0, 1fr) auto auto; padding-right: 6px; }
.material-main { grid-template-columns: 34px minmax(0, 1fr); }
.doc-name { display: flex; align-items: center; gap: 12px; border: 0; background: none; padding: 0; text-align: left; color: inherit; cursor: pointer; }
.doc-name:hover .cell-title { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
	.dash-top, .grid-main, .svc-hero { grid-template-columns: 1fr; }
	.svc-hero .model-plane { border-left: 0; border-top: 1px solid var(--line); min-height: 320px; }
}
@media (max-width: 960px) {
	.shell { grid-template-columns: 1fr; }
	.rail { position: fixed; z-index: 60; left: 0; top: 0; width: 280px; background: var(--ground); transform: translateX(-100%); transition: transform .3s var(--ease-out); box-shadow: var(--shadow-3); }
	.shell.nav-open .rail { transform: none; }
	.scrim { position: fixed; inset: 0; z-index: 55; background: rgba(10, 13, 18, .4); }
	.menu-btn { display: inline-flex; }
	.topbar, .content, .foot { padding-left: 16px; padding-right: 16px; }
	.grid-2 { grid-template-columns: 1fr; }
	.org-switch select { min-width: 0; width: 160px; }
}
@media (max-width: 640px) {
	.page-head h1 { font-size: 24px; }
	.welcome h1 { font-size: 25px; }
	.counts .v { font-size: 22px; }
	.counts > a, .counts > div { padding: 14px 16px; }
	.model-plane { min-height: 400px; }
	.welcome { padding: 20px; }
	.counts { margin: auto -20px -20px; }
	.form-grid { grid-template-columns: 1fr; }
	.search .input { min-width: 0; width: 100%; }
	.search { flex: 1; }
	.crumbs .crumb-org { display: none; }
	.course { grid-template-columns: 44px minmax(0, 1fr); }
	.course-thumb { width: 44px; height: 44px; }
	.course > :last-child { grid-column: 2; justify-self: start; }
	table.data.stack-sm thead { display: none; }
	table.data.stack-sm tr { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
	table.data.stack-sm td { padding: 0 !important; border: 0; }
	table.data.stack-sm td[data-hide-sm] { display: none; }
	.kv { grid-template-columns: 1fr; gap: 2px; }
	.kv dd { margin-bottom: 8px; }
	.toasts { left: 16px; right: 16px; }
	.org-switch { display: none; }
}
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* team billing cell, prepaid packages, two-up stat row */
.billing-cell { display: inline-flex; align-items: center; gap: 8px; vertical-align: middle; }
.stat-row.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pkg-list { border: 0; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.pkg { position: relative; cursor: pointer; }
.pkg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.pkg-body { display: grid; gap: 4px; padding: 14px 16px; border: 1px solid var(--line-2); border-radius: 10px; transition: border-color .15s, box-shadow .15s; }
.pkg-body strong { font-size: 14px; }
.pkg-price { font: 500 22px/1.1 var(--font); letter-spacing: -.02em; }
.pkg-body small { color: var(--muted); font-size: 12px; }
.pkg input:checked + .pkg-body { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.pkg input:focus-visible + .pkg-body { outline: 2px solid var(--accent); outline-offset: 2px; }
.plan-body { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; padding: 0 20px 18px; }
.plan-body > div:first-child { flex: 1; max-width: 420px; }
.plan-body .v { font: 500 26px/1 var(--font); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.plan-body .l { color: var(--muted); font-size: 12.5px; margin-top: 7px; }

/* Console rows: compact service tags and actions */
.svc-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.row-actions { display: flex; justify-content: flex-end; align-items: center; gap: 6px; flex-wrap: nowrap; }
.row-actions .btn.icon { width: 30px; }
.row-actions .btn.icon svg { width: 18px; height: 18px; }

/* System status pill (Tech Teki staff) */
.sys-pill { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--plane); color: var(--ink-2); font: 500 12.5px var(--font); cursor: pointer; white-space: nowrap; transition: border-color .2s, background .2s; }
.sys-pill:hover { background: var(--plane-2); }
.sys-pill:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sys-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--faint); }
.sys-pill[data-state="ok"] .sys-dot, .sys-dot[data-state="ok"] { background: #16a34a; box-shadow: 0 0 0 3px rgba(22, 163, 74, .18); }
.sys-pill[data-state="warn"] .sys-dot, .sys-dot[data-state="warn"] { background: #d97706; box-shadow: 0 0 0 3px rgba(217, 119, 6, .18); }
.sys-pill[data-state="down"] .sys-dot, .sys-dot[data-state="down"] { background: #dc2626; box-shadow: 0 0 0 3px rgba(220, 38, 38, .2); }
.sys-pill[data-state="down"] { border-color: rgba(220, 38, 38, .45); color: #b91c1c; }
.sys-pill[data-state="ok"] .sys-dot { animation: sys-pulse 2.4s ease-out infinite; }
@keyframes sys-pulse { 0% { box-shadow: 0 0 0 0 rgba(22, 163, 74, .45); } 70% { box-shadow: 0 0 0 6px rgba(22, 163, 74, 0); } 100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0); } }
@media (prefers-reduced-motion: reduce) { .sys-pill[data-state="ok"] .sys-dot { animation: none; } }
.sys-menu { width: 340px; padding: 0; }
.sys-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 16px 10px; }
.sys-list { list-style: none; margin: 0; padding: 0 8px 6px; display: grid; }
.sys-list li { display: grid; grid-template-columns: 14px minmax(0, 1fr); gap: 10px; align-items: center; padding: 8px; border-radius: 8px; }
.sys-list li + li { border-top: 1px solid var(--line); }
.sys-list b { display: block; font-size: 13px; font-weight: 600; }
.sys-list small { display: block; color: var(--muted); font-size: 12px; }
.sys-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 16px 14px; border-top: 1px solid var(--line); font-size: 12px; }
@media (max-width: 960px) { .sys-pill .sys-label { display: none; } .sys-pill { padding: 0 11px; } .sys-menu { width: min(340px, calc(100vw - 32px)); } }
.ca-orgs { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; max-height: 220px; overflow: auto; }
.ca-orgs legend { margin-bottom: 6px; }
.sm-select { height: 32px; width: 140px; padding-top: 0; padding-bottom: 0; font-size: 13px; }
.staff-scope { margin-top: 2px; max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ftype-link { background: #2563eb; }
a.doc-name { text-decoration: none; }
/* ---------- analytics ---------- */
.an-chart { position: relative; height: 220px; margin: 6px 20px 0 64px; outline: none; }
.an-chart:focus-visible { box-shadow: 0 0 0 2px var(--plane), 0 0 0 4px var(--accent); border-radius: 4px; }
.an-grid { position: absolute; left: 0; right: 0; height: 0; border-top: 1px solid var(--line); }
.an-grid span { position: absolute; right: calc(100% + 10px); top: -8px; font-size: 11.5px; color: var(--faint); white-space: nowrap; }
.an-bars { position: absolute; inset: 0; display: flex; align-items: stretch; gap: 2px; }
.an-bar { flex: 1; display: flex; align-items: flex-end; min-width: 0; }
.an-bar i { display: block; width: 100%; min-height: 2px; background: var(--accent); border-radius: 4px 4px 0 0; transition: opacity .15s; }
.an-bars:has(.an-bar.on) .an-bar:not(.on) i { opacity: .45; }
.an-tip { position: absolute; top: -6px; transform: translate(-50%, -100%); display: grid; gap: 2px; padding: 8px 10px; background: var(--plane); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow-3); font-size: 12.5px; color: var(--ink-2); white-space: nowrap; pointer-events: none; z-index: 3; }
.an-tip b { color: var(--ink); font-weight: 600; }
.an-x { display: flex; gap: 2px; margin: 8px 20px 0 64px; }
.an-x span { flex: 1; min-width: 0; font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: visible; }
.an-table { border-top: 1px solid var(--line); margin-top: 16px; }
.an-table summary { padding: 12px 20px; font-size: 13px; font-weight: 550; color: var(--accent-ink); cursor: pointer; }
.an-table .table-wrap { max-height: 320px; overflow: auto; }
.an-list { list-style: none; margin: 0; padding: 0 20px 16px; display: grid; gap: 12px; }
.an-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; align-items: center; font-size: 13.5px; }
.an-list li.has-ico { grid-template-columns: 20px minmax(0, 1fr) auto; column-gap: 10px; }
.an-list .an-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.an-list .meter { grid-column: 1 / -1; margin-top: 6px; }
.an-ico { width: 20px; height: 16px; display: inline-flex; align-items: center; justify-content: center; flex: none; color: var(--muted); }
.an-ico svg { width: 16px; height: 16px; }
img.an-ico { width: 16px; height: 16px; justify-self: center; border-radius: 3px; object-fit: contain; }
img.an-flag { width: 20px; height: 15px; border-radius: 2px; box-shadow: 0 0 0 1px var(--line); object-fit: cover; }
.an-letter { width: 16px; height: 16px; justify-self: center; border-radius: 4px; background: var(--plane-3); color: var(--ink-2); font-size: 10px; font-weight: 650; }
.an-emoji { font-size: 15px; line-height: 1; }
.an-more { padding: 0 20px 16px; margin-top: -4px; font-size: 13px; }
.an-list-all { padding: 0; }
.an-list-all li[hidden] { display: none; }
.an-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.an-toolbar .sm-select { width: auto; min-width: 180px; max-width: 100%; }
.segmented.an-ranges { flex-wrap: wrap; max-width: 100%; }
.segmented button svg { width: 14px; height: 14px; }
@media (max-width: 720px) { .an-chart, .an-x { margin-left: 52px; margin-right: 14px; } }

/* Anything marked hidden stays hidden, even when a class gives it display:grid or flex. */
[hidden] { display: none !important; }

/* Internal (Tech Teki only): ticket notes and the Documents section. A warm, dashed tint so it never reads as client-facing. */
.msg.internal .bubble { background: var(--warn-soft); border: 1px dashed var(--warn); }
.internal-tag { display: inline-flex; align-items: center; gap: 4px; color: var(--warn); font-weight: 600; }
.internal-tag svg { width: 12px; height: 12px; }
#reply-form.internal textarea { border-color: var(--warn); background: var(--warn-soft); }
.internal-plane { border: 1px dashed var(--warn); }
.internal-plane h2 { display: flex; align-items: center; gap: 8px; }
.internal-plane h2 svg { width: 17px; height: 17px; color: var(--warn); }
.internal-list { display: grid; }
.internal-note, .internal-doc { padding: 14px 20px; border-top: 1px solid var(--line); }
.internal-note .who { font-size: 12.5px; color: var(--muted); }
.internal-note .who b { color: var(--ink); font-weight: 600; }
.internal-note p { margin: 6px 0 0; font-size: 14px; white-space: normal; overflow-wrap: anywhere; }

/* Client-visible notes log (Documents > Notes) */
.note-add { padding: 4px 20px 16px; display: grid; gap: 10px; }
.note-item { padding: 14px 20px; border-top: 1px solid var(--line); }
.note-item .who { font-size: 12.5px; color: var(--muted); min-width: 0; }
.note-item .who b { color: var(--ink); font-weight: 600; }
.note-item p { margin: 6px 0 0; font-size: 14px; white-space: normal; overflow-wrap: anywhere; }
.note-item .row { flex-wrap: wrap; }

/* Staff "View as": a strip above the top bar for as long as the session is read only */
.viewas-bar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; padding: 8px 28px; background: var(--warn-soft); color: var(--warn); border-bottom: 1px solid color-mix(in srgb, var(--warn) 30%, transparent); font-size: 13.5px; }
.viewas-bar p { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.viewas-bar b { font-weight: 650; }
@media (max-width: 960px) { .viewas-bar { padding-left: 16px; padding-right: 16px; } }
.internal-doc { gap: 12px; }


/* Phones: a full-size, easy-to-hit menu button */
@media (max-width: 960px) {
	.menu-btn.btn.icon { width: 44px; height: 44px; margin-left: -6px; }
	.menu-btn svg { width: 24px; height: 24px; }
}

/* Phones: wide segmented filters scroll sideways inside themselves instead of widening the page */
@media (max-width: 640px) {
	.plane-head .segmented { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
	.plane-head .segmented::-webkit-scrollbar { display: none; }
	.plane-head .segmented button { flex: none; }
}

/* Radio groups inside forms (e.g. what a recurring invoice does when due) */
fieldset.field { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset.field > legend { font-size: 13px; font-weight: 550; color: var(--ink-2); padding: 0; margin-bottom: 8px; }
fieldset.field .check + .check { margin-top: 8px; }

/* ---------- Insights: tabs and Site Health ---------- */
.insights-tabs, .page-tabs { margin: -6px 0 16px; }
.insights-tabs .segmented, .page-tabs .segmented { max-width: 100%; background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent-line); }
.insights-tabs .seg-link, .page-tabs .seg-link { color: var(--accent-ink); }
.insights-tabs .seg-link:hover, .page-tabs .seg-link:hover { color: var(--accent-ink); background: var(--plane); }
.insights-tabs .seg-link[aria-current="page"], .page-tabs .seg-link[aria-current="page"] { background: var(--accent); color: var(--accent-on); }

/* The shared audit report takes the portal's tokens, so light, dark and the accent choice follow the rest of the screen. */
.ar-report {
	--ar-font: var(--font); --ar-ink: var(--ink); --ar-body: var(--ink-2); --ar-muted: var(--muted);
	--ar-surface: var(--plane); --ar-surface-2: var(--plane-2); --ar-line: var(--line); --ar-line-strong: var(--line-2);
	--ar-accent: var(--accent-strong); --ar-accent-hover: color-mix(in srgb, var(--accent-strong) 88%, #000); --ar-on-accent: var(--accent-on);
	--ar-crit: var(--crit); --ar-warn: var(--warn); --ar-ok: var(--ok);
	--ar-radius: var(--r-2); --ar-shadow: none; --ar-focus: var(--accent);
}
.sh-issues .ar-passed-toggle { color: var(--accent-ink); }

.sh-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.sh-stat { padding: 18px; min-width: 0; }
.sh-stat .l { color: var(--muted); font-size: 12.5px; }
.sh-stat .v { font: 500 30px/1.1 var(--font); letter-spacing: -.03em; font-variant-numeric: tabular-nums; margin-top: 6px; }
.sh-stat .v small { font-size: 15px; color: var(--muted); letter-spacing: 0; }
.sh-stat .n { color: var(--muted); font-size: 12.5px; margin-top: 6px; }
.sh-stat--score { display: flex; align-items: center; gap: 16px; }
.sh-stat--score svg { width: 76px; height: 76px; flex: none; }
.sh-stat--score .g { font-size: 15px; font-weight: 600; margin-top: 2px; }
.sh-ring-track { fill: none; stroke: var(--plane-3); stroke-width: 12; }
.sh-ring-fill { fill: none; stroke: var(--ok); stroke-width: 12; stroke-linecap: round; transform: rotate(-90deg); transform-origin: 60px 60px; }
.sh-ring[data-band="mid"] .sh-ring-fill { stroke: var(--warn); }
.sh-ring[data-band="low"] .sh-ring-fill { stroke: var(--crit); }
.sh-ring text { fill: var(--ink); font: 700 30px var(--font); }
.sh-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.sh-pill { font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 99px; background: var(--plane-3); color: var(--ink-2); }
.sh-pill.major { background: var(--crit-soft); color: var(--crit); }
.sh-pill.moderate { background: var(--warn-soft); color: var(--warn); }
.tone-ok { color: var(--ok); }
.tone-crit { color: var(--crit); }

/* Score over time: one button per weekly check */
.sh-chart { position: relative; margin: 6px 20px 0; padding-top: 22px; }
.sh-bars { display: flex; align-items: stretch; gap: 6px; height: 190px; border-bottom: 1px solid var(--line); }
.sh-bar { flex: 1 1 0; min-width: 0; display: flex; align-items: flex-end; padding: 0; border: 0; background: transparent; border-radius: 6px 6px 2px 2px; cursor: pointer; }
.sh-bar:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sh-bar-fill { position: relative; display: block; width: 100%; min-height: 2px; background: var(--line-2); border-radius: 6px 6px 2px 2px; transition: background .15s; }
.sh-bar:hover .sh-bar-fill { background: var(--faint); }
.sh-bar.on .sh-bar-fill { background: var(--accent); }
.sh-bar-fill b { position: absolute; left: -4px; right: -4px; bottom: 100%; margin-bottom: 3px; text-align: center; font: 600 11px var(--font); color: var(--muted); font-variant-numeric: tabular-nums; }
.sh-bar.on .sh-bar-fill b { color: var(--accent-ink); }
.sh-x { display: flex; gap: 6px; margin-top: 6px; }
.sh-x span { flex: 1 1 0; min-width: 0; text-align: center; font-size: 11px; color: var(--muted); white-space: nowrap; }
.sh-chart .an-tip { top: 14px; }

.sh-issues .plane-head { padding-bottom: 6px; }
.sh-body { padding: 8px 20px 20px; }
.sh-body .callout { margin-bottom: 14px; }
.sh-body .ar-report { gap: 16px; }
/* Area tabs: the report's section menu, laid out as a row of pills */
.sh-issues .ar-layout { display: block; }
.sh-issues .ar-nav { position: static; display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; margin-bottom: 14px; background: var(--ground-2); border: 0; border-radius: 10px; width: fit-content; max-width: 100%; }
.sh-issues .ar-nav-h { display: none; }
.sh-issues .ar-nav-btn { width: auto; min-height: 36px; padding: 0 12px; font-size: 13px; border-radius: 7px; gap: 8px; }
.sh-issues .ar-nav-btn[aria-pressed="true"] { background: var(--plane); box-shadow: var(--shadow-1); color: var(--ink); }
.sh-issues .ar-nav .ar-badge { padding: 1px 7px; font-size: 11.5px; }
.sh-issues .ar-section { border-radius: var(--r-2); }
.sh-issues .ar-section-h { padding: 14px 16px; }
.sh-issues .ar-section-h h3 { font-size: 15px; }
.sh-issues .ar-check-sum { min-height: 56px; padding: 10px 16px; }
.sh-issues .ar-check-body { padding: 0 16px 16px 58px; }
.sh-hist-note { padding: 12px 20px 16px; font-size: 12.5px; }
.sh-more { padding: 12px 20px 16px; }
table.data tr.sh-sel td { background: var(--accent-soft); }
.sh-actions { display: flex; flex-wrap: wrap; gap: 8px; }

@media (max-width: 960px) { .sh-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) {
	.sh-chart { margin: 6px 14px 0; }
	.sh-bars, .sh-x { gap: 3px; }
	.sh-bars { height: 160px; }
	.sh-bar-fill b { font-size: 10px; left: -6px; right: -6px; }
	.sh-x span:not(:nth-last-child(3n+1)) { visibility: hidden; }
	.sh-body { padding: 8px 12px 16px; }
	.sh-issues .ar-nav { overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
	.sh-issues .ar-nav::-webkit-scrollbar { display: none; }
	.sh-issues .ar-nav-btn { flex: none; }
	.sh-issues .ar-check-body { padding: 0 14px 14px; }
}
@media (max-width: 520px) { .sh-stats { gap: 12px; } .sh-stat--score { grid-column: 1 / -1; } .sh-stat { padding: 14px; } .sh-stat .v { font-size: 26px; } }
@media (prefers-reduced-motion: reduce) { .sh-bar-fill { transition: none; } }
