/* Pearl Drop — raindrop storm theme: deep navy + luminous cyan/teal. */
:root {
  --bg: #060b18;
  --bg2: #0a1226;
  --panel: #0c152e;
  --panel2: #0f1b38;
  --line: #1c2c52;
  --ink: #e8f4ff;
  --dim: #93a7c9;
  --cyan: #38e1ff;
  --teal: #2dd4bf;
  --aqua: #7ef0ff;
  --amber: #ffcf6e;
  --red: #ff6b7a;
  --green: #4ade80;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background:
    radial-gradient(1200px 500px at 20% -5%, rgba(56,225,255,.10), transparent 60%),
    radial-gradient(900px 500px at 85% 10%, rgba(45,212,191,.08), transparent 60%),
    linear-gradient(180deg, var(--bg), #04070f 140%);
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, "Segoe UI", Roboto, sans-serif;
  line-height: 1.55;
  min-height: 100vh;
}
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; overflow-wrap: anywhere; }
.dim { opacity: .65; }

/* ---- hero ---- */
.hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(160deg, #0a1430 0%, #071022 60%, #060b18 100%);
}
.rain {
  position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image:
    linear-gradient(transparent 92%, rgba(126,240,255,.55) 100%);
  background-size: 46px 90px, 34px 120px, 58px 70px;
  animation: rainfall 1.6s linear infinite;
}
@keyframes rainfall { from { background-position-y: 0, 30px, -20px; } to { background-position-y: 90px, 150px, 50px; } }
.hero-inner { position: relative; max-width: 1060px; margin: 0 auto; padding: 44px 24px 28px; }
.kicker { color: var(--cyan); text-transform: uppercase; letter-spacing: .28em; font-size: 12px; margin: 0 0 10px; }
.hero h1 {
  margin: 0 0 10px; font-size: 44px; letter-spacing: -.01em;
  background: linear-gradient(100deg, var(--aqua), var(--cyan) 45%, var(--teal));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 0 34px rgba(56,225,255,.25);
}
.drop-glyph { -webkit-text-fill-color: var(--cyan); }
.hero .sub { max-width: 760px; color: var(--dim); margin: 0 0 22px; }
.hero .sub strong { color: var(--ink); }

/* ---- tabs ---- */
.tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.tabs button {
  background: rgba(56,225,255,.06);
  border: 1px solid var(--line);
  color: var(--dim);
  padding: 9px 14px; border-radius: 10px; cursor: pointer; font-size: 14px;
}
.tabs button:hover { border-color: var(--cyan); color: var(--ink); }
.tabs button.active {
  background: linear-gradient(120deg, rgba(56,225,255,.22), rgba(45,212,191,.16));
  border-color: var(--cyan); color: var(--ink);
  box-shadow: 0 0 18px rgba(56,225,255,.25);
}

/* ---- layout ---- */
main { max-width: 1060px; margin: 0 auto; padding: 26px 24px 10px; }
.panel { display: none; }
.panel.active { display: block; animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; } }
.panel h2 { color: var(--aqua); margin: 6px 0 8px; font-size: 26px; }
.panel h3 { color: var(--teal); margin: 26px 0 8px; font-size: 18px; }
.lede { color: var(--dim); max-width: 820px; }
.lede a { color: var(--cyan); }
.hint a { color: var(--cyan); }
.hint { color: var(--dim); font-size: 13px; }
.err { color: var(--red); font-size: 14px; min-height: 1.2em; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 14px 0; }
.span2 { grid-column: 1 / -1; }
.field label { display: block; margin-bottom: 6px; font-size: 14px; color: var(--dim); }
.field { margin: 12px 0; }
input[type=text], input[type=date], textarea {
  width: 100%; background: var(--bg2); border: 1px solid var(--line);
  color: var(--ink); border-radius: 10px; padding: 10px 12px; font-size: 15px;
}
input:focus, textarea:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(56,225,255,.15); }
input:disabled, textarea:disabled { opacity: .45; cursor: not-allowed; }
textarea.tall { min-height: 170px; }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 14px 0; }

button {
  border-radius: 10px; padding: 10px 18px; font-size: 15px; cursor: pointer; border: 1px solid var(--line);
}
button.primary {
  background: linear-gradient(120deg, #298ca7, #0f9d8a);
  border-color: var(--cyan); color: #02141a; font-weight: 700;
  box-shadow: 0 0 22px rgba(56,225,255,.35);
}
button.primary:hover { filter: brightness(1.12); }
button.primary:disabled { opacity: .45; box-shadow: none; cursor: not-allowed; }
button.ghost { background: rgba(56,225,255,.06); color: var(--ink); }
button.ghost:hover { border-color: var(--cyan); }
.btn-link {
  display: inline-block; border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 18px; color: var(--cyan); text-decoration: none; font-size: 15px;
}
.btn-link:hover { border-color: var(--cyan); }

.out {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 18px; margin: 16px 0;
}
.hidden { display: none !important; }
pre.scroll {
  background: #04070f; border: 1px solid var(--line); border-radius: 10px;
  padding: 14px; overflow: auto; max-height: 320px; font-size: 13px; line-height: 1.5;
  white-space: pre-wrap; word-break: break-all;
}
.wrap { word-break: break-all; }
.kv { display: grid; grid-template-columns: 200px 1fr; gap: 8px; margin: 10px 0; font-size: 14px; }
.kv > span { color: var(--dim); }
.kv.big { font-size: 16px; }
.kv code { color: var(--aqua); }

.stats { display: flex; gap: 12px; flex-wrap: wrap; margin: 14px 0; }
.stat {
  flex: 1 1 140px; background: var(--panel2); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px 14px; text-align: center;
}
.stat .num { display: block; font-size: 24px; color: var(--cyan); font-weight: 700; }
.stat .lbl { font-size: 12px; color: var(--dim); text-transform: uppercase; letter-spacing: .08em; }

.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); }
th { color: var(--teal); font-weight: 600; background: rgba(45,212,191,.05); }
td { word-break: break-all; }
tbody tr:nth-child(odd) { background: rgba(56,225,255,.025); }

.checklist { list-style: none; padding: 0; margin: 10px 0; }
.checklist li { padding: 8px 12px; border-radius: 8px; margin: 6px 0; font-size: 14px; }
.checklist li.good { background: rgba(74,222,128,.08); border: 1px solid rgba(74,222,128,.35); }
.checklist li.bad { background: rgba(255,107,122,.08); border: 1px solid rgba(255,107,122,.4); }
.checklist li.warn { background: rgba(255,207,110,.08); border: 1px solid rgba(255,207,110,.4); }

.status-badge {
  display: inline-block; padding: 4px 14px; border-radius: 999px; font-size: 14px;
  border: 1px solid var(--line); text-transform: uppercase; letter-spacing: .12em; font-weight: 700;
}
.st-draft { color: var(--dim); }
.st-open { color: var(--cyan); border-color: var(--cyan); box-shadow: 0 0 14px rgba(56,225,255,.3); }
.st-closed { color: var(--amber); border-color: var(--amber); }
.st-sealed { color: var(--green); border-color: var(--green); box-shadow: 0 0 14px rgba(74,222,128,.3); }

.lock {
  background: rgba(255,207,110,.07); border: 1px solid rgba(255,207,110,.45);
  border-radius: 10px; padding: 12px 16px; margin: 12px 0; font-size: 14px;
}

.verdict {
  border-radius: 12px; padding: 16px 20px; margin: 16px 0; font-size: 18px; font-weight: 700;
}
.verdict.valid { background: rgba(74,222,128,.1); border: 1px solid var(--green); color: var(--green); box-shadow: 0 0 24px rgba(74,222,128,.25); }
.verdict.invalid { background: rgba(255,107,122,.1); border: 1px solid var(--red); color: var(--red); box-shadow: 0 0 24px rgba(255,107,122,.3); }

.notes { color: var(--dim); max-width: 860px; }
.notes li { margin: 8px 0; }
.notes strong { color: var(--ink); }
.notes code { color: var(--aqua); }

/* ---- honest limits + footer ---- */
.limits {
  max-width: 1060px; margin: 26px auto 0; padding: 0 24px;
}
.limits > div {
  border: 1px solid rgba(255,207,110,.4); border-radius: 14px;
  background: rgba(255,207,110,.05); padding: 16px 20px; font-size: 14px;
}
.limits strong { color: var(--amber); }
.limits ul { margin: 8px 0 0; padding-left: 20px; color: var(--dim); }
.limits li { margin: 5px 0; }
.limits code { color: var(--aqua); }

footer {
  max-width: 1060px; margin: 24px auto 0; padding: 20px 24px 40px;
  border-top: 1px solid var(--line); color: var(--dim); font-size: 14px;
  display: flex; gap: 24px; flex-wrap: wrap; align-items: center; justify-content: space-between;
}
footer a { color: var(--cyan); }
footer .donate code { color: var(--aqua); font-size: 13px; word-break: break-all; }

@media (max-width: 640px) {
  .grid2 { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; }
  .hero h1 { font-size: 32px; }
}

/* Keyboard focus: a visible ring in this app's accent on every interactive element (fleet focus-visible pass). */
:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }

/* Skip link: the first Tab stop on the page — parked off-screen until keyboard focus reveals it (fleet skip-link pass). */
.skip-link { position: absolute; left: 12px; top: -64px; z-index: 1000; padding: 10px 16px; border: 2px solid var(--amber); border-radius: 8px; background: #0b0e14; color: var(--amber); font-weight: 700; text-decoration: none; transition: top .15s ease; }
.skip-link:focus-visible { top: 12px; }
main:focus { outline: none; }

/* Reduced motion: when the OS asks for reduced motion, animations and transitions finish near-instantly and scrolling is not smoothed (fleet reduced-motion pass). Near-zero durations — not animation: none — so fade-ins still land on their end state and no content can be stranded invisible. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
