:root {
  --bg: #faf7f2;
  --surface: #faf7f2;
  --surface-2: #ffffff;
  --surface-3: #1E2230;
  --border: #ded5c7;
  --border-light: #2E3448;
  --accent: #c9a567;
  --accent-dim: rgba(201,165,103,0.12);
  --accent-mid: rgba(201,165,103,0.25);
  --red: #FF5757;
  --red-dim: rgba(255,87,87,0.12);
  --orange: #FF9A3C;
  --orange-dim: rgba(255,154,60,0.12);
  --yellow: #FFD166;
  --green: #e6c896;
  --green-dim: rgba(78,250,138,0.1);
  --text: #141414;
  --text-soft: #5a6169;
  --text-muted: #5a6169;
  --ink: #FFFFFF;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  background: var(--bg); color: var(--text);
  font-family: 'DM Sans', sans-serif; font-size: 14px;
  line-height: 1.5; -webkit-font-smoothing: antialiased; min-height: 100vh;
}
.serif { font-family: 'DM Serif Display', Georgia, serif; }
.mono { font-family: 'JetBrains Mono', monospace; }

/* HEADER */
header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(10,11,14,0.94); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 32px; height: 56px;
  display: flex; align-items: center; justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 26px; height: 26px; background: var(--accent);
  clip-path: polygon(50% 0%,100% 25%,100% 75%,50% 100%,0% 75%,0% 25%);
}
.brand-name { font-family: 'DM Serif Display', serif; font-size: 17px; color: var(--ink); letter-spacing: -.01em; }
.brand-name span { color: var(--accent); }
.header-right { display: flex; align-items: center; gap: 20px; }
.status-pill {
  display: flex; align-items: center; gap: 6px;
  background: var(--accent-dim); border: 1px solid rgba(201,165,103,0.2);
  border-radius: 20px; padding: 4px 12px;
  font-size: 11px; font-family: 'JetBrains Mono', monospace;
  letter-spacing: .06em; color: var(--accent);
}
.status-pill .dot {
  width: 6px; height: 6px; background: var(--accent); border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.3} }
.user-info { font-size: 12px; color: var(--text-soft); }
.user-info strong { color: var(--text); }

/* NAV */
nav {
  background: var(--surface); border-bottom: 1px solid var(--border);
  padding: 0 32px; display: flex;
}
.nav-tab {
  padding: 14px 20px; font-size: 11px; font-weight: 500;
  letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted);
  cursor: pointer; border-bottom: 2px solid transparent; transition: all .2s;
  font-family: 'JetBrains Mono', monospace;
}
.nav-tab:hover { color: var(--text-soft); }
.nav-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* LAYOUT */
main { max-width: 1440px; margin: 0 auto; padding: 32px; }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* SECTION HEADER */
.section-header { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 24px; }
.section-title { font-family: 'DM Serif Display', serif; font-size: 28px; color: var(--ink); letter-spacing: -.02em; line-height: 1; }
.section-subtitle { font-size: 10px; color: var(--text-muted); margin-top: 5px; font-family: 'JetBrains Mono', monospace; letter-spacing: .08em; }
.section-actions { display: flex; gap: 8px; }

/* BUTTONS */
.btn {
  padding: 8px 16px; border-radius: 6px; font-size: 12px; font-weight: 500;
  cursor: pointer; border: 1px solid var(--border-light);
  background: var(--surface-2); color: var(--text-soft); transition: all .15s;
  font-family: 'DM Sans', sans-serif;
}
.btn:hover { background: var(--surface-3); color: var(--text); }
.btn-accent {
  background: var(--accent); color: #faf7f2; border-color: var(--accent); font-weight: 600;
}
.btn-accent:hover { background: #b8934f; border-color: #b8934f; }


/* MAIN GRID — flex so each card's inline width/height (from resize:both) sticks. */
.dash-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 32px; 
  align-items: start;
}

/* CARD — resize:both works in both axes thanks to the flex parent.
   flex: 1 1 440px = default 440px wide, can grow to fill row, can shrink to min-width. */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  resize: both;
  flex: 1 1 440px;
  min-width: 320px;
  min-height: 200px;
}
/* When the user drags-resizes a card, the JS observer sets inline width — flex-basis must yield to it.
   We tag the card so a later resize commits to fixed-size mode. */
.card[data-dm-user-sized="1"] { flex: 0 0 auto; }
.card-header {
  flex-shrink: 0;
  padding: 16px 22px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.card-title { font-size: 13px; font-weight: 600; color: var(--text); }
.card-body { padding: 22px; flex: 1; overflow: auto; }

/* PROFIT BARS */
.profit-chart { display: flex; flex-direction: column; gap: 10px; }
.profit-row { display: grid; grid-template-columns: 120px 1fr 90px; align-items: center; gap: 12px; }
.profit-label { font-size: 11px; font-family: 'JetBrains Mono', monospace; color: var(--text-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profit-bar-wrap { height: 8px; background: var(--surface-3); border-radius: 4px; overflow: hidden; }
.profit-bar { height: 100%; border-radius: 4px; transition: width .6s cubic-bezier(.4,0,.2,1); }
.profit-bar.pos { background: linear-gradient(90deg, var(--green), #3EFFA0); }
.profit-bar.neg { background: linear-gradient(90deg, var(--red), #FF8080); }
.profit-val { font-size: 12px; font-family: 'JetBrains Mono', monospace; font-weight: 600; text-align: right; }
.profit-val.pos { color: var(--green); }
.profit-val.neg { color: var(--red); }

/* AVA CHAT */
.ava-panel { display: flex; flex-direction: column; height: 420px; }
.ava-messages {
  flex: 1; overflow-y: auto; padding: 16px;
  display: flex; flex-direction: column; gap: 12px;
  scrollbar-width: thin; scrollbar-color: var(--border) transparent;
}
.msg { display: flex; flex-direction: column; gap: 4px; max-width: 88%; }
.msg.ava { align-self: flex-start; }
.msg.user { align-self: flex-end; }
.msg-bubble { padding: 10px 14px; border-radius: 10px; font-size: 13px; line-height: 1.5; }
.msg.ava .msg-bubble { background: var(--surface-2); border: 1px solid var(--border); color: var(--text); border-bottom-left-radius: 3px; }
.msg.user .msg-bubble { background: var(--accent-dim); border: 1px solid rgba(201,165,103,0.2); color: var(--accent); border-bottom-right-radius: 3px; }
.msg-sender { font-size: 10px; font-family: 'JetBrains Mono', monospace; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); padding: 0 4px; }
.msg.user .msg-sender { text-align: right; color: rgba(201,165,103,0.5); }

/* Markdown rendering inside Ava bubbles */
.msg.ava .msg-bubble p { margin: 0 0 8px; }
.msg.ava .msg-bubble p:last-child { margin-bottom: 0; }
.msg.ava .msg-bubble strong { color: var(--ink); font-weight: 600; }
.msg.ava .msg-bubble code { font-family: 'JetBrains Mono', monospace; font-size: 12px; background: var(--surface-3); padding: 1px 5px; border-radius: 3px; color: var(--accent); }
.msg.ava .msg-bubble pre { background: var(--surface-3); border: 1px solid var(--border); border-radius: 6px; padding: 10px 12px; overflow-x: auto; margin: 8px 0; }
.msg.ava .msg-bubble pre code { background: transparent; padding: 0; color: var(--text); }
.msg.ava .msg-bubble ul, .msg.ava .msg-bubble ol { margin: 6px 0; padding-left: 22px; }
.msg.ava .msg-bubble li { margin: 2px 0; }
.msg.ava .msg-bubble h1, .msg.ava .msg-bubble h2, .msg.ava .msg-bubble h3, .msg.ava .msg-bubble h4 { font-family: 'DM Serif Display', serif; color: var(--ink); margin: 12px 0 6px; line-height: 1.2; font-weight: normal; }
.msg.ava .msg-bubble h1 { font-size: 20px; }
.msg.ava .msg-bubble h2 { font-size: 17px; }
.msg.ava .msg-bubble h3 { font-size: 15px; }
.msg.ava .msg-bubble h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; font-family: 'JetBrains Mono', monospace; color: var(--text-muted); }
.msg.ava .msg-bubble a { color: var(--accent); text-decoration: none; border-bottom: 1px dotted var(--accent); }
.msg.ava .msg-bubble a:hover { border-bottom-style: solid; }
.msg.ava .msg-bubble blockquote { border-left: 2px solid var(--accent); margin: 6px 0; padding: 2px 0 2px 10px; color: var(--text-muted); }
.msg.ava .msg-bubble table { border-collapse: collapse; margin: 10px 0; font-size: 12px; width: 100%; }
.msg.ava .msg-bubble th, .msg.ava .msg-bubble td { border: 1px solid var(--border); padding: 6px 10px; text-align: left; }
.msg.ava .msg-bubble th { background: var(--surface-3); color: var(--text-muted); font-family: 'JetBrains Mono', monospace; font-size: 10px; letter-spacing: .06em; text-transform: uppercase; font-weight: 500; }
.msg.ava .msg-bubble td { font-variant-numeric: tabular-nums; }
.msg.ava .msg-bubble tr:nth-child(even) td { background: rgba(255,255,255,0.015); }
.msg.ava .msg-bubble hr { border: 0; border-top: 1px solid var(--border); margin: 12px 0; }

@keyframes fadeUp { from{opacity:0;transform:translateY(6px)} to{opacity:1;transform:translateY(0)} }
.msg { animation: fadeUp .25s ease; }

.ava-input-wrap { border-top: 1px solid var(--border); padding: 12px 16px; display: flex; gap: 8px; align-items: flex-end; }
.ava-input {
  flex: 1; background: var(--surface-2); border: 1px solid var(--border-light);
  border-radius: 8px; padding: 10px 14px; color: var(--text); font-size: 13px;
  font-family: 'DM Sans', sans-serif; resize: none; min-height: 40px; max-height: 120px;
  outline: none; transition: border-color .2s; line-height: 1.4;
}
.ava-input:focus { border-color: rgba(201,165,103,0.4); }
.ava-input::placeholder { color: var(--text-muted); }
.ava-send {
  width: 38px; height: 38px; background: var(--accent); border: none;
  border-radius: 8px; cursor: pointer; display: flex; align-items: center;
  justify-content: center; color: #faf7f2; transition: background .15s; flex-shrink: 0;
}
.ava-send:hover { background: #b8934f; }
.ava-send svg { width: 16px; height: 16px; }

/* TABLE */
.bleeder-table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th {
  padding: 10px 14px; text-align: left; font-size: 10px;
  font-family: 'JetBrains Mono', monospace; letter-spacing: .1em;
  text-transform: uppercase; color: var(--text-muted); border-bottom: 1px solid var(--border);
  white-space: nowrap; font-weight: 400;
}
tbody tr { border-bottom: 1px solid var(--border); transition: background .12s; }
tbody tr:hover { background: var(--surface-2); }
tbody td { padding: 11px 14px; font-size: 12px; color: var(--text-soft); white-space: nowrap; }
tbody td:first-child { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--text); font-weight: 500; }
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 4px; font-size: 10px;
  font-family: 'JetBrains Mono', monospace; font-weight: 600; letter-spacing: .04em;
}
.badge.error { background: var(--red-dim); color: var(--red); border: 1px solid rgba(255,87,87,0.2); }
.badge.warn { background: var(--orange-dim); color: var(--orange); border: 1px solid rgba(255,154,60,0.2); }
.badge.ok { background: var(--green-dim); color: var(--green); border: 1px solid rgba(78,250,138,0.2); }
td.neg { color: var(--red); font-family: 'JetBrains Mono', monospace; font-weight: 600; }
td.pos { color: var(--green); font-family: 'JetBrains Mono', monospace; font-weight: 600; }
.edit-btn {
  padding: 4px 10px; background: transparent; border: 1px solid var(--border-light);
  border-radius: 4px; color: var(--text-muted); font-size: 11px; cursor: pointer;
  font-family: 'DM Sans', sans-serif; transition: all .15s;
}
.edit-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }

/* AUDIT RECEIPT */
.audit-receipt {
  background: var(--surface-2); border: 1px solid var(--border-light);
  border-left: 3px solid var(--accent); border-radius: 0 8px 8px 0;
  padding: 16px 18px; margin-top: 12px; font-size: 12px; display: none;
}
.audit-receipt.visible { display: block; animation: fadeUp .3s ease; }

/* Vote bar */
.vote-bar { display:flex; align-items:center; gap:6px; margin-top:6px; padding-left:4px; }
.vote-btn { background:none; border:1px solid var(--border); border-radius:6px; padding:3px 7px; cursor:pointer; color:var(--text-muted); display:flex; align-items:center; transition:all .15s; }
.vote-btn:hover.up   { border-color:var(--accent); color:var(--accent); }
.vote-btn:hover.down { border-color:#FF5757; color:#FF5757; }
.vote-btn.voted-up   { border-color:var(--accent); color:var(--accent); background:rgba(201,165,103,0.08); }
.vote-btn.voted-down { border-color:#FF5757; color:#FF5757; background:rgba(255,87,87,0.08); }
.vote-btn.verify { font-size:11px; font-family:'JetBrains Mono',monospace; padding:3px 9px; letter-spacing:.5px; }
.vote-btn.verify:hover { border-color:#9b8cff; color:#9b8cff; }
.verify-result { font-size:11px; font-family:'JetBrains Mono',monospace; margin-left:8px; }
.verify-result.pass { color:var(--accent); }
.verify-result.fail { color:#FF5757; }
.guess-flag { font-size:10px; font-family:'JetBrains Mono',monospace; color:#F59E0B; letter-spacing:.04em; margin-right:4px; }
.vote-confirmed { font-size:10px; color:var(--accent); font-family:'JetBrains Mono',monospace; }
.vote-disputed  { font-size:10px; color:#FF5757; font-family:'JetBrains Mono',monospace; }
.receipt-title { font-family: 'JetBrains Mono', monospace; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); margin-bottom: 10px; }
.receipt-row { display: flex; justify-content: space-between; align-items: center; padding: 5px 0; border-bottom: 1px solid var(--border); color: var(--text-soft); }
.receipt-row:last-child { border-bottom: none; }
.receipt-row .key { font-family: 'JetBrains Mono', monospace; font-size: 10px; letter-spacing: .06em; color: var(--text-muted); }
.receipt-status { display: inline-flex; align-items: center; gap: 4px; font-family: 'JetBrains Mono', monospace; font-size: 10px; font-weight: 600; }
.receipt-status.pass { color: var(--green); }
.receipt-status.warn { color: var(--yellow); }

/* CORRECTION MODAL */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.75);
  backdrop-filter: blur(4px); z-index: 200; display: none;
  align-items: center; justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--surface); border: 1px solid var(--border-light);
  border-radius: 12px; width: 440px; padding: 28px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6); animation: fadeUp .25s ease;
}
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 20px; }
.modal-title { font-family: 'DM Serif Display', serif; font-size: 20px; color: var(--ink); }
.modal-subtitle { font-size: 11px; color: var(--text-muted); font-family: 'JetBrains Mono', monospace; margin-top: 4px; letter-spacing: .04em; }
.modal-close { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 22px; line-height: 1; }
.modal-close:hover { color: var(--text); }
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 11px; font-family: 'JetBrains Mono', monospace; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 6px; }
.form-input {
  width: 100%; background: var(--surface-2); border: 1px solid var(--border-light);
  border-radius: 6px; padding: 10px 12px; color: var(--text); font-size: 13px;
  font-family: 'DM Sans', sans-serif; outline: none; transition: border-color .2s;
}
.form-input:focus { border-color: rgba(201,165,103,0.4); }
.correction-note {
  background: var(--accent-dim); border: 1px solid rgba(201,165,103,0.2);
  border-radius: 6px; padding: 10px 12px; font-size: 11px; color: var(--accent);
  margin-bottom: 20px; font-family: 'JetBrains Mono', monospace; letter-spacing: .02em; line-height: 1.5;
}
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; }

/* CHIPS */
.quick-chips { display: flex; gap: 6px; flex-wrap: wrap; padding: 10px 16px 8px; }
.chip {
  padding: 5px 10px; background: var(--surface-3); border: 1px solid var(--border-light);
  border-radius: 20px; font-size: 11px; color: var(--text-soft); cursor: pointer;
  font-family: 'JetBrains Mono', monospace; transition: all .15s; white-space: nowrap;
}
.chip:hover { background: var(--accent-dim); border-color: rgba(201,165,103,0.3); color: var(--accent); }

/* TYPING */
.typing-dot {
  display: inline-block; width: 5px; height: 5px; background: var(--text-muted);
  border-radius: 50%; animation: blink 1.2s ease-in-out infinite; margin: 0 1px;
}
.typing-dot:nth-child(2){animation-delay:.2s} .typing-dot:nth-child(3){animation-delay:.4s}
@keyframes blink{0%,80%,100%{opacity:.3}40%{opacity:1}}

::-webkit-scrollbar{width:6px;height:6px}
::-webkit-scrollbar-track{background:transparent}
::-webkit-scrollbar-thumb{background:var(--border-light);border-radius:3px}
::-webkit-scrollbar-thumb:hover{background:var(--text-muted)}

@media(max-width:1100px){.dash-grid{grid-template-columns:1fr}}

/* ── Plus / attach button ─────────────────────────── */
.ava-attach {
  background: transparent; color: var(--text-muted);
  border: 1px solid var(--border); border-radius: 8px;
  width: 32px; height: 32px; display: inline-flex;
  align-items: center; justify-content: center;
  cursor: pointer; padding: 0; transition: all .15s;
}
.ava-attach:hover { color: var(--accent); border-color: var(--accent); }
.ava-attach svg { width: 14px; height: 14px; }
.ava-attach.has-file { color: var(--accent); border-color: var(--accent); background: rgba(201,165,103,0.08); }
.ava-attach-pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(201,165,103,0.1); color: var(--accent);
  border: 1px solid rgba(201,165,103,0.3); border-radius: 6px;
  padding: 3px 8px; font-size: 11px; margin: 0 8px 6px 0;
}
.ava-attach-pill .x { cursor: pointer; opacity: 0.6; padding: 0 2px; }
.ava-attach-pill .x:hover { opacity: 1; }
.ava-attached-row { padding: 0 16px 4px 16px; display:flex; flex-wrap:wrap; }

/* ── Floating Ava button + drawer ───────────────── */
#avaFab {
  position: fixed; right: 22px; bottom: 22px; z-index: 9999;
  background: var(--accent); color: #051d18;
  border: none; border-radius: 28px; height: 56px; padding: 0 22px;
  font-weight: 700; font-size: 14px; cursor: pointer;
  box-shadow: 0 8px 26px rgba(201,165,103,0.35);
  display: inline-flex; align-items: center; gap: 10px;
  transition: transform .15s, box-shadow .15s;
}
#avaFab:hover { transform: translateY(-2px); box-shadow: 0 12px 32px rgba(201,165,103,0.5); }
#avaFab svg { width: 18px; height: 18px; }
#avaDrawer {
  position: fixed; right: 22px; bottom: 90px; z-index: 9999;
  width: 420px; max-width: calc(100vw - 32px);
  height: 620px; max-height: calc(100vh - 120px);
  background: #f5efe1; border: 1px solid var(--border);
  border-radius: 14px; box-shadow: 0 20px 48px rgba(0,0,0,0.55);
  display: none; flex-direction: column; overflow: hidden;
}
#avaDrawer.open { display: flex; }
#avaDrawer .ld-head {
  padding: 14px 16px; border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
  background: linear-gradient(180deg, rgba(201,165,103,0.06), transparent);
}
#avaDrawer .ld-title { font-weight: 700; font-size: 14px; }
#avaDrawer .ld-sub { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
#avaDrawer .ld-close { background: transparent; border: none; color: var(--text-muted); cursor: pointer; font-size: 22px; line-height: 1; }
#avaDrawer .ld-close:hover { color: var(--text); }
#avaDrawer .ld-msgs { flex: 1; overflow-y: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.ld-msg { padding: 10px 12px; border-radius: 10px; font-size: 13px; line-height: 1.45; white-space: pre-wrap; word-wrap: break-word; }
.ld-msg.user { background: rgba(201,165,103,0.10); align-self: flex-end; max-width: 85%; color: var(--text); }
.ld-msg.bot  { background: rgba(255,255,255,0.04); border: 1px solid var(--border); align-self: flex-start; max-width: 92%; }
.ld-msg.tool { font-size: 11px; color: var(--text-muted); align-self: center; font-style: italic; }
.ld-msg.err  { background: rgba(255,80,80,0.10); border: 1px solid rgba(255,80,80,0.4); color: #ffb4b4; }
#avaDrawer .ld-input-wrap { border-top: 1px solid var(--border); padding: 10px 12px; display: flex; gap: 6px; align-items: flex-end; }
#avaDrawer textarea {
  flex: 1; background: var(--bg); border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 10px; color: var(--text);
  font-size: 13px; resize: none; min-height: 34px; max-height: 120px; font-family: inherit;
}
#avaDrawer textarea:focus { border-color: rgba(201,165,103,0.4); outline: none; }


.dv-recap {
  background: rgba(255,255,255,0.025); border: 1px solid var(--border);
  border-radius: 10px; padding: 12px 14px;
}
.dv-recap-label {
  font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-muted); font-weight: 600;
}
.dv-recap-body { font-size: 13px; color: var(--text); margin-top: 4px; white-space: pre-wrap; word-wrap: break-word; max-height: 140px; overflow-y: auto; }
.dv-recap-sources { font-size: 12px; color: var(--accent); margin-top: 4px; }
.dv-recap-sources .src-pill { display: inline-block; background: rgba(201,165,103,0.1); border: 1px solid rgba(201,165,103,0.3); border-radius: 5px; padding: 1px 6px; margin: 0 4px 4px 0; font-size: 11px; }
.dv-recap-sql {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 11px; color: var(--text-muted);
  background: var(--bg); border: 1px solid var(--border); border-radius: 6px;
  padding: 8px 10px; margin-top: 6px; max-height: 120px; overflow: auto;
  white-space: pre-wrap; word-break: break-word;
}
.dv-radio-list { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.dv-radio {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px;
  cursor: pointer; font-size: 13px; transition: all .12s;
}
.dv-radio:hover { border-color: var(--accent); background: rgba(201,165,103,0.04); }
.dv-radio input { margin-top: 3px; accent-color: var(--accent); }
.dv-radio input:checked + span { color: var(--text); }
.dv-radio:has(input:checked) { border-color: var(--accent); background: rgba(201,165,103,0.06); }


/* INGREDIENTS-UI-V1 - "What did Ava use?" panel */
.ingredients { margin: 8px 0 4px 0; font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--text-muted,#a49678); }
.ingredients > summary { cursor: pointer; outline: none; padding: 4px 0; letter-spacing: 0.04em; text-transform: uppercase; user-select: none; }
.ingredients > summary:hover { color: var(--text,#141414); }
.ingredients .ic-count { color: var(--accent,#c9a567); font-weight: 600; }
.ingredients ul { list-style: none; padding: 6px 0 4px 0; margin: 4px 0 0 0; display: flex; flex-direction: column; gap: 3px; }
.ingredients li { display: flex; align-items: center; gap: 8px; padding: 5px 8px; background: rgba(255,255,255,0.02); border: 1px solid var(--border,#2a2115); border-radius: 5px; cursor: pointer; transition: background .12s, border-color .12s; }
.ingredients li:hover { background: rgba(201,165,103,0.06); border-color: rgba(201,165,103,0.35); }
.ingredients li code { color: var(--text,#141414); font-size: 11px; }
.ingredients li .role { font-size: 10px; padding: 1px 6px; border-radius: 3px; letter-spacing: 0.05em; text-transform: uppercase; }
.ingredients li .role.select    { background: rgba(201,165,103,0.12); color: #c9a567; }
.ingredients li .role.filter    { background: rgba(251,191,36,0.14); color: #7a5c00; }
.ingredients li .role.group     { background: rgba(167,139,250,0.14); color: #a78bfa; }
.ingredients li .role.join      { background: rgba(224,192,132,0.14); color: #e0c084; }
.ingredients li .role.aggregate { background: rgba(244,114,182,0.14); color: #f472b6; }


/* COLMETA-UI-V1 — column-meta picker modal */
.cm-modal-bg { display:none; position:fixed; inset:0; z-index:10000; background:rgba(0,0,0,0.6); align-items:center; justify-content:center; }
.cm-modal-bg.open { display:flex; }
.cm-modal { background: var(--bg-card,#1a140d); border:1px solid var(--border,#2a2115); border-radius:14px; min-width:480px; max-width:640px; width:90%; max-height:88vh; overflow-y:auto; padding:24px 26px; color:var(--text,#141414); box-shadow:0 30px 80px rgba(0,0,0,.5); }
.cm-modal h3 { margin:0 0 4px 0; font-size:14px; font-family:'JetBrains Mono',monospace; letter-spacing:.06em; color: var(--accent,#c9a567); text-transform:uppercase; }
.cm-modal .cm-sub { font-size:12px; color:var(--text-muted,#a49678); margin-bottom:12px; }
.cm-modal .cm-desc { font-size:13px; line-height:1.5; margin-bottom:12px; }
.cm-modal .cm-notes { font-size:12px; line-height:1.45; padding:8px 10px; border-radius:6px; background:rgba(251,191,36,0.07); border:1px solid rgba(251,191,36,0.25); color:#7a5c00; margin-bottom:14px; display:none; }
.cm-modal h4 { font-size:11px; font-family:'JetBrains Mono',monospace; letter-spacing:.06em; text-transform:uppercase; color:var(--text-muted,#a49678); margin:14px 0 6px 0; }
.cm-modal ul.cm-list { list-style:none; padding:0; margin:0; display:flex; flex-direction:column; gap:4px; }
.cm-modal ul.cm-list li { padding:8px 10px; border:1px solid var(--border,#2a2115); border-radius:6px; cursor:pointer; font-size:12.5px; transition: background .12s, border-color .12s; }
.cm-modal ul.cm-list li:hover { background:rgba(201,165,103,0.06); border-color:rgba(201,165,103,0.4); }
.cm-modal ul.cm-list li.selected { background:rgba(201,165,103,0.14); border-color:#c9a567; color:#c9a567; }
.cm-modal ul.cm-list li.empty { opacity:.55; cursor:default; font-style:italic; }
.cm-modal ul.cm-list li.empty:hover { background:transparent; border-color:var(--border,#2a2115); }
.cm-modal textarea.cm-free { width:100%; min-height:60px; padding:9px 11px; background:#faf7f2; color:var(--text,#141414); border:1px solid var(--border,#2a2115); border-radius:6px; font-size:13px; font-family:inherit; resize:vertical; margin-top:6px; }
.cm-modal .cm-actions { display:flex; justify-content:flex-end; gap:10px; margin-top:18px; }
.cm-modal .cm-btn { font-size:12px; letter-spacing:.06em; text-transform:uppercase; padding:8px 14px; border-radius:6px; cursor:pointer; font-family:inherit; }
.cm-modal .cm-btn.cancel { color:var(--text-muted,#a49678); background:none; border:1px solid var(--border,#2a2115); }
.cm-modal .cm-btn.save   { background:var(--accent,#c9a567); color:#faf7f2; border:none; font-weight:600; }
.cm-modal .cm-btn.save:disabled { opacity:.45; cursor:not-allowed; }
.cm-toast { position:fixed; bottom:24px; left:50%; transform:translateX(-50%); background:var(--accent,#c9a567); color:#faf7f2; font-size:13px; font-weight:600; padding:10px 18px; border-radius:8px; z-index:10001; box-shadow:0 8px 20px rgba(0,0,0,.4); opacity:0; transition:opacity .25s, transform .25s; pointer-events:none; }
.cm-toast.show { opacity:1; transform:translateX(-50%) translateY(-6px); }


/* ALTPICKER-UI-V1 - Rung 4 "could it be one of these?" picker */
.altpick-bg { display:none; position:fixed; inset:0; z-index:10000; background:rgba(0,0,0,0.6); align-items:center; justify-content:center; }
.altpick-bg.open { display:flex; }
.altpick { background: var(--bg-card,#1a140d); border:1px solid var(--border,#2a2115); border-radius:14px; min-width:520px; max-width:680px; width:92%; max-height:88vh; overflow-y:auto; padding:22px 24px; color:var(--text,#141414); box-shadow:0 30px 80px rgba(0,0,0,.5); }
.altpick h3 { margin:0 0 6px 0; font-size:13px; font-family:'JetBrains Mono',monospace; letter-spacing:.06em; text-transform:uppercase; color: var(--accent,#c9a567); }
.altpick .ap-sub { font-size:12px; color:var(--text-muted,#a49678); margin-bottom:12px; line-height:1.5; }
.altpick .ap-q { font-size:12.5px; padding:8px 10px; background:rgba(255,255,255,0.03); border-left:3px solid var(--accent,#c9a567); border-radius:4px; margin-bottom:14px; color:var(--text,#141414); }
.altpick .ap-group { margin-bottom:16px; border:1px solid var(--border,#2a2115); border-radius:8px; padding:10px 12px; }
.altpick .ap-group .ap-head { display:flex; align-items:baseline; gap:8px; margin-bottom:8px; }
.altpick .ap-group .ap-head code { font-size:12px; color:var(--text,#141414); }
.altpick .ap-group .ap-head .ap-disp { font-size:11px; color:var(--text-muted,#a49678); }
.altpick .ap-group .ap-head .ap-conf { margin-left:auto; font-size:10px; padding:2px 6px; border-radius:3px; background:rgba(251,191,36,0.15); color:#7a5c00; }
.altpick ul.ap-alts { list-style:none; padding:0; margin:0; display:flex; flex-direction:column; gap:4px; }
.altpick ul.ap-alts li { padding:7px 10px; border:1px solid var(--border,#2a2115); border-radius:6px; cursor:pointer; font-size:12px; transition:background .12s, border-color .12s; }
.altpick ul.ap-alts li:hover { background:rgba(201,165,103,0.06); border-color:rgba(201,165,103,0.45); }
.altpick ul.ap-alts li.selected { background:rgba(201,165,103,0.14); border-color:#c9a567; color:#c9a567; }
.altpick .ap-actions { display:flex; justify-content:space-between; gap:10px; margin-top:14px; }
.altpick .ap-btn { font-size:12px; letter-spacing:.06em; text-transform:uppercase; padding:8px 14px; border-radius:6px; cursor:pointer; font-family:inherit; }
.altpick .ap-btn.cancel { color:var(--text-muted,#a49678); background:none; border:1px solid var(--border,#2a2115); }
.altpick .ap-btn.fallthrough { color:var(--text-muted,#a49678); background:none; border:1px dashed var(--border,#2a2115); }
.altpick .ap-btn.save { background:var(--accent,#c9a567); color:#faf7f2; border:none; font-weight:600; }
.altpick .ap-btn.save:disabled { opacity:.45; cursor:not-allowed; }


/* EQUATION-UI-V1 - Rung 3 equation editor inside downvote modal */
.dv-eq-toggle { margin-top: 14px; }
.dv-eq-toggle a { font-size: 11px; color: var(--accent,#c9a567); cursor: pointer; text-decoration: underline dotted; font-family: 'JetBrains Mono', monospace; letter-spacing: 0.04em; }
.dv-eq-toggle a:hover { color: #c9a567; }
.dv-eq-row { display: none; margin-top: 10px; }
.dv-eq-row.open { display: block; }
.dv-eq-row .form-label { display: flex; align-items: baseline; gap: 8px; }
.dv-eq-row textarea.dv-eq-input { width: 100%; padding: 9px 11px; background: #faf7f2; color: var(--text,#141414); border: 1px solid var(--border,#2a2115); border-radius: 6px; font-size: 13px; font-family: 'JetBrains Mono', monospace; resize: vertical; min-height: 56px; }
.dv-eq-row .dv-eq-hint { font-size: 11px; color: var(--text-muted,#a49678); margin-top: 4px; line-height: 1.45; }
.dv-eq-row .dv-eq-hint code { font-family: 'JetBrains Mono', monospace; font-size: 11px; background: rgba(255,255,255,0.05); padding: 1px 4px; border-radius: 3px; }


/* CHATHANDBACK-V1 */
.ld-handback {
  display: inline-block;
  margin-top: 8px;
  padding: 4px 10px;
  background: transparent;
  border: 1px solid #2a2a2a;
  border-radius: 4px;
  color: #c9a567;
  font: 10px "JetBrains Mono", monospace;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}
.ld-handback:hover { background: #f5efe1; border-color: #c9a567; }

/* RESIZE-V1 */
.ava-messages,
.audit-receipt,
.bleeder-table-wrap {
  resize: vertical;
  overflow: auto;
  min-height: 140px;
  max-height: 85vh;
}
.ava-messages { min-height: 220px; }
.audit-receipt { min-height: 160px; }
/* Make the resize grip visible against the dark theme */
.ava-messages::-webkit-resizer,
.audit-receipt::-webkit-resizer,
.bleeder-table-wrap::-webkit-resizer {
  background-color: #f5efe1;
  border: 1px solid #2a2a2a;
}

/* RESIZE-FIX-V1 */
/* Make resize targets honor their own height (override flex:1 + inline styles) */
.ava-panel { height: auto !important; min-height: 420px; }
.ava-messages {
  flex: none !important;
  height: 420px;            /* initial; user can drag-resize */
  resize: vertical !important;
  overflow: auto !important;
  min-height: 220px !important;
  max-height: 85vh !important;
}
#avaMessagesFull {
  flex: none !important;
  height: 60vh;
  resize: vertical !important;
  overflow: auto !important;
  min-height: 240px !important;
  max-height: 85vh !important;
}
.audit-receipt {
  resize: vertical !important;
  overflow: auto !important;
  min-height: 160px !important;
  max-height: 85vh !important;
}
.audit-receipt.visible {
  /* keep block + animation, but also become resizable when shown */
  display: block;
}
.bleeder-table-wrap {
  resize: vertical !important;
  overflow: auto !important;
  min-height: 200px !important;
  max-height: 85vh !important;
  height: 360px;            /* initial; user can drag-resize */
}
/* Make the corner grip visible against dark theme (Chromium-only API) */
.ava-messages::-webkit-resizer,
#avaMessagesFull::-webkit-resizer,
.audit-receipt::-webkit-resizer,
.bleeder-table-wrap::-webkit-resizer {
  background-color: #f5efe1;
  border: 2px solid #c9a567;
  border-radius: 0 0 8px 0;
}
/* Hint via cursor on the bottom edge */
.ava-messages, #avaMessagesFull, .audit-receipt, .bleeder-table-wrap {
  position: relative;
}

/* RESIZE-HANDLES-V1 */
/* Turn off native resize - we draw our own bar */
.ava-messages, #avaMessagesFull, .audit-receipt, .bleeder-table-wrap {
  resize: none !important;
  overflow: auto !important;
  padding-bottom: 14px !important; /* room for handle */
}
.dm-resize-handle {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 10px;
  cursor: ns-resize;
  background: linear-gradient(180deg, transparent 0%, rgba(201,165,103,0.15) 50%, rgba(201,165,103,0.35) 100%);
  border-top: 1px solid rgba(201,165,103,0.35);
  z-index: 10;
  touch-action: none;
  user-select: none;
}
.dm-resize-handle::after {
  content: '';
  position: absolute; left: 50%; bottom: 3px;
  width: 36px; height: 3px; transform: translateX(-50%);
  background: rgba(201,165,103,0.7); border-radius: 2px;
}
.dm-resize-handle:hover {
  background: linear-gradient(180deg, transparent 0%, rgba(201,165,103,0.25) 50%, rgba(201,165,103,0.55) 100%);
}
.dm-resize-handle.dragging {
  background: rgba(201,165,103,0.5);
}
.dm-resizable { position: relative; }

/* BOX-DRAG-V1 */
.dm-box-wrap { position: relative; }
.dm-box-grip {
  position: absolute; top: 8px; right: 8px; z-index: 5;
  width: 28px; height: 22px; border-radius: 6px;
  background: rgba(201,165,103,0.08);
  border: 1px solid rgba(201,165,103,0.25);
  display: flex; align-items: center; justify-content: center;
  cursor: grab;
  opacity: 0.55;
  transition: opacity .15s, background .15s;
  user-select: none;
}
.dm-box-grip:hover { opacity: 1; background: rgba(201,165,103,0.18); }
.dm-box-grip:active { cursor: grabbing; }
.dm-box-grip::before {
  content: '';
  width: 12px; height: 8px;
  background-image:
    radial-gradient(circle, #c9a567 1px, transparent 1.5px),
    radial-gradient(circle, #c9a567 1px, transparent 1.5px),
    radial-gradient(circle, #c9a567 1px, transparent 1.5px),
    radial-gradient(circle, #c9a567 1px, transparent 1.5px),
    radial-gradient(circle, #c9a567 1px, transparent 1.5px),
    radial-gradient(circle, #c9a567 1px, transparent 1.5px);
  background-size: 4px 4px;
  background-position: 0 0, 4px 0, 8px 0, 0 4px, 4px 4px, 8px 4px;
  background-repeat: no-repeat;
}
.dm-box-dragging { opacity: 0.4; transform: scale(0.99); }
.dm-box-drop-target { outline: 2px dashed #c9a567; outline-offset: -2px; }
.dm-reset-order {
  display: inline-block; margin: 8px 0 0 4px; padding: 4px 10px;
  font-size: 10px; font-family: 'JetBrains Mono', monospace;
  background: transparent; color: rgba(201,165,103,0.7);
  border: 1px solid rgba(201,165,103,0.3); border-radius: 6px;
  cursor: pointer; text-transform: uppercase; letter-spacing: 0.06em;
}
.dm-reset-order:hover { background: rgba(201,165,103,0.1); color: #c9a567; }

/* CHART-TYPES-V1 */
.chart-type-picker { display: inline-flex; gap: 4px; margin-right: 8px; }
.chart-type-btn {
  width: 28px; height: 28px; padding: 0;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 6px; cursor: pointer; color: var(--text-muted);
  display: inline-flex; align-items: center; justify-content: center;
  transition: all .15s;
}
.chart-type-btn:hover { color: var(--text); border-color: var(--border-light); }
.chart-type-btn.active {
  background: var(--accent-dim); border-color: rgba(201,165,103,0.4);
  color: var(--accent);
}
.chart-type-btn svg { width: 14px; height: 14px; }

/* Vertical bars (column chart) */
.profit-cols { display: flex; align-items: flex-end; gap: 6px; height: 280px; padding: 8px 4px 28px; position: relative; }
.profit-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.profit-col .col-bar-wrap { width: 100%; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; }
.profit-col .col-bar {
  width: 100%; border-radius: 4px 4px 0 0; transition: height .6s cubic-bezier(.4,0,.2,1);
  min-height: 2px;
}
.profit-col .col-bar.pos { background: linear-gradient(180deg, #3EFFA0, var(--green)); }
.profit-col .col-bar.neg { background: linear-gradient(180deg, #FF8080, var(--red)); }
.profit-col .col-val { font-size: 10px; font-family: 'JetBrains Mono', monospace; color: var(--text-muted); white-space: nowrap; }
.profit-col .col-val.pos { color: var(--green); }
.profit-col .col-val.neg { color: var(--red); }
.profit-col .col-lbl { font-size: 9px; font-family: 'JetBrains Mono', monospace; color: var(--text-muted); writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; max-height: 80px; overflow: hidden; text-overflow: ellipsis; }

/* Donut chart */
.profit-donut-wrap { display: flex; gap: 24px; align-items: center; padding: 12px 4px; flex-wrap: wrap; }
.profit-donut-svg { flex-shrink: 0; }
.profit-donut-legend { display: flex; flex-direction: column; gap: 6px; font-size: 12px; flex: 1; min-width: 200px; }
.profit-donut-legend-row { display: flex; align-items: center; gap: 8px; }
.profit-donut-swatch { width: 10px; height: 10px; border-radius: 2px; flex-shrink: 0; }
.profit-donut-label { color: var(--text); font-family: 'JetBrains Mono', monospace; font-size: 11px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profit-donut-val { font-family: 'JetBrains Mono', monospace; font-size: 11px; font-variant-numeric: tabular-nums; }
.profit-donut-val.pos { color: var(--green); }
.profit-donut-val.neg { color: var(--red); }

/* Table view */
.profit-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.profit-table th, .profit-table td { padding: 8px 12px; text-align: left; border-bottom: 1px solid var(--border); }
.profit-table th {
  font-family: 'JetBrains Mono', monospace; font-size: 10px;
  letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); font-weight: 500;
  background: var(--surface-2);
}
.profit-table td { font-variant-numeric: tabular-nums; }
.profit-table td.profit-cell.pos { color: var(--green); font-weight: 600; }
.profit-table td.profit-cell.neg { color: var(--red); font-weight: 600; }
.profit-table tr:hover td { background: rgba(255,255,255,0.02); }

/* CARD-RESIZE-V2-CLEANUP — Native resize handled by .card CSS */

/* HIDE-AUDIT-V1 */
/* Hide the standalone audit receipt panels by default; user opts in per-message */
.audit-receipt, .audit-receipt.visible { display: none !important; }
/* Creator can flip a session toggle to see the panel again */
body.dm-show-audits .audit-receipt.visible { display: block !important; }

.dm-audit-toggle {
  display: inline-block;
  margin: 6px 0 2px;
  padding: 2px 8px;
  font-size: 10px;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 5px;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity .15s, color .15s, border-color .15s;
}
.dm-audit-toggle:hover { opacity: 1; color: var(--accent); border-color: rgba(201,165,103,0.4); }
.dm-audit-inline {
  margin-top: 6px;
  padding: 10px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-left: 2px solid var(--accent);
  border-radius: 6px;
  font-size: 11px;
  color: var(--text-soft);
  font-family: 'JetBrains Mono', monospace;
}
.dm-audit-inline .row { display: flex; justify-content: space-between; padding: 3px 0; gap: 12px; border-bottom: 1px dashed var(--border); }
.dm-audit-inline .row:last-child { border-bottom: none; }
.dm-audit-inline .k { color: var(--text-muted); letter-spacing: 0.06em; flex-shrink: 0; }
.dm-audit-inline .v { color: var(--text); text-align: right; word-break: break-word; }
.dm-audit-inline pre.sql {
  background: #f5efe1; border: 1px solid var(--border); border-radius: 4px;
  padding: 8px; margin: 6px 0 0; font-size: 10px; color: #bbb;
  white-space: pre-wrap; max-height: 240px; overflow: auto;
}


/* FEATREQ-V1 */
.dm-fr-pill {
  display: inline-block; margin: 6px 6px 0 0; padding: 3px 10px;
  font-size: 10px; font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.06em; text-transform: uppercase;
  background: transparent; color: var(--text-muted);
  border: 1px solid var(--border); border-radius: 6px; cursor: pointer;
  opacity: 0.7; transition: all .15s;
}
.dm-fr-pill:hover { opacity: 1; color: #FFB45C; border-color: rgba(255,180,92,0.5); }
.dm-fr-pill.auto { border-color: rgba(255,180,92,0.5); color: #FFB45C; opacity: 1; }
.dm-fr-modal-bg {
  position: fixed; inset: 0; background: rgba(0,0,0,0.55); z-index: 99998;
  display: flex; align-items: center; justify-content: center;
}
.dm-fr-modal {
  width: min(520px, 92vw); background: var(--panel);
  border: 1px solid var(--border); border-radius: 10px;
  padding: 22px; box-shadow: 0 16px 48px rgba(0,0,0,0.6);
}
.dm-fr-modal h3 { margin: 0 0 14px; font-family: 'DM Serif Display', serif; font-size: 22px; color: var(--ink); font-weight: normal; }
.dm-fr-modal label { display: block; font-size: 10px; font-family: 'JetBrains Mono', monospace; letter-spacing: 0.06em; color: var(--text-muted); margin: 10px 0 4px; }
.dm-fr-modal input, .dm-fr-modal textarea {
  width: 100%; box-sizing: border-box; background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border); border-radius: 6px; padding: 8px 10px; font-size: 13px; font-family: 'DM Sans', sans-serif;
}
.dm-fr-modal textarea { resize: vertical; min-height: 90px; }
.dm-fr-modal .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.dm-fr-toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%);
  background: rgba(255,180,92,0.15); border: 1px solid #FFB45C; color: #FFB45C;
  padding: 10px 18px; border-radius: 8px; font-size: 12px; z-index: 99999;
  font-family: 'JetBrains Mono', monospace; letter-spacing: 0.04em;
}

/* DATEWIN-PROMINENT-V1 */
.dm-datewin-bar {
  display: flex; align-items: center; gap: 14px;
  margin: 8px 0 18px;
  padding: 12px 16px;
  background: linear-gradient(180deg, #ffffff 0%, #f7f4ee 100%);
  border: 1px solid #1f1f1f;
  border-left: 3px solid #c9a567;
  border-radius: 10px;
  font-size: 13px;
  color: #ddd;
  flex-wrap: wrap;
}
.dm-datewin-bar .dm-dw-label {
  font-family: 'JetBrains Mono', monospace;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 10px;
  color: #888;
}
.dm-datewin-bar .dm-dw-current {
  font-weight: 600;
  color: #c9a567;
  font-size: 14px;
}
.dm-datewin-bar .dm-dw-help {
  color: #888; font-size: 12px; flex: 1 1 240px;
}
.dm-dw-chip {
  background: #f5efe1; color: #ccc;
  border: 1px solid #2a2a2a;
  border-radius: 999px;
  padding: 5px 11px; font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
  cursor: pointer;
  transition: background .12s, color .12s, border-color .12s;
}
.dm-dw-chip:hover { background: #222; color: #c9a567; border-color: rgba(201,165,103,0.4); }
.dm-dw-chip.active { background: rgba(201,165,103,0.15); color: #c9a567; border-color: rgba(201,165,103,0.6); }
.dm-dw-more {
  margin-left: auto;
  background: transparent; color: #888;
  border: 1px solid #2a2a2a; border-radius: 6px;
  padding: 5px 11px; font-size: 11px; cursor: pointer;
  font-family: 'JetBrains Mono', monospace;
  text-transform: uppercase; letter-spacing: 0.06em;
}
.dm-dw-more:hover { color: #c9a567; border-color: rgba(201,165,103,0.4); }

/* LAYOUTFIX-V1 */
html, body { overflow-x: hidden; max-width: 100vw; }
main { box-sizing: border-box; width: 100%; }
.card { max-width: 100%; min-width: 0; }
.card-body { overflow: hidden; min-width: 0; }
.profit-cols { overflow-x: auto; max-width: 100%; padding-bottom: 12px; }
.profit-cols::-webkit-scrollbar { height: 6px; }
.profit-col { min-width: 56px; max-width: 120px; }
.col-val { overflow: hidden; text-overflow: ellipsis; max-width: 100%; padding: 0 2px; }
.profit-chart { overflow-x: auto; max-width: 100%; }
.dm-datewin-bar { max-width: 100%; box-sizing: border-box; overflow: hidden; }
.bleeder-table-wrap, .dash-grid { max-width: 100%; min-width: 0; }
table { table-layout: auto; max-width: 100%; }

/* DATEBAR-ABOVE-AVA-V1 — host sits above the tabs content so it’s always visible */
#dmDateWinHost { position: sticky; top: 56px; z-index: 50; background: var(--bg, #faf7f2); padding-top: 8px; }
#dmDateWinHost .dm-datewin-bar { margin: 0; }
