/* bill-verdict v1 — mobile-first, one column, dark on light.
 * Same design-token family as air-fry-fix, cooler blue accent. */

*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --ink: #16130f;
  --ink-soft: #57514a;
  --line: #ded7cd;
  --surface: #f7f4ef;
  --card: #fffdf9;
  --accent: #17509c;
  --accent-ink: #123f7c;
}

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

body {
  margin: 0 auto;
  max-width: 640px;
  padding: 16px 16px 48px;
  background: var(--surface);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.45;
}

/* app.js toggles .hidden via the hidden attribute; make it stick. */
[hidden] {
  display: none !important;
}

h1 {
  margin: 8px 0 4px;
  font-size: 1.75rem;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.subtitle {
  margin: 0 0 24px;
  color: var(--ink-soft);
  font-size: 1rem;
}

section {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
  margin: 0 0 16px;
}

/* Small-caps legends on cards. */
h2 {
  margin: 0 0 12px;
  font-size: 1.05rem;
  text-transform: uppercase;
  font-variant: small-caps;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
}

label {
  display: block;
  margin: 0 0 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-soft);
}

input[type="number"],
select,
button {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

/* 48px tall — comfortably over the 44px mobile tap-target floor. */
input[type="number"],
select {
  min-height: 48px;
  padding: 10px 12px;
}

input,
select {
  -webkit-appearance: none;
  appearance: none;
}

select {
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-soft) 50%), linear-gradient(135deg, var(--ink-soft) 50%, transparent 50%);
  background-position: calc(100% - 18px) calc(50% + 1px), calc(100% - 13px) calc(50% + 1px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 34px;
}

button {
  min-height: 48px;
  padding: 12px 16px;
  margin-top: 12px;
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

button:active {
  background: var(--accent-ink);
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.field {
  margin-bottom: 12px;
}

.fine {
  margin: 12px 0 0;
  font-size: 0.85rem;
  color: var(--ink-soft);
}

/* Validation message inside the form card. */
#error {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-left: 4px solid var(--accent);
  border-radius: 6px;
  background: #e9f0f9;
  color: var(--accent-ink);
  font-size: 0.9rem;
  font-weight: 600;
}

/* Verdict: the most prominent thing on the page. */
#card {
  border-color: var(--accent);
}

#verdict-title {
  margin: 0 0 14px;
  font-size: clamp(1.4rem, 7vw, 1.9rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.01em;
  text-transform: none;
  font-variant: normal;
  color: var(--accent-ink);
}

#verdict-title:empty {
  display: none;
}

/* Two rate stats side by side; stacked single column under 420px. */
.rate-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#rate-your,
#rate-avg {
  flex: 1 1 0;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

#rate-your {
  color: var(--accent-ink);
}

#rate-avg {
  color: var(--ink-soft);
}

#rate-diff {
  margin: 12px 0 0;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

#fpl-note {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-left: 4px solid var(--accent);
  background: #e9f0f9;
  color: var(--accent-ink);
  font-size: 0.85rem;
}

#why-list {
  margin: 12px 0 0;
  padding: 0 0 0 20px;
  font-size: 0.95rem;
}

#why-list li {
  margin-bottom: 6px;
}

/* History chips */
#history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chip {
  width: 100%;
  min-height: 44px;
  margin: 0;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 600;
  text-align: left;
  padding: 10px 12px;
}

.chip:active {
  background: #eef2f7;
}

#history-empty {
  margin: 0;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

#history-note {
  margin: 12px 0 0;
  font-size: 0.85rem;
  color: var(--ink-soft);
}

footer {
  margin-top: 24px;
  font-size: 0.8rem;
  color: var(--ink-soft);
}

#source-note {
  margin: 0;
}

@media (min-width: 420px) {
  .rate-row {
    flex-direction: row;
    align-items: stretch;
  }
}

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