/* Ember — יומן רגעים חמים
   © אופיר ברנס (Ofir Baranes) 2026
   Palette: charcoal-warm + copper ember
*/

:root {
  --bg-0: #0e0905;
  --bg-1: #1a120c;
  --bg-2: #221710;
  --surface: rgba(38, 27, 19, 0.55);
  --surface-hi: rgba(56, 38, 25, 0.62);
  --border: rgba(217, 123, 60, 0.16);
  --border-hi: rgba(244, 162, 97, 0.32);

  --ember-deep: #5c3a24;
  --ember: #d97b3c;
  --ember-hi: #f4a261;
  --flame: #f9c784;
  --cream: #fde6c8;
  --ash: #8a7361;
  --ash-dim: #5a4a3d;

  --text: #fbe9cf;
  --text-mute: #b39c83;
  --text-dim: #7d6b58;

  --warn: #e76f51;
  --danger: #b8412c;

  --shadow-1: 0 1px 0 rgba(255, 200, 140, 0.06) inset, 0 10px 30px rgba(0,0,0,0.55);
  --shadow-2: 0 1px 0 rgba(255, 200, 140, 0.08) inset, 0 24px 60px rgba(0,0,0,0.65), 0 4px 16px rgba(217, 123, 60, 0.08);
  --glow: 0 0 40px rgba(217, 123, 60, 0.22), 0 0 8px rgba(244, 162, 97, 0.18);

  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --ease: cubic-bezier(.22, .61, .36, 1);

  --r-lg: 22px;
  --r-md: 14px;
  --r-sm: 10px;

  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
}

[data-palette="copper"] {
  --ember-deep: #6b3a1f;
  --ember: #c2602e;
  --ember-hi: #e89968;
  --flame: #f0c08a;
  --cream: #fce4cf;
}
[data-palette="oxblood"] {
  --bg-0: #0a0506;
  --bg-1: #170a0c;
  --bg-2: #1f0e10;
  --ember-deep: #5e1f1f;
  --ember: #a83838;
  --ember-hi: #e36a5d;
  --flame: #f5a194;
  --cream: #fbd9d2;
  --text: #f8e2db;
  --text-mute: #b3978d;
  --border: rgba(168, 56, 56, 0.18);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

html {
  background: var(--bg-0);
  color-scheme: dark;
}

body {
  font-family: 'Heebo', system-ui, -apple-system, sans-serif;
  font-weight: 400;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  min-height: 100vh;
  background:
    radial-gradient(ellipse 80% 60% at 50% -10%, rgba(217, 123, 60, 0.10), transparent 70%),
    radial-gradient(ellipse 60% 40% at 80% 80%, rgba(184, 65, 44, 0.06), transparent 70%),
    linear-gradient(180deg, var(--bg-0), var(--bg-1) 60%, var(--bg-0));
  background-attachment: fixed;
  position: relative;
  overflow-x: hidden;
  padding-bottom: calc(24px + var(--safe-bottom));
}

body[data-font="serif"] .hero-title,
body[data-font="serif"] h1,
body[data-font="serif"] h2 { font-family: 'Frank Ruhl Libre', serif; }

/* AMBIENT BG */
.ambient-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.orb-blur {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.45;
  animation: orbDrift 22s var(--ease) infinite alternate;
}
.orb-blur.o1 { top: -8%; left: -10%; width: 360px; height: 360px; background: radial-gradient(circle, #c2602e, transparent 70%); }
.orb-blur.o2 { bottom: 5%; right: -8%; width: 480px; height: 480px; background: radial-gradient(circle, #5c3a24, transparent 70%); animation-delay: -8s; }
.orb-blur.o3 { top: 35%; right: 30%; width: 280px; height: 280px; background: radial-gradient(circle, #e76f51, transparent 70%); opacity: 0.20; animation-delay: -14s; }

@keyframes orbDrift {
  0%   { transform: translate(0,0) scale(1); }
  100% { transform: translate(60px, -40px) scale(1.15); }
}

.grain {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    radial-gradient(rgba(255,200,140,0.02) 1px, transparent 1px);
  background-size: 3px 3px, 5px 5px;
  background-position: 0 0, 1px 1px;
  mix-blend-mode: overlay;
  opacity: 0.5;
}

.sparks { position: absolute; inset: 0; pointer-events: none; }
.spark {
  position: absolute;
  width: 2px; height: 2px;
  border-radius: 50%;
  background: var(--flame);
  box-shadow: 0 0 6px var(--ember-hi), 0 0 12px rgba(244,162,97,0.4);
  opacity: 0;
  animation: spark var(--dur, 6s) linear infinite;
  animation-delay: var(--delay, 0s);
}
@keyframes spark {
  0%   { opacity: 0; transform: translate(0, 0) scale(0.6); }
  10%  { opacity: 0.9; }
  100% { opacity: 0; transform: translate(var(--dx, 20px), -200px) scale(0.2); }
}

/* TOPBAR */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(12px + var(--safe-top)) 18px 12px;
  background: linear-gradient(180deg, rgba(14,9,5,0.85), rgba(14,9,5,0.5) 60%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Frank Ruhl Libre', serif;
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.01em;
  color: var(--cream);
}
.brand .mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(217,123,60,0.20), rgba(184,65,44,0.10));
  color: var(--ember-hi);
  box-shadow: inset 0 0 0 1px rgba(244,162,97,0.25), 0 0 20px rgba(217,123,60,0.18);
}
.brand .mark svg { width: 22px; height: 22px; }

.header-actions { display: flex; align-items: center; gap: 6px; }
.icon-btn {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border: 1px solid var(--border);
  background: rgba(26, 18, 12, 0.55);
  color: var(--cream);
  border-radius: 12px;
  cursor: pointer;
  transition: transform .25s var(--spring), background .2s var(--ease), border-color .2s var(--ease);
  backdrop-filter: blur(8px);
}
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn:hover { background: rgba(56,38,25,0.7); border-color: var(--border-hi); transform: translateY(-1px); }
.icon-btn:active { transform: scale(0.94); }

.install-btn {
  height: 38px;
  padding: 0 14px;
  font-family: 'Heebo', sans-serif;
  font-weight: 600;
  font-size: 13px;
  color: var(--bg-0);
  background: linear-gradient(135deg, var(--ember-hi), var(--ember));
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: transform .25s var(--spring), box-shadow .2s var(--ease);
  box-shadow: 0 6px 20px rgba(217,123,60,0.3);
}
.install-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(217,123,60,0.4); }
.install-btn.hidden { display: none; }

/* MAIN */
main {
  position: relative;
  z-index: 1;
  max-width: 980px;
  margin: 0 auto;
  padding: 4px 18px 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* HERO */
.hero {
  position: relative;
  border-radius: var(--r-lg);
  overflow: hidden;
  min-height: 320px;
  display: flex;
  align-items: flex-end;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-2);
  isolation: isolate;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background: url('hero_bg.png') center/cover no-repeat, linear-gradient(135deg, var(--ember-deep), var(--bg-1));
  z-index: -2;
  transform: scale(1.04);
  transition: transform 1.2s var(--ease);
}
.hero:hover .hero-bg { transform: scale(1.08); }
.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(14,9,5,0.92), rgba(14,9,5,0.55) 45%, rgba(14,9,5,0.15) 85%),
    linear-gradient(180deg, transparent 30%, rgba(14,9,5,0.85));
  z-index: -1;
}
.hero-content {
  padding: 28px 28px 26px;
  width: 100%;
}
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: rgba(217, 123, 60, 0.15);
  border: 1px solid rgba(244, 162, 97, 0.28);
  border-radius: 999px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--flame);
  text-transform: uppercase;
  margin-bottom: 18px;
}
.hero-eyebrow .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--ember-hi);
  box-shadow: 0 0 8px var(--ember-hi);
  animation: pulse 2.2s var(--ease) infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

.hero-title {
  font-family: 'Frank Ruhl Libre', serif;
  font-weight: 900;
  font-size: clamp(34px, 7vw, 52px);
  line-height: 1.05;
  letter-spacing: -0.025em;
  color: var(--cream);
  margin: 0 0 16px;
}
.hero-title .serif { font-family: 'Frank Ruhl Libre', serif; }
.hero-title em.italic {
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  font-weight: 400;
  color: var(--ember-hi);
}
.hero-sub {
  max-width: 540px;
  color: var(--text-mute);
  font-size: 15px;
  line-height: 1.6;
  margin: 0 0 22px;
}
.hero-meta {
  display: flex;
  gap: 18px;
  align-items: center;
  flex-wrap: wrap;
}
.meta-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.meta-num {
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 500;
  font-size: 26px;
  color: var(--cream);
  letter-spacing: -0.01em;
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
}
.flame-sm { font-size: 16px; }
.meta-lbl {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.meta-divider {
  width: 1px;
  height: 32px;
  background: var(--border);
}

/* GLASS PANELS */
.glass {
  background: var(--surface);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
}
.panel {
  padding: 22px;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 10px;
}
.panel-title {
  margin: 0;
  font-family: 'Frank Ruhl Libre', serif;
  font-weight: 700;
  font-size: 19px;
  color: var(--cream);
  letter-spacing: -0.01em;
}
.panel-title .muted {
  font-family: 'Heebo', sans-serif;
  font-weight: 400;
  font-size: 13px;
  color: var(--text-dim);
}

/* PROMPT */
.prompt-card { padding: 20px 22px; }
.prompt-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.prompt-tag {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ember-hi);
}
.prompt-refresh {
  width: 32px; height: 32px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-mute);
  border-radius: 10px;
  display: grid; place-items: center;
  cursor: pointer;
  transition: transform .35s var(--spring), color .2s;
}
.prompt-refresh svg { width: 14px; height: 14px; }
.prompt-refresh:hover { color: var(--ember-hi); }
.prompt-refresh:active { transform: rotate(180deg); }
.prompt-text {
  font-family: 'Instrument Serif', serif;
  font-size: 22px;
  line-height: 1.45;
  color: var(--cream);
  margin: 0;
  font-style: italic;
}

/* COMPOSER */
.composer { padding: 20px 22px; }
.composer textarea {
  width: 100%;
  background: transparent;
  border: none;
  resize: none;
  color: var(--text);
  font-family: 'Heebo', sans-serif;
  font-size: 16px;
  line-height: 1.7;
  outline: none;
  padding: 8px 4px 12px;
  border-bottom: 1px solid var(--border);
  transition: border-color .2s;
}
.composer textarea::placeholder { color: var(--text-dim); }
.composer textarea:focus { border-bottom-color: var(--ember); }
.composer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 14px 0;
  flex-wrap: wrap;
}
.warmth { display: flex; align-items: center; gap: 10px; }
.warmth-lbl {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.warmth-pips { display: flex; gap: 4px; }
.pip {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--ash-dim);
  cursor: pointer;
  transition: all .25s var(--spring);
}
.pip svg { width: 16px; height: 16px; }
.pip:hover { border-color: var(--border-hi); transform: translateY(-1px); }
.pip.active {
  background: linear-gradient(135deg, var(--ember-hi), var(--ember));
  border-color: var(--ember-hi);
  color: var(--bg-0);
  box-shadow: 0 0 14px rgba(244,162,97,0.5);
}
.tag-input-wrap { flex: 1; min-width: 180px; }
.tag-input-wrap input {
  width: 100%;
  background: rgba(26, 18, 12, 0.5);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 12px;
  color: var(--text);
  font-family: 'Heebo', sans-serif;
  font-size: 13px;
  outline: none;
  transition: border-color .2s;
}
.tag-input-wrap input:focus { border-color: var(--border-hi); }
.tag-input-wrap input::placeholder { color: var(--text-dim); }

.composer-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
}
.word-count {
  margin-inline-end: auto;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: var(--text-dim);
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 12px;
  font-family: 'Heebo', sans-serif;
  font-weight: 600;
  font-size: 13.5px;
  cursor: pointer;
  border: none;
  transition: all .25s var(--spring);
}
.btn svg { width: 16px; height: 16px; }
.btn-primary {
  background: linear-gradient(135deg, var(--ember-hi), var(--ember));
  color: var(--bg-0);
  box-shadow: 0 6px 20px rgba(217,123,60,0.3);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(217,123,60,0.42); }
.btn-primary:active { transform: scale(0.97); }
.btn-ghost {
  background: rgba(56, 38, 25, 0.4);
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-ghost:hover { background: rgba(56, 38, 25, 0.6); border-color: var(--border-hi); }
.btn-danger-ghost {
  background: transparent;
  border: 1px solid rgba(184,65,44,0.4);
  color: #e08070;
}
.btn-danger-ghost:hover { background: rgba(184,65,44,0.12); }

/* HEATMAP */
.heat-legend {
  display: flex;
  align-items: center;
  gap: 4px;
}
.legend-cell {
  width: 12px; height: 12px;
  border-radius: 3px;
  background: var(--surface-hi);
}
.legend-cell.l0 { background: rgba(56, 38, 25, 0.4); }
.legend-cell.l1 { background: rgba(217, 123, 60, 0.22); }
.legend-cell.l2 { background: rgba(217, 123, 60, 0.40); }
.legend-cell.l3 { background: rgba(217, 123, 60, 0.62); }
.legend-cell.l4 { background: rgba(244, 162, 97, 0.85); }
.legend-cell.l5 { background: var(--ember-hi); box-shadow: 0 0 6px var(--ember-hi); }

.muted, .muted-sm { color: var(--text-dim); font-weight: 400; }
.muted-sm { font-size: 11px; font-family: 'IBM Plex Mono', monospace; }

.heatmap-wrap {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}
.heatmap-months {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-top: 18px;
  padding-inline-end: 4px;
}
.heat-month {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: var(--text-dim);
  height: 12px;
  line-height: 12px;
}
.heatmap-body { position: relative; min-width: 0; }
.heatmap-days {
  display: flex;
  gap: 4px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: var(--text-dim);
  margin-bottom: 4px;
  padding-inline-start: 18px;
}
.heat-dow { width: 14px; text-align: center; }
.heatmap-grid {
  display: block;
  width: 100%;
  height: auto;
  min-height: 110px;
}

/* INSIGHTS */
.insights-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
.insight-card { padding: 18px 20px; }
.insight-title {
  margin: 0 0 10px;
  font-family: 'Heebo', sans-serif;
  font-weight: 600;
  font-size: 13px;
  color: var(--text-mute);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.insight-card svg { width: 100%; height: 110px; display: block; }
.insight-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
}
.delta {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
  color: var(--ember-hi);
}
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 110px;
  align-items: flex-start;
  align-content: flex-start;
}
.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: rgba(217,123,60,0.10);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12px;
  color: var(--cream);
}
.tag-chip .tcount {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: var(--ember-hi);
}
.recent-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 110px;
}
.recent-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(26, 18, 12, 0.45);
  border: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--text);
}
.recent-item .flames {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: var(--ember-hi);
  white-space: nowrap;
}
.recent-item .recent-text {
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
}
.recent-item .recent-date {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: var(--text-dim);
  white-space: nowrap;
}

/* SHEETS */
.sheet {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: flex-end;
  justify-content: center;
}
.sheet[aria-hidden="false"] { display: flex; }
.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(6px);
  animation: fadeIn .25s var(--ease);
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.sheet-body {
  position: relative;
  width: 100%;
  max-width: 640px;
  max-height: 88vh;
  background: linear-gradient(180deg, var(--bg-2), var(--bg-1));
  border: 1px solid var(--border-hi);
  border-bottom: none;
  border-radius: 24px 24px 0 0;
  padding: 8px 0 calc(20px + var(--safe-bottom));
  display: flex;
  flex-direction: column;
  box-shadow: 0 -20px 60px rgba(0,0,0,0.6);
  animation: slideUp .35s var(--spring);
}
@keyframes slideUp { from { transform: translateY(40px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.sheet-handle {
  width: 44px;
  height: 4px;
  background: var(--ash-dim);
  border-radius: 2px;
  margin: 6px auto 8px;
}
.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 22px 14px;
}
.sheet-head h2 {
  margin: 0;
  font-family: 'Frank Ruhl Libre', serif;
  font-weight: 700;
  font-size: 22px;
  color: var(--cream);
}
.sheet-toolbar {
  padding: 0 22px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sheet-toolbar input[type="search"] {
  width: 100%;
  background: rgba(26, 18, 12, 0.6);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 12px;
  font-family: 'Heebo', sans-serif;
  font-size: 14px;
  outline: none;
}
.sheet-toolbar input[type="search"]:focus { border-color: var(--border-hi); }
.filter-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.fpill {
  padding: 6px 12px;
  background: rgba(26, 18, 12, 0.55);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-mute);
  font-size: 12px;
  cursor: pointer;
  transition: all .2s var(--ease);
}
.fpill:hover { color: var(--cream); border-color: var(--border-hi); }
.fpill.active {
  background: rgba(217,123,60,0.18);
  color: var(--ember-hi);
  border-color: var(--ember);
}

.history-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px 22px 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.history-item {
  position: relative;
  padding: 14px 16px;
  background: rgba(26, 18, 12, 0.6);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.history-item:hover { border-color: var(--border-hi); }
.history-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: var(--text-dim);
}
.history-meta .flames { color: var(--ember-hi); }
.history-text {
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
  white-space: pre-wrap;
}
.history-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.history-tags .tag {
  font-size: 10.5px;
  padding: 2px 8px;
  background: rgba(217, 123, 60, 0.10);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-mute);
}
.history-actions {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}
.h-act {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-mute);
  padding: 4px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 11.5px;
  transition: all .2s;
}
.h-act:hover { color: var(--cream); border-color: var(--border-hi); }
.h-act.danger { color: #e08070; border-color: rgba(184,65,44,0.3); }
.h-act.danger:hover { background: rgba(184,65,44,0.12); }

/* SETTINGS */
.settings-body, .about-content {
  padding: 4px 22px 8px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  overflow-y: auto;
}
.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.setting-row.col { flex-direction: column; align-items: stretch; }
.setting-row label {
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
}
.seg {
  display: flex;
  gap: 4px;
  background: rgba(26, 18, 12, 0.55);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 3px;
}
.seg button {
  padding: 6px 12px;
  background: transparent;
  border: none;
  color: var(--text-mute);
  font-family: 'Heebo', sans-serif;
  font-size: 12.5px;
  border-radius: 7px;
  cursor: pointer;
  transition: all .2s;
}
.seg button.active {
  background: rgba(217,123,60,0.22);
  color: var(--cream);
}
.switch {
  position: relative;
  width: 44px; height: 24px;
}
.switch input { opacity: 0; width: 0; height: 0; }
.switch span {
  position: absolute;
  inset: 0;
  background: var(--ash-dim);
  border-radius: 24px;
  cursor: pointer;
  transition: background .25s;
}
.switch span::before {
  content: '';
  position: absolute;
  top: 3px;
  inset-inline-end: 3px;
  width: 18px; height: 18px;
  background: var(--cream);
  border-radius: 50%;
  transition: transform .3s var(--spring);
}
.switch input:checked + span { background: var(--ember); }
.switch input:checked + span::before { transform: translateX(20px); }
[dir="rtl"] .switch input:checked + span::before { transform: translateX(-20px); }

.num-input {
  width: 70px;
  background: rgba(26, 18, 12, 0.6);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 10px;
  padding: 6px 10px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 14px;
  text-align: center;
  outline: none;
}
.data-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.data-actions .btn { flex: 1; min-width: 110px; justify-content: center; }

/* ABOUT */
.about-body { padding-bottom: 30px; }
.about-content { padding-bottom: 20px; }
.about-lead {
  font-family: 'Instrument Serif', serif;
  font-size: 20px;
  line-height: 1.5;
  color: var(--cream);
  font-style: italic;
  margin: 0;
}
.about-content p { margin: 0; color: var(--text-mute); font-size: 14px; line-height: 1.65; }
.about-content p strong { color: var(--ember-hi); }
.about-feats {
  list-style: none;
  margin: 8px 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.about-feats li {
  padding: 10px 14px;
  background: rgba(26, 18, 12, 0.55);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 13px;
  color: var(--text-mute);
}
.about-feats li b { color: var(--cream); font-weight: 600; }
.copyright {
  text-align: center;
  font-size: 11px;
  color: var(--text-dim);
  font-family: 'IBM Plex Mono', monospace;
  letter-spacing: 0.05em;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

/* TOAST */
.toast {
  position: fixed;
  bottom: calc(28px + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  padding: 12px 22px;
  background: rgba(26, 18, 12, 0.95);
  border: 1px solid var(--border-hi);
  color: var(--cream);
  font-size: 13.5px;
  border-radius: 999px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.6), var(--glow);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: all .35s var(--spring);
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* RESPONSIVE */
@media (max-width: 720px) {
  .hero { min-height: 280px; }
  .hero-title { font-size: clamp(28px, 9vw, 42px); }
  .hero-content { padding: 22px 20px; }
  .insights-grid { grid-template-columns: 1fr; }
  .panel { padding: 18px; }
  .header-actions .icon-btn:not(#historyBtn):not(#searchBtn) { display: none; }
  .composer-row { flex-direction: column; align-items: stretch; gap: 12px; }
  .warmth { justify-content: space-between; }
  .meta-divider { display: none; }
  .hero-meta { gap: 22px; }
}
@media (max-width: 540px) {
  main { padding: 4px 14px 0; gap: 14px; }
  .topbar { padding-left: 14px; padding-right: 14px; }
  .hero-content { padding: 20px 18px; }
  .hero-eyebrow { font-size: 10px; padding: 5px 10px; }
  .pip { width: 32px; height: 32px; }
  .pip svg { width: 14px; height: 14px; }
}
@media (max-width: 380px) {
  .meta-num { font-size: 22px; }
  .brand { font-size: 20px; }
  .icon-btn { width: 36px; height: 36px; }
}

/* FOCUS RINGS */
button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--ember-hi);
  outline-offset: 2px;
}

/* SCROLLBARS */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--ash-dim); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--ember-deep); }
