/* AnkiToPodcast — clean, neutral theme. */
:root {
  --ink: #18181b;
  --accent: #4f46e5;
  --accent-dark: #4338ca;
  --bg: #f8f9fa;
  --card: #ffffff;
  --border: #e5e7eb;
  --muted: #6b7280;
  --good: #059669;
  --bad: #b42318;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 8px 24px rgba(0, 0, 0, 0.04);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 0.5em; }
h1 { font-size: 2.1rem; font-weight: 800; letter-spacing: -0.02em; }
h2 { font-size: 1.5rem; font-weight: 700; }
button { font-family: inherit; cursor: pointer; }

/* Layout */
.atp-header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--border);
}
.atp-header-inner, .atp-main {
  max-width: 1040px; margin: 0 auto; padding: 0 20px;
}
.atp-header-inner { display: flex; align-items: center; gap: 16px; height: 60px; }
.atp-brand { font-weight: 800; color: var(--ink); font-size: 1.15rem; letter-spacing: -0.02em; }
.atp-brand span { color: var(--accent); }
.atp-nav { margin-left: auto; display: flex; align-items: center; gap: 18px; }
.atp-nav a, .atp-nav button.link { color: var(--ink); background: none; border: none; font-size: 0.95rem; }
.atp-main { padding-top: 32px; padding-bottom: 64px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 20px; border-radius: 10px; border: 1px solid transparent;
  font-weight: 700; font-size: 0.98rem; background: var(--ink); color: #fff; transition: 0.15s;
}
.btn:hover { text-decoration: none; opacity: 0.92; }
.btn.accent { background: var(--accent); }
.btn.accent:hover { background: var(--accent-dark); }
.btn.ghost { background: #fff; color: var(--ink); border-color: var(--border); }
.btn.ghost:hover { border-color: var(--ink); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.sm { min-height: 36px; padding: 0 14px; font-size: 0.88rem; }

/* Cards / panels */
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px;
}
.stack > * + * { margin-top: 16px; }
.muted { color: var(--muted); }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; background: #eef2ff; color: var(--accent-dark); font-size: 0.78rem; font-weight: 600; }

/* Hero */
.hero { text-align: center; padding: 40px 0 24px; }
.hero h1 { font-size: clamp(2rem, 5vw, 3rem); }
.hero p.lead { font-size: 1.15rem; color: var(--muted); max-width: 620px; margin: 0 auto 24px; }
.hero .cta-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-top: 40px; }
.step-num { width: 34px; height: 34px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font-weight: 700; margin-bottom: 10px; }

/* Forms */
label.field { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 6px; }
input[type=text], input[type=email], input[type=password], select {
  width: 100%; min-height: 44px; padding: 0 12px; border: 1px solid var(--border);
  border-radius: 10px; font-size: 1rem; background: #fff; color: var(--ink);
}
input:focus, select:focus { outline: 2px solid var(--accent); border-color: var(--accent); }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 140px; }

/* Wizard */
.wizard-steps { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.wizard-steps .ws { flex: 1; min-width: 120px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); background: #fff; font-size: 0.85rem; font-weight: 600; color: var(--muted); }
.wizard-steps .ws.active { border-color: var(--accent); color: var(--accent-dark); background: #eef2ff; }
.wizard-steps .ws.done { color: var(--good); border-color: #a7f3d0; background: #ecfdf5; }
.dropzone { border: 2px dashed var(--border); border-radius: var(--radius); padding: 40px; text-align: center; background: #fff; }
.dropzone.drag { border-color: var(--accent); background: #eef2ff; }
table.preview { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
table.preview th, table.preview td { border: 1px solid var(--border); padding: 6px 8px; text-align: left; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
table.preview th { background: #f9fafb; }
.count-chips { display: flex; gap: 10px; flex-wrap: wrap; }
.count-chips .chip { background: #f3f4f6; border-radius: 10px; padding: 8px 12px; font-size: 0.85rem; }
.count-chips .chip b { font-size: 1.1rem; display: block; }

/* Library */
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.ep-card { cursor: pointer; }
.ep-card:hover { border-color: var(--accent); }
.ep-card h3 { font-size: 1.05rem; margin-bottom: 6px; }
.ep-meta { font-size: 0.8rem; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; }

/* Reader */
.reader { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; }
@media (max-width: 760px) { .reader { grid-template-columns: 1fr; } }
.reader .transcript { line-height: 2.1; font-size: 1.15rem; }
.reader .transcript .w { cursor: pointer; padding: 1px 2px; border-radius: 4px; }
.reader .transcript .w:hover { background: #eef2ff; }
.reader .transcript .w.active { background: var(--accent); color: #fff; }
.reader .dialogue-raw { white-space: pre-wrap; background: #f9fafb; border: 1px solid var(--border); border-radius: 10px; padding: 12px; font-size: 0.9rem; color: var(--muted); margin-bottom: 16px; }
.lookup { position: sticky; top: 80px; align-self: start; }
.lookup .word { font-size: 1.6rem; font-weight: 700; }
.lookup .rom { color: var(--muted); font-style: italic; }
.lookup .tr { font-size: 1.1rem; margin-top: 6px; }
.lookup .empty { color: var(--muted); }
audio { width: 100%; margin-top: 8px; }

/* Pricing */
.price-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
.price-card { text-align: center; }
.price-card .amount { font-size: 2.4rem; font-weight: 800; }
.price-card ul { list-style: none; padding: 0; margin: 16px 0; text-align: left; }
.price-card li { padding: 6px 0 6px 26px; position: relative; }
.price-card li:before { content: "✓"; color: var(--good); position: absolute; left: 0; font-weight: 700; }
.price-card.featured { border-color: var(--accent); }

/* Modal */
.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.5); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal { background: #fff; border-radius: var(--radius); padding: 28px; width: min(100%, 420px); }

/* Toast + banners */
.banner { padding: 12px 16px; border-radius: 10px; font-size: 0.92rem; }
.banner.error { background: #fef2f2; color: var(--bad); border: 1px solid #fecaca; }
.banner.info { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }
.banner.ok { background: #ecfdf5; color: var(--good); border: 1px solid #a7f3d0; }
.center { text-align: center; }
.spinner { width: 22px; height: 22px; border: 3px solid #fff; border-top-color: transparent; border-radius: 50%; animation: spin 0.7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.hidden { display: none !important; }

/* Video placeholder */
.video-embed { max-width: 720px; margin: 0 auto; }
.video-ph { aspect-ratio: 16 / 9; border: 1px solid var(--border); border-radius: var(--radius); background: #eef0f6; display: grid; place-content: center; text-align: center; color: var(--muted); gap: 2px; }
.video-ph span { font-size: 34px; color: var(--accent); line-height: 1; }
.video-ph p { margin: 6px 0 0; font-weight: 700; color: var(--ink); }

/* Legal pages */
body.atp-legal main { max-width: 720px; margin: 40px auto; padding: 0 20px; }
