/* Reference-inspired surfaces, circular glyphs and monthly planning. */
.theme-toggle {
  flex-shrink: 0;
}
.quick-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 17px 0 26px;
}
.quick-actions button {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  border-radius: 16px;
  font-size: 13px;
  transition:
    transform 0.2s,
    background 0.2s;
}
.quick-actions button:hover {
  transform: translateY(-2px);
  background: #edf2e5;
}
.quick-actions button > span {
  width: 31px;
  height: 31px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #edf1e6;
  color: #73845e;
}
.quick-actions .glyph {
  height: 18px;
  width: 18px;
}
.category-icon.blue,
.category-icon.orange,
.category-icon.green,
.category-icon.violet {
  background: #edf0e7;
  color: #7d8872;
}
.provider-mark {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}
.provider-mark.custom {
  background: #e8eddf;
  color: #6b7e55;
}
.provider-mark .glyph {
  width: 21px;
  height: 21px;
}
.provider-mark img {
  width: 24px;
  height: 28px;
  object-fit: contain;
}
.provider-glyph {
  display: block;
  width: 22px;
  height: 22px;
  background: currentColor;
  mask-repeat: no-repeat;
  mask-size: contain;
  mask-position: center;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-size: contain;
  -webkit-mask-position: center;
}
.provider-monogram {
  font-family: var(--font-ui);
  font-size: 20px;
  font-weight: 650;
  letter-spacing: -0.8px;
}
.provider-monogram.small {
  font-size: 10px;
  letter-spacing: -0.5px;
}
.provider-wordmark {
  font-size: 8px;
  font-weight: 750;
  color: #fff;
  letter-spacing: -0.4px;
}
.provider-wordmark > span {
  color: #f7a600;
}
.accounts-full .provider-mark {
  width: 43px;
  height: 43px;
}
.accounts-full .provider-wordmark {
  font-size: 9px;
}
.provider-search {
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid #dfe5d7;
  background: #fff;
  border-radius: 13px;
  padding: 11px 13px;
}
.provider-search > .glyph {
  width: 18px;
  height: 18px;
  color: #8b987b;
}
.provider-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: none;
  color: var(--ink);
  font-size: 14px;
}
.provider-search:focus-within {
  border-color: #9cb37f;
  box-shadow: 0 0 0 3px #a5bb7615;
}
.provider-group {
  margin-top: 23px;
}
.provider-group h3 {
  font-size: 12px;
  color: #929b85;
  font-weight: 450;
  margin: 0 0 10px;
}
.provider-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.provider-choice {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  min-height: 57px;
  background: #fff;
  color: var(--ink);
  border: 1px solid #e1e7d9;
  border-radius: 13px;
  text-align: left;
  transition:
    border-color 0.2s,
    background 0.2s,
    transform 0.2s;
}
.provider-choice:hover {
  background: #f2f6e9;
  border-color: #b9cba0;
  transform: translateY(-1px);
}
.provider-choice > .provider-mark {
  width: 32px;
  height: 32px;
}
.provider-choice > span:last-child {
  min-width: 0;
  font-size: 13px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.provider-choice .provider-glyph {
  width: 20px;
  height: 20px;
}
.provider-choice .provider-mark img {
  width: 21px;
  height: 25px;
}
.provider-custom {
  width: 100%;
  margin-top: 23px;
}
.provider-empty {
  padding: 35px 10px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}
.chosen-provider {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #f0f4e8;
  border: 1px solid #e0e8d3;
  border-radius: 15px;
  padding: 15px;
  margin-bottom: 22px;
}
.chosen-provider .provider-mark {
  width: 44px;
  height: 44px;
}
.chosen-provider > div {
  flex: 1;
  min-width: 0;
}
.chosen-provider strong {
  display: block;
  font-size: 15px;
  font-weight: 500;
}
.chosen-provider > div > span {
  display: block;
  font-size: 11px;
  color: #8c9a7b;
  margin-top: 4px;
}
.chosen-provider > .text-button {
  font-size: 12px;
}
.appearance-settings {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 23px;
  margin-bottom: 21px;
}
.appearance-settings h2 {
  font-size: 15px;
  font-weight: 500;
  margin: 0 0 6px;
}
.appearance-settings p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}
.appearance-settings > .field {
  width: 170px;
  flex-shrink: 0;
}
.budget-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.period-tabs {
  display: flex;
  gap: 3px;
  padding: 4px;
  background: #e9eee0;
  border-radius: 24px;
}
.period-tabs button {
  background: none;
  color: #7a8869;
  border-radius: 20px;
  padding: 9px 14px;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.period-tabs button.active {
  color: #334b24;
  background: #fff;
  box-shadow: 0 1px 4px #27371c0a;
}
.period-tabs .glyph {
  height: 16px;
  width: 16px;
}
.planning-summary {
  padding: 25px 28px 20px;
  border: 1px solid #dfe5d6;
  border-radius: 23px;
  background: #fff;
  margin-bottom: 16px;
}
.planning-summary-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}
.planning-kicker {
  color: #949d87;
  font-size: 11px;
}
.planning-summary-header h2 {
  margin: 6px 0 0;
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.5px;
  text-transform: capitalize;
}
.summary-tabs {
  display: flex;
  padding: 4px;
  gap: 3px;
  border: 1px solid #e1e7d7;
  border-radius: 24px;
  background: #f1f5e9;
}
.summary-tabs button {
  font-size: 12px;
  font-weight: 450;
  background: none;
  color: #8b9979;
  padding: 8px 17px;
  border-radius: 20px;
}
.summary-tabs button.active {
  background: #293326;
  color: white;
}
.planning-summary-body {
  display: grid;
  grid-template-columns: 1fr 210px;
  align-items: center;
  gap: 40px;
  padding: 27px 0 23px;
}
.planning-numbers {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.planning-numbers > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 17px;
}
.planning-numbers > div > span {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #929d84;
  font-size: 13px;
}
.planning-numbers .glyph {
  width: 18px;
  height: 18px;
  color: #94a480;
}
.planning-numbers strong {
  font-size: 24px;
  font-weight: 500;
  letter-spacing: -0.8px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.budget-ring {
  width: 190px;
  height: 190px;
  min-width: 190px;
  min-height: 190px;
  aspect-ratio: 1 / 1;
  box-sizing: border-box;
  justify-self: center;
  border-radius: 50%;
  background: conic-gradient(
    from -90deg,
    #b8d38a var(--ring-angle),
    #d8ddd0 var(--ring-angle)
  );
  padding: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: auto;
}
.budget-ring > div {
  width: 100%;
  height: 100%;
  aspect-ratio: 1 / 1;
  flex: 0 0 auto;
  background: #fff;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 7px;
}
.budget-ring strong {
  font-family: var(--font-ui);
  font-size: clamp(15px, calc(41px - var(--figure-length) * 1.9px), 29px);
  letter-spacing: -1px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.budget-ring span {
  color: #9aa58b;
  font-size: 11px;
}
.budget-ring.empty {
  background: #e8edde;
}
.budget-ring.deficit {
  background: #dca89a;
}
.budget-ring.deficit strong {
  color: #b56b56;
}
.planning-summary-footer {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  border-top: 1px solid #ecf0e4;
  padding-top: 16px;
  color: #99a68a;
  font-size: 11px;
}
.planning-summary-footer > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.planning-summary-footer p {
  margin: 0 0 0 auto;
  font-size: 11px;
}
.allocation-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
}
.allocation-dot.spent {
  background: #b5bcaa;
}
.allocation-dot.free {
  background: #b8d38a;
}
.planning-setup {
  padding: 26px;
  text-align: center;
  background: #f4f7ef;
  border: 1px dashed #ccd8bc;
  border-radius: 18px;
  margin-top: 20px;
}
.setup-symbol {
  width: 45px;
  height: 45px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #e3ecd7;
  color: #8ba26c;
  margin: 0 auto 14px;
}
.planning-setup h3 {
  margin: 0 0 9px;
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -0.5px;
}
.planning-setup p {
  font-size: 13px;
  color: #94a183;
  max-width: 390px;
  margin: 0 auto 20px;
  line-height: 1.7;
}
.planning-setup > div {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 11px;
}

/* Dark mode uses graphite surfaces with the existing lime identity. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #101114;
  --surface: #191b21;
  --ink: #f0f1f5;
  --muted: #9096a4;
  --line: #2b2e37;
  --blue: #d5e7bb;
  --green: #bbd49b;
  --red: #e2a08e;
}
[data-theme="dark"] .sidebar {
  background: #121318;
  border-color: #262932;
}
[data-theme="dark"] .brand-mark {
  background: #30352c;
  color: #d8efad;
}
[data-theme="dark"] .workspace,
[data-theme="dark"] .breadcrumb {
  color: #737986;
}
[data-theme="dark"] .breadcrumb span {
  color: #a2a7b2;
}
[data-theme="dark"] .nav button {
  color: #9097a4;
}
[data-theme="dark"] .nav button:hover {
  background: #20232b;
  color: #f1f3f6;
}
[data-theme="dark"] .nav button.active {
  background: #2b3026;
  color: #e3efcf;
  box-shadow: none;
}
[data-theme="dark"] .nav button.active .glyph {
  color: #d8efb5;
}
[data-theme="dark"] .profile {
  border-color: #292d35;
}
[data-theme="dark"] .avatar {
  color: #d1e3b8;
  background: #2e3628;
}
[data-theme="dark"] .local-status {
  color: #747d88;
}
[data-theme="dark"] .local-status strong {
  color: #b4bdc9;
}
[data-theme="dark"] .local-status .glyph {
  color: #9ead87;
}
[data-theme="dark"] .top-actions > .icon-button {
  background: #1c1f25;
  border-color: #31353e;
  color: #bbc1ca;
}
[data-theme="dark"] .icon-button {
  color: #969eac;
}
[data-theme="dark"] .icon-button:hover {
  color: #e5eccf;
  background: #30362a;
}
[data-theme="dark"] .page-heading p {
  color: #858d9a;
}
[data-theme="dark"] .btn-primary,
[data-theme="dark"] .btn-dark {
  background: #d4e9ae;
  color: #24301d;
  box-shadow: none;
}
[data-theme="dark"] .btn-primary:hover,
[data-theme="dark"] .btn-dark:hover {
  background: #e1f2c4;
  color: #182110;
}
[data-theme="dark"] .btn-light {
  background: #22262e;
  color: #d6dbe3;
  border-color: #363d48;
}
[data-theme="dark"] .btn-light:hover {
  background: #303630;
}
[data-theme="dark"] .btn-soft {
  background: #293324;
  color: #c8ddb0;
}
[data-theme="dark"] .btn-danger {
  background: #3d2926;
  color: #e0a391;
}
[data-theme="dark"] .text-button {
  color: #bfcea9;
}
[data-theme="dark"] .text-button:hover {
  color: #e0edc6;
}
[data-theme="dark"] .demo-banner {
  background: none;
  border-color: #30372b;
  color: #828c77;
}
[data-theme="dark"] .demo-label {
  background: #283121;
  color: #a8ba91;
}
[data-theme="dark"] .demo-banner button {
  color: #b6c69f;
}
[data-theme="dark"] .hero {
  background: linear-gradient(135deg, #22232d, #191b22);
  border: 1px solid #3c3e4b;
  box-shadow: inset 0 1px 0 #ffffff04;
}
[data-theme="dark"] .hero .eyebrow {
  color: #afb4c0;
}
[data-theme="dark"] .hero-chip {
  border-color: #454952;
  background: #ffffff06;
  color: #a8b1bf;
}
[data-theme="dark"] .hero-distribution {
  border-color: #393d47;
}
[data-theme="dark"] .hero-meta {
  color: #8e97a6;
}
[data-theme="dark"] .total-amount {
  color: #f3f4f7;
}
[data-theme="dark"] .total-amount .currency {
  color: #9fa6b4;
}
[data-theme="dark"] .distribution-title {
  color: #9ba4b2;
}
[data-theme="dark"] .distribution-title > span:last-child {
  color: #707b8b;
}
[data-theme="dark"] .legend-item {
  color: #a3adbb;
}
[data-theme="dark"] .legend-item strong {
  color: #e0e5ed;
}
[data-theme="dark"] .quick-actions button {
  background: #181b21;
  border-color: #303540;
  color: #c1cad5;
}
[data-theme="dark"] .quick-actions button:hover {
  background: #252a32;
}
[data-theme="dark"] .quick-actions button > span {
  background: #2a2f37;
  color: #d0d7df;
}
[data-theme="dark"] .month-picker {
  background: #1d222a;
  border: 1px solid #303744;
}
[data-theme="dark"] .month-picker strong {
  color: #aab5c4;
}
[data-theme="dark"] .stat-card {
  background: linear-gradient(135deg, #20232c, #191c23);
  border-color: #363c48;
}
[data-theme="dark"] .stat-top,
[data-theme="dark"] .stat-bottom {
  color: #929eae;
}
[data-theme="dark"] .stat-icon {
  background: #303640;
  color: #d2d9e1;
}
[data-theme="dark"] .stat-card.accent {
  background: #253024;
  border-color: #475b36;
}
[data-theme="dark"] .stat-card.accent .stat-value {
  color: #d7eab7;
}
[data-theme="dark"] .stat-card.accent .stat-top,
[data-theme="dark"] .stat-card.accent .stat-bottom {
  color: #a4ba8b;
}
[data-theme="dark"] .stat-card.accent .stat-icon {
  color: #d2e8b6;
  background: #38482e;
}
[data-theme="dark"] .insight {
  background: #262722;
  border-color: #414238;
  color: #a3a697;
}
[data-theme="dark"] .insight strong {
  color: #d3d4c4;
}
[data-theme="dark"] .insight > .glyph {
  color: #b2b397;
}
[data-theme="dark"] .insight.good {
  background: #243022;
  border-color: #3d5135;
  color: #b6c5a6;
}
[data-theme="dark"] .insight.good strong {
  color: #d4e6bd;
}
[data-theme="dark"] .account-card {
  background: #1c1d24;
  border-color: #333b47;
  color: #e4eaf1;
}
[data-theme="dark"] .account-card:hover {
  border-color: #697f56;
  box-shadow: 0 8px 24px #00000018;
}
[data-theme="dark"] .account-name {
  color: #a0acbb;
}
[data-theme="dark"] .account-balance small,
[data-theme="dark"] .account-equivalent {
  color: #8796a8;
}
[data-theme="dark"] .account-owner {
  background: #2a3326;
  color: #bacba7;
}
[data-theme="dark"] .currency-badge {
  background: #212831;
  border-color: #3a4655;
  color: #91a1b4;
}
[data-theme="dark"] .account-add {
  color: #91a582;
  border-color: #48563d;
}
[data-theme="dark"] .account-add:hover {
  background: #24301f;
}
[data-theme="dark"] .panel {
  background: #1b1c22;
  border-color: #323c48;
}
[data-theme="dark"] .panel-head,
[data-theme="dark"] .plan-row {
  border-color: #2a3542;
}
[data-theme="dark"] .category-icon,
[data-theme="dark"] .category-icon.blue,
[data-theme="dark"] .category-icon.orange,
[data-theme="dark"] .category-icon.green,
[data-theme="dark"] .category-icon.violet {
  background: #30313a;
  color: #c8d2df;
}
[data-theme="dark"] .row-title {
  color: #d5deea;
}
[data-theme="dark"] .row-subtitle,
[data-theme="dark"] .row-money small {
  color: #899db5;
}
[data-theme="dark"] .empty-icon {
  background: #28382f;
  color: #a7bd9c;
}
[data-theme="dark"] .empty h3 {
  color: #b6c8af;
}
[data-theme="dark"] .empty p {
  color: #83987b;
}
[data-theme="dark"] .notice {
  background: #202b22;
  border-color: #364734;
  color: #95a68d;
}
[data-theme="dark"] .notice strong {
  color: #c0d3b2;
}
[data-theme="dark"] .footer,
[data-theme="dark"] .footer button {
  color: #6f8370;
}
[data-theme="dark"] .tag,
[data-theme="dark"] .tag.blue {
  background: #30402c;
  color: #b4cba2;
}
[data-theme="dark"] .tag.green {
  background: #253f29;
  color: #b8d8ad;
}
[data-theme="dark"] .segmented {
  background: #202e24;
}
[data-theme="dark"] .segmented button {
  color: #8fa48a;
}
[data-theme="dark"] .segmented button.active {
  background: #394b30;
  color: #dfedcf;
}
[data-theme="dark"] .group-heading > span {
  color: #8f9f85;
}
[data-theme="dark"] .plan-table-head {
  background: #17231d;
  border-color: #2c3d2e;
  color: #8a9e84;
}
[data-theme="dark"] .plan-table-row {
  border-color: #2b3c2d;
}
[data-theme="dark"] .plan-cell small {
  color: #829a7b;
}
[data-theme="dark"] .progress {
  background: #2d4028;
}
[data-theme="dark"] .progress span {
  background: #b3ce8e;
}
[data-theme="dark"] .search-field input {
  color: #dce8d5;
  background: #1d1e25;
  border-color: #354a32;
}
[data-theme="dark"] .filters button {
  color: #8ca181;
}
[data-theme="dark"] .filters button.active {
  color: #c9ddae;
  background: #2d4027;
}
[data-theme="dark"] .entry-group-title {
  color: #8da782;
  background: #18191e;
  border-color: #2b4129;
}
[data-theme="dark"] .modal-backdrop {
  background: #0000007a;
}
[data-theme="dark"] .modal {
  color: #e8edf4;
  background: #191d25;
  border-color: #46505f;
  box-shadow: 0 20px 100px #00000066;
}
[data-theme="dark"] .modal-subtitle {
  color: #a1a4b0;
}
[data-theme="dark"] .form-type {
  border-color: #394454;
  background: #222b36;
}
[data-theme="dark"] .form-type button {
  color: #90a0b7;
}
[data-theme="dark"] .form-type button.active {
  background: #d2e7af;
  color: #24321c;
}
[data-theme="dark"] .big-input label {
  color: #8d9cb1;
}
[data-theme="dark"] .big-input input {
  color: #e3eaf5;
}
[data-theme="dark"] .big-input input::placeholder {
  color: #66758c;
}
[data-theme="dark"] .field > label {
  color: #a1a5b1;
}
[data-theme="dark"] .field input,
[data-theme="dark"] .field textarea,
[data-theme="dark"] .field select {
  color: #e1e9f5;
  background: #23242c;
  border-color: #3a3c47;
}
[data-theme="dark"] .field input:focus,
[data-theme="dark"] .field textarea:focus {
  background: #292a34;
  border-color: #829f64;
  box-shadow: 0 0 0 3px #a3b97a10;
}
[data-theme="dark"] .field input::placeholder {
  color: #6d839e;
}
[data-theme="dark"] .field input:disabled {
  color: #7289a4;
  background: #1d1e25;
}
[data-theme="dark"] .checkbox {
  color: #8ea78a;
}
[data-theme="dark"] .form-preview {
  background: #24331f;
  border-color: #405535;
  color: #a6bc96;
}
[data-theme="dark"] .form-preview strong {
  color: #cce2b5;
}
[data-theme="dark"] .form-error {
  background: #3b2826;
  color: #daa18f;
}
[data-theme="dark"] .balance-breakdown {
  background: #263920;
  color: #98b288;
}
[data-theme="dark"] .balance-breakdown strong {
  color: #cfdfb6;
}
[data-theme="dark"] .confirm-message {
  color: #9eb392;
}
[data-theme="dark"] .select-trigger {
  background: #23242c;
  border-color: #3a3c47;
  color: #e0e2ea;
}
[data-theme="dark"] .select-trigger:hover {
  background: #29374b;
  border-color: #6a815a;
}
[data-theme="dark"] .select-trigger:disabled {
  background: #1e1f25;
  border-color: #2d3f57;
  color: #6c839f;
}
[data-theme="dark"] .select-chevron {
  color: #8e93a0;
}
[data-theme="dark"] .select-menu {
  background: #23242cf7;
  border-color: #454752;
  box-shadow: 0 12px 40px #00000066;
}
[data-theme="dark"] .select-option {
  color: #d7d9e2;
}
[data-theme="dark"] .select-option:hover,
[data-theme="dark"] .select-option.highlighted {
  background: #2d3f36;
}
[data-theme="dark"] .select-option.selected {
  background: #33482a;
  color: #d9eac3;
}
[data-theme="dark"] .select-currency-code {
  color: #8ca47c;
}
[data-theme="dark"] .currency-symbol {
  background: #2d3e28;
  color: #bfdaa4;
}
[data-theme="dark"] .top-actions .select-trigger {
  background: #1d1e25;
  border-color: #393b46;
  color: #dde0e8;
}
[data-theme="dark"] .amount-currency-picker .select-trigger {
  background: #2d3b28;
  border-color: #465b3b;
}
[data-theme="dark"] .amount-currency-picker .currency-symbol {
  background: #3b4d31;
  color: #d1e7b6;
}
[data-theme="dark"] .transfer-details {
  background: #1e2d22;
  border-color: #334b35;
}
[data-theme="dark"] .transfer-details summary {
  color: #b1c9a0;
}
[data-theme="dark"] .transfer-details p,
[data-theme="dark"] .legacy-receipt {
  color: #8aa37c;
}
[data-theme="dark"] .rate-item {
  background: #21331e;
}
[data-theme="dark"] .rate-item span,
[data-theme="dark"] .rate-note,
[data-theme="dark"] .settings-row p {
  color: #91ab81;
}
[data-theme="dark"] .rate-item strong {
  color: #cadfb2;
}
[data-theme="dark"] .settings-row {
  border-color: #31472d;
}
[data-theme="dark"] .provider-search {
  background: #202b3a;
  border-color: #3b506b;
}
[data-theme="dark"] .provider-search input {
  color: #dce8f7;
}
[data-theme="dark"] .provider-group h3 {
  color: #969aa6;
}
[data-theme="dark"] .provider-choice {
  background: #24252e;
  border-color: #3a3c47;
  color: #d9dbe3;
}
[data-theme="dark"] .provider-choice:hover {
  background: #2c3d32;
  border-color: #647d50;
}
[data-theme="dark"] .provider-mark.custom {
  background: #32452a;
  color: #c1d9a6;
}
[data-theme="dark"] .chosen-provider {
  background: #253820;
  border-color: #405a34;
}
[data-theme="dark"] .chosen-provider > div > span {
  color: #9ab48b;
}
[data-theme="dark"] .period-tabs {
  background: #1d2b21;
  border: 1px solid #344b30;
}
[data-theme="dark"] .period-tabs button {
  color: #8ba67e;
}
[data-theme="dark"] .period-tabs button.active {
  background: #d1e5b1;
  color: #28381d;
  box-shadow: none;
}
[data-theme="dark"] .planning-summary {
  background: linear-gradient(135deg, #23242d, #191a21);
  border-color: #3c3e49;
}
[data-theme="dark"] .planning-kicker {
  color: #9296a2;
}
[data-theme="dark"] .summary-tabs {
  background: #1b1d20;
  border-color: #394d32;
}
[data-theme="dark"] .summary-tabs button {
  color: #86a079;
}
[data-theme="dark"] .summary-tabs button.active {
  background: #d5e8bb;
  color: #27361e;
}
[data-theme="dark"] .planning-numbers > div > span {
  color: #969aa6;
}
[data-theme="dark"] .planning-numbers .glyph {
  color: #c0cddd;
}
[data-theme="dark"] .budget-ring {
  background: conic-gradient(
    from -90deg,
    #c5dd9e var(--ring-angle),
    #555862 var(--ring-angle)
  );
}
[data-theme="dark"] .budget-ring > div {
  background: #1d1e26;
}
[data-theme="dark"] .budget-ring span {
  color: #969aa6;
}
[data-theme="dark"] .budget-ring.empty {
  background: #373942;
}
[data-theme="dark"] .budget-ring.deficit {
  background: #bc8170;
}
[data-theme="dark"] .budget-ring.deficit strong {
  color: #e7b3a0;
}
[data-theme="dark"] .planning-summary-footer {
  color: #969aa6;
  border-color: #343641;
}
[data-theme="dark"] .allocation-dot.spent {
  background: #747680;
}
[data-theme="dark"] .allocation-dot.free {
  background: #c5dd9e;
}
[data-theme="dark"] .planning-setup {
  background: #1e2e22;
  border-color: #45613c;
}
[data-theme="dark"] .setup-symbol {
  background: #34492a;
  color: #c6d9b3;
}
[data-theme="dark"] .planning-setup p {
  color: #96b08b;
}

@media (max-width: 680px) {
  .top-actions {
    gap: 6px;
  }
  .top-actions > .icon-button {
    width: 30px;
    height: 30px;
  }
  .top-actions .select-trigger {
    min-width: 88px;
  }
  .quick-actions {
    gap: 8px;
    margin: 13px 0 23px;
  }
  .quick-actions button {
    flex-direction: column;
    min-height: 82px;
    gap: 8px;
    font-size: 11px;
    border-radius: 16px;
  }
  .quick-actions button > span {
    width: 29px;
    height: 29px;
  }
  .provider-grid {
    gap: 7px;
  }
  .provider-choice {
    padding: 9px 8px;
    gap: 8px;
    min-height: 56px;
  }
  .provider-choice > span:last-child {
    font-size: 12px;
  }
  .provider-search input {
    font-size: 16px;
  }
  .appearance-settings {
    padding: 18px;
    flex-wrap: wrap;
    gap: 16px;
  }
  .appearance-settings > .field {
    width: 100%;
  }
  .budget-toolbar {
    gap: 13px;
    margin-bottom: 16px;
  }
  .period-tabs {
    padding: 3px;
  }
  .period-tabs button {
    font-size: 11px;
    padding: 8px 11px;
  }
  .budget-toolbar > .month-picker {
    margin-left: auto;
  }
  .planning-summary {
    padding: 20px 19px 17px;
    border-radius: 20px;
  }
  .planning-summary-header {
    gap: 12px;
  }
  .planning-summary-header h2 {
    font-size: 15px;
  }
  .planning-kicker {
    font-size: 10px;
  }
  .summary-tabs {
    padding: 3px;
  }
  .summary-tabs button {
    font-size: 11px;
    padding: 7px 12px;
  }
  .planning-summary-body {
    grid-template-columns: 1fr;
    gap: 25px;
    padding-top: 23px;
    padding-bottom: 19px;
  }
  .planning-numbers {
    gap: 17px;
  }
  .planning-numbers > div > span {
    font-size: 12px;
  }
  .planning-numbers strong {
    font-size: 25px;
  }
  .budget-ring {
    width: 184px;
    height: 184px;
    min-width: 184px;
    min-height: 184px;
    padding: 17px;
  }
  .planning-summary-footer {
    justify-content: center;
    gap: 12px;
    font-size: 10px;
  }
  .planning-summary-footer p {
    margin: 0;
    text-align: center;
    font-size: 10px;
    width: 100%;
    line-height: 1.6;
  }
  .planning-setup {
    padding: 23px 19px;
  }
  .planning-setup h3 {
    font-size: 16px;
  }
  .planning-setup p {
    font-size: 12px;
  }
  .planning-setup > div {
    flex-direction: column;
    align-items: stretch;
    gap: 11px;
  }
  .planning-setup .btn {
    font-size: 12px;
  }
  [data-theme="dark"] .sidebar {
    background: #18191feb;
    border-color: #3e414b;
    box-shadow: 0 8px 30px #00000066;
  }
  [data-theme="dark"] .nav button.active {
    background: #35432e;
    color: #e0edcf;
  }
  [data-theme="dark"] .nav button:hover {
    background: #2d3c29;
  }
  [data-theme="dark"] .hero-distribution {
    border-color: #39404d;
  }
}

@media (max-width: 680px) {
  .main {
    padding-top: calc(18px + env(safe-area-inset-top, 0px));
  }

  .topbar,
  .mobile-brand {
    min-height: 44px;
  }

  .top-actions > .icon-button {
    width: 44px;
    height: 44px;
    padding: 11px;
  }

  .top-actions .select-trigger {
    min-height: 44px;
  }
}

@media (display-mode: standalone) and (max-width: 680px) {
  .main {
    padding-top: max(18px, env(safe-area-inset-top, 0px));
  }
}

.pin-screen {
  min-height: 100dvh;
  padding: calc(28px + env(safe-area-inset-top, 0px)) 24px calc(24px + env(safe-area-inset-bottom, 0px));
  display: grid;
  place-items: center;
  background: var(--bg);
}

.pin-content {
  width: min(100%, 350px);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.pin-brand {
  margin-bottom: clamp(38px, 7vh, 74px);
}

.pin-heading h1 {
  font: 550 clamp(23px, 6vw, 31px) var(--font-display);
  letter-spacing: -0.04em;
  margin: 0 0 10px;
}

.pin-prompt {
  color: var(--muted);
  margin: 0;
  font-size: 14px;
}

.pin-dots {
  display: flex;
  justify-content: center;
  gap: 19px;
  margin: 27px 0 12px;
}

.pin-dots span {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 1.5px solid var(--ink);
  transition: background 140ms ease, transform 140ms ease;
}

.pin-dots span.filled {
  background: var(--accent);
  border-color: var(--accent);
  transform: scale(1.08);
}

.pin-error {
  min-height: 18px;
  margin: 0;
  color: #d97772;
  font-size: 12px;
}

.pin-keypad {
  display: grid;
  grid-template-columns: repeat(3, 72px);
  gap: 14px 20px;
  margin-top: 28px;
}

.pin-keypad button {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font: 400 28px var(--font-ui);
  transition: background 140ms ease, transform 140ms ease;
  touch-action: manipulation;
}

.pin-keypad button:active {
  background: var(--accent);
  color: #1c2418;
  transform: scale(0.95);
}

.pin-bottom {
  min-height: 65px;
  display: flex;
  gap: 15px;
  flex-direction: column;
  align-items: center;
  margin-top: 30px;
}

.pin-bottom .text-button {
  font-size: 13px;
}

@media (max-height: 710px) {
  .pin-brand { margin-bottom: 25px; }
  .pin-keypad { gap: 9px 18px; margin-top: 13px; }
  .pin-keypad button { width: 67px; height: 67px; }
  .pin-keypad { grid-template-columns: repeat(3, 67px); }
  .pin-bottom { margin-top: 14px; }
}

@media (max-width: 360px) {
  .top-actions .theme-toggle {
    display: none;
  }
}

.login-screen {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(100%, 420px);
  padding: clamp(22px, 6vw, 34px);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font: 600 18px var(--font-display);
}

.login-card h1 {
  margin: 26px 0 20px;
  font: 600 clamp(24px, 6vw, 32px) var(--font-display);
  letter-spacing: -0.03em;
}

.auth-step {
  display: grid;
  gap: 12px;
}

.auth-step[hidden] {
  display: none;
}

.auth-step .btn,
.login-telegram,
.unlock-action {
  width: 100%;
  min-height: 46px;
  justify-content: center;
  font-size: 14px;
}

.unlock-description {
  color: var(--muted);
  line-height: 1.55;
  margin: -8px 0 22px;
}

.unlock-action {
  margin-top: 12px;
}

.auth-step .field input {
  font-size: 16px;
}

.password-auth .form-error:empty,
.password-auth form[hidden],
.password-auth .password-note[hidden] {
  display: none;
}

.password-toggle {
  display: block;
  margin: 14px auto 0;
}

.password-note {
  margin-top: 12px;
}

.login-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
  color: var(--muted);
  font-size: 13px;
}

.login-divider::before,
.login-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.auth-settings {
  margin-bottom: 16px;
}

.plan-confirm-hint {
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.row-actions .plan-confirm {
  padding-inline: 8px;
  font-size: 11px;
  white-space: nowrap;
  min-height: 36px;
}

/* Persistent navigation and receipt capture */
.brand,
.mobile-brand {
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.nav .nav-create {
  background: var(--accent);
  color: #20251e;
  font-weight: 650;
}

.nav .nav-create:hover {
  background: #cce995;
  color: #151914;
}

.receipt-scan {
  margin: -3px 0 22px;
}

.receipt-scan-button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 14px 16px;
  border: 1px dashed #bcc5ae;
  border-radius: 15px;
  background: #f6faef;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    transform 160ms ease;
}

.receipt-scan-button:hover {
  border-color: #899c70;
  background: #eef6e2;
  transform: translateY(-1px);
}

.receipt-scan-button > .glyph {
  width: 25px;
  height: 25px;
  padding: 8px;
  box-sizing: content-box;
  border-radius: 12px;
  background: var(--accent);
}

.receipt-scan-button span {
  display: grid;
  gap: 3px;
}

.receipt-scan-button strong {
  font-size: 14px;
}

.receipt-scan-button small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.receipt-progress {
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
}

.receipt-progress[hidden] {
  display: none;
}

.receipt-progress > div {
  height: 4px;
  margin-top: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #dfe5d7;
}

.receipt-progress i {
  display: block;
  width: 4%;
  height: 100%;
  border-radius: inherit;
  background: #789c51;
  transition: width 180ms ease;
}

.receipt-progress.error {
  color: #b64b47;
}

.btn-danger.labelled {
  width: auto;
  min-width: 0;
  padding-inline: 15px;
  gap: 7px;
}

.btn-danger.labelled .glyph {
  width: 17px;
  height: 17px;
}

.account-provider-line {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: -4px 0 19px;
}

.account-provider-line > div {
  display: grid;
  gap: 3px;
}

.account-provider-line strong {
  font-size: 14px;
}

.account-provider-line span {
  color: var(--muted);
  font-size: 12px;
}

.account-settings-button {
  width: 100%;
  justify-content: center;
}

[data-theme="dark"] .nav .nav-create {
  background: var(--accent);
  color: #172014;
}

[data-theme="dark"] .nav .nav-create:hover {
  background: #cce995;
}

[data-theme="dark"] .receipt-scan-button {
  border-color: #4b5445;
  background: #1c211c;
  color: #edf3e5;
}

[data-theme="dark"] .receipt-scan-button:hover {
  border-color: #738664;
  background: #242b22;
}

[data-theme="dark"] .receipt-progress > div {
  background: #32372f;
}

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 150ms;
  animation-timing-function: ease-out;
}

button,
a,
[role="button"] {
  touch-action: manipulation;
}

@media (pointer: coarse) {
  .nav button,
  .nav button:hover,
  .icon-button:hover,
  .btn:hover,
  .account-card:hover,
  .account-add:hover {
    transform: none;
  }

  .nav button:active,
  .btn:active,
  .icon-button:active {
    filter: brightness(0.9);
  }
}

@media (hover: none) and (pointer: coarse) {
  .nav button:not(.active):not(.nav-create):hover,
  [data-theme="dark"] .nav button:not(.active):not(.nav-create):hover {
    background: transparent;
    color: inherit;
  }
}

@media (display-mode: standalone) and (max-width: 680px) {
  .sidebar {
    background: #f9fbf4;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  [data-theme="dark"] .sidebar {
    background: #1c1f1d;
  }
}

@media (max-width: 680px) {
  .modal {
    max-height: calc(100dvh - max(env(safe-area-inset-top, 0px), 48px) - 32px);
  }
}

@media (display-mode: standalone) and (max-width: 680px) {
  .modal {
    max-height: calc(100dvh - max(env(safe-area-inset-top, 0px), 58px) - 42px);
  }
}

@media (max-width: 680px) {
  .nav {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    grid-template-rows: minmax(0, 1fr);
  }

  .nav > button {
    justify-content: center;
    min-width: 0;
    padding: 6px 0;
    text-align: center;
  }

  .nav .nav-create,
  .nav .nav-create:hover {
    background: var(--ink);
    color: var(--accent);
  }

  .nav .nav-create > .glyph {
    width: 27px;
    height: 27px;
  }

  .nav .nav-create-label,
  .nav button[data-page="settings"] {
    display: none;
  }

  .receipt-scan {
    margin-top: -5px;
    margin-bottom: 19px;
  }

  .receipt-scan-button {
    padding: 12px 13px;
  }

  .receipt-scan-button small {
    font-size: 11px;
  }

  .form-actions .btn-danger.labelled {
    width: 100%;
    order: 3;
  }

}
