/* ═══════════════════════════════════════════════════════════
   TRIPS — styles.css
   Token structure follows TrigPoint; teal accent (Groundwork base); high
   contrast for outdoor use; 48px minimum touch targets.
   ═══════════════════════════════════════════════════════════ */

:root, [data-theme="light"] {
  --bg: #F5F7F8; --bg-surface: #FFFFFF; --bg-elevated: #FFFFFF; --bg-hover: #E8EDEF; --bg-nav: #FFFFFF;
  --border: #C9D1D5; --border-subtle: #E1E6E9;
  --text: #111111; --text-secondary: #3D3D36; --text-muted: #5E5E55;
  --accent: #1F5F74; --accent-hover: #174A5A; --accent-glow: rgba(31,95,116,0.12); --accent-text: #FFFFFF;
  --danger: #B3261E; --danger-bg: rgba(179,38,30,0.09);
  --success: #2E7D32; --success-bg: rgba(46,125,50,0.1);
  --amber: #8A5300; --amber-bg: #FFF1D6; --amber-border: #E0A43A;
  --info: #1F4E99; --info-bg: rgba(31,78,153,0.09);
  --chart-line: #557514;
  --toast-bg: #111111; --toast-text: #FFFFFF;
  --modal-overlay: rgba(0,0,0,0.5);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08); --shadow-md: 0 4px 12px rgba(0,0,0,0.1); --shadow-lg: 0 8px 24px rgba(0,0,0,0.14);
}

[data-theme="dark"] {
  --bg: #0C0F10; --bg-surface: #171C1E; --bg-elevated: #1F2629; --bg-hover: #283135; --bg-nav: #121719;
  --border: #36424A; --border-subtle: #283135;
  --text: #F2F2EC; --text-secondary: #C9CABF; --text-muted: #9C9E92;
  --accent: #7EC4D8; --accent-hover: #9BD3E3; --accent-glow: rgba(126,196,216,0.16); --accent-text: #0A1A20;
  --danger: #FF6B5E; --danger-bg: rgba(255,107,94,0.13);
  --success: #6CC070; --success-bg: rgba(108,192,112,0.14);
  --amber: #FFC061; --amber-bg: rgba(255,192,97,0.13); --amber-border: #A87628;
  --info: #8AB4F8; --info-bg: rgba(138,180,248,0.13);
  --chart-line: #7F9E4C;
  --toast-bg: #F2F2EC; --toast-text: #111111;
  --modal-overlay: rgba(0,0,0,0.72);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3); --shadow-md: 0 4px 12px rgba(0,0,0,0.4); --shadow-lg: 0 8px 24px rgba(0,0,0,0.5);
}

:root {
  --radius: 10px; --radius-lg: 14px; --transition: 150ms ease;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: 'SF Mono', 'Monaco', 'Consolas', monospace;
  --tap: 48px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font); background: var(--bg); color: var(--text);
  min-height: 100vh; line-height: 1.45; -webkit-font-smoothing: antialiased;
  font-size: 16px;
  padding-bottom: calc(env(safe-area-inset-bottom) + 48px);
  overflow-x: hidden;
}
body.no-scroll { overflow: hidden; }
button, input, select, textarea { font-family: inherit; font-size: 16px; color: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.app { max-width: 640px; margin: 0 auto; padding: 0 16px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ═══ HEADER ═══ */
header.top {
  position: sticky; top: 0; z-index: 100; background: var(--bg);
  padding: calc(env(safe-area-inset-top) + 10px) 0 10px;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  border-bottom: 1px solid var(--border-subtle);
}
.logo { display: flex; align-items: center; gap: 8px; min-width: 0; }
.logo-mark { width: 30px; height: 30px; background: var(--accent); border-radius: 7px; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.logo-mark svg { width: 20px; height: 20px; }
.logo-text { font-size: 17px; font-weight: 700; letter-spacing: -0.3px; }
.sync-btn {
  display: flex; align-items: center; gap: 7px; min-height: 40px; padding: 0 12px;
  border: 1px solid var(--border); border-radius: 100px; background: var(--bg-surface);
  font-size: 13px; font-weight: 600; color: var(--text-secondary);
}
.sync-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--text-muted); flex: 0 0 auto; }
.sync-dot.synced { background: var(--success); }
.sync-dot.syncing { background: var(--accent); animation: pulse 1s infinite; }
.sync-dot.error { background: var(--danger); }
.sync-dot.offline { background: var(--amber-border); }
.sync-dot.none { background: transparent; border: 2px solid var(--text-muted); }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

.upload-banner {
  margin-top: 10px; padding: 8px 12px; border-radius: var(--radius);
  background: var(--info-bg); color: var(--info); font-size: 13px; font-weight: 600;
}

/* ═══ VIEWS / LAYOUT ═══ */
main { padding-top: 14px; }
.view-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 6px 0 12px; flex-wrap: wrap; }
.view-title { font-size: 22px; font-weight: 700; letter-spacing: -0.4px; }
.view-sub { font-size: 14px; color: var(--text-muted); }
.group-title {
  font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.6px;
  color: var(--text-muted); margin: 22px 0 8px; display: flex; justify-content: space-between; gap: 8px;
}
.group-title .gt-extra { text-transform: none; letter-spacing: 0; font-weight: 600; color: var(--text-secondary); }
.empty { padding: 24px 12px; text-align: center; color: var(--text-muted); font-size: 15px; }
.back-btn { display: inline-flex; align-items: center; gap: 4px; min-height: var(--tap); padding: 0 8px 0 0; background: none; border: none; color: var(--accent); font-weight: 600; font-size: 16px; }

/* ═══ BUTTONS ═══ */
.btn {
  min-height: var(--tap); padding: 0 18px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--bg-surface); color: var(--text);
  font-weight: 600; font-size: 16px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: background var(--transition);
}
.btn:active { background: var(--bg-hover); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn-primary:active { background: var(--accent-hover); }
.btn-danger { color: var(--danger); border-color: var(--danger); background: var(--bg-surface); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--accent); }
.btn-block { width: 100%; }
.btn-small { min-height: 40px; padding: 0 12px; font-size: 14px; }
.btn[disabled] { opacity: 0.5; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-row .btn { flex: 1 1 auto; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 12px 0 2px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.chips::-webkit-scrollbar { display: none; }
.chips.wrap { flex-wrap: wrap; overflow: visible; }
.chips + .list, .chips + .empty { margin-top: 12px; }
.chip {
  flex: 0 0 auto; min-height: 44px; padding: 0 14px; border-radius: 100px;
  border: 1px solid var(--border); background: var(--bg-surface); color: var(--text-secondary);
  font-size: 14px; font-weight: 600; white-space: nowrap; max-width: 240px; overflow: hidden; text-overflow: ellipsis;
}
.chip.selected { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.chip-tag {
  display: inline-block; padding: 2px 9px; border-radius: 100px; background: var(--accent-glow);
  color: var(--accent); font-size: 12px; font-weight: 700; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle;
}

.pending-thumbs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.pending-thumb { position: relative; width: 64px; height: 64px; border-radius: 8px; overflow: hidden; background: var(--bg-hover); }
.pending-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pending-thumb .x {
  position: absolute; top: 2px; right: 2px; width: 26px; height: 26px; border-radius: 50%; border: none;
  background: rgba(0,0,0,0.65); color: #fff; font-size: 16px; line-height: 1;
}
.pending-thumb.busy::after { content: '…'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-weight: 700; color: var(--text-muted); }

/* ═══ CARDS / LISTS ═══ */
.filter-row { display: flex; gap: 10px; align-items: center; margin: 18px 0 6px; }
.filter-row select, .filter-row .search { flex: 1; min-width: 0; }
select.plain, .search {
  min-height: var(--tap); padding: 0 12px; border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--bg-surface); color: var(--text);
}
.list { display: flex; flex-direction: column; gap: 10px; }
.card {
  display: block; width: 100%; text-align: left; background: var(--bg-surface); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 12px 14px; box-shadow: var(--shadow-sm);
  min-height: var(--tap);
}
.card:active { background: var(--bg-hover); }
.card.incomplete { border-left: 5px solid var(--amber-border); }
.card-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.card-title { font-weight: 700; font-size: 16px; }
.card-text { font-size: 15px; white-space: pre-wrap; word-wrap: break-word; overflow-wrap: anywhere; }
.card-meta { font-size: 13px; color: var(--text-muted); margin-top: 4px; overflow-wrap: anywhere; }
.card-date { font-size: 13px; color: var(--text-muted); font-weight: 600; }
.card-row { display: flex; gap: 10px; align-items: flex-start; justify-content: space-between; }
.card-right { text-align: right; flex: 0 0 auto; font-weight: 700; }
.thumbs { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.thumb { width: 72px; height: 72px; border-radius: 8px; object-fit: cover; background: var(--bg-hover); display: block; border: none; padding: 0; overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb.missing { display: flex; align-items: center; justify-content: center; font-size: 11px; color: var(--text-muted); text-align: center; padding: 4px; }

.badge-check {
  display: inline-block; padding: 2px 8px; border-radius: 100px; font-size: 11px; font-weight: 700;
  background: var(--info-bg); color: var(--info); border: 1px solid currentColor; white-space: nowrap;
}
.flag-incomplete {
  display: inline-block; padding: 2px 8px; border-radius: 100px; font-size: 12px; font-weight: 700;
  background: var(--amber-bg); color: var(--amber); border: 1px solid var(--amber-border); white-space: nowrap;
}
.pill { display: inline-block; padding: 2px 8px; border-radius: 100px; font-size: 12px; font-weight: 700; background: var(--bg-hover); color: var(--text-secondary); white-space: nowrap; }

.notice {
  padding: 12px 14px; border-radius: var(--radius); font-size: 14px; margin: 10px 0;
  background: var(--amber-bg); color: var(--amber); border: 1px solid var(--amber-border); font-weight: 600;
}
.notice.info { background: var(--info-bg); color: var(--info); border-color: transparent; }

/* ═══ DETAIL ═══ */
.detail-block { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 14px; }
.detail-block + .detail-block { margin-top: 10px; }
.kv { display: grid; grid-template-columns: minmax(90px, 32%) 1fr; gap: 8px 12px; font-size: 15px; }
.kv dt { color: var(--text-muted); font-weight: 600; }
.kv dd { overflow-wrap: anywhere; white-space: pre-wrap; }
.kv dd.unknown { color: var(--amber); font-weight: 600; }

/* ═══ FORMS / SHEETS ═══ */
.sheet-overlay {
  position: fixed; inset: 0; z-index: 300; background: var(--bg);
  display: flex; flex-direction: column; overflow: hidden;
}
.sheet-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: calc(env(safe-area-inset-top) + 6px) 12px 6px; border-bottom: 1px solid var(--border);
  background: var(--bg-surface);
}
.sheet-head h2 { font-size: 17px; font-weight: 700; text-align: center; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sheet-head .btn { min-width: 76px; }
.sheet-body { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 16px 16px calc(env(safe-area-inset-bottom) + 40px); }
.sheet-inner { max-width: 640px; margin: 0 auto; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field > label, .field > .label { font-size: 14px; font-weight: 700; color: var(--text-secondary); }
.field .hint { font-size: 13px; color: var(--text-muted); }
.field input, .field select, .field textarea {
  width: 100%; min-height: var(--tap); padding: 10px 12px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--bg-surface); color: var(--text);
}
.field textarea { min-height: 96px; resize: vertical; line-height: 1.4; }
.field-row { display: flex; gap: 10px; }
.field-row .field { flex: 1; min-width: 0; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button {
  min-height: 44px; padding: 0 14px; border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--bg-surface); font-weight: 600; font-size: 15px; color: var(--text-secondary);
}
.seg button.selected { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }

/* ═══ MODAL ═══ */
.modal-overlay {
  position: fixed; inset: 0; z-index: 500; background: var(--modal-overlay);
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.modal { background: var(--bg-elevated); border-radius: var(--radius-lg); padding: 20px; width: 100%; max-width: 420px; box-shadow: var(--shadow-lg); max-height: 90vh; overflow-y: auto; }
.modal h3 { font-size: 18px; margin-bottom: 8px; }
.modal p { font-size: 15px; color: var(--text-secondary); margin-bottom: 14px; white-space: pre-wrap; }
.modal .field { margin-bottom: 12px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.modal-actions .btn { flex: 1 1 auto; }

/* ═══ VIEWER ═══ */
.viewer { position: fixed; inset: 0; z-index: 600; background: #000; display: flex; flex-direction: column; }
.viewer-head { display: flex; justify-content: space-between; align-items: center; padding: calc(env(safe-area-inset-top) + 6px) 12px 6px; color: #fff; gap: 8px; }
.viewer-head .btn { background: rgba(255,255,255,0.12); border-color: transparent; color: #fff; }
.viewer-label { font-size: 14px; flex: 1; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer-img { flex: 1; display: flex; align-items: center; justify-content: center; overflow: auto; }
.viewer-img img { max-width: 100%; max-height: 100%; object-fit: contain; }
.viewer-msg { color: #ccc; padding: 20px; text-align: center; }

/* ═══ TOAST ═══ */
.toast {
  position: fixed; left: 50%; transform: translateX(-50%) translateY(20px);
  bottom: calc(env(safe-area-inset-bottom) + 18px);
  background: var(--toast-bg); color: var(--toast-text); padding: 12px 16px; border-radius: var(--radius);
  font-size: 15px; font-weight: 600; z-index: 700; opacity: 0; pointer-events: none;
  transition: opacity 200ms, transform 200ms; max-width: calc(100% - 32px); width: max-content;
  display: flex; align-items: center; gap: 12px; box-shadow: var(--shadow-lg);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); pointer-events: auto; }
.toast.error { background: var(--danger); color: #fff; }
.toast button { background: none; border: 1px solid currentColor; color: inherit; border-radius: 6px; min-height: 36px; padding: 0 10px; font-weight: 700; }

/* ═══ MORE / SETTINGS ═══ */
.menu { display: flex; flex-direction: column; background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.menu-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 54px; padding: 0 16px;
  background: none; border: none; border-bottom: 1px solid var(--border-subtle); text-align: left; font-size: 16px; font-weight: 600; width: 100%;
}
.menu-item:last-child { border-bottom: none; }
.menu-item .mi-sub { font-size: 13px; color: var(--text-muted); font-weight: 500; }
.menu-item.danger { color: var(--danger); }
.menu-item::after { content: ''; flex: 0 0 auto; width: 20px; height: 20px; background: var(--text-muted); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 5l7 7-7 7'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 5l7 7-7 7'/%3E%3C/svg%3E") center / contain no-repeat; }
.menu-item.no-arrow::after { content: none; }
.stat-line { font-size: 14px; color: var(--text-secondary); margin: 6px 0; }
.mono { font-family: var(--mono); font-size: 13px; }

@media (min-width: 700px) {
  .sheet-body { padding-left: 24px; padding-right: 24px; }
}

/* ═══ ICONS ═══ */
.icon { width: 20px; height: 20px; flex: 0 0 auto; display: inline-block; vertical-align: middle; }
.icon-sm { width: 16px; height: 16px; }
.icon-lg { width: 24px; height: 24px; }
.back-btn .icon, .link-btn .icon { width: 18px; height: 18px; }
.link-btn { background: none; border: none; color: var(--accent); font-weight: 600; font-size: 14px; min-height: 40px; padding: 0; display: inline-flex; align-items: center; gap: 6px; }
.icon-btn { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--border); background: var(--bg-surface); color: var(--text-secondary); display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.head-right { display: flex; align-items: center; gap: 8px; }
.field input:focus, .field select:focus, .field textarea:focus, .inline-amount:focus, .set-input:focus {
  outline: 3px solid var(--accent-glow); border-color: var(--accent);
}

/* ═══ HOME ═══ */
.owed {
  background: var(--accent); color: var(--accent-text); border-radius: var(--radius-lg);
  padding: 16px 18px; box-shadow: var(--shadow-md); margin-top: 4px;
}
.owed-label { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.6px; opacity: 0.85; }
.owed-amount { font-size: 38px; font-weight: 700; letter-spacing: -1px; line-height: 1.15; font-variant-numeric: tabular-nums; }
.owed-other { font-size: 17px; font-weight: 600; opacity: 0.9; }
.owed-age { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 14px; font-weight: 600; flex-wrap: wrap; }
.owed .age { border: 1px solid rgba(255,255,255,0.5); }
.age { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 100px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.age::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.age.green { background: var(--success-bg); color: var(--success); }
.age.amber { background: var(--amber-bg); color: var(--amber); }
.age.red { background: var(--danger-bg); color: var(--danger); }
.owed .age.green, .owed .age.amber, .owed .age.red { background: #fff; }
.owed .age.green { color: #1E6B22; } .owed .age.amber { color: #7A4A00; } .owed .age.red { color: #A3221B; }

.btn-trip { width: 100%; min-height: 56px; font-size: 18px; margin: 14px 0 4px; }
.btn-trip .icon { width: 24px; height: 24px; stroke-width: 2.2; }

.current { border: 2px solid var(--accent); }
.current-label { font-size: 12px; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: 0.6px; }

.trip-card .card-row { align-items: center; }
.trip-sub { font-size: 13px; color: var(--text-muted); margin-top: 2px; overflow-wrap: anywhere; }
.trip-money { text-align: right; flex: 0 0 auto; }
.trip-money .tm-amount { font-weight: 700; font-variant-numeric: tabular-nums; }
.trip-money .tm-sub { font-size: 12px; color: var(--text-muted); }
.card-badges { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.pill.st-Open { background: var(--info-bg); color: var(--info); }
.pill.st-Ready { background: var(--amber-bg); color: var(--amber); }
.pill.st-Submitted { background: var(--accent-glow); color: var(--accent); }
.pill.st-Paid { background: var(--success-bg); color: var(--success); }
.flag {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 100px; font-size: 12px; font-weight: 700;
  background: var(--amber-bg); color: var(--amber); border: 1px solid var(--amber-border); white-space: nowrap;
}
.flag.bad { background: var(--danger-bg); color: var(--danger); border-color: var(--danger); }
details.more-trips > summary { list-style: none; cursor: pointer; }
details.more-trips > summary::-webkit-details-marker { display: none; }

/* ═══ TRIP VIEW ═══ */
.trip-head { margin: 4px 0 10px; }
.trip-title { font-size: 22px; font-weight: 700; letter-spacing: -0.4px; overflow-wrap: anywhere; }
.trip-meta { font-size: 14px; color: var(--text-secondary); margin-top: 2px; overflow-wrap: anywhere; }
.totals { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0; }
.tot { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 10px; min-width: 0; }
.tot-label { font-size: 12px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.4px; }
.tot-value { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.tot-value.small { font-size: 14px; color: var(--text-secondary); }
.tot.main { border-color: var(--accent); }
.tot.main .tot-value { color: var(--accent); }

.chips { display: flex; gap: 8px; flex-wrap: wrap; padding: 4px 0; }
.chip {
  flex: 0 0 auto; min-height: 44px; padding: 0 14px; border-radius: 100px;
  border: 1px solid var(--accent); background: var(--accent-glow); color: var(--accent);
  font-size: 15px; font-weight: 700; white-space: nowrap; display: inline-flex; align-items: center; gap: 4px;
}
.chip .chip-amt { font-weight: 500; opacity: 0.85; }
.chip:active { background: var(--accent); color: var(--accent-text); }
.add-row { display: flex; gap: 10px; margin: 10px 0 4px; }
.add-row .btn { flex: 1; }

.lines { display: flex; flex-direction: column; background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.line { display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 12px; border-bottom: 1px solid var(--border-subtle); }
.line:last-child { border-bottom: none; }
.line.fresh { background: var(--accent-glow); }
.line-main { flex: 1; min-width: 0; background: none; border: none; text-align: left; padding: 4px 0; min-height: 44px; }
.line-top { font-weight: 700; font-size: 15px; overflow-wrap: anywhere; }
.line-sub { font-size: 13px; color: var(--text-muted); overflow-wrap: anywhere; }
.line .card-badges { margin-top: 4px; }
.line-amount { flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.inline-amount {
  width: 96px; min-height: 44px; padding: 0 10px; text-align: right; font-weight: 700; font-size: 16px;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg); font-variant-numeric: tabular-nums;
}
.line-fixed { font-weight: 700; font-variant-numeric: tabular-nums; min-height: 44px; display: flex; align-items: center; }
.line-personal { font-size: 12px; color: var(--text-muted); }
.rc-dot { width: 36px; height: 36px; border-radius: 8px; flex: 0 0 auto; display: flex; align-items: center; justify-content: center; background: var(--bg-hover); color: var(--text-muted); overflow: hidden; border: none; padding: 0; }
.rc-dot img { width: 100%; height: 100%; object-fit: cover; }
.rc-dot.missing { background: var(--amber-bg); color: var(--amber); }
.status-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.status-actions .btn { flex: 1 1 140px; }

/* ═══ EXPENSE FORM ═══ */
.receipt-box { display: flex; gap: 12px; align-items: stretch; margin-bottom: 16px; }
.receipt-shot {
  flex: 0 0 auto; width: 104px; height: 104px; border-radius: var(--radius); overflow: hidden;
  border: 2px dashed var(--accent); background: var(--accent-glow); color: var(--accent);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-weight: 700; font-size: 14px; padding: 0;
}
.receipt-shot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.receipt-shot.has { border-style: solid; }
.receipt-shot.pdf { font-size: 13px; }
.receipt-side { flex: 1; display: flex; flex-direction: column; gap: 8px; justify-content: center; min-width: 0; }
.receipt-side .hint { font-size: 13px; color: var(--text-muted); overflow-wrap: anywhere; }
.amount-input { font-size: 22px !important; font-weight: 700; }
.items { border: 1px solid var(--border); border-radius: var(--radius); padding: 10px; background: var(--bg-surface); margin-bottom: 16px; }
.item-row { display: grid; grid-template-columns: 1fr 96px auto 36px; gap: 8px; align-items: center; margin-bottom: 8px; }
.item-row input[type="text"], .item-row input[inputmode] { min-height: 44px; padding: 0 10px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg); width: 100%; min-width: 0; }
.item-row label { font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.item-row .x { width: 36px; height: 36px; border: none; background: none; color: var(--text-muted); }
.item-sum { font-size: 13px; color: var(--text-secondary); font-weight: 600; }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; font-weight: 600; }
.check input { width: 22px; height: 22px; accent-color: var(--accent); }

/* ═══ CLAIM PACK ═══ */
.claim-wrap { margin-top: 8px; }
.claim-line { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 10px 12px; margin-bottom: 10px; }
.claim-line.done { opacity: 0.6; }
.claim-num { font-size: 12px; font-weight: 700; color: var(--text-muted); display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.cf { display: grid; grid-template-columns: 96px 1fr auto; gap: 8px; align-items: center; padding: 4px 0; border-bottom: 1px solid var(--border-subtle); min-height: 44px; }
.cf:last-child { border-bottom: none; }
.cf-label { font-size: 12px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.3px; }
.cf-value { font-size: 15px; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.cf-value.empty { color: var(--text-muted); }
.copy-btn { min-height: 40px; min-width: 64px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg); font-size: 13px; font-weight: 700; color: var(--accent); display: inline-flex; align-items: center; justify-content: center; gap: 4px; }
.copy-btn.copied { background: var(--success-bg); color: var(--success); border-color: var(--success); }
.claim-items { font-size: 13px; color: var(--text-secondary); padding: 6px 0 2px; }
.claim-items div { display: flex; justify-content: space-between; gap: 10px; }

/* Desktop: Oracle entry often happens on a laptop. */
@media (min-width: 900px) {
  .app.wide { max-width: 1180px; }
  .claim-table { width: 100%; border-collapse: collapse; background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; font-size: 14px; }
  .claim-table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: 0.3px; color: var(--text-muted); padding: 10px 8px; border-bottom: 1px solid var(--border); background: var(--bg); }
  .claim-table td { padding: 8px; border-bottom: 1px solid var(--border-subtle); vertical-align: top; }
  .claim-table tr.done td { opacity: 0.6; }
  .claim-table .cv { display: flex; align-items: flex-start; justify-content: space-between; gap: 6px; }
  .claim-table .cv span { overflow-wrap: anywhere; }
  .claim-table .copy-btn { min-height: 30px; min-width: 0; padding: 0 8px; font-size: 12px; }
  .claim-table .sub-row td { font-size: 13px; color: var(--text-secondary); background: var(--bg); }
  .claim-cards { display: none; }
}
@media (max-width: 899px) { .claim-table { display: none; } }

/* ═══ SETTINGS ═══ */
.set-block { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 12px 14px; }
.set-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border-subtle); flex-wrap: wrap; }
.set-row:last-child { border-bottom: none; }
.set-row .set-name { flex: 1 1 180px; min-width: 0; }
.set-input { min-height: 44px; padding: 0 10px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg); width: 100%; min-width: 0; }
.set-input.num { width: 96px; flex: 0 0 auto; text-align: right; }
.set-row select.set-input { flex: 1 1 160px; width: auto; }
.set-row .check { min-height: 36px; font-size: 13px; }
.set-label { flex: 1; font-weight: 600; font-size: 15px; }
.set-label .hint { display: block; font-size: 13px; color: var(--text-muted); font-weight: 500; }
textarea.set-input { min-height: 120px; padding: 10px; line-height: 1.4; }
.notice .btn-row { margin-top: 10px; }
.btn-trip + .list { margin-top: 10px; }
.items-title { font-size: 14px; font-weight: 700; color: var(--text-secondary); margin-bottom: 8px; }
p.hint { font-size: 13px; color: var(--text-muted); margin: 6px 0 14px; }
button.logo { background: none; border: none; color: inherit; padding: 0; min-height: var(--tap); }
.notice .chip { white-space: normal; text-align: left; max-width: 100%; height: auto; padding: 8px 14px; }
@media (min-width: 900px) {
  .claim-table .cb-text { display: none; }
  .claim-table .cv span { overflow-wrap: break-word; word-break: normal; }
  .claim-table .claim-items { max-width: 380px; }
  .claim-table td:nth-child(2) { white-space: nowrap; }
}
.hint.conv { font-weight: 600; color: var(--text-secondary); min-height: 18px; }

/* ═══ SETTINGS: collapsible sections and type rows ═══ */
.set-sec { margin-top: 12px; }
.set-sec > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  min-height: var(--tap); padding: 0 4px; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.6px; color: var(--text-muted);
}
.set-sec > summary::-webkit-details-marker, .type-row > summary::-webkit-details-marker { display: none; }
.set-sec > summary .icon { transition: transform var(--transition); }
.set-sec[open] > summary .icon { transform: rotate(180deg); }
.type-filter { margin-bottom: 8px; }
.type-list { display: flex; flex-direction: column; }
.type-row { border-bottom: 1px solid var(--border-subtle); }
.type-row:last-child { border-bottom: none; }
.type-row > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-height: var(--tap); padding: 6px 0; }
.type-row[open] > summary { color: var(--accent); }
.tr-name { flex: 1 1 160px; font-weight: 600; font-size: 15px; overflow-wrap: anywhere; }
.tr-badges { display: flex; gap: 4px; flex-wrap: wrap; }
.tb { display: inline-flex; align-items: center; gap: 3px; padding: 1px 8px; border-radius: 100px; font-size: 11px; font-weight: 700; background: var(--bg-hover); color: var(--text-secondary); white-space: nowrap; }
.tb.pin { background: var(--accent-glow); color: var(--accent); }
.tb .icon { width: 12px; height: 12px; }
.type-edit { padding: 4px 0 14px; }
.type-edit .field { margin-bottom: 6px; }
.type-edit .btn-danger { margin-top: 8px; }
