/*
 * MatchVIBE local frontend.
 *
 * Palette is the Matchain core mark plus the warm coral range of the founder's reference:
 * #FFA723 amber and #1E1E1E ink are the canonical mark colours, #DF2B56 is the Brand Kit v2
 * accent. Type is a system sans stack on purpose: the bundled MatchVIBE font binaries were
 * not found on this machine, so nothing here pretends to be the final typeface.
 */

:root {
  --amber: #ffa723;
  --coral: #ff6b3d;
  --rose: #df2b56;
  --ink: #1e1e1e;
  --ink-soft: #5b4b3d;
  --cream: #fdf6ee;
  --cream-2: #f7ead9;
  --line: #ecd9c3;
  --dark: #141110;
  --dark-2: #221c18;
  --ok: #2f7d4f;
  --warn: #9a5b00;
  --bad: #b3261e;
  --radius: 16px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  --shadow: 0 12px 40px rgba(60, 30, 10, .14);
  /* The installable shell has no native wrapper. These browser-provided insets keep the
     sticky controls and first tap targets clear of a device cutout without storing anything. */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
}

* { box-sizing: border-box; }

/* An author display rule must never override the native hidden state. Without this,
   .builder{display:flex} and .modal-root{display:grid} both paint while [hidden] is set,
   which is how the start screen and an empty builder appeared in the same screenshot. */
[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  margin: 0;
  min-height: 100%;
  padding: var(--safe-top) var(--safe-right) var(--safe-bottom) var(--safe-left);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip {
  position: absolute; left: -9999px; top: 8px; z-index: 50;
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 999px;
}
.skip:focus { left: 12px; }

:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; border-radius: 6px; }

button { font: inherit; cursor: pointer; }

/* ---------------------------------------------------------------- top bar */

.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 16px;
  margin: calc(-1 * var(--safe-top)) calc(-1 * var(--safe-right)) 0 calc(-1 * var(--safe-left));
  padding:
    calc(12px + var(--safe-top))
    calc(clamp(14px, 3vw, 28px) + var(--safe-right))
    12px
    calc(clamp(14px, 3vw, 28px) + var(--safe-left));
  background: rgba(253, 246, 238, .88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: baseline; gap: 10px; min-width: 0; }

.brand-logo {
  display: block; box-sizing: content-box;
  width: clamp(132px, 18vw, 152px); height: auto;
  padding: 5px 8px; border-radius: 8px; background: var(--ink);
}

.pedigree {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-soft);
}
.pedigree-mark { display: block; }

.topbar-status { display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; }
.topbar-actions { display: flex; gap: 8px; align-items: center; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line); background: #fff;
  border-radius: 999px; padding: 4px 11px; font-size: 12px; color: var(--ink-soft);
  white-space: nowrap;
}
.chip b { font-weight: 600; color: var(--ink); }
.chip .dot { width: 7px; height: 7px; border-radius: 999px; background: #b9a68f; flex: none; }
.chip[data-tone="ok"] .dot { background: var(--ok); }
.chip[data-tone="warn"] .dot { background: var(--warn); }
.chip[data-tone="bad"] .dot { background: var(--bad); }
.chip[data-tone="demo"] { background: var(--ink); border-color: var(--ink); color: #ffd9a8; }
.chip[data-tone="demo"] b { color: #fff; }
.chip[data-tone="demo"] .dot { background: var(--amber); }

/* ---------------------------------------------------------------- buttons */

.ghost {
  background: #fff; border: 1px solid var(--line); color: var(--ink);
  border-radius: 999px; padding: 8px 16px; font-size: 14px; font-weight: 550;
}
.ghost:hover { border-color: var(--ink); }
.ghost.danger { color: var(--bad); border-color: #f0cbc8; }
.solid {
  background: var(--ink); color: #fff; border: 1px solid var(--ink);
  border-radius: 999px; padding: 9px 20px; font-size: 14px; font-weight: 600;
}
.solid:hover { background: #000; }
button[disabled] { opacity: .5; cursor: not-allowed; }

/* ---------------------------------------------------------------- notices */

.notices { padding: 0 clamp(14px, 3vw, 28px); }
.notice {
  display: flex; gap: 12px; align-items: flex-start;
  margin: 12px 0 0; padding: 12px 14px; border-radius: 12px;
  border: 1px solid var(--line); background: #fff; box-shadow: var(--shadow);
}
.notice[data-tone="error"] { border-color: #f0cbc8; background: #fff6f5; }
.notice[data-tone="uncertain"] { border-color: #f2ddb4; background: #fffaf0; }
.notice strong { display: block; font-size: 14px; }
.notice p { margin: 2px 0 0; font-size: 14px; color: var(--ink-soft); }
.notice .notice-actions { margin-left: auto; display: flex; gap: 8px; flex: none; }

/* ---------------------------------------------------------------- hero */

/* Kept short and letting the gradient fade into the page cream at the foot, rather than filling
   the viewport: the composer directly below is the thing meant to hold attention, not the color
   field behind the heading. */
.hero { position: relative; overflow: hidden; padding: clamp(30px, 5vw, 56px) clamp(14px, 3vw, 28px) clamp(28px, 4vw, 44px); }

.hero::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(120% 90% at 18% 78%, rgba(223, 43, 86, .76) 0%, rgba(223, 43, 86, 0) 55%),
    radial-gradient(90% 80% at 78% 22%, rgba(255, 207, 106, .72) 0%, rgba(255, 207, 106, 0) 60%),
    linear-gradient(158deg, rgba(255, 122, 61, .68) 0%, rgba(255, 167, 35, .42) 52%, rgba(232, 86, 47, .70) 100%),
    url("../assets/matchvibe-higgsfield-hero-20260911.jpg") center / cover no-repeat;
}

.hero::after {
  content: ""; position: absolute; z-index: 0; inset: auto 0 0 0; height: 30%;
  background: linear-gradient(180deg, rgba(253, 246, 238, 0) 0%, var(--cream) 100%);
}

.hero-panels { z-index: 0; }
.hero-inner { z-index: 1; }

/* The reference's signature: tall vertical panels with curved tops, read as faint seams. */
.hero-panels { position: absolute; inset: 0; display: flex; opacity: .22; }
.hero-panels span {
  flex: 1;
  border-left: 1px solid rgba(255, 255, 255, .5);
  border-top-left-radius: 46% 12%;
  border-top-right-radius: 46% 12%;
  margin-top: 6%;
  background: linear-gradient(180deg, rgba(255, 255, 255, .18), rgba(255, 255, 255, 0) 42%);
}
.hero-panels span:first-child { border-left: 0; }

.hero-inner { position: relative; max-width: 940px; margin: 0 auto; text-align: center; }

.hero h1 {
  margin: 0 0 14px;
  font-size: clamp(38px, 7.4vw, 74px);
  line-height: 1.02;
  letter-spacing: -.035em;
  font-weight: 340;
  color: var(--ink);
}

.hero-sub {
  margin: 0 auto 28px; max-width: 54ch;
  font-size: clamp(15px, 1.7vw, 18px); color: #2e2118;
}
.hero-library-rail {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: 100%;
  margin: -8px auto 25px;
  padding: 7px 9px 7px 7px;
  border: 1px solid rgba(30, 30, 30, .22);
  border-radius: 999px;
  background: rgba(253, 246, 238, .58);
  box-shadow: 0 8px 22px rgba(107, 45, 12, .10);
  color: var(--ink);
  text-align: left;
}
.hero-library-rail img {
  width: 30px;
  height: 30px;
  padding: 6px;
  border-radius: 50%;
  background: var(--ink);
}
.hero-library-rail > span { display: grid; gap: 0; min-width: 0; }
.hero-library-rail b { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.hero-library-rail small { color: #4d3324; font-size: 12px; white-space: nowrap; }
.hero-library-rail a {
  margin-left: 5px;
  padding: 6px 9px;
  border-radius: 999px;
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}
.hero-library-rail a:hover { background: rgba(30, 30, 30, .10); }

/* ---------------------------------------------------------------- composer */

.composer-wrap { max-width: 700px; margin: 0 auto; }

/* overflow-y is pinned to hidden alongside overflow-x: auto so only the intended horizontal
   scroll ever shows here, never a vertical one. */
.categories { display: flex; gap: 4px; justify-content: flex-start; overflow-x: auto; overflow-y: hidden; padding: 0 4px; scrollbar-width: none; }
.categories::-webkit-scrollbar { display: none; }

.categories button {
  border: 0; background: rgba(255, 255, 255, .34); color: #43301f;
  min-height: 44px; display: inline-flex; align-items: center;
  padding: 9px 15px; border-radius: 12px 12px 0 0; font-size: 13.5px; font-weight: 550;
  white-space: nowrap;
}
.categories button[aria-selected="true"] { background: var(--dark); color: #fff; }
.categories button[disabled] { opacity: .62; cursor: not-allowed; }
.categories .unavailable-tag { font-size: 10px; letter-spacing: .05em; text-transform: uppercase; opacity: .8; margin-left: 6px; }

.composer {
  position: relative; background: var(--dark); border-radius: 18px;
  padding: 16px 16px 12px; box-shadow: var(--shadow); text-align: left;
}
/* Scoped to the start screen's composer, which sits directly under the category tabs: pulls
   the panel up 5px to tuck under the tabs' flat bottom corners, so no seam shows. This overlap
   used to come from a negative margin-bottom on the tabs themselves, which shrank their own
   row below their 44px height and made it scroll; moving the same 5px overlap here keeps the
   visual join without touching the tabs' box. The builder screen's composer (.composer-inline)
   has no tabs above it and is unaffected. */
.composer-wrap .composer { margin-top: -5px; }
.composer textarea {
  width: 100%; border: 0; background: transparent; color: #f4ece3;
  font: inherit; font-size: 16px; resize: vertical; min-height: 68px; outline: none;
}
.composer textarea::placeholder { color: #8b7d70; }
.composer textarea:focus-visible { outline: 2px solid var(--amber); outline-offset: 6px; border-radius: 8px; }

.composer-foot { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.composer-hint { font-size: 12.5px; color: #9c8d7e; flex: 1; min-width: 0; }
.composer-buttons { display: flex; gap: 8px; align-items: center; }
.composer-buttons .ghost { background: #2a2320; border-color: #3a312c; color: #f0e6dc; padding: 7px 14px; }
.composer-buttons .ghost.danger { color: #ff9c92; border-color: #4b3330; }

/* The single brightest control on screen: amber by default, not just on hover, so Build/Send
   reads as the primary action at rest. Ratios computed with tools/contrast.js (kept outside
   the repo): ink on amber 8.58:1, ink on the hover shade 7.32:1, both pass WCAG AAA. */
.send {
  flex: none; min-height: 44px; height: auto; min-width: 44px; border-radius: 999px;
  border: 0; background: var(--amber); color: var(--ink); font-size: 14.5px; font-weight: 600;
  line-height: 1; padding: 0 18px;
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
}
.send span[aria-hidden="true"] { font-size: 16px; }
.send:hover { background: #f2971c; }

.composer-note { margin: 10px 4px 0; font-size: 12.5px; color: #4a3627; text-align: center; }

.composer-inline { background: var(--dark-2); }

/* ---------------------------------------------------------------- starters */

.starters {
  list-style: none; margin: 26px auto 0; padding: 0; max-width: 860px;
  display: flex; flex-wrap: wrap; gap: 9px; justify-content: center;
}
.starters button {
  border: 1px solid rgba(30, 30, 30, .18); background: rgba(255, 255, 255, .58);
  color: #2c2018; border-radius: 999px; padding: 9px 17px; font-size: 14px; text-align: left;
}
.starters button:hover { background: #fff; border-color: var(--ink); }

/* ---------------------------------------------------------------- connect */

.connect, .examples { max-width: 1040px; margin: 0 auto; padding: clamp(24px, 3.5vw, 40px) clamp(14px, 3vw, 28px); }
.examples h2 { margin: 0 0 6px; font-size: clamp(22px, 3vw, 28px); letter-spacing: -.02em; font-weight: 600; }
.connection-details { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 14px 0; }
.connection-details summary { cursor: pointer; color: var(--ink-soft); font-size: 14px; font-weight: 650; min-height: 44px; display: flex; align-items: center; }
.connection-details[open] summary { color: var(--ink); margin-bottom: 10px; }
.connect-sub { margin: 0 0 18px; color: var(--ink-soft); max-width: 62ch; }
.online-note {
  margin: -4px 0 18px; max-width: 62ch; padding: 9px 11px;
  border-left: 3px solid var(--amber); background: #fff8e9; color: var(--ink-soft); font-size: 13px;
}
.install-shell {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px;
  margin: -2px 0 18px; max-width: 62ch;
}
.install-button { min-height: 44px; flex: none; }
.install-status { margin: 0; color: var(--ink-soft); font-size: 13px; flex: 1 1 260px; }

.connect-cards { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }

.connect-card {
  border: 1px solid var(--line); background: #fff; border-radius: var(--radius);
  padding: 20px; display: flex; flex-direction: column; gap: 10px;
}
.connect-card h3 { margin: 0; font-size: 17px; font-weight: 600; }
.connect-card p { margin: 0; font-size: 14px; color: var(--ink-soft); }
.connect-card .facts { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 6px; }
.connect-card .facts li { font-size: 13px; color: var(--ink-soft); display: flex; gap: 8px; }
.connect-card .facts li::before { content: "-"; color: #c0aa92; }
.connect-card .cta { margin-top: auto; padding-top: 12px; }

/* ---------------------------------------------------------------- thumbs */

.thumbs { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.thumb { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #fff; }
.thumb figcaption { padding: 12px 14px; font-size: 13.5px; color: var(--ink-soft); }
.thumb figcaption b { display: block; color: var(--ink); font-size: 14.5px; font-weight: 600; margin-bottom: 2px; }

/* A pure CSS mock of a generated page. It is decoration, not a screenshot of real output. */
.mock { aspect-ratio: 16 / 10; padding: 10px; background: var(--cream-2); display: grid; gap: 6px; grid-template-rows: auto auto 1fr; }
.mock-window { display: flex; gap: 4px; }
.mock-window span { width: 6px; height: 6px; border-radius: 999px; background: rgba(30, 30, 30, .22); }
.mock-bar { height: 14px; border-radius: 4px; background: var(--ink); opacity: .82; }
.mock-body { display: grid; gap: 6px; }
.mock-row { background: #fff; border-radius: 5px; height: 100%; box-shadow: inset 0 0 0 1px rgba(30, 30, 30, .07); }
.mock--dash .mock-body { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.mock--dash .mock-row:first-child { grid-column: span 2; background: linear-gradient(120deg, var(--amber), var(--coral)); }
.mock--form .mock-body { grid-template-rows: repeat(4, 1fr); }
.mock--form .mock-row:last-child { background: var(--ink); }
.mock--table .mock-body { grid-template-rows: repeat(5, 1fr); }
.mock--table .mock-row:first-child { background: var(--cream); }

/* ---------------------------------------------------------------- builder */

.builder { display: flex; flex-direction: column; min-height: calc(100vh - 58px); }

.builder-tabs { display: none; gap: 6px; padding: 10px clamp(14px, 3vw, 28px) 0; }
.builder-tabs button {
  flex: 1; border: 1px solid var(--line); background: #fff; color: var(--ink-soft);
  border-radius: 999px; padding: 9px; font-size: 14px; font-weight: 550; min-height: 44px;
}
.builder-tabs button[aria-selected="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }

.builder-grid {
  flex: 1; display: grid; gap: 16px; padding: 16px clamp(14px, 3vw, 28px) 24px;
  /* The preview is the payoff: it gets the largest share of desktop width. */
  grid-template-columns: 224px minmax(320px, .9fr) minmax(420px, 1.35fr);
  align-items: start;
}

.projects, .work, .preview {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; min-width: 0;
}
.projects { position: sticky; top: 74px; }
.projects-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.projects-head h2 { margin: 0; font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-soft); }
.projects-head .ghost { margin-left: auto; padding: 5px 12px; font-size: 13px; }
.projects ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.projects li button {
  width: 100%; text-align: left; border: 0; background: transparent; border-radius: 10px;
  padding: 9px 11px; font-size: 14px; color: var(--ink); min-height: 40px;
}
.projects li button:hover { background: var(--cream); }
.projects li button[aria-current="true"] { background: var(--ink); color: #fff; }
.projects li small { display: block; font-size: 11.5px; opacity: .7; }
.projects .empty { font-size: 13.5px; color: var(--ink-soft); padding: 6px 2px; }
.persistence-note { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 12px; color: var(--ink-soft); }
.persistence-label { margin: 0; }
.persistence-detail { margin-top: 6px; }
.persistence-detail summary { cursor: pointer; }
.persistence-detail p { margin: 6px 0 0; }

.work { display: flex; flex-direction: column; gap: 14px; }

.run { display: grid; gap: 10px; }
.run-status { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 14px; }
.run-status .badge {
  border-radius: 999px; padding: 3px 11px; font-size: 12px; font-weight: 600;
  background: var(--cream-2); color: var(--ink-soft);
}
.run-status .badge[data-tone="run"] { background: #fff2d9; color: var(--warn); }
.run-status .badge[data-tone="ok"] { background: #e6f3ea; color: var(--ok); }
.run-status .badge[data-tone="bad"] { background: #fdeae8; color: var(--bad); }
.run-status .badge[data-tone="uncertain"] { background: #1e1e1e; color: #ffd9a8; }

.run-log { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; max-height: 260px; overflow-y: auto; }
.run-log li {
  font-size: 13px; color: var(--ink-soft); display: flex; gap: 9px;
  padding: 4px 8px; border-radius: 8px; background: var(--cream);
}
.run-log li .k { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .02em; text-transform: uppercase; color: #a08f7c; flex: none; width: 74px; }
.run-log li[data-kind="error"] { background: #fdeae8; color: var(--bad); }
.run-empty { font-size: 13.5px; color: var(--ink-soft); }

/* Ordinary-language status leads; raw ids and durable-state tokens sit behind this disclosure. */
.run-details summary {
  cursor: pointer; min-height: 32px; display: inline-flex; align-items: center;
  font-size: 12.5px; font-weight: 600; color: var(--ink-soft);
}
.run-details[open] summary { color: var(--ink); }
.run-details-body { display: grid; gap: 3px; margin: 4px 0 0; }
.mono { font-family: var(--font-mono); font-size: 12px; color: var(--ink-soft); margin: 0; }

.preview { display: flex; flex-direction: column; gap: 0; padding: 0; overflow: hidden; }
/* A restrained browser-like chrome bar: three static dots, no functional reload, fullscreen,
   device toggle or deploy control. It is framing, not a second toolbar. */
.preview-head {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px;
  padding: 12px 14px; background: var(--cream-2); border-bottom: 1px solid var(--line);
}
.chrome-dots { display: flex; gap: 6px; flex: none; }
.chrome-dots span { width: 8px; height: 8px; border-radius: 999px; background: #e2cfae; }
.preview-head h2 { margin: 0; font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-soft); }
.source-label {
  margin-left: auto; min-width: 0; max-width: 100%; overflow-wrap: anywhere;
  font-size: 11.5px; color: var(--ink-soft); text-align: right;
  background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 4px 11px;
}
.preview-frame { background: var(--cream); min-height: 480px; display: grid; padding: 16px; }
.preview-frame iframe { width: 100%; height: 100%; min-height: 448px; border: 0; border-radius: 8px; background: #fff; box-shadow: 0 1px 0 var(--line); }
/* Empty state: a quiet card, not a bare dashed rectangle. The glyph is CSS shapes, not an
   image, so it stays truthful about there being no generated output yet. */
.preview-placeholder {
  place-self: center; text-align: center; padding: 36px 32px; max-width: 34ch;
  color: var(--ink-soft); font-size: 14px; line-height: 1.5;
  border: 1px dashed var(--line); border-radius: 12px; background: #fff;
}
.preview-placeholder::before {
  content: ""; display: block; width: 40px; height: 40px; margin: 0 auto 14px;
  border-radius: 10px; background: var(--cream-2);
  box-shadow: inset 0 0 0 1px var(--line);
}

/* ---------------------------------------------------------------- modal */

.modal-root { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; background: rgba(30, 20, 12, .46); padding: 18px; }
.modal { background: #fff; border-radius: 20px; padding: 22px; width: min(430px, 100%); box-shadow: var(--shadow); }
.modal h2 { margin: 0 0 4px; font-size: 19px; font-weight: 600; }
.modal p { margin: 0 0 16px; font-size: 14px; color: var(--ink-soft); }
.modal label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.modal input, .modal select {
  width: 100%; font: inherit; padding: 11px 13px; border-radius: 11px;
  border: 1px solid var(--line); background: var(--cream); margin-bottom: 14px; min-height: 44px;
}
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; }
.modal .powered { margin: 14px 0 0; font-size: 11.5px; color: var(--ink-soft); text-align: center; }

.team-dialog { width: min(760px, 100%); border: 1px solid var(--border-rose-gold); }
.team-dialog .team-kicker {
  margin: 0 0 7px; color: var(--accent-flame); font-size: 10px; font-weight: 850;
  letter-spacing: .12em; text-transform: uppercase;
}
.team-dialog .team-boundary {
  padding: 11px 13px; border: 1px solid var(--border-rose-gold); border-radius: 12px;
  background: var(--surface-panel); color: var(--text-secondary); line-height: 1.45;
}
.team-roles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin: 0 0 18px; padding: 0; border: 0; }
.team-roles legend { grid-column: 1 / -1; margin-bottom: 2px; font-size: 12px; font-weight: 750; color: var(--text-secondary); }
.modal .team-role {
  display: flex; align-items: flex-start; gap: 10px; min-height: 82px; margin: 0; padding: 12px;
  border: 1px solid var(--line); border-radius: 13px; background: #fff; cursor: pointer;
}
.modal .team-role:has(input:checked) { border-color: var(--accent-flame); background: #fff8f3; box-shadow: 0 0 0 2px rgba(255, 120, 61, .09); }
.modal .team-role input { flex: none; width: 18px; min-height: 18px; margin: 2px 0 0; accent-color: var(--accent-flame); }
.team-role span { display: grid; gap: 4px; }
.team-role b { color: var(--text-primary); font-size: 14px; }
.team-role small { color: var(--text-secondary); font-size: 12px; line-height: 1.35; }
.team-dialog > textarea {
  width: 100%; min-height: 112px; resize: vertical; padding: 12px 13px;
  border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--text-primary);
  font: inherit; font-size: 14px; line-height: 1.45;
}
.team-dialog #team-brief-output { min-height: 260px; background: #17181d; color: #fffaf6; font-family: var(--font-mono); font-size: 12.5px; }
.team-validation { min-height: 20px; margin: 7px 0 2px !important; color: var(--text-secondary) !important; font-size: 12px !important; }
.team-primary { color: #1b1210; border-color: transparent; background: var(--gradient-flame); }
.solid.team-primary:hover { color: #1b1210; background: var(--gradient-flame); filter: brightness(.96) saturate(1.05); }
.team-summary-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin: 8px 0 2px; }
.team-copy-status { margin-right: auto; color: var(--text-secondary); font-size: 12px; }

@media (max-width: 620px) {
  .team-roles { grid-template-columns: 1fr; }
  .team-dialog { padding: 18px; }
  .team-summary-actions { align-items: stretch; flex-direction: column; }
  .team-copy-status { min-height: 18px; margin: 0; }
}

/* ---------------------------------------------------------------- responsive */

@media (max-width: 1080px) {
  .builder-grid { grid-template-columns: 200px 1fr; }
  .preview { grid-column: 1 / -1; }
  .projects { position: static; }
}

@media (max-width: 720px) {
  .topbar { flex-wrap: wrap; }
  .topbar-status { width: 100%; margin-left: 0; order: 3; }
  .topbar-actions { margin-left: auto; }
  .hero h1 { letter-spacing: -.025em; }
  .starters { justify-content: stretch; }
  .starters li, .starters button { width: 100%; }
  .builder-tabs { display: flex; }
  /* Single column: rows must size to their own content, not stretch to fill .builder's
     min-height (grid's default align-content: normal behaves as stretch), or a large empty
     band opens between the visible pane and the Projects card below it. */
  .builder-grid { grid-template-columns: 1fr; align-content: start; }
  .projects { order: 3; }
  .builder[data-pane="build"] .preview { display: none; }
  .builder[data-pane="preview"] .work { display: none; }
  .ghost, .solid, .projects li button, .builder summary { min-height: 44px; }
  .builder summary { display: inline-flex; align-items: center; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

@media (prefers-contrast: more) {
  .composer-hint { color: #d3c6b9; }
  .connect-card p, .connect-card .facts li { color: #3b2e23; }
}

/* ---- template library ---------------------------------------------------------------
   The library sits below the composer on the start screen, inside the same amber and cream
   shell. Higgsfield category art sits behind the canonical MatchVIBE and Matchain marks;
   template IDs remain internal provenance only and are never used as the visual identity of
   a card. */

.library {
  max-width: 1120px;
  margin: 8px auto 0;
  padding: 28px 20px 40px;
}
.library-head {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 16px;
}
.library-head h2 { margin: 0 0 6px; font-size: 22px; letter-spacing: -.01em; }
.library-sub { margin: 0; max-width: 62ch; color: var(--muted, #7a6653); font-size: 14px; }
.library-count { margin: 0; font-size: 13px; color: var(--muted, #7a6653); font-variant-numeric: tabular-nums; }
.library-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  margin-bottom: 18px;
}
.library-field { display: grid; gap: 4px; min-width: 0; flex: 1 1 200px; }
.library-field label { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted, #7a6653); }
.library-field input, .library-field select {
  font: inherit;
  font-size: 14px;
  padding: 9px 12px;
  border: 1px solid #efe0cf;
  border-radius: 10px;
  background: #fffdfa;
  color: inherit;
  width: 100%;
  min-width: 0;
}
.library-check { display: flex; gap: 8px; align-items: center; font-size: 13.5px; padding-bottom: 9px; }
.library-controls button { align-self: flex-end; }
.library-access {
  display: inline-flex;
  align-self: flex-end;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line, #ecd9c3);
  border-radius: 999px;
  background: #fffdfa;
}
.library-access button {
  min-height: 44px;
  padding: 8px 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-soft, #5b4b3d);
  font-size: 12.5px;
  font-weight: 650;
}
.library-access button[aria-pressed="true"] { background: var(--ink, #1e1e1e); color: #fff; }
.library-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.tpl-card > article {
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #fff;
  border: 1px solid #efe0cf;
  border-radius: 14px;
  padding: 16px;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
@media (hover: hover) {
  .tpl-card > article:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: #e2b77e; }
}
.tpl-top { display: flex; gap: 12px; align-items: flex-start; }
.tpl-top h3 { margin: 2px 0 0; font-size: 16px; line-height: 1.25; }
.tpl-meta { margin: 0; font-size: 12px; color: var(--muted, #7a6653); }
.tpl-blurb { margin: 0; font-size: 14.5px; line-height: 1.45; color: #4a3d31; flex: 1; }
.tpl-cover {
  flex: none;
  width: 52px;
  height: 52px;
  border-radius: 12px;
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
  border: 1px solid rgba(23, 18, 14, .09);
  background: linear-gradient(140deg, #ffa723, #ffd9a8);
}
.tpl-cover::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(135deg, rgba(255,255,255,.18), transparent 54%, rgba(20,17,14,.08));
  pointer-events: none;
}
.tpl-category-icon {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.tpl-cover-art {
  position: absolute;
  inset: 8px;
  z-index: 0;
  border: 1px solid rgba(255,255,255,.38);
  border-radius: 8px;
  opacity: .7;
  background: linear-gradient(180deg, rgba(255,255,255,.58) 0 24%, transparent 24%),
    linear-gradient(90deg, rgba(32,23,17,.18) 0 31%, transparent 31% 38%, rgba(32,23,17,.18) 38% 100%);
}
.tpl-cover[data-layout="identity"] .tpl-cover-art,
.tpl-cover[data-layout="consent"] .tpl-cover-art { border-radius: 50%; inset: 9px; background: radial-gradient(circle at 50% 35%, rgba(255,255,255,.9) 0 18%, transparent 19%), linear-gradient(180deg, transparent 0 52%, rgba(32,23,17,.24) 53% 69%, transparent 70%); }
.tpl-cover[data-layout="gate"] .tpl-cover-art { inset: 11px 13px; border-radius: 5px; background: linear-gradient(180deg, transparent 0 38%, rgba(32,23,17,.33) 39% 100%); }
.tpl-cover[data-layout="meter"] .tpl-cover-art { border-radius: 50%; background: conic-gradient(rgba(255,255,255,.85) 0 68%, rgba(32,23,17,.25) 68% 100%); }
.tpl-cover[data-layout="board"] .tpl-cover-art { background: repeating-linear-gradient(180deg, rgba(255,255,255,.68) 0 5px, transparent 5px 10px); }
.tpl-cover[data-layout="market"] .tpl-cover-art { border-radius: 4px; background: linear-gradient(135deg, transparent 0 39%, rgba(255,255,255,.9) 40% 47%, transparent 48%), linear-gradient(180deg, transparent 0 72%, rgba(32,23,17,.28) 73%); }
.tpl-cover[data-layout="calculator"] .tpl-cover-art { background: repeating-linear-gradient(90deg, rgba(255,255,255,.7) 0 6px, transparent 6px 10px), linear-gradient(180deg, transparent 0 66%, rgba(32,23,17,.28) 67%); }
.tpl-cover[data-layout="console"] .tpl-cover-art { background: linear-gradient(90deg, rgba(32,23,17,.32) 0 30%, transparent 30%), repeating-linear-gradient(180deg, rgba(255,255,255,.6) 0 3px, transparent 3px 7px); }
.tpl-cover[data-layout="wizard"] .tpl-cover-art { background: linear-gradient(90deg, rgba(255,255,255,.88) 0 21%, transparent 21% 39%, rgba(255,255,255,.88) 39% 61%, transparent 61% 79%, rgba(255,255,255,.88) 79%); }
.tpl-cover[data-layout="feed"] .tpl-cover-art { background: repeating-linear-gradient(180deg, rgba(255,255,255,.68) 0 4px, transparent 4px 9px); }
.tpl-cover[data-layout="game"] .tpl-cover-art { border-radius: 50% 50% 8px 8px; background: radial-gradient(circle at 50% 28%, rgba(255,255,255,.88) 0 11%, transparent 12%), linear-gradient(180deg, transparent 0 59%, rgba(32,23,17,.3) 60%); }
.tpl-cover[data-layout="matchscore"] .tpl-cover-art { border-radius: 50%; background: conic-gradient(rgba(255,255,255,.88) 0 43%, rgba(32,23,17,.25) 43% 48%, rgba(255,255,255,.56) 48% 75%, rgba(32,23,17,.25) 75% 80%, rgba(255,255,255,.88) 80%); }
.tpl-cover[data-category="identity-social"] { background: linear-gradient(140deg, #ffa723, #ffd9a8); }
.tpl-cover[data-category="defi-trading"] { background: linear-gradient(140deg, #ff7a3d, #ffc46b); }
.tpl-cover[data-category="ai-agents"] { background: radial-gradient(circle at 30% 30%, #ffd9a8, #df2b56); }
.tpl-cover[data-category="sovereign-data-rewards"] { background: repeating-linear-gradient(45deg, #ffe6c2 0 6px, #ffc46b 6px 12px); }
.tpl-cover[data-category="rwa-tokenization"] { background: conic-gradient(from 220deg, #ffa723, #e0603c, #ffd9a8); }
.tpl-cover[data-category="nft-launchpad-memecoins"] { background: linear-gradient(140deg, #17120e, #7a6653); }
.tpl-logo-main {
  width: 16px;
  height: 16px;
  position: absolute;
  left: 4px;
  bottom: 4px;
  z-index: 2;
  border-radius: 5px;
  box-shadow: 0 2px 7px rgba(0, 0, 0, .22);
}
.tpl-logo-lineage {
  width: 12px;
  height: 12px;
  position: absolute;
  right: 4px;
  bottom: 4px;
  z-index: 2;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .22));
}
.tpl-lock {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  background: rgba(20, 17, 16, .56);
}
.tpl-lock::before {
  content: '';
  width: 16px;
  height: 12px;
  border: 2px solid #ffd9a8;
  border-radius: 3px;
  background: rgba(20, 17, 16, .35);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .28);
}
.tpl-lock::after {
  content: '';
  position: absolute;
  width: 9px;
  height: 8px;
  margin-top: -12px;
  border: 2px solid #ffd9a8;
  border-bottom: 0;
  border-radius: 7px 7px 0 0;
}
.tpl-card[data-access="locked"] .tpl-cover { filter: saturate(.34); }
.tpl-tags { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; }
.tpl-tags li {
  font-size: 11.5px;
  background: #f8f0e6;
  border-radius: 999px;
  padding: 3px 9px;
  color: var(--muted, #7a6653);
}
.tpl-tags li.is-starter { background: #17120e; color: #ffd9a8; }
.tpl-access {
  display: inline-flex;
  margin-top: 7px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 750;
  letter-spacing: .05em;
  line-height: 1.2;
  text-transform: uppercase;
}
.tpl-access[data-tone="free"] { background: #17120e; color: #ffd9a8; }
.tpl-access[data-tone="locked"] { background: #f8f0e6; color: var(--ink-soft, #5b4b3d); box-shadow: inset 0 0 0 1px var(--line, #ecd9c3); }
.tpl-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.tpl-actions button { min-height: 44px; font-size: 14px; }
.tpl-actions .tpl-access-status { border-color: var(--ink, #1e1e1e); }
.tpl-actions .tpl-access-status:hover { border-color: var(--rose, #df2b56); color: var(--rose, #df2b56); }
.library-empty {
  font-size: 14.5px;
  background: #fffaf2;
  border: 1px solid #f0d9b4;
  border-radius: 12px;
  padding: 16px;
  color: #4a3d31;
}
.modal-wide { max-width: 640px; }
.modal-wide h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted, #7a6653); margin: 14px 0 4px; }
.tpl-prompt { font-size: 13.5px; background: #f8f0e6; border-radius: 10px; padding: 10px 12px; margin: 0; }
.unlock-note { margin: 0; padding: 10px 12px; border-radius: 10px; background: #f8f0e6; color: var(--ink-soft, #5b4b3d); font-size: 13.5px; }
.preview-tools {
  display: flex; flex: 0 1 auto; flex-wrap: wrap; gap: 6px; min-width: 0; margin-left: 0;
}
.preview-tools button { font-size: 12.5px; white-space: nowrap; }

@media (max-width: 420px) {
  .categories {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    overflow: visible;
  }
  .categories button {
    flex-direction: column;
    min-width: 0;
    justify-content: center;
    line-height: 1.1;
    padding: 8px 6px 10px;
    text-align: center;
    white-space: normal;
  }
  .categories .unavailable-tag {
    display: block;
    margin-left: 0;
    margin-top: 2px;
  }
  .library { padding: 20px 12px 32px; }
  .library-grid { grid-template-columns: 1fr; }
  .library-controls { gap: 10px; }
  .library-field { flex-basis: 100%; }
  .hero-library-rail { align-items: flex-start; border-radius: 14px; }
  .hero-library-rail a { padding-left: 5px; padding-right: 2px; }
  .hero-library-rail small { white-space: normal; }
  .source-label { order: 3; flex: 1 1 100%; margin-left: 0; text-align: left; }
  .preview-tools { margin-left: auto; }
}

/* Preview export: a status line that reports what was requested, and the read-only source
   panel that is the reliable fallback when the host refuses a download. */
.preview-status { font-size: 12.5px; color: var(--muted, #7a6653); flex: 1 1 100%; }
.source-panel { flex: 1 1 100%; margin-top: 8px; }
.source-dump { max-height: 320px; overflow: auto; white-space: pre-wrap; word-break: break-word;
  font-size: 12px; line-height: 1.45; background: #14100c; color: #f4e7d7; padding: 12px 14px;
  border-radius: 10px; margin: 6px 0 0; }
.source-dump:focus-visible { outline: 2px solid var(--accent, #ffa723); outline-offset: 2px; }

/* ---------------------------------------------------------------- product studio refresh
   The start screen now behaves like the front door of the studio: a persistent product rail,
   one high-confidence creation surface and an honest view of the end-to-end launch track. */

:root {
  --surface-canvas: #f5f6f7;
  --surface-panel: #fffaf7;
  --surface-chrome: #17181d;
  --surface-raised: #23242b;
  --text-primary: #211d1b;
  --text-secondary: #6c625f;
  --text-on-dark: #fffaf6;
  --accent-flame: #ff783d;
  --accent-flame-hot: #ffad55;
  --accent-rose-gold: #c99586;
  --border-rose-gold: rgba(201, 149, 134, .38);
  --gradient-flame: linear-gradient(125deg, #ffb15c 0%, #ff783d 48%, #df5c79 100%);
  --paper: #fffdf8;
  --paper-2: #f4eee6;
  --obsidian: #111318;
  --obsidian-2: #1b1d23;
  --muted: #736967;
  --cyan: #d99a8a;
  --amber: #ffa723;
  --coral: #ff783d;
  --rose: #df5c79;
  --ink: #211d1b;
  --ink-soft: #655a58;
  --cream: #f5f6f7;
  --cream-2: #eee8e6;
  --line: #e7dfdc;
  --topbar-height: 66px;
  --radius-sm: 10px;
  --radius-lg: 24px;
}

body {
  background: var(--surface-canvas);
  letter-spacing: -.006em;
}

.topbar {
  min-height: var(--topbar-height);
  padding-top: calc(10px + var(--safe-top));
  padding-bottom: 10px;
  background: rgba(16, 16, 15, .96);
  border-bottom-color: rgba(255, 255, 255, .09);
  box-shadow: 0 10px 30px rgba(16, 12, 8, .16);
}
.brand-logo { width: 140px; padding: 4px 6px; background: transparent; }
.pedigree { color: #bcb2a8; }
.pedigree-mark { width: 14px; height: 18px; }
.topbar-nav { display: flex; align-items: center; gap: 4px; }
.topbar-nav a {
  min-height: 38px; display: inline-flex; align-items: center; padding: 0 12px;
  border-radius: 9px; color: #bcb2a8; font-size: 13px; font-weight: 650; text-decoration: none;
}
.topbar-nav a:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.topbar-nav .team-entry {
  min-height: 38px; display: inline-flex; align-items: center; gap: 7px; padding: 0 12px;
  border: 1px solid rgba(255, 177, 92, .34); border-radius: 9px;
  color: #fff; background: rgba(255, 120, 61, .12); font: inherit;
  font-size: 13px; font-weight: 700; cursor: pointer;
}
.topbar-nav .team-entry:hover { background: rgba(255, 120, 61, .22); border-color: rgba(255, 177, 92, .62); }
.topbar-nav .team-entry span {
  padding: 2px 6px; border-radius: 999px; background: var(--gradient-flame);
  color: #1b1210; font-size: 9px; font-weight: 850; letter-spacing: .07em; text-transform: uppercase;
}
.topbar .chip { border-color: rgba(255, 255, 255, .14); background: #24221f; color: #c9bfb4; }
.topbar .chip b { color: #fff; }
.topbar .chip[data-tone="demo"] { background: rgba(255, 167, 35, .13); border-color: rgba(255, 167, 35, .34); }
.topbar .ghost { min-height: 40px; border-color: rgba(255, 255, 255, .18); background: transparent; color: #fff; }

.start-shell {
  display: grid; grid-template-columns: 202px minmax(0, 1fr);
  min-height: calc(100dvh - var(--topbar-height)); background: var(--obsidian);
}
.start-content { min-width: 0; background: var(--surface-canvas); overflow: clip; }
.studio-rail {
  position: sticky; top: var(--topbar-height); height: calc(100dvh - var(--topbar-height));
  display: flex; flex-direction: column; gap: 24px; padding: 22px 14px 18px;
  color: #f7efe5; background: linear-gradient(180deg, #15171d 0%, #0f1014 100%); border-right: 1px solid rgba(255, 255, 255, .08);
}
.rail-brand { display: flex; align-items: center; gap: 10px; padding: 0 7px; }
.rail-brand img { border-radius: 9px; box-shadow: 0 5px 18px rgba(255, 167, 35, .18); }
.rail-brand span { display: grid; line-height: 1.1; }
.rail-brand b { font-size: 14px; letter-spacing: .01em; }
.rail-brand small { margin-top: 4px; color: #938a81; font-size: 10px; letter-spacing: .12em; text-transform: uppercase; }
.studio-rail nav { display: grid; gap: 5px; }
.studio-rail nav a {
  min-height: 44px; display: flex; align-items: center; gap: 11px; padding: 0 11px;
  border-radius: 10px; color: #aaa29a; font-size: 13.5px; font-weight: 620; text-decoration: none;
}
.studio-rail nav a:hover { color: #fff; background: #24221f; }
.studio-rail nav a:first-child { box-shadow: inset 3px 0 0 var(--amber); }
.studio-rail nav svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.rail-launch {
  margin-top: auto; display: flex; gap: 10px; align-items: flex-start; padding: 14px 11px;
  border: 1px solid #332f2b; border-radius: 14px; background: #1a1917;
}
.rail-launch img { flex: none; object-fit: contain; }
.rail-launch span { display: grid; min-width: 0; }
.rail-launch small { color: #8f877f; font-size: 9.5px; letter-spacing: .1em; text-transform: uppercase; }
.rail-launch b { margin-top: 2px; color: #fff; font-size: 12.5px; }
.rail-launch em { margin-top: 8px; color: var(--amber); font-size: 10.5px; font-style: normal; line-height: 1.35; }

.hero {
  margin: 16px 16px 0; padding: clamp(36px, 5vw, 68px) clamp(20px, 5vw, 72px) clamp(28px, 4vw, 52px);
  border-radius: 28px; isolation: isolate; color: #f8f3ed;
  border: 1px solid rgba(255, 184, 153, .22);
  box-shadow: 0 24px 70px rgba(38, 23, 32, .22), 0 0 0 1px rgba(201, 149, 134, .08);
  scroll-margin-top: calc(var(--topbar-height) + 16px);
}
.hero::before {
  background:
    linear-gradient(112deg, rgba(8, 12, 20, .96) 0%, rgba(12, 16, 26, .88) 44%, rgba(18, 20, 31, .72) 76%, rgba(18, 18, 28, .78) 100%),
    radial-gradient(90% 120% at 88% 18%, rgba(255, 151, 78, .34), transparent 62%),
    radial-gradient(75% 100% at 65% 75%, rgba(223, 92, 121, .34), transparent 68%),
    url("../assets/matchvibe-higgsfield-hero-20260911.jpg") center / cover no-repeat;
  background-color: #121722;
  background-blend-mode: normal, screen, screen, luminosity;
}
.hero::after { height: 16%; background: linear-gradient(180deg, transparent, rgba(16, 16, 15, .32)); }
.hero-panels { opacity: .08; }
.hero-inner { max-width: 1180px; text-align: left; }
.hero-eyebrow {
  display: flex; align-items: center; gap: 9px; margin: 0 0 14px; color: #d9d0c7;
  font-size: 11px; font-weight: 750; letter-spacing: .13em; text-transform: uppercase;
}
.hero-eyebrow span { width: 22px; height: 2px; border-radius: 9px; background: var(--amber); box-shadow: 0 0 16px rgba(255, 167, 35, .7); }
.hero h1 {
  max-width: 860px; margin-bottom: 16px; color: #fffaf4; font-size: clamp(46px, 7.5vw, 94px);
  font-family: var(--font); font-weight: 780;
  line-height: .98; letter-spacing: -.045em; text-transform: none;
}
.hero h1 strong {
  font: inherit; color: transparent;
  background: var(--gradient-flame); -webkit-background-clip: text; background-clip: text;
  filter: drop-shadow(0 8px 28px rgba(255, 120, 61, .18));
}
.hero-sub { margin: 0 0 22px; max-width: 62ch; color: #d8cfc6; font-size: clamp(15px, 1.6vw, 18px); }
.hero-library-rail {
  margin: 0 0 26px; border-color: var(--border-rose-gold); background: rgba(255, 255, 255, .10);
  box-shadow: 0 10px 32px rgba(10, 12, 18, .16); color: #fff;
}
.hero-library-rail small { color: #bdb4ab; }
.hero-library-rail a { color: #fff; }
.hero-library-rail a:hover { background: rgba(255, 255, 255, .09); }

.composer-wrap { max-width: 980px; margin: 0; }
.categories { gap: 7px; padding: 0 0 8px; }
.categories button {
  position: relative; min-width: 190px; min-height: 62px; gap: 11px; justify-content: flex-start;
  padding: 9px 13px; border: 1px solid rgba(255, 255, 255, .13); border-radius: 12px;
  background: rgba(255, 255, 255, .07); color: #d5ccc4; text-align: left;
}
.categories button[aria-selected="true"] { border-color: var(--amber); background: var(--paper); color: var(--ink); box-shadow: 0 8px 30px rgba(0, 0, 0, .18); }
.categories button[disabled] { opacity: .7; }
.category-icon { flex: none; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; background: rgba(255, 255, 255, .08); }
.category-icon svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.55; stroke-linecap: round; stroke-linejoin: round; }
.categories button[aria-selected="true"] .category-icon { background: #fff0d8; color: #b86d00; }
.category-copy { min-width: 0; display: grid; line-height: 1.15; }
.category-copy b { font-size: 13.5px; }
.category-copy small { margin-top: 4px; color: inherit; font-size: 10.5px; opacity: .68; }
.categories .unavailable-tag {
  position: absolute; top: 6px; right: 7px; margin: 0; padding: 2px 5px; border-radius: 5px;
  background: rgba(255, 255, 255, .08); font-size: 8px;
}
.composer-wrap .composer {
  margin-top: 0; padding: 18px 18px 13px; border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 15px; background: rgba(13, 14, 18, .86); backdrop-filter: blur(16px); box-shadow: 0 18px 50px rgba(0, 0, 0, .30);
}
.composer textarea { min-height: 82px; color: #fff; font-size: 16.5px; }
.composer textarea::placeholder { color: #a79d94; }
.composer-hint { color: #b8aea5; font-size: 13px; }
.send { min-height: 46px; padding: 0 22px; background: var(--gradient-flame); color: #24151a; box-shadow: 0 8px 24px rgba(255, 104, 68, .28); }
.send:hover { background: linear-gradient(125deg, #ffc272 0%, #ff8b4b 48%, #ec6f8a 100%); }
.composer-note {
  display: inline-flex; gap: 7px; margin: 9px 0 0; padding: 7px 10px; border-radius: 8px;
  background: rgba(255, 255, 255, .08); color: #cfc5bc; font-size: 12.5px; text-align: left;
}
.composer-note b { color: var(--amber); }

.build-pipeline {
  position: relative; z-index: 1; max-width: 980px; list-style: none; margin: 24px 0 14px; padding: 0;
  display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid rgba(255, 255, 255, .11);
  border-radius: 13px; background: rgba(9, 9, 8, .58); overflow: hidden;
}
.build-pipeline li { min-width: 0; display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-right: 1px solid rgba(255, 255, 255, .1); }
.build-pipeline li:last-child { border-right: 0; }
.build-pipeline svg { flex: none; width: 18px; height: 18px; fill: none; stroke: #7f7770; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.build-pipeline li[data-stage="active"] svg { stroke: var(--amber); }
.build-pipeline li[data-stage="planned"] { opacity: .64; }
.build-pipeline li[data-stage="available"] svg { stroke: #d9d0c7; }
.build-pipeline span { min-width: 0; display: grid; line-height: 1.15; }
.build-pipeline b { color: #f6f0ea; font-size: 12px; }
.build-pipeline small { margin-top: 3px; color: #8f877f; font-size: 9.5px; white-space: nowrap; }

.studio-glimpse {
  position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(230px, .65fr);
  max-width: 980px; min-height: 330px; border: 1px solid rgba(255, 255, 255, .12); border-radius: 17px;
  background: var(--paper); color: var(--ink); overflow: hidden; box-shadow: 0 20px 50px rgba(0, 0, 0, .22);
}
.glimpse-preview { min-width: 0; display: flex; flex-direction: column; border-right: 1px solid #e7ded4; }
.glimpse-chrome { min-height: 42px; display: flex; align-items: center; gap: 10px; padding: 0 13px; background: #f1ebe4; border-bottom: 1px solid #e3d9cf; }
.glimpse-chrome > span { display: flex; gap: 5px; }
.glimpse-chrome i { display: block; width: 7px; height: 7px; border-radius: 50%; background: #d3c3b3; }
.glimpse-chrome b { font-size: 11px; letter-spacing: .04em; text-transform: uppercase; }
.glimpse-chrome small { margin-left: auto; color: var(--muted); font-size: 10.5px; }
.glimpse-canvas { flex: 1; padding: 18px; background: #151513; color: #f8f3ed; }
.glimpse-appbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 15px; border-bottom: 1px solid #302e2a; }
.glimpse-appbar span { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; }
.glimpse-appbar img { border-radius: 6px; }
.glimpse-appbar em { padding: 5px 8px; border: 1px solid #4a443b; border-radius: 999px; color: #bdb3a9; font-size: 9px; font-style: normal; letter-spacing: .06em; text-transform: uppercase; }
.glimpse-copy { padding: clamp(24px, 4vw, 42px) 4px 22px; }
.glimpse-copy p { margin: 0 0 6px; color: var(--amber); font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.glimpse-copy h2 { max-width: 18ch; margin: 0 0 9px; color: #fff; font-size: clamp(23px, 3vw, 34px); line-height: 1.02; letter-spacing: -.035em; }
.glimpse-copy > span { display: block; max-width: 55ch; color: #a9a198; font-size: 12px; }
.glimpse-metrics { display: grid; grid-template-columns: 1.2fr .8fr; gap: 9px; }
.glimpse-metrics > span { min-height: 72px; display: flex; align-items: end; gap: 5px; padding: 12px; border: 1px solid #302e2a; border-radius: 10px; background: #1c1b19; }
.glimpse-metrics i { flex: 1; min-width: 8px; border-radius: 3px 3px 0 0; background: var(--amber); }
.glimpse-metrics i:nth-child(1) { height: 36%; }.glimpse-metrics i:nth-child(2) { height: 78%; }.glimpse-metrics i:nth-child(3) { height: 55%; }.glimpse-metrics i:nth-child(4) { height: 92%; }
.glimpse-metrics > span:last-child i { height: 45%; background: #d8d0c7; border-radius: 999px; }
.glimpse-metrics > span:last-child i:last-child { height: 84%; background: var(--cyan); }
.glimpse-inspector { padding: 22px 20px; background: #fffaf3; }
.inspector-kicker { margin: 0 0 8px; color: #a76b16; font-size: 9.5px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.glimpse-inspector h2 { margin: 0 0 18px; font-size: 22px; line-height: 1.03; letter-spacing: -.025em; }
.glimpse-inspector ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; }
.glimpse-inspector li { display: grid; grid-template-columns: 9px 1fr auto; gap: 8px; align-items: center; min-height: 42px; padding: 8px 0; border-bottom: 1px solid #eee5dc; }
.glimpse-inspector li > span { width: 7px; height: 7px; border-radius: 50%; background: #bfafa0; }
.glimpse-inspector li[data-state="ready"] > span { background: var(--ok); box-shadow: 0 0 0 4px rgba(47, 125, 79, .1); }
.glimpse-inspector li[data-state="build"] > span { background: var(--amber); }
.glimpse-inspector li[data-state="gate"] > span { background: var(--rose); }
.glimpse-inspector li b { font-size: 11.5px; }
.glimpse-inspector li small { color: var(--muted); font-size: 9.5px; text-align: right; }
.inspector-note { margin: 17px 0 0; color: var(--muted); font-size: 10.5px; line-height: 1.45; }
.hero .starters { max-width: 980px; margin: 14px 0 0; justify-content: flex-start; }
.hero .starters button { border-color: rgba(255, 255, 255, .14); background: rgba(255, 255, 255, .06); color: #cfc6bd; }
.hero .starters button:hover { border-color: var(--amber); background: rgba(255, 167, 35, .1); color: #fff; }

/* Flame gradient is the focal action language; rose-gold stays on quiet boundaries and metadata. */
.hero-eyebrow span { background: var(--gradient-flame); box-shadow: 0 0 18px rgba(255, 120, 61, .45); }
.categories button[aria-selected="true"] { border-color: var(--accent-rose-gold); box-shadow: 0 8px 30px rgba(38, 23, 32, .18), inset 0 0 0 1px rgba(255, 120, 61, .16); }
.categories button[aria-selected="true"] .category-icon { background: var(--gradient-flame); color: #24151a; }
.hero .starters button:hover { border-color: var(--accent-rose-gold); background: rgba(255, 120, 61, .13); }
.studio-glimpse { border-color: var(--border-rose-gold); }
.glimpse-inspector { background: var(--surface-panel); }

.library, .connect, .examples { scroll-margin-top: calc(var(--topbar-height) + 16px); }
.library { max-width: 1240px; padding-top: 44px; }
.library-head h2, .examples h2 { font-size: clamp(25px, 3vw, 34px); letter-spacing: -.035em; }
.library-grid { grid-template-columns: repeat(auto-fill, minmax(285px, 1fr)); gap: 16px; align-items: start; }
.tpl-card > article { height: auto; border-radius: 17px; padding: 17px; box-shadow: 0 1px 0 rgba(20, 17, 14, .03); }
.tpl-card[data-access="free"] > article { border-color: #e4c28f; box-shadow: inset 0 3px 0 var(--amber); }
.tpl-card[data-access="locked"] > article { background: #fbf8f3; }
.tpl-card[data-access="locked"] .tpl-blurb { color: #6f6257; }
.tpl-cover { width: 60px; height: 60px; border-radius: 14px; }
.tpl-top h3 { font-size: 17px; letter-spacing: -.015em; }

.builder { min-height: calc(100vh - var(--topbar-height)); min-height: calc(100dvh - var(--topbar-height)); background: var(--surface-canvas); }
.builder-grid {
  gap: 0; margin: 16px; padding: 0; grid-template-columns: 210px minmax(320px, .78fr) minmax(480px, 1.4fr);
  align-items: stretch; min-height: calc(100dvh - var(--topbar-height) - 32px);
  border: 1px solid #ded6d3; border-radius: 18px; background: var(--surface-panel); overflow: hidden; box-shadow: 0 22px 60px rgba(35, 25, 17, .12);
}
.projects, .work, .preview { border: 0; border-radius: 0; padding: 18px; }
.projects { top: calc(var(--topbar-height) + 16px); align-self: stretch; color: #f4ece3; background: var(--obsidian); border-right: 1px solid #302e2b; }
.projects-head h2, .projects .empty, .projects li small { color: #9e968e; }
.projects-head .ghost { border-color: #48443f; background: #24221f; color: #fff; }
.projects li button { color: #c8c0b8; }
.projects li button:hover { background: #24221f; color: #fff; }
.projects li button[aria-current="true"] { background: #2a251d; color: #fff; box-shadow: inset 3px 0 0 var(--amber); }
.projects .persistence-note { color: #8f877f; }
.work { background: #f7f4f3; border-right: 1px solid #e3d9cf; }
.preview { background: var(--surface-panel); }
.preview-head { min-height: 50px; background: #f7f2ec; }
.preview-frame { min-height: 590px; padding: 12px; background: #e9e4de; }
.preview-frame iframe { min-height: 566px; border-radius: 10px; box-shadow: 0 12px 32px rgba(28, 20, 14, .1); }
.run-log li .k { color: var(--ink-soft); font-size: 12px; }

.modal { max-height: calc(100dvh - 36px - var(--safe-top) - var(--safe-bottom)); overflow: auto; overscroll-behavior: contain; }

.topbar :focus-visible,
.studio-rail :focus-visible,
.hero :focus-visible,
.projects :focus-visible {
  outline-color: #ffd078;
  box-shadow: 0 0 0 2px var(--obsidian);
}

@media (max-width: 1180px) {
  .start-shell { grid-template-columns: 174px minmax(0, 1fr); }
  .studio-rail { padding-left: 10px; padding-right: 10px; }
  .categories button { min-width: 175px; }
  .studio-glimpse { grid-template-columns: 1fr 250px; }
  .builder-grid { grid-template-columns: 188px minmax(270px, .9fr) minmax(0, 1.2fr); }
}

@media (max-width: 900px) {
  .topbar { flex-wrap: wrap; }
  .topbar-nav {
    order: 5; width: 100%; display: flex; gap: 6px; overflow-x: auto;
    padding-top: 2px; scrollbar-width: none;
  }
  .topbar-nav a { min-height: 44px; flex: 1 0 auto; justify-content: center; }
  .topbar-nav .team-entry { min-height: 44px; flex: 1 0 auto; justify-content: center; white-space: nowrap; }
  .start-shell { display: block; background: var(--cream); }
  .studio-rail { display: none; }
  .hero { margin: 10px; padding-left: clamp(18px, 5vw, 42px); padding-right: clamp(18px, 5vw, 42px); border-radius: 22px; }
  .hero h1 { font-size: clamp(48px, 10vw, 78px); }
  .studio-glimpse { grid-template-columns: 1fr; }
  .glimpse-preview { border-right: 0; border-bottom: 1px solid #e7ded4; }
  .glimpse-inspector ul { grid-template-columns: 1fr 1fr; gap: 0 16px; }
  .builder-grid { margin: 10px; grid-template-columns: 180px 1fr; }
  .preview { grid-column: 1 / -1; }
}

@media (max-width: 720px) {
  .topbar { min-height: auto; gap: 8px; }
  .brand-logo { width: 124px; }
  .pedigree { display: none; }
  .topbar-status { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 2px; scrollbar-width: none; }
  .topbar-nav a { padding-inline: 10px; font-size: 12px; }
  .topbar-nav .team-entry { padding-inline: 10px; font-size: 12px; }
  .topbar-nav .team-entry span { display: none; }
  .hero { margin: 6px; padding: 32px 14px 24px; border-radius: 18px; }
  .hero h1 { font-size: clamp(43px, 16vw, 66px); }
  .hero-sub { font-size: 15px; }
  .hero-library-rail { display: grid; grid-template-columns: auto 1fr; border-radius: 13px; }
  .hero-library-rail a { grid-column: 2; margin: 0; padding: 3px 0 1px; }
  .categories { display: grid; grid-template-columns: 1fr; gap: 6px; }
  .categories button { min-width: 0; width: 100%; min-height: 56px; flex-direction: row; justify-content: flex-start; padding: 8px 12px; text-align: left; }
  .categories button[disabled] { min-height: 48px; }
  .categories button[disabled] .category-icon { width: 30px; height: 30px; }
  .categories .unavailable-tag { display: inline-flex; top: 50%; right: 9px; margin: 0; transform: translateY(-50%); }
  .composer-wrap .composer { padding: 14px 13px 11px; }
  .composer textarea { min-height: 96px; font-size: 16px; }
  .composer-note { display: block; line-height: 1.45; }
  .build-pipeline { grid-template-columns: 1fr 1fr; }
  .build-pipeline li:nth-child(2) { border-right: 0; }
  .build-pipeline li:nth-child(-n+2) { border-bottom: 1px solid rgba(255, 255, 255, .1); }
  .studio-glimpse { min-height: 0; }
  .glimpse-copy { padding-top: 26px; }
  .glimpse-metrics { grid-template-columns: 1fr; }
  .glimpse-inspector ul { grid-template-columns: 1fr; }
  .hero .starters { display: grid; }
  .library { padding-top: 32px; }
  .builder-grid { margin: 8px; border-radius: 14px; grid-template-columns: 1fr; }
  .projects { order: 0; position: static; border-right: 0; border-bottom: 1px solid #302e2b; }
  .work { border-right: 0; }
  .preview-frame { min-height: 430px; }
  .preview-frame iframe { min-height: 406px; }
  .modal-actions { position: sticky; bottom: -22px; margin: 0 -22px -22px; padding: 12px 22px 22px; background: #fff; }
}

@media (max-width: 620px) {
  .team-dialog { overflow-x: hidden; }
  .team-dialog .modal-actions {
    bottom: -18px; margin: 0 -18px -18px; padding: 12px 18px 18px;
  }
}
