/* Friborg Style Bench — quiet utility, mobile-first, blue accent, max 4px radius */

:root {
  --bg: #f7f6f2;          /* warm paper */
  --surface: #ffffff;
  --text: #1a1d23;        /* deep ink */
  --muted: #5c6470;
  --line: #e4e1d9;
  --blue: #2f6fae;        /* calm blue accent */
  --primary: var(--blue);
  --primary-ink: #ffffff;
  --live: #2f7d4f;        /* quiet green for Live tag */
  --radius: 4px;
  --shadow: 0 1px 2px rgba(20, 24, 33, 0.06), 0 4px 12px rgba(20, 24, 33, 0.04);
  --maxw: 860px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  font-size: 17px;
}

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

/* Skip link */
.skip {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--primary);
  color: var(--primary-ink);
  padding: 0.6rem 1rem;
  border-radius: var(--radius);
  z-index: 20;
}
.skip:focus { left: 0.5rem; top: 0.5rem; }

/* Top bar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 1rem;
  background: rgba(247, 246, 242, 0.92);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.brand .mark { width: 26px; height: 26px; color: var(--primary); flex: none; }
.mobile-title { display: none; }
.stations { display: flex; gap: 0.25rem; flex-wrap: wrap; }
.stations a {
  display: inline-flex;
  align-items: center;
  min-height: 46px;
  text-decoration: none;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.35rem 0.6rem;
  border-radius: var(--radius);
}
.stations a:hover { color: var(--text); background: rgba(47, 111, 174, 0.08); }

/* Layout */
main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 1.25rem 1rem 2.5rem;
}
section {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
}
section > h2 {
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 0.4rem;
}
.section-note { color: var(--muted); font-size: 0.95rem; margin-bottom: 1rem; }

/* Mobile nav */
.mobile-stations {
  display: flex;
  gap: 0.25rem;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  background: rgba(247, 246, 242, 0.98);
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 0.35rem 0.5rem;
  scrollbar-width: none;
}
.mobile-stations::-webkit-scrollbar { display: none; }
.mobile-stations a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  text-decoration: none;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.35rem 0.7rem;
  border-radius: var(--radius);
  white-space: nowrap;
}
.mobile-stations a:hover { color: var(--text); background: rgba(47, 111, 174, 0.08); }

/* Hero */
#hero {
  background: linear-gradient(180deg, #ffffff 0%, #fbfaf7 100%);
  border-top: 3px solid var(--primary);
}
#hero h1 { font-size: 2rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; }
.lede { font-size: 1.05rem; margin-top: 0.5rem; max-width: 46ch; }
.reflect {
  margin-top: 0.75rem;
  display: inline-block;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--primary);
  border-left: 3px solid var(--primary);
  padding-left: 0.6rem;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1.1rem; }

/* Buttons */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0.6rem 1.2rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius);
  border: 1px solid transparent;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}
.button.primary { background: var(--primary); color: var(--primary-ink); }
.button.primary:hover { background: #28608f; }
.button.ghost { background: transparent; color: var(--primary); border-color: var(--line); }
.button.ghost:hover { border-color: var(--primary); background: rgba(47, 111, 174, 0.06); }
.button:focus-visible,
.stations a:focus-visible,
input:focus-visible,
textarea:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.button[disabled] { opacity: 0.55; cursor: not-allowed; }

/* Priority deck */
.deck { list-style: none; display: grid; gap: 0.75rem; }
.section-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.section-header-text { min-width: 0; }
.deck-controls { display: flex; align-items: center; }
.deck-filters { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-top: 0.6rem; }
.deck-filters button { min-height: 46px; font-size: 0.9rem; padding: 0 0.7rem; }
.deck-filters button[aria-pressed="true"] { background: var(--primary); color: var(--primary-ink); border-color: transparent; }
.deck-meta { margin-top: 0.5rem; font-size: 0.88rem; color: var(--muted); min-height: 1.1em; }
.card { position: relative; border: 1px solid var(--line); border-left: 3px solid var(--primary); border-radius: var(--radius); padding: 0.9rem 1rem; background: #fcfbf9; transition: transform 0.18s ease, opacity 0.18s ease; }
[data-motion="off"] .card, [data-motion="off"] .button { transition: none !important; }
[data-motion="on"] .card.enter { transform: translateY(6px); opacity: 0; }
[data-motion="on"] .card.enter-visible { transform: translateY(0); opacity: 1; }
.card h3 { font-size: 1.02rem; font-weight: 600; margin-bottom: 0.25rem; }
.card p { font-size: 0.92rem; color: var(--muted); }
.card-meta { margin-top: 0.35rem; font-size: 0.82rem; color: var(--muted); }
.card-actions { margin-top: 0.5rem; display: flex; gap: 0.5rem; flex-wrap: wrap; }
.card-actions .button { min-height: 46px; font-size: 0.9rem; padding: 0.35rem 0.8rem; }
.deck-meta[hidden] { display: none; }
.tag { display: inline-block; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; padding: 0.1rem 0.45rem; border-radius: var(--radius); margin-bottom: 0.4rem; }
.tag-live { background: rgba(47, 125, 79, 0.12); color: var(--live); }
.tag-open { background: rgba(47, 111, 174, 0.1); color: var(--primary); }
.tag-next { background: rgba(47, 111, 174, 0.1); color: var(--primary); }
@media (min-width: 720px) {
  .deck { grid-template-columns: repeat(2, 1fr); }
  .card-actions .button { min-height: 46px; }
}
@media (min-width: 980px) {
  .deck { grid-template-columns: repeat(3, 1fr); }
}
.tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.1rem 0.45rem;
  border-radius: var(--radius);
  margin-bottom: 0.4rem;
}
.tag-live { background: rgba(47, 125, 79, 0.12); color: var(--live); }
.tag-next { background: rgba(47, 111, 174, 0.1); color: var(--primary); }

/* Forms */
.form { display: grid; gap: 0.85rem; }
.field { display: grid; gap: 0.3rem; }
.field label { font-size: 0.9rem; font-weight: 600; }
.field input,
.field textarea {
  font: inherit;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.6rem 0.7rem;
  width: 100%;
  resize: vertical;
}
.field input:focus,
.field textarea:focus { border-color: var(--primary); }

.verdict-row { display: flex; gap: 0.6rem; margin-bottom: 1rem; flex-wrap: wrap; }
.button.verdict { flex: 1 1 140px; }
.button.verdict.reject { background: transparent; color: #b4452f; border-color: #e2b3a8; }
.button.verdict.reject:hover { background: rgba(180, 69, 47, 0.07); }
.button.verdict.approve { background: var(--primary); color: var(--primary-ink); }
.button.verdict.approve:hover { background: #28608f; }

.status { margin-top: 0.75rem; font-size: 0.92rem; font-weight: 600; min-height: 1.2em; color: var(--primary); }
.status[data-kind="ok"] { color: var(--live); }
.status[data-kind="warn"] { color: #b07a16; }
.status[data-kind="error"] { color: #b4452f; }
#loop-signal { margin-top: 0.75rem; color: var(--muted); font-weight: 500; }
.api-link { margin-top: 0.75rem; font-size: 0.82rem; color: var(--muted); }
.api-link a,
.foot a {
  display: inline-flex;
  align-items: center;
  min-height: 46px;
}

/* Screen Doctor result */
.doctor-result {
  margin-top: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
  background: #fcfbf9;
}
.doctor-result[hidden] { display: none; }
.score { font-size: 2rem; font-weight: 700; color: var(--primary); line-height: 1; }
.score small { font-size: 1rem; color: var(--muted); font-weight: 500; }
.verdict-text { font-weight: 600; margin: 0.4rem 0 0.6rem; }
.warnings { list-style: none; display: grid; gap: 0.4rem; }
.warnings li {
  font-size: 0.9rem;
  padding: 0.5rem 0.7rem;
  border-left: 3px solid #c98a1e;
  background: rgba(201, 138, 30, 0.08);
  border-radius: var(--radius);
}

/* Rules */
.rules { list-style: none; display: grid; gap: 0.6rem; }
.rules li { padding-left: 0.2rem; }
.rules strong { color: var(--primary); }

/* Footer */
.foot {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 1rem;
  text-align: center;
  font-size: 0.82rem;
  color: var(--muted);
}

/* Desktop */
@media (min-width: 640px) {
  main { padding-top: 1.75rem; }
  section { padding: 1.75rem; }
  #hero h1 { font-size: 2.4rem; }
  .deck { grid-template-columns: repeat(2, 1fr); }
  .stations a { font-size: 0.95rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
