/* =============================================================
   WAXFRAME — style.css
   Sections (in order):
     1. Fonts
     2. CSS Reset
     3. Theme Variables (light / dark / auto)
     4. Base Layout (body, grid, scrollbar)
     5. Buttons
     6. Header
     7. Sidebar (col 1)
     8. Workspace Grid
     9. Column Shared Styles
    10. Col 1 — Project Details
    11. Col 3 — Working Document
    12. Col 4 — Paste Responses (AI Cards)
    13. Col 5 — Prompts
    14. Status Bar
    15. Theme Toggle
    16. History Drawer
    17. Overlay + Toast
    18. Mobile Blocker
   ============================================================= */


/* ── 1. FONTS ── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');


/* ── 2. CSS RESET ── */
* { box-sizing: border-box; margin: 0; padding: 0; }


/* ── 3. THEME VARIABLES ── */

/* Light (default) */
:root {
  --bg:           #d8dce8;
  --surface:      #ffffff;
  --surface2:     #eaecf4;
  --surface3:     #dde1ee;
  --border:       #c8cedd;
  --border2:      #b0b8cc;
  --text:         #1a202c;
  --text-dim:     #4a5568;
  --muted:        #8896a8;
  --accent:       #2563eb;
  --accent-dim:   rgba(37,99,235,0.08);
  --accent-hover: #1d4ed8;
  --green:        #059669;
  --green-dim:    rgba(5,150,105,0.09);
  --red:          #dc2626;
  --font:         'Inter', system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', monospace;
  --radius-sm:    7px;
  --radius-md:    11px;
  --shadow-sm:    0 2px 8px rgba(0,0,0,0.10);
  --shadow-md:    0 6px 24px rgba(0,0,0,0.16);
  --shadow-lg:    0 2px 0px rgba(0,0,0,0.08), 0 8px 32px rgba(0,0,0,0.18);
}

/* Dark */
[data-theme="dark"] {
  --bg:           #0f1117;
  --surface:      #1a1d27;
  --surface2:     #1e2130;
  --surface3:     #252838;
  --border:       #2a2e40;
  --border2:      #363b52;
  --text:         #e8ecf4;
  --text-dim:     #a8b3c8;
  --muted:        #5a6480;
  --accent:       #4d8aff;
  --accent-dim:   rgba(77,138,255,0.12);
  --accent-hover: #6b9fff;
  --green:        #34d399;
  --green-dim:    rgba(52,211,153,0.10);
  --red:          #f87171;
  --shadow-sm:    0 2px 8px rgba(0,0,0,0.5);
  --shadow-md:    0 6px 24px rgba(0,0,0,0.7);
  --shadow-lg:    0 2px 0px rgba(0,0,0,0.4), 0 8px 32px rgba(0,0,0,0.8);
}

/* Auto — applies dark vars when OS is in dark mode */
@media (prefers-color-scheme: dark) {
  [data-theme="auto"] {
    --bg:           #0f1117;
    --surface:      #1a1d27;
    --surface2:     #1e2130;
    --surface3:     #252838;
    --border:       #2a2e40;
    --border2:      #363b52;
    --text:         #e8ecf4;
    --text-dim:     #a8b3c8;
    --muted:        #5a6480;
    --accent:       #4d8aff;
    --accent-dim:   rgba(77,138,255,0.12);
    --accent-hover: #6b9fff;
    --green:        #34d399;
    --green-dim:    rgba(52,211,153,0.10);
    --red:          #f87171;
    --shadow-sm:    0 2px 8px rgba(0,0,0,0.5);
    --shadow-md:    0 6px 24px rgba(0,0,0,0.7);
    --shadow-lg:    0 2px 0px rgba(0,0,0,0.4), 0 8px 32px rgba(0,0,0,0.8);
  }
}

/* Dark mode: icons that use invert() in light mode should not be double-inverted */
[data-theme="dark"] .ai-icon-invert,
[data-theme="dark"] .resp-card-icon-invert { filter: none; }
@media (prefers-color-scheme: dark) {
  [data-theme="auto"] .ai-icon-invert,
  [data-theme="auto"] .resp-card-icon-invert { filter: none; }
}


/* ── 4. BASE LAYOUT ── */

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  display: grid;
  grid-template-columns: 420px 1fr;
  grid-template-rows: 56px 1fr;
  height: 100vh;
  overflow: hidden;
}

/* Status bar spans the full width */
#statusBar { grid-column: 1 / -1; }

/* Scrollbar */
::-webkit-scrollbar       { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* Global textarea */
textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.65;
  outline: none;
  padding: 10px 12px;
  resize: none;
  transition: border-color 0.15s;
  width: 100%;
}
textarea:focus       { border: 2px solid var(--accent); }
textarea::placeholder { color: var(--muted); }


/* ── 5. BUTTONS ── */

/* Base button */
.btn {
  align-items: center;
  background: transparent;
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  cursor: pointer;
  display: inline-flex;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  gap: 6px;
  line-height: 1;
  padding: 6px 14px;
  transition: all 0.12s;
  white-space: nowrap;
}
.btn:hover { background: var(--accent-dim); border-color: var(--accent); color: var(--accent); }

/* Accent — primary actions (Next Round, Copy All) */
.btn-accent { border-color: var(--accent); color: var(--accent); font-weight: 600; }
.btn-accent:hover { background: var(--accent-dim); }

/* Ghost — subtle secondary actions */
.btn-ghost { border-color: var(--border); color: var(--muted); }
.btn-ghost:hover { background: var(--accent-dim); border-color: var(--accent); color: var(--accent); }

/* Small size modifier */
.btn-sm { font-size: 12px; padding: 4px 10px; }

/* Bee controls bar buttons — white with blue border */
.bee-controls .btn { background: var(--surface); border-color: var(--accent); box-shadow: var(--shadow-sm); color: var(--accent); }
.bee-controls .btn:hover { background: var(--accent-dim); }

/* Inline card/footer action buttons (Clear, Copy All, etc.) */
.resp-btn {
  align-items: center;
  background: transparent;
  border: none;
  border-right: 1px solid var(--border);
  color: var(--muted);
  cursor: pointer;
  display: flex;
  flex: 1;
  font-family: var(--font);
  font-size: 11px;
  font-weight: 500;
  gap: 4px;
  justify-content: center;
  padding: 5px 4px;
  transition: all 0.12s;
  white-space: nowrap;
}
.resp-btn:last-child { border-right: none; }
.resp-btn:hover { background: var(--accent-dim); color: var(--accent); }

/* Build & Copy Prompt — full-width primary CTA */
.build-prompt-bar { background: var(--bg); flex-shrink: 0; padding: 8px 12px; }
.btn-build-big {
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  color: var(--accent);
  font-size: 15px;
  font-weight: 700;
  justify-content: center;
  letter-spacing: 0.02em;
  padding: 16px;
  width: 100%;
}
.btn-build-big:hover { background: var(--accent-dim); }

/* Back button disabled state */
#backRoundBtn:disabled { cursor: not-allowed; opacity: 0.35; }


/* ── 6. HEADER ── */

header {
  align-items: center;
  background: var(--bg);
  display: flex;
  gap: 16px;
  grid-column: 2;
  grid-row: 1;
  justify-content: flex-end;
  padding: 0 22px;
}

/* Logo (hidden — branding is in sidebar) */
.logo        { display: none; }
.logo-name   { color: var(--text); font-size: 20px; font-weight: 700; letter-spacing: -0.3px; line-height: 1.2; }
.logo-sub    { color: var(--muted); font-size: 11px; }

/* Phase bar */
.hdr-center  { align-items: center; display: flex; flex: 1; flex-direction: column; gap: 4px; min-width: 0; }
.phase-bar   { align-items: center; display: flex; flex-wrap: nowrap; gap: 2px; }
.phase-pip        { background: transparent; border: 1px solid var(--accent); border-radius: 20px; color: var(--accent); cursor: pointer; font-size: 12px; font-weight: 500; padding: 4px 12px; transition: all 0.15s; white-space: nowrap; }
.phase-pip:hover  { background: var(--accent-dim); }
.phase-pip.active { background: var(--accent); border-color: var(--accent); box-shadow: none; color: #fff; font-weight: 600; }
.phase-pip.done   { background: transparent; border-color: var(--border); box-shadow: none; color: var(--muted); }
.phase-arrow { color: var(--border2); font-size: 9px; margin: 0 1px; }

/* Header buttons */
.hdr-btns { display: flex; flex-shrink: 0; gap: 7px; }
.hdr-btns .btn { background: transparent; border-color: var(--accent); color: var(--accent); }
.hdr-btns .btn:hover { background: var(--accent-dim); }


/* ── 7. SIDEBAR (COL 1) ── */

.col-sidebar {
  background: var(--bg);
  display: flex;
  flex-direction: column;
  grid-column: 1;
  grid-row: 1 / -1;
  min-height: 0;
  overflow: hidden;
}

/* Logo / branding block */
.col-logo {
  align-items: center;
  background: var(--bg);
  display: flex;
  flex-shrink: 0;
  gap: 12px;
  height: 134px;
  padding: 16px 14px;
}
.header-logo-img  { height: 48px; object-fit: contain; width: 48px; }
.sidebar-logo-img { height: 96px; object-fit: contain; width: 96px; }
.bee-img          { height: 56px; margin-left: 4px; object-fit: contain; vertical-align: middle; width: 56px; }

/* Bee controls row */
.bee-controls { background: var(--bg); display: flex; flex-shrink: 0; flex-wrap: wrap; gap: 5px; padding: 8px 12px; }

/* AI row list */
.col-body-bees { background: var(--bg); flex: 1; overflow-y: auto; padding: 10px 12px; }
.ai-btn-list   { display: flex; flex-direction: column; gap: 5px; }

.ai-row { align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow-md); display: flex; overflow: hidden; transition: border-color 0.12s; }
.ai-row:hover      { border: 2px solid var(--accent); }
.ai-row.is-builder { background: var(--surface); border-color: var(--accent); }
.ai-row.is-builder .ai-row-label { color: var(--accent); }

.ai-checkbox-wrap { align-items: center; border-right: 1px solid var(--border); cursor: pointer; display: flex; height: 100%; justify-content: center; min-height: 40px; padding: 0 10px; }
.ai-checkbox-wrap input[type=checkbox] { accent-color: var(--accent); cursor: pointer; height: 15px; width: 15px; }

.ai-row-label { align-items: center; border-right: 1px solid var(--border); color: var(--text-dim); display: flex; flex: 1; font-size: 14px; font-weight: 500; gap: 8px; min-width: 0; padding: 8px 10px; }
.ai-name      { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-inactive  { opacity: 0.35; }
.ai-icon      { border-radius: 4px; flex-shrink: 0; height: 28px; object-fit: contain; width: 28px; }
.ai-icon-invert { filter: invert(1); }

.ai-row-actions { display: flex; }
.ai-act { align-items: center; background: transparent; border: none; border-left: 1px solid var(--border); color: var(--muted); cursor: pointer; display: flex; font-family: var(--font); font-size: 12px; font-weight: 500; gap: 3px; height: 40px; justify-content: center; padding: 0 9px; transition: all 0.12s; white-space: nowrap; }
.ai-act:hover  { background: var(--surface2); color: var(--accent); }
.ai-act.copied { color: var(--green); }

.builder-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; gap: 1px; letter-spacing: 0.03em; line-height: 1.2; min-width: 58px; padding: 3px 6px; text-transform: uppercase; }
.builder-btn:hover { background: var(--accent-dim) !important; color: var(--accent) !important; }

.builder-badge { background: var(--accent-dim); border: 1px solid var(--accent); border-radius: 4px; color: var(--accent); display: inline-flex; flex-direction: column; align-items: center; font-size: 10px; font-weight: 700; gap: 1px; letter-spacing: 0.03em; line-height: 1.2; margin-left: 5px; padding: 2px 5px; text-transform: uppercase; }

.remove-btn       { color: var(--red) !important; }
.remove-btn:hover { background: rgba(220,38,38,0.07) !important; color: var(--red) !important; }

/* Add AI form */
.add-ai-form { background: var(--surface2); border: 1px solid var(--accent); border-radius: var(--radius-md); margin-top: 8px; padding: 11px; }
.add-ai-form input { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text); font-family: var(--font); font-size: 13px; margin-top: 0; outline: none; padding: 7px 10px; width: 100%; }
.add-ai-form input + input  { margin-top: 6px; }
.add-ai-form input:focus    { border-color: var(--accent); }
.add-ai-form input::placeholder { color: var(--muted); }


/* ── 8. WORKSPACE GRID ── */

.workspace {
  display: grid;
  grid-column: 2;
  grid-row: 2;
  grid-template-columns: 480px 1fr 400px;
  min-height: 0;
  overflow: hidden;
}


/* ── 9. COLUMN SHARED STYLES ── */

.col { background: var(--bg); display: flex; flex-direction: column; overflow: hidden; }

.col-header     { align-items: center; background: var(--bg); display: flex; flex-shrink: 0; justify-content: space-between; padding: 10px 14px; }
.col-header-sub { background: var(--bg); }

.col-title { align-items: center; color: var(--text); display: flex; font-size: 11px; font-weight: 700; gap: 8px; letter-spacing: 0.09em; text-transform: uppercase; }

.step-num { align-items: center; background: var(--accent); border-radius: 50%; color: #fff; display: flex; flex-shrink: 0; font-size: 11px; font-weight: 700; height: 20px; justify-content: center; width: 20px; }

.col-body { background: var(--bg); flex: 1; overflow-y: auto; padding: 12px; }


/* ── 10. COL 1 — PROJECT DETAILS ── */

.project-name-bar { background: var(--bg); flex-shrink: 0; padding: 10px 12px; }

.project-name-bar input {
  background: var(--surface);
  border: 2px solid var(--border2);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  font-weight: 600;
  outline: none;
  padding: 9px 12px;
  transition: border-color 0.15s;
  width: 100%;
}
.project-name-bar input:hover       { border-color: var(--accent); }
.project-name-bar input:focus       { border-color: var(--accent); }
.project-name-bar input::placeholder { color: var(--muted); font-size: 13px; font-weight: 400; }
.project-name-bar textarea           { font-size: 13px; font-weight: 400; margin-top: 8px; min-height: 70px; }

.version-input { color: var(--text-dim) !important; font-size: 12px !important; font-weight: 400 !important; margin-bottom: 6px; }

.goal-wrap          { background: var(--surface); border: 2px solid var(--border2); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); display: flex; flex-direction: column; margin-top: 8px; overflow: hidden; transition: border-color 0.15s; }
.goal-wrap:hover        { border-color: var(--accent); }
.goal-wrap:focus-within { border-color: var(--accent); }
.goal-wrap textarea { border: none !important; border-radius: 0 !important; box-shadow: none !important; margin: 0; }

.goal-textarea,
.project-name-bar textarea.goal-textarea { flex: 1; font-size: 13px; min-height: 210px; }

.goal-actions { background: var(--surface); border-top: 1px solid var(--border); display: flex; flex-shrink: 0; }


/* ── 11. COL 3 — WORKING DOCUMENT ── */

.col-body-prompt { display: flex; flex: 1; flex-direction: column; gap: 10px; overflow-y: auto; padding: 12px; }
.master-prompt-ta { flex: 1; min-height: 200px; overflow-y: scroll; }
.doc-char-count        { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; color: var(--muted); font-size: 10px; font-weight: 600; padding: 2px 9px; white-space: nowrap; }
.doc-char-count.filled { background: var(--green-dim); border-color: var(--green); color: var(--green); }

/* Working document card — matches response card aesthetic */
.doc-card {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  transition: border-color 0.15s;
}
.doc-card:hover { border: 2px solid var(--accent); }
.doc-card textarea {
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  flex: 1;
  min-height: 300px;
  resize: none;
}
.doc-card-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  flex-shrink: 0;
}


/* ── 12. COL 4 — PASTE RESPONSES (AI CARDS) ── */

.col-responses        { background: var(--bg); }
.col-header-responses { background: var(--bg); }

.responses-grid {
  align-content: start;
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr 1fr;
}

/* Card */
.resp-card {
  aspect-ratio: 5/3;
  background: var(--surface);
  border: 2px solid var(--red);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
  position: relative;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.resp-card:hover     { border: 2px solid var(--accent); box-shadow: var(--shadow-md); }
.resp-card.is-filled { border: 2px solid var(--green); }

/* Card header row */
.resp-card-header {
  align-items: center;
  background: var(--surface);
  border-bottom: none;
  display: flex;
  flex-direction: row;
  flex-shrink: 0;
  gap: 10px;
  padding: 10px 12px;
  width: 100%;
}
.resp-card-icon        { border-radius: 8px; flex-shrink: 0; height: 44px; object-fit: contain; width: 44px; }
.resp-card-icon-invert { filter: invert(1); }
.resp-card-name        { color: var(--text); flex: 1; font-size: 14px; font-weight: 700; }
.resp-card-crown       { display: none; }

/* Status badge */
.resp-card-status        { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; color: var(--muted); font-size: 10px; font-weight: 600; padding: 2px 9px; white-space: nowrap; }
.resp-card-status.filled { background: var(--green-dim); border-color: var(--green); color: var(--green); }

/* Builder crown badge */
.resp-card-builder-badge {
  align-items: center;
  background: transparent;
  border: none;
  color: var(--accent);
  display: flex;
  flex-direction: column;
  font-size: 11px;
  font-weight: 700;
  gap: 1px;
  letter-spacing: 0.04em;
  line-height: 1.2;
  padding: 0;
  text-transform: uppercase;
}

/* Inner textarea */
.resp-card-ta {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  color: var(--text-dim);
  flex: 1;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.5;
  margin: 6px 8px;
  min-height: 0;
  outline: none;
  padding: 5px 8px;
  resize: none;
  width: calc(100% - 16px);
}
.resp-card-ta:focus { border-color: var(--accent); }

/* Card footer action buttons */
.resp-card-actions {
  background: var(--surface);
  border-top: none;
  display: flex;
  flex-shrink: 0;
  margin-top: auto;
  width: 100%;
}


/* ── 13. COL 5 — PROMPTS ── */

.right-col { background: var(--bg); display: flex; flex-direction: column; overflow: hidden; }

/* Phase selector dropdown */
.phase-tabs        { display: none; }
.phase-tab         { background: transparent; border: none; border-bottom: 2px solid transparent; border-left: none; border-right: none; border-top: none; color: var(--muted); cursor: pointer; font-family: var(--font); font-size: 12px; font-weight: 600; padding: 9px 14px; transition: all 0.15s; white-space: nowrap; }
.phase-tab:hover   { background: var(--bg); color: var(--text-dim); }
.phase-tab.active  { border-bottom-color: var(--accent); color: var(--accent); }

.phase-select-wrap { background: var(--bg); flex-shrink: 0; padding: 8px 12px; }
.phase-select {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  color: var(--text);
  cursor: pointer;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  outline: none;
  padding: 7px 10px;
  width: 100%;
}
.phase-select:focus { border: 2px solid var(--accent); }

/* Phase instructions area */
.phase-instructions-area { background: var(--bg); display: flex; flex: 1; flex-direction: column; gap: 6px; max-height: 50%; min-height: 0; overflow-y: auto; padding: 10px 12px; }
.phase-instr-label        { color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.phase-instr-textarea     { background: var(--surface); border: 1px solid var(--border2); border-radius: var(--radius-sm); box-shadow: var(--shadow-md); color: var(--text-dim); flex: 1; font-family: var(--font-mono); font-size: 12px; line-height: 1.7; min-height: 80px; outline: none; padding: 8px 10px; resize: none; }
.phase-instr-textarea:focus { border: 2px solid var(--accent); }

.send-block-divider { border: none; flex-shrink: 0; margin: 0; }

/* Send block area */
.send-block-area  { background: var(--bg); display: flex; flex: 1; flex-direction: column; gap: 6px; min-height: 0; overflow-y: auto; padding: 10px 12px; }
.send-block-label { color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }

.send-block-card {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  transition: border-color 0.15s;
}
.send-block-card:hover { border: 2px solid var(--accent); }

.send-block-ta    { background: var(--surface); border: none !important; border-radius: 0 !important; box-shadow: none !important; color: var(--text-dim); flex: 1; font-family: 'Courier New', monospace; font-size: 12px; line-height: 1.7; min-height: 40px; padding: 8px 10px; }
.send-block-ta:focus { border: 2px solid var(--accent); }

.send-block-footer { background: var(--surface); border-top: 1px solid var(--border); display: flex; flex-shrink: 0; }


/* ── 14. STATUS BAR ── */

.status-bar {
  align-items: center;
  background: var(--surface);
  box-shadow: 0 -2px 8px rgba(0,0,0,0.06);
  display: flex;
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 500;
  gap: 8px;
  height: 52px;
  overflow: hidden;
  padding: 0 16px;
}
.status-segment { color: var(--text-dim); font-weight: 600; white-space: nowrap; }
.status-divider { color: var(--border2); }
.status-main    { color: var(--muted); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.status-bar.state-waiting .status-main { color: var(--muted); }
.status-bar.state-partial .status-main { color: #d97706; font-weight: 700; }
.status-bar.state-ready   .status-main { color: var(--accent); font-weight: 700; }
.status-bar.state-built   .status-main { color: var(--green); font-weight: 700; }

.status-actions               { display: flex; flex-shrink: 0; gap: 6px; margin-left: 8px; }
.status-actions .btn-accent   { border-color: var(--accent); color: var(--accent); font-size: 14px; font-weight: 700; padding: 10px 20px; }
.status-actions .btn-accent:hover { background: var(--accent-dim); }
.status-actions .btn-ghost    { font-size: 14px; font-weight: 700; padding: 10px 20px; }


/* ── 15. THEME TOGGLE ── */

.theme-toggle {
  align-items: center;
  display: flex;
  flex-shrink: 0;
  gap: 4px;
}
.theme-opt {
  background: transparent;
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  color: var(--accent);
  cursor: pointer;
  font-family: var(--font);
  font-size: 13px;
  line-height: 1;
  outline: none;
  padding: 5px 9px;
  transition: all 0.15s;
}
.theme-opt:hover  { background: var(--accent-dim); }
.theme-opt.active { background: var(--accent); border-color: var(--accent); color: #fff; }


/* ── 16. HISTORY DRAWER ── */

#historyDrawer {
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: fixed;
  right: -500px;
  top: 0;
  transition: right 0.25s ease;
  width: 500px;
  z-index: 500;
}
#historyDrawer.open { right: 0; }

.drawer-hdr      { align-items: center; border-bottom: 1px solid var(--border); display: flex; flex-shrink: 0; justify-content: space-between; padding: 16px 20px; }
.drawer-hdr span { color: var(--text); font-size: 16px; font-weight: 700; }
.drawer-body     { flex: 1; overflow-y: auto; padding: 14px; }

.history-empty { color: var(--muted); padding: 40px 0; text-align: center; }

.hist-item       { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow-sm); margin-bottom: 10px; overflow: hidden; }
.hist-item-hdr   { align-items: center; cursor: pointer; display: flex; font-size: 14px; justify-content: space-between; padding: 10px 14px; }
.hist-item-hdr:hover { background: var(--surface2); }
.hist-item-body      { border-top: 1px solid var(--border); display: none; font-size: 14px; padding: 12px 14px; }
.hist-item-body.open { display: block; }

.hist-ai-label { color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: 0.08em; margin-bottom: 4px; margin-top: 10px; text-transform: uppercase; }
.hist-text     { background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text-dim); font-family: 'Courier New', monospace; font-size: 12px; line-height: 1.6; max-height: 100px; overflow-y: auto; padding: 8px 10px; white-space: pre-wrap; word-break: break-word; }


/* ── 17. OVERLAY + TOAST ── */

.overlay      { background: rgba(0,0,0,0.2); display: none; inset: 0; position: fixed; z-index: 499; }
.overlay.show { display: block; }

#toast {
  background: #1a202c;
  border-radius: var(--radius-sm);
  bottom: 22px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  color: #ffffff;
  font-size: 14px;
  font-weight: 500;
  left: 50%;
  opacity: 0;
  padding: 10px 20px;
  pointer-events: none;
  position: fixed;
  transform: translateX(-50%) translateY(8px);
  transition: all 0.2s;
  white-space: nowrap;
  z-index: 999;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── CSS TOOLTIPS (used on theme toggle buttons) ── */
[data-tooltip] { position: relative; }
[data-tooltip]::after {
  background: #1a202c;
  border-radius: var(--radius-sm);
  top: calc(100% + 8px);
  color: #ffffff;
  content: attr(data-tooltip);
  font-family: var(--font);
  font-size: 12px;
  font-weight: 500;
  left: 50%;
  opacity: 0;
  padding: 5px 10px;
  pointer-events: none;
  position: absolute;
  transform: translateX(-50%) translateY(-4px);
  transition: all 0.15s;
  white-space: nowrap;
  z-index: 1000;
}
[data-tooltip]:hover::after { opacity: 1; transform: translateX(-50%) translateY(0); }


/* ── 18. MOBILE BLOCKER ── */

.mobile-blocker {
  display: none;
  align-items: center;
  background: var(--bg);
  bottom: 0;
  inset: 0;
  justify-content: center;
  left: 0;
  position: fixed;
  right: 0;
  top: 0;
  z-index: 9999;
}

.mobile-blocker-inner {
  align-items: center;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 320px;
  padding: 40px 24px;
  text-align: center;
}

.mobile-blocker-logo {
  font-size: 64px;
  line-height: 1;
}

.mobile-blocker-title {
  color: var(--text);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.mobile-blocker-msg {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
}

@media (max-width: 1023px) {
  .mobile-blocker { display: flex; }
}
