/* ==========================================================================
   Super dark (OLED) theme — overrides the --af-* token contract from base.css.
   True-black canvas, neutral near-black surfaces, off-white text, plum accent.
   ========================================================================== */

:root {
  /* ---- Surfaces ---- */
  --af-ink:           #000000;  /* canvas */
  --af-ink-raised:    #121212;  /* cards, assistant bubbles */
  --af-ink-sunk:      #0A0A0A;  /* rails, composer, headers, code blocks */
  --af-ink-hairline:  #242424;  /* 1px structural borders */
  --af-ink-fog:       #1A1A1A;  /* hover fills, user messages */
  --af-ink-edge:      #666666;  /* input + control borders, ~3.3:1 on surfaces */
  --af-shadow-color:  rgba(0, 0, 0, 0.85);

  /* ---- Text ---- */
  --af-paper:         #EDEDED;  /* headings, emphasis */
  --af-paper-soft:    #D4D4D4;  /* body */
  --af-paper-dim:     #A8A8A8;  /* secondary */
  --af-paper-muted:   #8F8F8F;  /* placeholders, tertiary */

  /* ---- Accent: plum, lifted for dark backgrounds ---- */
  --af-accent:        #D294BC;  /* links, primary buttons (dark text on it) */
  --af-accent-soft:   #DEAACB;  /* hover */
  --af-accent-deep:   #EBC4DC;  /* emphasis text on fog, pressed fills */
  --af-accent-wash:   rgba(210, 148, 188, 0.14);
  --af-accent-edge:   rgba(210, 148, 188, 0.34);
  --af-accent-glow:   rgba(210, 148, 188, 0.16);

  /* ---- Marigold highlight (fine on dark as-is, deep lifted for text) ---- */
  --af-gold:          #EFC45D;
  --af-gold-soft:     #F4D384;
  --af-gold-deep:     #E8B94A;

  /* ---- Semantic, re-tuned for dark ---- */
  --af-alive:         #8CC293;
  --af-warn:          #E2B65C;
  --af-danger:        #EE8B74;
}

html, body {
  color-scheme: dark;
}

/* Scrollbars */
::-webkit-scrollbar-thumb {
  background: #333333;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--af-ink-edge);
}
html {
  scrollbar-color: #333333 transparent;
}

/* Selection */
::selection {
  background: rgba(210, 148, 188, 0.32);
  color: var(--af-paper);
}

/* Modal / drawer backdrops are mixed from the text color, which is light in
   dark mode — darken them instead. */
[class*="_lightboxBackdrop_"] { background: rgba(0, 0, 0, 0.88) !important; }
[class*="_loginBackdrop_"]    { background: rgba(0, 0, 0, 0.7) !important; }
[class*="_lightbox_"]::backdrop { background: rgba(0, 0, 0, 0.8) !important; }
[class*="_extensionOverlay_"],
[class*="_mobileBackdropVisible_"],
[class*="_modelBackdrop_"]    { background: rgba(0, 0, 0, 0.7) !important; }

/* Kill-button hover tint tuned for the lighter danger color */
.btn-icon.btn-kill:hover {
  background: rgba(238, 139, 116, 0.14);
}

/* Form controls: make sure native inputs never fall back to light */
input, textarea, select {
  color-scheme: dark;
}
input::placeholder, textarea::placeholder {
  color: var(--af-paper-muted);
}

/* Chat composer: the bundle borders it with --af-paper (bright text color).
   Swap for a soft dark grey; focus stays faintly visible. Recording state
   keeps its own danger tint. */
[class*="_composerShell_"]:not([class*="_composerRecording_"]) {
  border-color: #2e2e2e !important;
}
[class*="_composerShell_"]:not([class*="_composerRecording_"]):focus-within {
  border-color: #3a3a3a !important;
}
