/* ── Papyrus · Dark Editorial ───────────────────────────────────────────── */

:root {
  --ink: #e9e5dc;
  --ink-soft: #b8b2a4;
  --ink-muted: #6e695e;
  --paper: #121110;
  --paper-raised: #1a1917;
  --paper-panel: #161514;
  --line: rgba(233, 229, 220, 0.11);
  --line-strong: rgba(233, 229, 220, 0.22);
  --accent: #c4a574;
  --accent-dim: rgba(196, 165, 116, 0.15);
  --ready: #7a9e6a;
  --error: #c47070;

  --font-display: 'Cormorant Garamond', 'Georgia', serif;
  --font-body: 'Source Serif 4', 'Georgia', serif;
  --font-ui: 'IBM Plex Mono', 'Consolas', monospace;

  --ease-organic: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-drift: cubic-bezier(0.45, 0.05, 0.55, 0.95);
  --ease-settle: cubic-bezier(0.33, 0.86, 0.45, 1);
}

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

html { font-size: 16px; }

body {
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--ink-soft);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Film grain overlay */
.grain {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px;
}

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 3px; }

/* ── Header ─────────────────────────────────────────────────────────────── */

.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 36px 16px 40px;
  border-bottom: 1px solid var(--line);
  animation: drift-in 0.9s var(--ease-organic) both;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: inherit;
}

.brand-logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
  flex-shrink: 0;
  display: block;
  animation: mark-settle 1.2s var(--ease-settle) 0.2s both;
}

.brand-text .brand-name {
  display: block;
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: 0.01em;
  line-height: 1.1;
  text-decoration: none;
}

.brand-tag {
  font-family: var(--font-ui);
  font-size: 0.58rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-top: 3px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  animation: drift-in 0.9s var(--ease-organic) 0.15s both;
}

.header-divider {
  width: 1px;
  height: 22px;
  background: var(--line-strong);
  flex-shrink: 0;
}

/* ── Critique Toggle & Sidebar ──────────────────────────────────────────── */

.critique-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-ui);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--paper);
  background: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 80%, white);
  padding: 10px 18px 10px 14px;
  cursor: pointer;
  flex-shrink: 0;
  animation: critique-beacon 2.8s var(--ease-drift) infinite;
  transition: transform 0.35s var(--ease-organic), background 0.3s, box-shadow 0.35s;
}

.critique-toggle-icon {
  display: flex;
  align-items: center;
  opacity: 0.85;
}

.critique-toggle-label {
  white-space: nowrap;
}

.critique-toggle-arrow {
  font-size: 0.85rem;
  opacity: 0.7;
  transition: transform 0.35s var(--ease-organic), opacity 0.3s;
}

.critique-toggle:hover {
  background: color-mix(in srgb, var(--accent) 88%, white);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(196, 165, 116, 0.35);
}

.critique-toggle:hover .critique-toggle-arrow {
  transform: translateX(3px);
  opacity: 1;
}

.critique-toggle[aria-expanded="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
  animation: none;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.critique-toggle.has-content {
  animation: critique-beacon-strong 1.8s var(--ease-drift) infinite;
}

.critique-indicator {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--ready);
  box-shadow: 0 0 0 2px var(--paper), 0 0 10px rgba(122, 158, 106, 0.6);
  animation: indicator-pulse 1.6s var(--ease-drift) infinite;
}

@keyframes critique-beacon {
  0%, 100% { box-shadow: 0 0 0 0 rgba(196, 165, 116, 0.45); }
  50%      { box-shadow: 0 0 0 5px rgba(196, 165, 116, 0); }
}

@keyframes critique-beacon-strong {
  0%, 100% { box-shadow: 0 0 0 0 rgba(196, 165, 116, 0.55), 0 4px 14px rgba(196, 165, 116, 0.25); }
  50%      { box-shadow: 0 0 0 7px rgba(196, 165, 116, 0), 0 4px 20px rgba(196, 165, 116, 0.4); }
}

@keyframes indicator-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%      { transform: scale(1.25); opacity: 0.85; }
}

.status-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-ui);
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ready);
  animation: breathe 3.2s var(--ease-drift) infinite;
}

.status-dot.loading {
  background: var(--accent);
  animation: breathe-fast 1.1s var(--ease-drift) infinite;
}

.avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-ui);
  font-size: 0.58rem;
  font-weight: 500;
  color: var(--ink-muted);
  letter-spacing: 0.04em;
  cursor: default;
}

.sign-out-btn {
  background: none;
  border: none;
  padding: 6px;
  border-radius: 6px;
  color: var(--ink-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}
.sign-out-btn:hover {
  background: var(--line);
  color: var(--ink);
}

/* ── Critique Sidebar ─────────────────────────────────────────────────────── */

.critique-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(8, 7, 6, 0.55);
  z-index: 150;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.45s var(--ease-organic);
}

.critique-backdrop.visible {
  opacity: 1;
  pointer-events: auto;
}

.critique-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(480px, 92vw);
  background: var(--paper-raised);
  border-right: 1px solid var(--line-strong);
  z-index: 160;
  display: flex;
  flex-direction: column;
  padding: 0;
  transform: translateX(-105%);
  transition: transform 0.55s var(--ease-settle);
  box-shadow: 8px 0 40px rgba(0, 0, 0, 0.35);
}

.critique-sidebar.open {
  transform: translateX(0);
}

.critique-sidebar-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 22px 28px 18px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}

.critique-sidebar-title {
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.15;
  margin-bottom: 4px;
}

.critique-sidebar-sub {
  font-family: var(--font-ui);
  font-size: 0.55rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.critique-close {
  font-family: var(--font-ui);
  font-size: 1.4rem;
  line-height: 1;
  color: var(--ink-muted);
  background: none;
  border: 1px solid var(--line);
  width: 32px;
  height: 32px;
  cursor: pointer;
  flex-shrink: 0;
  transition: color 0.25s, border-color 0.25s;
}

.critique-close:hover {
  color: var(--ink);
  border-color: var(--line-strong);
}

.critique-sidebar-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px 32px;
  font-size: 0.94rem;
  color: var(--ink-soft);
  line-height: 1.75;
}

/* ── Critique tabs + conversation (chat) ───────────────────────────────── */

.critique-tabs {
  display: flex;
  gap: 2px;
  padding: 10px 28px 0;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}

.critique-tab {
  font-family: var(--font-ui);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 8px 14px 10px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}

.critique-tab:hover { color: var(--ink); }

.critique-tab.active {
  color: var(--ink);
  border-bottom-color: var(--accent, var(--ink));
}

.critique-pane {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

.critique-pane.visible { display: flex; }

/* Chat transcript */
.chat-log {
  flex: 1;
  overflow-y: auto;
  padding: 18px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
  font-family: var(--font-serif, inherit);
}

.chat-msg {
  max-width: 88%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 0.88rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.chat-msg.user {
  align-self: flex-end;
  background: var(--accent-soft, rgba(0,0,0,0.05));
  border: 1px solid var(--line);
}

.chat-msg.assistant {
  align-self: flex-start;
  background: var(--paper);
  border: 1px solid var(--line);
}

.chat-msg.assistant p { margin: 0 0 8px; }
.chat-msg.assistant p:last-child { margin-bottom: 0; }
.chat-msg.assistant ul, .chat-msg.assistant ol { margin: 6px 0; padding-left: 20px; }
.chat-msg.assistant h1, .chat-msg.assistant h2, .chat-msg.assistant h3,
.chat-msg.assistant h4 { margin: 8px 0 4px; font-size: 1.05rem; line-height: 1.3; }

.chat-status {
  align-self: flex-start;
  color: var(--ink-muted);
  font-size: 0.78rem;
  font-style: italic;
}

/* Composer */
.chat-composer {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 12px 24px 16px;
  border-top: 1px solid var(--line);
  flex-shrink: 0;
}

.chat-input {
  flex: 1;
  resize: none;
  font-family: var(--font-ui);
  font-size: 0.85rem;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 12px;
  line-height: 1.5;
}

.chat-input:focus { outline: none; border-color: var(--line-strong); }

.chat-send { flex-shrink: 0; }
.chat-send:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Asymmetric Layout ──────────────────────────────────────────────────── */

.desk-layout {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(380px, 1fr);
  gap: 0;
  max-width: 1680px;
  width: 100%;
  margin: 0 auto;
  padding: 24px 32px 32px 40px;
  align-items: stretch;
  min-height: calc(100vh - 72px);
}

.sidebar-stack {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-top: 0;
  padding-left: 28px;
  border-left: 1px solid var(--line);
  animation: sidebar-rise 1s var(--ease-organic) 0.25s both;
  min-height: calc(100vh - 120px);
}

/* ── Panels ─────────────────────────────────────────────────────────────── */

.panel {
  background: var(--paper-panel);
  border: 1px solid var(--line);
  position: relative;
}

.desk-panel {
  padding: 28px 36px 24px 40px;
  min-height: calc(100vh - 120px);
  display: flex;
  flex-direction: column;
  animation: desk-enter 1.1s var(--ease-organic) 0.1s both;
  border-radius: 0 2px 24px 0;
  margin-right: -1px;
}

.mastery-panel {
  padding: 22px 24px 0;
  border-radius: 0 0 2px 16px;
  flex: 1 1 auto;
  min-height: calc(100vh - 120px);
  display: flex;
  flex-direction: column;
  transform: translateX(-4px);
  animation: panel-stagger 0.85s var(--ease-organic) 0.48s both;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.panel-head.compact {
  margin-bottom: 14px;
  padding-bottom: 10px;
}

.panel-name {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.01em;
  line-height: 1.15;
}

.panel-label {
  font-family: var(--font-ui);
  font-size: 0.58rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.desk-meta {
  font-family: var(--font-ui);
  font-size: 0.58rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.desk-meta strong {
  color: var(--ink-soft);
  font-weight: 500;
}

.meta-sep {
  margin: 0 6px;
  opacity: 0.4;
}

.panel-body {
  font-size: 0.92rem;
  color: var(--ink-soft);
  overflow-y: auto;
  padding-right: 4px;
}

.mastery-panel .panel-body,
.mastery-panel .roadmap-view,
.mastery-panel .lesson-view {
  flex: 1;
  min-height: 0;
}

#pathPlaceholder {
  min-height: 120px;
}

.empty-state {
  font-family: var(--font-body);
  font-style: italic;
  color: var(--ink-muted);
  font-size: 0.95rem;
  line-height: 1.7;
  padding: 8px 0;
}

/* ── Manuscript Editor ───────────────────────────────────────────────────── */

.desk-form {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  gap: 0;
}

.writing-purpose {
  border: none;
  margin: 0 0 22px;
  padding: 0 0 22px;
  border-bottom: 1px solid var(--line);
}

.purpose-legend {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 6px;
  padding: 0;
}

.purpose-hint {
  font-size: 0.88rem;
  font-style: italic;
  color: var(--ink-muted);
  margin-bottom: 16px;
  line-height: 1.55;
}

.field-label {
  display: block;
  font-family: var(--font-ui);
  font-size: 0.55rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 8px;
}

.manuscript-label {
  margin-top: 4px;
  margin-bottom: 10px;
}

.label-optional {
  text-transform: none;
  letter-spacing: 0;
  font-style: italic;
  opacity: 0.75;
}

.purpose-select {
  width: 100%;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--ink);
  background: rgba(233, 229, 220, 0.04);
  border: 1px solid var(--line);
  padding: 11px 14px;
  margin-bottom: 16px;
  cursor: pointer;
  outline: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236e695e' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.purpose-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-dim);
}

.purpose-select:invalid {
  color: var(--ink-muted);
}

.purpose-context {
  width: 100%;
  font-family: var(--font-body);
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--ink-soft);
  background: rgba(233, 229, 220, 0.03);
  border: 1px solid var(--line);
  padding: 10px 14px;
  resize: vertical;
  min-height: 56px;
  outline: none;
  transition: border-color 0.3s;
}

.purpose-context::placeholder {
  font-style: italic;
  color: var(--ink-muted);
}

.purpose-context:focus {
  border-color: var(--line-strong);
  color: var(--ink);
}

.manuscript {
  flex: 1;
  width: 100%;
  min-height: calc(100vh - 260px);
  background: transparent;
  border: none;
  outline: none;
  resize: vertical;
  font-family: var(--font-body);
  font-size: 1.12rem;
  line-height: 1.9;
  color: var(--ink);
  padding: 4px 0 28px;
}

.manuscript::placeholder {
  font-style: italic;
  color: var(--ink-muted);
}

.desk-action {
  display: flex;
  justify-content: center;
  padding-top: 8px;
  animation: float-subtle 6s var(--ease-drift) infinite;
}

/* ── Manuscript Toolbar ──────────────────────────────────────────────────── */

.manuscript-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.manuscript-title-group {
  flex: 1;
  min-width: 0;
}

.manuscript-title-group .field-label {
  margin-bottom: 6px;
}

.manuscript-title-input {
  width: 100%;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--ink);
  background: transparent;
  border: none;
  border-bottom: 1px solid transparent;
  padding: 4px 0;
  outline: none;
  transition: border-color 0.3s;
}

.manuscript-title-input::placeholder {
  color: var(--ink-muted);
}

.manuscript-title-input:focus {
  border-bottom-color: var(--accent);
}

.manuscript-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

/* ── Save Status ─────────────────────────────────────────────────────────── */

.save-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-ui);
  font-size: 0.55rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-muted);
  white-space: nowrap;
}

.save-indicator {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ready);
  transition: background 0.3s;
}

.save-status.saving .save-indicator {
  background: var(--accent);
  animation: breathe-fast 1.1s var(--ease-drift) infinite;
}

.save-status.saving .save-text {
  color: var(--accent);
}

.save-status.error .save-indicator {
  background: var(--error);
}

.save-status.error .save-text {
  color: var(--error);
}

/* ── Secondary Button ────────────────────────────────────────────────────── */

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-ui);
  font-size: 0.55rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
  background: transparent;
  border: 1px solid var(--line);
  padding: 8px 14px;
  cursor: pointer;
  transition: color 0.25s, border-color 0.25s, background 0.25s;
  white-space: nowrap;
}

.btn-secondary svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  flex-shrink: 0;
}

.btn-secondary:hover {
  color: var(--ink);
  border-color: var(--line-strong);
  background: rgba(233, 229, 220, 0.04);
}

.btn-secondary:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* ── Manuscript List Panel ───────────────────────────────────────────────── */

.manuscript-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(360px, 88vw);
  background: var(--paper-raised);
  border-left: 1px solid var(--line-strong);
  z-index: 165;
  display: flex;
  flex-direction: column;
  padding: 0;
  transform: translateX(105%);
  transition: transform 0.45s var(--ease-settle);
  box-shadow: -8px 0 40px rgba(0, 0, 0, 0.35);
}

.manuscript-panel.open {
  transform: translateX(0);
}

.manuscript-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}

.manuscript-close {
  font-family: var(--font-ui);
  font-size: 1.4rem;
  line-height: 1;
  color: var(--ink-muted);
  background: none;
  border: 1px solid var(--line);
  width: 32px;
  height: 32px;
  cursor: pointer;
  flex-shrink: 0;
  transition: color 0.25s, border-color 0.25s;
}

.manuscript-close:hover {
  color: var(--ink);
  border-color: var(--line-strong);
}

.manuscript-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
}

.manuscript-panel-footer {
  padding: 14px;
  border-top: 1px solid var(--line);
  flex-shrink: 0;
}

/* ── Manuscript List Items ───────────────────────────────────────────────── */

.manuscript-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 14px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.25s, border-color 0.25s;
  margin-bottom: 4px;
}

.manuscript-item:hover {
  background: var(--accent-dim);
  border-color: var(--line);
}

.manuscript-item.active {
  background: var(--accent-dim);
  border-color: var(--accent);
}

.manuscript-item-icon {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  background: var(--paper-panel);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.7rem;
  color: var(--ink-muted);
}

.manuscript-item.active .manuscript-item-icon {
  border-color: var(--accent);
  color: var(--accent);
}

.manuscript-item-info {
  flex: 1;
  min-width: 0;
}

.manuscript-item-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
  line-height: 1.3;
}

.manuscript-item-preview {
  font-family: var(--font-body);
  font-size: 0.75rem;
  color: var(--ink-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
}

.manuscript-item-meta {
  font-family: var(--font-ui);
  font-size: 0.48rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-top: 5px;
  opacity: 0.7;
}

.manuscript-item-actions {
  flex-shrink: 0;
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.2s;
}

.manuscript-item:hover .manuscript-item-actions {
  opacity: 1;
}

.manuscript-delete-btn {
  background: none;
  border: 1px solid transparent;
  color: var(--ink-muted);
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  font-size: 0.7rem;
  transition: color 0.25s, border-color 0.25s;
  border-radius: 3px;
}

.manuscript-delete-btn:hover {
  color: var(--error);
  border-color: var(--error);
}

.manuscript-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(8, 7, 6, 0.55);
  z-index: 155;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s var(--ease-organic);
}

.manuscript-backdrop.visible {
  opacity: 1;
  pointer-events: auto;
}

/* ── Manuscript Panel Responsive ─────────────────────────────────────────── */

@media (max-width: 960px) {
  .manuscript-toolbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .manuscript-actions {
    width: 100%;
    justify-content: space-between;
  }
}

@media (max-width: 520px) {
  .manuscript-panel { width: 100vw; }
  .manuscript-title-input { font-size: 1.25rem; }
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */

.btn-primary {
  font-family: var(--font-ui);
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  background: var(--ink);
  color: var(--paper);
  border: none;
  padding: 14px 32px;
  cursor: pointer;
  transition: background 0.35s var(--ease-organic), transform 0.35s var(--ease-organic), opacity 0.3s;
}

.btn-primary:hover:not(:disabled) {
  background: #fff;
  transform: translateY(-1px);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
}

.btn-primary:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.btn-primary.narrow {
  width: 100%;
  margin-top: 8px;
}

.back-link {
  font-family: var(--font-ui);
  font-size: 0.58rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: none;
  border: none;
  color: var(--ink-muted);
  cursor: pointer;
  padding: 0;
  transition: color 0.25s;
}

.back-link:hover { color: var(--ink); }

/* ── Critique Markdown ───────────────────────────────────────────────────── */

.panel-body h2,
.panel-body h3,
.critique-sidebar-body h2,
.critique-sidebar-body h3,
.lesson-article h2,
.lesson-article h3 {
  font-family: var(--font-display);
  color: var(--ink);
  font-weight: 500;
  margin: 18px 0 8px;
}

.panel-body h2, .critique-sidebar-body h2, .lesson-article h2 { font-size: 1.15rem; }
.panel-body h3, .critique-sidebar-body h3, .lesson-article h3 { font-size: 1rem; }

.panel-body p, .critique-sidebar-body p, .lesson-article p {
  margin-bottom: 12px;
  line-height: 1.75;
}

.panel-body ul, .panel-body ol,
.critique-sidebar-body ul, .critique-sidebar-body ol,
.lesson-article ul, .lesson-article ol {
  margin: 0 0 14px 1.2em;
}

.panel-body li, .critique-sidebar-body li, .lesson-article li {
  margin-bottom: 5px;
  line-height: 1.65;
}

.panel-body strong, .critique-sidebar-body strong, .lesson-article strong {
  color: var(--ink);
  font-weight: 500;
}

.panel-body blockquote, .critique-sidebar-body blockquote, .lesson-article blockquote {
  border-left: 2px solid var(--accent);
  padding-left: 14px;
  margin: 14px 0;
  font-style: italic;
  color: var(--ink-muted);
}

/* ── Roadmap ─────────────────────────────────────────────────────────────── */

.roadmap-view {
  flex: 1;
  overflow-y: auto;
  min-height: 420px;
  max-height: none;
  padding-bottom: 12px;
}

.roadmap-note {
  font-family: var(--font-body);
  font-style: italic;
  font-size: 0.95rem;
  color: var(--ink-muted);
  margin-bottom: 18px;
  line-height: 1.6;
}

.roadmap-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.roadmap-item {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 18px 14px 18px 8px;
  min-height: 72px;
  cursor: pointer;
  border: 1px solid transparent;
  border-bottom: 1px solid var(--line);
  transition: background 0.3s var(--ease-organic), transform 0.35s var(--ease-organic), border-color 0.3s;
  animation: item-reveal 0.6s var(--ease-organic) both;
}

.roadmap-item:nth-child(1) { animation-delay: 0.05s; }
.roadmap-item:nth-child(2) { animation-delay: 0.12s; }
.roadmap-item:nth-child(3) { animation-delay: 0.19s; }
.roadmap-item:nth-child(4) { animation-delay: 0.26s; }
.roadmap-item:nth-child(5) { animation-delay: 0.33s; }
.roadmap-item:nth-child(6) { animation-delay: 0.40s; }

.roadmap-item:hover:not(.locked) {
  background: var(--accent-dim);
  transform: translateX(3px);
}

.roadmap-item.locked {
  opacity: 0.38;
  cursor: not-allowed;
}

.roadmap-item.completed .item-num {
  color: var(--accent);
}

.item-num {
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
}

.item-info h4 {
  font-family: var(--font-display);
  font-size: 1.28rem;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.3;
  margin-bottom: 5px;
}

.item-status {
  font-family: var(--font-ui);
  font-size: 0.58rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.roadmap-item.unlocked .item-status { color: var(--accent); }
.roadmap-item.completed .item-status { color: var(--ready); }

.item-arrow {
  font-family: var(--font-ui);
  font-size: 0.9rem;
  color: var(--ink-muted);
  transition: transform 0.3s var(--ease-organic);
}

.roadmap-item:hover:not(.locked) .item-arrow {
  transform: translateX(4px);
  color: var(--ink);
}

/* ── Lesson View (Article + Questions) ───────────────────────────────────── */

.lesson-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  min-height: 420px;
  max-height: none;
  padding-bottom: 72px;
  position: relative;
}

.lesson-header {
  margin-bottom: 16px;
  animation: drift-in 0.7s var(--ease-organic) both;
}

.lesson-index {
  font-family: var(--font-ui);
  font-size: 0.52rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  display: block;
  margin-bottom: 6px;
}

.lesson-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.25;
}

.lesson-article {
  font-size: 0.88rem;
  color: var(--ink-soft);
  line-height: 1.75;
  padding-bottom: 20px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--line);
  animation: article-unfold 0.9s var(--ease-organic) 0.1s both;
}

.questions-section {
  animation: drift-in 0.8s var(--ease-organic) 0.25s both;
}

.questions-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.q-progress {
  font-family: var(--font-ui);
  font-size: 0.52rem;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
}

.progress-track {
  height: 2px;
  background: var(--line);
  margin-bottom: 16px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  width: 0%;
  transition: width 0.7s var(--ease-organic);
}

.question-text {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.45;
  margin-bottom: 14px;
}

.choices-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 14px;
}

.choice-btn {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  text-align: left;
  background: transparent;
  border: 1px solid var(--line);
  padding: 11px 14px;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--ink-soft);
  line-height: 1.5;
  transition: border-color 0.3s, background 0.3s, transform 0.3s var(--ease-organic);
}

.choice-btn:hover:not(:disabled):not(.correct):not(.incorrect) {
  border-color: var(--line-strong);
  background: rgba(233, 229, 220, 0.03);
  transform: translateX(2px);
}

.choice-letter {
  font-family: var(--font-ui);
  font-size: 0.55rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  flex-shrink: 0;
  padding-top: 3px;
}

.choice-btn.selected {
  border-color: var(--accent);
  background: var(--accent-dim);
  color: var(--ink);
}

.choice-btn.selected .choice-letter { color: var(--accent); }

.choice-btn.correct {
  border-color: var(--ready);
  background: rgba(122, 158, 106, 0.1);
  color: var(--ink);
  cursor: default;
}

.choice-btn.incorrect {
  border-color: var(--error);
  background: rgba(196, 112, 112, 0.08);
  cursor: default;
}

.choice-btn:disabled { cursor: not-allowed; }

.btn-check {
  width: 100%;
  font-family: var(--font-ui);
  font-size: 0.58rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: var(--ink);
  color: var(--paper);
  border: none;
  padding: 12px;
  cursor: pointer;
  transition: opacity 0.3s, background 0.3s;
}

.btn-check:hover:not(:disabled) { background: #fff; }
.btn-check:disabled { opacity: 0.3; cursor: not-allowed; }

/* ── Feedback Drawer ─────────────────────────────────────────────────────── */

.feedback-drawer {
  position: absolute;
  bottom: 0;
  left: -22px;
  right: -22px;
  background: var(--paper-raised);
  border-top: 1px solid var(--line-strong);
  padding: 16px 22px 18px;
  transform: translateY(105%);
  transition: transform 0.55s var(--ease-settle);
  z-index: 10;
}

.feedback-drawer.visible { transform: translateY(0); }
.feedback-drawer.correct { border-top-color: var(--ready); }
.feedback-drawer.incorrect { border-top-color: var(--error); }

.drawer-verdict {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 6px;
}

.feedback-drawer.correct .drawer-verdict { color: var(--ready); }
.feedback-drawer.incorrect .drawer-verdict { color: var(--error); }

.drawer-explanation {
  font-size: 0.85rem;
  color: var(--ink-soft);
  line-height: 1.65;
  margin-bottom: 14px;
}

.btn-continue {
  width: 100%;
  font-family: var(--font-ui);
  font-size: 0.58rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border: none;
  padding: 11px;
  cursor: pointer;
  background: var(--ink);
  color: var(--paper);
  transition: background 0.3s;
}

.btn-continue:hover { background: #fff; }

/* ── Celebration ─────────────────────────────────────────────────────────── */

.celebration-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 32px 12px 24px;
  gap: 10px;
  animation: drift-in 0.8s var(--ease-organic) both;
}

.celebration-mark {
  font-size: 1.8rem;
  color: var(--accent);
  animation: spin-slow 8s linear infinite;
}

.celebration-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--ink);
}

.celebration-sub {
  font-style: italic;
  font-size: 0.88rem;
  color: var(--ink-muted);
  max-width: 240px;
  line-height: 1.6;
}

.xp-earned {
  font-family: var(--font-ui);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-top: 4px;
}

/* ── Skeleton & Error ──────────────────────────────────────────────────────── */

.skeleton-container {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 6px 0;
}

.skeleton-line {
  height: 11px;
  background: linear-gradient(90deg, var(--line) 30%, rgba(233,229,220,0.08) 50%, var(--line) 70%);
  background-size: 200% 100%;
  animation: shimmer 2.2s var(--ease-drift) infinite;
  border-radius: 1px;
}

.skeleton-line.header { height: 16px; width: 42%; margin-bottom: 4px; }
.skeleton-line.w-90 { width: 90%; }
.skeleton-line.w-80 { width: 80%; }
.skeleton-line.w-70 { width: 70%; }
.skeleton-line.w-60 { width: 60%; }
.skeleton-line.w-40 { width: 40%; }

.error-message {
  color: var(--error);
  font-size: 0.88rem;
  line-height: 1.6;
  padding: 4px 0;
}

.error-message strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1rem;
  margin-bottom: 4px;
}

.hidden { display: none !important; }

/* ── Organic Motion Keyframes ──────────────────────────────────────────────── */

@keyframes drift-in {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes desk-enter {
  from { opacity: 0; transform: translateX(-18px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes sidebar-rise {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes panel-stagger {
  from { opacity: 0; transform: translateX(var(--from-x, 6px)); }
  to   { opacity: 1; transform: translateX(var(--from-x-final, 6px)); }
}

.mastery-panel  { --from-x: -8px; --from-x-final: -4px; }

@keyframes mark-settle {
  0%   { transform: rotate(-8deg) scale(0.7); opacity: 0; }
  60%  { transform: rotate(2deg) scale(1.05); }
  100% { transform: rotate(0) scale(1); opacity: 1; }
}

@keyframes breathe {
  0%, 100% { opacity: 0.7; transform: scale(0.92); }
  50%      { opacity: 1; transform: scale(1.08); }
}

@keyframes breathe-fast {
  0%, 100% { opacity: 0.5; }
  50%      { opacity: 1; }
}

@keyframes float-subtle {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-3px); }
}

@keyframes item-reveal {
  from { opacity: 0; transform: translateX(-8px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes article-unfold {
  from { opacity: 0; max-height: 0; }
  to   { opacity: 1; max-height: 2000px; }
}

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@keyframes spin-slow {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ── Responsive ────────────────────────────────────────────────────────────── */

@media (max-width: 960px) {
  .desk-layout {
    grid-template-columns: 1fr;
    padding: 20px 20px 32px;
  }

  .sidebar-stack {
    margin-top: 0;
    padding-left: 0;
    border-left: none;
    transform: none;
  }

  .desk-panel {
    min-height: auto;
    border-radius: 0;
    margin-right: 0;
    padding: 24px 22px;
  }

  .mastery-panel { transform: none; }

  .manuscript { min-height: min(360px, 50vh); }

  .panel-body { max-height: 200px; }
  .roadmap-view { min-height: min(360px, 50vh); }
  .lesson-view { min-height: min(360px, 50vh); }
  .mastery-panel { min-height: min(480px, 60vh); }

  .critique-sidebar { width: min(100vw, 480px); }
}

/* ── UX Preferences Dropdown & Custom Themes ──────────────────────────────── */

.prefs-container {
  position: relative;
  display: inline-block;
}

.prefs-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 280px;
  background: var(--paper-raised);
  border: 1px solid var(--line-strong);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45);
  padding: 18px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 16px;
  border-radius: 4px;
  animation: drift-in 0.25s var(--ease-organic) both;
}

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

.prefs-section-title {
  font-family: var(--font-ui);
  font-size: 0.58rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-muted);
  border-bottom: 1px solid var(--line);
  padding-bottom: 5px;
  margin-bottom: 4px;
}

.prefs-row {
  display: flex;
  gap: 6px;
}

.prefs-btn {
  flex: 1;
  font-family: var(--font-ui);
  font-size: 0.58rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: transparent;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  padding: 8px 6px;
  cursor: pointer;
  transition: all 0.2s var(--ease-organic);
  text-align: center;
  border-radius: 2px;
}

.prefs-btn:hover {
  border-color: var(--line-strong);
  color: var(--ink);
  background: rgba(233, 229, 220, 0.03);
}

.prefs-btn.active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}

.prefs-toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Toggle Switch slider */
.switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: var(--line-strong);
  transition: 0.3s var(--ease-organic);
  border-radius: 20px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: var(--paper);
  transition: 0.3s var(--ease-organic);
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--accent);
}

input:checked + .slider:before {
  transform: translateX(16px);
}

/* Theme Override Root Classes */
:root.light-theme {
  --ink: #1c1a17;
  --ink-soft: #423e37;
  --ink-muted: #827b6f;
  --paper: #f4eedc;
  --paper-raised: #ebe5d3;
  --paper-panel: #ede7d5;
  --line: rgba(28, 26, 23, 0.12);
  --line-strong: rgba(28, 26, 23, 0.24);
}

:root.sepia-theme {
  --ink: #433422;
  --ink-soft: #5c4a35;
  --ink-muted: #8a7355;
  --paper: #f1e2c3;
  --paper-raised: #e6d5b3;
  --paper-panel: #ebdcb9;
  --line: rgba(67, 52, 34, 0.11);
  --line-strong: rgba(67, 52, 34, 0.22);
}

/* Accessibility Fonts */
:root.sans-serif-theme {
  --font-body: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

:root.dyslexic-theme {
  --font-body: "Comic Sans MS", cursive, sans-serif;
  letter-spacing: 0.05em;
  word-spacing: 0.12em;
}

/* ── Zen Mode centering ───────────────────────────────────────────────────── */

body.zen-mode .app-header {
  display: none !important;
}

body.zen-mode .desk-layout {
  grid-template-columns: 1fr !important;
  max-width: 800px;
  padding: 48px 24px;
}

body.zen-mode .sidebar-stack {
  display: none !important;
}

body.zen-mode .desk-panel {
  border: none !important;
  background: transparent !important;
  padding: 0 !important;
  border-radius: 0 !important;
}

body.zen-mode .manuscript-toolbar {
  opacity: 0.18;
  transition: opacity 0.3s var(--ease-organic);
}

body.zen-mode .manuscript-toolbar:hover {
  opacity: 1;
}

body.zen-mode .writing-purpose {
  display: none !important;
}

body.zen-mode .desk-action {
  opacity: 0.18;
  transition: opacity 0.3s var(--ease-organic);
}

body.zen-mode .desk-action:hover {
  opacity: 1;
}

/* Zen exit button */
.zen-exit-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  font-family: var(--font-ui);
  font-size: 0.58rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: var(--paper-raised);
  color: var(--ink-soft);
  border: 1px solid var(--line-strong);
  padding: 10px 16px;
  cursor: pointer;
  transition: all 0.25s var(--ease-organic);
  border-radius: 2px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
}

body.zen-mode .zen-exit-btn {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.zen-exit-btn:hover {
  color: var(--ink);
  border-color: var(--accent);
  background: var(--accent-dim);
}

/* ── Local Draft Recovery Banner ─────────────────────────────────────────── */

.recovery-banner {
  background: rgba(196, 165, 116, 0.08);
  border: 1px dashed var(--accent);
  padding: 12px 18px;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.88rem;
  color: var(--ink-soft);
  animation: drift-in 0.3s var(--ease-organic) both;
  border-radius: 2px;
}

.recovery-banner span {
  font-family: var(--font-body);
}

.recovery-banner div {
  display: flex;
  gap: 8px;
}

/* ── Confetti animation particles ────────────────────────────────────────── */

.confetti-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2000;
  overflow: hidden;
}

.confetti-piece {
  position: absolute;
  width: 8px;
  height: 8px;
  opacity: 0.9;
  border-radius: 20%;
  animation: fall 3s linear forwards;
}

@keyframes fall {
  0% {
    transform: translateY(-50px) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(105vh) rotate(720deg);
    opacity: 0;
  }
}

@media (max-width: 520px) {
  .app-header { padding: 14px 18px; }
  .brand-text .brand-name { font-size: 1.3rem; }
  .panel-name { font-size: 1.6rem; }
  .header-actions { gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
  .avatar { display: none; }
  .critique-toggle { padding: 8px 12px 8px 10px; font-size: 0.58rem; gap: 7px; }
  .critique-toggle-label { max-width: 9em; overflow: hidden; text-overflow: ellipsis; }
  .header-divider { display: none; }
}

/* ── Toast Notification Container & Items ───────────────────────────────── */
.candio-toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  max-width: 380px;
  width: calc(100vw - 48px);
}

.candio-toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(22, 21, 20, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 0.72rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
  opacity: 0;
  transform: translateY(12px) scale(0.96);
  transition: opacity 0.28s var(--ease-organic), transform 0.28s var(--ease-organic);
}

.candio-toast.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.candio-toast.leaving {
  opacity: 0;
  transform: translateY(-8px) scale(0.96);
}

.candio-toast-icon {
  font-size: 0.9rem;
  line-height: 1;
  flex-shrink: 0;
}

.candio-toast-msg {
  flex: 1;
  line-height: 1.4;
}

.candio-toast-close {
  background: none;
  border: none;
  color: var(--ink-muted);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  padding: 2px 4px;
  transition: color 0.2s;
}

.candio-toast-close:hover {
  color: var(--ink);
}

.candio-toast-success {
  border-left: 3px solid var(--ready);
}
.candio-toast-success .candio-toast-icon {
  color: var(--ready);
}

.candio-toast-error {
  border-left: 3px solid var(--error);
}
.candio-toast-error .candio-toast-icon {
  color: var(--error);
}

.candio-toast-warning {
  border-left: 3px solid var(--accent);
}
.candio-toast-warning .candio-toast-icon {
  color: var(--accent);
}

.candio-toast-info {
  border-left: 3px solid var(--ink-soft);
}
.candio-toast-info .candio-toast-icon {
  color: var(--ink-soft);
}

