/* ─────────────────────────────────────────────────────────────────────────────
   XYTRO CLOUD — the same design language as the Xena webchat.

   WHAT THIS REPLACES
   ------------------
   The page was glass-and-gradient: two radial washes, blurred panels at 72% opacity,
   20px radii, a gradient wordmark, a gradient "plan" chip and a gradient primary button.
   Every element competed, so nothing led — the file grid is the subject of this page and
   it was the quietest thing on it.

   THE RULES USED HERE (identical to the webchat overhaul)
   ------------------------------------------------------
   1. ONE accent. Teal marks the primary action and the selected item, nothing else.
      Anything that used the gradient for decoration now uses ink or a hairline.
   2. Neutral, solid surfaces. Panels are a flat token, not a blur; separation comes from
      a 1px line and a 1px shadow, not from opacity games that break over any background.
   3. One type scale — .72 / .78 / .86 / 1.02 / 1.28rem — and ONE family. Mono is for
      numbers only (sizes, percentages, the clock), because that is where it earns its
      place by lining digits up.
   4. Tighter radii (14 / 10 / pill). 20px on a 42px tile reads as a blob.
   5. Dark and light are the SAME design with the tokens swapped: the light block at the
      end only redefines colours, so nothing can drift out of sync.
   6. The file grid leads: quiet cards, one clear hover, and the size as the only
      secondary line. Actions stay in the toolbar so the grid has no chrome of its own.
   ───────────────────────────────────────────────────────────────────────────── */
:root {
  color-scheme: dark;

  --bg: #0d0d0f;
  --surface: #16161a;
  --surface-2: #1d1d22;
  --surface-3: #26262c;
  --line: rgba(255, 255, 255, .08);
  --line-strong: rgba(255, 255, 255, .14);

  --ink: #ececf1;
  --muted: #9a9aa6;
  --dim: #6b6b76;

  --accent: #2dd4bf;
  --accent-ink: #06201d;         /* text ON the accent */
  --accent-soft: rgba(45, 212, 191, .12);
  --accent-line: rgba(45, 212, 191, .38);
  --info: #7aa2f7;
  --violet: #a78bfa;
  --danger: #f87171;
  --warn: #fbbf24;
  --ok: #34d399;

  --radius: 14px;
  --radius-sm: 10px;
  --radius-pill: 999px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-lg: 0 18px 50px rgba(0, 0, 0, .55);
  --mono: ui-monospace, 'JetBrains Mono', SFMono-Regular, Menlo, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }

body {
  font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  /* ONE flat ground. The two radial washes are gone: they tinted every panel underneath
     them, which is why the old panels needed backdrop-filter to stay legible. */
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--accent-soft); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb {
  background: rgba(127, 127, 127, .28);
  border-radius: 10px;
  border: 2px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: rgba(127, 127, 127, .45); background-clip: content-box; }

/* ── Login ─────────────────────────────────────────────────────────────── */
#loginBox { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 24px; }

.login {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 40px 36px;
  width: 100%;
  max-width: 400px;
  text-align: center;
  box-shadow: var(--shadow-lg);
}

.login .logo {
  width: 52px; height: 52px;
  border-radius: 14px;
  background: var(--surface-3);
  border: 1px solid var(--line-strong);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 18px;
}

.login h1 { font-size: 1.28rem; font-weight: 700; letter-spacing: -.02em; }
.login .sub { font-size: .86rem; color: var(--muted); margin-top: 6px; margin-bottom: 22px; }

.login a.mail,
.login a.direct {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 14px; margin: 8px 0;
  border-radius: var(--radius-sm);
  text-decoration: none; font-size: .86rem; font-weight: 600;
  transition: background .14s, border-color .14s, color .14s;
}

.login a.mail {
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  color: var(--accent);
}
.login a.mail:hover { background: rgba(45, 212, 191, .18); }

.login a.direct {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  font-weight: 500;
}
.login a.direct:hover { border-color: var(--line-strong); color: var(--ink); }

.spinner {
  width: 26px; height: 26px;
  border: 2px solid var(--line-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
  margin: 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Shell ─────────────────────────────────────────────────────────────── */
#app { display: none; max-width: 1180px; margin: 0 auto; padding: 26px 28px 120px; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; margin-bottom: 18px; flex-wrap: wrap;
}

.brand { display: flex; align-items: center; gap: 12px; }
.brand .logo {
  width: 40px; height: 40px;
  border-radius: 11px;
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.brand .logo img, .login .logo img {
  width: 100%; height: 100%; object-fit: cover; border-radius: inherit; display: block;
}
/* The wordmark is INK, not a gradient. A gradient headline is decoration; the accent is
   spent on the one action that matters. */
.brand h1 { font-size: 1.02rem; font-weight: 700; letter-spacing: -.01em; color: var(--ink); }
.brand .tag {
  font-size: .72rem; color: var(--muted);
  margin-top: 1px; letter-spacing: .06em; text-transform: uppercase;
}

.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 13px;
  border-radius: var(--radius-sm);
  font: inherit; font-size: .82rem; font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  color: var(--ink);
  white-space: nowrap;
  transition: background .14s, border-color .14s, color .14s;
}
.btn:hover { background: var(--surface-3); border-color: var(--line-strong); }
.btn .ico { width: 15px; height: 15px; }

.btn .ico, .card .icon svg, .planbar .badge svg, .planbar .feat .ico,
.empty .big svg, .login a svg, #upBar svg {
  fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0;
}

/* The ONE accent surface on the page. */
.btn-primary {
  background: var(--accent);
  border-color: transparent;
  color: var(--accent-ink);
}
.btn-primary:hover { background: #5eead4; border-color: transparent; color: var(--accent-ink); }

.btn-danger { color: var(--danger); border-color: rgba(248, 113, 113, .3); background: transparent; }
.btn-danger:hover { background: rgba(248, 113, 113, .12); border-color: var(--danger); color: var(--danger); }
.btn:disabled { opacity: .35; pointer-events: none; }

/* ── Plan bar ──────────────────────────────────────────────────────────── */
.planbar {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.planbar .badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 11px;
  border-radius: var(--radius-pill);
  /* A plan is a LABEL, not a trophy: accent text on an accent tint, no gradient fill. */
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  color: var(--accent);
  font-size: .73rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
}

.planbar .feats { display: flex; gap: 6px; flex-wrap: wrap; }
.planbar .feat {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: .74rem; color: var(--muted);
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  background: transparent;
}
.planbar .feat .ico { width: 12px; height: 12px; color: var(--accent); }

/* ── Stats ─────────────────────────────────────────────────────────────── */
.stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px; margin-bottom: 14px;
}

.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  position: relative;
}
/* No gradient cap. A hairline that only exists to say "this is a card" is noise; the
   border already does that. */
.stat .v {
  /* SANS, not mono: one of these four cards holds an EMAIL ADDRESS, and an address set in
     a monospace face at headline size reads as a code or a token. Tabular figures give the
     same steady alignment for the three that ARE numbers, without the typewriter look. */
  font-size: 1.18rem; font-weight: 700; letter-spacing: -.015em;
  font-variant-numeric: tabular-nums;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.stat .l {
  font-size: .7rem; color: var(--muted); margin-top: 4px;
  text-transform: uppercase; letter-spacing: .07em;
}

/* ── Usage ─────────────────────────────────────────────────────────────── */
.usage {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  margin-bottom: 14px;
}
.usage .row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 9px; }
.usage .lbl { font-size: .8rem; color: var(--muted); }
.usage .amt { font-size: .82rem; font-variant-numeric: tabular-nums; font-family: var(--mono); }

.track {
  height: 7px;
  border-radius: var(--radius-pill);
  background: var(--surface-3);
  overflow: hidden;
}
.bar { width: 100%; }
.bar.seg { display: flex; gap: 2px; height: 8px; border-radius: var(--radius-pill); overflow: hidden; background: var(--surface-3); }
.fill {
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width .3s ease;
}
.seg-files { height: 100%; background: var(--accent); }
.seg-mail { height: 100%; background: var(--info); }
.seg-cache { height: 100%; background: var(--violet); }

.legend {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  font-size: .76rem; color: var(--muted);
  margin-top: 10px;
}
.legend .dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 5px; vertical-align: middle; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

/* ── Breadcrumbs + selection bar ───────────────────────────────────────── */
.crumbs {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  font-size: .82rem; color: var(--muted);
  margin: 4px 0 14px;
}
.crumbs a, .crumbs button {
  color: var(--muted); text-decoration: none; font: inherit;
  background: none; border: 0; cursor: pointer; padding: 2px 2px;
  border-radius: 6px;
}
.crumbs a:hover, .crumbs button:hover { color: var(--ink); }

.selbar {
  display: none;
  align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 14px; margin-bottom: 12px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  font-size: .82rem;
}
.selbar.show { display: flex; }
.selbar .cnt { font-weight: 600; color: var(--accent); }
.selbar .spacer { flex: 1; }

/* ── The file grid: the subject of the page ────────────────────────────── */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 10px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 13px 14px;
  cursor: pointer;
  transition: background .14s, border-color .14s;
  display: flex; align-items: center; gap: 11px;
  user-select: none;
  position: relative;
}
.card:hover { background: var(--surface-2); border-color: var(--line-strong); }
/* Selection is the accent, and it says so on the BORDER plus a tint — a border alone is
   easy to miss on a dark surface. */
.card.sel { border-color: var(--accent-line); background: var(--accent-soft); }

.card .icon {
  width: 36px; height: 36px;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  background: var(--surface-3);
  color: var(--muted);
}
.card .icon svg { width: 18px; height: 18px; }
/* Type tints stay, but muted: a grid of saturated tiles competes with the names, which
   are what the reader is actually scanning. */
.card .icon.folder { color: var(--violet); }
.card .icon.image { color: var(--accent); }
.card .icon.audio { color: #f472b6; }
.card .icon.video { color: #fb923c; }
.card .icon.archive { color: var(--warn); }
.card .icon.code { color: #5eead4; }
.card .icon.text { color: var(--muted); }

.card .info { min-width: 0; flex: 1; }
.card .nm {
  font-size: .86rem; font-weight: 600; letter-spacing: -.01em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.card .sz {
  font-size: .73rem; color: var(--dim);
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  margin-top: 2px;
}
.card .meta { font-size: .73rem; color: var(--dim); }

.card .check {
  position: absolute; top: 9px; right: 9px;
  width: 18px; height: 18px; border-radius: 50%;
  border: 1.5px solid var(--line-strong);
  background: var(--surface);
  display: flex; align-items: center; justify-content: center;
}
.card.sel .check { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.card .check svg { width: 11px; height: 11px; stroke-width: 3; }

/* ── Empty state ───────────────────────────────────────────────────────── */
.empty {
  grid-column: 1 / -1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 56px 20px;
  text-align: center;
  color: var(--muted);
  font-size: .86rem;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: transparent;
}
.empty .big {
  width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-2);
  color: var(--dim);
  margin-bottom: 12px;
}
.empty .big svg { width: 22px; height: 22px; }

/* ── Viewer ────────────────────────────────────────────────────────────── */
.viewer-overlay {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(0, 0, 0, .78);
  display: none; align-items: center; justify-content: center;
  padding: 28px;
}
.viewer-overlay.show, .viewer-overlay[style*="flex"] { display: flex; }

.viewer-body {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  max-width: min(1000px, 94vw);
  max-height: 90vh;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.viewer-head {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}
.viewer-name { font-size: .86rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer-acts { margin-left: auto; display: flex; gap: 6px; }
.viewer-img, .viewer-video { max-width: 100%; max-height: 76vh; display: block; background: #000; }
.viewer-audio { padding: 18px; }
.viewer-text {
  padding: 16px; overflow: auto; max-height: 70vh;
  font-family: var(--mono); font-size: .78rem; line-height: 1.6;
  white-space: pre-wrap; word-break: break-word;
  color: var(--ink); background: var(--bg);
}
.viewer-nopreview { padding: 40px 24px; color: var(--muted); font-size: .84rem; text-align: center; }

/* ── Trash ─────────────────────────────────────────────────────────────── */
.trash-overlay {
  position: fixed; inset: 0; z-index: 95;
  background: rgba(0, 0, 0, .78);
  display: none; align-items: center; justify-content: center;
  padding: 28px;
}
.trash-overlay.show, .trash-overlay[style*="flex"] { display: flex; }

.trash-panel {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: min(720px, 94vw);
  max-height: 84vh;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.trash-head {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.trash-title { font-size: .95rem; font-weight: 700; }
.trash-sub { font-size: .76rem; color: var(--muted); }
.trash-actions { margin-left: auto; display: flex; gap: 6px; }
.trash-list { overflow: auto; padding: 8px; }
.trash-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  font-size: .82rem;
  border: 1px solid transparent;
}
.trash-item:hover { background: var(--surface-2); border-color: var(--line); }

/* ── Toast ─────────────────────────────────────────────────────────────── */
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(12px);
  background: var(--surface-3);
  border: 1px solid var(--line-strong);
  color: var(--ink);
  padding: 11px 16px;
  border-radius: var(--radius-sm);
  font-size: .82rem; font-weight: 500;
  box-shadow: var(--shadow-lg);
  opacity: 0; pointer-events: none;
  transition: opacity .18s, transform .18s;
  z-index: 120;
  max-width: min(520px, 92vw);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { border-color: rgba(248, 113, 113, .5); color: #fecaca; }

/* ── Upload bar ────────────────────────────────────────────────────────── */
#upBar {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%);
  width: min(460px, 92vw);
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  box-shadow: var(--shadow-lg);
  display: none;
  z-index: 100;
}
#upBar .row { display: flex; justify-content: space-between; font-size: .78rem; margin-bottom: 7px; }

/* ── Light theme: the SAME design, tokens swapped ──────────────────────── */
@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --bg: #f7f7f8;
    --surface: #ffffff;
    --surface-2: #f1f1f3;
    --surface-3: #e8e8ec;
    --line: rgba(0, 0, 0, .09);
    --line-strong: rgba(0, 0, 0, .16);
    --ink: #17171a;
    --muted: #5f5f6a;
    --dim: #85858f;
    --accent: #0d9488;
    --accent-ink: #ffffff;
    --accent-soft: rgba(13, 148, 136, .1);
    --accent-line: rgba(13, 148, 136, .38);
    --info: #2563eb;
    --violet: #7c3aed;
    --shadow: 0 1px 2px rgba(0, 0, 0, .06);
    --shadow-lg: 0 18px 50px rgba(0, 0, 0, .18);
  }
  ::-webkit-scrollbar-thumb { background: rgba(0, 0, 0, .2); background-clip: content-box; }
  .btn-primary:hover { background: #0f766e; }
  .login a.mail:hover { background: rgba(13, 148, 136, .16); }
  .viewer-overlay, .trash-overlay { background: rgba(0, 0, 0, .45); }
  .toast.err { color: #b91c1c; }
}

/* ─────────────────────────────────────────────────────────────────────────────
   INTERACTION — the affordances that make the page feel operable.

   A grid of static tiles answers "what is here?" but not "what can I do?".
   Everything below exists to answer the second question on screen: a real focus
   ring you can tab to, a card that depresses when pressed, a thumbnail that
   shows you THIS picture rather than a generic glyph, per-card actions on hover
   and a target you can see while dragging files in.
   ───────────────────────────────────────────────────────────────────────────── */

/* Press + focus. A card that does not move under the cursor reads as an image. */
.card { outline: none; }
.card:active { background: var(--surface-3); }
.card:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

/* THUMBNAILS. The icon tile stays for everything we cannot render, but an image
   shows itself — "IMG_0981.png" tells you nothing about the picture. */
.card .icon.has-thumb {
  background: var(--surface-3) center/cover no-repeat;
  border: 1px solid var(--line);
  overflow: hidden;
  color: transparent;          /* the <svg> glyph must not paint over the photo */
}
.card .icon.has-thumb svg { display: none; }

/* Per-card actions: revealed on hover, focus or selection, never permanently. */
.card .acts {
  position: absolute;
  right: 8px;
  bottom: 8px;
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity .12s;
}
.card:hover .acts,
.card:focus-within .acts,
.card.sel .acts { opacity: 1; }

.card .act {
  width: 26px; height: 26px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 7px;
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  color: var(--muted);
  cursor: pointer;
  padding: 0;
}
.card .act:hover { color: var(--ink); background: var(--surface-3); }
.card .act.danger:hover { color: var(--danger); border-color: rgba(248,113,113,.45); }
.card .act svg { width: 13px; height: 13px; stroke-width: 2; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; }

/* The check sits top-right; the actions bottom-right, so they never collide. */
.card .check { opacity: 0; transition: opacity .12s; }
.card:hover .check,
.card.sel .check,
.card:focus-within .check { opacity: 1; }

/* Drop target: while files are dragged over the window, the grid says so. */
body.dragging-file .grid {
  outline: 2px dashed var(--accent-line);
  outline-offset: 8px;
  border-radius: var(--radius);
}
body.dragging-file #app::after {
  content: "Drop to upload";
  position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%);
  padding: 8px 16px; border-radius: var(--radius-pill);
  background: var(--accent); color: var(--accent-ink);
  font-size: .8rem; font-weight: 700;
  z-index: 110; pointer-events: none;
}

/* The "N items" line above the grid: the count is orientation, the sort is a control. */
.listmeta {
  display: flex; align-items: center; gap: 10px;
  font-size: .76rem; color: var(--muted);
  margin: 0 0 10px;
}
.listmeta .spacer { flex: 1; }

/* First-paint skeleton, so an empty grid never looks like an empty folder. */
.skeleton {
  border-radius: var(--radius);
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface-2) 37%, var(--surface) 63%);
  background-size: 400% 100%;
  animation: sk 1.3s ease infinite;
  height: 64px;
}
@keyframes sk { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

/* The hover actions sit over the size line unless the text reserves the space. */
.card .info { transition: padding-right .12s; }
.card:hover .info,
.card:focus-within .info,
.card.sel .info { padding-right: 62px; }

/* ── AI panel (AI Sort plan / AI Search results / Interpretation) ───────── */
.ai-panel {
  position: fixed; right: 20px; bottom: 20px; z-index: 105;
  width: min(520px, 94vw); max-height: 76vh;
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.ai-head {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; border-bottom: 1px solid var(--line);
}
.ai-title { font-size: .88rem; font-weight: 700; }
.ai-head .spacer { flex: 1; }
.ai-body { padding: 12px 14px; overflow: auto; font-size: .84rem; line-height: 1.6; }
.ai-body .grp { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; margin-bottom: 8px; }
.ai-body .grp b { display: block; margin-bottom: 4px; }
.ai-body .grp .f { color: var(--muted); font-size: .78rem; font-family: var(--mono); }
.ai-body .actions { display: flex; gap: 8px; margin-top: 10px; }
.ai-body .note { color: var(--muted); font-size: .78rem; }
.ai-body .ans { white-space: pre-wrap; }

/* A locked plan control still answers: it says what it is and what it costs. */
.btn.locked { opacity: .55; }
/* The protected folder is marked in the grid, so its missing Delete is expected. */
.card .lock { position: absolute; top: 9px; right: 34px; color: var(--muted); }
.card .lock svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2; }
