/* Brand fonts, served by SiteWatch itself (downloaded once on first start, see lib/fonts.js) */
@font-face { font-family: 'DM Sans'; font-style: normal; font-weight: 400; font-display: swap; src: url('/assets/fonts/dm-sans-400.woff2') format('woff2'); }
@font-face { font-family: 'DM Sans'; font-style: normal; font-weight: 500; font-display: swap; src: url('/assets/fonts/dm-sans-500.woff2') format('woff2'); }
@font-face { font-family: 'DM Sans'; font-style: normal; font-weight: 600; font-display: swap; src: url('/assets/fonts/dm-sans-600.woff2') format('woff2'); }
@font-face { font-family: 'Inter Tight'; font-style: normal; font-weight: 300; font-display: swap; src: url('/assets/fonts/inter-tight-300.woff2') format('woff2'); }
@font-face { font-family: 'Inter Tight'; font-style: normal; font-weight: 400; font-display: swap; src: url('/assets/fonts/inter-tight-400.woff2') format('woff2'); }
@font-face { font-family: 'Inter Tight'; font-style: normal; font-weight: 600; font-display: swap; src: url('/assets/fonts/inter-tight-600.woff2') format('woff2'); }

/* We are Pixelate brand: light first, dark as a toggle. Terracotta is the one brand colour (actions, wordmark square).
   Status colours (green / amber / red) are functional and sit alongside it. */
:root {
  --bg: #F6F5F2; --panel: #FFFFFF; --panel-2: #FAF9F7; --line: #ECEAE6; --line-2: #E0DDD7;
  --text: #161616; --muted: #6B6A66; --faint: #8E8C86; --idle: #DAD7D0;
  --up: #2E9E5E; --up-bg: #E7F4EC;
  --down: #D92D20; --down-bg: #FDECEA;
  --warn: #B76E00; --warn-bg: #FDF3E1;
  --info: #6B6A66; --info-bg: #F1EFEA;
  --accent: #C14B24; --accent-deep: #A63E1C; --accent-ink: #FFFFFF; --accent-wash: rgba(193,75,36,.07);
  --page-max: 1440px; --radius: 16px; --shadow: 0 30px 60px -30px rgba(0,0,0,.25);
  --display: "Inter Display", "Inter Tight", "Helvetica Neue", Arial, sans-serif;
  --body: "DM Sans", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #111111; --panel: #191919; --panel-2: #1F1F1F; --line: #262626; --line-2: #333331;
  --text: #F1F0EC; --muted: #A5A49E; --faint: #7A7974; --idle: #3A3A38;
  --up: #4CC283; --up-bg: rgba(76,194,131,.13);
  --down: #F0705F; --down-bg: rgba(240,112,95,.14);
  --warn: #F0B44A; --warn-bg: rgba(240,180,74,.13);
  --info: #A5A49E; --info-bg: rgba(255,255,255,.06);
  --accent: #D98F77; --accent-deep: #E8A58F; --accent-ink: #111111; --accent-wash: rgba(217,143,119,.09);
  --shadow: 0 30px 60px -30px rgba(0,0,0,.7);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 var(--body); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.muted { color: var(--muted); } .faint { color: var(--faint); }
.hidden { display: none !important; }

/* ---- Top bar ---- */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px; padding: 12px max(24px, calc((100% - var(--page-max)) / 2 + 24px)); background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
/* Sub-brand lockup (We are Pixelate guidelines, "Sub-brands"): wordmark · hairline · product name */
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; color: var(--text); }
.brand .wm { font-family: var(--display); font-size: 24px; letter-spacing: -0.04em; line-height: 1; white-space: nowrap; }
.brand .wm b { font-weight: 600; } .brand .wm span { font-weight: 300; }
.brand .wm i { display: inline-block; width: 5px; height: 5px; background: var(--accent); margin-left: 2px; }
.brand .rule { width: 1px; height: 24px; background: var(--line-2); }
.brand .product { font-family: var(--display); font-weight: 300; font-size: 21px; letter-spacing: -0.03em; line-height: 1; }
@media (max-width: 640px) { .brand .wm { font-size: 20px; } .brand .product { font-size: 18px; } .brand { gap: 10px; } }
.pill { display: inline-flex; align-items: center; gap: 7px; padding: 4px 10px; border-radius: 99px; font-size: 12.5px; font-weight: 550; background: var(--panel-2); border: 1px solid var(--line); white-space: nowrap; }
.pill.up { color: var(--up); background: var(--up-bg); border-color: transparent; }
.pill.down { color: var(--down); background: var(--down-bg); border-color: transparent; }
.pill.warn { color: var(--warn); background: var(--warn-bg); border-color: transparent; }
.spacer { flex: 1; }
.search { width: 240px; padding: 7px 10px 7px 32px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' stroke='%238a93a3' stroke-width='2'%3E%3Ccircle cx='6' cy='6' r='4.5'/%3E%3Cpath d='m9.5 9.5 3 3'/%3E%3C/svg%3E") no-repeat 11px center; outline: none; }
.search:focus { border-color: var(--accent); }

.btn { text-decoration: none; display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--panel); cursor: pointer; font-weight: 550; font-size: 13px; white-space: nowrap; }
.btn:hover { border-color: var(--faint); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--down); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--panel-2); }
.btn.sm { padding: 4px 9px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: default; }
.icon-btn { width: 32px; height: 32px; display: grid; place-items: center; padding: 0; }

/* ---- Layout ---- */
main { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; padding: 20px 24px 40px; max-width: var(--page-max); margin: 0 auto; }
@media (max-width: 1100px) { main { grid-template-columns: minmax(0, 1fr); } }

.stats { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
@media (max-width: 1100px) { .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 800px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.stat .label { color: var(--muted); font-size: 12px; font-weight: 500; }
.stat .value { font-size: 24px; font-weight: 650; letter-spacing: -.02em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat .value small { font-size: 13px; color: var(--muted); font-weight: 500; margin-left: 2px; }
.stat.down .value { color: var(--down); } .stat.up .value { color: var(--up); } .stat.warn .value { color: var(--warn); }

.toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.chips { display: flex; gap: 4px; background: var(--panel); border: 1px solid var(--line); padding: 3px; border-radius: 9px; }
.chip { border: 0; background: transparent; padding: 4px 10px; border-radius: 6px; cursor: pointer; color: var(--muted); font-size: 12.5px; font-weight: 550; }
.chip.on { background: var(--panel-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }
.chip .n { color: var(--faint); margin-left: 4px; font-variant-numeric: tabular-nums; }

/* ---- Monitor list ---- */
.list { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.row { display: grid; grid-template-columns: 22px minmax(180px, 1.6fr) minmax(160px, 1.4fr) 76px 130px 76px 76px 92px; align-items: center; gap: 14px; padding: 12px 16px; border-top: 1px solid var(--line); cursor: pointer; }
.row:first-child { border-top: 0; }
.row:hover { background: var(--panel-2); }
.row.head { cursor: default; background: var(--panel-2); color: var(--faint); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; padding: 8px 16px; }
.row.head:hover { background: var(--panel-2); }
@media (max-width: 900px) { .row { grid-template-columns: 22px 1fr 76px 92px; } .row > .c-bars, .row > .c-spark, .row > .c-ssl, .row > .c-dom { display: none; } }
.name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.url { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.flags { display: inline-flex; gap: 4px; margin-left: 6px; vertical-align: 1px; }
.flag { font-size: 10px; font-weight: 650; letter-spacing: .03em; padding: 1px 5px; border-radius: 4px; background: var(--panel-2); color: var(--faint); border: 1px solid var(--line); }
.flag.alert { color: var(--warn); border-color: transparent; background: var(--warn-bg); }
.num { font-variant-numeric: tabular-nums; text-align: right; }
.empty { padding: 60px 20px; text-align: center; color: var(--muted); }
.empty h3 { color: var(--text); margin: 0 0 6px; font-size: 16px; }

.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--idle); position: relative; }
.dot.up { background: var(--up); }
.dot.down { background: var(--down); }
.dot.down::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--down); animation: ping 1.6s ease-out infinite; }
.dot.degraded { background: var(--warn); }
.dot.paused { background: transparent; box-shadow: inset 0 0 0 2px var(--idle); }
@keyframes ping { from { opacity: .8; transform: scale(.6); } to { opacity: 0; transform: scale(1.6); } }

.bars { display: flex; gap: 2px; height: 26px; align-items: stretch; }
.bars i { flex: 1 1 0; min-width: 0; border-radius: 2px; background: var(--idle); opacity: .55; }
.bars i.ok { background: var(--up); opacity: 1; }
.bars i.part { background: var(--warn); opacity: 1; }
.bars i.bad { background: var(--down); opacity: 1; }
.bars.tall { height: 34px; gap: 3px; }

.badge { display: inline-block; padding: 2px 7px; border-radius: 5px; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; background: var(--panel-2); color: var(--muted); }
.badge.up { background: var(--up-bg); color: var(--up); } .badge.warn { background: var(--warn-bg); color: var(--warn); } .badge.down { background: var(--down-bg); color: var(--down); } .badge.info { background: var(--info-bg); color: var(--info); }

.spark { display: flex; align-items: center; gap: 8px; }
.spark svg { flex: 1; height: 26px; }
.spark .ms { font-size: 12px; color: var(--muted); width: 54px; text-align: right; font-variant-numeric: tabular-nums; }

/* ---- Activity ---- */
.side h2, .section-title { font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--faint); margin: 2px 0 10px; font-weight: 650; }
.feed { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); max-height: calc(100vh - 120px); overflow: auto; position: sticky; top: 76px; }
.ev { display: grid; grid-template-columns: 8px 1fr; gap: 10px; padding: 11px 14px; border-top: 1px solid var(--line); }
.ev:first-child { border-top: 0; }
.ev .bar { border-radius: 4px; background: var(--idle); }
.ev.down .bar { background: var(--down); } .ev.up .bar { background: var(--up); } .ev.warn .bar { background: var(--warn); } .ev.info .bar { background: var(--info); }
.ev .t { font-size: 11.5px; color: var(--faint); }
.ev .who { font-weight: 600; font-size: 13px; }
.ev .msg { font-size: 13px; color: var(--muted); }

/* ---- Drawer ---- */
.scrim { position: fixed; inset: 0; background: rgba(5,8,12,.55); z-index: 40; opacity: 0; pointer-events: none; transition: opacity .18s; }
.scrim.on { opacity: 1; pointer-events: auto; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(760px, 100vw); background: var(--bg); border-left: 1px solid var(--line); z-index: 50; transform: translateX(100%); transition: transform .22s cubic-bezier(.2,.8,.2,1); display: flex; flex-direction: column; box-shadow: var(--shadow); }
.drawer.on { transform: none; }
.d-head { padding: 18px 22px 0; border-bottom: 1px solid var(--line); }
.d-title { display: flex; align-items: center; gap: 12px; }
.d-title h2 { margin: 0; font-size: 19px; letter-spacing: -.01em; min-width: 0; overflow-wrap: anywhere; line-height: 1.1; }
.d-title > .pill, .d-title > .btn { flex: none; }
.d-head { min-width: 0; } .d-head .url { overflow-wrap: anywhere; }
.d-actions { display: flex; gap: 6px; margin: 12px 0 14px; flex-wrap: wrap; }
.tabs { display: flex; gap: 2px; margin-bottom: -1px; overflow-x: auto; }
.tab { border: 0; background: none; padding: 9px 12px; cursor: pointer; color: var(--muted); font-weight: 550; border-bottom: 2px solid transparent; white-space: nowrap; }
.tab.on { color: var(--text); border-color: var(--accent); }
.tab .dotmini { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--warn); margin-left: 6px; vertical-align: 2px; }
.d-body { flex: 1; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; padding: 20px 22px 40px; }
.cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 18px; }
@media (max-width: 640px) { .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.card .label { font-size: 11.5px; color: var(--muted); }
.card .value { font-size: 19px; font-weight: 650; margin-top: 2px; font-variant-numeric: tabular-nums; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }
.kv { margin: 0; display: grid; grid-template-columns: 150px 1fr; gap: 8px 14px; font-size: 13.5px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; word-break: break-word; }
.alertbox { border-radius: 8px; padding: 10px 12px; margin-bottom: 14px; font-size: 13.5px; }
.alertbox.down { background: var(--down-bg); color: var(--down); } .alertbox.warn { background: var(--warn-bg); color: var(--warn); } .alertbox.info { background: var(--info-bg); color: var(--info); }
.chart { width: 100%; height: 180px; display: block; }
.chart text { fill: var(--faint); font-size: 10.5px; font-family: inherit; }
.diff { font-family: var(--mono); font-size: 12.5px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); }
.diff div { padding: 3px 10px; white-space: pre-wrap; word-break: break-word; }
.diff .add { background: var(--up-bg); } .diff .add::before { content: "+ "; color: var(--up); }
.diff .rem { background: var(--down-bg); } .diff .rem::before { content: "− "; color: var(--down); }
.shots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (max-width: 640px) { .shots { grid-template-columns: 1fr; } }
.shot { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.shot .cap { font-size: 12px; color: var(--muted); padding: 7px 10px; border-bottom: 1px solid var(--line); }
.shot img { display: block; width: 100%; max-height: 420px; object-fit: cover; object-position: top; cursor: zoom-in; }
table.rec { width: 100%; border-collapse: collapse; font-size: 13px; }
table.rec td { padding: 6px 8px; border-top: 1px solid var(--line); vertical-align: top; }
table.rec td:first-child { color: var(--muted); width: 70px; font-weight: 600; }

/* ---- Modal / forms ---- */
.modal { position: fixed; inset: 0; z-index: 60; display: none; align-items: flex-start; justify-content: center; padding: 6vh 16px; background: rgba(5,8,12,.6); overflow: auto; }
.modal.on { display: flex; }
.dialog { width: min(680px, 100%); background: var(--panel); border: 1px solid var(--line-2); border-radius: 14px; box-shadow: var(--shadow); }
.dialog header { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.dialog header h3 { margin: 0; font-size: 16px; flex: 1; }
.dialog .body { padding: 18px 20px; }
.dialog footer { display: flex; gap: 8px; justify-content: flex-end; padding: 14px 20px; border-top: 1px solid var(--line); }
fieldset { border: 0; padding: 0; margin: 0 0 18px; }
legend { font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--faint); font-weight: 650; margin-bottom: 10px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
label.f { display: block; font-size: 12.5px; color: var(--muted); font-weight: 500; }
label.f > span { display: block; margin-bottom: 5px; }
.in { width: 100%; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--bg); outline: none; }
.in:focus { border-color: var(--accent); }
textarea.in { resize: vertical; min-height: 90px; font-family: var(--mono); font-size: 12.5px; }
.hint { font-size: 12px; color: var(--faint); margin-top: 4px; }
.toggle { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; margin-bottom: 8px; cursor: pointer; }
.toggle input { margin-top: 3px; accent-color: var(--accent); }
.toggle b { display: block; font-weight: 600; font-size: 13.5px; }
.toggle small { color: var(--muted); }
.toggle-extra { margin: -2px 0 10px 34px; }
details.adv summary { cursor: pointer; color: var(--muted); font-size: 13px; margin-bottom: 10px; }
.seg { display: inline-flex; background: var(--bg); border: 1px solid var(--line-2); border-radius: 8px; padding: 2px; margin-bottom: 16px; }
.seg button { border: 0; background: none; padding: 5px 12px; border-radius: 6px; cursor: pointer; color: var(--muted); font-weight: 550; }
.seg button.on { background: var(--panel-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }
.chan { border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin-bottom: 10px; }
.chan-row { display: flex; gap: 8px; align-items: center; margin-top: 10px; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--text); color: var(--bg); padding: 9px 14px; border-radius: 9px; font-weight: 550; opacity: 0; transition: .2s; z-index: 90; pointer-events: none; }
.toast.on { opacity: 1; transform: translateX(-50%); }
.lightbox { position: fixed; inset: 0; z-index: 95; background: rgba(0,0,0,.85); display: none; overflow: auto; padding: 30px; cursor: zoom-out; }
.lightbox.on { display: block; } .lightbox img { max-width: 100%; display: block; margin: 0 auto; }

/* ---- Code box with a copy icon in the corner ---- */
.codebox { position: relative; background: var(--bg); border: 1px solid var(--line-2); border-radius: 10px; }
.codebox .label { display: block; padding: 8px 44px 0 12px; font-size: 11.5px; color: var(--faint); font-family: inherit; }
.codebox pre { margin: 0; padding: 10px 44px 12px 12px; font-family: var(--mono); font-size: 12.5px; line-height: 1.5; white-space: pre-wrap; word-break: break-all; max-height: 180px; overflow: auto; color: var(--text); }
.codebox.inline { display: inline-flex; align-items: center; vertical-align: middle; }
.codebox.inline code { font-family: var(--mono); font-size: 12.5px; padding: 2px 34px 2px 9px; line-height: 1.6; white-space: nowrap; }
.copy-icon { position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; display: grid; place-items: center; border: 0; border-radius: 7px; background: transparent; color: var(--muted); cursor: pointer; }
.codebox.inline .copy-icon { top: 50%; transform: translateY(-50%); right: 3px; width: 26px; height: 26px; }
.copy-icon:hover { background: var(--panel-2); color: var(--text); }
.copy-icon svg { width: 16px; height: 16px; }
.copy-icon .ok { display: none; color: var(--up); }
.copy-icon.done .ok { display: block; } .copy-icon.done .cp { display: none; }

/* SiteWatch-managed (external) SSL pill in the site list */
.pill-ext { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; letter-spacing: 0; padding: 1px 8px 1px 6px; border-radius: 999px; background: var(--accent-wash); color: var(--accent-deep); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent); white-space: nowrap; }
.pill-ext svg { width: 11px; height: 11px; }

/* Display type: large and light, never bold (brand rule) */
.stat .value, .card .value, .d-title h2, .empty h3, .dialog header h3 { font-family: var(--display); font-weight: 300; letter-spacing: -0.03em; }
.stat .value { font-size: 30px; }
.d-title h2 { font-size: 26px; }
.dialog header h3 { font-size: 22px; }
.btn.primary:hover { background: var(--accent-deep); filter: none; }
.btn { border-radius: 999px; }
.chips, .seg { border-radius: 999px; } .chip, .seg button { border-radius: 999px; }

/* A checkbox and the settings it unlocks share one card */
.toggle-card { border: 1px solid var(--line); border-radius: 12px; margin-bottom: 8px; background: var(--panel); }
.toggle-card > .toggle { border: 0; margin: 0; border-radius: 12px; }
.toggle-card > .toggle-extra { margin: 0; padding: 14px 16px 16px 40px; border-top: 1px solid var(--line); }
.toggle-card > .toggle-extra > :last-child { margin-bottom: 0; }
.toggle-card:has(> .toggle input:checked) { border-color: var(--line-2); }

input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); }

/* ---- Notification channels ---- */
.chx { border: 1px solid var(--line); border-radius: 12px; margin-bottom: 8px; background: var(--panel); }
.chx .cr { display: flex; align-items: center; gap: 12px; padding: 12px 14px; cursor: pointer; }
.chx .ic { width: 34px; height: 34px; border-radius: 50%; background: var(--accent-wash); color: var(--accent); display: grid; place-items: center; flex-shrink: 0; }
.chx .ic svg, .picker .ic svg { width: 17px; height: 17px; }
.chx .meta { flex: 1; min-width: 0; }
.chx .nm { font-weight: 600; font-size: 14px; }
.chx .ds { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chx .ds.todo { color: var(--warn); }
.chx .scope { font-size: 11px; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--panel-2); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.chx .scope.down { background: var(--accent-wash); color: var(--accent-deep); border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
.chx .chev { color: var(--muted); transition: transform .15s; }
.chx.open .chev { transform: rotate(180deg); }
.chx .ex { border-top: 1px solid var(--line); padding: 14px 16px 16px 60px; }
.chx.off .ic, .chx.off .nm, .chx.off .ds { opacity: .55; }
.sw { width: 36px; height: 21px; border-radius: 999px; background: var(--idle); position: relative; border: 0; padding: 0; cursor: pointer; flex-shrink: 0; }
.sw::after { content: ""; position: absolute; left: 2px; top: 2px; width: 17px; height: 17px; border-radius: 50%; background: #fff; transition: left .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.sw[aria-checked="true"] { background: var(--accent); }
.sw[aria-checked="true"]::after { left: 17px; }
.seg.sm { margin: 4px 0 0; } .seg.sm button { font-size: 12.5px; padding: 4px 12px; }
.picker { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 560px) { .picker { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.picker button { border: 1px solid var(--line); border-radius: 12px; background: var(--panel); padding: 14px 8px; cursor: pointer; font-size: 13px; font-weight: 500; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.picker button:hover { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.picker button:disabled { cursor: default; color: var(--faint); } .picker button:disabled:hover { border-color: var(--line); box-shadow: none; }
.picker .ic { width: 34px; height: 34px; border-radius: 50%; background: var(--accent-wash); color: var(--accent); display: grid; place-items: center; }
.picker button:disabled .ic { background: var(--panel-2); color: var(--faint); }

/* Domain tab */
.status-chip { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 2px 9px; border-radius: 999px; margin-right: 4px; background: var(--up-bg); color: var(--up); }
.status-chip.bad { background: var(--down-bg); color: var(--down); }

.d-head .url a { color: inherit; text-underline-offset: 3px; }
.ext-arrow { display: inline-block; vertical-align: -1px; margin-left: 2px; flex-shrink: 0; }

.ui-ic { flex-shrink: 0; }
.btn .ui-ic { margin-right: 1px; }

/* Phones: header wraps onto two rows instead of pushing buttons off screen */
@media (max-width: 760px) {
  .top { flex-wrap: wrap; gap: 10px; padding: 10px 14px; }
  .top .spacer { display: none; }
  .top #overall { margin-left: auto; }
  /* Logo and controls on one row, status underneath */
  .top .brand { order: 1; } .top .hdr-acts { order: 2; margin-left: auto; } .top #overall { order: 3; margin-left: 0; }
  .top #overall { flex-basis: 100%; padding: 0; background: none; border: 0; font-size: 13px; }
  .top #overall.up { color: var(--muted); font-weight: 500; }
  main { padding: 14px 14px 32px; }
  .toolbar { flex-wrap: wrap; }
  .d-head { padding: 16px 16px 0; } .d-body { padding: 16px 16px 32px; }
}
.lbl-short { display: none; }

/* ---- Grouped site list ---- */
.group-h { display: flex; align-items: center; gap: 8px; padding: 14px 16px 8px; font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); border-top: 1px solid var(--line); background: var(--panel); }
.group-h span { font-weight: 500; letter-spacing: 0; color: var(--faint); }
.group-h.attn { color: var(--text); }
.row.head + .group-h { border-top: 0; }
.row.bad { background: color-mix(in srgb, var(--down-bg) 55%, var(--panel)); }
.row.warn { background: color-mix(in srgb, var(--warn-bg) 55%, var(--panel)); }
.url.why.bad { color: var(--down); } .url.why.warn { color: var(--warn); }

/* ---- Phone cards ---- */
.cards-m { display: none; }
.sec-h { display: flex; justify-content: space-between; font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 16px 4px 8px; }
.sec-h:first-child { margin-top: 4px; }
.sec-h.attn { color: var(--text); }
.mcard { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; margin-bottom: 8px; cursor: pointer; }
.mcard.bad { background: color-mix(in srgb, var(--down-bg) 55%, var(--panel)); border-color: color-mix(in srgb, var(--down) 22%, var(--line)); }
.mcard.warn { background: color-mix(in srgb, var(--warn-bg) 55%, var(--panel)); border-color: color-mix(in srgb, var(--warn) 22%, var(--line)); }
.mc-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.mc-top .name { font-weight: 600; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mcard .why { font-size: 13px; margin: 4px 0 0 18px; } .mcard .why.bad { color: var(--down); } .mcard .why.warn { color: var(--warn); }
.mcard .bars { height: 16px; margin: 10px 0 0; }
.mc-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.mchip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); background: var(--panel-2); border: 1px solid var(--line); border-radius: 999px; padding: 2px 4px 2px 9px; }
.mchip:first-child { padding-right: 9px; }
.mchip .badge { font-size: 11px; padding: 1px 7px; border-radius: 999px; }
@media (max-width: 760px) { .list { display: none; } .cards-m { display: block; } }

/* Header controls: theme toggle and menu circles, as on wearepixelate.com */
.pill i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.pill.up i { background: var(--up); } .pill.down i { background: var(--down); } .pill.warn i { background: var(--warn); }
.pill:not(.up):not(.down):not(.warn) i { display: none; }
.hdr-acts { display: flex; align-items: center; gap: 8px; }
.circ { box-sizing: border-box; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; padding: 0; border: 1.5px solid var(--line-2); background: var(--panel); color: var(--text); cursor: pointer; transition: color .2s, border-color .2s, background .2s; -webkit-tap-highlight-color: transparent; }
.circ:hover { color: var(--accent); border-color: var(--accent); }
.circ:focus-visible, .hmenu button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.circ svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.circ.accent { border-color: var(--accent); color: var(--accent); background: var(--accent-wash); }
.circ.accent:hover, .circ.accent.open { background: var(--accent); color: var(--accent-ink); }
#themeBtn .i-sun, [data-theme=dark] #themeBtn .i-moon { display: none; }
[data-theme=dark] #themeBtn .i-sun { display: block; }
#menuBtn .i-close, #menuBtn.open .i-burger { display: none; }
#menuBtn.open .i-close { display: block; }
.menu-wrap { position: relative; }
.hmenu { position: absolute; right: 0; top: calc(100% + 8px); width: 210px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 32px rgba(22,22,22,.14); padding: 6px; z-index: 30; }
.hmenu[hidden] { display: none; }
.hmenu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px; border: 0; border-radius: 9px; background: none; color: var(--text); font: 500 13.5px/1.2 var(--body); text-align: left; cursor: pointer; }
.hmenu button:hover { background: var(--panel-2); color: var(--accent-deep); }
.hmenu svg { width: 16px; height: 16px; fill: none; stroke: var(--muted); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.hmenu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 6px; }
@media (max-width: 760px) { .circ { width: 44px; height: 44px; } .circ svg { width: 20px; height: 20px; } }

/* Phones: 90 daily bars must fit the drawer width without making it scroll sideways */
@media (max-width: 760px) { .bars.tall { gap: 1px; } .bars.tall i { border-radius: 1px; } .tabs { scrollbar-width: none; } .tabs::-webkit-scrollbar { display: none; } }
@media (max-width: 760px) { .d-title h2 { font-size: 22px; } }

/* SSL tab: who renews the certificate */
.renew { padding: 14px 16px; }
.renew-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rchip { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; padding: 5px 12px 5px 9px; border-radius: 999px; white-space: nowrap; }
.rchip svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.rchip.r20 { background: var(--panel-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.rchip.rsw { background: var(--accent-wash); color: var(--accent-deep); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent); }
.renew-hint { font-size: 12.5px; color: var(--faint); margin-top: 8px; }
.renew-hint a { color: inherit; }
.renew .alertbox { margin: 12px 0 0; }
.renew .kv { margin-top: 12px; }
.renew .d-actions { margin: 12px 0 0; }
.renew-more .d-actions { margin: 12px 0 4px; }
.renew-more { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; }
.renew-more summary { cursor: pointer; font-size: 13px; font-weight: 550; color: var(--accent-deep); list-style: none; display: inline-flex; align-items: center; gap: 6px; }
.renew-more summary::-webkit-details-marker { display: none; }
.renew-more summary::before { content: ""; width: 6px; height: 6px; border-right: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor; transform: rotate(-45deg); transition: transform .15s; margin-right: 2px; }
.renew-more[open] summary::before { transform: rotate(45deg); }

/* Sign-in page */
.login-wrap { min-height: 72vh; display: grid; place-items: center; padding: 20px 16px 48px; }
.login-card { width: min(420px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 28px; }
.login-card h1 { margin: 0 0 4px; font: 300 34px/1.1 var(--display); letter-spacing: -.03em; }
.login-card form { display: grid; gap: 12px; margin-top: 14px; }
.login-card .in { min-height: 44px; font-size: 16px; }
.login-card .in.code { font: 400 26px/1 var(--mono, ui-monospace, Menlo, monospace); letter-spacing: .3em; text-align: center; }
.login-card .btn { min-height: 44px; justify-content: center; }
.login-card .msg { min-height: 1.2em; margin: 12px 0 0; font-size: 13px; color: var(--down); }
.login-card .msg.ok { color: var(--up); }
.login-card [hidden] { display: none; }

/* Visual tab: desktop / mobile switch, narrower phone screenshots */
.vseg { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--panel-2, var(--bg)); border: 1px solid var(--line); }
.vseg button { border: 0; background: none; padding: 5px 12px; border-radius: 999px; font: 600 12.5px/1.2 var(--body, inherit); color: var(--muted); cursor: pointer; }
.vseg button span { font-weight: 500; color: var(--warn-text, var(--muted)); margin-left: 2px; }
.vseg button.on { background: var(--panel); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.shots.mobile { grid-template-columns: repeat(3, minmax(0, 240px)); }
.shots.mobile .shot img { max-height: 520px; }
@media (max-width: 640px) { .shots.mobile { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; } .shots.mobile .shot .cap { font-size: 11px; padding: 5px 6px; } }

/* Pills that open their tab */
[data-goto] { cursor: pointer; transition: border-color .15s, color .15s; }
.flag[data-goto]:hover { color: var(--accent-deep, var(--accent)); border-color: var(--accent); }
.pill-ext[data-goto]:hover { box-shadow: inset 0 0 0 1px var(--accent); }
.mc-top .flag, .mc-top .pill-ext { flex: none; }
