:root {
  color-scheme: light dark;
  --ink: #172033;
  --muted: #667085;
  --line: #e4e7ec;
  --surface: #fff;
  --surface-subtle: #fbfcfe;
  --background: #f5f7fb;
  --accent: #2457c5;
  --accent-fill: #2457c5;
  --accent-fill-hover: #19449f;
  --accent-subtle: #eef4ff;
  --link: #475467;
  --label: #344054;
  --control-border: #d0d5dd;
  --notice-background: #eff8ff;
  --notice-ink: #175cd3;
  --success-background: #ecfdf3;
  --positive: #137547;
  --error-background: #fef3f2;
  --error-border: #fecdca;
  --error: #b42318;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #f5f5f7;
    --muted: #b0b0b5;
    --line: #3a3a3c;
    --surface: #2c2c2e;
    --surface-subtle: #242426;
    --background: #1c1c1e;
    --accent: #409cff;
    --accent-fill: #0a84ff;
    --accent-fill-hover: #0077ed;
    --accent-subtle: #203650;
    --link: #d1d1d6;
    --label: #e5e5ea;
    --control-border: #545458;
    --table-track: #242426;
    --notice-background: #20334a;
    --notice-ink: #a9d0ff;
    --success-background: #20382c;
    --positive: #8ee0aa;
    --error-background: #402727;
    --error-border: #754141;
    --error: #ff453a;
  }
}
* { box-sizing: border-box; }
.js .auto-submit-button { display: none; }
.ajax-fragment { display: contents; }
body.is-navigating { cursor: progress; }
body.is-navigating:not(.is-partial-navigation) main.container { opacity: .6; transition: opacity .2s ease; }
body.is-navigating::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  z-index: 30;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  animation: navigation-progress 1s linear infinite;
}
@keyframes navigation-progress {
  from { transform: translateX(-100%); }
  to { transform: translateX(100%); }
}
@media (prefers-reduced-motion: reduce) {
  body.is-navigating::before { animation: none; }
}
body.is-navigating:not(.is-partial-navigation) main.container[aria-busy="true"] { pointer-events: none; }
button.is-busy { gap: 8px; cursor: progress; }
.button-spinner {
  width: 14px;
  height: 14px;
  flex: none;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  opacity: .85;
  animation: button-spin .7s linear infinite;
}
@keyframes button-spin {
  to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
  .button-spinner { animation: none; }
}
body {
  margin: 0;
  color: var(--ink);
  background: var(--background);
  font: 14px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; }
.app-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar {
  min-height: 64px;
  padding: 0 max(22px, calc((100vw - 1120px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.brand { display: flex; align-items: center; gap: 9px; color: var(--ink); text-decoration: none; font-size: 16px; font-weight: 650; letter-spacing: -.015em; }
.brand-icon { width: 24px; height: 24px; object-fit: contain; }
.module-nav, .section-nav, .tool-tabs { display: flex; align-items: center; gap: 8px; }
.module-nav a, .module-link, .section-nav a, .tool-tabs a, .nav-button { color: var(--link); text-decoration: none; font: inherit; transition: color .15s ease, background-color .15s ease; }
.module-nav a:hover, .section-nav a:hover, .tool-tabs a:hover, .nav-button:hover { color: var(--accent); }
.module-nav form { margin: 0 0 0 10px; }
.module-link { display: grid; padding: 7px 10px; border-radius: 8px; font-size: 13px; font-weight: 550; }
.module-link small { color: var(--muted); font-size: 10px; font-weight: 500; }
.module-link.active { color: #fff; background: var(--accent-fill); }
.module-nav a.module-link.active:hover { color: #fff; }
.module-link.active small { color: rgb(255 255 255 / 82%); }
.module-link.unavailable { color: #98a2b3; cursor: default; }
.section-nav { min-height: 46px; padding: 0 max(22px, calc((100vw - 1120px) / 2)); border-top: 1px solid var(--line); }
.section-nav a, .tool-tabs a { padding: 9px 13px; border-radius: 8px; font-size: 13px; font-weight: 550; }
.section-nav a.active, .tool-tabs a.active { color: var(--accent); background: var(--accent-subtle); }
.tool-tabs { width: fit-content; padding: 4px; margin: -8px 0 20px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); }
.dashboard-tabs { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 20px; }
.dashboard-tabs a { display: inline-flex; align-items: center; min-height: 42px; padding: 9px 16px; border: 1px solid var(--line); border-radius: 9px; color: var(--link); background: var(--surface); text-decoration: none; font-size: 14px; font-weight: 550; transition: color .15s ease, background-color .15s ease, border-color .15s ease; }
.dashboard-tabs a:hover { color: var(--accent); border-color: var(--accent); }
.dashboard-tabs a.active { color: #fff; border-color: var(--accent-fill); background: var(--accent-fill); }
.dashboard-tabs a.active:hover { color: #fff; background: var(--accent-fill-hover); }
.dashboard-tabs a:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.nav-button { border: 0; background: none; cursor: pointer; padding: 8px 0; }
.container { width: min(1120px, calc(100% - 36px)); margin: 36px auto 70px; min-height: 72vh; }
.page-heading { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 24px; }
.heading-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.quick-entry-actions { display: flex; gap: 9px; }
.reset-filter-button svg { display: none; }
.dashboard-controls { display: flex; align-items: center; margin: -4px 0 14px; }
.currency-form { display: inline-flex; align-items: center; gap: 12px; padding: 7px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.currency-form label, .currency-label { color: var(--ink); font-weight: 550; font-size: 13.5px; margin: 0; }
.currency-form select { min-width: 100px; }
.currency-toggle { display: inline-flex; align-items: center; gap: 2px; padding: 2px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-subtle); outline: none; }
.currency-toggle-btn { display: inline-flex; align-items: center; justify-content: center; min-width: 42px; padding: 5px 10px; border-radius: 6px; font-size: 13px; font-weight: 600; text-decoration: none; color: var(--link); transition: color .15s ease, background-color .15s ease; user-select: none; -webkit-tap-highlight-color: transparent; }
.currency-toggle-btn:hover { color: var(--accent); }
.currency-toggle-btn.active { color: #fff; background: var(--accent-fill); }
.currency-toggle-btn.active:hover { color: #fff; background: var(--accent-fill-hover); }
.currency-toggle-btn:focus,
.currency-toggle-btn:focus-visible { outline: none; box-shadow: none; }
.currency-divider { color: var(--line); font-size: 13px; font-weight: 400; user-select: none; }
.personal-filters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto auto; align-items: end; gap: 12px; }
.finance-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 18px 0; }
.finance-metrics .metric span { color: var(--muted); font-size: 13px; }
.investment-return { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.movement-editor { scroll-margin-top: 20px; }
.movement-editor-context { margin: 0 0 18px; padding: 11px 13px; border-radius: 9px; background: var(--surface-subtle); color: var(--muted); }
.movement-editor-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.movement-delete { margin-top: 20px; padding-top: 15px; border-top: 1px solid var(--line); }
.movement-delete > summary { color: var(--error); font-weight: 550; cursor: pointer; }
.movement-delete .delete-form { border-top: 0; margin-top: 8px; padding-top: 8px; }
.pagination-controls { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; margin-top: 16px; }
.pagination-controls > :first-child { justify-self: start; }
.pagination-controls > :last-child { justify-self: end; }
.pagination-controls [aria-disabled="true"] { cursor: not-allowed; opacity: .55; }
.pagination-status { color: var(--muted); font-size: 13px; text-align: center; font-variant-numeric: tabular-nums; }
.pagination-controls :focus,
.pagination-controls :focus-visible,
.pagination-status:focus,
.pagination-status:focus-visible,
.pagination-status[tabindex="-1"]:focus,
#personal-movements-fragment:focus {
  outline: none;
  box-shadow: none;
}
.positive { color: var(--positive); }
.negative { color: var(--error); }
.return-indicator { display: inline-flex; align-items: center; gap: 4px; width: fit-content; padding: 3px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 1.4; font-variant-numeric: tabular-nums; }
.return-indicator.positive { background: var(--success-background); }
.return-indicator.negative { background: var(--error-background); }
.return-indicator.neutral { color: var(--muted); background: var(--surface-subtle); }
.checkbox-label { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: 9px; font-weight: 500; }
.delete-form, .restore-form { display: grid; gap: 14px; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
h1 { margin: 2px 0 4px; font-size: clamp(26px, 3.8vw, 32px); font-weight: 650; line-height: 1.2; letter-spacing: -.035em; }
main.container h1[tabindex="-1"]:focus { outline: none; }
h2 { margin: 0 0 8px; font-size: 19px; font-weight: 600; letter-spacing: -.025em; }
p { margin: 8px 0; }
.eyebrow { margin: 0; color: var(--accent); font-size: 12px; font-weight: 650; letter-spacing: .075em; text-transform: uppercase; }
.muted, .hint { color: var(--muted); }
.hint { font-size: 13px; }
.panel, .login-card, .empty-state, .metric {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 2px 8px rgb(16 24 40 / 3%);
}
.panel { padding: 22px; margin: 18px 0; }
.panel.narrow { max-width: 760px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 16px; }
.inline-form { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 13px; }
.inline-form label { white-space: nowrap; }
.inline-form input, .inline-form select { width: auto; min-width: 130px; }
.portfolio-caption { margin: -5px 0 18px; color: var(--muted); font-size: 13px; }
.portfolio-caption strong { color: var(--ink); }
.quote-edit-row { display: grid; grid-template-columns: minmax(100px, .7fr) minmax(180px, 1fr) minmax(180px, 1fr) auto; align-items: end; gap: 12px; padding: 14px 0; border-top: 1px solid var(--line); }
.quote-edit-row > strong { padding: 10px 0; }
.panel-disclosure, .performance-disclosure { display: block; }
.panel-disclosure > summary, .performance-disclosure > summary { display: grid; gap: 3px; cursor: pointer; list-style: none; }
.panel-disclosure > summary::-webkit-details-marker, .performance-disclosure > summary::-webkit-details-marker { display: none; }
.panel-disclosure > summary strong, .performance-disclosure > summary strong { font-size: 16px; }
.panel-disclosure > summary span, .performance-disclosure > summary span { color: var(--muted); font-size: 13px; }
.panel-disclosure[open] > summary, .performance-disclosure[open] > summary { margin-bottom: 18px; }
.panel-disclosure > summary::after { content: "Mostrar opciones"; color: var(--accent); font-size: 12px; font-weight: 650; }
.panel-disclosure[open] > summary::after { content: "Ocultar opciones"; }
.cash-investment-list { display: grid; gap: 12px; }
.cash-investment-card { padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-subtle); }
.cash-investment-heading { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.cash-investment-heading span, .cash-investment-metrics span { color: var(--muted); font-size: 13px; }
.cash-investment-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.cash-investment-metrics > div { display: grid; gap: 3px; }
.cash-investment-metrics strong { font-size: 18px; }
.dap-estimated-return { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.annual-total td { border-top: 2px solid var(--line); }
.refresh-form, .year-end-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin: 14px 0; }
.tax-source { padding: 12px 0; border-top: 1px solid var(--line); }
.tax-source summary { cursor: pointer; font-weight: 650; }
.tax-source .table-wrap { margin-top: 12px; }
.category-summary > summary { cursor: pointer; list-style: none; }
.category-summary > summary::-webkit-details-marker { display: none; }
.category-summary > summary::before { content: "⌄"; display: inline-block; width: 22px; color: var(--muted); }
.category-summary:not([open]) > summary::before { content: "›"; }
.category-summary-tabs { display: flex; gap: 14px; margin: 16px 0 12px; border-bottom: 1px solid var(--line); }
.category-summary-tabs a { padding: 8px 2px; color: var(--link); text-decoration: none; font-size: 13px; }
.category-summary-tabs a[aria-current="page"] { color: var(--accent); border-bottom: 2px solid var(--accent); }
.category-summary-scroll { max-height: 390px; overflow: auto; overscroll-behavior: contain; border: 1px solid var(--line); border-radius: 9px; }
.category-summary-table { width: max-content; min-width: 100%; }
.category-summary-table th, .category-summary-table td { min-width: 82px; padding: 9px 10px; }
.category-summary-table thead th { position: sticky; top: 0; z-index: 2; background: var(--surface-subtle); }
.category-summary-table tbody th, .category-summary-table tfoot th { position: sticky; left: 0; z-index: 1; background: var(--surface); color: var(--muted); font-weight: 500; }
.category-summary-table thead th:first-child { left: 0; z-index: 3; }
.category-summary-table tfoot th, .category-summary-table tfoot td { position: sticky; bottom: 0; background: var(--surface-subtle); font-weight: 650; }
.category-summary-table tfoot th { left: 0; z-index: 2; }
.allocation { margin: 20px 0; }
.allocation .section-heading { margin-bottom: 10px; }
.allocation .section-heading h3 { margin: 0; }
.allocation-bar { overflow: hidden; height: 12px; border-radius: 999px; background: var(--line); }
.allocation-bar svg { display: block; width: 100%; height: 100%; }
.allocation-segment, .legend-dot { background: var(--accent); }
.segment-1 { background: #12a594; }
.segment-2 { background: #f79009; }
.segment-3 { background: #7a5af8; }
.segment-4 { background: #ee46bc; }
.segment-5 { background: #06aed4; }
.segment-6 { background: #f04438; }
.segment-7 { background: #6172f3; }
.allocation-bar .segment-0 { fill: var(--accent); }
.allocation-bar .segment-1 { fill: #12a594; }
.allocation-bar .segment-2 { fill: #f79009; }
.allocation-bar .segment-3 { fill: #7a5af8; }
.allocation-bar .segment-4 { fill: #ee46bc; }
.allocation-bar .segment-5 { fill: #06aed4; }
.allocation-bar .segment-6 { fill: #f04438; }
.allocation-bar .segment-7 { fill: #6172f3; }
.allocation-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 12px; color: var(--muted); font-size: 13px; }
.allocation-legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend-dot { width: 9px; height: 9px; border-radius: 50%; }
.chart-wrap { height: 160px; margin: 10px 0 20px; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-subtle); }
.chart-wrap svg { width: 100%; height: 100%; overflow: visible; }
.performance-chart { height: 320px; }
.performance-gridline { stroke: var(--line); stroke-width: .6; }
.performance-axis-label { fill: var(--muted); font-size: 10px; }
.performance-axis-title { fill: var(--label); font-size: 11px; }
.performance-point { fill: var(--accent); }
.chart-line { fill: none; stroke: var(--accent); stroke-width: 2.5; vector-effect: non-scaling-stroke; stroke-linecap: round; stroke-linejoin: round; }
.chart-zero { stroke: #98a2b3; stroke-width: 1; stroke-dasharray: 4 4; vector-effect: non-scaling-stroke; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: end; gap: 12px; }
.form-grid, .stack { min-width: 0; }
.form-grid > *, .stack > * { min-width: 0; }
.full-width { grid-column: 1 / -1; }
.small-button { padding: 6px 9px; font-size: 12px; }
.annual-table tbody tr:last-child { font-weight: 650; }
h3 { margin: 22px 0 9px; font-size: 16px; font-weight: 600; letter-spacing: -.01em; }
.metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 20px 0; }
.overview-metrics { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.metric { padding: 18px 20px; display: grid; gap: 5px; align-content: start; }
.metric span { color: var(--muted); font-size: 13px; }
.metric strong { font-size: 24px; font-weight: 500; letter-spacing: -.025em; font-variant-numeric: tabular-nums; }
.metric .metric-detail { color: var(--muted); font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.button, button {
  display: inline-flex; align-items: center; justify-content: center;
  height: 42px; min-height: 42px; box-sizing: border-box; border-radius: 9px; padding: 8px 15px; border: 1px solid transparent;
  font: inherit; font-weight: 550; line-height: 1.4; text-decoration: none; cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.small-button { height: auto; min-height: 0; padding: 6px 9px; }
.nav-button { height: auto; min-height: 0; }
.primary { color: #fff; background: var(--accent-fill); }
.primary:hover { background: var(--accent-fill-hover); }
.primary:disabled {
  color: var(--muted);
  border-color: var(--line);
  background: var(--surface-subtle);
  cursor: not-allowed;
}
.primary:disabled:hover { background: var(--surface-subtle); }
.secondary { color: var(--label); background: var(--surface); border-color: var(--line); }
.danger { color: var(--error); border-color: var(--error-border); }
.stack { display: grid; gap: 17px; }
label { display: grid; gap: 7px; color: var(--label); font-weight: 500; }
input, select {
  display: block; width: 100%; min-width: 0; max-width: 100%; height: 42px; min-height: 42px; box-sizing: border-box; padding: 9px 11px; border: 1px solid var(--control-border);
  border-radius: 8px; background: var(--surface); color: var(--ink); font: inherit;
}
select {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath d='m4 6 4 4 4-4' fill='none' stroke='%23667085' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.8'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
}
input[type="date"], input[type="datetime-local"] {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  height: 42px;
  min-height: 42px;
  box-sizing: border-box;
  padding: 9px 11px;
  line-height: 1.4;
  text-align: left;
  inline-size: 100%;
  min-inline-size: 0;
  max-inline-size: 100%;
}
input[type="date"]::-webkit-date-and-time-value,
input[type="datetime-local"]::-webkit-date-and-time-value {
  min-height: 0;
  line-height: 1.4;
  text-align: left;
}
textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--control-border);
  border-radius: 8px; background: var(--surface); color: var(--ink); font: inherit;
}
input[type="checkbox"] { width: auto; height: auto; min-height: 0; }
input[type="file"] { height: auto; min-height: 42px; padding: 7px; }
input:focus, select:focus, textarea:focus { outline: 3px solid rgb(36 87 197 / 15%); border-color: var(--accent); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.duplicate-choice {
  display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start;
  gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); font-weight: 500;
}
.table-wrap { width: 100%; min-width: 0; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
.table-wrap > table { width: max-content; min-width: 100%; }
.history-scroll { max-height: 460px; overflow: auto; overscroll-behavior: contain; border: 1px solid var(--line); border-radius: 10px; }
.history-scroll table { min-width: 100%; }
.history-scroll th { position: sticky; top: 0; z-index: 1; background: var(--surface); }
.manual-quote-table { min-width: 620px; }
.manual-quote-table td { vertical-align: middle; }
.manual-quote-table input { min-width: 130px; text-align: right; }
.manual-quote-form .form-grid { align-items: end; }
table { width: 100%; border-collapse: collapse; white-space: nowrap; }
th, td { padding: 12px 10px; text-align: left; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-size: 12px; font-weight: 550; }
td { font-size: 14px; font-weight: 400; }
tr:last-child td { border-bottom: 0; }
.numeric { text-align: right; font-variant-numeric: tabular-nums; }
.empty-state { padding: 48px 24px; text-align: center; }
.empty-state p { max-width: 580px; margin: 8px auto 18px; color: var(--muted); }
.dataset-list { display: grid; gap: 10px; max-width: 640px; margin: 20px auto 0; text-align: left; }
.dataset-list form { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; }
.empty-icon { margin: 0 auto 12px; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; background: var(--accent-subtle); color: var(--accent); font-size: 25px; }
.notice { padding: 12px 14px; border-radius: 9px; background: var(--notice-background); color: var(--notice-ink); font-size: 13px; }
.messages { display: grid; gap: 9px; margin-bottom: 18px; }
.message { padding: 12px 14px; border-radius: 9px; background: var(--success-background); color: var(--positive); }
.message.error { background: var(--error-background); color: var(--error); }
.portfolio-partial ul { margin: 8px 0 0; padding-left: 20px; }
.compact-liquidation-form { grid-template-columns: minmax(0, 1fr); gap: 8px; margin-top: 10px; }
.rate-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.rate-grid label { font-size: 13px; }
.login-card { max-width: 420px; margin: 8vh auto; padding: 28px; }
.login-card h1 { margin-bottom: 4px; font-size: 28px; }
.login-card .hint { margin-top: 20px; }
footer { padding: 18px; border-top: 1px solid var(--line); text-align: center; color: var(--muted); font-size: 12px; }
@media (max-width: 680px) {
  .topbar { padding: 12px 18px; align-items: flex-start; flex-direction: column; }
  .module-nav {
    width: 100%; gap: 6px; flex-wrap: nowrap; overflow-x: auto;
    padding: 2px 0 5px; scrollbar-width: none; -webkit-overflow-scrolling: touch;
  }
  .module-nav::-webkit-scrollbar { display: none; }
  .module-nav .module-link { flex: 0 0 auto; white-space: nowrap; }
  .module-nav form.logout-form { flex: 0 0 auto; margin: 0 0 0 auto; }
  .nav-button {
    padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px;
    background: var(--surface-subtle); color: var(--muted); font-size: 12px;
    white-space: nowrap;
  }
  .nav-button:hover { color: var(--ink); background: var(--surface); }
  .section-nav { min-height: 0; padding: 8px 12px; gap: 2px; overflow-x: auto; }
  .section-nav a { flex: 0 0 auto; padding: 8px 10px; white-space: nowrap; }
  .tool-tabs { width: 100%; overflow-x: auto; }
  .tool-tabs a { flex: 0 0 auto; white-space: nowrap; }
  .pagination-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pagination-controls > :first-child { grid-column: 1; grid-row: 2; justify-self: stretch; }
  .pagination-controls > :last-child { grid-column: 2; grid-row: 2; justify-self: stretch; }
  .pagination-controls .button { justify-content: center; }
  .pagination-status { grid-column: 1 / -1; grid-row: 1; }
  .dashboard-tabs { gap: 8px; }
  .dashboard-tabs a { flex: 1 1 auto; justify-content: center; padding-inline: 12px; }
  .brand { font-size: 15px; }
  .container { width: calc(100% - 24px); margin-top: 24px; }
  .page-heading, .section-heading { align-items: flex-start; flex-direction: column; }
  .heading-actions { width: 100%; }
  .quick-entry-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; width: 100%; }
  .quick-entry-actions .button { width: 100%; }
  .reset-filter-button { justify-content: center; gap: 0; min-width: 44px; min-height: 44px; padding: 9px; }
  .personal-filters > .reset-filter-button {
    align-self: end;
    height: 42px;
    min-height: 42px;
    padding: 0;
  }
  .reset-filter-button svg { display: block; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
  .reset-filter-button span { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
  .refresh-form { width: 100%; }
  .refresh-quotes-button { width: 100%; }
  .dashboard-controls, .currency-form { width: 100%; }
  .currency-form { justify-content: space-between; }
  .currency-form select { min-width: 100px; }
  .inline-form { align-items: stretch; flex-wrap: wrap; }
  .inline-form input, .inline-form select { width: 100%; min-width: 0; }
  .year-filter { display: grid; grid-template-columns: minmax(0, 1fr); align-items: stretch; width: 100%; }
  .year-filter select { width: 100%; min-width: 0; }
  .form-grid > label, .stack > label { width: 100%; max-width: 100%; grid-template-columns: minmax(0, 1fr); }
  .metrics, .overview-metrics { grid-template-columns: 1fr; gap: 9px; }
  .finance-metrics { grid-template-columns: 1fr; gap: 9px; }
  .personal-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; }
  .personal-filters > .button, .personal-filters > button { width: 100%; min-width: 0; }
  .export-year-button { width: 100%; }
  .metric { padding: 13px 16px; }
  .metric strong { font-size: 22px; }
  .quote-edit-row { grid-template-columns: 1fr; align-items: stretch; }
  .quote-edit-row > strong { padding: 0; }
  .panel-disclosure > .section-heading { align-items: stretch; }
  .cash-investment-metrics { grid-template-columns: 1fr; }
  .cash-investment-heading { flex-direction: column; gap: 2px; }
  .panel { padding: 17px; }
  .rate-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .full-width { grid-column: auto; }
}
