/* JEZASOFT panel: large type, high contrast, plain layout. No external assets. */
:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --text: #1c2430;
  --muted: #5b6676;
  --border: #dde3ea;
  --primary: #1f5fbf;
  --primary-dark: #174a96;
  --primary-soft: #e8f0fc;
  --ok: #1d7a46;
  --ok-soft: #e6f4ec;
  --warn: #8a5a00;
  --warn-soft: #fff4d6;
  --bad: #b42318;
  --bad-soft: #fdecea;
  --off: #5b6676;
  --off-soft: #eef1f5;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  font-size: 17px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.5;
}
a { color: var(--primary); }
a:hover { color: var(--primary-dark); }
h1 { font-size: 1.75rem; line-height: 1.2; margin: 0 0 .35rem; }
h2 { font-size: 1.25rem; margin: 0 0 .75rem; }
p { margin: .4rem 0; }
code { background: var(--off-soft); padding: .1rem .35rem; border-radius: 6px; font-size: .9em; word-break: break-all; }
pre { white-space: pre-wrap; word-break: break-word; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.center { text-align: center; }
.lead { font-size: 1.1rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; background: #fff; padding: .5rem 1rem; z-index: 10; }
.skip:focus { left: 1rem; }
:focus-visible { outline: 3px solid #f2a900; outline-offset: 2px; }

/* Top bar */
.topbar { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 5; }
.topbar-inner { max-width: 1180px; margin: 0 auto; padding: .6rem 1.25rem; display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--text); font-weight: 700; }
.brand small { display: block; font-weight: 400; color: var(--muted); font-size: .8rem; }
.brand-mark { display: block; width: 40px; height: 40px; flex: none; }
.auth-brand .brand-mark { width: 56px; height: 56px; }
.nav { display: flex; gap: .25rem; flex-wrap: wrap; flex: 1; }
.nav a { text-decoration: none; color: var(--text); padding: .5rem .8rem; border-radius: 8px; font-weight: 500; }
.nav a:hover { background: var(--off-soft); }
.nav a[aria-current="page"] { background: var(--primary-soft); color: var(--primary-dark); font-weight: 700; }
.logout { display: flex; align-items: center; gap: .5rem; margin: 0; }
.who { color: var(--muted); font-size: .9rem; }

.container { max-width: 1180px; margin: 0 auto; padding: 1.5rem 1.25rem 4rem; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.4rem; margin-bottom: 1.25rem; }
.narrow { max-width: 720px; margin-left: auto; margin-right: auto; }
.crumbs { margin: 0 0 .75rem; }
.crumbs a { text-decoration: none; font-weight: 500; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.actions { display: flex; gap: .6rem; flex-wrap: wrap; }
.actions form { margin: 0; }
.domain-title { word-break: break-all; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 46px; padding: .6rem 1.15rem; border-radius: 10px; border: 1px solid transparent; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.btn-sm { min-height: 38px; padding: .35rem .8rem; font-size: .92rem; }
.btn-lg { min-height: 52px; padding: .7rem 1.6rem; font-size: 1.05rem; }
.btn-block { width: 100%; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-secondary { background: var(--surface); color: var(--text); border-color: #c5cdd8; }
.btn-secondary:hover { background: var(--off-soft); color: var(--text); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-danger { background: var(--bad); color: #fff; }
.btn-danger:hover { background: #8f1c13; color: #fff; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }

/* Alerts */
.flashes { margin-bottom: 1rem; }
.alert { display: flex; gap: .75rem; align-items: flex-start; padding: .9rem 1rem; border-radius: 10px; margin-bottom: .6rem; border: 1px solid; }
.alert p { margin: 0; }
.alert-icon { flex: none; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; color: #fff; font-weight: 800; font-size: .9rem; }
.alert-success { background: var(--ok-soft); border-color: #b5dcc5; }
.alert-success .alert-icon { background: var(--ok); }
.alert-error { background: var(--bad-soft); border-color: #f3c0bb; }
.alert-error .alert-icon { background: var(--bad); }
.alert-warning { background: var(--warn-soft); border-color: #f0d68f; }
.alert-warning .alert-icon { background: var(--warn); }
.alert-info { background: var(--primary-soft); border-color: #c3d6f5; }
.alert-info .alert-icon { background: var(--primary); }
.tech { margin: -.2rem 0 .8rem; font-size: .88rem; }
.tech pre, .log { background: #111827; color: #e5e7eb; padding: .8rem; border-radius: 8px; max-height: 360px; overflow: auto; font-size: .8rem; }
summary { cursor: pointer; font-weight: 600; }

/* Status pills (always text + color, never color alone) */
.pill { display: inline-flex; align-items: center; gap: .4rem; padding: .2rem .65rem; border-radius: 999px; font-size: .88rem; font-weight: 600; white-space: nowrap; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: currentColor; flex: none; }
.pill-ok { background: var(--ok-soft); color: var(--ok); }
.pill-warn { background: var(--warn-soft); color: var(--warn); }
.pill-bad { background: var(--bad-soft); color: var(--bad); }
.pill-off, .pill-unknown { background: var(--off-soft); color: var(--off); }
.tag { display: inline-block; font-size: .75rem; font-weight: 700; padding: .05rem .5rem; border-radius: 999px; background: var(--off-soft); color: var(--muted); margin-left: .3rem; vertical-align: middle; }
.tag-ok { background: var(--ok-soft); color: var(--ok); }
.tag-warn { background: var(--warn-soft); color: var(--warn); }

/* Summary */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem 1.25rem; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: .2rem; border-top: 5px solid var(--primary); }
.stat-ok { border-top-color: var(--ok); }
.stat-warn { border-top-color: #e0a100; }
.stat-bad { border-top-color: var(--bad); }
.stat-label { color: var(--muted); font-weight: 600; }
.stat-value { font-size: 2rem; font-weight: 800; line-height: 1.1; }
.stat-value small { font-size: 1rem; font-weight: 600; color: var(--muted); }
.stat-note { color: var(--muted); font-size: .9rem; }
.meter { width: 100%; height: 10px; border-radius: 999px; overflow: hidden; appearance: none; border: 0; background: var(--off-soft); margin: .3rem 0; }
.meter::-webkit-progress-bar { background: var(--off-soft); border-radius: 999px; }
.meter::-webkit-progress-value { background: var(--primary); border-radius: 999px; }
.meter::-moz-progress-bar { background: var(--primary); border-radius: 999px; }

.attention { border-color: #f3c0bb; background: #fffafa; }
.attention-list { margin: 0; padding-left: 1.2rem; }
.attention-list li { margin: .35rem 0; }
.hints { margin-bottom: 1.25rem; }
.hints p { background: var(--surface); border: 1px dashed #c5cdd8; border-radius: 10px; padding: .6rem 1rem; margin: 0 0 .5rem; }

/* Site list */
.list-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.filters { display: flex; gap: .4rem; flex-wrap: wrap; }
.chip { font: inherit; font-size: .92rem; padding: .4rem .85rem; border-radius: 999px; border: 1px solid #c5cdd8; background: var(--surface); cursor: pointer; min-height: 38px; }
.chip[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
.search { display: block; margin: 1rem 0; }
input, select { font: inherit; width: 100%; padding: .7rem .85rem; border: 1px solid #b9c3cf; border-radius: 10px; background: #fff; color: var(--text); min-height: 48px; }
input:focus, select:focus { border-color: var(--primary); }
input[aria-invalid="true"] { border-color: var(--bad); background: #fffafa; }
.sites { display: flex; flex-direction: column; }
.site-row { display: grid; grid-template-columns: minmax(0, 2.4fr) minmax(0, 1.7fr) minmax(0, 1.3fr) minmax(0, 1.1fr) minmax(0, .8fr) minmax(0, 1fr) 120px; gap: .75rem; align-items: center; padding: .75rem .5rem; border-bottom: 1px solid var(--border); }
.site-row:last-of-type { border-bottom: 0; }
.site-row:not(.site-row-head):hover { background: #f9fbfd; }
.site-row-head { font-size: .82rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); font-weight: 700; padding-top: 0; }
.site-row .pill { white-space: normal; }
.site-name a { font-weight: 700; text-decoration: none; word-break: break-all; }
.site-name a:hover { text-decoration: underline; }
.site-actions { text-align: right; }
.empty { color: var(--muted); padding: 1rem .5rem; }

/* Site detail */
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: .9rem 1.5rem; margin: 0; }
.facts dt { color: var(--muted); font-size: .88rem; font-weight: 600; }
.facts dd { margin: .15rem 0 0; }
.problem-list { margin: 1rem 0 0; padding: 0; list-style: none; }
.problem-list li { padding: .55rem .85rem; border-radius: 8px; margin-top: .4rem; }
.problem-bad { background: var(--bad-soft); color: var(--bad); }
.problem-warn { background: var(--warn-soft); color: var(--warn); }
.danger-zone { border-color: #f3c0bb; }
.danger-zone h2 { color: var(--bad); }

/* Forms */
.form { display: flex; flex-direction: column; gap: .5rem; }
.form label { font-weight: 600; }
.help { color: var(--muted); font-size: .9rem; margin: 0 0 .3rem; }
.field-error { color: var(--bad); font-weight: 600; margin: .2rem 0 0; }
.form-actions { display: flex; justify-content: flex-end; gap: .75rem; margin-top: 1rem; flex-wrap: wrap; }
.choices { border: 0; padding: 0; margin: 0 0 .5rem; display: flex; flex-direction: column; gap: .6rem; }
.choices legend { font-weight: 600; padding: 0; margin-bottom: .2rem; }
.choice { display: flex; gap: .8rem; align-items: flex-start; border: 2px solid var(--border); border-radius: 12px; padding: .85rem 1rem; cursor: pointer; font-weight: 400 !important; }
.choice:hover { border-color: #b9c3cf; }
.choice:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.choice input { width: 22px; height: 22px; min-height: 0; margin-top: .15rem; flex: none; accent-color: var(--primary); }
.choice-title { display: block; font-weight: 700; }
.choice-help { display: block; color: var(--muted); font-size: .92rem; }
.check { display: flex; gap: .7rem; align-items: center; font-weight: 400 !important; cursor: pointer; }
.check input { width: 22px; height: 22px; min-height: 0; flex: none; accent-color: var(--primary); }
.step { display: flex; gap: 1rem; padding: 1.1rem 0; border-bottom: 1px solid var(--border); }
.step:last-of-type { border-bottom: 0; }
.step-num { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--primary); color: #fff; font-weight: 800; }
.step-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .35rem; }
.static-value { font-weight: 600; padding: .5rem 0; margin: 0; }
.dns-status { margin: .2rem 0 0; font-weight: 600; min-height: 1.5em; }
.dns-status.ok { color: var(--ok); }
.dns-status.warn { color: var(--warn); }
.password-field { display: flex; gap: .5rem; }
.password-field .btn { flex: none; min-height: 48px; }
.checklist { padding-left: 1.2rem; }
.checklist li { margin: .35rem 0; }
.steps { padding-left: 1.3rem; }
.steps li { margin: .7rem 0; }

/* Login */
.auth-page .container { min-height: 100vh; display: grid; place-items: center; padding-top: 2rem; }
.auth-card { width: 100%; max-width: 460px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow); padding: 2rem; }
.auth-brand { display: flex; align-items: center; gap: .6rem; font-weight: 700; margin-bottom: 1.2rem; color: var(--muted); }
.code-input { font-size: 1.6rem; letter-spacing: .4em; text-align: center; font-variant-numeric: tabular-nums; }
.qr { display: grid; place-items: center; margin: .8rem 0; }
.qr img { background: #fff; padding: 8px; border: 1px solid var(--border); border-radius: 12px; }
.secret { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 1.1rem; letter-spacing: .08em; background: var(--off-soft); padding: .5rem .7rem; border-radius: 8px; }

/* Trash, history, help */
.trash-list { list-style: none; margin: 0; padding: 0; }
.trash-list li { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .9rem 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.trash-list li:last-child { border-bottom: 0; }
.trash-list form { margin: 0; }
.trash-list .domain { font-size: 1.1rem; word-break: break-all; }
.empty-state .big-icon { font-size: 3rem; margin: 0; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 210px 1fr; gap: .1rem 1rem; padding: .7rem 0 .7rem .9rem; border-left: 4px solid var(--ok); margin-bottom: .4rem; }
.timeline li.failed { border-left-color: var(--bad); }
.timeline .when { color: var(--muted); font-size: .9rem; grid-row: span 3; }
.timeline .result { font-size: .95rem; }
.timeline.compact li { grid-template-columns: 210px 1fr; }
.faq details { border-bottom: 1px solid var(--border); padding: .9rem 0; }
.faq details:last-child { border-bottom: 0; }
.faq summary { font-size: 1.05rem; }

/* Busy overlay */
.busy { position: fixed; inset: 0; background: rgba(15, 23, 42, .55); display: grid; place-items: center; z-index: 20; }
.busy[hidden] { display: none; }
.busy-box { background: var(--surface); border-radius: 16px; padding: 2rem 2.2rem; text-align: center; max-width: 380px; margin: 1rem; }
.busy-title { font-size: 1.2rem; font-weight: 700; }
.spinner { width: 48px; height: 48px; margin: 0 auto 1rem; border-radius: 50%; border: 5px solid var(--primary-soft); border-top-color: var(--primary); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 3s; } }

/* Phones and tablets: every site becomes a card */
@media (max-width: 900px) {
  :root { font-size: 16px; }
  .topbar-inner { gap: .6rem; }
  .nav { order: 3; flex-basis: 100%; overflow-x: auto; flex-wrap: nowrap; }
  .nav a { white-space: nowrap; }
  .logout { margin-left: auto; }
  .site-row-head { display: none; }
  .site-row { grid-template-columns: 1fr 1fr; border: 1px solid var(--border); border-radius: 12px; margin-bottom: .75rem; padding: .9rem; }
  .site-row:last-of-type { border-bottom: 1px solid var(--border); }
  .site-name { grid-column: 1 / -1; font-size: 1.1rem; }
  .site-row [data-label]::before { content: attr(data-label); display: block; font-size: .78rem; color: var(--muted); font-weight: 600; }
  .site-actions { grid-column: 1 / -1; text-align: left; }
  .site-actions .btn { width: 100%; }
  .timeline li, .timeline.compact li { grid-template-columns: 1fr; }
  .timeline .when { grid-row: auto; }
  .page-head .actions { width: 100%; }
  .page-head .actions > * { flex: 1; }
  .page-head .actions .btn { width: 100%; }
}
