@font-face {
  font-family: Geist;
  src: url("./fonts/GeistVariable.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
}

:root {
  color-scheme: light;
  --ink: #26342b;
  --muted: #66756b;
  --quiet: #78847b;
  --paper: #f5f7f4;
  --surface: #ffffff;
  --surface-soft: #f0f4ef;
  --line: #dce5dc;
  --line-strong: #bdcfbf;
  --scrim: color-mix(in srgb, var(--ink) 48%, transparent);
  --ink-overlay: color-mix(in srgb, var(--ink) 82%, transparent);
  --shadow-soft: color-mix(in srgb, var(--ink) 8%, transparent);
  --shadow-popover: color-mix(in srgb, var(--ink) 16%, transparent);
  --green: #356a49;
  --green-dark: #214d34;
  --green-soft: #e6efe6;
  --red: #9a3f36;
  --red-dark: #7a2f27;
  --red-soft: #f8e9e6;
  --space-0: 0;
  --space-25: 2px;
  --space-50: 4px;
  --space-75: 8px;
  --space-100: 12px;
  --space-200: 16px;
  --space-300: 24px;
  --space-400: 32px;
  --space-500: 40px;
  --space-neg-500: -40px;
  --space-600: 48px;
  --space-700: 64px;
  --space-800: 80px;
  --space-900: 96px;
  --text-xs: 12px;
  --line-xs: 16px;
  --text-sm: 14px;
  --line-sm: 20px;
  --text-base: 16px;
  --line-base: 24px;
  --text-lg: 18px;
  --line-lg: 28px;
  --text-xl: 20px;
  --line-xl: 28px;
  --text-2xl: 24px;
  --line-2xl: 32px;
  --text-3xl: 30px;
  --line-3xl: 36px;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-2xl: 24px;
  --radius-full: 9999px;
  --radius-none: 0;
  --motion: cubic-bezier(0.22, 1, 0.36, 1);
  font-family: Geist;
  font-size: var(--text-base);
  line-height: var(--line-base);
  font-weight: 400;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--paper); }
body { min-width: 320px; min-height: 100dvh; margin: var(--space-0); background: var(--paper); color: var(--ink); }
button, input, textarea, select { font: inherit; }
b, strong { font-weight: 600; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; cursor: pointer; }
a { color: var(--green); }
[hidden] { display: none !important; }
h1, h2, h3, p { margin-top: var(--space-0); text-wrap: balance; }
p, li, label, td { text-wrap: pretty; }
h1 { margin-bottom: var(--space-100); font-size: var(--text-3xl); line-height: var(--line-3xl); font-weight: 600; }
h2 { margin: var(--space-0); font-size: var(--text-xl); line-height: var(--line-xl); font-weight: 600; }
h3 { margin: var(--space-0); font-size: var(--text-base); line-height: var(--line-base); font-weight: 600; }
small { font-size: var(--text-xs); line-height: var(--line-xs); }
small { text-wrap: pretty; }
button:focus-visible, a:focus-visible, summary:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: var(--space-25);
}
button:disabled { cursor: not-allowed; opacity: .56; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.brand-lockup { display: inline-flex; align-items: center; gap: var(--space-75); color: var(--ink); font-size: var(--text-lg); line-height: var(--line-lg); font-weight: 600; text-decoration: none; }
.brand-lockup b { color: var(--green); font-weight: 600; }
.brand-symbol { width: var(--space-400); height: var(--space-400); display: grid; flex: 0 0 var(--space-400); place-items: center; border-radius: var(--radius-md); background: var(--green); color: var(--surface); font-size: var(--text-base); line-height: var(--line-base); font-weight: 700; }
.status-dot { width: var(--space-75); height: var(--space-75); flex: 0 0 var(--space-75); border-radius: var(--radius-full); background: var(--green); }

.login-shell { min-height: 100dvh; display: grid; place-items: center; padding: var(--space-300); }
.login-card { width: min(100%, 480px); padding: var(--space-200); border: 1px solid var(--line); border-radius: var(--radius-xl); background: var(--surface); }
.login-card > .brand-lockup { margin-bottom: var(--space-300); }
.logged-out-chat-preview { display: grid; gap: var(--space-100); padding: var(--space-200); border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-soft); }
.preview-chat-head { display: flex; align-items: center; gap: var(--space-100); }
.assistant-avatar { width: var(--space-400); height: var(--space-400); display: grid; flex: 0 0 var(--space-400); place-items: center; border-radius: var(--radius-lg); background: var(--green-soft); color: var(--green-dark); font-size: var(--text-base); line-height: var(--line-base); font-weight: 600; }
.preview-chat-head > span:last-child { display: grid; }
.preview-chat-head b { font-size: var(--text-sm); line-height: var(--line-sm); font-weight: 600; }
.preview-chat-head small { color: var(--muted); }
.preview-bubble { width: fit-content; max-width: 100%; padding: var(--space-100); border-radius: var(--radius-none); background: var(--surface); color: var(--ink); font-size: var(--text-sm); line-height: var(--line-sm); }
.preview-composer { display: flex; align-items: center; justify-content: space-between; gap: var(--space-100); min-height: var(--space-600); padding: var(--space-75); border: 1px solid var(--line); border-radius: var(--radius-none); background: var(--surface); color: var(--quiet); font-size: var(--text-sm); line-height: var(--line-sm); }
.preview-composer button { min-height: var(--space-500); padding: var(--space-75) var(--space-100); border: 0; border-radius: var(--radius-sm); background: var(--green); color: var(--surface); font-size: var(--text-sm); line-height: var(--line-sm); font-weight: 600; }
.login-form { display: grid; gap: var(--space-75); margin-top: var(--space-300); }
/* One field-label style everywhere: 14/20, 600, ink. */
.login-form label, .edit-dialog label, .form-row label, .referral-form > label, .journal-row label, .filters label > span:first-child, .setting-row > span { color: var(--ink); font-size: var(--text-sm); line-height: var(--line-sm); font-weight: 600; }
.login-form input, .form-control, input:not([type="checkbox"]), textarea, select {
  width: 100%;
  min-height: var(--space-600);
  padding: var(--space-100);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font-size: var(--text-base);
  line-height: var(--line-base);
  font-weight: 400;
}
.login-form input:focus, input:focus, textarea:focus, select:focus { border-color: var(--green); }
.login-form .button { margin-top: var(--space-100); }
.form-error { min-height: var(--line-sm); margin: var(--space-0); color: var(--red); font-size: var(--text-sm); line-height: var(--line-sm); }
.demo-note { display: flex; align-items: flex-start; gap: var(--space-75); margin: var(--space-200) var(--space-0) var(--space-0); color: var(--muted); font-size: var(--text-sm); line-height: var(--line-sm); }

/* Button system (single base + variants). One tap size: 48px high, 8px radius, 8/16 padding, 14/20 600 label at every width.
   Variants: primary / secondary / ghost / danger / danger-ghost / chip, plus the .button-icon size (48x48 circle).
   Every variant has a colour press state (not transform-only), so it still shows under prefers-reduced-motion. */
.button { min-height: var(--space-600); display: inline-flex; align-items: center; justify-content: center; gap: var(--space-75); padding: var(--space-75) var(--space-200); border: 1px solid transparent; border-radius: var(--radius-md); background: transparent; color: var(--green-dark); font-size: var(--text-sm); line-height: var(--line-sm); font-weight: 600; text-align: center; text-decoration: none; transition: transform 500ms var(--motion), opacity 300ms var(--motion), background-color 120ms var(--motion), color 120ms var(--motion); }
.button, .nav-item, .pack-option { text-wrap: balance; }
.button:active:not(:disabled) { transform: scale(.98); transition-duration: 120ms, 120ms, 120ms, 120ms; }
.button-primary { background: var(--green); color: var(--surface); }
.button-primary:active:not(:disabled) { background: var(--green-dark); }
.button-secondary, .button-chip { border-color: var(--line-strong); background: var(--surface); color: var(--green-dark); }
.button-secondary:active:not(:disabled), .button-chip:active:not(:disabled) { background: var(--green-soft); }
.button-ghost { background: transparent; color: var(--green-dark); }
.button-ghost:active:not(:disabled) { background: var(--green-soft); }
.button-danger { background: var(--red); color: var(--surface); }
.button-danger:active:not(:disabled) { background: var(--red-dark); }
.button-danger-ghost { background: transparent; color: var(--red); }
.button-danger-ghost:active:not(:disabled) { background: var(--red-soft); }
.button-chip { border-radius: var(--radius-full); text-align: left; overflow-wrap: anywhere; }
.button-icon { width: var(--space-600); min-width: var(--space-600); height: var(--space-600); flex: 0 0 auto; padding: var(--space-0); border-radius: var(--radius-full); font-size: var(--text-xl); line-height: var(--line-xl); }
.button-wide { width: 100%; }
.button[aria-busy="true"], button[aria-busy="true"] { cursor: progress; opacity: .7; }

.portal-shell { height: 100dvh; min-height: 0; display: grid; grid-template-columns: 220px minmax(0, 1fr); align-items: stretch; overflow: hidden; }
.sidebar { position: sticky; z-index: 6; top: var(--space-0); width: auto; height: 100dvh; display: flex; grid-column: 1; grid-row: 1; flex-direction: column; padding: var(--space-300) var(--space-200); border-right: 1px solid var(--line); background: var(--surface); }
.sidebar-brand { margin-bottom: var(--space-400); }
.main-nav { display: grid; gap: var(--space-50); }
.nav-item { width: 100%; min-height: var(--space-600); display: flex; align-items: center; gap: var(--space-100); padding: var(--space-75) var(--space-100); border: 1px solid transparent; border-radius: var(--radius-md); background: transparent; color: var(--muted); font-size: var(--text-base); line-height: var(--line-base); text-align: left; transition: transform 500ms var(--motion), opacity 300ms var(--motion); }
.nav-item:active:not(:disabled) { transform: scale(.98); }
.nav-item.active { background: var(--green-soft); color: var(--green-dark); font-weight: 600; }
.nav-count { min-width: var(--space-300); margin-left: auto; padding: var(--space-25) var(--space-50); border-radius: var(--radius-full); background: var(--surface); color: var(--muted); font-size: var(--text-xs); line-height: var(--line-xs); text-align: center; }
.profile-row { display: flex; align-items: center; gap: var(--space-75); margin-top: auto; padding-top: var(--space-200); border-top: 1px solid var(--line); }
.profile-avatar { width: var(--space-400); height: var(--space-400); display: grid; flex: 0 0 var(--space-400); place-items: center; border-radius: var(--radius-full); background: var(--green-soft); color: var(--green-dark); font-size: var(--text-sm); line-height: var(--line-sm); font-weight: 600; }
.profile-row > span:nth-child(2) { min-width: 0; display: grid; }
.profile-row b { font-size: var(--text-xs); line-height: var(--line-xs); font-weight: 600; }
.profile-row small { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile-row .button-ghost { margin-left: auto; }
.content-area { min-width: 0; height: 100dvh; min-height: 0; grid-column: 2; grid-row: 1; padding: var(--space-0) var(--space-400) var(--space-400); overflow-y: auto; overscroll-behavior: contain; }
.topbar { position: sticky; z-index: 4; top: var(--space-0); min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: var(--space-200); border-bottom: 1px solid var(--line); background: var(--paper); }
.chat-header-context { min-width: 0; display: flex; align-items: center; gap: var(--space-100); }
.chat-header-context > span:last-child { min-width: 0; display: grid; }
.chat-header-context b { font-size: var(--text-base); line-height: var(--line-base); font-weight: 600; }
.chat-header-context small { display: flex; align-items: center; gap: var(--space-75); color: var(--muted); }
.page-context { color: var(--muted); font-size: var(--text-sm); line-height: var(--line-sm); }
.topbar-right { display: flex; align-items: center; gap: var(--space-100); }
.view-panel { width: 100%; }
.page-view { max-width: 1120px; margin: var(--space-0) auto; padding: var(--space-400) var(--space-0) var(--space-700); }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: var(--space-300); margin-bottom: var(--space-300); }
.page-heading h1 { margin-bottom: var(--space-50); }
.page-heading p { margin-bottom: var(--space-0); color: var(--muted); font-size: var(--text-base); line-height: var(--line-base); }
.page-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-75); }
.metric-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-200); margin-bottom: var(--space-200); }
.metric-card { min-width: 0; min-height: 128px; display: grid; align-content: start; gap: var(--space-75); padding: var(--space-200); border: 1px solid var(--line); border-radius: var(--radius-xl); background: var(--surface); }
.metric-label { color: var(--muted); font-size: var(--text-sm); line-height: var(--line-sm); }
.metric-card strong { color: var(--green-dark); font-size: var(--text-2xl); line-height: var(--line-2xl); font-weight: 600; overflow-wrap: anywhere; }
.metric-card small { color: var(--muted); }
.dashboard-card, .panel-card { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius-xl); background: var(--surface); }
.manual-entry { margin-bottom: var(--space-200); }
.manual-entry > summary, .disclosure-section > summary { min-height: var(--space-600); display: flex; align-items: center; justify-content: space-between; gap: var(--space-200); padding: var(--space-100) var(--space-200); border-radius: var(--radius-xl); color: var(--ink); font-size: var(--text-base); line-height: var(--line-base); font-weight: 600; cursor: pointer; list-style: none; }
.manual-entry > summary::-webkit-details-marker, .disclosure-section > summary::-webkit-details-marker { display: none; }
.manual-entry > summary::after, .disclosure-section > summary::after { color: var(--green); content: "Buka"; font-size: var(--text-sm); line-height: var(--line-sm); font-weight: 600; }
.manual-entry[open] > summary::after, .disclosure-section[open] > summary::after { content: "Tutup"; }
.manual-entry-content, .disclosure-content { padding: var(--space-0) var(--space-200) var(--space-200); }
.disclosure-section .disclosure-content { padding: var(--space-0) var(--space-200) var(--space-200); }
.manual-entry-content > p { margin: var(--space-0) var(--space-0) var(--space-200); color: var(--muted); font-size: var(--text-sm); line-height: var(--line-sm); }
.manual-rows { display: grid; gap: var(--space-100); }
.journal-row { min-width: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-100); margin: var(--space-0); padding: var(--space-200); border: 1px solid var(--line); border-radius: var(--radius-none); }
.journal-row legend { padding: var(--space-0) var(--space-50); color: var(--green-dark); font-size: var(--text-sm); line-height: var(--line-sm); font-weight: 600; }
.journal-row label, .setting-row { min-width: 0; display: grid; gap: var(--space-50); }
.journal-row input, .journal-row select, .setting-row input, .setting-row select, .filters input, .filters select, .referral-form input, .form-row select, .edit-dialog input, .edit-dialog select { min-width: 0; min-height: var(--space-600); padding: var(--space-100); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); font-size: var(--text-base); line-height: var(--line-base); font-weight: 400; }
.journal-row input, .journal-row select, .filters input, .filters select, .edit-dialog input, .edit-dialog select { border-radius: var(--radius-sm); }
.journal-remove { justify-self: start; }
.journal-row-error { grid-column: 1 / -1; color: var(--red); font-size: var(--text-sm); line-height: var(--line-sm); }
.manual-actions { display: flex; flex-wrap: wrap; gap: var(--space-75); margin-top: var(--space-200); }
.manual-fee-summary, .manual-review-fee-total { margin-top: var(--space-100); color: var(--muted); font-size: var(--text-sm); line-height: var(--line-sm); }
.manual-errors { margin-top: var(--space-100); }
.manual-review { margin-top: var(--space-300); padding-top: var(--space-200); border-top: 1px solid var(--line); }
.manual-review .dashboard-head { padding: var(--space-0) var(--space-0) var(--space-100); }
.manual-review-rows { display: grid; gap: var(--space-75); margin: var(--space-0); padding-left: var(--space-300); color: var(--muted); font-size: var(--text-sm); line-height: var(--line-sm); }
.manual-review-fee-total { color: var(--green-dark); font-weight: 600; }
.transaction-list { overflow: hidden; }
.dashboard-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-200); padding: var(--space-200); }
.dashboard-head h2 { margin-bottom: var(--space-50); }
.dashboard-head p { margin: var(--space-0); color: var(--muted); font-size: var(--text-sm); line-height: var(--line-sm); }
.filters { display: flex; flex-wrap: wrap; gap: var(--space-100); }
.filters label { min-width: 144px; display: grid; gap: var(--space-50); }
.category-strip { display: flex; flex-wrap: wrap; gap: var(--space-75); padding: var(--space-0) var(--space-200) var(--space-200); }
.category-chip { max-width: 100%; display: flex; align-items: center; gap: var(--space-75); padding: var(--space-75) var(--space-100); border-radius: var(--radius-md); background: var(--surface-soft); color: var(--muted); font-size: var(--text-sm); line-height: var(--line-sm); overflow-wrap: anywhere; }
.category-chip { border-radius: var(--radius-none); }
.category-chip b { color: var(--green-dark); font-weight: 600; }
.table-scroll { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th { padding: var(--space-100); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--muted); font-size: var(--text-xs); line-height: var(--line-xs); font-weight: 600; }
th:first-child, td:first-child { padding-left: var(--space-200); }
td { padding: var(--space-100); border-bottom: 1px solid var(--line); color: var(--muted); font-size: var(--text-sm); line-height: var(--line-sm); vertical-align: middle; }
td:nth-child(2) { color: var(--ink); font-weight: 600; }
.align-right { text-align: right; }
td.align-right { color: var(--green-dark); font-weight: 600; white-space: nowrap; }
.table-actions { display: flex; justify-content: flex-end; gap: var(--space-50); }
.empty-state { display: grid; justify-items: center; gap: var(--space-100); padding: var(--space-400) var(--space-200); color: var(--muted); text-align: center; }
.empty-state b { color: var(--ink); font-size: var(--text-lg); line-height: var(--line-lg); font-weight: 600; }
.empty-state p { max-width: 480px; margin: var(--space-0); font-size: var(--text-base); line-height: var(--line-base); }
.proof-note { margin: var(--space-200) var(--space-0) var(--space-0); color: var(--muted); font-size: var(--text-sm); line-height: var(--line-sm); }

.account-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-200); align-items: start; }
.account-main-column, .account-side-column { min-width: 0; display: grid; align-content: start; gap: var(--space-200); }
.balance-card { padding: var(--space-200); border-radius: var(--radius-xl); background: var(--green-dark); color: var(--surface); }
.balance-card-top { display: flex; justify-content: space-between; gap: var(--space-100); color: var(--green-soft); font-size: var(--text-sm); line-height: var(--line-sm); }
.balance-card > strong { display: block; margin: var(--space-100) var(--space-0); font-size: var(--text-2xl); line-height: var(--line-2xl); font-weight: 600; overflow-wrap: anywhere; }
.balance-meta { display: flex; flex-wrap: wrap; gap: var(--space-75); align-items: center; color: var(--green-soft); font-size: var(--text-sm); line-height: var(--line-sm); }
.expiry-warning { color: var(--surface); font-weight: 600; }
.low-balance-warning { margin: var(--space-100) var(--space-0) var(--space-0); color: var(--surface); font-size: var(--text-sm); line-height: var(--line-sm); }
.panel-card { padding: var(--space-200); }
.panel-card .button { border-radius: var(--radius-md); }
.panel-card input:not([type="checkbox"]), .panel-card select { border-radius: var(--radius-sm); }
.panel-card.disclosure-section { padding: var(--space-0); }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-100); }
.panel-heading .body-copy { margin-bottom: var(--space-0); }
.body-copy { margin: var(--space-100) var(--space-0) var(--space-0); color: var(--muted); font-size: var(--text-sm); line-height: var(--line-sm); }
.usage-card .body-copy { margin-bottom: var(--space-100); }
.extra-toggle { display: flex; align-items: flex-start; gap: var(--space-100); padding: var(--space-100); border-radius: var(--radius-sm); background: var(--surface-soft); }
.extra-toggle input, .acknowledge input { width: var(--space-200); height: var(--space-200); flex: 0 0 var(--space-200); margin: var(--space-25) var(--space-0) var(--space-0); accent-color: var(--green); }
.extra-toggle span { display: grid; gap: var(--space-50); }
.extra-toggle b { color: var(--ink); font-size: var(--text-sm); line-height: var(--line-sm); font-weight: 600; }
.extra-toggle small { color: var(--muted); text-wrap: pretty; }
.referral-code { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-100); margin-top: var(--space-200); padding: var(--space-100); border-radius: var(--radius-sm); background: var(--surface-soft); }
.referral-code .button { border-radius: var(--radius-md); }
.referral-code code { color: var(--green-dark); font-family: Geist; font-size: var(--text-xl); line-height: var(--line-xl); font-weight: 600; }
.referral-form { display: grid; gap: var(--space-75); margin-top: var(--space-200); }
.referral-form > div { display: flex; align-items: center; gap: var(--space-75); }
.referral-form input { flex: 1; }
.referral-form small { min-height: var(--line-sm); color: var(--muted); text-wrap: pretty; }
.pack-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-75); margin: var(--space-200) var(--space-0); }
.pack-option { min-width: 0; min-height: var(--space-700); display: grid; align-content: center; gap: var(--space-50); padding: var(--space-100); border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--muted); text-align: left; }
.pack-option[aria-pressed="true"] { border-color: var(--green); background: var(--green-soft); }
.pack-option:active:not(:disabled) { transform: scale(.98); }
.pack-option b { color: var(--ink); font-size: var(--text-base); line-height: var(--line-base); font-weight: 600; }
.pack-option small { color: var(--muted); }
.form-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: var(--space-100); margin: var(--space-200) var(--space-0); }
.acknowledge { display: flex; align-items: flex-start; gap: var(--space-75); margin: var(--space-200) var(--space-0); color: var(--muted); font-size: var(--text-sm); line-height: var(--line-sm); }
.inline-result { display: grid; gap: var(--space-100); margin-top: var(--space-100); padding: var(--space-100); border-radius: var(--radius-sm); background: var(--green-soft); color: var(--green-dark); font-size: var(--text-sm); line-height: var(--line-sm); }
.inline-result p { margin: var(--space-0); }
.topup-history-rows { display: grid; gap: var(--space-75); }
.topup-history-row { display: flex; justify-content: space-between; gap: var(--space-100); padding: var(--space-100) var(--space-0); border-bottom: 1px solid var(--line); color: var(--muted); font-size: var(--text-sm); line-height: var(--line-sm); }
.topup-history-row b { color: var(--green-dark); font-weight: 600; }
.topup-history-row small { display: block; margin-top: var(--space-50); color: var(--muted); }
.setting-row { margin-bottom: var(--space-100); }
.workspace-card .disclosure-content { padding-bottom: var(--space-200); }
.workspace-status { display: flex; align-items: center; gap: var(--space-75); margin: var(--space-100) var(--space-0); color: var(--green-dark); font-size: var(--text-sm); line-height: var(--line-sm); }
.workspace-details { margin: var(--space-0) var(--space-0) var(--space-200); padding: var(--space-100) var(--space-0); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.workspace-details div { display: flex; justify-content: space-between; gap: var(--space-100); padding: var(--space-50) var(--space-0); }
.workspace-details dt, .workspace-details dd { font-size: var(--text-sm); line-height: var(--line-sm); }
.workspace-details dt { color: var(--muted); }
.workspace-details dd { max-width: 58%; margin: var(--space-0); overflow-wrap: anywhere; color: var(--ink); text-align: right; }
.workspace-card .button + .button { margin-top: var(--space-100); }
.history-card { margin-top: var(--space-200); }
.lifecycle-list { display: grid; gap: var(--space-100); color: var(--muted); }
.lifecycle-list > p { margin: var(--space-0); font-size: var(--text-sm); line-height: var(--line-sm); }
.lifecycle-row { display: grid; gap: var(--space-50); padding: var(--space-100) var(--space-0); border-bottom: 1px solid var(--line); }
.lifecycle-row b { color: var(--ink); font-size: var(--text-sm); line-height: var(--line-sm); font-weight: 600; }
.lifecycle-row small { display: block; color: var(--muted); }

.chat-layout { height: calc(100dvh - 72px); min-height: 0; display: grid; grid-template-rows: minmax(0, 1fr) auto; overflow: hidden; }
#portal-view[data-active-view="chat"] { height: 100dvh; min-height: 0; overflow: hidden; }
#portal-view[data-active-view="chat"] .content-area { height: 100dvh; min-height: 0; display: grid; grid-template-rows: 72px minmax(0, 1fr); padding: var(--space-0); overflow: hidden; }
#portal-view[data-active-view="chat"] .topbar { position: relative; min-width: 0; padding: var(--space-0) var(--space-300); border: 0; background: var(--surface); }
#portal-view[data-active-view="chat"] .page-context { display: none; }
#portal-view[data-active-view="chat"] .portal-footer { display: none; }
#portal-view[data-active-view="chat"] .chat-layout { width: 100%; height: 100%; min-height: 0; margin: var(--space-0); padding: var(--space-0); }
.messages { min-width: 0; min-height: 0; display: flex; flex-direction: column; align-items: stretch; gap: var(--space-100); overflow-x: hidden; overflow-y: auto; padding: var(--space-300); background: var(--surface-soft); overscroll-behavior: contain; scrollbar-width: thin; }
#message-list { width: 100%; min-width: 0; display: flex; flex-direction: column; gap: var(--space-200); }
.message { width: fit-content; max-width: min(78%, 720px); min-width: 0; display: grid; gap: var(--space-50); }
.message.user { align-self: flex-end; }
.message.assistant { align-self: flex-start; }
.message-bubble { padding: var(--space-100) var(--space-200); border: 0; border-radius: var(--radius-xl); background: var(--surface); color: var(--ink); font-size: var(--text-base); line-height: var(--line-base); white-space: pre-wrap; overflow-wrap: anywhere; box-shadow: 0 var(--space-25) var(--space-25) var(--shadow-soft); }
.message-photo-link { display: block; overflow: hidden; border-radius: var(--radius-sm); }
.message-photo { display: block; width: min(240px, 62vw); max-height: 320px; object-fit: cover; }
.message-document-link { min-width: 0; display: flex; align-items: center; gap: var(--space-100); padding: var(--space-100); border: 1px solid var(--line); border-radius: var(--radius-sm); color: inherit; text-decoration: none; }
.document-file-icon { width: 40px; height: 44px; flex: 0 0 auto; display: grid; place-items: center; border-radius: var(--radius-sm); background: var(--green-soft); color: var(--green-dark); font-size: var(--text-2xl); line-height: var(--line-2xl); }
.message-document-details, .document-preview-details > span:last-child { min-width: 0; display: grid; gap: var(--space-25); }
.message-document-details b, .document-preview-details b { overflow-wrap: anywhere; font-size: var(--text-sm); line-height: var(--line-sm); }
.message-document-details small, .document-preview-details small { color: var(--muted); font-size: var(--text-xs); line-height: var(--line-xs); }
.message-document-link:active { background: var(--green-soft); }
.message-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.message.assistant .message-bubble { border-bottom-left-radius: var(--radius-sm); }
.message.user .message-bubble { border-bottom-right-radius: var(--radius-sm); background: var(--green-soft); color: var(--ink); }
.message-meta { display: flex; align-items: center; justify-content: flex-end; gap: var(--space-75); margin-top: var(--space-50); color: var(--muted); font-size: var(--text-xs); line-height: var(--line-xs); }
.message.user .message-meta { color: var(--muted); }
.header-view-switch { display: none; }
.channel-tag { color: var(--muted); }
.welcome-card { width: fit-content; max-width: min(92%, 560px); min-width: 0; align-self: flex-start; margin: var(--space-0); padding: var(--space-200); border: 0; border-radius: var(--radius-xl); border-bottom-left-radius: var(--radius-sm); background: var(--surface); color: var(--ink); overflow-wrap: anywhere; box-shadow: 0 var(--space-25) var(--space-25) var(--shadow-soft); }
.welcome-card h1 { margin: var(--space-0) var(--space-0) var(--space-75); font-size: var(--text-lg); line-height: var(--line-lg); font-weight: 600; }
.welcome-card p { margin: var(--space-0); font-size: var(--text-base); line-height: var(--line-base); }
.welcome-card .self-chat-line { margin-top: var(--space-100); color: var(--muted); font-size: var(--text-sm); line-height: var(--line-sm); }
.self-chat-line a { display: inline-flex; min-height: var(--space-600); align-items: center; font-weight: 600; text-decoration-thickness: 1px; text-underline-offset: var(--space-25); }
.welcome-prompts { display: flex; flex-wrap: wrap; gap: var(--space-75); margin-top: var(--space-200); }
.welcome-prompts .button { max-width: 100%; }
.composer-dock { position: relative; min-width: 0; padding: var(--space-200) var(--space-300); background: var(--paper); }
.chat-composer { width: min(100%, 960px); display: flex; align-items: flex-end; gap: var(--space-100); margin: var(--space-0) auto; padding: var(--space-75); border: 0; border-radius: var(--radius-full); background: var(--surface); box-shadow: 0 var(--space-25) var(--space-50) var(--shadow-soft); }
.chat-composer textarea { width: 100%; min-width: 0; min-height: var(--space-600); max-height: 120px; resize: none; padding: var(--space-100); border: 0; border-radius: var(--radius-sm); outline: 0; background: transparent; color: var(--ink); font-size: var(--text-base); line-height: var(--line-base); }
.chat-composer textarea:focus { border: 0; outline: 0; box-shadow: none; }
.photo-picker { position: relative; flex: 0 0 auto; }
.photo-add-button { width: 48px; height: 48px; font-weight: 400; }
.photo-add-button:disabled { opacity: .55; }
.photo-picker-menu { position: absolute; z-index: 20; bottom: calc(100% + var(--space-100)); left: var(--space-0); width: 176px; display: grid; gap: var(--space-50); padding: var(--space-75); border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: 0 var(--space-75) var(--space-300) var(--shadow-popover); }
.photo-picker-menu[hidden], .photo-preview[hidden] { display: none; }
.photo-picker-menu button { min-height: var(--space-600); padding: var(--space-100); border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--ink); font: inherit; text-align: left; }
.photo-picker-menu button:active { background: var(--green-soft); }
.photo-preview { width: min(100%, 960px); display: flex; align-items: center; gap: var(--space-100); margin: var(--space-0) auto var(--space-100); }
.photo-preview img { width: 72px; height: 72px; object-fit: cover; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); }
.document-preview-details { min-width: 0; display: flex; align-items: center; gap: var(--space-100); padding: var(--space-75) var(--space-100); border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); }
.document-preview-details[hidden] { display: none; }
.document-preview-details .document-file-icon { width: 36px; height: 40px; }
.remove-photo-button { position: relative; width: var(--space-400); height: var(--space-400); display: grid; place-items: center; margin-left: var(--space-neg-500); margin-top: var(--space-neg-500); padding: var(--space-0); border: 1px solid var(--surface); border-radius: var(--radius-full); background: var(--ink-overlay); color: var(--surface); font-size: var(--text-xl); line-height: var(--line-xl); }
.remove-photo-button::after { position: absolute; inset: calc(var(--space-0) - var(--space-75)); content: ""; }
.send-button { width: var(--space-600); height: var(--space-600); }
/* Loading state (iteration 5): keep the 48px send circle while sending; pulse opacity only, instead of squeezing the word Mengirim into the circle. Reduced-motion already disables animation. */
.send-button[aria-busy="true"] { animation: send-pulse 1.2s var(--motion) infinite; }
@keyframes send-pulse { 0%, 100% { opacity: .7; } 50% { opacity: 1; } }
.chat-error { width: min(100%, 960px); margin: var(--space-0) auto var(--space-75); color: var(--red); font-size: var(--text-sm); line-height: var(--line-sm); }
.proposal-card { min-width: 280px; white-space: normal; }
.proposal-title { display: block; margin-bottom: var(--space-100); font-size: var(--text-sm); line-height: var(--line-sm); font-weight: 600; }
.proposal-row { display: flex; justify-content: space-between; gap: var(--space-200); padding: var(--space-100) var(--space-0); border-top: 1px solid var(--line); }
.proposal-left { min-width: 0; display: grid; gap: var(--space-25); font-size: var(--text-sm); line-height: var(--line-sm); }
.proposal-kind { color: var(--green-dark); }
.proposal-extra { color: var(--muted); font-size: var(--text-xs); line-height: var(--line-xs); }
.proposal-amount { flex: 0 0 auto; color: var(--green-dark); font-size: var(--text-base); line-height: var(--line-base); white-space: nowrap; }
.proposal-fee { margin-top: var(--space-75); color: var(--muted); font-size: var(--text-sm); line-height: var(--line-sm); }
.proposal-actions { display: flex; gap: var(--space-75); margin-top: var(--space-200); }
.proposal-actions .button { flex: 1; }
/* Native feel: no iOS focus zoom, safe-area padding, momentum scroll. */
.messages { -webkit-overflow-scrolling: touch; }
button { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }

.portal-footer { display: flex; justify-content: space-between; gap: var(--space-200); padding: var(--space-200) var(--space-0); border-top: 1px solid var(--line); color: var(--muted); font-size: var(--text-sm); line-height: var(--line-sm); }
.portal-footer a { color: var(--green-dark); font-weight: 600; text-decoration: none; }
.faq-dialog, .edit-dialog { width: min(640px, calc(100vw - var(--space-400))); max-width: none; max-height: min(82dvh, 760px); overflow: auto; padding: var(--space-200); border: 1px solid var(--line); border-radius: var(--radius-xl); background: var(--surface); color: var(--ink); }
/* Motion audit (iteration 9): FAQ and edit dialogs fade in and settle from
   a slight rise/scale instead of appearing instantly. Transform and opacity
   only, existing --motion ease-out curve, 250ms/200ms (modal budget
   200-500ms). @starting-style + allow-discrete give a matching fade-out
   where the browser supports it; older browsers fall back to instant,
   which is today's behaviour. Reduced-motion is handled below. */
.faq-dialog, .edit-dialog { transition: transform 250ms var(--motion), opacity 200ms var(--motion); transition-behavior: allow-discrete; }
.faq-dialog:not([open]), .edit-dialog:not([open]) { opacity: 0; transform: translateY(8px) scale(.97); }
@starting-style { .faq-dialog[open], .edit-dialog[open] { opacity: 0; transform: translateY(8px) scale(.97); } }
.faq-dialog::backdrop, .edit-dialog::backdrop { transition: opacity 200ms var(--motion); transition-behavior: allow-discrete; }
@starting-style { .faq-dialog[open]::backdrop, .edit-dialog[open]::backdrop { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .faq-dialog, .edit-dialog, .faq-dialog::backdrop, .edit-dialog::backdrop { transition: none; } }
.faq-dialog::backdrop, .edit-dialog::backdrop { background: var(--scrim); }
.faq-dialog-head, .dialog-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-200); margin-bottom: var(--space-200); color: var(--ink); font-size: var(--text-lg); line-height: var(--line-lg); font-weight: 600; }
.global-faq { display: grid; gap: var(--space-100); }
.faq-section > summary { min-height: var(--space-600); display: flex; align-items: center; padding: var(--space-100); border: 1px solid var(--line); border-radius: var(--radius-none); font-size: var(--text-base); line-height: var(--line-base); font-weight: 600; cursor: pointer; }
.faq-section summary { text-wrap: balance; }
.faq-section details { padding: var(--space-100); border: 1px solid var(--line); border-radius: var(--radius-none); background: var(--surface); }
.faq-section details > summary { color: var(--green-dark); font-size: var(--text-base); line-height: var(--line-base); font-weight: 600; cursor: pointer; }
.faq-section details > summary { min-height: var(--space-600); display: flex; align-items: center; padding: var(--space-75) var(--space-0); }
.faq-section p { margin: var(--space-100) var(--space-0) var(--space-0); color: var(--muted); font-size: var(--text-sm); line-height: var(--line-sm); }
.edit-dialog form { display: grid; gap: var(--space-100); }
.edit-dialog .dialog-head { margin-bottom: var(--space-100); }
.dialog-head h2 { font-size: var(--text-lg); line-height: var(--line-lg); }
.edit-dialog label { display: grid; gap: var(--space-50); }
.dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--space-75); margin-top: var(--space-100); }
.toast { position: fixed; z-index: 10; right: var(--space-300); bottom: var(--space-300); max-width: min(420px, calc(100vw - var(--space-400))); padding: var(--space-100) var(--space-200); border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); color: var(--ink); font-size: var(--text-sm); line-height: var(--line-sm); opacity: 0; pointer-events: none; transform: translateY(var(--space-75)); transition: transform 500ms var(--motion), opacity 300ms var(--motion); }
.toast.visible { opacity: 1; pointer-events: auto; transform: translateY(0); }

@media (max-width: 900px) {
  .content-area { padding-right: var(--space-300); padding-left: var(--space-300); }
  .journal-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-head { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 700px) {
  .portal-shell { height: 100dvh; display: block; }
  .sidebar { display: none; }
  .sidebar-brand, .profile-row { display: none; }
  .nav-faq { display: none; }
  .drawer-button { display: grid; place-items: center; width: 40px; height: 40px; flex: 0 0 40px; border: 1px solid var(--line); border-radius: var(--radius-full); background: var(--surface); color: var(--ink); cursor: pointer; }
  .drawer-button .nav-icon { display: block; width: var(--space-300); height: var(--space-300); }
  .drawer-scrim { display: block; position: fixed; inset: 0; background: var(--ink-overlay); opacity: 0; visibility: hidden; transition: opacity 300ms var(--motion), visibility 300ms var(--motion); z-index: 60; }
  .drawer-scrim.open { opacity: 1; visibility: visible; }
  .drawer { display: flex; flex-direction: column; position: fixed; top: 0; left: 0; width: min(320px, 85vw); height: 100dvh; padding: var(--space-300) var(--space-200); background: var(--surface); box-shadow: 2px 0 24px var(--shadow-popover); transform: translateX(-105%); visibility: hidden; transition: transform 300ms var(--motion), visibility 300ms var(--motion); z-index: 61; overflow-y: auto; }
  .drawer.open { transform: translateX(0); visibility: visible; }
  .drawer-head { padding: var(--space-100) var(--space-100) var(--space-300); }
  .drawer-title { font-size: var(--text-3xl); line-height: var(--line-3xl); font-weight: 700; }
  .drawer-section-label { margin: var(--space-300) var(--space-100) var(--space-100); color: var(--muted); font-size: var(--text-xs); line-height: var(--line-xs); font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; }
  .drawer-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-25); }
  .drawer-list button { width: 100%; display: flex; align-items: center; gap: var(--space-100); padding: var(--space-100); border: 0; border-radius: var(--radius-md); background: transparent; color: var(--ink); font-size: var(--text-base); line-height: var(--line-base); text-align: left; cursor: pointer; }
  .drawer-list button.active { background: var(--green-soft); font-weight: 600; }
  .drawer-list button:disabled { opacity: 0.6; cursor: default; }
  .drawer-list .nav-icon { display: block; width: var(--space-300); height: var(--space-300); flex: 0 0 var(--space-300); }
  .drawer-list small { margin-left: auto; color: var(--muted); font-size: var(--text-xs); line-height: var(--line-xs); text-align: right; }
  .drawer-whatsapp-icon { color: #25d366; }
  .drawer-foot { margin-top: auto; display: flex; align-items: center; gap: var(--space-100); padding-top: var(--space-300); border-top: 1px solid var(--line); }
  .drawer-foot button { border: 0; background: transparent; color: var(--ink); font-size: var(--text-base); cursor: pointer; }
  .drawer-foot .nav-icon { display: block; width: var(--space-300); height: var(--space-300); }
  .nav-count { min-width: 0; margin: var(--space-0); padding: var(--space-0); background: transparent; }
  .content-area { height: 100dvh; min-height: 0; margin-left: var(--space-0); padding: var(--space-0) var(--space-200) var(--space-400); overflow-y: auto; }
  .topbar { min-height: calc(var(--space-700) + env(safe-area-inset-top)); padding-top: env(safe-area-inset-top); gap: var(--space-100); }
  .chat-header-context { gap: var(--space-75); }
  .chat-header-context .assistant-avatar { width: var(--space-300); height: var(--space-300); flex-basis: var(--space-300); border-radius: var(--radius-md); }
  .chat-header-context .status-dot { width: var(--space-50); height: var(--space-50); flex-basis: var(--space-50); }
  /* Header buttons keep the 48px/8px/14px system but use 4px side padding here: with 8/16 the three header links total ~240px and squeeze the assistant name to 0px at 320px. */
  .topbar .button { padding-inline: var(--space-50); white-space: nowrap; }
  .chat-header-context b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .page-context { display: none; }
  .page-view { padding: var(--space-300) var(--space-0) var(--space-600); }
  .page-heading { align-items: flex-start; flex-direction: column; gap: var(--space-200); }
  .page-heading h1 { font-size: var(--text-2xl); line-height: var(--line-2xl); }
  .page-actions { width: 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page-actions .button { min-width: 0; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-200); }
  .metric-card { min-height: 112px; padding: var(--space-200); border-radius: var(--radius-lg); }
  .dashboard-head { gap: var(--space-200); padding: var(--space-200); }
  .filters { width: 100%; min-width: 0; flex-direction: column; box-sizing: border-box; }
  /* FIX 2026-11-04, month slicer box cut on real iPhone: .filters is a flex
     item inside .dashboard-head, and its default min-width:auto let its
     content's intrinsic width push it past the card, where
     .transaction-list overflow:hidden then clipped its right edge.
     min-width:0 lets the flex item actually shrink to the card. */
  /* FIX 2026-11-02, filters overlapping on real iPhone: the month input
     is intrinsically wider in iOS Safari than in desktop WebKit/Chromium,
     and a grid label's default min-width:auto let it overflow into the
     next field, so Bulan and Kategori overlapped. Stacking the two
     fields full-width removes the side-by-side fight entirely, and
     width:100% + min-width:0 on the controls stops any intrinsic
     picker width from overflowing its own field. */
  .filters label { min-width: 0; flex: none; width: 100%; max-width: 100%; overflow: hidden; grid-template-columns: minmax(0, 1fr); }
  .filters input, .filters select { width: 100%; max-width: 100%; min-width: 0; min-height: var(--space-600); font-size: var(--text-base); line-height: var(--line-base); }
  /* Explicit 48px: a 16/24 select in Chromium otherwise grows to 49px, and WebKit ignores min-height on a closed select. */
  .filters select { height: var(--space-600); padding-block: var(--space-0); }
  /* FIX 2026-11-04, month box right border cut on real iPhone: iOS Safari
     renders the month input a few pixels wider than its CSS box, so the
     input's own right border was clipped by the label's overflow:hidden —
     top/bottom lines ended square, with no right border or rounded corner,
     while the Kategori select (which fits) showed a complete box. The box
     now lives on a wrapper: the wrapper's border is always complete and
     rounded, and the input inside it is borderless, so any iOS over-width
     clips only input content, never the box itself. */
  /* Month box = same 48px box as Kategori: flex centres the borderless input
     vertically, and the iOS date value is left-aligned with no UA margin so the
     value starts at the same 12px inset as the Kategori value. */
  .filters .month-box { display: flex; align-items: center; width: 100%; max-width: 100%; height: var(--space-600); overflow: hidden; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); box-sizing: border-box; }
  .filters .month-box #filter-month { -webkit-appearance: none; appearance: none; width: 100%; max-width: 100%; min-width: 0; min-height: 0; height: 100%; padding-block: var(--space-0); padding-inline: var(--space-100); border: 0; border-radius: 0; background: transparent; text-align: left; }
  .filters .month-box #filter-month::-webkit-date-and-time-value { margin: 0; text-align: left; }
  .filters .month-box #filter-month::-webkit-datetime-edit { padding: 0; }
  .category-strip { padding: var(--space-0) var(--space-100) var(--space-100); }
  .category-chip { border-radius: var(--radius-sm); }
  .table-scroll { overflow: visible; padding: var(--space-0) var(--space-100) var(--space-100); }
  table, tbody { width: 100%; display: block; }
  thead { display: none; }
  tr { display: grid; gap: var(--space-50); margin-bottom: var(--space-100); padding: var(--space-200); border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
  td, th:first-child, td:first-child { min-width: 0; display: grid; grid-template-columns: minmax(88px, 1fr) minmax(0, 1.5fr); gap: var(--space-100); padding: var(--space-50) var(--space-0); border: 0; text-align: left; overflow-wrap: anywhere; }
  td::before { color: var(--muted); content: attr(data-label); font-size: var(--text-xs); line-height: var(--line-xs); }
  td.align-right { color: var(--green-dark); white-space: normal; }
  .table-actions-cell { display: block; }
  .table-actions-cell::before { content: ""; }
  .table-actions { justify-content: flex-start; }
  .empty-state { padding: var(--space-300) var(--space-200); }
  .account-grid { grid-template-columns: minmax(0, 1fr); gap: var(--space-200); }
  .account-main-column, .account-side-column { gap: var(--space-200); }
  .balance-card { padding: var(--space-200); }
  .balance-card { border-radius: var(--radius-lg); }
  .panel-card { padding: var(--space-200); border-radius: var(--radius-lg); }
  .panel-card .button, .referral-code .button { border-radius: var(--radius-md); }
  .panel-card input:not([type="checkbox"]), .panel-card select, .extra-toggle, .referral-code { border-radius: var(--radius-sm); }
  .disclosure-section > summary { padding: var(--space-75) var(--space-100); }
  .disclosure-content { padding: var(--space-0) var(--space-200) var(--space-200); }
  .referral-form > div { align-items: stretch; flex-direction: column; }
  .referral-code { align-items: flex-start; }
  .form-row { grid-template-columns: minmax(0, 1fr); }
  .journal-row { grid-template-columns: minmax(0, 1fr); }
  .proof-note { margin-top: var(--space-100); }
  .portal-footer { padding: var(--space-100) var(--space-0); }
  .chat-layout { height: 100%; }
  #portal-view[data-active-view="chat"] { height: 100dvh; }
  #portal-view[data-active-view="chat"] .content-area { height: 100dvh; min-height: 0; grid-template-rows: var(--space-700) minmax(0, 1fr); padding: var(--space-0); }
  #portal-view[data-active-view="chat"] .topbar { min-height: calc(var(--space-700) + env(safe-area-inset-top)); padding: env(safe-area-inset-top) var(--space-100) var(--space-0); }
  .messages { gap: var(--space-100); padding: var(--space-100); }
  #message-list { gap: var(--space-100); }
  .message { max-width: 92%; }
  .message-bubble { padding: var(--space-100); border-radius: var(--radius-lg); }
  .message-photo-link, .message-document-link { border-radius: var(--radius-md); }
  .welcome-card { max-width: 100%; padding: var(--space-100); border-radius: var(--radius-lg); }
  .welcome-card .self-chat-line { margin-top: var(--space-75); }
  .welcome-prompts { gap: var(--space-50); margin-top: var(--space-100); }
  .composer-dock { padding: var(--space-75) var(--space-100) calc(var(--space-100) + env(safe-area-inset-bottom)); }
  .chat-composer { gap: var(--space-75); padding: var(--space-75); border-radius: var(--radius-lg); }
  .chat-composer textarea { min-height: var(--space-600); padding: var(--space-75); font-size: var(--text-base); line-height: var(--line-base); }
  .photo-picker-menu { position: fixed; inset: auto var(--space-100) calc(var(--space-700) + env(safe-area-inset-bottom)); width: auto; gap: var(--space-50); padding: var(--space-100); border-radius: var(--radius-xl); }
  .photo-picker-menu button { min-height: var(--space-600); }
  .photo-preview { margin-bottom: var(--space-75); }
  .chat-error { margin-bottom: var(--space-50); }
  .toast { right: var(--space-100); bottom: var(--space-800); max-width: calc(100vw - var(--space-300)); }
}

@media (max-width: 360px) {
  .page-actions .button { width: 100%; }
  .page-actions { grid-template-columns: minmax(0, 1fr); }
  .welcome-prompts { display: grid; grid-template-columns: minmax(0, 1fr); }
  .welcome-prompts .button { width: 100%; }
  .message { max-width: 96%; }
  .chat-header-context .assistant-avatar { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; transform: none !important; }
}

/* Mobile-native fix 1: sticky hover. Touch has no hover, so iOS leaves :hover applied after a tap. Gate every hover style behind capability, keep :active for touch. */
@media (hover: hover) and (pointer: fine) {
  .button:hover:not(:disabled) { transform: translateY(-1px); }
  .button-primary:hover:not(:disabled):not(:active) { background: var(--green-dark); }
  .button-secondary:hover:not(:disabled):not(:active), .button-chip:hover:not(:disabled):not(:active) { background: var(--green-soft); }
  .button-ghost:hover:not(:disabled):not(:active) { background: var(--surface-soft); }
  .button-danger:hover:not(:disabled):not(:active) { background: var(--red-dark); }
  .button-danger-ghost:hover:not(:disabled):not(:active) { background: var(--red-soft); }
  .nav-item:hover:not(:disabled) { background: var(--surface-soft); color: var(--green-dark); }
  .manual-entry > summary:hover, .disclosure-section > summary:hover { background: var(--surface-soft); }
  .pack-option:hover:not(:disabled) { background: var(--green-soft); }
  .photo-picker-menu button:hover { background: var(--green-soft); }
  .portal-footer a:hover { text-decoration: underline; }
}

/* Mobile-native fix 2: long-press on a control must not select its label or show a callout. Content (message bubbles, body text) is NOT covered. */
button, .nav-item, .category-chip {
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

/* Mobile-native fix 3: pull-to-refresh / rubber band must not hijack an app with its own scroll containers. Inner containers already use contain. */
html, body {
  overscroll-behavior: none;
}

/* Drawer navigation (Muse-style left drawer), mobile only. */
@media (min-width: 701px) {
  .drawer-button, .drawer-scrim, .drawer { display: none; }
}
/* Mobile-first, drawer-only navigation (2026-11-05): the sidebar/bottom
   bar is hidden on mobile; the hamburger drawer is the only navigator. */

/* Mobile-native iteration 4 (queue d): Transaksi rows become compact cards
   on mobile. Item + amount lead on the first line, date/kind/category/source
   collapse into one muted meta line, Edit/Hapus stay on their own row.
   No field is hidden except an empty source ("-"), desktop table untouched,
   spacing/radius tokens only, monthly total stays first and the list stays
   newest-first (API order), so nothing is truncated. */
@media (max-width: 700px) {
  #expense-rows tr.tx-card {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: var(--space-50) var(--space-100);
    padding: var(--space-100);
    border-radius: var(--radius-lg);
  }
  #expense-rows td.tx-item {
    order: 1;
    flex: 1 1 55%;
    display: block;
    padding: var(--space-0);
    color: var(--ink);
    font-size: var(--text-base);
    line-height: var(--line-base);
    font-weight: 600;
  }
  #expense-rows td.tx-item::before { display: none; }
  #expense-rows td.tx-amount {
    order: 2;
    flex: 0 1 auto;
    display: block;
    padding: var(--space-0);
    text-align: right;
    font-size: var(--text-base);
    line-height: var(--line-base);
  }
  #expense-rows td.tx-amount::before { display: none; }
  #expense-rows td.tx-date,
  #expense-rows td.tx-kind,
  #expense-rows td.tx-category,
  #expense-rows td.tx-source {
    display: block;
    padding: var(--space-0);
    font-size: var(--text-xs);
    line-height: var(--line-xs);
  }
  #expense-rows td.tx-date { order: 3; }
  #expense-rows td.tx-date::before { display: none; }
  #expense-rows td.tx-kind { order: 4; }
  #expense-rows td.tx-category { order: 5; }
  #expense-rows td.tx-source { order: 6; }
  #expense-rows td.tx-kind::before,
  #expense-rows td.tx-category::before,
  #expense-rows td.tx-source::before {
    content: "\00b7";
    padding-right: var(--space-50);
  }
  #expense-rows td.tx-source.tx-empty { display: none; }
  #expense-rows td.tx-actions {
    order: 7;
    flex: 1 1 100%;
    display: block;
    padding: var(--space-50) var(--space-0) var(--space-0);
  }
  #expense-rows td.tx-actions::before { display: none; }
}

/* Transaction cards, fixed 2026-11-02: on mobile the list is rendered as
   real <div> cards (#expense-cards), not as <tr> cards. Flex/grid on a
   table row is not reliably honoured by iOS Safari, so the old <tr>
   cards could stack on top of each other on a real phone even though
   desktop Chromium/WebKit laid them out fine. <div> flex is safe on
   Safari, so the mobile card uses it. Desktop keeps the table, which is
   hidden on mobile and vice versa. */
.expense-cards { display: none; }
@media (max-width: 700px) {
  .table-scroll { display: none; }
  .expense-cards { display: block; }
  .tx-card-div {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-50) var(--space-100);
    margin-bottom: var(--space-100);
    padding: var(--space-100);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
  }
  .tx-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--space-100);
    width: 100%;
  }
  .tx-head-item {
    flex: 1 1 auto;
    min-width: 0;
    color: var(--ink);
    font-size: var(--text-base);
    line-height: var(--line-base);
    font-weight: 600;
    overflow-wrap: anywhere;
  }
  .tx-head-amount {
    flex: 0 0 auto;
    color: var(--green-dark);
    font-size: var(--text-base);
    line-height: var(--line-base);
    white-space: nowrap;
  }
  .tx-meta {
    width: 100%;
    margin: var(--space-0);
    color: var(--muted);
    font-size: var(--text-xs);
    line-height: var(--line-xs);
  }
  .tx-card-actions { width: 100%; padding-top: var(--space-50); }
}

/* Mobile-native iteration 6 (queue f): press feedback that lands on finger-down.
   Two gaps: ghost buttons and the row actions had no :active state at all,
   and every control with a 500ms transform transition finished a quick tap before
   the scale showed. Press-in now runs at 120ms (mobile-native section 5:
   100-160ms ease-out); on release the base 500ms ease-out spring returns, so the
   release stays soft. The existing prefers-reduced-motion rule still disables
   transform/transition entirely. */
.nav-item:active:not(:disabled), .pack-option:active:not(:disabled) { transition-duration: 120ms, 120ms; }

/* Break-ui stress test (iteration 10): toast text must wrap inside its box.
   A long unbroken token in a toast (server message, filename, referral code)
   overflowed the fixed toast to the right and off-screen: measured
   scrollWidth 568px inside a 296px box at a 320px viewport. overflow-wrap:
   anywhere breaks only when a token has no break opportunity, so normal
   spaced messages are unchanged. */
.toast { overflow-wrap: anywhere; }

/* Break-ui stress test (iteration 11): pulsa pack buttons overflowed at
   narrow widths. In three columns at a 320px viewport each button is
   79px wide (55px of content after padding) while the shipped 100k pack
   label "Rp 100.000" measures 90px, so the label spilled ~16px past its
   button border into the next button (all three packs overflowed; the
   20k/50k labels measure 83px). Three columns only fit once the viewport
   passes ~454px, so below 480px the packs stack full-width instead of
   shrinking or breaking the Rupiah amounts mid-number. No colour, font,
   copy, flow, backend, Jev, pricing, or Ya/Ubah change. */
@media (max-width: 480px) {
  .pack-options { grid-template-columns: minmax(0, 1fr); }
}

/* Break-ui stress test (iteration 12): error lines must wrap inside their box.
   A long unbroken token in a server error message (filename, code, URL) set
   into #chat-error overflowed its 296px box at a 320px viewport (measured
   scrollWidth 476px, tail unreadable, composer dock scrolling to 488px), and
   the same token in #login-error stretched the whole login card to 478px in
   a 320px viewport. overflow-wrap: anywhere breaks only when a token has no
   break opportunity, so normal spaced error sentences are unchanged. No
   copy, flow, backend, Jev, pricing, or Ya/Ubah change. */
.chat-error, .form-error { overflow-wrap: anywhere; }

/* Break-ui stress test (iteration 13): manual journal row errors must wrap
   inside their box. A long unbroken token in a row validation message
   overflowed its 220px box at a 320px viewport (measured scrollWidth 613px,
   tail clipped by the card), while .chat-error/.form-error were already
   fixed in iteration 12 — .journal-row-error is its own class and was
   missed. overflow-wrap: anywhere breaks only when a token has no break
   opportunity, so normal spaced messages are unchanged. No copy, flow,
   backend, Jev, pricing, or Ya/Ubah change. */
.journal-row-error { overflow-wrap: anywhere; }
/* Break-ui stress test (iteration 14): proposal rows must not squeeze the
   item column into a sliver under a huge amount. At a 320px viewport the
   row is 260px wide and a 15-digit amount is 187px nowrap, so the item
   column collapsed to 57px and a long item stacked one or two words per
   line, while the amount itself must never wrap mid-number. With
   flex-wrap the row keeps its normal one-line shape while it fits, and
   only stacks (item full width, amount right-aligned on its own line)
   when item basis + amount + gap exceed the row. Normal rows are
   unchanged: the left column still grows to the remainder. No copy, flow,
   backend, Jev, pricing, or Ya/Ubah change. */
.proposal-row { flex-wrap: wrap; }
.proposal-left { flex: 1 1 100px; }
.proposal-amount { margin-left: auto; }
/* Unslopping (iteration 15): filter controls are 48px at every width, not
   just on mobile. Measured in WebKit before the fix: at 320/390px Bulan
   and Kategori both render 48px (the mobile rules already force this),
   but at 1200px Bulan renders 50px and Kategori only 38px, because
   WebKit ignores min-height on a closed select and sizes a month input
   intrinsically — the same WebKit quirk the mobile rule already comments
   on. One explicit height + no vertical padding for both controls makes
   the row a single 48px system at desktop too; the mobile wrapper rules
   are more specific, so mobile is unchanged. No copy, flow, backend,
   Jev, pricing, or Ya/Ubah change. */
.filters select { height: var(--space-600); padding-block: var(--space-0); }
.filters input[type="month"] { height: var(--space-600); padding-block: var(--space-0); }



/* ===== Three-pane layout (Muse-app style), Chat view first =====
   Left rail 64px icons only | channel list 320px | conversation. Desktop/tablet
   >= 900px shows all three; below that ONE pane at a time (data-pane on
   #portal-view: "conversation" is the default, "list" shows the channel list).
   Tokens only: spacing 4/8/12/16/24, radius card 16 / button 8 / icon pill,
   one border colour (--line-strong), one green-soft. Display-only: nothing here
   touches data, Ya/Ubah, Jev, credits or auth. */
.nav-icon { width: var(--space-300); height: var(--space-300); flex: 0 0 var(--space-300); display: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.channel-pane { display: none; }
.back-to-list { width: var(--space-600); height: var(--space-600); display: none; flex: 0 0 auto; place-items: center; padding: var(--space-0); border: 0; border-radius: var(--radius-full); background: transparent; color: var(--green-dark); }
.back-to-list:active { background: var(--green-soft); }
.avatar-menu-wrap { position: relative; flex: 0 0 auto; }
.avatar-button { width: var(--space-600); height: var(--space-600); display: grid; place-items: center; padding: var(--space-0); border: 0; border-radius: var(--radius-full); background: var(--green-soft); color: var(--green-dark); font-size: var(--text-base); line-height: var(--line-base); font-weight: 600; overflow: hidden; position: relative; }
.avatar-img { position: relative; z-index: 1; width: 100%; height: 100%; display: block; object-fit: cover; object-position: center 20%; border-radius: var(--radius-full); }
.avatar-img { animation: kirana-idle 4s ease-in-out infinite; }
@keyframes kirana-idle { 0%, 100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-2px) scale(1.02); } }
.avatar-button.is-typing .avatar-img { animation: kirana-typing 0.9s ease-in-out infinite; }
@keyframes kirana-typing { 0%, 100% { transform: translateY(0) rotate(0deg) scale(1); } 25% { transform: translateY(-3px) rotate(-2deg) scale(1.03); } 75% { transform: translateY(-1px) rotate(2deg) scale(1.03); } }
.avatar-button.is-react .avatar-img { animation: kirana-react 0.7s ease-out 1; }
@keyframes kirana-react { 0% { transform: scale(1); } 30% { transform: scale(1.15); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .avatar-img { animation: none; } }
.nav-placeholder { opacity: 0.6; }
.avatar-picker { display: grid; gap: var(--space-100); padding: var(--space-100) var(--space-0); }
.avatar-picker-options { display: flex; gap: var(--space-200); }
.avatar-pick { display: flex; flex-direction: column; align-items: center; gap: var(--space-50); padding: var(--space-50); border: 0; border-radius: var(--radius-md); background: transparent; color: var(--ink); font-size: var(--text-sm); line-height: var(--line-sm); cursor: pointer; }
.avatar-pick img { width: var(--space-700); height: var(--space-700); border-radius: var(--radius-full); object-fit: cover; border: 2px solid transparent; }
.avatar-pick.active img { border-color: var(--green); }
.avatar-fallback { position: absolute; inset: 0; display: grid; place-items: center; }
.avatar-menu { position: absolute; z-index: 30; top: calc(100% + var(--space-75)); left: var(--space-0); width: 208px; display: grid; gap: var(--space-50); padding: var(--space-75); border: 1px solid var(--line-strong); border-radius: var(--radius-xl); background: var(--surface); box-shadow: 0 var(--space-75) var(--space-300) var(--shadow-popover); }
.list-avatar-wrap .avatar-menu { right: var(--space-0); left: auto; }
.avatar-menu button { min-height: var(--space-600); padding: var(--space-75) var(--space-100); border: 0; border-radius: var(--radius-md); background: transparent; color: var(--ink); font-size: var(--text-base); line-height: var(--line-base); text-align: left; }
.avatar-menu button:active:not(:disabled), .avatar-menu button:focus-visible { background: var(--green-soft); }
.avatar-menu .avatar-menu-logout { color: var(--red); }
.chat-header-context > span:last-child small > span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-layout > .channel-filter-banner { grid-row: 1; }
.chat-layout > .messages { grid-row: 2; }
.chat-layout > .composer-dock { grid-row: 3; }
.chat-layout { grid-template-rows: auto minmax(0, 1fr) auto; }
.channel-filter-banner { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: var(--space-100); padding: var(--space-0) var(--space-100) var(--space-0) var(--space-300); border-bottom: 1px solid var(--line-strong); background: var(--surface); color: var(--green-dark); font-size: var(--text-sm); line-height: var(--line-sm); font-weight: 600; }
.channel-empty { max-width: 360px; display: grid; justify-items: center; gap: var(--space-100); margin: var(--space-300) auto; padding: var(--space-300) var(--space-200); text-align: center; }
.channel-empty b { font-size: var(--text-lg); line-height: var(--line-lg); font-weight: 600; }
.channel-empty p { margin: var(--space-0); color: var(--muted); font-size: var(--text-sm); line-height: var(--line-sm); }
.channel-pane-head { min-height: 72px; display: flex; flex: 0 0 auto; align-items: center; justify-content: space-between; gap: var(--space-100); padding: var(--space-0) var(--space-200); }
.channel-pane-head h2 { font-size: var(--text-lg); line-height: var(--line-lg); }
.channel-list { min-height: 0; display: grid; align-content: start; gap: var(--space-50); margin: var(--space-0); padding: var(--space-75); list-style: none; overflow-y: auto; }
.channel-row { width: 100%; min-width: 0; min-height: var(--space-600); display: grid; gap: var(--space-50); padding: var(--space-100) var(--space-200); border: 0; border-radius: var(--radius-md); background: transparent; color: var(--ink); text-align: left; }
.channel-row[aria-current="true"] { background: var(--green-soft); }
.channel-name { font-size: var(--text-base); line-height: var(--line-base); font-weight: 600; }
.channel-preview { min-width: 0; overflow: hidden; color: var(--muted); font-size: var(--text-sm); line-height: var(--line-sm); text-overflow: ellipsis; white-space: nowrap; }
.channel-label { color: var(--muted); font-size: var(--text-xs); line-height: var(--line-xs); }

/* Chat header: the quiet header. Navigation lives in the rail / avatar menu. */
#portal-view[data-active-view="chat"] .header-faq-link { display: none; }

/* >= 701px: left rail, icons only, 64px wide (no text labels: aria-label + title). */
@media (min-width: 701px) {
  .portal-shell { grid-template-columns: var(--space-700) minmax(0, 1fr); }
  .sidebar { width: var(--space-700); align-items: center; padding: var(--space-300) var(--space-75); border-right: 0; box-shadow: inset -1px 0 0 var(--line-strong); }
  .sidebar-brand { width: var(--space-600); justify-content: center; margin-bottom: var(--space-300); }
  .brand-text, .nav-label, .nav-count, .profile-row { display: none; }
  .main-nav { gap: var(--space-75); }
  .nav-item { width: var(--space-600); height: var(--space-600); justify-content: center; padding: var(--space-0); border-radius: var(--radius-full); }
  .nav-icon { display: block; }
  #portal-view[data-active-view="chat"] .channel-pane { height: 100dvh; display: flex; grid-column: 2; grid-row: 1; flex-direction: column; min-width: 0; background: var(--surface); box-shadow: inset -1px 0 0 var(--line-strong); }
  #portal-view[data-active-view="chat"] .back-to-list { display: grid; }
}
/* 701-899px: one pane at a time next to the rail. */
@media (min-width: 701px) and (max-width: 899px) {
  #portal-view[data-active-view="chat"][data-pane="conversation"] .channel-pane { display: none; }
  #portal-view[data-active-view="chat"][data-pane="list"] .content-area { display: none; }
}
/* >= 900px: all three panes. */
@media (min-width: 900px) {
  #portal-view[data-active-view="chat"] { grid-template-columns: var(--space-700) 320px minmax(0, 1fr); }
  #portal-view[data-active-view="chat"] .content-area { grid-column: 3; }
  #portal-view[data-active-view="chat"] .back-to-list, #portal-view[data-active-view="chat"] .list-avatar-wrap { display: none; }
}
/* <= 700px: ONE pane. Conversation by default; list is a full-screen pane reached from the header back control.
   Rail is hidden in chat (existing rule) and the avatar menu carries Akun / Transaksi / Tanya jawab / Keluar. */
@media (max-width: 700px) {
  .nav-faq { display: none; }
  #portal-view[data-active-view="chat"] .channel-pane { display: none; }
  #portal-view[data-active-view="chat"] .header-view-switch { display: none; }
  #portal-view[data-active-view="chat"] .chat-header-context { gap: var(--space-50); }
  .channel-pane-head { min-height: calc(var(--space-700) + env(safe-area-inset-top)); padding: env(safe-area-inset-top) var(--space-100) var(--space-0) var(--space-200); }
  .channel-filter-banner { padding-left: var(--space-200); }
}
@media (hover: hover) and (pointer: fine) {
  .channel-row:hover:not([aria-current="true"]), .avatar-menu button:hover:not(:disabled), .back-to-list:hover { background: var(--green-soft); }
  .nav-item:hover:not(.active):not(:disabled) { background: var(--green-soft); }
}
.back-to-list .nav-icon { display: block; }

/* ---- Transaction trail (view only) and search ---------------------------------------- */
.tx-search { padding: var(--space-200); display: grid; gap: var(--space-100); margin-bottom: var(--space-200); }
.tx-search-field { display: grid; gap: var(--space-75); color: var(--ink); font-size: var(--text-sm); line-height: var(--line-sm); font-weight: 600; }
.tx-search-field input { min-width: 0; min-height: var(--space-600); padding: var(--space-100); border: 1px solid var(--line-strong); border-radius: var(--radius-md); background: var(--surface); color: var(--ink); font-size: var(--text-base); line-height: var(--line-base); font-weight: 400; }
.tx-search-status:empty { display: none; }
.tx-search-results { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-75); }
.tx-search-item { display: flex; align-items: center; justify-content: space-between; gap: var(--space-100); padding: var(--space-100) var(--space-200); border: 1px solid var(--line-strong); border-radius: var(--radius-md); background: var(--surface); min-width: 0; }
.tx-search-item > div { min-width: 0; overflow-wrap: anywhere; }
.tx-search-item b { font-size: var(--text-base); font-weight: 600; }
.tx-search-item .meta, .trail-view .meta, .trail-step .meta { margin: 0; color: var(--muted); font-size: var(--text-xs); line-height: var(--line-xs); font-weight: 400; }
.tx-search-item .button { flex: none; }
.trail-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-200); }
.trail-step { min-width: 0; padding: var(--space-200); border: 1px solid var(--line); border-radius: var(--radius-xl); background: var(--surface); display: grid; gap: var(--space-100); }
.trail-missing { background: var(--surface-soft); }
.trail-step-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-100); flex-wrap: wrap; }
.trail-step-head h2 { margin: 0; font-size: var(--text-lg); line-height: var(--line-base); font-weight: 600; color: var(--ink); }
.trail-badge { padding: var(--space-50) var(--space-100); border-radius: 9999px; border: 1px solid var(--line-strong); font-size: var(--text-xs); line-height: var(--line-xs); font-weight: 600; color: var(--muted); }
.trail-recorded .trail-badge { background: var(--green-soft); color: var(--green-dark); }
.trail-text { margin: 0; color: var(--muted); font-size: var(--text-base); line-height: var(--line-base); overflow-wrap: anywhere; }
.trail-quote { margin: 0; padding: var(--space-100); border-left: 3px solid var(--line); background: var(--surface-soft); color: var(--ink); font-size: var(--text-base); line-height: var(--line-base); overflow-wrap: anywhere; }
.trail-line { color: var(--ink); }
.trail-facts { margin: 0; display: grid; gap: var(--space-75); }
.trail-facts > div { display: grid; grid-template-columns: minmax(96px, 168px) 1fr; gap: var(--space-100); }
.trail-facts dt { color: var(--muted); font-size: var(--text-sm); line-height: var(--line-sm); font-weight: 600; }
.trail-facts dd { margin: 0; color: var(--ink); font-size: var(--text-base); line-height: var(--line-base); overflow-wrap: anywhere; }
.trail-number { display: grid; gap: var(--space-75); justify-items: start; }
.trail-amount { font-size: var(--text-2xl); line-height: var(--line-base); font-weight: 600; color: var(--green-dark); font-variant-numeric: tabular-nums; }
.trail-amount.trail-ignored { text-decoration: line-through; color: var(--muted); }
.trail-annotation { margin: 0; padding: var(--space-100); border-radius: var(--radius-md); background: var(--red-soft); color: var(--red-dark); font-size: var(--text-sm); line-height: var(--line-sm); font-weight: 600; overflow-wrap: anywhere; }
.trail-comment-form { display: grid; gap: var(--space-100); width: 100%; }
.trail-comment-form[hidden] { display: none; }
.trail-comment-form select, .trail-comment-form textarea { min-width: 0; padding: var(--space-100); border: 1px solid var(--line-strong); border-radius: var(--radius-md); background: var(--surface); color: var(--ink); font: inherit; font-size: var(--text-base); }
.trail-comment-form select { min-height: var(--space-600); }
.tx-card-actions .trail-open, .table-actions .trail-open { white-space: nowrap; }
@media (max-width: 700px) {
  .tx-search-item { flex-direction: column; align-items: stretch; }
  .trail-facts > div { grid-template-columns: 1fr; gap: var(--space-50); }
}
