/* Mello Studio. Tokens match the Mello Marketing app: teal does the work (buttons,
   links, the active place), orange is the spark (running count, focus). Light by
   default, dark follows the system. */
:root {
  color-scheme: light;
  --bg: #f3f6f7; --surface: #ffffff; --surface-2: #f8fafb; --surface-3: #ebf0f2;
  --line: #e0e7ea; --line-strong: #c6d2d7;
  --ink: #14232a; --ink-2: #3f525a; --muted: #5c6f77; --heading: #0c1d24;
  --navy: #0b3b45; --navy-2: #12505c; --gold: #e8781e; --gold-ink: #0e5f6e; --gold-tint: #e2eff1; --hero-accent: #f7ad6e;
  --primary: #0e5f6e; --primary-ink: #ffffff; --primary-hover: #0a4c58; --ring: #d0650f;
  --ok: #157a5c; --ok-tint: #e4f3ec; --warn: #8f5d00; --warn-tint: #fbf1de; --bad: #b42318; --bad-tint: #fcecea; --info: #3d5a85; --info-tint: #edf2f8;
  --shadow: 0 1px 2px rgba(12, 29, 36, .04), 0 1px 3px rgba(12, 29, 36, .04);
  --shadow-lg: 0 16px 40px rgba(12, 29, 36, .12), 0 2px 8px rgba(12, 29, 36, .05);
  --sidebar: #f8fafb; --sidebar-ink: #36494f; --sidebar-muted: #5e7078; --sidebar-active: #e2eef1; --sidebar-strong: #0c1d24;
  --radius: 14px; --radius-s: 10px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --display: Manrope, Inter, ui-sans-serif, system-ui, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --nav-h: 0px;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #0b1215; --surface: #121b1f; --surface-2: #162127; --surface-3: #1d292f;
    --line: #24333a; --line-strong: #314349;
    --ink: #e3ecef; --ink-2: #b2c2c8; --muted: #889aa1; --heading: #f5f9fa;
    --navy: #0f3440; --navy-2: #15434f; --gold: #f28b3c; --gold-ink: #7cc7d5; --gold-tint: #10303a;
    --primary: #5bbccd; --primary-ink: #04212a; --primary-hover: #86d0dd; --ring: #f28b3c;
    --ok: #4fd1a5; --ok-tint: #10291f; --warn: #f2b64c; --warn-tint: #2a2111; --bad: #ff8a7a; --bad-tint: #331715; --info: #9db8e8; --info-tint: #172238;
    --shadow: 0 1px 2px rgba(0, 0, 0, .35); --shadow-lg: 0 16px 40px rgba(0, 0, 0, .5);
    --sidebar: #0f171b; --sidebar-ink: #c3d1d6; --sidebar-muted: #7e9198; --sidebar-active: #1a282e; --sidebar-strong: #ffffff;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { font-family: var(--font); background: var(--bg); color: var(--ink); font-size: 14.5px; line-height: 1.5; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
h1, h2, h3 { font-family: var(--display); color: var(--heading); text-wrap: balance; margin: 0; }
p { margin: 0; }
a { color: var(--gold-ink); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
::selection { background: color-mix(in srgb, var(--primary) 25%, transparent); }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
.muted { color: var(--muted); } .small { font-size: 12.5px; } .bad { color: var(--bad); } .grow { flex: 1; min-width: 0; }
.mono { font-family: var(--mono); font-size: 12px; word-break: break-all; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }

/* icons */
.i { display: inline-grid; place-items: center; flex: none; width: 18px; height: 18px; }
.i svg { width: 100%; height: 100%; display: block; }
.i.lg { width: 28px; height: 28px; }
.i.fill svg { fill: currentColor; }
.mark { display: inline-block; width: 34px; height: 34px; flex: none; }
.mark svg { width: 100%; height: 100%; display: block; border-radius: 10px; }

/* shell */
.app { display: grid; grid-template-columns: 244px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--sidebar); border-right: 1px solid var(--line); padding: 18px 12px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; }
.brand b { display: block; font-family: var(--display); font-weight: 800; font-size: 16px; color: var(--sidebar-strong); letter-spacing: -.01em; }
.brand small { color: var(--sidebar-muted); font-size: 12px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav button { position: relative; width: 100%; text-align: left; background: transparent; border: 0; padding: 9px 10px; border-radius: 10px; color: var(--sidebar-ink); display: flex; align-items: center; gap: 11px; font-weight: 500; }
.nav button .i { color: var(--sidebar-muted); }
.nav button:hover { background: var(--sidebar-active); color: var(--sidebar-strong); }
.nav button.on { background: var(--sidebar-active); color: var(--sidebar-strong); font-weight: 600; }
.nav button.on .i { color: var(--gold-ink); }
.count { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--gold); color: #fff; font-size: 11.5px; font-weight: 700; display: inline-grid; place-items: center; }
.side-foot { margin-top: auto; padding: 10px; font-size: 12.5px; color: var(--sidebar-muted); display: flex; align-items: center; gap: 8px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
.dot.ok { background: var(--ok); } .dot.info { background: var(--info); } .dot.bad { background: var(--bad); }
.main { padding: 28px 32px 64px; min-width: 0; }
.page { max-width: 1320px; margin: 0 auto; }
.mobile-head { display: none; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.page-head p { color: var(--muted); margin-top: 4px; max-width: 62ch; }
.head-right { display: flex; gap: 10px; align-items: center; }

/* surfaces and controls */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
section.card { margin-bottom: 16px; }
.card h2 { font-size: 16px; font-weight: 700; margin-bottom: 10px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); border-radius: var(--radius-s); padding: 9px 14px; font-weight: 600; font-size: 14px; line-height: 1.2; transition: background .15s, border-color .15s, color .15s; white-space: nowrap; }
.btn:hover { background: var(--surface-2); border-color: var(--muted); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.btn.primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn.lg { padding: 12px 20px; font-size: 15px; border-radius: 12px; }
.btn.sm { padding: 7px 11px; font-size: 13px; }
.btn.sm .i { width: 16px; height: 16px; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--surface-3); }
.btn.danger { color: var(--bad); }
.btn.danger:hover { background: var(--bad-tint); border-color: var(--bad); }
.btn.on { background: var(--gold-tint); border-color: var(--primary); color: var(--gold-ink); }
.btn:disabled { opacity: .55; }
.btn .count { margin-left: 2px; }
.link { background: none; border: 0; padding: 2px 0; color: var(--gold-ink); font-weight: 600; font-size: 13px; display: inline-flex; align-items: center; gap: 6px; }
.link:hover { text-decoration: underline; }
.link .i { width: 15px; height: 15px; }
.icon-btn { width: 34px; height: 34px; border-radius: 9px; border: 0; background: transparent; color: var(--ink-2); display: inline-grid; place-items: center; flex: none; }
.icon-btn:hover { background: var(--surface-3); color: var(--ink); }
.icon-btn.fav-on { color: var(--gold); }
input[type=text], input[type=number], input[type=password], input[type=search], input[type=url], select, textarea {
  width: 100%; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-s); padding: 10px 12px; color: var(--ink); outline: none; transition: border-color .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .8; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent); }
textarea { resize: vertical; line-height: 1.55; }
select { appearance: none; padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235c6f77' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 16px; }
.field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.lab { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.lab.between { display: flex; }
.hint { font-size: 12.5px; color: var(--muted); }
.pill { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-2); border-radius: 999px; padding: 7px 13px; font-size: 13.5px; font-weight: 500; }
.pill:hover { border-color: var(--primary); color: var(--ink); }
.pill.on { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.pill.sm { padding: 3px 9px; font-size: 12px; white-space: nowrap; }
.pill .x { border: 0; background: transparent; color: inherit; padding: 0; display: inline-grid; place-items: center; }
.pill .i { width: 15px; height: 15px; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 2px; background: var(--surface-3); border-radius: 11px; padding: 3px; }
.seg button { border: 0; background: transparent; color: var(--muted); padding: 7px 14px; border-radius: 9px; font-size: 13.5px; font-weight: 600; }
.seg button:hover { color: var(--ink); }
.seg button.on { background: var(--surface); color: var(--heading); box-shadow: var(--shadow), 0 0 0 1px var(--line); }
.unit { display: flex; align-items: center; gap: 8px; }
.unit input { width: 96px; }
.unit span { color: var(--muted); font-size: 13.5px; }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; font-size: 14px; color: var(--ink-2); padding: 8px 0; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch i { width: 40px; height: 22px; border-radius: 999px; background: var(--line-strong); position: relative; transition: background .15s; flex: none; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: left .15s; }
.switch input:checked + i { background: var(--primary); }
.switch input:checked + i::after { left: 21px; }
.switch input:focus-visible + i { outline: 2px solid var(--ring); outline-offset: 2px; }
.spin { display: inline-block; width: 14px; height: 14px; border: 2px solid color-mix(in srgb, var(--muted) 35%, transparent); border-top-color: var(--gold); border-radius: 50%; animation: spin .8s linear infinite; flex: none; }
.spin.lg { width: 26px; height: 26px; border-width: 3px; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation-duration: 2.4s; } * { transition: none !important; } }
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 36px 20px; color: var(--muted); border: 1px dashed var(--line-strong); border-radius: var(--radius); }
.empty b { color: var(--heading); font-size: 15px; }
.empty p { max-width: 44ch; font-size: 13.5px; }
.empty.big { padding: 64px 20px; background: var(--surface); }
.empty .btn { margin-top: 6px; }
.banner { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 12px; border: 1px solid; margin: 0 auto 20px; max-width: 1320px; }
.banner > .i { width: 22px; height: 22px; }
.banner b { color: var(--heading); }
.banner p { color: var(--ink-2); font-size: 13.5px; }
.banner.warn { background: var(--warn-tint); border-color: color-mix(in srgb, var(--warn) 40%, transparent); }
.banner.warn > .i { color: var(--warn); }
.banner.info { background: var(--info-tint); border-color: color-mix(in srgb, var(--info) 35%, transparent); }
.banner.info > .i { color: var(--info); }

/* create */
.create { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
.compose { display: flex; flex-direction: column; gap: 20px; padding: 20px 20px 0; min-width: 0; }
.modes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.modes button { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 10px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink-2); font-weight: 600; font-size: 14.5px; transition: border-color .15s, background .15s; }
.modes button:hover { border-color: var(--line-strong); color: var(--ink); }
.modes button.on { background: var(--gold-tint); border-color: var(--primary); color: var(--gold-ink); box-shadow: inset 0 0 0 1px var(--primary); }
.types { display: flex; flex-wrap: wrap; gap: 8px; margin-top: -6px; }
.type-help { color: var(--muted); font-size: 13.5px; margin-top: -10px; }
.looks { display: flex; gap: 10px; overflow-x: auto; padding: 2px 2px 8px; scroll-snap-type: x proximity; scrollbar-width: thin; }
.look { flex: none; width: 112px; display: flex; flex-direction: column; gap: 6px; text-align: left; padding: 6px 6px 8px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); scroll-snap-align: start; transition: border-color .15s, box-shadow .15s; }
.look:hover { border-color: var(--line-strong); }
.look.on { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.look .sw { aspect-ratio: 4 / 3; border-radius: 8px; overflow: hidden; display: grid; place-items: center; background: linear-gradient(135deg, var(--navy), var(--navy-2)); }
.look .sw.none { background: var(--surface-3); color: var(--muted); }
.look .sw img { width: 100%; height: 100%; object-fit: cover; }
.ini { font-family: var(--display); font-weight: 800; letter-spacing: .04em; color: var(--hero-accent); font-size: 18px; }
.look b { font-size: 12.5px; font-weight: 600; line-height: 1.25; color: var(--ink); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.look small { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.refstrip { display: flex; gap: 10px; flex-wrap: wrap; }
.ref, .refstrip .add { width: 84px; height: 84px; border-radius: 12px; flex: none; }
.ref { position: relative; overflow: hidden; border: 1px solid var(--line); background: var(--surface-3); }
.ref img, .ref video { width: 100%; height: 100%; object-fit: cover; display: block; }
.ref .x { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 7px; border: 0; background: rgba(6, 12, 15, .65); color: #fff; display: grid; place-items: center; padding: 0; }
.ref .x .i { width: 14px; height: 14px; }
.ref .n { position: absolute; left: 4px; bottom: 4px; background: rgba(6, 12, 15, .7); color: #fff; font-size: 10.5px; padding: 1px 6px; border-radius: 5px; }
.refstrip .add { border: 1.5px dashed var(--line-strong); background: transparent; color: var(--muted); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 12px; font-weight: 600; }
.refstrip .add:hover { border-color: var(--primary); color: var(--gold-ink); background: var(--gold-tint); }
.source { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.shapes { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.shape { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 6px 10px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); text-align: center; min-width: 0; }
.shape:hover { border-color: var(--line-strong); }
.shape i { display: block; border: 2px solid currentColor; border-radius: 4px; margin: 2px 0 4px; opacity: .8; }
.shape b { font-size: 13px; font-weight: 600; color: var(--ink); }
.shape small { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.shape.on { border-color: var(--primary); background: var(--gold-tint); color: var(--gold-ink); box-shadow: inset 0 0 0 1px var(--primary); }
.shape.more { justify-content: center; gap: 6px; }
.shape.more select { padding: 5px 26px 5px 8px; font-size: 12.5px; background-position: right 6px center; background-size: 14px; }
.row-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; }
.advanced { border-top: 1px solid var(--line); padding-top: 14px; }
.advanced summary { list-style: none; display: flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; color: var(--ink-2); }
.advanced summary::-webkit-details-marker { display: none; }
.advanced summary small { color: var(--muted); font-weight: 400; font-size: 12.5px; }
.advanced summary::after { content: ""; margin-left: auto; width: 16px; height: 16px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235c6f77' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center / 16px no-repeat; transition: transform .15s; }
.advanced[open] summary::after { transform: rotate(180deg); }
.advanced[open] summary { margin-bottom: 14px; }
.adv-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 12px; }
.span2 { grid-column: 1 / -1; }
.compose-foot { position: sticky; bottom: var(--nav-h); z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 0 -20px; padding: 14px 20px; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(8px); border-top: 1px solid var(--line); border-radius: 0 0 var(--radius) var(--radius); }
.quote { display: flex; align-items: center; gap: 12px; min-height: 44px; }
.quote .price { display: flex; flex-direction: column; line-height: 1.1; }
.quote .price small { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.quote .price b { font-family: var(--display); font-size: 24px; font-weight: 800; color: var(--heading); font-variant-numeric: tabular-nums; }
.quote .via { display: flex; flex-direction: column; font-size: 13.5px; font-weight: 600; color: var(--ink); min-width: 0; }
.quote .via small { font-size: 12px; font-weight: 400; color: var(--muted); }
.quote.over .via small { color: var(--warn); font-weight: 600; }
.results { position: sticky; top: 20px; padding: 18px; }
.results h2 { font-size: 15px; margin: 0; }
.results .empty { margin-top: 14px; }
.runs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.run { position: relative; min-width: 0; }
.run .thumb { position: relative; display: block; width: 100%; aspect-ratio: 1; padding: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--surface-3); }
.run .thumb:not(:disabled):hover { border-color: var(--primary); }
.run .thumb img, .run .thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.ph { width: 100%; height: 100%; display: grid; place-items: center; color: var(--muted); }
.ph.tall { min-height: 150px; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 6px; background: linear-gradient(135deg, var(--navy), var(--navy-2)); color: var(--hero-accent); }
.ph.tall small { color: #d9e7ea; font-size: 12px; }
.run .state { position: absolute; left: 6px; bottom: 6px; background: rgba(6, 12, 15, .72); color: #fff; font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 999px; }
.run .state.bad { background: var(--bad); }
.run-cap { padding: 6px 2px 0; }
.run-cap p { font-size: 12.5px; font-weight: 500; color: var(--ink); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.35; }
.run-cap small { display: block; font-size: 11.5px; color: var(--muted); margin-top: 2px; overflow-wrap: anywhere; }
.run .cancel { position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; background: rgba(6, 12, 15, .65); color: #fff; }
.run .cancel:hover { background: var(--bad); color: #fff; }

/* plan */
.count.soft { background: var(--gold-tint); color: var(--gold-ink); }
.sync { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
.plan-hint { display: flex; align-items: center; gap: 10px; width: 100%; margin: -6px 0 16px; padding: 10px 14px; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--primary) 35%, transparent); background: var(--gold-tint); color: var(--gold-ink); font-size: 13.5px; text-align: left; }
.plan-hint span { flex: 1; color: var(--ink); }
.plan-hint b { font-weight: 600; }
.plan-hint:hover { border-color: var(--primary); }
.for-plan { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; background: var(--gold-tint); border: 1px solid color-mix(in srgb, var(--primary) 35%, transparent); color: var(--gold-ink); }
.for-plan b { display: block; color: var(--heading); font-size: 13.5px; }
.for-plan small { color: var(--muted); font-size: 12px; }
select.biz { width: auto; min-width: 180px; }
.group h2 small { color: var(--muted); font-family: var(--font); font-weight: 500; font-size: 13px; }
.needs { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; max-width: 920px; }
.need { display: flex; gap: 14px; padding: 14px; align-items: flex-start; }
.need.late { border-color: color-mix(in srgb, var(--warn) 45%, transparent); }
.need-thumb { flex: none; width: 84px; max-height: 112px; border-radius: 10px; overflow: hidden; background: var(--surface-3); border: 1px solid var(--line); display: grid; place-items: center; }
.need-thumb img, .need-thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.need-body { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 6px; }
.need-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.need h3 { font-family: var(--font); font-size: 14.5px; font-weight: 600; color: var(--heading); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.need .row { margin-top: 2px; }
@media (min-width: 761px) { .need { align-items: center; } .need-body { flex-direction: row; align-items: center; gap: 16px; } .need-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; } .need .row { margin: 0; flex-wrap: nowrap; } }
.pill-state { margin-left: auto; display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.pill-state .i { width: 13px; height: 13px; }
.pill-state .spin { width: 11px; height: 11px; }
.pill-state.needed { background: var(--warn-tint); color: var(--warn); }
.pill-state.making { background: var(--info-tint); color: var(--info); }
.pill-state.made { background: var(--ok-tint); color: var(--ok); }

/* library */
.search { position: relative; display: flex; align-items: center; width: min(380px, 100%); }
.search > .i { position: absolute; left: 12px; color: var(--muted); pointer-events: none; }
.search input { padding-left: 38px; padding-right: 36px; }
.search kbd { position: absolute; right: 10px; font-family: var(--mono); font-size: 11px; color: var(--muted); border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 5px; padding: 0 5px; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 16px; }
.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; align-items: end; margin-bottom: 16px; }
.wall { column-count: 4; column-gap: 16px; }
.tile { break-inside: avoid; margin: 0 0 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; cursor: zoom-in; box-shadow: var(--shadow); transition: transform .18s, box-shadow .18s, border-color .18s; }
.tile:hover, .tile:focus-visible { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: var(--line-strong); }
.tile .media { position: relative; background: var(--surface-3); }
.tile img, .tile video { width: 100%; display: block; }
.tile .tag { position: absolute; top: 8px; left: 8px; display: inline-flex; align-items: center; gap: 4px; background: rgba(6, 12, 15, .6); color: #fff; font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 999px; backdrop-filter: blur(4px); }
.tile .tag .i { width: 11px; height: 11px; }
.tile .fav { position: absolute; top: 8px; right: 8px; width: 32px; height: 32px; border-radius: 9px; border: 0; background: rgba(6, 12, 15, .5); color: #fff; display: grid; place-items: center; opacity: 0; transition: opacity .15s; backdrop-filter: blur(4px); }
.tile .fav .i { width: 16px; height: 16px; }
.tile .fav.on { opacity: 1; color: var(--gold); }
.tile .quick { position: absolute; right: 8px; bottom: 8px; display: flex; gap: 6px; opacity: 0; transition: opacity .15s; }
.tile .quick button, .tile .quick a { width: 32px; height: 32px; border-radius: 9px; border: 0; background: rgba(6, 12, 15, .6); color: #fff; display: grid; place-items: center; backdrop-filter: blur(4px); }
.tile .quick .i { width: 16px; height: 16px; }
.tile .quick button:hover, .tile .quick a:hover { background: var(--primary); color: var(--primary-ink); }
.tile .quick .danger:hover { background: var(--bad); color: #fff; }
.tile:hover .fav, .tile:hover .quick, .tile:focus-within .fav, .tile:focus-within .quick { opacity: 1; }
@media (hover: none) { .tile .quick, .tile .fav { opacity: 1; } }
.tile figcaption { padding: 10px 12px 12px; }
.tile figcaption p { font-size: 13px; font-weight: 500; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile figcaption small { font-size: 11.5px; color: var(--muted); display: block; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile figure, figure.tile { margin: 0 0 16px; }
.more { text-align: center; margin-top: 8px; }

/* lightbox */
.lb { position: fixed; inset: 0; z-index: 50; display: grid; grid-template-columns: minmax(0, 1fr) 400px; background: rgba(6, 12, 15, .92); backdrop-filter: blur(8px); }
.lb:focus { outline: none; }
.lb .stage { position: relative; display: grid; place-items: center; padding: 28px 72px; min-width: 0; min-height: 0; }
.lb .stage img, .lb .stage video { max-width: 100%; max-height: calc(100vh - 56px); border-radius: 12px; box-shadow: 0 24px 60px rgba(0, 0, 0, .5); }
.lb .stage audio { width: min(600px, 90%); }
.lb .stage .icon-btn { position: absolute; background: rgba(255, 255, 255, .1); color: #fff; }
.lb .stage .icon-btn:hover { background: rgba(255, 255, 255, .2); }
.lb .close { top: 16px; left: 16px; width: 40px; height: 40px; }
.lb .navbtn { top: 50%; transform: translateY(-50%); width: 44px; height: 56px; }
.lb .navbtn .i { width: 24px; height: 24px; }
.lb .prev { left: 16px; } .lb .next { right: 16px; }
.lb .panel { background: var(--surface); border-left: 1px solid var(--line); padding: 20px; overflow: auto; display: flex; flex-direction: column; gap: 18px; }
.lb .panel h2 { font-size: 17px; }
.promptbox { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.promptbox p { font-size: 13.5px; white-space: pre-wrap; max-height: 180px; overflow: auto; color: var(--ink); }
.actions { display: flex; flex-direction: column; gap: 8px; }
.act-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.act-grid .btn { justify-content: flex-start; }
.kv { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 8px 12px; margin: 0; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; color: var(--ink); min-width: 0; overflow-wrap: anywhere; }
.panel-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 14px; border-top: 1px solid var(--line); margin-top: auto; }

/* modal and toast */
.modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 20px; background: rgba(6, 12, 15, .55); backdrop-filter: blur(3px); }
.modal .card { width: min(640px, 100%); max-height: 86vh; overflow: auto; display: flex; flex-direction: column; gap: 16px; box-shadow: var(--shadow-lg); }
.modal h2 { font-size: 18px; margin: 0; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.sub-h { font-size: 13px; font-weight: 600; color: var(--ink-2); font-family: var(--font); margin: 4px 0 0; }
.pickgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 8px; }
.pickgrid button { aspect-ratio: 1; padding: 0; border: 2px solid transparent; border-radius: 10px; overflow: hidden; background: var(--surface-3); }
.pickgrid button:hover { border-color: var(--primary); }
.pickgrid img, .pickgrid video { width: 100%; height: 100%; object-fit: cover; display: block; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 70; display: flex; align-items: center; gap: 10px; max-width: min(520px, calc(100vw - 32px)); padding: 11px 16px; border-radius: 12px; background: #0c1d24; color: #fff; font-size: 13.5px; box-shadow: var(--shadow-lg); animation: rise .2s ease-out; }
.toast .i { color: #4fd1a5; }
.toast.err .i { color: #ff8a7a; }
@keyframes rise { from { transform: translateY(8px); opacity: 0; } }

/* uploads, looks */
.drop { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 34px 20px; margin-bottom: 20px; text-align: center; color: var(--muted); background: var(--surface); border: 2px dashed var(--line-strong); border-radius: 16px; cursor: pointer; transition: border-color .15s, background .15s; }
.drop:hover, .drop.over { border-color: var(--primary); background: var(--gold-tint); color: var(--gold-ink); }
.drop b { color: var(--heading); font-size: 15px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.grid.wide { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.refcard { padding: 0; overflow: hidden; }
.refcard .img { aspect-ratio: 1; background: var(--surface-3); display: grid; place-items: center; overflow: hidden; color: var(--muted); }
.refcard .img img, .refcard .img video { width: 100%; height: 100%; object-fit: cover; display: block; }
.refcard .b { padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.refcard .row { justify-content: space-between; }
input.name { border-color: transparent; background: transparent; padding: 4px 6px; font-weight: 600; font-size: 13.5px; }
input.name:hover { border-color: var(--line); }
.group { margin-bottom: 28px; }
.group > h2 { font-size: 17px; margin-bottom: 12px; }
.stylecard { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.stylecard .img { aspect-ratio: 16 / 9; width: 100%; border: 0; padding: 0; display: grid; place-items: center; overflow: hidden; background: linear-gradient(135deg, var(--navy), var(--navy-2)); }
.stylecard .img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s; }
.stylecard .img:hover img { transform: scale(1.03); }
.stylecard .ini { font-size: 28px; }
.stylecard .b { padding: 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.stylecard .b p { color: var(--muted); font-size: 13px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.stylecard .row { margin-top: auto; }
.preset { display: flex; flex-direction: column; gap: 8px; cursor: pointer; padding: 16px; transition: border-color .15s, box-shadow .15s; }
.preset:hover { border-color: var(--primary); box-shadow: var(--shadow-lg); }
.preset b { font-size: 14px; color: var(--heading); }
.preset p { color: var(--muted); font-size: 12.5px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.preset .meta { display: flex; align-items: center; gap: 6px; margin-top: auto; }
.preset .meta .icon-btn { margin-left: auto; width: 30px; height: 30px; }

/* spending, settings */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 16px; }
.stat { display: flex; flex-direction: column; gap: 4px; padding: 18px; }
.stat small { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.stat b { font-family: var(--display); font-size: 28px; font-weight: 800; color: var(--heading); font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: 13px; }
.bar { height: 8px; background: var(--surface-3); border-radius: 999px; overflow: hidden; margin-top: 8px; }
.bar i { display: block; height: 100%; background: var(--gold); border-radius: 999px; }
.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
table.t { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.t th, table.t td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.t th { color: var(--muted); font-size: 12px; font-weight: 600; }
table.t tr:last-child td { border-bottom: 0; }
table.t .num { text-align: right; font-variant-numeric: tabular-nums; }
.table-wrap { overflow: auto; margin-top: 12px; }
.services { list-style: none; margin: 12px 0 0; padding: 0; }
.services li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.services li:last-child { border-bottom: 0; }
.services code { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.status { margin-left: auto; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--surface-3); color: var(--muted); }
.status.ok { background: var(--ok-tint); color: var(--ok); }
details.catalog summary { list-style: none; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; cursor: pointer; }
details.catalog summary::-webkit-details-marker { display: none; }
details.catalog summary h2 { margin: 0; }
section.card .kv { margin-top: 8px; }

/* sign in */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-card { width: min(380px, 100%); display: flex; flex-direction: column; gap: 12px; padding: 28px; }
.login-card .mark { width: 48px; height: 48px; margin-bottom: 4px; }
.login-card .mark svg { border-radius: 13px; }
.login-card h1 { font-size: 24px; font-weight: 800; }
.login-card .lab { margin-top: 6px; }
.login-card .btn { margin-top: 6px; width: 100%; }

/* responsive */
@media (max-width: 1400px) { .wall { column-count: 3; } }
@media (max-width: 1100px) { .create { grid-template-columns: minmax(0, 1fr); } .results { position: static; } .runs { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); } .lb { grid-template-columns: minmax(0, 1fr) 340px; } }
@media (max-width: 900px) { .wall { column-count: 2; } .lb { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto; } .lb .panel { max-height: 52vh; border-left: 0; border-top: 1px solid var(--line); } .lb .stage { padding: 56px 16px 16px; } .lb .stage img, .lb .stage video { max-height: calc(48vh - 72px); } .two { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
  :root { --nav-h: calc(64px + env(safe-area-inset-bottom)); }
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 40; left: 0; right: 0; bottom: 0; top: auto; height: var(--nav-h); padding: 6px 6px env(safe-area-inset-bottom); flex-direction: row; border-right: 0; border-top: 1px solid var(--line); background: color-mix(in srgb, var(--sidebar) 94%, transparent); backdrop-filter: blur(10px); }
  .brand, .side-foot { display: none; }
  .nav { flex-direction: row; flex: 1; justify-content: space-around; gap: 0; }
  .nav button { width: auto; flex: 1; min-width: 0; flex-direction: column; justify-content: center; gap: 3px; padding: 6px 0; font-size: 10px; letter-spacing: -.01em; border-radius: 10px; text-align: center; }
  .needs { grid-template-columns: 1fr; }
  .need-thumb { width: 72px; }
  .plan-hint { margin-top: 0; }
  .nav button.on { background: transparent; color: var(--gold-ink); }
  .nav .count { position: absolute; top: 2px; left: calc(50% + 6px); margin: 0; min-width: 18px; height: 18px; font-size: 10.5px; }
  .main { padding: 0 16px calc(var(--nav-h) + 32px); }
  .mobile-head { display: flex; align-items: center; gap: 10px; padding: 14px 0 6px; font-family: var(--display); font-weight: 800; color: var(--heading); }
  .mobile-head .mark { width: 28px; height: 28px; }
  .page-head { margin: 10px 0 16px; }
  .page-head h1 { font-size: 22px; }
  .banner { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; }
  .banner .btn { grid-column: 2; justify-self: start; }
  .card { padding: 16px; }
  .compose { padding: 16px 16px 0; gap: 18px; }
  .compose-foot { margin: 0 -16px; padding: 12px 16px; border-radius: 0 0 var(--radius) var(--radius); }
  .compose-foot .btn.lg { padding: 12px 16px; }
  .modes { gap: 6px; }
  .modes button { flex-direction: column; gap: 4px; padding: 10px 4px; font-size: 12.5px; }
  .shapes { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .adv-grid { grid-template-columns: 1fr; }
  .quote .price b { font-size: 20px; }
  .quote .via small { display: none; }
  .search { width: 100%; }
  .toolbar .seg { width: 100%; overflow-x: auto; flex-wrap: nowrap; }
  .toolbar .seg button { flex: none; padding: 7px 11px; }
  .wall { column-gap: 10px; }
  .tile { margin-bottom: 10px; }
  .tile figcaption { padding: 8px 10px 10px; }
  .lb .stage { padding: 56px 8px 8px; }
  .lb .navbtn { display: none; }
  .act-grid { grid-template-columns: 1fr 1fr; }
  .kv { grid-template-columns: 96px minmax(0, 1fr); }
  .toast { right: 16px; left: 16px; top: 12px; bottom: auto; max-width: none; }
}
.late-text { color: var(--warn); font-weight: 600; }
