/* Oswald is SIL OFL. Roboto is Apache 2.0. License files sit in static/fonts/. */

@font-face {
  font-family: "Oswald";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/oswald-500.woff2") format("woff2");
}

@font-face {
  font-family: "Oswald";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/oswald-600.woff2") format("woff2");
}

@font-face {
  font-family: "Oswald";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/oswald-700.woff2") format("woff2");
}

@font-face {
  font-family: "Roboto";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/roboto-400.woff2") format("woff2");
}

@font-face {
  font-family: "Roboto";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/roboto-500.woff2") format("woff2");
}

@font-face {
  font-family: "Roboto";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/roboto-700.woff2") format("woff2");
}

:root {
  color-scheme: light;
  --hes-orange: #E9661F;
  --hes-orange-deep: #B9501A;
  --ink: #1D1D1B;
  --charcoal: #2B2B2A;
  --steel: #D6D3CE;
  --paper: #F6F5F2;
  --card: #FFF;
  --play: #1E7A4C;
  --play-bg: #E6F4EC;
  --avoid: #A8261E;
  --avoid-bg: #FBE5E3;
  --case: #1F5FA8;
  --case-bg: #E5EEF9;
  --open: #5A5A5A;
  --open-bg: #F1F1F0;
  --na: #6B6B6B;
  --na-bg: #FAFAF8;
  --muted: #5A5A5A;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Roboto", "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
}

.skip {
  position: absolute;
  left: -999px;
  background: var(--card);
  color: var(--ink);
  padding: 0.4rem 0.6rem;
}

.skip:focus { left: 1rem; top: 1rem; z-index: 2; }

.site-header, main, footer {
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

.site-header {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  align-items: center;
  background: var(--charcoal);
  color: white;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 4px solid var(--hes-orange);
}

.site-header a { color: white; }

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-right: auto;
  text-decoration: none;
  min-height: 44px;
}

.brand img {
  display: block;
  height: 40px;
  width: auto;
}

.brand-word {
  font-family: "Oswald", sans-serif;
  font-weight: 600;
  letter-spacing: 0.12em;
  font-size: 1.2rem;
}

.main-nav, .sign-out, .subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.85rem;
  align-items: center;
}

.main-nav a, .subnav a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.15rem;
  text-decoration: none;
}

.subnav a { color: var(--hes-orange-deep); }

.who { font-size: 0.95rem; }

main { max-width: 64rem; padding-top: 1.25rem; padding-bottom: 2.5rem; }

footer {
  color: var(--muted);
  font-size: 0.95rem;
  padding-bottom: 2rem;
}

h1, h2, h3, .section-label {
  font-family: "Oswald", sans-serif;
  font-weight: 600;
  letter-spacing: 0.02em;
}

h1, h2, .section-label {
  text-transform: uppercase;
}

h1 { font-size: 2rem; margin: 0 0 0.6rem; line-height: 1.15; }
h2 { font-size: 1.35rem; margin: 1.5rem 0 0.5rem; }
h3 { font-size: 1.15rem; margin: 1.2rem 0 0.4rem; }

a { color: var(--hes-orange-deep); }
a:hover { text-decoration: none; }

:focus-visible {
  outline: 3px solid var(--hes-orange);
  outline-offset: 2px;
}

button, .button, .tile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  background: var(--hes-orange);
  color: var(--ink);
  border: 2px solid var(--hes-orange);
  border-radius: 4px;
  padding: 0.45rem 0.9rem;
  font: inherit;
  text-decoration: none;
  cursor: pointer;
}

button:hover, .button:hover, .tile:hover {
  background: var(--hes-orange-deep);
  border-color: var(--hes-orange-deep);
  color: white;
}

button.secondary, .secondary {
  background: var(--card);
  color: var(--ink);
  border: 2px solid var(--charcoal);
}

button.secondary:hover, .secondary:hover {
  background: var(--charcoal);
  color: white;
}

button.danger {
  background: var(--avoid);
  border-color: var(--avoid);
  color: white;
}

button.danger:hover {
  background: #7e1c16;
  border-color: #7e1c16;
  color: white;
}

.tile { padding: 0.9rem 1.1rem; font-size: 1.05rem; }

.hint, .meta { color: var(--muted); }

.flash {
  border: 2px solid var(--charcoal);
  border-left-width: 6px;
  background: var(--card);
  padding: 0.6rem 0.8rem;
}

.flash-error { border-left-color: var(--avoid); }

.hero-search { margin: 1rem 0 1.4rem; }

.hero-row, .search-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
}

.hero-row input, .search-row input {
  flex: 1 1 12rem;
  width: auto;
  min-width: 0;
  height: 44px;
  min-height: 44px;
}

.choices { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.choices a, .filter-chip {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  border: 2px solid var(--steel);
  background: var(--card);
  color: var(--ink);
  text-decoration: none;
  border-radius: 4px;
  padding: 0.35rem 0.8rem;
}

.choices a[aria-current="true"], .filter-chip[aria-current="true"] {
  background: var(--charcoal);
  color: white;
  border-color: var(--charcoal);
}

.category-grid, .type-list, .brand-grid, .result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
  gap: 0.75rem;
}

.category-grid a, .type-card {
  min-height: 44px;
  background: var(--card);
  border: 2px solid var(--steel);
  border-radius: 4px;
  padding: 0.75rem;
  color: var(--ink);
  text-decoration: none;
}

.category-grid a {
  display: flex;
  align-items: center;
  font-family: "Oswald", sans-serif;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.type-card { display: flex; flex-direction: column; gap: 0.45rem; }

.stack {
  display: flex;
  height: 0.7rem;
  width: 100%;
  background: var(--steel);
  border: 1px solid var(--charcoal);
}

.stack .seg { display: block; height: 100%; min-width: 4px; }
.seg.play { background: var(--play); }
.seg.avoid { background: var(--avoid); }
.seg.case { background: var(--case); }
.seg.open { background: var(--open); }
.seg.na { background: var(--na); }

.scope-line { font-size: 1.05rem; }

.legend { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 0.45rem; }
.legend.compact { margin-top: 0.4rem; }

.status, .pill {
  font-weight: 700;
}

.pill, .status {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: 4px;
  padding: 0.2rem 0.5rem;
  border: 2px solid transparent;
}

.status { font-size: 1.15rem; margin: 0.35rem 0; }

.play, .pill.play, .status-play { color: var(--play); background: var(--play-bg); border-color: var(--play); }
.avoid, .pill.avoid, .status-avoid { color: var(--avoid); background: var(--avoid-bg); border-color: var(--avoid); }
.case, .pill.case, .status-case { color: var(--case); background: var(--case-bg); border-color: var(--case); }
.open, .pill.open, .status-open { color: var(--open); background: var(--open-bg); border-color: var(--open); }
.na, .pill.na, .status-na {
  color: var(--na);
  background: var(--na-bg);
  border-color: var(--na);
  border-style: dashed;
}

.answer-card, .brand-card, .panel {
  background: var(--card);
  border: 2px solid var(--steel);
  border-radius: 4px;
  padding: 0.85rem;
}

.answer-card.is-proposed { border-color: var(--hes-orange); }

.answer-card h3, .answer-card p, .brand-card h4, .brand-card p { margin: 0.25rem 0; }

.brand-name {
  font-family: "Oswald", sans-serif;
  font-weight: 600;
  font-size: 1.2rem;
  letter-spacing: 0.02em;
  margin: 0;
}

.verdict { font-size: 1.05rem; }

.ribbon {
  display: inline-block;
  margin: 0 0 0.35rem;
  background: var(--hes-orange);
  color: var(--ink);
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border: 2px solid var(--hes-orange-deep);
}

.crumbs { font-size: 0.95rem; }
.crumbs a { margin-right: 0.15rem; }
.why-label {
  font-weight: 700;
  margin-right: 0.25rem;
}

.note { white-space: pre-wrap; }

.summary, .panel { margin-top: 1rem; }

.subnav { margin-bottom: 0.5rem; }

label { display: block; font-weight: 700; margin-top: 0.85rem; }

input, select, textarea {
  display: block;
  width: min(100%, 36rem);
  margin-top: 0.25rem;
  font: inherit;
  min-height: 44px;
  padding: 0.45rem 0.55rem;
  border: 2px solid var(--steel);
  border-radius: 4px;
  background: var(--card);
  color: var(--ink);
}

textarea { min-height: 6.5rem; }

form button { margin-top: 0.8rem; }

.data, .diff, .matrix {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
}

.data th, .data td, .diff th, .diff td, .matrix th, .matrix td {
  text-align: left;
  vertical-align: top;
  padding: 0.45rem;
  border-bottom: 1px solid var(--steel);
}

.diff td.changed { font-weight: 700; }

.matrix-scroll { overflow-x: auto; }

.badge {
  border-radius: 4px;
  padding: 0.1rem 0.45rem;
  font-size: 0.85rem;
  font-weight: 700;
}

.needs-review { background: #fde8c8; color: #6a3d00; }

code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

.preview-toggle { margin: 0.5rem 0 1rem; }

@media (max-width: 40rem) {
  .site-header { align-items: flex-start; }
  .sign-out, .main-nav { width: 100%; }
  .hero-row, .search-row { flex-direction: column; align-items: stretch; }
  .hero-row input, .search-row input {
    flex: 0 0 auto;
    width: 100%;
    height: 44px;
  }
  .hero-row button, .search-row button { width: 100%; }
  .category-grid, .type-list, .brand-grid, .result-grid { grid-template-columns: 1fr; }
}
