/* ── FAB Choice Popup ── */

.fab-choice {
  position: fixed;
  bottom: 90px;
  right: 24px;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.18);
  z-index: 800;
  overflow: hidden;
  min-width: 210px;
}

.fab-choice.hidden { display: none; }

.fab-choice-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px 18px;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
  text-align: left;
  transition: background 0.15s;
}

.fab-choice-btn:last-child { border-bottom: none; }
.fab-choice-btn:hover { background: var(--bg-warm); }

/* A <button> inherits nothing — its UA default is `color: buttontext`, i.e.
   black. That went unnoticed while the icon was an emoji, because an emoji
   paints itself and ignores `color`. Once the icon became a currentColor SVG
   it turned black and vanished into the dark surface. The label and desc below
   were never affected because they set their own colour. */
.fab-choice-btn { color: var(--text); }

.fab-choice-icon { font-size: 20px; flex-shrink: 0; }

.fab-choice-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.fab-choice-desc {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ── Backdrop ── */

.au-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 840;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}

.au-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

/* ── Auto-Upload Overlay ── */

#au-overlay {
  position: fixed;
  inset: 0;
  background: var(--surface);
  z-index: 850;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

#au-overlay.open { transform: translateX(0); }

/* ── Header ── */

.au-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
  flex-shrink: 0;
}

.au-title {
  flex: 1;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  margin: 0;
}

.au-back {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
}

.au-back:hover { background: var(--bg-warm); color: var(--text); }
.au-back.hidden { display: none; }

.au-close {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: var(--text-muted);
  padding: 6px 10px;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
}

.au-close:hover { background: var(--bg-warm); color: var(--text); }

/* ── Body ── */

.au-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px 12px;
  max-width: 760px;
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}

.au-hint {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0 0 20px;
  line-height: 1.5;
}

/* ── File row (step 1) ── */

.au-file-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.au-or { font-size: 13px; color: var(--text-muted); }

.au-file-label {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
}

.au-file-name {
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
}

/* ── Sections (step 2) ── */

.au-section {
  margin-bottom: 16px;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  padding: 12px 16px 16px;
}

.au-section-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 14px;
}

/* ── Footer ── */

.au-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  padding: 14px 28px;
  border-top: 1px solid var(--border-light);
  flex-shrink: 0;
  max-width: 760px;
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}

/* ── Review panel ───────────────────────────────────────────────────────────
   The review step is generated from a field list and annotated with how
   confident the parser was. These rules carry that annotation: what to check,
   what is only suggested, and what could not be placed at all. Everything uses
   the existing tokens so it follows the theme. */

.au-banner {
  background: var(--bg-warm);
  border: 1px solid var(--border-light);
  border-left: 3px solid #b8860b;
  border-radius: 6px;
  padding: 10px 12px;
  margin-bottom: 14px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--text);
}
.au-banner-clean { border-left-color: #2e7d32; color: var(--text-muted); }
.au-banner strong { font-weight: 600; margin-right: 4px; }

.au-jump {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: 999px;
  padding: 2px 10px;
  margin: 2px 3px 2px 0;
  font: inherit;
  font-size: 12px;
  color: var(--text);
  cursor: pointer;
}
.au-jump:hover { border-color: #b8860b; }

/* A field the parser was unsure of. The marker is on the row, not the input,
   so the explanation underneath is visibly part of the same thing. */
.au-row { position: relative; }
.au-row.au-check { border-left: 2px solid #b8860b; margin-left: -8px; padding-left: 6px; }

.au-field-note {
  font-size: 11px;
  line-height: 1.6;
  color: var(--text-muted);
  padding: 2px 0 6px;
}
.au-flag { color: #b8860b; font-weight: 600; }

.au-alts { display: inline; }
.au-alt {
  background: none;
  border: 1px solid var(--border-light);
  border-radius: 4px;
  padding: 1px 6px;
  margin-left: 4px;
  font: inherit;
  font-size: 11px;
  color: var(--text);
  cursor: pointer;
}
.au-alt:hover { border-color: #b8860b; }

/* Conditions the parser recognised but will not set on its own. Off until
   tapped — that is the whole point, so the off state has to read as off. */
.au-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.au-suggest {
  background: var(--surface);
  border: 1px dashed var(--border-light);
  border-radius: 999px;
  padding: 5px 12px;
  font: inherit;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
}
.au-suggest:hover { border-color: #b8860b; color: var(--text); }
.au-suggest.is-on {
  border-style: solid;
  border-color: #2e7d32;
  background: rgba(46, 125, 50, 0.1);
  color: var(--text);
  font-weight: 600;
}

/* The quote ladder. Nothing is preselected, because the note did not say. */
.au-quotes { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.au-quote {
  flex: 1 1 110px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 10px 12px;
  font: inherit;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}
.au-quote:hover { border-color: #b8860b; }
.au-quote.is-on { border-color: #2e7d32; background: rgba(46, 125, 50, 0.1); }
.au-quote-face { font-size: 15px; font-weight: 600; }
.au-quote-mo   { font-size: 12px; color: var(--text-muted); }

/* What the parser could not place, and the note itself. Both collapsed: they
   are there to be checked, not to be read every time. */
.au-leftovers summary,
.au-rawnote summary {
  cursor: pointer;
  font-size: 12px;
  color: var(--text-muted);
  padding: 4px 0;
}
.au-leftovers ul { margin: 4px 0 0 18px; font-size: 12px; color: var(--text); }
.au-leftovers li { margin: 2px 0; }
.au-rawnote pre {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-muted);
  background: var(--bg-warm);
  border-radius: 6px;
  padding: 10px;
  margin: 6px 0 0;
}

@media (max-width: 480px) {
  .au-quote { flex: 1 1 100%; }
  .au-banner { font-size: 12px; }
}

/* ── Collapsible sections ───────────────────────────────────────────────── */

.au-collapse > summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 0 8px;
}
.au-collapse > summary::-webkit-details-marker { display: none; }
.au-collapse > summary::before {
  content: '▾';
  font-size: 11px;
  color: var(--text-muted);
  transition: transform .15s ease;
}
.au-collapse:not([open]) > summary::before { transform: rotate(-90deg); }
.au-collapse:not([open]) > summary { padding-bottom: 2px; }

/* How much of a section is filled, so a closed one still says what is inside. */
.au-sec-count {
  margin-left: auto;
  font-size: 11px;
  font-weight: 400;
  color: var(--text-muted);
}

/* Where a jump link landed. Replaces focusing the input, which on Safari zooms
   the viewport in and never back out. */
.au-jumped {
  animation: au-flash 1.6s ease-out;
  border-radius: 6px;
}
@keyframes au-flash {
  0%, 30% { background: rgba(184, 134, 11, 0.18); }
  100%    { background: transparent; }
}

/* A value the panel filled from the carrier rather than from the note. */
.au-auto { color: #2e7d32; font-weight: 600; }

/* ── Multi-select chips ─────────────────────────────────────────────────── */

.cp-multi { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.cp-multi-chip {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: 999px;
  padding: 5px 12px;
  font: inherit;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
}
.cp-multi-chip:hover { border-color: #b8860b; color: var(--text); }
.cp-multi-chip.is-on {
  border-color: #2e7d32;
  background: rgba(46, 125, 50, 0.1);
  color: var(--text);
  font-weight: 600;
}
