:root {
  --bg: #f6f7fb;
  --card: #ffffff;
  --ink: #1a1d29;
  --muted: #6b7280;
  --line: #e5e7eb;
  --accent: #4f46e5;
  --accent-dark: #4338ca;
  --accent-soft: #eef2ff;
  --good: #16a34a;
  --danger: #dc2626;
  --radius: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.topbar {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.02em;
  text-decoration: none;
  color: var(--ink);
}
.brand span { color: var(--accent); }

.topbar .userbox { display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--muted); }

.container { max-width: 960px; margin: 0 auto; padding: 24px 16px 64px; }

.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 8px 0 20px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: 24px; letter-spacing: -0.02em; }
.page-head p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

.btn {
  display: inline-block;
  border: 0;
  border-radius: 10px;
  padding: 10px 18px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  text-align: center;
}
.btn:hover { background: var(--accent-dark); }
.btn.secondary { background: var(--accent-soft); color: var(--accent-dark); }
.btn.secondary:hover { background: #e0e7ff; }
.btn.ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); }
.btn.ghost:hover { color: var(--ink); border-color: #cbd5e1; }
.btn.danger { background: #fef2f2; color: var(--danger); border: 1px solid #fecaca; }
.btn.danger:hover { background: #fee2e2; }
.btn.small { padding: 7px 12px; font-size: 13px; border-radius: 8px; }
.btn:disabled { opacity: 0.6; cursor: default; }
.lang-select {
  padding: 7px 8px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.lang-select:hover { color: var(--ink); border-color: #cbd5e1; }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%;
  padding: 10px 12px;
  font-size: 15px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
  border-color: var(--accent);
}
.field .hint { font-size: 12px; color: var(--muted); margin-top: 4px; }

.checkline { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; }
.checkline input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--accent); flex-shrink: 0; }

.alert {
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 14px;
  margin-bottom: 16px;
  display: none;
}
.alert.show { display: block; }
.alert.error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert.ok { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }

.release-card { display: block; text-decoration: none; color: inherit; transition: transform 0.06s ease; }
.release-card:hover { transform: translateY(-2px); }
.release-card h3 { margin: 0 0 2px; font-size: 18px; letter-spacing: -0.01em; }
.release-card .artist { color: var(--muted); font-size: 14px; margin-bottom: 10px; }

.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--accent-soft);
  color: var(--accent-dark);
  border-radius: 999px;
  padding: 3px 10px;
  margin-bottom: 8px;
}

.countdown { font-size: 13px; font-weight: 600; color: var(--accent-dark); margin-bottom: 10px; }
.countdown.past { color: var(--muted); }

.progress { height: 8px; background: var(--line); border-radius: 999px; overflow: hidden; margin: 6px 0; }
.progress > div { height: 100%; background: var(--accent); border-radius: 999px; transition: width 0.2s ease; }
.progress-meta { font-size: 12px; color: var(--muted); }

.empty {
  text-align: center;
  padding: 56px 20px;
  color: var(--muted);
}
.empty h2 { color: var(--ink); margin: 0 0 8px; font-size: 20px; }
.empty p { margin: 0 0 20px; font-size: 15px; }

.task { display: flex; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--line); align-items: flex-start; }
.task:last-child { border-bottom: 0; }
.task input[type="checkbox"] { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--accent); flex-shrink: 0; cursor: pointer; }
.task .tbody { flex: 1; min-width: 0; }
.task .ttitle { font-weight: 600; font-size: 15px; }
.task.done .ttitle { text-decoration: line-through; color: var(--muted); }
.task .tdetail { font-size: 13px; color: var(--muted); margin-top: 2px; }
.task .tmeta { font-size: 12px; color: var(--muted); margin-top: 6px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.task .tcat { background: var(--accent-soft); color: var(--accent-dark); border-radius: 999px; padding: 2px 8px; font-weight: 600; }
.task .del { background: none; border: 0; color: #cbd5e1; cursor: pointer; font-size: 16px; padding: 2px 6px; }
.task .del:hover { color: var(--danger); }
.task.overdue .tmeta .tdate { color: var(--danger); font-weight: 700; }

.section-title { font-size: 16px; font-weight: 700; margin: 0 0 12px; letter-spacing: -0.01em; }

.urlrow { display: flex; gap: 8px; align-items: center; }
.urlrow input { flex: 1; font-size: 13px; }

table.fans { width: 100%; border-collapse: collapse; font-size: 14px; }
table.fans th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); padding: 8px; border-bottom: 1px solid var(--line); }
table.fans td { padding: 8px; border-bottom: 1px solid var(--line); }
table.fans tr:last-child td { border-bottom: 0; }

.auth-wrap { max-width: 420px; margin: 48px auto; }
.auth-wrap h1 { font-size: 26px; letter-spacing: -0.02em; margin: 0 0 4px; }
.auth-wrap .sub { color: var(--muted); font-size: 14px; margin: 0 0 24px; }
.auth-switch { text-align: center; margin-top: 16px; font-size: 14px; color: var(--muted); }
.auth-switch a { color: var(--accent-dark); font-weight: 600; }

.presave-hero { text-align: center; padding: 48px 16px 8px; }
.presave-hero .badge { margin-bottom: 12px; }
.presave-hero h1 { font-size: 32px; margin: 0 0 4px; letter-spacing: -0.02em; }
.presave-hero .artist { font-size: 18px; color: var(--muted); margin-bottom: 8px; }
.presave-hero .rdate { font-size: 14px; color: var(--muted); }
.presave-card { max-width: 480px; margin: 24px auto; }
.presave-success { text-align: center; padding: 24px 0; }
.presave-success h2 { margin: 0 0 8px; }
.powered { text-align: center; font-size: 12px; color: var(--muted); margin-top: 32px; }

.row-flex { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

@media (max-width: 560px) {
  .container { padding: 16px 12px 48px; }
  .page-head h1 { font-size: 21px; }
  .topbar { padding: 10px 14px; }
  .presave-hero h1 { font-size: 26px; }
}

/* ---- landing page ---- */
.landing-nav .userbox .btn { white-space: nowrap; }
.landing-hero { padding: 64px 16px 56px; background: linear-gradient(180deg, #eef2ff 0%, var(--bg) 100%); }
.landing-hero-inner { max-width: 1080px; margin: 0 auto; display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 48px; align-items: center; }
.landing-hero h1 { font-size: 46px; letter-spacing: -0.03em; line-height: 1.12; margin: 14px 0 16px; }
.landing-lead { font-size: 18px; color: var(--muted); margin: 0 0 28px; line-height: 1.65; }
.landing-cta-row .btn { padding: 14px 26px; font-size: 16px; }
.landing-hero-visual { position: relative; min-height: 380px; }
.mock-presave, .mock-check { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: 0 12px 32px rgba(79, 70, 229, 0.10); position: absolute; width: 250px; }
.mock-presave { top: 0; left: 0; text-align: center; }
.mock-check { bottom: 0; right: 0; width: 260px; }
.mock-title { font-size: 20px; font-weight: 800; margin: 8px 0 2px; }
.mock-artist { font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.mock-countdown { font-size: 13px; font-weight: 700; color: var(--accent-dark); margin-bottom: 12px; }
.mock-input { border: 1px solid var(--line); border-radius: 8px; padding: 8px; font-size: 13px; color: var(--muted); margin-bottom: 8px; background: var(--bg); }
.mock-btn { background: var(--accent); color: #fff; border-radius: 8px; padding: 9px; font-size: 14px; font-weight: 700; }
.mock-check-title { font-size: 14px; font-weight: 800; margin-bottom: 10px; }
.mock-task { font-size: 13px; padding: 5px 0; color: var(--ink); }
.mock-task.done { color: var(--muted); text-decoration: line-through; }
.mock-check .progress { margin-top: 10px; }
.landing-section { padding: 56px 0; }
.landing-alt { background: var(--card); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.landing-kicker { text-align: center; font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.1em; color: var(--accent); margin: 0 0 28px; }
.landing-section .card h3 { margin: 0 0 8px; font-size: 19px; }
.landing-section .card p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.65; }
.landing-step { position: relative; }
.landing-step-n { width: 36px; height: 36px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 800; display: flex; align-items: center; justify-content: center; font-size: 17px; margin-bottom: 14px; }
.landing-faq { max-width: 720px; }
.landing-faq .card { margin-bottom: 12px; }
.landing-faq .card h3 { font-size: 17px; }
.landing-final { text-align: center; padding: 72px 16px; background: linear-gradient(180deg, var(--bg) 0%, #eef2ff 100%); }
.landing-final h2 { font-size: 32px; letter-spacing: -0.02em; margin: 0 0 28px; }
.landing-cta { padding: 14px 34px; font-size: 17px; }
.landing-footer { border-top: 1px solid var(--line); padding: 20px 0; background: var(--card); }
.landing-pricing { max-width: 1020px; margin: 0 auto; }
.landing-price { font-size: 40px; font-weight: 800; letter-spacing: -0.02em; margin: 8px 0; }
.landing-price small { font-size: 15px; font-weight: 600; color: var(--muted); margin-left: 4px; }
.landing-feats { list-style: none; padding: 0; margin: 0 0 20px; }
.landing-feats li { padding: 6px 0 6px 26px; position: relative; font-size: 15px; }
.landing-feats li::before { content: "✓"; position: absolute; left: 4px; color: var(--accent); font-weight: 800; }
.landing-pro { border: 2px solid var(--accent); }
.landing-pro-alt { font-size: 13px; color: var(--muted); margin: -4px 0 12px; }
.landing-price-note { font-size: 13px; color: var(--muted); margin: 12px 0 0; font-style: italic; }
.landing-pricing .btn { width: 100%; text-align: center; }

/* upgrade modal */
.modal-backdrop { position: fixed; inset: 0; background: rgba(15, 18, 40, 0.55); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 16px; }
.modal-card { background: var(--card); border-radius: var(--radius); padding: 28px; max-width: 440px; width: 100%; box-shadow: 0 24px 64px rgba(0,0,0,0.25); }
.modal-card h2 { margin: 0 0 8px; font-size: 22px; }
.modal-card p { color: var(--muted); font-size: 14px; margin: 0 0 20px; }
.plan-option { display: flex; justify-content: space-between; align-items: center; border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; margin-bottom: 10px; cursor: pointer; }
.plan-option:hover { border-color: var(--accent); }
.plan-option .plan-name { font-weight: 800; }
.plan-option .plan-note { font-size: 12px; color: var(--accent-dark); font-weight: 700; }
.plan-option .plan-go { font-size: 13px; color: var(--accent); font-weight: 700; }
.pro-badge { display: inline-block; background: var(--accent); color: #fff; font-size: 11px; font-weight: 800; border-radius: 20px; padding: 2px 10px; margin-left: 8px; vertical-align: middle; }

@media (max-width: 900px) {
  .landing-hero-inner { grid-template-columns: 1fr; gap: 36px; }
  .landing-hero h1 { font-size: 34px; }
  .landing-hero { padding: 44px 16px 40px; }
  .mock-presave { position: relative; width: 100%; margin-bottom: 16px; }
  .mock-check { position: relative; width: 100%; }
  .landing-hero-visual { min-height: 0; }
  .landing-nav .userbox .btn.ghost { display: none; }
  .landing-final h2 { font-size: 25px; }
}

/* ---- mobile pass (2026-09-29) ---- */
@media (max-width: 640px) {
  /* prevent iOS auto-zoom on focus: inputs must be >= 16px */
  .field input, .field select, .field textarea,
  .urlrow input, .presave-card input { font-size: 16px; }

  /* topbar: keep it on one line, truncate email */
  .topbar { gap: 8px; }
  .brand { font-size: 16px; white-space: nowrap; }
  .topbar .userbox { gap: 8px; font-size: 13px; }
  .topbar .userbox #userEmail {
    max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }

  /* page head actions go full width */
  .page-head .btn { width: 100%; padding: 13px 18px; }

  /* buttons: comfortable tap targets */
  .btn { min-height: 44px; }
  .btn.small { min-height: 38px; padding: 8px 14px; }

  /* cards breathe less on small screens */
  .card { padding: 16px 14px; }

  /* task rows: bigger checkboxes, more air */
  .task { padding: 14px 2px; gap: 14px; }
  .task input[type="checkbox"] { width: 24px; height: 24px; }
  .task .del { font-size: 20px; padding: 6px 10px; }

  /* template library rows */
  .tpl-item { padding: 12px 2px; }
  .tpl-item .btn { min-height: 38px; }

  /* url copy row stacks */
  .urlrow { flex-direction: column; align-items: stretch; }
  .urlrow .btn { width: 100%; }

  /* fans table scrolls horizontally instead of breaking layout */
  .table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -14px; padding: 0 14px; }
  table.fans { min-width: 480px; }

  /* grids: single column sooner */
  .grid { grid-template-columns: 1fr; }

  /* auth pages */
  .auth-wrap { margin: 24px auto; padding: 0 4px; }

  /* presave fan page */
  .presave-hero { padding: 32px 12px 4px; }
  .presave-card { margin: 20px 12px; }
  .presave-card .btn { width: 100%; padding: 13px 18px; }
}

/* ---- template library ---- */
.tpl-reminder { background: #fef9c3; border: 1px solid #fde68a; color: #92400e; border-radius: 8px; padding: 10px 12px; font-size: 14px; font-weight: 600; margin-bottom: 12px; }
.tpl-group { margin-bottom: 18px; }
.tpl-group:last-child { margin-bottom: 0; }
.tpl-group-title { font-size: 14px; font-weight: 700; margin: 0 0 6px; color: var(--accent-dark); }
.tpl-item { display: flex; gap: 12px; align-items: flex-start; padding: 10px 4px; border-bottom: 1px solid var(--line); }
.tpl-item:last-child { border-bottom: 0; }
.tpl-item.is-added { opacity: 0.55; }
.tpl-info { flex: 1; min-width: 0; }
.tpl-title { font-weight: 600; font-size: 14px; }
.tpl-detail { font-size: 13px; color: var(--muted); margin-top: 2px; }
.tpl-due { font-size: 12px; color: var(--muted); margin-top: 4px; }
.tpl-item .btn { flex-shrink: 0; }
