:root {
  --blue: #2B5B9C; --blue-d: #1E4475; --blue-l: #E8EFF8;
  --ink: #18202B; --ink2: #3A4552; --mute: #5A6472; --mute2: #6B7480;
  --red: #C8102E; --red-l: #FBE7EA; --green: #2E6B47; --green-l: #DCEFE3; --green-d: #1F5135;
  --gold-l: #FBEFD9; --gold: #7A4F05;
  --bg: #F4F5F7; --line: #E3E6EA; --line2: #D5DCE6; --card: #FFFFFF;
  --r: 14px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: 'Plus Jakarta Sans', system-ui, -apple-system, Segoe UI, sans-serif; font-size: 15px; -webkit-text-size-adjust: 100%; }
body.dark { background: #0B0D10; }
a { color: var(--blue); }
button, input, select, textarea { font-family: inherit; font-size: 16px; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; }
.hidden { display: none !important; }
.muted { color: var(--mute); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.b { font-weight: 800; }
.center { text-align: center; }
.row { display: flex; align-items: center; gap: 10px; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack-sm { display: flex; flex-direction: column; gap: 8px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.span2 { grid-column: span 2; }
.grow { flex: 1; min-width: 0; }
.eyebrow { font-size: 12px; font-weight: 800; letter-spacing: .08em; color: var(--mute); text-transform: uppercase; }
h1 { margin: 0; font-size: 24px; font-weight: 800; }
h2 { margin: 0; font-size: 20px; font-weight: 800; }

/* ---------- buttons & inputs ---------- */
.btn { height: 46px; padding: 0 16px; border-radius: 12px; border: none; font-weight: 800; font-size: 15px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: var(--blue); color: #fff; white-space: nowrap; }
.btn:hover { background: var(--blue-d); }
.btn:disabled { background: #9AA6B6; cursor: default; }
.btn-block { width: 100%; }
.btn-lg { height: 52px; font-size: 16px; border-radius: 14px; }
.btn-sm { height: 38px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn-line { background: #fff; color: var(--ink); border: 1.5px solid var(--line2); }
.btn-line:hover { background: #F7F8FA; }
.btn-blue-line { background: #fff; color: var(--blue); border: 1.5px solid var(--blue); }
.btn-blue-line:hover { background: var(--blue-l); }
.btn-red { background: #fff; color: var(--red); border: 1.5px solid var(--red); }
.btn-red:hover { background: var(--red-l); }
.btn-green { background: var(--green); }
.btn-green:hover { background: var(--green-d); }
.btn-ghost { background: transparent; color: var(--blue); }
.btn-ghost:hover { background: var(--blue-l); }
.btn-dark { background: rgba(255,255,255,.14); color: #fff; }
.btn-dark:hover { background: rgba(255,255,255,.22); }
.icon-btn { width: 44px; height: 44px; border-radius: 11px; border: 1px solid var(--line2); background: #fff; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.icon-btn:hover { background: #F7F8FA; }
.icon-btn.ok { background: var(--green); border: none; color: #fff; }
.icon-btn.ok:disabled { background: #9AA6B6; }
.icon-btn.no { border: 1.5px solid #E8B9C0; color: var(--red); }
.link { background: none; border: none; color: var(--blue); font-weight: 800; padding: 0; font-size: inherit; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field > label, .lbl { font-size: 13px; font-weight: 700; color: var(--ink2); }
.input { height: 48px; border-radius: 11px; border: 1.5px solid var(--line2); padding: 0 12px; background: #fff; width: 100%; min-width: 0; }
textarea.input { height: auto; min-height: 84px; padding: 10px 12px; resize: vertical; }
.input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(43,91,156,.15); }
.input.good { border-color: var(--green); }
.input.bad { border-color: var(--red); }
.hint { font-size: 12px; color: var(--mute); }
.hint.good { color: var(--green); font-weight: 700; }
.hint.bad { color: var(--red); font-weight: 700; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.4; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 1px 0 0; flex: none; accent-color: var(--blue); }
.seg { display: flex; background: #EEF0F3; border-radius: 12px; padding: 3px; }
.seg button { flex: 1; height: 36px; padding: 0 14px; border-radius: 9px; border: none; background: transparent; font-weight: 800; font-size: 13px; color: var(--mute); }
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
.chip { height: 34px; padding: 0 12px; border-radius: 17px; border: 1px solid var(--line2); background: #fff; font-size: 13px; font-weight: 700; color: var(--ink2); white-space: nowrap; }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.search { position: relative; }
.search svg { position: absolute; left: 12px; top: 14px; color: var(--mute2); }
.search .input { padding-left: 40px; }

/* ---------- tags ---------- */
.tag { display: inline-flex; align-items: center; font-size: 11px; font-weight: 800; padding: 3px 8px; border-radius: 10px; white-space: nowrap; letter-spacing: .02em; }
.tag-gold { background: var(--gold-l); color: var(--gold); }
.tag-green { background: var(--green-l); color: var(--green-d); }
.tag-blue { background: var(--blue-l); color: var(--blue-d); }
.tag-red { background: var(--red-l); color: var(--red); }
.tag-grey { background: #EEF0F3; color: var(--ink2); }
.badge { min-width: 18px; height: 18px; border-radius: 9px; background: var(--red); color: #fff; font-size: 11px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; padding: 0 5px; }

/* ---------- cards ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px; }
.card-tight { padding: 0; overflow: hidden; }
.note { border-radius: 12px; padding: 12px 14px; font-size: 14px; line-height: 1.5; }
.note-blue { background: var(--blue-l); color: #1E3A5F; }
.note-gold { background: var(--gold-l); color: #6A4304; }
.note-grey { background: var(--bg); color: var(--ink2); }
.note-red { background: var(--red-l); color: #8A0B20; }
.av { width: 42px; height: 42px; border-radius: 50%; background: #C98A1A; color: #fff; font-weight: 800; font-size: 14px; display: inline-flex; align-items: center; justify-content: center; flex: none; overflow: hidden; }
.av img { width: 100%; height: 100%; object-fit: cover; }
.av-sm { width: 34px; height: 34px; font-size: 12px; }
.av-lg { width: 84px; height: 84px; font-size: 26px; }

/* ---------- app shell ---------- */
.app { min-height: 100vh; display: flex; flex-direction: column; }
.topbar { height: 64px; flex: none; padding: 0 16px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: #fff; position: sticky; top: 0; z-index: 20; }
.topbar img { height: 40px; width: auto; display: block; }
.main { flex: 1; width: 100%; max-width: 760px; margin: 0 auto; padding: 0 0 calc(96px + var(--safe-b)); }
.band { background: #fff; border-bottom: 1px solid var(--line); padding: 14px 16px 12px; display: flex; flex-direction: column; gap: 10px; }
.pad { padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); border-top: 1px solid var(--line); background: #fff; padding: 6px 4px calc(8px + var(--safe-b)); }
.tabbar a { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; font-weight: 700; color: var(--mute2); min-height: 52px; justify-content: center; text-decoration: none; position: relative; }
.tabbar a.on { color: var(--blue); font-weight: 800; }
.tabbar .badge { position: absolute; top: 2px; left: 54%; }
.sidebar { display: none; }

/* desktop */
@media (min-width: 1000px) {
  .app { flex-direction: row; }
  .tabbar, .topbar .tb-logo { display: none; }
  .sidebar { display: flex; flex-direction: column; gap: 4px; width: 236px; flex: none; background: #fff; border-right: 1px solid var(--line); padding: 18px 14px; position: sticky; top: 0; height: 100vh; }
  .sidebar img { height: 46px; width: auto; align-self: flex-start; margin: 0 6px 18px; }
  .sidebar .btn { margin-bottom: 14px; }
  .sidebar a { height: 44px; border-radius: 10px; padding: 0 12px; display: flex; align-items: center; justify-content: space-between; color: var(--ink2); font-weight: 700; text-decoration: none; }
  .sidebar a:hover { background: var(--bg); }
  .sidebar a.on { background: var(--blue-l); color: var(--blue-d); font-weight: 800; }
  .sidebar .who { margin-top: auto; display: flex; gap: 10px; align-items: center; padding: 10px 6px 0; border-top: 1px solid var(--line); font-size: 13px; }
  .appcol { flex: 1; min-width: 0; display: flex; flex-direction: column; }
  .topbar { display: none; }
  .main { padding-bottom: 40px; max-width: 900px; }
  .main.wide { max-width: none; padding: 0; }
}
.appcol { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* ---------- flight cards ---------- */
.day-h { font-size: 12px; font-weight: 800; letter-spacing: .08em; color: var(--mute); padding: 6px 2px 0; text-transform: uppercase; }
.fcard { display: flex; gap: 12px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; text-align: left; width: 100%; color: inherit; }
.fcard:hover { border-color: var(--line2); background: #FBFCFD; }
.fcard.sel { border-color: var(--blue); box-shadow: 0 0 0 2px var(--blue-l); }
.fcard .bar { width: 4px; align-self: stretch; border-radius: 2px; background: var(--blue); flex: none; }
.fcard .bar.full { background: var(--red); }
.fcard .bar.past { background: #B8C0CA; }
.fcard .bar.mine { background: var(--green); }
.fcard .bar.req { background: #E0A526; }
.fcard .t { width: 70px; flex: none; }
.fcard .t b { display: block; font-size: 15px; }
.fcard .t span { font-size: 11px; font-weight: 700; color: var(--mute); }
.fcard .route { font-size: 18px; font-weight: 800; letter-spacing: .01em; }
.fcard .sub { font-size: 12px; color: var(--mute); margin-bottom: 3px; }
.fcard .seat { text-align: right; flex: none; }
.fcard .seat b { font-size: 17px; display: block; }
.fcard .seat span { font-size: 10px; font-weight: 800; color: var(--mute); }
.fcard input[type=checkbox] { width: 22px; height: 22px; accent-color: var(--blue); flex: none; }
.empty { text-align: center; color: var(--mute); padding: 26px 10px; font-size: 14px; }

/* month grid */
.mgrid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.mgrid .dow { font-size: 10px; font-weight: 700; color: var(--mute); text-align: center; padding-bottom: 2px; }
.mcell { min-height: 58px; border-radius: 9px; border: 1px solid var(--line); background: #fff; padding: 3px; display: flex; flex-direction: column; gap: 2px; text-align: left; overflow: hidden; color: inherit; }
.mcell .n { font-size: 11px; font-weight: 700; }
.mcell.out { background: #FAFBFC; border-style: dashed; color: #C0C6CE; }
.mcell.past { background: #F7F8F9; color: #9AA2AD; }
.mcell.today { border: 1.5px solid var(--blue); }
.mcell.today .n { color: var(--blue); }
.mcell.sel { border: 2px solid var(--blue); background: var(--blue-l); }
.pill { height: 15px; border-radius: 4px; background: var(--blue); color: #fff; font-size: 9px; font-weight: 800; display: flex; align-items: center; justify-content: center; gap: 2px; white-space: nowrap; overflow: hidden; }
.pill.full { background: var(--red); } .pill.past { background: #B8C0CA; } .pill.mine { background: var(--green); } .pill.req { background: #E0A526; }
.pill .dot { width: 6px; height: 6px; border-radius: 3px; background: #F2B630; flex: none; }
.pill .rest { opacity: .85; font-weight: 700; flex: none; }
.pill > span:first-child { overflow: hidden; text-overflow: ellipsis; }
@media (min-width: 1000px) {
  .mcell { min-height: 112px; padding: 6px; gap: 4px; }
  .mcell .n { font-size: 12px; }
  .pill { height: auto; font-size: 11px; font-weight: 700; padding: 3px 6px; justify-content: space-between; border-radius: 6px; }
  .pill .dot { width: 7px; height: 7px; }
}
.cal-split { display: flex; min-height: 100vh; }
.cal-split .cal-main { flex: 1; min-width: 0; padding: 22px 24px; display: flex; flex-direction: column; gap: 14px; }
.cal-split .cal-panel { width: 410px; flex: none; background: #fff; border-left: 1px solid var(--line); position: sticky; top: 0; height: 100vh; overflow: auto; }

/* flight detail */
.fhead { background: var(--ink); color: #fff; padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; }
.fhead .back { border: none; background: none; color: #C9D6E8; font-weight: 700; font-size: 14px; display: inline-flex; align-items: center; gap: 4px; padding: 0; min-height: 36px; }
.fhead .meta { font-size: 13px; font-weight: 600; color: #C9D6E8; }
.fhead .big { font-size: 30px; font-weight: 800; letter-spacing: .02em; }
.fhead .times { font-size: 14px; color: #DDE3EA; }
.stat { background: rgba(255,255,255,.1); border-radius: 12px; padding: 10px; }
.stat .k { font-size: 11px; font-weight: 700; color: #C9D6E8; }
.stat .v { font-size: 20px; font-weight: 800; }
.ftabs { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 64px; z-index: 5; }
@media (min-width: 1000px) { .ftabs { top: 0; } }
.ftabs button { height: 50px; border: none; background: none; font-weight: 700; font-size: 14px; color: var(--mute2); border-bottom: 3px solid transparent; }
.ftabs button.on { font-weight: 800; color: var(--ink); border-bottom-color: var(--blue); }
.req { display: flex; flex-direction: column; gap: 10px; }
.req-top { display: flex; gap: 12px; align-items: flex-start; }
.req .nm { font-size: 16px; font-weight: 800; }
.req .w { font-size: 12px; font-weight: 600; color: var(--ink2); }
.prow { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; width: 100%; text-align: left; color: inherit; }
.prow:hover { border-color: var(--line2); }
.prow .r { text-align: right; font-size: 12px; color: var(--ink2); flex: none; }
.prow .r b { font-size: 14px; color: var(--ink); }
.guest { margin-left: 46px; font-size: 12px; color: var(--mute); }
.load { background: var(--bg); border-radius: 12px; padding: 12px 14px; display: flex; justify-content: space-between; font-size: 14px; }

/* request inbox group */
.grp-h { background: var(--ink); color: #fff; padding: 12px 14px; display: flex; justify-content: space-between; align-items: center; }
.grp-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px 10px 14px; border-top: 1px solid #EEF0F3; }
.grp-open { width: 100%; height: 44px; border: none; border-top: 1px solid #EEF0F3; background: #F7F8FA; font-weight: 800; font-size: 13px; color: var(--blue); }

/* trip hero */
.hero { position: relative; border-radius: 20px; overflow: hidden; background: #2A3038; color: #fff; text-align: left; border: none; width: 100%; padding: 0; }
.hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 46%; }
.hero .shade { position: absolute; inset: 0; background: rgba(10,14,20,.62); }
.hero .in { position: relative; padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.hero .rt { font-size: 36px; font-weight: 800; letter-spacing: .02em; }
.hero .box { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; background: rgba(255,255,255,.96); color: var(--ink); border-radius: 14px; padding: 12px 14px; }
.hero .box .k { font-size: 11px; font-weight: 600; color: var(--mute); }
.hero .box .v { font-size: 18px; font-weight: 800; }
.kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.kv .k { font-size: 12px; font-weight: 600; color: var(--mute); }
.kv .v { font-size: 17px; font-weight: 800; }

/* person list */
.plist { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.plist button { display: flex; gap: 12px; align-items: center; padding: 11px 14px; border: none; border-top: 1px solid #EEF0F3; background: #fff; text-align: left; color: inherit; width: 100%; }
.plist button:first-child { border-top: none; }
.plist button:hover { background: #FAFBFC; }

/* ---------- auth screens ---------- */
.auth { min-height: 100vh; background: #0B0D10; display: flex; flex-direction: column; align-items: center; padding: 34px 18px 40px; gap: 20px; }
.auth > img { height: 64px; width: auto; }
.auth .card { width: 100%; max-width: 430px; border-radius: 22px; padding: 22px 20px; border: none; }
.auth .side { width: 100%; max-width: 430px; background: #1A1F26; border-radius: 16px; padding: 14px 16px; color: #DDE3EA; font-size: 13px; line-height: 1.5; }
.auth .side b { color: #fff; }
@media (min-width: 900px) { .auth { justify-content: center; } }
.photo-pick { display: flex; align-items: center; gap: 14px; background: none; border: none; padding: 0; text-align: left; }
.photo-pick .ph { width: 64px; height: 64px; border-radius: 50%; border: 2px dashed #B8C0CA; background: var(--bg); display: flex; align-items: center; justify-content: center; overflow: hidden; flex: none; }
.photo-pick .ph img { width: 100%; height: 100%; object-fit: cover; }
.code-input { letter-spacing: .4em; font-size: 24px; font-weight: 800; text-align: center; height: 58px; }

/* ---------- modal sheet ---------- */
.overlay { position: fixed; inset: 0; z-index: 100; background: rgba(12,16,22,.55); display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: #fff; width: 100%; max-width: 560px; max-height: 92vh; overflow: auto; border-radius: 22px 22px 0 0; padding: 18px 18px calc(22px + var(--safe-b)); display: flex; flex-direction: column; gap: 14px; animation: up .18s ease-out; }
@media (min-width: 700px) { .overlay { align-items: center; } .sheet { border-radius: 22px; } }
@keyframes up { from { transform: translateY(30px); opacity: .5; } to { transform: none; opacity: 1; } }
.x-btn { width: 40px; height: 40px; border-radius: 10px; border: none; background: var(--bg); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.toast { position: fixed; left: 50%; bottom: calc(90px + var(--safe-b)); transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; font-weight: 700; font-size: 14px; z-index: 200; max-width: calc(100% - 32px); box-shadow: 0 6px 20px rgba(0,0,0,.25); }
.toast.err { background: var(--red); }
.spin { width: 28px; height: 28px; border: 3px solid var(--line2); border-top-color: var(--blue); border-radius: 50%; animation: sp .8s linear infinite; margin: 40px auto; }
@keyframes sp { to { transform: rotate(360deg); } }
.busy { opacity: .6; pointer-events: none; }
.selbar { position: fixed; left: 0; right: 0; bottom: calc(66px + var(--safe-b)); z-index: 25; background: var(--ink); color: #fff; padding: 10px 14px; display: flex; gap: 8px; align-items: center; }
@media (min-width: 1000px) { .selbar { left: 236px; bottom: 0; } }
.guest-box { background: var(--bg); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
