/* CertKeeper — security-print palette: banknote green ink on cool paper, a gold seal for emphasis. */
:root {
  --paper: #eef2ee;
  --surface: #ffffff;
  --sunk: #f5f8f5;
  --ink: #15302a;
  --ink-2: #2c4a42;
  --muted: #5b6f69;
  --line: #d3dcd6;
  --line-2: #e4eae6;
  --seal: #0c7556;
  --seal-ink: #ffffff;
  --seal-soft: #dcefe6;
  --gold: #b8892a;
  --amber: #a86a0c;
  --amber-soft: #f8ecd4;
  --red: #b23a28;
  --red-soft: #f7e1dc;
  --grey-soft: #e7ece9;
  --side: #15302a;
  --side-text: #cfe3da;
  --side-active: #23463d;
  --focus: #e9a93a;
  --radius-s: 6px;
  --radius-m: 10px;
  --shadow: 0 1px 0 rgba(21, 48, 42, .06), 0 6px 18px -10px rgba(21, 48, 42, .25);
  --font-display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --font-ui: "Public Sans", "Segoe UI", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0f1d1a;
    --surface: #152723;
    --sunk: #12221e;
    --ink: #e4efe9;
    --ink-2: #c3d6cd;
    --muted: #8fa69e;
    --line: #2a4139;
    --line-2: #213731;
    --seal: #3fb88d;
    --seal-ink: #08201a;
    --seal-soft: #173f33;
    --gold: #e0b55a;
    --amber: #e7a646;
    --amber-soft: #3a2c13;
    --red: #ef7b66;
    --red-soft: #3d1d17;
    --grey-soft: #22362f;
    --side: #0a1714;
    --side-text: #b9d2c7;
    --side-active: #1b322c;
    --shadow: 0 1px 0 rgba(0, 0, 0, .3), 0 8px 20px -12px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 15px/1.55 var(--font-ui);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--seal); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 650; letter-spacing: -.01em; line-height: 1.2; margin: 0; }
h1 { font-size: 1.85rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 .8em; }
.mono { font-family: var(--font-mono); font-size: .92em; letter-spacing: -.01em; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------------- app shell ---------------- */
.shell { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.side {
  background: var(--side);
  color: var(--side-text);
  padding: 22px 14px;
  display: flex; flex-direction: column; gap: 22px;
  position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px; color: #fff; text-decoration: none; }
.brand img { width: 34px; height: 34px; border-radius: 50%; background: #0d2621; }
.brand b { font: 650 1.12rem/1 var(--font-display); letter-spacing: -.01em; }
.brand span { display: block; font-size: .74rem; color: var(--side-text); margin-top: 3px; opacity: .8; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: var(--radius-s);
  color: var(--side-text); text-decoration: none; font-weight: 500;
}
.nav a svg { width: 18px; height: 18px; flex: none; opacity: .8; }
.nav a:hover { background: var(--side-active); color: #fff; }
.nav a[aria-current="page"] { background: var(--side-active); color: #fff; box-shadow: inset 3px 0 0 var(--gold); }
.side-foot { margin-top: auto; padding: 12px 10px 0; border-top: 1px solid rgba(255, 255, 255, .08); font-size: .85rem; }
.side-foot form { margin-top: 6px; }
.linkish { background: none; border: 0; padding: 0; color: #fff; font: inherit; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }

.main { padding: 30px clamp(16px, 4vw, 44px) 60px; max-width: 1180px; width: 100%; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px 20px; margin-bottom: 22px; }
.page-head p { margin: 6px 0 0; color: var(--muted); max-width: 62ch; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* ---------------- buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 38px; padding: 0 15px;
  border-radius: var(--radius-s); border: 1px solid var(--line);
  background: var(--surface); color: var(--ink);
  font: 600 .9rem/1 var(--font-ui); text-decoration: none; cursor: pointer;
  transition: background .12s, border-color .12s;
}
.btn:hover { border-color: var(--muted); }
.btn svg { width: 16px; height: 16px; }
.btn.primary { background: var(--seal); border-color: var(--seal); color: var(--seal-ink); }
.btn.primary:hover { filter: brightness(1.07); }
.btn.danger { color: var(--red); }
.btn.danger:hover { border-color: var(--red); background: var(--red-soft); }
.btn.small { min-height: 32px; padding: 0 11px; font-size: .84rem; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.inline { display: inline; margin: 0; }

/* ---------------- flash ---------------- */
.flashes { display: grid; gap: 8px; margin-bottom: 20px; }
.flash { padding: 11px 14px; border-radius: var(--radius-s); border-left: 4px solid var(--seal); background: var(--seal-soft); }
.flash.error { border-left-color: var(--red); background: var(--red-soft); }

/* ---------------- health strip ---------------- */
.health { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 18px 20px; margin-bottom: 18px; box-shadow: var(--shadow); }
.health-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 20px; align-items: baseline; }
.health-top h2 { font-size: 1.05rem; }
.bar { display: flex; height: 10px; border-radius: 99px; overflow: hidden; background: var(--grey-soft); margin: 14px 0 12px; }
.bar i { display: block; height: 100%; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0; padding: 0; list-style: none; font-size: .88rem; color: var(--muted); }
.legend li { display: flex; align-items: center; gap: 7px; }
.legend b { color: var(--ink); font-variant-numeric: tabular-nums; }
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.s-ok { --c: var(--seal); --c-soft: var(--seal-soft); }
.s-soon { --c: var(--amber); --c-soft: var(--amber-soft); }
.s-danger, .s-error { --c: var(--red); --c-soft: var(--red-soft); }
.s-new, .s-paused { --c: var(--muted); --c-soft: var(--grey-soft); }
.dot, .bar i { background: var(--c); }

/* ---------------- domain list ---------------- */
.list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); box-shadow: var(--shadow); overflow: hidden; }
.row {
  display: grid; align-items: center; gap: 16px;
  grid-template-columns: 54px minmax(0, 2.2fr) minmax(0, 1.2fr) 130px 210px;
  padding: 14px 18px; border-top: 1px solid var(--line-2);
}
.row:first-child { border-top: 0; }
.row.head { padding-top: 10px; padding-bottom: 10px; background: var(--sunk); font-size: .8rem; color: var(--muted); font-weight: 600; }
.row .name { font-family: var(--font-mono); font-weight: 600; font-size: .98rem; color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
.row .name:hover { color: var(--seal); text-decoration: underline; }
.row .sub { font-size: .84rem; color: var(--muted); margin-top: 2px; }
.row .when b { font-weight: 600; }
.tag { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 99px; font-size: .75rem; font-weight: 600; background: var(--grey-soft); color: var(--ink-2); vertical-align: 2px; margin-left: 6px; font-family: var(--font-ui); }
.tag.test { background: var(--amber-soft); color: var(--amber); }
.status { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; font-size: .9rem; color: var(--c); }
.busy { display: inline-flex; align-items: center; gap: 7px; color: var(--seal); font-weight: 600; font-size: .88rem; }
.spinner { width: 13px; height: 13px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* the seal: a ring that empties as the certificate ages */
.seal { position: relative; width: 48px; height: 48px; display: grid; place-items: center; }
.seal svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.seal .track { stroke: var(--line-2); }
.seal .arc { stroke: var(--c); stroke-linecap: round; transition: stroke-dashoffset .6s ease; }
.seal b { font: 700 .95rem/1 var(--font-display); font-variant-numeric: tabular-nums; color: var(--ink); }
.seal small { position: absolute; bottom: -15px; font-size: .66rem; color: var(--muted); white-space: nowrap; }
.seal.big { width: 132px; height: 132px; }
.seal.big b { font-size: 2.4rem; }
.seal.big small { position: static; display: block; text-align: center; margin-top: 4px; font-size: .8rem; }
.seal.big .inner { text-align: center; }

.empty { text-align: center; padding: 56px 20px; }
.empty img { width: 120px; opacity: .9; margin-bottom: 14px; filter: hue-rotate(0deg); background: var(--side); border-radius: 50%; }
.empty h2 { margin-bottom: 8px; }
.empty p { color: var(--muted); max-width: 46ch; margin: 0 auto 18px; }

/* ---------------- detail page ---------------- */
.detail-head { display: grid; grid-template-columns: auto 1fr; gap: 26px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 24px; box-shadow: var(--shadow); margin-bottom: 18px; }
.detail-head h1 { font-family: var(--font-mono); font-size: clamp(1.3rem, 3vw, 1.9rem); font-weight: 600; letter-spacing: -.03em; overflow-wrap: anywhere; }
.detail-head .status { margin: 8px 0 14px; font-size: 1rem; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 20px 22px; box-shadow: var(--shadow); }
.panel h2 { margin-bottom: 12px; }
.facts { display: grid; grid-template-columns: minmax(110px, auto) 1fr; gap: 9px 16px; margin: 0; }
.facts dt { color: var(--muted); font-size: .88rem; }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-family: var(--font-mono); font-size: .82rem; padding: 3px 8px; border-radius: var(--radius-s); background: var(--sunk); border: 1px solid var(--line-2); }
.match { font-weight: 600; }
.match.yes { color: var(--seal); }
.match.no { color: var(--amber); }

.jobs { list-style: none; margin: 0; padding: 0; }
.jobs li { display: grid; grid-template-columns: 14px 1fr auto; gap: 10px; align-items: baseline; padding: 9px 0; border-top: 1px solid var(--line-2); }
.jobs li:first-child { border-top: 0; }
.jobs .dot { transform: translateY(1px); }
.j-ok { --c: var(--seal); } .j-skipped { --c: var(--muted); } .j-error { --c: var(--red); } .j-queued, .j-running { --c: var(--gold); }

/* ---------------- tables ---------------- */
.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); box-shadow: var(--shadow); overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 16px; border-top: 1px solid var(--line-2); vertical-align: top; }
thead th { border-top: 0; background: var(--sunk); font-size: .8rem; color: var(--muted); font-weight: 600; white-space: nowrap; }
td .sub { font-size: .84rem; color: var(--muted); }
.ok-text { color: var(--seal); font-weight: 600; }
.err-text { color: var(--red); font-weight: 600; }

/* ---------------- forms ---------------- */
.form { max-width: 720px; }
.form .panel + .panel { margin-top: 16px; }
.field { margin-bottom: 16px; }
.field:last-child { margin-bottom: 0; }
.field > label, .legend-label { display: block; font-weight: 600; margin-bottom: 6px; }
.hint { display: block; color: var(--muted); font-size: .85rem; margin-top: 5px; }
input[type=text], input[type=password], input[type=email], input[type=number], select {
  width: 100%; min-height: 42px; padding: 9px 12px;
  border: 1px solid var(--line); border-radius: var(--radius-s);
  background: var(--surface); color: var(--ink); font: inherit;
}
input:focus, select:focus { border-color: var(--seal); outline: 3px solid color-mix(in srgb, var(--seal) 25%, transparent); outline-offset: 0; }
.row2 { display: grid; grid-template-columns: 2fr 1fr; gap: 14px; }
.row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.step { display: grid; grid-template-columns: 30px 1fr; gap: 14px; }
.step-n { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font: 700 .9rem/1 var(--font-display); background: var(--seal-soft); color: var(--seal); }
.step h2 { margin: 4px 0 4px; font-size: 1.05rem; }
.step .hint { margin: 0 0 12px; }

.ticks { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.tick {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-s);
  background: var(--surface); cursor: pointer; min-width: 0;
}
.tick:hover { border-color: var(--muted); }
.tick input { width: 18px; height: 18px; accent-color: var(--seal); flex: none; margin: 0; }
.tick span { overflow-wrap: anywhere; }
.tick .mono { font-weight: 500; }
.tick:has(input:checked) { border-color: var(--seal); background: var(--seal-soft); }
.tick small { display: block; color: var(--muted); font-size: .78rem; font-family: var(--font-ui); }
.opt-list { display: grid; gap: 8px; }
.opt-list .tick { align-items: flex-start; }
.opt-list .tick input { margin-top: 2px; }
.loading { color: var(--muted); display: flex; align-items: center; gap: 8px; padding: 6px 0; }
.form-foot { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; align-items: center; }

/* ---------------- log ---------------- */
.log {
  background: #0d1f1b; color: #cfe6dc; border-radius: var(--radius-m);
  padding: 16px 18px; font: 400 .84rem/1.6 var(--font-mono);
  white-space: pre-wrap; overflow-wrap: anywhere; min-height: 240px; max-height: 70vh; overflow: auto;
}
.log .err { color: #ff9b85; }
.log .good { color: #8fe0bd; }
.job-status { display: flex; align-items: center; gap: 10px; font-weight: 600; margin: 4px 0 16px; }

/* ---------------- login ---------------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(360px, .9fr); background: var(--surface); }
.auth-art {
  background: radial-gradient(circle at 50% 46%, #1d4a3f 0%, #15302a 58%, #0f2520 100%);
  display: grid; place-items: center; position: relative; overflow: hidden; padding: 40px;
}
.auth-art img { width: min(78%, 560px); aspect-ratio: 1; }
.auth-art .caption {
  position: absolute; left: 40px; bottom: 34px; right: 40px;
  color: #cfe3da; font-size: .92rem; max-width: 40ch;
}
.auth-art .caption b { display: block; font: 600 1.35rem/1.25 var(--font-display); color: #fff; margin-bottom: 6px; letter-spacing: -.01em; }
.auth-form { display: flex; flex-direction: column; justify-content: center; padding: 48px clamp(20px, 6vw, 72px); }
.auth-form .brand { color: var(--ink); padding: 0; margin-bottom: 40px; }
.auth-form .brand span { color: var(--muted); }
.auth-form h1 { font-size: 2rem; margin-bottom: 8px; }
.auth-form > p { color: var(--muted); margin-bottom: 28px; max-width: 40ch; }
.auth-form form { max-width: 380px; }
.auth-form .btn.primary { width: 100%; min-height: 46px; font-size: 1rem; margin-top: 6px; }
.auth-error { background: var(--red-soft); color: var(--red); border-radius: var(--radius-s); padding: 10px 12px; margin-bottom: 16px; font-weight: 500; max-width: 380px; }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 64px; }
.pw-toggle { position: absolute; right: 6px; top: 6px; height: 30px; padding: 0 10px; border: 0; background: var(--sunk); border-radius: 4px; color: var(--muted); font: 600 .78rem/1 var(--font-ui); cursor: pointer; }
.auth-foot { margin-top: 36px; font-size: .8rem; color: var(--muted); }

/* ---------------- responsive ---------------- */
@media (max-width: 980px) {
  .row { grid-template-columns: 54px minmax(0, 1fr) 210px; }
  .row .c-acct, .row .c-when, .row.head .c-acct, .row.head .c-when { display: none; }
  .grid2 { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; align-items: center; flex-wrap: wrap; padding: 12px 16px; gap: 10px; }
  .nav { flex-direction: row; overflow-x: auto; width: 100%; order: 3; gap: 4px; padding-bottom: 2px; }
  .nav a { white-space: nowrap; padding: 8px 10px; }
  .nav a[aria-current="page"] { box-shadow: inset 0 -3px 0 var(--gold); }
  .side-foot { margin: 0 0 0 auto; padding: 0; border: 0; display: flex; gap: 10px; align-items: center; }
  .side-foot form { margin: 0; }
  .side-foot .who { display: none; }
  .auth { grid-template-columns: 1fr; }
  .auth-art { min-height: 230px; padding: 24px; }
  .auth-art img { width: 200px; }
  .auth-art .caption { display: none; }
  .auth-form { padding-top: 32px; }
  .auth-form .brand { margin-bottom: 24px; }
}
@media (max-width: 560px) {
  .main { padding-top: 22px; }
  h1 { font-size: 1.55rem; }
  .row { grid-template-columns: 48px minmax(0, 1fr); gap: 12px; padding: 14px; }
  .row .c-act { grid-column: 2; }
  .row.head { display: none; }
  .detail-head { grid-template-columns: 1fr; justify-items: start; }
  .row2, .row3 { grid-template-columns: 1fr; }
  .facts { grid-template-columns: 1fr; gap: 2px 0; }
  .facts dd { margin-bottom: 8px; }
  th, td { padding: 10px 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
