/* v19: two-resort itinerary, transfer risk and travel ledger. */
.guide-tabs {
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  overflow: visible;
}

.guide-tabs button {
  min-width: 0;
}

.guide-risk-grid .critical,
.guide-callout.transfer-critical {
  border-color: rgba(255, 82, 129, .3);
  background:
    linear-gradient(180deg, rgba(255,255,255,.82), rgba(255,255,255,.56)),
    linear-gradient(110deg, #ffe8f5, #fff1d9 55%, #e8faff);
}

.guide-callout.iru {
  background:
    linear-gradient(180deg, rgba(255,255,255,.78), rgba(255,255,255,.5)),
    linear-gradient(110deg, #e5fff1, #e7fbff 52%, #fff0fa);
}

.guide-callout.vilu {
  background:
    linear-gradient(180deg, rgba(255,255,255,.78), rgba(255,255,255,.5)),
    linear-gradient(110deg, #e8f9ff, #f0ecff 55%, #ffeaf6);
}

.guide-learn-cta {
  margin-top: 22px;
}

.trip-control-strip { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:8px; margin:12px 0 16px; }
.trip-control-strip button { min-width:0; min-height:68px; display:flex; align-items:center; gap:11px; padding:12px 15px; text-align:left; border:1px solid rgba(139,92,255,.12); border-radius:14px; background:rgba(255,255,255,.88); }
.trip-control-strip button > svg { width:22px; flex:0 0 22px; color:#9a54c4; }
.trip-control-strip span, .trip-control-strip b, .trip-control-strip small { display:block; min-width:0; }
.trip-control-strip b { overflow-wrap:anywhere; color:var(--ink); font-size:var(--type-body); }
.trip-control-strip small { margin-top:3px; color:var(--muted); font-size:var(--type-meta); }
.trip-control-strip .quick-ledger-btn { color:#fff; border-color:transparent; background:linear-gradient(110deg,#ff66aa,#9b80ef 60%,#39c9c5); }
.trip-control-strip .quick-ledger-btn > svg, .trip-control-strip .quick-ledger-btn b, .trip-control-strip .quick-ledger-btn small { color:#fff; }

.packing-hero { position:relative; display:grid; grid-template-columns:minmax(0,1fr) auto; gap:18px; padding:28px; overflow:hidden; border:1px solid rgba(255,255,255,.9); border-radius:20px; background:linear-gradient(110deg,#fff0f8,#eef0ff 55%,#e6fffa); }
.packing-hero span { color:#9a54c4; font-size:var(--type-meta); font-weight:900; }
.packing-hero h2 { margin:4px 0 6px; font-size:var(--type-section-title); }
.packing-hero p { margin:0; color:var(--ink-2); font-size:var(--type-body-small); line-height:1.6; }
.packing-hero > strong { color:#ff4f9b; font-size:38px; line-height:1; }
.packing-hero > strong small { color:var(--muted); font-size:13px; }
.packing-progress { grid-column:1/-1; height:8px; overflow:hidden; border-radius:8px; background:rgba(255,255,255,.7); }
.packing-progress span { height:100%; display:block; border-radius:8px; background:linear-gradient(90deg,#ff65a9,#9a7df0,#36c7c3); transition:width .2s ease; }
.packing-toolbar { display:flex; align-items:center; justify-content:space-between; gap:12px; margin:18px 0 12px; }
.packing-filters { display:flex; gap:6px; }
.packing-filters button { min-height:42px; padding:0 15px; color:var(--ink-2); border:1px solid var(--line); border-radius:42px; background:#fff; font-size:var(--type-button); font-weight:800; }
.packing-filters button.active { color:#fff; border-color:#9b80ef; background:#9b80ef; }
.packing-add { display:grid; grid-template-columns:minmax(200px,.7fr) minmax(0,1.3fr); gap:18px; align-items:center; padding:18px; border:1px solid var(--line); border-radius:16px; background:rgba(255,255,255,.78); }
.packing-add h3 { margin:0; font-size:var(--type-card-title); }
.packing-add p { margin:5px 0 0; color:var(--muted); font-size:var(--type-meta); line-height:1.5; }
.packing-add-form { display:grid; grid-template-columns:minmax(0,1fr) 132px auto; gap:8px; }
.packing-add-form input, .packing-add-form select { min-width:0; min-height:48px; padding:0 13px; color:var(--ink); border:1px solid rgba(139,92,255,.14); border-radius:12px; background:#fff; font-size:16px; }
.packing-add-form .primary-btn { min-height:48px; }
.packing-board { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; margin-top:14px; }
.packing-group { min-width:0; align-self:start; border:1px solid var(--line); border-radius:16px; background:rgba(255,255,255,.82); overflow:hidden; }
.packing-group > header { min-height:52px; display:flex; align-items:center; justify-content:space-between; gap:10px; padding:11px 14px; border-bottom:1px solid var(--line); background:rgba(248,246,255,.75); }
.packing-group > header > span { display:flex; align-items:center; gap:8px; }
.packing-group > header svg { width:17px; color:#9a54c4; }
.packing-group > header b { font-size:var(--type-body); }
.packing-group > header small { color:var(--muted); font-size:var(--type-meta); }
.packing-items { display:grid; }
.packing-item { min-width:0; display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:stretch; border-bottom:1px solid var(--line); }
.packing-item:last-child { border-bottom:0; }
.packing-item label { min-width:0; min-height:66px; display:grid; grid-template-columns:22px minmax(0,1fr) 18px; gap:10px; align-items:center; padding:10px 13px; cursor:pointer; }
.packing-item input { width:20px; height:20px; accent-color:#35bfa6; }
.packing-item label span, .packing-item label b, .packing-item label small { display:block; min-width:0; }
.packing-item label b { font-size:var(--type-body-small); overflow-wrap:anywhere; }
.packing-item label small { margin-top:3px; color:var(--muted); font-size:var(--type-meta); line-height:1.45; }
.packing-item label > svg { width:17px; color:transparent; }
.packing-item.done { background:rgba(222,250,241,.55); }
.packing-item.done label > svg { color:#24a77b; }
.packing-item.done label b { color:var(--muted); text-decoration:line-through; }
.packing-item > .icon-btn { align-self:center; margin-right:8px; }
.packing-empty { grid-column:1/-1; min-height:180px; display:grid; place-items:center; align-content:center; gap:8px; color:var(--muted); border:1px dashed var(--line); border-radius:16px; }
.packing-empty svg { width:32px; }

.credential-hero { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:24px; align-items:center; padding:26px; color:#fff; border:1px solid rgba(255,255,255,.12); border-radius:8px; background:#17284f; box-shadow:0 18px 40px rgba(23,40,79,.14); }
.credential-hero span, .credential-hero h2, .credential-hero p { display:block; }
.credential-hero > div > span { color:#65ddd5; font-size:var(--type-meta); font-weight:900; }
.credential-hero h2 { margin:5px 0 7px; color:#fff; font-size:var(--type-section-title); }
.credential-hero p { max-width:760px; margin:0; color:rgba(255,255,255,.72); font-size:var(--type-body-small); line-height:1.65; }
.credential-score { min-width:118px; text-align:center; }
.credential-score strong { display:block; color:#ffcf66; font-size:36px; line-height:1; }
.credential-score strong small { font-size:14px; }
.credential-score > span { margin-top:7px; color:rgba(255,255,255,.68); font-size:var(--type-meta); }
.credential-phone-guide { margin-top:14px; padding:18px 20px; border:1px solid rgba(82,109,170,.2); border-left:5px solid #526daa; border-radius:8px; background:#f5f8ff; }
.credential-phone-head { display:flex; align-items:center; gap:12px; }
.credential-phone-head > svg { width:27px; flex:0 0 27px; color:#526daa; }
.credential-phone-head span, .credential-phone-head b, .credential-phone-head small { display:block; min-width:0; }
.credential-phone-head b { color:#1d315f; font-size:var(--type-card-title); }
.credential-phone-head small { margin-top:4px; color:#64708b; font-size:var(--type-meta); line-height:1.45; }
.credential-phone-guide ol { counter-reset:phone-step; display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:8px; margin:16px 0 12px; padding:0; list-style:none; }
.credential-phone-guide li { counter-increment:phone-step; min-width:0; padding:12px; border:1px solid rgba(82,109,170,.14); border-radius:6px; background:#fff; }
.credential-phone-guide li::before { content:counter(phone-step); width:24px; height:24px; display:grid; place-items:center; margin-bottom:9px; color:#fff; border-radius:50%; background:#526daa; font-size:var(--type-caption); font-weight:900; }
.credential-phone-guide li b, .credential-phone-guide li span { display:block; overflow-wrap:anywhere; }
.credential-phone-guide li b { color:#263a68; font-size:var(--type-body-small); }
.credential-phone-guide li span { margin-top:5px; color:#64708b; font-size:var(--type-caption); line-height:1.5; }
.credential-phone-guide > p { display:flex; align-items:flex-start; gap:8px; margin:0; padding-top:11px; color:#495977; border-top:1px solid rgba(82,109,170,.14); font-size:var(--type-body-small); line-height:1.55; }
.credential-phone-guide > p > svg { width:18px; flex:0 0 18px; color:#2b8b71; }
.imuga-decision { display:grid; grid-template-columns:minmax(0,1.2fr) minmax(220px,.8fr); gap:14px 24px; align-items:center; margin-top:14px; padding:18px 20px; border:1px solid rgba(33,167,132,.25); border-left:5px solid #24a77b; border-radius:8px; background:#f1fff9; }
.imuga-decision > div { display:flex; align-items:center; gap:12px; }
.imuga-decision > div > svg { width:26px; flex:0 0 26px; color:#148166; }
.imuga-decision b, .imuga-decision small { display:block; }
.imuga-decision b { color:#173e36; font-size:var(--type-card-title); }
.imuga-decision small { margin-top:4px; color:#4c6d66; font-size:var(--type-meta); line-height:1.45; }
.imuga-decision ol { margin:0; padding-left:22px; color:#173e36; font-size:var(--type-body-small); font-weight:800; line-height:1.75; }
.imuga-decision > p { grid-column:1/-1; margin:0; padding-top:11px; color:#4c6d66; border-top:1px solid rgba(33,167,132,.18); font-size:var(--type-body-small); line-height:1.55; }
.trip-gap-section, .credential-section { margin-top:34px; }
.trip-gap-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:9px; }
.trip-gap-grid article { min-width:0; padding:15px; border:1px solid var(--line); border-radius:8px; background:#fff; }
.trip-gap-grid article.urgent { border-color:rgba(222,67,101,.24); background:#fff7f9; }
.trip-gap-grid article.watch { border-color:rgba(219,151,42,.28); background:#fffaf0; }
.trip-gap-grid article > span { display:inline-block; padding:4px 7px; color:#7a5c95; border-radius:4px; background:#f5effb; font-size:var(--type-caption); font-weight:900; }
.trip-gap-grid article.urgent > span { color:#b63554; background:#ffe9ef; }
.trip-gap-grid article.watch > span { color:#a26917; background:#fff0cf; }
.trip-gap-grid time { float:right; padding-top:4px; color:var(--muted); font-size:var(--type-caption); font-weight:800; }
.trip-gap-grid h3 { clear:both; margin:12px 0 6px; color:var(--ink); font-size:var(--type-card-title); }
.trip-gap-grid p { margin:0; color:var(--muted); font-size:var(--type-meta); line-height:1.58; }
.credential-groups { display:grid; gap:10px; }
.credential-group { border:1px solid var(--line); border-radius:8px; overflow:hidden; background:rgba(255,255,255,.84); }
.credential-group > summary { min-height:64px; display:grid; grid-template-columns:minmax(0,1fr) auto 18px; gap:12px; align-items:center; padding:12px 16px; cursor:pointer; list-style:none; }
.credential-group > summary::-webkit-details-marker { display:none; }
.credential-group > summary > span { min-width:0; display:grid; grid-template-columns:28px minmax(0,1fr); column-gap:9px; align-items:center; }
.credential-group > summary > span > svg { grid-row:1/3; width:22px; color:#7b5ab6; }
.credential-group > summary b, .credential-group > summary small { display:block; min-width:0; }
.credential-group > summary b { color:var(--ink); font-size:var(--type-card-title); }
.credential-group > summary small { margin-top:3px; color:var(--muted); font-size:var(--type-meta); }
.credential-group > summary em { color:#7b5ab6; font-size:var(--type-meta); font-style:normal; font-weight:900; white-space:nowrap; }
.credential-group > summary > svg { width:17px; transition:transform .2s ease; }
.credential-group[open] > summary { border-bottom:1px solid var(--line); }
.credential-group[open] > summary > svg { transform:rotate(180deg); }
.credential-list { display:grid; }
.credential-item { min-width:0; display:grid; grid-template-columns:38px minmax(0,1fr) auto; gap:12px; align-items:center; padding:14px 16px; border-bottom:1px solid var(--line); }
.credential-item:last-child { border-bottom:0; }
.credential-item.stored { background:rgba(235,255,247,.6); }
.credential-item.correction { background:rgba(255,249,235,.72); }
.credential-item-icon { width:38px; height:38px; display:grid; place-items:center; border-radius:50%; color:#76539b; background:#f3edfb; }
.credential-item.stored .credential-item-icon { color:#178366; background:#ddf8ed; }
.credential-item.correction .credential-item-icon { color:#b87417; background:#fff0cf; }
.credential-item-icon svg { width:19px; }
.credential-copy { min-width:0; }
.credential-copy > div { display:flex; flex-wrap:wrap; gap:7px 10px; align-items:center; }
.credential-copy > div > span { color:#7954a8; font-size:var(--type-caption); font-weight:900; }
.credential-item.stored .credential-copy > div > span { color:#178366; }
.credential-item.correction .credential-copy > div > span { color:#a36b1b; }
.credential-copy > div > small { color:var(--muted); font-size:var(--type-caption); }
.credential-copy h3 { margin:4px 0 5px; overflow-wrap:anywhere; color:var(--ink); font-size:var(--type-body); }
.credential-copy p { margin:2px 0 0; color:var(--muted); font-size:var(--type-meta); line-height:1.5; }
.credential-copy p b { color:var(--ink-2); }
.credential-copy em { display:block; margin-top:6px; overflow-wrap:anywhere; color:#178366; font-size:var(--type-caption); font-style:normal; font-weight:800; }
.credential-actions { display:flex; align-items:center; gap:6px; }
.credential-actions .primary-btn, .credential-actions .ghost-btn { min-height:42px; white-space:nowrap; }
.credential-file-input { position:absolute; width:1px; height:1px; overflow:hidden; opacity:0; pointer-events:none; }
.credential-storage-warning { display:flex; align-items:flex-start; gap:10px; margin-top:12px; padding:13px; color:#9b5c18; border:1px solid #f0c980; border-radius:8px; background:#fff8e7; }
.credential-storage-warning svg { width:18px; flex:0 0 18px; }
.credential-storage-warning p { margin:0; font-size:var(--type-body-small); line-height:1.5; }

.credential-viewer { position:fixed; inset:0; z-index:220; display:none; padding:16px; background:rgba(8,22,44,.84); }
.credential-viewer.open { display:flex; animation:fade .18s ease both; }
.credential-viewer-card { width:min(980px,100%); height:min(94vh,980px); display:grid; grid-template-rows:auto minmax(0,1fr) auto; margin:auto; overflow:hidden; border:1px solid rgba(255,255,255,.18); border-radius:10px; background:#f7faff; box-shadow:0 24px 80px rgba(4,18,45,.38); }
.credential-viewer-header { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; padding:17px 20px 14px; color:#fff; background:#17284f; }
.credential-viewer-heading { min-width:0; }
.credential-viewer-heading > span { display:block; color:#71ded5; font-size:var(--type-caption); font-weight:900; letter-spacing:.08em; }
.credential-viewer-heading h2 { margin:5px 0 4px; overflow-wrap:anywhere; color:#fff; font-size:var(--type-card-title); }
.credential-viewer-heading p { margin:0; color:rgba(255,255,255,.7); font-size:var(--type-meta); }
.credential-viewer-header .icon-btn { flex:0 0 auto; color:#fff; background:rgba(255,255,255,.1); }
.credential-viewer-body { min-height:0; overflow:auto; padding:18px; background:#e9eff8; overscroll-behavior:contain; }
.credential-viewer-image { display:block; width:auto; max-width:100%; height:auto; margin:0 auto; border-radius:5px; box-shadow:0 4px 18px rgba(18,35,64,.2); }
.credential-viewer-pages { display:grid; gap:16px; max-width:900px; margin:0 auto; }
.credential-viewer-page { display:block; width:100%; height:auto; border-radius:4px; background:#fff; box-shadow:0 4px 18px rgba(18,35,64,.2); }
.credential-viewer-frame { width:100%; height:100%; min-height:620px; border:0; background:#fff; }
.credential-viewer-footer { display:flex; justify-content:flex-end; gap:8px; padding:12px 16px; border-top:1px solid #d9e1ef; background:#fff; }
body.credential-viewer-open { overflow:hidden; }

.rescue-mode-tabs { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; margin:14px 0; padding:5px; border:1px solid var(--line); border-radius:8px; background:rgba(255,255,255,.78); }
.rescue-mode-tabs button { min-width:0; min-height:58px; display:flex; align-items:center; gap:10px; padding:10px 14px; color:var(--muted); border:0; border-radius:6px; background:transparent; text-align:left; }
.rescue-mode-tabs button.active { color:#fff; background:#263d70; box-shadow:0 8px 18px rgba(38,61,112,.16); }
.rescue-mode-tabs svg { width:21px; flex:0 0 21px; }
.rescue-mode-tabs span, .rescue-mode-tabs b, .rescue-mode-tabs small { display:block; min-width:0; }
.rescue-mode-tabs b { font-size:var(--type-body); }
.rescue-mode-tabs small { margin-top:3px; color:inherit; opacity:.75; font-size:var(--type-caption); }
.active-confirm-hero { display:flex; align-items:center; justify-content:space-between; gap:20px; margin-bottom:12px; padding:22px; color:#fff; border-radius:8px; background:#17284f; box-shadow:0 16px 34px rgba(23,40,79,.13); }
.active-confirm-hero span { color:#65ddd5; font-size:var(--type-caption); font-weight:900; }
.active-confirm-hero h2 { margin:5px 0 6px; color:#fff; font-size:var(--type-section-title); }
.active-confirm-hero p { max-width:720px; margin:0; color:rgba(255,255,255,.72); font-size:var(--type-body-small); line-height:1.55; }
.active-confirm-hero .primary-btn { flex:0 0 auto; color:#17284f; background:#65ddd5; }
.active-confirm-quick { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:7px; margin:0 0 12px; }
.active-confirm-quick button { min-height:44px; padding:8px 10px; color:#305069; border:1px solid rgba(47,153,142,.2); border-radius:6px; background:#edfffb; font-size:var(--type-button); font-weight:800; }
.confirmation-stage-chips { display:grid; grid-template-columns:repeat(6,minmax(0,1fr)); gap:7px; margin-bottom:16px; }
.confirmation-stage-chips .chip { min-width:0; min-height:42px; padding:7px 8px; white-space:normal; }
.active-confirm-group { margin:0 0 18px; }
.active-confirm-group > header { display:grid; grid-template-columns:auto minmax(0,1fr) auto; gap:12px; align-items:center; margin-bottom:8px; padding:12px 14px; border-left:4px solid #34b9a7; background:#f0fbf8; }
.active-confirm-group > header time { color:#178876; font-size:var(--type-body-small); font-weight:900; }
.active-confirm-group > header h2 { margin:0; color:var(--ink); font-size:var(--type-card-title); }
.active-confirm-group > header p { margin:3px 0 0; color:var(--muted); font-size:var(--type-caption); line-height:1.4; }
.active-confirm-group > header > span { color:#178876; font-size:var(--type-caption); font-weight:900; white-space:nowrap; }
.active-confirm-group > .rescue-list { gap:7px; }
.ledger-quick { display:flex; align-items:center; flex-wrap:wrap; gap:8px; margin-top:14px; padding:12px; border:1px solid var(--line); border-radius:14px; background:rgba(255,255,255,.78); }
.ledger-quick > span { margin-right:4px; color:var(--muted); font-size:var(--type-meta); font-weight:900; }
.ledger-quick button { min-height:42px; display:flex; align-items:center; gap:6px; padding:0 13px; color:#76539b; border:1px solid rgba(139,92,255,.12); border-radius:42px; background:#f8f2ff; font-size:var(--type-button); font-weight:800; }
.ledger-quick svg { width:16px; }
.ledger-pending { display:grid; grid-template-columns:1fr 1fr; gap:8px; margin-top:10px; }
.ledger-pending > div { min-width:0; display:grid; grid-template-columns:32px minmax(0,1fr) auto; gap:10px; align-items:center; padding:13px 14px; border:1px dashed rgba(239,140,50,.36); border-radius:14px; background:#fffaf3; }
.ledger-pending svg { width:20px; color:#ef8c32; }
.ledger-pending span, .ledger-pending b, .ledger-pending small { display:block; min-width:0; }
.ledger-pending b { font-size:var(--type-body-small); }
.ledger-pending small { margin-top:3px; color:var(--muted); font-size:var(--type-meta); line-height:1.4; }
.ledger-pending em { color:#d87520; font-size:var(--type-caption); font-style:normal; font-weight:900; white-space:nowrap; }

.ledger-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: 30px;
  border: 1px solid rgba(255,255,255,.9);
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.7), rgba(255,255,255,.34)),
    linear-gradient(105deg, #ffe6f5, #f1eaff 42%, #dff8ff 72%, #e3fff1);
  box-shadow: inset 0 2px 2px rgba(255,255,255,.8), 0 16px 40px rgba(94, 73, 150, .08);
}

.ledger-hero span,
.ledger-hero strong,
.ledger-hero p {
  display: block;
}

.ledger-hero span {
  color: #9a54c4;
  font-size: var(--type-meta);
  font-weight: 900;
}

.ledger-hero strong {
  margin-top: 4px;
  color: #ff4f9b;
  font-size: 42px;
  line-height: 1.15;
}

.ledger-hero p {
  margin: 7px 0 0;
  color: var(--ink-2);
  font-size: var(--type-body);
}

.ledger-summary,
.ledger-list-section {
  margin-top: 24px;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,.78);
}

.ledger-currency-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.ledger-currency-grid article {
  min-width: 0;
  padding: 18px;
  border: 1px solid rgba(139, 92, 255, .1);
  border-radius: 14px;
  background: linear-gradient(145deg, #fff, #fff5fb);
}

.ledger-currency-grid span,
.ledger-currency-grid b,
.ledger-currency-grid small {
  display: block;
}

.ledger-currency-grid span {
  color: #a052d2;
  font-size: var(--type-caption);
  font-weight: 900;
}

.ledger-currency-grid b {
  margin-top: 6px;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: var(--type-card-title);
}

.ledger-currency-grid small {
  margin-top: 4px;
  color: var(--muted);
  font-size: var(--type-meta);
}

.ledger-list {
  display: grid;
  gap: 10px;
}

.ledger-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  gap: 14px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.ledger-category {
  padding: 7px 10px;
  color: #9b4fbe;
  border-radius: 45px;
  background: #f7eaff;
  font-size: var(--type-caption);
  font-weight: 900;
  white-space: nowrap;
}

.ledger-item h3 {
  margin: 0;
  font-size: var(--type-body);
}

.ledger-item p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: var(--type-meta);
}

.ledger-item > strong {
  color: var(--ink);
  font-size: var(--type-body);
  text-align: right;
  white-space: nowrap;
}

.ledger-item > strong small {
  display: block;
  margin-top: 3px;
  color: #ef8c32;
  font-size: var(--type-caption);
}

.ledger-item > strong small.paid {
  color: #26a577;
}

.ledger-actions {
  display: flex;
  gap: 7px;
}

.ledger-actions .icon-btn {
  width: 44px;
  height: 44px;
  min-width: 44px;
  color: #875aba;
  background: #f5effc;
}

.ledger-actions .icon-btn.danger,
.danger-btn {
  color: #d83570;
  background: #fff0f5;
}

.danger-btn {
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid #ffc4d8;
  border-radius: 45px;
  font-size: var(--type-button);
  font-weight: 850;
}

.ledger-empty {
  min-height: 180px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  color: var(--muted);
}

.ledger-empty svg {
  width: 34px;
  height: 34px;
}

body.ledger-sheet-open {
  overflow: hidden;
}

body.ledger-sheet-open .bottom-nav {
  visibility: hidden;
  opacity: 0;
}

body.ledger-sheet-open .mobile-header {
  visibility:hidden;
  opacity:0;
}

.ledger-sheet {
  position: fixed;
  z-index: 230;
  inset: 0;
  display: grid;
  align-items: end;
  visibility: hidden;
  pointer-events: none;
}

.ledger-sheet.open {
  visibility: visible;
  pointer-events: auto;
}

.ledger-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  border-radius: 0;
  background: rgba(45, 34, 82, .34);
  backdrop-filter: blur(5px);
}

.ledger-panel {
  position: relative;
  width: min(720px, 100%);
  max-height: min(92dvh, 860px);
  margin: 0 auto;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  border: 1px solid rgba(255,255,255,.94);
  border-bottom: 0;
  border-radius: 28px 28px 0 0;
  background: #fffcff;
  box-shadow: 0 -22px 70px rgba(65, 43, 125, .2);
}

.ledger-handle {
  width: 48px;
  height: 5px;
  margin: 10px auto 2px;
  border-radius: 5px;
  background: #ddd7ea;
}

.ledger-panel header {
  padding: 10px 22px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid rgba(139,92,255,.1);
}

.ledger-panel header span {
  color: #a052d2;
  font-size: var(--type-caption);
  font-weight: 900;
}

.ledger-panel header h2 {
  margin: 2px 0 0;
  font-size: var(--type-section-title);
}

.ledger-form {
  min-height: 0;
  overflow-y: auto;
  padding: 18px 22px 24px;
  display: grid;
  gap: 16px;
}

.ledger-form label > span,
.ledger-form legend {
  display: block;
  margin-bottom: 7px;
  color: var(--ink);
  font-size: var(--type-body-small);
  font-weight: 850;
}

.ledger-form input,
.ledger-form textarea {
  width: 100%;
  min-height: 52px;
  padding: 12px 15px;
  color: var(--ink);
  border: 1px solid rgba(139,92,255,.14);
  border-radius: 16px;
  background: #fff;
  font-size: 16px;
}

.ledger-form textarea {
  min-height: 74px;
  resize: vertical;
}

.ledger-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.ledger-form fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.ledger-segmented {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.ledger-segmented button {
  min-height: 44px;
  padding: 0 15px;
  color: #65597b;
  border: 1px solid rgba(139,92,255,.12);
  border-radius: 45px;
  background: linear-gradient(180deg, #fff, #f7f3fc);
  font-size: var(--type-button);
  font-weight: 800;
}

.ledger-segmented button.active {
  color: #fff;
  border-color: rgba(255,255,255,.9);
  background:
    linear-gradient(180deg, rgba(255,255,255,.48), transparent 50%),
    linear-gradient(105deg, #ff75c7, #e77ee9 38%, #8ca4ff 70%, #6cded6);
  box-shadow: inset 0 2px 2px rgba(255,255,255,.8), inset 0 -5px 10px rgba(91,71,204,.1);
}

.ledger-panel footer {
  padding: 12px 22px calc(14px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(139,92,255,.1);
  background: rgba(255,255,255,.96);
}

.ledger-panel footer .primary-btn {
  width: 100%;
}

@media (max-width: 960px) {
  .guide-tabs {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 7px;
  }

  .guide-tabs button {
    min-height: 52px;
    padding: 8px 5px;
    font-size: var(--type-body-small);
  }

  .ledger-currency-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .credential-phone-guide ol { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .confirmation-stage-chips { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .packing-board { grid-template-columns:1fr; }
  .trip-gap-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
}

@media (max-width: 520px) {
  .guide-tabs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .guide-tabs button {
    min-height: 56px;
    padding: 8px 3px;
    font-size: 14px;
    white-space: normal;
  }

  .guide-tabs svg {
    width: 18px;
    height: 18px;
  }
  .trip-control-strip { grid-template-columns:1fr 1fr; }
  .trip-control-strip .quick-ledger-btn { grid-column:auto; }
  .credential-hero { grid-template-columns:1fr; padding:20px 16px; }
  .credential-score { text-align:left; }
  .credential-phone-guide { padding:16px; }
  .credential-phone-guide ol { grid-template-columns:1fr; }
  .rescue-mode-tabs button { min-height:54px; padding:8px 10px; }
  .active-confirm-hero { align-items:stretch; flex-direction:column; padding:18px 16px; }
  .active-confirm-hero .primary-btn { width:100%; }
  .active-confirm-quick { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .confirmation-stage-chips { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .active-confirm-group > header { grid-template-columns:1fr auto; }
  .active-confirm-group > header time { grid-column:1/-1; }
  .imuga-decision { grid-template-columns:1fr; padding:16px; }
  .imuga-decision > p { grid-column:auto; }
  .trip-gap-grid { grid-template-columns:1fr; }
  .credential-group > summary { grid-template-columns:minmax(0,1fr) 17px; padding:11px 12px; }
  .credential-group > summary em { grid-column:1; padding-left:37px; white-space:normal; }
  .credential-group > summary > svg { grid-column:2; grid-row:1/3; }
  .credential-item { grid-template-columns:34px minmax(0,1fr); padding:13px 11px; }
  .credential-item-icon { width:34px; height:34px; }
  .credential-actions { grid-column:2; flex-wrap:wrap; }
  .credential-actions .primary-btn, .credential-actions .ghost-btn { flex:1; }
  .credential-viewer { padding:0; }
  .credential-viewer-card { width:100%; height:100%; border:0; border-radius:0; }
  .credential-viewer-header { padding:14px 14px 12px; }
  .credential-viewer-body { padding:10px; }
  .credential-viewer-footer { padding:10px; padding-bottom:calc(10px + env(safe-area-inset-bottom)); }
  .credential-viewer-footer .ghost-btn, .credential-viewer-footer .primary-btn { flex:1; min-height:44px; }
  .packing-hero { padding:22px 17px; }
  .packing-hero > strong { font-size:31px; }
  .packing-toolbar { align-items:stretch; flex-direction:column; }
  .packing-filters, .packing-toolbar > .ghost-btn { width:100%; }
  .packing-filters button { flex:1; padding:0 6px; }
  .packing-add { grid-template-columns:1fr; }
  .packing-add-form { grid-template-columns:1fr; }
  .packing-add-form select { min-height:48px; }
  .ledger-pending { grid-template-columns:1fr; }

  .ledger-hero {
    align-items: stretch;
    flex-direction: column;
    padding: 22px 18px;
  }

  .ledger-hero strong {
    font-size: 38px;
  }

  .ledger-hero .primary-btn,
  .ledger-summary .ghost-btn {
    width: 100%;
  }

  .ledger-summary,
  .ledger-list-section {
    padding: 18px 14px;
  }

  .ledger-summary .section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .ledger-currency-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .ledger-currency-grid article {
    padding: 14px 12px;
  }

  .ledger-currency-grid b {
    font-size: 17px;
  }

  .ledger-item {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 10px;
  }

  .ledger-item > strong {
    grid-column: 2 / -1;
    grid-row: 2;
    text-align: left;
  }

  .ledger-actions {
    grid-column: 3;
    grid-row: 1 / 3;
    flex-direction: column;
  }

  .ledger-form-row {
    grid-template-columns: 1fr;
  }

  .ledger-panel header,
  .ledger-form,
  .ledger-panel footer {
    padding-right: 16px;
    padding-left: 16px;
  }
}

@media (max-width: 360px) {
  .guide-tabs {
    gap: 5px;
  }

  .guide-tabs button {
    min-height: 54px;
    font-size: 13px;
  }

  .ledger-currency-grid {
    grid-template-columns: 1fr;
  }

  .ledger-item {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .ledger-category {
    justify-self: start;
  }

  .ledger-item > div:nth-of-type(1) {
    grid-column: 1 / -1;
  }

  .ledger-actions {
    grid-column: 2;
    grid-row: 1 / 4;
  }
}

/* Travel-day home: itinerary and documents are the primary mobile workflow. */
.today-command {
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:24px;
  padding:26px;
  color:#fff;
  border-radius:8px;
  background:#14233f;
  box-shadow:0 18px 40px rgba(20,35,63,.15);
}

.today-command-copy > span,
.today-section-head span,
.tomorrow-preview > span {
  color:#52d5c8;
  font-size:var(--type-meta);
  font-weight:900;
}

.today-command h1 { margin:6px 0 7px; color:#fff; font-size:var(--type-page-title); }
.today-command p { max-width:680px; margin:0; color:rgba(255,255,255,.72); line-height:1.6; }
.today-command-actions { display:flex; gap:8px; flex-wrap:wrap; }
.today-command-actions .ghost-btn { color:#fff; border-color:rgba(255,255,255,.25); background:transparent; }
.today-command-actions .icon-btn { color:#fff; border-color:rgba(255,255,255,.25); background:rgba(255,255,255,.08); }

.today-layout { display:grid; grid-template-columns:minmax(0,1fr) minmax(300px,360px); gap:16px; margin-top:16px; align-items:start; }
.today-board,
.today-credential-panel,
.tomorrow-preview,
.home-support-strip { border:1px solid var(--line); border-radius:8px; background:#fff; }
.today-board { padding:20px; }
.today-section-head { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:12px; }
.today-section-head h2 { margin:2px 0 0; font-size:var(--type-section-title); }
.today-section-head em { color:var(--muted); font-size:var(--type-meta); font-style:normal; }
.today-itinerary { border-top:1px solid var(--line); }
.today-itinerary-row { display:grid; grid-template-columns:38px minmax(0,1fr); gap:12px; padding:18px 0; border-bottom:1px solid var(--line); }
.today-itinerary-row:last-child { border-bottom:0; }
.today-sequence { width:32px; height:32px; display:grid; place-items:center; color:#fff; border-radius:50%; background:#1a6f78; font-size:var(--type-caption); font-weight:900; }
.today-itinerary-main { min-width:0; }
.today-itinerary-meta { display:flex; align-items:center; gap:9px; flex-wrap:wrap; }
.today-itinerary-meta span { color:#b33b57; font-size:var(--type-meta); font-weight:900; }
.today-itinerary-meta time { color:var(--muted); font-size:var(--type-meta); font-weight:800; }
.today-itinerary-main > h2 { margin:5px 0 9px; font-size:var(--type-card-title); }
.today-itinerary-main > p { margin:9px 0; color:var(--muted); font-size:var(--type-body-small); line-height:1.6; }
.today-action { display:flex; align-items:flex-start; gap:8px; padding:10px 12px; color:#5d3c26; border-left:3px solid #e79a45; background:#fff8ed; font-size:var(--type-body-small); line-height:1.55; }
.today-action svg { width:17px; flex:0 0 17px; margin-top:2px; color:#bc6b22; }
.today-itinerary .timeline-legs { margin:8px 0; }
.today-itinerary .timeline-leg { border-radius:6px; }

.today-side { display:grid; gap:16px; }
.today-credential-panel,
.tomorrow-preview { padding:18px; }
.today-credential-panel { scroll-margin-top:78px; }
.today-credential-list { display:grid; gap:8px; }
.today-credential { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:10px; align-items:center; padding:11px; border:1px solid var(--line); border-radius:6px; background:#fafbfd; }
.today-credential.stored { border-color:rgba(31,143,110,.28); background:#f2fcf8; }
.today-credential span { color:#92511a; font-size:var(--type-caption); font-weight:900; }
.today-credential h3 { margin:3px 0; font-size:var(--type-body-small); }
.today-credential p,
.today-empty { margin:0; color:var(--muted); font-size:var(--type-caption); line-height:1.45; }
.today-credential .primary-btn,
.today-credential .ghost-btn { min-height:38px; padding:0 10px; white-space:nowrap; }
.text-link { display:flex; align-items:center; gap:6px; margin-top:12px; padding:0; color:#1a6f78; border:0; background:transparent; font-size:var(--type-body-small); font-weight:900; }
.text-link svg { width:16px; }
.tomorrow-preview { border-left:4px solid #df6b72; }
.tomorrow-preview h2 { margin:5px 0 7px; font-size:var(--type-card-title); }
.tomorrow-preview p { margin:0; color:var(--muted); font-size:var(--type-body-small); line-height:1.55; }
.home-support-strip { display:flex; align-items:center; justify-content:space-between; gap:16px; margin-top:16px; padding:14px 16px; }
.home-support-strip > div { display:flex; align-items:center; gap:11px; }
.home-support-strip > div > svg { color:#526daa; }
.home-support-strip span,
.home-support-strip b,
.home-support-strip small { display:block; }
.home-support-strip small { margin-top:3px; color:var(--muted); font-size:var(--type-meta); }

.credential-bundle-import { display:flex; align-items:center; justify-content:space-between; gap:16px; margin-top:14px; padding:16px 18px; color:#fff; border-radius:8px; background:#1a6f78; }
.credential-bundle-import > div { display:flex; align-items:center; gap:12px; min-width:0; }
.credential-bundle-import > div > svg { flex:0 0 25px; }
.credential-bundle-import span,
.credential-bundle-import b,
.credential-bundle-import small { display:block; min-width:0; }
.credential-bundle-import small { margin-top:3px; color:rgba(255,255,255,.75); font-size:var(--type-meta); line-height:1.45; }
.credential-bundle-import .primary-btn { color:#184f55; background:#fff; white-space:nowrap; }
.credential-phone-guide > summary { cursor:pointer; list-style:none; }
.credential-phone-guide > summary::-webkit-details-marker { display:none; }
.credential-phone-head > svg:last-child { margin-left:auto; width:18px; transition:transform .2s ease; }
.credential-phone-guide[open] .credential-phone-head > svg:last-child { transform:rotate(180deg); }
.credential-owner { padding:2px 6px; color:#7d4a16 !important; border-radius:4px; background:#fff1d8; font-weight:900 !important; }

@media (max-width: 820px) {
  .today-command { align-items:stretch; flex-direction:column; padding:20px 17px; }
  .today-command-actions { display:grid; grid-template-columns:1fr 1fr 44px; }
  .today-layout { grid-template-columns:1fr; }
  .today-side { grid-template-columns:1fr 1fr; }
}

@media (max-width: 520px) {
  .today-command-actions { grid-template-columns:1fr 1fr 44px; }
  .today-command-actions .primary-btn,
  .today-command-actions .ghost-btn { padding:0 10px; }
  .today-board { padding:16px 13px; }
  .today-itinerary-row { grid-template-columns:30px minmax(0,1fr); gap:9px; padding:15px 0; }
  .today-sequence { width:28px; height:28px; }
  .today-itinerary .timeline-leg { grid-template-columns:1fr 20px 1fr; }
  .today-itinerary .timeline-leg-id,
  .today-itinerary .timeline-leg > small { grid-column:1/-1; }
  .today-side { grid-template-columns:1fr; }
  .home-support-strip { align-items:stretch; flex-direction:column; }
  .home-support-strip .ghost-btn { width:100%; }
  .credential-bundle-import { align-items:stretch; flex-direction:column; padding:16px; }
  .credential-bundle-import .primary-btn { width:100%; }

  .ledger-sheet { align-items:stretch; }
  .ledger-panel { width:100%; height:100dvh; max-height:100dvh; border:0; border-radius:0; grid-template-rows:auto minmax(0,1fr) auto; }
  .ledger-handle { display:none; }
  .ledger-panel header { padding-top:calc(12px + env(safe-area-inset-top)); background:#fffcff; }
  .ledger-form { overscroll-behavior:contain; -webkit-overflow-scrolling:touch; padding-bottom:28px; }
  .ledger-panel footer { padding-bottom:calc(12px + env(safe-area-inset-bottom)); }
}
