:root {
  --bg: #F7F3EE;
  --bg-card: #EDE7DC;
  --bg-surface: #E4DDD3;
  --text: #2C2416;
  --text-mid: #6B5C47;
  --text-light: #9C8B78;
  --accent: #8B7355;
  --accent-light: #D4B896;
  --border: #D8CFBF;
  --border-light: #E8E0D5;
  --pink: #C4897A;
  --green: #6B8C6E;
  --blue: #7A8FA8;
  --amber: #B8924A;
  --purple: #8B82B0;
  --route-home: #B8924A;
  --route-rel: #C4897A;
  --route-sport: #6B8C6E;
  --route-impr: #8B82B0;
  --route-dream: #7A8FA8;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { background: var(--bg); color: var(--text); font-family: 'Inter', sans-serif; font-size: 15px; line-height: 1.6; min-height: 100vh; }

/* ONBOARDING */
#onboarding { min-height: 100vh; display: flex; flex-direction: column; }
.ob-header { text-align: center; padding: 2.5rem 2rem 0; }
.ob-monogram { font-family: 'Cormorant Garamond', serif; font-size: 15px; font-weight: 300; color: var(--text-light); letter-spacing: .2em; margin-bottom: .5rem; }
.ob-divider { width: 60px; height: 1px; background: var(--accent-light); margin: 0 auto 2rem; }
.ob-screens { flex: 1; display: flex; flex-direction: column; }
.ob-screen { display: none; flex-direction: column; flex: 1; padding: 0 2rem 2rem; animation: fadeup .35s ease; }
.ob-screen.active { display: flex; }
@keyframes fadeup { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.ob-screen-top { flex: 1; }
.ob-dots { display: flex; gap: 7px; justify-content: center; margin-bottom: 2.5rem; }
.ob-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--border); transition: all .25s; }
.ob-dot.active { background: var(--accent); width: 20px; border-radius: 3px; }
.ob-dot.done { background: var(--accent-light); }
.ob-icon { font-size: 36px; color: var(--accent-light); margin-bottom: 1.5rem; }
.ob-eyebrow { font-size: 10px; color: var(--text-light); letter-spacing: .1em; text-transform: uppercase; margin-bottom: .5rem; }
.ob-title { font-family: 'Cormorant Garamond', serif; font-size: 32px; font-weight: 400; line-height: 1.2; color: var(--text); margin-bottom: 1.25rem; }
.ob-body { font-size: 14px; color: var(--text-mid); line-height: 1.8; }
.ob-body p + p { margin-top: .875rem; }
.ob-hl { color: var(--text); font-weight: 500; }

.ob-blocks { display: flex; flex-direction: column; gap: 8px; margin-top: 1.25rem; }
.ob-block { display: flex; gap: 12px; align-items: flex-start; padding: 1rem; background: var(--bg-card); border-radius: 10px; }
.ob-block-icon { font-size: 18px; flex-shrink: 0; margin-top: 2px; }
.ob-block-title { font-size: 13px; font-weight: 500; color: var(--text); margin-bottom: 3px; }
.ob-block-text { font-size: 12px; color: var(--text-mid); line-height: 1.55; }

.ob-routes { display: flex; flex-direction: column; gap: 7px; margin-top: 1.25rem; }
.ob-route { display: flex; align-items: center; gap: 10px; padding: .75rem 1rem; background: var(--bg-card); border-radius: 8px; }
.ob-route-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.ob-route-name { font-size: 13px; font-weight: 500; color: var(--text); flex: 1; }
.ob-route-count { font-size: 12px; color: var(--text-light); }

.ob-fine { display: flex; flex-direction: column; gap: 8px; margin-top: 1.25rem; }
.ob-fine-item { display: flex; gap: 12px; align-items: flex-start; padding: .875rem 1rem; background: var(--bg-card); border-radius: 8px; }
.ob-fine-icon { font-size: 16px; flex-shrink: 0; margin-top: 1px; }
.ob-fine-title { font-size: 13px; color: var(--text); line-height: 1.4; }
.ob-fine-sub { font-size: 11px; color: var(--text-light); margin-top: 2px; line-height: 1.4; }

.first-task { margin-top: 1.25rem; padding: 1rem 1.125rem; border: 1.5px solid var(--pink); border-radius: 12px; background: #F9EFED; }
.first-task-label { font-size: 10px; color: var(--pink); letter-spacing: .08em; text-transform: uppercase; margin-bottom: .375rem; }
.first-task-title { font-family: 'Cormorant Garamond', serif; font-size: 18px; color: #8B4A3C; margin-bottom: .375rem; }
.first-task-text { font-size: 13px; color: #A05C50; line-height: 1.55; }
.ob-summary { display: flex; flex-direction: column; gap: 7px; margin-top: 1.25rem; }
.ob-sum-item { display: flex; align-items: center; gap: 10px; padding: .625rem 1rem; background: var(--bg-card); border-radius: 8px; }
.ob-sum-icon { font-size: 14px; color: var(--green); flex-shrink: 0; }
.ob-sum-text { font-size: 13px; color: var(--text); }
.ob-closing { margin-top: 1.25rem; padding: 1rem 1.125rem; background: var(--bg-card); border-radius: 8px; border-left: 3px solid var(--accent-light); }
.ob-closing-text { font-size: 14px; color: var(--text-mid); line-height: 1.75; font-style: italic; font-family: 'Cormorant Garamond', serif; }
.ob-closing-sign { font-size: 12px; color: var(--text-light); margin-top: .625rem; }

.ob-footer { display: flex; align-items: center; justify-content: space-between; padding-top: 1.25rem; margin-top: 1.5rem; border-top: 1px solid var(--border-light); }
.btn-back { padding: 8px 16px; font-size: 13px; background: none; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; color: var(--text-mid); font-family: 'Inter', sans-serif; }
.btn-back:disabled { opacity: 0; pointer-events: none; }
.btn-next { padding: 9px 22px; font-size: 13px; background: var(--accent); border: none; border-radius: 8px; cursor: pointer; color: #FFF8F0; font-family: 'Inter', sans-serif; display: flex; align-items: center; gap: 6px; }
.btn-start { background: var(--green); }
.ob-step { font-size: 11px; color: var(--text-light); }

/* MAIN APP */
#app { display: none; }
.app-header { background: var(--bg); border-bottom: 1px solid var(--border-light); padding: 1.25rem 1.5rem; text-align: center; position: sticky; top: 0; z-index: 10; }
.app-mono { font-size: 10px; color: var(--text-light); letter-spacing: .15em; text-transform: uppercase; margin-bottom: .25rem; }
.app-title { font-family: 'Cormorant Garamond', serif; font-size: 22px; font-weight: 400; color: var(--text); }

.app-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; padding: 1rem 1.5rem; border-bottom: 1px solid var(--border-light); }
.stat-box { background: var(--bg-card); border-radius: 8px; padding: .625rem .75rem; text-align: center; }
.stat-n { font-family: 'Cormorant Garamond', serif; font-size: 24px; font-weight: 400; color: var(--text); }
.stat-l { font-size: 10px; color: var(--text-light); margin-top: 1px; text-transform: uppercase; letter-spacing: .05em; }

.prog-wrap { padding: .875rem 1.5rem; border-bottom: 1px solid var(--border-light); }
.prog-row { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-light); margin-bottom: 6px; letter-spacing: .03em; }
.prog-bg { background: var(--bg-surface); border-radius: 99px; height: 4px; }
.prog-fill { height: 4px; border-radius: 99px; background: var(--accent); transition: width .5s ease; }

.view-tabs { display: flex; border-bottom: 1px solid var(--border-light); padding: 0 1.5rem; }
.vtab { padding: .75rem 1rem; font-size: 12px; color: var(--text-light); background: none; border: none; border-bottom: 2px solid transparent; cursor: pointer; font-family: 'Inter', sans-serif; letter-spacing: .03em; margin-bottom: -1px; }
.vtab.active { color: var(--text); border-bottom-color: var(--accent); }

/* ROUTES VIEW */
.routes-view { padding: 1.25rem 1.5rem; display: flex; flex-direction: column; gap: 10px; }
.route-card { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--bg-card); }
.route-hdr { display: flex; align-items: center; gap: 10px; padding: .875rem 1rem; cursor: pointer; }
.route-stripe { width: 4px; height: 36px; border-radius: 2px; flex-shrink: 0; }
.route-info { flex: 1; }
.route-name { font-family: 'Cormorant Garamond', serif; font-size: 17px; font-weight: 400; color: var(--text); margin-bottom: 1px; }
.route-meta { font-size: 11px; color: var(--text-light); }
.route-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.route-pct { font-size: 13px; color: var(--text-mid); }
.route-bar-bg { width: 50px; height: 3px; background: var(--bg-surface); border-radius: 99px; overflow: hidden; }
.route-bar-fill { height: 3px; border-radius: 99px; transition: width .4s ease; }
.route-chev { font-size: 14px; color: var(--text-light); transition: transform .2s; }
.route-chev.open { transform: rotate(180deg); }
.route-body { display: none; border-top: 1px solid var(--border-light); }
.route-body.open { display: block; }
.route-items { padding: .75rem 1rem; display: flex; flex-direction: column; gap: 5px; }
.rt-row { display: flex; align-items: center; gap: 9px; padding: .5rem .625rem; border-radius: 7px; cursor: pointer; transition: background .12s; }
.rt-row:hover { background: var(--bg-surface); }
.rt-row.locked { opacity: .45; cursor: default; }
.rt-icon { font-size: 15px; width: 18px; text-align: center; flex-shrink: 0; }
.rt-name { font-size: 13px; color: var(--text); flex: 1; }
.rt-st { font-size: 12px; color: var(--text-light); }
.rt-row.done .rt-name { color: var(--text-mid); }

/* GRID VIEW */
.grid-view { padding: 1.25rem 1.5rem; }
.filter-row { display: flex; gap: 6px; margin-bottom: 1rem; flex-wrap: wrap; }
.fbtn { font-size: 11px; padding: 4px 12px; border-radius: 99px; border: 1px solid var(--border); background: none; cursor: pointer; color: var(--text-mid); font-family: 'Inter', sans-serif; transition: all .15s; }
.fbtn.active { background: var(--accent); border-color: var(--accent); color: #FFF8F0; }
.t-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(155px,1fr)); gap: 8px; }
.t-card { background: var(--bg-card); border: 1px solid var(--border-light); border-radius: 12px; padding: .875rem; cursor: pointer; transition: border-color .15s; position: relative; min-height: 120px; display: flex; flex-direction: column; justify-content: space-between; }
.t-card:hover:not(.tc-locked) { border-color: var(--accent-light); }
.tc-locked { opacity: .5; cursor: default; }
.tc-done { border-color: var(--green) !important; }
.tc-wedding { border: 1.5px solid var(--pink); }
.tc-divan { border: 1.5px solid var(--amber); }
.tc-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 7px; }
.tc-icon { font-size: 20px; color: var(--text-light); }
.tc-done .tc-icon { color: var(--green); }
.tc-rdot { width: 6px; height: 6px; border-radius: 50%; margin-top: 3px; }
.tc-num { font-size: 10px; color: var(--text-light); margin-bottom: 2px; letter-spacing: .04em; }
.tc-title { font-family: 'Cormorant Garamond', serif; font-size: 15px; color: var(--text); margin-bottom: 4px; line-height: 1.25; }
.tc-badge { font-size: 10px; padding: 2px 8px; border-radius: 99px; display: inline-block; margin-bottom: 4px; }
.tc-sub { font-size: 11px; color: var(--text-light); }
.tc-spec { position: absolute; top: 7px; right: 7px; font-size: 10px; font-weight: 500; padding: 2px 6px; border-radius: 99px; }
.sp-w { background: #F9EFED; color: var(--pink); }
.sp-d { background: #FDF3E7; color: var(--amber); }

/* MODAL */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(44,36,22,.45); z-index: 100; align-items: flex-end; justify-content: center; padding: 0; }
.modal-overlay.open { display: flex; }
.modal { background: var(--bg); border-radius: 20px 20px 0 0; padding: 1.5rem; width: 100%; max-width: 540px; max-height: 88vh; overflow-y: auto; animation: slideup .3s ease; }
@keyframes slideup { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-drag { width: 36px; height: 4px; background: var(--border); border-radius: 99px; margin: 0 auto 1.25rem; }
.modal-route-tag { display: flex; align-items: center; gap: 6px; margin-bottom: 1rem; }
.mrt-dot { width: 7px; height: 7px; border-radius: 50%; }
.mrt-lbl { font-size: 11px; color: var(--text-light); }
.modal-title { font-family: 'Cormorant Garamond', serif; font-size: 26px; font-weight: 400; color: var(--text); margin-bottom: .875rem; line-height: 1.2; }
.modal-story { padding: .875rem 1rem; margin-bottom: .875rem; font-size: 13px; color: var(--text-mid); line-height: 1.65; border-left: 3px solid var(--accent-light); background: var(--bg-card); font-style: italic; }
.modal-story.sw { border-left-color: var(--pink); }
.modal-story.sd { border-left-color: var(--amber); }
.modal-desc { font-size: 14px; color: var(--text-mid); line-height: 1.75; margin-bottom: 1rem; }
.unlock-note { font-size: 12px; color: var(--text-light); padding: .5rem .875rem; background: var(--bg-card); border-radius: 7px; margin-bottom: 1rem; display: flex; align-items: center; gap: 6px; }
.tasks-lbl { font-size: 10px; color: var(--text-light); letter-spacing: .07em; text-transform: uppercase; margin-bottom: .625rem; }
.tasks-list { display: flex; flex-direction: column; gap: 7px; margin-bottom: 1rem; }
.task-item { display: flex; gap: 10px; align-items: flex-start; padding: .75rem .875rem; background: var(--bg-card); border-radius: 8px; cursor: pointer; transition: background .15s; }
.task-item:hover { background: var(--bg-surface); }
.task-item.task-done { background: #EAF3EA; }
.task-check { width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid var(--border); flex-shrink: 0; margin-top: 1px; display: flex; align-items: center; justify-content: center; transition: all .15s; background: var(--bg); }
.task-check.checked { background: var(--green); border-color: var(--green); }
.task-check.checked i { color: #fff; font-size: 12px; }
.task-item.task-done .task-text { color: var(--text-light); text-decoration: line-through; text-decoration-color: var(--border); }
.tdiff { font-size: 10px; padding: 2px 8px; border-radius: 99px; flex-shrink: 0; margin-top: 2px; }
.td-e { background: #EAF3EA; color: #3A6B3D; }
.td-m { background: #FDF3E7; color: #8B6120; }
.td-h { background: #F9EFED; color: #8B4A3C; }
.task-text { font-size: 13px; color: var(--text); line-height: 1.5; }
.ach-box { background: var(--bg-card); border-radius: 8px; padding: .625rem 1rem; margin-bottom: 1rem; display: flex; align-items: center; gap: 10px; }
.ach-box.ach-reached { background: #EAF3EA; }
.complete-banner { display: none; align-items: center; gap: 8px; background: #EAF3EA; color: #3A6B3D; border-radius: 8px; padding: .625rem 1rem; margin-bottom: .875rem; font-size: 13px; font-weight: 500; }
.complete-banner.show { display: flex; }
.task-dots { display: flex; gap: 4px; margin-top: 4px; }
.task-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--border); }
.task-dot.done { background: var(--green); }
.ach-ic { font-size: 16px; color: var(--accent); }
.ach-title { font-size: 13px; font-weight: 500; color: var(--text); }
.ach-sub { font-size: 11px; color: var(--text-light); }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; }
.btn-modal-close { padding: 8px 16px; font-size: 13px; background: none; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; color: var(--text-mid); font-family: 'Inter', sans-serif; }
.btn-modal-done { padding: 8px 18px; font-size: 13px; background: var(--accent); border: none; border-radius: 8px; cursor: pointer; color: #FFF8F0; font-family: 'Inter', sans-serif; }
.btn-modal-done:disabled { opacity: .4; cursor: default; }
.btn-md-w { background: var(--pink); }
.btn-md-dv { background: var(--amber); }

@media (min-width: 600px) {
  .ob-screen { padding: 0 2.5rem 2rem; max-width: 480px; margin: 0 auto; width: 100%; }
  .app-stats { max-width: 540px; margin: 0 auto; }
  .routes-view, .grid-view { max-width: 540px; margin: 0 auto; }
  .t-grid { grid-template-columns: repeat(auto-fill, minmax(170px,1fr)); }
}

/* LOGIN */
#login-screen, #reset-screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 2rem; }
.login-card { width: 100%; max-width: 340px; text-align: center; }
.login-title { font-family: 'Cormorant Garamond', serif; font-size: 28px; color: var(--text); margin: .75rem 0 1.25rem; }
.login-error { font-size: 12px; color: #8B4A3C; background: #F9EFED; border-radius: 7px; padding: .5rem .75rem; margin-bottom: .875rem; display: none; }
.login-error.show { display: block; }
.login-info { font-size: 12px; color: #4A6B5C; background: #EDF5F1; border-radius: 7px; padding: .5rem .75rem; margin-bottom: .875rem; display: none; }
.login-info.show { display: block; }
.login-form { display: flex; flex-direction: column; gap: 8px; }
.login-input { font-family: 'Inter', sans-serif; font-size: 14px; padding: .75rem .875rem; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-card); color: var(--text); }
.login-input:focus { outline: none; border-color: var(--accent-light); }
.login-form .btn-next { justify-content: center; margin-top: 4px; width: 100%; }
.login-switch { margin-top: 1rem; background: none; border: none; font-size: 12px; color: var(--text-light); text-decoration: underline; cursor: pointer; font-family: 'Inter', sans-serif; }

body.observer-mode .task-item { cursor: default; }
body.observer-mode .task-check { opacity: .6; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); background: var(--text); color: var(--bg); font-size: 13px; padding: .625rem 1.125rem; border-radius: 99px; opacity: 0; pointer-events: none; transition: all .25s ease; z-index: 200; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
