:root {
  --bg: #F7F3EA; --card: #FFFFFF; --ink: #1C1C1A; --muted: #5E5D57; --line: #EEE8DC;
  --border: #D8D3C6; --track: #ECE6D8; --navy: #1E2B4D; --blue: #1F5FD6; --gold: #8A5A12;
  --gold-soft: #FBF1DC; --orange: #B4520F; --radius: 18px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink);
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif; -webkit-font-smoothing: antialiased; }
button, input { font-family: inherit; }
a { color: var(--blue); text-decoration: none; }
#app { max-width: 520px; margin: 0 auto; min-height: 100vh; padding-bottom: 96px; }
.page { padding: 0 20px; display: flex; flex-direction: column; gap: 14px; }
h1 { margin: 0; font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }
h2.sec { margin: 0; font-size: 13px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.brand { font-family: 'Fredoka', sans-serif; font-weight: 600; color: var(--gold); font-size: 13px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 20px 20px 12px; gap: 8px; }
.topbar .col { display: flex; flex-direction: column; gap: 2px; }
.avatar { width: 44px; height: 44px; border-radius: 22px; display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 17px; flex-shrink: 0; }
.avatar.sm { width: 36px; height: 36px; font-size: 14px; }
.me { width: 40px; height: 40px; border-radius: 20px; background: var(--navy); color: #fff; border: 0;
  font-weight: 700; font-size: 15px; cursor: pointer; }
.card { background: var(--card); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column;
  gap: 12px; box-shadow: 0 1px 2px rgba(28,28,26,.06); }
.band { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; color: #fff; }
.band .dot { width: 10px; height: 10px; border-radius: 5px; box-shadow: 0 0 0 3px rgba(255,255,255,.28); flex-shrink: 0; }
.band .lbl { font-size: 15px; font-weight: 800; }
.band .det { font-size: 13px; font-weight: 600; opacity: .92; margin-left: auto; text-align: right; }
.who { display: flex; align-items: center; gap: 12px; color: var(--ink); }
.who .nm { font-size: 17px; font-weight: 700; }
.who .grow { display: flex; flex-direction: column; flex-grow: 1; gap: 2px; min-width: 0; }
.big { font-size: 22px; font-weight: 800; letter-spacing: -.01em; }
.row { display: flex; align-items: center; gap: 8px; }
.between { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.bar { height: 8px; border-radius: 4px; background: var(--track); overflow: hidden; }
.bar > div { height: 8px; border-radius: 4px; }
.btns { display: flex; gap: 8px; }
.btn { flex: 1 1 0; min-height: 44px; border-radius: 12px; border: 1px solid var(--border); background: #fff;
  font-size: 14px; font-weight: 700; color: var(--ink); cursor: pointer; padding: 0 12px; }
.btn.primary { background: var(--navy); color: #fff; border-color: var(--navy); }
.btn.blue { background: var(--blue); color: #fff; border-color: var(--blue); }
.btn.gold { background: var(--gold); color: #fff; border-color: var(--gold); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn:disabled { opacity: 1; background: var(--track); border-color: var(--track); color: var(--muted); cursor: default; }
.chip { min-height: 38px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--border); background: #fff;
  font-size: 13px; font-weight: 700; color: var(--ink); cursor: pointer; }
.chip.on { background: var(--blue); border-color: var(--blue); color: #fff; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: 11px; font-weight: 800; border-radius: 6px; padding: 4px 7px; flex-shrink: 0; }
.notice { padding: 12px 14px; border-radius: 14px; background: #FFF1E4; color: #6B2E08; font-size: 13px; line-height: 1.45; }
.notice.err { background: #FDE4E1; color: #7A1A10; }
.nav { position: fixed; left: 0; right: 0; bottom: 0; background: #fff; border-top: 1px solid #E6E1D5;
  display: flex; justify-content: space-around; padding: 8px 12px calc(10px + env(safe-area-inset-bottom)); z-index: 5; }
.nav a { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; font-weight: 600;
  color: var(--muted); min-width: 64px; padding-top: 4px; position: relative; }
.nav a.on { color: var(--blue); font-weight: 800; }
.nav .badge { position: absolute; top: 0; right: 14px; background: var(--orange); color: #fff; border-radius: 999px;
  font-size: 10px; font-weight: 800; padding: 1px 5px; }
.back { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; color: var(--ink);
  background: none; border: 0; cursor: pointer; }
.list { background: #fff; border-radius: 16px; padding: 4px 14px; display: flex; flex-direction: column; }
.li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.li:last-child { border-bottom: 0; }
.li .grow { display: flex; flex-direction: column; flex-grow: 1; min-width: 0; gap: 2px; }
.li .t { font-size: 15px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li button.rowbtn { all: unset; display: flex; align-items: center; gap: 12px; width: 100%; cursor: pointer; }
.stepper { display: flex; align-items: center; gap: 6px; }
.stepper button { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--border); background: #fff;
  font-size: 20px; font-weight: 700; cursor: pointer; color: var(--ink);
  touch-action: manipulation; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.stepper button:active { background: var(--track); }
.stepper span { min-width: 88px; text-align: center; font-size: 16px; font-weight: 800; }
.sched-row { all: unset; display: grid; grid-template-columns: 40px minmax(0,1fr) 120px; gap: 8px; align-items: center;
  min-height: 44px; padding: 0 6px; margin: 0 -6px; border-radius: 10px; cursor: pointer; }
.sched-row.sel { background: #EEF3FD; }
.sched-row .track { position: relative; height: 12px; border-radius: 6px; background: var(--track); display: block; }
.sched-row .fill { position: absolute; top: 0; bottom: 0; border-radius: 6px; display: block; }
.sched-row .lab { font-size: 13px; font-weight: 700; text-align: right; }
.editor { margin-top: 12px; padding: 14px; border-radius: 16px; border: 2px solid var(--blue); display: flex; flex-direction: column; gap: 14px; }
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; }
.tile { text-align: left; padding: 10px 12px; border-radius: 14px; border: 2px solid #E2E1DA; background: #fff;
  display: flex; flex-direction: column; gap: 2px; }
.tile.on { border-color: var(--blue); }
.tile .v { font-size: 24px; font-weight: 800; letter-spacing: -.02em; }
.slider { position: relative; height: 44px; margin: 0 14px; touch-action: none; cursor: pointer; user-select: none; }
.slider .rail { position: absolute; left: 0; right: 0; top: 17px; height: 10px; border-radius: 5px; background: var(--track); }
.slider .rng { position: absolute; top: 17px; height: 10px; border-radius: 5px; background: var(--blue); }
.slider .h { position: absolute; top: 8px; width: 28px; height: 28px; margin-left: -14px; border-radius: 14px;
  box-shadow: 0 1px 4px rgba(0,0,0,.2); }
.slider .h.a { background: #fff; border: 3px solid var(--blue); }
.slider .h.b { background: var(--blue); border: 3px solid #fff; }
.days7 { display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); gap: 4px; }
.days7 button { height: 40px; border-radius: 10px; border: 1px solid var(--border); background: #fff; font-weight: 800; cursor: pointer; }
.days7 button.on { background: var(--blue); border-color: var(--blue); color: #fff; }
.week { display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); gap: 8px; align-items: end; height: 130px; }
.week .c { display: flex; flex-direction: column; align-items: center; gap: 6px; height: 130px; justify-content: flex-end; }
.week .b { width: 100%; border-radius: 6px; min-height: 3px; }
/* login */
.hero { height: 340px; background: var(--navy); overflow: hidden; }
.hero svg { display: block; width: 100%; height: 100%; }
.login { padding: 4px 24px 28px; display: flex; flex-direction: column; gap: 20px; }
.login h1 { font-family: 'Fredoka', sans-serif; font-size: 40px; font-weight: 600; color: var(--navy); line-height: 1.05; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; font-weight: 700; }
.field input { height: 52px; border-radius: 16px; border: 1px solid var(--border); background: #fff; padding: 0 16px; font-size: 16px; }
.who2 { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; }
.who2 button { height: 56px; border-radius: 16px; border: 2px solid #E4DFD2; background: #FBF8F2; display: flex; align-items: center;
  justify-content: center; gap: 10px; font-size: 15px; font-weight: 700; cursor: pointer; color: var(--ink); }
.who2 button.on { border-color: var(--navy); background: #fff; }
.who2 .i { width: 30px; height: 30px; border-radius: 15px; background: #9A9588; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 13px; }
.who2 button.on .i { background: var(--navy); }
/* sheet */
.scrim { position: fixed; inset: 0; background: rgba(20,26,44,.48); display: flex; flex-direction: column; justify-content: flex-end; z-index: 20; }
.scrim .close { flex-grow: 1; border: 0; background: transparent; cursor: pointer; }
.sheet { background: #fff; border-radius: 24px 24px 0 0; padding: 10px 20px calc(24px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 16px; max-width: 520px; width: 100%; margin: 0 auto; box-shadow: 0 -8px 30px rgba(0,0,0,.18); }
.sheet .grab { width: 40px; height: 5px; border-radius: 3px; background: var(--border); align-self: center; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; }
.opt { height: 52px; border-radius: 14px; border: 2px solid #E3C98F; background: #fff; font-size: 15px; font-weight: 700; cursor: pointer; color: var(--ink); }
.opt.on { background: var(--gold); border-color: var(--gold); color: #fff; }
#toast { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); background: var(--navy); color: #fff;
  padding: 10px 16px; border-radius: 12px; font-size: 14px; font-weight: 700; opacity: 0; transition: opacity .2s; pointer-events: none; z-index: 30; }
#toast.show { opacity: 1; }
.spin { padding: 60px 0; text-align: center; color: var(--muted); }
.axis { position: relative; height: 16px; margin: -6px 14px 0; font-weight: 600; }
.axis span { position: absolute; top: 0; transform: translateX(-50%); white-space: nowrap; }
.slider .tip { position: absolute; bottom: 42px; transform: translateX(-50%); background: var(--navy); color: #fff; font-size: 13px;
  font-weight: 800; padding: 5px 9px; border-radius: 8px; white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity .12s; }
.slider .tip::after { content: ''; position: absolute; left: var(--ar, 50%); bottom: -4px; margin-left: -4px; border: 4px solid transparent; border-bottom: 0; border-top-color: var(--navy); }
.slider .tip.show { opacity: 1; }
