/* Bank Assistant — modern design language ("Bank Assistant Mobile" canvas,
   artboards 4a/2a): warm off-white page, bubble-less assistant flow, flat
   white data cards with a single accent blue, no gradients. Mobile-first
   (390px reference), centered 680px column on desktop. */

*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  height: 100%;
}

:root {
  --bg: #fbfbfa;
  --ink: #12141a;
  --ink-inverse: #fbfbfa;
  --muted: #6b7383;
  --card: #ffffff;
  --line: rgba(18, 20, 26, 0.09);       /* card borders */
  --line-soft: rgba(18, 20, 26, 0.07);  /* in-card dividers */
  --accent: #1a4fff;
  --accent-soft: rgba(26, 79, 255, 0.08);
  --green: #0a8a4a;
  --green-soft: rgba(10, 138, 74, 0.08);
  --red: #b53e3e;
  --red-soft: rgba(181, 62, 62, 0.08);
  --amber: #e09a18;
  --amber-ink: #b07b12;
  --amber-soft: rgba(224, 154, 24, 0.1);
  --timer: #ffbf3f;                     /* countdown on the dark sheet */
  --radius-card: 20px;
  --radius-option: 16px;
  --mono: ui-monospace, Menlo, Monaco, monospace;
  --col: 680px;                          /* content column on desktop */
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Manrope', sans-serif;
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
  line-height: 1.55;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

button:disabled {
  cursor: default;
}

:focus-visible {
  outline: 2px solid rgba(26, 79, 255, 0.55);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.hidden,
[hidden] {
  display: none !important;
}

/* ── App frame ───────────────────────────────────────────────────────────── */

.app {
  height: 100dvh;
  display: flex;
  flex-direction: column;
}

.topbar {
  flex-shrink: 0;
  background: var(--bg);
  border-bottom: 1px solid var(--line-soft);
}

.topbar-inner {
  max-width: var(--col);
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  /* anchor for the popovers hanging off the header (user menu, bell) */
  position: relative;
}

.brand-logo {
  height: 26px;
  width: auto;
  display: block;
  border-radius: 5px;
}

.brand-divider {
  width: 1px;
  height: 18px;
  background: rgba(18, 20, 26, 0.12);
  display: block;
}

.brand-name {
  flex: 1;
  min-width: 0;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.approval-pill {
  display: flex;
  align-items: center;
  margin-left: auto;
  gap: 7px;
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  font-size: 11.5px;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.approval-pill .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulseDot 1.4s ease-in-out infinite;
}

.topbar-btn {
  height: 36px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid rgba(18, 20, 26, 0.1);
  background: var(--card);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
}

/* Narrow screens: while an approval is pending the pill takes the header —
   the wordmark and divider yield (the logo keeps the brand present). */
@media (max-width: 480px) {
  .topbar-inner:has(.approval-pill:not([hidden])) .brand-name,
  .topbar-inner:has(.approval-pill:not([hidden])) .brand-divider {
    display: none;
  }
}

.avatar-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(18, 20, 26, 0.1);
  background: var(--card);
  font-size: 12.5px;
  font-weight: 800;
  color: var(--ink);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Message flow ────────────────────────────────────────────────────────── */

.chat {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(18, 20, 26, 0.16) transparent;
}

.messages {
  max-width: var(--col);
  margin: 0 auto;
  padding: 18px 20px 10px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  /* Fill the scroll viewport, so a child with margin-top:auto (the
     opening notification panel) can sit at the bottom, by the composer. */
  min-height: 100%;
}

.message-user {
  align-self: flex-end;
  max-width: 78%;
  background: var(--ink);
  color: var(--ink-inverse);
  font-size: 14.5px;
  line-height: 1.45;
  font-weight: 500;
  padding: 11px 15px;
  border-radius: 20px 20px 4px 20px;
  overflow-wrap: break-word;
  white-space: pre-wrap;
}

/* One assistant turn: text bubbles + flat data cards, no avatar. */
.turn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
}

/* Cards and interactive blocks span the column; only text is a bubble. */
.turn > :not(.md) {
  align-self: stretch;
}

/* Agent text mirrors the user bubble: white, bottom-left corner tucked. */
.turn > .md {
  max-width: 85%;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px 20px 20px 4px;
  padding: 11px 15px;
}

.md {
  font-size: 15.5px;
  line-height: 1.55;
  letter-spacing: -0.005em;
  text-wrap: pretty;
  overflow-wrap: break-word;
}

.md > :first-child { margin-top: 0; }
.md > :last-child { margin-bottom: 0; }

.md p { margin: 0 0 10px; }
.md strong { font-weight: 800; }
.md ul, .md ol { margin: 0 0 10px; padding-left: 22px; }
.md li { margin: 3px 0; }
.md h1, .md h2, .md h3, .md h4 {
  margin: 14px 0 8px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.3;
}
.md h1 { font-size: 19px; }
.md h2 { font-size: 17px; }
.md h3, .md h4 { font-size: 15.5px; }
.md a { color: var(--accent); text-decoration: none; font-weight: 700; }
.md a:hover { text-decoration: underline; }
.md code {
  font-family: var(--mono);
  font-size: 0.85em;
  background: rgba(18, 20, 26, 0.05);
  border-radius: 6px;
  padding: 2px 6px;
}
.md pre {
  margin: 0 0 10px;
  padding: 12px 14px;
  background: rgba(18, 20, 26, 0.04);
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  overflow-x: auto;
}
.md pre code { background: none; padding: 0; }
.md blockquote {
  margin: 0 0 10px;
  padding: 2px 0 2px 14px;
  border-left: 3px solid rgba(26, 79, 255, 0.35);
  color: var(--muted);
}

/* Markdown tables (skill output) get the card-table treatment. */
.md table {
  border-collapse: collapse;
  width: 100%;
  margin: 0 0 10px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  font-size: 13px;
}
.md th {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: left;
  padding: 10px 12px 8px;
}
.md td {
  padding: 8px 12px;
  border-top: 1px solid var(--line-soft);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* System notices reuse the warning-alert look. */
.message-system {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 11px 13px;
  border-radius: 14px;
  background: var(--amber-soft);
  font-size: 13px;
  line-height: 1.45;
  font-weight: 500;
}

.message-system::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--amber-ink);
  margin-top: 6px;
  flex-shrink: 0;
}

/* ── Activity (tool) feed ────────────────────────────────────────────────── */

/* Minimal line: "3 araç · 4,2 sn" — live while streaming, summary after. */
.activity-min {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.01em;
  min-height: 18px;
}

.activity-min .dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

.activity-min.live .dot {
  animation: pulseDot 1.2s ease-in-out infinite;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.8); }
}

@media (prefers-reduced-motion: reduce) {
  .approval-pill .dot,
  .activity-min.live .dot { animation: none; }
}

/* Detail mode: the full call list, collapsible once the turn ends. */
.activity-feed {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.activity-line {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  overflow-wrap: break-word;
}

.activity-line.result {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  padding-left: 14px;
}

.activity-details summary {
  cursor: pointer;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.activity-details summary::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

.activity-details[open] summary { margin-bottom: 7px; }

/* Placeholder card shown from the moment render_ui starts until its
   contents finish generating — the real cards replace it. */
.skeleton-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--card);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.skeleton-bar {
  height: 12px;
  border-radius: 6px;
  background: rgba(18, 20, 26, 0.07);
  animation: skeletonPulse 1.4s ease-in-out infinite;
}

.skeleton-bar:nth-child(1) { width: 38%; height: 10px; }
.skeleton-bar:nth-child(2) { width: 60%; height: 22px; }
.skeleton-bar:nth-child(3) { width: 100%; animation-delay: 0.15s; }
.skeleton-bar:nth-child(4) { width: 84%; animation-delay: 0.3s; }

@keyframes skeletonPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

@media (prefers-reduced-motion: reduce) {
  .skeleton-bar { animation: none; }
}

/* ── Data cards (render_ui) ──────────────────────────────────────────────── */

.ui-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--card);
  overflow: hidden;
}

.ui-card > * + * {
  border-top: 1px solid var(--line-soft);
}

.ui-card-title {
  padding: 13px 16px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Header with a small-caps label over a large figure (+ optional chip). */
.ui-card-head {
  padding: 14px 16px 12px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
}

.ui-card-head-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.ui-card-head-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ui-card-head-value {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.ui-chip {
  font-size: 11.5px;
  font-weight: 800;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 8px;
  padding: 5px 9px;
  white-space: nowrap;
  flex-shrink: 0;
}

.ui-chip.pos { color: var(--green); background: var(--green-soft); }
.ui-chip.neg { color: var(--red); background: var(--red-soft); }
.ui-chip.muted { color: var(--muted); background: rgba(18, 20, 26, 0.06); }

/* Statement (ekstre) rows */
.ui-stmt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
}

.ui-stmt + .ui-stmt { border-top: 1px solid var(--line-soft); }

.ui-stmt-main { min-width: 0; }

.ui-stmt-period { font-size: 14.5px; font-weight: 700; }

.ui-stmt-dates {
  margin-top: 3px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}

.ui-stmt-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
  flex: none;
}

.ui-stmt-amount {
  font-size: 15px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.ui-stmt-empty { padding: 14px 16px; font-size: 13px; color: var(--muted); }

.ui-row {
  padding: 13px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.ui-row-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 14px;
  font-weight: 700;
}

.ui-row-title {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.ui-row-title > span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ui-row-sub {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ui-row-sub.iban { font-family: var(--mono); font-weight: 500; }

.ui-tag {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 6px;
  padding: 2px 7px;
  flex-shrink: 0;
}

.ui-tag.neg { color: var(--red); background: var(--red-soft); }

.ui-row-amount {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.ui-row-amount.neg { color: var(--red); }
.ui-row-amount.pos { color: var(--green); }

.ui-row-amount-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex-shrink: 0;
}

.ui-row-pnl {
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.ui-row-pnl.pos { color: var(--green); }
.ui-row-pnl.neg { color: var(--red); }

.ui-card-total {
  padding: 12px 16px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.ui-card-total strong {
  font-size: 15px;
  font-weight: 800;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

/* Transactions: date column · name/category · signed amount. */
.ui-tx {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.ui-tx-date {
  width: 46px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.ui-tx-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ui-tx-name {
  font-size: 13.5px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ui-tx-amount {
  font-size: 13.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.ui-tx-amount.pos { color: var(--green); }

/* Stat: one key figure. */
.ui-stat {
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--card);
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.ui-stat-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.ui-stat-value {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.035em;
  font-variant-numeric: tabular-nums;
  overflow-wrap: break-word;
}

.ui-stat-note {
  font-size: 12.5px;
  color: var(--muted);
  font-weight: 600;
}

.ui-stat-note:empty { display: none; }

/* Table. */
.ui-table-wrap {
  overflow-x: auto;
}

.ui-table {
  border-collapse: collapse;
  width: 100%;
  font-size: 13px;
}

.ui-table th {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: left;
  padding: 11px 16px 8px;
  white-space: nowrap;
}

.ui-table td {
  padding: 9px 16px;
  border-top: 1px solid var(--line-soft);
  font-weight: 600;
  white-space: nowrap;
}

.ui-table th.num, .ui-table td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

/* Bar chart — vertical columns (time series), last bar accented. */
.ui-bars {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ui-bars-track {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  height: 120px;
}

.ui-bar-col {
  flex: 1;
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.ui-bar-val {
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.ui-bar {
  width: 100%;
  background: rgba(26, 79, 255, 0.16);
  border-radius: 6px 6px 0 0;
}

.ui-bar-col.accent .ui-bar { background: var(--accent); }

.ui-bars-labels {
  display: flex;
  gap: 10px;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-align: center;
}

.ui-bars-labels span {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ui-bars-labels span.accent { color: var(--accent); }

/* Diverging bars (mixed signs): zero baseline, positive up, negative down. */
.ui-bar-col.diverging { justify-content: flex-start; gap: 4px; }

.ui-bar-zone {
  width: 100%;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.ui-bar-zone.up { justify-content: flex-end; border-bottom: 1.5px solid rgba(18, 20, 26, 0.22); }
.ui-bar-zone.down { justify-content: flex-start; }

.ui-bar-zone .ui-bar { border-radius: 6px 6px 0 0; }
.ui-bar-zone.down .ui-bar { border-radius: 0 0 6px 6px; }

/* Semantic and symmetric: green up, red down, equal visual weight —
   the same gain/loss language as holdings P&L. */
.ui-bar.pos { background: rgba(10, 138, 74, 0.55); }
.ui-bar.neg { background: rgba(181, 62, 62, 0.55); }
.ui-bar-val.pos { color: var(--green); }
.ui-bar-val.neg { color: var(--red); }
.ui-hbar-fill.neg { background: rgba(181, 62, 62, 0.55); }

/* Bar chart — horizontal fallback for long labels / many bars. */
.ui-hbars {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ui-hbar-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  font-size: 13.5px;
  margin-bottom: 5px;
}

.ui-hbar-head span:first-child {
  font-weight: 600;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ui-hbar-head span:last-child {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.ui-hbar-track {
  height: 8px;
  border-radius: 4px;
  background: rgba(18, 20, 26, 0.06);
  overflow: hidden;
}

.ui-hbar-fill {
  height: 100%;
  border-radius: 4px;
  background: var(--accent);
}

/* Category breakdown: segmented bar + legend rows. */
.ui-cats {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ui-seg-bar {
  display: flex;
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  gap: 2px;
}

.ui-seg-bar span {
  display: block;
}

.ui-cat-rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ui-cat-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
}

.ui-cat-dot {
  width: 7px;
  height: 7px;
  border-radius: 2px;
  flex-shrink: 0;
}

.ui-cat-label {
  flex: 1;
  min-width: 0;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ui-cat-pct {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.ui-cat-amount {
  min-width: 66px;
  text-align: right;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Alerts: tinted rows with a level dot. */
.ui-alert {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 11px 13px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.45;
  font-weight: 500;
}

.ui-alert .ui-alert-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-top: 6px;
  flex-shrink: 0;
}

.ui-alert.info { background: rgba(26, 79, 255, 0.06); }
.ui-alert.info .ui-alert-dot { background: var(--accent); }
.ui-alert.warning { background: var(--amber-soft); }
.ui-alert.warning .ui-alert-dot { background: var(--amber-ink); }
.ui-alert.success { background: rgba(10, 138, 74, 0.09); }
.ui-alert.success .ui-alert-dot { background: var(--green); }

/* Detail card: one entity in depth — headline value, label→value rows,
   optional warning strip ("Vadeden önce bozarsanız faiz işlemez."). */
.ui-detail-rows {
  padding: 6px 16px 14px;
  display: flex;
  flex-direction: column;
}

.ui-detail-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
}

.ui-detail-row + .ui-detail-row {
  border-top: 1px solid var(--line-soft);
}

.ui-detail-row-label {
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}

.ui-detail-row-value {
  font-size: 13.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: right;
  overflow-wrap: break-word;
}

.ui-detail-note {
  padding: 11px 16px;
  background: var(--amber-soft);
  font-size: 12.5px;
  line-height: 1.45;
  font-weight: 600;
}

/* ── Credit card (one card in depth) ─────────────────────────────────────── */

/* The card face: flat ink rectangle like the user bubble — the one place
   the component looks like the physical object it describes. */
.ui-ccard-face {
  margin: 14px 16px 0;
  padding: 16px 18px;
  border-radius: 14px;
  background: var(--ink);
  color: var(--ink-inverse);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ui-ccard-name {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ui-ccard-num {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.12em;
  opacity: 0.75;
  white-space: nowrap;
}

.ui-ccard-limit {
  padding: 4px 16px 14px;
}

.ui-ccard-bar {
  height: 6px;
  border-radius: 999px;
  background: var(--accent-soft);
  overflow: hidden;
}

.ui-ccard-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
}

.ui-ccard-limit-cap {
  margin-top: 7px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.ui-ccard-overdue {
  padding: 11px 16px;
  background: var(--red-soft);
  color: var(--red);
  font-size: 12.5px;
  line-height: 1.45;
  font-weight: 700;
}

/* ── Choice ("hangisi?") ─────────────────────────────────────────────────── */

.choice-block {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.choice-question {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.45;
}

.choice-note {
  font-size: 12.5px;
  color: var(--muted);
  font-weight: 600;
  line-height: 1.45;
  margin-top: -8px;
}

.choice-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.choice-card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 13px 15px;
  border-radius: var(--radius-option);
  border: 1px solid rgba(18, 20, 26, 0.1);
  background: var(--card);
  color: var(--ink);
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.choice-list .choice-card:first-child {
  border-color: var(--ink);
}

.choice-card:not(:disabled):hover {
  border-color: var(--accent);
}

.choice-card.picked {
  border-color: var(--accent);
  background: rgba(26, 79, 255, 0.04);
}

.choice-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(18, 20, 26, 0.05);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.choice-list .choice-card:first-child .choice-avatar,
.choice-card.picked .choice-avatar {
  background: rgba(26, 79, 255, 0.1);
  color: var(--accent);
}

.choice-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.choice-label {
  font-size: 14px;
  font-weight: 700;
  overflow-wrap: break-word;
}

.choice-label.iban,
.choice-sub.iban {
  font-family: var(--mono);
  font-weight: 600;
}

.choice-sub {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
  overflow-wrap: break-word;
}

.choice-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.choice-chip {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--muted);
  background: rgba(18, 20, 26, 0.05);
  border-radius: 7px;
  padding: 3px 9px;
}

.choice-list .choice-card:first-child .choice-chip,
.choice-card.picked .choice-chip {
  color: var(--accent);
  background: var(--accent-soft);
}

.choice-block.stale .choice-card {
  opacity: 0.55;
}

.choice-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--accent);
}

.choice-status::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

/* ── Assistant's note above the approval sheet (light, clearly not the bank) */

.approval-note {
  border-radius: var(--radius-card);
  background: var(--card);
  border: 1px solid var(--line);
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: -4px;
}

.approval-note-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.approval-note-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  font-size: 13.5px;
  line-height: 1.45;
}

.approval-note-label {
  color: var(--muted);
  flex-shrink: 0;
}

.approval-note-value {
  font-weight: 600;
  text-align: right;
  overflow-wrap: anywhere;
}

.approval-note-row.iban .approval-note-value {
  font-family: var(--mono);
  font-size: 0.92em;
}

.approval-note-row.warning .approval-note-value {
  color: var(--amber-ink);
}

/* ── Bank approval (elicitation) — the dark sheet ────────────────────────── */

.approval-card {
  border-radius: 26px;
  background: var(--ink);
  color: var(--ink-inverse);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.approval-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.approval-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(251, 251, 250, 0.55);
}

.approval-timer {
  font-size: 11.5px;
  font-weight: 800;
  color: var(--timer);
  font-variant-numeric: tabular-nums;
}

.approval-text {
  font-size: 14.5px;
  line-height: 1.5;
  font-weight: 500;
  overflow-wrap: break-word;
}

.approval-text .elicitation-amt {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.approval-text .elicitation-acct {
  font-family: var(--mono);
  font-size: 0.85em;
  color: rgba(251, 251, 250, 0.6);
}

.approval-wait-bar {
  height: 4px;
  border-radius: 2px;
  background: rgba(251, 251, 250, 0.14);
  overflow: hidden;
}

.approval-wait-fill {
  height: 100%;
  border-radius: 2px;
  background: var(--timer);
}

.approval-actions {
  display: flex;
  gap: 10px;
}

.approval-btn {
  border-radius: 15px;
  padding: 14px 12px;
  font-size: 13.5px;
}

.approval-btn.reject {
  flex: 1;
  font-weight: 700;
  border: 1px solid rgba(251, 251, 250, 0.2);
  background: transparent;
  color: rgba(251, 251, 250, 0.8);
}

.approval-btn.approve {
  flex: 1.6;
  font-weight: 800;
  border: 0;
  background: var(--accent);
  color: #fff;
}

.approval-btn:disabled { opacity: 0.5; }

.approval-status {
  font-size: 13px;
  font-weight: 700;
}

.approval-status.ok { color: #6fdb9e; }
.approval-status.no { color: rgba(251, 251, 250, 0.7); }
.approval-status.expired { color: var(--timer); }

/* ── Composer ────────────────────────────────────────────────────────────── */

.composer-zone {
  flex-shrink: 0;
  background: var(--bg);
}

.composer {
  max-width: var(--col);
  margin: 0 auto;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.composer-field {
  flex: 1;
  min-width: 0;
  min-height: 50px;
  display: flex;
  align-items: center;
  border-radius: 25px;
  border: 1px solid rgba(18, 20, 26, 0.1);
  background: var(--card);
  padding: 6px 18px;
  transition: border-color 0.15s ease;
}

.composer-field:focus-within {
  border-color: var(--accent);
}

.composer textarea {
  flex: 1;
  min-width: 0;
  border: 0;
  background: none;
  resize: none;
  font: inherit;
  font-size: 14.5px;
  line-height: 1.45;
  color: var(--ink);
  outline: none;
  padding: 8px 0;
  max-height: 120px;
}

.composer textarea::placeholder {
  color: var(--muted);
}

/* iOS Safari auto-zooms on focus when an input's font is under 16px —
   meet the threshold on touch-sized screens so typing doesn't jump. */
@media (max-width: 1023px) {
  .composer textarea {
    font-size: 16px;
  }
}

.send-button {
  width: 50px;
  height: 50px;
  flex-shrink: 0;
  border: 0;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.send-button:disabled {
  opacity: 0.5;
}

.spinner {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  animation: spin 0.8s linear infinite;
}

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

/* ── Sessions sheet ("Sohbetler") ────────────────────────────────────────── */

.scrim {
  position: fixed;
  inset: 0;
  background: rgba(18, 20, 26, 0.45);
  z-index: 40;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.scrim.open { opacity: 1; }

.sheet {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translate(-50%, 105%);
  width: min(100%, 480px);
  max-height: 88dvh;
  background: var(--bg);
  border-radius: 28px 28px 0 0;
  box-shadow: 0 -20px 50px rgba(18, 20, 26, 0.25);
  z-index: 41;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease;
}

.sheet.open { transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  .scrim, .sheet { transition: none; }
}

/* Mobile sheet modes: "Sohbetler" opens conversations only, the avatar
   opens the user picker only — mirroring the desktop sidebar/popover split.
   (The docked desktop sidebar hides the user section by its own rule.) */
.sheet.mode-threads .user-section { display: none; }
.sheet.mode-users .threads-section,
.sheet.mode-users .sheet-foot,
.sheet.mode-users .pill-btn,
.sheet.mode-users .user-section .sheet-section-label { display: none; }

.sheet-grab {
  width: 42px;
  height: 5px;
  border-radius: 999px;
  background: rgba(18, 20, 26, 0.18);
  align-self: center;
  margin: 10px 0 4px;
  flex-shrink: 0;
}

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 18px 4px;
  flex-shrink: 0;
}

.sheet-head h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.pill-btn {
  height: 38px;
  padding: 0 16px;
  border-radius: 19px;
  border: 0;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}

.sheet-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 10px 18px 6px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scrollbar-width: thin;
  scrollbar-color: rgba(18, 20, 26, 0.16) transparent;
}

.sheet-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sheet-section-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.session-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.session-item .session-row {
  flex: 1;
  min-width: 0;
}

/* Delete = destroy (history + server state). The trash opens a real
   confirmation dialog — see .confirm-dialog. */
.session-delete {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.session-delete:hover {
  color: var(--red);
  border-color: rgba(181, 62, 62, 0.35);
}

/* Destructive-action confirmation: centered card above everything,
   including the sessions sheet. */
.scrim.confirm-layer {
  z-index: 60;
  opacity: 1;
  transition: none;
}

.confirm-dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(calc(100% - 40px), 360px);
  background: var(--bg);
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(18, 20, 26, 0.3);
  padding: 20px;
  z-index: 61;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.confirm-title {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.confirm-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  background: rgba(18, 20, 26, 0.05);
  border-radius: 10px;
  padding: 8px 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.confirm-body {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--muted);
  font-weight: 600;
}

.confirm-actions {
  display: flex;
  gap: 10px;
  margin-top: 6px;
}

.confirm-btn {
  border-radius: 14px;
  padding: 12px;
  font-size: 13.5px;
  font-weight: 700;
}

.confirm-btn.cancel {
  flex: 1;
  border: 1px solid rgba(18, 20, 26, 0.12);
  background: var(--card);
  color: var(--ink);
}

.confirm-btn.danger {
  flex: 1.4;
  border: 0;
  background: var(--red);
  color: #fff;
  font-weight: 800;
}

.confirm-btn.danger:disabled {
  opacity: 0.6;
}

.session-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  border-radius: var(--radius-option);
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.session-row:not(:disabled):hover {
  border-color: rgba(26, 79, 255, 0.4);
}

.session-row.active {
  border: 1.5px solid var(--accent);
  background: rgba(26, 79, 255, 0.05);
  padding: 11.5px 13.5px;
}

.session-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(26, 79, 255, 0.1);
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.session-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(107, 115, 131, 0.35);
  flex-shrink: 0;
}

.session-row.active .session-dot { background: var(--accent); }

.session-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.session-title {
  font-size: 13.5px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.session-sub {
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.session-chip {
  font-size: 10.5px;
  font-weight: 800;
  color: var(--accent);
  background: rgba(26, 79, 255, 0.1);
  border-radius: 999px;
  padding: 3px 9px;
  flex-shrink: 0;
}

.session-empty {
  font-size: 12.5px;
  color: var(--muted);
  font-weight: 600;
  padding: 4px 2px;
}

.sheet-foot {
  flex-shrink: 0;
  padding: 10px 18px calc(14px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid rgba(26, 79, 255, 0.12);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.model-info {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--muted);
  font-family: var(--mono);
  padding: 2px 2px 0;
}

.model-picker-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 2px 2px 0;
}

.model-picker-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.model-picker {
  flex: 1;
  min-width: 0;
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  color: var(--ink);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  padding: 7px 28px 7px 10px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23888' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  cursor: pointer;
}

.model-picker:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 10px 2px;
  border: 0;
  background: none;
  text-align: left;
}

.toggle-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.toggle-title {
  font-size: 13.5px;
  font-weight: 700;
}

.toggle-sub {
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 600;
}

.switch {
  width: 50px;
  height: 30px;
  border-radius: 999px;
  background: rgba(18, 20, 26, 0.14);
  display: flex;
  align-items: center;
  padding: 3px;
  flex-shrink: 0;
  transition: background-color 0.15s ease;
}

.switch .knob {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  display: block;
  box-shadow: 0 2px 6px rgba(18, 20, 26, 0.25);
  transition: transform 0.15s ease;
}

.switch.on {
  background: var(--accent);
}

.switch.on .knob {
  transform: translateX(20px);
}

.danger-btn {
  width: 100%;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--red);
  background: rgba(181, 62, 62, 0.07);
  border: 1px solid rgba(181, 62, 62, 0.2);
  border-radius: 14px;
  padding: 13px;
}

.danger-btn:disabled {
  opacity: 0.45;
}

/* ── Desktop (≥1024px): collapsible left sidebar + avatar user menu ──────── */

/* The hamburger and the user popover exist only on desktop. */
.sidebar-toggle {
  display: none;
}

.user-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 20px;
  width: 300px;
  /* long user lists scroll inside the popover instead of running off-screen */
  max-height: calc(100vh - 90px);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 16px 40px rgba(18, 20, 26, 0.16);
  padding: 14px;
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.user-menu-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(18, 20, 26, 0.16) transparent;
}

@media (min-width: 1024px) {
  .app {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr) auto;
    grid-template-areas:
      'top'
      'chat'
      'comp';
  }

  /* Sidebar open: the docked sheet takes a fixed left column. */
  .app.sidebar-open {
    grid-template-columns: 320px minmax(0, 1fr);
    grid-template-areas:
      'top  top'
      'side chat'
      'side comp';
  }

  .topbar { grid-area: top; }
  .chat { grid-area: chat; }
  .composer-zone { grid-area: comp; }

  /* Brand sits top-left; the hamburger opens/closes the conversations
     sidebar; the avatar opens the user menu; the mobile opener goes away. */
  .topbar-inner { max-width: none; position: relative; }
  #sessionsBtn { display: none; }
  .scrim { display: none !important; }

  .sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid rgba(18, 20, 26, 0.1);
    background: var(--card);
    color: var(--ink);
    flex-shrink: 0;
  }

  .sidebar-toggle.active {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-soft);
  }

  .sheet.docked {
    display: flex;
    grid-area: side;
    position: static;
    transform: none;
    width: auto;
    max-height: none;
    min-height: 0;
    border-radius: 0;
    box-shadow: none;
    border-right: 1px solid var(--line-soft);
    transition: none;
  }

  .sheet.docked .sheet-grab { display: none; }
  .sheet.docked .sheet-head { padding-top: 18px; }
  .sheet.docked .sheet-foot { padding-bottom: 14px; }

  /* Users live under the avatar on desktop, not in the sidebar. */
  .sheet.docked .user-section { display: none; }

  /* A little more room for the conversation next to the sidebar. */
  :root { --col: 760px; }
}

/* ── Bildirimler: bell + reminder cards ──────────────────────────────────── */

/* Reminders are the one place the design carries color beyond the accent:
   each card is a separate thing to decide, and a tone per card is what
   keeps five of them from reading as one wall of text. Tones are soft
   tints of the palette's own hues — still flat, still no gradients. */
/* Beşli ton paleti (tone-violet/amber/blue/red/green) buradaydı; onay kaydı
   artık panel satırıyla aynı nötr kabuğu kullanıyor, tonlar kaldırıldı. */

.bell-btn {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(18, 20, 26, 0.1);
  background: var(--card);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.bell-btn.has-pending {
  color: var(--accent);
  border-color: rgba(26, 79, 255, 0.28);
  background: var(--accent-soft);
}

.bell-btn.open {
  border-color: var(--accent);
}

.bell-count {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  border: 2px solid var(--bg);
  background: var(--red);
  color: #fff;
  font-size: 10.5px;
  font-weight: 800;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* A card arriving in the bell should read as an arrival, not as a number
   that quietly changed. */
@keyframes bellRing {
  0%, 100% { transform: rotate(0); }
  20% { transform: rotate(-14deg); }
  40% { transform: rotate(11deg); }
  60% { transform: rotate(-7deg); }
  80% { transform: rotate(4deg); }
}

@keyframes countPop {
  0% { transform: scale(1); }
  35% { transform: scale(1.55); }
  100% { transform: scale(1); }
}

.bell-btn.ring svg { animation: bellRing 0.65s ease; }
.bell-btn.ring .bell-count { animation: countPop 0.5s ease; }

@keyframes popoverIn {
  from { opacity: 0; transform: translateY(-6px) scale(0.985); }
  to { opacity: 1; transform: none; }
}

.bell-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 20px;
  width: min(360px, calc(100vw - 24px));
  max-height: min(70vh, calc(100vh - 100px));
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(18, 20, 26, 0.16) transparent;
  /* Same white card as the opening panel — the two homes of one row. */
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: 0 16px 40px rgba(18, 20, 26, 0.16);
  padding: 14px;
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transform-origin: top right;
  animation: popoverIn 0.18s ease;
}

.bell-panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.bell-panel-count {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted);
}

.bell-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.notif-empty {
  font-size: 13px;
  color: var(--muted);
  padding: 6px 2px 2px;
}

/* ── The opening panel: one white card, header + rows + footer ─────────── */

.notif-panel {
  align-self: stretch;
  /* Anchor to the bottom of the (min-height:100%) message column: the
     panel belongs next to the composer, not floating under the greeting. */
  margin-top: auto;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: 0 10px 30px rgba(18, 20, 26, 0.07);
  overflow: hidden;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.notif-panel.in { opacity: 1; transform: none; }
.notif-panel.leaving { opacity: 0; transform: translateY(-8px); }

.np-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line-soft);
  cursor: pointer;
  user-select: none;
}

.np-bellchip {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid;
  place-items: center;
  flex: none;
}

.np-title {
  font-size: 15px;
  font-weight: 700;
  flex: 1;
}

.np-toggle {
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  display: grid;
  place-items: center;
  cursor: pointer;
}

.np-toggle:hover { background: var(--accent-soft); color: var(--ink); }
.np-toggle svg { transition: transform 0.25s ease; }
.notif-panel.collapsed .np-toggle svg { transform: rotate(-90deg); }
.notif-panel.collapsed .np-head { border-bottom-color: transparent; }
.notif-panel.collapsed .np-body,
.notif-panel.collapsed .np-more { display: none; }

/* Each reminder is its own rounded card — the same card language as the
   user picker's rows — inside a spaced body rather than divider-separated
   flat rows. */
.np-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 14px 14px;
}

.np-row {
  position: relative;             /* anchors the corner ✕ */
  display: flex;
  align-items: center;
  gap: 12px;
  /* right padding clears the corner ✕, so amount and button keep one
     straight right edge beneath it */
  padding: 12px 40px 12px 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-option);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.np-row:hover {
  border-color: rgba(26, 79, 255, 0.28);
  box-shadow: 0 4px 14px rgba(18, 20, 26, 0.06);
}

.np-row.settled:hover { border-color: var(--line); box-shadow: none; }

.np-ico {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid;
  place-items: center;
  flex: none;
}

.np-main { flex: 1; min-width: 0; }

.np-name {
  font-size: 14.5px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Fallback for rows written before the structured columns: the report
   sentence needs room, so it may wrap. */
.np-name.plain { font-weight: 600; white-space: normal; font-size: 13.5px; }

.np-sub {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 5px;
}

.np-pill {
  font-size: 12px;
  font-weight: 600;
  padding: 2.5px 9px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  white-space: nowrap;
}

/* due_date geçmiş, kart hâlâ deadline'a kadar ekranda: gecikme. */
.np-pill.overdue { background: var(--red-soft); color: var(--red); }
/* Ödemenin beklendiği gün. --amber-ink, --amber'a göre koyu: küçük punto
   rozet metninin açık zeminde okunabilir kalması için. */
.np-pill.today { background: var(--amber-soft); color: var(--amber-ink); }

.np-date { font-size: 12.5px; color: var(--muted); white-space: nowrap; }

.np-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 7px;
  flex: none;
}

.np-amount {
  font-size: 15.5px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Carries .notif-btn only so the decide path's disable selector finds it —
   undo that class's fixed 36px square (two-class selector: .notif-btn is
   defined later in this file and would win a single-class tie). */
.notif-btn.np-pay {
  width: auto;
  height: auto;
  border: none;
  border-radius: 999px;
  background: var(--accent);
  color: var(--ink-inverse);
  font-size: 13px;
  font-weight: 700;
  padding: 8px 16px;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.notif-btn.np-pay:not(:disabled):hover { transform: translateY(-1px); }
.notif-btn.np-pay:disabled { opacity: 0.55; }

.np-row.settled .notif-btn { display: none; }
.np-row .notif-status { margin-top: 2px; }
.np-row .notif-error { flex-basis: 100%; }

.np-more {
  display: block;
  width: 100%;
  border: none;
  border-top: 1px solid var(--line-soft);
  background: transparent;
  color: var(--accent);
  font-size: 13.5px;
  font-weight: 600;
  padding: 11px 16px;
  cursor: pointer;
}

.np-more:hover { background: var(--accent-soft); }

@media (max-width: 480px) {
  .np-row { flex-wrap: wrap; }
  .np-side { flex-direction: row; align-items: center; width: 100%;
             justify-content: space-between; padding-left: 52px; }
}

/* Classic reminder card — the bell's rows and the in-conversation record
   of an approved reminder. */
/* Sohbete düşen onay kaydı: panel satırının (.np-row) aynı düzeni — ikon,
   metin, sağda tutar — ama butonsuz ve renksiz. Kendi tonu, kicker'ı ve
   "Son ödeme ..." satırı vardı; sohbette asistan balonuna benzeyen ayrı bir
   dil kuruyordu. Gövdeyi .np-* sınıfları çizdiği için burada yalnızca
   kabuk tanımlanıyor. */
.notif-card {
  display: flex;
  align-items: center;
  flex-wrap: wrap;                /* durum satırı alta geçsin */
  gap: 12px;
  padding: 12px 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-option);
}

/* Tutarın yanına sıkışmasın: kendi satırına insin. */
.notif-card .notif-status { flex-basis: 100%; }

/* .notif-actions / .notif-hint ("Onaylarsanız asistan işlemi başlatır") ve
   .notif-btn.yes / .no buradaydı: hepsi eski onay kartının butonlarına
   aitti. Onay kaydı artık butonsuz, bekleyen satır ise .np-pay / .np-no
   kullanıyor — kaldırıldılar. */
.notif-btn {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.12s ease, background 0.15s ease, opacity 0.15s ease;
}

.notif-btn:not(:disabled):hover { transform: translateY(-1px); }
.notif-btn:disabled { opacity: 0.5; }

.notif-status {
  font-size: 12.5px;
  font-weight: 700;
}

.notif-status.ok { color: var(--green); }
.notif-status.no { color: var(--muted); }
.notif-status.gone { color: var(--muted); }

.notif-card.settled { opacity: 0.92; }

/* An approval replayed from the transcript: same card, no buttons, full
   width like the cards it once sat among. */
.notif-history { align-self: stretch; }

.notif-error {
  font-size: 12px;
  font-weight: 600;
  color: var(--red);
}

/* Bell rows: the same np-row card, stacked for the narrow dropdown — icon
   and text up top, amount + buttons on their own line beneath. */
.bell-list .np-row {
  flex-wrap: wrap;
}

.bell-list .np-side {
  flex-direction: row;
  align-items: center;
  width: 100%;
  justify-content: flex-end;
  gap: 10px;
}

.bell-list .np-amount { margin-right: auto; }

/* The decline ✕, pinned to the card's top-right corner in both homes —
   "delete this reminder", visually apart from the pay action. */
.notif-btn.np-no {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: var(--muted);
}

.notif-btn.np-no svg { width: 13px; height: 13px; }

.notif-btn.np-no:not(:disabled):hover {
  color: var(--red);
  background: var(--red-soft);
}

@media (prefers-reduced-motion: reduce) {
  .bell-btn.ring svg,
  .bell-btn.ring .bell-count,
  .bell-panel { animation: none; }
  .notif-slot,
  .notif-card { transition: none; }
}

/* ── Scrollbars (WebKit) ─────────────────────────────────────────────────── */

.chat::-webkit-scrollbar,
.sheet-body::-webkit-scrollbar,
.ui-table-wrap::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.chat::-webkit-scrollbar-thumb,
.sheet-body::-webkit-scrollbar-thumb,
.ui-table-wrap::-webkit-scrollbar-thumb {
  background: rgba(18, 20, 26, 0.16);
  border-radius: 3px;
}
