:root {
  color-scheme: light;
  --paper: #f3f1ea;
  --paper-deep: #e9e6dc;
  --surface: rgba(255, 255, 252, 0.82);
  --surface-solid: #fffefa;
  --ink: #13231d;
  --muted: #69726e;
  --line: rgba(19, 35, 29, 0.11);
  --green: #176b4d;
  --green-bright: #35bc84;
  --danger: #b34343;
  --shadow: 0 24px 70px rgba(35, 47, 39, 0.1);
  --radius: 28px;
  --font-sans: "Helvetica Neue", Helvetica, "Nimbus Sans", Arial, sans-serif;
  font-family: var(--font-sans);
  font-synthesis: none;
}

* { box-sizing: border-box; }

html { min-width: 320px; min-height: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--ink);
  background-color: var(--paper);
  background-image: url("/grid-texture.svg");
  background-size: 640px 480px;
  background-attachment: fixed;
  overflow-x: hidden;
}

button, input { font: inherit; }
button { color: inherit; }
button, a, label { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible { outline: 3px solid rgba(23, 107, 77, 0.22); outline-offset: 2px; }
.hidden { display: none !important; }
.offline-notice { position: fixed; z-index: 120; top: env(safe-area-inset-top, 0); left: 50%; width: min(540px, calc(100% - 24px)); padding: 9px 13px; border-radius: 0 0 12px 12px; color: white; background: #8a5a19; box-shadow: 0 8px 24px rgba(19,35,29,.16); font-size: 10px; font-weight: 750; text-align: center; transform: translateX(-50%); }

.ambient {
  position: fixed;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  filter: blur(2px);
  pointer-events: none;
  z-index: -1;
}
.ambient-one { top: -240px; right: -100px; background: radial-gradient(circle, rgba(53, 188, 132, 0.18), transparent 68%); }
.ambient-two { bottom: -270px; left: -160px; background: radial-gradient(circle, rgba(245, 166, 35, 0.12), transparent 68%); }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  position: relative;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  color: var(--ink);
  transition: transform .3s cubic-bezier(.2,.8,.2,1);
}
.brand:hover .brand-mark { transform: translateY(-1px); }
.brand-mark svg { width: 100%; height: 100%; overflow: visible; }
.logo-contour, .logo-cut { fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; }
.logo-contour-outer { stroke-width: 1.45; }
.logo-contour-middle { stroke-width: 1.25; opacity: .72; }
.logo-contour-inner { stroke-width: 1.15; opacity: .5; }
.logo-cut { stroke-width: 1.05; opacity: .82; }
.brand-wordmark {
  display: inline-flex;
  align-items: baseline;
  gap: .36em;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: .075em;
  text-transform: uppercase;
}
.brand-wordmark > span { color: inherit; font-weight: inherit; letter-spacing: inherit; }

.eyebrow {
  margin: 0;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.auth-view {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(420px, 0.8fr);
  padding: 28px;
}

.auth-intro {
  position: relative;
  min-height: calc(100vh - 56px);
  display: flex;
  flex-direction: column;
  padding: 24px 5vw 46px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 36px;
  overflow: hidden;
  background:
    radial-gradient(circle at 80% 22%, rgba(53, 188, 132, 0.2), transparent 34%),
    linear-gradient(145deg, #e3eadf 0%, #d9e4da 52%, #e9e4d3 100%);
}

.auth-intro::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 45%, rgba(255,255,255,.22));
  pointer-events: none;
}

.auth-message { position: relative; z-index: 1; margin: auto 0 44px; max-width: 700px; }
.auth-message h1 {
  max-width: 670px;
  margin: 16px 0 20px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(48px, 5.4vw, 82px);
  font-weight: 500;
  line-height: 0.99;
  letter-spacing: -0.055em;
}
.auth-message > p:last-child { max-width: 540px; margin: 0; color: #4d5c55; font-size: 18px; line-height: 1.6; }

.sample-rings { position: relative; z-index: 1; display: flex; align-items: flex-end; gap: clamp(14px, 3vw, 38px); }
.sample-ring {
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--ink);
  font-size: 12px;
  font-weight: 750;
  background: rgba(255, 255, 255, 0.32);
}
.sample-ring::before { content: ""; position: absolute; border-radius: 50%; }
.sample-ring-one { width: 112px; height: 112px; border: 14px solid #ff655f; }
.sample-ring-two { width: 142px; height: 142px; border: 14px solid #6758e8; }
.sample-ring-three { width: 90px; height: 90px; border: 12px solid #15956f; }

.auth-panel-wrap { display: grid; place-items: center; padding: 5vw; }
.auth-panel { width: min(100%, 410px); }
.auth-tabs { display: inline-flex; gap: 4px; padding: 4px; margin-bottom: 52px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.42); }
.auth-tab { padding: 9px 14px; border: 0; border-radius: 10px; color: var(--muted); background: transparent; font-size: 13px; font-weight: 700; cursor: pointer; }
.auth-tab.is-active { color: var(--ink); background: var(--surface-solid); box-shadow: 0 3px 12px rgba(20,35,29,.07); }
.auth-heading { margin-bottom: 28px; }
.auth-heading h2, .modal h2 { margin: 8px 0 0; font-family: Georgia, "Times New Roman", serif; font-size: 34px; font-weight: 500; letter-spacing: -0.035em; }
.auth-recovery-button { justify-self: center; padding: 2px 4px; border: 0; color: var(--green); background: transparent; font: inherit; font-size: 12px; font-weight: 750; cursor: pointer; }
.auth-recovery-button:hover { text-decoration: underline; text-underline-offset: 3px; }

.form-stack { display: grid; gap: 18px; }
.register-fields { display: grid; gap: 18px; }
.form-stack > label:not(.avatar-picker) { display: grid; gap: 8px; }
.form-stack label > span:first-child, .color-fieldset legend, .budget-mode-fieldset legend { font-size: 13px; font-weight: 750; }
input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="date"] {
  width: 100%;
  height: 52px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ink);
  background: rgba(255,255,252,.75);
  transition: border-color .2s, box-shadow .2s, background .2s;
}
textarea {
  width: 100%;
  min-height: 108px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ink);
  background: rgba(255,255,252,.75);
  font: inherit;
  line-height: 1.5;
  resize: vertical;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
textarea:hover { border-color: rgba(19,35,29,.24); }
textarea:focus { border-color: var(--green); background: var(--surface-solid); box-shadow: 0 0 0 4px rgba(23,107,77,.08); outline: 0; }
input:hover { border-color: rgba(19,35,29,.24); }
input:focus { border-color: var(--green); background: var(--surface-solid); box-shadow: 0 0 0 4px rgba(23,107,77,.08); outline: 0; }
input:disabled { color: var(--muted); background: rgba(19,35,29,.035); }
select { width: 100%; height: 52px; padding: 0 40px 0 15px; border: 1px solid var(--line); border-radius: 14px; color: var(--ink); background: rgba(255,255,252,.75); font: inherit; }
.security-note { display: grid; gap: 7px; padding: 15px; border: 1px solid var(--line); border-radius: 14px; background: rgba(19,35,29,.035); }
.security-note strong { font-size: 13px; }
.security-note p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.security-note .button { justify-self: start; margin-top: 3px; }
.recovery-codes-intro { margin: 0 0 16px; }
.recovery-codes-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.recovery-codes-list code { padding: 10px 8px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: rgba(19,35,29,.045); font-size: 11px; text-align: center; user-select: all; }
.select-with-action { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.select-with-action .button { height: 52px; }
.input-with-suffix { position: relative; display: block; }
.input-with-suffix input { padding-right: 100px; }
.input-with-suffix > span { position: absolute; top: 17px; right: 15px; color: var(--muted); font-size: 13px; }
.field-note { margin-top: -1px; color: var(--muted); font-size: 10px; font-weight: 400; line-height: 1.45; }
.budget-mode-fieldset { display: grid; gap: 8px; padding: 0; border: 0; }
.budget-mode-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.budget-mode-choices label { position: relative; cursor: pointer; }
.budget-mode-choices input { position: absolute; opacity: 0; pointer-events: none; }
.budget-mode-choices label > span { min-height: 68px; display: grid; align-content: center; gap: 3px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,252,.68); transition: border-color .2s, box-shadow .2s, background .2s; }
.budget-mode-choices strong { font-size: 11px; }
.budget-mode-choices small { color: var(--muted); font-size: 9px; font-weight: 500; line-height: 1.35; }
.budget-mode-choices input:checked + span { border-color: rgba(23,107,77,.42); background: rgba(23,107,77,.06); box-shadow: 0 0 0 3px rgba(23,107,77,.055); }
.budget-mode-choices input:focus-visible + span { outline: 2px solid var(--green); outline-offset: 2px; }
.specialized-category { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 11px; padding: 11px; border: 1px solid rgba(23,107,77,.15); border-radius: 14px; background: rgba(23,107,77,.045); }
.specialized-category-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 11px; color: white; background: var(--green); }
.specialized-category-icon svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.55; stroke-linecap: round; stroke-linejoin: round; }
.specialized-category > span:nth-child(2) { min-width: 0; display: grid; gap: 2px; }
.specialized-category small { color: var(--green); font-size: 8px; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; }
.specialized-category strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.book-project-fields { display: grid; gap: 13px; padding: 15px; border: 1px solid rgba(23,107,77,.13); border-radius: 17px; background: linear-gradient(145deg, rgba(255,255,255,.55), rgba(23,107,77,.035)); }
.book-project-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.book-project-heading > span:first-child { display: grid; gap: 2px; }
.book-project-heading small { color: var(--green); font-size: 7px; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.book-project-heading strong { font-size: 12px; }
.book-project-badge { padding: 4px 7px; border-radius: 999px; color: var(--green); background: rgba(23,107,77,.08); font-size: 7px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.book-project-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.book-project-grid > label { display: grid; gap: 6px; }
.book-project-grid label > span:first-child { font-size: 10px; font-weight: 740; }
.book-project-grid label > span small { color: var(--muted); font-size: 8px; font-weight: 500; }
.book-project-grid input { height: 43px; border-radius: 12px; font-size: 12px; }
.book-density-field { grid-column: 1 / -1; }
.book-density-field .input-with-suffix input { padding-right: 105px; }
.book-density-field .input-with-suffix > span { top: 14px; font-size: 10px; }
.book-project-fields > p { margin: -3px 0 0; color: var(--muted); font-size: 8px; line-height: 1.45; }
.project-capture-fields { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 9px 14px; padding: 14px; border: 1px solid rgba(22,138,173,.16); border-radius: 16px; background: rgba(22,138,173,.035); }
.project-capture-fields > span { display: grid; gap: 2px; }
.project-capture-fields > span small { color: #168aad; font-size: 7px; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.project-capture-fields > span strong { font-size: 11px; }
.project-capture-links { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 5px; }
.project-capture-chip { display: inline-flex; align-items: center; gap: 5px; padding: 5px 8px; border-radius: 999px; color: #126f8d; background: rgba(22,138,173,.09); font-size: 8px; font-weight: 720; }
.project-capture-chip::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.project-capture-empty { color: var(--muted); font-size: 8px; }
.form-error { margin: -5px 0 0; padding: 10px 12px; border-radius: 10px; color: #853c3c; background: rgba(179,67,67,.08); font-size: 13px; line-height: 1.4; }
.choice-fieldset { padding: 0; border: 0; }
.choice-fieldset legend { margin-bottom: 9px; font-size: 13px; font-weight: 750; }
.segmented-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.segmented-choice label { cursor: pointer; }
.segmented-choice input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.segmented-choice label > span { min-height: 58px; display: grid; align-content: center; gap: 2px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.5); font-size: 12px; font-weight: 780; transition: border-color .2s, background .2s, box-shadow .2s; }
.segmented-choice small { color: var(--muted); font-size: 9px; font-weight: 500; }
.segmented-choice input:checked + span { border-color: var(--green); background: rgba(23,107,77,.07); box-shadow: 0 0 0 2px rgba(23,107,77,.08); }

.button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 18px;
  border: 0;
  border-radius: 13px;
  font-size: 14px;
  font-weight: 760;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, opacity .18s ease, background .18s ease;
}
.button:hover { transform: translateY(-1px); }
.button:active { transform: translateY(0); }
.button:disabled { opacity: .42; cursor: not-allowed; transform: none; }
.button-primary { color: white; background: var(--green); box-shadow: 0 8px 22px rgba(23,107,77,.2); }
.button-primary:hover { background: #105f43; box-shadow: 0 10px 25px rgba(23,107,77,.25); }
.button-dark { color: white; background: var(--ink); }
.button-light { color: var(--ink); background: white; }
.button-quiet { border: 1px solid var(--line); background: transparent; }
.button-danger { color: var(--danger); background: rgba(179,67,67,.08); }
.button-wide { width: 100%; margin-top: 4px; }
.button-small { min-height: 38px; padding: 0 14px; font-size: 13px; border-radius: 11px; }
.local-note { margin: 24px 0 0; color: var(--muted); text-align: center; font-size: 12px; }
.local-note span { color: var(--green-bright); margin-right: 5px; }

.avatar-picker { display: flex; align-items: center; gap: 14px; padding: 12px; border: 1px dashed rgba(19,35,29,.19); border-radius: 16px; cursor: pointer; transition: background .2s; }
.avatar-picker:hover { background: rgba(255,255,255,.42); }
.avatar-picker > span:nth-child(2) { display: grid; gap: 4px; }
.avatar-picker strong { font-size: 13px; }
.avatar-picker small { color: var(--muted); font-size: 11px; }
.avatar-picker input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.avatar { display: grid; flex: 0 0 auto; place-items: center; width: 42px; height: 42px; border-radius: 50%; color: white; background: var(--green); background-position: center; background-size: cover; font-size: 14px; font-weight: 800; text-transform: uppercase; }
.avatar-large { width: 58px; height: 58px; font-size: 18px; }
.avatar-placeholder { color: var(--green); background: rgba(23,107,77,.1); font-size: 24px; font-weight: 400; }

.app-view { min-height: 100vh; min-height: 100dvh; padding-bottom: calc(128px + env(safe-area-inset-bottom, 0)); }
.app-header {
  position: relative;
  z-index: 10;
  min-height: 96px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  padding: 20px clamp(24px, 4vw, 64px);
  border-bottom: 1px solid var(--line);
  background: rgba(243,241,234,.76);
  backdrop-filter: blur(18px);
}
.brand-compact { justify-self: start; }
.header-actions { justify-self: end; display: flex; align-items: center; gap: 12px; }
.stats-button { height: 40px; display: inline-flex; align-items: center; gap: 7px; padding: 0 12px; border: 1px solid var(--line); border-radius: 12px; color: var(--muted); background: rgba(255,255,255,.45); font-size: 12px; font-weight: 750; cursor: pointer; }
.stats-button:hover { color: var(--ink); background: white; }
.stats-button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.profile-button { padding: 0; border: 0; border-radius: 50%; background: transparent; cursor: pointer; }
.profile-button .avatar { box-shadow: 0 0 0 3px var(--paper), 0 0 0 4px var(--line); }

.header-center { justify-self: center; display: grid; justify-items: center; gap: 5px; }
.mode-switch { display: flex; padding: 2px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.5); }
.mode-switch button { min-width: 58px; height: 24px; padding: 0 10px; border: 0; border-radius: 999px; color: var(--muted); background: transparent; font-size: 9px; font-weight: 780; cursor: pointer; transition: color .2s, background .2s, box-shadow .2s; }
.mode-switch button.is-active { color: white; background: var(--ink); box-shadow: 0 3px 10px rgba(19,35,29,.16); }
.day-nav { display: grid; grid-template-columns: 36px minmax(150px, auto) 36px; align-items: center; gap: 6px; }
.icon-button { width: 38px; height: 38px; display: grid; place-items: center; padding: 0; border: 1px solid transparent; border-radius: 50%; background: transparent; cursor: pointer; }
.icon-button:hover { border-color: var(--line); background: rgba(255,255,255,.5); }
.icon-button:disabled { opacity: .2; cursor: default; }
.icon-button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.date-button { display: grid; gap: 2px; padding: 4px 12px; border: 0; background: transparent; cursor: pointer; }
.date-button span { font-size: 14px; font-weight: 780; }
.date-button small { color: var(--muted); font-size: 10px; text-transform: capitalize; }

.dashboard { width: min(1260px, calc(100% - 48px)); margin: 0 auto; }
.dashboard-heading { max-width: 660px; margin: 52px auto 24px; text-align: center; }
.dashboard-heading h1 { margin: 12px 0 14px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(36px, 4.6vw, 54px); font-weight: 500; line-height: 1.05; letter-spacing: -0.052em; }
.dashboard-heading > p:last-child { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.5; }

.finance-overview { width: min(1040px, 100%); display: grid; gap: 10px; margin: 28px auto 22px; padding: 14px; border: 1px solid rgba(23,107,77,.13); border-radius: 20px; background: rgba(255,255,252,.62); box-shadow: 0 18px 55px rgba(19,35,29,.055); backdrop-filter: blur(12px); }
.finance-overview-main { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.finance-balance-card, .finance-budget-card { min-width: 0; display: grid; gap: 3px; padding: 13px 15px; border-radius: 15px; color: white; background: linear-gradient(135deg, #13231d, #1d4335); }
.finance-budget-card { color: var(--ink); background: rgba(23,107,77,.075); }
.finance-balance-card > span, .finance-budget-card > span { color: #a9e9cc; font-size: 7px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.finance-budget-card > span { color: var(--green); }
.finance-balance-card strong, .finance-budget-card strong { overflow: hidden; font-family: Georgia, "Times New Roman", serif; font-size: 25px; font-weight: 500; line-height: 1.05; text-overflow: ellipsis; white-space: nowrap; }
.finance-balance-card small { color: rgba(255,255,255,.52); font-size: 8px; }
.finance-budget-card small { color: var(--muted); font-size: 8px; }
.finance-balance-card.is-empty { color: var(--ink); background: rgba(19,35,29,.045); }
.finance-balance-card.is-empty > span { color: var(--muted); }
.finance-balance-card.is-empty small { color: var(--muted); }
.finance-bank-actions { display: flex; align-items: center; justify-content: flex-end; gap: 7px; }
.balances-only-badge { margin-right: auto; display: inline-flex; align-items: center; gap: 6px; color: var(--green); font-size: 8px; font-weight: 760; }
.balances-only-badge i { width: 7px; height: 7px; border-radius: 50%; background: var(--green-bright); box-shadow: 0 0 0 4px rgba(56,173,127,.1); }
.finance-connections { display: flex; flex-wrap: wrap; gap: 6px; }
.finance-connections > span { display: inline-flex; align-items: center; gap: 7px; padding: 4px 5px 4px 9px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,.45); }
.finance-connections small { color: var(--muted); font-size: 7px; }
.finance-accounts { display: grid; gap: 5px; padding-top: 9px; border-top: 1px solid var(--line); }
.finance-account-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 9px; padding: 7px 9px; border-radius: 11px; background: rgba(19,35,29,.025); }
.finance-account-row > i { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 8px; color: white; background: var(--green); font-size: 8px; font-style: normal; font-weight: 800; text-transform: uppercase; }
.finance-account-row > span { min-width: 0; display: grid; gap: 1px; }
.finance-account-row strong { overflow: hidden; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.finance-account-row small { color: var(--muted); font-size: 7px; }
.finance-account-row b { font-size: 10px; font-variant-numeric: tabular-nums; }
.finance-connection-error { margin: 0; padding: 8px 10px; border-radius: 9px; color: #853c3c; background: rgba(179,67,67,.07); font-size: 8px; }
.treasury-forecast-panel { display: grid; gap: 12px; margin-top: 4px; padding: 17px; border-radius: 17px; background: linear-gradient(145deg, rgba(255,255,255,.7), rgba(23,107,77,.035)); }
.treasury-panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.treasury-panel-heading h2 { margin: 3px 0 0; font-family: Georgia, "Times New Roman", serif; font-size: 24px; font-weight: 500; letter-spacing: -.035em; }
.treasury-panel-actions { display: flex; gap: 6px; }
.treasury-kpis { display: grid; grid-template-columns: 1fr 1fr .8fr; gap: 8px; }
.treasury-kpi { min-width: 0; display: grid; gap: 3px; padding: 12px 13px; border: 1px solid rgba(23,107,77,.1); border-radius: 13px; background: rgba(23,107,77,.06); }
.treasury-kpi > span { color: var(--green); font-size: 7px; font-weight: 820; letter-spacing: .09em; text-transform: uppercase; }
.treasury-kpi strong { overflow: hidden; font-family: Georgia, "Times New Roman", serif; font-size: 23px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.treasury-kpi small { color: var(--muted); font-size: 7px; line-height: 1.35; }
.treasury-kpi.is-quiet { background: rgba(19,35,29,.035); }
.treasury-kpi.is-alert { border-color: rgba(179,67,67,.16); background: rgba(179,67,67,.06); }
.treasury-kpi.is-alert > span, .treasury-kpi.is-alert strong { color: var(--danger); }
.treasury-timeline { overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.48); }
.treasury-timeline-row { display: grid; grid-template-columns: minmax(90px, .9fr) minmax(90px, .8fr) minmax(105px, 1fr) minmax(105px, 1fr); align-items: center; gap: 9px; padding: 8px 11px; border-top: 1px solid rgba(19,35,29,.065); font-size: 8px; font-variant-numeric: tabular-nums; }
.treasury-timeline-row:first-child { border-top: 0; }
.treasury-timeline-row > strong, .treasury-timeline-row > b { text-align: right; }
.treasury-timeline-row > b { color: var(--green); }
.treasury-timeline-head { color: var(--muted); background: rgba(19,35,29,.035); font-size: 7px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.treasury-timeline-head > span:nth-last-child(-n+2) { text-align: right; }
.treasury-timeline-row.is-alert > b { color: var(--danger); }
.treasury-net { color: var(--muted); }
.treasury-net.is-positive { color: var(--green); }
.treasury-net.is-negative { color: var(--danger); }
.treasury-panel-footer { display: grid; gap: 9px; }
.treasury-panel-footer > small { color: var(--muted); font-size: 7px; line-height: 1.45; }
.treasury-upcoming { display: flex; flex-wrap: wrap; gap: 5px; }
.treasury-upcoming > span { display: grid; grid-template-columns: auto auto; gap: 0 5px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 9px; background: rgba(255,255,255,.55); }
.treasury-upcoming i { grid-row: 1 / 3; align-self: center; width: 18px; height: 18px; display: grid; place-items: center; border-radius: 6px; color: white; background: var(--danger); font-size: 10px; font-style: normal; font-weight: 800; }
.treasury-upcoming i.income { background: var(--green); }
.treasury-upcoming b { font-size: 7px; }
.treasury-upcoming small { color: var(--muted); font-size: 6px; }
.treasury-empty-note { margin: 0; padding: 8px 10px; border: 1px dashed rgba(23,107,77,.18); border-radius: 10px; color: var(--muted); font-size: 8px; }

.rings-orbit {
  position: relative;
  width: min(620px, calc(100vh - 340px), 100%);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  margin: -12px auto 0;
  isolation: isolate;
}
.rings-canvas { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.project-ring { --ring-color: var(--green); cursor: pointer; outline: none; animation: ring-arrival .75s backwards cubic-bezier(.18,.8,.2,1); }
.project-ring > circle, .project-ring > path { transition: opacity .3s ease, stroke-width .3s ease, filter .3s ease; }
.orbit-track, .orbit-progress-shadow, .orbit-progress { fill: none; }
.orbit-track { stroke: color-mix(in srgb, var(--ring-color) 13%, transparent); }
.orbit-track, .orbit-progress { pointer-events: stroke; }
.orbit-progress-shadow {
  stroke: color-mix(in srgb, var(--ring-color) 22%, transparent);
  stroke-linecap: round;
  filter: blur(8px);
}
.orbit-progress {
  stroke: var(--ring-color);
  stroke-linecap: round;
  filter: drop-shadow(0 5px 7px color-mix(in srgb, var(--ring-color) 24%, transparent));
  transition: stroke-dashoffset .8s cubic-bezier(.2,.75,.25,1), opacity .3s ease, stroke-width .3s ease, filter .3s ease;
}
.orbit-shine { fill: none; stroke: rgba(255,255,255,.28); stroke-linecap: round; pointer-events: none; }
.orbit-end {
  fill: white;
  stroke: var(--ring-color);
  filter: drop-shadow(0 3px 7px color-mix(in srgb, var(--ring-color) 50%, transparent));
  pointer-events: none;
  transition: opacity .3s, r .3s;
}
.orbit-particles { pointer-events: none; transition: opacity .3s ease; }
.orbit-particle {
  fill: var(--ring-color);
  opacity: .28;
  filter: drop-shadow(0 0 5px color-mix(in srgb, var(--ring-color) 72%, transparent));
  transform-box: fill-box;
  transform-origin: center;
  animation: particle-erosion var(--particle-duration) var(--particle-delay) infinite ease-in-out;
}
.completion-layer, .completion-burst { pointer-events: none; }
.completion-layer { opacity: 0; transition: opacity .6s ease, filter .35s ease; }
.project-ring.is-completed .completion-layer { opacity: 1; }
.orbit-facet {
  fill: rgba(255,255,255,.1);
  stroke: rgba(255,255,255,.2);
  stroke-width: .55;
  mix-blend-mode: screen;
}
.orbit-facet:nth-child(3n) { fill: color-mix(in srgb, var(--ring-color) 74%, white); opacity: .18; }
.orbit-completion-edge {
  fill: none;
  stroke: color-mix(in srgb, var(--ring-color) 35%, white);
  stroke-width: 2.2;
  stroke-linejoin: bevel;
  opacity: .82;
  filter: drop-shadow(0 0 4px rgba(255,255,255,.68));
}
.orbit-crack {
  fill: none;
  stroke: color-mix(in srgb, var(--ring-color) 24%, #13231d);
  stroke-width: 1.35;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: .82;
  filter: drop-shadow(.7px .7px .25px rgba(255,255,255,.48));
}
.orbit-crack-branch { stroke-width: .85; opacity: .67; }
.orbit-overflow {
  fill: none;
  stroke: rgba(255,255,255,.94);
  stroke-width: 3;
  stroke-linecap: round;
  opacity: 0;
  filter: drop-shadow(0 0 5px white) drop-shadow(0 0 8px var(--ring-color));
  transition: stroke-dashoffset .8s cubic-bezier(.2,.75,.25,1), opacity .35s ease;
}
.project-ring.is-overflowing .orbit-overflow { opacity: .92; }
.completion-burst { opacity: 0; }
.completion-aura {
  fill: none;
  stroke: var(--ring-color);
  stroke-width: 3;
  transform-box: fill-box;
  transform-origin: center;
}
.completion-ray {
  fill: none;
  stroke: var(--ring-color);
  stroke-width: 2.4;
  stroke-linecap: round;
  transform-box: fill-box;
  transform-origin: center;
}
.completion-spark {
  fill: color-mix(in srgb, var(--ring-color) 48%, white);
  filter: drop-shadow(0 0 5px var(--ring-color));
  transform-box: fill-box;
  transform-origin: center;
}
.project-ring.is-celebrating .completion-burst { opacity: 1; }
.project-ring.is-celebrating .completion-aura { animation: completion-aura 1.25s cubic-bezier(.18,.8,.2,1) both; }
.project-ring.is-celebrating .completion-ray { animation: completion-ray .82s var(--burst-delay) cubic-bezier(.12,.72,.24,1) both; }
.project-ring.is-celebrating .completion-spark { animation: completion-spark 1.15s var(--burst-delay) cubic-bezier(.12,.72,.24,1) both; }
.project-ring.is-celebrating .orbit-progress { animation: completion-glow 1.45s cubic-bezier(.2,.75,.2,1) both; }
.project-ring.is-celebrating .orbit-crack { stroke-dasharray: 60; animation: crack-reveal .7s var(--crack-delay, 0s) ease-out both; }
.project-ring.is-running .orbit-progress { animation: running-ring 2.1s ease-in-out infinite; }
.project-ring.is-running.is-celebrating .orbit-progress { animation: completion-glow 1.45s cubic-bezier(.2,.75,.2,1) both; }
.rings-orbit.has-selection .project-ring:not(.is-selected) > circle,
.rings-orbit.has-selection .project-ring:not(.is-selected) > path { opacity: .18; filter: saturate(.4); }
.rings-orbit.has-selection .project-ring:not(.is-selected) .orbit-particles { opacity: .12; }
.rings-orbit.has-selection .project-ring.is-completed:not(.is-selected) .completion-layer { opacity: .13; filter: saturate(.45); }
.project-ring.is-selected .orbit-particles { filter: saturate(1.08); }
.project-ring.is-selected .orbit-track { stroke: color-mix(in srgb, var(--ring-color) 22%, transparent); }
.project-ring.is-selected .orbit-progress { filter: drop-shadow(0 8px 12px color-mix(in srgb, var(--ring-color) 48%, transparent)); }
.project-ring.is-selected .orbit-end { r: 7px; }
.project-ring:focus-visible .orbit-track { stroke: color-mix(in srgb, var(--ring-color) 28%, transparent); }

.rings-core {
  position: relative;
  z-index: 4;
  width: 250px;
  min-height: 220px;
  display: grid;
  place-content: center;
  padding: 22px;
  text-align: center;
  background: transparent;
  pointer-events: none;
  transition: transform .35s cubic-bezier(.2,.8,.2,1);
}
.rings-core button { pointer-events: auto; }
.rings-orbit.has-selection .rings-core { transform: scale(1.035); }
.core-idle { display: grid; justify-items: center; gap: 5px; }
.core-idle-mark { position: relative; width: 47px; height: 47px; margin-bottom: 8px; }
.core-idle-mark span { position: absolute; inset: 0; border: 3px solid var(--green); border-radius: 50%; opacity: .2; }
.core-idle-mark span:nth-child(2) { inset: 8px; opacity: .48; }
.core-idle-mark span:nth-child(3) { inset: 16px; opacity: 1; }
.core-idle strong { font-family: Georgia, "Times New Roman", serif; font-size: 27px; font-weight: 500; letter-spacing: -.04em; }
.core-idle small { max-width: 155px; color: var(--muted); font-size: 11px; line-height: 1.4; }
.core-detail { width: 200px; display: grid; justify-items: center; }
.core-project-label { display: flex; align-items: center; gap: 6px; color: var(--selected-color); font-size: 9px; font-weight: 850; letter-spacing: .13em; text-transform: uppercase; }
.core-project-label::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 4px color-mix(in srgb, currentColor 12%, transparent); }
.core-project-title { width: 196px; margin: 7px 0 0; color: var(--ink); font-size: 16px; line-height: 1.08; letter-spacing: -.025em; overflow-wrap: anywhere; text-wrap: balance; }
.core-project-title.is-long { font-size: 13.5px; line-height: 1.04; }
.core-project-title.is-very-long { font-size: 11.5px; line-height: 1.03; letter-spacing: -.01em; }
.core-percent { margin-top: 2px; font-family: Georgia, "Times New Roman", serif; font-size: 45px; line-height: 1; letter-spacing: -.055em; }
.rings-core.is-completed .core-percent { color: var(--selected-color); text-shadow: 0 5px 18px color-mix(in srgb, var(--selected-color) 22%, transparent); }
.core-achievement { margin-top: 3px; padding: 3px 8px; border: 1px solid color-mix(in srgb, var(--selected-color) 20%, transparent); border-radius: 999px; color: var(--selected-color); background: color-mix(in srgb, var(--selected-color) 7%, transparent); font-size: 7px; font-weight: 850; letter-spacing: .09em; text-transform: uppercase; }
.core-book-status { width: 100%; display: grid; gap: 3px; margin: 5px 0 0; padding: 5px 8px; border: 1px solid color-mix(in srgb, var(--selected-color) 15%, transparent); border-radius: 10px; color: var(--ink); text-align: left; background: color-mix(in srgb, var(--selected-color) 5%, rgba(255,255,255,.75)); cursor: pointer; }
.core-book-status > span { display: block; color: var(--muted); font-size: 8px; }
.core-book-status > span b { color: var(--ink); }
.core-book-status > i { height: 3px; overflow: hidden; border-radius: 99px; background: rgba(19,35,29,.08); }
.core-book-status > i span { display: block; height: 100%; border-radius: inherit; background: var(--selected-color); }
.core-book-status small { overflow: hidden; color: var(--selected-color); font-size: 7px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.core-book-status.is-unconfigured { text-align: center; border-style: dashed; }
.core-time { margin: 5px 0 12px; color: var(--muted); font-size: 11px; }
.core-time b { color: var(--ink); }
.financial-ring.is-over-budget .orbit-track { stroke: rgba(179,67,67,.2); }
.financial-ring.is-over-budget .orbit-progress { stroke: var(--danger); }
.finance-rings-core.is-over-budget { box-shadow: inset 0 0 35px rgba(255,255,255,.85), 0 18px 55px rgba(179,67,67,.12); }
.finance-core-detail { width: 208px; }
.core-money { max-width: 210px; margin-top: 6px; overflow: hidden; color: var(--ink); font-family: Georgia, "Times New Roman", serif; font-size: 31px; line-height: 1; letter-spacing: -.045em; text-overflow: ellipsis; white-space: nowrap; }
.core-money.is-negative { color: var(--danger); }
.core-budget-status { margin-top: 4px; color: var(--selected-color); font-size: 8px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.core-actions { display: grid; grid-template-columns: 1fr 1fr 38px; gap: 6px; width: 100%; }
.core-actions.finance-core-actions { grid-template-columns: repeat(3, 1fr); }
.quick-button, .play-button { height: 42px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.58); font-size: 12px; font-weight: 760; cursor: pointer; transition: background .18s, transform .18s; }
.core-actions .quick-button, .core-actions .play-button { height: 38px; border-radius: 11px; font-size: 10px; }
.core-tools { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 8px; }
.core-tool-button { display: inline-flex; align-items: center; gap: 4px; padding: 0; border: 0; color: var(--muted); background: transparent; font-size: 9px; cursor: pointer; }
.core-tool-button:hover { color: var(--ink); }
.core-tool-button svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.quick-button:hover, .play-button:hover { transform: translateY(-1px); background: white; }
.quick-button:disabled, .core-tool-button:disabled { opacity: .32; cursor: not-allowed; transform: none; }
.play-button { display: grid; place-items: center; color: white; border-color: transparent; background: var(--ring-color); }
.play-button:hover { background: var(--ring-color); filter: brightness(.94); }
.play-button:disabled { opacity: .3; filter: grayscale(.5); cursor: not-allowed; transform: none; }
.play-icon { width: 0; height: 0; margin-left: 2px; border-top: 6px solid transparent; border-bottom: 6px solid transparent; border-left: 9px solid currentColor; }
.active-dot { width: 10px; height: 10px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 5px rgba(255,255,255,.22); }
.orbit-instruction { position: absolute; bottom: 4%; left: 50%; color: var(--muted); font-size: 10px; letter-spacing: .05em; transform: translateX(-50%); transition: opacity .25s; }
.rings-orbit.has-selection .orbit-instruction { opacity: 0; }
@keyframes running-ring { 50% { filter: drop-shadow(0 8px 16px color-mix(in srgb, var(--ring-color) 60%, transparent)); } }
@keyframes ring-arrival { from { opacity: 0; } }
@keyframes completion-aura {
  0% { opacity: 0; transform: scale(.92); stroke-width: 8; }
  24% { opacity: .78; }
  100% { opacity: 0; transform: scale(1.13); stroke-width: .5; }
}
@keyframes completion-ray {
  0% { opacity: 0; transform: translate(0, 0) scale(.3); }
  22% { opacity: .9; }
  100% { opacity: 0; transform: translate(var(--burst-x), var(--burst-y)) scale(1); }
}
@keyframes completion-spark {
  0% { opacity: 0; transform: translate(0, 0) scale(.3); }
  20% { opacity: 1; }
  72% { opacity: .72; }
  100% { opacity: 0; transform: translate(var(--burst-x), var(--burst-y)) scale(.1); }
}
@keyframes completion-glow {
  0% { filter: drop-shadow(0 5px 7px color-mix(in srgb, var(--ring-color) 24%, transparent)); }
  30% { filter: brightness(1.28) drop-shadow(0 0 10px white) drop-shadow(0 0 25px var(--ring-color)); }
  100% { filter: drop-shadow(0 5px 7px color-mix(in srgb, var(--ring-color) 24%, transparent)); }
}
@keyframes crack-reveal { from { opacity: 0; stroke-dashoffset: 60; } to { stroke-dashoffset: 0; } }
@keyframes particle-erosion {
  0%, 100% { opacity: .1; transform: translate(0, 0) scale(.72); }
  38% { opacity: var(--particle-peak); transform: translate(var(--drift-mid-x), var(--drift-mid-y)) scale(1); }
  78% { opacity: .06; transform: translate(var(--drift-x), var(--drift-y)) scale(.45); }
}

.empty-state { width: min(520px, 100%); margin: 0 auto; padding: 48px 32px; border: 1px dashed rgba(19,35,29,.18); border-radius: 32px; text-align: center; background: rgba(255,255,255,.42); }
.empty-ring { width: 108px; height: 108px; display: grid; place-items: center; margin: 0 auto 24px; border: 12px solid rgba(23,107,77,.13); border-radius: 50%; }
.empty-ring span { color: var(--green); font-size: 34px; font-weight: 300; }
.empty-state h2 { margin: 0 0 10px; font-family: Georgia, "Times New Roman", serif; font-size: 30px; font-weight: 500; }
.empty-state p { max-width: 390px; margin: 0 auto 24px; color: var(--muted); font-size: 14px; line-height: 1.55; }

.timer-dock {
  position: fixed;
  z-index: 30;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom, 0));
  width: min(620px, calc(100% - 32px));
  min-height: 72px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
  padding: 12px 14px 12px 20px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 22px;
  color: white;
  background: rgba(19,35,29,.94);
  box-shadow: 0 18px 55px rgba(19,35,29,.3);
  backdrop-filter: blur(18px);
  transform: translateX(-50%);
}
.timer-project { min-width: 0; display: flex; align-items: center; gap: 12px; }
.timer-project > span:last-child { min-width: 0; display: grid; }
.timer-project small { color: rgba(255,255,255,.58); font-size: 10px; text-transform: uppercase; letter-spacing: .1em; }
.timer-project strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.timer-pulse { width: 10px; height: 10px; flex: 0 0 auto; border-radius: 50%; background: var(--timer-color, var(--green-bright)); box-shadow: 0 0 0 6px color-mix(in srgb, var(--timer-color, var(--green-bright)) 18%, transparent); animation: pulse 1.8s infinite; }
.timer-dock time { font-variant-numeric: tabular-nums; font-size: 24px; font-weight: 650; letter-spacing: -.02em; }
.timer-actions { justify-self: end; display: flex; gap: 8px; }
.timer-actions .button-quiet { color: rgba(255,255,255,.7); border-color: rgba(255,255,255,.12); }
.stop-icon { width: 9px; height: 9px; border-radius: 2px; background: currentColor; }
@keyframes pulse { 50% { box-shadow: 0 0 0 10px transparent; } }

.modal {
  width: min(520px, calc(100% - 32px));
  padding: 0;
  border: 1px solid rgba(255,255,255,.7);
  border-radius: 28px;
  color: var(--ink);
  background: var(--surface-solid);
  box-shadow: 0 35px 100px rgba(19,35,29,.22);
}
.modal::backdrop { background: rgba(19,35,29,.34); backdrop-filter: blur(7px); }
.modal form { padding: 28px; }
.modal-content { padding: 28px; }
.install-web-app-intro { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 14px; margin-bottom: 20px; padding: 14px; border-radius: 17px; background: rgba(23,107,77,.06); }
.install-web-app-intro img { width: 72px; height: 72px; border-radius: 17px; box-shadow: 0 8px 22px rgba(19,35,29,.16); }
.install-web-app-intro > span { display: grid; gap: 4px; }
.install-web-app-intro strong { font-size: 13px; }
.install-web-app-intro small { color: var(--muted); font-size: 10px; line-height: 1.45; }
.install-web-app-steps { display: grid; gap: 9px; margin: 0; padding: 0; list-style: none; }
.install-web-app-steps li { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 10px; }
.install-web-app-steps li > span { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 9px; color: var(--green); background: rgba(23,107,77,.08); font-size: 10px; font-weight: 800; }
.install-web-app-steps p, .install-web-app-browser { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.install-web-app-steps strong, .install-web-app-browser strong { color: var(--ink); }
.install-web-app-browser { padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.6); }
.install-web-app-note { margin-top: 17px; }
.modal-small { width: min(480px, calc(100% - 32px)); }
#passwordDialog[open] {
  position: fixed;
  z-index: 1000;
  top: 50%;
  left: 50%;
  max-height: calc(100vh - 32px);
  margin: 0;
  overflow: auto;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 100vmax rgba(19,35,29,.34), 0 35px 100px rgba(19,35,29,.22);
}
.project-modal { width: min(620px, calc(100% - 32px)); max-height: min(920px, calc(100vh - 28px)); overflow: auto; }
.treasury-modal { width: min(760px, calc(100% - 32px)); max-height: min(900px, calc(100vh - 28px)); overflow: auto; }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.modal-header h2 { font-size: 31px; }
.modal-actions { display: flex; align-items: center; gap: 8px; margin-top: 28px; }
.modal-spacer { flex: 1; }
.color-fieldset { padding: 0; border: 0; }
.color-fieldset legend { margin-bottom: 11px; }
.color-choices { display: flex; gap: 11px; }
.color-choices label { cursor: pointer; }
.color-choices input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.color-choices span { display: block; width: 34px; height: 34px; border: 7px solid white; border-radius: 50%; background: var(--swatch); box-shadow: 0 0 0 1px var(--line); transition: transform .18s, box-shadow .18s; }
.color-choices input:checked + span { transform: scale(1.1); box-shadow: 0 0 0 2px var(--ink); }

.treasury-method-note { padding: 13px 14px; border: 1px solid rgba(23,107,77,.14); border-radius: 15px; background: rgba(23,107,77,.045); }
.treasury-method-note strong { font-size: 11px; }
.treasury-method-note p { margin: 4px 0 0; color: var(--muted); font-size: 9px; line-height: 1.45; }
.checkbox-row { display: grid !important; grid-template-columns: auto 1fr; align-items: center; gap: 11px; padding: 12px 13px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.48); cursor: pointer; }
.checkbox-row input { width: 18px; height: 18px; accent-color: var(--green); }
.checkbox-row.hidden { display: none !important; }
.checkbox-row > span { display: grid; gap: 2px; }
.checkbox-row strong { font-size: 10px; }
.checkbox-row small { color: var(--muted); font-size: 8px; line-height: 1.4; }
.treasury-settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.treasury-settings-grid > label, .cashflow-date-grid > label { display: grid; gap: 7px; }
.treasury-settings-grid label > span:first-child, .cashflow-date-grid label > span:first-child { font-size: 9px; font-weight: 750; }
.treasury-settings-grid input, .treasury-settings-grid select, .cashflow-date-grid input, .cashflow-date-grid select { height: 43px; border-radius: 11px; font-size: 10px; }
.treasury-settings-grid .input-with-suffix > span { top: 13px; font-size: 10px; }
.cashflow-rules-editor { display: grid; gap: 10px; padding-top: 3px; }
.compact-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.compact-heading h3 { margin: 3px 0 0; font-size: 13px; }
.cashflow-rules-list { display: grid; gap: 6px; }
.cashflow-rule-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 9px; padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.5); }
.cashflow-rule-row > i { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 9px; color: white; background: var(--danger); font-size: 15px; font-style: normal; }
.cashflow-rule-row.income > i { background: var(--green); }
.cashflow-rule-row > span { min-width: 0; display: grid; gap: 2px; }
.cashflow-rule-row > span strong { overflow: hidden; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.cashflow-rule-row > span small { overflow: hidden; color: var(--muted); font-size: 7px; text-overflow: ellipsis; white-space: nowrap; }
.cashflow-rule-row > b { color: var(--danger); font-size: 9px; font-variant-numeric: tabular-nums; }
.cashflow-rule-row.income > b { color: var(--green); }
.cashflow-rules-empty { padding: 15px; border: 1px dashed rgba(23,107,77,.18); border-radius: 13px; text-align: center; }
.cashflow-rules-empty strong { font-size: 10px; }
.cashflow-rules-empty p { margin: 4px auto 0; max-width: 380px; color: var(--muted); font-size: 8px; line-height: 1.45; }
.cashflow-direction-fieldset { padding: 0; border: 0; }
.cashflow-direction-fieldset legend { margin-bottom: 8px; font-size: 13px; font-weight: 750; }
.cashflow-direction-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.cashflow-direction-choices label { cursor: pointer; }
.cashflow-direction-choices input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.cashflow-direction-choices span { display: grid; place-items: center; min-height: 43px; border: 1px solid var(--line); border-radius: 12px; color: var(--muted); background: rgba(255,255,255,.5); font-size: 10px; font-weight: 750; }
.cashflow-direction-choices input:checked + span { color: white; border-color: var(--green); background: var(--green); }
.cashflow-direction-choices label:last-child input:checked + span { border-color: var(--danger); background: var(--danger); }
.cashflow-date-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cashflow-date-grid > label:last-child { grid-column: 1 / -1; }

.bank-modal { width: min(720px, calc(100% - 32px)); max-height: min(820px, calc(100vh - 28px)); overflow: auto; }
.bank-consent-note { display: grid; grid-template-columns: auto 1fr; gap: 12px; margin-bottom: 17px; padding: 14px; border: 1px solid rgba(23,107,77,.14); border-radius: 16px; background: rgba(23,107,77,.05); }
.bank-consent-note > span { width: 37px; height: 37px; display: grid; place-items: center; border-radius: 12px; color: white; background: var(--green); font-family: Georgia, "Times New Roman", serif; font-size: 19px; }
.bank-consent-note strong { font-size: 11px; }
.bank-consent-note p { margin: 4px 0 0; color: var(--muted); font-size: 9px; line-height: 1.45; }
.bank-not-configured { padding: 16px; border-radius: 15px; color: white; background: var(--ink); }
.bank-not-configured strong { font-size: 12px; }
.bank-not-configured p { margin: 6px 0 12px; color: rgba(255,255,255,.62); font-size: 9px; line-height: 1.5; }
.bank-not-configured code { display: block; overflow: auto; padding: 9px 10px; border-radius: 9px; color: #a9e9cc; background: rgba(0,0,0,.18); font-size: 8px; white-space: nowrap; }
.bank-search { display: grid; gap: 7px; }
.bank-search > span { font-size: 11px; font-weight: 750; }
.bank-institutions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 12px; }
.bank-institution { min-width: 0; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 9px; padding: 9px; border: 1px solid var(--line); border-radius: 13px; color: var(--ink); text-align: left; background: rgba(255,255,255,.55); cursor: pointer; transition: border-color .2s, background .2s, transform .2s; }
.bank-institution:hover { border-color: rgba(23,107,77,.25); background: white; transform: translateY(-1px); }
.bank-institution > span { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; color: var(--green); background: rgba(23,107,77,.09); font-size: 8px; font-weight: 850; text-transform: uppercase; }
.bank-institution strong { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.bank-institution small { color: var(--green); font-size: 8px; }
.bank-institution:disabled { opacity: .58; cursor: wait; transform: none; }
.bank-modal .stats-loading { min-height: 150px; }

.categories-modal { max-height: min(720px, calc(100vh - 32px)); overflow: auto; }
.category-create-form { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 0 !important; }
.category-create-form .button { height: 52px; }
.categories-list { display: grid; gap: 7px; margin-top: 20px; }
.category-row { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 6px; padding: 7px 7px 7px 13px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.48); }
.category-row input { height: 38px; padding: 0 8px; border: 0; background: transparent; }
.category-row input:focus { box-shadow: none; }
.category-row button { width: 34px; height: 34px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 9px; color: var(--muted); background: transparent; cursor: pointer; }
.category-row button:hover { color: var(--ink); background: white; }
.category-row button[data-delete-category]:hover { color: var(--danger); }
.category-row svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.category-row.is-system { grid-template-columns: auto 1fr auto; padding: 11px 12px; border-color: rgba(23,107,77,.15); background: rgba(23,107,77,.045); }
.category-system-mark { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 9px; color: white; background: var(--green); }
.category-system-mark svg { width: 15px; height: 15px; }
.category-system-copy { min-width: 0; display: grid; gap: 2px; }
.category-system-copy strong { font-size: 12px; }
.category-system-copy small { color: var(--muted); font-size: 8px; }
.category-system-badge { padding: 4px 7px; border-radius: 999px; color: var(--green); background: rgba(23,107,77,.09); font-size: 7px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.category-note { margin: 14px 0 0; color: var(--muted); font-size: 10px; line-height: 1.45; }

.stats-modal { width: min(1060px, calc(100% - 32px)); max-height: min(900px, calc(100vh - 28px)); overflow: auto; }
.stats-header { margin-bottom: 18px; }
.stats-periods { display: inline-flex; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 13px; background: var(--paper); }
.stats-periods button { height: 34px; padding: 0 13px; border: 0; border-radius: 9px; color: var(--muted); background: transparent; font-size: 11px; font-weight: 750; cursor: pointer; }
.stats-periods button.is-active { color: var(--ink); background: white; box-shadow: 0 4px 12px rgba(19,35,29,.07); }
.stats-loading { min-height: 320px; display: grid; place-items: center; color: var(--muted); font-size: 13px; }
.stats-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 20px; }
.stat-summary-card { min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: 17px; background: linear-gradient(145deg, white, rgba(243,241,234,.55)); }
.stat-summary-card small { color: var(--muted); font-size: 9px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.stat-summary-card strong { display: block; margin-top: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: Georgia, "Times New Roman", serif; font-size: 23px; font-weight: 500; letter-spacing: -.04em; }
.stat-summary-card > span { display: block; margin-top: 3px; overflow: hidden; color: var(--muted); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.reading-projection { position: relative; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 18px; margin-top: 10px; padding: 20px; overflow: hidden; border-radius: 19px; color: white; background: linear-gradient(130deg, #173d30, #176b4d); box-shadow: 0 15px 35px rgba(23,107,77,.15); }
.reading-projection::after { content: ""; position: absolute; width: 180px; height: 180px; right: -45px; top: -80px; border: 1px solid rgba(255,255,255,.12); border-radius: 50%; box-shadow: 0 0 0 24px rgba(255,255,255,.035), 0 0 0 52px rgba(255,255,255,.025); pointer-events: none; }
.reading-projection-copy { position: relative; z-index: 1; }
.reading-projection-copy > small { color: #a9e9cc; font-size: 8px; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; }
.reading-projection-copy h3 { margin: 5px 0 3px; font-size: 17px; }
.reading-projection-copy p { max-width: 570px; margin: 0; color: rgba(255,255,255,.65); font-size: 10px; line-height: 1.5; }
.reading-projection-value { position: relative; z-index: 1; min-width: 145px; text-align: right; }
.reading-projection-value strong { display: block; font-family: Georgia, "Times New Roman", serif; font-size: 39px; font-weight: 500; line-height: .95; letter-spacing: -.05em; }
.reading-projection-value span { color: rgba(255,255,255,.68); font-size: 9px; }
.reading-projection .button { position: relative; z-index: 1; color: var(--ink); background: white; }
.reading-library { margin-top: 10px; padding: 18px; border: 1px solid var(--line); border-radius: 19px; background: rgba(255,255,255,.56); }
.reading-library-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.reading-library-heading small { color: var(--green); font-size: 8px; font-weight: 780; letter-spacing: .1em; text-transform: uppercase; }
.reading-library-heading h3 { margin: 4px 0 0; font-size: 15px; }
.reading-library-summary { display: grid; grid-template-columns: auto auto; align-items: baseline; gap: 6px; text-align: right; }
.reading-library-summary strong { font-family: Georgia, "Times New Roman", serif; font-size: 31px; font-weight: 500; line-height: 1; }
.reading-library-summary span { max-width: 125px; color: var(--muted); font-size: 8px; line-height: 1.3; }
.reading-library-list { display: grid; gap: 7px; margin-top: 14px; }
.reading-library-book { display: grid; grid-template-columns: 4px minmax(0, 1fr) auto auto auto; align-items: center; gap: 13px; padding: 10px 12px 10px 0; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.55); }
.reading-library-book > i { align-self: stretch; border-radius: 0 5px 5px 0; background: var(--book-color); }
.reading-library-book > span { display: grid; gap: 2px; }
.reading-library-book span > small { color: var(--muted); font-size: 7px; }
.reading-library-book span > strong { font-size: 9px; white-space: nowrap; }
.reading-library-title { min-width: 0; }
.reading-library-title > strong { overflow: hidden; font-size: 11px !important; text-overflow: ellipsis; white-space: nowrap; }
.reading-library-empty { min-height: 76px; display: flex; align-items: center; justify-content: center; gap: 11px; padding: 12px; color: var(--muted); text-align: left; }
.reading-library-empty > span { font-family: Georgia, "Times New Roman", serif; color: var(--green); font-size: 30px; }
.reading-library-empty p { max-width: 390px; margin: 0; font-size: 9px; line-height: 1.45; }
.stats-chart-card, .stats-list-card { padding: 18px; border: 1px solid var(--line); border-radius: 19px; background: rgba(255,255,255,.55); }
.stats-chart-card { margin-top: 10px; }
.stats-section-heading-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.stats-section-heading h3 { margin: 0; font-size: 14px; }
.stats-section-heading p { margin: 3px 0 0; color: var(--muted); font-size: 10px; }
.stats-chart-key { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 8px; white-space: nowrap; }
.stats-chart-key i { width: 7px; height: 7px; border-radius: 2px; background: var(--green); box-shadow: 9px 0 #6b5cff, 18px 0 #ef6a5b; margin-right: 18px; }
.stats-chart { height: 190px; margin-top: 14px; }
.stats-chart svg { width: 100%; height: 100%; overflow: visible; }
.chart-grid-line { stroke: rgba(19,35,29,.07); stroke-width: 1; }
.chart-bar { fill: var(--green); opacity: .82; transition: opacity .2s; }
.chart-bar-segment { opacity: .88; }
.chart-bar:hover { opacity: 1; }
.chart-label { fill: var(--muted); font-size: 8px; text-anchor: middle; }
.chart-value { fill: var(--ink); font-size: 8px; text-anchor: middle; opacity: 0; }
.chart-group:hover .chart-value { opacity: 1; }
.stats-distribution-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(310px, .9fr); gap: 10px; margin-top: 10px; }
.stats-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.stats-category-distribution { display: grid; grid-template-columns: 156px minmax(0, 1fr); align-items: center; gap: 22px; margin-top: 16px; }
.stats-donut { display: grid; place-items: center; min-height: 148px; }
.stats-donut-ring { width: 144px; height: 144px; display: grid; place-items: center; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(19,35,29,.04), 0 12px 30px rgba(19,35,29,.08); }
.stats-donut-ring > div, .stats-donut-empty { width: 92px; height: 92px; display: grid; place-content: center; border-radius: 50%; text-align: center; background: #fbfaf6; box-shadow: 0 0 0 1px rgba(19,35,29,.05); }
.stats-donut-ring strong, .stats-donut-empty span { font-family: Georgia, "Times New Roman", serif; font-size: 20px; font-weight: 500; letter-spacing: -.04em; }
.stats-donut-ring small, .stats-donut-empty small { margin-top: 2px; color: var(--muted); font-size: 8px; }
.stats-bars { display: grid; gap: 12px; min-width: 0; }
.stat-distribution-row { display: grid; grid-template-columns: 8px minmax(0, 1fr) auto; align-items: center; gap: 3px 8px; }
.stat-distribution-dot { width: 8px; height: 8px; grid-row: 1; border-radius: 50%; background: var(--distribution-color); }
.stat-distribution-row > span { min-width: 0; display: grid; gap: 1px; }
.stat-distribution-row > span > strong { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.stat-distribution-row > span > small { color: var(--muted); font-size: 7px; }
.stat-distribution-value { justify-items: end; }
.stat-distribution-value > strong { font-family: Georgia, "Times New Roman", serif; font-size: 13px !important; font-weight: 500; }
.stat-distribution-row > .stat-bar-track { grid-column: 2 / -1; }
.stat-bar-track { height: 6px; margin-top: 6px; overflow: hidden; border-radius: 99px; background: rgba(19,35,29,.07); }
.stat-bar-fill { height: 100%; border-radius: inherit; background: var(--bar-color); }
.stats-weekdays { height: 178px; display: grid; grid-template-columns: repeat(7, minmax(25px, 1fr)); align-items: end; gap: 5px; margin-top: 12px; }
.stat-weekday { min-width: 0; display: grid; grid-template-rows: 18px 108px 14px 12px; align-items: end; justify-items: center; gap: 2px; }
.stat-weekday > span { max-width: 100%; overflow: hidden; color: var(--muted); font-size: 7px; text-overflow: ellipsis; white-space: nowrap; }
.stat-weekday > div { width: 100%; height: 100%; display: flex; align-items: flex-end; overflow: hidden; border-radius: 7px; background: rgba(23,107,77,.055); }
.stat-weekday > div i { width: 100%; min-height: 2px; border-radius: 7px 7px 4px 4px; background: linear-gradient(180deg, #2b8a67, var(--green)); }
.stat-weekday > strong { font-size: 8px; text-transform: capitalize; }
.stat-weekday > small { color: var(--muted); font-size: 7px; }
.stats-daily-distribution, .stats-sources { display: grid; gap: 12px; margin-top: 17px; }
.stat-band-row { display: grid; grid-template-columns: minmax(110px, 1fr) minmax(90px, 1.15fr) 28px; align-items: center; gap: 10px; }
.stat-band-row > span { min-width: 0; display: flex; align-items: baseline; justify-content: space-between; gap: 5px; }
.stat-band-row > span strong { overflow: hidden; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.stat-band-row > span small { color: var(--muted); font-size: 7px; white-space: nowrap; }
.stat-band-row > .stat-bar-track { margin: 0; }
.stat-band-row > strong { font-size: 9px; text-align: right; }
.stat-source-row { display: grid; grid-template-columns: 9px minmax(0, 1fr) auto; align-items: center; gap: 9px; }
.stat-source-row > span { min-width: 0; display: grid; gap: 2px; }
.stat-source-row > span strong { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.stat-source-row > span small { color: var(--muted); font-size: 7px; }
.stat-source-row > strong { font-size: 10px; }
.stat-source-dot { width: 9px; height: 9px; border-radius: 3px; background: #9d8f75; }
.stat-source-timer { background: var(--green); }
.stat-source-capture { border-radius: 50%; background: #168aad; }
.stat-source-manual { background: #c79542; transform: rotate(45deg); }
.stats-project-card { margin-top: 10px; }
.stats-projects { display: grid; gap: 0; max-height: 390px; margin-top: 12px; overflow: auto; }
.stat-project-row { display: grid; grid-template-columns: 20px 8px minmax(155px, 1.4fr) minmax(120px, 1fr) auto; align-items: center; gap: 10px; min-height: 52px; border-top: 1px solid rgba(19,35,29,.07); font-size: 11px; }
.stat-project-row:first-child { border-top: 0; }
.stat-project-rank { color: var(--muted); font-family: Georgia, "Times New Roman", serif; font-size: 13px; text-align: right; }
.stat-project-dot { width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50%; background: var(--project-color); }
.stat-project-name { min-width: 0; display: grid; gap: 2px; }
.stat-project-name > strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat-project-name > small { overflow: hidden; color: var(--muted); font-size: 7px; text-overflow: ellipsis; white-space: nowrap; }
.stat-project-share { display: grid; grid-template-columns: minmax(70px, 1fr) 38px; align-items: center; gap: 7px; }
.stat-project-share .stat-bar-track { margin: 0; }
.stat-project-share small { color: var(--muted); font-size: 7px; text-align: right; }
.stat-project-row > strong { font-size: 10px; white-space: nowrap; }
.stats-empty { padding: 26px 8px; color: var(--muted); text-align: center; font-size: 11px; }

.capture-modal { width: min(1080px, calc(100% - 32px)); max-height: min(920px, calc(100vh - 28px)); overflow: auto; }
.capture-guide { margin-top: 18px; padding: 20px; border: 1px solid rgba(22,138,173,.18); border-radius: 20px; background: linear-gradient(135deg, rgba(22,138,173,.07), rgba(255,255,255,.56)); }
.capture-guide-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.capture-guide-heading > div { display: grid; justify-items: start; gap: 4px; }
.capture-guide-heading h3 { margin: 0; font-size: 18px; }
.capture-guide-heading p { max-width: 650px; margin: 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.capture-guide-badge { padding: 4px 7px; border-radius: 999px; color: #126f8d; background: rgba(22,138,173,.1); font-size: 7px; font-weight: 820; letter-spacing: .09em; text-transform: uppercase; }
.capture-guide-badge.is-ready { color: var(--green); background: rgba(23,107,77,.1); }
.capture-guide-badge.is-warning { color: #9a6812; background: rgba(245,166,35,.13); }
.capture-guide-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 16px 0 0; padding: 0; list-style: none; counter-reset: capture-step; }
.capture-guide-step { position: relative; min-width: 0; display: grid; grid-template-columns: auto 1fr; align-items: start; gap: 8px; padding: 11px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.6); counter-increment: capture-step; }
.capture-guide-step::before { content: counter(capture-step); width: 23px; height: 23px; display: grid; place-items: center; border-radius: 50%; color: var(--muted); background: var(--paper); font-size: 8px; font-weight: 800; }
.capture-guide-step.is-done::before { content: "✓"; color: white; background: var(--green); }
.capture-guide-step.is-current { border-color: rgba(22,138,173,.28); box-shadow: inset 0 0 0 1px rgba(22,138,173,.06); }
.capture-guide-step.is-current::before { color: white; background: #168aad; }
.capture-guide-step > span { min-width: 0; display: grid; gap: 3px; }
.capture-guide-step strong { font-size: 9px; }
.capture-guide-step small { color: var(--muted); font-size: 7px; line-height: 1.35; }
.capture-guide-links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 11px; }
.capture-guide-link { display: inline-flex; align-items: center; gap: 6px; padding: 6px 9px; border-radius: 999px; color: var(--green); background: rgba(23,107,77,.08); font-size: 8px; font-weight: 730; }
.capture-guide-link::before { content: "✓"; font-size: 8px; }
.capture-guide-help { margin-top: 12px; border-top: 1px solid var(--line); }
.capture-guide-help summary, .capture-advanced-help summary { padding-top: 11px; color: var(--green); font-size: 9px; font-weight: 760; cursor: pointer; }
.capture-guide-help ol { display: grid; gap: 7px; margin: 9px 0 0; padding-left: 19px; color: var(--muted); font-size: 9px; line-height: 1.45; }
.capture-guide-help code { padding: 2px 4px; border-radius: 4px; color: var(--ink); background: rgba(19,35,29,.06); font-size: 8px; }
.capture-grid { display: grid; grid-template-columns: .85fr 1.15fr; gap: 10px; margin-top: 10px; }
.capture-source-stats, .capture-links-list, .capture-devices-list { display: grid; gap: 7px; margin-top: 14px; }
.capture-source-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 9px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.48); }
.capture-source-icon { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 9px; color: #126f8d; background: rgba(22,138,173,.09); font-size: 10px; font-weight: 820; text-transform: uppercase; }
.capture-source-copy { min-width: 0; display: grid; gap: 2px; }
.capture-source-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.capture-source-copy small { overflow: hidden; color: var(--muted); font-size: 7px; text-overflow: ellipsis; white-space: nowrap; }
.capture-source-time { display: grid; gap: 2px; text-align: right; }
.capture-source-time strong { font-size: 10px; }
.capture-source-time small { color: var(--green); font-size: 7px; }
.capture-link-row, .capture-device-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.48); }
.capture-link-row > span, .capture-device-row > span { min-width: 0; display: grid; gap: 2px; }
.capture-link-row strong, .capture-device-row strong { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.capture-link-row small, .capture-device-row small { overflow: hidden; color: var(--muted); font-size: 7px; text-overflow: ellipsis; white-space: nowrap; }
.capture-link-row button, .capture-device-row button { width: 28px; height: 28px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 8px; color: var(--muted); background: transparent; cursor: pointer; }
.capture-link-row button:hover, .capture-device-row button:hover { color: var(--danger); background: rgba(179,67,67,.06); }
.capture-inline-form { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr) auto; gap: 6px; margin-top: 12px; padding: 0 !important; }
.capture-inline-form select, .capture-add-source input, .capture-add-source select, .capture-device-form input, .capture-device-form select { height: 40px; min-width: 0; padding: 0 9px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: rgba(255,255,255,.72); font-size: 9px; }
.capture-inline-form .button, .capture-add-source .button, .capture-device-form .button { min-height: 40px; }
.capture-add-source { margin-top: 9px; border-top: 1px solid var(--line); }
.capture-add-source summary { padding: 11px 2px 4px; color: var(--green); font-size: 9px; font-weight: 750; cursor: pointer; }
.capture-add-source form { display: grid; grid-template-columns: .75fr 1fr 1fr .9fr auto; gap: 6px; padding: 7px 0 0 !important; }
.capture-setup-card { margin-top: 10px; padding: 18px; border-radius: 19px; color: white; background: linear-gradient(132deg, #13231d, #1d4335); }
.capture-setup-card .stats-section-heading p { color: rgba(255,255,255,.52); }
.ios-renewal-controls { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 9px; margin-top: 13px; }
.ios-renewal-status { display: flex; align-items: center; gap: 11px; min-height: 42px; padding: 11px 13px; border: 1px solid rgba(255,255,255,.1); border-radius: 13px; background: rgba(0,0,0,.12); }
.ios-renewal-controls .button { min-height: 42px; }
.ios-renewal-status > span:last-child { min-width: 0; display: grid; gap: 2px; }
.ios-renewal-status strong { font-size: 9px; }
.ios-renewal-status small { color: rgba(255,255,255,.5); font-size: 7px; line-height: 1.35; }
.ios-renewal-dot { width: 9px; height: 9px; flex: 0 0 auto; border-radius: 50%; background: #f5a623; box-shadow: 0 0 0 5px rgba(245,166,35,.12); }
.ios-renewal-status.is-healthy .ios-renewal-dot { background: #55d69e; box-shadow: 0 0 0 5px rgba(85,214,158,.12); }
.ios-renewal-status.is-waiting .ios-renewal-dot { animation: pulse 1.8s infinite; }
.capture-setup-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 14px; }
.capture-device-form { display: grid; grid-template-columns: 1fr .65fr auto; align-content: start; gap: 6px; padding: 0 !important; }
.capture-device-row { border-color: rgba(255,255,255,.1); background: rgba(255,255,255,.045); }
.capture-device-row small { color: rgba(255,255,255,.48); }
.capture-device-row button { color: rgba(255,255,255,.46); }
.capture-token-panel { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; margin-top: 14px; padding: 12px; border: 1px solid rgba(169,233,204,.22); border-radius: 13px; background: rgba(169,233,204,.08); }
.capture-token-panel > span { display: grid; gap: 2px; }
.capture-token-panel small { color: #a9e9cc; font-size: 7px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.capture-token-panel strong { font-size: 10px; }
.capture-token-panel code { min-width: 0; overflow: hidden; color: white; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; user-select: all; }
.capture-onboarding { display: grid; grid-template-columns: .8fr 1.2fr; align-items: center; gap: 7px 13px; margin-top: 15px; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.1); }
.capture-onboarding > span { display: grid; gap: 2px; }
.capture-onboarding strong { font-size: 9px; }
.capture-onboarding small { color: rgba(255,255,255,.5); font-size: 7px; line-height: 1.35; }
.capture-onboarding code { overflow: auto; padding: 7px 9px; border-radius: 8px; color: #a9e9cc; background: rgba(0,0,0,.16); font-size: 8px; white-space: nowrap; }
.capture-advanced-help { margin-top: 13px; border-top: 1px solid rgba(255,255,255,.1); }
.capture-advanced-help summary { color: #a9e9cc; }

.reading-modal { width: min(760px, calc(100% - 32px)); max-height: min(900px, calc(100vh - 28px)); overflow: auto; }
.reading-header { margin-bottom: 18px; }
.reading-process { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin: 0; padding: 0; list-style: none; }
.reading-process li { position: relative; display: grid; grid-template-columns: auto 1fr; gap: 1px 8px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 13px; background: rgba(243,241,234,.45); }
.reading-process li > span { grid-row: 1 / 3; width: 25px; height: 25px; display: grid; place-items: center; border-radius: 50%; color: var(--green); background: rgba(23,107,77,.09); font-size: 9px; font-weight: 750; }
.reading-process strong { font-size: 10px; }
.reading-process small { color: var(--muted); font-size: 8px; }
.reading-profile-card { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 20px; margin-top: 10px; padding: 17px 19px; border-radius: 17px; color: white; background: var(--ink); }
.reading-profile-card > div { display: grid; grid-template-columns: auto auto; align-items: baseline; gap: 0 7px; }
.reading-profile-card small { grid-column: 1 / -1; color: #a9e9cc; font-size: 8px; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; }
.reading-profile-card strong { font-family: Georgia, "Times New Roman", serif; font-size: 38px; font-weight: 500; line-height: 1; }
.reading-profile-card span { color: rgba(255,255,255,.55); font-size: 8px; }
.reading-profile-card p { margin: 0; color: rgba(255,255,255,.66); font-size: 10px; line-height: 1.5; }
.reading-method, .reading-measures { margin-top: 18px; }
.reading-method h3, .reading-section-heading h3 { margin: 0; font-size: 13px; }
.reading-method > p { margin: 5px 0 12px; color: var(--muted); font-size: 9px; line-height: 1.5; }
.reading-sample-form { display: grid; grid-template-columns: 1.2fr .8fr; gap: 9px; padding: 0 !important; }
.reading-sample-form > label { display: grid; gap: 6px; }
.reading-sample-form label > span { font-size: 10px; font-weight: 700; }
.reading-stopwatch { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 10px 10px 10px 14px; border: 1px solid var(--line); border-radius: 14px; background: rgba(243,241,234,.45); }
.reading-stopwatch > span { display: grid; }
.reading-stopwatch small { color: var(--muted); font-size: 7px; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; }
.reading-stopwatch time { font-size: 21px; font-weight: 500; font-variant-numeric: tabular-nums; letter-spacing: -.03em; }
.reading-stopwatch .button { min-width: 160px; }
.reading-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.reading-section-heading small { color: var(--muted); font-size: 8px; }
.reading-samples-list { display: grid; gap: 6px; margin-top: 9px; }
.reading-sample-row { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 10px; padding: 9px 9px 9px 12px; border: 1px solid var(--line); border-radius: 12px; }
.reading-sample-row > span { min-width: 0; display: grid; gap: 1px; }
.reading-sample-row strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.reading-sample-row small { color: var(--muted); font-size: 8px; }
.reading-sample-speed { color: var(--green); font-size: 10px; font-weight: 750; }
.reading-sample-row button { width: 29px; height: 29px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 8px; color: var(--muted); background: transparent; cursor: pointer; }
.reading-sample-row button:hover { color: var(--danger); background: rgba(179,67,67,.06); }
.reading-sample-row svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.book-size-form { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 14px; margin-top: 18px; padding: 13px !important; border: 1px solid var(--line); border-radius: 14px; background: rgba(243,241,234,.4); }
.book-size-form > span:first-child { display: grid; gap: 2px; }
.book-size-form strong { font-size: 10px; }
.book-size-form small { color: var(--muted); font-size: 8px; }
.book-size-control { display: flex; gap: 6px; }
.book-size-control input { width: 118px; height: 38px; }
.book-size-control .button { height: 38px; }

.book-progress-meta { margin: 5px 0 0; color: var(--muted); font-size: 9px; line-height: 1.4; }
.book-session-estimate { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; padding: 13px; border-radius: 15px; color: white; background: var(--ink); }
.book-session-estimate > span { display: grid; gap: 3px; }
.book-session-estimate small { color: #a9e9cc; font-size: 7px; font-weight: 780; letter-spacing: .09em; text-transform: uppercase; }
.book-session-estimate strong { font-size: 14px; }
.book-session-estimate p { grid-column: 1 / -1; margin: 3px 0 0; color: rgba(255,255,255,.62); font-size: 8px; line-height: 1.45; }
.book-progress-card { display: grid; gap: 9px; padding: 15px; border: 1px solid rgba(23,107,77,.14); border-radius: 16px; background: rgba(23,107,77,.045); }
.book-progress-line { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: 11px; }
.book-progress-line strong { color: var(--green); font-family: Georgia, "Times New Roman", serif; font-size: 25px; font-weight: 500; }
.book-progress-track { height: 7px; overflow: hidden; border-radius: 99px; background: rgba(23,107,77,.1); }
.book-progress-track span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #174f3c, #38ad7f); transition: width .25s ease; }
.book-progress-card p { margin: 0; color: var(--muted); font-size: 9px; line-height: 1.5; }
.book-page-update { display: grid; gap: 8px; margin-top: 18px; }
.book-page-update > span { font-size: 12px; font-weight: 750; }
.book-progress-actions { align-items: stretch; }
.book-progress-actions .button-dark { padding: 0 13px; font-size: 11px; }

.toast {
  position: fixed;
  z-index: 100;
  left: 50%;
  top: calc(20px + env(safe-area-inset-top, 0));
  max-width: calc(100% - 32px);
  padding: 12px 17px;
  border-radius: 13px;
  color: white;
  background: var(--ink);
  box-shadow: 0 10px 35px rgba(19,35,29,.2);
  font-size: 13px;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -15px);
  transition: opacity .22s, transform .22s;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 900px) {
  .auth-view { grid-template-columns: 1fr; padding: calc(16px + env(safe-area-inset-top, 0)) max(16px, env(safe-area-inset-right, 0)) calc(16px + env(safe-area-inset-bottom, 0)) max(16px, env(safe-area-inset-left, 0)); }
  .auth-intro { min-height: 390px; padding: 24px 28px; }
  .auth-message { margin: auto 0 20px; }
  .auth-message h1 { font-size: clamp(42px, 10vw, 66px); }
  .sample-rings { position: absolute; right: 24px; bottom: 18px; opacity: .38; }
  .sample-ring-one { width: 82px; height: 82px; border-width: 10px; }
  .sample-ring-two { width: 102px; height: 102px; border-width: 10px; }
  .sample-ring-three { display: none; }
  .auth-panel-wrap { padding: 62px 20px; }
  .auth-tabs { margin-bottom: 38px; }
}

@media (max-width: 720px) {
  .app-view { padding-bottom: calc(150px + env(safe-area-inset-bottom, 0)); }
  .app-header { min-height: 82px; grid-template-columns: 1fr auto; padding: calc(16px + env(safe-area-inset-top, 0)) max(18px, env(safe-area-inset-right, 0)) 16px max(18px, env(safe-area-inset-left, 0)); }
  .brand-compact > span:last-child { display: none; }
  .header-center { grid-column: 1 / -1; grid-row: 2; margin-top: 4px; }
  .day-nav { grid-column: 1 / -1; grid-row: 2; justify-self: center; margin-top: 4px; }
  .header-actions { grid-column: 2; grid-row: 1; }
  .header-actions .button { width: 42px; padding: 0; font-size: 0; }
  .header-actions .button span { font-size: 22px; font-weight: 400; }
  .stats-button { width: 42px; justify-content: center; padding: 0; }
  .stats-button span { display: none; }
  .dashboard { width: min(100% - 28px, 620px); }
  .dashboard-heading { margin: 48px auto 34px; }
  .dashboard-heading h1 { font-size: 35px; }
  .finance-overview { margin-top: 0; }
  .finance-overview-main { grid-template-columns: 1fr; }
  .finance-bank-actions { flex-wrap: wrap; justify-content: stretch; }
  .balances-only-badge { width: 100%; margin-bottom: 3px; }
  .finance-bank-actions .button { flex: 1; }
  .treasury-panel-heading { display: grid; }
  .treasury-panel-actions { width: 100%; }
  .treasury-panel-actions .button { flex: 1; }
  .treasury-kpis { grid-template-columns: 1fr; }
  .treasury-timeline { overflow-x: auto; }
  .treasury-timeline-row { min-width: 520px; }
  .treasury-settings-grid, .cashflow-date-grid { grid-template-columns: 1fr; }
  .cashflow-date-grid > label:last-child { grid-column: auto; }
  .cashflow-rule-row { grid-template-columns: auto minmax(0, 1fr) auto; }
  .cashflow-rule-row > b { grid-column: 2; }
  .cashflow-rule-row > button { grid-column: 3; grid-row: 1 / 3; }
  .rings-orbit { width: min(100%, 500px); margin-top: -8px; }
  .rings-core { width: 174px; min-height: 164px; padding: 12px; }
  .core-idle-mark { width: 35px; height: 35px; margin-bottom: 4px; }
  .core-idle-mark span:nth-child(2) { inset: 6px; }
  .core-idle-mark span:nth-child(3) { inset: 12px; }
  .core-idle strong { font-size: 21px; }
  .core-idle small { max-width: 125px; font-size: 9px; }
  .core-detail { width: 152px; }
  .core-project-label { font-size: 7px; }
  .core-project-title { width: 148px; margin-top: 4px; font-size: 12px; }
  .core-project-title.is-long { font-size: 10.5px; }
  .core-project-title.is-very-long { font-size: 9.2px; }
  .core-percent { font-size: 37px; }
  .core-book-status { gap: 2px; margin-top: 3px; padding: 4px 6px; }
  .core-book-status > span { font-size: 7px; }
  .core-book-status small { font-size: 6px; }
  .core-time { margin: 3px 0 8px; font-size: 9px; }
  .core-actions { grid-template-columns: 1fr 1fr 32px; gap: 4px; }
  .core-actions .quick-button, .core-actions .play-button { width: auto; height: 32px; min-height: 32px; border-radius: 9px; font-size: 9px; }
  .core-tools { gap: 9px; margin-top: 5px; }
  .core-tool-button { font-size: 8px; }
  .core-tool-button svg { width: 10px; height: 10px; }
  .orbit-instruction { bottom: 1%; }
  .timer-dock { grid-template-columns: 1fr auto; gap: 8px 16px; padding: 13px 14px; }
  .timer-dock time { justify-self: end; font-size: 21px; }
  .timer-actions { grid-column: 1 / -1; width: 100%; }
  .timer-actions .button { flex: 1; }
  .modal form { padding: 22px; }
  .modal-content { padding: 22px; }
  .modal-actions { flex-wrap: wrap; }
  .profile-modal-actions .button-danger { order: 4; width: 100%; margin-top: 10px; }
  .recovery-codes-list { grid-template-columns: 1fr; }
  .stats-summary { grid-template-columns: 1fr 1fr; }
  .stats-distribution-grid, .stats-detail-grid { grid-template-columns: 1fr; }
  .stat-project-row { grid-template-columns: 18px 8px minmax(0, 1fr) auto; padding: 9px 0; }
  .stat-project-share { grid-column: 3 / -1; }
  .stat-project-row > strong { grid-column: 4; grid-row: 1; }
  .capture-grid, .capture-setup-grid { grid-template-columns: 1fr; }
  .capture-guide-steps { grid-template-columns: 1fr 1fr; }
  .capture-add-source form { grid-template-columns: 1fr 1fr; }
  .capture-add-source form .button { grid-column: 1 / -1; }
  .capture-token-panel { grid-template-columns: 1fr auto; }
  .capture-token-panel code { grid-column: 1 / -1; grid-row: 2; }
  .stats-periods { width: 100%; }
  .stats-periods button { flex: 1; padding: 0 7px; }
  .reading-projection { grid-template-columns: 1fr; }
  .reading-projection-value { text-align: left; }
  .reading-library-heading { align-items: flex-start; }
  .reading-library-summary { grid-template-columns: 1fr; gap: 1px; }
  .reading-library-book { grid-template-columns: 4px minmax(0, 1fr) auto; gap: 9px; }
  .reading-library-book > span:nth-last-child(-n+2) { display: none; }
  .reading-process { grid-template-columns: 1fr; }
  .reading-profile-card { grid-template-columns: 1fr; gap: 8px; }
  .reading-sample-form { grid-template-columns: 1fr; }
  .reading-stopwatch { grid-column: 1; }
  .book-size-form { grid-template-columns: 1fr; }
  .book-size-control input { flex: 1; width: auto; }
  .book-project-grid { grid-template-columns: 1fr; }
  .book-density-field { grid-column: 1; }
  .book-progress-actions .button-dark { order: 4; width: 100%; margin-top: 5px; }
}

@media (max-width: 520px) {
  .stats-section-heading-row { display: grid; }
  .stats-category-distribution { grid-template-columns: 1fr; gap: 10px; }
  .stats-donut { min-height: 132px; }
  .stats-donut-ring { width: 128px; height: 128px; }
  .stats-donut-ring > div { width: 82px; height: 82px; }
  .bank-institutions { grid-template-columns: 1fr; }
  .capture-inline-form, .capture-device-form, .capture-add-source form, .ios-renewal-controls { grid-template-columns: 1fr; }
  .capture-add-source form .button { grid-column: 1; }
  .capture-onboarding { grid-template-columns: 1fr; }
  .capture-guide-heading { display: grid; }
  .capture-guide-heading .button { justify-self: start; }
  .capture-guide-steps { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .orbit-particle { animation: none !important; opacity: .35; }
}

/* Budget v2 — cockpit mensuel, distinct des anneaux de temps. */
.finance-overview { width: min(1180px, 100%); gap: 0; margin: 36px auto 70px; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; backdrop-filter: none; }
.budget-workspace { display: grid; gap: 18px; }
.budget-hero { position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1.45fr) auto; gap: 28px; padding: 34px; border-radius: 28px; color: white; background: linear-gradient(128deg, #10251d 0%, #174735 58%, #22684b 100%); box-shadow: 0 28px 75px rgba(13, 43, 32, .18); }
.budget-hero::after { position: absolute; right: -75px; top: -115px; width: 330px; height: 330px; border: 1px solid rgba(174, 234, 204, .14); border-radius: 50%; box-shadow: 0 0 0 55px rgba(174, 234, 204, .035), 0 0 0 112px rgba(174, 234, 204, .025); content: ''; pointer-events: none; }
.budget-hero.is-incomplete { background: linear-gradient(128deg, #24342e, #40544c); }
.budget-hero-copy { position: relative; z-index: 1; min-width: 0; }
.budget-confidence { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 25px; padding: 6px 10px; border: 1px solid rgba(185, 239, 213, .22); border-radius: 999px; color: #bcebd4; background: rgba(255,255,255,.06); font-size: 10px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.budget-confidence::before { width: 6px; height: 6px; border-radius: 50%; background: #72d7a8; box-shadow: 0 0 0 4px rgba(114, 215, 168, .12); content: ''; }
.budget-hero-copy > p { margin: 0 0 6px; color: rgba(255,255,255,.62); font-size: 14px; font-weight: 720; }
.budget-hero-copy > strong { display: block; font-family: Georgia, "Times New Roman", serif; font-size: clamp(43px, 6vw, 74px); font-weight: 500; line-height: 1; letter-spacing: -.055em; }
.budget-hero-copy > small { display: block; max-width: 570px; margin-top: 13px; color: rgba(255,255,255,.66); font-size: 13px; line-height: 1.5; }
.budget-plan-gap { max-width: 640px; display: grid; grid-template-columns: auto minmax(0,1fr); align-items: start; gap: 10px; margin-top: 16px; padding: 13px 14px; border: 1px solid rgba(255, 202, 130, .3); border-radius: 14px; color: #fff2dc; background: rgba(120, 62, 12, .22); }
.budget-plan-gap > i { width: 23px; height: 23px; display: grid; place-items: center; border-radius: 50%; color: #5c360a; background: #ffd28f; font-size: 13px; font-style: normal; font-weight: 900; }
.budget-plan-gap > span { display: grid; gap: 4px; }
.budget-plan-gap strong { font-size: 13px; line-height: 1.35; }
.budget-plan-gap small { color: rgba(255,255,255,.76); font-size: 11px; line-height: 1.45; }
.budget-plan-gap em { color: #ffdca8; font-size: 10px; font-style: normal; font-weight: 720; line-height: 1.45; }
.budget-hero-actions { position: relative; z-index: 1; align-self: start; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.button-ghost-light { border-color: rgba(255,255,255,.2); color: white; background: rgba(255,255,255,.07); }
.button-ghost-light:hover { background: rgba(255,255,255,.14); }
.budget-constraints { position: relative; z-index: 1; grid-column: 1 / -1; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 1px; overflow: hidden; margin-top: 5px; border: 1px solid rgba(255,255,255,.12); border-radius: 17px; background: rgba(255,255,255,.06); }
.budget-constraints > span { min-width: 0; display: grid; gap: 5px; padding: 14px 16px; border-left: 1px solid rgba(255,255,255,.1); }
.budget-constraints > span:first-child { border-left: 0; }
.budget-constraints small { color: rgba(255,255,255,.5); font-size: 10px; font-weight: 720; }
.budget-constraints strong { overflow: hidden; font-size: 17px; font-variant-numeric: tabular-nums; text-overflow: ellipsis; white-space: nowrap; }
.budget-constraints .is-negative { color: #ffb9ab; }
.budget-constraints > span.is-cash { background: rgba(255, 196, 92, .1); }
.budget-constraints > span.is-cash small { color: #ffd892; }
.budget-constraints > span.is-cash strong { color: #fff0ce; }

.budget-panel { min-width: 0; padding: 24px; border: 1px solid rgba(23,107,77,.12); border-radius: 23px; background: rgba(255,255,252,.72); box-shadow: 0 16px 48px rgba(19,35,29,.05); backdrop-filter: blur(10px); }
.budget-section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.budget-section-heading h2 { margin: 4px 0 0; font-family: Georgia, "Times New Roman", serif; font-size: 26px; font-weight: 500; letter-spacing: -.035em; }
.budget-section-heading > div > small { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; }
.budget-envelope-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.budget-envelope { display: grid; gap: 14px; padding: 17px; border: 1px solid rgba(19,35,29,.08); border-radius: 17px; background: rgba(255,255,255,.62); transition: transform .2s, border-color .2s, box-shadow .2s; }
.budget-envelope:hover { border-color: color-mix(in srgb, var(--budget-color) 36%, transparent); box-shadow: 0 10px 28px rgba(19,35,29,.06); transform: translateY(-1px); }
.budget-envelope.is-warning { border-color: rgba(226,161,47,.25); }
.budget-envelope.is-over { border-color: rgba(179,67,67,.27); background: rgba(255,249,248,.78); }
.budget-envelope.is-archived { opacity: .68; background: rgba(19,35,29,.025); }
.budget-envelope-heading { min-width: 0; display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 10px; }
.budget-envelope-heading > i { width: 11px; height: 11px; border-radius: 50%; background: var(--budget-color); box-shadow: 0 0 0 5px color-mix(in srgb, var(--budget-color) 13%, transparent); }
.budget-envelope-heading > span { min-width: 0; display: grid; gap: 2px; }
.budget-envelope-heading strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.budget-envelope-heading small { color: var(--muted); font-size: 10px; }
.budget-envelope-available { justify-items: end; text-align: right; }
.budget-envelope-available > small { font-size: 8px; font-weight: 760; letter-spacing: .04em; text-transform: uppercase; }
.budget-envelope-available > b { font-family: Georgia, "Times New Roman", serif; font-size: 20px; font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; }
.budget-envelope-available > b.is-negative { color: var(--danger); }
.budget-envelope-track { height: 7px; overflow: hidden; border-radius: 999px; background: rgba(19,35,29,.07); }
.budget-envelope-track > i { display: block; height: 100%; border-radius: inherit; background: var(--budget-color); transition: width .35s ease; }
.budget-envelope.is-warning .budget-envelope-track > i { background: #df9d2e; }
.budget-envelope.is-over .budget-envelope-track > i { background: var(--danger); }
.budget-envelope.is-dynamic { background: color-mix(in srgb, var(--budget-color) 4%, rgba(255,255,255,.72)); }
.budget-envelope-dynamic-note { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 12px; background: color-mix(in srgb, var(--budget-color) 9%, white); }
.budget-envelope-dynamic-note > span { width: 28px; height: 28px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 9px; color: var(--budget-color); background: white; font-family: Georgia, "Times New Roman", serif; font-size: 17px; }
.budget-envelope-dynamic-note > small { color: var(--muted); font-size: 9px; line-height: 1.4; }
.budget-envelope-daily { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 12px; border-radius: 12px; background: color-mix(in srgb, var(--budget-color) 9%, white); }
.budget-envelope-daily > span { display: grid; gap: 2px; }
.budget-envelope-daily > span small { color: var(--muted); font-size: 8px; font-weight: 760; letter-spacing: .04em; text-transform: uppercase; }
.budget-envelope-daily > span strong { font-family: Georgia, "Times New Roman", serif; font-size: 19px; font-weight: 500; }
.budget-envelope-daily > small { max-width: 175px; color: var(--muted); font-size: 8px; line-height: 1.4; text-align: right; }
.budget-envelope-daily.is-unconfigured { background: rgba(19,35,29,.04); }
.budget-envelope-daily.is-unconfigured > span strong { font-family: inherit; font-size: 11px; font-weight: 750; }
.budget-envelope-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.budget-envelope-footer > span:first-child { color: var(--muted); font-size: 10px; font-variant-numeric: tabular-nums; }
.budget-envelope-footer > span:last-child, .budget-panel-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.budget-archived-label { color: var(--muted); font-size: 9px; font-weight: 750; text-transform: uppercase; }
.budget-empty-panel, .budget-list-empty { display: grid; justify-items: center; gap: 6px; padding: 28px; border: 1px dashed rgba(23,107,77,.2); border-radius: 17px; text-align: center; }
.budget-empty-panel > span { width: 36px; height: 36px; display: grid; place-items: center; margin-bottom: 4px; border-radius: 50%; color: var(--green); background: rgba(23,107,77,.08); font-size: 20px; }
.budget-empty-panel strong, .budget-list-empty strong { font-size: 13px; }
.budget-empty-panel p, .budget-list-empty p { max-width: 440px; margin: 0 0 9px; color: var(--muted); font-size: 11px; line-height: 1.5; }

.budget-dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(330px, .85fr); align-items: start; gap: 18px; }
.budget-side-stack { display: grid; gap: 18px; }
.budget-entry-list { display: grid; }
.budget-entry-row { min-width: 0; display: grid; grid-template-columns: auto minmax(0,1fr) auto auto; align-items: center; gap: 11px; padding: 12px 0; border-top: 1px solid rgba(19,35,29,.07); }
.budget-entry-row:first-child { border-top: 0; padding-top: 2px; }
.budget-entry-row > i { width: 9px; height: 9px; border-radius: 50%; background: var(--budget-color); }
.budget-entry-row > span { min-width: 0; display: grid; gap: 2px; }
.budget-entry-row > span strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.budget-entry-row > span small { color: var(--muted); font-size: 9px; }
.budget-entry-row > b { color: var(--ink); font-size: 12px; font-variant-numeric: tabular-nums; }
.budget-entry-row > b.is-refund { color: var(--green); }
.budget-entry-delete { width: 28px; height: 28px; color: var(--muted); font-size: 18px; }
.budget-entry-delete:hover { color: var(--danger); border-color: rgba(179,67,67,.16); background: rgba(179,67,67,.05); }
.budget-entry-review { font-size: 9px; }
.budget-entry-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.budget-entry-fields > label { display: grid; gap: 7px; }
.budget-entry-fields label > span:first-child { font-size: 9px; font-weight: 750; }
.budget-entry-kind label:last-child input:checked + span { border-color: var(--green); background: var(--green); }

.budget-setup-callout { display: grid; grid-template-columns: auto minmax(0,1fr); gap: 10px 12px; align-items: center; padding: 16px; border-radius: 16px; background: rgba(23,107,77,.055); }
.budget-setup-callout > span { grid-row: 1 / 3; width: 35px; height: 35px; display: grid; place-items: center; border-radius: 12px; color: white; background: var(--green); }
.budget-setup-callout strong { font-size: 12px; }
.budget-setup-callout p { margin: 4px 0 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.budget-setup-callout .button { grid-column: 2; justify-self: start; }
.budget-forecast-summary { display: grid; gap: 13px; }
.budget-low-chart { margin-bottom: 18px; min-width: 0; }
.budget-low-chart-scroll { overflow-x: auto; }
.budget-low-chart svg { display: block; width: 100%; min-width: 480px; max-height: 340px; }
.budget-low-chart svg text { fill: var(--muted); font-size: 11px; }
.budget-low-chart svg line, .budget-low-chart svg path { fill: none; vector-effect: non-scaling-stroke; }
.budget-chart-grid { stroke: var(--line); }
.budget-chart-zoom { display: flex; flex-wrap: wrap; align-items: end; gap: 8px; margin-bottom: 16px; }
.budget-chart-zoom button[aria-pressed="true"] { color: var(--paper, white); background: var(--green); }
.budget-chart-zoom label { display: grid; gap: 4px; color: var(--muted); font-size: 11px; }
.budget-chart-zoom input { min-width: 0; width: 145px; padding: 7px; color: var(--ink); background: transparent; border: 1px solid var(--line); border-radius: 8px; }
.budget-chart-balance { stroke: var(--green); stroke-width: 2; }
.budget-chart-low { stroke: var(--ink); stroke-width: 2.5; stroke-dasharray: 7 4; }
.budget-chart-reserve { stroke: var(--danger); stroke-dasharray: 3 4; }
.budget-chart-plan { stroke: var(--muted); stroke-dasharray: 10 5; }
.budget-chart-minimum { fill: var(--danger); stroke: var(--paper, white); stroke-width: 2; }
.budget-chart-legend { display: flex; flex-wrap: wrap; gap: 10px 18px; color: var(--muted); font-size: 11px; }
.budget-chart-legend span::before { content: ''; display: inline-block; width: 20px; margin-right: 6px; vertical-align: middle; border-top: 2px solid var(--green); }
.budget-chart-legend .low::before { border-top: 2px dashed var(--ink); }
.budget-chart-legend .reserve::before { border-top: 2px dotted var(--danger); }
.budget-chart-legend .plan::before { border-top: 2px dashed var(--muted); }
.budget-chart-interactive { position: relative; }
.budget-chart-hit-area { cursor: crosshair; }
.budget-chart-hit-area:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }
.budget-chart-hover { pointer-events: none; }
.budget-chart-guide { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 4; }
.budget-chart-hover circle { stroke: var(--paper, white); stroke-width: 2; vector-effect: non-scaling-stroke; }
.budget-chart-hover-balance { fill: var(--green); }
.budget-chart-hover-low { fill: var(--ink); }
.budget-chart-detail { position: absolute; z-index: 2; display: grid; gap: 7px; width: 250px; max-width: calc(100% - 16px); padding: 13px 15px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper, white); color: var(--ink); box-shadow: 0 6px 24px rgb(0 0 0 / 12%); pointer-events: none; font-size: 12px; font-variant-numeric: tabular-nums; }
.budget-chart-detail[hidden] { display: none; }
.budget-chart-detail > strong { margin-bottom: 3px; }
.budget-chart-detail > span { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); }
.budget-chart-detail b { color: var(--ink); white-space: nowrap; }
.budget-chart-note { color: var(--muted); font-size: 11px; line-height: 1.6; margin-bottom: 0; }
.budget-point-low { display: grid; gap: 3px; padding: 14px; border-radius: 15px; background: rgba(23,107,77,.055); }
.budget-point-low > span { color: var(--green); font-size: 9px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.budget-point-low strong { font-family: Georgia, "Times New Roman", serif; font-size: 25px; font-weight: 500; }
.budget-point-low small { color: var(--muted); font-size: 9px; }
.budget-point-low.is-alert { background: rgba(179,67,67,.06); }
.budget-point-low.is-alert > span, .budget-point-low.is-alert strong { color: var(--danger); }
.budget-upcoming-list { display: grid; }
.budget-upcoming-list > button { min-width: 0; display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 9px; padding: 9px 0; border: 0; border-top: 1px solid rgba(19,35,29,.065); color: var(--ink); text-align: left; background: transparent; cursor: pointer; }
.budget-upcoming-list > button:first-child { border-top: 0; }
.budget-upcoming-list i { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 8px; color: white; background: var(--danger); font-size: 13px; font-style: normal; }
.budget-upcoming-list i.income { background: var(--green); }
.budget-upcoming-list span { min-width: 0; display: grid; gap: 1px; }
.budget-upcoming-list strong { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.budget-upcoming-list small { color: var(--muted); font-size: 8px; }
.budget-upcoming-list b { font-size: 10px; font-variant-numeric: tabular-nums; }
.budget-history-note, .budget-source-note { margin: 0; padding: 15px; border-radius: 14px; color: var(--muted); background: rgba(19,35,29,.035); font-size: 11px; line-height: 1.5; }
.budget-source-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.budget-source-heading > span:first-child { display: grid; gap: 2px; }
.budget-source-heading small { color: var(--muted); font-size: 9px; }
.budget-source-heading strong { font-size: 12px; }
.budget-liquidity-cards { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 7px; margin-bottom: 15px; }
.budget-liquidity-cards > span { min-width: 0; display: grid; gap: 3px; padding: 12px; border: 1px solid rgba(23,107,77,.1); border-radius: 13px; background: rgba(23,107,77,.045); }
.budget-liquidity-cards small { color: var(--green); font-size: 8px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.budget-liquidity-cards strong { overflow: hidden; font-family: Georgia, "Times New Roman", serif; font-size: 20px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.budget-liquidity-cards em { color: var(--muted); font-size: 7px; font-style: normal; }
.budget-liquidity-cards > span.is-cash { border-color: rgba(200,139,27,.2); background: rgba(255,196,92,.12); }
.budget-liquidity-cards > span.is-cash small { color: #9a6410; }
.budget-sources-panel .finance-accounts { margin-bottom: 12px; padding-top: 0; border-top: 0; }
.budget-sources-panel .finance-account-row { font-size: 11px; }
.bank-review-panel { border-color: rgba(226,161,47,.25); background: rgba(255,252,244,.82); }
.bank-review-list { display: grid; }
.bank-review-row { min-width: 0; display: grid; grid-template-columns: auto minmax(0,1fr) auto auto; align-items: center; gap: 11px; padding: 12px 0; border-top: 1px solid rgba(19,35,29,.07); }
.bank-review-row:first-child { border-top: 0; padding-top: 0; }
.bank-review-row > i { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 9px; color: white; background: var(--danger); font-size: 14px; font-style: normal; font-weight: 800; }
.bank-review-row > i.credit { background: var(--green); }
.bank-review-row > span { min-width: 0; display: grid; gap: 2px; }
.bank-review-row > span strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.bank-review-row > span small { overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.bank-review-row > b { font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bank-review-row > b.is-refund { color: var(--green); }
.bank-review-more { margin: 12px 0 0; color: var(--muted); font-size: 10px; text-align: center; }
.bank-transaction-summary { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 15px; border-radius: 15px; background: rgba(23,107,77,.055); }
.bank-transaction-summary > span { min-width: 0; display: grid; gap: 3px; }
.bank-transaction-summary > span strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.bank-transaction-summary > span small { color: var(--muted); font-size: 9px; }
.bank-transaction-summary > b { font-size: 15px; white-space: nowrap; }
.bank-transaction-summary > b.is-refund { color: var(--green); }
.bank-transaction-upgrade { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 12px 0; padding: 13px; border: 1px solid rgba(23,107,77,.13); border-radius: 14px; background: rgba(23,107,77,.055); }
.bank-transaction-upgrade > span { display: grid; gap: 3px; }
.bank-transaction-upgrade strong { font-size: 10px; }
.bank-transaction-upgrade small { color: var(--muted); font-size: 8px; line-height: 1.4; }
.bank-connection-list { display: grid; margin: 12px 0; border-top: 1px solid rgba(19,35,29,.07); }
.bank-connection-list > span { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid rgba(19,35,29,.07); }
.bank-connection-list > span > span { display: grid; gap: 2px; }
.bank-connection-list strong { font-size: 10px; }
.bank-connection-list small { color: var(--muted); font-size: 8px; }

@media (max-width: 900px) {
  .budget-hero { grid-template-columns: 1fr; }
  .budget-hero-actions { justify-content: flex-start; }
  .budget-constraints { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .budget-constraints > span:nth-child(4) { border-left: 0; }
  .budget-constraints > span:nth-child(n+4) { border-top: 1px solid rgba(255,255,255,.1); }
  .budget-dashboard-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .finance-overview { margin-top: 24px; }
  .budget-hero, .budget-panel { padding: 20px; border-radius: 20px; }
  .budget-hero-copy > strong { font-size: 42px; }
  .budget-hero-actions .button { flex: 1; }
  .budget-envelope-list { grid-template-columns: 1fr; }
  .budget-section-heading { align-items: center; }
  .budget-section-heading h2 { font-size: 23px; }
  .budget-envelope-footer { align-items: flex-start; }
  .budget-entry-fields { grid-template-columns: 1fr; }
  .bank-review-row { grid-template-columns: auto minmax(0,1fr) auto; }
  .bank-review-row > b { grid-column: 2; }
  .bank-review-row > .button { grid-column: 3; grid-row: 1 / 3; }
  .budget-constraints { grid-template-columns: 1fr 1fr; }
  .budget-constraints > span:nth-child(odd) { border-left: 0; }
  .budget-constraints > span:nth-child(even) { border-left: 1px solid rgba(255,255,255,.1); }
  .budget-constraints > span:nth-child(n+3) { border-top: 1px solid rgba(255,255,255,.1); }
}

@media (max-width: 430px) {
  .budget-constraints { grid-template-columns: 1fr; }
  .budget-constraints > span { border-top: 1px solid rgba(255,255,255,.1); border-left: 0; }
  .budget-constraints > span:first-child { border-top: 0; }
  .budget-envelope-heading { grid-template-columns: auto minmax(0,1fr); }
  .budget-envelope-available { grid-column: 2; justify-items: start; text-align: left; }
  .budget-envelope-available > b { font-size: 18px; }
  .budget-envelope-daily { align-items: flex-start; display: grid; }
  .budget-envelope-daily > small { max-width: none; text-align: left; }
  .budget-envelope-footer { display: grid; }
  .budget-liquidity-cards { grid-template-columns: 1fr; }
  .budget-entry-row { grid-template-columns: auto minmax(0,1fr) auto; }
  .budget-entry-row > b { grid-column: 2; }
  .budget-entry-delete { grid-column: 3; grid-row: 1 / 3; }
  .budget-entry-review { grid-column: 3; grid-row: 1 / 3; }
  .bank-transaction-upgrade { align-items: flex-start; display: grid; }
}

/* Audio courses and local transcription */
.audio-overview { width: min(1040px, 100%); margin: 34px auto 72px; }
.audio-workspace { display: grid; gap: 18px; }
.audio-hero { position: relative; display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(220px, .65fr); gap: 32px; align-items: center; overflow: hidden; padding: 34px; border-radius: 28px; color: white; background: radial-gradient(circle at 92% 10%, rgba(77,214,161,.2), transparent 30%), linear-gradient(128deg, #10251d, #174735 58%, #22684b); box-shadow: 0 28px 75px rgba(13,43,32,.18); }
.audio-hero::after { content: ''; position: absolute; inset: auto -50px -90px auto; width: 220px; height: 220px; border: 1px solid rgba(255,255,255,.12); border-radius: 50%; box-shadow: 0 0 0 28px rgba(255,255,255,.025), 0 0 0 58px rgba(255,255,255,.018); }
.audio-hero.is-recording { background: radial-gradient(circle at 88% 14%, rgba(255,122,105,.28), transparent 32%), linear-gradient(128deg, #2a1817, #63332e 60%, #8e443c); }
.audio-hero-copy, .audio-hero-actions { position: relative; z-index: 1; }
.audio-hero-copy h2 { max-width: 640px; margin: 10px 0 12px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(30px, 4vw, 46px); font-weight: 500; line-height: 1.06; letter-spacing: -.045em; }
.audio-hero-copy > p:not(.eyebrow) { max-width: 620px; margin: 0; color: rgba(255,255,255,.73); line-height: 1.55; }
.audio-hero-copy label { display: grid; gap: 7px; max-width: 520px; margin-top: 24px; color: rgba(255,255,255,.64); font-size: 10px; font-weight: 760; text-transform: uppercase; letter-spacing: .08em; }
.audio-hero-copy input { min-height: 48px; padding: 0 15px; border: 1px solid rgba(255,255,255,.18); border-radius: 13px; color: white; background: rgba(255,255,255,.1); outline: none; font: inherit; font-size: 14px; font-weight: 620; letter-spacing: 0; text-transform: none; }
.audio-hero-copy input:focus { border-color: rgba(255,255,255,.55); box-shadow: 0 0 0 3px rgba(255,255,255,.09); }
.audio-hero-copy time { display: block; margin-top: 22px; font-size: clamp(34px, 6vw, 64px); font-weight: 650; font-variant-numeric: tabular-nums; letter-spacing: -.055em; }
.audio-hero-actions { display: grid; gap: 12px; justify-items: stretch; }
.audio-hero-actions .button { min-height: 56px; border: 0; border-radius: 15px; font-size: 12px; font-weight: 780; }
.audio-start-button { color: var(--ink); background: #fff; box-shadow: 0 16px 36px rgba(0,0,0,.18); }
.audio-start-button span { display: inline-block; width: 10px; height: 10px; margin-right: 7px; border-radius: 50%; background: #e9574b; box-shadow: 0 0 0 5px rgba(233,87,75,.12); }
.audio-stop-button { color: white; background: rgba(255,255,255,.16); box-shadow: inset 0 0 0 1px rgba(255,255,255,.24); }
.audio-stop-button span { display: inline-block; width: 10px; height: 10px; margin-right: 7px; border-radius: 2px; background: white; }
.audio-hero-actions small { color: rgba(255,255,255,.6); font-size: 9px; line-height: 1.5; text-align: center; }
.audio-pending-notice { padding: 13px 16px; border: 1px solid rgba(245,166,35,.25); border-radius: 14px; color: #654b1e; background: rgba(255,245,220,.75); font-size: 10px; font-weight: 680; text-align: center; }
.audio-reliability-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.audio-reliability-grid article { padding: 18px; border: 1px solid var(--line); border-radius: 17px; background: rgba(255,255,255,.62); }
.audio-reliability-grid strong { color: var(--green); font-size: 11px; }
.audio-reliability-grid p { margin: 7px 0 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
.audio-library-heading { display: flex; justify-content: space-between; align-items: end; gap: 18px; margin-top: 14px; }
.audio-library-heading h2 { margin: 7px 0 0; font-family: Georgia, "Times New Roman", serif; font-size: 30px; font-weight: 500; letter-spacing: -.04em; }
.audio-library { display: grid; gap: 12px; }
.audio-recording-card { display: grid; gap: 14px; padding: 20px; border: 1px solid var(--line); border-radius: 20px; background: rgba(255,255,255,.72); box-shadow: 0 12px 34px rgba(19,35,29,.045); }
.audio-recording-card.is-processing { border-color: rgba(23,107,77,.25); }
.audio-recording-card.is-failed { border-color: rgba(190,67,56,.25); }
.audio-recording-heading { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; }
.audio-recording-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; color: var(--green); background: rgba(23,107,77,.09); font-size: 10px; font-weight: 800; }
.audio-recording-card.is-failed .audio-recording-icon { color: #b84439; background: rgba(184,68,57,.09); }
.audio-recording-heading > span:nth-child(2) { min-width: 0; display: grid; gap: 4px; }
.audio-recording-heading strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.audio-recording-heading small { overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.audio-recording-heading em { padding: 6px 9px; border-radius: 999px; color: var(--green); background: rgba(23,107,77,.08); font-size: 8px; font-style: normal; font-weight: 780; white-space: nowrap; }
.audio-recording-card.is-failed .audio-recording-heading em { color: #a33c33; background: rgba(184,68,57,.08); }
.audio-recording-card audio { width: 100%; height: 38px; }
.audio-processing-note, .audio-error { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.audio-error { color: #9f3d34; }
.audio-transcript { padding: 14px 16px; border-radius: 14px; background: rgba(23,107,77,.045); }
.audio-transcript summary { cursor: pointer; color: var(--ink); font-size: 10px; font-weight: 750; }
.audio-transcript summary small { margin-left: 7px; color: var(--muted); font-weight: 500; }
.audio-transcript > div { max-height: 320px; margin: 14px 0; overflow: auto; color: #263a32; font-family: Georgia, "Times New Roman", serif; font-size: 13px; line-height: 1.7; white-space: normal; }
.audio-recording-actions { display: flex; justify-content: flex-end; gap: 8px; }
.audio-empty { padding: 40px 20px; border: 1px dashed rgba(23,107,77,.2); border-radius: 20px; text-align: center; background: rgba(255,255,255,.35); }
.audio-empty > span { display: grid; place-items: center; width: 48px; height: 48px; margin: 0 auto 14px; border: 1px solid rgba(23,107,77,.18); border-radius: 50%; color: var(--green); font-size: 24px; }
.audio-empty h3 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: 21px; font-weight: 500; }
.audio-empty p { margin: 8px 0 0; color: var(--muted); font-size: 10px; }
.audio-consent-note { max-width: 760px; margin: 8px auto 0; color: var(--muted); font-size: 9px; line-height: 1.55; text-align: center; }

/* Tâches — capture rapide, priorités lisibles et historique local. */
.tasks-overview { width: min(1040px, 100%); margin: 34px auto 72px; }
.tasks-workspace { display: grid; gap: 18px; }
.tasks-capture { position: relative; display: grid; grid-template-columns: minmax(260px, .8fr) minmax(0, 1.2fr); align-items: end; gap: 30px; overflow: hidden; padding: 30px; border-radius: 27px; color: white; background: radial-gradient(circle at 95% 0%, rgba(91,219,167,.24), transparent 34%), linear-gradient(128deg, #10251d, #174735 60%, #22684b); box-shadow: 0 25px 68px rgba(13,43,32,.17); }
.tasks-capture::after { position: absolute; right: -72px; top: -110px; width: 260px; height: 260px; border: 1px solid rgba(255,255,255,.11); border-radius: 50%; box-shadow: 0 0 0 38px rgba(255,255,255,.025), 0 0 0 78px rgba(255,255,255,.018); content: ''; pointer-events: none; }
.tasks-capture-copy, .todo-quick-form { position: relative; z-index: 1; }
.tasks-capture .eyebrow { color: #8ce2bc; }
.tasks-capture-copy h2 { margin: 8px 0 10px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(27px, 3vw, 38px); font-weight: 500; line-height: 1.07; letter-spacing: -.04em; }
.tasks-capture-copy > p:last-child { max-width: 440px; margin: 0; color: rgba(255,255,255,.64); font-size: 11px; line-height: 1.5; }
.todo-quick-form { display: grid; grid-template-columns: minmax(0, 1fr) 142px 150px auto; align-items: end; gap: 8px; }
.todo-quick-form label { min-width: 0; display: grid; gap: 6px; }
.todo-quick-form label > span { color: rgba(255,255,255,.57); font-size: 8px; font-weight: 780; letter-spacing: .07em; text-transform: uppercase; }
.todo-quick-form input, .todo-quick-form select { height: 47px; min-width: 0; border-color: rgba(255,255,255,.16); border-radius: 12px; color: white; background: rgba(255,255,255,.1); font-size: 11px; }
.todo-quick-form input { padding-inline: 12px; }
.todo-quick-form input::-webkit-calendar-picker-indicator { filter: invert(1); opacity: .66; }
.todo-quick-form input::placeholder { color: rgba(255,255,255,.58); }
.todo-quick-form input:focus, .todo-quick-form select:focus { border-color: rgba(255,255,255,.55); background: rgba(255,255,255,.14); box-shadow: 0 0 0 3px rgba(255,255,255,.08); }
.todo-quick-form select option { color: var(--ink); background: var(--surface-solid); }
.todo-quick-form .button { min-height: 47px; padding-inline: 16px; color: var(--ink); background: white; box-shadow: 0 10px 28px rgba(0,0,0,.14); font-size: 11px; }
.todo-quick-title { grid-column: 1 / -1; }
.todo-quick-title input { font-size: 14px; font-weight: 650; }

.tasks-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); overflow: hidden; border: 1px solid rgba(23,107,77,.12); border-radius: 18px; background: rgba(255,255,252,.68); box-shadow: 0 10px 35px rgba(19,35,29,.04); }
.tasks-summary > span { min-width: 0; display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 15px 18px; border-left: 1px solid var(--line); }
.tasks-summary > span:first-child { border-left: 0; }
.tasks-summary small { color: var(--muted); font-size: 9px; font-weight: 760; letter-spacing: .06em; text-transform: uppercase; }
.tasks-summary strong { font-family: Georgia, "Times New Roman", serif; font-size: 25px; font-weight: 500; }
.tasks-summary .is-active { background: rgba(23,107,77,.045); }
.tasks-summary .is-active small, .tasks-summary .is-active strong { color: var(--green); }
.tasks-summary .is-alert { background: rgba(179,67,67,.045); }
.tasks-summary .is-alert small, .tasks-summary .is-alert strong { color: var(--danger); }

.tasks-board { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 15px; }
.todo-group { min-width: 0; padding: 20px; border: 1px solid rgba(19,35,29,.09); border-radius: 21px; background: rgba(255,255,252,.68); box-shadow: 0 12px 38px rgba(19,35,29,.04); }
.todo-group-overdue { border-color: rgba(179,67,67,.18); background: rgba(255,250,249,.72); }
.todo-group-today { border-color: rgba(23,107,77,.19); }
.todo-group-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 10px; }
.todo-group-heading > span { display: grid; gap: 3px; }
.todo-group-heading h3 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: 23px; font-weight: 500; letter-spacing: -.03em; }
.todo-group-heading small { color: var(--muted); font-size: 8px; }
.todo-group-heading b { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 50%; color: var(--green); background: rgba(23,107,77,.08); font-size: 10px; }
.todo-group-overdue .todo-group-heading b { color: var(--danger); background: rgba(179,67,67,.08); }
.todo-list { display: grid; }
.todo-card { min-width: 0; display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 11px; padding: 13px 2px; border-top: 1px solid rgba(19,35,29,.075); }
.todo-card:first-child { border-top: 0; }
.todo-card.priority-high:not(.is-completed) { box-shadow: inset 2px 0 #d78835; }
.todo-check { width: 24px; height: 24px; display: grid; flex: 0 0 auto; place-items: center; padding: 0; border: 1.5px solid rgba(19,35,29,.2); border-radius: 50%; color: white; background: transparent; font-size: 12px; font-weight: 850; cursor: pointer; transition: border-color .18s, background .18s, transform .18s; }
.todo-check:hover { border-color: var(--green); transform: scale(1.05); }
.todo-card.is-completed .todo-check { border-color: var(--green); background: var(--green); }
.todo-card-body { min-width: 0; display: grid; gap: 5px; padding: 0; border: 0; color: inherit; text-align: left; background: transparent; cursor: pointer; }
.todo-card-body > strong { overflow-wrap: anywhere; font-size: 12px; line-height: 1.4; }
.todo-card-body > p { display: -webkit-box; overflow: hidden; margin: 0; color: var(--muted); font-size: 9px; line-height: 1.45; white-space: pre-line; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.todo-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 9px; color: var(--muted); }
.todo-meta small { display: inline-flex; align-items: center; gap: 5px; font-size: 8px; }
.todo-due.is-overdue { color: var(--danger); font-weight: 760; }
.todo-project i { width: 6px; height: 6px; border-radius: 50%; background: var(--todo-project-color, var(--green)); }
.todo-priority { color: #9b5c16; }
.todo-more { align-self: center; width: 31px; height: 31px; padding: 0 0 6px; border: 0; border-radius: 9px; color: var(--muted); background: transparent; font-size: 13px; letter-spacing: 1px; cursor: pointer; }
.todo-more:hover { color: var(--ink); background: rgba(19,35,29,.05); }
.todo-card.is-completed { opacity: .62; }
.todo-card.is-completed .todo-card-body > strong { text-decoration: line-through; text-decoration-thickness: 1px; }
.todo-completed { padding: 0 20px; border: 1px solid rgba(19,35,29,.09); border-radius: 20px; background: rgba(255,255,252,.48); }
.todo-completed summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 17px 0; color: var(--ink); cursor: pointer; list-style: none; }
.todo-completed summary::-webkit-details-marker { display: none; }
.todo-completed summary > span { font-size: 11px; font-weight: 760; }
.todo-completed summary > small { color: var(--muted); font-size: 9px; }
.todo-completed[open] summary { border-bottom: 1px solid rgba(19,35,29,.075); }
.tasks-all-clear { grid-column: 1 / -1; display: grid; justify-items: center; padding: 48px 24px; border: 1px dashed rgba(23,107,77,.22); border-radius: 22px; text-align: center; background: rgba(255,255,255,.38); }
.tasks-all-clear > span { width: 46px; height: 46px; display: grid; place-items: center; margin-bottom: 13px; border-radius: 50%; color: white; background: var(--green); font-size: 19px; }
.tasks-all-clear h3 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: 25px; font-weight: 500; }
.tasks-all-clear p { max-width: 470px; margin: 8px 0 16px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.todo-dialog-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.todo-dialog-grid > label { display: grid; gap: 8px; }
.todo-dialog-grid label > span:first-child { font-size: 13px; font-weight: 750; }

@media (max-width: 720px) {
  .audio-overview { margin-top: 0; }
  .audio-hero { grid-template-columns: 1fr; padding: 25px; }
  .audio-hero-copy h2 { font-size: 32px; }
  .audio-reliability-grid { grid-template-columns: 1fr; }
  .audio-recording-heading { grid-template-columns: auto minmax(0, 1fr); }
  .audio-recording-heading em { grid-column: 2; justify-self: start; }
  .audio-recording-actions { justify-content: stretch; flex-wrap: wrap; }
  .audio-recording-actions .button { flex: 1; }
  .tasks-overview { margin-top: 0; }
  .tasks-capture { grid-template-columns: 1fr; padding: 25px; }
  .tasks-board { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .todo-quick-form { grid-template-columns: 1fr 1fr; }
  .todo-quick-title, .todo-quick-form .button { grid-column: 1 / -1; }
}

@media (max-width: 430px) {
  .mode-switch button { min-width: 53px; padding-inline: 8px; }
  .audio-hero { padding: 22px 19px; border-radius: 22px; }
  .audio-library-heading { align-items: center; }
  .audio-recording-card { padding: 16px; }
  .mode-switch button { min-width: 48px; padding-inline: 7px; }
  .tasks-capture { padding: 22px 19px; border-radius: 22px; }
  .todo-quick-form { grid-template-columns: 1fr; }
  .todo-quick-title { grid-column: auto; }
  .tasks-summary > span { display: grid; padding: 13px; }
  .tasks-summary strong { font-size: 22px; }
  .todo-group { padding: 17px 15px; }
  .todo-dialog-grid { grid-template-columns: 1fr; }
}


.weekday-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; }
.weekday-choices label { display: flex; align-items: center; gap: 8px; min-height: 44px; cursor: pointer; }
.weekday-choices input { width: 18px; height: 18px; flex: 0 0 18px; }
.masked-ring-settings { margin-top: 18px; }
.masked-ring-settings summary { cursor: pointer; padding-block: 12px; }
.masked-ring-settings .button { display: block; margin-top: 8px; width: 100%; text-align: left; }
