/* Legends Planner. Stanley Apps Ltd. */
:root {
  --bg: #F7F4EE; --card: #FFFFFF; --ink: #1E2B33; --soft: #5D6B74; --line: #E6E0D6;
  --brand: #2F7D6D; --brand-ink: #FFFFFF; --brand-soft: #E3F1EC;
  --warn: #D9622B; --warn-soft: #FCE9DF; --gold: #B98A12; --gold-soft: #FBF1D6; --rose: #C2456B; --rose-soft: #FBE4EB;
  --sky: #2E6DB4; --sky-soft: #E3EDF8; --ok: #2E8B57;
  --radius: 16px; --shadow: 0 1px 2px rgba(30, 43, 51, .06), 0 4px 16px rgba(30, 43, 51, .05);
  --nav-h: 64px; --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12181C; --card: #1B2428; --ink: #EEF2F3; --soft: #A3B1B8; --line: #2C3A40;
    --brand: #5BB9A2; --brand-ink: #0D1A17; --brand-soft: #1D3631; --warn: #F08A5D; --warn-soft: #3A2419;
    --gold: #E2B848; --gold-soft: #3A3018; --rose: #EE7D9F; --rose-soft: #3B1F29; --sky: #7FB0EA; --sky-soft: #1C2C3E; --ok: #6FCF97;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3); color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--brand); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .4em; }
h1 { font-size: 1.6rem; letter-spacing: -.01em; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 .7em; }
.muted { color: var(--soft); }
.small { font-size: .875rem; }
.big { font-size: 1.9rem; font-weight: 700; letter-spacing: -.02em; }
.hide, [hidden] { display: none !important; }

.splash { min-height: 100vh; display: grid; place-content: center; text-align: center; color: var(--soft); }
.splash img { border-radius: 18px; margin: 0 auto 8px; }

/* layout */
.shell { min-height: 100vh; padding-bottom: calc(var(--nav-h) + var(--safe-b) + 16px); }
.top { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px);
  padding: calc(env(safe-area-inset-top, 0px) + 12px) 16px 10px; display: flex; align-items: center; gap: 10px; }
.top .title { font-weight: 700; font-size: 1.15rem; flex: 1; }
.top img { width: 32px; height: 32px; border-radius: 9px; }
main { max-width: 760px; margin: 0 auto; padding: 4px 16px 24px; }
.nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; background: var(--card); border-top: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(5, 1fr); padding-bottom: var(--safe-b); }
.nav button { border: 0; background: none; padding: 8px 2px 10px; min-height: var(--nav-h); display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: .72rem; color: var(--soft); cursor: pointer; }
.nav button .i { font-size: 1.35rem; line-height: 1; filter: grayscale(.6); }
.nav button.on { color: var(--brand); font-weight: 600; }
.nav button.on .i { filter: none; }
@media (min-width: 900px) {
  .shell { padding: 0 0 0 220px; }
  .nav { top: 0; right: auto; width: 220px; grid-template-columns: 1fr; align-content: start; border-top: 0; border-right: 1px solid var(--line); padding: 80px 12px 0; gap: 4px; }
  .nav button { flex-direction: row; justify-content: flex-start; gap: 12px; min-height: 46px; font-size: .98rem; padding: 0 14px; border-radius: 12px; }
  .nav button.on { background: var(--brand-soft); }
  .top { padding-left: 24px; }
}

/* cards and lists */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin: 0 0 14px; }
.card.tint { background: var(--brand-soft); box-shadow: none; }
.card.tint .big { font-size: 1.55rem; }
.card.warm { background: var(--gold-soft); box-shadow: none; }
.row { display: flex; align-items: center; gap: 12px; }
.row.top-a { align-items: flex-start; }
.grow { flex: 1; min-width: 0; }
.between { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.list { list-style: none; margin: 0; padding: 0; }
.item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.item:last-child { border-bottom: 0; }
.item.tap { cursor: pointer; }
.item .ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 1.25rem; background: var(--bg); flex: none; }
.item .name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .sub { color: var(--soft); font-size: .86rem; }
.item .amt { font-weight: 700; white-space: nowrap; text-align: right; }
.item .amt.in { color: var(--ok); }
.section-h { display: flex; justify-content: space-between; align-items: baseline; margin: 22px 2px 8px; }
.section-h h2 { margin: 0; }
.chip { display: inline-block; font-size: .75rem; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: var(--bg); color: var(--soft); white-space: nowrap; }
.chip.today { background: var(--warn); color: #fff; }
.chip.soon { background: var(--warn-soft); color: var(--warn); }
.chip.bday { background: var(--rose-soft); color: var(--rose); }
.chip.ok { background: var(--brand-soft); color: var(--brand); }
.chip.gold { background: var(--gold-soft); color: var(--gold); }
.empty { text-align: center; color: var(--soft); padding: 26px 12px; }
.empty .e { font-size: 2.2rem; }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 14px; }
.stats .card { margin: 0; }
.stats .lbl { color: var(--soft); font-size: .85rem; }
.bar { height: 8px; border-radius: 99px; background: var(--bg); overflow: hidden; margin-top: 6px; }
.bar i { display: block; height: 100%; background: var(--brand); border-radius: 99px; }
.bar.warn i { background: var(--warn); }
.steps { counter-reset: s; display: grid; gap: 10px; }
.step { display: flex; gap: 12px; align-items: center; background: var(--card); border-radius: 14px; padding: 14px; box-shadow: var(--shadow); cursor: pointer; border: 0; text-align: left; width: 100%; }
.step .n { width: 30px; height: 30px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; font-weight: 700; flex: none; }
.step.done .n { background: var(--brand); color: var(--brand-ink); }

/* buttons and forms */
.btn { border: 0; border-radius: 12px; padding: 12px 18px; font-weight: 600; cursor: pointer; background: var(--brand); color: var(--brand-ink); min-height: 46px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; }
.btn.block { width: 100%; }
.btn.ghost { background: var(--brand-soft); color: var(--brand); }
.btn.plain { background: transparent; color: var(--brand); padding: 8px 10px; min-height: 36px; }
.btn.danger { background: var(--warn-soft); color: var(--warn); }
.btn.small { padding: 6px 12px; min-height: 34px; font-size: .88rem; border-radius: 10px; }
.btn:disabled { opacity: .55; cursor: default; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
label.f { display: block; margin: 0 0 14px; }
label.f > span { display: block; font-weight: 600; font-size: .92rem; margin-bottom: 6px; }
label.f > small { display: block; color: var(--soft); margin-top: 4px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=time], input[type=search], select, textarea {
  width: 100%; border: 1.5px solid var(--line); background: var(--card); border-radius: 12px; padding: 11px 12px; min-height: 46px; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); }
textarea { min-height: 80px; resize: vertical; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 14px; }
.check input { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--brand); flex: none; }
.seg { display: flex; background: var(--bg); border-radius: 12px; padding: 4px; gap: 4px; margin-bottom: 16px; }
.seg button { flex: 1; border: 0; background: none; padding: 9px; border-radius: 9px; font-weight: 600; color: var(--soft); cursor: pointer; }
.seg button.on { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
.err { background: var(--warn-soft); color: var(--warn); padding: 10px 12px; border-radius: 10px; margin: 0 0 14px; font-size: .92rem; }
.note { background: var(--sky-soft); color: var(--ink); padding: 12px; border-radius: 12px; margin: 0 0 14px; font-size: .92rem; }

/* welcome */
.welcome { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.welcome .box { width: 100%; max-width: 420px; }
.welcome .logo { display: flex; gap: 12px; align-items: center; margin-bottom: 18px; }
.welcome .logo img { width: 54px; height: 54px; border-radius: 15px; }
.welcome .pitch { display: grid; gap: 8px; margin: 0 0 20px; padding: 0; list-style: none; color: var(--soft); }
.foot { text-align: center; color: var(--soft); font-size: .8rem; margin-top: 18px; }

/* bottom sheet */
.sheet { position: fixed; inset: 0; z-index: 30; background: rgba(15, 22, 26, .45); display: flex; align-items: flex-end; justify-content: center; }
.sheet .panel { background: var(--card); width: 100%; max-width: 620px; max-height: 92vh; overflow: auto; border-radius: 22px 22px 0 0; padding: 18px 18px calc(18px + var(--safe-b)); animation: up .18s ease-out; }
.sheet .panel.full { max-width: 760px; }
@media (min-width: 700px) { .sheet { align-items: center; } .sheet .panel { border-radius: 22px; max-height: 88vh; } }
@keyframes up { from { transform: translateY(30px); opacity: .4; } to { transform: none; opacity: 1; } }
.sheet .handle { width: 40px; height: 4px; border-radius: 9px; background: var(--line); margin: -6px auto 12px; }
.sheet .hd { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; gap: 10px; }
.sheet .hd h2 { margin: 0; }
.x { border: 0; background: var(--bg); width: 36px; height: 36px; border-radius: 50%; font-size: 1.1rem; cursor: pointer; flex: none; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + var(--safe-b) + 14px); z-index: 40; background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-weight: 600; max-width: 90vw; box-shadow: var(--shadow); }

/* calendar */
.cal-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal .dow { text-align: center; font-size: .75rem; color: var(--soft); padding: 4px 0; font-weight: 600; }
.cal button { aspect-ratio: 1 / 1.05; border: 0; border-radius: 10px; background: var(--card); padding: 4px 2px; display: flex; flex-direction: column; align-items: center; gap: 3px; cursor: pointer; font-size: .9rem; }
.cal button.out { opacity: .35; }
.cal button.today { outline: 2px solid var(--brand); }
.cal button.sel { background: var(--brand); color: var(--brand-ink); }
.dots { display: flex; gap: 2px; flex-wrap: wrap; justify-content: center; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--warn); }
.dots i.e { background: var(--rose); }
.dots i.o { background: var(--sky); }

/* import review */
.tx-mini { max-height: 260px; overflow: auto; border: 1px solid var(--line); border-radius: 12px; padding: 0 12px; }
.found { display: grid; gap: 10px; }
.found .fb { border: 1.5px solid var(--line); border-radius: 14px; padding: 12px; }
.found .fb.on { border-color: var(--brand); background: color-mix(in srgb, var(--brand-soft) 50%, var(--card)); }
.found .fb .two select, .found .fb .two input { min-height: 40px; padding: 8px 10px; }
.progress { height: 10px; background: var(--bg); border-radius: 99px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--brand); transition: width .2s; }
.drop { border: 2px dashed var(--line); border-radius: 16px; padding: 26px 16px; text-align: center; cursor: pointer; display: block; }
.drop:hover, .drop.over { border-color: var(--brand); background: var(--brand-soft); }
.drop input { display: none; }
.tip { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--line); }
.tip:last-child { border-bottom: 0; }
.tip .e { font-size: 1.5rem; line-height: 1; }
.search { margin-bottom: 10px; }
