:root {
  --ink: #1a1a1a;
  --muted: #5c5c5c;
  --line: #d8d4ce;
  --bg: #f7f5f1;
  --card: #fff;
  --accent: #2d5e3f;
  --accent-soft: #e4efe8;
  --warn: #8a5a00;
  --font: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: "Avenir Next", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.45;
}

.app {
  max-width: 920px;
  margin: 0 auto;
  padding: 24px 20px 48px;
}

header.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.top-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.nav-link {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 0.88rem;
  padding: 8px 12px;
  border-radius: 4px;
  cursor: pointer;
}

.nav-link:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.nav-link.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font);
  font-size: 1.65rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  color: inherit;
  line-height: 1;
}

.brand-wordmark {
  display: block;
  height: 48px;
  width: auto;
  max-width: min(320px, 70vw);
  flex-shrink: 0;
  object-fit: contain;
}

.brand-studio {
  color: var(--accent);
  font-family: var(--font);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.tag {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-top: 4px;
}

.screen { display: none; }
.screen.on { display: block; }

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 22px 24px;
}

h1 {
  font-family: var(--font);
  font-size: 1.45rem;
  font-weight: 600;
  margin: 0 0 6px;
}

h2 {
  font-family: var(--font);
  font-size: 1.1rem;
  margin: 22px 0 10px;
}

.lede {
  color: var(--muted);
  margin: 0 0 18px;
  font-size: 0.92rem;
}

.row { display: grid; gap: 12px; }
@media (min-width: 700px) {
  .row.two { grid-template-columns: 1fr 1fr; }
  .row.three { grid-template-columns: 1fr 1fr 1fr; }
}

.card {
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 14px 16px;
  background: #fafaf8;
}

.card strong { display: block; font-size: 0.95rem; margin-bottom: 4px; }
.card .meta { font-size: 0.8rem; color: var(--muted); }

.next {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: 0.85rem;
}

.next em {
  font-style: normal;
  color: var(--accent);
  font-weight: 600;
}

.bar {
  height: 8px;
  background: #ebe7e0;
  border-radius: 99px;
  overflow: hidden;
  margin: 8px 0 4px;
}

.bar > i {
  display: block;
  height: 100%;
  background: var(--accent);
}

.btn {
  display: inline-block;
  border: none;
  background: var(--accent);
  color: #fff;
  padding: 10px 16px;
  border-radius: 4px;
  font: inherit;
  font-size: 0.88rem;
  cursor: pointer;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn.ghost {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}

.btn + .btn { margin-left: 8px; }
.btn.block { display: block; width: 100%; text-align: center; margin: 10px 0 0; }

.guide {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 18px;
  padding: 12px;
  background: var(--accent-soft);
  border-radius: 5px;
  font-size: 0.78rem;
}

.guide span {
  padding: 4px 8px;
  border-radius: 4px;
  color: var(--muted);
  background: #fff;
}

.guide span.done { color: #1d5c38; }
.guide span.now {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
}

.next-banner {
  border: 1px solid var(--accent);
  background: var(--accent-soft);
  border-radius: 6px;
  padding: 14px 16px;
  margin-bottom: 18px;
}

.next-banner .lbl {
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 4px;
}

.stations { display: grid; gap: 10px; }
@media (min-width: 700px) {
  .stations { grid-template-columns: 1fr 1fr; }
}

.station {
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 14px;
  cursor: pointer;
  background: #fff;
  text-align: left;
  font: inherit;
  color: inherit;
  width: 100%;
}

.station:hover { border-color: var(--accent); }
.station.now {
  border-color: var(--accent);
  box-shadow: inset 3px 0 0 var(--accent);
}

.station .st {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

button.linkish {
  border: none;
  background: none;
  padding: 0;
  margin: 0;
  font: inherit;
  color: var(--accent);
  cursor: pointer;
  text-align: left;
}

button.linkish:hover {
  text-decoration: underline;
}

.pill {
  display: inline-block;
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 99px;
  background: var(--accent-soft);
  color: var(--accent);
}

.pill.warn { background: #f5e6c8; color: var(--warn); }
.pill.ok { background: #dcefe3; color: #1d5c38; }

label {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin: 10px 0 4px;
}

input, select, textarea {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  font: inherit;
  background: #fff;
}

textarea { min-height: 88px; resize: vertical; }

.color-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.color-row input[type="color"] {
  width: 48px;
  min-width: 48px;
  height: 40px;
  padding: 2px;
  cursor: pointer;
  flex: 0 0 auto;
}

.color-row input.color-hex {
  width: auto;
  flex: 1;
  max-width: 140px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.02em;
}

.check { list-style: none; padding: 0; margin: 0; }
.check li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.9rem;
}

.check.kw-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px 16px;
  border-top: 1px solid var(--line);
  padding-top: 8px;
}
@media (min-width: 560px) {
  .check.kw-grid { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 820px) {
  .check.kw-grid { grid-template-columns: 1fr 1fr 1fr; }
}
.check.kw-grid li {
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  break-inside: avoid;
}

.check input { width: auto; margin-top: 3px; }

.note { font-size: 0.78rem; color: var(--muted); margin-top: 2px; }
.mvp { font-size: 0.72rem; color: var(--accent); font-weight: 600; }

.studio-card {
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 14px 16px;
  background: #fafaf8;
  margin-bottom: 12px;
}

.studio-card.warn { border-color: #c4a574; }

.wrap-preview {
  display: flex;
  width: 100%;
  max-width: 720px;
  margin: 12px 0 8px;
  border: 1px solid var(--line);
  background: #e8e4dc;
  overflow: hidden;
  position: relative;
  background-size: 100% 100%;
  background-position: center;
  background-repeat: no-repeat;
}

.wrap-preview.wrap-full .wrap-panel {
  opacity: 0.08;
}

.wrap-panel {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fafaf8;
  background-size: 100% 100%;
  background-position: center;
  background-repeat: no-repeat;
  border-right: 1px solid rgba(0,0,0,0.12);
  color: var(--muted);
  font-size: 0.78rem;
  text-align: center;
  min-width: 0;
  overflow: hidden;
}

.wrap-panel:last-child { border-right: none; }

.wrap-panel.has-art span { display: none; }

.wrap-back { background-color: #efeae2; }
.wrap-spine {
  background-color: #1a1a1a;
  color: #f7f5f1;
  font-size: 0.7rem;
}
.wrap-spine:not(.has-art) {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}
.wrap-front { background-color: #e7efe9; }

.barcode-zone {
  position: absolute;
  right: 8%;
  bottom: 6%;
  width: 28%;
  height: 14%;
  border: 1px solid rgba(0, 0, 0, 0.28);
  background: transparent;
  box-shadow: none;
  pointer-events: none;
}

.barcode-zone.line-white {
  border-color: rgba(255, 255, 255, 0.85);
}

footer.foot {
  margin-top: 18px;
  font-size: 0.78rem;
  color: var(--muted);
}

.empty {
  text-align: center;
  padding: 32px 16px;
  color: var(--muted);
}
