/* PSU Wattage Check — mobile-first, dark-mode aware.
   Token system reused from the aquacalc/Statlas surface rail. */
:root {
  --bg: #f7f6f4;
  --card: #ffffff;
  --text: #1f1c17;
  --muted: #6f6a60;
  --line: #e4e0d8;
  --accent: #b3591b;
  --accent-text: #ffffff;
  --ok: #e2f3e8;      --ok-line: #3f9c65;
  --info: #e8eff5;    --info-line: #5b87a8;
  --warn: #fdf3d0;    --warn-line: #d9a92c;
  --danger: #fbe2e0;  --danger-line: #d96b62;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14120f;
    --card: #1e1b17;
    --text: #ece9e4;
    --muted: #a49d92;
    --line: #35302a;
    --accent: #e08a45;
    --accent-text: #241304;
    --ok: #1c352a;      --ok-line: #3f9c65;
    --info: #1d2b36;    --info-line: #5b87a8;
    --warn: #3a3315;    --warn-line: #d9a92c;
    --danger: #3d201e;  --danger-line: #d96b62;
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
}

.wrap { max-width: 36rem; margin: 0 auto; padding: 1.25rem 1rem 3rem; }

.top { text-align: center; margin-bottom: 1rem; }
h1 { font-size: 1.55rem; letter-spacing: 0.01em; }
.tagline { color: var(--muted); font-size: 0.9rem; margin-top: 0.3rem; }
.crumb { font-size: 0.8rem; margin-bottom: 0.4rem; }
.crumb a { color: var(--muted); text-decoration: none; }
.crumb a:hover { color: var(--accent); }

a { color: var(--accent); }

.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 0.8rem; padding: 1rem; margin-bottom: 1rem;
}
.card-title { font-size: 1.05rem; margin-bottom: 0.7rem; }

.field { display: flex; flex-direction: column; gap: 0.25rem; margin-bottom: 0.8rem; }
.field:last-child { margin-bottom: 0; }
.field-label { font-size: 0.8rem; color: var(--muted); }

input[type="text"], select {
  width: 100%; font-size: 1rem; padding: 0.6rem 0.7rem;
  border: 1px solid var(--line); border-radius: 0.6rem;
  background: var(--bg); color: var(--text);
}
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: -1px; }

button {
  font-size: 1rem; padding: 0.6rem 1rem; border: none; border-radius: 0.6rem;
  background: var(--accent); color: var(--accent-text); font-weight: 600; cursor: pointer;
}
button:active { transform: translateY(1px); }

.input-wrap { position: relative; }
.suggestions {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 10;
  background: var(--card); border: 1px solid var(--line); border-radius: 0.6rem;
  overflow: hidden; box-shadow: 0 6px 18px rgba(0,0,0,0.18);
}
.sug {
  display: block; width: 100%; text-align: left; background: none;
  color: var(--text); font-weight: 400; border-radius: 0;
  padding: 0.55rem 0.8rem; border-bottom: 1px solid var(--line);
}
.sug:last-child { border-bottom: none; }
.sug:hover, .sug.active { background: var(--accent); color: var(--accent-text); }
.sug .sci { font-size: 0.78rem; opacity: 0.75; }

.chosen { margin-top: 0.4rem; }
.chip {
  display: flex; align-items: center; gap: 0.6rem;
  border: 1px solid var(--line); border-radius: 0.6rem; padding: 0.45rem 0.6rem;
}
.chip-name { font-weight: 600; font-size: 0.95rem; }
.chip-meta { font-size: 0.75rem; color: var(--muted); }
.chip > div:first-child { flex: 1; min-width: 0; }
.chip .chip-name + .chip-meta { margin-top: 0.1rem; }
.remove-btn {
  background: none; color: var(--muted); font-size: 1.1rem; padding: 0.2rem 0.4rem;
  margin-left: auto;
}
.remove-btn:hover { color: var(--danger-line); }
.chip > div { flex: 1; }

.verdict-banner {
  border: 1px solid var(--line); border-left-width: 4px;
  border-radius: 0.5rem; padding: 0.7rem 0.8rem; font-size: 1.05rem;
  font-weight: 700; margin-bottom: 0.7rem;
}
.verdict-banner.ok      { background: var(--ok);     border-left-color: var(--ok-line); }
.verdict-banner.warning { background: var(--warn);   border-left-color: var(--warn-line); }
.verdict-banner.danger  { background: var(--danger); border-left-color: var(--danger-line); }
.headline { margin-bottom: 0.7rem; font-size: 0.95rem; }

.verdicts { list-style: none; display: grid; gap: 0.4rem; }
.verdict {
  border: 1px solid var(--line); border-left-width: 4px;
  border-radius: 0.5rem; padding: 0.55rem 0.7rem; font-size: 0.92rem;
}
.verdict.ok      { background: var(--ok);     border-left-color: var(--ok-line); }
.verdict.info    { background: var(--info);   border-left-color: var(--info-line); }
.verdict.warning { background: var(--warn);   border-left-color: var(--warn-line); }
.verdict.danger  { background: var(--danger); border-left-color: var(--danger-line); }
.verdict .sev { font-weight: 700; font-size: 0.75rem; letter-spacing: 0.05em;
  text-transform: uppercase; display: block; margin-bottom: 0.1rem; }

details { margin-top: 0.8rem; }
summary { cursor: pointer; color: var(--accent); font-size: 0.9rem; }
.steps { list-style: none; display: grid; gap: 0.5rem; margin-top: 0.7rem; }
.step {
  border: 1px solid var(--line); border-radius: 0.5rem;
  padding: 0.55rem 0.7rem; font-size: 0.88rem;
}
.step strong { display: block; margin-bottom: 0.1rem; }

.cta { margin-top: 0.9rem; }
.btn {
  display: inline-block; background: var(--accent); color: var(--accent-text);
  font-weight: 600; padding: 0.6rem 1rem; border-radius: 0.6rem;
  text-decoration: none;
}

.sources, .related { list-style: none; display: grid; gap: 0.35rem;
  font-size: 0.9rem; }
.qlist { grid-template-columns: 1fr; }
.slot { margin-top: 0.8rem; font-size: 0.78rem; color: var(--muted); }

.tblwrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 0.82rem; }
th, td { text-align: left; padding: 0.35rem 0.5rem; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 600; white-space: nowrap; }

.share-row { display: flex; align-items: center; gap: 0.7rem; margin-top: 0.9rem; }
.share-msg { font-size: 0.85rem; color: var(--muted); }

.foot { margin-top: 2rem; color: var(--muted); font-size: 0.72rem; text-align: center; }
