/* Shinsei Pass — style vàng-đen FF (giống Sổ Bé) */
:root {
  --bg: #0d0d0d;
  --card: #171717;
  --card2: #1d1d1d;
  --gold: #F5B942;
  --gold2: #FFD97A;
  --ink: #f5f0e6;
  --ink-soft: #b8b0a0;
  --line: #2a2a2a;
  --green: #10B981;
  --red: #E5484D;
}
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  max-width: 520px;
  margin: 0 auto;
  padding-bottom: 70px;
  min-height: 100vh;
}
.hidden { display: none !important; }
a { color: var(--gold); }

/* Header */
header {
  padding: 22px 18px 14px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #141414, #0d0d0d);
}
.logo { font-size: .7rem; letter-spacing: 2px; color: var(--gold); font-weight: 800; margin-bottom: 6px; }
header h1 { font-size: 1.5rem; color: var(--gold2); }
.sub { font-size: .8rem; color: var(--ink-soft); margin-top: 4px; }

/* Tabbar */
.tabbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; background: #111; border-bottom: 1px solid var(--line);
}
.tab-btn {
  flex: 1; padding: 12px 4px; background: none; border: none; color: var(--ink-soft);
  font-size: .85rem; font-weight: 700; cursor: pointer; border-bottom: 2px solid transparent;
}
.tab-btn.active { color: var(--gold); border-bottom-color: var(--gold); }

/* Route cards */
#groups { display: flex; flex-direction: column; gap: 12px; padding: 14px 14px 4px; }
.grp { background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.grp.open { border-color: #3a2f14; }
.grp-head {
  display: flex; align-items: center; gap: 10px; width: 100%;
  background: linear-gradient(90deg, #1a1508, #141414);
  border: none; color: var(--ink); padding: 13px 14px; cursor: pointer; text-align: left;
}
.grp-icon { font-size: 1.4rem; }
.grp-hd { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.grp-title { font-weight: 800; font-size: .95rem; color: var(--gold2); }
.grp-sub { font-size: .7rem; color: var(--ink-soft); margin-top: 2px; }
.grp-arrow { color: var(--gold); transition: transform .2s; }
.grp.open .grp-arrow { transform: rotate(180deg); }
.grp-body { display: none; padding: 10px; flex-direction: column; gap: 10px; background: #121212; }
.grp.open .grp-body { display: flex; }
.route-card {
  display: flex; gap: 12px; text-align: left; width: 100%;
  background: var(--card2); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px; color: var(--ink); cursor: pointer; transition: border .15s;
}
.route-card.active { border-color: var(--gold); background: #1c180e; }
.rc-icon { font-size: 1.6rem; line-height: 1.2; }
.rc-body { flex: 1; min-width: 0; }
.rc-title { font-weight: 800; font-size: .95rem; }
.rc-sub { font-size: .72rem; color: var(--ink-soft); margin: 3px 0 7px; line-height: 1.35; }
.rc-prog { display: flex; align-items: center; gap: 8px; }
.rc-bar { height: 5px; background: var(--gold); border-radius: 3px; min-width: 2px; }
.rc-prog .rc-bar { flex: 1; background: #333; overflow: hidden; position: relative; }
.rc-prog .rc-bar { background: linear-gradient(90deg, var(--gold), var(--gold2)); width: 0; }
.rc-prog span { font-size: .68rem; color: var(--ink-soft); }

/* Templates (mục đặc biệt) */
.tpl {
  display: block; background: var(--card2); border: 1px solid var(--line); border-radius: 10px;
  padding: 11px 12px; color: var(--ink); text-decoration: none;
}
.tpl-t { font-size: .84rem; font-weight: 700; }
.tpl-g { font-size: .73rem; color: var(--ink-soft); margin-top: 3px; line-height: 1.4; }
.tpl-l { font-size: .72rem; color: var(--gold); margin-top: 5px; }
.tpl-head { padding: 4px 2px 2px; }
.tpl-title { font-size: .9rem; font-weight: 800; color: var(--gold2); }
.tpl-sub { font-size: .73rem; color: var(--ink-soft); margin: 4px 0 8px; line-height: 1.4; }

/* Progress */
.prog-wrap { padding: 12px 14px 2px; }
.prog-top { display: flex; justify-content: space-between; font-size: .8rem; margin-bottom: 6px; color: var(--ink-soft); }
.prog-top #prog-pct { color: var(--gold); font-weight: 800; }
.prog-track { height: 8px; background: #222; border-radius: 5px; overflow: hidden; }
#prog-bar { height: 100%; width: 0; background: linear-gradient(90deg, var(--gold), var(--gold2)); border-radius: 5px; transition: width .3s; }

/* Expiry banner */
#expiry-banner, #expiry-banner-life {
  margin: 10px 14px 0; padding: 9px 12px; border-radius: 10px;
  background: #2a150f; border: 1px solid #7a2e22; color: #ffb4a8; font-size: .78rem; line-height: 1.4;
}

/* Checklist items */
#checklist, #checklist-life { padding: 10px 14px; display: flex; flex-direction: column; gap: 8px; }
.empty-hint {
  padding: 28px 18px; text-align: center; color: var(--ink-soft);
  font-size: .85rem; background: var(--card); border: 1px dashed var(--line); border-radius: 12px;
}
.item { background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.item.done { border-color: #14532d; background: #0f1a14; }
.item-head {
  display: flex; align-items: center; gap: 10px; width: 100%;
  background: none; border: none; color: var(--ink); padding: 12px; cursor: pointer; font-size: .92rem;
}
.item-icon { font-size: 1.15rem; }
.item-title { flex: 1; text-align: left; font-weight: 700; }
.item-count { font-size: .72rem; color: var(--ink-soft); background: #222; padding: 2px 8px; border-radius: 999px; }
.item.done .item-count { background: #14532d; color: #6ee7b7; }
.item-arrow { color: var(--ink-soft); transition: transform .2s; }
.item.open .item-arrow { transform: rotate(180deg); }
.item-body { display: none; padding: 2px 12px 12px; flex-direction: column; gap: 8px; }
.item.open .item-body { display: flex; }

/* Steps */
.step {
  display: flex; gap: 10px; align-items: flex-start; cursor: pointer;
  background: var(--card2); border: 1px solid var(--line); border-radius: 10px; padding: 10px;
  position: relative;
}
.step input { display: none; }
.step-box {
  width: 22px; height: 22px; min-width: 22px; border-radius: 6px; border: 2px solid #444;
  margin-top: 1px; display: inline-flex; align-items: center; justify-content: center;
  color: #0d0d0d; font-size: .8rem; font-weight: 900;
}
.step.checked { border-color: #14532d; background: #101b14; }
.step.checked .step-box { background: var(--green); border-color: var(--green); }
.step.checked .step-box::after { content: '✓'; }
.step-main { flex: 1; min-width: 0; }
.step-t { font-size: .85rem; font-weight: 700; display: block; }
.step.checked .step-t { text-decoration: line-through; color: #7dd3a8; }
.step-g { font-size: .76rem; color: var(--ink-soft); display: block; margin-top: 4px; line-height: 1.45; }
.step-link { font-size: .74rem; display: inline-block; margin-top: 6px; text-decoration: none; border-bottom: 1px dashed var(--gold); }
.exp { font-size: .7rem; font-weight: 700; color: var(--gold); margin-left: 8px; }
.exp.danger { color: var(--red); }

/* Panels */
.panel { padding: 16px 14px; }
.panel h2 { font-size: 1.05rem; color: var(--gold2); margin: 14px 0 8px; }
.panel h2:first-child { margin-top: 0; }
#riyusho-guide { padding-left: 18px; color: var(--ink-soft); font-size: .84rem; line-height: 1.55; display: flex; flex-direction: column; gap: 6px; }
#riyusho-template {
  background: #141414; border: 1px solid var(--line); border-radius: 10px;
  padding: 14px; font-size: .76rem; line-height: 1.6; white-space: pre-wrap;
  color: #d8d2c4; margin-top: 10px; max-height: 60vh; overflow: auto;
}

/* Settings */
.set-row {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 12px; margin-bottom: 8px; cursor: pointer;
}
.set-row span { font-size: .84rem; color: var(--ink); }
.set-row small { color: var(--ink-soft); font-size: .72rem; }
.set-row input { width: 44px; height: 24px; appearance: none; background: #333; border-radius: 12px; position: relative; cursor: pointer; transition: background .15s; }
.set-row input::after { content: ''; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: #888; transition: left .15s, background .15s; }
.set-row input:checked { background: var(--gold); }
.set-row input:checked::after { left: 22px; background: #0d0d0d; }
.hint { font-size: .74rem; color: var(--ink-soft); margin: 6px 0; line-height: 1.45; }

/* Buttons */
.btn {
  background: linear-gradient(180deg, var(--gold), #d99a26); color: #0d0d0d;
  border: none; border-radius: 10px; padding: 10px 16px; font-weight: 800; font-size: .85rem;
  cursor: pointer; margin: 4px 6px 4px 0;
}
.btn-row { display: flex; flex-wrap: wrap; }

/* Disclaimer */
.disclaimer { padding: 10px 14px; font-size: .7rem; color: #8a8272; line-height: 1.5; }

/* Toast */
#toast {
  position: fixed; bottom: 84px; left: 50%; transform: translateX(-50%);
  background: var(--gold); color: #0d0d0d; font-weight: 800; font-size: .82rem;
  padding: 10px 18px; border-radius: 999px; z-index: 99; box-shadow: 0 4px 20px rgba(0,0,0,.5);
  max-width: 90vw; text-align: center;
}

footer { text-align: center; padding: 18px; font-size: .72rem; color: #6a6456; }
footer a { color: #6a6456; }
