@font-face {
  font-family: "IBM Plex Sans Variable";
  src: url("/admin/assets/fonts/ibm-plex-sans-latin.woff2") format("woff2");
  font-display: swap;
  font-weight: 100 700;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("/admin/assets/fonts/ibm-plex-mono-600-latin.woff2") format("woff2");
  font-display: swap;
  font-weight: 500 600;
}

:root {
  --bg: #f3f6f9;
  --card: #ffffff;
  --ink: #0a1b2d;
  --ink-soft: #3e5266;
  --muted: #62758a;
  --faint: #b7c3cf;
  --line: #e1e7ee;
  --line-soft: #eef2f6;
  --cyan: #0a9dff;
  --blue: #0b6fe0;
  --wash: #e6f4ff;
  --wash-strong: #d3ebff;
  --danger: #c43d4b;
  --notice-bg: #fff4e6;
  --notice-ink: #7a4a00;
  --shadow-card: 0 1px 0 rgba(10, 27, 45, .04), 0 18px 36px -24px rgba(10, 27, 45, .28);
  --shadow-lift: 0 1px 0 rgba(10, 27, 45, .04), 0 28px 48px -24px rgba(10, 27, 45, .38);
  --shadow-sheet: 0 40px 100px -30px rgba(10, 27, 45, .5);
  --body: "IBM Plex Sans Variable", "Segoe UI", system-ui, sans-serif;
  --data: "IBM Plex Mono", ui-monospace, Consolas, monospace;
  --poster-radius: 24px;
  color-scheme: light;
}

/* Five colour tones: vaults pick one, cards take one from the uploader's name. */
.tone-0 { --tone-bg: linear-gradient(160deg, #bfe6ff 0%, #eaf6ff 55%, #fff1ea 100%); --tone-deep: #0b6fe0; --tone-soft: #e6f4ff; --tone-glow: rgba(11, 111, 224, .4); }
.tone-1 { --tone-bg: linear-gradient(160deg, #ffdcc8 0%, #fff1ea 55%, #eaf6ff 100%); --tone-deep: #b4542a; --tone-soft: #fff1ea; --tone-glow: rgba(180, 84, 42, .4); }
.tone-2 { --tone-bg: linear-gradient(160deg, #d9dcff 0%, #eef0ff 55%, #fff1ea 100%); --tone-deep: #4a4fc4; --tone-soft: #eef0ff; --tone-glow: rgba(74, 79, 196, .4); }
.tone-3 { --tone-bg: linear-gradient(160deg, #c9f0e8 0%, #eaf8f6 55%, #eaf6ff 100%); --tone-deep: #127566; --tone-soft: #eaf8f6; --tone-glow: rgba(18, 117, 102, .4); }
.tone-4 { --tone-bg: linear-gradient(160deg, #ffedb8 0%, #fff8e6 55%, #ffede6 100%); --tone-deep: #8e6300; --tone-soft: #fff8e6; --tone-glow: rgba(142, 99, 0, .4); }
.tone-none { --tone-bg: #eef2f6; --tone-deep: #62758a; --tone-soft: #eef2f6; --tone-glow: rgba(98, 117, 138, .4); }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button, select, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--cyan); }
h1, h2, p { margin: 0; }
:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.mark { width: 30px; height: 30px; flex: none; }
svg.icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- Buttons ---------- */

.pill {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--card); color: var(--ink);
  font-size: 14px; font-weight: 600; white-space: nowrap;
  transition: border-color .15s ease, background .15s ease;
}
.pill:hover:not(:disabled) { border-color: var(--cyan); color: var(--ink); }
.pill.dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.pill.dark:hover:not(:disabled) { background: #13304f; border-color: #13304f; color: #fff; }
.pill.small { height: 36px; padding: 0 14px; font-size: 13px; }
.pill.armed { background: var(--danger); border-color: var(--danger); color: #fff; }
.pill:disabled { background: #e1e7ee; border-color: #e1e7ee; color: #8a9aab; }
.text-btn { height: 40px; padding: 0 10px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font-size: 14px; font-weight: 600; }
.text-btn:hover { color: var(--ink); }
.round-btn {
  display: grid; place-items: center; flex: none;
  width: 40px; height: 40px; border: 0; border-radius: 50%;
  background: var(--wash); color: var(--blue);
  transition: background .15s ease, color .15s ease;
}
.round-btn:hover { background: var(--cyan); color: #fff; }
.round-btn.close { color: var(--ink); }
.round-btn.close:hover { background: var(--wash-strong); color: var(--ink); }
.round-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Top bar ---------- */

.topbar {
  position: sticky; top: 0; z-index: 5;
  background: rgba(243, 246, 249, .86);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar-in { display: flex; align-items: center; gap: 12px; max-width: 1320px; height: 68px; margin: 0 auto; padding: 0 32px; }
.brand { display: inline-flex; align-items: center; gap: 10px; border-radius: 10px; color: var(--ink); font-weight: 700; font-size: 19px; letter-spacing: -.01em; }
.brand:hover { color: var(--ink); }
.grow { flex: 1; }
.logout { margin: 0; }
.admin-pill { padding: 0 16px; flex: none; }

/* Account menu: who is signed in, the admin console for admins, the team, sign out. */
.account { position: relative; flex: none; }
.account-btn {
  display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 10px 0 4px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--card); color: var(--ink);
  transition: border-color .15s ease;
}
.account-btn:hover { border-color: var(--cyan); }
.account-btn .chev { width: 12px; height: 12px; fill: none; stroke: var(--muted); stroke-width: 1.6; stroke-linecap: round; transition: transform .15s ease; }
.account-btn[aria-expanded="true"] .chev { transform: rotate(180deg); }
.account-avatar {
  display: grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 50%;
  background: var(--ink); color: #fff; font-size: 12px; font-weight: 700; text-transform: uppercase;
}
.account-avatar.big { width: 44px; height: 44px; font-size: 15px; }
.account-scrim { position: fixed; inset: 0; z-index: 6; }
.account-menu {
  position: absolute; right: 0; top: calc(100% + 10px); z-index: 7;
  display: flex; flex-direction: column; gap: 2px;
  width: 300px; max-width: calc(100vw - 32px); padding: 8px; box-sizing: border-box;
  border-radius: 22px; background: var(--card);
  box-shadow: 0 30px 70px -20px rgba(10, 27, 45, .4), 0 0 0 1px var(--line);
}
.account-menu[hidden], .account-scrim[hidden], .admin-item[hidden] { display: none; }
.account-who { display: flex; align-items: center; gap: 12px; padding: 12px 12px 14px; }
.account-text { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.account-name { font-size: 15px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.account-handle { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu-item {
  display: flex; align-items: center; gap: 12px; width: 100%; box-sizing: border-box;
  padding: 10px 12px; border: 0; border-radius: 14px; background: transparent;
  color: var(--ink); font-size: 14px; font-weight: 600; text-align: left;
}
.menu-item:hover { background: var(--bg); color: var(--ink); }
.menu-item.admin-item { background: #f3f9ff; }
.menu-item.admin-item:hover { background: var(--wash); }
.menu-item.danger, .menu-item.danger:hover { color: var(--danger); }
.menu-item.danger:hover { background: #fdf0f1; }
.menu-icon { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 10px; color: var(--muted); }
.menu-icon.dark { background: var(--ink); color: #fff; }
.menu-text { display: flex; flex-direction: column; gap: 1px; flex: 1; min-width: 0; }
.menu-title { font-size: 14px; font-weight: 600; }
.menu-sub { font-size: 12.5px; font-weight: 400; color: var(--muted); }
.menu-badge { flex: none; display: flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 999px; background: var(--cyan); color: #fff; font-size: 11px; font-weight: 700; }
.menu-rule { height: 1px; margin: 4px 8px; background: var(--line); }
.team-pill { padding: 0 14px 0 6px; }
.team-pill .faces { margin-right: 8px; }

.faces { display: flex; }
.face {
  display: grid; place-items: center;
  width: 28px; height: 28px; margin-right: -8px;
  border-radius: 50%; box-shadow: 0 0 0 2px #fff;
  background: var(--tone-soft); color: var(--tone-deep);
  font-size: 12px; font-weight: 700; text-transform: uppercase;
}
.face.you { background: var(--ink); color: #fff; }
.face.add { background: var(--wash); color: var(--blue); }

/* ---------- Page ---------- */

/* A side list of places on wide screens, the videos beside it. */
.shell { max-width: 1440px; margin: 0 auto; padding: 28px 32px 0; }
.layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 40px; align-items: start; }
.content { min-width: 0; }

.side {
  position: sticky; top: 92px;
  display: flex; flex-direction: column; gap: 24px;
  max-height: calc(100vh - 112px); overflow-y: auto; padding: 0 4px 24px 0;
}
.side-group, .side-list { display: flex; flex-direction: column; gap: 2px; }
.side-label { padding: 0 12px 6px; color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.side-head { display: flex; align-items: center; justify-content: space-between; padding: 0 4px 6px 0; }
.side-head .side-label { padding-bottom: 0; }
.side-add {
  display: grid; place-items: center; width: 28px; height: 28px;
  border: 0; border-radius: 8px; background: transparent;
  color: var(--blue); font-size: 20px; line-height: 1;
}
.side-add:hover { background: var(--wash); }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; min-height: 40px; padding: 0 12px;
  border: 0; border-radius: 12px; background: transparent;
  color: var(--ink); text-align: left; font-size: 14px; font-weight: 500;
}
.nav-item:hover { background: #e9eef3; }
.nav-item[aria-current="page"] { background: #fff; font-weight: 700; box-shadow: 0 0 0 1px var(--line), 0 8px 18px -12px rgba(10, 27, 45, .35); }
.nav-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-count { color: var(--muted); font: 500 12px var(--data); }
svg.nav-icon { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linejoin: round; }
svg.nav-lock { width: 12px; height: 12px; fill: none; stroke: #8a9aab; stroke-width: 2.4; stroke-linecap: round; flex: none; }
.nav-dot { flex: none; width: 12px; height: 12px; border-radius: 4px; background: var(--tone-deep); }
.nav-dot.dashed { border: 1.5px dashed #9fb0c2; background: transparent; }
.nav-face {
  display: grid; place-items: center; flex: none; width: 22px; height: 22px; border-radius: 50%;
  background: var(--tone-soft); color: var(--tone-deep); font-size: 11px; font-weight: 700;
}
/* Libraries: the chosen one is dark. */
.lib-item[aria-selected="true"] { background: var(--ink); color: #fff; font-weight: 600; }
.lib-item[aria-selected="true"] .nav-count { color: rgba(255, 255, 255, .7); }
.lib-item { font-weight: 600; }

/* Phones and narrow windows: the same places as a row of chips. */
.chips-box { display: none; }
.chips { display: flex; gap: 8px; overflow-x: auto; overflow-y: hidden; padding: 0 16px 2px; }
.chip {
  flex: none; display: flex; align-items: center; gap: 7px;
  height: 38px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: 999px; background: #fff;
  color: var(--ink); font-size: 14px; font-weight: 600; white-space: nowrap;
}
.chip .nav-name { overflow: visible; }
.chip .nav-count { color: inherit; opacity: .7; font-size: 11px; }
.chip .nav-dot { width: 10px; height: 10px; border-radius: 3px; }
.chip .nav-face { width: 18px; height: 18px; font-size: 10px; }
.chip[aria-current="page"], .chip[aria-selected="true"] { border-color: var(--ink); background: var(--ink); color: #fff; }
.chip[aria-current="page"] .nav-dot { background: #fff; border-color: #fff; }
.lib-chip { height: 36px; padding: 0 12px; border: 0; border-radius: 10px; background: transparent; font-size: 13px; }

/* The header over the videos: a colour or a face, the name, then the actions. */
.head { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; min-height: 56px; margin-bottom: 24px; }
.head-mark { flex: none; width: 52px; height: 52px; border-radius: 16px; background: var(--tone-bg); box-shadow: inset 0 0 0 1px rgba(10, 27, 45, .06); }
.head-mark.tone-none { background: #eaeff4; }
.head-mark.round { display: grid; place-items: center; border-radius: 50%; background: var(--tone-soft); color: var(--tone-deep); font-size: 20px; font-weight: 700; box-shadow: none; }
.head-text { flex: 1; min-width: 200px; display: flex; flex-direction: column; gap: 4px; }
.page-title { font-size: 36px; line-height: 1.05; letter-spacing: -.03em; font-weight: 700; overflow-wrap: anywhere; }
.subtitle { font-size: 14px; color: var(--muted); }
.head-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.head-btn { height: 44px; padding: 0 16px; }
.head-btn svg.icon { width: 17px; height: 17px; }
/* Send to team is the one blue action, on the page, the vault, the cards and the viewer. */
.pill.send-btn { border-color: var(--cyan); background: var(--cyan); color: #fff; font-weight: 700; }
.pill.send-btn:hover:not(:disabled) { border-color: #2baaff; background: #2baaff; color: #fff; }
.pill.send-btn:disabled { border-color: var(--faint); background: var(--faint); color: #fff; }
.pill.send-btn svg.icon { width: 17px; height: 17px; }
.head .send-btn { padding: 0 18px; }
/* While choosing, the bar at the bottom holds the actions. */
body.sorting .head-actions, body.sorting .send-one, body.sorting .take-one { display: none; }
.take-one { flex: none; }
.take-one:hover:not(:disabled) { border-color: var(--danger); color: var(--danger); }

.section-title { font-size: 20px; letter-spacing: -.015em; font-weight: 700; }
.mini img, .pick-poster img, .item-thumb .thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

@media (max-width: 859px) {
  .layout { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .side { display: none; }
  .chips-box { display: flex; flex-direction: column; gap: 10px; margin: 0 -32px 20px; }
  .chips { padding: 0 32px 2px; }
}

/* ---------- Grid ---------- */

.status { margin: 0 0 20px; color: var(--muted); font-size: 15px; }
.status.error { color: var(--danger); font-weight: 500; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 32px 20px; margin: 0; padding: 0; list-style: none; }
.media-tabs { margin: -8px 0 24px; }
.media-tabs .tab { display: flex; gap: 8px; align-items: center; padding: 0 16px; }
.media-tabs .tab span { color: var(--muted); font: 12px var(--data); }
#media-panel { min-width: 0; }
#media-panel[data-type="images"] .bone-poster,
#media-panel[data-type="files"] .bone-poster { aspect-ratio: 4 / 3; }
.card { display: flex; flex-direction: column; gap: 12px; min-width: 0; animation: rise .45s ease both; animation-delay: calc(var(--i, 0) * 40ms); }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }

.poster {
  position: relative; overflow: hidden;
  aspect-ratio: 9 / 16; border-radius: var(--poster-radius);
  background: var(--tone-bg); cursor: pointer;
  container-type: inline-size;
  box-shadow: var(--shadow-card);
  transition: transform .25s cubic-bezier(.2, .8, .2, 1), box-shadow .25s;
}
.poster:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); }
.poster.selected { outline: 3px solid var(--cyan); outline-offset: 3px; }
.letter {
  position: absolute; left: 0; right: 0; top: 20%;
  color: var(--tone-deep); opacity: .88;
  font-size: 52cqw; line-height: 1; font-weight: 700; letter-spacing: -.04em; text-align: center;
}
.poster img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.poster.photo-poster { aspect-ratio: 4 / 3; }
.poster.file-poster { aspect-ratio: 4 / 3; }
.poster.file-poster .letter { display: none; }
.poster.file-poster .play { top: 50%; }
.poster.photo-poster img { object-fit: contain; }
.poster.photo-poster.has-image .letter { display: none; }
.poster .shade { position: absolute; inset: auto 0 0; height: 40%; background: linear-gradient(180deg, transparent, rgba(10, 27, 45, .45)); }
.tag {
  position: absolute; display: flex; align-items: center;
  height: 24px; padding: 0 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600;
}
.tag.platform { top: 10px; left: 10px; background: rgba(255, 255, 255, .82); color: var(--ink); }
.tag.count { top: 10px; right: 10px; background: var(--cyan); color: #fff; }
.tag.length {
  right: 10px; bottom: 10px; padding: 0 8px; border-radius: 8px;
  background: rgba(10, 27, 45, .78); color: #fff;
  font: 600 12px var(--data);
}
.tag.length.link-only { background: rgba(255, 255, 255, .85); color: var(--muted); font-family: var(--body); }
.handle {
  position: absolute; left: 12px; right: 64px; bottom: 12px;
  overflow: hidden; color: var(--tone-deep);
  font-size: 12px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap;
}
.poster.has-image .handle { color: #fff; }
.play {
  position: absolute; left: 50%; top: 58%; transform: translate(-50%, -50%);
  display: grid; place-items: center;
  width: 52px; height: 52px; border-radius: 50%;
  background: #fff; box-shadow: 0 10px 24px -8px rgba(10, 27, 45, .35);
}
.play svg { width: 18px; height: 18px; fill: var(--ink); }
.check {
  position: absolute; top: 8px; left: 8px; z-index: 1;
  display: grid; place-items: center;
  width: 32px; height: 32px; border-radius: 50%;
  border: 2px solid #fff; background: rgba(255, 255, 255, .85);
  box-shadow: 0 4px 10px -4px rgba(10, 27, 45, .3);
}
.check svg { width: 14px; height: 14px; fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.poster.selected .check { border-color: var(--cyan); background: var(--cyan); }
/* While sorting, a tap selects instead of playing: the tick takes the label's corner. */
body.sorting .poster .tag.platform, body.sorting .poster .play { display: none; }

.meta { display: flex; align-items: flex-start; gap: 10px; padding: 0 2px; }
.meta-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.card-title {
  display: -webkit-box; overflow: hidden;
  font-size: 15px; font-weight: 600; line-height: 1.3;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow-wrap: anywhere;
}
.by { overflow: hidden; color: var(--muted); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.vault-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.vault-tag { display: flex; align-items: center; gap: 6px; color: var(--tone-deep); font-size: 12px; font-weight: 600; }
.vault-tag i { width: 8px; height: 8px; border-radius: 3px; background: var(--tone-deep); }
.vault-more { color: var(--muted); font-size: 12px; font-weight: 600; }
.dl svg { width: 18px; height: 18px; }
.send-one svg { width: 17px; height: 17px; stroke-width: 2.2; }

.skeleton { display: flex; flex-direction: column; gap: 12px; }
.skeleton .bone-poster { aspect-ratio: 9 / 16; border-radius: var(--poster-radius); background: linear-gradient(160deg, #e6edf4, #eef3f8); }
.skeleton .bone { height: 14px; width: 80%; border-radius: 7px; background: #e1e7ee; }
.skeleton .bone.short { height: 12px; width: 50%; background: #e8edf2; }

.empty {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  max-width: 640px; padding: 48px 28px;
  border: 2px dashed #cfd9e3; border-radius: 24px; text-align: center;
}
.empty-art { width: 64px; aspect-ratio: 9 / 16; border-radius: 12px; background: linear-gradient(160deg, #bfe6ff, #eaf6ff 55%, #fff1ea); }
.empty p { margin-top: 8px; font-size: 16px; line-height: 1.55; }

.more { display: flex; justify-content: center; align-items: center; gap: 12px; padding: 48px 0 64px; color: var(--muted); font-size: 14px; }
.more .failed { color: var(--danger); }
.sentinel { height: 1px; }

/* ---------- Sort bar ---------- */

.sortbar {
  position: fixed; left: 50%; bottom: 20px; z-index: 15;
  display: flex; align-items: center; gap: 8px;
  width: min(860px, calc(100% - 48px)); padding: 8px 8px 8px 20px;
  border-radius: 24px; background: var(--ink); color: #fff;
  transform: translateX(-50%);
  box-shadow: 0 24px 50px -20px rgba(10, 27, 45, .6);
}
.bar-text { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 1px; }
.bar-title { max-width: 100%; overflow: hidden; font-size: 15px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.sel-all { flex: none; min-height: 36px; padding: 0 14px; border: 1px solid #ffffff40; border-radius: 999px; background: #ffffff14; color: #c5e5ff; font-size: 13px; font-weight: 600; white-space: nowrap; }
.sel-all:hover:not(:disabled) { color: #fff; border-color: #ffffff80; background: #ffffff26; }
.sel-all:disabled { opacity: .5; cursor: default; }
.bar-cancel { flex: none; height: 44px; padding: 0 14px; border: 0; border-radius: 999px; background: transparent; color: #9fb0c2; font-size: 14px; font-weight: 600; }
.bar-cancel:hover { color: #fff; }
.bar-act { position: relative; flex: none; }
.bar-action {
  display: flex; align-items: center; gap: 8px;
  height: 44px; padding: 0 18px; border: 0; border-radius: 999px;
  background: #fff; color: var(--ink);
  font-size: 14px; font-weight: 700; white-space: nowrap;
}
.bar-action svg.icon { width: 17px; height: 17px; }
.bar-action:disabled { opacity: .4; }
.bar-action.is-send { background: var(--cyan); color: #fff; }
.bar-action.is-send:hover:not(:disabled) { background: #2baaff; }
.bar-action.is-remove { background: var(--danger); color: #fff; }
.bar-action.is-remove:hover:not(:disabled) { background: #a8323f; }
.bar-menu {
  position: absolute; right: 0; bottom: calc(100% + 14px);
  display: flex; flex-direction: column; gap: 2px;
  width: 260px; max-height: 50vh; overflow-y: auto; padding: 8px;
  border-radius: 20px; background: #fff; color: var(--ink);
  box-shadow: 0 30px 60px -20px rgba(10, 27, 45, .45), 0 0 0 1px var(--line);
}
.bar-menu-label { padding: 8px 10px 6px; color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.bar-menu-list { display: flex; flex-direction: column; gap: 2px; }
.bar-menu-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px; border: 0; border-radius: 12px;
  background: transparent; color: var(--ink); text-align: left;
  font-size: 14px; font-weight: 600; overflow-wrap: anywhere;
}
.bar-menu-item:hover { background: var(--bg); }
.bar-menu-item i { flex: none; width: 12px; height: 12px; border-radius: 4px; background: var(--tone-deep); }
body.sorting .shell { padding-bottom: 96px; }

/* ---------- Sheets (viewer, team, vault settings) ---------- */

.sheet {
  max-width: none; max-height: none; padding: 0; border: 0;
  border-radius: 32px; background: var(--card); color: var(--ink);
  box-shadow: var(--shadow-sheet);
}
.sheet::backdrop { background: rgba(10, 27, 45, .45); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.sheet[open] { animation: pop .25s ease backwards; }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.98); } }
.sheet-title { flex: 1; font-size: 26px; line-height: 1.15; letter-spacing: -.025em; font-weight: 700; text-wrap: pretty; overflow-wrap: anywhere; }
.label { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.notice { display: flex; gap: 12px; padding: 14px 16px; border-radius: 16px; background: var(--notice-bg); color: var(--notice-ink); font-size: 14px; line-height: 1.5; }
.notice svg { flex: none; width: 18px; height: 18px; margin-top: 2px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.choice {
  height: 36px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--card); color: var(--ink);
  font-size: 14px; font-weight: 600;
}
.choice[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choices.tight { gap: 6px; }
.choices.tight .choice { display: flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; font-size: 13px; white-space: nowrap; }
.choice i { width: 8px; height: 8px; border-radius: 3px; background: var(--tone-deep); }
.choice.tone-none i { background: var(--faint); }

/* Viewer */
.viewer { width: min(1100px, calc(100% - 48px)); height: min(780px, calc(100% - 48px)); overflow: hidden; box-shadow: 0 50px 120px -30px rgba(0, 0, 0, .6); }
.viewer[open] { display: flex; }
.viewer::backdrop { background: rgba(6, 14, 24, .62); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.stage {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  padding: 28px 24px 18px;
  background: radial-gradient(90% 70% at 50% 35%, var(--tone-glow) 0%, transparent 70%), var(--ink);
}
.stage-row { flex: 1; min-height: 0; width: 100%; display: flex; align-items: center; justify-content: center; gap: 20px; }
.arrow {
  display: grid; place-items: center; flex: none;
  width: 48px; height: 48px; border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .12); color: #fff;
  transition: background .15s ease, opacity .15s ease;
}
.arrow:hover:not(:disabled) { background: rgba(255, 255, 255, .22); }
.arrow:disabled { opacity: .3; cursor: default; }
.arrow svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.frame {
  position: relative; display: grid; place-items: center; overflow: hidden;
  height: 100%; max-height: 100%; aspect-ratio: 9 / 16;
  border-radius: 20px; background: var(--tone-bg);
  container-type: inline-size;
  box-shadow: 0 30px 70px -24px rgba(0, 0, 0, .7);
}
.frame .letter { opacity: .35; }
/* Tall videos fill the frame; wide or square ones are shown whole. */
.frame video, .frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #04101c; }
.frame.fit video, .frame.fit img { object-fit: contain; }
.frame audio { position: absolute; left: 5%; bottom: 15%; width: 90%; }
.viewer.is-photo { width: min(1440px, calc(100% - 32px)); height: min(900px, calc(100% - 32px)); }
.viewer.is-photo .panel { width: 340px; }
.viewer.is-photo .stage-row { gap: 12px; }
.viewer.is-photo .arrow { width: 36px; height: 36px; }
.frame.photo-frame { flex: 1; min-width: 0; width: 100%; aspect-ratio: auto; display: block; overflow: auto; border-radius: 8px; background: transparent; box-shadow: none; }
.photo-frame .letter { display: none; }
.photo-frame .stage-msg { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); }
.photo-canvas { display: flex; align-items: center; justify-content: center; min-width: 100%; min-height: 100%; }
.frame .photo-canvas img { position: static; flex: none; object-fit: contain; background: transparent; user-select: none; }
.photo-frame.zoomed { cursor: grab; }
.photo-frame.dragging { cursor: grabbing; }
.photo-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; flex: none; }
.photo-tools button { min-width: 32px; min-height: 36px; padding: 6px 10px; border: 1px solid rgba(255, 255, 255, .25); border-radius: 8px; background: rgba(255, 255, 255, .1); color: #fff; font-size: 13px; }
.photo-tools button:hover:not(:disabled) { background: rgba(255, 255, 255, .2); }
.photo-tools button:disabled { opacity: .4; cursor: default; }
.photo-tools output { min-width: 46px; color: #fff; font: 12px var(--data); text-align: center; }
.viewer.photo-expanded { width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; border-radius: 0; }
.viewer.photo-expanded .panel { display: none; }
.viewer.photo-expanded .stage, .stage:fullscreen { flex: 1; width: 100%; height: 100%; min-height: 0; padding: 16px; background: var(--ink); }
.viewer.photo-expanded .stage-row, .stage:fullscreen .stage-row { flex: 1; min-height: 0; }
.viewer.photo-expanded .photo-frame, .stage:fullscreen .photo-frame { height: 100%; }
.stage-msg { position: relative; padding: 8px 16px; border-radius: 999px; background: rgba(255, 255, 255, .9); font-size: 14px; font-weight: 600; white-space: nowrap; }
.stage-foot { display: flex; align-items: center; gap: 8px; color: rgba(255, 255, 255, .72); font-size: 12px; }
.stage-foot .position { color: #fff; font: 600 12px var(--data); }
.panel { width: 380px; flex: none; display: flex; flex-direction: column; min-height: 0; overflow-y: auto; }
.panel-main { display: flex; flex-direction: column; gap: 18px; padding: 22px 24px 0; }
.panel-main > * { flex-shrink: 0; }
.panel-top { display: flex; align-items: center; gap: 12px; }
.panel-top .avatar { font-size: 16px; }
.viewer .round-btn.close { background: var(--bg); }
.viewer .round-btn.close:hover { background: var(--wash); }
.who { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.who-name { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who-sub { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.viewer-title { font-size: 24px; line-height: 1.2; letter-spacing: -.022em; font-weight: 700; text-wrap: pretty; overflow-wrap: anywhere; }
.viewer-title-row { display: flex; align-items: baseline; gap: 12px; }
.viewer-title-row h2 { flex: 1; min-width: 0; }
.viewer-title-row button { flex: none; }
.item-comments { display: flex; flex-direction: column; gap: 12px; margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--line); }
.comment-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.comment-heading h3 { margin: 0; font-size: 17px; font-weight: 700; }
.item-comments .fine { margin: 0; }
.comment-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 16px; }
.comment { min-width: 0; }
.comment-meta { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 8px; font-size: 13px; }
.comment-meta time { color: var(--muted); font-size: 12px; }
.comment-owner { color: var(--muted); font-size: 11px; font-weight: 600; }
.comment p { margin: 5px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; line-height: 1.5; }
.item-comments textarea, .item-comments select { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; background: #fff; color: var(--ink); font: inherit; }
.item-comments textarea { resize: vertical; min-height: 80px; }
.item-comments textarea:focus-visible, .item-comments select:focus-visible { outline: 2px solid var(--blue, #0a9dff); outline-offset: 2px; }
.item-comments form > button { align-self: flex-end; }
.rename-form { display: flex; flex-direction: column; gap: 10px; }
.rename-form label { font-size: 14px; font-weight: 600; }
.rename-form input { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.rename-actions { display: flex; justify-content: flex-end; align-items: center; gap: 12px; }
.items-box { display: flex; flex-direction: column; gap: 8px; }
.item-count { color: var(--muted); font-size: 13px; }
.item-thumbs { display: flex; gap: 8px; overflow-x: auto; padding: 3px; }
.item-thumb { flex: none; display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 0; border: 0; background: transparent; color: var(--muted); font-size: 11px; font-weight: 600; }
.item-thumb .thumb { position: relative; overflow: hidden; display: grid; place-items: center; width: 48px; aspect-ratio: 9 / 16; border-radius: 10px; background: var(--tone-bg); color: var(--tone-deep); outline: 0 solid transparent; outline-offset: 2px; }
.item-thumb .thumb svg { position: relative; width: 14px; height: 14px; fill: currentColor; fill-rule: evenodd; }
/* Over a picture the video/photo mark sits on a small dark dot. */
.item-thumb .thumb.has-image svg { width: 22px; height: 22px; padding: 5px; border-radius: 50%; background: rgba(10, 27, 45, .6); color: #fff; }
.item-thumb[aria-pressed="true"] { color: var(--ink); }
.item-thumb[aria-pressed="true"] .thumb { outline: 2px solid var(--ink); }
.notice span { text-wrap: pretty; }
.actions { display: flex; flex-direction: column; gap: 10px; }
.actions-main { display: flex; gap: 8px; }
.actions-main .pill { flex: 1; min-width: 0; height: 48px; font-size: 15px; }
.actions .download { border: 0; }
.actions-links { display: flex; justify-content: center; gap: 4px; }
.link-btn {
  display: inline-flex; align-items: center; height: 36px; padding: 0 12px;
  border: 0; border-radius: 999px; background: transparent;
  color: var(--ink-soft); font-size: 13px; font-weight: 600;
}
.link-btn:hover { background: var(--bg); color: var(--ink); }
.actions .download:disabled { cursor: not-allowed; }
.audio-tools { display: flex; flex-direction: column; gap: 8px; }
.audio-extract { width: 100%; justify-content: flex-start; }
.audio-format { margin-left: auto; color: var(--muted); font: 500 11px var(--data); }
.audio-status { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.vault-box { border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.vault-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border: 0; background: transparent; text-align: left; }
.vault-row:hover { background: #f8fafc; }
.vault-swatch { flex: none; width: 36px; height: 36px; border-radius: 10px; background: var(--tone-bg); box-shadow: inset 0 0 0 1px rgba(10, 27, 45, .06); }
.vault-row-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.vault-row-name { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vault-row-sub { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vault-row-action { flex: none; color: var(--blue); font-size: 13px; font-weight: 600; }
.vault-options { display: flex; flex-direction: column; gap: 2px; padding: 6px; border-top: 1px solid var(--line); background: #fbfcfd; }
.vault-option { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border: 0; border-radius: 12px; background: transparent; text-align: left; }
.vault-option:hover:not(:disabled) { background: #eef3f8; }
.vault-option[aria-selected="true"] { background: var(--wash); }
.vault-option:disabled { opacity: .6; }
.vault-option i { flex: none; width: 12px; height: 12px; border-radius: 4px; background: var(--tone-deep); }
.vault-option-name { flex: 1; min-width: 0; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vault-option-access { color: var(--muted); font-size: 12px; white-space: nowrap; }
.vault-option .tick { flex: none; width: 18px; height: 16px; fill: none; stroke: var(--cyan); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; opacity: 0; }
.vault-option[aria-selected="true"] .tick { opacity: 1; }
.vault-options .vault-note { padding: 10px 12px; color: var(--muted); font-size: 13px; }
.shared-line { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; }
.shared-line i { flex: none; width: 10px; height: 10px; border-radius: 3px; background: var(--tone-deep); }
.spacer { flex: 1; min-height: 24px; }
.up-next {
  display: flex; align-items: center; gap: 12px;
  margin: 0 24px 24px; padding: 10px 14px 10px 10px;
  border: 0; border-radius: 18px; background: var(--bg); color: var(--ink); text-align: left;
  transition: background .15s ease;
}
.up-next:hover { background: var(--wash); }
.upnext-thumb {
  position: relative; display: grid; place-items: center; overflow: hidden; flex: none;
  width: 40px; aspect-ratio: 9 / 16; border-radius: 9px;
  background: var(--tone-bg); color: var(--tone-deep); font-size: 16px; font-weight: 700;
}
.upnext-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.upnext-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.upnext-label { color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.upnext-title { display: -webkit-box; overflow: hidden; font-size: 14px; font-weight: 600; line-height: 1.3; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.up-next svg.icon { width: 20px; height: 20px; stroke-width: 2.4; }

/* Narrow screens: the video sits above the details and the whole sheet scrolls. */
@media (max-width: 900px) {
  .viewer { height: auto; max-height: calc(100% - 48px); overflow-y: auto; }
  .viewer[open] { flex-direction: column; }
  .stage { flex: none; min-height: 460px; padding: 20px 12px 14px; }
  .stage-row { flex: none; gap: 10px; }
  .frame { height: 390px; }
  .key-hint { display: none; }
  .panel { width: 100%; overflow: visible; }
  .viewer.is-photo { height: auto; }
  .viewer.is-photo .panel { width: 100%; }
  .viewer.is-photo .stage { min-height: 0; height: clamp(320px, 60vh, 600px); }
  .viewer.is-photo .stage-row { flex: 1; gap: 6px; }
  .viewer.is-photo .photo-frame { height: 100%; }
  .viewer.photo-expanded { height: 100%; }
  .viewer.photo-expanded .stage { height: 100%; flex: 1; }
}

/* Team */
.team { width: min(560px, calc(100% - 48px)); max-height: min(760px, calc(100% - 48px)); overflow: hidden; }
.team[open] { display: flex; flex-direction: column; }
.team-head { display: flex; flex-direction: column; gap: 14px; padding: 28px 28px 0; }
.team-head-row { display: flex; align-items: flex-start; gap: 12px; }
.team-head-text { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.team-lede { color: var(--muted); font-size: 14px; line-height: 1.5; text-wrap: pretty; }
.meter-box { display: flex; flex-direction: column; gap: 8px; padding: 14px; border-radius: 16px; background: var(--bg); }
.meter-count { font-size: 13px; }
.meter-count b { font-weight: 600; }
.meter-count span { color: var(--muted); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); }
.tab { height: 44px; padding: 0 12px; border: 0; background: transparent; color: var(--muted); font-size: 14px; font-weight: 600; }
.tab[aria-selected="true"] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--ink); }
.team-body { display: flex; flex-direction: column; gap: 14px; padding: 20px 28px 28px; overflow-y: auto; overscroll-behavior: contain; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field-label { font-size: 14px; font-weight: 600; }
.field textarea, .field input[type="text"] {
  width: 100%; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: 16px;
  background: #fff; color: var(--ink);
  font-size: 15px; line-height: 1.5;
}
.field textarea { resize: vertical; }
.field input[type="text"] { height: 48px; border-radius: 14px; font-size: 16px; }
.field textarea:focus, .field input[type="text"]:focus { outline: 2px solid var(--cyan); outline-offset: 0; border-color: transparent; }
.add-btn { align-self: flex-start; height: 44px; padding: 0 20px; font-size: 15px; }
.notice.plain { display: block; }
.results { display: flex; flex-direction: column; overflow: hidden; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 14px; list-style: none; }
.results:empty { display: none; }
.result { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-top: 1px solid var(--line-soft); font-size: 14px; overflow-wrap: anywhere; }
.result:first-child { border-top: 0; }
.result i { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.result b { font-weight: 600; }
.result span { color: var(--muted); }
.result.good i { background: #1fa37f; }
.result.good span { color: #127566; }
.result.bad i { background: var(--danger); }
.result.bad span { color: var(--danger); }
.tips { display: flex; flex-direction: column; gap: 6px; margin: 4px 0 0; padding: 0 0 0 18px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.people { display: flex; flex-direction: column; gap: 12px; margin: 0; padding: 0; list-style: none; }
.person { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.person.needs-invite { margin: 0 -10px; padding: 10px; border-radius: 14px; background: #f3f9ff; }
.avatar {
  display: grid; place-items: center; flex: none;
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--tone-soft); color: var(--tone-deep);
  font-size: 15px; font-weight: 700; text-transform: uppercase;
}
.avatar.pending { border: 2px dashed #b7c6d5; background: transparent; color: var(--muted); }
.person-text { flex: 1; min-width: 150px; display: flex; flex-direction: column; gap: 2px; }
.person-name { font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.person-sub { color: var(--muted); font-size: 13px; line-height: 1.4; }
.person-actions { display: flex; gap: 6px; }
.team-empty { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 24px 8px; color: var(--muted); font-size: 14px; line-height: 1.5; text-align: center; }
.share-box { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: 14px; background: var(--wash); font-size: 14px; line-height: 1.5; }
.share-box .row { display: flex; flex-wrap: wrap; gap: 8px; }

/* Vault settings */
.vm { width: min(560px, calc(100% - 48px)); max-height: min(760px, calc(100% - 48px)); }
.vm[open] { display: flex; }
.vm-form { display: flex; flex-direction: column; gap: 20px; width: 100%; padding: 28px; overflow-y: auto; }
/* The sheet scrolls as a whole; nothing inside it is squeezed to fit. */
.vm-form > *, .team-body > *, .panel > * { flex-shrink: 0; }
.panel > .spacer { flex-shrink: 1; }
.vm-head { display: flex; align-items: center; gap: 12px; }
.vm-preview {
  display: flex; align-items: flex-end;
  height: 96px; padding: 16px 18px; border-radius: 20px;
  background: var(--tone-bg); color: var(--tone-deep);
  font-size: 24px; font-weight: 700; letter-spacing: -.02em; overflow-wrap: anywhere;
}
.swatches { display: flex; gap: 10px; }
.swatch { width: 40px; height: 40px; border: 0; border-radius: 50%; background: var(--tone-bg); box-shadow: inset 0 0 0 1px rgba(10, 27, 45, .08); }
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--ink); }
.modes { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px; }
.mode {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 14px; border: 1.5px solid var(--line); border-radius: 16px;
  background: #fff; color: var(--ink); text-align: left;
}
.mode[aria-checked="true"] { border-color: var(--ink); background: #f3f9ff; }
.radio { flex: none; display: grid; place-items: center; width: 18px; height: 18px; margin-top: 1px; border: 2px solid var(--faint); border-radius: 50%; }
.radio i { width: 8px; height: 8px; border-radius: 50%; }
.mode[aria-checked="true"] .radio { border-color: var(--ink); }
.mode[aria-checked="true"] .radio i { background: var(--ink); }
.mode-text { display: flex; flex-direction: column; gap: 3px; }
.mode-text b { font-size: 14px; font-weight: 600; }
.mode-text span { color: var(--muted); font-size: 13px; line-height: 1.4; }
.pick-list { display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; }
.pick {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; border: 0; border-top: 1px solid var(--line-soft);
  background: #fff; color: var(--ink); text-align: left;
}
.pick:first-child { border-top: 0; }
.pick .avatar { width: 36px; height: 36px; font-size: 14px; }
.pick-name { flex: 1; font-size: 15px; font-weight: 600; }
.box { display: grid; place-items: center; width: 22px; height: 22px; border: 2px solid var(--faint); border-radius: 7px; background: #fff; }
.box svg { width: 12px; height: 12px; fill: none; stroke: #fff; stroke-width: 3.4; stroke-linecap: round; stroke-linejoin: round; }
.pick[aria-checked="true"] .box { border-color: var(--ink); background: var(--ink); }
.pick-empty { padding: 14px; color: var(--muted); font-size: 14px; }
.fine { color: var(--muted); font-size: 13px; line-height: 1.5; }
.vm-error { color: var(--danger); font-size: 14px; font-weight: 500; }

/* Connect Claude */
.mcp { width: min(1040px, calc(100% - 48px)); max-height: min(780px, calc(100% - 48px)); }
.mcp[open] { display: flex; }
.mcp-body { display: flex; flex-direction: column; gap: 18px; width: 100%; padding: 28px 32px; overflow-y: auto; }
.mcp-body > * { flex-shrink: 0; }
.mcp-body .vm-head { align-items: flex-start; }
.mcp-heading { display: flex; flex-direction: column; gap: 8px; flex: 1; }
.mcp-lede { max-width: 80ch; color: var(--muted); font-size: 14px; line-height: 1.5; text-wrap: pretty; }
.mcp-cols { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 24px; }
.mcp-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.mcp-connect-col { padding: 18px 20px; border-radius: 20px; background: var(--bg); gap: 10px; align-self: start; }
.copy-row { display: flex; gap: 8px; align-items: center; }
.copy-row input, .field .copy-row input[type="text"] {
  flex: 1; min-width: 0; height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 14px;
  background: var(--card); font-family: var(--data); font-size: 12.5px; text-overflow: ellipsis;
}
.mcp-make-col .pill { height: 44px; }
.mcp-new { display: flex; flex-direction: column; gap: 10px; }
.mcp-tabs { display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); }
.mcp-tab {
  flex: 1; height: 34px; padding: 0 12px; border: 0; border-radius: 999px; background: transparent;
  color: var(--muted); font-size: 13px; font-weight: 600; white-space: nowrap;
  transition: background .15s ease, color .15s ease;
}
.mcp-tab:hover { color: var(--ink); }
.mcp-tab[aria-selected="true"] { background: var(--ink); color: #fff; }
.mcp-panel { display: flex; flex-direction: column; gap: 8px; }
.mcp-panel[hidden] { display: none; }
.mcp-step { display: flex; gap: 10px; margin-top: 4px; font-size: 14px; line-height: 1.45; color: var(--ink-soft); }
.mcp-step b {
  display: grid; place-items: center; flex: none; width: 22px; height: 22px; margin-top: 1px;
  border-radius: 50%; background: var(--wash-strong); color: var(--blue); font-size: 12px;
}
.mcp-step:first-child { margin-top: 0; }
.mcp-code { position: relative; border-radius: 14px; background: #12202f; }
.mcp-code pre {
  margin: 0; padding: 12px 72px 12px 14px; overflow-x: auto;
  color: #e8eef5; font-family: var(--data); font-size: 12.5px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere;
}
.mcp-copy {
  position: absolute; top: 8px; right: 8px; height: 28px; padding: 0 12px; border: 0; border-radius: 999px;
  background: rgba(255, 255, 255, .12); color: #fff; font-size: 12px; font-weight: 600;
}
.mcp-copy:hover { background: rgba(255, 255, 255, .22); }
.mcp-try { margin-top: 2px; }
.mcp-list { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; max-height: 200px; overflow-y: auto; }
.mcp-body code { padding: 1px 5px; border-radius: 6px; background: var(--card); font-family: var(--data); font-size: 12px; overflow-wrap: anywhere; }
.mcp-token { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 14px; }
.mcp-token-text { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.mcp-token-text b { font-size: 14px; font-weight: 600; }
.mcp-token-text span { color: var(--muted); font-size: 12.5px; }
@media (max-width: 820px) {
  .mcp-cols { grid-template-columns: 1fr; gap: 20px; }
  .mcp-body { padding: 20px 16px; }
  .mcp-connect-col { padding: 14px; }
}

/* Add links */
.links { width: min(680px, calc(100% - 48px)); max-height: min(780px, calc(100% - 48px)); }
.links[open] { display: flex; }
.links-body { display: flex; flex-direction: column; gap: 18px; width: 100%; padding: 28px 32px; overflow-y: auto; overscroll-behavior: contain; }
.links-body > * { flex-shrink: 0; }
.links-body .vm-head { align-items: flex-start; }
.links-drafts { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; list-style: none; }
.links-draft-line { display: flex; align-items: center; gap: 8px; }
.links-draft input {
  flex: 1; min-width: 0; height: 48px; padding: 0 16px; border: 1px solid var(--line); border-radius: 14px;
  background: var(--card); color: var(--ink); font-family: var(--data); font-size: 14px;
}
.links-draft input::placeholder { color: var(--muted); font-family: var(--body); font-size: 15px; }
.links-draft input:focus { outline: 2px solid var(--cyan); outline-offset: 0; border-color: transparent; }
.links-draft.has-error input { border-color: var(--danger); }
.links-draft-error { margin: 6px 0 0 4px; color: var(--danger); font-size: 12.5px; line-height: 1.4; }
.links-more {
  display: inline-flex; align-items: center; gap: 8px; align-self: flex-start; height: 36px; padding: 0 6px;
  border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-size: 14px; font-weight: 600;
}
.links-more .icon { width: 16px; height: 16px; }
.links-more:hover:not(:disabled) { color: var(--ink); }
.links-more:disabled { opacity: .5; cursor: not-allowed; }
.links-form-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.links-form-row .pill { height: 44px; padding: 0 22px; }
.links-problems { display: flex; flex-direction: column; gap: 4px; margin: 0; padding: 12px 14px 12px 30px; border-radius: 14px; background: var(--notice-bg); color: var(--notice-ink); font-size: 13px; line-height: 1.45; overflow-wrap: anywhere; }
.links-list-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.links-list-head .pill { gap: 8px; }
.links-list { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.links-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 14px; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.links-row.is-done { background: var(--bg); }
.links-main { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; }
.links-url { overflow: hidden; color: var(--ink); font-family: var(--data); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.links-url:hover { color: var(--blue); }
.links-meta { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; font-weight: 600; }
.links-platform { letter-spacing: .04em; text-transform: uppercase; }
.links-chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; background: var(--bg); color: var(--ink-soft); }
.chip-running, .chip-queued { background: var(--wash); color: var(--blue); }
.chip-done { background: #e3f6ea; color: #17703a; }
.chip-failed { background: #fde8ea; color: var(--danger); }
.links-spin { width: 10px; height: 10px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: links-turn .8s linear infinite; }
@keyframes links-turn { to { transform: rotate(360deg); } }
.links-why { color: var(--danger); font-size: 12.5px; line-height: 1.4; overflow-wrap: anywhere; }
.links-note { color: var(--muted); font-size: 12.5px; line-height: 1.4; overflow-wrap: anywhere; }
.links-actions { display: flex; align-items: center; gap: 6px; flex: none; }
.links-download { gap: 7px; }
.links-download .icon { width: 16px; height: 16px; }
.links-done { display: inline-flex; align-items: center; gap: 6px; color: #17703a; font-size: 13px; font-weight: 600; }
.links-done .icon { width: 16px; height: 16px; }
.links-remove { width: 32px; height: 32px; }
.links-remove svg { width: 14px; height: 14px; }
@media (prefers-reduced-motion: reduce) { .links-spin { animation: none; } }
@media (max-width: 820px) {
  .links-body { padding: 20px 16px; }
  .links-row { flex-wrap: wrap; }
  .links-actions { margin-left: auto; }
}

/* Download transcripts */
.tx { width: min(520px, calc(100% - 48px)); max-height: min(720px, calc(100% - 48px)); }
.tx[open] { display: flex; }
.tx-body { display: flex; flex-direction: column; gap: 18px; width: 100%; padding: 28px; overflow-y: auto; }
.tx-body > * { flex-shrink: 0; }
.tx-sub { color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.tx-choose { display: flex; flex-direction: column; gap: 10px; }
.tx-option {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px; text-align: left;
  border: 1px solid var(--line); border-radius: 18px; background: var(--card);
  transition: border-color .15s ease, background .15s ease;
}
.tx-option:hover { border-color: var(--cyan); background: #f8fbff; }
.tx-kind {
  display: grid; place-items: center; flex: none; width: 48px; height: 48px; border-radius: 14px;
  background: var(--wash); color: var(--blue); font-family: var(--data); font-size: 13px; font-weight: 600;
}
.tx-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tx-text b { font-size: 15px; font-weight: 600; }
.tx-text span { color: var(--muted); font-size: 13px; line-height: 1.4; }
.tx-status { font-size: 15px; line-height: 1.5; overflow-wrap: anywhere; }
.tx-bar { height: 8px; margin-top: 12px; border-radius: 4px; background: var(--line); overflow: hidden; }
.tx-bar[hidden] { display: none; }
.tx-bar i { display: block; width: 0; height: 100%; border-radius: 4px; background: var(--cyan); transition: width .3s ease; }
.tx-notes { margin: 14px 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; color: var(--ink-soft); font-size: 13px; line-height: 1.5; }
.tx-notes[hidden] { display: none; }
.vm-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding-top: 18px; border-top: 1px solid var(--line); }
.vm-foot .pill { height: 44px; }
.delete-btn { color: var(--danger); }
.delete-btn.armed,
.delete-btn.armed:hover:not(:disabled) { background: var(--danger); border-color: var(--danger); color: #fff; }

/* Add videos picker */
.empty-add { margin-top: 8px; height: 44px; padding: 0 20px; font-size: 15px; }
.picker { width: min(760px, calc(100% - 48px)); height: min(720px, calc(100% - 48px)); overflow: hidden; }
.picker[open] { display: flex; flex-direction: column; }
.picker-head { display: flex; flex-direction: column; gap: 14px; padding: 24px 28px 16px; border-bottom: 1px solid var(--line); }
.picker-row { display: flex; align-items: center; gap: 12px; }
.picker-swatch { flex: none; width: 40px; height: 40px; border-radius: 12px; background: var(--tone-bg); }
.picker-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.picker-title { font-size: 22px; letter-spacing: -.02em; font-weight: 700; overflow-wrap: anywhere; }
.picker-sub { color: var(--muted); font-size: 13px; }
.picker-tabs { display: flex; gap: 6px; }
.picker-tabs .choice { font-size: 13px; white-space: nowrap; }
.picker-tabs .choice[aria-selected="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.picker-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 20px 28px; }
.picker-none { margin: 24px 0; color: var(--muted); font-size: 14px; text-align: center; }
.picker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 16px 12px; }
.pick-card { display: flex; flex-direction: column; gap: 6px; min-width: 0; padding: 0; border: 0; background: none; color: var(--ink); text-align: left; }
.pick-poster {
  position: relative; overflow: hidden;
  aspect-ratio: 9 / 16; border-radius: 14px;
  background: var(--tone-bg); container-type: inline-size;
}
.pick-card[aria-checked="true"] .pick-poster { outline: 3px solid var(--cyan); outline-offset: 2px; }
.pick-poster .letter { top: 22%; font-size: 50cqw; }
.pick-check {
  position: absolute; top: 6px; right: 6px;
  display: grid; place-items: center;
  width: 26px; height: 26px; border-radius: 50%;
  border: 2px solid #fff; background: rgba(255, 255, 255, .85);
}
.pick-check svg { width: 12px; height: 12px; fill: none; stroke: #fff; stroke-width: 3.4; stroke-linecap: round; stroke-linejoin: round; }
.pick-card[aria-checked="true"] .pick-check { border-color: var(--cyan); background: var(--cyan); }
.pick-vault {
  position: absolute; left: 6px; bottom: 6px; max-width: calc(100% - 12px);
  display: flex; align-items: center; gap: 5px;
  height: 22px; padding: 0 8px; border-radius: 999px;
  background: rgba(255, 255, 255, .88); color: var(--tone-deep);
  font-size: 11px; font-weight: 600; white-space: nowrap; overflow: hidden;
}
.pick-vault i { flex: none; width: 7px; height: 7px; border-radius: 2px; background: var(--tone-deep); }
.pick-title {
  display: -webkit-box; overflow: hidden;
  font-size: 13px; font-weight: 600; line-height: 1.3;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere;
}
.picker-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 14px 28px; border-top: 1px solid var(--line); }
.picker-note { flex: 1; min-width: 160px; color: var(--muted); font-size: 13px; }
.picker-foot .pill { height: 44px; padding: 0 22px; font-size: 15px; }

/* Send to team */
.send-sheet { width: min(560px, calc(100% - 48px)); max-height: min(760px, calc(100% - 48px)); overflow: hidden; }
.send-sheet[open] { display: flex; flex-direction: column; }
.send-pick, .send-done { display: flex; flex-direction: column; min-height: 0; }
.send-pick[hidden], .send-done[hidden] { display: none; }
.send-head { display: flex; align-items: center; gap: 16px; padding: 24px 28px 18px; border-bottom: 1px solid var(--line); }
.send-thumbs { flex: none; display: flex; padding-left: 4px; }
.send-thumb {
  position: relative; display: grid; place-items: center; overflow: hidden;
  width: 38px; aspect-ratio: 9 / 16; border-radius: 9px;
  background: var(--tone-bg); color: var(--tone-deep);
  font-size: 15px; font-weight: 700;
  box-shadow: 0 0 0 2px #fff, 0 8px 16px -8px rgba(10, 27, 45, .4);
}
.send-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.send-thumb.t0 { transform: rotate(-6deg); }
.send-thumb.t1 { margin-left: -16px; transform: rotate(4deg); }
.send-thumb.t2 { margin-left: -16px; transform: rotate(11deg); }
.send-head-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.send-head-text .picker-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.send-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 12px; padding: 20px 28px; }
.send-row { display: flex; align-items: center; justify-content: space-between; }
.send-all { height: 32px; padding: 0 12px; border: 0; border-radius: 999px; background: var(--wash); color: var(--blue); font-size: 13px; font-weight: 600; }
.send-all:hover:not(:disabled) { background: var(--wash-strong); }
.send-people { display: flex; flex-direction: column; gap: 4px; }
.send-person {
  display: flex; align-items: center; gap: 12px;
  margin: 0 -10px; padding: 8px 10px; border: 0; border-radius: 14px;
  background: transparent; color: var(--ink); text-align: left;
}
.send-person:hover:not(:disabled) { background: var(--bg); }
.send-person[aria-checked="true"] { background: #f3f9ff; }
.send-person[aria-checked="true"] .box { border-color: var(--ink); background: var(--ink); }
.send-person .box { width: 24px; height: 24px; border-radius: 8px; }
.send-person-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.send-none { padding: 16px; border-radius: 14px; background: var(--bg); color: var(--muted); font-size: 14px; line-height: 1.5; }
.send-note { margin-top: 8px; }
.send-note .optional { color: var(--muted); font-weight: 400; }
.send-note textarea {
  padding: 10px 14px; border: 1px solid var(--line); border-radius: 14px;
  font-size: 15px; line-height: 1.5; resize: vertical; outline-color: var(--cyan);
}
.send-foot { display: flex; align-items: center; gap: 12px; padding: 14px 28px; border-top: 1px solid var(--line); }
.send-foot .picker-note { min-width: 0; }
.send-foot .pill { height: 48px; padding: 0 22px; font-size: 15px; }
.done-head { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 36px 28px 20px; text-align: center; }
.done-icon { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: #e6f7f1; color: #127566; }
.done-icon.partly { background: #fff4e6; color: #9a5b00; }
.done-icon svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.done-head .sheet-title { flex: none; margin-top: 6px; }
.done-text { color: var(--muted); font-size: 15px; line-height: 1.5; }
.done-list { min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; padding: 0 28px 8px; }
.done-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line-soft); }
.done-row .avatar { width: 36px; height: 36px; font-size: 14px; }
.done-row-text { flex: 1; min-width: 150px; display: flex; flex-direction: column; gap: 1px; }
.done-status { color: #127566; font-size: 13px; line-height: 1.4; }
.done-status.fail { color: #9a5b00; }
.done-foot { padding: 16px 28px 24px; }
.done-foot .pill { width: 100%; height: 48px; font-size: 15px; font-weight: 700; }

/* ---------- Toast ---------- */

.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 30;
  padding: 12px 20px; border-radius: 999px;
  background: var(--ink); color: #fff;
  font-size: 14px; font-weight: 500; white-space: nowrap;
  transform: translateX(-50%);
  box-shadow: 0 20px 40px -16px rgba(10, 27, 45, .5);
}
body.sorting .toast { bottom: 96px; }

/* ---------- Phone ---------- */

@media (max-width: 760px) {
  :root { --poster-radius: 18px; }
  .topbar-in { padding: 0 16px; gap: 8px; }
  .admin-pill { padding: 0 12px; }
  .admin-label { display: none; }
  .shell { padding: 16px 16px 0; }
  .page-title { font-size: 28px; }
  .chips-box { margin: 0 -16px 20px; }
  .chips { padding: 0 16px 2px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 12px; }
  .sortbar { width: calc(100% - 24px); bottom: 12px; }
  .sheet { width: 100%; max-height: 92%; margin: auto 0 0; border-radius: 28px 28px 0 0; }
  .viewer { max-height: 92%; }
  .team, .vm, .tx, .mcp, .links, .send-sheet { width: 100%; max-height: 92%; }
  .send-head, .send-body, .send-foot, .done-list { padding-left: 16px; padding-right: 16px; }
  .sortbar { padding-left: 16px; }
  .bar-cancel { padding: 0 10px; }
  .bar-action { padding: 0 14px; }
  .picker { width: 100%; height: 88%; }
  .picker-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .picker-head, .picker-body, .picker-foot { padding-left: 16px; padding-right: 16px; }
}

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

/* ---------- Sign-in ---------- */

.signin { position: relative; display: grid; place-items: center; min-height: 100vh; padding: 24px; overflow: hidden; }
.signin-shape { position: absolute; aspect-ratio: 9 / 16; border-radius: 32px; opacity: .9; }
.signin-shape.one { left: calc(50% - 400px); top: 12%; width: 260px; background: linear-gradient(160deg, #bfe6ff, #eaf6ff 55%, #fff1ea); transform: rotate(-14deg); }
.signin-shape.two { left: calc(50% + 170px); top: 30%; width: 230px; background: linear-gradient(160deg, #ffdcc8, #fff1ea 55%, #eaf6ff); transform: rotate(12deg); }
.signin-card {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 16px;
  width: 100%; max-width: 400px; padding: 40px 36px;
  border-radius: 32px; background: #fff; text-align: center;
  box-shadow: 0 40px 80px -30px rgba(10, 27, 45, .25);
}
.signin-card .mark { width: 40px; height: 40px; }
.signin-card h1 { margin-top: 8px; font-size: 30px; letter-spacing: -.025em; }
.signin-card .lede { color: var(--muted); font-size: 15px; line-height: 1.5; text-wrap: pretty; }
.tg-button {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; margin-top: 12px; padding: 15px 20px;
  border-radius: 999px; background: var(--ink); color: #fff;
  font-size: 16px; font-weight: 600;
}
.tg-button:hover { background: #13304f; color: #fff; }
.tg-button svg { width: 20px; height: 20px; fill: var(--cyan); }
.signin-error { color: var(--danger); font-size: 14px; font-weight: 500; }
.signin-card .fine { margin-top: 4px; }
@media (max-width: 760px) { .signin-shape { display: none; } }

/* TeleReel's item assistant: a quiet dock with the source card anchored to the composer. */
.agent-card-ask { color: #248bff; background: #eaf4ff; }
.agent-ask { color: #1475d1; border-color: #cde5ff; background: #f0f7ff; }
.agent-scrim { display: none; }
.agent-panel { position: fixed; z-index: 95; right: 20px; bottom: 20px; width: min(430px, calc(100vw - 40px)); height: min(850px, calc(100dvh - 40px)); display: flex; flex-direction: column; background: #fff; border: 1px solid #dde5ed; border-radius: 28px; box-shadow: 0 18px 70px #122c4b30; overflow: hidden; animation: agent-in .18s ease-out; }
.agent-header { display: flex; align-items: center; gap: 12px; padding: 17px 18px; border-bottom: 1px solid #edf1f5; flex-shrink: 0; }
.agent-header > div { flex: 1; min-width: 0; }
.agent-header strong { font-size: 15px; line-height: 1.3; }
.agent-header p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.agent-orb { display: grid; place-items: center; width: 42px; height: 42px; flex: none; border-radius: 50%; color: #fff; font-size: 25px; background: linear-gradient(135deg, #149dff, #5f7cff); box-shadow: 0 3px 10px #248bff40; }
.agent-icon-button { border: 0; border-radius: 50%; width: 32px; height: 32px; display: grid; place-items: center; background: #f2f5f8; color: var(--ink); font-size: 22px; flex: none; }
.agent-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 24px 18px; }
.agent-welcome h2 { margin: 0; color: var(--ink); font-size: 25px; line-height: 1.2; letter-spacing: -.025em; font-weight: 700; }
.agent-welcome > p { margin: 10px 0 22px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.agent-suggestions { display: flex; flex-direction: column; gap: 10px; }
.agent-suggestions button { display: flex; align-items: center; gap: 12px; padding: 13px; text-align: left; background: #f3f6f9; border: 1px solid transparent; border-radius: 16px; color: var(--ink); }
.agent-suggestions button:hover { border-color: #cfe4ff; background: #eef6ff; }
.agent-suggestions button > span { width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid #e1e9f1; border-radius: 10px; color: #248bff; background: #fff; font-size: 19px; flex: none; }
.agent-suggestions b { flex: 1; font-size: 13px; font-weight: 600; }
.agent-suggestions i { font-style: normal; color: #93a3b5; font-size: 22px; }
.agent-messages { display: flex; flex-direction: column; gap: 18px; }
.agent-message { font-size: 14px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.agent-user { align-self: flex-end; max-width: 92%; padding: 12px 15px; border-radius: 18px 18px 4px 18px; background: #edf5ff; color: #142c44; }
.agent-answer { display: flex; align-items: flex-start; gap: 10px; }
.agent-answer-mark { color: #248bff; font-size: 20px; flex: none; }
.agent-answer-body { min-width: 0; }
.agent-thinking .agent-answer-mark { animation: agent-pulse 1.2s infinite; }
.agent-retry { margin-top: 8px; font-size: 12px; }
.agent-footer { flex-shrink: 0; padding: 12px 14px 14px; border-top: 1px solid #f0f3f7; }
.agent-status { margin: 0 4px 10px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.agent-options { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0 4px 10px; font-size: 12px; color: var(--muted); }
.agent-options label { display: flex; align-items: center; gap: 5px; max-width: 100%; }
.agent-options select { min-width: 0; max-width: 230px; border: 1px solid #dce6ee; border-radius: 7px; padding: 4px; color: var(--ink); background: #fff; font: inherit; }
.agent-attached { display: flex; align-items: center; gap: 12px; padding: 6px; margin-bottom: 8px; border: 1px solid #cce4ff; border-radius: 14px; background: #f3f9ff; }
.agent-attached > span { display: grid; place-items: center; width: 32px; height: 48px; flex: none; border-radius: 8px; background: #e4e2ff; color: #6258cd; font-size: 15px; font-weight: 700; }
.agent-attached > div { min-width: 0; }
.agent-attached b { color: #248bff; font-size: 10px; letter-spacing: .08em; }
.agent-attached p { margin: 2px 0 0; font-size: 12px; font-weight: 600; overflow-wrap: anywhere; }
.agent-compose { display: flex; align-items: flex-end; gap: 8px; padding: 6px; border: 1px solid #dfe7ef; border-radius: 24px; background: #f5f7fa; }
.agent-compose textarea { width: 100%; min-height: 36px; max-height: 120px; resize: vertical; padding: 9px 8px; border: 0; background: transparent; color: var(--ink); font: inherit; font-size: 14px; line-height: 1.4; }
.agent-compose textarea:focus { outline: none; }
.agent-compose:focus-within { border-color: #248bff; box-shadow: 0 0 0 2px #248bff1a; }
.agent-compose button { width: 36px; height: 36px; flex: none; border: 0; border-radius: 50%; background: #248bff; color: #fff; font-size: 24px; }
.agent-compose button:disabled { background: #bac7d3; cursor: default; }
.agent-note { margin: 7px 3px 0; color: #899cb0; font-size: 10px; text-align: center; line-height: 1.4; }
.agent-panel :is(button, select):focus-visible { outline: 2px solid #248bff; outline-offset: 3px; }
@keyframes agent-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes agent-pulse { 50% { opacity: .35; } }
@media (max-width: 640px) {
  .agent-panel { right: 0; bottom: 0; width: 100%; height: 88dvh; max-height: calc(100dvh - 12px); border-radius: 24px 24px 0 0; }
  .agent-scrim { display: block; position: fixed; inset: 0; z-index: 94; background: #0c21394d; }
  .agent-header { padding: 16px; }
  .agent-body { padding: 22px 16px; }
  .agent-footer { padding-bottom: max(14px, env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) { .agent-panel, .agent-thinking .agent-answer-mark { animation: none; } }

/* Vault owners' activity report follows the library's existing controls and type. */
.va-dialog { width: min(1180px,calc(100vw - 40px)); max-height: calc(100dvh - 48px); border: 1px solid #dae3ed; border-radius: 24px; padding: 28px; color: #102333; background: #fff; box-shadow: 0 24px 80px #0a223333; }
.va-dialog::backdrop { background: #0a223366; backdrop-filter: blur(3px); }
.va-head { display: flex; justify-content: space-between; align-items: start; gap: 16px; }
.va-head h2 { margin: 4px 0 16px; font-size: 26px; letter-spacing: -.7px; }
.va-eyebrow { margin: 0; font-size: 11px; letter-spacing: 1.2px; color: #647b92; font-weight: 700; }
.va-note { color: #64778b; font-size: 13px; line-height: 1.6; max-width: 980px; }
.va-filters { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; margin: 24px 0 12px; }
.va-filters label { display: grid; gap: 6px; font-size: 12px; font-weight: 600; min-width: 160px; max-width: 320px; flex: 1; }
.va-filters select { width: 100%; min-height: 40px; padding: 8px 12px; border: 1px solid #d7e2ed; border-radius: 10px; color: inherit; background: #f5f8fb; font: inherit; }
.va-stats { display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); gap: 10px; margin: 24px 0 28px; }
.va-stat { display: grid; gap: 6px; padding: 16px; border: 1px solid #e2eaf2; border-radius: 14px; background: #f8fafc; }
.va-stat strong { font-size: 28px; font-weight: 650; letter-spacing: -1px; }
.va-stat span { font-size: 12px; color: #64778b; }
.va-dialog h3 { font-size: 16px; margin: 28px 0 12px; }
.va-scroll { overflow: auto; border: 1px solid #e2eaf2; border-radius: 12px; }
.va-scroll table { width: 100%; border-collapse: collapse; font-size: 12px; text-align: left; }
.va-scroll th { background: #f4f7fa; color: #60758a; font-size: 11px; font-weight: 600; white-space: nowrap; }
.va-scroll td,.va-scroll th { padding: 12px 14px; border-bottom: 1px solid #e8edf3; }
.va-scroll td:first-child { min-width: 160px; max-width: 280px; overflow-wrap: anywhere; font-weight: 550; }
.va-scroll tr:last-child td { border-bottom: 0; }
.va-scroll td { font-variant-numeric: tabular-nums; }
@media(max-width:700px) { .va-dialog { width: calc(100vw - 16px); max-height: calc(100dvh - 16px); padding: 20px 14px; border-radius: 18px; } .va-stats { grid-template-columns: repeat(3,minmax(0,1fr)); } .va-head h2 { font-size: 22px; } .va-filters label { max-width: none; min-width: 130px; } }
.picker-source-heading { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.picker-source-heading h3 { margin: 0; font-size: 16px; }
.picker-source-heading:has(> button[hidden]):has(> h3[hidden]) { display: none; }
.picker-sources { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.picker-source { display: flex; flex-direction: column; align-items: start; gap: 8px; padding: 18px; border: 1px solid var(--line,#e2e8f0); border-radius: 14px; background: #f6f9fc; text-align: left; color: inherit; font: inherit; cursor: pointer; }
.picker-source:hover { background: #eaf4fc; border-color: #a5d5fa; }
.picker-source-name { font-weight: 650; overflow-wrap: anywhere; }
.picker-source-count { font-size: 12px; color: #718298; }
@media(max-width:600px) { .picker-sources { grid-template-columns: 1fr; } }
/* Keep chat on its own row so it remains easy to find beside send/download. */
.actions-main { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
.actions-main .agent-ask { grid-column: 1 / -1; }
.actions-main .pill { min-height: 48px; height: auto; padding: 10px 12px; white-space: normal; line-height: 1.3; }
.actions-main .icon { flex-shrink: 0; }
.actions-main:has(#viewer-send[hidden]) .download { grid-column: 1 / -1; }

.agent-answer-body { white-space: normal; max-width: 100%; }
.agent-answer-body p { margin: 0 0 12px; }
.agent-answer-body p:last-child { margin-bottom: 0; }
.agent-answer-body h3,.agent-answer-body h4,.agent-answer-body h5 { margin: 16px 0 8px; font-size: 15px; line-height: 1.4; }
.agent-answer-body > :first-child { margin-top: 0; }
.agent-answer-body strong { font-weight: 700; }
.agent-answer-body ul,.agent-answer-body ol { margin: 8px 0 14px; padding-left: 22px; list-style-position: outside; }
.agent-answer-body ul { list-style-type: disc; }
.agent-answer-body ol { list-style-type: decimal; }
.agent-answer-body li { margin: 6px 0; }
.agent-answer-body code { font-family: var(--data); font-size: 12px; background: #f0f4f8; padding: 2px 5px; border-radius: 4px; }
.agent-answer-body pre { max-width: 100%; overflow-x: auto; white-space: pre; padding: 12px; background: #f0f4f8; border-radius: 10px; margin: 10px 0; }
.agent-answer-body pre code { padding: 0; }
.agent-answer-body blockquote { margin: 10px 0; padding-left: 12px; border-left: 3px solid #c5dcf4; color: var(--muted); }
.agent-answer-body a { color: #1475d1; text-decoration: underline; }
.agent-answer-body hr { margin: 14px 0; border: 0; border-top: 1px solid var(--line); }

@media(max-width:600px) {
  .sortbar { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; padding: 12px; }
  .sortbar .bar-text { grid-column: 1 / -1; }
  .sortbar #sel-all { grid-row: 2; grid-column: 1; }
  .sortbar #sel-clear { grid-row: 2; grid-column: 2; }
  .sortbar .bar-cancel { grid-row: 2; grid-column: 3; }
  .sortbar .bar-act { grid-row: 3; grid-column: 1 / -1; }
  .sortbar .bar-action { width: 100%; justify-content: center; }
}
