:root {
  color-scheme: light;
  --cream: #fff9f7;
  --paper: #ffffff;
  --cherry: #a8344d;
  --cherry-dark: #8b263e;
  --blush: #f9e5e9;
  --blush-light: #fff2f4;
  --text: #4b3038;
  --muted: #9b8189;
  --line: #f0e1e4;
  --orange: #e68ba1;
  --orange-light: #fff0f2;
  --shadow: 0 8px 28px rgba(117, 44, 61, .035);
  font-family: 'Noto Sans Thai', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--cream); color: var(--text); font-size: 14px; line-height: 1.6; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button, input, select, textarea { outline: none; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid #d990a3; outline-offset: 3px; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
svg { flex-shrink: 0; vertical-align: middle; }
h1, h2, h3, p { margin: 0; }
button { border: 0; }
button:disabled { cursor: wait; opacity: .6; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.icon { width: 20px; height: 20px; stroke-width: 1.7; }

/* A calm, persistent travel notebook navigation. */
.sidebar { position: fixed; z-index: 30; top: 0; bottom: 0; left: 0; width: 236px; padding: 30px 20px 24px; background: #fffdfb; border-right: 1px solid var(--line); display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 3px 32px; }
.brand-logo { width: 62px; height: 62px; object-fit: contain; flex-shrink: 0; }
.brand-copy { display: flex; flex-direction: column; }
.brand-copy strong { font-size: 23px; letter-spacing: -.8px; font-weight: 800; color: var(--cherry); line-height: 1.3; }
.brand-copy small { color: #a57982; font-size: 10px; margin-top: 4px; letter-spacing: .5px; }
.sidebar-label { color: #b38e95; font-size: 10px; font-weight: 600; letter-spacing: 1.8px; text-transform: uppercase; padding: 0 16px; margin: 5px 0 12px; }
.sidebar nav { display: flex; flex-direction: column; gap: 7px; }
.nav-item { background: transparent; width: 100%; display: flex; align-items: center; gap: 12px; text-align: left; padding: 13px 16px; border-radius: 12px; color: #9b6a74; font-size: 13px; font-weight: 500; transition: background .18s, color .18s; }
.nav-item:hover { background: #f9eef0; color: var(--cherry); }
.nav-item.active { background: #f4e2e6; color: var(--cherry); font-weight: 650; }
.nav-item svg { width: 19px; height: 19px; }
.nav-count { margin-left: auto; background: #fff; min-width: 23px; height: 22px; display: flex; align-items: center; justify-content: center; border-radius: 6px; font-size: 10px; color: #81565f; }
.sidebar-trip { position: relative; border: 1px solid #f1dbdf; border-radius: 15px; padding: 17px 16px 15px; margin-top: 37px; background: #fbf5f6; overflow: hidden; }
.sidebar-trip::after { content: ''; position: absolute; width: 66px; height: 66px; border: 14px solid #f4e3e6; border-radius: 50%; right: -28px; bottom: -20px; pointer-events: none; }
.eyebrow { text-transform: uppercase; font-size: 10px; font-weight: 650; letter-spacing: 1.7px; color: #a3767f; }
.sidebar-trip h3 { margin-top: 10px; font-size: 15px; font-weight: 650; }
.sidebar-trip p { margin-top: 5px; color: #9f7079; font-size: 11px; }
.trip-dots { display: flex; gap: 4px; margin-top: 14px; }
.trip-dots span { display: block; width: 6px; height: 6px; border-radius: 50%; background: #b64e69; }
.trip-dots span:nth-child(2) { background: #e6a5b7; }
.trip-dots span:nth-child(3) { background: #df7d98; }
.sidebar-footer { margin-top: auto; padding: 22px 6px 0; display: flex; align-items: center; gap: 11px; }
.avatar { width: 37px; height: 37px; border-radius: 50%; background: #f9e2e6; display: flex; align-items: center; justify-content: center; font-size: 21px; border: 3px solid #fff; flex-shrink: 0; }
.sidebar-footer strong { display: block; font-size: 12px; font-weight: 600; }
.sidebar-footer small { display: block; font-size: 10px; color: #ac838b; margin-top: 2px; }

/* Main canvas. */
.main { margin-left: 236px; padding: 0 42px 22px; max-width: 1600px; }
.topbar { display: flex; align-items: center; justify-content: space-between; height: 76px; border-bottom: 1px solid var(--line); margin-bottom: 31px; }
.breadcrumb { display: flex; align-items: center; gap: 12px; font-size: 11px; color: #aa8088; }
.breadcrumb svg { width: 14px; height: 14px; }
.breadcrumb strong, .breadcrumb span:last-child { color: #754e56; font-weight: 500; }
.topbar-right { display: flex; align-items: center; gap: 22px; }
.saved-status { display: flex; align-items: center; gap: 6px; font-size: 10px; color: #a57881; }
.saved-status i { display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: #9c5d6a; box-shadow: 0 0 0 3px #f6e6e9; }
.avatar-stack { display: flex; padding-right: 5px; }
.avatar-stack span { display: flex; align-items: center; justify-content: center; width: 31px; height: 31px; border: 3px solid var(--cream); border-radius: 50%; background: #f0c6d1; font-size: 16px; margin-right: -5px; }
.avatar-stack span:nth-child(2) { background: #f5d9e1; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 26px; }
.heading-copy .eyebrow { color: #9f7079; margin-bottom: 4px; font-size: 11px; }
h1 { font-size: 27px; font-weight: 750; letter-spacing: -.6px; line-height: 1.45; }
.heading-copy > p { color: #a57881; font-size: 11px; margin-top: 4px; }
.page-actions { display: flex; align-items: center; gap: 9px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border-radius: 10px; padding: 11px 15px; min-height: 42px; font-size: 12px; line-height: 1.4; font-weight: 550; white-space: nowrap; transition: transform .15s, background .15s, box-shadow .15s; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn .icon, .btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--cherry); color: #fff; border: 1px solid var(--cherry); box-shadow: 0 4px 9px #a8344d10; }
.btn-primary:hover { background: var(--cherry-dark); box-shadow: 0 5px 13px #a8344d20; }
.btn-secondary { background: white; border: 1px solid #f0d8dd; color: #774f57; }
.btn-secondary:hover { background: #fbf1f3; border-color: #d7b8be; }
.btn-ghost { background: transparent; color: #94636d; border: 1px solid transparent; }
.btn-ghost:hover { background: #f6e9eb; color: var(--cherry); }
.btn-small { min-height: 34px; padding: 8px 12px; font-size: 10px; }

/* Trip cover, with room for the two travelling bears. */
.hero { position: relative; display: flex; align-items: center; justify-content: space-between; isolation: isolate; min-height: 213px; border-radius: 19px; background: #fbe1e6; overflow: hidden; padding: 29px 36px; margin-bottom: 22px; }
.hero::before { content: ''; z-index: -1; position: absolute; width: 540px; height: 250px; border-radius: 50%; right: -96px; bottom: -164px; background: #efbfcc; transform: rotate(-7deg); }
.hero::after { content: ''; z-index: -1; position: absolute; width: 350px; height: 160px; border-radius: 50%; right: 180px; bottom: -125px; background: #f5ced8; transform: rotate(12deg); }
.hero-copy { position: relative; z-index: 2; max-width: 60%; }
.hero-tag { display: inline-flex; gap: 5px; align-items: center; color: #7e525b; background: rgba(255, 255, 255, .58); border: 1px solid rgba(255, 255, 255, .64); border-radius: 6px; padding: 4px 9px; font-size: 11px; font-weight: 600; margin-bottom: 10px; }
.hero-tag svg { height: 12px; width: 12px; }
.hero h2 { font-size: 29px; color: #94324b; line-height: 1.4; font-weight: 750; letter-spacing: -.7px; }
.hero-copy > p { color: #95636d; font-size: 11px; margin-top: 6px; }
.hero-meta { display: flex; gap: 17px; margin-top: 20px; flex-wrap: wrap; }
.hero-meta span { display: inline-flex; gap: 5px; align-items: center; color: #825760; font-size: 10px; }
.hero-meta svg { width: 13px; height: 13px; }
.hero-art { position: absolute; right: 19px; top: -18px; bottom: -24px; width: 330px; display: flex; align-items: center; justify-content: center; }
.hero-art > img { width: 310px; height: 250px; object-fit: contain; filter: drop-shadow(0 10px 8px rgba(127, 47, 66, .05)); }
.floating-note { position: absolute; top: 46px; right: 4px; display: inline-flex; align-items: center; gap: 5px; background: #fdf7f8; color: #996670; border-radius: 9px; padding: 7px 9px; font-size: 11px; box-shadow: 0 4px 12px #6a3c4508; transform: rotate(7deg); }
.floating-note span { color: #dd5772; }

/* At-a-glance totals. */
.stats-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; margin-bottom: 26px; }
.stat-card { min-width: 0; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); padding: 20px 21px 17px; box-shadow: var(--shadow); }
.stat-card.highlight { background: #fff0f3; border-color: #f0d7dc; }
.stat-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.stat-label { color: #9e6e78; font-size: 11px; }
.stat-icon { width: 31px; height: 31px; display: flex; align-items: center; justify-content: center; background: #f7e9ec; border-radius: 9px; color: #925a65; }
.stat-icon svg { width: 16px; height: 16px; }
.stat-icon.forest { color: #7a525a; background: #f1d9de; }
.stat-icon.orange { color: #db4e6a; background: #fbecef; }
.stat-number { margin-top: 9px; font-size: 31px; font-weight: 750; line-height: 1.4; color: var(--cherry); letter-spacing: -.7px; font-variant-numeric: tabular-nums; }
.stat-number span { color: #ad838c; font-size: 11px; font-weight: 450; margin-left: 5px; letter-spacing: 0; }
.stat-foot { margin-top: 8px; display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 11px; color: #ad838c; min-height: 23px; }
.chip { display: inline-flex; align-items: center; gap: 3px; padding: 3px 6px; border-radius: 4px; background: #f2dee2; font-size: 11px; color: #915e68; font-weight: 500; }
.chip svg { width: 11px; height: 11px; }
.split-control { display: inline-flex; align-items: center; gap: 9px; }
.split-control button { display: flex; align-items: center; justify-content: center; width: 22px; height: 22px; font-size: 14px; border-radius: 6px; border: 1px solid #eed3d8; background: #fff; color: #996670; }
.split-control button:hover { background: #f2dee2; }
.split-control span { font-size: 10px; color: #94626c; }

/* Ledger and category breakdown. */
.content-grid { display: grid; grid-template-columns: minmax(0, 2.15fr) minmax(235px, 1fr); gap: 21px; align-items: start; }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: 17px; box-shadow: var(--shadow); overflow: hidden; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 22px 22px 0; }
.panel-heading h2 { font-size: 14px; font-weight: 650; color: #6f3748; }
.panel-heading h2 .icon { width: 15px; height: 15px; margin-right: 5px; }
.panel-subtitle { display: flex; align-items: center; gap: 7px; color: #b59198; font-size: 11px; margin-top: 3px; }
.panel-subtitle span { font-size: inherit; }
.pill { display: inline-flex; align-items: center; justify-content: center; background: #f7ebed; padding: 3px 8px; border-radius: 20px; color: #9b6a74; font-size: 11px; white-space: nowrap; }
.filter-bar { display: flex; gap: 10px; padding: 17px 22px 16px; }
.search-box { display: flex; align-items: center; gap: 7px; min-width: 0; flex: 1; border: 1px solid #f3dee2; background: #fcf6f7; border-radius: 8px; padding: 8px 10px; }
.search-box svg { width: 14px; height: 14px; color: #ae868e; }
.search-box input { min-width: 0; width: 100%; background: transparent; border: 0; color: #7f555d; font-size: 10px; padding: 1px 0; }
.search-box input::placeholder { color: #b48e96; }
.search-box:focus-within { border-color: #c2909a; box-shadow: 0 0 0 3px #f6e7ea; }
.search-box input:focus-visible { outline: none; }
.filter-bar select { border: 1px solid #f3dee2; color: #97656f; background: #fff; border-radius: 8px; font-size: 10px; padding: 8px 24px 8px 10px; max-width: 135px; cursor: pointer; }
.table-head, .expense-row { display: grid; grid-template-columns: minmax(0, 1fr) 100px 87px 30px; gap: 8px; align-items: center; }
.table-head { border-top: 1px solid #f6e8eb; border-bottom: 1px solid #f6e8eb; background: #fdf8f9; padding: 10px 22px; color: #a97e87; font-size: 11px; }
.table-head > :nth-child(2) { text-align: right; }
.table-head > :nth-child(3) { text-align: center; }
.expense-list { padding: 0 22px; }
.expense-row { min-height: 64px; border-bottom: 1px solid #f6e8eb; }
.expense-row:last-child { border-bottom: 0; }
.expense-main { display: flex; align-items: center; gap: 11px; min-width: 0; }
.expense-main > div:last-child { min-width: 0; }
.category-icon { display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 10px; background: #f7e9ec; color: #9c6b75; flex-shrink: 0; font-size: 17px; }
.category-icon svg { width: 16px; height: 16px; stroke-width: 1.6; }
.category-icon.food { background: #fff0f2; color: #dd5771; }
.category-icon.transport { background: #f3e1e4; color: #a05f6c; }
.category-icon.shopping { background: #f7ebf0; color: #bd849a; }
.category-icon.activity { background: #f8e9ef; color: #b07189; }
.category-icon.other { background: #f5e6e9; color: #a87c85; }
.expense-name { font-size: 11px; color: #6a474e; font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.expense-meta { margin-top: 3px; font-size: 10px; color: #b38c94; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.amount { text-align: right; font-size: 12px; font-weight: 650; color: #633a42; white-space: nowrap; font-variant-numeric: tabular-nums; }
.amount small, .amount span { font-weight: 400; color: #a87d86; font-size: 11px; }
.receipt-status { display: flex; align-items: center; justify-content: center; gap: 4px; border: 1px dashed #f0d6db; background: #fff; border-radius: 5px; padding: 5px 5px; width: fit-content; justify-self: center; color: #ae868e; transition: border-color .2s, background .2s; }
.receipt-status:hover { border-color: #b97e8a; background: #fbf0f2; color: #824c56; }
.receipt-status svg { width: 11px; height: 11px; }
.receipt-status small { font-size: 10px; white-space: nowrap; }
.receipt-status.has-receipt { background: #f6e6e9; border: 1px solid #f0d9dd; color: #93606a; }
.icon-button { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; border-radius: 7px; width: 28px; height: 28px; background: transparent; color: #bb99a0; transition: color .2s, background .2s; }
.icon-button svg { width: 14px; height: 14px; }
.icon-button:hover { color: #c14e65; background: #fbedf0; }
.empty-state { text-align: center; padding: 45px 20px; color: #a1737c; font-size: 12px; }
.carry-forward { display: flex; align-items: center; gap: 10px; margin: 7px 22px 0; padding: 13px 12px; background: #fcf6f7; border: 1px dashed #f1d9de; border-radius: 9px; }
.carry-forward > svg { color: #b48e96; width: 16px; height: 16px; }
.carry-copy { display: flex; flex-direction: column; gap: 3px; }
.carry-copy strong { font-size: 10px; font-weight: 500; color: #9b6a74; }
.carry-copy small { font-size: 10px; color: #ba989f; }
.carry-amount { margin-left: auto; color: #9d6d76; font-size: 12px; font-weight: 550; white-space: nowrap; }
.table-footer { padding: 15px 22px 17px; display: flex; justify-content: space-between; gap: 10px; font-size: 11px; color: #ae868e; }
.table-footer strong { color: #895c65; font-size: 10px; font-weight: 600; }
.side-panels { display: flex; flex-direction: column; gap: 17px; }
.side-panels .panel-heading { padding: 20px 21px 0; }
.side-panels .panel-heading h2 { font-size: 13px; }
.chart-wrap { display: flex; align-items: center; justify-content: center; padding: 23px 15px 22px; }
.donut { width: 150px; height: 150px; border-radius: 50%; padding: 19px; transform: rotate(-90deg); }
.donut-hole { width: 100%; height: 100%; background: white; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; transform: rotate(90deg); }
.donut-hole strong { color: #713f49; font-size: 22px; font-weight: 700; letter-spacing: -.3px; line-height: 1.5; }
.donut-hole small { color: #ae868e; font-size: 10px; }
.legend { display: flex; flex-direction: column; gap: 12px; padding: 0 21px 23px; }
.legend-row { display: flex; align-items: center; justify-content: space-between; gap: 9px; }
.legend-label { display: flex; align-items: center; gap: 7px; font-size: 10px; color: #9b6973; }
.legend-label i { display: block; width: 7px; height: 7px; border-radius: 2px; background: #ab6b78; }
.legend-value { display: flex; align-items: center; gap: 8px; font-variant-numeric: tabular-nums; }
.legend-value b { font-size: 10px; font-weight: 550; color: #825760; }
.legend-value small { font-size: 10px; color: #bb99a0; min-width: 27px; text-align: right; }
.memory-card { padding: 22px; border: 1px solid #f3d9e0; border-radius: 16px; background: #fff0f2; position: relative; overflow: hidden; }
.memory-card::after { content: ''; width: 85px; height: 85px; border: 19px solid #f9e1e8; border-radius: 50%; position: absolute; right: -43px; top: -28px; pointer-events: none; }
.memory-icon { width: 34px; height: 34px; border-radius: 10px; background: #f8dce4; display: flex; justify-content: center; align-items: center; color: #cc7b94; margin-bottom: 12px; }
.memory-icon svg { width: 18px; height: 18px; }
.memory-card h3 { font-size: 12px; font-weight: 600; color: #99465e; }
.memory-card p { color: #b27d8d; font-size: 11px; margin: 7px 0 14px; line-height: 1.9; }
.memory-card .btn { background: #fffafb; border-color: #eccbd5; color: #b05c75; font-size: 10px; padding: 8px 12px; min-height: 34px; }
.memory-card .btn:hover { background: white; }
.tip-card { color: #b28c94; font-size: 11px; padding: 0 10px; display: flex; gap: 6px; align-items: flex-start; line-height: 1.9; }
.tip-card svg { width: 13px; height: 13px; margin-top: 2px; }
.page-footer { padding: 24px 0 3px; color: #bd9ba2; font-size: 11px; text-align: center; }
.page-footer svg { width: 11px; height: 11px; }

/* Evidence gallery. */
#receipts-view { padding-bottom: 22px; }
.receipts-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; padding: 22px; }
.receipt-card { border: 1px solid var(--line); border-radius: 12px; background: #fff; overflow: hidden; }
.receipt-image { height: 175px; background: #f8edef; overflow: hidden; }
.receipt-image img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; transition: transform .25s; }
.receipt-image:hover img { transform: scale(1.035); }
.pdf-placeholder { height: 100%; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 8px; color: #a2737d; font-size: 11px; }
.pdf-placeholder svg { width: 35px; height: 35px; }
.receipt-card-body { padding: 14px; }
.receipt-card-body strong { display: block; font-size: 11px; font-weight: 550; color: #7a525a; }
.receipt-card-body small { display: block; color: #b08890; font-size: 11px; margin-top: 3px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.receipt-actions { display: flex; align-items: center; gap: 7px; margin-top: 11px; }
.receipts-empty { padding: 65px 25px; text-align: center; color: #aa7f88; font-size: 12px; }
.receipts-empty svg { width: 38px; height: 38px; margin-bottom: 13px; color: #be8e98; }
.receipts-empty h3 { color: #7f555d; font-size: 15px; font-weight: 600; margin-bottom: 7px; }
.receipts-empty p { font-size: 11px; }
.receipts-empty .btn { margin-top: 18px; }

/* Entry and receipt dialogs. */
.modal { width: min(580px, calc(100vw - 36px)); max-height: calc(100dvh - 48px); border: 1px solid #f1dbdf; border-radius: 20px; color: var(--text); background: #fffdfb; padding: 0; box-shadow: 0 25px 80px #3f222830; overflow-x: hidden; overflow-y: auto; }
.modal::backdrop { background: rgba(64, 30, 42, .35); backdrop-filter: blur(4px); }
.modal[open] { animation: modal-in .2s ease-out; }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; padding: 25px 27px 20px; border-bottom: 1px solid var(--line); }
.modal-header h2 { font-size: 20px; font-weight: 700; color: #60353e; }
.modal-header p { font-size: 10px; color: #a87c85; margin-top: 4px; }
.modal-header .icon-button { width: 30px; height: 30px; background: #f6e7ea; color: #9f6f79; }
.modal form { padding: 22px 27px 0; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px 14px; }
.field { display: flex; flex-direction: column; min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 11px; font-weight: 550; color: #81565f; margin-bottom: 7px; }
.field input, .field select, .field textarea { width: 100%; border: 1px solid #efd3d9; border-radius: 8px; padding: 11px 12px; color: #7a4d56; background: white; font-size: 12px; min-width: 0; }
.field input::placeholder, .field textarea::placeholder { color: #bb9aa0; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: #ba808c; }
.field small { color: #ae868e; font-size: 11px; margin-top: 5px; }
.field textarea { resize: vertical; min-height: 76px; line-height: 1.6; }
.input-money { display: flex; align-items: center; border: 1px solid #efd3d9; border-radius: 8px; background: #fff; overflow: hidden; }
.input-money span { padding-left: 12px; color: #ab7c86; }
.input-money input { border: 0; border-radius: 0; font-weight: 600; }
.input-money:focus-within { border-color: #ba808c; }
.upload-zone { border: 1px dashed #d8b0b8; border-radius: 11px; padding: 19px 15px 17px; background: #fcf2f4; text-align: center; margin-top: 6px; }
.upload-zone > svg { color: #b5717f; width: 29px; height: 29px; margin-bottom: 9px; }
.upload-buttons { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; }
.upload-zone p { color: #ae868e; font-size: 11px; margin-top: 10px; }
.attachment-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.attachment-item { display: flex; align-items: center; gap: 9px; border: 1px solid #f1dbdf; border-radius: 9px; padding: 7px; background: white; }
.attachment-item img, .file-icon { width: 35px; height: 35px; border-radius: 5px; object-fit: cover; background: #f6e7ea; color: #a6727c; }
.file-icon { display: flex; align-items: center; justify-content: center; }
.attachment-item > span { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 10px; color: #9b6873; }
.attachment-item > button { margin-left: auto; flex-shrink: 0; }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 21px 0 23px; margin-top: 7px; }
.modal-footer .btn { min-width: 90px; }
.form-error { color: #b3465d; background: #fbecef; border-radius: 7px; padding: 8px 11px; font-size: 11px; margin-top: 14px; }
.receipt-viewer { width: min(800px, calc(100vw - 36px)); }
.viewer-content { padding: 20px; background: #f8eef0; min-height: 180px; }
.viewer-content img, .receipt-viewer img { max-width: 100%; max-height: calc(100dvh - 220px); object-fit: contain; margin: auto; border-radius: 7px; }
.viewer-content iframe, .receipt-viewer iframe { display: block; width: 100%; height: min(650px, 65dvh); border: 0; border-radius: 7px; background: white; }
.viewer-content .btn { margin-top: 12px; }
.toast { position: fixed; z-index: 100; left: calc(50% + 118px); bottom: 27px; transform: translate(-50%, 18px); padding: 12px 19px; background: #96324a; color: #fff; border: 1px solid #ffffff16; border-radius: 12px; box-shadow: 0 8px 28px #51262f20; font-size: 12px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; max-width: min(450px, calc(100vw - 30px)); text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.loading { opacity: .6; pointer-events: none; }
@keyframes modal-in { from { opacity: 0; transform: translateY(8px) scale(.99); } to { opacity: 1; transform: translateY(0) scale(1); } }

@media (min-width: 1650px) {
  .main { margin-right: auto; padding-left: 60px; padding-right: 60px; }
  .hero-art { right: 70px; }
  .hero { min-height: 230px; }
}
@media (max-width: 1250px) {
  .main { padding-left: 28px; padding-right: 28px; }
  .sidebar { width: 216px; padding-left: 15px; padding-right: 15px; }
  .main { margin-left: 216px; }
  .content-grid { gap: 17px; grid-template-columns: minmax(0, 1.9fr) minmax(225px, 1fr); }
  .page-actions { gap: 7px; }
  .page-actions .btn { padding-left: 11px; padding-right: 11px; font-size: 11px; }
  .hero { padding-left: 27px; }
  .hero-art { right: -8px; width: 285px; }
  .hero-art > img { width: 280px; }
  .floating-note { right: 6px; top: 43px; }
  .stat-card { padding-left: 17px; padding-right: 17px; }
  .stat-number { font-size: 28px; }
  .panel-heading { padding-left: 18px; padding-right: 18px; }
  .filter-bar { padding-left: 18px; padding-right: 18px; }
  .table-head, .expense-row { grid-template-columns: minmax(0, 1fr) 75px 69px 24px; gap: 6px; }
  .table-head { padding-left: 18px; padding-right: 18px; }
  .expense-list { padding-left: 18px; padding-right: 18px; }
  .expense-main { gap: 8px; }
  .carry-forward { margin-left: 18px; margin-right: 18px; }
  .table-footer { padding-left: 18px; padding-right: 18px; }
  .toast { left: calc(50% + 108px); }
}
@media (max-width: 1080px) {
  .sidebar { width: 190px; padding-left: 12px; padding-right: 12px; }
  .brand { gap: 7px; }
  .brand-logo { width: 48px; height: 48px; }
  .brand-copy strong { font-size: 21px; }
  .brand-copy small { font-size: 10px; }
  .nav-item { padding-left: 12px; padding-right: 12px; font-size: 12px; gap: 9px; }
  .main { margin-left: 190px; padding-left: 23px; padding-right: 23px; }
  .page-heading { align-items: flex-start; }
  h1 { font-size: 24px; }
  .page-actions { padding-top: 13px; }
  .page-actions .btn-secondary { font-size: 0; width: 39px; padding: 10px; }
  .page-actions .btn-secondary svg { width: 17px; height: 17px; }
  .hero h2 { font-size: 26px; }
  .hero-copy { max-width: 59%; }
  .hero-art { right: -14px; width: 265px; }
  .hero-art > img { width: 260px; }
  .hero-meta { gap: 10px; }
  .stats-grid { gap: 10px; }
  .stat-number { font-size: 26px; }
  .stat-card { padding-left: 15px; padding-right: 15px; }
  .stat-label { font-size: 10px; }
  .stat-foot { font-size: 10px; }
  .content-grid { grid-template-columns: minmax(0, 1fr); }
  .side-panels { display: grid; grid-template-columns: 1fr 1fr; align-items: start; }
  .side-panels > .panel { grid-row: span 2; }
  .memory-card { height: fit-content; }
  .tip-card { grid-column: 2; }
  .side-panels .panel { display: grid; grid-template-columns: 160px 1fr; }
  .side-panels .panel-heading { grid-column: 1 / -1; }
  .chart-wrap { padding: 22px 9px; }
  .donut { width: 125px; height: 125px; padding: 15px; }
  .donut-hole strong { font-size: 19px; }
  .legend { justify-content: center; padding: 22px 15px 22px 0; gap: 12px; }
  .legend-label { font-size: 11px; }
  .legend-value { gap: 4px; }
  .legend-value small { display: none; }
  .toast { left: calc(50% + 95px); }
}
@media (max-width: 760px) {
  .sidebar { position: relative; width: 100%; padding: 13px 22px 0; border-right: 0; border-bottom: 1px solid var(--line); background: #fffdfb; display: grid; grid-template-columns: 1fr; }
  .brand { padding: 0 0 13px; gap: 8px; }
  .brand-logo { width: 44px; height: 44px; }
  .brand-copy { flex-direction: row; align-items: baseline; gap: 8px; }
  .brand-copy strong { font-size: 22px; }
  .brand-copy small { font-size: 11px; }
  .sidebar-label, .sidebar-trip, .sidebar-footer { display: none; }
  .sidebar nav { flex-direction: row; gap: 10px; }
  .nav-item { flex: 1; min-width: 0; justify-content: center; border-radius: 9px 9px 0 0; padding: 11px 9px; font-size: 11px; gap: 6px; }
  .nav-item.active { box-shadow: inset 0 -2px #98606b; background: #f6e7ea; }
  .nav-item svg { width: 16px; height: 16px; }
  .nav-count { margin-left: 0; min-width: 17px; width: 17px; height: 17px; font-size: 10px; }
  .main { margin-left: 0; padding: 0 22px 16px; }
  .topbar { height: 53px; margin-bottom: 22px; }
  .breadcrumb { font-size: 11px; gap: 7px; }
  .topbar-right { gap: 14px; }
  .saved-status { font-size: 10px; }
  .avatar-stack span { width: 27px; height: 27px; font-size: 13px; }
  .page-heading { gap: 13px; margin-bottom: 20px; }
  .heading-copy .eyebrow { font-size: 10px; }
  h1 { font-size: 23px; }
  .heading-copy > p { font-size: 10px; }
  .page-actions { padding-top: 8px; }
  .page-actions .btn-primary { font-size: 10px; padding: 10px; min-height: 38px; }
  .page-actions .btn-secondary { min-height: 38px; width: 37px; }
  .hero { padding: 25px; min-height: 195px; margin-bottom: 17px; border-radius: 16px; }
  .hero h2 { font-size: 25px; }
  .hero-copy { max-width: 62%; }
  .hero-copy > p { font-size: 10px; }
  .hero-art { top: -10px; bottom: -30px; right: -4px; width: 250px; }
  .hero-art > img { width: 250px; height: 230px; }
  .hero-meta { margin-top: 17px; gap: 9px; }
  .hero-meta span { font-size: 11px; }
  .floating-note { top: 35px; right: 8px; font-size: 10px; padding: 6px 7px; }
  .stats-grid { gap: 10px; margin-bottom: 19px; }
  .stat-card { padding: 16px 14px 13px; border-radius: 13px; }
  .stat-number { font-size: 25px; }
  .stat-number span { font-size: 11px; }
  .stat-icon { height: 26px; width: 26px; border-radius: 7px; }
  .stat-icon svg { height: 14px; width: 14px; }
  .stat-foot { gap: 3px; flex-wrap: wrap; font-size: 10px; }
  .chip { font-size: 10px; }
  .content-grid { gap: 17px; }
  .table-head, .expense-row { grid-template-columns: minmax(0, 1fr) 95px 85px 25px; gap: 8px; }
  .expense-row { min-height: 65px; }
  .expense-name { font-size: 12px; }
  .expense-meta { font-size: 11px; }
  .receipt-status small { font-size: 11px; }
  .receipts-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .toast { left: 50%; }
}
@media (max-width: 550px) {
  .sidebar { padding-left: 16px; padding-right: 16px; }
  .brand-copy small { font-size: 10px; }
  .sidebar nav { gap: 4px; }
  .nav-item { font-size: 10px; }
  .main { padding-left: 16px; padding-right: 16px; }
  .topbar-right { gap: 8px; }
  .saved-status { font-size: 10px; }
  .breadcrumb { font-size: 10px; gap: 5px; }
  .avatar-stack span { width: 24px; height: 24px; border-width: 2px; font-size: 12px; }
  .page-heading { flex-wrap: wrap; align-items: center; }
  .heading-copy { flex: 1; }
  h1 { font-size: 22px; }
  .page-actions { width: 100%; padding-top: 0; gap: 7px; }
  .page-actions .btn-secondary { width: auto; font-size: 10px; padding: 10px 12px; }
  .page-actions .btn-primary { margin-left: auto; padding-left: 15px; padding-right: 15px; }
  .hero { padding: 20px; min-height: 200px; flex-direction: column; align-items: stretch; }
  .hero-copy { min-width: 0; max-width: 100%; }
  .hero h2 { font-size: 23px; max-width: min(210px, 100%); overflow-wrap: anywhere; }
  .hero-copy > p { font-size: 11px; max-width: min(200px, 100%); line-height: 1.8; overflow-wrap: anywhere; }
  .hero-tag { padding: 3px 7px; font-size: 10px; margin-bottom: 8px; }
  .hero-meta { gap: 7px; flex-direction: column; margin-top: 13px; }
  .hero-meta span { font-size: 10px; }
  .hero-meta svg { width: 12px; height: 12px; }
  .hero-art { position: relative; width: min(100%, 300px); right: auto; top: auto; bottom: auto; margin: 12px 0 0 auto; padding-top: 24px; align-items: center; }
  .hero-art > img { width: 100%; height: auto; }
  .floating-note { top: 0; right: 5px; font-size: 10px; padding: 5px 6px; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat-card { padding: 15px 15px 13px; }
  .stat-card:first-child { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr auto; align-items: center; padding: 17px 19px; }
  .stat-card:first-child .stat-top { grid-column: 1; }
  .stat-card:first-child .stat-icon { display: none; }
  .stat-card:first-child .stat-number { grid-column: 2; grid-row: 1 / 3; font-size: 32px; margin-top: 0; }
  .stat-card:first-child .stat-foot { grid-column: 1; margin-top: 3px; justify-content: flex-start; gap: 7px; }
  .stat-label { font-size: 10px; }
  .stat-number { font-size: 26px; }
  .stat-foot { font-size: 10px; }
  .split-control { gap: 7px; }
  .split-control button { width: 20px; height: 20px; }
  .split-control span { font-size: 11px; }
  .panel { border-radius: 14px; }
  .panel-heading { padding: 18px 15px 0; }
  .panel-heading h2 { font-size: 13px; }
  .panel-subtitle { font-size: 10px; }
  .filter-bar { padding: 14px 15px; gap: 7px; }
  .search-box { padding: 8px; }
  .search-box input, .filter-bar select, .trip-switcher select, .field select, .field input, .field textarea, #base-input, #trip-name-input { font-size: 16px; }
  .filter-bar select { max-width: 115px; padding-left: 8px; padding-right: 8px; }
  .table-head, .expense-row { grid-template-columns: minmax(0, 1fr) 67px 28px 24px; gap: 6px; }
  .table-head { padding: 9px 15px; font-size: 10px; }
  .table-head > :nth-child(3) { font-size: 0; }
  .expense-list { padding: 0 15px; }
  .expense-main { gap: 8px; }
  .category-icon { width: 31px; height: 31px; border-radius: 9px; }
  .category-icon svg { width: 14px; height: 14px; }
  .expense-name { font-size: 10px; }
  .expense-meta { font-size: 10px; margin-top: 2px; }
  .amount { font-size: 11px; }
  .amount small, .amount span { font-size: 10px; }
  .receipt-status { width: 25px; height: 25px; padding: 5px; }
  .receipt-status small { display: none; }
  .receipt-status svg { width: 12px; height: 12px; }
  .icon-button { width: 24px; height: 26px; }
  .icon-button svg { width: 13px; height: 13px; }
  .carry-forward { margin-left: 15px; margin-right: 15px; padding: 11px 10px; gap: 7px; }
  .carry-copy strong { font-size: 11px; }
  .carry-copy small { font-size: 10px; }
  .carry-amount { font-size: 11px; }
  .table-footer { padding: 14px 15px; font-size: 10px; }
  .table-footer strong { font-size: 11px; }
  .side-panels { display: flex; flex-direction: column; gap: 14px; }
  .side-panels > * { width: 100%; }
  .side-panels .panel { display: grid; grid-template-columns: 45% 55%; }
  .side-panels .panel-heading { padding: 18px 18px 0; }
  .chart-wrap { padding: 20px 7px; }
  .donut { width: 130px; height: 130px; padding: 17px; }
  .legend { gap: 13px; padding: 20px 18px 20px 0; }
  .legend-label { font-size: 10px; }
  .legend-value b { font-size: 10px; }
  .legend-value small { display: inline; font-size: 10px; }
  .memory-card { padding: 20px; display: grid; grid-template-columns: 35px 1fr; column-gap: 12px; }
  .memory-icon { grid-row: 1 / 3; margin-bottom: 0; }
  .memory-card h3 { align-self: end; }
  .memory-card p { margin-top: 4px; margin-bottom: 11px; }
  .memory-card .btn { grid-column: 2; width: fit-content; }
  .tip-card { font-size: 10px; padding: 0 3px; }
  .page-footer { font-size: 10px; padding-top: 21px; }
  .receipts-grid { padding: 16px; gap: 10px; }
  .receipt-image { height: 140px; }
  .receipt-card-body { padding: 10px; }
  .receipt-card-body strong { font-size: 10px; }
  .receipt-actions .btn { font-size: 10px; min-height: 28px; padding: 6px 8px; }
  .modal { width: calc(100vw - 24px); max-height: calc(100dvh - 24px); border-radius: 16px; }
  .modal-header { padding: 20px 20px 16px; }
  .modal-header h2 { font-size: 18px; }
  .modal-header p { font-size: 11px; }
  .modal form { padding: 18px 20px 0; }
  .form-grid { gap: 15px 11px; }
  .field label { font-size: 10px; }
  .field input, .field select, .field textarea { font-size: 16px; padding: 10px; }
  .field small { font-size: 10px; }
  .upload-zone { padding: 15px 10px; }
  .upload-zone .btn { font-size: 10px; padding-left: 10px; padding-right: 10px; }
  .modal-footer { padding-bottom: 20px; }
  .viewer-content { padding: 12px; }
  .toast { bottom: 18px; font-size: 11px; width: max-content; padding: 11px 17px; }
}
@media (max-width: 360px) {
  .main { padding-left: 12px; padding-right: 12px; }
  .brand-copy small { display: none; }
  .page-actions .btn { padding-left: 9px; padding-right: 9px; font-size: 11px; }
  .hero h2 { font-size: 21px; }
  .hero-copy > p { max-width: min(158px, 100%); }
  .stat-number { font-size: 24px; }
  .table-head, .expense-row { grid-template-columns: minmax(0, 1fr) 59px 25px 22px; gap: 4px; }
  .expense-name { font-size: 11px; }
  .expense-main { gap: 6px; }
  .category-icon { width: 28px; height: 28px; }
  .legend-value small { display: none; }
  .donut { width: 118px; height: 118px; padding: 15px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* Details shared by generated rows and the entry dialogs. */
.brand-copy strong { font-size: 17px; white-space: nowrap; letter-spacing: -.4px; }
.brand-copy small { font-size: 10px; letter-spacing: .25px; white-space: nowrap; }
.trip-dots { align-items: center; }
.trip-dots small { color: #ae868e; font-size: 10px; margin-left: 4px; white-space: nowrap; }
.sidebar-footer > [data-icon] { margin-left: auto; color: #be9da4; }
.sidebar-footer > [data-icon] svg { width: 14px; height: 14px; }
.expense-name { background: transparent; border: 0; padding: 0; display: block; max-width: 100%; text-align: left; line-height: 1.7; }
.expense-name:hover { color: var(--cherry); text-decoration: underline; text-underline-offset: 3px; }
.empty-state > svg { display: block; margin: 0 auto 12px; width: 27px; height: 27px; }
.empty-state > strong { display: block; font-size: 12px; font-weight: 550; color: #8c5e67; }
.empty-state > p { font-size: 10px; margin-top: 7px; line-height: 1.9; }
.receipt-image { display: block; width: 100%; padding: 0; }
.receipt-actions { justify-content: space-between; }
.receipt-actions > span { color: #8c5d67; font-size: 10px; font-weight: 550; }
.receipts-empty { grid-column: 1 / -1; }
.attachment-item small { display: block; color: #b38c94; font-size: 10px; margin-top: 2px; }
.page-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 7px 15px; }
.page-footer > span:last-child { color: #c1a1a8; font-size: 10px; }
.form-error:empty { display: none; }
.footer-spacer { flex: 1; }
.small-modal { max-width: 440px; }
.modal > .modal-footer { padding: 16px 24px 23px; margin-top: 0; }
#delete-dialog > p { padding: 22px 25px 3px; font-size: 12px; color: #9b6973; }
.btn-primary.danger { background: #ba4058; border-color: #ba4058; }
.btn-primary.danger:hover { background: #9e2e45; }
#delete-expense, #delete-trip { color: #bc5c75; min-width: 0; }
#delete-expense:hover, #delete-trip:hover { background: #fbebee; }
@media (max-width: 1080px) { .brand-copy strong { font-size: 15px; } .brand-copy small { font-size: 10px; } }
@media (max-width: 760px) { .brand-copy strong { font-size: 21px; } .brand-copy small { font-size: 10px; } }
@media (max-width: 550px) { .page-footer { flex-direction: column; align-items: center; gap: 4px; } .page-footer > span:last-child { font-size: 10px; } .modal-footer .btn { min-width: 76px; font-size: 11px; } }

/* Reusable destination controls blend with their surrounding headings. */
.trip-name-btn { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; min-height: 24px; padding: 2px 5px; margin: -2px -5px; border: 0; border-radius: 6px; background: transparent; color: inherit; font: inherit; font-weight: inherit; line-height: inherit; text-align: left; vertical-align: baseline; transition: background .18s, color .18s; }
.trip-name-btn > svg, .trip-name-btn [data-icon] svg { width: 13px; height: 13px; color: #c8798e; }
.trip-name-btn [data-icon] { display: inline-flex; flex-shrink: 0; }
.trip-name-btn:hover { background: #fbe7ed; color: var(--cherry); }
.trip-name-btn:hover svg { color: var(--cherry); }
.trip-name-btn:focus-visible { outline: 3px solid #d990a3; outline-offset: 3px; }
.trip-name-btn > span:first-child:not([data-icon]) { overflow: hidden; text-overflow: ellipsis; }

.trip-switcher{display:flex;align-items:center;flex-wrap:wrap;gap:10px;margin:18px 0 0;color:var(--muted);font-size:12px}.trip-switcher select{max-width:260px;min-width:150px;padding:8px 30px 8px 12px;border:1px solid var(--line);border-radius:10px;background:white;color:var(--cherry);font-weight:600}.trip-switcher .btn-small{min-height:36px}.breadcrumb{display:flex;align-items:center;gap:8px}.breadcrumb strong{max-width:300px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}@media(max-width:550px){.trip-switcher{gap:7px;flex-wrap:wrap}.trip-switcher>label{display:none}.trip-switcher select{flex:1 0 100%;min-width:0;max-width:100%}.trip-switcher .btn-small{flex:0 0 auto}.breadcrumb strong{max-width:160px}}

/* Choose a travel expense type before personalizing the entry. */
.expense-type-field select { background: #fff5f7; border-color: #e9c3cd; }
.expense-type-field select:focus { border-color: #c9788d; }
#expense-type-help { line-height: 1.8; }

.category-icon.drinks,.category-icon.stay,.category-icon.donation,.category-icon.equipment,.category-icon.daily,.category-icon.health,.category-icon.fees{background:#fff0f3;color:#b94360}
.trip-switcher + .page-heading { margin-top: 18px; }
