/* =============================================================
   Polidis POC — app.css
   Aesthetic: editorial-institutional. Monochromatic base,
   amber annotation accent. Libre Baskerville + DM Sans.
   ============================================================= */

/* ── Custom properties ───────────────────────────────────────── */
:root {
  /* Base palette */
  --ink:        #1a1814;
  --ink-light:  #4a453d;
  --ink-muted:  #8a847a;
  --paper:      #f8f6f2;
  --paper-warm: #f2ede5;
  --rule:       #ddd9d2;
  --rule-light: #eae6df;

  /* Annotation amber */
  --amber:      #d4830a;
  --amber-soft: rgba(212, 131, 10, 0.18);
  --amber-glow: rgba(212, 131, 10, 0.32);
  --amber-dark: #a86208;

  /* UI */
  --danger:     #b03030;
  --danger-soft:rgba(176, 48, 48, 0.08);
  --radius:     4px;
  --sidebar-w:  340px;
  --toolbar-h:  48px;

  /* Typography */
  --font-serif:  'Libre Baskerville', Georgia, serif;
  --font-sans:   'DM Sans', system-ui, sans-serif;
  --font-mono:   'JetBrains Mono', 'Courier New', monospace;
}

/* ── Reset & base ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body {
  font-family: var(--font-sans);
  background: var(--paper);
  color: var(--ink);
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ── Toolbar ──────────────────────────────────────────────────── */
.toolbar {
  height: var(--toolbar-h);
  min-height: var(--toolbar-h);
  background: var(--ink);
  color: #e8e2d8;
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0 16px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  z-index: 100;
}

.toolbar-brand {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-right: 20px;
  flex-shrink: 0;
}
.brand-mark {
  color: var(--amber);
  font-size: 16px;
  line-height: 1;
}
.brand-name {
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 700;
  color: #f0ece4;
  letter-spacing: 0.01em;
}
.brand-tagline {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-muted);
  font-weight: 300;
}

.toolbar-doc {
  flex: 1;
  display: flex;
  align-items: baseline;
  gap: 8px;
  overflow: hidden;
  padding: 0 12px;
  border-left: 1px solid rgba(255,255,255,0.08);
  border-right: 1px solid rgba(255,255,255,0.08);
  margin-right: 12px;
  min-width: 0;
}
.doc-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-muted);
  flex-shrink: 0;
}
.doc-name {
  font-size: 13px;
  color: #c8c2b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.tab-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0 18px;
}
.tab-row .spacer { flex: 1; }
.toolbar-user {
  display: flex;
  align-items: center;
  gap: 6px;
}
.locale-switcher {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-right: 8px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 4px;
  padding: 2px;
}
.locale-switcher button {
  border: 0;
  background: transparent;
  color: #b0a898;
  font-family: var(--font-sans);
  font-size: 10px;
  line-height: 1;
  padding: 5px 6px;
  border-radius: 2px;
  cursor: pointer;
}
.locale-switcher button[aria-pressed="true"] {
  background: var(--amber);
  color: white;
}
.notification-menu {
  position: relative;
}
.notification-button {
  position: relative;
  width: 30px;
  justify-content: center;
}
.notification-icon {
  color: var(--amber);
  font-size: 9px;
}
.notification-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--danger);
  color: white;
  font-size: 10px;
  line-height: 16px;
  text-align: center;
}
.notification-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 310px;
  max-height: 360px;
  overflow-y: auto;
  background: white;
  color: var(--ink);
  border: 1px solid var(--rule);
  border-radius: 6px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.18);
  z-index: 300;
}
.notification-item {
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--rule-light);
  color: inherit;
  text-decoration: none;
  font-size: 12px;
  line-height: 1.35;
}
.notification-item:hover {
  background: var(--paper-warm);
}
.notification-item.is-read {
  color: var(--ink-muted);
}
.notification-item time {
  font-size: 10px;
  color: var(--ink-muted);
}
.notification-empty {
  padding: 18px;
  color: var(--ink-muted);
  font-size: 12px;
  text-align: center;
}

/* ── Reader/PDF view toggle ───────────────────────────────────── */
.view-toggle {
  display: flex;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: var(--radius);
  overflow: hidden;
  margin-right: 6px;
}
.view-toggle-btn {
  font-family: var(--font-sans);
  font-size: 12px;
  padding: 5px 10px;
  border: none;
  background: transparent;
  color: #b0a898;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.view-toggle-btn:hover { background: rgba(255,255,255,0.08); color: #e0dcd4; }
.view-toggle-btn[aria-pressed="true"] {
  background: var(--amber);
  color: white;
}

/* ── Buttons ──────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 400;
  padding: 5px 10px;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, opacity 0.12s;
  white-space: nowrap;
  text-decoration: none;
  line-height: 1.4;
}
.btn-ghost {
  background: transparent;
  color: #b0a898;
  border: 1px solid rgba(255,255,255,0.1);
}
.btn-ghost:hover {
  background: rgba(255,255,255,0.08);
  color: #e0dcd4;
}
.btn-ghost.btn-danger:hover {
  background: var(--danger-soft);
  color: #e07070;
  border-color: rgba(176,48,48,0.3);
}
.btn-primary {
  background: var(--amber);
  color: white;
  font-weight: 500;
}
.btn-primary:hover { background: var(--amber-dark); }
.btn-secondary {
  background: var(--rule-light);
  color: var(--ink-light);
}
.btn-secondary:hover { background: var(--rule); }
.btn-locked::before {
  content: "\1F512";
  font-size: 12px;
}

/* ── Main layout ──────────────────────────────────────────────── */
.main-layout {
  flex: 1;
  display: flex;
  overflow: hidden;
}

/* ── PDF viewer column ────────────────────────────────────────── */
.viewer-column {
  flex: 1;
  overflow-y: auto;
  overflow-x: auto;
  background: #6b6660;
  /* Custom scrollbar */
  scrollbar-width: thin;
  scrollbar-color: #4a4540 #3a3530;
}
.viewer-column::-webkit-scrollbar { width: 8px; }
.viewer-column::-webkit-scrollbar-track { background: #3a3530; }
.viewer-column::-webkit-scrollbar-thumb { background: #5a5550; border-radius: 4px; }

.pdf-viewer {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 24px 60px;
  gap: 12px;
  min-height: 100%;
}
/* `.pdf-viewer`/`.reader-viewer` set `display` unconditionally above, which
   otherwise beats the UA [hidden] default (author CSS wins over UA CSS
   regardless of specificity) — toggling the `hidden` property alone would
   silently do nothing. */
.pdf-viewer[hidden], .reader-viewer[hidden] { display: none; }

.viewer-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  color: #c0bab4;
  padding: 80px 0;
  font-size: 14px;
}
.loading-spinner {
  width: 28px;
  height: 28px;
  border: 2px solid rgba(255,255,255,0.15);
  border-top-color: var(--amber);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── PDF page wrapper ─────────────────────────────────────────── */
.pdf-page-wrapper {
  position: relative;
  background: white;
  box-shadow: 0 2px 12px rgba(0,0,0,0.35), 0 0 0 1px rgba(0,0,0,0.12);
  line-height: 0; /* prevent gap under canvas */
  transition: box-shadow 0.2s;
}
.pdf-page-wrapper.flash-page {
  box-shadow: 0 2px 20px rgba(212,131,10,0.5), 0 0 0 2px var(--amber);
}

/* ── PDF.js canvas ────────────────────────────────────────────── */
.pdf-page-wrapper canvas {
  display: block;
}

/* ── Text layer (PDF.js) ──────────────────────────────────────── */
/* pdf.js ≥4 sizes the layer and every span through CSS custom properties
   (--total-scale-factor, --font-height, --scale-x, …); these variable
   definitions are load-bearing — without them spans collapse to 0px and
   text selection silently stops working. viewer.js sets --scale-factor per
   page render; pdf.js sets --min-font-size and the per-span variables. */
.textLayer {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  overflow: hidden;
  line-height: 1;
  text-align: initial;
  transform-origin: 0 0;
  z-index: 0;
  --user-unit: 1;
  --total-scale-factor: calc(var(--scale-factor) * var(--user-unit));
  --scale-round-x: 1px;
  --scale-round-y: 1px;
  --min-font-size: 1;
  --text-scale-factor: calc(var(--total-scale-factor) * var(--min-font-size));
  --min-font-size-inv: calc(1 / var(--min-font-size));
}
.textLayer span,
.textLayer br {
  color: transparent;
  position: absolute;
  white-space: pre;
  cursor: text;
  transform-origin: 0% 0%;
  /* Allow text selection */
  user-select: text;
  -webkit-user-select: text;
}
.textLayer > span:not(.markedContent),
.textLayer .markedContent span:not(.markedContent) {
  z-index: 1;
  --font-height: 0;
  --scale-x: 1;
  --rotate: 0deg;
  font-size: calc(var(--text-scale-factor) * var(--font-height));
  transform: rotate(var(--rotate)) scaleX(var(--scale-x)) scale(var(--min-font-size-inv));
}
.textLayer .markedContent {
  display: contents;
}
.textLayer ::selection {
  background: rgba(70, 130, 200, 0.3);
  color: transparent;
}

/* ── Reader mode ──────────────────────────────────────────────── */
.reader-viewer {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 32px 24px 90px;
  min-height: 100%;
  background: var(--paper);
}
.reader-page-wrapper {
  width: 100%;
  max-width: 640px;
  font-family: var(--font-serif);
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink);
}
.reader-page-marker {
  display: block;
  font-family: var(--font-sans);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-muted);
  text-align: center;
  margin: 28px 0 14px;
  padding-top: 14px;
  border-top: 1px solid var(--rule);
  user-select: none;
  -webkit-user-select: none;
}
.reader-page-wrapper:first-child .reader-page-marker { margin-top: 0; border-top: none; padding-top: 0; }
.reader-page-wrapper.flash-page { animation: readerPageFlash 0.8s ease-out; }
@keyframes readerPageFlash {
  0%   { background: var(--amber-soft); }
  100% { background: transparent; }
}

.reader-block {
  display: block;
  margin: 0 0 14px;
  user-select: text;
  -webkit-user-select: text;
}
.reader-block-heading {
  font-weight: 700;
  font-size: 1.05em;
  margin-top: 22px;
}
.reader-block-list-item {
  margin-left: 1.4em;
}
.reader-block-empty {
  display: block;
  color: var(--ink-muted);
  font-family: var(--font-sans);
  font-size: 13px;
  font-style: italic;
  user-select: none;
  -webkit-user-select: none;
}

.reader-table-scroll {
  display: block;
  overflow-x: auto;
  margin: 14px 0 20px;
  -webkit-overflow-scrolling: touch;
}
.reader-table {
  border-collapse: collapse;
  width: 100%;
  font-family: var(--font-sans);
  font-size: 0.85em;
}
.reader-table td {
  border: 1px solid var(--rule);
  padding: 6px 9px;
  vertical-align: middle;
  text-align: center;
  white-space: nowrap;
}
.reader-table td:first-child {
  text-align: left;
  white-space: normal;
}
.reader-cell-bold { font-weight: 700; }
.reader-cell-italic { font-style: italic; }

/* ── Annotation highlights ────────────────────────────────────── */
.annotation-highlight {
  position: absolute;
  background: var(--amber-soft);
  border-bottom: 2px solid var(--amber);
  pointer-events: all;
  cursor: pointer;
  transition: background 0.15s;
  z-index: 5;
}
.annotation-highlight:hover {
  background: var(--amber-glow);
}
.annotation-highlight.flash-highlight {
  animation: highlightFlash 0.6s ease-out 2;
}
/* Reader mode highlights are real inline <mark> elements, not absolutely
   positioned overlays — reset the PDF-mode box model, keep the same colors. */
.annotation-highlight.is-inline {
  position: static;
  display: inline;
  border-bottom-width: 2px;
  font: inherit;
  color: inherit;
}
.deeplink-highlight {
  position: absolute;
  background: rgba(70, 130, 200, 0.28);
  border-bottom: 2px solid rgba(45, 100, 170, 0.9);
  pointer-events: none;
  z-index: 6;
  animation: deeplinkPulse 0.8s ease-in-out infinite alternate;
}
.deeplink-highlight.is-inline {
  position: static;
  display: inline;
  font: inherit;
  color: inherit;
}
@keyframes deeplinkPulse {
  from { background: rgba(70, 130, 200, 0.18); }
  to   { background: rgba(70, 130, 200, 0.42); }
}
@keyframes highlightFlash {
  0%   { background: var(--amber-glow); }
  50%  { background: rgba(212,131,10,0.5); }
  100% { background: var(--amber-soft); }
}

/* ── Sidebar ──────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  max-width: var(--sidebar-w);
  background: var(--paper);
  border-left: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.sidebar-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 18px 12px;
  border-bottom: 1px solid var(--rule);
  flex-shrink: 0;
}
.sidebar-title {
  font-family: var(--font-serif);
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  flex: 1;
}
.sidebar-count {
  font-size: 11px;
  font-weight: 500;
  background: var(--ink);
  color: var(--paper);
  border-radius: 20px;
  padding: 1px 7px;
  min-width: 20px;
  text-align: center;
}
.sidebar-sort {
  max-width: 112px;
  border: 1px solid var(--rule);
  background: var(--paper-warm);
  color: var(--ink-light);
  border-radius: var(--radius);
  padding: 2px 6px;
  font-family: var(--font-sans);
  font-size: 11px;
}
/* Grip + close button only appear in the mobile bottom-sheet mode */
.sidebar-grip { display: none; }
.sidebar-close {
  display: none;
  width: 28px;
  height: 28px;
  border: none;
  background: none;
  color: var(--ink-muted);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  border-radius: 3px;
  align-items: center;
  justify-content: center;
}
.sidebar-close:hover { background: var(--rule-light); color: var(--ink); }

.sidebar-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--ink-muted);
  padding: 40px 24px;
  text-align: center;
}
.empty-icon {
  font-size: 24px;
  color: var(--rule);
}
.sidebar-empty p {
  font-size: 13px;
  line-height: 1.6;
}

.annotation-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px 0;
  scrollbar-width: thin;
  scrollbar-color: var(--rule) transparent;
}

/* ── Annotation card ──────────────────────────────────────────── */
.annotation-card {
  padding: 12px 18px;
  border-left: 3px solid transparent;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
  position: relative;
}
.annotation-card:hover {
  background: var(--paper-warm);
  border-left-color: var(--amber);
}
.annotation-card.is-active {
  background: var(--paper-warm);
  border-left-color: var(--amber);
}
.annotation-card + .annotation-card {
  border-top: 1px solid var(--rule-light);
}
.orphan-section {
  border-top: 1px solid var(--rule);
  margin-top: 14px;
  padding: 14px 18px 4px;
}
.orphan-section h3 {
  font-family: var(--font-serif);
  font-size: 15px;
  margin-bottom: 4px;
}
.orphan-section > p {
  color: var(--ink-muted);
  font-size: 12px;
  line-height: 1.45;
  margin-bottom: 10px;
}
.orphan-card {
  background: var(--paper);
  border: 1px dashed var(--rule);
  border-radius: 6px;
  padding: 12px;
  margin-top: 8px;
}

.card-quote {
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.5;
  color: var(--ink-light);
  background: var(--paper-warm);
  border-left: 2px solid var(--amber);
  padding: 4px 8px;
  margin-bottom: 8px;
  border-radius: 0 2px 2px 0;
  /* Truncate long quotes */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-orphaned .card-quote {
  border-left-color: var(--ink-muted);
  opacity: 0.7;
}

.card-body {
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink);
  margin-bottom: 8px;
}
.card-body.is-deleted {
  color: var(--ink-muted);
  font-style: italic;
}
.card-edit-form {
  margin-bottom: 8px;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-author {
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-light);
  text-decoration: none;
}
.card-author:hover { color: var(--amber-dark); }
.card-date {
  font-size: 11px;
  color: var(--ink-muted);
}
.card-replies {
  margin-left: auto;
  border: 1px solid var(--rule);
  background: none;
  color: var(--ink-muted);
  font-family: var(--font-sans);
  font-size: 10.5px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 20px;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.12s, border-color 0.12s, background 0.12s;
}
.card-replies:hover {
  color: var(--amber-dark);
  border-color: var(--amber);
  background: var(--amber-soft);
}
.card-replies.has-replies {
  color: var(--amber-dark);
  border-color: var(--amber-glow);
  background: var(--amber-soft);
}
.card-vote {
  border: 1px solid var(--rule);
  background: none;
  color: var(--ink-muted);
  font-family: var(--font-sans);
  font-size: 10.5px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 20px;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.12s, border-color 0.12s, background 0.12s;
}
.card-vote:hover,
.card-vote.is-active {
  color: var(--amber-dark);
  border-color: var(--amber);
  background: var(--amber-soft);
}
.card-vote + .card-replies {
  margin-left: 0;
}
.follow-toggle {
  border: 1px solid var(--rule);
  background: none;
  color: var(--ink-muted);
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 20px;
  cursor: pointer;
}
.follow-toggle:hover,
.follow-toggle.is-active {
  color: var(--amber-dark);
  border-color: var(--amber);
  background: var(--amber-soft);
}

.card-page {
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--ink-muted);
  background: var(--rule-light);
  padding: 1px 5px;
  border-radius: 2px;
}
.card-orphan-badge {
  font-size: 10px;
  color: var(--ink-muted);
  font-style: italic;
}

.card-delete {
  position: absolute;
  top: 10px;
  right: 14px;
  width: 20px;
  height: 20px;
  border: none;
  background: none;
  color: var(--ink-muted);
  cursor: pointer;
  border-radius: 2px;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  line-height: 1;
  transition: color 0.12s, background 0.12s;
}
.annotation-card:hover .card-delete {
  display: flex;
}
.card-delete:hover {
  color: var(--danger);
  background: var(--danger-soft);
}

/* ── Selection popover ────────────────────────────────────────── */
.popover {
  position: fixed;
  z-index: 200;
  pointer-events: all;
}
.popover[hidden] { display: none; }
.popover-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  padding: 6px 12px;
  background: var(--ink);
  color: #e8e2d8;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,0,0,0.35), 0 1px 3px rgba(0,0,0,0.2);
  transition: background 0.12s, transform 0.1s;
  white-space: nowrap;
}
.popover-btn:hover {
  background: #2e2a25;
  transform: translateY(-1px);
}
/* Triangle arrow below */
.popover-btn::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--ink);
}

/* ── Compose modal ────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(26,24,20,0.55);
  backdrop-filter: blur(2px);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-backdrop[hidden] { display: none; }

.modal {
  background: var(--paper);
  border-radius: 6px;
  width: 480px;
  max-width: calc(100vw - 40px);
  box-shadow: 0 20px 60px rgba(0,0,0,0.3), 0 0 0 1px rgba(0,0,0,0.08);
  animation: modalIn 0.18s cubic-bezier(0.34, 1.2, 0.64, 1);
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  display: flex;
  align-items: center;
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--rule-light);
}
.modal-title {
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 700;
  flex: 1;
}
.modal-close {
  width: 24px;
  height: 24px;
  border: none;
  background: none;
  color: var(--ink-muted);
  cursor: pointer;
  font-size: 18px;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s, color 0.12s;
}
.modal-close:hover { background: var(--rule-light); color: var(--ink); }

.modal-quote {
  margin: 12px 20px;
  padding: 8px 12px;
  background: var(--paper-warm);
  border-left: 3px solid var(--amber);
  border-radius: 0 3px 3px 0;
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--ink-light);
  max-height: 80px;
  overflow-y: auto;
}

.modal-body {
  padding: 4px 20px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.form-label {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
}
.form-hint {
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--ink-muted);
}
.form-hint a { color: var(--amber-dark); }
.suggestion-list {
  margin: 4px 0 0 18px;
  color: var(--ink-light);
  font-size: 13px;
  line-height: 1.5;
}
.suggestion-list li + li {
  margin-top: 6px;
}
.form-input,
.form-textarea {
  width: 100%;
  font-family: var(--font-sans);
  font-size: 13px;
  padding: 8px 10px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: white;
  color: var(--ink);
  transition: border-color 0.12s;
  outline: none;
  resize: none;
}
.form-input:focus,
.form-textarea:focus {
  border-color: var(--amber);
  box-shadow: 0 0 0 2px var(--amber-soft);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 20px 16px;
  border-top: 1px solid var(--rule-light);
}

/* ── Toast notifications ──────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 400;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  align-items: center;
}
.toast {
  background: var(--ink);
  color: #e8e2d8;
  font-size: 12px;
  padding: 8px 16px;
  border-radius: var(--radius);
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  animation: toastIn 0.2s ease, toastOut 0.3s ease 2.5s forwards;
  white-space: nowrap;
}
.toast.toast-error {
  background: var(--danger);
}
@keyframes toastIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes toastOut {
  to { opacity: 0; transform: translateY(-4px); }
}

/* ── Ask panel ───────────────────────────────────────────────── */
.ask-panel {
  position: fixed;
  right: 18px;
  top: 74px;
  bottom: 18px;
  z-index: 800;
  width: min(420px, calc(100vw - 36px));
  background: white;
  border: 1px solid var(--rule);
  border-radius: 6px;
  box-shadow: 0 18px 54px rgba(0,0,0,0.16);
  display: flex;
  flex-direction: column;
}
.ask-panel[hidden] { display: none; }
.ask-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--rule-light);
}
.ask-panel-header h2 {
  font-family: var(--font-serif);
  font-size: 17px;
}
.ask-panel-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.ask-panel-actions .btn {
  padding: 6px 10px;
}
.ask-upgrade {
  margin: 14px;
  padding: 14px;
  border: 1px solid var(--rule-light);
  border-radius: 6px;
  background: var(--paper-warm);
  font-size: 13px;
  line-height: 1.5;
}
.ask-upgrade .btn {
  margin-top: 12px;
}
.ask-upgrade-eyebrow {
  color: var(--amber-dark);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}
.ask-upgrade-modal .modal-body {
  gap: 12px;
}
.ask-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
}
.ask-message {
  border: 1px solid var(--rule-light);
  border-radius: 6px;
  padding: 10px;
  margin-bottom: 8px;
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
}
.ask-message-user { background: var(--paper-warm); }
.ask-message-assistant { background: white; }
.ask-citations {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.ask-citation {
  font-size: 11px;
  border: 1px solid var(--rule);
  border-radius: 14px;
  padding: 3px 8px;
  text-decoration: none;
  color: var(--ink-light);
}
.ask-citation-unverified {
  border-style: dashed;
  color: var(--ink-muted);
}
.ask-quota {
  color: var(--ink-muted);
  font-size: 11px;
  padding: 0 12px 8px;
}
.ask-form {
  border-top: 1px solid var(--rule-light);
  padding: 12px;
}
.ask-form .btn {
  width: 100%;
  margin-top: 8px;
}

/* ── Thread dialog ────────────────────────────────────────────── */
.thread-modal {
  width: 560px;
  display: flex;
  flex-direction: column;
  max-height: min(80dvh, 720px);
}
.thread-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 4px 20px 12px;
  scrollbar-width: thin;
  scrollbar-color: var(--rule) transparent;
}

.thread-node.is-root > .thread-comment {
  border-left: 3px solid var(--amber);
  background: var(--paper-warm);
  border-radius: 0 4px 4px 0;
  padding: 10px 12px;
  margin-bottom: 4px;
}
.thread-comment {
  padding: 8px 0;
}
.thread-comment-meta {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 3px;
}
.thread-author {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-light);
  text-decoration: none;
}
.thread-author:hover { color: var(--amber-dark); }
.thread-date {
  font-size: 11px;
  color: var(--ink-muted);
}
.thread-root-badge {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--amber-dark);
  background: var(--amber-soft);
  padding: 1px 6px;
  border-radius: 2px;
}
.thread-comment-body {
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink);
  white-space: pre-wrap;
}
.thread-comment-body.is-deleted {
  color: var(--ink-muted);
  font-style: italic;
}
.thread-comment-actions {
  display: flex;
  gap: 12px;
  margin-top: 4px;
}
.thread-action {
  border: none;
  background: none;
  padding: 2px 0;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-muted);
  cursor: pointer;
  transition: color 0.12s;
}
.thread-action:hover { color: var(--amber-dark); }
.thread-action-danger:hover { color: var(--danger); }

/* Nesting: each reply's children indent under it with a guide line */
.thread-children {
  margin-left: 14px;
  padding-left: 12px;
  border-left: 1px solid var(--rule-light);
}
.thread-children:empty { display: none; }

.thread-inline-form {
  margin: 6px 0 4px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.thread-inline-form[hidden] { display: none; }
.thread-inline-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}
.btn-sm { padding: 4px 10px; font-size: 11px; }

.thread-composer {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 12px 20px 16px;
  border-top: 1px solid var(--rule-light);
}
.thread-composer .form-textarea { flex: 1; }

/* ── Mobile FAB + bottom sheet scrim ──────────────────────────── */
.fab {
  display: none;
  position: fixed;
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  z-index: 240;
  align-items: center;
  gap: 7px;
  padding: 12px 16px;
  border: none;
  border-radius: 28px;
  background: var(--ink);
  color: #e8e2d8;
  font-family: var(--font-sans);
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0,0,0,0.35);
}
.fab-icon { font-size: 16px; line-height: 1; }
.fab-count {
  font-size: 12px;
  font-weight: 500;
  background: var(--amber);
  color: white;
  border-radius: 20px;
  padding: 1px 8px;
  min-width: 22px;
  text-align: center;
}

.sheet-scrim {
  position: fixed;
  inset: 0;
  background: rgba(26,24,20,0.4);
  z-index: 245;
}
.sheet-scrim[hidden] { display: none; }

/* ── Responsive: mobile layout ────────────────────────────────── */
@media (max-width: 900px) {
  /* Toolbar: brand + icon-only buttons */
  .brand-tagline, .toolbar-doc, .btn-label { display: none; }
  .toolbar { padding: 0 10px; }
  .toolbar-brand { flex: 1; margin-right: 0; }
  .btn-ghost { padding: 7px 9px; }

  .pdf-viewer { padding: 10px 8px 90px; gap: 8px; }
  .reader-viewer { padding: 20px 18px 90px; }
  .reader-page-wrapper { font-size: 15px; }

  /* Sidebar becomes a bottom sheet behind the FAB */
  .fab { display: inline-flex; }
  .sidebar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    width: auto;
    min-width: 0;
    max-width: none;
    height: 72dvh;
    z-index: 250;
    border-left: none;
    border-top: 1px solid var(--rule);
    border-radius: 14px 14px 0 0;
    box-shadow: 0 -8px 30px rgba(0,0,0,0.25);
    transform: translateY(105%);
    transition: transform 0.25s cubic-bezier(0.32, 0.72, 0.25, 1);
  }
  .sidebar.is-open { transform: translateY(0); }
  .sidebar-header { position: relative; padding-top: 20px; }
  .sidebar-grip {
    display: block;
    position: absolute;
    top: 7px;
    left: 50%;
    transform: translateX(-50%);
    width: 36px;
    height: 4px;
    border-radius: 2px;
    background: var(--rule);
  }
  .sidebar-close { display: flex; }

  /* Delete button always visible (no hover on touch) */
  .card-delete { display: flex; }

  /* Modals hug the bottom of small screens */
  .modal-backdrop { align-items: flex-end; }
  .modal {
    width: 100%;
    max-width: 100%;
    border-radius: 14px 14px 0 0;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .thread-modal { max-height: 86dvh; }
}

/* ── Touch refinements ────────────────────────────────────────── */
@media (pointer: coarse) {
  /* 16px inputs prevent iOS Safari from zooming the page on focus */
  .form-input, .form-textarea { font-size: 16px; }
  .popover-btn { padding: 10px 16px; font-size: 14px; }
  .thread-action { padding: 6px 0; font-size: 12px; }
  .card-replies { padding: 4px 10px; }
}

/* =============================================================
   Prototype additions — auth, dashboard, moderation, statuses
   ============================================================= */

/* Pages that scroll normally (dashboard, login, moderation) */
body.page {
  overflow: auto;
  height: auto;
  min-height: 100dvh;
}
.page-main {
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
  padding: 28px 20px 80px;
}
.page-heading {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 18px;
}
.page-heading h1 {
  font-family: var(--font-serif);
  font-size: 22px;
  color: var(--ink);
}
.page-heading .sub {
  font-size: 12px;
  color: var(--ink-muted);
}
.page-heading .spacer { flex: 1; }
.legal-footer {
  width: 100%;
  max-width: 880px;
  margin: auto auto 0;
  padding: 18px 20px 22px;
  display: flex;
  justify-content: center;
  gap: 18px;
  border-top: 1px solid var(--rule-light);
  color: var(--ink-muted);
  font-size: 11.5px;
}
.legal-footer a {
  color: var(--ink-muted);
  text-decoration: none;
}
.legal-footer a:hover { color: var(--amber-dark); }
.legal-page {
  max-width: 760px;
}
.draft-banner {
  border: 1px solid var(--amber);
  background: var(--amber-soft);
  color: var(--amber-dark);
  border-radius: 4px;
  padding: 8px 10px;
  margin-bottom: 18px;
  font-size: 12px;
  font-weight: 500;
}
.version-banner {
  border: 1px solid var(--amber);
  background: var(--amber-soft);
  color: var(--amber-dark);
  border-radius: 4px;
  padding: 8px 10px;
  margin: 12px auto 0;
  width: min(820px, calc(100% - 32px));
  font-size: 12px;
  font-weight: 500;
}
.version-banner a {
  color: var(--amber-dark);
  margin-left: 8px;
}
.legal-section {
  border-top: 1px solid var(--rule);
  padding-top: 18px;
  margin-top: 18px;
}
.legal-section h2 {
  font-family: var(--font-serif);
  font-size: 17px;
  margin-bottom: 8px;
}
.legal-section p,
.legal-section li {
  font-size: 13px;
  line-height: 1.65;
  color: var(--ink-light);
}
.legal-section p + p { margin-top: 10px; }
.legal-section ul {
  margin-left: 18px;
  display: grid;
  gap: 6px;
}
.legal-section a { color: var(--amber-dark); }
.notice-form {
  display: grid;
  gap: 10px;
  max-width: 680px;
}
.check-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  color: var(--ink-light);
  line-height: 1.45;
}
.check-row input { margin-top: 2px; }
.form-error {
  color: var(--danger);
  font-size: 12px;
  min-height: 16px;
}
.form-success {
  color: #3d663d;
  background: rgba(74,122,74,0.1);
  border: 1px solid rgba(74,122,74,0.28);
  border-radius: 4px;
  padding: 8px 10px;
  font-size: 12px;
}

/* Toolbar user chip */
.toolbar-user {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #c8c2b8;
}
.user-chip .role-badge {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  background: var(--amber);
  color: white;
  padding: 1px 6px;
  border-radius: 2px;
}
.toolbar a.btn { color: #b0a898; }

/* Login */
.login-wrap {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.login-card {
  width: 380px;
  max-width: 100%;
  background: white;
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 28px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.08);
}
.login-brand {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 4px;
}
.login-brand .brand-mark { font-size: 20px; }
.login-brand .brand-name { color: var(--ink); font-size: 20px; }
.login-sub {
  font-size: 12px;
  color: var(--ink-muted);
  margin-bottom: 20px;
}
.login-card .form-label { margin-top: 12px; display: block; }
.login-card .form-input { margin-top: 4px; }
.login-card .btn-primary {
  width: 100%;
  justify-content: center;
  margin-top: 18px;
  padding: 9px;
  font-size: 13px;
}
.login-error {
  color: var(--danger);
  font-size: 12px;
  margin-top: 10px;
  min-height: 16px;
}
.login-hint {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--rule-light);
  font-size: 11px;
  line-height: 1.7;
  color: var(--ink-muted);
}
.login-hint code {
  font-family: var(--font-mono);
  font-size: 10.5px;
  background: var(--paper-warm);
  padding: 1px 4px;
  border-radius: 2px;
}

/* Document cards (dashboard) */
.doc-grid {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.folder-section {
  border-top: 1px solid var(--rule);
  padding-top: 14px;
}
.folder-section:first-child {
  border-top: 0;
  padding-top: 0;
}
.folder-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 10px;
}
.folder-title {
  font-family: var(--font-serif);
  font-size: 18px;
  line-height: 1.25;
  margin: 0;
}
.folder-desc {
  font-size: 12px;
  line-height: 1.45;
  color: var(--ink-muted);
  margin-top: 4px;
}
.folder-meta {
  margin-left: auto;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  color: var(--ink-muted);
  font-size: 11px;
}
.folder-docs {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.version-stack {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.version-history {
  margin-left: 18px;
  padding-left: 12px;
  border-left: 2px solid var(--rule);
}
.version-history summary {
  cursor: pointer;
  color: var(--ink-muted);
  font-size: 11px;
  margin: 4px 0 8px;
}
.version-history .doc-card {
  margin-top: 8px;
  background: var(--paper);
}
.doc-card {
  display: block;
  background: white;
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 16px 18px;
  text-decoration: none;
  color: var(--ink);
  transition: border-color 0.12s, box-shadow 0.12s;
}
.doc-card:hover {
  border-color: var(--amber);
  box-shadow: 0 4px 16px rgba(0,0,0,0.06);
}
.doc-card-top {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.doc-card-title {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 700;
  flex: 1;
}
.doc-card-desc {
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--ink-light);
  margin-top: 6px;
}
.doc-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  font-size: 11px;
  color: var(--ink-muted);
}
.doc-card-meta .mono { font-family: var(--font-mono); font-size: 10px; }
.chip {
  display: inline-block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 2px 8px;
  border-radius: 20px;
  background: var(--rule-light);
  color: var(--ink-light);
}
.chip-amber { background: var(--amber-soft); color: var(--amber-dark); }
.empty-note {
  text-align: center;
  color: var(--ink-muted);
  font-size: 13px;
  padding: 60px 0;
}
.profile-list {
  display: grid;
  gap: 10px;
}
.profile-annotation {
  display: block;
  background: white;
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 14px 16px;
  text-decoration: none;
  color: inherit;
}
.profile-annotation:hover {
  border-color: var(--amber);
  background: var(--paper-warm);
}
.profile-doc {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-light);
  margin-bottom: 8px;
}

/* Status badges on annotation cards & moderation queue */
.status-badge {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 1px 6px;
  border-radius: 2px;
  white-space: nowrap;
}
.status-draft     { background: var(--rule-light); color: var(--ink-light); }
.status-pending   { background: rgba(70,110,180,0.12); color: #3a5a90; }
.status-rejected  { background: var(--danger-soft); color: var(--danger); }
.status-friends   { background: rgba(90,140,90,0.12); color: #4a7a4a; }
.status-edited    { background: rgba(138,132,122,0.14); color: var(--ink-muted); }

.card-publish,
.card-edit {
  border: 1px solid var(--amber);
  background: var(--amber-soft);
  color: var(--amber-dark);
  font-family: var(--font-sans);
  font-size: 10.5px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 20px;
  cursor: pointer;
  transition: background 0.12s;
}
.card-publish:hover,
.card-edit:hover { background: var(--amber-glow); }

/* Draft/pending highlights are visually distinct from published ones */
.annotation-highlight.hl-draft   { border-bottom-style: dashed; background: rgba(138,132,122,0.16); border-bottom-color: var(--ink-muted); }
.annotation-highlight.hl-pending { border-bottom-style: dotted; }
.annotation-highlight.hl-rejected{ background: var(--danger-soft); border-bottom-color: var(--danger); }

/* Moderation queue */
.queue-section { margin-bottom: 28px; }
.queue-section h2 {
  font-family: var(--font-serif);
  font-size: 15px;
  margin-bottom: 10px;
}
.queue-card {
  background: white;
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 14px 16px;
  margin-bottom: 10px;
}
.queue-quote {
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.5;
  color: var(--ink-light);
  background: var(--paper-warm);
  border-left: 2px solid var(--amber);
  padding: 4px 8px;
  margin-bottom: 8px;
  border-radius: 0 2px 2px 0;
}
.queue-context {
  font-size: 11.5px;
  color: var(--ink-muted);
  margin-bottom: 6px;
  font-style: italic;
}
.queue-body { font-size: 13px; line-height: 1.55; margin-bottom: 10px; }
.queue-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  color: var(--ink-muted);
}
.queue-meta .spacer { flex: 1; }
.queue-sort-toggle {
  border-color: var(--rule);
}
.triage-badge {
  border-radius: 999px;
  padding: 2px 7px;
  font-size: 10.5px;
  font-weight: 500;
  border: 1px solid var(--rule);
}
.triage-green {
  background: rgba(74,122,74,0.12);
  border-color: rgba(74,122,74,0.35);
  color: #356436;
}
.triage-amber {
  background: var(--amber-soft);
  border-color: var(--amber-glow);
  color: var(--amber-dark);
}
.triage-red {
  background: var(--danger-soft);
  border-color: rgba(176,48,48,0.25);
  color: var(--danger);
}
.triage-unscored {
  background: var(--paper-warm);
  color: var(--ink-muted);
}
.usage-section {
  margin-bottom: 24px;
}
.usage-section h2 {
  font-family: var(--font-serif);
  font-size: 15px;
  margin-bottom: 10px;
}
.usage-bar {
  height: 12px;
  border-radius: 999px;
  background: var(--rule-light);
  overflow: hidden;
  margin-bottom: 8px;
}
.usage-bar-fill {
  height: 100%;
  background: var(--amber);
}
.usage-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border: 1px solid var(--rule);
  border-radius: 6px;
  overflow: hidden;
  font-size: 12px;
}
.usage-table th,
.usage-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--rule-light);
  text-align: right;
}
.usage-table th:first-child,
.usage-table td:first-child {
  text-align: left;
}
.usage-table th {
  color: var(--ink-muted);
  font-weight: 500;
  background: var(--paper-warm);
}
.btn-approve {
  background: #4a7a4a;
  color: white;
  font-weight: 500;
}
.btn-approve:hover { background: #3d663d; }
.btn-reject {
  background: none;
  border: 1px solid var(--rule);
  color: var(--danger);
}
.btn-reject:hover { background: var(--danger-soft); border-color: var(--danger); }

/* Compose modal: visibility selector */
.visibility-row {
  display: flex;
  gap: 8px;
}
.visibility-option {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 8px 10px;
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
}
.visibility-option:has(input:checked) {
  border-color: var(--amber);
  background: var(--amber-soft);
}
.visibility-option input { display: none; }
.visibility-option .v-title { font-size: 12px; font-weight: 500; color: var(--ink); }
.visibility-option .v-desc  { font-size: 10.5px; color: var(--ink-muted); line-height: 1.4; }

/* Thread dialog: pending replies */
.thread-comment.is-pending { opacity: 0.75; }

/* Upload dialog reuses .modal; form grid */
.form-row { display: flex; gap: 10px; }
.form-row > div { flex: 1; }
.upload-file-label {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px dashed var(--rule);
  border-radius: var(--radius);
  padding: 10px 12px;
  font-size: 12px;
  color: var(--ink-light);
  cursor: pointer;
  transition: border-color 0.12s;
}
.upload-file-label:hover { border-color: var(--amber); }
.folder-name-input {
  margin-top: 8px;
}
