/* Budget — dark theme only. Palette, type, and layout for a quiet finance
   dashboard.  Every rule here is styling; nothing depends on JS.  Money is
   right-aligned and rendered with tabular numerals so columns line up. */

:root {
  /* Surfaces */
  --bg:            #0f1115;
  --panel:         #171a21;
  --panel-alt:    #1c2029;      /* headings, tfoot, hover base */
  --panel-hover:  #1f242e;
  --border:        #262a33;
  --border-strong:#333844;

  /* Text */
  --fg:            #e6e8ec;
  --fg-muted:      #9aa0ab;
  --fg-dim:        #6b7180;
  --fg-inverse:    #0f1115;

  /* Accent — one restrained blue for links and primary actions. */
  --accent:        #5b8def;
  --accent-hover:  #7aa2f5;
  --accent-quiet:  #2a3a5c;

  /* Status semantics — same idea in three colors. */
  --ok:            #3ddc84;
  --ok-bg:         #16281f;
  --ok-border:     #234b34;

  --warn:          #f5b642;
  --warn-bg:       #2a2318;
  --warn-border:   #4a3a1e;

  --bad:           #f56b6b;
  --bad-bg:        #2b1a1a;
  --bad-border:    #4d2626;

  /* Radii + shape */
  --r-sm: 4px;
  --r-md: 6px;
  --r-lg: 8px;

  /* Type scale */
  --fs-title:   1.75rem;
  --fs-section: 1.15rem;
  --fs-body:    0.9375rem;    /* 15px */
  --fs-small:   0.8125rem;    /* 13px */
  --fs-micro:   0.75rem;

  /* Consistent horizontal rhythm */
  --page-max: 1100px;
  --page-pad: 1.5rem;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font: var(--fs-body)/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI",
        Roboto, "Helvetica Neue", Arial, sans-serif;
  font-variant-ligatures: none;
  -webkit-font-smoothing: antialiased;
}

/* All money-like numbers use tabular figures. */
.num, table, input[type="number"], .free-hero-amount, code, small.dim {
  font-variant-numeric: tabular-nums;
}

/* ---------------------------------------------------------------- header */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem calc(var(--page-pad) + 0.25rem);
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
}
nav {
  display: flex;
  gap: 0.25rem;
}
nav a {
  color: var(--fg-muted);
  text-decoration: none;
  padding: 0.35rem 0.75rem;
  border-radius: var(--r-sm);
  font-size: var(--fs-body);
  font-weight: 500;
  transition: color 0.12s, background 0.12s;
}
nav a:hover { color: var(--fg); background: var(--panel-hover); }
nav a.active {
  color: var(--fg);
  background: var(--panel-hover);
  box-shadow: inset 0 -2px 0 var(--accent);
}
form.logout { margin: 0; }

/* --------------------------------------------------------------- layout */
main {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 1.75rem var(--page-pad) 3rem;
}
section { margin-top: 1.5rem; }
section:first-of-type { margin-top: 0; }

h1 {
  font-size: var(--fs-title);
  font-weight: 600;
  margin: 0 0 0.5rem;
  letter-spacing: -0.01em;
}
h2 {
  font-size: var(--fs-section);
  font-weight: 600;
  margin: 1.5rem 0 0.75rem;
  color: var(--fg);
}
h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 1rem 0 0.5rem;
  color: var(--fg);
}
h4 {
  font-size: var(--fs-small);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0.75rem 0 0.4rem;
  color: var(--fg-muted);
}

h1 small, h2 small, h3 small {
  color: var(--fg-muted);
  font-weight: 400;
  font-size: 0.8em;
  margin-left: 0.5rem;
}

p { margin: 0.5rem 0; }
p.hint, .hint  { color: var(--fg-muted); font-size: var(--fs-small); }
p.empty, .empty {
  color: var(--fg-muted);
  font-style: italic;
  padding: 0.75rem 0;
}
.error { color: var(--bad); }

code {
  background: var(--panel-alt);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 0.05rem 0.35rem;
  font-size: 0.85em;
  color: var(--fg);
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover { color: var(--accent-hover); text-decoration: underline; }

/* --------------------------------------------------------------- login */
section.narrow {
  max-width: 360px;
  margin: 4rem auto;
  padding: 1.75rem 2rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
}
section.narrow h1 { margin-bottom: 1.25rem; text-align: center; }

/* --------------------------------------------------------------- tables */
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  margin-bottom: 1rem;
}
thead th {
  background: var(--panel-alt);
  color: var(--fg-muted);
  font-weight: 600;
  font-size: var(--fs-micro);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.6rem 0.85rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: bottom;
}
tbody td, tfoot td {
  padding: 0.55rem 0.85rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  font-size: var(--fs-body);
}
tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background 0.08s; }
tbody tr:hover { background: var(--panel-hover); }

tfoot td {
  background: var(--panel-alt);
  border-top: 1px solid var(--border);
  border-bottom: none;
  font-weight: 600;
}

.num { text-align: right; }
th.num { text-align: right; }

tr.inactive td { color: var(--fg-dim); font-style: italic; }

/* Denser tables inside cards. */
table.tight { margin-bottom: 0.5rem; }
table.tight th, table.tight td { padding: 0.4rem 0.6rem; font-size: var(--fs-small); }
table.tight tr.acct-heading td {
  background: var(--panel-alt);
  color: var(--fg-muted);
  font-size: var(--fs-micro);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding-top: 0.5rem;
}
table.tight tr.acct-subtotal td { border-bottom: 1px dashed var(--border-strong); }

/* --------------------------------------------------------------- forms */
form.stacked {
  display: grid;
  gap: 0.85rem;
  max-width: 480px;
  margin-top: 1rem;
}
form.stacked label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: var(--fs-small);
  color: var(--fg-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
form.stacked label.checkbox {
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  text-transform: none;
  letter-spacing: 0;
  color: var(--fg);
  font-weight: 400;
  font-size: var(--fs-body);
}
form.stacked label .hint { text-transform: none; letter-spacing: 0; font-weight: 400; }
form.stacked .row {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

input, select, textarea {
  background: var(--bg);
  color: var(--fg);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  padding: 0.45rem 0.6rem;
  font: inherit;
  font-size: var(--fs-body);
  outline: none;
  transition: border-color 0.12s, box-shadow 0.12s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-quiet);
}
input[type="date"] { color-scheme: dark; }
input[type="checkbox"] {
  width: 1rem; height: 1rem;
  accent-color: var(--accent);
  vertical-align: middle;
}
input[type="file"] {
  background: transparent;
  padding: 0.35rem 0;
  border: none;
}
select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--fg-muted) 50%),
    linear-gradient(135deg, var(--fg-muted) 50%, transparent 50%);
  background-position:
    calc(100% - 15px) 50%,
    calc(100% - 10px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 1.75rem;
}
::placeholder { color: var(--fg-dim); }

form.inline {
  display: inline-flex;
  gap: 0.35rem;
  align-items: center;
  margin: 0;
}
form.inline input {
  width: 6.5rem;
  padding: 0.25rem 0.45rem;
  font-size: var(--fs-small);
}

/* --------------------------------------------------------------- buttons */
button, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: var(--fg-inverse);
  border: 1px solid var(--accent);
  border-radius: var(--r-sm);
  font: inherit;
  font-size: var(--fs-body);
  font-weight: 500;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
  line-height: 1.2;
}
button:hover, .btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
button:disabled { opacity: 0.5; cursor: not-allowed; }
button:focus-visible { outline: 2px solid var(--accent-hover); outline-offset: 2px; }

/* Quiet secondary — text-only, still a real button. */
button.linky {
  background: transparent;
  color: var(--accent);
  border: none;
  padding: 0.25rem 0.35rem;
  font-weight: 500;
  text-decoration: none;
}
button.linky:hover {
  background: var(--panel-hover);
  color: var(--accent-hover);
  text-decoration: none;
}

/* --------------------------------------------------------------- pills */
.pill {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.6rem;
  border-radius: 999px;
  font-size: var(--fs-micro);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border: 1px solid transparent;
  line-height: 1.5;
}
.pill-ok         { background: var(--ok-bg);   color: var(--ok);   border-color: var(--ok-border); }
.pill-held_heavy { background: var(--warn-bg); color: var(--warn); border-color: var(--warn-border); }
.pill-failing    { background: var(--bad-bg);  color: var(--bad);  border-color: var(--bad-border); }

.pill-status-waiting { background: var(--panel-alt); color: var(--fg-muted); border-color: var(--border); }
.pill-status-reading { background: var(--accent-quiet); color: var(--accent-hover); border-color: var(--accent-quiet); }
.pill-status-done    { background: var(--ok-bg);  color: var(--ok);  border-color: var(--ok-border); }
.pill-status-failed  { background: var(--bad-bg); color: var(--bad); border-color: var(--bad-border); }

/* Summary row left-border strip carries the status color. */
tr.status-ok         td:first-child { box-shadow: inset 3px 0 0 var(--ok); }
tr.status-held_heavy td:first-child { box-shadow: inset 3px 0 0 var(--warn); }
tr.status-failing    td:first-child { box-shadow: inset 3px 0 0 var(--bad); }

/* --------------------------------------------------------------- flags */
.flag {
  display: inline-block;
  padding: 0.1rem 0.45rem;
  background: var(--warn-bg);
  color: var(--warn);
  border: 1px solid var(--warn-border);
  border-radius: 999px;
  font-size: var(--fs-micro);
  margin: 0 0.25rem 0.2rem 0;
  line-height: 1.4;
}

/* --------------------------------------------------------------- misc */
.actions a, .actions form { margin-right: 0.85rem; }
.actions a:last-child, .actions form:last-child { margin-right: 0; }
.toggle { margin-top: 0.5rem; font-size: var(--fs-small); }

ul.dates { list-style: none; padding: 0; margin: 0.5rem 0; }
ul.dates li {
  padding: 0.35rem 0;
  border-bottom: 1px dotted var(--border);
  color: var(--fg-muted);
  font-size: var(--fs-small);
}
ul.tight-list { margin: 0.25rem 0; padding-left: 1.25rem; color: var(--fg-muted); }
ul.tight-list li { font-size: var(--fs-small); padding: 0.15rem 0; }

/* --------------------------------------------------------------- obligations */
section.group { margin-top: 1.75rem; }
section.total {
  margin-top: 1.75rem;
  padding: 1rem 1.25rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}
section.total .num { font-size: 1.05rem; font-weight: 600; }

/* --------------------------------------------------------------- paycheck cards */
.paycheck-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.25rem 1.5rem;
  margin-top: 1.25rem;
}
.paycheck-card > .card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  flex-wrap: wrap;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border);
}
.card-head-date h2 { margin: 0; font-size: 1.25rem; }
.card-head-date h2 small { color: var(--fg-muted); font-weight: 400; font-size: 0.85rem; margin-left: 0.4rem; }
.card-head-date p.hint { margin: 0.35rem 0 0; }

/* Status border strip on the left of the whole card. */
.status-border-ok         { border-left: 3px solid var(--ok); }
.status-border-held_heavy { border-left: 3px solid var(--warn); }
.status-border-failing    { border-left: 3px solid var(--bad); }

.paycheck-card .grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.75rem;
  margin-top: 1rem;
}
@media (max-width: 720px) {
  .paycheck-card .grid { grid-template-columns: 1fr; }
}

.paycheck-card h3 { font-size: var(--fs-small); text-transform: uppercase; letter-spacing: 0.06em; color: var(--fg-muted); margin: 1.25rem 0 0.5rem; }
.paycheck-card h3 small { text-transform: none; letter-spacing: 0; }

.ledger {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.75rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}
@media (max-width: 720px) {
  .ledger { grid-template-columns: 1fr; }
}
.ledger table.tight { margin: 0; }
.ledger tr.row-sum td {
  background: var(--panel-alt);
  border-top: 1px solid var(--border-strong);
  border-bottom: none;
  font-weight: 600;
}

/* --------------------------------------------------------------- FREE hero */
/* The one number the user is here to see: large, green, always visible. */
.free-hero {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.2rem;
  padding: 0.65rem 1.25rem;
  background: var(--ok-bg);
  border: 1px solid var(--ok-border);
  border-radius: var(--r-md);
  color: var(--ok);
  line-height: 1;
}
.free-hero-label {
  font-size: var(--fs-micro);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ok);
  opacity: 0.75;
}
.free-hero-amount {
  font-size: 2.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ok);
}
@media (max-width: 480px) { .free-hero-amount { font-size: 2rem; } }

/* Summary table Free column: same green identity, one row tall. */
table th.free {
  background: var(--ok-bg);
  color: var(--ok);
  border-left: 1px solid var(--ok-border);
  border-right: 1px solid var(--ok-border);
}
table td.free {
  background: var(--ok-bg);
  color: var(--ok);
  font-weight: 700;
  font-size: 1rem;
  border-left: 1px solid var(--ok-border);
  border-right: 1px solid var(--ok-border);
}
tbody tr:hover td.free { background: #1c3126; }

/* --------------------------------------------------------------- import */
.warning-box {
  background: var(--warn-bg);
  border: 1px solid var(--warn-border);
  border-left: 3px solid var(--warn);
  padding: 0.85rem 1rem;
  border-radius: var(--r-md);
  margin-bottom: 1rem;
}
.warning-box h2 { margin: 0 0 0.35rem; color: var(--warn); font-size: 1rem; }
.warning-box p { color: var(--fg); font-size: var(--fs-small); margin: 0; }

/* One-shot flash message rendered from session by base.html. */
.flash {
  padding: 0.75rem 1rem;
  border-radius: var(--r-md);
  margin-bottom: 1rem;
  font-size: var(--fs-body);
}
.flash-info {
  background: var(--ok-bg);
  color: var(--fg);
  border: 1px solid var(--ok-border);
  border-left: 3px solid var(--ok);
}
.flash-error {
  background: var(--bad-bg);
  color: var(--fg);
  border: 1px solid var(--bad-border);
  border-left: 3px solid var(--bad);
}

/* Skip-note on unchecked-account obligations */
.skip-note {
  color: var(--warn);
  font-size: var(--fs-micro);
  font-weight: 600;
  margin-top: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.obligation-row:has(.skip-note[style=""]) input,
.obligation-row:has(.skip-note[style=""]) select {
  opacity: 0.55;
}

/* --------------------------------------------------------------- review */
.review-form table { font-size: var(--fs-small); }
.review-form input:not([type="checkbox"]),
.review-form select {
  padding: 0.25rem 0.4rem;
  font-size: var(--fs-small);
  width: 100%;
  max-width: 12rem;
}
.review-form input.num { max-width: 7rem; }
.review-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}
/* First button (Add): primary blue. Second (Replace): destructive red. */
.review-actions button:last-child {
  background: var(--bad);
  border-color: var(--bad);
  color: var(--fg-inverse);
}
.review-actions button:last-child:hover {
  background: #ff8080;
  border-color: #ff8080;
}

/* ================================================================= chat */
/* Floating bubble bottom-right on every page. */
#chat-bubble {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 3rem;
  height: 3rem;
  padding: 0;
  border-radius: 999px;
  background: var(--accent);
  color: var(--fg-inverse);
  border: 1px solid var(--accent);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
}
#chat-bubble:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

/* Side panel (slide-in from right). */
#chat-panel {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 100%;
  max-width: 460px;
  background: var(--panel);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.18s ease-out;
  z-index: 50;
}
#chat-panel.open { transform: translateX(0); }
.chat-close {
  position: absolute;
  top: 0.5rem; right: 0.5rem;
  width: 2rem; height: 2rem;
  padding: 0;
  background: transparent;
  color: var(--fg-muted);
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
}
.chat-close:hover { color: var(--fg); background: var(--panel-hover); border-radius: var(--r-sm); }

#chat-panel-body {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;   /* let inner scroll work */
}

/* Full-page /chat variant */
.chat-fullpage {
  display: flex;
  flex-direction: column;
  height: 75vh;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
}

/* Shared chat internals (used by both) */
.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem 0.5rem;
  gap: 0.75rem;
}
.chat-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--fg);
}
.chat-newbtn {
  padding: 0.35rem 0.75rem;
  font-size: var(--fs-small);
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--border-strong);
}
.chat-newbtn:hover { background: var(--panel-hover); border-color: var(--accent); color: var(--accent-hover); }

.chat-convlist {
  max-height: 6.5rem;
  overflow-y: auto;
  padding: 0 0.75rem 0.5rem;
  border-bottom: 1px solid var(--border);
}
.chat-conv-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.35rem 0.5rem;
  border-radius: var(--r-sm);
  cursor: pointer;
  color: var(--fg-muted);
  font-size: var(--fs-small);
  gap: 0.5rem;
}
.chat-conv-item:hover { background: var(--panel-hover); color: var(--fg); }
.chat-conv-item.current { background: var(--panel-hover); color: var(--fg); }
.chat-conv-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}
.chat-conv-del {
  padding: 0 0.3rem;
  background: transparent;
  color: var(--fg-dim);
  border: none;
  font-size: 1rem;
  line-height: 1;
}
.chat-conv-del:hover { color: var(--bad); background: transparent; }

.chat-thread {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 1rem 1.25rem;
  min-height: 0;
}
.chat-msg { margin-bottom: 0.85rem; }
.chat-msg-body {
  padding: 0.6rem 0.85rem;
  border-radius: var(--r-md);
  font-size: var(--fs-body);
  line-height: 1.55;
}
.chat-msg-user .chat-msg-body {
  background: var(--accent-quiet);
  color: var(--fg);
  margin-left: 3rem;
  white-space: pre-wrap;
}
.chat-msg-assistant .chat-msg-body {
  background: var(--panel-alt);
  color: var(--fg);
  margin-right: 1.5rem;
  border: 1px solid var(--border);
}
.chat-msg-body :first-child { margin-top: 0; }
.chat-msg-body :last-child { margin-bottom: 0; }
.chat-msg-body h1, .chat-msg-body h2, .chat-msg-body h3, .chat-msg-body h4 {
  margin-top: 0.85rem; margin-bottom: 0.35rem;
}
.chat-msg-body h1 { font-size: 1.05rem; }
.chat-msg-body h2 { font-size: 1rem; }
.chat-msg-body h3, .chat-msg-body h4 { font-size: 0.95rem; text-transform: none; letter-spacing: 0; color: var(--fg); }
.chat-msg-body pre {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 0.5rem 0.75rem;
  overflow-x: auto;
  font-size: var(--fs-small);
  margin: 0.5rem 0;
}
.chat-msg-body code {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0 0.25rem;
  font-size: 0.85em;
}
.chat-msg-body pre code { background: none; border: none; padding: 0; }
.chat-msg-body table {
  margin: 0.5rem 0;
  font-size: var(--fs-small);
  background: var(--bg);
  border-color: var(--border);
}
.chat-msg-body table th, .chat-msg-body table td { padding: 0.3rem 0.5rem; }
.chat-msg-body ul, .chat-msg-body ol {
  margin: 0.4rem 0;
  padding-left: 1.25rem;
}
.chat-msg-body li { margin-bottom: 0.15rem; }

.chat-tool-note {
  padding: 0.35rem 0.85rem;
  margin: 0.25rem 1.5rem 0.85rem 0;
  color: var(--fg-muted);
  font-size: var(--fs-small);
  font-style: italic;
  border-left: 2px solid var(--accent-quiet);
  padding-left: 0.75rem;
}

.chat-proposal {
  background: var(--warn-bg);
  border: 1px solid var(--warn-border);
  border-radius: var(--r-md);
  padding: 0.85rem 1rem;
  margin: 0.5rem 0 0.85rem;
}
.chat-proposal-title {
  font-weight: 600;
  color: var(--warn);
  margin-bottom: 0.35rem;
}
.chat-proposal-rationale {
  color: var(--fg);
  font-size: var(--fs-small);
  margin-bottom: 0.5rem;
}
.chat-proposal-list {
  margin: 0.35rem 0 0.75rem 1.25rem;
  padding: 0;
  color: var(--fg);
  font-size: var(--fs-small);
}
.chat-proposal-list li { margin-bottom: 0.2rem; }
.chat-proposal-btns { display: flex; gap: 0.5rem; }
.chat-btn-primary {
  padding: 0.35rem 0.85rem;
  font-size: var(--fs-small);
  background: var(--accent);
  color: var(--fg-inverse);
  border: 1px solid var(--accent);
}
.chat-btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.chat-btn-quiet {
  padding: 0.35rem 0.85rem;
  font-size: var(--fs-small);
  background: transparent;
  color: var(--fg-muted);
  border: 1px solid var(--border-strong);
}
.chat-btn-quiet:hover { background: var(--panel-hover); color: var(--fg); }

.chat-input {
  margin: 0.75rem;
  padding: 0.6rem 0.85rem;
  font: inherit;
  font-size: var(--fs-body);
  background: var(--bg);
  color: var(--fg);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  resize: none;
  min-height: 2.5rem;
  max-height: 10rem;
  overflow-y: auto;
}
.chat-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-quiet); }

@media (max-width: 480px) {
  #chat-bubble { bottom: 1rem; right: 1rem; }
  .chat-msg-user .chat-msg-body { margin-left: 1rem; }
}
