:root {
  --bg: #fff8ea;
  --card: #ffffff;
  --ink: #241a12;
  --muted: #75685a;
  --line: #ead9bf;
  --soft: #fff1d2;
  --accent: #d98324;
  --accent-dark: #9d5514;
  --good: #0f766e;
  --bad: #b42318;
  --info: #18458f;
  --disabled: #f1eee9;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, #fff1cc, var(--bg));
  color: var(--ink);
  line-height: 1.55;
}
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .5; cursor: not-allowed; }
.app-shell { width: min(1080px, 100%); margin: 0 auto; padding: 14px 12px 40px; }
.hero {
  display: flex; gap: 14px; align-items: center;
  border: 1px solid var(--line); border-radius: 26px;
  padding: 18px; background: rgba(255, 255, 255, .82);
  box-shadow: 0 8px 20px rgba(76, 53, 23, .08);
}
.hero__mark { width: 62px; height: 62px; display: grid; place-items: center; border-radius: 22px; background: var(--soft); font-size: 34px; }
.version { margin: 0 0 2px; color: var(--accent-dark); font-weight: 900; }
h1 { margin: 0; font-size: clamp(30px, 7vw, 52px); line-height: 1; }
.hero p:last-child { margin: 6px 0 0; color: var(--muted); font-weight: 800; }
.notice, .mini-now, .test-panel, .section-block {
  margin-top: 14px;
  background: rgba(255, 255, 255, .9);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 14px;
}
.notice { display: grid; gap: 4px; }
.notice strong { color: var(--accent-dark); font-size: 18px; }
.mini-now { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.mini-now__label { display: block; color: var(--muted); font-size: 12px; font-weight: 900; }
.test-panel h2, .section-heading h2 { margin: 0; }
.test-panel p, .muted { color: var(--muted); margin: 4px 0 0; }
.test-panel__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.candidate-wizard { margin-top: 12px; border: 1px solid #f0d4a6; background: #fff7e8; border-radius: 18px; padding: 12px; }
.candidate-wizard__title { margin: 0; font-size: 20px; }
.candidate-wizard__progress { font-weight: 900; color: var(--accent-dark); }
.candidate-wizard__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.section-heading--stacked { align-items: stretch; }
.search-box { width: min(100%, 320px); min-height: 46px; border-radius: 999px; border: 1px solid var(--line); padding: 8px 14px; background: #fff; }
.count-label { margin: 4px 0 0; color: var(--muted); font-weight: 900; }
.category-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.tab-button { min-height: 42px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--ink); font-weight: 900; }
.tab-button[aria-selected="true"] { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; }
.card-list { display: grid; gap: 12px; }
.empty-card { border: 1px dashed var(--line); background: #fffdf7; color: var(--muted); border-radius: 18px; padding: 16px; text-align: center; font-weight: 900; }
.station-card { border: 1px solid var(--line); background: var(--card); border-radius: 22px; padding: 16px; box-shadow: 0 4px 14px rgba(76, 53, 23, .06); }
.station-card.is-playing { border-color: rgba(15, 118, 110, .48); box-shadow: 0 0 0 4px rgba(15, 118, 110, .09); }
.station-card.is-error { border-color: rgba(180, 35, 24, .42); }
.station-card.is-adoption { border-color: rgba(15, 118, 110, .52); }
.station-card.is-official-only { opacity: .96; }
.station-card__header { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.station-card__name { margin: 0; font-size: 22px; line-height: 1.25; }
.station-card__area { margin: 3px 0 0; color: var(--muted); font-weight: 900; }
.category-pill { flex: 0 0 auto; max-width: 42%; border-radius: 999px; padding: 6px 10px; background: #f7efe3; color: #6c4b21; font-size: 12px; font-weight: 900; text-align: center; }
.station-card__description { margin: 12px 0; }
.station-card__tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.tag { border-radius: 999px; background: #f7efe3; color: #6c4b21; padding: 3px 9px; font-size: 12px; font-weight: 900; }
.station-card__meta { display: grid; gap: 8px; margin: 12px 0; padding: 0; }
.station-card__meta div { display: grid; grid-template-columns: 4.5em 1fr; gap: 8px; padding: 8px 10px; background: #fff8eb; border-radius: 14px; }
.station-card__meta dt { color: var(--muted); font-weight: 900; }
.station-card__meta dd { margin: 0; font-weight: 900; }
.source-note { margin: 10px 0; color: var(--accent-dark); font-size: 13px; font-weight: 900; white-space: pre-line; }
.station-status { border-radius: 16px; background: #f8f5ef; padding: 11px 12px; margin: 12px 0; }
.station-status__label { color: var(--muted); font-size: 12px; font-weight: 900; }
.station-status__message { white-space: pre-line; font-weight: 900; }
.station-status.is-playing { background: #e8f7f4; color: var(--good); }
.station-status.is-error { background: #fff0ed; color: var(--bad); }
.station-status.is-info { background: #fff3db; color: var(--accent-dark); }
.station-status.is-loading { background: #eef4ff; color: var(--info); }
.station-card__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.button, .station-card__actions a { min-height: 48px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; border-radius: 16px; border: 1px solid transparent; padding: 10px 14px; text-decoration: none; font-weight: 900; }
.button--play { background: var(--accent-dark); color: #fff; }
.button--stop { background: #3b3129; color: #fff; }
.button--ok { background: var(--good); color: #fff; }
.button--ng { background: var(--bad); color: #fff; }
.button--adopt { background: #0f766e; color: #fff; }
.button--downgrade { background: #6b5d52; color: #fff; }
.button--official, .station-card__actions a { background: var(--soft); color: var(--accent-dark); border-color: #f0d4a6; }
.button--ghost { background: #fff; border-color: var(--line); color: var(--muted); }
.button--small { min-height: 38px; border-radius: 999px; padding: 7px 12px; font-size: 14px; }
.button--disabled { background: var(--disabled); color: var(--muted); border-color: var(--line); cursor: default; }
.debug-box { display: none; margin-top: 10px; border-top: 1px dashed var(--line); padding-top: 10px; }
body.debug .debug-box { display: block; }
.debug-box summary { font-weight: 900; color: var(--muted); cursor: pointer; }
.debug-box pre { white-space: pre-wrap; word-break: break-word; background: #211b16; color: #fff8e8; border-radius: 12px; padding: 10px; font-size: 12px; }
@media (min-width: 800px) { .card-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) {
  .app-shell { padding-inline: 10px; }
  .hero { border-radius: 20px; }
  .hero__mark { width: 48px; height: 48px; border-radius: 16px; font-size: 28px; }
  .section-heading, .mini-now { align-items: stretch; flex-direction: column; }
  .search-box { width: 100%; }
  .station-card__header { flex-direction: column; }
  .category-pill { max-width: 100%; }
  .station-card__actions, .candidate-wizard__actions, .test-panel__actions { display: grid; grid-template-columns: 1fr; }
  .button, .station-card__actions a { width: 100%; }
}
