:root {
  color-scheme: light;
  --ink: #17322b;
  --ink-soft: #4d655e;
  --forest: #18392f;
  --forest-deep: #102a23;
  --mint: #d8ecdf;
  --mint-bright: #b8dfc5;
  --cream: #ffffff;
  --paper: #ffffff;
  --line: #e5e9e6;
  --amber: #d58d31;
  --rose: #b85e5a;
  --blue: #4f7f8e;
  --shadow: 0 8px 24px rgba(22, 50, 43, 0.045);
  --radius: 16px;
  font-family:
    Inter,
    ui-sans-serif,
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--cream);
  min-width: 320px;
}

button,
input,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(79, 127, 142, 0.38);
  outline-offset: 3px;
}

.brand {
  display: inline-flex;
  gap: 12px;
  align-items: center;
  color: var(--forest-deep);
  font-weight: 750;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.brand--light {
  color: white;
}

.brand__mark {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 12px;
  color: var(--forest-deep);
  background: var(--mint-bright);
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 15px;
  font-weight: 800;
}

.eyebrow {
  margin: 0 0 7px;
  color: #72827c;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.eyebrow--light {
  color: #a9c5ba;
}

.muted {
  color: var(--ink-soft);
}

.is-hidden {
  display: none !important;
}

/* Login */

.login-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(360px, 1.08fr) minmax(420px, 0.92fr);
}

.login-story {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(32px, 5vw, 72px);
  overflow: hidden;
  color: white;
  background:
    radial-gradient(circle at 80% 20%, rgba(184, 223, 197, 0.18), transparent 26%),
    radial-gradient(circle at 15% 85%, rgba(213, 141, 49, 0.16), transparent 30%),
    linear-gradient(145deg, var(--forest), var(--forest-deep));
}

.login-story__copy {
  max-width: 680px;
  margin: 16vh 0 8vh;
}

.login-story h1 {
  max-width: 680px;
  margin: 0;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(45px, 6vw, 84px);
  font-weight: 500;
  letter-spacing: -0.055em;
  line-height: 0.98;
}

.login-story__copy > p:last-child {
  max-width: 520px;
  margin: 28px 0 0;
  color: #c7d9d2;
  font-size: clamp(17px, 1.4vw, 21px);
  line-height: 1.6;
}

.login-story__foot {
  margin: 0;
  color: #93aca2;
  font-size: 13px;
}

.login-panel {
  display: grid;
  padding: 36px;
  place-items: center;
  background: var(--paper);
}

.login-card {
  width: min(420px, 100%);
}

.login-card h2 {
  margin: 0;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 44px;
  font-weight: 500;
  letter-spacing: -0.04em;
}

.login-card > .muted {
  margin: 10px 0 30px;
}

.login-form {
  display: grid;
  gap: 11px;
}

.login-form label {
  font-size: 13px;
  font-weight: 750;
}

.password-field {
  position: relative;
}

.password-field input {
  width: 100%;
  height: 54px;
  padding: 0 72px 0 16px;
  border: 1px solid #cbd0ca;
  border-radius: 12px;
  color: var(--ink);
  background: white;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.password-field input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(79, 127, 142, 0.12);
  outline: none;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 12px;
  border: 0;
  color: var(--ink-soft);
  background: transparent;
  font-size: 12px;
  font-weight: 750;
  transform: translateY(-50%);
  cursor: pointer;
}

.button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 18px;
  border: 0;
  border-radius: 11px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 780;
  cursor: pointer;
}

.button--primary {
  color: white;
  background: var(--forest);
  box-shadow: 0 8px 20px rgba(24, 57, 47, 0.18);
}

.button--primary:hover {
  background: var(--forest-deep);
}

.button--secondary {
  border: 1px solid #cbd5cf;
  color: var(--forest);
  background: var(--paper);
}

.button--secondary:hover {
  background: #e9eee9;
}

.button--wide {
  width: 100%;
  min-height: 52px;
  margin-top: 9px;
}

.button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.security-note {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: 24px;
  color: #73817c;
  font-size: 12px;
  line-height: 1.5;
}

.security-note span {
  margin-top: 3px;
  color: #55a274;
  font-size: 8px;
}

.security-note p {
  margin: 0;
}

.notice {
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 13px;
}

.notice--error {
  margin: 0 0 18px;
  border: 1px solid #e8c7c4;
  color: #863b38;
  background: #fff0ef;
}

/* Legal pages */

.legal-shell {
  width: min(860px, calc(100% - 36px));
  margin: 0 auto;
  padding: 34px 0 72px;
}

.legal-card {
  margin-top: 32px;
  padding: clamp(28px, 6vw, 62px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow);
}

.legal-card h1 {
  max-width: 700px;
  margin: 0;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(36px, 6vw, 60px);
  font-weight: 500;
  letter-spacing: -0.05em;
  line-height: 1.02;
}

.legal-updated {
  margin: 14px 0 40px;
  color: #7b8984;
  font-size: 11px;
}

.legal-card h2 {
  margin: 28px 0 8px;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 21px;
  font-weight: 500;
  letter-spacing: -0.025em;
}

.legal-card p:not(.eyebrow) {
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.75;
}

.legal-back {
  margin-top: 36px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  font-weight: 750;
}

.legal-back a {
  color: var(--forest);
}

/* Dashboard */

.app-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: 250px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  height: 100vh;
  flex-direction: column;
  padding: 28px 20px 22px;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(18px);
}

.sidebar .brand {
  padding: 0 8px;
}

.nav {
  display: grid;
  gap: 5px;
  margin-top: 44px;
}

.nav__item {
  display: flex;
  gap: 13px;
  align-items: center;
  min-height: 44px;
  padding: 0 13px;
  border-radius: 10px;
  color: #61716b;
  text-decoration: none;
  font-size: 13px;
  font-weight: 680;
}

.nav__item span {
  width: 18px;
  color: #86958f;
  text-align: center;
  font-size: 16px;
}

.nav__item:hover,
.nav__item.is-active {
  color: var(--forest-deep);
  background: #f2f6f3;
}

.sidebar__bottom {
  display: grid;
  gap: 14px;
  margin-top: auto;
}

.actual-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px;
  border-radius: 14px;
  color: white;
  background: var(--forest);
  text-decoration: none;
}

.actual-link span:first-child {
  display: grid;
  gap: 3px;
}

.actual-link strong {
  font-size: 12px;
}

.actual-link small {
  color: #adc3bb;
  font-size: 10px;
}

.sign-out {
  width: 100%;
  padding: 8px;
  border: 0;
  color: #7a8782;
  background: transparent;
  font-size: 12px;
  cursor: pointer;
}

.dashboard {
  min-width: 0;
  padding: 34px clamp(24px, 4vw, 62px) 70px;
  background: #ffffff;
}

.topbar {
  display: flex;
  gap: 24px;
  justify-content: space-between;
  align-items: center;
}

.topbar h1 {
  margin: 0;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(32px, 4vw, 49px);
  font-weight: 500;
  letter-spacing: -0.045em;
}

.topbar__actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.sync-button {
  min-width: 132px;
}

.sync-button__icon {
  display: inline-block;
  font-size: 15px;
  line-height: 1;
}

.sync-button.is-syncing .sync-button__icon {
  animation: spin 800ms linear infinite;
}

.freshness {
  color: #788780;
  font-size: 11px;
}

.icon-button,
.mobile-menu {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--forest);
  background: var(--paper);
  cursor: pointer;
}

.mobile-menu {
  display: none;
  width: auto;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 750;
}

.control-strip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 32px 0 24px;
}

.scope-switch {
  display: inline-flex;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 253, 248, 0.7);
}

.scope-switch button {
  min-height: 34px;
  padding: 0 15px;
  border: 0;
  border-radius: 8px;
  color: #6e7d77;
  background: transparent;
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}

.scope-switch button.is-active {
  color: white;
  background: var(--forest);
}

.scope-switch--disabled button:not(.is-active) {
  opacity: 0.5;
}

.scope-switch--disabled button {
  cursor: default;
}

.mode-badge {
  padding: 7px 10px;
  border-radius: 999px;
  color: #48665a;
  background: var(--mint);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.loading-panel {
  display: grid;
  min-height: 420px;
  place-items: center;
  align-content: center;
  color: #6e7d77;
}

.spinner {
  width: 28px;
  height: 28px;
  border: 3px solid #d7ddd7;
  border-top-color: var(--forest);
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.section-block {
  scroll-margin-top: 24px;
  margin-top: 26px;
}

.section-heading,
.panel__heading {
  display: flex;
  gap: 20px;
  justify-content: space-between;
  align-items: flex-start;
}

.section-heading {
  margin-bottom: 14px;
}

.section-heading h2,
.panel__heading h2,
.quality-panel h2 {
  margin: 0;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 25px;
  font-weight: 500;
  letter-spacing: -0.035em;
}

.section-heading a,
.panel__heading a {
  color: #59766b;
  font-size: 12px;
  font-weight: 750;
  text-decoration: none;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.metric {
  min-width: 0;
  padding: 23px;
  border-right: 1px solid var(--line);
}

.metric:last-child {
  border-right: 0;
}

.metric__label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 15px;
  color: #71807a;
  font-size: 11px;
  font-weight: 750;
}

.metric__value {
  display: block;
  overflow: hidden;
  color: var(--forest-deep);
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(25px, 2.5vw, 36px);
  letter-spacing: -0.045em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric__note {
  display: block;
  margin-top: 8px;
  color: #83908b;
  font-size: 10px;
}

.metric__trend {
  color: #2f7c50;
}

.metric__trend--warn {
  color: var(--rose);
}

.insight-grid,
.split-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1.65fr) minmax(280px, 0.75fr);
}

.split-grid--live {
  grid-template-columns: minmax(0, 1fr);
}

.panel {
  padding: 23px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: 0 5px 18px rgba(22, 50, 43, 0.035);
}

.legend {
  display: flex;
  gap: 16px;
  color: #74827d;
  font-size: 10px;
  font-weight: 700;
}

.legend span::before {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 6px;
  border-radius: 2px;
  content: '';
}

.legend__income::before {
  background: var(--forest);
}

.legend__spend::before {
  background: var(--amber);
}

.legend__total::before {
  background: #9ca39f;
}

.legend__trend::before {
  height: 3px;
  border-radius: 999px;
  background: var(--forest-deep);
  vertical-align: middle;
}

.cashflow-tools {
  display: grid;
  gap: 10px;
  justify-items: end;
}

.cashflow-pager {
  display: grid;
  grid-template-columns: 30px minmax(112px, auto) 30px;
  gap: 7px;
  align-items: center;
}

.cashflow-pager button {
  display: grid;
  width: 30px;
  height: 30px;
  padding: 0;
  place-items: center;
  border: 1px solid #d8dfd9;
  border-radius: 9px;
  color: var(--forest-deep);
  background: #fffefa;
  font-size: 16px;
  cursor: pointer;
}

.cashflow-pager button:hover:not(:disabled) {
  border-color: #9db4a8;
  background: #edf4ef;
}

.cashflow-pager button:focus-visible {
  outline: 2px solid #6f9f87;
  outline-offset: 2px;
}

.cashflow-pager button:disabled {
  color: #b8c0bc;
  background: #f5f5f1;
  cursor: default;
}

.cashflow-pager span {
  color: #697a73;
  text-align: center;
  font-size: 9px;
  font-weight: 800;
}

.cashflow-chart {
  margin-top: 25px;
}

.cashflow-plot {
  position: relative;
  height: 250px;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

.cashflow-months {
  position: relative;
  z-index: 1;
  display: grid;
  height: 100%;
  gap: clamp(5px, 0.9vw, 12px);
}

.chart-month {
  display: grid;
  height: 100%;
  min-width: 0;
  padding: 0 4px;
  grid-template-rows: 34px minmax(0, 1fr) 27px;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: 12px 12px 0 0;
  color: inherit;
  background: transparent;
  font: inherit;
  cursor: pointer;
  transition:
    border-color 140ms ease,
    background 140ms ease;
}

.chart-month:hover,
.chart-month.is-selected {
  border-color: #cbd9d0;
  background: rgba(226, 237, 229, 0.58);
}

.chart-month:focus-visible {
  outline: 2px solid #6f9f87;
  outline-offset: -2px;
}

.chart-month:hover .chart-bar--total,
.chart-month.is-selected .chart-bar--total {
  background: rgba(76, 103, 91, 0.72);
}

.chart-bar-track {
  display: flex;
  min-height: 0;
  align-items: end;
  justify-content: center;
  border-bottom: 1px solid #dfe4e0;
  background: linear-gradient(to top, rgba(223, 228, 224, 0.28) 1px, transparent 1px) 0 0 / 100% 25%;
}

.chart-bar {
  width: min(32px, 54%);
  min-height: 2px;
  border-radius: 6px 6px 0 0;
}

.chart-bar--total {
  background: rgba(125, 136, 130, 0.58);
}

.chart-label {
  display: grid;
  align-content: start;
  color: var(--forest-deep);
  text-align: center;
  font-size: 11px;
  font-weight: 800;
}

.chart-label small {
  margin-top: 2px;
  color: #8a9691;
  font-size: 7px;
  font-weight: 700;
}

.chart-total {
  overflow: hidden;
  color: #6f7d77;
  text-align: center;
  font-size: 8px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cashflow-trend {
  position: absolute;
  z-index: 2;
  top: 40px;
  right: 0;
  bottom: 33px;
  left: 0;
  width: 100%;
  height: calc(100% - 73px);
  overflow: visible;
  pointer-events: none;
}

.cashflow-trend polyline {
  fill: none;
  stroke: var(--forest-deep);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.5;
}

.month-breakdown {
  margin-top: 18px;
  padding: 18px;
  border: 1px solid #dce5de;
  border-radius: 16px;
  background: #f7f9f5;
}

.month-breakdown__heading {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: end;
}

.month-breakdown__heading h3 {
  margin: 2px 0 0;
  color: var(--forest-deep);
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 24px;
  font-weight: 500;
  letter-spacing: -0.035em;
}

.month-breakdown__total {
  display: grid;
  gap: 2px;
  text-align: right;
}

.month-breakdown__total span {
  color: #798780;
  font-size: 8px;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.month-breakdown__total strong {
  color: var(--forest-deep);
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 25px;
  font-weight: 500;
}

.month-breakdown__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
  gap: 8px;
  margin-top: 15px;
}

.month-category {
  display: grid;
  min-width: 0;
  padding: 11px;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid #dce4dd;
  border-radius: 12px;
  color: var(--ink);
  background: #fffefa;
  font: inherit;
  text-align: left;
}

.month-category--button {
  cursor: pointer;
}

.month-category--button:hover {
  border-color: #95ae9e;
  background: #edf4ef;
}

.month-category--button:focus-visible {
  outline: 2px solid #6f9f87;
  outline-offset: 2px;
}

.month-category__icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 10px;
  color: var(--forest-deep);
  background: #e3eee6;
  font-size: 15px;
  font-weight: 850;
}

.month-category__copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.month-category__copy strong {
  overflow: hidden;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.month-category__copy small {
  color: #7d8a84;
  font-size: 7px;
}

.month-category__amount {
  color: #536a60;
  font-size: 9px;
  white-space: nowrap;
}

.month-breakdown__empty {
  margin: 14px 0 0;
  color: #77857f;
  font-size: 9px;
}

.attention-item {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  width: 100%;
  padding: 15px 0;
  border-bottom: 1px solid #e7e7df;
}

.attention-item--button {
  border-top: 0;
  border-right: 0;
  border-left: 0;
  border-radius: 10px;
  color: inherit;
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition:
    background 140ms ease,
    transform 140ms ease;
}

.attention-item--button:hover {
  background: #f4f7f3;
  transform: translateX(2px);
}

.attention-item--button:focus-visible {
  outline: 2px solid #6f9f87;
  outline-offset: 2px;
}

.attention-item:last-child {
  border-bottom: 0;
}

.attention-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--amber);
}

.attention-dot--good {
  background: #55a274;
}

.attention-item__copy {
  min-width: 0;
  flex: 1;
}

.attention-item__chevron {
  flex: 0 0 auto;
  align-self: center;
  color: #557066;
  font-size: 22px;
  line-height: 1;
}

.attention-item strong,
.attention-item small {
  display: block;
}

.connections-panel {
  overflow: visible;
  background:
    radial-gradient(circle at 96% 4%, rgba(184, 223, 197, 0.24), transparent 30%), var(--paper);
}

.connections-heading {
  display: flex;
  gap: 28px;
  justify-content: space-between;
  align-items: flex-start;
}

.connections-heading h2 {
  margin: 0;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 30px;
  font-weight: 500;
  letter-spacing: -0.04em;
}

.connections-intro {
  max-width: 720px;
  margin: 10px 0 0;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.65;
}

.connection-status {
  flex: 0 0 auto;
  padding: 7px 10px;
  border-radius: 999px;
  color: #48665a;
  background: var(--mint);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.provider-setup {
  margin-top: 20px;
  padding: 16px 18px;
  border: 1px solid #e5d3ae;
  border-radius: 13px;
  color: #72521e;
  background: #fff7e8;
}

.provider-setup strong {
  font-size: 12px;
}

.provider-setup p {
  margin: 5px 0 0;
  font-size: 11px;
  line-height: 1.55;
}

.connection-controls {
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(170px, 0.35fr) minmax(260px, 1fr);
  margin-top: 22px;
}

.connection-controls label {
  display: grid;
  gap: 7px;
  color: #60716b;
  font-size: 10px;
  font-weight: 780;
}

.connection-controls input,
.connection-controls select {
  width: 100%;
  height: 46px;
  padding: 0 13px;
  border: 1px solid #cbd3cd;
  border-radius: 11px;
  color: var(--ink);
  background: white;
  font-size: 12px;
}

.connection-controls input:focus,
.connection-controls select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(79, 127, 142, 0.1);
  outline: none;
}

.institution-search {
  position: relative;
}

.institution-results {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 2px;
}

.institution-results[aria-busy='true'] {
  opacity: 0.72;
}

.institution-group {
  overflow: hidden;
  border: 1px solid #d5ddd7;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.78);
}

.institution-group--card {
  border-color: #dfd8ca;
}

.institution-group summary {
  display: grid;
  gap: 11px;
  grid-template-columns: 38px minmax(0, 1fr) auto 18px;
  align-items: center;
  min-height: 64px;
  padding: 11px 13px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.institution-group summary::-webkit-details-marker {
  display: none;
}

.institution-group summary:hover {
  background: #f2f6f2;
}

.institution-group summary:focus-visible {
  outline: 3px solid rgba(79, 127, 142, 0.38);
  outline-offset: -3px;
}

.institution-group--card summary:hover {
  background: #f7f3eb;
}

.institution-group__icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 11px;
  color: var(--forest-deep);
  background: var(--mint);
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 12px;
  font-weight: 800;
}

.institution-group--card .institution-group__icon {
  color: #695029;
  background: #f1e3c7;
  font-size: 10px;
}

.institution-group__title {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.institution-group__title strong {
  font-size: 12px;
}

.institution-group__title small,
.institution-group__count {
  color: #71817b;
  font-size: 9px;
}

.institution-group__count {
  white-space: nowrap;
}

.institution-group__chevron {
  color: #65776f;
  font-size: 16px;
  transition: transform 160ms ease;
}

.institution-group[open] .institution-group__chevron {
  transform: rotate(180deg);
}

.institution-group__options {
  display: grid;
  max-height: 330px;
  padding: 5px;
  overflow-y: auto;
  border-top: 1px solid #e2e7e3;
}

.institution-option {
  display: grid;
  gap: 11px;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  width: 100%;
  padding: 9px;
  border: 0;
  border-radius: 9px;
  color: var(--ink);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.institution-option:hover,
.institution-option:focus-visible {
  background: #edf2ed;
}

.institution-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 9px;
  color: var(--forest-deep);
  background: var(--mint);
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 11px;
  font-weight: 800;
}

.institution-option__copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.institution-option__copy strong {
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.institution-option__copy small {
  color: #80908a;
  font-size: 9px;
}

.institution-option__arrow {
  color: #71827b;
}

.institution-empty {
  margin: 0;
  padding: 20px;
  color: #7a8883;
  text-align: center;
  font-size: 11px;
}

.connection-message {
  margin-top: 16px;
  padding: 11px 13px;
  border-radius: 10px;
  color: #435f54;
  background: #eaf2ec;
  font-size: 11px;
}

.connection-message--success {
  color: #2d6845;
  background: #e5f5e9;
}

.connection-message--error {
  color: #863b38;
  background: #fff0ef;
}

.live-account-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 20px;
}

.live-account-card {
  min-width: 0;
  padding: 16px;
  border: 1px solid #d8dfd9;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.7);
}

.live-account-card__heading {
  display: flex;
  gap: 10px;
  align-items: center;
}

.live-account-card__heading > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.live-account-card__heading strong,
.live-account-card__heading small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-account-card__heading strong {
  font-size: 11px;
}

.live-account-card__heading small,
.live-account-card__type {
  color: #7a8983;
  font-size: 9px;
}

.live-account-card__balance {
  display: block;
  margin-top: 15px;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 25px;
  font-weight: 500;
  letter-spacing: -0.03em;
}

.live-account-card__type {
  display: block;
  margin-top: 4px;
}

.live-account-card__access {
  display: grid;
  gap: 3px;
  margin-top: 12px;
  padding-top: 11px;
  border-top: 1px solid #e2e6e2;
}

.live-account-card__access strong {
  font-size: 10px;
  font-weight: 800;
}

.live-account-card__access small {
  color: #7d8b85;
  font-size: 8px;
}

.live-account-card__access--active strong {
  color: #397051;
}

.live-account-card__access--warning strong {
  color: #9b651d;
}

.live-account-card__access--urgent strong,
.live-account-card__access--expired strong {
  color: #a23d38;
}

.live-account-card__access--neutral strong {
  color: #62736c;
}

.live-account-card__manage {
  width: 100%;
  min-height: 36px;
  margin-top: 14px;
}

.live-accounts-empty {
  grid-column: 1 / -1;
  margin: 0;
  border: 1px dashed #ccd5cf;
  border-radius: 12px;
}

.connections-footnote {
  margin: 17px 0 0;
  color: #82908b;
  font-size: 9px;
  line-height: 1.5;
}

.connections-footnote a {
  color: #48665a;
  font-weight: 750;
}

.attention-item strong {
  font-size: 12px;
}

.attention-item small {
  margin-top: 4px;
  color: #7e8b86;
  font-size: 10px;
  line-height: 1.4;
}

.account-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.account-card {
  position: relative;
  padding: 19px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper);
}

.account-card__top {
  display: flex;
  justify-content: space-between;
  color: #6f7e78;
  font-size: 10px;
  font-weight: 750;
  text-transform: uppercase;
}

.account-card h3 {
  margin: 17px 0 6px;
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-card strong {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 25px;
  font-weight: 500;
  letter-spacing: -0.03em;
}

.status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 5px;
  border-radius: 50%;
  background: #55a274;
}

.status-dot--stale {
  background: var(--amber);
}

.ranked-list,
.budget-list {
  display: grid;
  gap: 15px;
  margin-top: 21px;
}

.analysed-spending .ranked-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.overview-spending {
  margin-top: 18px;
}

.spending-intro {
  max-width: 720px;
  margin: 9px 0 0;
  color: #71807a;
  font-size: 10px;
  line-height: 1.55;
}

.spending-tools {
  display: grid;
  gap: 8px;
  justify-items: end;
}

.history-profile {
  color: #3c7457;
  font-size: 9px;
  font-weight: 800;
}

.spending-summary {
  display: flex;
  gap: 18px;
  align-items: baseline;
  margin-top: 18px;
  padding: 0;
  overflow: hidden;
  border: 1px solid #dfe8e2;
  border-radius: 14px;
  background: #f8fbf9;
}

.spending-summary strong {
  color: var(--forest-deep);
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 24px;
  font-weight: 500;
}

.spending-summary span {
  color: #65776f;
  font-size: 10px;
}

.spending-summary > strong {
  padding: 16px 0 16px 18px;
}

.spending-summary > span {
  padding: 16px 18px 16px 0;
}

.spending-summary__button {
  display: grid;
  width: 100%;
  padding: 16px 18px;
  border: 0;
  grid-template-columns: auto 1fr auto;
  gap: 20px;
  align-items: center;
  color: inherit;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.spending-summary__button:hover {
  background: #f0f7f2;
}

.spending-summary__button:focus-visible {
  outline-offset: -3px;
}

.spending-summary__total {
  color: var(--forest-deep) !important;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 24px !important;
  letter-spacing: -0.035em;
}

.spending-summary__label {
  color: #526a60 !important;
  font-weight: 720;
}

.spending-summary__arrow {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 50%;
  color: var(--forest-deep) !important;
  background: #e1eee5;
  font-size: 15px !important;
}

.ranked-group-heading {
  display: flex;
  grid-column: 1 / -1;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 9px;
  border-bottom: 1px solid #e3e7e2;
}

.ranked-group-heading--below {
  margin-top: 12px;
}

.ranked-group-heading strong {
  color: var(--forest-deep);
  font-size: 11px;
}

.ranked-group-heading span {
  color: #84918c;
  text-align: right;
  font-size: 9px;
}

.ranked-row__top strong {
  display: flex;
  gap: 7px;
  align-items: center;
}

.ranked-row__identity {
  display: flex;
  min-width: 0;
  gap: 9px;
  align-items: center;
}

.ranked-row__icon {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 9px;
  color: #315849 !important;
  background: #e8f3ec;
  font-size: 12px;
  font-weight: 850;
}

.ranked-row__icon--food {
  color: #7b552f !important;
  background: #faeddc;
}

.ranked-row__icon--shopping {
  color: #715a82 !important;
  background: #f0eafa;
}

.ranked-row__icon--digital {
  color: #446a87 !important;
  background: #e8f1f8;
}

.ranked-row__icon--home {
  color: #3f6655 !important;
  background: #e5f0e8;
}

.ranked-row__icon--travel {
  color: #316d78 !important;
  background: #e2f2f4;
}

.ranked-row__icon--holiday {
  color: #8c6423 !important;
  background: #fbf0cf;
}

.ranked-row__icon--family,
.ranked-row__icon--life {
  color: #85536a !important;
  background: #f8e9ef;
}

.ranked-row__icon--care {
  color: #417153 !important;
  background: #e5f3e9;
}

.ranked-row__icon--money {
  color: #4d6170 !important;
  background: #e9eef2;
}

.ranked-row__icon--work {
  color: #765629 !important;
  background: #f6ead5;
}

.ranked-row__icon--review {
  color: #915b2c !important;
  background: #faead7;
}

.ranked-row--button {
  width: 100%;
  min-height: 104px;
  padding: 12px;
  border: 1px solid #e8ece9;
  border-radius: 14px;
  color: inherit;
  background: #ffffff;
  text-align: left;
  cursor: pointer;
}

.ranked-row--button:hover,
.ranked-row--button.is-selected {
  border-color: #b9cec1;
  background: #fbfdfb;
  box-shadow: 0 7px 18px rgba(22, 50, 43, 0.06);
}

.ranked-row--empty {
  background: #fcfdfc;
}

.ranked-row--empty .track {
  opacity: 0.45;
}

.ranked-row--empty .ranked-row__value,
.ranked-row--empty .ranked-row__meta {
  color: #929d98;
}

.ranked-row--button:focus-visible {
  outline: 2px solid #6f9f87;
  outline-offset: 5px;
}

.ranked-row__value {
  display: inline-flex;
  gap: 7px;
  align-items: center;
}

.ranked-row__chevron {
  color: #6c7d75;
  font-size: 13px;
  transition: transform 160ms ease;
}

.ranked-row__meta {
  display: block;
  margin-top: 6px;
  color: #7c8a84;
  font-size: 8px;
  font-weight: 700;
}

.ranked-row--button.is-selected .ranked-row__chevron {
  transform: rotate(180deg);
}

.review-tag {
  padding: 2px 6px;
  border-radius: 999px;
  color: #8b6531;
  background: #f4e5c8;
  font-size: 7px;
  font-weight: 800;
  text-transform: uppercase;
}

.ranked-row--reimbursable .ranked-row__top strong {
  color: #765629;
}

.ranked-row__top,
.budget-row__top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 7px;
  font-size: 11px;
}

.ranked-row__top strong,
.budget-row__top strong {
  font-weight: 750;
}

.ranked-row__top span,
.budget-row__top span {
  color: #677872;
}

.track {
  display: block;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7e9e3;
}

.track__fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--forest);
}

.track__fill--amber {
  background: var(--amber);
}

.spending-breakdown {
  display: grid;
  grid-column: 1 / -1;
  gap: 13px;
  margin-top: 4px;
  padding: 17px;
  border: 1px solid #d9e1da;
  border-radius: 14px;
  background: #f5f7f3;
}

.spending-breakdown__heading {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: start;
}

.spending-breakdown__heading > div {
  display: grid;
  gap: 4px;
}

.spending-breakdown__heading strong {
  color: var(--forest-deep);
  font-size: 12px;
}

.spending-breakdown__heading span {
  color: #76857f;
  font-size: 9px;
}

.spending-breakdown__close {
  padding: 3px 0;
  border: 0;
  color: #547064;
  background: transparent;
  font-size: 9px;
  font-weight: 800;
  cursor: pointer;
}

.spending-breakdown__close:focus-visible {
  outline: 2px solid #6f9f87;
  outline-offset: 3px;
}

.spending-breakdown__list {
  display: grid;
  border-top: 1px solid #dde3dd;
}

.spending-payment {
  display: grid;
  grid-template-columns: minmax(200px, 1fr) auto minmax(235px, 0.75fr);
  gap: 16px;
  align-items: center;
  padding: 13px 0;
  border-bottom: 1px solid #dde3dd;
}

.spending-payment:last-child {
  border-bottom: 0;
}

.spending-payment__identity {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.spending-payment__identity time,
.spending-payment__identity small {
  color: #7b8983;
  font-size: 8px;
}

.spending-payment__identity strong {
  overflow: hidden;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.spending-payment__amount {
  color: var(--forest-deep);
  font-size: 11px;
  white-space: nowrap;
}

.spending-payment__controls {
  display: grid;
  grid-template-columns: minmax(145px, 1fr) auto;
  gap: 7px;
  align-items: end;
}

.spending-payment__controls label {
  display: grid;
  gap: 4px;
  color: #66776f;
  font-size: 8px;
  font-weight: 750;
}

.spending-payment__controls select {
  width: 100%;
  height: 34px;
  padding: 0 9px;
  border: 1px solid #cbd5ce;
  border-radius: 8px;
  color: var(--ink);
  background: #fffefa;
  font-size: 9px;
}

.spending-payment__controls select:focus-visible {
  border-color: #6f9f87;
  outline: 2px solid rgba(111, 159, 135, 0.2);
}

.button--compact {
  min-height: 34px;
  padding: 0 12px;
  color: white;
  background: var(--forest);
  font-size: 9px;
}

.button--compact:disabled {
  cursor: default;
}

.assignment-message {
  min-height: 10px;
  grid-column: 1 / -1;
  color: #76857f;
  font-size: 8px;
}

.assignment-message--saved {
  color: #3c7457;
}

.assignment-message--error {
  color: #9b403b;
}

.spending-dialog {
  width: min(780px, calc(100% - 32px));
  max-width: none;
  max-height: min(820px, calc(100vh - 40px));
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 22px;
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 30px 90px rgba(15, 36, 30, 0.28);
}

.spending-dialog::backdrop {
  background: rgba(15, 35, 29, 0.48);
  backdrop-filter: blur(3px);
}

.spending-dialog__surface {
  max-height: min(820px, calc(100vh - 40px));
  padding: 24px;
  overflow-y: auto;
}

.spending-dialog__empty {
  margin-top: 16px;
  padding: 28px;
  border: 1px dashed #ccd8d0;
  border-radius: 14px;
  color: #71807a;
  background: #fafcfb;
  text-align: center;
  font-size: 11px;
  line-height: 1.6;
}

.spending-dialog__heading {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
}

.spending-dialog__title {
  display: grid;
  gap: 5px;
}

.spending-dialog__title h2 {
  margin: 0;
  color: var(--forest-deep);
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 30px;
  font-weight: 500;
  letter-spacing: -0.04em;
}

.spending-dialog__title > p:not(.eyebrow) {
  max-width: 620px;
  margin: 0;
  color: #71807a;
  font-size: 10px;
  line-height: 1.55;
}

.spending-dialog__title > .spending-dialog__learning-note {
  margin-top: 6px;
  padding: 9px 11px;
  border-radius: 10px;
  color: #426451;
  background: #edf4ef;
}

.spending-dialog__close,
.spending-dialog__back {
  flex: 0 0 auto;
  border: 0;
  color: #557066;
  background: transparent;
  font-weight: 800;
  cursor: pointer;
}

.spending-dialog__close {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  background: #eef3ee;
  font-size: 20px;
}

.spending-dialog__back {
  padding: 7px 0;
  font-size: 10px;
}

.spending-dialog__close:hover,
.spending-dialog__back:hover {
  color: var(--forest-deep);
}

.spending-dialog__close:focus-visible,
.spending-dialog__back:focus-visible,
.supplier-row:focus-visible,
.category-choice:focus-visible {
  outline: 2px solid #6f9f87;
  outline-offset: 2px;
}

.pattern-note {
  display: grid;
  gap: 4px;
  margin-top: 18px;
  padding: 12px 14px;
  border-radius: 12px;
  color: #456456;
  background: #edf4ef;
}

.pattern-note strong {
  font-size: 9px;
}

.pattern-note span {
  font-size: 9px;
  line-height: 1.5;
}

.supplier-list {
  display: grid;
  margin-top: 14px;
  border-top: 1px solid #e0e5e0;
}

.supplier-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  width: 100%;
  padding: 14px 8px;
  border: 0;
  border-bottom: 1px solid #e0e5e0;
  color: var(--ink);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.supplier-row:hover {
  background: #f5f7f3;
}

.supplier-row__identity,
.supplier-row__value {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.supplier-row__identity strong {
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.supplier-row__identity small,
.supplier-row__value small {
  color: #7a8882;
  font-size: 8px;
}

.supplier-row__pattern {
  color: #3d7658;
  font-size: 8px;
  font-weight: 750;
}

.supplier-row__value {
  grid-template-columns: auto 14px;
  text-align: right;
}

.supplier-row__value strong,
.supplier-row__value small {
  grid-column: 1;
}

.supplier-row__value > span {
  grid-column: 2;
  grid-row: 1 / 3;
  align-self: center;
  color: #63786e;
  font-size: 20px;
}

.picker-payment {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-top: 18px;
  padding: 14px 16px;
  border: 1px solid #dde4de;
  border-radius: 13px;
  background: #f7f8f5;
}

.picker-payment > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.picker-payment strong {
  font-size: 11px;
}

.picker-payment small {
  color: #7a8882;
  font-size: 8px;
}

.category-choices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-top: 17px;
}

.category-choice {
  position: relative;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 68px;
  padding: 12px 14px;
  border: 1px solid #d6ded7;
  border-radius: 12px;
  color: var(--ink);
  background: #fffefa;
  text-align: left;
  cursor: pointer;
}

.category-choice:hover:not(:disabled) {
  border-color: #8cad9a;
  background: #edf4ef;
}

.category-choice strong {
  color: var(--forest-deep);
  font-size: 10px;
}

.category-choice small {
  padding-right: 45px;
  color: #788680;
  font-size: 8px;
  line-height: 1.4;
}

.category-choice__icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 10px;
  color: var(--forest-deep);
  background: #e3eee6;
  font-size: 14px;
  font-weight: 850;
}

.category-choice__icon.ranked-row__icon--food {
  color: #7b552f;
  background: #faeddc;
}

.category-choice__icon.ranked-row__icon--shopping {
  color: #715a82;
  background: #f0eafa;
}

.category-choice__icon.ranked-row__icon--digital {
  color: #446a87;
  background: #e8f1f8;
}

.category-choice__icon.ranked-row__icon--home,
.category-choice__icon.ranked-row__icon--care {
  color: #3f6655;
  background: #e5f0e8;
}

.category-choice__icon.ranked-row__icon--travel {
  color: #316d78;
  background: #e2f2f4;
}

.category-choice__icon.ranked-row__icon--holiday,
.category-choice__icon.ranked-row__icon--work {
  color: #8c6423;
  background: #fbf0cf;
}

.category-choice__icon.ranked-row__icon--family,
.category-choice__icon.ranked-row__icon--life {
  color: #85536a;
  background: #f8e9ef;
}

.category-choice__icon.ranked-row__icon--money {
  color: #4d6170;
  background: #e9eef2;
}

.category-choice__icon.ranked-row__icon--review {
  color: #915b2c;
  background: #faead7;
}

.category-choice__copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.category-choice__current {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 3px 6px;
  border-radius: 999px;
  color: #3d7658;
  background: #dceee2;
  font-size: 7px;
  font-weight: 800;
  text-transform: uppercase;
}

.category-choice.is-current {
  border-color: #afc5b7;
  background: #eef4ef;
}

.category-choice.is-current:disabled {
  cursor: default;
}

.category-choice.is-saving::after {
  position: absolute;
  right: 12px;
  bottom: 10px;
  color: #557066;
  content: 'Saving…';
  font-size: 8px;
}

.spending-dialog .assignment-message {
  margin: 10px 0 0;
}

.track__fill--rose {
  background: var(--rose);
}

.track--segmented {
  display: flex;
  overflow: hidden;
}

.track--segmented .track__fill {
  position: static;
  flex: 0 0 auto;
}

.track__fill--household {
  background: #2f7658;
}

.track__fill--parents {
  background: #8a6da8;
}

.track__fill--unmatched {
  background: #b8beb9;
}

.amazon-split-summary {
  color: #71807a;
  font-size: 8px;
  font-weight: 700;
}

.amazon-import {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto;
  gap: 9px;
  align-items: end;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid #d9e3dc;
  border-radius: 13px;
  background: #f3f7f3;
}

.amazon-import__heading {
  display: grid;
  grid-column: 1 / -1;
  gap: 4px;
}

.amazon-import__heading strong {
  font-size: 10px;
}

.amazon-import__heading small,
.amazon-import__help {
  color: #6f7f78;
  font-size: 8px;
  line-height: 1.45;
}

.amazon-import__file,
.amazon-import__hint {
  min-width: 0;
  min-height: 36px;
  padding: 8px 10px;
  border: 1px solid #ccd8d0;
  border-radius: 9px;
  color: var(--ink);
  background: #fffefa;
  font: inherit;
  font-size: 8px;
}

.amazon-import__help {
  grid-column: 1 / -1;
  width: fit-content;
  color: #3d7658;
  font-weight: 750;
}

.amazon-import__message {
  grid-column: 1 / -1;
  min-height: 10px;
  margin: 0;
  font-size: 8px;
}

.discovery-panel {
  display: grid;
  gap: 6px;
  margin-top: 24px;
  padding: 16px;
  border-radius: 14px;
  background: linear-gradient(135deg, #eef5ef, #f8f4ea);
}

.discovery-panel > strong {
  color: var(--forest-deep);
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 19px;
  font-weight: 500;
}

.discovery-panel__list {
  display: grid;
  gap: 8px;
  margin: 5px 0 0;
  padding: 0;
  list-style: none;
}

.discovery-panel__list li {
  display: grid;
  grid-template-columns: 25px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  color: #52665d;
  font-size: 9px;
  line-height: 1.45;
}

.discovery-panel__icon {
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  border-radius: 8px;
  color: var(--forest-deep);
  background: #dceadf;
  font-size: 11px;
  font-weight: 800;
}

@media (max-width: 700px) {
  .amazon-import {
    grid-template-columns: 1fr;
  }
}

.budget-summary {
  display: flex;
  gap: 16px;
  align-items: baseline;
  margin-top: 20px;
  padding: 16px;
  border-radius: 13px;
  background: #edf2ed;
}

.budget-summary strong {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 26px;
  font-weight: 500;
}

.budget-summary span {
  color: #687873;
  font-size: 10px;
}

.table-scroll {
  overflow-x: auto;
  margin-top: 18px;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

th {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  color: #778680;
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

td {
  padding: 14px 12px;
  border-bottom: 1px solid #e9e8e1;
  font-size: 11px;
}

tbody tr:last-child td {
  border-bottom: 0;
}

.tag {
  display: inline-block;
  padding: 5px 8px;
  border-radius: 999px;
  color: #48665a;
  background: var(--mint);
  font-size: 9px;
  font-weight: 800;
  text-transform: capitalize;
}

.quality-panel {
  display: grid;
  gap: 40px;
  grid-template-columns: 0.85fr 1.15fr;
  padding: 30px;
  border-radius: var(--radius);
  color: white;
  background: var(--forest);
  box-shadow: var(--shadow);
}

.quality-panel h2 {
  font-size: 32px;
}

.quality-panel p:not(.eyebrow) {
  color: #b5cac2;
  font-size: 12px;
  line-height: 1.6;
}

.quality-actions {
  display: grid;
  gap: 8px;
}

.quality-action {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  padding: 11px 13px;
  border-radius: 10px;
  color: #d6e3de;
  background: rgba(255, 255, 255, 0.07);
  font-size: 11px;
  line-height: 1.45;
}

.quality-action span:first-child {
  color: var(--mint-bright);
}

.empty-state {
  padding: 28px 0;
  color: #7a8883;
  text-align: center;
  font-size: 12px;
}

/* Standalone connection centre */

.connections-page {
  width: min(1180px, calc(100% - 48px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 28px 0 48px;
}

.connections-page__topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
}

.connections-page__hero {
  display: grid;
  gap: 42px;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  padding: clamp(28px, 5vw, 58px);
  overflow: hidden;
  border-radius: 24px;
  color: white;
  background:
    radial-gradient(circle at 86% 10%, rgba(184, 223, 197, 0.2), transparent 32%),
    linear-gradient(140deg, var(--forest), var(--forest-deep));
  box-shadow: var(--shadow);
}

.connections-page__hero h1 {
  max-width: 700px;
  margin: 0;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(38px, 5vw, 64px);
  font-weight: 500;
  letter-spacing: -0.055em;
  line-height: 1;
}

.connections-page__hero p:not(.eyebrow) {
  max-width: 660px;
  margin: 20px 0 0;
  color: #c5d8d0;
  font-size: 14px;
  line-height: 1.7;
}

.connections-page__shield {
  display: grid;
  gap: 4px;
  min-width: 180px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.07);
}

.connections-page__shield strong {
  color: var(--mint-bright);
  font-size: 13px;
}

.connections-page__shield span {
  color: #afc4bb;
  font-size: 10px;
}

.connections-page > .connection-message {
  margin-top: 18px;
}

.connections-manager {
  margin-top: 18px;
  padding: clamp(22px, 4vw, 34px);
}

.connections-manager__heading {
  display: flex;
  gap: 24px;
  justify-content: space-between;
  align-items: flex-start;
}

.connections-manager__heading h2,
.renew-explainer h2 {
  margin: 0;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 30px;
  font-weight: 500;
  letter-spacing: -0.04em;
}

.managed-connection-list {
  display: grid;
  gap: 12px;
  margin-top: 22px;
}

.managed-connection-loading {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
  min-height: 150px;
  color: var(--ink-soft);
  font-size: 12px;
}

.managed-connection-card {
  display: grid;
  gap: 22px;
  grid-template-columns: minmax(190px, 0.75fr) minmax(220px, 1fr) minmax(210px, 0.75fr);
  align-items: center;
  padding: 18px;
  border: 1px solid #d9dfda;
  border-radius: 16px;
  background: #fffefa;
}

.managed-connection-card__main {
  display: flex;
  gap: 12px;
  align-items: center;
  min-width: 0;
}

.managed-connection-card__mark {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 12px;
  color: var(--forest-deep);
  background: var(--mint);
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 12px;
  font-weight: 800;
}

.managed-connection-card__mark--card {
  color: #695029;
  background: #f1e3c7;
}

.managed-connection-card__heading {
  min-width: 0;
}

.managed-connection-card__heading h3 {
  overflow: hidden;
  margin: 0;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.managed-connection-card__heading p {
  margin: 4px 0 0;
  color: #7a8983;
  font-size: 9px;
}

.managed-account-list {
  display: grid;
  gap: 7px;
}

.managed-account {
  min-width: 0;
  padding: 8px 10px;
  border-radius: 9px;
  background: #f3f5f1;
}

.managed-account span,
.managed-account strong,
.managed-account small {
  display: block;
  min-width: 0;
}

.managed-account strong {
  overflow: hidden;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.managed-account small {
  margin-top: 3px;
  color: #7d8a85;
  font-size: 8px;
}

.managed-connection-card__controls {
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.managed-access-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.managed-access-copy small {
  color: #7d8b85;
  font-size: 8px;
  line-height: 1.4;
}

.managed-access-status {
  font-size: 9px;
  font-weight: 800;
}

.managed-access-status--active {
  color: #397051;
}

.managed-access-status--warning {
  color: #9b651d;
}

.managed-access-status--urgent,
.managed-access-status--expired {
  color: #a23d38;
}

.managed-access-status--neutral {
  color: #62736c;
}

.managed-connections-empty {
  margin: 0;
  border: 1px dashed #ccd5cf;
  border-radius: 12px;
}

.renew-explainer {
  display: grid;
  gap: 32px;
  grid-template-columns: minmax(240px, 0.8fr) minmax(0, 1.2fr);
  margin-top: 18px;
  padding: clamp(24px, 4vw, 36px);
  border: 1px solid #dedfd8;
  border-radius: 20px;
  background: rgba(255, 253, 248, 0.6);
}

.renew-explainer ol {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.renew-explainer li {
  display: grid;
  gap: 11px;
  grid-template-columns: 28px 1fr;
  align-items: start;
}

.renew-explainer li > span {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 9px;
  color: var(--forest-deep);
  background: var(--mint);
  font-size: 10px;
  font-weight: 800;
}

.renew-explainer li p,
.renew-explainer li strong {
  display: block;
}

.renew-explainer li p {
  margin: 1px 0 0;
  color: #718079;
  font-size: 10px;
  line-height: 1.5;
}

.renew-explainer li strong {
  margin-bottom: 2px;
  color: var(--ink);
  font-size: 11px;
}

.connections-page__footer {
  display: flex;
  gap: 16px;
  justify-content: flex-end;
  align-items: center;
  padding: 22px 0 0;
}

.connections-page__footer p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 11px;
}

@media (max-width: 1080px) {
  .analysed-spending .ranked-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric:nth-child(2) {
    border-right: 0;
  }

  .metric:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .insight-grid,
  .split-grid {
    grid-template-columns: 1fr;
  }

  .account-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .live-account-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .managed-connection-card {
    grid-template-columns: minmax(190px, 0.8fr) minmax(220px, 1.2fr);
  }

  .managed-connection-card__controls {
    grid-column: 1 / -1;
    padding-top: 12px;
    border-top: 1px solid #e3e7e3;
  }
}

@media (max-width: 780px) {
  .login-shell {
    grid-template-columns: 1fr;
  }

  .login-story {
    min-height: 42vh;
    padding: 28px;
  }

  .login-story__copy {
    margin: 12vh 0 3vh;
  }

  .login-story__foot {
    display: none;
  }

  .login-panel {
    padding: 48px 24px;
  }

  .connections-page {
    width: min(100% - 28px, 1180px);
    padding-top: 18px;
  }

  .connections-page__topbar .brand > span:last-child {
    display: none;
  }

  .connections-page__hero,
  .renew-explainer {
    grid-template-columns: 1fr;
  }

  .connections-page__shield {
    min-width: 0;
  }

  .connections-manager__heading,
  .connections-page__footer {
    align-items: flex-start;
  }

  .connections-manager__heading {
    display: grid;
  }

  .managed-connection-card {
    grid-template-columns: 1fr;
  }

  .managed-connection-card__controls {
    grid-column: auto;
    grid-template-columns: 1fr;
  }

  .managed-connection-card__controls .button {
    width: 100%;
  }

  .connections-page__footer {
    display: grid;
  }

  .app-shell {
    display: block;
  }

  .sidebar {
    position: fixed;
    z-index: 10;
    left: 0;
    width: min(290px, 86vw);
    transform: translateX(-105%);
    transition: transform 180ms ease;
  }

  .sidebar.is-open {
    transform: translateX(0);
    box-shadow: 20px 0 50px rgba(16, 42, 35, 0.2);
  }

  .dashboard {
    padding: 23px 18px 50px;
  }

  .mobile-menu {
    display: grid;
  }

  .topbar {
    align-items: flex-start;
  }

  .topbar__actions .freshness,
  .topbar__actions .button:not(.sync-button) {
    display: none;
  }

  .topbar__actions .sync-button {
    display: inline-flex;
    min-width: 0;
    padding: 0 12px;
  }

  .control-strip {
    align-items: flex-end;
  }

  .scope-switch button {
    padding: 0 10px;
  }

  .mode-badge {
    max-width: 110px;
    text-align: center;
  }

  .metric-grid,
  .account-grid,
  .live-account-grid {
    grid-template-columns: 1fr;
  }

  .connections-heading {
    display: grid;
  }

  .connection-status {
    justify-self: start;
  }

  .connection-controls {
    grid-template-columns: 1fr;
  }

  .institution-results {
    grid-template-columns: 1fr;
  }

  .metric {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .metric:last-child {
    border-bottom: 0;
  }

  .quality-panel {
    grid-template-columns: 1fr;
  }

  .cashflow-chart {
    margin-top: 18px;
  }

  .panel__heading:has(.cashflow-tools) {
    display: grid;
    gap: 16px;
  }

  .cashflow-tools {
    justify-items: start;
  }

  .cashflow-plot {
    height: 225px;
  }

  .month-breakdown {
    padding: 14px;
  }

  .month-breakdown__heading {
    align-items: start;
  }

  .month-breakdown__grid {
    grid-template-columns: 1fr;
  }

  .analysed-spending .panel__heading {
    display: grid;
    gap: 14px;
  }

  .spending-tools {
    justify-items: start;
  }

  .analysed-spending .ranked-list {
    grid-template-columns: 1fr;
  }

  .ranked-group-heading {
    grid-column: 1;
  }

  .spending-breakdown {
    grid-column: 1;
  }

  .spending-payment {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .spending-payment__controls {
    grid-column: 1 / -1;
  }

  .spending-dialog__surface {
    padding: 18px;
  }

  .category-choices {
    grid-template-columns: 1fr;
  }

  .supplier-row {
    gap: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
