/* Visual Uptime: calm, neutral, server-rendered UI. No frameworks, no external assets. */
:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #f9fafb;
  --border: #e2e5ea;
  --border-strong: #cdd2da;
  --text: #1a1f26;
  --muted: #5b6676;
  --faint: #8a94a3;
  --primary: #2457d6;
  --primary-hover: #1c46b0;
  --primary-soft: #e9efff;
  --ok: #17794a;
  --ok-bg: #e5f4ec;
  --ok-border: #bfe3cf;
  --bad: #c42b2b;
  --bad-bg: #fdeded;
  --bad-border: #f4c4c4;
  --warn: #9a5b00;
  --warn-bg: #fff3d9;
  --warn-border: #f1d79b;
  --info: #2457d6;
  --info-bg: #e9efff;
  --info-border: #c5d4fb;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
  --radius: 12px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101317;
    --surface: #181c22;
    --surface-2: #1d222a;
    --border: #2b323c;
    --border-strong: #3a434f;
    --text: #e8ebf0;
    --muted: #a0aab8;
    --faint: #7b8696;
    --primary: #6b93ff;
    --primary-hover: #8aa9ff;
    --primary-soft: #1e2a4a;
    --ok: #52c58a;
    --ok-bg: #12291f;
    --ok-border: #1f4a35;
    --bad: #ff7a7a;
    --bad-bg: #331618;
    --bad-border: #5a2a2d;
    --warn: #f0b34d;
    --warn-bg: #30240d;
    --warn-border: #55421a;
    --info: #8aa9ff;
    --info-bg: #1b2644;
    --info-border: #2d3f70;
    --shadow: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 var(--font);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; padding-top: 24px; padding-bottom: 40px; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; font-weight: 650; letter-spacing: -0.01em; }
h1 { font-size: 24px; }
h2 { font-size: 17px; }
h3 { font-size: 15px; margin: 22px 0 8px; }
h4 { font-size: 13px; margin: 18px 0 6px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; }
p { margin: 0 0 12px; }
code { font-family: var(--mono); font-size: 0.9em; background: var(--surface-2); border: 1px solid var(--border); border-radius: 5px; padding: 1px 5px; word-break: break-all; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.mt { margin-top: 14px; }
.pad { padding: 16px; }
.grow { flex: 1 1 220px; }
.inline { display: inline; margin: 0; }
.tone-bad { color: var(--bad); }
.tone-ok { color: var(--ok); }
.tone-warn { color: var(--warn); }
.tone-info { color: var(--info); }
.url, .url-plain { word-break: break-all; }
.url-plain { color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding-left: 16px; padding-right: 16px; }
.container-wide { max-width: 1200px; }
.narrow { max-width: 620px; margin: 0 auto; }
.narrow-wide { max-width: 760px; margin: 0 auto; }

/* ----- top bar ----- */
.topbar { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20; }
.topbar-inner { max-width: 1200px; margin: 0 auto; padding: 0 16px; height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; color: var(--text); letter-spacing: -0.01em; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.logo-mark { color: var(--primary); }
.topnav { display: flex; align-items: center; gap: 12px; min-width: 0; }
.topnav-link { color: var(--muted); font-size: 14px; }
.user-email { color: var(--muted); font-size: 13px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ----- project header + tabs ----- */
.project-head { background: var(--surface); border-bottom: 1px solid var(--border); padding-top: 18px; }
.project-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.project-title h1 a { color: var(--text); }
.project-title h1 a:hover { text-decoration: none; }
.domain { font-size: 13px; }
.tabs { display: flex; gap: 2px; margin-top: 14px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.tabs::-webkit-scrollbar { display: none; }
.tab { padding: 9px 14px; color: var(--muted); font-weight: 500; font-size: 14px; border-bottom: 2px solid transparent; white-space: nowrap; }
.tab:hover { color: var(--text); text-decoration: none; }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

/* ----- page heads, cards ----- */
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head p { margin: 4px 0 0; }
.crumb { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; box-shadow: var(--shadow); }
.card.flush { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-actions { font-size: 14px; }
.grid-2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; align-items: start; }
.grid-2 > .card { margin-bottom: 0; }
.grid-2 { margin-bottom: 16px; }

.flash { padding: 11px 14px; border-radius: 10px; margin-bottom: 16px; border: 1px solid; font-size: 14px; }
.flash-ok { background: var(--ok-bg); border-color: var(--ok-border); color: var(--ok); }
.flash-err { background: var(--bad-bg); border-color: var(--bad-border); color: var(--bad); }
.flash-info { background: var(--info-bg); border-color: var(--info-border); color: var(--text); }
.flash-warn { background: var(--warn-bg); border-color: var(--warn-border); color: var(--text); }
.note { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; margin-bottom: 8px; font-size: 14px; color: var(--muted); }
.note strong { color: var(--text); }

.empty { text-align: center; padding: 48px 20px; background: var(--surface); border: 1px dashed var(--border-strong); border-radius: var(--radius); margin-bottom: 16px; }
.empty-title { font-size: 17px; font-weight: 600; margin-bottom: 6px; }
.empty-body { color: var(--muted); max-width: 460px; margin: 0 auto; }

/* ----- buttons, badges ----- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font: inherit; font-weight: 550; font-size: 14px; cursor: pointer; white-space: nowrap; line-height: 1; }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:disabled, .btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn-danger:hover { background: var(--bad); filter: brightness(0.92); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-ghost.danger { color: var(--bad); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 13px; border-radius: 7px; }
.btn-xs { height: 26px; padding: 0 8px; font-size: 12px; border-radius: 6px; }
summary.btn { list-style: none; }
summary.btn::-webkit-details-marker { display: none; }
.actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.badge { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 1.5; border: 1px solid transparent; white-space: nowrap; }
.badge-ok { background: var(--ok-bg); color: var(--ok); border-color: var(--ok-border); }
.badge-bad { background: var(--bad-bg); color: var(--bad); border-color: var(--bad-border); }
.badge-warn { background: var(--warn-bg); color: var(--warn); border-color: var(--warn-border); }
.badge-info { background: var(--info-bg); color: var(--info); border-color: var(--info-border); }
.badge-neutral { background: var(--surface-2); color: var(--muted); border-color: var(--border); }

.pill { display: inline-flex; align-items: center; gap: 7px; padding: 4px 11px; border-radius: 999px; font-size: 13px; font-weight: 600; border: 1px solid transparent; white-space: nowrap; }
.pill .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.pill-ok { background: var(--ok-bg); color: var(--ok); border-color: var(--ok-border); }
.pill-bad { background: var(--bad-bg); color: var(--bad); border-color: var(--bad-border); }
.pill-warn { background: var(--warn-bg); color: var(--warn); border-color: var(--warn-border); }
.pill-info { background: var(--info-bg); color: var(--info); border-color: var(--info-border); }
.pill-info .dot { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.35; } }

/* ----- forms ----- */
.stack { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { font-size: 13px; font-weight: 600; }
.field-inline > span { color: var(--muted); font-weight: 500; font-size: 12px; }
.hint { color: var(--muted); font-size: 12.5px; }
input[type=text], input[type=email], input[type=url], input[type=number], input[type=date], input[type=time], select {
  height: 38px; padding: 0 11px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; width: 100%; min-width: 0;
}
input:focus, select:focus { outline: 2px solid var(--primary); outline-offset: 0; border-color: var(--primary); }
input:disabled, select:disabled { background: var(--surface-2); color: var(--faint); }
.check { display: flex; gap: 8px; align-items: center; font-size: 14px; cursor: pointer; }
.check input { width: 16px; height: 16px; }
.form-row { display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-end; }
.form-row > .field { flex: 0 1 190px; }
.form-row > .field.grow { flex: 1 1 260px; }
.inline-form { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; margin-top: 10px; }
.inline-form > input[type=text], .inline-form > input[type=email], .inline-form > input[type=url] { flex: 1 1 240px; width: auto; }
.inline-form.wrap { flex-direction: column; align-items: flex-start; }
.inline-form select { width: auto; min-width: 200px; }

.filters { display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-end; padding: 14px 16px; }
.filters .field { flex: 0 1 190px; }
.filter-actions { display: flex; gap: 8px; }

/* ----- stats ----- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.stat { display: block; padding: 12px 14px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; color: inherit; min-width: 0; }
a.stat:hover { text-decoration: none; border-color: var(--border-strong); background: var(--surface); }
.stat-value { font-size: 20px; font-weight: 650; letter-spacing: -0.01em; overflow-wrap: anywhere; line-height: 1.25; }
.stat-value.stat-text { font-size: 15px; font-weight: 600; padding-top: 3px; }
.stat-label { font-size: 12px; color: var(--muted); margin-top: 2px; }
.progress-stats { margin: 18px 0 14px; }

.meta-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px 24px; margin: 0; }
.meta-grid > div { min-width: 0; }
.meta-grid dt { font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); font-weight: 600; margin-bottom: 2px; }
.meta-grid dd { margin: 0; overflow-wrap: anywhere; }

/* ----- overview ----- */
.status-hero { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; padding: 20px 22px; border-radius: var(--radius); border: 1px solid; margin-bottom: 16px; }
.status-ok { background: var(--ok-bg); border-color: var(--ok-border); }
.status-bad { background: var(--bad-bg); border-color: var(--bad-border); }
.status-warn { background: var(--warn-bg); border-color: var(--warn-border); }
.status-info { background: var(--info-bg); border-color: var(--info-border); }
.status-main { display: flex; gap: 14px; align-items: center; min-width: 0; flex: 1 1 320px; }
.status-icon { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 20px; color: #fff; flex: none; }
.status-ok .status-icon { background: var(--ok); }
.status-bad .status-icon { background: var(--bad); }
.status-warn .status-icon { background: var(--warn); }
.status-info .status-icon { background: var(--info); }
.status-title { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; }
.status-hero .muted { font-size: 14px; }
.row-meta { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 14px; color: var(--muted); }

.activity { list-style: none; margin: 0; padding: 0; }
.activity-item { display: flex; align-items: baseline; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.activity-item:last-child { border-bottom: 0; }
.activity-item time { margin-left: auto; color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.activity-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--faint); transform: translateY(-1px); }
.tone-dot-ok .activity-dot { background: var(--ok); }
.tone-dot-bad .activity-dot { background: var(--bad); }
.tone-dot-warn .activity-dot { background: var(--warn); }
.tone-dot-info .activity-dot { background: var(--info); }

/* ----- project cards ----- */
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.project-card { display: block; background: var(--surface); border: 1px solid var(--border); border-left-width: 4px; border-radius: var(--radius); padding: 16px 18px; color: inherit; box-shadow: var(--shadow); transition: border-color 0.12s, box-shadow 0.12s; }
.project-card:hover { text-decoration: none; border-color: var(--border-strong); box-shadow: 0 2px 8px rgba(16, 24, 40, 0.08); }
.project-card.health-ok { border-left-color: var(--ok); }
.project-card.health-bad { border-left-color: var(--bad); }
.project-card.health-warn { border-left-color: var(--warn); }
.project-card.health-info { border-left-color: var(--info); }
.project-card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.project-card-name { display: flex; flex-direction: column; min-width: 0; }
.project-card-name strong { font-size: 16px; overflow-wrap: anywhere; }
.project-card-name span { font-size: 13px; overflow-wrap: anywhere; }
.project-card-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 16px 0 0; }
.project-card-meta dt { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; }
.project-card-meta dd { margin: 2px 0 0; font-size: 14px; font-weight: 550; }
.project-card-foot { margin-top: 12px; }

/* ----- lists and tables ----- */
.list { list-style: none; margin: 0; padding: 0; }
.list-item { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.list-item:last-child { border-bottom: 0; }
.list.compact .list-item { padding: 7px 0; }
.list-main { min-width: 0; }
.list-title { font-weight: 600; overflow-wrap: anywhere; }
.list-side { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.chip { font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--ok-bg); color: var(--ok); border: 1px solid var(--ok-border); white-space: nowrap; }
.row-badges { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); font-weight: 600; padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table tbody tr:last-child td { border-bottom: 0; }
.table .num, .table th.num { text-align: right; }
.table-compact th { padding: 8px 12px; }
.table-compact td { padding: 8px 12px; }
.card:not(.flush) .table-wrap { margin: 0 -4px; }
.row-title { font-weight: 600; color: var(--text); overflow-wrap: anywhere; }
.cell-main { min-width: 240px; }
.row-resolved { opacity: 0.8; }
.row-actions td { padding-top: 0; background: var(--surface); }
.row-actions { border-bottom: 1px solid var(--border); }
.manage { display: flex; gap: 6px; align-items: flex-start; flex-wrap: wrap; }
.manage details { position: relative; }
.manage details[open] { flex-basis: 100%; }
.manage details .inline-form { margin: 6px 0 4px; }
.vp { white-space: nowrap; }

.pager { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; margin-bottom: 8px; }
.anchors { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }
.anchors a { padding: 5px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); font-size: 13px; font-weight: 550; }
.anchors a:hover { color: var(--text); text-decoration: none; border-color: var(--border-strong); }

/* ----- run progress ----- */
.steps { list-style: none; margin: 4px 0 0; padding: 0; }
.step { display: flex; align-items: center; gap: 12px; padding: 9px 0; color: var(--faint); font-size: 15px; position: relative; }
.step + .step::before { content: ""; position: absolute; left: 10px; top: -10px; height: 20px; width: 2px; background: var(--border); }
.step.done + .step::before, .step.active::before { background: var(--ok); }
.step-mark { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--border-strong); flex: none; display: grid; place-items: center; background: var(--surface); position: relative; z-index: 1; }
.step.done { color: var(--text); }
.step.done .step-mark { background: var(--ok); border-color: var(--ok); }
.step.done .step-mark::after { content: ""; width: 6px; height: 11px; border: solid #fff; border-width: 0 2px 2px 0; transform: translateY(-1px) rotate(45deg); }
.step.active { color: var(--text); font-weight: 600; }
.step.active .step-mark { border-color: var(--primary); border-top-color: transparent; animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.progress { height: 6px; background: var(--surface-2); border-radius: 999px; overflow: hidden; border: 1px solid var(--border); margin-bottom: 12px; }
.progress-bar { height: 100%; background: var(--primary); transition: width 0.4s ease; }
.inline-details summary { cursor: pointer; display: inline; }
.inline-details code { display: block; margin-top: 6px; white-space: pre-wrap; }

/* ----- incident detail & evidence ----- */
.incident-head.is-open { border-left: 4px solid var(--bad); }
.incident-head.is-resolved { border-left: 4px solid var(--ok); }
.incident-title { font-size: 24px; margin: 10px 0 8px; }
.incident-statement { font-size: 16.5px; color: var(--text); max-width: 80ch; }
.evidence .card-head { margin-bottom: 10px; }
.evidence-tools { display: flex; gap: 8px; flex-wrap: wrap; }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; padding: 3px; margin-bottom: 12px; }
.seg-btn { border: 0; background: transparent; color: var(--muted); font: inherit; font-weight: 600; font-size: 13.5px; padding: 6px 16px; border-radius: 7px; cursor: pointer; }
.seg-btn:hover:not(:disabled) { color: var(--text); }
.seg-btn[aria-selected=true] { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(16, 24, 40, 0.12); }
.seg-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.shot-scroll { max-height: 80vh; overflow: auto; border: 1px solid var(--border); border-radius: 10px; background: repeating-conic-gradient(var(--surface-2) 0% 25%, var(--surface) 0% 50%) 50% / 16px 16px; scroll-behavior: smooth; overscroll-behavior: contain; }
.shot { position: relative; display: inline-block; max-width: 100%; line-height: 0; vertical-align: top; }
.shot img { display: block; max-width: 100%; height: auto; }
.evidence.actual .shot { max-width: none; }
.evidence.actual .shot img { max-width: none; }
.region { position: absolute; border: 3px solid #e5262e; background: rgba(229, 38, 46, 0.12); border-radius: 4px; pointer-events: none; box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.85); }
.region.flash { animation: regionflash 1.2s ease-out 2; }
@keyframes regionflash { 0%, 100% { background: rgba(229, 38, 46, 0.12); } 50% { background: rgba(229, 38, 46, 0.45); } }
.caption { margin: 8px 2px 0; }
.regions { margin-top: 8px; }

/* ----- coverage ----- */
.tpl-list { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.tpl-head, .tpl > summary { display: grid; grid-template-columns: minmax(180px, 2.2fr) 60px minmax(120px, 1.6fr) 110px 130px; gap: 12px; align-items: center; padding: 11px 14px; }
.tpl-head { background: var(--surface-2); font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); font-weight: 600; border-bottom: 1px solid var(--border); }
.tpl-head .num { text-align: right; }
.tpl > summary { cursor: pointer; list-style: none; font-size: 14px; }
.tpl > summary::-webkit-details-marker { display: none; }
.tpl > summary:hover { background: var(--surface-2); }
.tpl + .tpl { border-top: 1px solid var(--border); }
.tpl[open] > summary { background: var(--surface-2); border-bottom: 1px solid var(--border); }
.tpl-name { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.tpl-name::before { content: ""; width: 7px; height: 7px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(-45deg); transition: transform 0.12s; flex: none; margin-right: 2px; }
.tpl[open] .tpl-name::before { transform: rotate(45deg); }
.tpl.is-excluded > summary { opacity: 0.7; }
.tpl-sampled { min-width: 0; }
.tpl-body { padding: 4px 16px 16px; }
.tpl-actions { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin-top: 12px; }
.url-list { list-style: none; margin: 0; padding: 0; font-size: 13.5px; }
.url-list li { display: flex; align-items: center; gap: 10px; padding: 5px 0; border-bottom: 1px dashed var(--border); flex-wrap: wrap; }
.url-list li:last-child { border-bottom: 0; }
.url-list li .btn { margin-left: auto; }
.removed > summary { cursor: pointer; list-style: none; }
.removed > summary::-webkit-details-marker { display: none; }
.removed[open] > summary { margin-bottom: 12px; }

/* ----- baselines ----- */
.snap-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.snap { margin: 0; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--surface); }
.snap-thumb { display: block; height: 150px; overflow: hidden; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.snap-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.snap figcaption { padding: 10px 12px; font-size: 14px; }

/* ----- settings ----- */
.secret-box { border: 1px solid var(--warn-border); background: var(--warn-bg); border-radius: 10px; padding: 12px 14px; margin: 10px 0; }
.secret-box p { margin: 4px 0 8px; }
.secret-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.secret-row code { flex: 1 1 280px; padding: 8px 10px; background: var(--surface); user-select: all; }

/* ----- docs ----- */
.docs { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px 32px; max-width: 900px; margin: 0 auto; }
.docs h1 { margin-bottom: 12px; }
.docs h2 { margin: 30px 0 10px; font-size: 20px; padding-top: 6px; }
.docs h3 { margin: 22px 0 8px; font-size: 16px; }
.docs ul { padding-left: 20px; margin: 0 0 12px; }
.docs li { margin-bottom: 4px; }
.docs pre.code { background: #0f1720; color: #e6edf5; padding: 14px 16px; border-radius: 10px; overflow-x: auto; font-size: 13px; line-height: 1.5; margin: 0 0 16px; }
.docs pre.code code { background: none; border: 0; padding: 0; color: inherit; word-break: normal; }
.docs .table-wrap { margin-bottom: 16px; }
.docs .table td code { white-space: nowrap; }

/* ----- auth ----- */
.auth-wrap { display: grid; place-items: start center; padding-top: 6vh; }
.auth-card { width: 100%; max-width: 420px; padding: 28px; }
.auth-card h1 { margin-bottom: 8px; }

.footer { display: flex; justify-content: space-between; gap: 12px; padding-top: 16px; padding-bottom: 24px; font-size: 13px; border-top: 1px solid var(--border); }

/* ----- responsive ----- */
@media (max-width: 860px) {
  .grid-2 { grid-template-columns: 1fr; }
  .tpl-head { display: none; }
  .tpl > summary { grid-template-columns: 1fr auto; row-gap: 4px; }
  .tpl > summary > :nth-child(3), .tpl > summary > :nth-child(4) { display: none; }
  .tpl > summary > :nth-child(2)::after { content: " URLs"; }
}
@media (max-width: 640px) {
  body { font-size: 14.5px; }
  main { padding-top: 16px; }
  h1 { font-size: 21px; }
  .topbar-inner { height: auto; min-height: 52px; padding-top: 6px; padding-bottom: 6px; }
  .user-email { display: none; }
  .card { padding: 16px; }
  .docs { padding: 18px 16px; }
  .status-hero { padding: 16px; }
  .project-card-meta { grid-template-columns: 1fr 1fr 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
  .form-row > .field { flex: 1 1 100%; }
  .filters .field { flex: 1 1 100%; }
  .page-head .btn { width: auto; }
  .incident-title { font-size: 21px; }
  .stack-table thead { display: none; }
  .stack-table, .stack-table tbody, .stack-table tr, .stack-table td { display: block; width: 100%; }
  .stack-table tr { padding: 12px 14px; border-bottom: 1px solid var(--border); }
  .stack-table tr:last-child { border-bottom: 0; }
  .stack-table td { padding: 2px 0; border: 0; }
  .stack-table td[data-label]::before { content: attr(data-label) ": "; color: var(--muted); font-size: 12px; }
  .stack-table td.num { text-align: left; }
  .stack-table .row-actions { padding-top: 0; }
  .stack-table .cell-main { min-width: 0; padding-bottom: 6px; }
  .list-item { flex-direction: column; align-items: flex-start; gap: 6px; }
  .list-side, .chips { justify-content: flex-start; }
  .activity-item { display: grid; grid-template-columns: 10px 1fr; column-gap: 10px; align-items: start; }
  .activity-item .activity-dot { margin-top: 7px; }
  .activity-item time { grid-column: 2; margin-left: 0; }
  .seg-btn { padding: 6px 12px; }
  .shot-scroll { max-height: 70vh; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
