:root {
    --brand: #0b5d57;
    --brand-2: #0e7a72;
    --brand-soft: #e3f2f0;
    --deal: #e8590c;
    --deal-soft: #fff1e6;
    --ink: #17212b;
    --muted: #6b7684;
    --line: #e7eaee;
    --bg: #f5f7f8;
    --card: #ffffff;
    --l0: #2f9e6e; --l1: #8cc98a; --l2: #e9d57a; --l3: #f2a65a; --l4: #e0664f;
    --bs-body-font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --bs-link-color: var(--brand-2);
    --bs-link-hover-color: var(--brand);
    --bs-link-color-rgb: 14, 122, 114;
}
body { background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased; }
body.has-tabbar { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
@media (min-width: 768px) { body.has-tabbar { padding-bottom: 0; } }
.wrap { max-width: 760px; margin: 0 auto; padding-left: 16px; padding-right: 16px; }
.min-w-0 { min-width: 0; }
.text-brand { color: var(--brand) !important; }
.bg-brand { background-color: var(--brand) !important; }
.text-deal { color: var(--deal) !important; }

/* top & tab bar */
.topbar { position: sticky; top: 0; z-index: 1020; background: rgba(255,255,255,.92); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.topbar .wrap { height: 56px; }
.brand { display: inline-flex; align-items: center; gap: .5rem; font-weight: 800; font-size: 1.15rem; color: var(--ink); text-decoration: none; letter-spacing: -.01em; }
.brand-mark { width: 30px; height: 30px; border-radius: 9px; background: var(--brand); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: .95rem; }
.toplink { padding: .4rem .7rem; border-radius: 8px; color: var(--muted); text-decoration: none; font-weight: 500; font-size: .95rem; }
.toplink:hover, .toplink.active { color: var(--ink); background: #eef1f3; }
.btn-icon { width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; color: var(--muted); font-size: 1.25rem; border: 0; background: transparent; }
.btn-icon.btn-sm { width: 34px; height: 34px; font-size: 1.05rem; }
.btn-icon:hover { background: #eef1f3; color: var(--ink); }
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030; display: flex; justify-content: space-around; align-items: center; background: #fff; border-top: 1px solid var(--line); padding: 6px 12px calc(6px + env(safe-area-inset-bottom)); }
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--muted); text-decoration: none; font-size: .72rem; font-weight: 600; padding: 4px 0; }
.tabbar a i { font-size: 1.3rem; }
.tabbar a.active { color: var(--brand); }
.tabbar .tab-add { flex: 0 0 auto; width: 54px; height: 54px; border-radius: 18px; background: var(--brand); color: #fff !important; justify-content: center; margin-top: -22px; box-shadow: 0 6px 18px rgba(11,93,87,.35); }
.tabbar .tab-add i { font-size: 1.5rem; }

/* buttons & badges */
.btn { border-radius: 12px; font-weight: 600; }
.btn-sm { border-radius: 10px; }
.btn-brand { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-brand:hover, .btn-brand:focus, .btn-brand:active { background: var(--brand-2) !important; border-color: var(--brand-2) !important; color: #fff !important; }
.btn-outline-brand { color: var(--brand); border-color: #b9d9d5; background: #fff; }
.btn-outline-brand:hover { background: var(--brand-soft); color: var(--brand); border-color: var(--brand); }
.btn-outline-secondary { background: #fff; border-color: var(--line); color: var(--ink); }
.btn-outline-secondary:hover { background: #eef1f3; border-color: #d5dae0; color: var(--ink); }
.text-bg-deal { background: var(--deal) !important; color: #fff !important; }
.text-bg-brand-soft { background: var(--brand-soft) !important; color: var(--brand) !important; }
.text-bg-success-soft { background: #e5f6ec !important; color: #1d7a46 !important; }
.text-bg-danger-soft { background: #fdeaea !important; color: #b42318 !important; }
.badge { font-weight: 600; }
.spinner-grow-sm { width: .6rem; height: .6rem; }
.flash { border-radius: 14px; border: 0; }

/* cards */
.card-soft { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 16px; box-shadow: 0 1px 2px rgba(16,24,40,.04); }
.back-link { display: inline-flex; align-items: center; gap: .2rem; color: var(--muted); text-decoration: none; font-size: .9rem; margin-bottom: .5rem; }
.empty { padding: 32px 20px; }
.empty-icon { width: 56px; height: 56px; border-radius: 18px; background: var(--brand-soft); color: var(--brand); display: inline-flex; align-items: center; justify-content: center; font-size: 1.6rem; margin-bottom: 12px; }

/* landing */
.hero { text-align: center; padding: 28px 0 24px; }
.hero h1 { font-size: clamp(2rem, 7vw, 3rem); font-weight: 800; letter-spacing: -.03em; line-height: 1.08; margin: 14px 0; }
.hero .lead { color: var(--muted); font-size: 1.08rem; max-width: 560px; margin: 0 auto 22px; }
.pill { display: inline-flex; align-items: center; gap: .35rem; background: var(--deal-soft); color: var(--deal); padding: .35rem .8rem; border-radius: 999px; font-size: .85rem; font-weight: 600; }
.story { margin: 8px 0 18px; }
.story-label { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; margin-bottom: 10px; }
.story-icon { width: 48px; height: 48px; border-radius: 14px; background: var(--brand-soft); color: var(--brand); display: flex; align-items: center; justify-content: center; font-size: 1.4rem; flex: 0 0 auto; }
.price-old { color: var(--muted); text-decoration: line-through; }
.price-new { font-size: 1.6rem; font-weight: 800; color: var(--deal); }
.steps { display: grid; gap: 10px; }
.step { display: flex; gap: 14px; align-items: flex-start; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; }
.step-n { width: 30px; height: 30px; border-radius: 10px; background: var(--brand); color: #fff; font-weight: 800; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.auth-card { max-width: 440px; margin: 12px auto; padding: 24px; }

/* watch list */
.watch-card { display: block; color: inherit; text-decoration: none; margin-bottom: 12px; transition: transform .1s ease, box-shadow .15s ease; }
.watch-card:hover { box-shadow: 0 6px 18px rgba(16,24,40,.08); color: inherit; }
.watch-card:active { transform: scale(.99); }
.watch-card.is-paused { opacity: .6; }
.watch-name { font-weight: 700; font-size: 1.05rem; line-height: 1.25; }
.watch-foot { display: flex; align-items: center; gap: 10px; border-top: 1px dashed var(--line); margin-top: 12px; padding-top: 10px; }

/* form */
.form-section { margin-bottom: 12px; }
.form-section-title { font-weight: 700; margin-bottom: 12px; display: flex; align-items: center; gap: .45rem; }
.form-section-title i { color: var(--brand); }
.form-control, .form-select, .input-group-text { border-radius: 12px; border-color: #dde2e7; }
.form-control-lg { border-radius: 14px; font-size: 1.05rem; }
.form-control:focus, .form-select:focus { border-color: var(--brand-2); box-shadow: 0 0 0 .2rem rgba(14,122,114,.15); }
.form-label { font-weight: 600; font-size: .9rem; margin-bottom: .35rem; }
.form-range::-webkit-slider-thumb { background: var(--brand); }
.form-range::-moz-range-thumb { background: var(--brand); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; padding: .45rem .85rem; border-radius: 999px; border: 1px solid #dde2e7; background: #fff; font-weight: 500; font-size: .92rem; cursor: pointer; user-select: none; }
.chip-sm { padding: .4rem 0; width: calc((100% - 36px) / 7); justify-content: center; }
.btn-check:checked + .chip { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-check:focus-visible + .chip { box-shadow: 0 0 0 .2rem rgba(14,122,114,.25); }
.stepper { display: flex; border: 1px solid #dde2e7; border-radius: 12px; overflow: hidden; background: #fff; }
.stepper .btn { border: 0; border-radius: 0; width: 44px; font-size: 1.2rem; color: var(--brand); }
.stepper .form-control { border: 0; border-radius: 0; font-weight: 700; -moz-appearance: textfield; }
.stepper .form-control::-webkit-inner-spin-button { -webkit-appearance: none; }
.estimate { background: var(--brand-soft); color: var(--brand); border-radius: 12px; padding: 10px 12px; font-size: .88rem; }
.estimate.warn { background: #fff4e5; color: #9a5b00; }
.sticky-submit { position: sticky; bottom: calc(76px + env(safe-area-inset-bottom)); padding: 10px 0; background: linear-gradient(to top, var(--bg) 70%, rgba(245,247,248,0)); z-index: 5; }
@media (min-width: 768px) { .sticky-submit { bottom: 0; } }

/* detail */
.filters-line { display: flex; flex-wrap: wrap; gap: 6px; font-size: .8rem; }
.filters-line span { background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: .2rem .6rem; color: var(--muted); }
.progress-card { margin-bottom: 12px; border-color: #b9d9d5; background: #f4fbfa; }
.action-row { display: flex; flex-wrap: wrap; gap: 8px; }
.seg { background: #e9edf0; border-radius: 12px; padding: 4px; display: flex; flex-wrap: nowrap; }
.seg .nav-item { flex: 1; }
.seg .nav-link { width: 100%; border: 0; border-radius: 9px; color: var(--muted); font-weight: 600; font-size: .92rem; padding: .5rem .3rem; background: transparent; }
.seg .nav-link.active { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(16,24,40,.12); }
.cnt { display: inline-block; min-width: 1.4em; padding: 0 .35em; border-radius: 999px; background: #dde3e8; font-size: .75rem; color: var(--muted); }
.cnt-deal { background: var(--deal); color: #fff; }
.best-row { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: transparent; padding: 8px 4px; border-bottom: 1px solid var(--line); text-align: left; color: inherit; }
.best-row:last-of-type { border-bottom: 0; }
.best-row:hover { background: #f6f8f9; }
.best-date { font-weight: 600; min-width: 74px; }
.down { color: #1d9a5b; }
.up { color: #d9480f; }
.legend { display: flex; align-items: center; gap: 4px; }
.legend .lg { width: 18px; height: 10px; border-radius: 3px; display: inline-block; }
.lg.l0, .cal-day.l0 { background: var(--l0); }
.lg.l1, .cal-day.l1 { background: var(--l1); }
.lg.l2, .cal-day.l2 { background: var(--l2); }
.lg.l3, .cal-day.l3 { background: var(--l3); }
.lg.l4, .cal-day.l4 { background: var(--l4); }
.cal { padding: 12px; }
.cal-title { font-weight: 700; text-transform: capitalize; margin: 2px 4px 10px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-dn { text-align: center; font-size: .72rem; color: var(--muted); font-weight: 600; padding-bottom: 2px; }
.cal-day { position: relative; aspect-ratio: 1 / 1.05; border-radius: 10px; border: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 0; color: #1b2a20; line-height: 1.05; }
button.cal-day:active { transform: scale(.95); }
.cal-day.l0, .cal-day.l4 { color: #fff; }
.cal-day.off { background: #f1f3f5; color: #b3bac2; }
.cal-day.off.pending { background: repeating-linear-gradient(45deg, #f1f3f5, #f1f3f5 4px, #e9ecef 4px, #e9ecef 8px); }
.cal-n { font-size: .68rem; opacity: .85; }
.cal-p { font-size: .9rem; font-weight: 800; letter-spacing: -.02em; }
.cal-t { position: absolute; top: 2px; right: 3px; font-size: .6rem; }
.cal-day.l0 .cal-t, .cal-day.l4 .cal-t { color: #fff; }
@media (min-width: 576px) { .cal-p { font-size: 1rem; } .cal-n { font-size: .75rem; } }
.hotel-row { display: flex; align-items: center; gap: 6px; padding: 10px; margin-bottom: 8px; }
.hotel-row.is-hidden { opacity: .55; }
.hotel-main { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; border: 0; background: transparent; padding: 0; color: inherit; }
.hotel-main img, .hotel-main .ph { width: 56px; height: 56px; border-radius: 12px; object-fit: cover; flex: 0 0 auto; background: #eef1f3; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 1.4rem; }
.deal { margin-bottom: 10px; border-left: 4px solid var(--deal); }
.deal-badge { background: var(--deal-soft); color: var(--deal); font-weight: 800; border-radius: 10px; padding: .35rem .5rem; font-size: .85rem; white-space: nowrap; }
.deal-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.sheet { height: auto !important; max-height: 82vh; border-radius: 20px 20px 0 0; }
.sheet .offcanvas-header { padding-bottom: 8px; }
.day-hotel { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.day-hotel:last-child { border-bottom: 0; }
.day-links { display: flex; gap: 14px; font-size: .82rem; font-weight: 600; margin-top: 2px; }
.day-links a { text-decoration: none; }
.day-hotel { align-items: flex-start; }
.day-hotel .rank { margin-top: 2px; width: 24px; height: 24px; border-radius: 8px; background: #eef1f3; font-size: .75rem; font-weight: 700; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.day-hotel:first-child .rank { background: var(--l0); color: #fff; }
.chart-box { position: relative; height: 190px; }
.modal-content { border-radius: 20px; border: 0; }
@media (max-width: 575.98px) { .modal-fullscreen-sm-down .modal-content { border-radius: 0; } }
