/* ============================================================
   price-compare — editorial Scandinavian aesthetic
   Cream paper, ink-black text, single rust accent.
   Serif display (Instrument Serif) + clean sans body (Inter Tight).
   ============================================================ */

:root {
  --paper: #1a1a1a; /* dark background (was cream) */
  --paper-deep: #4d4d4d; /* subtle dividers (was deeper cream) */
  --ink: #f6f1e7; /* light text (was near-black) */
  --ink-soft: #d6d0c4; /* secondary text */
  --ink-muted: #8a857e; /* muted text */
  --rule: #f6f1e7; /* light rules */
  --accent: #d57a52; /* softer rust reads better on dark */
  --accent-soft: #b8451f; /* deeper rust as alternate */
  --error: #c45454;
  --success: #5fa978;

  --font-display: "Instrument Serif", "Times New Roman", serif;
  --font-body: "Inter Tight", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "JetBrains Mono", monospace;
}

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

html,
body {
  background: var(--paper); /* was var(--ink) — restored */
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  background-image:
    radial-gradient(
      1200px 600px at 80% -10%,
      rgba(184, 69, 31, 0.06),
      transparent 60%
    ),
    radial-gradient(
      900px 500px at -10% 110%,
      rgba(26, 26, 26, 0.04),
      transparent 60%
    );
}

/* -------- Layout -------- */
.page {
  max-width: 760px;
  margin: 0 auto;
  padding: 64px 32px 48px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

@media (max-width: 600px) {
  .page {
    padding: 40px 20px 32px;
  }
}

/* -------- Masthead -------- */
.masthead {
  margin-bottom: 48px;
}
.masthead__rule {
  width: 64px;
  height: 2px;
  background: var(--rule);
  margin-bottom: 24px;
}
.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--ink-muted);
  margin-bottom: 24px;
}
.title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(40px, 6vw, 64px);
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin-bottom: 24px;
  color: var(--ink);
}
.title em {
  font-style: italic;
  color: var(--accent);
}
.lede {
  font-size: 18px;
  line-height: 1.6;
  color: var(--ink-soft);
  max-width: 56ch;
}

/* -------- Conversation -------- */
.conversation {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-bottom: 32px;
  min-height: 100px;
}
.msg {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.msg__role {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--ink-muted);
}
.msg__role--user {
  color: var(--accent);
}

.msg__body {
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  white-space: pre-wrap;
  word-wrap: break-word;
}
.msg--assistant .msg__body {
  font-family: var(--font-display);
  font-size: 22px;
  line-height: 1.5;
}
.msg--assistant .msg__body em {
  font-style: italic;
  color: var(--accent);
}

.msg__body a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  word-break: break-all;
}
.msg__body a:hover {
  color: var(--ink);
}

.msg__plans {
  margin-top: 12px;
  border-top: 1px solid var(--paper-deep);
  padding-top: 16px;
  display: grid;
  gap: 8px;
}
.plan {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--paper-deep);
  font-size: 14px;
  color: var(--ink-soft);
}
.plan:last-child {
  border-bottom: none;
}
.plan__name {
  font-weight: 500;
  color: var(--ink);
}
.plan__features {
  font-size: 13px;
  color: var(--ink-muted);
}
.plan__price {
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--ink);
  white-space: nowrap;
  text-align: right;
}
.plan__price-main {
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--ink);
  white-space: nowrap;
}
.plan__price-sub {
  font-size: 11px;
  color: var(--ink-muted);
  white-space: nowrap;
  margin-top: 2px;
}
.plan__source {
  font-size: 12px;
}
.plan__source a {
  color: var(--ink-muted);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.plan__source a:hover {
  color: var(--accent);
}

/* Section headings inside the structured results — separate mobile, växel, bundled. */
.plan-section {
  display: grid;
  gap: 4px;
}
.plan-section + .plan-section {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--paper-deep);
}
.plan-section__heading {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 4px;
}
.plan--combined .plan__price-main {
  color: var(--accent);
}

.status {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 1.2s ease-in-out infinite;
}
@keyframes pulse {
  0%,
  100% {
    opacity: 0.3;
    transform: scale(0.85);
  }
  50% {
    opacity: 1;
    transform: scale(1.1);
  }
}

.error {
  background: rgba(138, 42, 42, 0.06);
  border-left: 2px solid var(--error);
  padding: 12px 16px;
  font-size: 14px;
  color: var(--error);
}

/* -------- Composer -------- */
.composer {
  position: sticky;
  bottom: 16px;
  background: var(--paper); /* was var(--ink) — restored */
  border: 1px solid var(--paper-deep); /* was var(--ink) — visible now */
  padding: 16px 18px;
  margin-top: 16px;
  border-radius: 12px;
}
.composer textarea {
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.5;
  color: var(--ink);
  resize: none;
}
.composer textarea::placeholder {
  color: var(--ink-muted);
  font-style: italic;
}
.composer__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--paper-deep);
}
.hint {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-muted);
  letter-spacing: 0.06em;
}
button {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  background: transparent; /* was var(--ink) — invisible on dark page */
  color: var(--ink);
  border: none;
  padding: 8px 16px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: color 120ms ease;
}
button:hover {
  background: transparent;
  color: var(--accent); /* hover changes text color, not bg */
}
button:disabled {
  background: transparent;
  color: var(--ink-muted);
  cursor: not-allowed;
}
button:disabled:hover {
  color: var(--ink-muted);
}

/* -------- Colophon -------- */
.colophon {
  margin-top: 32px;
  padding-top: 16px;
  border-top: 1px solid var(--paper-deep);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-muted);
  letter-spacing: 0.08em;
  display: flex;
  gap: 8px;
}
.colophon a {
  color: var(--ink-muted);
  text-decoration: none;
}
.colophon a:hover {
  color: var(--accent);
}
.colophon .dot {
  opacity: 0.5;
}

/* -------- Streaming caret -------- */
.streaming::after {
  content: "▌";
  display: inline-block;
  margin-left: 2px;
  color: var(--accent);
  animation: blink 1s steps(2, start) infinite;
}
@keyframes blink {
  50% {
    opacity: 0;
  }
}
