/*
 * MobileImportMedia — sheet styling for the user-initiated Import Media flow.
 *
 * Trains: harnessing-iphone-flotilla S5 (2026-05-08, original);
 *         streamlining-import-modal S3 (2026-07-13 — enriched rows: state
 *         glyphs, Tag/Comment chips, comment accordion, doc-type chips,
 *         batch-note surface; sandbox route-toggle rules removed).
 * Mock:  tools/mobile-pilot/outputs/mobile_p0_09_import_media_2026-05-08.html (LOCKED).
 *
 * Substrate matches the dark teal palette shared across S3 modal surfaces
 * (#0a2e2e). Three accent palettes — amber / blue / pink — for the three
 * sources, mirrored from the locked mock SVG strokes.
 *
 * Mobile-only — every selector is namespaced .mim-* so desktop is untouched.
 */

/* ── Source picker rows ────────────────────────────────────────────── */
.mim-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 4px 0 16px;
}

.mim-intro {
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Source Sans 3", sans-serif;
  color: rgba(232, 232, 232, 0.78);
  padding: 0 4px 8px;
}

.mim-source-row {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  background: #0d3535;
  border: 1px solid rgba(232, 160, 64, 0.32);
  border-radius: 14px;
  padding: 14px 16px;
  text-align: left;
  color: #e0e0e8;
  cursor: pointer;
  transition: transform 120ms ease, background 120ms ease, border-color 120ms ease;
  -webkit-tap-highlight-color: transparent;
  min-height: 64px;
}
.mim-source-row:active {
  transform: scale(0.985);
  background: #103e3e;
}
.mim-source-row:focus-visible {
  outline: 2px solid rgba(232, 160, 64, 0.7);
  outline-offset: 2px;
}

.mim-source-row.mim-accent-amber { border-color: rgba(232, 160, 64, 0.32); }
.mim-source-row.mim-accent-blue  { border-color: rgba(96, 165, 250, 0.32); }
.mim-source-row.mim-accent-pink  { border-color: rgba(196, 96, 136, 0.36); }

.mim-source-icon {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.mim-source-icon svg {
  width: 22px;
  height: 22px;
}
.mim-accent-amber .mim-source-icon {
  background: rgba(232, 160, 64, 0.10);
  border-color: rgba(232, 160, 64, 0.32);
  color: rgb(232, 180, 96);
}
.mim-accent-blue .mim-source-icon {
  background: rgba(96, 165, 250, 0.10);
  border-color: rgba(96, 165, 250, 0.32);
  color: rgb(126, 178, 250);
}
.mim-accent-pink .mim-source-icon {
  background: rgba(196, 96, 136, 0.10);
  border-color: rgba(196, 96, 136, 0.36);
  color: rgb(216, 130, 168);
}

.mim-source-text {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.mim-source-label {
  font: 600 16px/1.25 -apple-system, BlinkMacSystemFont, "Source Sans 3", sans-serif;
  color: #fff;
  letter-spacing: 0.01em;
}
.mim-source-sub {
  font: 13px/1.4 -apple-system, BlinkMacSystemFont, "Source Sans 3", sans-serif;
  color: rgba(168, 176, 184, 0.92);
}

.mim-source-chevron {
  font-size: 22px;
  color: rgba(255, 255, 255, 0.32);
  flex: 0 0 auto;
}

.mim-footnote {
  font: 12px/1.45 -apple-system, BlinkMacSystemFont, "Source Sans 3", sans-serif;
  color: rgba(168, 176, 184, 0.7);
  padding: 6px 4px 0;
  font-style: italic;
}

/* ── Queue / review pass ───────────────────────────────────────────── */
.mim-content-queue {
  gap: 10px;
}

.mim-queue-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 4px 4px;
}
.mim-queue-count {
  font: 600 14px/1.3 -apple-system, BlinkMacSystemFont, sans-serif;
  color: rgba(232, 180, 96, 0.95);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.mim-queue-add-more {
  background: transparent;
  border: 1px solid rgba(232, 160, 64, 0.32);
  color: rgb(232, 180, 96);
  border-radius: 999px;
  font: 13px/1 -apple-system, BlinkMacSystemFont, sans-serif;
  padding: 8px 14px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.mim-queue-add-more:active { background: rgba(232, 160, 64, 0.10); }

.mim-queue-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mim-queue-row {
  display: flex;
  gap: 12px;
  align-items: stretch;
  background: #0d3535;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 10px;
}

.mim-queue-thumb {
  flex: 0 0 64px;
  width: 64px;
  height: 64px;
  border-radius: 8px;
  background: #051c1c;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  color: rgba(232, 180, 96, 0.65);
}
.mim-queue-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.mim-queue-thumb svg {
  width: 28px;
  height: 28px;
}
.mim-thumb-play-badge {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.32);
  color: #fff;
  font-size: 18px;
  pointer-events: none;
}

.mim-queue-meta {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.mim-queue-topline {
  display: flex;
  gap: 8px;
  align-items: center;
  min-width: 0;
}
.mim-queue-chip {
  font: 700 10px/1 -apple-system, BlinkMacSystemFont, sans-serif;
  letter-spacing: 0.08em;
  padding: 4px 7px;
  border-radius: 999px;
  flex: 0 0 auto;
}
.mim-chip-photo  { background: rgba(232, 160, 64, 0.18);  color: rgb(232, 200, 132); }
.mim-chip-video  { background: rgba(96, 165, 250, 0.18);  color: rgb(150, 198, 252); }
.mim-chip-audio  { background: rgba(196, 96, 136, 0.18);  color: rgb(232, 156, 188); }
.mim-chip-pdf    { background: rgba(220, 88, 88, 0.18);   color: rgb(240, 152, 152); }
.mim-chip-text   { background: rgba(120, 200, 200, 0.18); color: rgb(176, 232, 232); }
.mim-chip-document { background: rgba(255, 255, 255, 0.10); color: rgba(232, 232, 232, 0.92); }

.mim-queue-name {
  font: 14px/1.3 -apple-system, BlinkMacSystemFont, sans-serif;
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1 1 auto;
  min-width: 0;
}
.mim-queue-size {
  font: 12px/1 -apple-system, BlinkMacSystemFont, sans-serif;
  color: rgba(168, 176, 184, 0.7);
  flex: 0 0 auto;
}

.mim-queue-caption {
  width: 100%;
  background: #051c1c;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 8px;
  color: #e0e0e8;
  font: 13px/1.4 -apple-system, BlinkMacSystemFont, sans-serif;
  padding: 8px 10px;
  min-height: 36px;
}
.mim-queue-caption::placeholder { color: rgba(168, 176, 184, 0.55); }
.mim-queue-caption:focus {
  outline: none;
  border-color: rgba(232, 160, 64, 0.55);
}

.mim-queue-remove {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.10);
  color: rgba(232, 232, 232, 0.65);
  align-self: flex-start;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.mim-queue-remove svg { width: 16px; height: 16px; }
.mim-queue-remove:active { background: rgba(220, 88, 88, 0.18); color: rgb(240, 152, 152); }

/* ── Enriched item rows (streamlining-import-modal S3) ─────────────────
   Upload-state glyph on the thumbnail corner, Tag/Comment chips, in-row
   comment accordion, doc-type hint chips, and the batch-note surface
   (which sits where the retired sandbox toggle used to render — the
   .mim-route-toggle* rules were removed with that affordance). */

/* Upload-state glyph: ⟳ uploading → ✓ safe → ! retry (tappable) → ≡ dup. */
.mim-thumb-state {
  position: absolute;
  right: 3px;
  bottom: 3px;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font: 700 12px/1 -apple-system, BlinkMacSystemFont, sans-serif;
  background: rgba(5, 28, 28, 0.85);
  color: rgba(232, 232, 232, 0.75);
  padding: 0;
  pointer-events: none;
  -webkit-tap-highlight-color: transparent;
}
.mim-thumb-state.mim-state-queued,
.mim-thumb-state.mim-state-uploading {
  color: rgb(232, 200, 132);
  animation: mim-spin 1.4s linear infinite;
}
.mim-thumb-state.mim-state-uploaded {
  background: rgba(96, 200, 132, 0.28);
  color: rgb(140, 220, 168);
}
.mim-thumb-state.mim-state-failed {
  background: rgba(220, 88, 88, 0.32);
  color: rgb(240, 152, 152);
  pointer-events: auto;   /* tappable → retry */
  cursor: pointer;
}
.mim-thumb-state.mim-state-duplicate {
  background: rgba(232, 160, 64, 0.28);
  color: rgb(232, 200, 132);
}
@keyframes mim-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* Status subline (duplicate / failure notes). */
.mim-queue-note {
  font: 12px/1.35 -apple-system, BlinkMacSystemFont, sans-serif;
  color: rgba(232, 200, 132, 0.9);
}
.mim-row-failed .mim-queue-note { color: rgb(240, 152, 152); }
.mim-row-duplicate { opacity: 0.72; }
.mim-row-duplicate .mim-queue-caption { opacity: 0.5; }

/* Tag / Comment enrichment chips. */
.mim-row-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.mim-chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px solid rgba(232, 160, 64, 0.32);
  color: rgb(232, 200, 132);
  border-radius: 999px;
  font: 600 12px/1 -apple-system, BlinkMacSystemFont, sans-serif;
  padding: 7px 12px;
  min-height: 32px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
/* An author `display` rule beats the UA stylesheet's [hidden]{display:none},
   so `chip.hidden = true` was a silent no-op — chips the JS believed it had
   hidden stayed visible AND tappable. Found 2026-08-18 when a duplicate row's
   Comment chip accepted text the code thought unreachable. Any element here
   given a display value needs this guard. */
.mim-chip-btn[hidden] { display: none; }
.mim-chip-btn svg { width: 14px; height: 14px; }
.mim-chip-btn:active { background: rgba(232, 160, 64, 0.10); }
.mim-chip-btn:disabled {
  border-color: rgba(255, 255, 255, 0.10);
  color: rgba(232, 232, 232, 0.35);
  cursor: default;
}
.mim-chip-btn.mim-chip-busy {
  color: rgba(232, 200, 132, 0.6);
  animation: mim-pulse 1.2s ease-in-out infinite;
}
.mim-chip-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: rgb(232, 160, 64);
  display: inline-block;
}

/* In-row comment accordion — typed or dictated (S4 mic). */
.mim-comment-accordion { padding-top: 2px; }
/* Mic wrappers: the VoiceDictation button absolutely positions against
   these (global baseline in css/voice-dictation.css supplies the amber
   circle + pulse); the textarea reserves a right gutter for it. */
.mim-comment-wrap,
.mim-batch-note-inputwrap {
  position: relative;
}
.mim-comment-wrap .vd-mic-btn,
.mim-batch-note-inputwrap .vd-mic-btn {
  top: 6px;
  right: 6px;
  margin: 0;
}
.mim-comment-input,
.mim-batch-note-input {
  width: 100%;
  background: #051c1c;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 8px;
  color: #e0e0e8;
  font: 13px/1.45 -apple-system, BlinkMacSystemFont, sans-serif;
  padding: 8px 48px 8px 10px;
  min-height: 52px;
  max-height: 320px;
  resize: none;
  overflow-y: auto;
}
.mim-comment-input::placeholder,
.mim-batch-note-input::placeholder { color: rgba(168, 176, 184, 0.55); }
.mim-comment-input:focus,
.mim-batch-note-input:focus {
  outline: none;
  border-color: rgba(232, 160, 64, 0.55);
}

/* Doc-type hint chips (documents/PDFs only). */
.mim-doctype-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.mim-doctype-chip {
  background: transparent;
  border: 1px solid rgba(96, 165, 250, 0.28);
  color: rgba(150, 198, 252, 0.9);
  border-radius: 999px;
  font: 500 11px/1 -apple-system, BlinkMacSystemFont, sans-serif;
  padding: 6px 10px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.mim-doctype-chip.mim-doctype-active {
  background: rgba(96, 165, 250, 0.22);
  color: #fff;
  border-color: rgba(96, 165, 250, 0.6);
}

/* Batch-note surface — sits where the sandbox toggle row used to render
   (chrome-neutral swap, DESIGN §2). */
.mim-batch-note {
  background: #0d3535;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  margin: 10px 0 4px;
  overflow: hidden;
}
.mim-batch-note-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  background: transparent;
  border: none;
  color: #e0e0e8;
  font: 600 14px/1.3 -apple-system, BlinkMacSystemFont, sans-serif;
  padding: 12px 14px;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.mim-batch-note-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.mim-batch-note-caret {
  color: rgba(232, 200, 132, 0.8);
  transition: transform 160ms ease;
}
.mim-batch-note-open .mim-batch-note-caret { transform: rotate(180deg); }
.mim-batch-note-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 14px 12px;
}
/* Same [hidden] defeat as .mim-chip-btn: without this the collapse toggle is
   inert — aria-expanded flips and the caret rotates while the body never
   hides. Second instance of the class found in the 2026-08-18 sweep. */
.mim-batch-note-body[hidden] { display: none; }
/* Fergi interview chip — live entry (S4). Wine/pink = the Fergi AI mode
   color (matches the AI sheet's #831843 band). */
.mim-fergi-chip {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(131, 24, 67, 0.28);
  border: 1px solid rgba(216, 130, 168, 0.55);
  color: #eeb6cf;
  border-radius: 999px;
  font: 600 12px/1 -apple-system, BlinkMacSystemFont, sans-serif;
  padding: 7px 12px;
  min-height: 32px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.mim-fergi-chip:active { background: rgba(131, 24, 67, 0.45); }
.mim-fergi-chip:disabled {
  cursor: default;
  opacity: 0.5;
  background: transparent;
  border-style: dashed;
}

/* Interview suggestion card — one-tap-confirm offer of Fergi's distilled
   note. Never lands unseen: the member taps "Use this note" or it drops. */
.mim-fergi-suggest {
  background: rgba(131, 24, 67, 0.16);
  border: 1px solid rgba(216, 130, 168, 0.4);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.mim-fergi-suggest-label {
  font: 700 11px/1.2 -apple-system, BlinkMacSystemFont, sans-serif;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(238, 182, 207, 0.9);
}
.mim-fergi-suggest-text {
  font: 13px/1.45 -apple-system, BlinkMacSystemFont, sans-serif;
  color: #e8e0e6;
  max-height: 180px;
  overflow-y: auto;
  white-space: pre-wrap;
}
.mim-fergi-suggest-actions {
  display: flex;
  gap: 8px;
}
.mim-fergi-suggest-use {
  background: linear-gradient(135deg, #a83a6b 0%, #831843 100%);
  border: none;
  color: #fff;
  border-radius: 999px;
  font: 600 12px/1 -apple-system, BlinkMacSystemFont, sans-serif;
  padding: 8px 14px;
  min-height: 32px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.mim-fergi-suggest-use:active { filter: brightness(1.15); }
.mim-fergi-suggest-dismiss {
  background: transparent;
  border: 1px solid rgba(168, 176, 184, 0.35);
  color: rgba(200, 206, 214, 0.85);
  border-radius: 999px;
  font: 600 12px/1 -apple-system, BlinkMacSystemFont, sans-serif;
  padding: 8px 14px;
  min-height: 32px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

/* "Done — back to your import" return pill: floats OVER the Fergi AI sheet
   (unifiedAIModal z 10350 → pill 10360) so the member always has a one-tap
   way back to the still-open staging sheet beneath. */
.mim-fergi-return {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 64px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 10360;
  background: linear-gradient(135deg, #a83a6b 0%, #831843 100%);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #fff;
  border-radius: 999px;
  font: 600 13px/1 -apple-system, BlinkMacSystemFont, sans-serif;
  padding: 10px 18px;
  min-height: 38px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.mim-fergi-return:active { transform: translateX(-50%) scale(0.97); }

/* Footer commit button */
.mim-queue-footer {
  display: flex;
  justify-content: stretch;
  /* No home-indicator inset here: the fullscreen sheet ends above the tab bar,
     which owns it (mobile-bottom-sheet.css, converging-mobile-import S6). */
  padding: 4px 0 8px;
}
.mim-commit-btn {
  flex: 1 1 auto;
  background: linear-gradient(180deg, rgba(232, 180, 96, 1) 0%, rgba(232, 160, 64, 1) 100%);
  color: #1a0e00;
  font: 700 16px/1.2 -apple-system, BlinkMacSystemFont, sans-serif;
  border: none;
  border-radius: 14px;
  padding: 16px 20px;
  letter-spacing: 0.01em;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 2px 8px rgba(232, 160, 64, 0.30);
  min-height: 52px;
}
.mim-commit-btn:active { transform: translateY(1px); }
.mim-commit-btn:disabled {
  background: rgba(255, 255, 255, 0.10);
  color: rgba(232, 232, 232, 0.45);
  box-shadow: none;
  cursor: not-allowed;
}

/* ── Progress sheet ────────────────────────────────────────────────── */
.mim-progress-heading {
  font: 600 15px/1.3 -apple-system, BlinkMacSystemFont, sans-serif;
  color: #fff;
  padding: 4px 4px 8px;
}
.mim-progress-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.mim-progress-row {
  display: flex;
  gap: 10px;
  align-items: center;
  background: #0d3535;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 10px 12px;
  font: 14px/1.3 -apple-system, BlinkMacSystemFont, sans-serif;
  color: #e0e0e8;
}
.mim-progress-dot {
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}
.mim-progress-uploaded .mim-progress-dot { background: rgba(96, 200, 132, 0.18); color: rgb(140, 220, 168); }
.mim-progress-failed   .mim-progress-dot { background: rgba(220, 88, 88, 0.18);  color: rgb(240, 152, 152); }
.mim-progress-uploading .mim-progress-dot {
  background: rgba(232, 160, 64, 0.18);
  color: rgb(232, 200, 132);
  animation: mim-pulse 1.2s ease-in-out infinite;
}
@keyframes mim-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.4; }
}
.mim-progress-name {
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.mim-progress-status {
  flex: 0 0 auto;
  font-size: 12px;
  color: rgba(168, 176, 184, 0.85);
  letter-spacing: 0.02em;
  text-transform: lowercase;
}
.mim-progress-failed .mim-progress-status { color: rgb(240, 152, 152); }

/* ── Result toast (View + Undo) ────────────────────────────────────── */
.mim-toast-host {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 16px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  z-index: 11200;  /* above default tab-bar (11000) and BottomSheet but below drawer (12000) */
  pointer-events: none;
}
.mim-result-toast {
  pointer-events: auto;
  background: #0d3535;
  border: 1px solid rgba(232, 160, 64, 0.45);
  color: #e0e0e8;
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 280px;
  max-width: min(92vw, 420px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  animation: mim-toast-in 200ms ease-out;
}
.mim-result-toast.mim-result-out {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 220ms ease-out, transform 220ms ease-out;
}
@keyframes mim-toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.mim-result-msg {
  font: 14px/1.4 -apple-system, BlinkMacSystemFont, sans-serif;
  color: #fff;
}
.mim-result-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  align-items: center;
}
.mim-result-view,
.mim-result-undo {
  background: transparent;
  border: 1px solid rgba(232, 160, 64, 0.55);
  color: rgb(232, 200, 132);
  border-radius: 999px;
  font: 600 13px/1 -apple-system, BlinkMacSystemFont, sans-serif;
  padding: 8px 14px;
  min-height: 32px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.mim-result-view { color: #fff; background: rgba(232, 160, 64, 0.20); }
.mim-result-view:active,
.mim-result-undo:active {
  background: rgba(232, 160, 64, 0.32);
}
.mim-result-close {
  margin-left: 4px;
  background: transparent;
  border: none;
  color: rgba(232, 232, 232, 0.55);
  font-size: 18px;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.mim-result-close:active { background: rgba(255, 255, 255, 0.08); }

/* ── Drawer entry — primary action button (visual peer to drawer items) ──
   D-B1 (meticulous-tailoring-canvas S2): saturated amber + dark text mirrors
   the canonical .mim-commit-btn pattern (high contrast, ~12:1 on label) so
   the affordance reads cleanly on the white drawer panel and previews the
   amber identity carried through the rest of the import flow. */
.mobile-drawer-import-action {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin: 4px 0 14px;
  padding: 14px 14px;
  background: linear-gradient(180deg, rgba(232, 180, 96, 1) 0%, rgba(232, 160, 64, 1) 100%);
  border: 1px solid rgba(176, 112, 32, 0.65);
  border-radius: 14px;
  color: #1a0e00;
  font: 600 15px/1.25 -apple-system, BlinkMacSystemFont, "Source Sans 3", sans-serif;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  text-align: left;
  min-height: 56px;
  box-shadow: 0 2px 8px rgba(232, 160, 64, 0.30);
}
.mobile-drawer-import-action:active { transform: translateY(1px); background: linear-gradient(180deg, rgba(216, 160, 80, 1) 0%, rgba(216, 144, 48, 1) 100%); }
.mobile-drawer-import-action-icon {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(26, 14, 0, 0.12);
  border: 1px solid rgba(26, 14, 0, 0.32);
  color: #1a0e00;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mobile-drawer-import-action-icon svg { width: 20px; height: 20px; }
.mobile-drawer-import-action-text {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.mobile-drawer-import-action-label { font-weight: 700; color: #1a0e00; }
.mobile-drawer-import-action-sub {
  font: 12px/1.3 -apple-system, BlinkMacSystemFont, sans-serif;
  color: rgba(26, 14, 0, 0.72);
  font-weight: 500;
}

/* ── Reduced motion ────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .mim-source-row,
  .mim-commit-btn,
  .mim-result-toast,
  .mim-batch-note-caret {
    transition: none;
    animation: none;
  }
  .mim-progress-uploading .mim-progress-dot { animation: none; }
  .mim-thumb-state.mim-state-queued,
  .mim-thumb-state.mim-state-uploading { animation: none; }
  .mim-chip-btn.mim-chip-busy { animation: none; }
}

/* ── converging-mobile-import S5 (#8): "Your contributions" — the per-item ladder ──
 * Colour carries the state, never decoration: teal = in the vault, green = described by the vault,
 * amber = waiting for the vault's AI (NOT failed), rose = the AI couldn't read it / not added,
 * grey = only received so far. */
.mim-contrib { display: flex; flex-direction: column; gap: 12px; padding: 4px 2px 24px; color: #e0e0e8;
  font: 14px/1.4 -apple-system, BlinkMacSystemFont, sans-serif; }
.mim-contrib-intro { margin: 0; color: rgba(224, 224, 232, 0.75); font-size: 13px; }
.mim-contrib-all { align-self: flex-start; background: transparent; border: 1px solid rgba(232, 160, 64, 0.55);
  color: rgb(232, 200, 132); border-radius: 999px; padding: 6px 12px; font: 600 13px/1 inherit; min-height: 32px; }
.mim-contrib-empty { padding: 18px 4px; color: rgba(224, 224, 232, 0.7); }
.mim-contrib-batch { background: #0d3535; border: 1px solid rgba(64, 200, 200, 0.25); border-radius: 14px;
  padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.mim-contrib-batch.mim-contrib-undone { border-color: rgba(160, 160, 170, 0.3); opacity: 0.75; }
.mim-contrib-head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.mim-contrib-name { font-weight: 700; color: #fff; }
.mim-contrib-when { font-size: 12px; color: rgba(224, 224, 232, 0.6); white-space: nowrap; }
.mim-contrib-phase { font-size: 13px; color: rgb(120, 220, 210); }
.mim-contrib-wait { font-size: 13px; color: #2b1d00; background: rgb(240, 190, 90); border-radius: 10px;
  padding: 8px 10px; }
.mim-contrib-learned { font-size: 12px; color: rgba(190, 240, 200, 0.9); }
.mim-contrib-items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.mim-contrib-item { display: flex; gap: 10px; align-items: flex-start; padding: 6px; border-radius: 10px;
  border-left: 4px solid rgba(160, 160, 170, 0.6); background: rgba(255, 255, 255, 0.03); }
.mim-contrib-tappable { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.mim-contrib-state-published, .mim-contrib-state-held_until_read { border-left-color: rgb(64, 200, 200); }
.mim-contrib-state-analysed { border-left-color: rgb(100, 210, 150); }
.mim-contrib-state-captioned { border-left-color: rgb(80, 220, 120); }
.mim-contrib-state-waiting_ai { border-left-color: rgb(240, 180, 70); }
.mim-contrib-state-analysis_failed, .mim-contrib-state-refused { border-left-color: rgb(230, 110, 120); }
.mim-contrib-thumb { width: 56px; height: 56px; flex: 0 0 56px; border-radius: 8px; object-fit: cover;
  background: rgba(255, 255, 255, 0.06); }
.mim-contrib-body { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.mim-contrib-item-name { color: #fff; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mim-contrib-rungs { display: flex; gap: 6px; flex-wrap: wrap; }
.mim-rung { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; color: rgba(224, 224, 232, 0.4); }
.mim-rung-dot { width: 8px; height: 8px; border-radius: 50%; border: 1px solid currentColor; }
.mim-rung-on { color: rgb(120, 220, 170); }
.mim-rung-on .mim-rung-dot { background: currentColor; }
.mim-contrib-words { font-size: 12px; color: rgba(224, 224, 232, 0.85); }
.mim-contrib-state-waiting_ai .mim-contrib-words { color: rgb(240, 190, 90); }
.mim-contrib-caption { font-size: 12px; color: rgba(224, 224, 232, 0.65); font-style: italic; }
.mim-contrib-more { font-size: 12px; color: rgba(224, 224, 232, 0.6); padding-left: 6px; }
.mim-contrib-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.mim-contrib-undo { background: transparent; border: 1px solid rgba(230, 110, 120, 0.7); color: rgb(245, 160, 168);
  border-radius: 999px; padding: 8px 14px; min-height: 36px; font: 600 13px/1 -apple-system, BlinkMacSystemFont, sans-serif; }
.mim-contrib-undo[data-confirm="1"] { background: rgba(230, 110, 120, 0.22); color: #fff; }
.mim-contrib-undo-note { font-size: 11px; color: rgba(224, 224, 232, 0.55); }

/* S5 (#8): UMI's AI section while the vault has not read an item yet (loaded globally, so desktop too). */
.um-analysis-pending { font-style: italic; color: #8a6d1f; }
.um-analysis-pending-section[data-analysis-state="waiting_ai"] .um-analysis-pending { color: #b07a00; }
.um-analysis-pending-section[data-analysis-state="analysis_failed"] .um-analysis-pending,
.um-analysis-pending-section[data-analysis-state="failed"] .um-analysis-pending { color: #b0424e; }
