/* THEON // CLOUD — quiet-cyber register.
   Warm-black ground, hairline rules, mono voice, one chartreuse accent.
   No glow, no bloom, no backdrop-blur. State reads as brightness and border. */

:root {
  --bg-deep: #14110f;
  --bg: #1a1614;
  --surface: #231f1d;
  --surface-2: #2a2522;
  --surface-3: #322c28;
  --ink: #e8e3dd;
  --ink-mid: #a89e8f;
  --ink-faint: #7a7268;
  --ink-dim: #524a44;
  --rule: #2d2825;
  --rule-soft: #25201d;
  --accent: #d4ff3d;
  --accent-soft: rgba(212, 255, 61, 0.12);
  --warn: #ff8866;
  --info: #7ad7ff;
  --mono: 'JetBrains Mono', 'Geist Mono', 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 22px; --sp-6: 32px;
  --bar-h: 46px;
  --side-w: 220px;
  --detail-w: 350px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; height: 100%;
  background: var(--bg-deep);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

:where(button, input, textarea, a):focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 2px;
}

::selection { background: var(--accent); color: #14110f; }

/* scrollbars stay part of the chrome, not an OS intrusion */
* { scrollbar-width: thin; scrollbar-color: var(--surface-3) transparent; }
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 0; }
*::-webkit-scrollbar-track { background: transparent; }

/* ── the mark: the official THEON.<< wordmark SVG ───────────────────────── */
/* Sized by height; the SVG's own 529.91 x 86.42 viewBox carries the ratio, so
   there is no CSS-drawn approximation of the brand to drift out of sync. */
.mark { margin: 0; line-height: 0; flex: 0 0 auto; }
.mark img { display: block; width: auto; }
.mark-bar img { height: 15px; }
.mark-gate img { height: 26px; }

/* ── gate ───────────────────────────────────────────────────────────────── */
.gate {
  position: fixed; inset: 0; display: grid; place-items: center;
  background: var(--bg-deep); padding: var(--sp-4);
}
.gate-card {
  width: min(340px, 100%);
  border: 1px solid var(--rule);
  background: var(--bg);
  padding: var(--sp-6) var(--sp-5) var(--sp-5);
  display: flex; flex-direction: column; gap: var(--sp-3);
}
.gate-card .mark { margin-bottom: 2px; }
.gate-sub {
  margin: -10px 0 var(--sp-4);
  color: var(--ink-faint); letter-spacing: 0.34em; font-size: 11px;
}
.field { display: flex; flex-direction: column; gap: var(--sp-1); }
.field span { color: var(--ink-faint); font-size: 11px; letter-spacing: 0.14em; }
.field input {
  background: var(--bg-deep); border: 1px solid var(--rule);
  padding: 9px 11px; outline: none;
}
.field input:focus { border-color: var(--accent); }
.gate-err { color: var(--warn); font-size: 11px; min-height: 15px; margin: 0; }
.gate-note { margin: 0 0 var(--sp-2); color: var(--ink-mid); font-size: 12px; line-height: 1.5; }
.gate-enter { justify-content: center; text-decoration: none; padding: 9px 11px; }

/* ── buttons ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--surface); border: 1px solid var(--rule);
  color: var(--ink); padding: 6px 11px;
  letter-spacing: 0.1em; font-size: 11px;
  transition: border-color 90ms steps(2), background 90ms steps(2);
}
.btn:hover { border-color: var(--ink-dim); background: var(--surface-2); }
.btn-accent { background: var(--accent); color: #14110f; border-color: var(--accent); font-weight: 600; }
.btn-accent:hover { background: #c2ee2a; border-color: #c2ee2a; }
.btn-danger:hover { border-color: var(--warn); color: var(--warn); }

.icon-btn {
  display: grid; place-items: center;
  width: 30px; height: 28px;
  background: none; border: 1px solid transparent; color: var(--ink-mid);
}
.icon-btn:hover { color: var(--ink); border-color: var(--rule); }

.mini {
  background: none; border: 1px solid var(--rule); color: var(--ink-faint);
  width: 18px; height: 18px; line-height: 1; display: grid; place-items: center;
  font-size: 13px;
}
.mini:hover { color: var(--accent); border-color: var(--accent); }

.link-btn {
  background: none; border: none; color: var(--ink-faint);
  padding: var(--sp-2) 0; text-align: left; font-size: 11px; letter-spacing: 0.1em;
}
.link-btn:hover { color: var(--accent); }

/* ── layout ─────────────────────────────────────────────────────────────── */
.app { display: flex; flex-direction: column; height: 100dvh; }

.bar {
  display: flex; align-items: center; gap: var(--sp-3);
  height: var(--bar-h); flex: 0 0 auto;
  padding: 0 var(--sp-3);
  border-bottom: 1px solid var(--rule);
  background: var(--bg);
  padding-top: env(safe-area-inset-top);
  height: calc(var(--bar-h) + env(safe-area-inset-top));
}
.bar-organ {
  color: var(--ink-faint); font-size: 10px; letter-spacing: 0.3em;
  border-left: 1px solid var(--rule); padding-left: var(--sp-3);
}
.workspace-btn {
  border: 1px solid var(--rule);
  background: transparent;
  color: var(--ink-mid);
  padding: 5px 9px;
  font-size: 10px;
  letter-spacing: .16em;
}
.workspace-btn:hover,
body.documents-active .workspace-btn { color: var(--accent); border-color: var(--accent); }

.search {
  flex: 1 1 auto; max-width: 520px; margin-left: auto;
  display: flex; align-items: center; gap: var(--sp-2);
  background: var(--bg-deep); border: 1px solid var(--rule);
  padding: 5px 9px; color: var(--ink-faint);
}
.search:focus-within { border-color: var(--accent); color: var(--ink-mid); }
.search input {
  flex: 1; background: none; border: none; outline: none; color: var(--ink);
  min-width: 0;
}
.search input::placeholder { color: var(--ink-dim); }
.search kbd {
  border: 1px solid var(--rule); padding: 0 5px; font-size: 10px; color: var(--ink-dim);
}

.body { flex: 1 1 auto; display: flex; min-height: 0; }

/* sidebar */
.side {
  width: var(--side-w); flex: 0 0 auto;
  border-right: 1px solid var(--rule);
  background: var(--bg);
  overflow-y: auto; overflow-x: hidden;
  display: flex; flex-direction: column;
  padding-bottom: env(safe-area-inset-bottom);
}
.side-block { padding: var(--sp-3); border-bottom: 1px solid var(--rule-soft); }
.side-foot { margin-top: auto; border-bottom: none; }
.side-head {
  display: flex; align-items: center; justify-content: space-between;
  color: var(--ink-dim); font-size: 10px; letter-spacing: 0.24em;
  margin-bottom: var(--sp-2);
}

.folders, .kinds { list-style: none; margin: 0; padding: 0; }
.folders li > button, .kinds li > button {
  width: 100%; display: flex; align-items: center; gap: var(--sp-2);
  background: none; border: none; border-left: 2px solid transparent;
  color: var(--ink-mid); padding: 4px var(--sp-2); text-align: left;
  font-size: 12px;
}
.folders li > button:hover, .kinds li > button:hover { color: var(--ink); background: var(--surface); }
.folders li > button.on, .kinds li > button.on {
  color: var(--accent); border-left-color: var(--accent); background: var(--accent-soft);
}
.folders .n, .kinds .n { margin-left: auto; color: var(--ink-dim); font-size: 10px; }
.folders .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.stat { margin: 0; font-size: 11px; color: var(--ink-faint); }
.stat div { display: flex; justify-content: space-between; gap: var(--sp-2); padding: 1px 0; }
.stat dt { color: var(--ink-dim); }
.stat dd { margin: 0; color: var(--ink-mid); }
.stat .em { color: var(--accent); }

/* main */
.main { flex: 1 1 auto; min-width: 0; overflow-y: auto; padding: var(--sp-3) var(--sp-4) var(--sp-6); }

.crumbs {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  color: var(--ink-faint); font-size: 11px; margin-bottom: var(--sp-2); min-height: 17px;
}
.crumbs button { background: none; border: none; color: var(--ink-mid); padding: 0; }
.crumbs button:hover { color: var(--accent); }
.crumbs .crumb-exit {
  min-height: 28px; padding: 4px 9px;
  border: 1px solid var(--rule); color: var(--accent);
  letter-spacing: .12em; font-size: 10px;
}
.crumbs .crumb-exit:hover { border-color: var(--accent); background: var(--accent-soft); }
.crumbs .sep { color: var(--ink-dim); }
.crumbs .cur { color: var(--ink); }

.toolbar {
  display: flex; align-items: center; gap: var(--sp-3);
  padding-bottom: var(--sp-3); border-bottom: 1px solid var(--rule-soft);
  margin-bottom: var(--sp-3); flex-wrap: wrap;
}
.seg { display: flex; border: 1px solid var(--rule); }
.seg button {
  background: none; border: none; color: var(--ink-faint);
  padding: 4px 10px; font-size: 10px; letter-spacing: 0.14em;
}
.seg button + button { border-left: 1px solid var(--rule); }
.seg button.on { color: var(--accent); background: var(--accent-soft); }
.count { margin-left: auto; color: var(--ink-dim); font-size: 11px; }
.folder-create-btn { min-height: 29px; }

/* ── grid ───────────────────────────────────────────────────────────────── */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(206px, 1fr));
  gap: var(--sp-3);
}

.tile {
  position: relative; display: flex; flex-direction: column;
  background: var(--bg); border: 1px solid var(--rule);
  overflow: hidden; text-align: left; padding: 0;
  transition: border-color 90ms steps(2);
}
.tile-open {
  display: flex; flex-direction: column; flex: 1; min-width: 0;
  padding: 0; border: 0; background: transparent; color: inherit; text-align: left;
}
.tile:hover { border-color: var(--ink-dim); }
.tile.sel { border-color: var(--accent); }
.tile:focus-visible { outline: 1px solid var(--accent); outline-offset: 1px; }

.tile .shot {
  position: relative; aspect-ratio: 4 / 3; background: var(--bg-deep);
  display: grid; place-items: center; overflow: hidden; width: 100%; flex: 0 0 auto;
}
.tile .shot img {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover; display: block;
  opacity: 0; transition: opacity 140ms steps(3);
}
.tile .shot img.art { object-fit: contain; padding: 10px; }
.tile .shot img.in { opacity: 1; }
.tile .glyph { color: var(--ink-dim); font-size: 10px; letter-spacing: 0.2em; }

.badge {
  position: absolute; right: 5px; bottom: 5px;
  background: rgba(20, 17, 15, 0.86); border: 1px solid var(--rule);
  color: var(--ink-mid); font-size: 9px; letter-spacing: 0.1em; padding: 1px 4px;
}
.badge.kind { left: 5px; right: auto; }

.tile .meta { padding: 6px 8px 7px; border-top: 1px solid var(--rule-soft); min-width: 0; }
.tile .nm {
  color: var(--ink); font-size: 11px; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; display: block;
}
.tile .sub { color: var(--ink-dim); font-size: 10px; display: flex; gap: 6px; }
.tile-more {
  position: absolute; top: 7px; right: 7px; z-index: 2;
  width: 30px; height: 30px; display: grid; place-items: center;
  border: 1px solid var(--rule); background: rgba(20, 17, 15, 0.9);
  color: var(--ink-mid); padding: 0;
}
.tile-more:hover { color: var(--accent); border-color: var(--accent); }

/* The pick target. Same 30px square as the details door, mirrored to the other
   corner, and present at every width: a phone has no hover, so an affordance
   revealed by hover is an affordance a phone does not have. */
.tile-pick {
  position: absolute; top: 7px; left: 7px; z-index: 2;
  width: 30px; height: 30px; display: grid; place-items: center;
  border: 1px solid var(--rule); background: rgba(20, 17, 15, 0.9);
  color: var(--ink-mid); padding: 0; font-size: 12px; line-height: 1;
  transition: color 90ms steps(2), background 90ms steps(2), border-color 90ms steps(2);
}
.tile-pick:hover { color: var(--accent); border-color: var(--accent); }
/* Picked reads as fill, selected reads as border. They are different questions
   ("act on these" against "show me this") and one tile can be both at once. */
.tile.picked { border-color: var(--accent); background: var(--accent-soft); }
.tile.picked .tile-pick {
  color: #14110f; background: var(--accent); border-color: var(--accent);
  /* A hairline, not a glow: picked paints the control chartreuse, and over a
     photograph that happens to be pale the whole box would otherwise dissolve
     into the image and leave a tick floating on nothing. */
  box-shadow: inset 0 0 0 1px rgba(20, 17, 15, 0.55);
}
.grid.list .tile-pick {
  position: static; flex: 0 0 auto; margin: 0 var(--sp-2) 0 var(--sp-1);
}

/* The move bar, below the toolbar so its appearance never reflows the sort and
   view segments out from under a finger already on its way to one. */
.pickbar {
  display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap;
  margin-bottom: var(--sp-3); padding: var(--sp-2) var(--sp-3);
  border: 1px solid var(--accent); background: var(--accent-soft);
}
.pickbar-count {
  color: var(--accent); font-size: 10px; letter-spacing: .18em; margin-right: auto;
}

/* ── the destination picker ─────────────────────────────────────────────── */
.move-filter { margin-bottom: var(--sp-3); }
.move-list {
  display: flex; flex-direction: column;
  max-height: min(38vh, 300px); overflow-y: auto;
  border: 1px solid var(--rule);
}
.move-row {
  display: flex; align-items: baseline; gap: var(--sp-3);
  width: 100%; min-height: 32px; padding: 7px 10px;
  border: 0; border-bottom: 1px solid var(--rule-soft);
  background: transparent; color: var(--ink-mid);
  font-size: 11px; text-align: left;
}
.move-row:last-child { border-bottom: 0; }
.move-row:hover:not(:disabled) { color: var(--ink); background: var(--surface); }
.move-row.on { color: var(--accent); background: var(--accent-soft); }
.move-row:disabled { color: var(--ink-dim); cursor: not-allowed; }
.move-row-name { min-width: 0; overflow-wrap: anywhere; }
.move-row-meta { margin-left: auto; flex: 0 0 auto; color: var(--ink-faint); font-size: 9px; }

/* A destination a share link already reaches. The mark sits on the right of the
   row, in the accent, because it is the one thing about a folder that changes
   what moving a file there MEANS. */
.move-row-link {
  margin-left: 8px;
  padding: 1px 5px;
  font-size: 10px;
  letter-spacing: 0.08em;
  /* Dark on the accent, the same as a picked tick. The page ink is near-white,
     and near-white on chartreuse is a shape where a word should be. */
  color: var(--bg-deep);
  background: var(--accent);
  border-radius: 2px;
}
.move-warn {
  margin: 8px 0 0;
  padding: 8px 10px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--accent-soft);
  border-left: 2px solid var(--accent);
}
.move-new { margin-top: var(--sp-3); }

/* The share door. A verb across the foot of the folder tile, because the
   gesture people actually make on a folder is "open it", and the glyph in the
   corner was carrying the one action this product exists for. */
.tile-share {
  width: 100%; min-height: 32px; padding: 8px;
  border: 0; border-top: 1px solid var(--rule-soft);
  background: var(--surface); color: var(--ink-mid);
  font-size: 10px; letter-spacing: 0.16em; text-align: center;
  transition: color 90ms steps(2), background 90ms steps(2);
}
.tile-share:hover { color: var(--accent); background: var(--accent-soft); }
.tile-share:focus-visible { outline: 1px solid var(--accent); outline-offset: -2px; }

/* A refusal has to look like one. Nothing in this sheet styled :disabled, so a
   button that had stopped responding looked exactly like one that had not. */
.btn:disabled {
  color: var(--ink-faint); background: transparent; cursor: not-allowed;
}
.btn:disabled:hover { border-color: var(--rule); background: transparent; }
/* `.btn:disabled` overrides the accent's colour and background but never set
   its BORDER, so a disabled accent button sat there wearing the lit chartreuse
   frame: the picker's MOVE looked like the primary action while it refused
   every click. A refusal has to look like one on both halves of the paint. */
.btn-accent:disabled { border-color: var(--rule); }

.folder-tile { border-color: var(--rule); }
.folder-tile:hover { border-color: var(--accent); }
.folder-shot { background: var(--surface); }
.folder-icon,
.tile .shot img.folder-icon {
  position: static; inset: auto;
  display: block; width: 78px; height: auto; opacity: .92;
  object-fit: contain;
  transition: opacity 90ms steps(2), transform 90ms steps(2);
}
.folder-tile:hover .folder-icon { opacity: 1; transform: translateY(-1px); }
.folder-creator { border-color: var(--accent); }
.folder-creator-body { padding: var(--sp-3); border-top: 1px solid var(--rule-soft); }
.folder-creator-body .d-label { display: grid; gap: var(--sp-1); margin: 0; }
.folder-creator-actions {
  display: flex; justify-content: flex-end; gap: var(--sp-2); margin-top: var(--sp-3);
}

.load-more {
  display: block; width: min(320px, 100%); min-height: 42px;
  margin: var(--sp-5) auto 0; background: var(--bg);
  border: 1px solid var(--rule); color: var(--ink-mid);
  letter-spacing: .18em; font-size: 10px;
}
.load-more:hover { color: var(--accent); border-color: var(--accent); }

/* list view */
.grid.list { display: block; }
.grid.list .tile, .grid.list .tile-open { flex-direction: row; align-items: center; }
.grid.list .tile { border-left: none; border-right: none; border-top: none; }
.grid.list .tile + .tile { margin-top: 0; }
.grid.list .shot { width: 52px; height: 52px; aspect-ratio: 1; flex: 0 0 auto; }
.grid.list .meta { border: none; flex: 1; display: flex; align-items: center; gap: var(--sp-3); }
.grid.list .sub { margin-left: auto; }
.grid.list .badge { display: none; }
.grid.list .folder-icon,
.grid.list .shot img.folder-icon { width: 36px; height: auto; }
/* The share door is a full-width foot in the grid and a column in the row. An
   unscoped `width: 100%` here would fight the row for the whole line, which is
   the mirror image of the rule that once collapsed every photograph to 54px. */
.grid.list .tile-share {
  width: auto; flex: 0 0 auto; align-self: stretch;
  min-width: 84px; margin-right: 44px;
  border-top: 0; border-left: 1px solid var(--rule-soft);
}
.grid.list .folder-creator { align-items: stretch; }
.grid.list .folder-creator-body {
  flex: 1; display: flex; align-items: end; gap: var(--sp-2); border-top: 0;
}
.grid.list .folder-creator-body .d-label { flex: 1; }
.grid.list .folder-creator-actions { margin-top: 0; }

.empty {
  padding: var(--sp-6) 0; text-align: center; color: var(--ink-dim);
  font-size: 11px; letter-spacing: 0.14em;
}

/* ── detail ─────────────────────────────────────────────────────────────── */
.detail {
  width: var(--detail-w); flex: 0 0 auto;
  border-left: 1px solid var(--rule); background: var(--bg);
  overflow-y: auto; padding: var(--sp-3);
  padding-bottom: calc(var(--sp-6) + env(safe-area-inset-bottom));
}
.scrim {
  position: fixed; inset: 0; border: 0; padding: 0;
  background: rgba(10, 8, 7, 0.72);
}
.detail-scrim { z-index: 79; }
.side-scrim { z-index: 74; }
.detail h2 {
  font-size: 12px; margin: 0 0 var(--sp-2); word-break: break-all; line-height: 1.35;
}
.d-head { display: flex; align-items: flex-start; gap: var(--sp-2); }
.d-head .icon-btn { margin-left: auto; flex: 0 0 auto; }
.d-shot {
  width: 100%; background: var(--bg-deep); border: 1px solid var(--rule);
  margin-bottom: var(--sp-3); display: block; aspect-ratio: 4/3; object-fit: contain;
}
.d-shot.zoomable { cursor: zoom-in; }
body.lightbox-open { overflow: hidden; }
.d-rows { font-size: 11px; margin: 0 0 var(--sp-3); }
.d-rows div { display: flex; gap: var(--sp-2); padding: 2px 0; border-bottom: 1px solid var(--rule-soft); }
.d-rows dt { color: var(--ink-dim); flex: 0 0 74px; }
.d-rows dd { margin: 0; color: var(--ink-mid); word-break: break-all; flex: 1; min-width: 0; }
/* Device rows stay one line: an unparsed user-agent must not become a wall. */
.d-rows dd.one-line { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; word-break: normal; }

.d-label { color: var(--ink-dim); font-size: 10px; letter-spacing: 0.2em; margin: var(--sp-3) 0 var(--sp-1); }
.d-none { color: var(--ink-dim); font-size: 11px; margin: 0 0 var(--sp-2); }
.d-input, .d-area {
  width: 100%; background: var(--bg-deep); border: 1px solid var(--rule);
  color: var(--ink); padding: 6px 8px; outline: none; font-size: 11px;
}
.d-input:focus, .d-area:focus { border-color: var(--accent); }
.d-area { resize: vertical; min-height: 54px; }

.copyrow { display: flex; gap: 0; align-items: stretch; }
.copyrow .d-input { border-right: none; font-size: 10px; }
.copyrow button { border: 1px solid var(--rule); background: var(--surface); color: var(--ink-mid); padding: 0 9px; font-size: 10px; }
.copyrow button:hover { color: var(--accent); border-color: var(--accent); }

.d-acts { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-top: var(--sp-4); }
.folder-detail-mark {
  min-height: 136px; margin-bottom: var(--sp-3); border: 1px solid var(--rule);
  background: var(--surface); display: grid; place-items: center;
  align-content: center; gap: var(--sp-3); color: var(--ink-dim);
  font-size: 9px; letter-spacing: .2em;
}
.folder-detail-mark .folder-icon { width: 84px; opacity: 1; }
.folder-share-options {
  display: grid; grid-template-columns: minmax(0, 1fr) 118px; gap: var(--sp-2);
}
.folder-share-options label { display: grid; gap: var(--sp-1); }
.folder-share-options label > span {
  color: var(--ink-dim); font-size: 9px; letter-spacing: .14em;
}
.folder-created-link:empty, .folder-share-list:empty { display: none; }
.folder-share-list { margin-top: var(--sp-4); }
.folder-share-row {
  display: flex; align-items: stretch; border: 1px solid var(--rule);
  background: var(--bg-deep);
}
.folder-share-row + .folder-share-row { border-top: 0; }
.folder-share-copy {
  min-width: 0; flex: 1; display: grid; gap: 1px; text-align: left;
  padding: 8px; border: 0; background: none;
}
.folder-share-copy .nm { color: var(--ink-mid); font-size: 10px; letter-spacing: .12em; }
.folder-share-copy .sub { color: var(--ink-dim); font-size: 9px; }
.folder-share-copy:hover .nm { color: var(--accent); }
.folder-share-row .mini {
  width: 38px; height: auto; border: 0; border-left: 1px solid var(--rule);
}
/* ── the client's list, as the owner reads it ───────────────────────────── */
/* The panel is a sibling of its row, not a child, so the rows keep collapsing
   their shared borders. Both adjacencies have to be named or a panel leaves a
   double hairline behind it. */
.pick-panel + .folder-share-row, .folder-share-row + .pick-panel { border-top: 0; }
.pick-panel {
  border: 1px solid var(--rule); border-top: 0; background: var(--bg-deep);
}
.pick-panel-toggle {
  width: 100%; border: 0; background: none; text-align: left;
  padding: 7px 8px; color: var(--ink-faint);
  font: inherit; font-size: 9px; letter-spacing: .14em;
}
.pick-panel-toggle:hover { color: var(--accent); }
.pick-panel-body { padding: 0 8px 8px; }
.pick-group {
  margin: 0 0 var(--sp-1); font-size: 9px; letter-spacing: .14em;
  color: var(--ink-dim); border-bottom: 1px solid var(--rule-soft); padding-bottom: 3px;
}
.pick-row {
  display: flex; align-items: center; gap: var(--sp-2);
  padding: 3px 0; min-height: 34px; cursor: pointer;
}
.pick-row input { width: 14px; height: 14px; flex: 0 0 auto; accent-color: var(--accent); }
.pick-shot {
  width: 34px; height: 34px; flex: 0 0 auto; overflow: hidden;
  background: var(--surface); border: 1px solid var(--rule);
  display: flex; align-items: center; justify-content: center;
  font-size: 8px; letter-spacing: .08em; color: var(--ink-dim);
}
.pick-shot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pick-copy { min-width: 0; display: grid; gap: 1px; }
.pick-copy .nm {
  font-size: 10px; color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pick-copy .sub { font-size: 9px; color: var(--ink-dim); }
.pick-panel-tools { display: flex; gap: var(--sp-1); margin: var(--sp-2) 0; }
.pick-panel-tools .mini { width: auto; padding: 0 10px; height: 24px; }
.pick-panel-copy { display: grid; gap: var(--sp-1); }
.pick-panel-copy .btn { width: 100%; justify-content: center; font-size: 10px; }

/* ACCESS spans both columns in either block. The file block carries BOTH
   classes, so matching on .folder-share-options alone covers the pair. */
.folder-share-options > label:first-child, .folder-share-options > .share-check {
  grid-column: 1 / -1;
}
.folder-share-options label.share-check {
  display: flex; align-items: center; gap: 8px; min-height: 30px;
}
.share-check input { width: 15px; height: 15px; accent-color: var(--accent); }
.share-check-hint {
  grid-column: 1 / -1; margin: -2px 0 var(--sp-1);
  color: var(--ink-dim); font-size: 10px; line-height: 1.5;
}
.file-share-request {
  padding: 8px; border: 1px solid var(--rule); border-top: 0;
  background: var(--bg-deep);
}
.file-share-request .sub {
  display: block; margin: 0 0 6px; color: var(--ink-dim); font-size: 9px;
  overflow-wrap: anywhere;
}
.file-share-acts { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-top: var(--sp-1); }
.file-share-acts .mini {
  width: auto; height: auto; min-height: 30px; padding: 0 10px;
  font-size: 9px; letter-spacing: .14em;
}

.chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: var(--sp-1); }
.chip {
  border: 1px solid var(--rule); color: var(--ink-mid); padding: 1px 6px;
  font-size: 10px; background: none;
}
.chip:hover { border-color: var(--accent); color: var(--accent); }

/* ── readout: the one voice ─────────────────────────────────────────────── */
.readout {
  /* Offset past the sidebar: at the window edge it collided with the store
     readout and the AGENT ACCESS action. */
  position: fixed; left: calc(var(--side-w) + var(--sp-4));
  bottom: calc(var(--sp-3) + env(safe-area-inset-bottom));
  color: var(--ink-faint); font-size: 10px; letter-spacing: 0.16em;
  pointer-events: none; z-index: 60; max-width: 60vw;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.readout .k { color: var(--accent); }

/* ── upload dock ────────────────────────────────────────────────────────── */
.dock {
  position: fixed; right: var(--sp-3); bottom: calc(var(--sp-3) + env(safe-area-inset-bottom));
  width: min(300px, calc(100vw - 24px));
  background: var(--bg); border: 1px solid var(--rule);
  z-index: 70; max-height: 46vh; overflow-y: auto;
}
.dock-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 9px; border-bottom: 1px solid var(--rule-soft);
  color: var(--ink-faint); font-size: 10px; letter-spacing: 0.2em;
}
.up { padding: 6px 9px; border-bottom: 1px solid var(--rule-soft); font-size: 11px; }
.up:last-child { border-bottom: none; }
.up .nm { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-mid); }
.up progress.track {
  display: block; width: 100%; height: 2px; border: 0; border-radius: 0;
  appearance: none; background: var(--surface-2); margin-top: 4px;
}
.up progress.track::-webkit-progress-bar { background: var(--surface-2); }
.up progress.track::-webkit-progress-value { background: var(--accent); }
.up progress.track::-moz-progress-bar { background: var(--accent); }
.up.done progress.track::-webkit-progress-value { background: var(--ink-dim); }
.up.done progress.track::-moz-progress-bar { background: var(--ink-dim); }
.up.err .nm { color: var(--warn); }
.up .pct { float: right; color: var(--ink-dim); font-size: 10px; }
.up-actions { display: flex; gap: 6px; margin-top: 5px; }
.up-actions button {
  border: 0; background: none; padding: 0; color: var(--ink-faint);
  font-size: 9px; letter-spacing: .12em;
}
.up-actions button:hover { color: var(--accent); }

/* ── modal ─────────────────────────────────────────────────────────────── */
.modal {
  width: min(440px, calc(100vw - 28px)); padding: 0;
  border: 1px solid var(--rule); background: var(--bg); color: var(--ink);
}
.modal::backdrop { background: rgba(10, 8, 7, .86); }
.modal-card { padding: var(--sp-5); }
.modal-kicker {
  margin: 0 0 var(--sp-3); color: var(--accent);
  font-size: 9px; letter-spacing: .25em;
}
.modal h2 { margin: 0 0 var(--sp-2); font-size: 15px; font-weight: 500; }
.modal-body { color: var(--ink-mid); margin: 0 0 var(--sp-4); font-size: 12px; }
.modal-items {
  list-style: none; margin: 0; padding: 0;
  max-height: min(42vh, 360px); overflow-y: auto;
  border: 1px solid var(--rule);
}
.modal-items li {
  display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-3);
  min-width: 0; padding: 8px 10px; border-bottom: 1px solid var(--rule-soft);
  font-size: 11px;
}
.modal-items li:last-child { border-bottom: 0; }
.modal-item-name {
  min-width: 0; overflow-wrap: anywhere; color: var(--ink);
}
.modal-item-meta { flex: 0 0 auto; color: var(--ink-faint); font-size: 9px; }
.modal-actions {
  display: flex; justify-content: flex-end; gap: var(--sp-2); margin-top: var(--sp-5);
}

/* ── lightbox ───────────────────────────────────────────────────────────── */
.lightbox {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(10, 8, 7, 0.97);
  display: flex; align-items: center; justify-content: center;
}
.lb-stage {
  max-width: 100vw; max-height: 100dvh; display: grid; place-items: center;
  padding: 52px var(--sp-4);
  width: 100%; height: 100%;
}
.lb-stage img, .lb-stage video {
  max-width: 100%; max-height: calc(100dvh - 104px);
  object-fit: contain; display: block; background: #000;
}
.lb-stage pre {
  max-width: min(900px, 100%); max-height: calc(100dvh - 120px); overflow: auto;
  background: var(--bg); border: 1px solid var(--rule); padding: var(--sp-4);
  font-size: 12px; color: var(--ink-mid); white-space: pre-wrap; word-break: break-word;
  margin: 0; width: 100%;
}
.lb-stage .noview { color: var(--ink-faint); font-size: 11px; letter-spacing: 0.2em; text-align: center; }
.lb-stage .noview .btn { margin-top: var(--sp-4); }

.lb-close, .lb-nav {
  position: absolute; background: none; border: 1px solid transparent;
  color: var(--ink-mid); z-index: 2;
}
.lb-close { top: calc(var(--sp-3) + env(safe-area-inset-top)); right: var(--sp-3); width: 32px; height: 32px; font-size: 15px; }
.lb-nav { top: 50%; transform: translateY(-50%); width: 40px; height: 64px; font-size: 26px; }
.lb-prev { left: 4px; } .lb-next { right: 4px; }
.lb-close:hover, .lb-nav:hover { color: var(--accent); border-color: var(--rule); }

.lb-bar {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: var(--sp-2) var(--sp-4);
  padding-bottom: calc(var(--sp-2) + env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: var(--sp-3);
  border-top: 1px solid var(--rule); background: var(--bg);
  font-size: 11px; color: var(--ink-faint);
}
.lb-bar .nm { color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-bar .sp { margin-left: auto; display: flex; gap: var(--sp-3); align-items: center; }
.lb-bar a { color: var(--ink-mid); text-decoration: none; }
.lb-bar a:hover { color: var(--accent); }

/* ── drop veil ──────────────────────────────────────────────────────────── */
.veil {
  position: fixed; inset: 0; z-index: 90;
  border: 1px solid var(--accent);
  background: rgba(20, 17, 15, 0.9);
  display: grid; place-items: center;
  color: var(--accent); letter-spacing: 0.3em; font-size: 12px;
  pointer-events: none;
}

/* ── responsive ─────────────────────────────────────────────────────────── */
.only-narrow { display: none; }

@media (max-width: 900px) {
  .detail {
    position: fixed; right: 0; top: 0; bottom: 0; z-index: 80;
    width: min(340px, 100%); box-shadow: -1px 0 0 var(--rule);
    padding-top: calc(var(--sp-3) + env(safe-area-inset-top));
  }
}

@media (max-width: 720px) {
  .only-wide { display: none; }
  .only-narrow { display: grid; }
  .bar {
    display: grid; grid-template-columns: 44px auto 1fr 44px 44px;
    gap: var(--sp-2); padding: env(safe-area-inset-top) var(--sp-2) var(--sp-2);
    height: auto; min-height: calc(100px + env(safe-area-inset-top));
  }
  .bar .icon-btn, .bar .btn { width: 44px; height: 44px; padding: 0; justify-content: center; }
  .bar .search {
    grid-column: 1 / -1; grid-row: 2; width: 100%; max-width: none;
    min-height: 42px; margin: 0;
  }
  .bar-organ { display: none; }
  .workspace-btn {
    width: 44px; min-width: 44px; height: 44px; padding: 0;
    overflow: hidden; font-size: 0;
  }
  .workspace-btn::after { content: 'DOC'; font-size: 8px; letter-spacing: .06em; }
  body.documents-active .workspace-btn::after { content: 'FILES'; }
  .side {
    position: fixed; left: 0; top: 0; bottom: 0;
    z-index: 75; width: min(286px, 86vw); transform: translateX(-100%);
    transition: transform 120ms steps(3);
    padding-top: calc(var(--sp-4) + env(safe-area-inset-top));
  }
  .side.open { transform: translateX(0); }
  .main { padding: var(--sp-2) var(--sp-3) var(--sp-6); }
  /* A fixed floor, not a vw fraction: 46vw landed a hair over half the usable
     width on a 390px phone and collapsed the grid to a single column. */
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-2); }
  .search { min-width: 0; }
  .mark-bar img { height: 13px; }
  .readout { display: none; }
  .toolbar { gap: var(--sp-2); }
  .folder-create-btn { order: 3; width: 100%; justify-content: center; min-height: 38px; }
  .toolbar .seg button { min-height: 36px; padding-inline: 9px; }
  .detail { width: 100%; }
  .detail .icon-btn { width: 44px; height: 44px; }
  .tile .nm { font-size: 12px; }
  .tile .sub { display: block; }
  .tile .sub span:last-child { display: none; }
  .dock { left: var(--sp-2); right: var(--sp-2); width: auto; max-height: 58vh; }
  .lb-close { width: 44px; height: 44px; }
  .lb-nav { width: 44px; }
  .lb-bar { align-items: flex-start; }
  .lb-bar .sp { gap: var(--sp-2); }
}

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