/* Mattera client portal. Minimal & Swiss, Mattera brand (see design-system/.../MASTER.md). */
:root {
  --ink: #0a0a0a;
  --paper: #ffffff;
  --wash: #f6f6f4;
  --muted: #5f6670;
  --line: #e4e4e0;
  --line-strong: #c9c9c3;
  --accent: #cc3366;
  --accent-ink: #a3214d;
  --sun: #ffd400;
  --ok: #137a3f;
  --ok-bg: #e7f4ec;
  --warn: #8a5a00;
  --warn-bg: #fff4d6;
  --bad: #b42318;
  --bad-bg: #fdecea;
  --client: var(--ink);
  --radius: 10px;
  --radius-sm: 6px;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px;
  --font: "Jost", "Futura", "Avenir Next", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.5; color: var(--ink);
  background: var(--wash); -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--ink); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--accent-ink); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { line-height: 1.15; margin: 0; font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.2rem); }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: var(--s4); top: -60px; background: var(--ink); color: #fff; padding: var(--s2) var(--s4);
  border-radius: var(--radius-sm); z-index: 100; }
.skip:focus { top: var(--s4); color: #fff; }

/* Brand mark */
.mark { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--ink);
  color: #fff; font-weight: 600; font-size: 1.05rem; line-height: 1; flex: none; }
.mark b { color: var(--sun); }
.wordmark { display: flex; align-items: center; gap: var(--s3); text-decoration: none; color: var(--ink); }
.wordmark span { font-weight: 600; line-height: 1; font-size: 1.05rem; letter-spacing: -0.01em; }
.wordmark small { display: block; font-weight: 400; color: var(--muted); font-size: .75rem; margin-top: 3px; letter-spacing: .02em; }

/* Buttons and forms */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--s2); min-height: 44px; padding: 0 var(--s5);
  border-radius: 999px; border: 1px solid var(--ink); background: var(--ink); color: #fff; font: inherit; font-weight: 500;
  text-decoration: none; cursor: pointer; transition: background .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease); }
.btn:hover { background: #2a2a2a; color: #fff; }
.btn.secondary { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn.secondary:hover { border-color: var(--ink); background: var(--paper); }
.btn.danger { background: transparent; color: var(--bad); border-color: #f0c2bd; }
.btn.danger:hover { background: var(--bad-bg); }
.btn.small { min-height: 36px; padding: 0 var(--s4); font-size: .9rem; }
.btn.block { width: 100%; }
.btn svg { width: 18px; height: 18px; }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--ink); text-decoration: underline;
  text-underline-offset: 3px; cursor: pointer; min-height: 44px; }

.field { display: grid; gap: 6px; margin-bottom: var(--s4); }
.field label, .label { font-weight: 500; font-size: .95rem; }
.field .help { color: var(--muted); font-size: .85rem; }
.field .error, .form-error { color: var(--bad); font-size: .9rem; }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=search], select, textarea {
  width: 100%; min-height: 44px; padding: 10px 14px; font: inherit; color: var(--ink); background: var(--paper);
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm); transition: border-color .15s var(--ease); }
input:hover, select:hover, textarea:hover { border-color: #9b9b94; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--accent); outline-offset: 0; border-color: var(--ink); }
input[aria-invalid=true] { border-color: var(--bad); }
input[type=color] { width: 64px; height: 44px; padding: 4px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--paper); cursor: pointer; }
input[type=file] { font: inherit; font-size: .9rem; }
input.code { font-size: 1.6rem; letter-spacing: .4em; text-align: center; font-variant-numeric: tabular-nums; }
.check { display: flex; gap: var(--s3); align-items: flex-start; padding: var(--s3) 0; cursor: pointer; }
.check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--ink); flex: none; cursor: pointer; }
.check strong { display: block; font-weight: 500; }

.alert { padding: var(--s3) var(--s4); border-radius: var(--radius-sm); margin-bottom: var(--s4); font-size: .95rem;
  border: 1px solid var(--line); background: var(--paper); }
.alert.success { background: var(--ok-bg); border-color: #b9dfc8; color: #0d5a2e; }
.alert.error { background: var(--bad-bg); border-color: #f4c7c2; color: #8f1c13; }
.alert.info { background: var(--warn-bg); border-color: #f1dc9c; color: #6b4600; }

/* Sign-in pages */
.auth { min-height: 100vh; display: grid; place-items: center; padding: var(--s5); background: var(--paper); }
.auth-card { width: 100%; max-width: 420px; }
.auth-card .wordmark { margin-bottom: var(--s7); }
.auth-card h1 { margin-bottom: var(--s2); }
.auth-card .lead { color: var(--muted); margin-bottom: var(--s5); }
.auth-foot { margin-top: var(--s5); display: flex; justify-content: space-between; gap: var(--s4); flex-wrap: wrap; font-size: .95rem; }
.qr { width: 200px; height: 200px; border: 1px solid var(--line); border-radius: var(--radius); margin: var(--s4) 0; }
.secret { font-family: ui-monospace, Menlo, monospace; background: var(--wash); padding: var(--s2) var(--s3); border-radius: var(--radius-sm);
  word-break: break-all; }
ol.steps { padding-left: 1.2em; margin: 0 0 var(--s4); display: grid; gap: var(--s2); }

/* App shell */
.shell { display: grid; grid-template-columns: 264px 1fr; min-height: 100vh; }
.side { background: var(--paper); border-right: 1px solid var(--line); padding: var(--s5) var(--s4); display: flex; flex-direction: column;
  gap: var(--s5); position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side .wordmark { padding: 0 var(--s2); }
.nav-label { font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 0 var(--s3); margin-bottom: var(--s2); }
.nav { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.nav a { display: flex; align-items: center; gap: var(--s3); min-height: 44px; padding: 0 var(--s3); border-radius: var(--radius-sm);
  text-decoration: none; color: var(--ink); font-weight: 500; transition: background .15s var(--ease); position: relative; }
.nav a svg { width: 20px; height: 20px; color: var(--muted); flex: none; }
.nav a:hover { background: var(--wash); color: var(--ink); }
.nav a[aria-current=page] { background: var(--wash); }
.nav a[aria-current=page]::before { content: ""; position: absolute; left: -16px; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.nav a[aria-current=page] svg { color: var(--ink); }
.side-foot { margin-top: auto; border-top: 1px solid var(--line); padding-top: var(--s4); display: grid; gap: var(--s2); }
.me { display: flex; align-items: center; gap: var(--s3); padding: 0 var(--s2); }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--wash); border: 1px solid var(--line); display: grid; place-items: center;
  font-size: .8rem; font-weight: 600; flex: none; }
.me div { min-width: 0; }
.me strong, .me span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me span { color: var(--muted); font-size: .85rem; }
.side-foot form .linkbtn { padding: 0 var(--s2); display: flex; align-items: center; gap: var(--s2); text-decoration: none; color: var(--muted); }
.side-foot form .linkbtn:hover { color: var(--ink); }
.side-foot svg { width: 18px; height: 18px; }

/* Client switcher */
.switcher { position: relative; }
.switcher summary, .switcher-card { list-style: none; display: flex; align-items: center; gap: var(--s3); padding: var(--s2) var(--s3); min-height: 56px;
  border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; transition: border-color .15s var(--ease); }
.switcher summary::-webkit-details-marker { display: none; }
.switcher summary:hover { border-color: var(--line-strong); }
.switcher .grow { flex: 1; min-width: 0; }
.switcher .grow strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.switcher .grow span { display: block; font-size: .8rem; color: var(--muted); }
.switcher summary > svg { width: 16px; height: 16px; color: var(--muted); }
.switcher[open] summary > svg { transform: rotate(180deg); }
.switcher ul { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 6px); background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: 0 12px 32px rgba(0,0,0,.08); list-style: none; margin: 0; padding: var(--s2); max-height: 320px; overflow-y: auto; }
.switcher li a { display: flex; align-items: center; gap: var(--s3); min-height: 44px; padding: 0 var(--s2); border-radius: var(--radius-sm); text-decoration: none; }
.switcher li a:hover { background: var(--wash); }
.client-logo { width: 36px; height: 36px; border-radius: 8px; object-fit: contain; background: var(--paper); border: 1px solid var(--line); flex: none; }
.client-initials { width: 36px; height: 36px; border-radius: 8px; display: grid; place-items: center; font-size: .8rem; font-weight: 600;
  color: #fff; background: var(--client); flex: none; }

.main { min-width: 0; }
.topbar { display: none; }
.staff-banner { background: var(--sun); color: var(--ink); padding: var(--s2) var(--s6); font-size: .9rem; display: flex; gap: var(--s4);
  align-items: center; justify-content: space-between; flex-wrap: wrap; }
.staff-banner a { font-weight: 500; }
.content { padding: var(--s6) var(--s6) var(--s7); max-width: 1180px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s4); flex-wrap: wrap; margin-bottom: var(--s5); }
.page-head p { color: var(--muted); margin-top: var(--s2); max-width: 62ch; }
.client-head { display: flex; align-items: center; gap: var(--s4); margin-bottom: var(--s5); }
.client-head .client-logo, .client-head .client-initials { width: 56px; height: 56px; border-radius: 12px; font-size: 1.1rem; }
.client-head p { color: var(--muted); }
.client-head .bar { width: 4px; align-self: stretch; border-radius: 2px; background: var(--client); }

/* Cards, grids, tables */
.grid { display: grid; gap: var(--s4); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s5); }
.card h2 { margin-bottom: var(--s2); }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); margin-bottom: var(--s4); }
.stat .label { color: var(--muted); font-size: .875rem; font-weight: 400; }
.stat .value { font-size: 2rem; font-weight: 600; font-variant-numeric: tabular-nums; margin-top: var(--s1); line-height: 1.1; }
.stat .value.blank { color: var(--line-strong); }
.stat .note { color: var(--muted); font-size: .85rem; margin-top: var(--s2); }
.empty { text-align: center; padding: var(--s7) var(--s5); }
.empty .icon-wrap { width: 56px; height: 56px; border-radius: 50%; background: var(--wash); display: grid; place-items: center; margin: 0 auto var(--s4); }
.empty .icon-wrap svg { width: 26px; height: 26px; }
.empty p { color: var(--muted); max-width: 52ch; margin: var(--s2) auto 0; }
.soon { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 500; padding: 3px 10px; border-radius: 999px;
  background: var(--sun); color: var(--ink); }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; gap: var(--s3); align-items: flex-start; padding: var(--s3) 0; border-top: 1px solid var(--line); }
.list li:first-child { border-top: 0; }
.list svg { width: 20px; height: 20px; color: var(--muted); flex: none; margin-top: 2px; }

.table-wrap { overflow-x: auto; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th, td { text-align: left; padding: var(--s3) var(--s4); border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-weight: 500; color: var(--muted); font-size: .85rem; background: #fbfbfa; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td.actions { text-align: right; white-space: nowrap; }
td.actions form { display: inline-flex; gap: var(--s2); align-items: center; }
td.actions select { width: auto; min-height: 36px; padding: 4px 10px; }
.client-cell { display: flex; align-items: center; gap: var(--s3); }
.client-cell a { font-weight: 500; text-decoration: none; }
.client-cell a:hover { text-decoration: underline; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: .78rem; padding: 2px 10px; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--ink); white-space: nowrap; }
.chip.off { border-style: dashed; color: var(--muted); }
.chip.ok { background: var(--ok-bg); border-color: #b9dfc8; color: #0d5a2e; }
.chip.warn { background: var(--warn-bg); border-color: #f1dc9c; color: #6b4600; }
.toolbar { display: flex; gap: var(--s3); align-items: center; flex-wrap: wrap; margin-bottom: var(--s4); }
.toolbar form { display: flex; gap: var(--s2); flex: 1; max-width: 420px; }

.tabs-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: var(--s3); }
.tabs-pick .check { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: var(--s3) var(--s4); margin: 0; transition: border-color .15s var(--ease); }
.tabs-pick .check:has(input:checked) { border-color: var(--ink); background: #fbfbfa; }
.tabs-pick .check span { color: var(--muted); font-size: .85rem; display: block; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 var(--s5); }
.form-grid .full { grid-column: 1 / -1; }
.section { margin-top: var(--s6); }
.section > h2 { margin-bottom: var(--s3); }
.inline-form { display: grid; grid-template-columns: 1fr 1.4fr 160px auto; gap: var(--s3); align-items: end; }
.inline-form .field { margin: 0; }
.current-logo { display: flex; align-items: center; gap: var(--s3); margin-bottom: var(--s2); }

@media (max-width: 1024px) {
  .grid.cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { display: none; }
  .topbar { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: var(--s3) var(--s4);
    background: var(--paper); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; }
  .topbar > details > summary { list-style: none; min-height: 44px; min-width: 44px; display: grid; place-items: center; cursor: pointer; border-radius: var(--radius-sm); }
  .topbar > details > summary::-webkit-details-marker { display: none; }
  .topbar > details > summary svg { width: 24px; height: 24px; }
  .topbar > details[open] > .mobile-menu { display: flex; }
  .mobile-menu { display: none; position: fixed; inset: 69px 0 0 0; background: var(--paper); flex-direction: column; gap: var(--s5);
    padding: var(--s5) var(--s4); overflow-y: auto; }
  .content { padding: var(--s5) var(--s4) var(--s7); }
  .staff-banner { padding: var(--s2) var(--s4); }
  .grid.cols-3, .grid.cols-2, .form-grid { grid-template-columns: 1fr; }
  .inline-form { grid-template-columns: 1fr; }
  .hide-sm { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; animation-duration: 0s !important; }
}

.auth-card details { margin-bottom: var(--s4); }
.auth-card details summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; }
.auth-card details p { margin-top: var(--s2); }

/* ---------- Phase 2: Website tab ---------- */
.chip svg { width: 14px; height: 14px; display: inline-block; vertical-align: -2px; margin-right: 4px; }
.chip.accent { background: #fbe9ef; border-color: #f0bccd; color: var(--accent-ink); font-weight: 500; }
.chip.bad { background: var(--bad-bg); border-color: #f4c7c2; color: #8f1c13; }
.accent-text { color: var(--accent-ink); font-weight: 600; }
.trend { font-weight: 600; font-variant-numeric: tabular-nums; }
.trend.up { color: var(--ok); }
.trend.down { color: var(--bad); }
.alert svg { width: 18px; height: 18px; display: inline-block; vertical-align: -3px; }
.actions-row { display: flex; flex-wrap: wrap; gap: var(--s3); align-items: center; }
.actions-row form { margin: 0; }
.form-narrow { max-width: 720px; }
.mono { font-family: ui-monospace, Menlo, monospace; font-size: .9rem; }
.pre { white-space: normal; overflow-wrap: anywhere; }
.subcard { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: var(--s4); }
.reading form { display: inline; }
.reading .linkbtn { min-height: 0; }
.seg { display: inline-flex; gap: 4px; padding: 4px; background: var(--paper); border: 1px solid var(--line); border-radius: 999px; flex-wrap: wrap; }
.seg a { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 var(--s4); border-radius: 999px; text-decoration: none; font-weight: 500; font-size: .95rem; }
.seg a:hover { background: var(--wash); }
.seg a[aria-current=page] { background: var(--ink); color: #fff; }
.seg .count { font-size: .78rem; padding: 0 7px; border-radius: 999px; background: var(--wash); color: var(--ink); }
.seg a[aria-current=page] .count { background: rgba(255,255,255,.2); color: #fff; }
.nav-count { margin-left: auto; font-size: .75rem; font-weight: 600; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px;
  background: var(--sun); color: var(--ink); display: inline-grid; place-items: center; }
.req-list { list-style: none; margin: 0; padding: 0; }
.req-list li + li { border-top: 1px solid var(--line); }
.req-row { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) var(--s2); min-height: 56px; text-decoration: none; border-radius: var(--radius-sm); transition: background .15s var(--ease); }
.req-row:hover { background: var(--wash); }
.req-row .grow { flex: 1; min-width: 0; }
.req-row strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.req-num { color: var(--muted); font-variant-numeric: tabular-nums; min-width: 2.5em; }
.detail-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); }
.timeline { list-style: none; margin: var(--s3) 0 0; padding: 0; display: grid; gap: var(--s3); }
.ev { border-left: 2px solid var(--line); padding: 2px 0 2px var(--s4); }
.ev-preview, .ev-published { border-left-color: var(--accent); }
.ev-needs_team, .ev-error { border-left-color: var(--sun); }
.ev.internal { background: #fffbea; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; padding-top: var(--s2); padding-bottom: var(--s2); }
.ev-head { display: flex; flex-wrap: wrap; gap: 4px var(--s2); align-items: baseline; }
.ev-text { margin-top: 4px; overflow-wrap: anywhere; }
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s4); }
.compare figure { margin: 0; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; background: var(--wash); }
.compare figcaption { display: flex; justify-content: space-between; align-items: center; padding: var(--s2) var(--s3); background: var(--paper); border-bottom: 1px solid var(--line); font-weight: 500; }
.compare figcaption a { display: inline-flex; gap: 4px; align-items: center; font-size: .9rem; min-height: 32px; }
.compare figcaption svg { width: 14px; height: 14px; }
.compare iframe { display: block; width: 100%; height: 560px; border: 0; background: #fff; }
.frame-empty { height: 560px; display: grid; place-items: center; padding: var(--s5); text-align: center; }
.approve-row { display: flex; gap: var(--s3); align-items: flex-start; flex-wrap: wrap; margin-top: var(--s4); }
.approve-row details { flex: 1; min-width: 260px; }
.approve-row summary { list-style: none; }
.approve-row summary::-webkit-details-marker { display: none; }
/* bars */
.bars { list-style: none; margin: var(--s4) 0 var(--s3); padding: 0; display: grid; gap: var(--s2); }
.bars li { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) auto; gap: var(--s3); align-items: center; font-size: .92rem; }
.bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 14px; display: block; }
.bar { display: block; height: 14px; background: var(--ink); border-radius: 0 4px 4px 0; }
.bar-value { font-variant-numeric: tabular-nums; color: var(--muted); min-width: 3ch; text-align: right; }
/* uptime strip */
.uptime-strip { list-style: none; margin: var(--s4) 0 var(--s2); padding: 0; display: grid; grid-template-columns: repeat(30, minmax(0, 1fr)); gap: 3px; }
.uptime-strip li { height: 32px; border-radius: 3px; }
.u-up { background: var(--ok); }
.u-blip { background: #e0a400; }
.u-down { background: var(--bad); }
.u-none { background: var(--line); }
.strip-legend { display: flex; gap: var(--s4); flex-wrap: wrap; }
.strip-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
/* visitors chart */
.chart { margin: 0; position: relative; }
.chart svg { width: 100%; height: auto; overflow: visible; font-family: var(--font); }
.chart svg:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis { fill: var(--muted); font-size: 11px; }
.chart .area { fill: var(--accent); opacity: .1; }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.chart .end-dot { fill: var(--accent); stroke: var(--paper); stroke-width: 2; }
.chart .end-label { fill: var(--ink); font-size: 12px; font-weight: 600; }
.chart .cross { stroke: var(--ink); stroke-width: 1; opacity: 0; pointer-events: none; }
.chart .hover-dot { fill: var(--accent); stroke: var(--paper); stroke-width: 2; opacity: 0; pointer-events: none; }
.chart .tip { position: absolute; top: 0; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 6px 10px; border-radius: var(--radius-sm);
  font-size: .85rem; pointer-events: none; white-space: nowrap; display: grid; }
.chart .tip span { opacity: .8; font-size: .8rem; }
.table-view { margin-top: var(--s3); font-size: .9rem; }
.table-view summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; color: var(--muted); }
.table-view table { max-width: 360px; }
@media (max-width: 860px) {
  .detail-grid, .compare { grid-template-columns: 1fr; }
  .compare iframe, .frame-empty { height: 420px; }
  .uptime-strip li { height: 24px; }
  .bars li { grid-template-columns: minmax(0, 1fr) auto; }
  .bars .bar-track { grid-column: 1 / -1; grid-row: 2; }
}
.bar-w1 { width: 1%; }
.bar-w2 { width: 2%; }
.bar-w3 { width: 3%; }
.bar-w4 { width: 4%; }
.bar-w5 { width: 5%; }
.bar-w6 { width: 6%; }
.bar-w7 { width: 7%; }
.bar-w8 { width: 8%; }
.bar-w9 { width: 9%; }
.bar-w10 { width: 10%; }
.bar-w11 { width: 11%; }
.bar-w12 { width: 12%; }
.bar-w13 { width: 13%; }
.bar-w14 { width: 14%; }
.bar-w15 { width: 15%; }
.bar-w16 { width: 16%; }
.bar-w17 { width: 17%; }
.bar-w18 { width: 18%; }
.bar-w19 { width: 19%; }
.bar-w20 { width: 20%; }
.bar-w21 { width: 21%; }
.bar-w22 { width: 22%; }
.bar-w23 { width: 23%; }
.bar-w24 { width: 24%; }
.bar-w25 { width: 25%; }
.bar-w26 { width: 26%; }
.bar-w27 { width: 27%; }
.bar-w28 { width: 28%; }
.bar-w29 { width: 29%; }
.bar-w30 { width: 30%; }
.bar-w31 { width: 31%; }
.bar-w32 { width: 32%; }
.bar-w33 { width: 33%; }
.bar-w34 { width: 34%; }
.bar-w35 { width: 35%; }
.bar-w36 { width: 36%; }
.bar-w37 { width: 37%; }
.bar-w38 { width: 38%; }
.bar-w39 { width: 39%; }
.bar-w40 { width: 40%; }
.bar-w41 { width: 41%; }
.bar-w42 { width: 42%; }
.bar-w43 { width: 43%; }
.bar-w44 { width: 44%; }
.bar-w45 { width: 45%; }
.bar-w46 { width: 46%; }
.bar-w47 { width: 47%; }
.bar-w48 { width: 48%; }
.bar-w49 { width: 49%; }
.bar-w50 { width: 50%; }
.bar-w51 { width: 51%; }
.bar-w52 { width: 52%; }
.bar-w53 { width: 53%; }
.bar-w54 { width: 54%; }
.bar-w55 { width: 55%; }
.bar-w56 { width: 56%; }
.bar-w57 { width: 57%; }
.bar-w58 { width: 58%; }
.bar-w59 { width: 59%; }
.bar-w60 { width: 60%; }
.bar-w61 { width: 61%; }
.bar-w62 { width: 62%; }
.bar-w63 { width: 63%; }
.bar-w64 { width: 64%; }
.bar-w65 { width: 65%; }
.bar-w66 { width: 66%; }
.bar-w67 { width: 67%; }
.bar-w68 { width: 68%; }
.bar-w69 { width: 69%; }
.bar-w70 { width: 70%; }
.bar-w71 { width: 71%; }
.bar-w72 { width: 72%; }
.bar-w73 { width: 73%; }
.bar-w74 { width: 74%; }
.bar-w75 { width: 75%; }
.bar-w76 { width: 76%; }
.bar-w77 { width: 77%; }
.bar-w78 { width: 78%; }
.bar-w79 { width: 79%; }
.bar-w80 { width: 80%; }
.bar-w81 { width: 81%; }
.bar-w82 { width: 82%; }
.bar-w83 { width: 83%; }
.bar-w84 { width: 84%; }
.bar-w85 { width: 85%; }
.bar-w86 { width: 86%; }
.bar-w87 { width: 87%; }
.bar-w88 { width: 88%; }
.bar-w89 { width: 89%; }
.bar-w90 { width: 90%; }
.bar-w91 { width: 91%; }
.bar-w92 { width: 92%; }
.bar-w93 { width: 93%; }
.bar-w94 { width: 94%; }
.bar-w95 { width: 95%; }
.bar-w96 { width: 96%; }
.bar-w97 { width: 97%; }
.bar-w98 { width: 98%; }
.bar-w99 { width: 99%; }
.bar-w100 { width: 100%; }
.chart .tip[hidden] { display: none; }

/* ---------- Phase 3: customer service + notifications ---------- */
.support-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); align-items: start; }
.small-seg a { min-height: 32px; font-size: .85rem; padding: 0 var(--s3); }
.convo { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s4); }
.msg { max-width: 82%; border-radius: var(--radius); padding: var(--s3) var(--s4); border: 1px solid var(--line); background: var(--wash); }
.msg.us { justify-self: end; background: var(--paper); border-color: var(--line-strong); }
.msg.them { justify-self: start; }
.msg.internal { background: #fffbea; border-color: #f1dc9c; max-width: 100%; justify-self: stretch; }
.msg-head { display: flex; flex-wrap: wrap; gap: 4px var(--s2); align-items: baseline; margin-bottom: 4px; }
.msg-body { overflow-wrap: anywhere; }
.msg-files { list-style: none; margin: var(--s2) 0 0; padding: 0; display: grid; gap: 4px; font-size: .9rem; }
.msg-files li { display: flex; gap: 6px; align-items: center; }
.msg-files svg { width: 16px; height: 16px; color: var(--muted); }
.reply-box { margin-top: var(--s5); border-top: 1px solid var(--line); padding-top: var(--s4); }
.file-inline { display: inline-flex; gap: var(--s2); align-items: center; color: var(--muted); }
.bell { display: flex; align-items: center; gap: var(--s3); min-height: 44px; padding: 0 var(--s2); border-radius: var(--radius-sm); text-decoration: none; font-weight: 500; }
.bell:hover, .bell[aria-current=page] { background: var(--wash); }
.bell svg { width: 20px; height: 20px; color: var(--muted); }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); flex: none; }
@media (max-width: 860px) { .support-grid { grid-template-columns: 1fr; } .msg { max-width: 100%; } }
.dot.read { background: transparent; }
.support-grid .req-row strong { white-space: normal; }

/* ---------- Phase 4: design, social, setup ---------- */
.stepper { list-style: none; margin: 0 0 var(--s4); padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s2); counter-reset: step; }
.stepper li { position: relative; padding: var(--s3) var(--s3) var(--s3) 44px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--paper); font-weight: 500; font-size: .92rem; color: var(--muted); counter-increment: step; }
.stepper li::before { content: counter(step); position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: .78rem; background: var(--wash); color: var(--muted); }
.stepper li.done { color: var(--ink); }
.stepper li.done::before { content: "✓"; background: var(--ok); color: #fff; }
.stepper li.now { color: var(--ink); border-color: var(--ink); }
.stepper li.now::before { background: var(--ink); color: #fff; }
.question-card { border-color: var(--sun); box-shadow: inset 4px 0 0 var(--sun); }
.design-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: var(--s4); }
.design-file { margin: 0; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; background: var(--wash); display: flex; flex-direction: column; }
.design-file img { width: 100%; height: 220px; object-fit: contain; background: repeating-conic-gradient(#f1f1ef 0% 25%, #fff 0% 50%) 50% / 16px 16px; }
.design-file figcaption { display: flex; justify-content: space-between; align-items: center; gap: var(--s2); padding: var(--s2) var(--s3); background: var(--paper); border-top: 1px solid var(--line); flex-wrap: wrap; }
.file-tile { height: 220px; display: grid; place-items: center; align-content: center; gap: var(--s2); color: var(--muted); padding: var(--s3); text-align: center; overflow-wrap: anywhere; }
.file-tile svg { width: 32px; height: 32px; }
.brand-logo { max-height: 72px; max-width: 220px; object-fit: contain; margin-bottom: var(--s3); }
.swatches { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--s3); }
.swatches li { display: grid; justify-items: center; gap: 4px; }
.swatch { width: 40px; height: 40px; border-radius: 8px; border: 1px solid var(--line); background: var(--wash); display: block; }
.cal { list-style: none; margin: 0; padding: 0; }
.cal li + li { border-top: 1px solid var(--line); }
.cal-date { width: 48px; text-align: center; display: grid; line-height: 1.1; }
.cal-date strong { font-size: 1.4rem; }
.cal-date span { font-size: .75rem; text-transform: uppercase; color: var(--muted); letter-spacing: .05em; }
.caption { white-space: normal; background: var(--wash); border-radius: var(--radius-sm); padding: var(--s3) var(--s4); margin-top: var(--s3); overflow-wrap: anywhere; }
.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li { display: flex; gap: var(--s3); align-items: flex-start; padding: var(--s3) 0; border-top: 1px solid var(--line); }
.checklist li:first-child { border-top: 0; }
.checklist .tick { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line-strong); flex: none; display: grid; place-items: center; margin-top: 2px; }
.checklist .is-done .tick { background: var(--ok); border-color: var(--ok); color: #fff; }
.checklist .tick svg { width: 14px; height: 14px; }
.checklist .is-waiting .tick { border-style: dashed; }
@media (max-width: 860px) { .stepper { grid-template-columns: 1fr 1fr; } }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px var(--s4); margin: 0; font-size: .92rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.cond-fields[hidden] { display: none; }
fieldset.field { border: 0; padding: 0; margin: 0 0 var(--s4); min-width: 0; }
fieldset.field legend { padding: 0; margin-bottom: 6px; }
fieldset.subcard legend { padding: 0 var(--s2); }

/* ---------- house styles ---------- */
.style-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: var(--s3); margin-top: var(--s2); }
.style-grid.admin { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--s4); }
.style-card { position: relative; display: grid; gap: 6px; padding: var(--s3); border: 1px solid var(--line); border-radius: var(--radius-sm); cursor: pointer; background: var(--paper); transition: border-color .15s var(--ease); }
.style-card:hover { border-color: var(--line-strong); }
.style-card:has(input:checked) { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.style-card:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }
.style-card input { position: absolute; top: 10px; right: 10px; width: 18px; height: 18px; accent-color: var(--ink); }
.style-card img, .style-none { width: 100%; height: 130px; object-fit: cover; border-radius: 4px; background: var(--wash); }
.style-none { display: grid; place-items: center; font-size: 2rem; font-weight: 600; color: var(--muted); }
.style-admin img { width: 100%; height: 200px; object-fit: cover; border-radius: var(--radius-sm); margin-bottom: var(--s3); background: var(--wash); }
.style-admin.off { opacity: .6; }

/* ---------- ClickUp archive ---------- */
.archive-filters { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1.2fr) 140px auto auto; gap: var(--s3); align-items: end; }
.archive-filters .field, .archive-filters .check { margin: 0; }
.pager { display: flex; gap: var(--s3); align-items: center; justify-content: center; margin-top: var(--s4); }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px var(--s4); margin: var(--s3) 0 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.box { width: 16px; height: 16px; border: 1.5px solid var(--line-strong); border-radius: 3px; flex: none; margin-top: 3px; }
@media (max-width: 860px) { .archive-filters { grid-template-columns: 1fr; } }
label.check[hidden], [data-other-size][hidden], [data-print-size][hidden] { display: none; }

/* ---------- SEO ---------- */
.stat .value .of { font-size: 1rem; color: var(--muted); font-weight: 400; }
.summary-card { font-size: 1.1rem; line-height: 1.6; border-left: 4px solid var(--accent); }
@media print {
  .side, .topbar, .staff-banner, .print-btn, .skip { display: none !important; }
  .shell { display: block; }
  body { background: #fff; }
  .card { break-inside: avoid; border-color: #ccc; }
  .content { padding: 0; max-width: none; }
}
.req-row > svg { width: 20px; height: 20px; flex: none; color: var(--muted); }
.req-row .grow > span { display: block; }
/* Admin: per-client page bar */
.client-tabs { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; margin: 0 0 var(--s5); background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
.client-tabs a { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 var(--s4); border-radius: var(--radius-sm); text-decoration: none; font-weight: 500; font-size: .95rem; }
.client-tabs a svg { width: 16px; height: 16px; color: var(--muted); }
.client-tabs a:hover { background: var(--wash); }
.client-tabs a[aria-current=page] { background: var(--ink); color: #fff; }
.client-tabs a[aria-current=page] svg { color: #fff; }
.client-tabs .client-tabs-out { margin-left: auto; }
@media (max-width: 860px) { .client-tabs .client-tabs-out { margin-left: 0; } }
.brand-upload { display: grid; grid-template-columns: minmax(200px, 1fr) minmax(220px, 1.3fr) minmax(200px, 1.3fr) auto; gap: var(--s3); align-items: end; }
.brand-upload .field { margin: 0; }
@media (max-width: 1100px) { .brand-upload { grid-template-columns: 1fr 1fr; } }
@media (max-width: 860px) { .brand-upload { grid-template-columns: 1fr; } }

.yoy { border-top: 1px solid var(--line); padding-top: var(--s3); }
.card-head .seg { flex-wrap: wrap; }

/* ---------- Insights ---------- */
.insights { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--s4); }
.insight { display: flex; flex-direction: column; gap: var(--s2); }
.insight-best_day { grid-column: 1 / -1; border-left: 4px solid var(--accent); }
.insight-value { font-size: 1.5rem; font-weight: 600; line-height: 1.2; overflow-wrap: anywhere; }
.insight-body { color: var(--ink); }
.insight-best_day .insight-body { font-size: 1.05rem; max-width: 80ch; }
.insight-list { margin: 0; padding-left: 1.1em; display: grid; gap: 4px; font-size: .92rem; }
.steps-bars { list-style: none; margin: var(--s2) 0 0; padding: 0; display: grid; gap: 6px; }
.steps-bars li { display: grid; grid-template-columns: 110px minmax(0, 1fr) auto; gap: var(--s3); align-items: center; font-size: .9rem; }
.compare.compare-single { grid-template-columns: 1fr; }
.compare.compare-single iframe { height: 720px; }

/* ---------- site control ---------- */
.action-list { list-style: none; margin: 0; padding: 0; }
.action-row { display: flex; gap: var(--s4); align-items: flex-start; padding: var(--s3) 0; border-top: 1px solid var(--line); }
.action-row:first-child { border-top: 0; }
.action-row .grow { flex: 1; min-width: 0; }
pre.code { background: var(--wash); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: var(--s3); overflow: auto; font-size: .82rem; max-height: 420px; white-space: pre-wrap; overflow-wrap: anywhere; }
pre.log { max-height: 600px; }
textarea.code-edit { font-size: .85rem; line-height: 1.45; tab-size: 4; white-space: pre; overflow: auto; }
.small-value { font-size: 1.2rem !important; }
