/* Solution Library.
   Palette and type are the design comp's, which is the Questt house identity: warm paper, forest
   green, Georgia over IBM Plex Sans. An earlier pass used the intelligencewarehouse.com palette
   instead — #1B6B5A with DM Serif Display and Inter — on the reasoning that the page is served
   under that domain. Wrong call: this is Questt's internal library, not a page of the marketing
   site, and DM Serif Display ships one very heavy weight that shouted at every size. */

:root {
  --bg: #FAFAF8;                /* warm paper */
  --card: #FFFFFF;
  --border: #E5E2DB;
  --rule: #D8D4CB;              /* a divider that has to read against --raised */
  --text: #1C1B17;
  --ink-soft: #33322D;          /* row titles: present without going full black */
  --sub: #6E6C63;
  --muted: #9A978C;

  --accent: #2D5A3D;            /* Questt forest green */
  --accent-hover: #234A31;
  --accent-soft: #E7EEE8;
  --accent-line: #CBDCCF;
  --copper: #A85D3B;
  --copper-soft: #F5E9E2;
  --neutral-soft: #F1F0EA;
  --raised: #F4F3EE;            /* an expanded row, lifted off the page */
  --danger: #A23B2C;

  --display: Georgia, 'Times New Roman', serif;
  --serif-soft: Georgia, 'Times New Roman', serif;
  --body: 'IBM Plex Sans', ui-sans-serif, system-ui, -apple-system, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  /* The index is one grid, declared once so the header row and every row below it cannot drift
     apart. Changing a column width here changes both. */
  /* Industry is deliberately not a column. On this library most rows share one value — ten FMCG
     in a row is a column doing no work — and the By-industry tab is the lens for it. It stays in
     the expanded view, where it is about one use case rather than repeated down the page. */
  --cols: minmax(0, 1fr) 190px 250px 34px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: var(--body); color: var(--text); background: var(--bg); }
button { font: inherit; cursor: pointer; }
button:disabled { opacity: .45; cursor: not-allowed; }
button:focus-visible, a:focus-visible, .in:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
[hidden] { display: none !important; }

.page {
  min-height: 100vh;
  background-color: var(--bg);
  background-image:
    linear-gradient(rgba(28,27,23,.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(28,27,23,.028) 1px, transparent 1px);
  background-size: 72px 72px, 72px 72px;
}
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 36px; }

.eyebrow {
  font-family: var(--mono); font-size: 11px; letter-spacing: .16em;
  text-transform: uppercase; color: var(--copper);
}
.display {
  font-family: var(--display); font-weight: 700; font-size: 46px; margin: 14px 0 0;
  line-height: 1.06; letter-spacing: -.01em;
}
.hl { color: var(--accent); font-style: italic; }
.count {
  font-family: var(--mono); font-size: 11px; color: var(--muted);
  letter-spacing: .14em; text-transform: uppercase; white-space: nowrap;
}

/* --- nav --------------------------------------------------------------------------------- */
.nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 0; border-bottom: 1px solid var(--border);
}
.logo { font-family: var(--mono); font-size: 21px; font-weight: 500; letter-spacing: -.02em; }
.nav-right { display: flex; align-items: center; gap: 16px; }
.who {
  font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted);
}
.linkbtn {
  background: none; border: none; color: var(--sub); font-family: var(--mono); font-size: 11px;
  letter-spacing: .1em; text-transform: uppercase; padding: 6px 2px;
}
.linkbtn:hover { color: var(--accent); }
.masthead { padding: 52px 36px 4px; }
.masthead-line { display: flex; align-items: baseline; justify-content: space-between; gap: 24px; }

/* --- controls and filters ----------------------------------------------------------------- */
.controls { display: flex; align-items: center; gap: 14px; margin-top: 30px; }
.search-wrap { position: relative; display: flex; align-items: center; flex: 1; min-width: 0; }
.search-wrap svg { position: absolute; left: 17px; color: var(--muted); pointer-events: none; }
/* .in.search, not .search: `.in { width: 100% }` is defined later in this file with equal
   specificity, so a bare .search rule loses to it. */
.in.search {
  width: 100%; border-radius: 999px; padding: 13px 18px 13px 44px; font-size: 15px;
}
.in.search:focus { border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-soft); }
.in.search::-webkit-search-cancel-button { cursor: pointer; }

.axis {
  display: flex; gap: 30px; margin-top: 26px; border-bottom: 1px solid var(--border);
}
.axis button {
  background: none; border: 0; padding: 13px 0; margin-bottom: -1px;
  font-family: var(--mono); font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted); border-bottom: 2px solid transparent;
  transition: color .14s ease, border-color .14s ease;
}
.axis button:hover { color: var(--text); }
.axis button.on { color: var(--text); border-bottom-color: var(--accent); }

/* Industry and function get a line each. Sharing one made a long chip list wrap into the other
   group's label, so the two vocabularies read as one run of words. */
.filters { margin-top: 20px; }
.filter-row { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.filter-row + .filter-row { margin-top: 10px; }
.filter-label {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted); width: 76px; flex-shrink: 0;
}
.chip {
  font-family: var(--mono); font-size: 11.5px; letter-spacing: .02em;
  padding: 7px 14px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--neutral-soft); color: var(--sub);
  transition: background .14s ease, border-color .14s ease, color .14s ease;
}
.chip:hover { border-color: var(--accent-line); color: var(--accent); }
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip.on:hover { color: #fff; }
/* The count is what makes a chip worth its space: it says how much is behind it before you spend
   a click finding out. Chips that would return nothing are not rendered at all. */
.chip-n { margin-left: 7px; opacity: .55; font-size: 10.5px; }
.chip.on .chip-n { opacity: .75; }
.chip-more {
  font-family: var(--mono); font-size: 11px; letter-spacing: .06em;
  color: var(--sub); background: transparent; border: 1px dashed var(--rule);
  border-radius: 999px; padding: 7px 13px;
}
.chip-more:hover { color: var(--accent); border-color: var(--accent-line); }
.clear {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--copper); background: none; border: 0; padding: 6px 4px;
}
.clear:hover { text-decoration: underline; }

/* --- the index ----------------------------------------------------------------------------
   A flat, filterable list that expands in place. It replaced a grid of cards behind a slide-over
   drawer: opening a use case there cost a panel that hid the list you were comparing against, and
   the assets — the thing anyone actually comes here for — were two clicks deep. */
.index-head {
  display: grid; grid-template-columns: var(--cols); gap: 16px;
  padding: 30px 18px 11px; margin-top: 8px; border-bottom: 1px solid var(--border);
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted);
}
.group-head { display: flex; align-items: baseline; gap: 12px; padding: 32px 18px 12px; }
/* Italic and a size below the masthead: a group heading is a signpost, not a second title. */
.group-head h2 {
  font-family: var(--serif-soft); font-weight: 400; font-style: italic; color: var(--accent);
  font-size: 26px; margin: 0; letter-spacing: -.005em;
}
.group-head .gcount { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.group-head .grule { flex: 1; height: 1px; background: var(--border); }
.group:first-child .group-head { padding-top: 18px; }

/* The inner lens. Rust mono against the outer green serif, so the two levels are told apart by
   voice rather than by size alone — at a glance you can see which way the view is nested without
   reading either label. */
.sub-head {
  display: flex; align-items: baseline; gap: 10px; padding: 16px 18px 8px;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--copper);
}
.sub-head .gcount { letter-spacing: 0; }
/* The first sub-header sits directly under its group heading, which already has the space. */
.subgroup:first-child .sub-head { padding-top: 6px; }
/* The last row of a sub-group keeps its rule; the group's own last row does not need one on top
   of the next group heading's whitespace. */
.group > .subgroup:last-child > .uc:last-child { border-bottom: 0; }

.uc { border-bottom: 1px solid var(--border); }
.uc-head {
  display: grid; grid-template-columns: var(--cols); gap: 16px; align-items: start;
  width: 100%; text-align: left; padding: 15px 18px; border: 0; background: transparent;
  transition: background .14s ease;
}
.uc-head:hover { background: var(--raised); }
.uc.open > .uc-head { background: var(--raised); }
.uc-head > span { min-width: 0; }

/* Every row is two lines, and the second one is never empty. Revealing it on hover kept the list
   short but left a row that is a bare name until you point at it, and a name alone does not say
   whether a use case has anything behind it. Where there is no subtitle the clients stand in, so
   the line always carries something — see subtitleFor(). */
.uc-name { display: block; min-width: 0; }
.uc-title {
  display: block; font-size: 15px; font-weight: 500; color: var(--ink-soft);
  letter-spacing: -.005em;
}
.uc-blurb {
  display: block; font-size: 13px; color: var(--sub); line-height: 1.5; margin-top: 1px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* The stand-in reads as a different kind of statement from an authored subtitle: it is derived,
   and italic muted is the cheapest way to say so without a label. */
.uc-blurb.derived { font-style: italic; color: var(--muted); }
.uc-meta {
  font-family: var(--mono); font-size: 11.5px; color: var(--sub); line-height: 1.45;
  overflow: hidden; text-overflow: ellipsis; padding-top: 3px;
}
/* What the row holds, named rather than totalled. Wraps to a second line when a use case carries
   the full set, which is why the row aligns its columns to the top rather than centring them. */
.uc-tags { display: flex; flex-wrap: wrap; gap: 5px; align-content: flex-start; }
.uc-tag {
  font-family: var(--mono); font-size: 9.5px; font-weight: 500; letter-spacing: .1em;
  text-transform: uppercase; border-radius: 5px; padding: 4px 8px; white-space: nowrap;
  color: var(--sub); background: var(--neutral-soft);
}
.uc-tag.t-template { color: var(--copper); background: var(--copper-soft); }
.uc-tag.t-client { color: var(--accent); background: var(--accent-soft); }
.uc-tag.empty { color: var(--muted); background: transparent; border: 1px dashed var(--border); }
.chev { color: var(--muted); justify-self: end; margin-top: 2px; transition: transform .16s ease; }
.uc.open .chev { transform: rotate(180deg); }

.uc-body { padding: 2px 18px 22px; background: var(--raised); }
/* Where the industry went when it stopped being a column. */
.uc-context {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted); margin: 6px 0 12px;
}
.assets { display: flex; flex-direction: column; gap: 8px; }

/* --- one asset row ------------------------------------------------------------------------ */
.xrow {
  display: flex; align-items: flex-start; gap: 15px;
  background: var(--card); border: 1px solid var(--border); border-radius: 10px;
  padding: 13px 15px;
  transition: border-color .14s ease, box-shadow .14s ease;
}
.xrow:hover { border-color: var(--accent-line); box-shadow: 0 2px 10px rgba(26,26,24,.045); }
.xtag {
  font-family: var(--mono); font-size: 9.5px; font-weight: 600; letter-spacing: .1em;
  text-transform: uppercase; border-radius: 6px; padding: 5px 0; width: 96px;
  text-align: center; flex-shrink: 0; margin-top: 2px;
  color: var(--sub); background: var(--neutral-soft);
}
.xtag.t-template { color: var(--copper); background: var(--copper-soft); }
.xtag.t-client { color: var(--accent); background: var(--accent-soft); }
.xmain { flex: 1; min-width: 0; }
.xline { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.xname { font-size: 14px; font-weight: 600; }
.xmeta { font-family: var(--mono); font-size: 10.5px; color: var(--muted); }
/* Quiet on purpose. It marks the one to copy, which matters to whoever generates from it and to
   nobody else scanning the list. */
.xcanon {
  font-family: var(--mono); font-size: 9px; font-weight: 500; letter-spacing: .1em;
  text-transform: uppercase; color: var(--copper); background: var(--copper-soft);
  border-radius: 4px; padding: 3px 7px;
}
.xsolving {
  font-size: 13px; color: var(--sub); margin-top: 3px; line-height: 1.55;
  max-width: 76ch; text-wrap: pretty;
}
/* The attachments of a build that holds more than one. A single attachment is the Open link on
   the right instead — naming it "Dashboard" when it is the only thing there says nothing. */
.xfiles { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 9px; }
.xfilewrap { display: inline-flex; align-items: center; }
.xfile {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--sub); background: var(--neutral-soft); border: 1px solid transparent;
  border-radius: 999px; padding: 5px 11px; text-decoration: none;
}
.xfile:hover { color: var(--accent); background: var(--accent-soft); border-color: var(--accent-line); }
.xfile .fx { font-size: 8px; opacity: .6; }
.xact { display: flex; align-items: center; gap: 4px; flex-shrink: 0; margin-top: 2px; }
.xopen {
  display: inline-flex; align-items: center; gap: 6px; text-decoration: none;
  font-family: var(--mono); font-size: 10.5px; font-weight: 600; letter-spacing: .1em;
  text-transform: uppercase; color: var(--accent); padding: 4px 2px;
}
.xopen:hover { text-decoration: underline; }
.xopen .fx { font-size: 10px; }
.xnone { font-family: var(--mono); font-size: 10px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted); padding: 4px 2px; }
.xdel {
  background: none; border: 0; color: var(--muted); font-size: 11px; line-height: 1;
  padding: 5px 6px; border-radius: 6px; opacity: .55;
  transition: opacity .14s ease, color .14s ease, background .14s ease;
}
.xdel:hover { opacity: 1; color: var(--danger); background: var(--neutral-soft); }
/* Hidden until the chip is wanted. Three permanent crosses down a row is most of what made the
   old treatment read as clutter rather than as controls. Width, not display, so revealing one
   does not reflow the row under the cursor. */
.xfilewrap .xdel {
  width: 0; padding: 0; overflow: hidden; opacity: 0; color: var(--sub);
  border-radius: 0 999px 999px 0;
  transition: width .14s ease, padding .14s ease, opacity .14s ease, color .14s ease;
}
.xfilewrap:hover .xdel, .xfilewrap:focus-within .xdel { width: 24px; padding: 0 8px 0 2px; opacity: .7; }
.xfilewrap .xdel:hover, .xfilewrap .xdel:focus-visible { opacity: 1; color: var(--danger); background: transparent; }
/* The row-level remove is the destructive one — it takes the build and everything under it — so
   it keeps its distance from the chips and never sits inline with them. */
.xdel.row { margin-left: 4px; }
.xedit {
  background: none; border: 0; color: var(--muted); padding: 5px 6px; border-radius: 6px;
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .08em; text-transform: uppercase;
}
.xedit:hover { color: var(--accent); background: var(--accent-soft); }

.uc-empty {
  font-size: 13.5px; color: var(--muted); font-style: italic;
  border: 1px dashed var(--border); border-radius: 10px; padding: 16px;
}
.uc-actions {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px;
}
.dashed-btn {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--accent); background: transparent; border: 1px dashed var(--accent-line);
  border-radius: 999px; padding: 8px 16px;
  transition: background .14s ease, border-color .14s ease;
}
.dashed-btn:hover { background: var(--accent-soft); border-color: var(--accent); }
/* The generate path is the solid one; attaching something you already have is the dashed one.
   Named `generate`, not `studio`: `.studio` is the full-screen overlay — position:fixed, inset:0,
   z-index:70 — so a button carrying it becomes a viewport-sized ellipse covering the whole page. */
.dashed-btn.generate {
  border-style: solid; border-color: var(--accent); background: var(--accent); color: #fff;
}
.dashed-btn.generate:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.fixedval {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  font-size: 14px; color: var(--ink-soft); background: var(--raised);
  border: 1px solid var(--border); border-radius: 9px; padding: 11px 13px;
}
.uc-danger {
  margin-left: auto;
  font-family: var(--mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); background: none; border: 0; padding: 8px 4px;
}
.uc-danger:hover { color: var(--danger); }

.tail { height: 110px; }

/* --- forms ------------------------------------------------------------------------------- */
.field { display: block; margin-bottom: 16px; }
.field > span {
  display: block; font-family: var(--mono); font-size: 10px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 7px;
}
.in {
  width: 100%; font-family: var(--body); font-size: 14px; color: var(--text);
  background: var(--card); border: 1px solid var(--border); border-radius: 9px;
  padding: 11px 13px; outline: none; resize: vertical;
}
.in:focus { border-color: var(--accent); }
.in.mono { font-family: var(--mono); font-size: 13px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.chiprow { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.chip-new {
  font-family: var(--body); font-size: 13px; color: var(--text); background: var(--card);
  border: 1px dashed var(--border); border-radius: 999px; padding: 7px 14px; outline: none;
  width: 140px;
}
.chip-new:focus { border-color: var(--accent-line); }
.orfile { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.orfile > span {
  font-family: var(--mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); white-space: nowrap;
}
.filedrop {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 10px;
  border: 1px dashed var(--border); border-radius: 10px; padding: 15px;
  color: var(--sub); font-size: 13.5px; background: var(--card); cursor: pointer;
  transition: background .14s ease, border-color .14s ease;
}
.filedrop:hover { border-color: var(--accent-line); background: var(--accent-soft); }

.primary, .ghost {
  font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
  border-radius: 999px;
}
.primary { background: var(--accent); color: #fff; border: none; padding: 13px 24px; }
.primary.block { width: 100%; padding: 13px 22px; }
.primary.sm, .ghost.sm { padding: 9px 16px; font-size: 10.5px; }
.ghost { background: transparent; color: var(--sub); border: 1px solid var(--border); padding: 12px 22px; }
.ghost:hover { border-color: var(--accent); color: var(--accent); }
.btnrow {
  display: flex; align-items: center; justify-content: flex-end; gap: 14px;
  margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--border); flex-wrap: wrap;
}
.btnrow .ghost { border: 0; padding: 12px 4px; }

/* --- gate -------------------------------------------------------------------------------- */
.gate {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 30px;
  background-color: var(--bg);
  background-image:
    linear-gradient(rgba(28,27,23,.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(28,27,23,.028) 1px, transparent 1px);
  background-size: 72px 72px, 72px 72px;
}
.gate-card {
  width: 100%; max-width: 400px; background: var(--card); border: 1px solid var(--border);
  border-radius: 16px; padding: 38px 34px; box-shadow: 0 18px 50px rgba(26,26,24,.07);
}
.gate-title {
  font-family: var(--display); font-weight: 700; font-size: 38px; margin: 16px 0 0;
  letter-spacing: -.02em; line-height: 1.1;
}
.gate-sub { font-size: 14px; color: var(--sub); margin: 10px 0 26px; }
.gate-error {
  font-size: 13px; color: var(--danger); margin: 0 0 14px; background: #FBF0EE;
  border: 1px solid #F0D8D3; border-radius: 8px; padding: 10px 12px;
}

/* --- modal ------------------------------------------------------------------------------- */
.scrim { position: fixed; inset: 0; background: rgba(26,26,24,.32); z-index: 40; animation: fade .18s ease; }
.modal {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 50;
  width: min(620px, 92vw); max-height: 88vh; overflow-y: auto;
  background: var(--bg); border: 1px solid var(--border); border-radius: 16px;
  box-shadow: 0 24px 80px rgba(26,26,24,.2); padding: 32px 36px 28px;
  animation: pop .18s cubic-bezier(.22,.61,.36,1);
}
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.modal-head h2 {
  font-family: var(--display); font-weight: 700; font-size: 30px; margin: 0;
  letter-spacing: -.015em; line-height: 1.15;
}
.modal-head .eyebrow { margin-bottom: 8px; }
.modal-sub { font-size: 13.5px; color: var(--sub); margin: 10px 0 0; max-width: 52ch; line-height: 1.6; }
#modal-body { margin-top: 26px; }
.close {
  background: transparent; border: none; color: var(--muted); font-size: 14px;
  padding: 6px 9px; border-radius: 8px; line-height: 1;
}
.close:hover { background: var(--neutral-soft); color: var(--text); }

/* --- upload ------------------------------------------------------------------------------ */
.upload {
  border: 1px dashed var(--accent-line); border-radius: 10px; background: var(--card);
  padding: 14px 16px; margin-top: 8px;
}
.upload-name { font-size: 13.5px; color: var(--sub); margin: 0; }
.bar { height: 4px; background: var(--neutral-soft); border-radius: 999px; margin-top: 11px; overflow: hidden; }
.bar > div { height: 100%; background: var(--accent); width: 0; transition: width .2s ease; }
.uploading {
  font-family: var(--mono); font-size: 10px; color: var(--sub); margin: 9px 0 0;
  letter-spacing: .06em; text-transform: uppercase;
}

/* --- viewer ------------------------------------------------------------------------------ */
.viewer {
  position: fixed; inset: 0; z-index: 60; background: rgba(16,16,15,.92);
  display: flex; flex-direction: column;
}
.viewer-head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px 24px; color: #EDEDEA; font-family: var(--mono); font-size: 12px;
  letter-spacing: .06em;
}
.viewer-head .close { color: #EDEDEA; }
.viewer-head .close:hover { background: rgba(255,255,255,.12); color: #fff; }
.viewer-body { flex: 1; display: flex; align-items: center; justify-content: center; padding: 0 24px 24px; }
/* A <video> with no metadata yet has no intrinsic size, so `max-width: 100%` alone left it at the
   browser's default 300x150 — a stamp-sized black box floating in a full-screen overlay, which is
   what it looked like. Sizing it up front and letting `aspect-ratio: auto` hand over to the real
   ratio once metadata lands means it opens at full size and never jumps. */
.viewer-body video {
  width: 100%; max-width: 1200px; height: auto; max-height: 100%;
  aspect-ratio: auto 16 / 9; background: #000; border-radius: 8px;
}
.viewer-body img { max-width: 100%; max-height: 100%; border-radius: 8px; }
.viewer-error { color: #C9C7C1; font-size: 15px; text-align: center; max-width: 46ch; }
.viewer-body iframe { width: 100%; height: 100%; border: 0; border-radius: 8px; background: #fff; }

/* --- misc -------------------------------------------------------------------------------- */
.empty-state { font-size: 15px; color: var(--muted); font-style: italic; padding: 34px 18px; }
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 80;
  background: var(--text); color: #FAFAF8; border-radius: 999px; padding: 12px 22px;
  font-size: 13px; box-shadow: 0 10px 30px rgba(26,26,24,.24); max-width: 90vw;
}
.toast.bad { background: var(--danger); }

@keyframes pop  { from { transform: translate(-50%,-48%); opacity: .5 } to { transform: translate(-50%,-50%); opacity: 1 } }
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }

/* --- narrow ------------------------------------------------------------------------------
   The three metadata columns are the first thing to go: on a phone the use case name and what it
   holds are worth the width, and industry and function are what the chips above are for. */
@media (max-width: 900px) {
  :root { --cols: minmax(0, 1fr) 30px; }
  .wrap { padding: 0 20px; }
  .display { font-size: 42px; }
  .masthead { padding: 34px 20px 4px; }
  .masthead-line { flex-direction: column; align-items: flex-start; gap: 10px; }
  .controls { flex-wrap: wrap; }
  .search-wrap { flex: 1 1 100%; }
  .index-head > span:nth-child(2),
  .index-head > span:nth-child(3),
  .uc-head > .uc-meta,
  .uc-head > .uc-tags { display: none; }
  /* No hover on a touch screen, so the blurb has nowhere to appear from. It goes back under the
     title and wraps, which costs height the desktop layout was reclaiming — but a row that is a
     bare name and a chevron says too little to be worth tapping. */
  /* Narrow enough that the subtitle needs to wrap rather than ellipsis away to nothing. */
  .uc-blurb { white-space: normal; }
  .filter-label { width: auto; }
  .uc-head, .uc-body { padding-left: 4px; padding-right: 4px; }
  /* The headings share the rows' gutter, or they hang out past the list they label. */
  .index-head, .group-head, .sub-head { padding-left: 4px; padding-right: 4px; }
  .group-head h2 { font-size: 22px; }
  .xrow { flex-wrap: wrap; gap: 10px; }
  .xtag { width: 84px; }
  .xact { width: 100%; justify-content: flex-end; }
  .row2 { grid-template-columns: 1fr; }
  .modal { padding: 26px 22px 22px; }
  .orfile { flex-direction: column; align-items: stretch; }
}
@media (prefers-reduced-motion: reduce) {
  .chev, .xrow, .chip { transition: none; }
  .modal, .scrim { animation: none; }
}

/* --- Solution Studio -----------------------------------------------------------------------
   Full-screen rather than a modal: the reason the Studio exists is watching the artifact change
   as you talk to it, and a dialog that has to leave the library visible behind it cannot give the
   preview enough room to be judged. */
.studio {
  position: fixed; inset: 0; z-index: 70; background: var(--bg);
  display: flex; flex-direction: column;
}
.studio-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 20px;
  padding: 20px 28px; border-bottom: 1px solid var(--border); background: var(--card);
}
.studio-head h2 {
  font-family: var(--display); font-weight: 700; font-size: 26px; margin: 6px 0 0;
  letter-spacing: -.01em;
}
.studio-head-right { display: flex; align-items: center; gap: 16px; }
.studio-step {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted);
}
.studio-body { flex: 1; display: grid; grid-template-columns: 430px minmax(0, 1fr); min-height: 0; }
.studio-panel {
  border-right: 1px solid var(--border); overflow-y: auto; padding: 24px 26px 60px;
  background: var(--card);
}
/* The artifact sits on the neutral grid rather than on card white, so the page's own background
   is visible as its own and not mistaken for the chrome around it. */
.studio-stage {
  overflow: hidden; display: flex; flex-direction: column; background: var(--raised);
}
.studio-stage iframe { flex: 1; width: 100%; border: 0; background: #fff; }
.studio-empty {
  flex: 1; display: flex; align-items: center; justify-content: center; padding: 40px;
  text-align: center; color: var(--muted); font-size: 14px; font-style: italic;
}
.studio-bar {
  display: flex; align-items: center; gap: 12px; padding: 12px 18px;
  border-bottom: 1px solid var(--border); background: var(--card); flex-wrap: wrap;
}
.studio-bar .spacer { flex: 1; }

.vpill {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .06em;
  border: 1px solid var(--border); background: var(--neutral-soft); color: var(--sub);
  border-radius: 999px; padding: 5px 11px;
}
.vpill.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.pub-link {
  font-family: var(--mono); font-size: 11px; color: var(--accent); text-decoration: none;
  border-bottom: 1px solid var(--accent-line); padding-bottom: 1px;
  max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pub-link:hover { border-bottom-color: var(--accent); }

.studio-sec {
  font-family: var(--mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted); margin: 26px 0 10px;
}
.studio-sec:first-child { margin-top: 0; }
.brief-summary {
  font-size: 14px; line-height: 1.6; color: var(--text); background: var(--raised);
  border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px;
}
.brief-json {
  font-family: var(--mono); font-size: 11px; line-height: 1.6; color: var(--sub);
  background: var(--raised); border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 14px; max-height: 260px; overflow: auto; white-space: pre-wrap; margin: 0;
}
.q-list { margin: 0; padding-left: 18px; font-size: 13.5px; color: var(--sub); line-height: 1.7; }
.raw { margin-top: 26px; }
.raw summary {
  font-family: var(--mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted); cursor: pointer; padding: 4px 0; list-style: none;
}
.raw summary::before { content: "+ "; }
.raw[open] summary::before { content: "\2212 "; }
.raw summary:hover { color: var(--accent); }
.raw .brief-json { margin-top: 10px; }

/* The built-from panel: what it adapted and why. The rationale is the point — a reference list
   without it asks the reader to trust the selection rather than judge it. */
.ref { border: 1px solid var(--border); border-radius: 10px; padding: 11px 13px; margin-bottom: 8px;
  background: var(--card); }
.ref-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.ref-client { font-size: 13.5px; font-weight: 600; }
.ref-uc { font-family: var(--mono); font-size: 10.5px; color: var(--muted); }
.ref-why { font-size: 13px; color: var(--sub); margin-top: 4px; line-height: 1.55; }

.studio-status {
  display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--sub);
  border: 1px dashed var(--accent-line); border-radius: 10px; padding: 13px 15px;
  background: var(--accent-soft);
}
.studio-status.bad { border-color: #E8CFC9; background: #FBF0EE; color: var(--danger); }
.spinner {
  width: 13px; height: 13px; border-radius: 50%; flex-shrink: 0;
  border: 2px solid var(--accent-line); border-top-color: var(--accent);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 900px) {
  .studio-body { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .studio-panel { border-right: 0; border-bottom: 1px solid var(--border); max-height: 46vh; }
}
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }

/* --- Studio intake: client combobox and sample data ---------------------------------------- */
.fieldnote {
  display: block; font-family: var(--mono); font-size: 10px; letter-spacing: .06em;
  color: var(--muted); margin-top: 6px; min-height: 13px;
}
.fieldnote.ok { color: var(--sub); }
.fieldnote.new { color: var(--copper); }

.drop {
  display: flex; flex-direction: column; align-items: center; gap: 7px; text-align: center;
  border: 1px dashed var(--rule); border-radius: 11px; padding: 20px 18px;
  background: var(--card); font-size: 13.5px; color: var(--sub);
  transition: border-color .14s ease, background .14s ease;
}
.drop.over { border-color: var(--accent); background: var(--accent-soft); }
.dropnote { font-size: 11.5px; color: var(--muted); line-height: 1.5; max-width: 44ch; }
.linkish {
  background: none; border: 0; padding: 0; color: var(--accent); font: inherit;
  text-decoration: underline; text-underline-offset: 2px;
}

.attached { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.attached:empty { margin-top: 0; }
.chipfile {
  display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--sub);
  background: var(--neutral-soft); border-radius: 999px; padding: 5px 6px 5px 13px;
}
.chipfile .sz { font-family: var(--mono); font-size: 10px; color: var(--muted); }

/* What the agent was actually handed, said plainly. A file that was stored but not parsed has to
   look different from one that was read, or the brief implies grounding it does not have. */
.attachrow {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13px;
}
.attachrow:last-child { border-bottom: 0; }
.af { font-weight: 600; color: var(--ink-soft); }
.an { font-family: var(--mono); font-size: 10px; color: var(--copper); text-align: right; }
.an.read { color: var(--sub); }
