:root {
  --bg: #f3efe6;
  --ink: #1c1915;
  --muted: #6b645b;
  --line: #e4dccf;
  --card: #fffdf8;
  --accent: #8c3a22;
  --accent-soft: #f3e4dc;
  --ok: #1f6b45;
  --warn: #8a5a12;
  --bad: #8d2b2b;
  --shadow: 0 16px 40px rgba(48, 32, 16, 0.06);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 10% -10%, #efe4d4 0%, transparent 55%),
    var(--bg);
  font-family: "Segoe UI", Candara, sans-serif;
  line-height: 1.5;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.shell { max-width: 980px; margin: 0 auto; padding: 28px 20px 64px; }

.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
}

.brand {
  font-family: Georgia, "Iowan Old Style", serif;
  font-size: 1.45rem;
  letter-spacing: -0.03em;
  color: var(--ink);
  text-decoration: none;
}

.nav { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.nav a, .btn, button {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  border-radius: 999px;
  padding: 8px 14px;
  font: inherit;
  cursor: pointer;
  text-decoration: none;
}

.nav a.active, .btn.primary, button.primary {
  background: var(--ink);
  color: #f7f1e8;
  border-color: var(--ink);
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 22px;
}

.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.stat strong { display: block; font-family: Georgia, serif; font-size: 2rem; }

h1, h2 {
  font-family: Georgia, "Iowan Old Style", serif;
  font-weight: 500;
  letter-spacing: -0.03em;
  margin: 0 0 8px;
}

.muted { color: var(--muted); }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

input[type="text"], input[type="password"] {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 12px 14px;
  font: inherit;
  color: var(--ink);
}

label { display: block; font-size: 0.92rem; margin-bottom: 6px; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 0.82rem; letter-spacing: 0.04em; text-transform: uppercase; }

.badge {
  display: inline-block;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 0.8rem;
  background: var(--accent-soft);
  color: var(--accent);
}
.badge.ok { background: #e5f3eb; color: var(--ok); }
.badge.warn { background: #f8efd8; color: var(--warn); }
.badge.bad { background: #f8e4e4; color: var(--bad); }
.badge.off { background: #eeeae4; color: var(--muted); }

.error {
  background: #f8e4e4;
  color: var(--bad);
  border-radius: 12px;
  padding: 10px 12px;
}

.transcript {
  white-space: pre-wrap;
  font-family: Georgia, serif;
  font-size: 1.05rem;
  line-height: 1.65;
  user-select: text;
  -webkit-user-select: text;
  cursor: text;
}

.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card { width: min(420px, 100%); }

.meter { display: flex; align-items: center; gap: 8px; min-width: 140px; }
.meter .track { flex: 1; height: 6px; background: var(--line); border-radius: 99px; overflow: hidden; }
.meter .fill { display: block; height: 100%; background: var(--accent); width: 0; }
.meter .pct { min-width: 3rem; font-variant-numeric: tabular-nums; }

.ghost { background: transparent; border: none; color: var(--bad); padding: 0; cursor: pointer; font: inherit; }
.ghost:hover { text-decoration: underline; }

@media (max-width: 720px) {
  .grid { grid-template-columns: 1fr; }
  .top { align-items: flex-start; flex-direction: column; }
  table, thead, tbody, tr, th, td { display: block; }
  thead { display: none; }
  td { border-bottom: none; padding: 4px 0; }
  tr { border-bottom: 1px solid var(--line); padding: 12px 0; }
}
