/* Shared visual palette, loaded after component and responsive styles. */
:root {
  --ink: #17372e;
  --muted: #526b61;
  --line: #9eb7ab;
  --control-line: #638574;
  --green: #146044;
  --paper: #dce7e2;
  --surface: #f5f9f7;
  --tint: #e0ede6;
  --selected: #c3dfcf;
}

.site-header, .panel, .operation-modal, .auth-card, .wallet-hero, .account-dropdown {
  background: var(--surface);
}
.panel, .auth-card, .wallet-hero { box-shadow: 0 6px 20px #17372e0c; }
.profile-budget-grid > .panel { background: var(--surface); }
.primary:not(.reset-submit) {
  background: #146044;
  box-shadow: inset 0 0 0 1px #0d4933, 0 3px 8px #17372e24;
}
.primary:not(.reset-submit):hover { background: #0c4933; }
.outline, .choice {
  background: var(--surface);
  border-color: var(--control-line);
  color: var(--ink);
}
.outline:hover, .choice:hover { background: var(--tint); border-color: var(--green); }
.choice.selected {
  background: var(--selected);
  border-color: var(--green);
  color: #114c35;
  box-shadow: inset 0 0 0 1px var(--green);
}
.category-field .choice .category-icon { background: var(--tint); color: var(--green); }
.category-field .choice.selected .category-icon { background: #a8cfb9; color: #114c35; }
.field input, .search-row input, .message-compose textarea {
  background: #f9fcfa;
  border-color: var(--control-line);
  color: var(--ink);
}
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
.field input:focus, .search-row input:focus, .message-compose textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px #14604426;
  outline: 2px solid var(--green);
  outline-offset: 2px;
}
button:focus-visible, a:focus-visible { outline-color: var(--green); }
.link-btn { color: var(--muted); }
.link-btn:hover, .link-btn.active { background: var(--selected); color: #114c35; }
.site-header .top-actions > .link-btn:hover,
.site-header .top-actions > .link-btn.active { background: var(--selected); color: #114c35; }
.account-dropdown button:hover, .account-dropdown button.active { background: var(--selected); }
.chat-trigger, .account-trigger, .icon-btn, .modal-close {
  color: var(--ink);
  background: var(--tint);
  border: 1px solid var(--control-line);
}
.chat-trigger:hover, .account-trigger:hover, .account-menu[open] .account-trigger,
.icon-btn:hover, .modal-close:hover {
  background: var(--selected);
  border-color: var(--green);
  box-shadow: 0 0 0 2px #1460441c;
}

.account-card.uah { background: #164b36; color: #fff; }
.account-card.usd { background: #176463; color: #fff; }
.account-card.eur { background: #354d78; color: #fff; }
.account-card > small, .account-bottom { opacity: .9; }
.account-card .account-actions { border-color: #ffffff55; }
.account-card .account-actions button {
  background: #ffffff17;
  border-color: #ffffff80;
  color: #fff;
}
.account-card .account-actions button:hover { background: #ffffff30; border-color: #fff; }
.wallet-value, .hero-visual { background: #c6ddcf; }
.wallet-value span, .wallet-value small, .visual-note, .demo-label,
.hero p, .hero-proof, .eyebrow, .hero h1 em { color: var(--muted); }
.currency-mark, .avatar, .system-avatar { background: #c3dfcf; color: #164b36; }
.wallet-row, .notice, .message-access, .share-explainer,
.current-budget-card, .budget-option, .reset-balances > div, .reset-code {
  background: var(--tint);
  border-color: var(--line);
}
.budget-role { background: var(--surface); border-color: var(--control-line); color: var(--green); }
.budget-people { border-color: var(--line); }
.budget-option:hover, .budget-option.is-current {
  background: var(--selected);
  border-color: var(--green);
}
.current-budget-identity .avatar { background: #a8cfb9; }
.budget-kind, .current-budget-identity p, .budget-people small,
.budget-option-state, .is-current .budget-option-state { color: var(--muted); }
.budget-live { color: var(--green); }
.budget-live i { background: var(--green); }
.badge { background: #d2e5da; color: #29533f; border: 1px solid var(--line); }
.positive { color: #17613d; }
.danger { color: #a3362e; }
.operation { border-bottom-color: #c7d8cf; }
.operation-icon { background: #ecd8b8; color: #79541f; }
.operation-icon.income { background: #c3dfcf; color: #17613d; }
.progress { background: #c3d5ca; }
.progress i { background: #237a50; }
.conversion-receipt { background: var(--tint); border-color: var(--control-line); }
.conversion-receipt small, .conversion-history { color: #29533f !important; }
.history-totals article { background: var(--tint); border-color: var(--line); }
.history-totals article > b, .header-rates .rates-source,
.header-rates i, .header-rates small { color: var(--muted); }
.calendar-day:hover { background: var(--tint); }
.calendar-day.today { box-shadow: inset 0 0 0 1px var(--green); }
.calendar-day.selected { background: var(--green); }
.history-calendar-heading .icon-btn { background: var(--tint); }
.history-calendar-toggle { width: 40px; height: 40px; flex-shrink: 0; }
.history-calendar-toggle .category-svg { width: 21px; height: 21px; }
.history-page > .dash-head { flex-wrap: nowrap; }
.history-page > .dash-head > div:first-child { min-width: 0; }
.history-page > .dash-head > .top-actions { width: auto; flex-shrink: 0; }
.history-page > .dash-head .history-calendar-toggle { flex: 0 0 40px; }
.history-operation.is-allocation, .operation.is-allocation {
  background: #f5e5c7;
  border-color: #bd944f;
  border-left-color: #9b6c20;
}
.allocation-label { background: #ecd09b; border-color: #aa7e37; color: #624316; }

.message-sidebar { background: #e0ebe5; }
.conversation:hover { background: #cfe1d6; }
.conversation.selected { background: var(--selected); box-shadow: inset 0 0 0 1px #638574; }
.conversation.selected:hover { background: #b5d6c3; }
.conversation-count { background: var(--green); }
.message-thread { background: #edf4ef; }
.chat-bubble { background: #f9fcfa; border-color: #8aa798; }
.chat-bubble.own { background: #c3dfcf; border-color: #638574; }
.system-dot { background: #7c9989; }
.system-message.is-new .system-dot { background: var(--green); }
.allocation-card, .allocation-summary { background: var(--tint); border-color: var(--control-line); }
.allocation-card:hover { background: var(--selected); }

@media (max-width: 760px) {
  .message-sidebar .conversation + .conversation { margin-top: 10px; }
  .messages-modal.chat-open .message-sidebar { background: #e0ebe5; }
  .messages-modal.chat-open .conversation + .conversation { margin-top: 8px; }
  .messages-modal.chat-open .conversation-count { box-shadow: 0 0 0 2px #e0ebe5; }
  .messages-modal.chat-open .message-list-back {
    background: var(--tint);
    border-color: var(--control-line);
  }
  .mobile-navigation { background: #f5f9f7f5; }
  .mobile-navigation button { color: var(--muted); }
  .mobile-navigation button:hover { background: var(--tint); }
  .mobile-navigation button.active { background: var(--selected); color: #114c35; }
}
