/* Phone banking: native viewport anchoring, richer activity and valuation. */
html, body.coutts-prototype-page { height: 100%; overscroll-behavior: none; }
#coutts-prototype.prototype-shell { position: fixed; inset: 0; width: auto; height: auto; min-height: 0; margin: 0; }
.banking-app { min-height: 0; }
.merchant-icon { width: 42px; height: 42px; flex: 0 0 42px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; background: #f4f2ed; border: 1px solid #ffffff16; overflow: hidden; color: #384640; font: 600 12px/1 Arial,sans-serif; }
.merchant-icon img { width: 100%; height: 100%; object-fit: contain; padding: 7px; }
.merchant-icon.is-fallback { background: #273431; color: #d9d9c6; }
.transaction-row { min-height: 80px; gap: 13px; }
.transaction-title { font-size: 14px; font-weight: 500; }
.transaction-meta { font-size: 11px; }
.transaction-amount { font-size: 14px; }
.banking-tabs { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); border-top: 1px solid var(--hairline); margin-top: 20px; padding-top: 16px; gap: 6px; }
.banking-tabs button { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 9px; min-height: 72px; border: 1px solid transparent; border-radius: 6px; background: #d1c29408; color: #e1dac7; font-size: 12px; cursor: pointer; }
.banking-tabs button:hover { border-color: #bdab7744; background: #d1c29412; }
.banking-tabs .app-icon { width: 20px; height: 20px; color: #c7b386; }
.spending-preview { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--hairline); }
.spending-preview .section-heading { margin-bottom: 12px; }
.spending-preview h3 { margin: 0; font-size: 14px; font-weight: 500; }
.spending-preview p { color: var(--stone); font-size: 11px; line-height: 1.6; }
.spending-preview-values { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.spending-preview-values small { display: block; color: var(--stone); font-size: 11px; margin-bottom: 5px; }
.spending-preview-values strong { font-size: 23px; font-weight: 450; }
.activity-filters { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.activity-filters label, .spending-month-control { display: flex; flex-direction: column; gap: 7px; color: #afb7ad; font-size: 11px; }
.activity-filters input, .activity-filters select, .spending-month-control select { min-width: 0; width: 100%; min-height: 46px; padding: 10px; border: 1px solid #a6b29435; border-radius: 5px; background: #0d1516; color: #ece9df; font-size: 14px; color-scheme: dark; }
.activity-filters input[type='date'] { min-width: 0; max-width: 100%; }
.activity-filters input:focus-visible, .activity-filters select:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.transaction-date-group { margin: 0 0 20px; }
.transaction-date-group h3 { font-size: 11px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; padding: 14px 0 10px; margin: 0; color: #a9b3a5; border-bottom: 1px solid var(--hairline); }
.transaction-date-group .transaction-row { background: transparent; }
.activity-toolbar { align-items: center; }
.activity-toolbar .text-button { min-height: 44px; white-space: nowrap; }
.activity-results { padding: 0; }
.activity-summary { font-size: 12px; color: #a8b3a6; }
.spending-overview { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.spending-overview .metric-tile { padding: 17px; border-radius: 6px; }
.spending-overview .metric-tile strong { font-size: 26px; }
.spending-breakdowns { display: grid; gap: 24px; }
.spending-breakdowns h3, .spending-heading { font: 23px Georgia,serif; margin: 0 0 16px; }
.spending-category-row, .spending-merchant-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 6px 16px; padding: 14px 0; border-bottom: 1px solid var(--hairline); font-size: 13px; }
.spending-category-row small, .spending-merchant-row small { color: var(--stone); font-size: 10px; }
.spending-category-row strong, .spending-merchant-row strong { font-size: 14px; font-weight: 500; }
.spending-bar { grid-column: 1/-1; height: 4px; background: #d8dfcf12; overflow: hidden; border-radius: 2px; margin-top: 5px; }
.spending-bar > span { height: 100%; display: block; background: #bdab77; }
.monthly-bars { display: flex; gap: 12px; align-items: stretch; min-height: 160px; margin: 20px 0; padding-top: 25px; }
.monthly-bars > * { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; font-size: 10px; color: var(--stone); gap: 10px; }
.monthly-bar-track { height: 115px; width: 100%; display: flex; align-items: flex-end; justify-content: center; }
.monthly-bar-fill { width: min(36px,100%); background: #b39d69; border-radius: 3px 3px 0 0; min-height: 2px; }
.monthly-bars strong { font-size: 10px; color: #d6dacc; font-weight: 500; white-space: nowrap; }
@media (max-width: 759px) {
  :root { --nav-height: 64px; }
  .banking-app { display: grid; grid-template-columns: minmax(0,1fr); grid-template-rows: minmax(0,1fr); height: 100%; min-height: 0; }
  .app-content { grid-column: 1; grid-row: 1; min-width: 0; min-height: 0; padding-bottom: calc(var(--app-navigation-height,calc(70px + env(safe-area-inset-bottom,0px))) + 22px); scroll-padding-bottom: calc(var(--app-navigation-height,calc(70px + env(safe-area-inset-bottom,0px))) + 22px); scrollbar-width: none; }
  .app-content::-webkit-scrollbar { display: none; }
  #coutts-prototype .app-navigation { position: fixed; inset: auto 0 0; width: auto; min-height: calc(64px + env(safe-area-inset-bottom,0px)); padding: 5px max(8px,env(safe-area-inset-right,0px)) max(6px,env(safe-area-inset-bottom,0px)) max(8px,env(safe-area-inset-left,0px)); margin: 0; border-radius: 0; background: #0b1314; box-shadow: 0 -1px 0 #fff1; border-top: 0; }
  .app-navigation button { min-height: 53px; border-radius: 0; gap: 6px; font-size: 10px; padding: 5px 0; }
  .app-navigation button.is-active::after { bottom: 1px; }
  .home-main { display: flex; }
  .home-main > .account-panel { order: 0; }
  .home-main > .recent-panel { order: 1; }
  .home-main > .relationship-panel { order: 2; }
  .screen-shell { padding-top: max(20px,env(safe-area-inset-top,0px)); gap: 20px; }
  .screen-header { padding-bottom: 18px; }
  .screen-header h1 { font-size: 30px; }
  .account-panel .balance-value { font-size: clamp(35px,9vw,46px); }
  .account-panel .quick-actions { margin-top: 18px; }
  .account-panel .quick-action { min-height: 61px; }
  .account-panel .quick-action > span:last-child { font-size: 10px; }
  .account-panel-header { margin-bottom: 20px; gap: 16px; }
  .banking-tabs button { min-height: 68px; font-size: 11px; }
  .transaction-row { min-height: 79px; padding: 13px 0; gap: 11px; }
  .transaction-title { font-size: 13px; }
  .transaction-amount { font-size: 13px; }
  .merchant-icon { width: 38px; height: 38px; flex-basis: 38px; border-radius: 10px; }
  .merchant-icon img { padding: 6px; }
  .app-sheet { bottom: 0; width: 100%; max-height: calc(var(--app-viewport-height,100dvh) - max(12px,env(safe-area-inset-top,0px))); }
  .sheet-panel { max-height: calc(var(--app-viewport-height,100dvh) - max(12px,env(safe-area-inset-top,0px))); padding-inline: 20px; padding-bottom: max(14px,env(safe-area-inset-bottom,0px)); }
  .sheet-body { padding-top: 18px; }
  .spending-overview .metric-tile { padding: 13px; }
  .spending-overview .metric-tile strong { font-size: 23px; }
  .toast-region { bottom: calc(78px + env(safe-area-inset-bottom,0px)); }
  html[data-app-keyboard='open'] #coutts-prototype .app-navigation { visibility: hidden; pointer-events: none; }
}
/* Keep an editing sheet above the keyboard without shrinking the whole app.
   The home-indicator inset does not belong above an on-screen keyboard. */
html[data-app-keyboard='open'] .app-sheet { inset: auto 0 var(--app-keyboard-inset,0px); margin: 0 auto; max-height: calc(var(--app-viewport-height,100dvh) - 12px); }
html[data-app-keyboard='open'] .sheet-panel { max-height: calc(var(--app-viewport-height,100dvh) - 12px); padding-bottom: 14px; }
@media (max-width: 374px) {
  .screen-header h1 { font-size: 27px; }
  .merchant-icon { width: 32px; height: 32px; flex-basis: 32px; }
  .transaction-row { gap: 9px; }
  .transaction-title, .transaction-amount { font-size: 12px; }
  .transaction-meta { font-size: 10px; }
  .sheet-panel { padding-inline: 16px; }
  .activity-filters { gap: 10px; }
  .activity-filters input, .activity-filters select { font-size: 12px; padding-inline: 7px; }
}
/* Financial chart: readable axes, understated line and precise inspection. */
.valuation-chart { position: relative; min-width: 0; margin-top: 20px; }
.valuation-readout { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 14px; padding-bottom: 12px; }
.valuation-readout > div { display: grid; gap: 5px; }
.valuation-selected-value { color: #e6e6d8; font-size: 20px; font-weight: 450; letter-spacing: -.025em; }
.valuation-selected-date { color: #a7b2a5; font-size: 11px; }
.valuation-status { color: #a7b2a5; font-size: 10px; }
.valuation-plot { display: block; width: 100%; height: 248px; overflow: visible; touch-action: pan-y; }
.valuation-grid { stroke: #dbe0d31a; stroke-width: 1; vector-effect: non-scaling-stroke; }
.valuation-baseline { stroke: #a7b0a33a; stroke-width: 1; stroke-dasharray: 3 4; vector-effect: non-scaling-stroke; }
.valuation-line { fill: none; stroke: #c3ae7d; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.valuation-y-label, .valuation-x-label { font: 10px Arial,sans-serif; fill: #a2aea0; }
.valuation-cursor-line { stroke: #a3b1a2aa; stroke-width: 1; stroke-dasharray: 2 3; vector-effect: non-scaling-stroke; }
.valuation-cursor-dot { fill: #14201e; stroke: #dbc18c; stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.valuation-scrubber { margin-top: 8px; }
.valuation-scrubber input[type='range'] { display: block; width: 100%; margin: 0; min-height: 44px; accent-color: #baa573; cursor: ew-resize; }
.valuation-scrub-hint { display: block; color: #8e9d8e; font-size: 10px; line-height: 1.5; }
.valuation-note-row { display: flex; gap: 8px 18px; flex-wrap: wrap; justify-content: space-between; font-size: 10px; line-height: 1.6; color: #9dab9c; padding-top: 14px; margin-top: 12px; border-top: 1px solid var(--hairline); }
.valuation-disclosure { color: #93a18f; font-size: 10px; line-height: 1.6; }
.valuation-chart.is-compact { margin-top: 20px; }
.valuation-chart.is-compact .valuation-plot { height: 165px; }
.valuation-chart.is-compact .valuation-selected-value { font-size: 16px; }
.wealth-chart-panel .section-heading { flex-wrap: wrap; gap: 14px; }
.wealth-chart-panel .segmented-control { min-width: 216px; width: auto; max-width: none; }
.wealth-chart-panel .segment-button { min-height: 42px; padding-inline: 13px; }
@media (max-width: 759px) {
  .valuation-plot { height: 230px; }
  .valuation-chart.is-compact .valuation-plot { height: 165px; }
  .valuation-readout { padding-bottom: 10px; }
  .valuation-selected-value { font-size: 19px; }
  .wealth-chart-panel .segmented-control { width: 100%; }
  .valuation-note-row { display: block; }
  .valuation-note-row > * { display: block; margin-top: 6px; }
}
/* Transaction and spending controls share the same bank-account context. */
.spending-preview-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.spending-preview-heading .eyebrow { margin-bottom: 6px; }
.spending-preview-metrics, .spending-cashflow { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.spending-preview-metrics span, .spending-cashflow span { display: block; font-size: 11px; color: #abb6a7; margin-bottom: 6px; }
.spending-preview-metrics strong, .spending-cashflow strong { display: block; font-size: 23px; font-weight: 450; letter-spacing: -.025em; }
.spending-comparison { font-size: 11px; color: #acb5a7; line-height: 1.6; }
.spending-comparison[data-direction='down'] { color: #98bba8; }
.activity-workspace .banking-tabs, .spending-workspace .banking-tabs { margin: 0; padding: 0 0 14px; border-top: 0; border-bottom: 1px solid var(--hairline); }
.banking-tab.is-active { background: #bcaa731e; color: #e2c994; border-color: #bcaa7344; }
.activity-account-label { color: #a9b5a5; font-size: 11px; margin: 0; }
.activity-date-picker { border-bottom: 1px solid var(--hairline); padding-bottom: 12px; }
.activity-date-picker summary { display: flex; gap: 9px; align-items: center; min-height: 42px; font-size: 12px; color: #cebc91; cursor: pointer; list-style: none; }
.activity-date-picker summary::-webkit-details-marker { display: none; }
.activity-date-picker summary::after { content: '+'; margin-left: auto; font-size: 18px; }
.activity-date-picker[open] summary::after { content: '−'; }
.activity-date-picker .app-icon { width: 18px; height: 18px; }
.activity-date-picker .activity-filters { margin-top: 12px; }
.activity-filter-totals { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); padding: 14px 0; border-block: 1px solid var(--hairline); gap: 8px; }
.activity-filter-totals span, .activity-filter-totals small { display: block; color: var(--stone); font-size: 10px; }
.activity-filter-totals strong { display: block; margin-top: 5px; font-size: 17px; font-weight: 450; }
.transaction-date-label { margin: 0; padding: 12px 0; color: #a9b7a7; font-size: 11px; font-weight: 500; border-bottom: 1px solid var(--hairline); }
.spending-month-controls { display: grid; grid-template-columns: 46px minmax(0,1fr) 46px; gap: 12px; align-items: center; }
.spending-month-controls .field { margin: 0; }
.spending-month-controls select { width: 100%; min-height: 48px; padding: 12px; font-size: 15px; border: 1px solid var(--hairline-strong); background: #0d1516; color: var(--ivory); border-radius: 5px; }
.spending-month-controls .icon-button { width: 44px; height: 44px; }
.spending-month-controls .month-back .app-icon { transform: rotate(180deg); }
.spending-overview { display: block; border: 1px solid #c3ad7638; border-radius: 7px; background: #1a2722; padding: 23px; }
.spending-total { font-size: 43px; font-weight: 350; line-height: 1.2; letter-spacing: -.035em; margin: 15px 0 8px; }
.spending-cashflow { padding-top: 18px; margin-top: 18px; border-top: 1px solid var(--hairline); }
.spending-cashflow strong { font-size: 21px; }
.spending-trend .section-heading { margin-top: 10px; }
.spending-trend .section-heading .muted, .spending-breakdowns .section-heading .muted { font-size: 10px; }
.spending-trend h3, .spending-breakdowns h3 { font: 21px Georgia,serif; margin: 0; }
.monthly-bars { padding-top: 0; min-height: 170px; gap: 7px; }
.monthly-bar { appearance: none; border: 0; background: transparent; cursor: pointer; padding: 5px 0; border-radius: 3px; }
.monthly-bar:hover, .monthly-bar.is-active { background: #baa37010; }
.monthly-bar-track { height: 115px; width: 100%; padding-inline: 6px; }
.monthly-bar-track > span { display: block; width: 100%; min-height: 2px; background: #758375; border-radius: 3px 3px 0 0; }
.monthly-bar.is-active .monthly-bar-track > span { background: #c0ac78; }
.monthly-bar-amount { font-size: 10px; color: #bcc6b4; text-align: center; max-width: 100%; overflow-wrap: anywhere; }
.monthly-bar-label { font-size: 10px; }
.spending-category-row { display: flex; flex-direction: column; width: 100%; padding: 15px 0; background: transparent; color: var(--ivory); border: 0; border-bottom: 1px solid var(--hairline); text-align: left; cursor: pointer; gap: 9px; }
.spending-category-row:hover { background: #baa37008; }
.spending-category-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 13px; }
.spending-category-top strong { font-size: 13px; font-weight: 500; }
.spending-category-track { display: block; height: 4px; background: #d9e2ce0c; border-radius: 2px; overflow: hidden; }
.spending-category-track > span { display: block; height: 100%; background: #baa370; }
.spending-merchant-row { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; width: 100%; border: 0; border-bottom: 1px solid var(--hairline); background: transparent; color: var(--ivory); text-align: left; cursor: pointer; gap: 12px; }
.spending-merchant-row:hover { background: #baa37008; }
@media (max-width: 374px) {
 .spending-total { font-size: 37px; }
 .spending-overview { padding: 18px; }
 .spending-cashflow strong { font-size: 19px; }
 .activity-filter-totals strong { font-size: 14px; }
 .monthly-bar-amount { font-size: 9px; }
}
@media (max-width: 1023px) {
  .activity-filters input, .activity-filters select,
  .spending-month-controls select, .search-input { font-size: 16px; }
}
