.guide { flex: 1; min-width: 0; overflow-y: auto; }
.guide-inner { max-width: 72rem; margin: 0 auto; padding: 2rem 1.25rem; display: flex; flex-direction: column; gap: 2rem; }
.lede { margin: 0.75rem 0 0; max-width: 36rem; color: var(--muted); font-size: 0.9rem; line-height: 1.5; }
.lede-sm { margin: 0.4rem 0 0; font-size: 0.75rem; color: var(--muted); }
h1 em { font-style: italic; color: var(--accent); font-family: var(--display); }
.steps { display: grid; gap: 1rem; padding: 0; margin: 0; list-style: none; }
.card { border-radius: 0.9rem; padding: 1.5rem; }
.card.ink { background: var(--ink); color: var(--canvas); }
.card.accent { background: var(--accent); color: var(--ink); }
.card.paper { background: var(--canvas); box-shadow: var(--shadow); }
.card .n { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.14em; margin: 0; opacity: 0.5; }
.card h2 { font-size: 1.35rem; margin: 1rem 0 0.4rem; }
.card p:last-child { margin: 0; font-size: 0.9rem; line-height: 1.5; opacity: 0.8; }
.events ul { list-style: none; margin: 0.75rem 0 0; padding: 0; display: grid; gap: 0.5rem; }
.events li { display: flex; justify-content: space-between; gap: 1rem; background: var(--ink-soft); border-radius: 0.5rem; padding: 0.75rem 0.85rem; font-size: 0.85rem; }
.events code { font-family: var(--mono); }
.events span { opacity: 0.5; font-size: 0.75rem; }
.eyebrow { margin: 0; font-size: 0.7rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
.eyebrow.light { color: rgb(244 241 236 / 0.5); }

.scrim { position: fixed; inset: 0; background: rgb(17 17 17 / 0.4); z-index: 40; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; max-height: 88dvh; width: 100%; border-radius: 1rem 1rem 0 0; overflow: auto; background: var(--ink); color: var(--canvas); display: flex; flex-direction: column; }
.sheet-head { display: flex; justify-content: space-between; gap: 1rem; padding: 1.25rem 1.25rem 1rem; }
.sheet-head h2 { color: var(--canvas); font-size: 1.75rem; }
.sheet .when { color: rgb(244 241 236 / 0.45); font-family: var(--mono); }
.close { width: 2.75rem; height: 2.75rem; border: 0; border-radius: 0.5rem; background: rgb(244 241 236 / 0.1); color: var(--canvas); font-size: 1.1rem; flex-shrink: 0; }
.sheet-dl { padding: 0 1.25rem; }
.sheet-dl div { display: flex; justify-content: space-between; gap: 1rem; padding: 0.75rem 0; border-bottom: 1px solid rgb(244 241 236 / 0.1); font-size: 0.875rem; }
.sheet-dl dt { color: rgb(244 241 236 / 0.55); text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.7rem; }
.sheet-dl dd { margin: 0; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sheet-tags { display: flex; flex-direction: column; gap: 0.5rem; padding: 1.25rem; margin-top: auto; }
.sheet-tags .tag { flex-direction: row; justify-content: space-between; align-items: center; min-height: 2.75rem; }
.sheet-tags .tag.warm { background: rgb(244 241 236 / 0.1); color: var(--canvas); }
.sheet-tags .tag.junk { background: var(--canvas); color: var(--ink); }
.sheet-error { padding: 0 1.25rem 0.5rem; font-size: 0.75rem; color: rgb(244 241 236 / 0.55); }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { opacity: 0.35; } }

@media (max-width: 1023px) {
  .app.guide-on .stage { display: none; }
  .app.guide-on .guide { display: block; }
  .layout-toggles, .gutter, .pane-rail, .record, .classify-pane { display: none !important; }
  .queue { width: auto !important; }
}

@media (min-width: 640px) {
  .steps { grid-template-columns: 1fr 1fr; }
  .events ul { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 1024px) {
  .topbar { display: flex; }
  .mobile-bar { display: none; }
  .minis, .mobile-filters { display: none; }
  .stage { --queue-w: 46%; --classify-w: 17%; }
  .pane { display: flex; flex-direction: column; min-height: 0; position: relative; }
  .pane-body { display: flex; flex-direction: column; min-height: 0; min-width: 0; flex: 1; overflow: hidden; }
  .pane-rail { display: none; flex-direction: column; align-items: center; gap: 0.75rem; padding: 0.75rem 0.35rem; height: 100%; }
  .queue { flex: none; width: var(--queue-w); min-width: 0; container-type: inline-size; container-name: queue; }
  .record { display: flex; flex: 1; min-width: 0; background: var(--paper); }
  .classify-pane { display: flex; flex: none; width: var(--classify-w); background: var(--ink); color: var(--paper); }
  .gutter { display: block; width: 0.5rem; flex-shrink: 0; cursor: col-resize; position: relative; background: transparent; z-index: 2; }
  .gutter::after { content: ""; position: absolute; inset: 0 auto 0 50%; width: 1px; background: var(--line); transform: translateX(-50%); transition: background-color 160ms var(--ease), width 160ms var(--ease); }
  .gutter:hover::after, .gutter:focus-visible::after, .stage.dragging .gutter.active::after { width: 3px; background: var(--accent); }
  .stage.dragging { cursor: col-resize; user-select: none; }
  .stage:not(.dragging) .queue,
  .stage:not(.dragging) .classify-pane { transition: width 220ms var(--ease); }
  .queue { overflow: hidden; }
  .queue-head { display: block; padding: 1rem 1.25rem; border-bottom: 1px solid var(--line); }
  .queue-title { display: flex; justify-content: space-between; align-items: flex-end; gap: 0.75rem; }
  .queue-actions { display: flex; align-items: center; gap: 0.5rem; }
  .queue-head h1 { font-size: 1.5rem; }
  .all-check { display: flex; align-items: center; gap: 0.5rem; font-size: 0.75rem; color: var(--muted); }
  .all-check input { width: 1rem; height: 1rem; accent-color: var(--accent); }
  .desk-search { margin-top: 1rem; display: block; }
  .desk-search input { height: 2.5rem; }
  .desk-filters { display: grid; grid-template-columns: repeat(5, 1fr); padding: 0; overflow: visible; gap: 0; }
  .desk-filters .chip { height: auto; min-height: 3.5rem; border-radius: 0; background: transparent; box-shadow: none; color: var(--muted); border-bottom: 2px solid transparent; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.15rem; padding: 0.6rem 0.2rem; }
  .desk-filters .chip .n { margin: 0; font-family: var(--display); font-size: 1.1rem; opacity: 1; font-weight: 500; }
  .desk-filters .chip.active { background: transparent; color: var(--ink); border-bottom-color: var(--accent); }
  .toolbar { padding: 0.5rem 1rem; }
  .desk-hint { display: inline; }
  .row { flex-direction: row; align-items: center; padding: 0.75rem 1rem; }
  .row-tags { width: 10.5rem; flex-shrink: 0; padding-left: 0; }
  .tag-mini { height: 2.25rem; }
  .classify-body { background: var(--ink); }
  .rail-word { writing-mode: vertical-rl; transform: rotate(180deg); font-size: 0.7rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
  .rail-word.light { color: rgb(244 241 236 / 0.45); }
  .pane-rail b { font-family: var(--display); font-size: 1.1rem; font-weight: 500; }
  .rail-avatar { width: 2rem; height: 2rem; border-radius: 0.4rem; display: grid; place-items: center; background: var(--canvas); box-shadow: var(--shadow); font-family: var(--display); font-size: 0.7rem; }
  .ink-rail { background: var(--ink); }
  .rail-tags { display: flex; flex-direction: column; gap: 0.35rem; margin-top: auto; padding-bottom: 0.5rem; width: 100%; }
  .rail-tags .tag-mini { width: 100%; height: 2.5rem; padding: 0; font-size: 0.65rem; }
  .stage.queue-off .queue { width: var(--rail-w); }
  .stage.queue-off .queue .pane-body { display: none; }
  .stage.queue-off .queue .pane-rail { display: flex; }
  .stage.record-off .record { flex: none; width: var(--rail-w); }
  .stage.record-off .record .pane-body { display: none; }
  .stage.record-off .record .pane-rail { display: flex; }
  .stage.classify-off .classify-pane { width: var(--rail-w); }
  .stage.classify-off .classify-pane .pane-body { display: none; }
  .stage.classify-off .classify-pane .pane-rail { display: flex; }
  .app.guide-on .stage { display: none; }
  .app.guide-on .guide { display: block; }
  .guide { display: none; }
}

@container queue (max-width: 26rem) {
  .row { flex-direction: column; align-items: stretch; }
  .row-tags { width: auto; padding-left: 3rem; }
}

@media (min-width: 1280px) {
  .steps { grid-template-columns: repeat(4, 1fr); }
  .events ul { grid-template-columns: repeat(4, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
