@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../vendor/fonts/inter-latin-400.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../vendor/fonts/inter-latin-500.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../vendor/fonts/inter-latin-600.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../vendor/fonts/inter-latin-700.woff2") format("woff2");
}

:root {
  color-scheme: light;
  --stone-50: #fafaf9;
  --stone-100: #f5f5f4;
  --stone-150: #efefed;
  --stone-200: #e7e5e4;
  --stone-300: #d6d3d1;
  --stone-400: #a8a29e;
  --stone-500: #78716c;
  --stone-600: #57534e;
  --stone-700: #44403c;
  --stone-800: #292524;
  --stone-900: #1c1917;
  --teal-50: #f0fdfa;
  --teal-100: #ccfbf1;
  --teal-200: #99f6e4;
  --teal-600: #0d9488;
  --teal-700: #0f766e;
  --teal-800: #115e59;
  --red-50: #fef2f2;
  --red-200: #fecaca;
  --red-600: #dc2626;
  --amber-50: #fffbeb;
  --amber-600: #d97706;
  --white: #fff;
  --surface: #fff;
  --row-hover: #fcfcfb;
  --sidebar-width: 232px;
  --topbar-height: 46px;
  --radius: 5px;
  --border: 1px solid var(--stone-200);
  --font: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html, body, #app { width: 100%; max-width: 100%; min-width: 0; min-height: 100%; margin: 0; overflow-x: hidden; }
body { background: var(--stone-100); color: var(--stone-800); font: 400 13px/1.45 var(--font); }
button, input, select, textarea { color: inherit; font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .5; }
img, video, canvas, svg { max-width: 100%; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.is-hidden { display: none !important; }
.auth-page { display: grid; min-height: 100vh; place-items: center; padding: 24px; background: var(--stone-100); }
.auth-shell { width: min(100%, 390px); }
.auth-mark { display: flex; align-items: center; gap: 10px; margin: 0 0 14px 2px; color: var(--stone-900); font-size: 15px; }
.auth-mark .brand-meter { border-color: var(--stone-300); }
.auth-card { display: grid; gap: 12px; padding: 22px; }
.auth-card h1 { margin: 0; color: var(--stone-900); font-size: 22px; font-weight: 600; }
.auth-card > p:not(.eyebrow) { margin: -5px 0 4px; color: var(--stone-500); font-size: 12px; }
.auth-card .button { width: 100%; margin-top: 4px; }
.check-label { display: flex; align-items: center; gap: 8px; color: var(--stone-600); font-size: 12px; }
.auth-error { margin: 0; color: var(--red-600); font-size: 12px; }

*, *::before, *::after { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--teal-600); outline-offset: 2px; }
::selection { background: var(--teal-100); color: var(--teal-800); }

.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 110; display: flex; width: var(--sidebar-width); min-width: 0; flex-direction: column; background: var(--stone-900); color: var(--stone-300); border-right: 1px solid #302c2a; transition: width 160ms ease; }
.brand { display: flex; height: var(--topbar-height); align-items: center; gap: 10px; padding: 0 14px; border-bottom: 1px solid #322e2c; overflow: hidden; }
.brand-meter { display: flex; flex: 0 0 24px; height: 20px; align-items: end; gap: 2px; padding: 3px; border: 1px solid #4d4845; border-radius: 3px; }
.brand-meter i { display: block; width: 3px; background: #2dd4bf; border-radius: 1px 1px 0 0; animation: meter-in 500ms ease both; }
.brand-meter i:nth-child(1) { height: 5px; }
.brand-meter i:nth-child(2) { height: 9px; animation-delay: 60ms; }
.brand-meter i:nth-child(3) { height: 13px; animation-delay: 120ms; }
.brand-meter i:nth-child(4) { height: 8px; animation-delay: 180ms; }
@keyframes meter-in { from { height: 2px; opacity: .2; } }
.brand-copy { display: grid; min-width: 0; line-height: 1.05; white-space: nowrap; }
.brand-copy b { color: white; font-size: 13px; font-weight: 600; letter-spacing: -.01em; }
.brand-copy small { margin-top: 4px; color: var(--stone-500); font-size: 8px; font-weight: 600; letter-spacing: .12em; }
.side-nav { display: grid; gap: 2px; padding: 12px 8px; }
.nav-link { position: relative; display: flex; width: 100%; height: 34px; align-items: center; gap: 10px; padding: 0 10px; color: var(--stone-400); background: transparent; border: 0; border-radius: 4px; text-align: left; }
.nav-link::before { position: absolute; left: -8px; width: 2px; height: 18px; background: transparent; content: ""; }
.nav-link:hover { color: var(--stone-100); background: #292624; }
.nav-link.is-active { color: white; background: #302c2a; }
.nav-link.is-active::before { background: #2dd4bf; }
.nav-link svg { flex: 0 0 17px; width: 17px; height: 17px; }
.nav-link span { min-width: 0; flex: 1; white-space: nowrap; }
.nav-link em { min-width: 20px; padding: 1px 5px; color: var(--stone-400); background: #403b38; border-radius: 8px; font-size: 10px; font-style: normal; text-align: center; }
.sidebar-foot { display: grid; gap: 6px; margin-top: auto; padding: 8px; border-top: 1px solid #322e2c; }
.connection-mini { display: flex; min-width: 0; height: 30px; align-items: center; gap: 8px; padding: 0 9px; color: var(--stone-400); font-size: 11px; }
.connection-mini span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status-dot { width: 7px; height: 7px; flex: 0 0 7px; background: var(--stone-500); border-radius: 50%; }
.status-dot.is-connected { background: #2dd4bf; box-shadow: 0 0 0 3px rgba(45,212,191,.1); }
.status-dot.is-error { background: #f87171; }
.sidebar-logout { display: flex; height: 32px; align-items: center; gap: 10px; padding: 0 10px; color: var(--stone-400); background: transparent; border: 0; border-radius: 4px; font-size: 11px; cursor: pointer; text-align: left; width: 100%; transition: background 120ms ease, color 120ms ease; }
.sidebar-logout:hover { color: #fca5a5; background: #292624; }
.sidebar-logout svg { width: 15px; height: 15px; }
.sidebar-collapse { display: flex; height: 32px; align-items: center; gap: 10px; padding: 0 10px; color: var(--stone-500); background: transparent; border: 0; border-radius: 4px; font-size: 11px; }
.sidebar-collapse:hover { color: var(--stone-200); background: #292624; }
.sidebar-collapse svg { width: 15px; }
.sidebar.is-collapsed { width: 56px; }
.sidebar.is-collapsed .brand { padding: 0 16px; }
.sidebar.is-collapsed .brand-copy, .sidebar.is-collapsed .nav-link span, .sidebar.is-collapsed .nav-link em, .sidebar.is-collapsed .connection-mini span:last-child, .sidebar.is-collapsed .sidebar-collapse span, .sidebar.is-collapsed .sidebar-logout span { display: none; }
.sidebar.is-collapsed .nav-link { justify-content: center; padding: 0; }
.sidebar.is-collapsed .nav-link::before { left: -8px; }
.sidebar.is-collapsed .connection-mini, .sidebar.is-collapsed .sidebar-collapse, .sidebar.is-collapsed .sidebar-logout { justify-content: center; padding: 0; }
.sidebar.is-collapsed .sidebar-collapse svg { transform: rotate(180deg); }

.app-main { min-width: 0; min-height: 100vh; margin-left: var(--sidebar-width); transition: margin-left 160ms ease; }
.sidebar.is-collapsed + .app-main { margin-left: 56px; }
.desktop-topbar { position: sticky; top: 0; z-index: 90; display: flex; height: var(--topbar-height); align-items: center; justify-content: space-between; gap: 16px; padding: 0 22px; background: var(--surface); border-bottom: var(--border); }
.topbar-title { display: flex; min-width: 0; align-items: baseline; gap: 9px; }
.topbar-title span { font-weight: 600; white-space: nowrap; }
.topbar-title small { overflow: hidden; color: var(--stone-500); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.topbar-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 7px; }
.topbar-credit { display: inline-flex; min-height: 30px; align-items: center; gap: 6px; padding: 0 9px; color: var(--teal-800); background: var(--teal-50); border: 1px solid var(--teal-200); border-radius: var(--radius); font: inherit; font-size: 11px; font-weight: 600; }
.topbar-credit:hover { background: var(--surface); border-color: var(--teal-500); }
.topbar-credit svg { width: 14px; height: 14px; }
.mobile-credit { display: none; }
.mobile-top-bar, .mobile-bottom-nav { display: none; }

.workspace { min-width: 0; min-height: calc(100vh - var(--topbar-height)); padding: 22px 24px 32px; background: var(--stone-100); }
.page { display: none; width: 100%; min-width: 0; }
.page.is-active { display: block; animation: page-in 150ms ease both; }
@keyframes page-in { from { opacity: 0; transform: translateY(2px); } }
.page-heading { display: flex; min-width: 0; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 16px; }
.page-heading h1 { margin: 2px 0 2px; color: var(--stone-900); font-size: 20px; line-height: 1.2; font-weight: 600; letter-spacing: -.025em; }
.page-heading p { margin: 0; color: var(--stone-500); font-size: 12px; }
.page-heading .eyebrow { color: var(--teal-700); font-size: 9px; font-weight: 700; letter-spacing: .12em; }
.compact-heading { align-items: center; }
.page-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 7px; }
.count-label { margin-left: 7px; color: var(--stone-500); font-size: 11px; font-weight: 400; letter-spacing: 0; vertical-align: middle; }

.button, .icon-button, .touch-button, .text-button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border-radius: var(--radius); font-weight: 500; text-decoration: none; }
.button { min-height: 34px; padding: 0 11px; border: var(--border); font-size: 12px; white-space: nowrap; text-decoration: none; }
.button svg { width: 15px; height: 15px; }
.button-primary { color: white; background: var(--teal-700); border-color: var(--teal-700); }
.button-primary:hover { background: var(--teal-800); border-color: var(--teal-800); }
.button-secondary { color: var(--stone-700); background: var(--surface); }
.button-secondary:hover { background: var(--stone-50); border-color: var(--stone-300); }
.button-danger { color: white; background: var(--red-600); border-color: var(--red-600); }
.button-danger-ghost { color: var(--red-600); background: var(--surface); border-color: var(--red-200); }
.button.compact { min-height: 30px; padding-inline: 9px; }
.icon-button { width: 32px; height: 32px; padding: 0; color: var(--stone-600); background: var(--surface); border: var(--border); text-decoration: none; }
.icon-button:hover { background: var(--stone-50); }
.touch-button { width: 44px; height: 44px; padding: 0; color: var(--stone-700); background: transparent; border: 0; outline: none; -webkit-tap-highlight-color: transparent; -webkit-touch-callout: none; user-select: none; }
.text-button { min-height: 28px; padding: 0 2px; color: var(--teal-700); background: transparent; border: 0; font-size: 11px; }
.text-button svg { width: 13px; height: 13px; }
.danger-text { color: var(--red-600); }
.is-spinning { animation: spin 1s linear infinite; }
.is-spinning svg, svg.is-spinning { animation: spin 1s linear infinite; }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

.panel { min-width: 0; background: var(--surface); border: var(--border); border-radius: var(--radius); }
.page > .panel + .panel { margin-top: 14px; }
.panel-header { display: flex; min-height: 49px; align-items: center; justify-content: space-between; gap: 16px; padding: 9px 13px; border-bottom: var(--border); }
.panel-header h2 { margin: 0; color: var(--stone-800); font-size: 14px; font-weight: 600; }
.panel-header p { margin: 2px 0 0; color: var(--stone-500); font-size: 11px; }
.setup-callout { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; padding: 11px 13px; background: var(--teal-50); border: 1px solid var(--teal-200); border-radius: var(--radius); }
.setup-callout .callout-icon { display: grid; width: 32px; height: 32px; flex: 0 0 32px; place-items: center; color: var(--teal-700); background: var(--surface); border: 1px solid var(--teal-200); border-radius: 4px; }
.setup-callout > div:nth-child(2) { min-width: 0; flex: 1; }
.setup-callout strong { font-size: 12px; }
.setup-callout p { margin: 2px 0 0; color: var(--stone-600); font-size: 11px; }
.metric-strip { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); margin-bottom: 12px; background: var(--surface); border: var(--border); border-radius: var(--radius); }
.metric-strip > div { position: relative; display: flex; min-width: 0; min-height: 58px; flex-direction: column; justify-content: center; padding: 8px 14px; border-right: var(--border); }
.metric-strip > div:first-child::before { position: absolute; inset: 10px auto 10px 0; width: 2px; background: var(--teal-600); content: ""; }
.metric-strip > div:last-child { border-right: 0; }
.metric-strip span { color: var(--stone-500); font-size: 10px; text-transform: uppercase; letter-spacing: .04em; }
.metric-strip strong { margin-top: 2px; color: var(--stone-900); font-size: 18px; line-height: 1.1; font-weight: 600; letter-spacing: -.03em; }
.metric-strip .metric-status { color: var(--stone-600); font-size: 13px; letter-spacing: 0; }
.metric-strip .metric-status.is-connected { color: var(--teal-700); }
.dashboard-grid { display: grid; grid-template-columns: minmax(0,1.5fr) minmax(310px,.8fr); gap: 12px; }
.compact-list { min-height: 175px; }
.compact-row { position: relative; display: flex; min-width: 0; min-height: 53px; align-items: center; gap: 10px; padding: 8px 13px; border-bottom: var(--border); }
.compact-list button.compact-row { width: 100%; color: inherit; background: var(--surface); border: 0; border-bottom: var(--border); border-radius: 0; font: inherit; text-align: left; }
.compact-list button.compact-row:hover { background: var(--stone-50); }
.compact-row:last-child { border-bottom: 0; }
.compact-row::before { position: absolute; inset: 9px auto 9px 0; width: 2px; background: var(--stone-300); content: ""; }
.compact-row.is-active::before, .compact-row.is-completed::before { background: var(--teal-600); }
.compact-row.is-failed::before { background: var(--red-600); }
.compact-row-main { min-width: 0; flex: 1; }
.compact-row-main strong, .account-primary strong { display: block; overflow: hidden; color: var(--stone-800); font-size: 12px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.compact-row-main span, .account-primary span { display: block; overflow: hidden; margin-top: 2px; color: var(--stone-500); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.empty-mini { display: grid; min-height: 175px; place-items: center; color: var(--stone-400); font-size: 12px; }
.skeleton-list { padding: 6px 13px; }
.skeleton-list i { display: block; height: 39px; background: var(--stone-100); border-bottom: var(--border); animation: skeleton 1.2s ease-in-out infinite alternate; }
@keyframes skeleton { to { opacity: .45; } }

.toolbar { display: flex; min-height: 49px; align-items: center; gap: 9px; margin-bottom: 8px; padding: 7px 9px; }
.toolbar-spacer { flex: 1; }
.toolbar-select { height: 34px; padding: 0 10px; background: var(--stone-50); border: var(--border); border-radius: var(--radius); font-size: 12px; color: var(--stone-700); cursor: pointer; outline: 0; }
.toolbar-select:focus { background: var(--surface); border-color: var(--teal-600); box-shadow: 0 0 0 2px var(--teal-100); }
.search-field { display: flex; width: min(360px, 100%); height: 34px; align-items: center; gap: 7px; padding: 0 9px; background: var(--stone-50); border: var(--border); border-radius: var(--radius); }
.search-field:focus-within { background: var(--surface); border-color: var(--teal-600); box-shadow: 0 0 0 2px var(--teal-100); }
.search-field svg { width: 15px; color: var(--stone-400); }
.search-field input { width: 100%; min-width: 0; padding: 0; background: transparent; border: 0; outline: 0; font-size: 13px; }
.selection-label { color: var(--stone-500); font-size: 11px; }
.data-panel { overflow: hidden; }
.table-wrap { width: 100%; min-width: 0; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.data-table th { height: 35px; padding: 0 10px; color: var(--stone-500); background: var(--stone-50); border-bottom: var(--border); font-size: 10px; font-weight: 600; text-align: left; text-transform: uppercase; letter-spacing: .035em; }
.data-table td { height: 53px; padding: 7px 10px; border-bottom: var(--border); vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: var(--row-hover); }
.data-table .check-cell { width: 38px; padding-inline: 10px 4px; }
.data-table .action-cell { width: 292px; text-align: right; }
.account-table th:nth-child(2) { width: 16%; }
.account-table th:nth-child(3) { width: 20%; }
.account-table th:nth-child(4) { width: 23%; }
.account-table th:nth-child(5) { width: 14%; }
.account-table th:nth-child(6) { width: 11%; }
.account-table .action-cell { width: 244px; }
.account-table td:nth-child(3), .account-table td:nth-child(4) { line-height: 1.45; overflow-wrap: anywhere; }
.user-badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 7px; background: var(--stone-100); border: 1px solid var(--stone-200); border-radius: 4px; font-size: 11px; font-weight: 500; color: var(--stone-700); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-badge svg { width: 12px; height: 12px; color: var(--stone-500); }
.nickname-cell { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; }
.nickname-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.nickname-edit-btn { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; padding: 0; color: var(--stone-400); background: transparent; border: 0; border-radius: 3px; cursor: pointer; transition: color 120ms ease, background 120ms ease; }
.nickname-edit-btn:hover { color: var(--teal-700); background: var(--stone-200); }
.nickname-edit-btn svg { width: 13px; height: 13px; }
input[type="checkbox"] { width: 15px; height: 15px; margin: 0; accent-color: var(--teal-700); }
.account-number { color: var(--stone-800); font-variant-numeric: tabular-nums; font-weight: 600; letter-spacing: .015em; }
.account-primary { min-width: 0; }
.muted-cell { color: var(--stone-400); font-size: 11px; }
.row-actions { display: flex; justify-content: flex-end; gap: 5px; }
.row-actions .button { min-height: 29px; padding-inline: 8px; font-size: 11px; }
.row-actions .icon-button { width: 29px; height: 29px; }
.status-badge { display: inline-flex; min-height: 21px; align-items: center; gap: 5px; padding: 0 7px; color: var(--stone-600); background: var(--stone-100); border: 1px solid var(--stone-200); border-radius: 10px; font-size: 10px; font-weight: 500; white-space: nowrap; }
.status-badge i { width: 5px; height: 5px; background: var(--stone-400); border-radius: 50%; }
.status-badge.status-connected { color: var(--teal-800); background: var(--teal-50); border-color: var(--teal-200); }
.status-badge.status-connected i { background: var(--teal-600); }
.status-badge.status-error { color: var(--red-600); background: var(--red-50); border-color: var(--red-200); }
.status-badge.status-error i { background: var(--red-600); }
.status-badge.status-unlinked { color: #64748b; background: #f1f5f9; border-color: #cbd5e1; }
.status-badge.status-unlinked i { background: #94a3b8; }
.mobile-account-view { display: none; }
.empty-state { display: grid; min-height: 280px; place-items: center; align-content: center; padding: 28px; color: var(--stone-500); text-align: center; }
.empty-state > svg { width: 26px; height: 26px; margin-bottom: 9px; color: var(--stone-400); }
.empty-state h3 { margin: 0; color: var(--stone-700); font-size: 13px; font-weight: 600; }
.empty-state p { margin: 4px 0 12px; font-size: 11px; }

.download-panel { overflow: hidden; }
.download-panel-head { display: grid; grid-template-columns: minmax(0,1fr) 170px 86px; min-height: 35px; align-items: center; padding: 0 12px; color: var(--stone-500); background: var(--stone-50); border-bottom: var(--border); font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .035em; }
.download-row { position: relative; display: grid; grid-template-columns: minmax(0,1fr) 170px 86px; min-height: 58px; align-items: center; gap: 10px; padding: 7px 12px 7px 15px; border-bottom: var(--border); }
.download-row::before { position: absolute; inset: 9px auto 9px 0; width: 2px; background: var(--stone-300); content: ""; }
.download-row[data-status="preparing"]::before, .download-row[data-status="downloading"]::before, .download-row[data-status="completed"]::before { background: var(--teal-600); }
.download-row[data-status="failed"]::before { background: var(--red-600); }
.download-title { min-width: 0; }
.download-title strong { display: block; overflow: hidden; font-size: 12px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.download-title span { display: block; overflow: hidden; margin-top: 2px; color: var(--stone-500); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.download-status { display: flex; align-items: center; gap: 7px; color: var(--stone-600); font-size: 11px; text-transform: capitalize; }
.download-status i { width: 7px; height: 7px; background: var(--stone-400); border-radius: 50%; }
.download-row[data-status="preparing"] .download-status i, .download-row[data-status="downloading"] .download-status i { background: var(--teal-600); animation: pulse 1s ease infinite; }
.download-row[data-status="completed"] .download-status { color: var(--teal-700); }
.download-row[data-status="completed"] .download-status i { background: var(--teal-600); }
.download-row[data-status="failed"] .download-status { color: var(--red-600); }
.download-row[data-status="failed"] .download-status i { background: var(--red-600); }
@keyframes pulse { 50% { opacity: .3; } }
.download-action { justify-self: end; }
.download-error { display: block; overflow: hidden; max-width: 165px; color: var(--red-600); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.download-panel-foot { display: flex; min-height: 40px; align-items: center; justify-content: space-between; padding: 5px 12px; color: var(--stone-500); background: var(--stone-50); border-top: var(--border); font-size: 10px; }

.settings-layout { display: grid; grid-template-columns: minmax(440px,720px) minmax(260px,360px); gap: 12px; align-items: start; }
.settings-card { overflow: hidden; }
.settings-header { min-height: 57px; }
.form-grid { display: grid; gap: 12px; padding: 14px; }
.field { display: grid; min-width: 0; gap: 5px; }
.field > span:first-child { color: var(--stone-700); font-size: 12px; font-weight: 500; }
.field input, .field select { width: 100%; min-width: 0; height: 35px; padding: 0 9px; background: var(--surface); border: var(--border); border-radius: var(--radius); outline: 0; }
.field input:focus, .field select:focus { border-color: var(--teal-600); box-shadow: 0 0 0 2px var(--teal-100); }
.field small { color: var(--stone-500); font-size: 10px; }
.password-wrap { position: relative; display: block; }
.password-wrap input { padding-right: 38px; }
.input-icon { position: absolute; inset: 2px 2px 2px auto; display: grid; width: 33px; place-items: center; color: var(--stone-500); background: transparent; border: 0; }
.input-icon svg { width: 16px; }
.connection-row { display: flex; min-height: 56px; align-items: center; justify-content: space-between; margin: 0 14px; padding: 8px 0; border-top: var(--border); }
.connection-row span { display: block; color: var(--stone-500); font-size: 10px; text-transform: uppercase; letter-spacing: .04em; }
.connection-row strong { display: block; margin-top: 2px; font-size: 12px; font-weight: 500; }
.connection-pulse { width: 9px; height: 9px; background: var(--stone-300); border-radius: 50%; }
.connection-pulse.is-connected { background: var(--teal-600); box-shadow: 0 0 0 4px var(--teal-100); }
.connection-pulse.is-error { background: var(--red-600); box-shadow: 0 0 0 4px var(--red-50); }
.form-actions { display: flex; min-height: 55px; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; background: var(--stone-50); border-top: var(--border); }
.form-actions > div { display: flex; gap: 7px; }
.security-note { display: flex; gap: 11px; padding: 14px; }
.security-note > svg { width: 20px; height: 20px; flex: 0 0 20px; color: var(--teal-700); }
.security-note h2 { margin: 0; font-size: 13px; font-weight: 600; }
.security-note p { margin: 4px 0 8px; color: var(--stone-600); font-size: 11px; }
.security-note ul { margin: 0; padding-left: 15px; color: var(--stone-500); font-size: 10px; }
.security-note li + li { margin-top: 3px; }

.app-dialog { width: min(960px, calc(100% - 28px)); max-height: min(88vh, 880px); padding: 0; background: var(--surface); border: var(--border); border-radius: 7px; box-shadow: 0 18px 60px rgba(28,25,23,.22); }
.app-dialog::backdrop { background: rgba(28,25,23,.52); }
.dialog-shell { display: flex; min-width: 0; max-height: min(88vh,880px); flex-direction: column; margin: 0; }
.dialog-header { display: flex; min-height: 55px; flex: 0 0 auto; align-items: center; gap: 10px; padding: 7px 10px 7px 15px; border-bottom: var(--border); }
.dialog-header > div { min-width: 0; flex: 1; }
.dialog-header p { margin: 0 0 1px; color: var(--teal-700); font-size: 8px; font-weight: 700; letter-spacing: .11em; }
.dialog-header h2 { overflow: hidden; margin: 0; font-size: 15px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.dialog-back { display: none; background: transparent; border: 0; outline: none; box-shadow: none; -webkit-tap-highlight-color: transparent; -webkit-touch-callout: none; user-select: none; }
.dialog-back:focus,
.dialog-back:focus-visible,
.dialog-back:active,
.dialog-back:hover,
.touch-button.dialog-back:focus,
.touch-button.dialog-back:focus-visible,
.touch-button.dialog-back:active,
.touch-button.dialog-back:hover { outline: none !important; box-shadow: none !important; background: transparent !important; -webkit-tap-highlight-color: transparent !important; }
.dialog-body { min-width: 0; padding: 13px; overflow: auto; }
.profile-summary { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); margin-bottom: 10px; border: var(--border); border-radius: var(--radius); }
.profile-summary div { min-width: 0; padding: 9px 10px; border-right: var(--border); }
.profile-summary div:last-child { border-right: 0; }
.profile-summary span { display: block; color: var(--stone-500); font-size: 9px; text-transform: uppercase; letter-spacing: .04em; }
.profile-summary strong { display: block; overflow: hidden; margin-top: 2px; font-size: 12px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.bill-toolbar { display: flex; min-height: 43px; align-items: center; gap: 10px; padding: 5px 9px; background: var(--stone-50); border: var(--border); border-bottom: 0; border-radius: var(--radius) var(--radius) 0 0; }
.bill-toolbar label { display: flex; align-items: center; gap: 7px; font-size: 11px; }
.bill-toolbar > span { margin-left: auto; color: var(--stone-500); font-size: 10px; }
.bill-toolbar-actions { display: flex; align-items: center; gap: 8px; }
.bill-table-wrap { overflow: hidden; border: var(--border); border-radius: 0 0 var(--radius) var(--radius); }
.bill-table th:nth-child(2) { width: 18%; }
.bill-table th:nth-child(3) { width: 24%; }
.bill-table th:nth-child(4) { width: 30%; }
.bill-table th:nth-child(5) { width: 14%; }
.bill-table th:last-child { width: 100px; }
.bill-table td:nth-child(4) { overflow-wrap: anywhere; }
.bill-table td:nth-child(5) { font-variant-numeric: tabular-nums; }
.mobile-bill-list { display: none; }
.form-dialog { width: min(520px, calc(100% - 28px)); }
.form-stack { display: grid; gap: 11px; padding: 15px; }
.form-note { display: flex; gap: 8px; padding: 9px; color: var(--stone-600); background: var(--stone-50); border: var(--border); border-radius: var(--radius); }
.form-note svg { width: 16px; flex: 0 0 16px; color: var(--amber-600); }
.form-note p { margin: 0; font-size: 10px; }
.dialog-footer { display: flex; min-height: 55px; justify-content: flex-end; align-items: center; gap: 7px; padding: 9px 13px; background: var(--stone-50); border-top: var(--border); }
.confirm-dialog { width: min(410px, calc(100% - 28px)); padding: 20px; }
.confirm-dialog .dialog-shell { display: block; }
.confirm-icon { display: grid; width: 34px; height: 34px; margin-bottom: 10px; place-items: center; color: var(--red-600); background: var(--red-50); border: 1px solid var(--red-200); border-radius: 50%; }
.confirm-icon svg { width: 17px; }
.confirm-dialog h2 { margin: 0; font-size: 15px; font-weight: 600; }
.confirm-dialog > .dialog-shell > p { margin: 5px 0 10px; color: var(--stone-600); font-size: 12px; }
.confirm-context { padding: 8px 10px; color: var(--stone-600); background: var(--stone-50); border: var(--border); border-radius: var(--radius); font-size: 11px; white-space: pre-line; }
.confirm-actions { display: flex; justify-content: flex-end; gap: 7px; margin-top: 15px; }

.toast-region { position: fixed; right: 14px; bottom: 14px; z-index: 2000; display: grid; width: min(340px, calc(100% - 28px)); gap: 7px; pointer-events: none; }
.toast { display: flex; min-height: 45px; align-items: center; gap: 9px; padding: 9px 11px; color: var(--stone-200); background: var(--stone-900); border: 1px solid #3c3734; border-radius: var(--radius); box-shadow: 0 8px 24px rgba(28,25,23,.18); animation: toast-in 180ms ease both; }
.toast svg { width: 16px; flex: 0 0 16px; color: #5eead4; }
.toast.is-error svg { color: #fca5a5; }
.toast div { min-width: 0; }
.toast strong { display: block; font-size: 11px; font-weight: 600; }
.toast span { display: block; margin-top: 1px; color: var(--stone-400); font-size: 10px; }
@keyframes toast-in { from { opacity: 0; transform: translateY(5px); } }
.more-menu { position: fixed; right: 10px; bottom: calc(62px + env(safe-area-inset-bottom)); z-index: 1200; width: 216px; padding: 6px; background: var(--surface); border: var(--border); border-radius: 8px; box-shadow: 0 10px 30px rgba(28,25,23,.18); display: flex; flex-direction: column; }
.more-menu-header { padding: 6px 10px 8px; border-bottom: var(--border); margin-bottom: 4px; }
.more-menu-user-info { display: flex; flex-direction: column; gap: 1px; }
.more-menu-user-name { font-size: 13px; font-weight: 600; color: var(--stone-900); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.more-menu-user-role { font-size: 10px; font-weight: 600; color: var(--teal-700); letter-spacing: .04em; }
.more-menu-links { display: flex; flex-direction: column; gap: 2px; }
.more-menu button { display: flex; width: 100%; min-height: 38px; align-items: center; gap: 9px; padding: 0 10px; background: transparent; border: 0; border-radius: 5px; font-size: 13px; font-weight: 500; color: var(--stone-700); text-align: left; cursor: pointer; transition: background 120ms ease, color 120ms ease; }
.more-menu button:hover, .more-menu button.is-active { background: var(--stone-100); color: var(--stone-900); }
.more-menu button svg { width: 17px; height: 17px; color: var(--stone-500); flex-shrink: 0; }
.more-menu button.is-active svg { color: var(--teal-700); }
.more-menu-divider { height: 1px; background: var(--stone-200); margin: 4px 0; }
.more-menu-footer { display: flex; flex-direction: column; gap: 2px; }
.more-menu button.danger-item { color: #dc2626; }
.more-menu button.danger-item:hover { background: #fef2f2; color: #b91c1c; }
.more-menu button.danger-item svg { color: #dc2626; }

/* Saved-bill controls and profile summary refinements. */
.profile-summary div:nth-child(4) { display: none; }
.download-title strong small { color: var(--stone-500); font-size: 10px; font-weight: 500; }
.saved-bill-pagination { display: flex; min-height: 42px; align-items: center; justify-content: center; gap: 4px; padding: 5px 12px; border-top: var(--border); color: var(--stone-500); font-size: 11px; }
.saved-page-button { display: inline-grid; width: 28px; height: 28px; place-items: center; color: var(--stone-600); background: var(--surface); border: var(--border); border-radius: 3px; font-size: 11px; }
.saved-page-arrow svg { width: 14px; height: 14px; }
.saved-page-button:disabled { color: var(--stone-300); background: var(--stone-50); border-color: var(--stone-200); cursor: not-allowed; }
.saved-page-button:hover { color: var(--teal-800); border-color: var(--teal-400); }
.saved-page-button:disabled:hover { color: var(--stone-300); border-color: var(--stone-200); }
.saved-page-button.is-current { color: white; background: var(--teal-700); border-color: var(--teal-700); }

/* User cell spacing fix */
.user-cell { display: flex; flex-direction: column; gap: 2px; min-width: 0; line-height: 1.35; }
.user-cell strong { font-weight: 600; color: var(--stone-900); font-size: 13px; }
.user-cell small { color: var(--stone-500); font-size: 11px; }

/* Admin wallet viewing banner and selector */
.wallet-user-selector-wrap { display: flex; align-items: center; gap: 8px; }
.wallet-select-label { color: var(--stone-600); font-size: 12px; font-weight: 500; white-space: nowrap; }
.wallet-banner { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; padding: 9px 14px; background: var(--teal-50); border: 1px solid var(--teal-200); border-radius: var(--radius); font-size: 12px; color: var(--teal-900); }
.wallet-banner svg { width: 16px; height: 16px; color: var(--teal-700); flex-shrink: 0; }
.wallet-banner button { margin-left: auto; color: var(--teal-700); font-size: 11px; font-weight: 600; text-decoration: underline; background: transparent; border: 0; cursor: pointer; padding: 2px 4px; }
.wallet-banner button:hover { color: var(--teal-900); }

/* Searchable Select */
.searchable-select-wrapper { position: relative; display: inline-block; width: 100%; min-width: 0; }
.toolbar .searchable-select-wrapper { width: auto; min-width: 150px; max-width: 240px; }
.wallet-user-selector-wrap .searchable-select-wrapper { width: auto; min-width: 220px; max-width: 320px; }
.searchable-select-trigger { display: flex; width: 100%; min-width: 0; height: 35px; align-items: center; justify-content: space-between; gap: 8px; padding: 0 10px; background: var(--surface); border: var(--border); border-radius: var(--radius); color: var(--stone-800); font: inherit; font-size: 12px; cursor: pointer; text-align: left; outline: 0; transition: border-color 120ms ease, box-shadow 120ms ease; }
.toolbar .searchable-select-trigger, .wallet-user-selector-wrap .searchable-select-trigger { height: 34px; background: var(--stone-50); }
.searchable-select-trigger:hover { background: var(--surface); border-color: var(--stone-400); }
.searchable-select-trigger:focus-visible, .searchable-select-wrapper.is-open .searchable-select-trigger { background: var(--surface); border-color: var(--teal-600); box-shadow: 0 0 0 2px var(--teal-100); }
.searchable-select-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.searchable-select-arrow { flex: 0 0 auto; width: 14px; height: 14px; color: var(--stone-400); transition: transform 150ms ease; }
.searchable-select-wrapper.is-open .searchable-select-arrow { transform: rotate(180deg); }

.searchable-select-menu { position: absolute; top: calc(100% + 4px); left: 0; z-index: 1050; width: max(100%, 220px); min-width: 100%; max-width: 360px; padding: 5px; background: var(--surface); border: var(--border); border-radius: var(--radius); box-shadow: 0 10px 28px rgba(28,25,23,.16); animation: dropdown-in 120ms ease-out; }
.searchable-select-menu.open-upward { top: auto; bottom: calc(100% + 4px); }
@keyframes dropdown-in { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: translateY(0); } }
.searchable-select-search-wrap { display: flex; align-items: center; gap: 6px; padding: 0 8px; margin-bottom: 5px; height: 32px; background: var(--stone-50); border: 1px solid var(--stone-200); border-radius: 4px; }
.searchable-select-search-wrap:focus-within { background: var(--surface); border-color: var(--teal-600); box-shadow: 0 0 0 1px var(--teal-600); }
.searchable-select-search-wrap svg { width: 13px; height: 13px; color: var(--stone-400); flex-shrink: 0; }
.searchable-select-search { width: 100%; border: 0; background: transparent; outline: 0; font: inherit; font-size: 12px; color: var(--stone-800); }
.searchable-select-options { max-height: 200px; overflow-y: auto; overscroll-behavior: contain; }
.searchable-select-option { display: flex; align-items: center; justify-content: space-between; min-height: 30px; padding: 5px 8px; border-radius: 4px; font-size: 12px; color: var(--stone-700); cursor: pointer; user-select: none; }
.searchable-select-option:hover, .searchable-select-option.is-highlighted { background: var(--teal-50); color: var(--teal-900); }
.searchable-select-option.is-selected { background: var(--teal-600); color: white; font-weight: 500; }
.searchable-select-empty { padding: 12px; text-align: center; color: var(--stone-400); font-size: 11px; }

select.has-searchable-select { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; border: 0 !important; opacity: 0 !important; pointer-events: none !important; }

.sidebar-backdrop { display: none; }

@media (max-width: 980px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .settings-layout { grid-template-columns: 1fr; }
  .security-note { max-width: 720px; }
  .data-table .action-cell { width: 250px; }
}

@media (max-width: 760px) {
  :root { --mobile-top: calc(48px + env(safe-area-inset-top)); --mobile-bottom: calc(56px + env(safe-area-inset-bottom)); }
  body { font-size: 13px; }
  .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(15, 23, 42, 0.6); backdrop-filter: blur(2px); z-index: 1400; opacity: 0; pointer-events: none; transition: opacity 220ms ease; }
  .sidebar-backdrop.is-visible { opacity: 1; pointer-events: auto; }
  .sidebar { display: flex !important; position: fixed; inset: 0 auto 0 0; width: 260px; max-width: 82vw; z-index: 1500; transform: translateX(-100%); transition: transform 220ms cubic-bezier(0.16, 1, 0.3, 1); box-shadow: 4px 0 28px rgba(0, 0, 0, 0.4); }
  .sidebar.is-mobile-open { transform: translateX(0); }
  .sidebar-collapse { display: none !important; }
  .desktop-topbar { display: none; }
  .app-main { margin-left: 0 !important; }
  .mobile-top-bar { position: sticky; top: 0; z-index: 1000; display: block; width: 100%; height: var(--mobile-top); padding-top: env(safe-area-inset-top); background: var(--surface); border-bottom: var(--border); }
  .mobile-top-bar__row { display: flex; min-width: 0; height: 48px; align-items: center; padding: 0 6px 0 10px; gap: 4px; }
  .mobile-menu-btn { width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; color: var(--stone-700); border-radius: var(--radius); flex-shrink: 0; }
  .mobile-menu-btn:hover { background: var(--stone-100); color: var(--stone-900); }
  .mobile-menu-btn svg { width: 20px; height: 20px; }
  .mobile-top-bar__title { min-width: 0; flex: 1 1 auto; overflow: hidden; margin: 0; font-size: 15px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
  .mobile-top-bar__actions { display: flex; flex: 0 0 auto; align-items: center; }
  .mobile-credit { display: inline-flex; max-width: 96px; min-height: 30px; align-items: center; overflow: hidden; padding: 0 7px; color: var(--teal-800); background: var(--teal-50); border: 1px solid var(--teal-200); border-radius: var(--radius); font: inherit; font-size: 10px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
  .mobile-bottom-nav { position: fixed; inset: auto 0 0; z-index: 1000; display: block; width: 100%; height: var(--mobile-bottom); padding-bottom: env(safe-area-inset-bottom); background: var(--surface); border-top: var(--border); }
  .mobile-bottom-nav__items { display: grid; height: 56px; grid-template-columns: repeat(6,minmax(0,1fr)); align-items: center; }
  .mobile-bottom-nav__item { position: relative; display: flex; width: 100%; min-width: 0; height: 56px; flex-direction: column; align-items: center; justify-content: center; gap: 1px; padding: 0; color: var(--stone-500); background: transparent; border: 0; }
  .mobile-bottom-nav__item svg { width: 24px; height: 24px; stroke-width: 1.65; }
  .mobile-bottom-nav__item span { max-width: 100%; overflow: hidden; font-size: 10px; line-height: 12px; text-overflow: ellipsis; white-space: nowrap; }
  .mobile-bottom-nav__item.is-active { color: var(--teal-700); }
  .mobile-bottom-nav__item.is-active::before { position: absolute; top: 0; width: 24px; height: 2px; background: var(--teal-600); content: ""; }
  .mobile-bottom-nav__item em { position: absolute; top: 3px; left: calc(50% + 8px); display: none; min-width: 15px; height: 15px; padding: 0 4px; color: white; background: var(--teal-700); border-radius: 8px; font-size: 9px; font-style: normal; line-height: 15px; }
  .mobile-bottom-nav__item em:not(:empty) { display: block; }
  .workspace { min-height: calc(100vh - var(--mobile-top)); padding: 14px 12px var(--mobile-bottom); }
  .page-heading { align-items: center; margin-bottom: 11px; }
  .page-heading h1 { font-size: 18px; }
  .page-heading > div:first-child > p:not(.eyebrow), .page-heading .eyebrow { display: none; }
  .page-heading .page-actions .button-secondary { display: none; }
  .page-heading .page-actions .button { min-height: 32px; }
  .setup-callout { align-items: flex-start; flex-wrap: wrap; }
  .setup-callout .button { width: 100%; }
  .metric-strip { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .metric-strip > div { min-height: 53px; border-bottom: var(--border); }
  .metric-strip > div:nth-child(2) { border-right: 0; }
  .metric-strip > div:nth-child(3), .metric-strip > div:nth-child(4) { border-bottom: 0; }
  .metric-strip strong { font-size: 16px; }
  .dashboard-grid { gap: 9px; }
  .panel-header { padding-inline: 11px; }
  .page > .panel + .panel { margin-top: 10px; }
  .compact-row { padding-inline: 11px; }
  .toolbar { flex-wrap: wrap; }
  .search-field { width: 100%; }
  .toolbar-select { flex: 1; min-width: 140px; }
  .toolbar-spacer { display: none; }
  .toolbar .searchable-select-wrapper { width: 100%; min-width: 100%; max-width: 100%; }
  .wallet-user-selector-wrap { width: 100%; flex-wrap: wrap; margin-top: 6px; }
  .wallet-user-selector-wrap .searchable-select-wrapper { width: 100%; min-width: 100%; max-width: 100%; }
  .selection-label { flex: 1; }
  .desktop-account-view { display: none; }
  .mobile-account-view { display: block; }
  .account-card { position: relative; display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 8px 10px; padding: 12px 14px; border-bottom: var(--border); }
  .account-card:last-child { border-bottom: 0; }
  .account-card::before { position: absolute; inset: 10px auto 10px 0; width: 3px; background: var(--teal-600); content: ""; }
  .account-card-check { padding-top: 3px; }
  .account-card-main { min-width: 0; }
  .account-card-main strong { display: block; font-size: 13.5px; font-weight: 600; }
  .account-card-main span { display: block; overflow: hidden; margin-top: 2px; color: var(--stone-500); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
  .account-card-main .status-badge { display: inline-flex; margin-top: 6px; }
  .account-card-actions { grid-column: 2; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
  .account-card-actions .button { min-height: 31px; padding: 0 10px; font-size: 12px; font-weight: 500; }
  .account-card-actions .icon-button { width: 31px; height: 31px; margin-left: auto; }
  .table-wrap .data-table { min-width: 620px; }
  .download-panel-head { display: none; }
  .download-row { grid-template-columns: minmax(0,1fr) auto; min-height: 67px; padding: 8px 9px 8px 12px; }
  .download-status { grid-column: 1; }
  .download-action { grid-area: 1 / 2 / 3 / 3; }
  .download-error { max-width: 220px; }
  .download-panel-foot span { display: none; }
  .settings-layout { display: block; }
  .settings-card { margin-inline: 0; }
  .security-note { margin-top: 9px; }
  .form-actions { align-items: stretch; flex-direction: column-reverse; }
  .form-actions > div { display: grid; grid-template-columns: 1fr 1fr; }
  .form-actions > .button { width: 100%; }
  .field input, .field select { font-size: 16px; }
  .app-dialog { width: 100%; max-width: 100%; height: 100%; max-height: 100%; margin: 0; border: 0; border-radius: 0; }
  .app-dialog .dialog-shell { width: 100%; max-width: 100%; height: 100%; max-height: 100%; padding-bottom: env(safe-area-inset-bottom); }
  .dialog-header { min-height: calc(48px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 2px 0; }
  .dialog-header .dialog-back { display: inline-flex; background: transparent; border: 0; outline: none; box-shadow: none; -webkit-tap-highlight-color: transparent; -webkit-touch-callout: none; }
  .dialog-header .dialog-back:focus,
  .dialog-header .dialog-back:focus-visible,
  .dialog-header .dialog-back:active,
  .dialog-header .dialog-back:hover { outline: none !important; box-shadow: none !important; background: transparent !important; -webkit-tap-highlight-color: transparent !important; }
  .dialog-header > .icon-button { display: none; }
  .dialog-header p { display: none; }
  .dialog-header h2 { font-size: 15px; }
  .dialog-body { padding: 10px 11px; }
  .profile-summary { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .profile-summary div:nth-child(2) { border-right: 0; }
  .profile-summary div:nth-child(-n+2) { border-bottom: var(--border); }
  .bill-toolbar { flex-wrap: wrap; }
  .bill-toolbar > span { margin-left: auto; }
  .bill-toolbar-actions { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
  .bill-toolbar-actions .button { width: 100%; justify-content: center; }
  .bill-table { display: none; }
  .mobile-bill-list { display: block; }
  .mobile-bill-row { display: grid; grid-template-columns: 24px minmax(0,1fr) auto; gap: 8px; align-items: center; min-height: 67px; padding: 8px 9px; border-bottom: var(--border); }
  .mobile-bill-row:last-child { border-bottom: 0; }
  .mobile-bill-row strong { display: block; font-size: 12px; font-weight: 600; }
  .mobile-bill-row span { display: block; margin-top: 2px; color: var(--stone-500); font-size: 10px; }
  .mobile-bill-row .amount { color: var(--stone-800); font-size: 12px; font-weight: 500; }
  .form-stack { flex: 1; align-content: start; overflow: auto; }
  .dialog-footer { padding-bottom: calc(9px + env(safe-area-inset-bottom)); }
  .dialog-footer .button { flex: 1; min-height: 38px; }
  .confirm-dialog { width: calc(100% - 28px); height: auto; margin: auto; padding: 18px; border: var(--border); border-radius: 7px; }
  .confirm-dialog .dialog-shell { height: auto; padding: 0; }
  .toast-region { right: 10px; bottom: calc(var(--mobile-bottom) + 9px); width: calc(100% - 20px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Respect native hidden state even when a component has its own display rule. */
[hidden], .more-menu[hidden] { display: none !important; }
/* The wrapper owns the single visible focus indicator. */
.searchable-select-search-wrap input.searchable-select-search,
.searchable-select-search-wrap input.searchable-select-search:focus,
.searchable-select-search-wrap input.searchable-select-search:focus-visible,
.search-field input:focus, .search-field input:focus-visible {
  border: 0; outline: 0; box-shadow: none; background: transparent;
}
.saved-bills-toolbar { flex-wrap: wrap; align-items: end; gap: 12px; }
.download-filter { display: flex; flex-direction: column; gap: 5px; font-size: 12px; min-width: 140px; flex: 1; }
.download-filter input, .download-filter select { width: 100%; min-height: 36px; }
.saved-bills-toolbar .search-field { flex: 2; min-width: 220px; }
.download-list { overflow-x: auto; }
.downloads-table { width: 100%; min-width: 920px; }
.downloads-table td { overflow-wrap: anywhere; }
.downloads-table .download-status { display: flex; flex-direction: column; align-items: start; }
.wallet-panel .data-table { min-width: 1100px; }
.wallet-panel .data-table th:nth-child(1) { width: 13%; }
.wallet-panel .data-table th:nth-child(2) { width: 10%; }
.wallet-panel .data-table th:nth-child(3) { width: 8%; }
.wallet-panel .data-table th:nth-child(4) { width: 10%; }
.wallet-panel .data-table th:nth-child(5) { width: 17%; }
.wallet-panel .data-table th:nth-child(6) { width: 28%; }
.wallet-panel .data-table th:nth-child(7) { width: 10%; }
.wallet-panel .data-table th:nth-child(8) { width: 4%; }
.wallet-panel .data-table td { overflow-wrap: anywhere; }
.account-table { min-width: 1100px; }
@media (min-width: 761px) { .more-menu { display: none !important; } }
@media (max-width: 760px) {
  .saved-bills-toolbar .search-field { flex-basis: 100%; min-width: 0; }
  .download-filter { min-width: 0; flex-basis: calc(50% - 12px); }
  .download-list { overflow: visible; }
  .downloads-table, .downloads-table tbody { display: block; min-width: 0; }
  .downloads-table thead { display: none; }
  .downloads-table tr { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 16px; border-bottom: var(--border); }
  .downloads-table td { display: block; border: 0; padding: 0; min-width: 0; white-space: normal; }
  .downloads-table td::before { content: attr(data-label); display: block; margin-bottom: 4px; color: var(--stone-500); font-size: 11px; }
  .downloads-table td:nth-child(2) { grid-column: 1 / -1; }
  .page-heading, .panel-header { flex-wrap: wrap; gap: 12px; }
  .page-actions { flex-wrap: wrap; }
  .more-menu { max-height: calc(100dvh - 150px); overflow-y: auto; }
  .searchable-select-menu { max-width: min(360px, calc(100vw - 48px)); min-width: min(100%, 220px); }
}

@media (max-width: 760px) {
  .sidebar:not(.is-mobile-open) { box-shadow: none; }
}

@media (min-width: 761px) {
  .downloads-table th:first-child, .downloads-table td:first-child { min-width: 140px; white-space: nowrap; }
  .downloads-table th:nth-child(2), .downloads-table td:nth-child(2) { min-width: 180px; }
}
@media (min-width: 761px) and (max-width: 980px) {
  .topbar-title small { display: none; }
}

/* Compact controls share the existing search-field surface and focus treatment. */
.saved-bills-toolbar { gap: 8px; padding: 8px 0; }
.download-filter { gap: 4px; min-width: 130px; font-size: 11px; }
.download-filter input, .download-filter select {
  height: 35px; min-height: 35px; padding: 0 9px; border: var(--border);
  border-radius: var(--radius); background: var(--stone-50); outline: 0;
}
.download-filter input:focus-visible { background: var(--surface); border-color: var(--teal-600); box-shadow: 0 0 0 2px var(--teal-100); }
.filter-actions { display: flex; align-items: center; flex: 0 0 auto; gap: 6px; }
.filter-actions .button { min-height: 35px; white-space: nowrap; }
.account-filter-toolbar { gap: 8px; flex-wrap: wrap; }
.account-filter-toolbar .search-field { flex: 1 1 280px; min-width: 200px; }
.account-filter-toolbar .toolbar-select { width: 140px; }
.account-filter-field { display: grid; gap: 4px; min-width: 0; width: 150px; flex: 0 0 150px; }
.account-filter-field > span { font-size: 11px; color: var(--stone-600); }
.toolbar .account-filter-field .searchable-select-wrapper { width: 100%; min-width: 0; max-width: 100%; }
.account-filter-toolbar { align-items: end; }
@media (max-width: 760px) {
  .toolbar.account-filter-toolbar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: center; gap: 8px; }
  .account-filter-toolbar > .mobile-only-selection,
  .account-filter-toolbar > .search-field,
  .account-filter-toolbar > .filter-actions { grid-column: 1 / -1; width: 100%; min-width: 0; }
  .account-filter-toolbar > .account-filter-field { width: 100%; min-width: 0; }
  .account-filter-toolbar > .selection-label { min-width: 0; }
  .account-filter-toolbar > #download-selected-accounts { justify-self: end; }
}
/* Eight columns need explicit space; overflowing controls stay inside their own cell. */
.account-table { min-width: 1150px; }
.account-table th:nth-child(1) { width: 38px; }
.account-table th:nth-child(2) { width: 125px; }
.account-table th:nth-child(3) { width: 155px; }
.account-table th:nth-child(4) { width: 190px; }
.account-table th:nth-child(5) { width: 220px; }
.account-table th:nth-child(6) { width: 85px; }
.account-table th:nth-child(7) { width: 100px; }
.account-table th:nth-child(8), .account-table .action-cell { width: 230px; }
.account-table td { overflow-wrap: anywhere; }
.account-table td:nth-child(2), .account-table td:nth-child(7) { white-space: nowrap; }
.account-table .row-actions { flex-wrap: wrap; gap: 4px; }
.account-table .row-actions > * { flex-shrink: 0; }
[data-page-panel="users"] .form-actions { justify-content: flex-start; min-height: 48px; padding: 8px 14px; }
[data-page-panel="users"] .form-actions > .button { width: auto; align-self: flex-start; }
[data-page-panel="users"] input[type="file"] { height: 36px; padding: 4px 8px; line-height: 26px; }
[data-page-panel="users"] input[type="file"]::file-selector-button {
  height: 26px; margin: 0 8px 0 0; padding: 0 8px; vertical-align: top;
  color: var(--stone-700); background: var(--stone-50); border: var(--border); border-radius: 3px; font: inherit;
}
@media (max-width: 760px) {
  .account-filter-toolbar .search-field { flex-basis: 100%; min-width: 0; }
  .account-filter-toolbar .searchable-select-wrapper { width: calc(50% - 4px); min-width: 0; flex: 1; }
  .download-filter { flex-basis: calc(50% - 8px); min-width: 0; }
  .filter-actions { flex-wrap: wrap; }
  .saved-bills-toolbar .filter-actions { flex: 1; }
  [data-page-panel="users"] .form-actions { flex-direction: row; align-items: center; }
}

/* Compact desktop forms; one clear reading column on phones. */
[data-page-panel="users"] .admin-adjust-panel { margin-top: 12px; }
[data-page-panel="users"] .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; padding: 12px 14px; }
[data-page-panel="users"] .field-wide { grid-column: 1 / -1; }
@media (max-width: 760px) {
  [data-page-panel="users"] .form-grid { grid-template-columns: minmax(0, 1fr); gap: 9px; padding: 10px 12px; }
}

/* Result summaries sit with the records, not among editable filter fields. */
.results-notice { display: flex; align-items: center; min-height: 32px; padding: 7px 11px; border-bottom: var(--border); border-left: 3px solid var(--teal-600); background: var(--teal-50); color: var(--teal-800); font-size: 11px; font-weight: 500; }
.results-notice:empty { display: none; }
.saved-bill-pagination, nav[class*="pagination"], .pagination { justify-content: flex-end; }
.mobile-only-selection { display: none; }
[data-page-panel="users"] .form-actions { background: transparent; border: 0; padding: 0; min-height: 34px; margin: 0; }
[data-page-panel="users"] .form-actions > .button { margin-left: 0; }
@media (max-width: 760px) {
  .workspace { padding-bottom: calc(var(--mobile-bottom) + 24px); }
  .mobile-only-selection { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; }
  .table-wrap { overflow: visible; }
  table.data-table:not(.account-table):not(.bill-table) { display: block; min-width: 0 !important; width: 100%; background: var(--stone-100); }
  table.data-table:not(.account-table):not(.bill-table) thead { display: none; }
  table.data-table:not(.account-table):not(.bill-table) tbody { display: grid; gap: 8px; padding: 8px; }
  table.data-table:not(.account-table):not(.bill-table) tbody tr { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px 12px; padding: 11px; border: var(--border); border-radius: var(--radius); background: var(--surface); }
  table.data-table:not(.account-table):not(.bill-table) td { display: block; width: auto; min-width: 0; height: auto; min-height: 0; padding: 0; border: 0; text-align: left; overflow-wrap: anywhere; white-space: normal; }
  table.data-table:not(.account-table):not(.bill-table) td::before { content: attr(data-label); display: block; color: var(--stone-500); font-size: 10px; line-height: 1.3; margin-bottom: 3px; }
  table.data-table:not(.account-table):not(.bill-table) td[data-label="" ]::before { display: none; }
  table.data-table:not(.account-table):not(.bill-table) td[data-label*="Address"],
  table.data-table:not(.account-table):not(.bill-table) td[data-label="Address"],
  table.data-table:not(.account-table):not(.bill-table) td[data-label="Remark"],
  table.data-table:not(.account-table):not(.bill-table) .mobile-full-cell { grid-column: 1 / -1; }
  table.data-table:not(.account-table):not(.bill-table) .row-actions { justify-content: flex-start; flex-wrap: wrap; }
  table.data-table:not(.account-table):not(.bill-table) .button { min-height: 30px; padding: 0 8px; }
  #account-cards { display: grid; gap: 8px; padding: 8px; background: var(--stone-100); }
  .account-card { padding: 11px; border: var(--border); border-radius: var(--radius); background: var(--surface); }
  .account-card:last-child { border-bottom: var(--border); }
  .mobile-bill-list { display: grid; gap: 8px; padding: 8px; background: var(--stone-100); }
  .mobile-bill-row { min-height: 60px; border: var(--border); border-radius: var(--radius); background: var(--surface); }
  .mobile-bill-row:last-child { border-bottom: var(--border); }
  .results-notice { padding: 6px 9px; font-size: 10px; }
}

@media (max-width: 760px) {
  #refresh-remote-accounts { display: inline-flex; }
}

/* Keep matching form inputs aligned even when one has helper text. */
#create-user-form .field { align-content: start; grid-template-rows: auto 35px; }
#create-user-form .field small { grid-row: 3; }
@media (min-width: 761px) {
  .downloads-table { min-width: 1060px; }
  .downloads-table th:nth-child(2), .downloads-table td:nth-child(2) { min-width: 140px; }
  .downloads-table th:nth-child(3), .downloads-table td:nth-child(3) { min-width: 180px; }
}
@media (max-width: 760px) {
  .downloads-table td:nth-child(3) { grid-column: 1 / -1; }
}

.download-account-selection, .download-selection-controls, .download-selection-controls label { display: flex; align-items: center; gap: 8px; }
.download-selection-controls { flex-wrap: wrap; }
.download-selection-controls label { font-size: 11px; }
.download-selection-controls #download-selection-label { display: inline; }
.downloads-table td:last-child .button { margin: 2px; }
@media (min-width: 761px) {
  .downloads-table { min-width: 1150px; }
  .downloads-table th:last-child { width: 142px; }
}

.remote-app-nickname { display: block; line-height: 1.35; margin-bottom: 5px; overflow-wrap: anywhere; }
.remote-app-nickname:last-child { margin-bottom: 0; }
.remote-app-nickname small { display: block; color: var(--stone-500); font-size: 10px; }
@media (max-width: 760px) {
  td[data-label="App Account Nickname"] { grid-column: 1 / -1; }
}

/* Five account details remain readable in fresh and cached bill dialogs. */
.profile-summary { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 1px; background: var(--stone-200); }
.profile-summary div, .profile-summary div:nth-child(-n+2) { display: block; padding: 8px 10px; border: 0; background: var(--surface); }
.profile-summary div:nth-child(4) { display: block; }
.profile-summary div:nth-child(5) { grid-column: span 2; }
.profile-summary strong { white-space: normal; overflow-wrap: anywhere; }
@media (max-width: 760px) {
  .profile-summary { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .profile-summary div:nth-child(3), .profile-summary div:nth-child(5) { grid-column: 1 / -1; }
}

/* Timestamp columns retain their own space alongside status and action controls. */
.account-table { min-width: 1320px; }
.account-table th:nth-child(7) { width: 150px; }
.account-table th:nth-child(8) { width: 100px; }
.account-table th:nth-child(9) { width: 230px; }
.remote-account-table { min-width: 1450px; }
.remote-account-table th:first-child { width: 38px; }
.remote-account-table th:nth-child(2) { width: 130px; }
.remote-account-table th:nth-child(6) { width: 200px; }
.remote-account-table th:nth-child(8) { width: 160px; }
.remote-account-table th:nth-child(9) { width: 90px; }
.remote-account-table .action-cell { width: 100px; }
.remote-filter-toolbar { flex-wrap: wrap; gap: 8px; }
.remote-filter-toolbar .search-field { flex: 1 1 300px; }
@media (max-width: 760px) {
  .remote-filter-toolbar .search-field { flex-basis: 100%; }
  .remote-filter-toolbar .searchable-select-wrapper { flex: 1; min-width: 0; }
}

.table-pagination, .saved-bill-pagination { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 5px; padding: 8px 11px; border-top: var(--border); font-size: 11px; background: var(--surface); }
.page-size-label { display: inline-flex; align-items: center; gap: 6px; margin-right: 5px; color: var(--stone-600); }
.page-size-label select { width: 64px; height: 29px; padding: 0 6px; border: var(--border); border-radius: var(--radius); background: var(--stone-50); }
.pagination-summary { margin-right: 6px; color: var(--stone-600); }
#active-download-list:not(.is-hidden) { margin-bottom: 10px; }
@media (max-width: 760px) {
  .table-pagination, .saved-bill-pagination { gap: 4px; padding: 8px; }
  .pagination-summary { font-size: 10px; }
  .page-size-label { gap: 4px; margin-right: 0; }
}

/* Shared surfaces and controls, including dynamically added dropdowns. */
.theme-toggle { flex-shrink: 0; font-size: 19px; }
.user-filter-toolbar { flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.user-filter-toolbar .search-field { flex: 1; min-width: 180px; }
.user-filter-toolbar > .searchable-select-wrapper { width: 160px; }
.status-badge[data-edit-user-status] { cursor: pointer; }
.status-badge[data-edit-user-status]:focus-visible { outline: 2px solid var(--teal-600); outline-offset: 2px; }
.searchable-select-wrapper { min-width: 0; max-width: 100%; }
.page-size-label .searchable-select-wrapper { width: 68px; }
.page-size-label .searchable-select-trigger { height: 30px; padding: 0 7px; }
.download-filter { min-width: 0; }
.download-filter input { display: block; width: 100%; max-width: 100%; min-width: 0; box-sizing: border-box; -webkit-appearance: none; appearance: none; }
/* Safari date controls have their own value box; center it inside the field. */
.download-filter input:is([type="date"], [type="month"]) { height: 36px; min-height: 36px; padding-block: 0; line-height: 34px; text-align: left; }
.download-filter input::-webkit-date-and-time-value { min-height: 34px; line-height: 34px; margin: 0; text-align: left; }
.download-filter input::-webkit-datetime-edit { display: inline-flex; align-items: center; padding: 0; min-height: 34px; }
.download-filter input::-webkit-datetime-edit-fields-wrapper { padding: 0; }
:root[data-theme="dark"] {
  color-scheme: dark;
  --surface: #202c33; --row-hover: #2a3942;
  --stone-50: #1b262d; --stone-100: #111b21; --stone-150: #26343d;
  --stone-200: #34434c; --stone-300: #465760; --stone-400: #8fa0ab;
  --stone-500: #a7b5be; --stone-600: #bdc8cf; --stone-700: #d3dbe0;
  --stone-800: #e9edef; --stone-900: #f5f7f8;
  --teal-50: #25343e; --teal-100: #354852; --teal-200: #4a606c;
  --teal-400: #81939e; --teal-500: #a3b2bc; --teal-600: #c3cdd3;
  --teal-700: #c3cdd3; --teal-800: #e9edef; --teal-900: #f5f7f8;
  --red-50: #38262c; --red-200: #75434e; --red-600: #f0a7b1;
  --amber-50: #332e24; --amber-600: #e9c17c;
}

[data-theme="dark"] .sidebar { background: #202c33; color: #bdc8cf; --stone-900: #f5f7f8; --stone-300: #465760; --stone-400: #8fa0ab; --stone-500: #a7b5be; --stone-200: #34434c; }
[data-theme="dark"] .brand-name, [data-theme="dark"] .sidebar .nav-link.is-active { color: #f2f7f4; }
[data-theme="dark"] .button-primary:hover { background: #d9e1e6; }
[data-theme="dark"] .status-connected, [data-theme="dark"] .eyebrow { color: #c3cdd3; }
[data-theme="dark"] .searchable-select-option.is-selected { color: #111b21; }
[data-theme="dark"] .saved-page-button.is-current { color: #111b21; background: #c3cdd3; }
[data-theme="dark"] input:-webkit-autofill { -webkit-box-shadow: 0 0 0 1000px var(--surface) inset; -webkit-text-fill-color: var(--stone-800); }
[data-theme="dark"] .form-actions, [data-theme="dark"] .panel-header, [data-theme="dark"] .dialog-footer { background: var(--surface); }
@media (max-width: 767px) {
  .saved-bills-toolbar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 10px; align-items: end; }
  .saved-bills-toolbar > .search-field, .saved-bills-toolbar > .filter-actions, .saved-bills-toolbar > .results-notice { grid-column: 1 / -1; min-width: 0; width: 100%; }
  .saved-bills-toolbar .download-filter { min-width: 0; width: 100%; max-width: 100%; gap: 5px; }
  .saved-bills-toolbar .searchable-select-wrapper { min-width: 0; width: 100%; }
  .saved-bills-toolbar input { min-width: 0; max-width: 100%; }
  .page > .panel.data-panel, .page > .wallet-panel, .page > .download-panel { background: transparent; border: 0; border-radius: 0; overflow: visible; }
  .page .data-panel > .table-wrap, .page .account-cards { padding: 0; background: transparent; }
  .page .data-table tbody { padding: 0; gap: 8px; }
  .page .table-pagination { border: 0; background: transparent; margin-top: 8px; }
  .page .results-notice { margin-bottom: 8px; }
  .mobile-top-bar__actions { gap: 4px; }
  .mobile-top-bar__actions .theme-toggle { width: 28px; height: 30px; border: 0; }
  .user-filter-toolbar > .searchable-select-wrapper { flex: 1; min-width: 120px; }
}

@media (min-width: 768px) and (max-width: 1100px) {
  .saved-bills-toolbar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .saved-bills-toolbar > .search-field, .saved-bills-toolbar > .filter-actions { grid-column: 1 / -1; min-width: 0; }
  .saved-bills-toolbar .download-filter { width: 100%; min-width: 0; }
}
@media (max-width: 767px) {
  .page table.data-table:not(.account-table):not(.bill-table) tbody { padding: 0; }
  .page #account-cards { padding: 0; }
  .mobile-bill-list { padding: 0; background: transparent; }
}

[data-theme="dark"] .sidebar { --stone-100: #111b21; }
[data-theme="dark"] .toast { color: var(--stone-800); background: var(--surface); border-color: var(--stone-200); }
@media (max-width: 767px) { .mobile-credit { flex-shrink: 0; } }

/* Never present previous-page snapshots as current records during navigation. */
.page-load-notice { margin: 0 0 12px; padding: 10px 0; color: var(--stone-500); font-size: 12px; }
.page[aria-busy="true"] > :not(.page-heading):not(.page-load-notice) { visibility: hidden; pointer-events: none; }

.theme-toggle svg, [data-toggle-theme] svg { width: 17px; height: 17px; }
.saved-page-button svg, .table-pagination > svg { width: 14px; height: 14px; }

/* Shared feedback: quiet surfaces, clear hierarchy, and one Lucide icon family. */
.app-notice { --notice-accent: var(--teal-700); display: flex; align-items: center; gap: 10px; min-width: 0; color: var(--stone-700); }
.app-notice > svg { width: 16px; height: 16px; flex: 0 0 16px; color: var(--notice-accent); }
.notice-copy { display: flex; flex-wrap: wrap; align-items: baseline; gap: 3px 10px; min-width: 0; overflow-wrap: anywhere; }
.notice-copy > strong { font-size: 12px; line-height: 1.5; font-weight: 500; color: var(--stone-800); }
.notice-copy > span { font-size: 11px; line-height: 1.5; color: var(--stone-600); }
.app-notice[data-tone="neutral"] { --notice-accent: var(--stone-500); }
.app-notice[data-tone="error"] { --notice-accent: var(--red-600); }
.app-notice[data-tone="warning"] { --notice-accent: #98600b; }
.page-load-notice.app-notice { min-height: 40px; padding: 9px 12px; margin: 0 0 12px; background: var(--stone-50); border: var(--border); border-radius: var(--radius); }
.app-notice[data-tone="loading"] > svg { animation: notice-spin 1.1s linear infinite; }
@keyframes notice-spin { to { transform: rotate(360deg); } }
.results-notice { min-height: 34px; padding: 7px 11px; border: 0; border-bottom: var(--border); border-radius: 0; background: transparent; color: var(--stone-600); }
.results-notice .notice-copy > strong { font-size: 11px; }
.results-notice .notice-copy > span { font-size: 10px; }
.toast.app-notice, [data-theme="dark"] .toast.app-notice { align-items: flex-start; gap: 10px; padding: 12px; color: var(--stone-700); background: var(--surface); border: var(--border); border-radius: 7px; box-shadow: 0 6px 22px rgba(0,0,0,.12); pointer-events: auto; }
.toast.app-notice > svg { margin-top: 2px; color: var(--notice-accent); }
.toast .notice-copy { display: block; flex: 1; }
.toast .notice-copy > strong { display: block; font-size: 12px; }
.toast .notice-copy > span { display: block; margin-top: 2px; font-size: 11px; color: var(--stone-600); }
.notice-dismiss { display: inline-grid; width: 26px; height: 26px; flex: 0 0 26px; place-items: center; margin: -4px -4px 0 0; padding: 0; border: 0; border-radius: 4px; background: transparent; color: var(--stone-500); cursor: pointer; }
.notice-dismiss:hover { background: var(--stone-100); color: var(--stone-800); }
.toast .notice-dismiss svg { width: 14px; height: 14px; flex: none; color: inherit; }
.wallet-banner { flex-wrap: wrap; gap: 8px; padding: 10px 12px; color: var(--stone-700); background: var(--stone-50); border-color: var(--stone-200); }
.wallet-banner svg { color: var(--stone-500); }
.wallet-banner button { color: var(--teal-700); }
.setup-callout { padding: 12px; background: var(--stone-50); border: var(--border); border-radius: var(--radius); }
.setup-callout .callout-icon { width: 24px; height: 24px; flex-basis: 24px; background: transparent; border: 0; color: var(--stone-500); }
.auth-error { display: flex; align-items: flex-start; gap: 9px; padding: 10px 12px; background: var(--red-50); border: 1px solid var(--red-200); border-radius: var(--radius); line-height: 1.5; }
.auth-error svg { width: 16px; height: 16px; flex: 0 0 16px; margin-top: 1px; }
[data-theme="dark"] .app-notice { --notice-accent: #c3cdd3; }
[data-theme="dark"] .app-notice[data-tone="neutral"] { --notice-accent: var(--stone-500); }
[data-theme="dark"] .app-notice[data-tone="warning"] { --notice-accent: #f2c370; }
[data-theme="dark"] .app-notice[data-tone="error"] { --notice-accent: var(--red-600); }
[data-theme="dark"] .wallet-banner button { color: #c3cdd3; }
@media (max-width: 760px) {
  .page-load-notice.app-notice { padding: 9px 10px; gap: 8px; }
  .page-load-notice .notice-copy { display: block; }
  .page-load-notice .notice-copy > span { display: block; margin-top: 1px; }
  .toast-region { width: calc(100% - 24px); right: 12px; gap: 8px; bottom: calc(var(--mobile-bottom) + 12px); }
  .results-notice { padding-left: 0; padding-right: 0; }
}
@media (prefers-reduced-motion: reduce) { .app-notice[data-tone="loading"] > svg { animation: none; } }

/* Keep searchable choices inside modal layout, with the trigger always visible. */
.app-dialog .searchable-select-menu { position: static; width: 100%; min-width: 0; max-width: 100%; margin-top: 5px; box-shadow: 0 3px 10px rgba(0,0,0,.08); }
.app-dialog .searchable-select-options { max-height: min(200px, 32dvh); overscroll-behavior: contain; }
.app-dialog .searchable-select-wrapper { width: 100%; }
#user-status-dialog .dialog-body { min-height: 0; }

.user-activity-panel { margin-top: 12px; }
.activity-filter-toolbar { padding: 10px 12px; gap: 8px; flex-wrap: wrap; }
.activity-filter-toolbar .search-field { flex: 1; min-width: 180px; }
.activity-filter-toolbar > .searchable-select-wrapper { width: 210px; }
.activity-table { min-width: 940px; }
.admin-user-table .row-actions { flex-wrap: wrap; }
@media (max-width: 760px) {
  .activity-filter-toolbar { padding: 8px 0; }
  .activity-filter-toolbar .search-field { flex-basis: 100%; }
  .activity-filter-toolbar > .searchable-select-wrapper { flex: 1; min-width: 150px; }
}

#change-password-dialog #change-password-user { display: block; margin-top: 3px; color: var(--stone-600); font-size: 11px; font-weight: 400; letter-spacing: 0; }

/* Neutral charcoal dark mode; teal branding is reserved for light mode. */
[data-theme="dark"] .button-primary { color: #111b21; background: #c3cdd3; border-color: #c3cdd3; }
[data-theme="dark"] .button-primary:hover { color: #111b21; background: #d9e1e6; border-color: #d9e1e6; }
[data-theme="dark"] .button-danger { color: #fff; background: #a43a47; border-color: #a43a47; }
[data-theme="dark"] .button-danger:hover { background: #b54553; }
[data-theme="dark"] .status-badge.status-unlinked { color: var(--stone-600); background: #2a3942; border-color: var(--stone-200); }
[data-theme="dark"] .data-table tbody tr:hover, [data-theme="dark"] .data-table tbody tr:has(input[type="checkbox"]:checked) { color: var(--stone-800); background: var(--row-hover); }
[data-theme="dark"] .searchable-select-option:hover, [data-theme="dark"] .searchable-select-option.is-highlighted { background: #2a3942; color: #e9edef; }
[data-theme="dark"] .searchable-select-option.is-selected { background: #3b4d58; color: #f5f7f8; }
[data-theme="dark"] .nav-link:hover, [data-theme="dark"] .nav-link.is-active, [data-theme="dark"] .sidebar-logout:hover, [data-theme="dark"] .sidebar-collapse:hover { background: #2a3942; color: #f5f7f8; }
[data-theme="dark"] .sidebar, [data-theme="dark"] .brand, [data-theme="dark"] .sidebar-foot { border-color: #34434c; }
[data-theme="dark"] .nav-link em { background: #34434c; color: #bdc8cf; }
[data-theme="dark"] .nav-link.is-active::before, [data-theme="dark"] .brand-meter i { background: #c3cdd3; }
[data-theme="dark"] .status-dot.is-connected { background: #c3cdd3; box-shadow: none; }
[data-theme="dark"] .more-menu button.danger-item:hover { background: var(--red-50); color: var(--red-600); }
[data-theme="dark"] ::selection { background: #435560; color: #f5f7f8; }
.auth-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.auth-header .auth-mark { margin: 0; }
.auth-theme-toggle { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 6px; min-height: 34px; padding: 0 10px; color: var(--stone-600); background: var(--surface); border: var(--border); border-radius: 6px; font-size: 11px; font-weight: 500; }
.auth-theme-toggle:hover { background: var(--stone-50); color: var(--stone-900); border-color: var(--stone-300); }
.auth-theme-toggle svg { width: 15px; height: 15px; }
.available-credits-cell { font-variant-numeric: tabular-nums; font-weight: 600; }
@media (max-width: 400px) { .auth-page { padding: 18px; } .auth-header .auth-mark { font-size: 13px; gap: 7px; } .auth-theme-toggle { padding: 0 8px; } }

.attachment-list { display: grid; gap: 8px; }
.attachment-item { display: flex; align-items: center; gap: 10px; padding: 10px; border: var(--border); border-radius: var(--radius); color: var(--stone-800); text-decoration: none; }
.attachment-item:hover { background: var(--row-hover); }
.attachment-item > svg { width: 18px; flex-shrink: 0; }
.attachment-item > svg:last-child { margin-left: auto; }
.attachment-item span { display: grid; gap: 3px; min-width: 0; overflow-wrap: anywhere; }
.attachment-item strong { font-size: 12px; font-weight: 500; }
.attachment-item small { color: var(--stone-500); font-size: 11px; }
