/*
 * frontend/shared/breadcrumb-dc.css
 *
 * 2026-07-06 (DC-DEST-STREAM-V1) — styles for the JS-INJECTED Destination
 * sheet on DC surfaces OUTSIDE make.html (Stream at /cuts, future pages).
 * make.html keeps its inline copy of these rules (its sheet markup is
 * inline too); everything here is scoped under #dcDestinationSheet so it
 * can load anywhere without colliding with a page's own .dc-* rules.
 * Values byte-match make.html's palette, with hard fallbacks because the
 * host page (dark-themed /cuts) does not define DC's CSS variables.
 */

/* COMPASS-PULLDOWN-V1 (Roughy 2026-07-25): "a professional Apple menu … black
 * on light-gray … use the whole fucking screen … re-pull-down easily with one
 * thumb." The sheet is no longer a dark-glass takeover — it is a tall, tight,
 * near-black-on-light pull-down that claims the screen so the tier tree is
 * fully browsable in one thumb roll. Drag physics land in COMPASS-DRAG-V1;
 * the CSS here exposes the --dc-drag transform var the drag writes to, and
 * keeps a spring transition for the release/settle. */
#dcDestinationSheet.dc-sheet {
  position: fixed; inset: 0; z-index: 300;
  pointer-events: none; opacity: 0; transition: opacity 200ms ease-out;
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', sans-serif;
  color: #1c1c1e;
}
#dcDestinationSheet.dc-sheet[aria-hidden="false"] { pointer-events: auto; opacity: 1; }
#dcDestinationSheet .dc-sheet-backdrop {
  position: absolute; inset: 0; background: rgba(20,20,22,0.28);
  -webkit-backdrop-filter: saturate(120%) blur(1.5px); backdrop-filter: saturate(120%) blur(1.5px);
}
#dcDestinationSheet .dc-sheet-panel {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: #f4f4f5;                        /* Apple system light-gray */
  border-radius: 14px 14px 0 0;
  padding: 6px 14px calc(14px + env(safe-area-inset-bottom, 0px));
  max-width: 620px; margin: 0 auto;
  /* --dc-drag is 0 when open; the drag handler sets it to the live finger
   * offset (px, >=0) so the panel tracks the thumb 1:1 while dragging. */
  --dc-drag: 24px;
  transform: translateY(var(--dc-drag));
  transition: transform 300ms cubic-bezier(0.22, 1, 0.36, 1);
  border-top: 1px solid #e3e3e6;
  box-shadow: 0 -6px 28px rgba(20,20,22,0.16);
  /* COMPASS-COMPRESS-V1 (Roughy device 2026-07-28: "a lot of wasted space on
   * it"). The panel used to hard-claim height:92dvh so two folder rows painted a
   * near-full-screen sheet of dead space. Size to CONTENT instead, capped at
   * 92dvh so a deep folder list still scrolls — the same content-sizing the
   * desktop breakpoint below already uses. The taut, only-as-tall-as-needed feel
   * is the piano-keys direction. */
  height: auto; max-height: 92dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
/* While the thumb is down we kill the transition so the panel is glued to the
 * finger; JS adds .is-dragging on pointerdown and removes it on release. */
#dcDestinationSheet .dc-sheet-panel.is-dragging { transition: none; }
#dcDestinationSheet.dc-sheet[aria-hidden="false"] .dc-sheet-panel { --dc-drag: 0px; }
/* The grab bar is a real handle now — a wide, obvious thumb target at the top
 * of the panel that the drag listener binds to (and the whole header, so a
 * thumb landing anywhere up top can pull). */
#dcDestinationSheet .dc-sheet-handle {
  width: 40px; height: 5px; background: #c3c3c7;
  border-radius: 3px; margin: 8px auto 12px;
  flex: 0 0 auto;
}
@media (min-width: 768px) {
  /* WHERE-TO-CENTER-V1 (Roughy device 2026-07-28: "raise up and center... stuff
   * getting cut off at the bottom"). The bottom-anchored sheet felt marooned on
   * a wide viewport and its footer fell off the bottom edge. Float it as a
   * centered modal, sized to content, capped so a deep tree still scrolls inside. */
  #dcDestinationSheet .dc-sheet-panel {
    bottom: auto; top: 50%; left: 50%; right: auto;
    transform: translate(-50%, -50%);
    border-radius: 16px; border-top: none;
    box-shadow: 0 24px 64px rgba(20,20,22,0.22);
    height: auto; max-height: 84vh; width: min(560px, calc(100vw - 32px));
    padding: 8px 18px 16px;
  }
  #dcDestinationSheet.dc-sheet[aria-hidden="false"] .dc-sheet-panel { transform: translate(-50%, -50%); }
  #dcDestinationSheet .dc-sheet-handle { display: none; }
}
#dcDestinationSheet .dc-sheet-close-x {
  position: absolute; top: 12px; right: 12px;
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  background: #f3f1ea; border: 1px solid #e8e6df; border-radius: 50%;
  color: #404040; font-size: 18px; line-height: 1; cursor: pointer;
  -webkit-tap-highlight-color: transparent; z-index: 2;
  transition: background 140ms, transform 100ms;
  -webkit-appearance: none; appearance: none; padding: 0;
}
#dcDestinationSheet .dc-sheet-close-x:hover { background: #e8e6df; }
#dcDestinationSheet .dc-sheet-close-x:active { transform: scale(0.94); }
#dcDestinationSheet .dc-sheet-title {
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', sans-serif;
  font-size: 15px; font-weight: 600; letter-spacing: -0.01em;
  margin: 0 0 2px; color: #1c1c1e; text-align: center;
}
#dcDestinationSheet .dc-sheet-sub {
  font-size: 12px; color: #8e8e93; margin: 0 0 8px; text-align: center;
}

#dcDestinationSheet .dc-dest-path {
  display: flex; gap: 4px; align-items: center; flex-wrap: wrap;
  padding: 8px 0; font-size: 12px; color: #8a8a85;
  border-bottom: 1px solid #d4cdb8; margin-bottom: 8px;
}
#dcDestinationSheet .dc-dest-crumb {
  background: transparent; border: 1px solid transparent; border-radius: 4px;
  padding: 2px 8px; cursor: pointer; font: inherit; color: #8a8a85;
  white-space: nowrap; max-width: 12ch; overflow: hidden; text-overflow: ellipsis;
}
#dcDestinationSheet .dc-dest-crumb:hover,
#dcDestinationSheet .dc-dest-crumb:focus { background: rgba(0,0,0,0.04); outline: none; }
#dcDestinationSheet .dc-dest-crumb.is-current { color: #333; font-weight: 500; }
#dcDestinationSheet .dc-dest-crumb-sep { color: #8a8a85; flex-shrink: 0; }

/* CLAIM-THE-SCREEN: the body is the flex-grow region and takes ALL remaining
 * panel height (was capped at 50vh — the "cramped little bottom"). One thumb
 * roll now scrolls the whole tier tree. -webkit-overflow-scrolling gives the
 * momentum/rubber-band that makes the piano-key roll feel native. */
#dcDestinationSheet .dc-dest-body {
  display: flex; flex-direction: column; gap: 1px;
  flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 2px 0 4px;
  -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
}
#dcDestinationSheet .dc-dest-loading,
#dcDestinationSheet .dc-dest-empty {
  text-align: center; color: #8e8e93; padding: 16px 8px; font-size: 13px;
}
/* Apple-menu row: tight, near-black on light, thin hairline separators, a
 * crisp active-fill on press. 44px min for a confident thumb. */
#dcDestinationSheet .dc-dest-row {
  display: flex; align-items: center; gap: 10px; padding: 9px 8px;
  min-height: 44px; border-radius: 8px;
  background: transparent; border: 0; box-shadow: inset 0 -0.5px 0 #e6e6e9;
  cursor: pointer; font: inherit; text-align: left; width: 100%; color: #1c1c1e;
  font-size: 15px; letter-spacing: -0.01em;
}
#dcDestinationSheet .dc-dest-row:last-child { box-shadow: none; }
#dcDestinationSheet .dc-dest-row:hover,
#dcDestinationSheet .dc-dest-row:focus,
#dcDestinationSheet .dc-dest-row:active {
  background: rgba(0,0,0,0.06); outline: none;
}
#dcDestinationSheet .dc-dest-row-glyph { font-size: 18px; flex-shrink: 0; width: 22px; text-align: center; }
#dcDestinationSheet .dc-dest-row-text {
  flex: 1 1 auto; min-width: 0; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}
#dcDestinationSheet .dc-dest-row-meta { font-size: 11px; color: #8a8a85; }
#dcDestinationSheet .dc-dest-row-chevron { color: #8a8a85; flex-shrink: 0; font-size: 16px; }
/* View mode: the chevron is a DRILL tap target (open the folder) distinct
   from the row body (go there). Give it a real hit area + a subtle bezel
   so it reads as "there's more inside." (DC final-tuneup 2026-07-07) */
#dcDestinationSheet.is-view-mode .dc-dest-row-chevron.is-drill {
  min-width: 44px; align-self: stretch;
  display: flex; align-items: center; justify-content: center;
  margin: -10px -12px -10px 4px; padding: 0 12px;
  font-size: 20px; color: #667eea;
  border-left: 1px solid #eceae3;
  border-top-right-radius: 12px; border-bottom-right-radius: 12px;
}
#dcDestinationSheet.is-view-mode .dc-dest-row-chevron.is-drill:hover,
#dcDestinationSheet.is-view-mode .dc-dest-row-chevron.is-drill:active {
  background: rgba(102,126,234,0.08);
}
/* View mode reads as navigation: the row body invites a tap-to-go. */
#dcDestinationSheet.is-view-mode .dc-dest-row { cursor: pointer; }
#dcDestinationSheet.is-view-mode .dc-dest-row-meta { color: #a3a29c; }
#dcDestinationSheet .dc-dest-row.is-leaf .dc-dest-row-chevron { color: #2d6a4f; }
#dcDestinationSheet .dc-dest-row.is-current-selection {
  background: rgba(45, 106, 79, 0.08); border-color: #2d6a4f;
}

#dcDestinationSheet .dc-dest-new {
  border-top: 1px solid #d4cdb8; padding-top: 12px; margin-top: 8px;
}
#dcDestinationSheet .dc-dest-new[hidden] { display: none; }
#dcDestinationSheet .dc-dest-new-strip { display: flex; gap: 8px; flex-wrap: wrap; }
#dcDestinationSheet .dc-dest-new-strip .dc-dest-create-btn {
  flex: 1 1 auto; min-height: 40px;
  border: 1px dashed #b9b19a; border-radius: 10px;
  background: transparent; color: #2d6a4f; font: inherit; font-weight: 600;
  cursor: pointer; padding: 8px 12px;
}
#dcDestinationSheet .dc-dest-new-strip .dc-dest-create-btn:active { background: rgba(45,106,79,.08); }
#dcDestinationSheet .dc-dest-new-form {
  display: flex; flex-direction: column; gap: 8px; margin-top: 8px;
}
#dcDestinationSheet .dc-dest-new-form[hidden] { display: none; }
#dcDestinationSheet .dc-dest-new-context { font-size: 13px; font-weight: 600; color: #404040; }
#dcDestinationSheet .dc-dest-new-error { font-size: 12px; color: #8b3621; }
#dcDestinationSheet .dc-dest-new-error[hidden] { display: none; }
#dcDestinationSheet .dc-dest-new-actions { display: flex; gap: 8px; justify-content: flex-end; }

#dcDestinationSheet .dc-dest-footer {
  border-top: 1px solid #d4cdb8; padding-top: 12px; margin-top: 12px;
}

#dcDestinationSheet .dc-input {
  /* 16px is LOAD-BEARING, not taste: iOS Safari auto-zooms the whole page
     when a focused input's font-size is under 16px and never zooms back —
     the 2026-07-10 field report ("fonts doubled, Create button off-screen")
     was exactly this. Do not shrink below 16px. */
  padding: 12px 14px; border: 1px solid #e8e6df; border-radius: 10px;
  font: inherit; font-size: 16px; background: #fafaf7; color: #1a1a1a; width: 100%;
  box-sizing: border-box;
}
#dcDestinationSheet .dc-btn {
  flex: 1; padding: 14px; border-radius: 10px; cursor: pointer;
  font-family: inherit; font-size: 15px; font-weight: 500;
  border: 1px solid #e8e6df; transition: background 140ms, border-color 140ms;
  -webkit-tap-highlight-color: transparent;
}
#dcDestinationSheet .dc-btn-secondary { background: transparent; color: #404040; }
#dcDestinationSheet .dc-btn-secondary:hover { background: #f3f1ea; }
#dcDestinationSheet .dc-btn-primary { background: #c8553d; border-color: #c8553d; color: white; }
#dcDestinationSheet .dc-btn-primary:hover { background: #8b3621; border-color: #8b3621; }
#dcDestinationSheet .dc-btn-tertiary {
  background: transparent; color: #404040; width: 100%; text-align: center;
}
#dcDestinationSheet .dc-btn-tertiary:hover { background: #f3f1ea; }

/* OR-UNION (2026-07-07): the gathered-places row in view mode. */
#dcDestMultiRow { display:flex; flex-wrap:wrap; gap:6px; padding:4px 0 8px; }
#dcDestinationSheet .dc-dest-multi-chip { background:#eef2ff; border:1px solid #c7d2fe; color:#3730a3; border-radius:999px; padding:6px 12px; font-size:13px; font-weight:600; cursor:pointer; }
#dcDestinationSheet .dc-dest-multi-add { background:transparent; border:1.5px dashed #b8b3a4; color:#6b675c; border-radius:999px; padding:6px 12px; font-size:13px; font-weight:600; cursor:pointer; min-height:36px; }
#dcDestinationSheet .dc-dest-multi-add:disabled { opacity:0.4; cursor:default; }

/* ────────────────────────────────────────────────────────────────────
   DC-DARK-SHEET-V1 — SUPERSEDED 2026-07-25 by COMPASS-PULLDOWN-V1.

   The 07-23 decision was "match the dark feed." Roughy 2026-07-25 overrode
   it explicitly: "it should look like a professional Apple menu … black on
   gray on light … good contrast, easy to read." A navigator you browse by
   feel needs maximum legibility, not feed-matching camouflage; a light,
   high-contrast menu that floats over the dimmed dark feed is the call.
   The dark PALETTE values below are flipped to Apple-light; the STRUCTURAL
   rules from this block (disambiguation sub-line, true-root layout, account
   styling) are kept as-is — only colour changed (Rule 42: supersede with a
   stated reason, don't silently delete).
   ──────────────────────────────────────────────────────────────────── */
#dcDestinationSheet.dc-sheet { color: #1c1c1e; }
#dcDestinationSheet .dc-sheet-title { color: #1c1c1e; }
#dcDestinationSheet .dc-sheet-sub,
#dcDestinationSheet .dc-dest-crumbs,
#dcDestinationSheet .dc-dest-crumb-sep,
#dcDestinationSheet .dc-dest-loading,
#dcDestinationSheet .dc-dest-row-meta { color: #8e8e93; }
#dcDestinationSheet .dc-dest-crumb { color: #3a3a3c; }
#dcDestinationSheet .dc-sheet-close-x {
  background: rgba(0,0,0,0.05); border: 1px solid rgba(0,0,0,0.08);
  color: #3a3a3c;
}
#dcDestinationSheet .dc-sheet-close-x:hover { background: rgba(0,0,0,0.09); }
#dcDestinationSheet .dc-dest-row { color: #1c1c1e; }
#dcDestinationSheet .dc-dest-row:active { background: rgba(0,0,0,0.06); }
#dcDestinationSheet .dc-dest-row-chevron { color: #c3c3c7; }
#dcDestinationSheet.is-view-mode .dc-dest-row-chevron.is-drill { color: #007aff; }
#dcDestinationSheet .dc-dest-row.is-leaf .dc-dest-row-chevron { color: #007aff; }
#dcDestinationSheet .dc-dest-row.is-current-selection {
  background: rgba(0,122,255,0.10); border-color: #007aff;
}
#dcDestinationSheet .dc-dest-new-input {
  background: #ffffff; border: 1px solid #d1d1d6; color: #1c1c1e;
}
#dcDestinationSheet .dc-dest-new-btn,
#dcDestinationSheet .dc-sheet-footer button {
  border: 1px solid #d1d1d6; color: #1c1c1e;
}

/* DISAMBIGUATION (Roughy: "it just gives me Mentawai Mentawai Mentawai —
   the same project three times, which is silly looking"). Three containers
   CAN legitimately share a name; the row has to carry enough to tell them
   apart. The meta line now holds tier + counts + age on its own line, so
   identical names stop rendering as identical rows. */
#dcDestinationSheet .dc-dest-row { align-items: flex-start; flex-wrap: wrap; }
#dcDestinationSheet .dc-dest-row-text {
  flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap;
}
#dcDestinationSheet .dc-dest-row-sub {
  flex: 1 0 100%; padding-left: 30px; margin-top: 2px;
  font-size: 11px; color: #8e8e93;
}
/* Crumb chain must never truncate mid-word into "Mentaw" — let it wrap and
   keep every level tappable. */
#dcDestinationSheet .dc-dest-crumbs { flex-wrap: wrap; row-gap: 2px; }
#dcDestinationSheet .dc-dest-crumb { max-width: 46vw; overflow: hidden; text-overflow: ellipsis; }

/* GHOST-PILL-V1: these three were the only UNSCOPED rules in this file, which
   is how a stray pill could paint anywhere on the page. Scoped above; recoloured
   here for the dark sheet. */
#dcDestinationSheet .dc-dest-multi-chip {
  background: rgba(0,122,255,0.10); border-color: rgba(0,122,255,0.35); color: #007aff;
}
#dcDestinationSheet .dc-dest-multi-add {
  border: 1.5px dashed #c3c3c7; color: #6c6c70;
}

/* ── SYSTEM-ROOT-TIER-V1 UI (Roughy 2026-07-24) ────────────────────────────
   "Morgan is superadmin. Is there a reason why I can't see the root of the
   entire PSP system per the design?" — the backend shipped and nothing called
   it. This is the entry point: one row above your own root, for a session the
   SERVER agrees may stand there.

   Styled as a tier ABOVE, not a sibling: accent rule beneath it separates it
   from your own containers, so it reads as "up a level", not "another folder". */
#dcDestinationSheet .dc-dest-row-trueroot {
  border-bottom: 1px solid rgba(0,122,255,0.30);
  margin-bottom: 6px;
}
#dcDestinationSheet .dc-dest-row-trueroot .dc-dest-row-text { font-weight: 700; }
#dcDestinationSheet .dc-dest-row-trueroot .dc-dest-row-meta,
#dcDestinationSheet .dc-dest-row-trueroot .dc-dest-row-chevron {
  color: #007aff;
}
/* An account is a place you walk into, never a filing destination. */
#dcDestinationSheet .dc-dest-row.is-account .dc-dest-row-meta {
  color: #8e8e93;
}

/* C12 LENS-HONESTY-V1 (2026-07-24): the tree does not obey the feed's lens, and
   says so rather than letting the two disagree in silence. Styled as a NOTE,
   not an error — nothing is wrong, the user is simply owed the difference. */
.dc-dest-narrow-note {
  margin: 0 0 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  background: rgba(0,122,255,0.07);
  border: 1px solid rgba(0,122,255,0.22);
  color: #48484a;
  font-size: 0.8125rem;
  line-height: 1.35;
}
