/* Layer — the darkroom. Warm light over near-black, one amber accent,
   Bricolage Grotesque display over IBM Plex Mono labels. */

@font-face {
  font-family: 'Bricolage Grotesque';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('./fonts/bricolage-grotesque-latin-500-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Bricolage Grotesque';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('./fonts/bricolage-grotesque-latin-700-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('./fonts/ibm-plex-mono-latin-400-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('./fonts/ibm-plex-mono-latin-500-normal.woff2') format('woff2');
}

:root {
  --bg: #0e0d0b;
  --bg-raised: #14131078;
  --panel: #161512;
  --panel-2: #1d1b17;
  --line: #29261f;
  --line-strong: #3a352b;
  --text: #ece7dc;
  --muted: #96907f;
  --faint: #6b665a;
  --accent: #ff8a3d;
  --accent-soft: #ff8a3d22;
  --accent-line: #b35c2466;
  --danger: #e5484d;
  --ok: #6fcf82;
  --radius: 12px;
  --display: 'Bricolage Grotesque', 'Avenir Next', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.6 var(--display);
  font-weight: 500;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }
.mono { font-family: var(--mono); font-size: 12px; letter-spacing: 0.01em; }
.muted { color: var(--muted); }
.empty { color: var(--muted); padding: 10px 0; }
.row { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; }
.row-center { justify-content: center; }

::selection { background: var(--accent-soft); }
:focus-visible { outline: 2px solid var(--accent-line); outline-offset: 2px; }

/* ------------------------------------------------------------ loading bar */

.loading-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 2px;
  z-index: 100;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  background-size: 40% 100%;
  background-repeat: no-repeat;
  opacity: 0;
  transition: opacity 150ms ease;
  pointer-events: none;
}
.loading-bar.active {
  opacity: 1;
  animation: loading-sweep 1s linear infinite;
}
@keyframes loading-sweep {
  from { background-position-x: -40%; }
  to { background-position-x: 140%; }
}

/* ------------------------------------------------------------------ gate */

.gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(1100px 480px at 75% -5%, rgba(255, 138, 61, 0.10), transparent 62%),
    radial-gradient(800px 600px at -10% 110%, rgba(255, 138, 61, 0.05), transparent 55%),
    var(--bg);
}
.gate-grain {
  position: absolute;
  inset: 0;
  opacity: 0.5;
  pointer-events: none;
  background-image: repeating-conic-gradient(rgba(255,255,255,0.012) 0% 25%, transparent 0% 50%);
  background-size: 3px 3px;
}

.gate-frame {
  width: min(26rem, 92vw);
  position: relative;
  animation: rise 500ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

.gate-logo, .brand-logo { display: inline-flex; flex-direction: column; gap: 3px; }
.gate-logo { margin-bottom: 1rem; }
.stratum { display: block; height: 5px; border-radius: 2px; background: var(--accent); }
.gate-logo .s1, .brand-logo .s1 { width: 34px; opacity: 1; }
.gate-logo .s2, .brand-logo .s2 { width: 24px; opacity: 0.62; }
.gate-logo .s3, .brand-logo .s3 { width: 14px; opacity: 0.32; }
.brand-logo .stratum { height: 3px; }
.brand-logo .s1 { width: 18px; }
.brand-logo .s2 { width: 13px; }
.brand-logo .s3 { width: 8px; }

.gate-mark {
  font-size: 58px;
  font-weight: 700;
  letter-spacing: 0.16em;
  margin: 0;
  line-height: 1;
}
.gate-sub { color: var(--muted); margin: 0.9rem 0 1.8rem; }

.auth-form { display: flex; flex-direction: column; gap: 1rem; }
.auth-note { color: var(--muted); margin: 0; font-size: 14px; }
.auth-error { color: var(--danger); font-family: var(--mono); font-size: 12.5px; margin-top: 1rem; }
.auth-links { display: flex; gap: 1.2rem; }
.auth-link {
  background: none; border: none; padding: 0;
  color: var(--muted); text-decoration: underline; text-underline-offset: 3px;
  cursor: pointer; font: inherit; font-size: 13px;
}
.auth-link:hover { color: var(--text); }
.gate-foot { color: var(--faint); font-family: var(--mono); font-size: 11.5px; margin-top: 2.4rem; }
.input-code { font-family: var(--mono); font-size: 22px; letter-spacing: 0.35em; text-align: center; }

/* ----------------------------------------------------------------- shell */

.shell {
  display: grid;
  grid-template-columns: 248px 1fr;
  min-height: 100vh;
}
@media (max-width: 860px) { .shell { grid-template-columns: 1fr; } .sidebar { position: static; height: auto; } }

.sidebar {
  border-right: 1px solid var(--line);
  background: var(--panel);
  padding: 1.1rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 1.6rem;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.22em;
  font-size: 15px;
  padding: 0.2rem 0.5rem;
}

.side-section { display: flex; flex-direction: column; gap: 2px; }
.side-label {
  font-family: var(--mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--faint);
  margin: 0 0 0.4rem;
  padding: 0 0.5rem;
}
.side-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text);
  text-decoration: none;
  padding: 0.42rem 0.5rem;
  border-radius: 8px;
  font-size: 14px;
  border-left: 2px solid transparent;
}
.side-item:hover { background: var(--panel-2); }
.side-item.active { background: var(--panel-2); border-left-color: var(--accent); }
.side-item-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-item-time { font-family: var(--mono); font-size: 10.5px; color: var(--faint); }
.side-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); flex-shrink: 0; }
.side-dot.generating { background: var(--accent); animation: pulse 1.2s ease-in-out infinite; }
.side-dot.failed { background: var(--danger); }
@keyframes pulse { 50% { opacity: 0.35; } }

.side-add {
  background: none;
  border: 1px dashed var(--line-strong);
  color: var(--muted);
  border-radius: 8px;
  padding: 0.45rem 0.6rem;
  font: inherit;
  font-size: 13.5px;
  cursor: pointer;
  text-align: left;
  margin-top: 0.3rem;
}
.side-add:hover { color: var(--accent); border-color: var(--accent-line); }
.side-new-input { margin-top: 0.3rem; }

.side-foot {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.8rem 0.5rem 0;
  border-top: 1px solid var(--line);
}
.side-foot-link { color: var(--muted); text-decoration: none; font-size: 13.5px; }
.side-foot-link:hover { color: var(--text); }
.user-email { color: var(--faint); font-family: var(--mono); font-size: 11px; overflow: hidden; text-overflow: ellipsis; }

.main {
  padding: 2rem 2.4rem 3rem;
  max-width: 1120px;
  width: 100%;
  min-width: 0;
}
.view-enter { animation: view-in 240ms ease both; }
@keyframes view-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

/* -------------------------------------------------------------- controls */

.input, .textarea {
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 0.6rem 0.75rem;
  font: inherit;
  min-width: 0;
  width: 100%;
}
.input:focus, .textarea:focus { outline: none; border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-soft); }
.textarea { resize: vertical; line-height: 1.55; }

.field { display: flex; flex-direction: column; gap: 0.4rem; }
.field-name {
  font-family: var(--mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--faint);
}

.btn {
  border: 1px solid var(--line-strong);
  background: var(--panel-2);
  color: var(--text);
  border-radius: 9px;
  padding: 0.55rem 1.05rem;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 120ms ease, border-color 120ms ease, background 120ms ease;
}
.btn:hover { border-color: var(--accent-line); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: default; transform: none; }
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #191008;
  font-weight: 700;
}
.btn-primary:hover { background: #ffa063; border-color: #ffa063; }
.btn-ghost { background: transparent; }
.btn-small { padding: 0.32rem 0.7rem; font-size: 13px; }
.btn-lg { padding: 0.8rem 1.4rem; font-size: 15.5px; }
.btn-danger-solid { background: var(--danger); border-color: var(--danger); color: #fff; font-weight: 700; }

.section-label {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--muted);
  margin: 1.8rem 0 0.6rem;
}
.section-label .muted { text-transform: none; letter-spacing: 0.02em; color: var(--faint); }

.badge {
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 0.15rem 0.6rem;
  color: var(--muted);
  font-size: 11px;
}
.badge-toggle { background: var(--panel-2); cursor: pointer; font: inherit; font-family: var(--mono); font-size: 11px; }
.badge-toggle:hover { border-color: var(--accent-line); color: var(--text); }
.badge-toggle:disabled { opacity: 0.5; cursor: default; }
.badge-literal { border-color: var(--accent); color: var(--accent); }

/* ------------------------------------------------------------------ home */

.empty-hero { max-width: 34rem; margin: 3rem auto 2rem; text-align: center; }
.empty-hero h2 { font-size: 26px; font-weight: 700; margin: 0 0 0.6rem; }
.empty-hero p { margin: 0 0 1.2rem; }

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 0.9rem; }
.home-grid { max-width: 52rem; margin: 0 auto; }
.card {
  display: block;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  color: var(--text);
  text-decoration: none;
  transition: transform 150ms ease, border-color 150ms ease;
  animation: view-in 300ms ease both;
}
.card:hover { transform: translateY(-2px); border-color: var(--accent-line); }
.card h3 { margin: 0 0 0.35rem; font-size: 16.5px; font-weight: 700; }
.card p { margin: 0.1rem 0; font-size: 13px; }

/* ------------------------------------------------------------- tree view */

.tree-layout {
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  gap: 2rem;
  align-items: start;
}
@media (max-width: 980px) { .tree-layout { grid-template-columns: 1fr; } }

.outline { position: sticky; top: 2rem; }
.outline-head { margin-bottom: 1rem; }
.outline-head p { margin: 0.2rem 0 0; }
.tree-title { margin: 0; font-size: 21px; font-weight: 700; }
.tree-title.editable { cursor: text; }
.tree-title.editable:hover { color: var(--accent); }
.tree-title-input { font-size: 18px; font-weight: 700; }

.outline-list { display: flex; flex-direction: column; margin-bottom: 0.6rem; }
.outline-row {
  display: flex;
  align-items: stretch;
  border-radius: 8px;
}
.outline-row:hover { background: var(--panel); }
.outline-row.selected { background: var(--accent-soft); }

/* Connector guides make the nesting unmistakable: a vertical rail per
   ancestor level and an elbow into the row itself. */
.tree-rail {
  width: 22px;
  flex-shrink: 0;
  align-self: stretch;
  background: linear-gradient(to right, transparent 10px, var(--line-strong) 10px, var(--line-strong) 11px, transparent 11px);
}
.tree-elbow {
  width: 22px;
  flex-shrink: 0;
  align-self: stretch;
  position: relative;
}
.tree-elbow::before {
  content: '';
  position: absolute;
  left: 10px;
  top: -1px;
  bottom: 50%;
  width: 10px;
  border-left: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
  border-bottom-left-radius: 7px;
}
.outline-row:last-child .tree-elbow::before { bottom: calc(50% - 1px); }

.outline-name {
  flex: 1;
  text-align: left;
  background: none;
  border: none;
  color: var(--text);
  font: inherit;
  font-size: 14.5px;
  padding: 0.5rem 0.4rem;
  cursor: pointer;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.outline-row.selected .outline-name { color: var(--accent); font-weight: 700; }
.outline-add {
  background: none;
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--faint);
  font-size: 17px;
  cursor: pointer;
  padding: 0 0.55rem;
  align-self: center;
  line-height: 1.4;
}
.outline-add:hover { color: var(--accent); border-color: var(--accent-line); }
.outline-input { margin: 3px 0; }
.outline-tree-delete { margin-top: 1.2rem; align-self: flex-start; }

/* ------------------------------------------------------------ node detail */

.node-detail { min-width: 0; }
.detail-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.6rem;
}
.crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 0.35rem; min-width: 0; }
.crumb {
  background: none;
  border: none;
  padding: 0.1rem 0.2rem;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  cursor: pointer;
}
.crumb:hover { color: var(--text); }
.crumb.current { color: var(--accent); }
.crumb.static { cursor: default; }
.crumb-sep { color: var(--faint); font-family: var(--mono); font-size: 11px; }
.crumb-label {
  color: var(--faint);
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  margin-right: 0.3rem;
}

.generate-cta { box-shadow: 0 6px 24px -8px rgba(255, 138, 61, 0.45); flex-shrink: 0; }

.node-name-row { display: flex; align-items: baseline; gap: 0.9rem; margin: 0 0 0.8rem; }
.node-name { margin: 0; font-size: 30px; font-weight: 700; line-height: 1.15; }
.node-name.editable { cursor: text; }
.node-name.editable:hover { color: var(--accent); }
.node-name-input { font-size: 24px; font-weight: 700; max-width: 30rem; }
.btn-danger-text { color: var(--danger); }
.btn-danger-text:hover { border-color: var(--danger); }
.detail-actions { margin-top: 1.6rem; padding-top: 1rem; border-top: 1px solid var(--line); }

.prompt-editor { font-size: 15px; }
.save-bar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.5rem;
  animation: view-in 150ms ease both;
}
.save-note { color: var(--accent); font-family: var(--mono); font-size: 12px; }

.refs { display: flex; gap: 0.7rem; flex-wrap: wrap; align-items: center; }
.ref-cell { position: relative; }
.ref-thumb {
  width: 92px; height: 92px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: var(--panel-2);
  display: block;
}
.ref-remove {
  position: absolute; top: -8px; right: -8px;
  width: 22px; height: 22px; border-radius: 50%;
  border: 1px solid var(--line-strong); background: var(--bg); color: var(--muted);
  cursor: pointer; line-height: 1; font-size: 13px;
}
.ref-remove:hover { color: var(--danger); border-color: var(--danger); }
.ref-add {
  width: 92px; height: 92px;
  border-radius: 10px;
  border: 1px dashed var(--line-strong);
  background: none;
  color: var(--faint);
  font-size: 26px;
  cursor: pointer;
  transition: color 120ms ease, border-color 120ms ease;
}
.ref-add:hover { color: var(--accent); border-color: var(--accent-line); }

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.8rem;
}
.gallery-cell { margin: 0; cursor: zoom-in; animation: view-in 280ms ease both; }
.gallery-thumb {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  display: block;
  transition: transform 150ms ease, border-color 150ms ease;
}
.gallery-cell:hover .gallery-thumb { transform: scale(1.02); border-color: var(--accent-line); }
.gallery-caption { color: var(--faint); font-size: 10.5px; margin-top: 0.3rem; }
.tree-gallery { margin-top: 1.6rem; }
.tree-gallery summary { cursor: pointer; }
.tree-gallery[open] summary { margin-bottom: 0.6rem; }

/* ---------------------------------------------------------- session view */

.session-panel {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 5rem);
  min-height: 30rem;
}
.session-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--line);
}
.session-title { margin: 0 0 0.2rem; font-size: 24px; font-weight: 700; }
.session-meta { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; justify-content: flex-end; }

.transcript {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  padding: 1.2rem 0.2rem;
}
.transcript-empty { margin: auto; }

.msg {
  max-width: 44rem;
  padding: 0.6rem 0.95rem;
  border-radius: 12px;
  white-space: pre-wrap;
  animation: view-in 200ms ease both;
}
.msg-user {
  align-self: flex-end;
  background: var(--panel-2);
  border: 1px solid var(--line-strong);
  border-bottom-right-radius: 4px;
}
.msg-pending { opacity: 0.55; }
.msg-assistant { align-self: flex-start; color: var(--muted); padding-left: 0; }
.msg-image {
  align-self: flex-start;
  padding: 0;
  max-width: min(30rem, 88%);
  cursor: zoom-in;
  width: 100%;
}
.generated {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: var(--panel-2);
  display: block;
  min-height: 120px;
}
.msg-image:hover .generated { border-color: var(--accent-line); }
.image-bar { display: flex; justify-content: space-between; padding: 0.35rem 0.2rem 0; }
.image-bar-actions { color: var(--faint); font-size: 11px; }
.msg-image:hover .image-bar-actions { color: var(--accent); }

.status-line {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-height: 2.2rem;
  padding: 0.2rem 0;
}
.status-text { font-size: 12.5px; color: var(--accent); }
.status-failed { color: var(--danger); }
.gen-pulse { display: inline-flex; gap: 4px; }
.gen-pulse span {
  width: 6px; height: 6px; border-radius: 2px;
  background: var(--accent);
  animation: strata 1.1s ease-in-out infinite;
}
.gen-pulse span:nth-child(2) { animation-delay: 0.15s; }
.gen-pulse span:nth-child(3) { animation-delay: 0.3s; }
@keyframes strata {
  0%, 100% { transform: translateY(0); opacity: 0.4; }
  50% { transform: translateY(-4px); opacity: 1; }
}

.composer {
  display: flex;
  gap: 0.7rem;
  align-items: flex-end;
  border-top: 1px solid var(--line);
  padding-top: 0.9rem;
}
.composer-input { flex: 1; overflow: hidden; }
.composer-send { align-self: flex-end; }

/* -------------------------------------------------------------- tutorial */

.tutorial { max-width: 56rem; }
.tutorial-title { font-size: 30px; font-weight: 700; margin: 0 0 1.6rem; }
.tutorial-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin-bottom: 1.8rem;
}
.tutorial-step {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
}
.tutorial-step h3 { margin: 0.3rem 0 0.5rem; font-size: 16.5px; }
.tutorial-step p { margin: 0; color: var(--muted); font-size: 14px; }
.step-index { color: var(--accent); font-size: 12px; margin: 0; }

/* ----------------------------------------------------------------- modal */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 9, 7, 0.72);
  backdrop-filter: blur(3px);
  display: grid;
  place-items: center;
  z-index: 60;
  animation: fade 140ms ease both;
}
@keyframes fade { from { opacity: 0; } }
.modal-card {
  width: min(26rem, 92vw);
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  padding: 1.2rem 1.3rem;
  animation: rise 200ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
  box-shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.8);
}
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.7rem; }
.modal-head h3 { margin: 0; font-size: 17px; font-weight: 700; }
.modal-x { background: none; border: none; color: var(--faint); font-size: 20px; cursor: pointer; padding: 0 0.2rem; }
.modal-x:hover { color: var(--text); }
.modal-text { margin: 0.4rem 0; color: var(--muted); font-size: 14px; }
.modal-text .mono { color: var(--text); }
.modal-actions { display: flex; justify-content: flex-end; gap: 0.6rem; margin-top: 1.1rem; }

.chip-row { display: flex; gap: 0.45rem; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--line-strong);
  background: var(--panel-2);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  cursor: pointer;
  transition: all 120ms ease;
}
.chip:hover { color: var(--text); }
.chip.selected { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }

/* --------------------------------------------------------------- lightbox */

.lightbox-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(8, 7, 6, 0.9);
  display: grid;
  place-items: center;
  z-index: 70;
  animation: fade 150ms ease both;
  padding: 2rem;
}
.lightbox-figure { margin: 0; max-width: min(80vh, 92vw); width: 100%; }
.lightbox-img {
  width: 100%;
  max-height: 74vh;
  object-fit: contain;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: var(--panel);
  animation: rise 220ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.lightbox-caption { margin-top: 0.8rem; display: flex; flex-direction: column; gap: 0.7rem; }
.lightbox-prompt { color: var(--muted); margin: 0; font-size: 12px; max-height: 5.5em; overflow-y: auto; }
.lightbox-prompt-label { color: var(--accent); text-transform: uppercase; font-size: 10px; letter-spacing: 0.14em; }

/* ----------------------------------------------------------------- toast */

.toast-host {
  position: fixed;
  bottom: 1.2rem;
  right: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 90;
}
.toast {
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-left: 3px solid var(--danger);
  color: var(--text);
  border-radius: 10px;
  padding: 0.65rem 1rem;
  max-width: 24rem;
  font-size: 13.5px;
  animation: toast-in 200ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
  box-shadow: 0 12px 32px -12px rgba(0, 0, 0, 0.7);
}
.toast-out { opacity: 0; transform: translateX(10px); transition: all 350ms ease; }
@keyframes toast-in {
  from { opacity: 0; transform: translateX(16px); }
  to { opacity: 1; transform: none; }
}
