/* marchelle design system.
   Soft grey canvas, rounded cards, black pill controls, one lime accent,
   a slim top bar for the app, and big tight display headings.
   Every colour, radius and font is a token here, so changes stay
   one-line edits. */

@font-face {
  font-family: "Manrope";
  src: url("/fonts/manrope-latin.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Manrope";
  src: url("/fonts/manrope-latin-ext.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --bg: #e8ebe9;
  --surface: #f6f7f5;
  --surface-2: #ffffff;
  --ink: #121412;
  --ink-2: #585d59;
  --ink-3: #646964; /* hint text: at least 4.5:1 on every background */
  --line: #dde1de;
  --line-2: #c9cdca;
  --dark: #141514;
  --dark-2: #2a2c2a;
  --lime: #e1e65d;
  --lime-2: #c9ce3f;
  --lime-ink: #2d3a05;
  --error: #b3412f;
  --error-bg: #f8e3de;
  --ok: #3d6212;
  --warn-bg: #f5ead2;
  --warn-ink: #6e4a0e;

  --r-xl: 28px;
  --r-lg: 22px;
  --r-md: 16px;
  --r-sm: 12px;
  --pill: 999px;

  --shadow: 0 1px 2px rgba(18, 20, 18, 0.04);
  --shadow-lift: 0 10px 28px rgba(18, 20, 18, 0.12);
  --font: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* --- Base ------------------------------------------------------------- */

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss01";
}
a { color: var(--ink); }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
img { max-width: 100%; }

h1 { font-size: 30px; line-height: 1.12; letter-spacing: -0.03em; font-weight: 600; margin: 0 0 12px; }
h2 { font-size: 18px; line-height: 1.3; letter-spacing: -0.01em; font-weight: 650; margin: 0 0 12px; }
h3 { font-size: 16px; font-weight: 650; margin: 0 0 8px; }
p { margin: 0 0 12px; }
.muted { color: var(--ink-2); }
.small { font-size: 13.5px; }
.hint { font-size: 13.5px; color: var(--ink-2); margin: 4px 0 0; }

/* Big display heading with inline icon pills, as on the dashboard. */
.display {
  font-size: clamp(34px, 4.6vw, 56px);
  line-height: 1.04;
  letter-spacing: -0.045em;
  font-weight: 500;
  margin: 0;
}
.title-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.3em;
  height: 0.82em;
  border-radius: var(--pill);
  background: var(--surface-2);
  border: 1px solid var(--line);
  vertical-align: 0.06em;
  margin: 0 0.06em;
}
.title-pill svg { width: 0.42em; height: 0.42em; }
.title-pill.lime { background: var(--lime); border-color: var(--lime); }
.title-pill.dark { background: var(--dark); border-color: var(--dark); color: #fff; }

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  font: inherit;
  font-size: 14.5px;
  font-weight: 650;
  line-height: 1.2;
  border-radius: var(--pill);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}
.btn svg { width: 16px; height: 16px; }
.btn:hover:not(:disabled) { transform: translateY(-1px); }
.btn:disabled { opacity: 0.45; cursor: default; }
.btn-primary { background: var(--dark); color: #fff; }
.btn-primary:hover:not(:disabled) { background: #000; box-shadow: 0 6px 16px rgba(0, 0, 0, 0.22); }
.btn-secondary { background: var(--surface-2); color: var(--ink); border-color: var(--line); }
.btn-secondary:hover:not(:disabled) { border-color: var(--line-2); box-shadow: var(--shadow-lift); }
.btn-lime { background: var(--lime); color: var(--ink); }
.btn-lime:hover:not(:disabled) { background: var(--lime-2); }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover:not(:disabled) { color: var(--ink); background: rgba(255, 255, 255, 0.7); transform: none; }
.btn-danger { background: var(--surface-2); color: var(--error); border-color: #ecc9c1; }
.btn-danger:hover:not(:disabled) { background: var(--error-bg); }
.btn-sm { padding: 7px 13px; font-size: 13px; }
.btn-lg { padding: 14px 24px; font-size: 15px; }
.btn-block { width: 100%; margin-top: 20px; }

.link-button, .linkish {
  font: inherit;
  font-size: 13.5px;
  background: none;
  border: none;
  padding: 0;
  color: var(--ink);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--line-2);
}
.link-button:hover, .linkish:hover { text-decoration-color: var(--ink); }

/* --- Forms -------------------------------------------------------------- */

label { display: block; font-size: 13.5px; font-weight: 650; margin: 16px 0 6px; }
input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="search"], select, textarea {
  width: 100%;
  padding: 12px 15px;
  font: inherit;
  font-size: 15px;
  color: var(--ink);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 4px rgba(18, 20, 18, 0.07); }
textarea { resize: vertical; min-height: 76px; }
input[readonly] { color: var(--ink-2); cursor: default; }
.row { display: flex; gap: 12px; }
.row > div { flex: 1; }
.checkbox { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; margin-top: 18px; }
.checkbox input { margin-top: 4px; accent-color: var(--dark); }
.status { font-size: 14px; margin-top: 12px; min-height: 0; }
.status:empty { display: none; }
.status.error { color: var(--error); }
.status.ok { color: var(--ok); }
.dims { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }

/* --- Pills: chips, tags, badges ------------------------------------------ */

.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  padding: 8px 14px;
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink);
  border-radius: var(--pill);
  cursor: pointer;
  transition: background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}
.chip:hover:not(:disabled) { border-color: var(--line-2); }
.chip[aria-pressed="true"] { background: var(--dark); border-color: var(--dark); color: #fff; }
.chip:disabled { opacity: 0.4; cursor: default; }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--pill);
  background: var(--surface-2);
  color: var(--ink);
  border: 1px solid var(--line);
  white-space: nowrap;
}
 .tag.lime { background: var(--lime); border-color: var(--lime); color: var(--ink); }
.tag.dark { background: var(--dark); border-color: var(--dark); color: #fff; }
.tag.warn { background: var(--warn-bg); border-color: var(--warn-bg); color: var(--warn-ink); }

.badge {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 11px;
  border-radius: var(--pill);
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--ink-2);
}
.badge.yes { background: var(--lime); border-color: var(--lime); color: var(--ink); }
.badge.warn { background: var(--warn-bg); border-color: var(--warn-bg); color: var(--warn-ink); }

/* --- Cards ---------------------------------------------------------------- */

.panel, .card {
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 24px;
  box-shadow: var(--shadow);
}
.panel + .panel { margin-top: 18px; }
.panel h2 { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.card.lime { background: var(--lime); }
.card.dark { background: var(--dark); color: #fff; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.card-title { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 15px; }
.icon-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-2);
  border: 1px solid var(--line);
  flex: none;
}
.icon-circle svg { width: 17px; height: 17px; }
.card.lime .icon-circle { background: rgba(255, 255, 255, 0.6); border-color: transparent; }
.card.dark .icon-circle { background: var(--dark-2); border-color: var(--dark-2); color: #fff; }

/* Capsule meter: a row of pills, filled or dashed. */

/* Capsule bar chart: dark = requested, lime = finished. */
.chart-legend { display: flex; gap: 16px; font-size: 13px; color: var(--ink-2); align-items: center; }
.chart-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: 0; }
.chart-legend .k-dark { background: var(--dark); }
.chart-legend .k-lime { background: var(--lime-2); }
.capchart { display: grid; grid-template-columns: 30px 1fr; gap: 10px; margin-top: 10px; }
.cap-axis { display: flex; flex-direction: column; justify-content: space-between; font-size: 11.5px; color: var(--ink-3); height: 220px; text-align: right; }
.cap-cols { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; align-items: end; height: 250px; border-bottom: 1px dashed var(--line-2); padding-bottom: 30px; position: relative; }
.cap-col { position: relative; height: 220px; display: flex; justify-content: center; }
.cap {
  position: absolute;
  bottom: 0;
  width: 30px;
  border-radius: var(--pill);
  min-height: 30px;
}
.cap::before {
  content: "";
  position: absolute;
  top: 8px;
  left: 50%;
  width: 12px;
  height: 12px;
  margin-left: -6px;
  border-radius: 50%;
  background: #fff;
}
.cap.dark { background: var(--dark); }
/* The lime "finished" capsule sits inside the dark one like a fill level,
   so the dark rim still shows when every image finished. */
.cap.lime { background: var(--lime); width: 22px; bottom: 4px; min-height: 22px; }
.cap.lime::before { background: var(--dark); top: 5px; width: 10px; height: 10px; margin-left: -5px; }
.cap.empty { height: 100%; border: 1.5px dashed var(--line-2); background: transparent; }
.cap.empty::before { background: var(--line-2); }
.cap-label { position: absolute; bottom: -26px; font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.cap-label.today { color: var(--ink); font-weight: 700; }
.cap-val {
  position: absolute;
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--pill);
  background: var(--dark);
  color: #fff;
  white-space: nowrap;
  transform: translateX(22px);
  opacity: 0;
  transition: opacity 0.12s ease;
  pointer-events: none;
}
.cap-val.lime { background: var(--lime); color: var(--ink); transform: translateX(-100%) translateX(-22px); }
.cap-col:hover .cap-val, .cap-col.peak .cap-val { opacity: 1; }

/* --- Public pages (landing, login) ----------------------------------------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 1240px;
  margin: 0 auto;
  padding: 22px 24px;
}
.wordmark { display: inline-flex; align-items: center; text-decoration: none; flex: none; }
.wordmark img { display: block; height: 24px; width: auto; }
.wordmark .logo-icon { display: none; }
/* The company's logo beside marchelle, after a lime ×. */
.appbar-brand { display: inline-flex; align-items: center; gap: 12px; flex: none; min-width: 0; }
.org-brand { display: inline-flex; align-items: center; gap: 12px; min-width: 0; }
.org-x { width: 12px; height: 12px; flex: none; fill: none; stroke: var(--lime-2); stroke-width: 3; stroke-linecap: round; }
.org-logo { display: block; height: auto; max-height: 28px; max-width: 150px; width: auto; object-fit: contain; }
@media (max-width: 700px) {
  .appbar-brand, .org-brand { gap: 8px; }
  .org-x { width: 10px; height: 10px; }
  .org-logo { max-height: 22px; max-width: 84px; }
}
/* Phones: room for the logo, the links, credits and the account letter. */
@media (max-width: 520px) {
  .appbar:has(.org-brand) { gap: 8px; padding-left: 16px; padding-right: 16px; }
  .appbar:has(.org-brand) .appnav { margin-right: 0; }
  .appbar:has(.org-brand) .appnav a { padding: 8px 7px; font-size: 13.5px; }
  .appbar-brand, .org-brand { gap: 6px; }
  .org-x { width: 8px; height: 8px; }
  .org-logo { max-height: 18px; max-width: 54px; }
  .appbar:has(.org-brand) .appnav a { padding: 8px 5px; }
  .appbar:has(.org-brand) .credit-pill { margin-right: 6px; padding: 6px 9px; }
  .appbar:has(.org-brand) .avatar { width: 34px; height: 34px; }
}
/* Small phones with a logo: credits stay in Account and the Studio's Create bar. */
@media (max-width: 420px) {
  .appbar:has(.org-brand) .credit-pill { display: none; }
}
@media (max-width: 380px) {
  .appbar .credit-pill { display: none; }
  .appbar .appnav a { padding: 8px 6px; font-size: 13.5px; }
  .org-logo { max-width: 44px; }
}
@media (max-width: 340px) {
  .appbar-brand, .org-brand { gap: 4px; }
  .appbar:has(.org-brand) .appnav a { padding: 8px 4px; font-size: 13px; }
}
@media (max-width: 700px) {
  .appbar .wordmark .logo-full { display: none; }
  .appbar .wordmark .logo-icon { display: block; }
}
.topbar-actions { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.page { max-width: 1240px; margin: 0 auto; padding: 8px 24px 64px; }
.narrow { max-width: 460px; margin: 18px auto 64px; padding: 0 20px; }
.narrow .panel { padding: 30px; border-radius: var(--r-xl); }

.card.dark p { color: #c4c8c4; }

/* Pill tabs (login: Log In / Create Account) */
.tabs { display: flex; gap: 4px; padding: 4px; background: var(--bg); border-radius: var(--pill); margin-bottom: 8px; }
.tab {
  flex: 1;
  font: inherit;
  font-size: 14px;
  font-weight: 650;
  padding: 10px 14px;
  border: none;
  border-radius: var(--pill);
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
}
.tab[aria-selected="true"] { background: var(--dark); color: #fff; }

/* --- App shell: slim top bar ---------------------------------------------------- */

.appbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 24px;
  max-width: 1320px;
  margin: 0 auto;
  padding: 16px 28px;
  background: rgba(232, 235, 233, 0.88);
  backdrop-filter: blur(10px);
}
/* Links sit on the right, just before the account letter. */
.appnav { display: flex; gap: 4px; flex: 1; justify-content: flex-end; margin-right: 14px; }
.appnav a { padding: 8px 14px; border-radius: var(--pill); font-size: 14.5px; font-weight: 650; color: var(--ink-2); text-decoration: none; }
.appnav a:hover { color: var(--ink); background: rgba(255, 255, 255, 0.7); }
.appnav a[aria-current="page"] { background: var(--dark); color: #fff; }
.account-menu { position: relative; }
.avatar { width: 40px; height: 40px; border-radius: 50%; border: none; background: var(--lime); color: var(--ink); font: inherit; font-weight: 750; font-size: 15px; cursor: pointer; }
.menu {
  position: absolute;
  right: 0;
  top: 48px;
  min-width: 220px;
  background: var(--surface-2);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lift);
  padding: 8px;
  display: flex;
  flex-direction: column;
}
.menu-who { font-size: 12.5px; color: var(--ink-3); padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 6px; overflow: hidden; text-overflow: ellipsis; }
.menu a, .menu button { text-align: left; font: inherit; font-size: 14px; font-weight: 600; padding: 9px 10px; border-radius: 10px; border: none; background: none; color: var(--ink); cursor: pointer; text-decoration: none; }
.menu a:hover, .menu button:hover { background: var(--surface); }
body.app { display: block; }
.app-main { max-width: 1320px; margin: 0 auto; padding: 12px 28px 80px; }
@media (max-width: 700px) {
  .appbar { padding: 12px 16px; gap: 12px; }
  .app-main { padding: 8px 16px 60px; }
  /* No room on a phone: Admin is in the footer instead, so the account
     letter stays on screen. */
  .appnav a[data-nav="admin"] { display: none; }
}
/* Tablets and narrow windows: the logo goes home, so Home and Pricing make
   room (both are in the footer too), and the links tighten. */
@media (max-width: 1000px) {
  .appbar { gap: 16px; }
  .appnav a { padding: 8px 10px; }
  .appnav [data-nav="home"], .appnav [data-nav="pricing"], .appnav .soon { display: none; }
}
@media (max-width: 860px) {
  .appbar .credit-pill .cp-word { display: none; }
  .appbar .credit-pill .cp-short { display: inline; }
  .appnav a[data-nav="admin"] { display: none; }
}
/* Small phones: tighter nav so the account letter still fits. */
@media (max-width: 420px) {
  .appbar { gap: 8px; }
  .appnav { gap: 0; margin-right: 4px; }
  .appnav a { padding: 8px 9px; font-size: 14px; }
}

/* --- App page heads ------------------------------------------------------------ */

.app-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin-bottom: 26px; }
.head-actions { display: flex; gap: 10px; align-items: center; padding-top: 6px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 34px 0 16px; }
.section-head h2 { margin: 0; font-size: 24px; letter-spacing: -0.03em; font-weight: 600; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.toolbar input[type="search"] { width: 250px; border-radius: var(--pill); padding: 10px 16px; }
.crumb { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); text-decoration: none; margin-bottom: 10px; }
.crumb:hover { color: var(--ink); }

/* --- Dashboard ---------------------------------------------------------------- */

.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.product-card {
  background: var(--surface);
  border-radius: var(--r-lg);
  overflow: hidden;
  text-decoration: none;
  color: var(--ink);
  padding: 8px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.product-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); }
.product-card .cover {
  aspect-ratio: 4 / 3;
  border-radius: var(--r-md);
  background: #e1e5e2 center / cover no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-3);
  font-size: 13px;
}
.product-card .body { padding: 12px 8px 8px; }
.product-card .name { font-weight: 700; line-height: 1.3; letter-spacing: -0.01em; }
.product-card .meta { font-size: 13px; color: var(--ink-2); margin-top: 2px; }
.product-card .status { display: inline-flex; margin-top: 10px; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: var(--pill); background: var(--surface-2); border: 1px solid var(--line); }
.product-card .status.todo { background: var(--warn-bg); border-color: var(--warn-bg); color: var(--warn-ink); }
.product-card .status.busy { background: var(--lime); border-color: var(--lime); }

.empty { text-align: center; padding: 56px 24px; border-radius: var(--r-lg); border: 1.5px dashed var(--line-2); background: rgba(255, 255, 255, 0.4); }
.empty h2 { font-size: 24px; letter-spacing: -0.03em; }

/* --- Product page ------------------------------------------------------------------ */
.estimate { font-size: 14px; color: var(--ink-2); }
.estimate strong { color: var(--ink); }
.gallery { min-width: 0; }

details.more { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 14px; }
details.more > summary { cursor: pointer; font-size: 14px; font-weight: 700; list-style: none; display: flex; justify-content: space-between; gap: 8px; }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::after { content: "Show"; font-weight: 650; font-size: 12px; padding: 3px 10px; border-radius: var(--pill); background: var(--dark); color: #fff; height: fit-content; }
details.more[open] > summary::after { content: "Hide"; }

.gallery-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.gallery-head h2 { margin: 0; font-size: 24px; letter-spacing: -0.03em; font-weight: 600; }
.gallery-empty {
  border: 1.5px dashed var(--line-2);
  border-radius: var(--r-lg);
  padding: 56px 24px;
  text-align: center;
  color: var(--ink-2);
  background: rgba(255, 255, 255, 0.4);
}
.gallery-empty h3 { margin: 0 0 6px; color: var(--ink); font-size: 20px; letter-spacing: -0.02em; }
.err-detail { width: 100%; text-align: left; color: var(--ink-2); font-size: 12px; }
.err-detail summary { cursor: pointer; text-align: center; font-weight: 600; }
.err-detail code {
  display: block;
  margin-top: 6px;
  padding: 10px;
  max-height: 140px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  background: var(--surface);
  border-radius: var(--r-sm);
  font-size: 11.5px;
}

.spinner { width: 28px; height: 28px; border: 3px solid #d6dbd7; border-top-color: var(--dark); border-radius: 50%; animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.notice { font-size: 13px; padding: 11px 13px; border-radius: var(--r-sm); background: var(--warn-bg); color: var(--warn-ink); }
.notice.info { background: var(--bg); color: var(--ink-2); }

/* Photos */
.dropzone {
  border: 1.5px dashed var(--line-2);
  border-radius: var(--r-md);
  padding: 26px 18px;
  text-align: center;
  color: var(--ink-2);
  font-size: 14px;
  cursor: pointer;
  background: var(--surface-2);
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.dropzone:hover, .dropzone.over { border-color: var(--ink); background: #fafbf6; }
.dropzone strong { color: var(--ink); }
.photo { background: var(--surface-2); border-radius: var(--r-md); overflow: hidden; border: 2px solid transparent; }
.photo.primary { border-color: var(--dark); }

.details-layout { display: grid; grid-template-columns: minmax(0, 640px); gap: 16px; }
.details-layout > .panel { margin: 0; }
.danger-zone { border: 1px solid #ecc9c1; }

/* --- Lightbox ---------------------------------------------------------------------- */

.lightbox { position: fixed; inset: 0; z-index: 50; background: rgba(12, 13, 12, 0.96); display: grid; grid-template-columns: 1fr 340px; }
.lb-stage { position: relative; display: flex; align-items: center; justify-content: center; padding: 28px; min-height: 0; }
.lb-stage img { max-width: 100%; max-height: calc(100vh - 56px); object-fit: contain; border-radius: var(--r-md); }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 48px; border-radius: 50%; border: none; background: rgba(255, 255, 255, 0.12); color: #fff; font-size: 24px; cursor: pointer; }
.lb-nav:hover { background: rgba(255, 255, 255, 0.24); }
.lb-prev { left: 18px; }
.lb-next { right: 18px; }
.lb-side { background: var(--surface); margin: 12px; border-radius: var(--r-lg); padding: 24px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.lb-side h3 { margin: 0; font-size: 20px; letter-spacing: -0.02em; }
.lb-side dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 7px 14px; font-size: 13.5px; }
.lb-side dt { color: var(--ink-2); }
.lb-side dd { margin: 0; font-weight: 600; }
.lb-close { position: absolute; top: 16px; right: 16px; width: 36px; height: 36px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--line); font-size: 20px; cursor: pointer; color: var(--ink); line-height: 1; }
@media (max-width: 900px) {
  .lightbox { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
  .lb-side { max-height: 46vh; }
  .lb-stage img { max-height: 48vh; }
}

/* --- Dialog ------------------------------------------------------------------------ */

dialog { border: none; border-radius: var(--r-xl); padding: 30px; width: min(480px, calc(100vw - 32px)); background: var(--surface); box-shadow: 0 30px 80px rgba(12, 13, 12, 0.3); }
dialog::backdrop { background: rgba(12, 13, 12, 0.5); }
dialog h2 { font-size: 26px; letter-spacing: -0.03em; font-weight: 600; }
.dialog-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 24px; }

/* --- Admin ----------------------------------------------------------------------- */

.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin: 0 0 16px; }
.stat { background: var(--surface); border-radius: var(--r-lg); padding: 20px 20px 18px; }
.stat:first-child { background: var(--lime); }
.stat-value { font-size: 38px; font-weight: 500; letter-spacing: -0.05em; line-height: 1.05; }
.stat-label { font-size: 13px; color: var(--ink-2); margin-top: 8px; font-weight: 600; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-weight: 700; font-size: 12.5px; color: var(--ink-2); text-transform: uppercase; letter-spacing: 0.04em; }
tbody tr:hover td { background: var(--surface-2); }

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

/* --- Type picker ------------------------------------------------------------ */

dialog.type-picker { width: min(920px, calc(100vw - 24px)); max-height: calc(100vh - 40px); padding: 0; display: flex; flex-direction: column; overflow: hidden; }
dialog.type-picker:not([open]) { display: none; }
.tp-head { padding: 24px 26px 16px; }
.tp-head h2 { margin-bottom: 12px; }
.tp-search { border-radius: var(--pill) !important; padding: 12px 18px !important; }
.tp-body { display: grid; grid-template-columns: 300px 1fr; gap: 0; min-height: 0; flex: 1; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.tp-cats { overflow-y: auto; padding: 10px; border-right: 1px solid var(--line); max-height: 56vh; }
.tp-cat { width: 100%; display: grid; grid-template-columns: 26px 1fr auto; gap: 8px; align-items: center; text-align: left; font: inherit; font-size: 13.5px; font-weight: 600; padding: 9px 12px; border: none; border-radius: var(--r-sm); background: transparent; color: var(--ink); cursor: pointer; }
.tp-cat:hover { background: var(--surface-2); }
.tp-cat[aria-pressed="true"] { background: var(--dark); color: #fff; }
.tp-cat .num { font-size: 11.5px; opacity: 0.55; }
.tp-cat .n { font-size: 11.5px; opacity: 0.55; }
.tp-types { overflow-y: auto; padding: 16px 20px 20px; max-height: 56vh; }
.tp-title { font-weight: 700; font-size: 14px; margin: 0 0 12px; }
.tp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
.tp-type { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; font: inherit; font-size: 14px; font-weight: 600; padding: 11px 14px; border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--line); color: var(--ink); cursor: pointer; }
.tp-type:hover { border-color: var(--ink); }
.tp-type.current { background: var(--lime); border-color: var(--lime); }
.tp-type small { font-size: 11.5px; font-weight: 500; color: var(--ink-2); }
.tp-type small.lit { color: var(--ok); font-weight: 700; }
dialog.type-picker .dialog-actions { margin: 0; padding: 14px 20px; }
@media (max-width: 700px) {
  .tp-body { grid-template-columns: 1fr; }
  .tp-cats { display: flex; gap: 6px; overflow-x: auto; border-right: none; border-bottom: 1px solid var(--line); max-height: none; }
  .tp-cat { width: auto; white-space: nowrap; grid-template-columns: auto auto; }
  .tp-cat .n { display: none; }
}

/* --- Readiness strip, category filter, prompt view --------------------------- */
.chip.more-toggle { background: transparent; border-style: dashed; color: var(--ink-2); }
details.prompt summary { cursor: pointer; font-size: 13px; font-weight: 700; }
details.prompt pre { white-space: pre-wrap; word-break: break-word; font-size: 11.5px; line-height: 1.5; background: var(--surface-2); border-radius: var(--r-sm); padding: 10px; max-height: 260px; overflow: auto; margin: 8px 0 0; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.install-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 520px) { .install-grid { grid-template-columns: 1fr; } }

/* --- Simple create flow ------------------------------------------------------- */

.place-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.place {
  position: relative;
  text-align: left;
  font: inherit;
  font-size: 13.5px;
  font-weight: 650;
  padding: 11px 12px 11px 36px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink);
  cursor: pointer;
  line-height: 1.25;
}
.place::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 50%;
  width: 16px;
  height: 16px;
  margin-top: -8px;
  border-radius: 5px;
  border: 1.5px solid var(--line-2);
  background: #fff;
}
.place[aria-pressed="true"] { background: var(--dark); border-color: var(--dark); color: #fff; }
.place[aria-pressed="true"]::before { background: var(--lime); border-color: var(--lime); }
.place[aria-pressed="true"]::after { content: "✓"; position: absolute; left: 15px; top: 50%; margin-top: -9px; font-size: 12px; font-weight: 800; color: var(--ink); }
.place:hover:not([aria-pressed="true"]) { border-color: var(--line-2); }
.place.more-toggle { padding-left: 12px; border-style: dashed; color: var(--ink-2); background: transparent; text-align: center; }
.place.more-toggle::before { display: none; }

/* New product: start from a photo */
.dropzone.big { padding: 48px 20px; font-size: 15px; border-radius: var(--r-lg); }
.dropzone.big strong { display: block; font-size: 19px; letter-spacing: -0.02em; margin-bottom: 4px; }
.dropzone.busy { pointer-events: none; opacity: 0.8; }
.upload-steps { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; font-size: 14px; }
.upload-steps span { color: var(--ink-3); }
.upload-steps span.on { color: var(--ink); font-weight: 650; }
.upload-steps span.done { color: var(--ok); }
.upload-steps span.done::before { content: "✓ "; }

/* --- Public page extras --------------------------------------------------------- */

.site-footer { max-width: 1240px; margin: 0 auto; padding: 24px 24px 40px; display: flex; gap: 18px; flex-wrap: wrap; font-size: 13px; color: var(--ink-3); }
.site-footer a { color: var(--ink-2); text-decoration: none; }
.site-footer a:hover { color: var(--ink); text-decoration: underline; }
.site-footer.app-footer { max-width: 1320px; padding: 8px 28px 32px; }
@media (max-width: 700px) { .site-footer.app-footer { padding: 8px 16px 28px; } }
.step-num { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; font-size: 13px; font-weight: 750; margin-bottom: 10px; background: var(--dark); color: #fff; }
.card.lime .step-num { background: var(--dark); }
.card.dark .step-num { background: var(--lime); color: var(--ink); }
.legal { max-width: 760px; margin: 0 auto; padding: 36px; }
.legal h1 { font-size: 36px; letter-spacing: -0.04em; font-weight: 600; margin-top: 18px; }
.legal h2 { font-size: 18px; margin: 26px 0 8px; }
.legal p { color: var(--ink-2); font-size: 15px; }
.legal strong { color: var(--ink); }
.checkbox a { color: var(--ink); }

.btn-danger-solid { background: var(--error); color: #fff; }
.btn-danger-solid:hover:not(:disabled) { background: #9a3526; }
dialog.confirm-dialog { width: min(420px, calc(100vw - 32px)); }
dialog.confirm-dialog h2 { font-size: 22px; }
.welcome { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 28px; align-items: center; padding: 32px; }
.welcome h2 { font-size: 30px; letter-spacing: -0.04em; font-weight: 600; margin: 0 0 18px; }
.welcome-steps { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; font-size: 16px; font-weight: 600; }
.welcome-steps li { display: flex; align-items: center; gap: 12px; }
.welcome-steps .step-num { margin: 0; flex: none; }
@media (max-width: 860px) { .welcome { grid-template-columns: 1fr; padding: 24px; } }
td.wrap { white-space: normal; min-width: 280px; max-width: 520px; }
td details summary { cursor: pointer; font-size: 12.5px; color: var(--ink-2); margin-top: 4px; }
td details code { display: block; white-space: pre-wrap; word-break: break-word; font-size: 11.5px; background: var(--surface-2); padding: 8px; border-radius: 8px; margin-top: 6px; }
.auth-intro { text-align: center; margin: 8px 0 20px; }
.auth-intro p { margin: 10px 0 0; }
/* Phones: your products come before the stats. */

/* ======================================================================
   Layout v3: calm pages, one main action each
   ====================================================================== */

.page-title { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 18px 0 28px; }
.product-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.product-card { padding: 0; background: transparent; box-shadow: none; }
.product-card:hover { box-shadow: none; }
.product-card .cover { border-radius: var(--r-lg); aspect-ratio: 4 / 3; }
.product-card:hover .cover { box-shadow: var(--shadow-lift); }
.product-card .body { padding: 12px 4px 4px; }
.product-card .name { font-size: 16px; }

/* Product header */

/* Gallery: images large, newest first, grouped by day */
.gallery-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.day { margin-bottom: 26px; }
.day-label { font-size: 13px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.06em; margin: 0 0 12px; }
/* A grid rather than CSS columns: columns rebalance four images into two
   columns and leave the third empty. */
.masonry { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 14px; align-items: start; }
.tile { position: relative; border-radius: var(--r-md); overflow: hidden; background: #e2e6e3; width: 100%; }
.tile img { display: block; width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; transition: transform 0.3s ease; }
.tile:hover img { transform: scale(1.015); }
.tile .star { position: absolute; top: 10px; right: 10px; width: 38px; height: 38px; border-radius: 50%; border: none; background: rgba(255, 255, 255, 0.92); color: var(--ink-3); font-size: 17px; cursor: pointer; opacity: 0; transition: opacity 0.15s ease; }
.tile:hover .star, .tile .star:focus-visible, .tile .star[aria-pressed="true"] { opacity: 1; }
.tile .star[aria-pressed="true"] { background: var(--lime); color: var(--ink); }
.tile .star svg { width: 19px; height: 19px; display: block; margin: auto; }
.tile .caption { position: absolute; left: 0; right: 0; bottom: 0; padding: 26px 14px 11px; font-size: 12.5px; font-weight: 650; color: #fff; background: linear-gradient(transparent, rgba(0, 0, 0, 0.55)); opacity: 0; transition: opacity 0.15s ease; pointer-events: none; }
.tile:hover .caption { opacity: 1; }
@media (hover: none) { .tile .star { opacity: 1; } }
/* View / Edit: always showing, bottom right, opens the viewer. */
.tile .tile-edit { position: absolute; right: 10px; bottom: 10px; z-index: 1; padding: 7px 14px; border-radius: var(--pill); border: 1.5px solid var(--ink); background: var(--lime); color: var(--ink); font: inherit; font-size: 12.5px; font-weight: 750; cursor: pointer; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18); }
.tile .tile-edit:hover { background: var(--lime-2); }
.tile .tile-edit .short { display: none; }
.tile .caption { padding-right: 120px; }
@media (max-width: 420px) {
  .tile .tile-edit .long { display: none; }
  .tile .tile-edit .short { display: inline; }
  .tile .caption { padding-right: 70px; }
}
.tile.pending { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; font-size: 13px; font-weight: 650; color: var(--ink-2); background: var(--surface); min-height: 160px; }
.tile.failed { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; padding: 20px; background: var(--surface); color: var(--error); font-size: 13px; }
.tile.failed .row2 { display: flex; gap: 6px; }

/* Sheets: focused tasks over the page */

/* Set cards */

/* Edit sheet photos */

/* Viewer: three actions, details folded away */
.lb-more { position: relative; }
.lb-details { margin-top: auto; border-top: 1px solid var(--line); padding-top: 12px; }
.lb-details > summary { cursor: pointer; font-weight: 700; font-size: 14px; margin-bottom: 10px; }
@media (max-width: 460px) { .masonry { grid-template-columns: 1fr; } }
.appbar-auth { display: flex; gap: 6px; align-items: center; }
a.welcome-go { display: block; text-decoration: none; color: var(--ink-2); }

/* ======================================================================
   One-page product studio
   ====================================================================== */

/* Half and half: the product pane on the left, pinned; the images on the
   right, one per row at full width, scrolling with the page. */
.studio { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: start; margin-top: 6px; }
.composer { position: sticky; top: 84px; height: calc(100vh - 100px); display: flex; flex-direction: column; background: var(--surface); border-radius: var(--r-lg); overflow: clip; }
.composer-body { overflow-y: auto; padding: 6px 26px 26px; flex: 1; min-height: 0; }
.composer-foot { flex: none; }
.studio .masonry { grid-template-columns: 1fr; gap: 18px; }
.studio .tile { border-radius: var(--r-lg); }
.composer-foot { padding: 16px 22px 18px; background: var(--surface-2); border-top: 1px solid var(--line); }
.composer-foot .btn { width: 100%; margin-top: 10px; }
.c-section { margin-top: 20px; }
.c-title { font-size: 15px; font-weight: 750; margin: 0 0 10px; letter-spacing: -0.01em; display: flex; align-items: baseline; gap: 8px; }
.c-title .sub { font-size: 12.5px; font-weight: 500; color: var(--ink-3); }

.save-note { font-size: 12.5px; margin: 10px 0 0; }
.save-note:empty { display: none; }
.gallery .gallery-head h2 { font-size: 24px; letter-spacing: -0.03em; font-weight: 600; margin: 0; }
@media (max-width: 980px) {
  .studio { grid-template-columns: minmax(0, 1fr); } /* never wider than the screen */
  .composer { position: static; height: auto; }
}

/* Product photos as thumbnails */
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; }
.thumb { position: relative; width: 84px; height: 84px; border-radius: var(--r-sm); overflow: hidden; background: #fff; border: 2px solid transparent; }
.thumb.main { border-color: var(--dark); }
.thumb img { width: 100%; height: 100%; object-fit: cover; cursor: pointer; display: block; }
.thumb .tag { position: absolute; left: 4px; bottom: 4px; font-size: 10.5px; padding: 2px 7px; }
.thumb-x { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%; border: none; background: rgba(255, 255, 255, 0.92); font-size: 14px; line-height: 1; cursor: pointer; opacity: 0; transition: opacity 0.12s ease; }
.thumb:hover .thumb-x, .thumb-x:focus-visible { opacity: 1; }
@media (hover: none) { .thumb-x { opacity: 1; } }
.thumb.add { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; font: inherit; font-size: 22px; line-height: 1; color: var(--ink-2); border: 1.5px dashed var(--line-2); background: var(--surface-2); cursor: pointer; }
.thumb.add span { font-size: 11.5px; font-weight: 650; margin-top: 4px; }
.thumb.add:hover { border-color: var(--ink); color: var(--ink); }
.place-grid .place[data-place="other"] { border-style: dashed; }
.place-grid .place[data-place="other"][aria-pressed="true"] { border-style: solid; }

/* Product name as an editable heading */
.title-edit { display: flex; align-items: center; gap: 8px; margin: 18px 0 14px; cursor: text; }
.title-edit input {
  flex: 0 1 auto;
  min-width: 0;
  max-width: calc(100% - 28px);
  font: inherit;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.15;
  color: var(--ink);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  padding: 4px 8px;
  margin-left: -9px;
}
.title-edit input { text-overflow: ellipsis; }
@media (max-width: 420px) { .title-edit input { font-size: 23px; } }
.title-edit input:hover { border-color: var(--line); background: rgba(255, 255, 255, 0.5); }
.title-edit input:focus { border-color: var(--ink); background: #fff; box-shadow: none; }
.title-edit .pencil { color: var(--ink-3); opacity: 0.6; flex: none; }
.title-edit .pencil svg { width: 16px; height: 16px; display: block; }
.title-edit:hover .pencil { opacity: 1; }
#newTitle { font-size: 28px; letter-spacing: -0.035em; font-weight: 600; margin: 18px 0 14px; }

/* Paste a link */

.link-row { display: flex; gap: 8px; margin-top: 8px; }
.link-row input { flex: 1; min-width: 0; border-radius: var(--pill); padding: 11px 16px; }
.linkish svg { width: 14px; height: 14px; vertical-align: -2px; margin-right: 4px; }

/* Scene groups */
.scene-group { grid-column: 1 / -1; font-size: 12px; font-weight: 750; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-3); margin: 10px 0 2px; }

/* Product card ••• menu */
.product-item { position: relative; }
.card-menu-btn { position: absolute; top: 10px; right: 10px; width: 34px; height: 34px; border-radius: 50%; border: none; background: rgba(255, 255, 255, 0.92); color: var(--ink); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; opacity: 0; transition: opacity 0.12s ease; }
.card-menu-btn svg { width: 18px; height: 18px; }
.product-item:hover .card-menu-btn, .card-menu-btn:focus-visible, .card-menu-btn[aria-expanded="true"] { opacity: 1; }
@media (hover: none) { .card-menu-btn { opacity: 1; } }
.card-menu { position: absolute; top: 50px; right: 10px; z-index: 5; background: var(--surface-2); border-radius: var(--r-sm); box-shadow: var(--shadow-lift); padding: 6px; min-width: 170px; }
.card-menu button { width: 100%; text-align: left; font: inherit; font-size: 14px; font-weight: 600; padding: 9px 10px; border: none; background: none; border-radius: 8px; cursor: pointer; color: var(--ink); }
.card-menu button:hover { background: var(--surface); }
.card-menu button.danger, .card-menu button[data-act="delete"] { color: var(--error); }
.card-menu button.danger:hover, .card-menu button[data-act="delete"]:hover { background: var(--error-bg); }

#quantityCount { margin-top: 10px; max-width: 200px; }
/* On/off switch */
/* The real checkbox is hidden inside the label itself; positioned against
   the pane instead, focusing it scrolled the whole pane out of place. */
.switch { position: relative; display: flex; align-items: center; gap: 12px; cursor: pointer; margin: 0; font-weight: 500; }
.switch input { position: absolute; left: 0; top: 0; opacity: 0; width: 1px; height: 1px; margin: 0; }
.switch-track { position: relative; flex: none; width: 46px; height: 26px; border-radius: var(--pill); background: var(--line-2); transition: background-color 0.15s ease; }
.switch-track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2); transition: transform 0.15s ease; }
.switch input:checked + .switch-track { background: var(--dark); }
.switch input:checked + .switch-track::after { transform: translateX(20px); background: var(--lime); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--ink); outline-offset: 2px; }
.switch strong { display: block; font-size: 15px; font-weight: 750; }
.switch .sub { font-size: 12.5px; color: var(--ink-3); }

/* Pricing */
.pricing-head { max-width: 760px; margin: 30px 0 34px; }
.pricing-head p { font-size: 17px; margin-top: 18px; }
.plans { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; align-items: stretch; }
.plan { display: flex; flex-direction: column; padding: 26px; border-radius: var(--r-xl); }
.plan-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.plan-top h2 { margin: 0; font-size: 22px; letter-spacing: -0.03em; font-weight: 600; }
.plan-price { font-size: 48px; font-weight: 500; letter-spacing: -0.05em; line-height: 1; margin: 22px 0 6px; }
.plan-price small { font-size: 15px; letter-spacing: 0; color: var(--ink-2); margin-left: 6px; }
.card.dark .plan-price small { color: #b9bdb9; }
.plan-lead { color: var(--ink-2); margin: 0 0 18px; }
.card.dark .plan-lead { color: #c4c8c4; }
.plan-list { list-style: none; padding: 0; margin: 0 0 26px; display: flex; flex-direction: column; gap: 10px; font-size: 14.5px; font-weight: 550; }
.plan-list li { display: flex; gap: 10px; }
.plan-list li::before { content: "✓"; font-weight: 800; }
.plan-btn { margin-top: auto; width: 100%; }
.faq { max-width: 760px; margin: 56px 0 20px; }
.faq h2 { font-size: 26px; letter-spacing: -0.03em; font-weight: 600; margin-bottom: 14px; }
.faq details { background: var(--surface); border-radius: var(--r-md); padding: 16px 20px; margin-bottom: 10px; }
.faq summary { cursor: pointer; font-weight: 700; }
.faq details p { color: var(--ink-2); margin: 10px 0 0; }
.plans-note { margin: 16px 2px 0; font-size: 14.5px; }
.compare { margin: 56px 0 0; }
.compare h2 { font-size: 26px; letter-spacing: -0.03em; font-weight: 600; margin-bottom: 14px; }
.compare-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.compare-item { display: flex; flex-direction: column; gap: 6px; padding: 20px 22px; border-radius: var(--r-lg); }
.compare-k { font-weight: 700; font-size: 14.5px; }
.compare-v { font-size: 34px; font-weight: 500; letter-spacing: -0.04em; line-height: 1.1; }
@media (max-width: 1150px) { .plans { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) { .compare-grid { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .plans { grid-template-columns: 1fr; } }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.small-switch .switch-track { width: 40px; height: 22px; }
.small-switch .switch-track::after { width: 16px; height: 16px; }
.small-switch input:checked + .switch-track::after { transform: translateX(18px); }

/* Phones: the signed-out bar keeps Log In; Create Account is on the page. */
@media (max-width: 560px) {
  .appbar-auth .btn-primary { display: none; }
}

/* Admin: pilot */
.invite-form { display: grid; grid-template-columns: 1.3fr 1fr 1fr auto; gap: 8px; margin-top: 8px; }
.invite-form input { border-radius: var(--pill); padding: 10px 16px; }
@media (max-width: 860px) { .invite-form { grid-template-columns: 1fr; } }
.row-actions { text-align: right; white-space: nowrap; }
.invite-result { margin-top: 14px; padding: 16px; border-radius: var(--r-md); background: var(--lime); color: var(--ink); }
.invite-result-msg { margin: 0 0 10px; font-weight: 650; }
.copy-row { display: flex; gap: 8px; align-items: center; }
.copy-row input { flex: 1 1 auto; min-width: 0; border-radius: var(--pill); padding: 9px 14px; font-size: 13px; background: #fff; border: 1px solid rgba(0, 0, 0, 0.08); color: var(--ink); }
.invite-result-hint { margin: 10px 0 0; color: var(--lime-ink); }
.invite-result-hint:empty { display: none; }
@media (max-width: 560px) {
  .copy-row { flex-wrap: wrap; }
  .copy-row input { flex-basis: 100%; }
}
.feedback-list { display: flex; flex-direction: column; gap: 12px; }
.feedback-item { display: grid; grid-template-columns: 180px 1fr; gap: 16px; padding: 12px; background: var(--surface-2); border-radius: var(--r-md); }
.feedback-item.resolved { opacity: 0.55; }
.feedback-item img { width: 100%; border-radius: var(--r-sm); display: block; }
.fb-general { display: flex; align-items: center; justify-content: center; min-height: 90px; border-radius: var(--r-sm); background: var(--bg); font-weight: 700; color: var(--ink-3); }
.fb-body { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; min-width: 0; }
.fb-meta { font-size: 13.5px; }
.fb-note { margin: 0; white-space: pre-wrap; }
@media (max-width: 700px) { .feedback-item { grid-template-columns: 1fr; } }
dialog.confirm-dialog textarea { width: 100%; }

/* --- Home page logo intro (public/js/intro.js) ------------------------------
   The wordmark alone, centred on the plain canvas, then it glides into the
   top bar and the cover fades. index.html's <head> adds .intro-on and
   .intro-running to <html> before the first paint when it should play. */
#intro { display: none; }
html.intro-on #intro {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  transition: opacity 0.6s ease;
  /* Failsafe: if the script never runs, the cover lifts by itself. */
  animation: introFailsafe 0.5s ease 4.5s forwards;
}
/* Pops in: a quick fade and settle. On a wrapper, so the flight's own
   transform on the image is never fighting an animation. */
#intro .intro-pop { opacity: 0; animation: introPop 0.5s cubic-bezier(0.2, 0.7, 0.3, 1) 0.05s forwards; }
#intro .intro-logo {
  display: block;
  height: clamp(40px, 10vw, 104px);
  width: auto;
  transform-origin: top left;
  will-change: transform;
}
/* Weighted so the logo leaves decisively and settles gently. */
#intro.flying .intro-logo { transition: transform 0.9s cubic-bezier(0.62, 0, 0.18, 1); }
#intro.done { opacity: 0; pointer-events: none; }
/* While it runs, the real top-bar logo is hidden (still laid out, so it
   can be measured). The animation is a failsafe in case the script never
   removes the class. */
html.intro-running .appbar .wordmark img { visibility: hidden; animation: introShowLogo 0s linear 5s forwards; }
@keyframes introPop { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: none; } }
@keyframes introFailsafe { to { opacity: 0; visibility: hidden; pointer-events: none; } }
@keyframes introShowLogo { to { visibility: visible; } }
@media (prefers-reduced-motion: reduce) {
  html.intro-on #intro { display: none; }
  html.intro-running .appbar .wordmark img { visibility: visible; }
}

/* --- Product page: Website Set, Company Look, spec sheet ---------- */


.sheet-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 12px 0 2px; }
.look-dialog { width: min(560px, calc(100vw - 24px)); }
.look-dialog .look-h { font-size: 14px; margin: 16px 0 8px; }
.look-dialog .look-h .sub { font-weight: 500; color: var(--ink-3); font-size: 12.5px; }

/* --- Simplified product form ------------------------------------------------ */
.start-box .link-row { margin-top: 10px; }
.drop-hint { margin: 10px 0 0; }
.summary-card { margin-top: 14px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-2); overflow: hidden; }
.filled-note { display: flex; gap: 10px; justify-content: space-between; align-items: center; padding: 9px 14px; font-size: 13px; background: var(--warn-bg); color: var(--warn-ink); }
.details-panel { margin-top: 6px; }
.details-sub { font-size: 14px; margin: 22px 0 2px; padding-top: 16px; border-top: 1px solid var(--line); }
.details-sub .sub { font-weight: 500; color: var(--ink-3); font-size: 12.5px; }
/* Supporting Items: the supplier's own words, or up to two of their products. */
.chips .chip[hidden] { display: none; }
.sx-sup-hint { margin: 6px 0 0; }
#supportingText { margin-top: 8px; }
.sx-sup-lib { margin-top: 8px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.sx-sup-list { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.sx-sup-list:empty { display: none; }
.sx-sup-item { display: grid; grid-template-columns: 52px minmax(0, 1fr) 28px; gap: 10px; align-items: center; padding: 8px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--card, #fff); }
.sx-sup-thumb { width: 52px; height: 52px; border-radius: 8px; background: #eef0ee center / cover no-repeat; }
.sx-sup-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.sx-sup-text strong { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sx-sup-text input { padding: 6px 9px; font-size: 13px; }
.sx-sup-x { width: 28px; height: 28px; border: 0; border-radius: 50%; background: transparent; font-size: 18px; line-height: 1; cursor: pointer; color: var(--ink-3); }
.sx-sup-x:hover { background: var(--line); color: var(--ink); }
.sx-sup-tip { margin: 8px 0 0; }
.c-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.c-pair.single { grid-template-columns: 1fr; }
.c-pair[hidden] { display: none; }
@media (max-width: 520px) { .c-pair { grid-template-columns: 1fr; } }
.look-foot { margin: 14px 0 0; }
#lookCollapsed { margin-top: 20px; }


/* --- Pricing: not open yet -------------------------------------------------------- */
.soon { color: var(--ink-3); cursor: default; }
.soon em { font-style: normal; font-size: 11px; font-weight: 700; margin-left: 4px; padding: 2px 7px; border-radius: var(--pill); background: rgba(18, 20, 18, 0.06); }
.appnav .soon { padding: 8px 14px; font-size: 14.5px; font-weight: 650; opacity: 0.55; }
@media (max-width: 420px) { .appnav .soon { padding: 8px 9px; font-size: 14px; } .appnav .soon em { display: none; } }


/* --- Callouts in the image viewer --------------------------------------------- */
.lb-frame { position: relative; display: inline-flex; max-width: 100%; max-height: calc(100vh - 56px); }
.lb-frame img { display: block; }
.lb-canvas { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: var(--r-md); touch-action: none; }
.lb-canvas.editing { cursor: grab; }
.lb-canvas.placing { cursor: crosshair; }
.lb-callouts { display: flex; flex-direction: column; gap: 10px; padding-top: 4px; border-top: 1px solid var(--line); }
.lb-callouts > .btn { align-self: flex-start; margin-top: 10px; }
/* Add Callouts: the width of the panel, lime with a black outline. */
.lb-callouts > .co-toggle { align-self: stretch; width: 100%; }
.btn-outlined { border: 1.5px solid var(--ink); }
.btn-lime.btn-outlined:hover:not(:disabled) { background: var(--lime-2); }
.btn-lime:disabled { opacity: 0.7; }
.co-panel { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.co-panel[hidden] { display: none; }
.co-list { display: flex; flex-direction: column; gap: 8px; }
.co-item { display: grid; grid-template-columns: 26px 1fr 28px; gap: 6px 8px; align-items: center; padding: 8px; border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--line); }
.co-item.selected { border-color: var(--ink); }
.co-num { width: 24px; height: 24px; border-radius: 50%; background: var(--lime); color: var(--ink); font-size: 12px; font-weight: 750; display: grid; place-items: center; }
.co-item input { padding: 7px 10px; font-size: 13.5px; }
.co-item input.co-sub { grid-column: 2; font-size: 12.5px; }
.co-x { border: 0; background: transparent; font-size: 18px; color: var(--ink-3); cursor: pointer; padding: 0; }
.co-x:hover { color: var(--ink); }
.co-hint { margin: 0; }
.co-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* --- Product options: versions, finishes, Colour Range ---------------------- */

.v-label { margin: 12px 0 6px; font-size: 12.5px; font-weight: 700; color: var(--ink-2); }
.chip .dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 7px; vertical-align: -1px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.18); background-size: cover; background-position: center; }

/* Options editor */
dialog.options-dialog { width: min(760px, calc(100vw - 24px)); max-height: calc(100vh - 40px); padding: 0; overflow: hidden; }
dialog.options-dialog[open] { display: flex; flex-direction: column; }
.od-body { padding: 22px 24px; overflow-y: auto; }
.od-head { padding: 20px 24px 0; }
.od-head h2 { margin: 0 0 4px; }
.od-foot { padding: 14px 24px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; align-items: center; background: var(--surface); }
.od-section { margin-top: 18px; }
.od-section:first-child { margin-top: 0; }
.od-section h3 { font-size: 15px; margin: 0 0 4px; }
.od-section > p { margin: 0 0 10px; }

.od-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.od-photo { display: flex; flex-direction: column; gap: 6px; }
.od-photo img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--r-sm); background: #fff; border: 1px solid var(--line); }
.od-photo select { font-size: 13px; padding: 6px 8px; }
@media (max-width: 560px) {
  /* Phone: name and × on the first line, details underneath. */

}

/* --- Collections ---------------------------------------------------------------- */

/* Choosing products (new collection, add a product). */
dialog.product-picker { width: min(720px, calc(100vw - 32px)); max-height: calc(100vh - 48px); display: flex; flex-direction: column; }
dialog.product-picker[open] { display: flex; }
dialog.product-picker label { display: block; font-weight: 700; font-size: 13.5px; margin: 6px 0 6px; }
dialog.product-picker label .sub { font-weight: 500; color: var(--ink-3); margin-left: 4px; }
dialog.product-picker .pp-search { margin: 12px 0 0; }
.pp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-top: 14px; overflow-y: auto; min-height: 120px; padding: 2px; }
.pp-item { display: flex; flex-direction: column; gap: 4px; text-align: left; padding: 6px; border: 1.5px solid var(--line); border-radius: var(--r-md); background: var(--surface-2); cursor: pointer; font: inherit; color: var(--ink); }
.pp-item:hover:not(:disabled) { border-color: var(--ink-3); }
.pp-item[aria-pressed="true"] { border-color: var(--ink); box-shadow: 0 0 0 2px var(--lime); }
.pp-item:disabled { opacity: 0.55; cursor: not-allowed; }
.pp-cover { position: relative; aspect-ratio: 4 / 3; border-radius: var(--r-sm); background: #e1e5e2 center / cover no-repeat; }
.pp-num { position: absolute; top: 6px; left: 6px; width: 24px; height: 24px; border-radius: 50%; background: var(--lime); color: var(--ink); font-weight: 800; font-size: 13px; display: grid; place-items: center; box-shadow: 0 0 0 2px var(--ink); }
.pp-name { font-weight: 700; font-size: 13.5px; line-height: 1.3; padding: 2px 2px 0; }
.pp-type { font-size: 12px; color: var(--ink-3); padding: 0 2px 2px; }
dialog.product-picker .dialog-actions { align-items: center; margin-top: 16px; }
dialog.product-picker .pp-count { margin-right: auto; }

/* Dashboard: collections next to products. */
.page-title .title-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.product-card .cover { position: relative; }

/* Product page: the products in a collection. */

.members { display: flex; flex-direction: column; gap: 10px; }
.member { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 12px; padding: 10px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-md); }

.member-letter { flex: none; width: 22px; height: 22px; border-radius: 50%; background: var(--dark); color: #fff; font-size: 12px; font-weight: 800; display: grid; place-items: center; align-self: center; }

.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: var(--pill); background: var(--surface); }
.qty button { width: 32px; height: 32px; border: 0; background: transparent; font-size: 17px; font-weight: 700; cursor: pointer; color: var(--ink); border-radius: var(--pill); }
.qty button:disabled { color: var(--ink-3); cursor: not-allowed; }
.qty output { min-width: 34px; text-align: center; font-weight: 800; font-size: 14px; }

.member-warn { font-size: 12.5px; color: var(--warn-ink); background: var(--warn-bg); border-radius: var(--r-sm); padding: 6px 10px; }

@media (max-width: 420px) {
  .member { grid-template-columns: 52px minmax(0, 1fr); gap: 10px; }

}

/* --- Credits ------------------------------------------------------------------ */
.credit-pill { display: inline-flex; align-items: center; gap: 4px; margin-right: 10px; padding: 7px 14px; border-radius: var(--pill); background: var(--lime); color: var(--ink); border: 1.5px solid var(--ink); font-size: 13.5px; font-weight: 800; text-decoration: none; white-space: nowrap; }
.credit-pill:hover { background: var(--lime-2); }
.credit-pill.low { background: var(--warn-bg); border-color: var(--warn-ink); color: var(--warn-ink); }
.credit-pill.empty { background: var(--error-bg); border-color: var(--error); color: var(--error); }
.credit-pill.unlimited { background: var(--surface-2); }
.credit-pill .cp-short { display: none; }
@media (max-width: 520px) {
  .credit-pill { padding: 6px 10px; font-size: 12.5px; margin-right: 6px; }
  .credit-pill .cp-word { display: none; }
  .credit-pill .cp-short { display: inline; }
  .appnav .soon { display: none; }
}
.credit-need { color: var(--error); font-weight: 700; }
.credits-card .credits-big { font-size: 44px; font-weight: 800; letter-spacing: -0.04em; line-height: 1; }
.credits-card .credits-sub { margin: 6px 0 0; }
.credit-history { list-style: none; margin: 18px 0 0; padding: 0; border-top: 1px solid var(--line); }
.credit-history li { display: flex; gap: 12px; align-items: baseline; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.credit-history .ch-delta { flex: none; width: 52px; font-weight: 800; text-align: right; }
.credit-history .ch-delta.plus { color: var(--ok); }
.credit-history .ch-what { flex: 1; min-width: 0; }
.credit-history .ch-when { flex: none; color: var(--ink-3); font-size: 12.5px; }
.welcome-credits { display: inline-flex; margin: 0 0 12px; padding: 6px 12px; border-radius: var(--pill); background: var(--lime); border: 1.5px solid var(--ink); font-weight: 800; font-size: 13.5px; }

/* --- Library ------------------------------------------------------------------ */
.library { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 28px; align-items: start; }
.lib-side { position: sticky; top: 90px; }
.lib-nav { display: flex; flex-direction: column; gap: 2px; }
.lib-nav-h { margin: 16px 10px 6px; font-size: 11.5px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }
.lib-link { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; padding: 9px 12px; border: none; border-radius: var(--r-sm); background: transparent; font: inherit; font-size: 14.5px; font-weight: 650; color: var(--ink-2); text-align: left; cursor: pointer; }
.lib-link:hover { background: rgba(255, 255, 255, 0.6); color: var(--ink); }
.lib-link[aria-current="true"] { background: var(--dark); color: #fff; }
.lib-link[aria-current="true"] .lib-n { color: rgba(255, 255, 255, 0.7); }
.lib-link-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lib-link.folder .lib-link-name::before { content: ""; display: inline-block; width: 13px; height: 10px; margin-right: 8px; border: 1.5px solid currentColor; border-radius: 2px 3px 3px 3px; vertical-align: -1px; opacity: 0.7; }
.lib-n { font-size: 12.5px; font-weight: 700; color: var(--ink-3); }
.lib-new { color: var(--ink); margin-top: 6px; border: 1.5px dashed var(--line-2); justify-content: center; }
.lib-new:hover { border-color: var(--ink-3); }
.lib-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; min-height: 40px; }
.lib-title { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.lib-title h2 { margin: 0; font-size: 26px; letter-spacing: -0.03em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lib-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.lib-empty { text-align: center; padding: 48px 24px; border-radius: var(--r-lg); border: 1.5px dashed var(--line-2); background: rgba(255, 255, 255, 0.4); }
.lib-empty h3 { margin: 0 0 6px; }
.lib-empty .btn { margin-top: 14px; }
.library .product-grid { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
@media (max-width: 860px) {
  .library { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .lib-side { position: static; }
  /* Collections become a row you swipe along. */
  .lib-nav { flex-direction: row; overflow-x: auto; gap: 6px; padding-bottom: 4px; scrollbar-width: none; }
  .lib-nav::-webkit-scrollbar { display: none; }
  .lib-nav-h { display: none; }
  .lib-link { width: auto; flex: none; padding: 8px 14px; border-radius: var(--pill); background: var(--surface-2); border: 1px solid var(--line); }
  .lib-new { margin-top: 0; }
  .library .product-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
}

/* Collections a product is in. */
dialog.collections-dialog .cd-list { display: flex; flex-direction: column; gap: 2px; max-height: 300px; overflow-y: auto; margin: 4px 0 14px; }
.cd-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r-sm); cursor: pointer; font-weight: 650; }
.cd-row:hover { background: var(--surface-2); }
.cd-row input { width: 18px; height: 18px; accent-color: var(--ink); margin: 0; }
.cd-row span:nth-child(2) { flex: 1; }
.cd-new-label { display: block; font-weight: 700; font-size: 13.5px; margin-bottom: 6px; }

/* --- Variations (product page) ------------------------------------------------- */
.var-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 2px 0 12px; }
.var-tab { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: var(--pill); border: 1px solid var(--line); background: var(--surface-2); font: inherit; font-size: 13.5px; font-weight: 700; color: var(--ink-2); cursor: pointer; }
.var-tab:hover { border-color: var(--ink-3); color: var(--ink); }
.var-tab[aria-selected="true"] { background: var(--dark); border-color: var(--dark); color: #fff; }
.var-n { min-width: 18px; height: 18px; padding: 0 5px; border-radius: var(--pill); background: var(--surface); color: var(--ink-2); font-size: 11px; font-weight: 800; display: inline-grid; place-items: center; }
.var-tab[aria-selected="true"] .var-n { background: rgba(255, 255, 255, 0.18); color: #fff; }
.var-tab.no-photo .var-n { background: var(--warn-bg); color: var(--warn-ink); }
.var-tab.var-add { border-style: dashed; color: var(--ink); background: transparent; }
.var-panel { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px 14px 10px; margin-bottom: 12px; }
.var-panel label { font-size: 12.5px; }
.var-panel input { font-size: 14px; padding: 8px 11px; }
.var-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 10px; }
.var-panel .dims { margin-bottom: 6px; }
.danger-link { color: var(--error); font-size: 13px; }
.thumbs.empty-var { display: block; }
.thumb.add.var-need { width: 100%; height: auto; min-height: 96px; padding: 16px; flex-direction: column; gap: 4px; text-align: center; font-size: 13px; line-height: 1.4; }
.thumb.add.var-need strong { font-size: 14.5px; color: var(--ink); }
.thumb.add.var-need span { color: var(--ink-3); font-weight: 500; }

@media (max-width: 560px) { .var-grid { grid-template-columns: minmax(0, 1fr); } }

/* --- Colours & Finishes (Stage 2) ------------------------------------------------ */
.dot { display: inline-block; flex: none; width: 16px; height: 16px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, 0.18); background-size: cover; background-position: center; vertical-align: -3px; }

/* Ticks in the product dialog. */
.tick-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.tick { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: var(--pill); border: 1px solid var(--line); background: var(--surface-2); font-size: 13.5px; font-weight: 650; cursor: pointer; }
.tick:has(input:checked) { border-color: var(--ink); background: var(--lime); }
.tick input { width: 16px; height: 16px; margin: 0; accent-color: var(--ink); }
.tick { height: 36px; box-sizing: border-box; margin: 0; }
.tick-grid { align-items: center; }
.tick.add { border-style: dashed; background: transparent; font: inherit; font-size: 13.5px; font-weight: 700; color: var(--ink); min-height: 0; line-height: 1; }
.od-light-row + .od-light-row { margin-top: 10px; }
.od-light-row .v-label { margin: 0 0 6px; }
.od-foot .od-lib { margin-right: auto; font-size: 13px; }

/* One palette item. */
dialog.palette-item-dialog { width: min(520px, calc(100vw - 32px)); }
dialog.palette-item-dialog label { display: block; font-weight: 700; font-size: 13.5px; margin: 12px 0 6px; }
dialog.palette-item-dialog label .sub { font-weight: 500; color: var(--ink-3); margin-left: 4px; }
.pi-kinds { margin-top: 4px; }
.pi-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 10px; }
.pi-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.pi-row label.pi-colour { display: inline-flex; align-items: center; gap: 8px; margin: 0; }
.pi-row input[type="color"] { width: 40px; height: 36px; padding: 2px; border: 1px solid var(--line); border-radius: var(--r-sm); background: #fff; cursor: pointer; }
.pi-swatch-img { width: 36px; height: 36px; border-radius: var(--r-sm); background: #fff center / cover no-repeat; border: 1px solid var(--line); }
@media (max-width: 480px) { .pi-grid { grid-template-columns: minmax(0, 1fr); } }

/* The palette in the Library. */
.pal-intro { margin: 0 0 18px; color: var(--ink-2); max-width: 720px; }
.pal-section { background: var(--surface); border-radius: var(--r-lg); padding: 14px 16px; margin-bottom: 14px; }
.pal-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.pal-head h3 { margin: 0; font-size: 17px; }
.pal-section > p.muted { margin: 4px 0 8px; }
.pal-row { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto auto 28px; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.pal-row .dot { width: 22px; height: 22px; }
.pal-text { display: flex; flex-direction: column; min-width: 0; }
.pal-text strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pal-x { border: 0; background: transparent; font-size: 20px; color: var(--ink-3); cursor: pointer; }
.pal-none { margin: 8px 0 2px; }
.lib-link.palette .lib-link-name::before { content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 8px; border-radius: 50%; background: conic-gradient(#c0392b, #e1e65d, #2e86c1, #383e42, #c0392b); vertical-align: -1px; }
@media (max-width: 560px) {
  .pal-row { grid-template-columns: 22px minmax(0, 1fr) auto 28px; }
  .pal-used { display: none; }
}

/* --- Studio: a picked product's remove button ------------------------------------- */
.st-x { border: 0; background: transparent; font-size: 20px; color: var(--ink-3); cursor: pointer; }

/* Add to Studio on a product page. */

/* Phones: the logo goes home, so Home (and the admin's Pricing link) make room for Library and Studio. */
@media (max-width: 520px) {
  .appnav [data-nav="home"], .appnav [data-nav="pricing"] { display: none; }
}

/* --- Images page (Stage 4) -------------------------------------------------------- */

.img-filter { display: flex; flex-direction: column; gap: 4px; margin: 0; font-size: 12px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-3); }
.img-filter select { min-width: 200px; max-width: 280px; font-size: 14px; text-transform: none; letter-spacing: 0; font-weight: 600; color: var(--ink); padding: 8px 10px; }
.img-filter[hidden] { display: none; }

.img-more { display: flex; justify-content: center; margin: 10px 0 30px; }
.tile .tag-shot { position: absolute; top: 10px; left: 10px; font-size: 11px; font-weight: 800; padding: 4px 9px; border-radius: var(--pill); background: var(--lime); color: var(--ink); pointer-events: none; }
.lb-meta { margin: 18px 0 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 13.5px; }
.lb-meta dt { color: var(--ink-3); font-weight: 650; }
.lb-meta dd { margin: 0; }

@media (max-width: 560px) {
  .img-filter { flex: 1 1 100%; }
  .img-filter select { max-width: none; width: 100%; }
}
.lb-nav[hidden] { display: none; }
.lb-nav { z-index: 3; }

/* --- Styles, Restyle, Bring a Photo (Stage 5) ------------------------------------ */
.chip.own-style { border-style: dashed; }
dialog.restyle-dialog { width: min(720px, calc(100vw - 32px)); }
.style-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 12px; max-height: 56vh; overflow-y: auto; padding: 2px; }
.style-grid.static { max-height: none; }
.style-card { display: flex; flex-direction: column; gap: 4px; text-align: left; padding: 8px; border: 1.5px solid var(--line); border-radius: var(--r-md); background: var(--surface-2); font: inherit; color: var(--ink); }
button.style-card { cursor: pointer; }
button.style-card:hover { border-color: var(--ink-3); }
.style-card[aria-pressed="true"] { border-color: var(--ink); box-shadow: 0 0 0 2px var(--lime); }
.style-card strong { font-size: 14px; }
.style-card span:not(.style-thumb) { font-size: 12px; color: var(--ink-3); line-height: 1.35; }
.style-thumb { display: block; aspect-ratio: 4 / 3; border-radius: var(--r-sm); background: #e8ebe9 center / cover no-repeat; border: 1px solid var(--line); }
/* Little previews of the built-in styles, drawn in CSS. */
/* Place Product: a site photo with the red spot. */
.sw-place { background: radial-gradient(circle at 56% 68%, #ff1a1a 0 4%, transparent 4.5% 7%, #ff1a1a 7.5% 10%, #fff 10.5% 12%, transparent 12.5%), linear-gradient(180deg, #c6d9e8 0 40%, #9fae95 40% 60%, #cdc8bb 60%); }
.sw-photo { background: linear-gradient(180deg, #9cc3e6 0 45%, #7f9b6a 45% 70%, #b8b1a3 70%); }
.sw-sketch { background: radial-gradient(circle at 30% 45%, rgba(242, 176, 54, 0.75) 0 18%, transparent 19%), radial-gradient(circle at 70% 55%, rgba(217, 80, 64, 0.6) 0 16%, transparent 17%), repeating-linear-gradient(135deg, transparent 0 7px, rgba(30, 30, 30, 0.12) 7px 8px), #fbfaf6; }
.sw-watercolour { background: radial-gradient(ellipse at 30% 40%, rgba(120, 170, 210, 0.55), transparent 45%), radial-gradient(ellipse at 65% 60%, rgba(140, 190, 130, 0.55), transparent 45%), radial-gradient(ellipse at 50% 30%, rgba(240, 200, 140, 0.45), transparent 40%), #f7f4ec; }
.sw-axonometric { background: repeating-linear-gradient(30deg, transparent 0 14px, rgba(20, 20, 20, 0.35) 14px 15px), repeating-linear-gradient(150deg, transparent 0 14px, rgba(20, 20, 20, 0.35) 14px 15px), #ffffff; }
.sw-render { background: linear-gradient(180deg, #cfe0ee 0 46%, transparent 46%), linear-gradient(115deg, #e9e6df 0 58%, #c9c4ba 58%), #e9e6df; box-shadow: inset 0 -14px 0 #a9b8a4; }
.sw-bw { background: linear-gradient(180deg, #d4d4d4 0 45%, #6e6e6e 45% 70%, #a8a8a8 70%); }
.style-list { display: flex; flex-direction: column; }
.own-style-row { display: grid; grid-template-columns: 72px minmax(0, 1fr) auto 28px; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.own-style-row .style-thumb { width: 72px; }

/* Bring a Photo, in the Studio. */
.lib-link.styles .lib-link-name::before { content: "✎"; display: inline-block; width: 10px; margin-right: 8px; font-size: 11px; }

/* ======================================================================
   Library: a catalogue. Cards show the product's own photo, whole.
   ====================================================================== */
.product-card .cover.ref { background: #fff; border: 1px solid var(--line); padding: 10px; overflow: hidden; }
.product-card .cover.ref img { display: block; width: 100%; height: 100%; object-fit: contain; }
.product-card .cover.ref.none { background: var(--lime); border-color: var(--lime); color: var(--ink); padding: 0; }
.product-card .cover.ref.none svg { width: 46px; height: 46px; opacity: 0.55; }

/* A product's page: photos and details only */
.product-page { max-width: 760px; }
.product-page #newTitle { margin: 18px 0 14px; }
.pp-create { display: flex; flex-direction: column; gap: 12px; margin-top: 22px; }
.pp-create .btn { width: 100%; justify-content: center; }
.pp-create .pill-link { align-self: center; }

/* ======================================================================
   Studio: one panel on the left, the preview on the right
   ====================================================================== */
/* Half and half on every visit; dragging the handle changes it until the page is left. */
.sx { grid-template-columns: var(--sx-panel, max(360px, calc(50% - 12px))) 24px minmax(0, 1fr); gap: 0; }
/* The handle between the panel and the preview: drag to resize. */
.sx-resize { position: sticky; top: 84px; align-self: start; height: calc(100vh - 100px); cursor: col-resize; display: flex; align-items: center; justify-content: center; touch-action: none; border-radius: var(--pill); }
.sx-resize::before { content: ""; position: absolute; top: 12px; bottom: 12px; left: 50%; width: 1px; background: transparent; transition: background-color 0.12s ease; }
.sx-resize span { position: relative; width: 6px; height: 44px; border-radius: var(--pill); background: var(--line-2); transition: background-color 0.12s ease, height 0.12s ease; }
.sx-resize:hover::before, .sx-resize:focus-visible::before, .sx-resizing .sx-resize::before { background: var(--line-2); }
.sx-resize:hover span, .sx-resize:focus-visible span, .sx-resizing .sx-resize span { background: var(--ink); height: 64px; }
.sx-resize:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }
body.sx-resizing { cursor: col-resize; user-select: none; }
body.sx-resizing .sx-preview { pointer-events: none; }

.sx-tabs { flex: none; display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin: 12px 14px 6px; padding: 4px; border-radius: var(--pill); background: var(--bg); }
.sx-tabs button { font: inherit; font-size: 14px; font-weight: 750; padding: 9px 10px; border: 0; border-radius: var(--pill); background: transparent; color: var(--ink-2); cursor: pointer; }
.sx-tabs button[aria-selected="true"] { background: var(--dark); color: #fff; }
.sx .c-title { align-items: center; flex-wrap: wrap; }
.sx-step { flex: none; display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--lime); color: var(--ink); font-size: 12px; font-weight: 800; }
.sx-h { font-size: 13.5px; font-weight: 750; margin: 0 0 8px; display: flex; align-items: baseline; gap: 8px; letter-spacing: -0.01em; }
.sx-h .sub { font-size: 12px; font-weight: 500; color: var(--ink-3); }
.sx-own, .sx-more { margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--line); }
.sx-own > .c-title, .sx-more > .c-title { margin-bottom: 0; }
.sx-own-title .sub { flex-basis: 100%; margin-left: 30px; line-height: 1.4; }
.sx-own-title .sub:empty { display: none; }
.sx-own.set-on > .c-section:not(.sx-keep), .sx-own.set-on > .c-pair { opacity: 0.4; }
.sx-own.set-on > .c-section:not(.sx-keep):hover, .sx-own.set-on > .c-pair:hover { opacity: 0.75; }

/* Products picked */
.sx-picks { display: flex; flex-direction: column; gap: 10px; }
.sx-pick { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-md); padding: 10px 12px 12px; }
.sx-pick.has-problem { border-color: #ead8ae; }
.sx-pick-head { display: flex; align-items: center; gap: 10px; }
.sx-pick-img { flex: none; width: 52px; height: 52px; border-radius: var(--r-sm); border: 1px solid var(--line); background: #fff center / contain no-repeat; display: grid; place-items: center; color: var(--ink-3); }
.sx-pick-img svg { width: 22px; height: 22px; }
.sx-pick-name { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.sx-pick-name strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sx-pick .member-warn { margin: 10px 0 0; }
.sx-pick .member-warn a { color: inherit; font-weight: 700; }
.sx-pick-body .v-label { margin: 10px 0 5px; }
.sx-field { display: flex; align-items: center; gap: 10px; margin: 10px 0 0; font-size: 12.5px; font-weight: 700; color: var(--ink-2); }
.sx-field select { flex: 1; min-width: 0; padding: 7px 10px; font-size: 13.5px; }
.chips.sm { gap: 5px; }
.chips.sm .chip { padding: 5px 11px; font-size: 12.5px; }
.sx-together { display: flex; gap: 8px; align-items: center; margin-top: 10px; }
.sx-together input { flex: 1; min-width: 0; padding: 7px 10px; font-size: 13px; }
.sx-range { margin-top: 12px; }
.sx-add { margin-top: 10px; }
.sx-empty { padding: 16px; border-radius: var(--r-md); border: 1.5px dashed var(--line-2); color: var(--ink-2); font-size: 13.5px; text-align: center; }

/* Quick Sets: three lime buttons */
.sx-sets { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.sx-set { font: inherit; text-align: left; display: flex; flex-direction: column; gap: 3px; padding: 11px 12px; border-radius: var(--r-md); border: 1.5px solid var(--ink); background: var(--lime); color: var(--ink); cursor: pointer; }
.sx-set strong { font-size: 13.5px; line-height: 1.25; }
.sx-set span { font-size: 11.5px; font-weight: 650; color: var(--lime-ink); }
.sx-set:hover:not(:disabled):not([aria-pressed="true"]) { background: var(--lime-2); }
.sx-set[aria-pressed="true"] { background: var(--dark); border-color: var(--dark); color: #fff; }
.sx-set[aria-pressed="true"] span { color: var(--lime); }
.sx-set:disabled { opacity: 0.45; cursor: default; }

/* Restyle or Enhance */
.sx-sources { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.sx-source { font: inherit; text-align: left; display: flex; flex-direction: column; gap: 3px; padding: 12px; border-radius: var(--r-md); border: 1.5px solid var(--line); background: var(--surface-2); color: var(--ink); cursor: pointer; }
.sx-source strong { font-size: 13.5px; line-height: 1.25; }
.sx-source span { font-size: 11.5px; color: var(--ink-3); }
.sx-source:hover { border-color: var(--line-2); }
.sx-source.on { border-color: var(--ink); }
.sx-chosen { display: flex; gap: 12px; align-items: center; margin-top: 10px; padding: 10px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line); }
.sx-chosen[hidden] { display: none; }
.sx-chosen-img { flex: none; width: 96px; aspect-ratio: 4 / 3; border-radius: var(--r-sm); background: #e2e6e3 center / cover no-repeat; }
.sx-chosen-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.35; }
.sx-chosen .linkish { flex: none; font-weight: 700; }
.sx-modes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.sx-mode { font: inherit; text-align: left; display: flex; flex-direction: column; gap: 3px; padding: 8px 8px 10px; border-radius: var(--r-md); border: 1.5px solid var(--line); background: var(--surface-2); color: var(--ink); cursor: pointer; }
.sx-mode .style-thumb { aspect-ratio: 16 / 9; margin-bottom: 4px; }
.sx-mode strong { font-size: 13.5px; }
.sx-mode span:not(.style-thumb) { font-size: 11.5px; color: var(--ink-3); line-height: 1.35; }
.sx-mode:hover { border-color: var(--line-2); }
.sx-mode[aria-pressed="true"] { border-color: var(--ink); background: var(--lime); }
.sx-mode[aria-pressed="true"] span:not(.style-thumb) { color: var(--lime-ink); }
.sx-mode[data-mode="enhance"] .style-thumb { background: linear-gradient(135deg, #cfe0f0 0%, #f6efe0 55%, #9fb894 100%); }
#editPane label { display: block; font-weight: 700; font-size: 13.5px; margin: 10px 0 6px; }
#editPane label .sub { font-weight: 500; color: var(--ink-3); margin-left: 4px; }
#editProductRow[hidden] { display: none; }
.sx-edit-note { margin: 18px 0 0; }

/* The preview */
.sx-preview { min-width: 0; }
.sx-big { display: block; width: 100%; max-height: 72vh; padding: 0; border: 0; border-radius: var(--r-lg); overflow: hidden; background: var(--surface); cursor: zoom-in; }
.sx-big img { display: block; width: 100%; height: 100%; object-fit: contain; }
.sx-stage .tile.pending, .sx-stage .tile.failed { border-radius: var(--r-lg); max-height: 72vh; min-height: 260px; }
.sx-caption { margin: 8px 2px 0; font-size: 13px; font-weight: 650; color: var(--ink-2); }
.sx-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.sx-actions[hidden] { display: none; }
.sx-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; margin-top: 18px; }
.sx-thumb { position: relative; aspect-ratio: 1; padding: 0; border-radius: var(--r-sm); border: 2px solid transparent; background: #e2e6e3 center / cover no-repeat; cursor: pointer; display: grid; place-items: center; font: inherit; font-weight: 800; color: var(--error); }
.sx-thumb.on { border-color: var(--ink); }
.sx-thumb.pending { background: var(--surface); }
.sx-thumb.failed { background: var(--error-bg); }
.sx-star { position: absolute; top: 4px; right: 4px; width: 18px; height: 18px; border-radius: 50%; background: var(--lime); color: var(--ink); font-size: 11px; display: grid; place-items: center; }
.spinner.sm { width: 18px; height: 18px; border-width: 2px; }

/* Pick one of your images */
dialog.image-picker { width: min(860px, calc(100vw - 32px)); }
.ip-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; max-height: 58vh; overflow-y: auto; margin-top: 12px; }
.ip-item { aspect-ratio: 4 / 3; padding: 0; border-radius: var(--r-sm); border: 2px solid transparent; background: #e2e6e3 center / cover no-repeat; cursor: pointer; display: flex; align-items: flex-end; overflow: hidden; font: inherit; }
.ip-item span { width: 100%; padding: 14px 8px 6px; font-size: 11.5px; font-weight: 750; color: #fff; text-align: left; background: linear-gradient(transparent, rgba(0, 0, 0, 0.55)); }
.ip-item:hover, .ip-item:focus-visible { border-color: var(--ink); }

@media (max-width: 980px) {
  .sx { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .sx-resize { display: none; }
  .sx .composer { overflow: visible; }
  .sx .composer-body { overflow: visible; }
  /* The Create bar stays on screen while the panel scrolls by. */
  .sx .composer-foot { position: sticky; bottom: 0; z-index: 20; border-radius: 0 0 var(--r-lg) var(--r-lg); box-shadow: 0 -8px 24px rgba(18, 20, 18, 0.08); }
}
@media (max-width: 520px) {
  .sx .composer-body { padding: 6px 16px 22px; }
  .sx-sets { grid-template-columns: minmax(0, 1fr); }
  .sx-set { flex-direction: row; justify-content: space-between; align-items: baseline; }
  .sx-sources { grid-template-columns: minmax(0, 1fr); }
  .sx-own-title .sub { margin-left: 0; }
}

/* ======================================================================
   Gallery: filters
   ====================================================================== */
.gl-filters { margin: -6px 0 18px; }
.gl-bar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 12px; }
.gl-search { flex: 1 1 240px; min-width: 200px; margin: 0; }
.gl-search input { width: 100%; border-radius: var(--pill); padding: 10px 16px; }
.gl-bar .img-filter select, .gl-bar .img-filter input { min-width: 150px; max-width: 240px; font-size: 14px; text-transform: none; letter-spacing: 0; font-weight: 600; color: var(--ink); padding: 8px 10px; }
.gl-dates { display: flex; gap: 10px; }
.gl-dates[hidden] { display: none; }
.gl-more-btn { height: 40px; }
.gl-n { margin-left: 6px; padding: 0 7px; border-radius: var(--pill); background: var(--lime); color: var(--ink); font-size: 12px; font-weight: 800; }
.gl-n[hidden] { display: none; }
.gl-sort { margin-left: auto; }
.gl-sort select { min-width: 150px; }
.gl-more { margin-top: 12px; padding: 12px 16px; border-radius: var(--r-md); background: var(--surface); display: grid; gap: 8px; }
.gl-more[hidden] { display: none; }
.gl-more-row { display: grid; grid-template-columns: 96px minmax(0, 1fr); align-items: center; gap: 10px; }
.gl-more-row .v-label { margin: 0; }
.gl-more-row select { max-width: 320px; padding: 7px 10px; font-size: 14px; }
.gl-more-row .switch { grid-column: 2; }
.gl-active { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; min-height: 28px; }
.gl-count { font-size: 14px; font-weight: 800; margin-right: 4px; }
.gl-chips { display: contents; }
.gl-chip { font: inherit; font-size: 12.5px; font-weight: 700; padding: 4px 10px; border-radius: var(--pill); border: 1.5px solid var(--ink); background: var(--lime); color: var(--ink); cursor: pointer; }
.gl-chip:hover { background: var(--lime-2); }
@media (max-width: 700px) {
  .gl-bar .img-filter { flex: 1 1 140px; }
  .gl-bar .img-filter select, .gl-bar .img-filter input { max-width: none; width: 100%; min-width: 0; }
  .gl-sort { margin-left: 0; }
  .gl-more-row { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .gl-more-row .switch { grid-column: 1; }
  .gl-dates { flex: 1 1 100%; }
  .gl-dates .img-filter { flex: 1; }
}

/* ======================================================================
   Pill links: small stand-alone actions and "go to" links, defined as
   pills rather than underlined text. Links inside a sentence stay text.
   ====================================================================== */
.pill-link { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: var(--pill); border: 1.5px solid var(--line-2); background: var(--surface-2); color: var(--ink); font: inherit; font-size: 13.5px; font-weight: 750; line-height: 1.2; letter-spacing: -0.005em; text-decoration: none; white-space: nowrap; cursor: pointer; transition: border-color 0.12s ease, background-color 0.12s ease; }
.pill-link:hover { border-color: var(--ink); }
.pill-link:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.pill-link:disabled, .pill-link[aria-busy="true"] { opacity: 0.55; cursor: progress; }
.pill-link.sm { padding: 4px 11px; font-size: 12.5px; }
.pill-link[hidden] { display: none; }
.sx-h .pill-link { margin-left: 2px; }
.look-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.co-add { align-self: flex-start; }
.sx-pick .member-warn .pill-link { margin-left: 4px; vertical-align: middle; }
[aria-busy="true"] { cursor: progress; }

/* ======================================================================
   Library: search and categories on one line
   ====================================================================== */
.list-tools { display: flex; align-items: center; gap: 10px; margin: 0 0 18px; flex-wrap: nowrap; }
.list-tools[hidden] { display: none; }
.list-tools input[type="search"] { flex: 0 0 240px; width: 240px; border-radius: var(--pill); padding: 10px 16px; }
.cat-row { flex: 0 1 auto; min-width: 0; display: flex; gap: 7px; overflow: hidden; white-space: nowrap; padding: 2px 0; }
.cat-row .chip { flex: none; }
.cat-row .chip[hidden] { display: none; }
.cat-n { color: var(--ink-3); font-weight: 600; margin-left: 2px; }
.chip[aria-pressed="true"] .cat-n { color: rgba(255, 255, 255, 0.7); }
.cat-x { margin-left: 2px; font-weight: 800; }
.cat-more-wrap { position: relative; flex: none; }
.cat-more-wrap[hidden] { display: none; }
.cat-more { border-style: dashed; font-weight: 750; }
.cat-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; min-width: 230px; max-height: 320px; overflow-y: auto; padding: 6px; border-radius: var(--r-sm); background: var(--surface-2); box-shadow: var(--shadow-lift); display: flex; flex-direction: column; }
.cat-menu[hidden] { display: none; }
.cat-menu button { display: flex; justify-content: space-between; gap: 14px; text-align: left; font: inherit; font-size: 14px; font-weight: 600; padding: 9px 10px; border: 0; border-radius: 8px; background: none; color: var(--ink); cursor: pointer; }
.cat-menu button:hover, .cat-menu button:focus-visible { background: var(--surface); }
@media (max-width: 640px) {
  .list-tools { flex-wrap: wrap; }
  .list-tools input[type="search"] { flex: 1 1 100%; width: 100%; }
  .cat-row { flex: 0 1 auto; }
}

/* ======================================================================
   Image viewer panel: three actions, then small pills
   ====================================================================== */
.lb-side { gap: 12px; }
.lb-head { padding-right: 44px; margin-bottom: 4px; }
.lb-side .lb-title { margin: 0; font-size: 20px; line-height: 1.25; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.lb-sub { margin: 4px 0 0; font-size: 13px; line-height: 1.45; color: var(--ink-2); }
.lb-row { display: flex; gap: 8px; }
.lb-row .lb-download { flex: 1; justify-content: center; }
.lb-star { flex: none; width: 48px; padding-left: 0; padding-right: 0; justify-content: center; font-size: 18px; }
.lb-wide { width: 100%; justify-content: center; }
/* Restyle or Enhance, and Edit, side by side. */
.lb-pair { display: flex; flex-wrap: wrap; gap: 8px; }
.lb-pair .btn { flex: 1 1 auto; justify-content: center; padding-left: 12px; padding-right: 12px; white-space: nowrap; }
/* An edit: hold to see the original. */
.lb-compare { position: absolute; z-index: 3; left: 50%; bottom: 14px; transform: translateX(-50%); font: inherit; font-size: 13px; font-weight: 750; padding: 8px 14px; border-radius: var(--pill); border: 0; background: rgba(18, 20, 18, 0.78); color: #fff; cursor: pointer; user-select: none; -webkit-user-select: none; touch-action: none; white-space: nowrap; }
.lb-compare.on { background: var(--lime); color: var(--ink); }
.lb-compare[hidden] { display: none; }
.lb-original { margin: 4px 0 8px; }
.lb-original[hidden] { display: none; }

/* Edit: what should change, and (recommended) the area, dragged as a box. */
dialog.edit-dialog { width: min(760px, calc(100vw - 24px)); }
.ed-stage { position: relative; margin: 12px auto 8px; border-radius: var(--r-sm); overflow: hidden; background: #e8ebe9; cursor: crosshair; touch-action: none; user-select: none; -webkit-user-select: none; }
.ed-stage img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.ed-box { position: absolute; border: 3px solid #ff1a1a; box-shadow: 0 0 0 1.5px #fff, 0 0 0 9999px rgba(0, 0, 0, 0.32); border-radius: 2px; pointer-events: none; }
.ed-box[hidden] { display: none; }
.ed-hint { margin: 0 0 12px; }
.ed-clear[hidden] { display: none; }
.edit-dialog textarea { width: 100%; }
.lb-side .lb-callouts { border-top: 0; padding-top: 0; gap: 10px; }
.lb-side .lb-callouts > .co-toggle { margin-top: 0; }
.lb-pills { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding-top: 12px; border-top: 1px solid var(--line); }
.lb-extra { display: contents; }
.lb-more { position: relative; display: inline-flex; }
.lb-more-btn { min-width: 38px; justify-content: center; font-size: 16px; letter-spacing: 0.05em; }
.lb-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 5; min-width: 220px; padding: 6px; border-radius: var(--r-sm); background: var(--surface-2); box-shadow: var(--shadow-lift); display: flex; flex-direction: column; }
.lb-menu[hidden] { display: none; }
.lb-menu button { text-align: left; font: inherit; font-size: 14px; font-weight: 600; padding: 9px 10px; border: 0; border-radius: 8px; background: none; color: var(--ink); cursor: pointer; white-space: nowrap; }
.lb-menu button:hover, .lb-menu button:focus-visible { background: var(--surface); }
.lb-menu button[hidden] { display: none; }
.lb-menu button.danger { color: var(--error); }
.lb-menu button:disabled { opacity: 0.5; cursor: default; }

/* ======================================================================
   Product page: the photo large on the left, a clean card on the right
   ====================================================================== */
.product-page { max-width: 1180px; }
.product-page .start-box { max-width: 640px; }
.pp-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 32px; align-items: start; }
.pp-grid[hidden] { display: none; }
.pp-media { min-width: 0; }
.pp-hero { position: relative; aspect-ratio: 4 / 3.4; border-radius: var(--r-lg); border: 1px solid var(--line); background: #fff; display: grid; place-items: center; overflow: hidden; margin-bottom: 14px; }
.pp-hero img { display: block; width: 100%; height: 100%; object-fit: contain; padding: 22px; }
.pp-hero-tag { position: absolute; left: 14px; bottom: 14px; }
.pp-hero-main { position: absolute; left: 14px; bottom: 14px; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08); }
.pp-hero.empty { background: var(--lime); border-color: var(--lime); }
.pp-hero-none { display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--ink); font-size: 14px; font-weight: 650; }
.pp-hero-none svg { width: 52px; height: 52px; opacity: 0.55; }
.pp-media .var-tabs { margin-bottom: 10px; }
.pp-media .thumb { width: 72px; height: 72px; background: #fff; border: 1px solid var(--line); }
.pp-media .thumb.shown { border: 2px solid var(--ink); }
.pp-media .thumb.add { border: 1.5px dashed var(--line-2); }
.thumb-show { display: block; width: 100%; height: 100%; padding: 0; border: 0; background: #fff; cursor: pointer; }
.thumb-show img { width: 100%; height: 100%; object-fit: contain; display: block; }
.pp-info { min-width: 0; }
.pp-info .summary-card { margin-top: 0; }

/* The card: label, value, one button per row */
.sum-row { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 14px 16px; border-top: 1px solid var(--line); }
.sum-row:first-child { border-top: 0; }
.sum-label { font-size: 11.5px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }
.sum-value { min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: 14px; line-height: 1.45; }
.sum-value strong { font-weight: 700; }
.sum-sub { font-size: 13px; color: var(--ink-2); }
.sum-line.one { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sum-line.two { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 13px; }
.sum-row .btn { flex: none; }
.summary-card .filled-note { border-top: 1px solid #ecdcb8; }
.pp-info .details-panel { margin-top: 12px; padding: 4px 2px; }
.pp-info .pp-create { margin-top: 18px; }

@media (max-width: 900px) {
  .pp-grid { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .pp-hero { aspect-ratio: 1 / 1; }
}
@media (max-width: 460px) {
  .sum-row { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; padding: 12px 14px; }
  .sum-label { grid-column: 1 / -1; }
}
.pp-media .thumb.main:not(.shown) { border: 1px solid var(--line); }
.filled-note .linkish { color: inherit; font-weight: 700; flex: none; white-space: nowrap; }

/* Specify a Scene: a full-width row that becomes the text box */
.sx-specify { margin-top: 7px; }
.sx-specify-btn { width: 100%; display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: var(--r-sm); border: 1.5px dashed var(--line-2); background: transparent; color: var(--ink); font: inherit; font-size: 14px; font-weight: 650; text-align: left; cursor: pointer; }
.sx-specify-btn:hover { border-color: var(--ink); background: var(--surface-2); }
.sx-specify-btn[hidden] { display: none; }
.sx-pen svg { width: 16px; height: 16px; display: block; color: var(--ink-2); }
.sx-specify-field { display: flex; align-items: center; gap: 10px; padding: 4px 6px 4px 14px; border-radius: var(--r-sm); border: 1.5px solid var(--ink); background: var(--surface-2); }
.sx-specify-field[hidden] { display: none; }
.sx-specify-field input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 8px 0; font-size: 14px; box-shadow: none; }
.sx-specify-field input:focus { outline: none; box-shadow: none; }
.sx-tick { flex: none; width: 16px; height: 16px; border-radius: 4px; border: 1.5px solid var(--line-2); background: #fff; position: relative; }
.sx-specify-field.on { background: var(--dark); border-color: var(--dark); }
.sx-specify-field.on input { color: #fff; }
.sx-specify-field.on input::placeholder { color: rgba(255, 255, 255, 0.6); }
.sx-specify-field.on .sx-tick { background: var(--lime); border-color: var(--lime); }
.sx-specify-field.on .sx-tick::after { content: "✓"; position: absolute; inset: 0; display: grid; place-items: center; font-size: 11px; font-weight: 800; color: var(--ink); }
.sx-specify-x { flex: none; width: 30px; height: 30px; border: 0; border-radius: 50%; background: transparent; color: var(--ink-3); font-size: 20px; cursor: pointer; }
.sx-specify-field.on .sx-specify-x { color: rgba(255, 255, 255, 0.75); }
.sx-more-scenes { margin-top: 10px; }

/* Favourite: a heart. Filled black on lime once favourited. */
.lb-star svg { width: 20px; height: 20px; display: block; }
.lb-star[aria-pressed="true"] { background: var(--lime); border-color: var(--lime); color: var(--ink); }
.sx-fav svg { width: 17px; height: 17px; margin-right: 6px; }
.sx-fav[aria-pressed="true"] { background: var(--lime); border-color: var(--lime); }
.sx-star svg { width: 11px; height: 11px; display: block; }

/* Studio: three tabs */
/* Four tabs: one row when the panel is wide enough, two by two when not. */
.sx-tabs { display: flex; gap: 2px; }
.sx-tabs button { flex: 1 1 auto; padding: 9px 10px; font-size: 13.5px; white-space: nowrap; }

/* Prompt tab */
.sx-prompt { width: 100%; min-height: 150px; resize: vertical; font-size: 14.5px; line-height: 1.5; }
.sx-count { margin: 6px 0 0; text-align: right; }
.sx-ref-add { display: flex; flex-wrap: wrap; gap: 6px; }
.sx-refs { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.sx-refs:empty { display: none; }
.sx-ref { display: grid; grid-template-columns: 64px minmax(0, 1fr) 24px; gap: 10px; align-items: center; padding: 8px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line); }
.sx-ref-img { position: relative; width: 64px; height: 64px; border-radius: var(--r-sm); background: #e2e6e3 center / cover no-repeat; }
.sx-ref-n { position: absolute; left: 4px; top: 4px; width: 20px; height: 20px; border-radius: 50%; background: var(--lime); color: var(--ink); font-size: 11px; font-weight: 800; display: grid; place-items: center; }
.sx-ref-main { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.sx-ref-main strong { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sx-ref-main input { padding: 7px 10px; font-size: 13px; }
.sx-howmany { margin-top: 10px; }
.sx-real { margin-top: 16px; }
.pill-link:disabled { opacity: 0.45; cursor: default; }

/* Quick Sets follow the panel's width: side by side, or stacked rows when narrow. */
.sx .composer { container-type: inline-size; }
@container (max-width: 430px) {
  .sx-sets { grid-template-columns: minmax(0, 1fr); }
  .sx-set { flex-direction: row; justify-content: space-between; align-items: baseline; }
}

/* ======================================================================
   Studio: My Site Photo, White Background, Cut Out
   ====================================================================== */
.sx-h-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.sx-h-row .sx-h { margin: 0; }
.sx-seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: var(--pill); background: var(--bg); }
.sx-seg button { font: inherit; font-size: 12.5px; font-weight: 750; padding: 6px 12px; border: 0; border-radius: var(--pill); background: transparent; color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.sx-seg button[aria-pressed="true"] { background: var(--surface-2); color: var(--ink); box-shadow: 0 1px 2px rgba(18, 20, 18, 0.12); }
.site-on .not-site { display: none !important; }
.sx-site-empty p { margin: 0 0 10px; color: var(--ink-2); }
.sx-sources.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.sx-site-img { position: relative; border-radius: var(--r-md); overflow: hidden; background: #e2e6e3; cursor: crosshair; line-height: 0; }
.sx-site-img img { width: 100%; height: auto; max-height: 420px; object-fit: contain; display: block; }
.sx-site-dot { position: absolute; width: 30px; height: 30px; margin: -15px 0 0 -15px; border-radius: 50%; border: 4px solid #ff1a1a; box-shadow: 0 0 0 2px #fff, 0 2px 8px rgba(0, 0, 0, 0.35); pointer-events: none; }
.sx-site-dot::after { content: ""; position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%; background: #ff1a1a; }
.sx-site-dot[hidden] { display: none; }
.sx-site .small { margin: 8px 0 6px; }
.sx-site-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.sx-versions-h { margin-top: 14px; }
.place.white { background: #fff; }
.place .png-tag { font-size: 10.5px; font-weight: 800; color: var(--ink-3); margin-left: 2px; }
.place[aria-pressed="true"] .png-tag { color: var(--lime); }
.sw-cutout { background: linear-gradient(90deg, transparent 38%, #2a2c2a 38% 42%, transparent 42% 58%, #2a2c2a 58% 62%, transparent 62%) center 70% / 70% 40% no-repeat, linear-gradient(#cfd3d0, #cfd3d0) center 42% / 52% 9% no-repeat, #fff; border: 1px solid var(--line); }
.sx-sets { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.sx-preview .sx-actions #pvPng[hidden] { display: none; }

/* ======================================================================
   Studio: Develop
   ====================================================================== */
.sx-dv-empty p { margin: 0 0 12px; }
.sx-dv-start { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.sx-concept .sx-pick-head { align-items: center; }
.concept-tag { flex: none; font-size: 10.5px; padding: 3px 8px; background: var(--dark); border-color: var(--dark); color: var(--lime); }
.sx-dv-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.sx-promote { background: var(--lime); border-color: var(--ink); }
.sx-rounds { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.sx-round { font: inherit; font-size: 12.5px; font-weight: 750; padding: 6px 12px; border-radius: var(--pill); border: 1.5px solid var(--line-2); background: var(--surface-2); color: var(--ink); cursor: pointer; }
.sx-round[aria-selected="true"] { background: var(--dark); border-color: var(--dark); color: #fff; }
.sx-round.new { border-style: dashed; color: var(--ink-2); }
.sx-round.new[aria-selected="true"] { border-style: solid; color: #fff; }
.sx-drop { padding: 12px; border-radius: var(--r-md); border: 1.5px dashed var(--line-2); background: var(--surface-2); }
.sx-drop > p { margin: 0 0 10px; color: var(--ink-2); }
.sx-inputs { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.sx-inputs:empty { display: none; }
.sx-inputs.shown { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.sx-input { display: flex; gap: 10px; align-items: flex-start; }
.sx-inputs.shown .sx-input { flex-direction: column; gap: 6px; }
.sx-input-img { position: relative; flex: none; width: 72px; height: 72px; border-radius: var(--r-sm); background: #e2e6e3 center / cover no-repeat; border: 1px solid var(--line); }
.sx-inputs.shown .sx-input-img { width: 100%; height: auto; aspect-ratio: 4 / 3; background-size: contain; background-color: #fff; }
.sx-input-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; line-height: 1.3; }
.sx-input-main input { padding: 7px 10px; font-size: 13px; }
.sx-input-main strong { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sx-drop .sx-ref-add { align-items: center; }
.sx-drop .sx-ref-add input { flex: 1; min-width: 160px; padding: 7px 10px; font-size: 13px; }
.sx-round-save { display: flex; gap: 8px; margin-top: 12px; }
.sx-round-note { margin: 0 0 8px; }
.sx-modes.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.sx-modes.three .sx-mode { padding: 10px; }
.sx-parts { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.sx-parts > p { margin: 0; }
.sx-part { padding: 10px 12px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface-2); }
.sx-part-head { display: flex; align-items: center; gap: 6px; }
.sx-part-name { flex: 1; font-weight: 750; padding: 6px 10px; font-size: 13.5px; }
.sx-part-items { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; align-items: center; }
.sx-finish { display: inline-flex; align-items: center; gap: 6px; padding: 4px 4px 4px 8px; border-radius: var(--pill); border: 1px solid var(--line-2); font-size: 12.5px; font-weight: 650; background: var(--surface); }
.sx-finish .dot { width: 14px; height: 14px; }
.sx-finish button { border: 0; background: transparent; font-size: 16px; line-height: 1; padding: 0 4px; color: var(--ink-3); cursor: pointer; }
.sx-part-note { width: 100%; padding: 6px 10px; font-size: 12.5px; }
.sx-combos { margin-top: 12px; }
.sx-combos .sx-h { margin-bottom: 6px; }
.sx-combo { display: inline-flex; align-items: center; }
.sx-combo .chip { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.sx-combo-x { font: inherit; border: 1.5px solid var(--line-2); border-left: 0; border-radius: 0 var(--pill) var(--pill) 0; background: var(--surface-2); color: var(--ink-3); padding: 3px 8px; cursor: pointer; align-self: stretch; }
.sx-make { display: flex; flex-direction: column; gap: 12px; }
.sx-make-h { margin: 0 0 6px; font-size: 13px; font-weight: 750; }
.sx-make-h .sub, .sx-check .sub { display: block; font-size: 11.5px; font-weight: 500; color: var(--ink-3); }
.sx-make-h .sub { display: inline; margin-left: 4px; }
.sx-check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.sx-check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--dark); flex: none; }
.sx-check strong { font-size: 13.5px; }
.sx-make-time { margin-top: 10px; font-size: 12px; color: var(--ink-2); }
/* Simpler Develop (October 2026): a concept dropdown with a ⋯ menu, a
   one-row Follow it control, small text links, one row of outputs and a
   collapsed More Options. */
.sx-dv-concept { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.sx-dv-concept select { flex: 1 1 180px; min-width: 0; font-weight: 700; }
.sx-dv-start select { width: auto; max-width: 260px; }
.sx-menu-wrap { position: relative; display: inline-flex; }
.sx-dots { font: inherit; font-size: 18px; font-weight: 800; line-height: 1; width: 36px; height: 36px; border-radius: 50%; border: 1.5px solid var(--line-2); background: var(--surface-2); color: var(--ink); cursor: pointer; }
.sx-dots:hover, .sx-dots[aria-expanded="true"] { border-color: var(--ink); }
.sx-dv-menu { min-width: 180px; }
.sx-link { font: inherit; font-size: 12.5px; font-weight: 700; padding: 2px 0; border: 0; background: none; color: var(--ink); text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; cursor: pointer; }
.sx-link:hover { text-decoration-color: var(--ink); }
.sx-link.quiet { color: var(--ink-3); font-weight: 600; }
.sx-link[hidden] { display: none; }
.sx-dv-links { display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: center; margin-top: 8px; }
.sx-follow { margin-top: 12px; }
.sx-follow[hidden] { display: none; }
.sx-follow-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sx-follow-l { font-size: 13px; font-weight: 750; }
.sx-follow-hint { margin: 6px 0 0; }
.sx-kind { padding: 6px 8px; font-size: 12.5px; width: auto; max-width: 100%; }
.sx-round-label { margin: 0 0 8px; }
.sx-part-head .pill-link { flex: none; }
.sx-part-note { margin-top: 8px; }
.sx-part-items + .sx-part-note { margin-top: 0; }
.sx-make-main { margin-bottom: 0; }
.sx-dv-more { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 10px; }
.sx-dv-more summary { cursor: pointer; font-size: 13px; font-weight: 750; list-style: none; }
.sx-dv-more summary::-webkit-details-marker { display: none; }
.sx-dv-more summary::before { content: "▸"; display: inline-block; width: 14px; transition: transform 0.15s; }
.sx-dv-more[open] summary::before { transform: rotate(90deg); }
.sx-dv-more summary .sub { font-weight: 500; color: var(--ink-3); }
.sx-dv-more .sx-dv-h:first-of-type { margin-top: 10px; }
.sx-dv-h { margin-top: 14px; }
.cd-dims { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.concept-dialog .type-btn, .promote-dialog .type-btn { font: inherit; width: 100%; text-align: left; padding: 10px 12px; border-radius: var(--r-sm); border: 1.5px solid var(--line-2); background: var(--surface-2); cursor: pointer; }
.finish-picker { width: min(560px, calc(100vw - 24px)); }
.finish-picker .chip .dot { width: 14px; height: 14px; margin-right: 6px; vertical-align: -2px; }
.compare-dialog { width: min(980px, calc(100vw - 24px)); }
.cmp-pick { display: flex; align-items: center; gap: 10px; margin: 6px 0 14px; }
.cmp-pick select { width: auto; }
.cmp-grid { display: grid; grid-template-columns: minmax(90px, 0.6fr) 1fr 1fr; gap: 10px; align-items: center; max-height: 62vh; overflow-y: auto; }
.cmp-grid > strong { font-size: 13.5px; }
.cmp-label { font-size: 12.5px; font-weight: 750; color: var(--ink-2); }
.cmp-img { position: relative; aspect-ratio: 4 / 3; border: 0; padding: 0; border-radius: var(--r-sm); background: #fff center / contain no-repeat; cursor: zoom-in; box-shadow: inset 0 0 0 1px var(--line); }
.cmp-none { display: grid; place-items: center; aspect-ratio: 4 / 3; border-radius: var(--r-sm); border: 1.5px dashed var(--line-2); font-size: 12px; color: var(--ink-3); }
.rv-badge { position: absolute; top: 6px; right: 6px; font-size: 10.5px; font-weight: 800; padding: 3px 8px; border-radius: var(--pill); background: var(--lime); color: var(--ink); width: auto !important; }
.rv-badge.rejected { background: var(--error-bg); color: var(--error); }
.ip-item { position: relative; }
.ip-item[aria-pressed="true"] { border-color: var(--ink); box-shadow: 0 0 0 2px var(--lime); }
.ip-item .rv-badge { padding: 3px 8px; background: var(--lime); color: var(--ink); }
.ip-item .pp-num { width: 24px; padding: 0; background: var(--lime); color: var(--ink); text-align: center; }

/* The viewer: a cut-out's PNG, and the team's verdict on a Develop image. */
.lb-png { flex: none; }
.lb-png[hidden], .lb-review[hidden], .lb-png-note[hidden] { display: none; }
.lb-png-note { margin: 0; }
.lb-review { padding: 12px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); }
.lb-review-h { margin: 0 0 8px; font-size: 13px; font-weight: 750; }
.lb-review .chip.rv-approved[aria-pressed="true"] { background: var(--lime); border-color: var(--ink); color: var(--ink); }
.lb-review .chip.rv-rejected[aria-pressed="true"] { background: var(--error-bg); border-color: var(--error); color: var(--error); }
.lb-review-note { margin-top: 8px; padding: 7px 10px; font-size: 13px; }
.lb-review-by { margin: 6px 0 0; }
.lb-review-by:empty { display: none; }

/* The Library: concepts. */
.lib-link.concepts .lib-link-name::before { content: "✦"; display: inline-block; width: 10px; margin-right: 8px; font-size: 11px; }
.product-item.concept .name { display: flex; align-items: center; gap: 6px; }
.welcome-alt { margin: 14px 0 0; }
.welcome-alt a { color: inherit; font-weight: 750; }

/* Narrow panel: Develop and site controls stack. */
@container (max-width: 430px) {
  .sx-modes.three { grid-template-columns: minmax(0, 1fr); }
  .sx-sources.two { grid-template-columns: minmax(0, 1fr); }
  .sx-sets { grid-template-columns: minmax(0, 1fr); }
}

@container (max-width: 470px) {
  .sx-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-radius: 20px; }
  .sx-tabs button { border-radius: 16px; overflow: hidden; text-overflow: ellipsis; }
}
.site-only { display: none; }
.site-on .site-only { display: inline; }

/* --- Account: Your Logo -------------------------------------------------------- */
.logo-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 14px; }
.logo-box {
  width: 220px; height: 96px; display: grid; place-items: center; padding: 12px; border-radius: var(--r-sm);
  border: 1.5px dashed var(--line-2);
  background-color: #fff;
  background-image: conic-gradient(#eef0ee 25%, transparent 0 50%, #eef0ee 0 75%, transparent 0);
  background-size: 16px 16px;
}
.logo-box.has { border-style: solid; border-color: var(--line); }
.logo-box img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.logo-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.logo-h { margin: 18px 0 8px; font-size: 13.5px; font-weight: 750; }
#markMore[hidden], #markSize[hidden], .logo-h[hidden] { display: none; }
.mark-preview { margin-top: 16px; border-radius: var(--r-md); overflow: hidden; background: #e2e6e3; aspect-ratio: 900 / 672; }
.mark-preview[hidden] { display: none; }
.mark-preview img { display: block; width: 100%; height: 100%; object-fit: cover; }


/* ==========================================================================
   Spacing and touch (October 2026)
   Room between things that sat too close, and iPhone / iPad behaviour.
   Last in the file, so these win over the rules above.
   ========================================================================== */
/* Top bar: links never touch, with room before the credits pill. */
.appnav { gap: 8px; margin-right: 18px; }
@media (max-width: 1000px) { .appnav { gap: 6px; margin-right: 12px; } }
@media (max-width: 520px) { .appnav { gap: 6px; margin-right: 6px; } }
@media (max-width: 380px) { .appnav { gap: 2px; margin-right: 4px; } }

/* Studio: the tabs, and Custom Scene / My Site Photo. */
.sx-tabs { gap: 4px; }
.sx-seg { gap: 4px; }

/* Pill and chip rows: an even gap, including between wrapped lines. */
.chips { gap: 8px; }
.chips.sm { gap: 6px; }
.sx-ref-add { gap: 8px; }
.sx-dv-links { gap: 6px 18px; }

/* Library: side links apart; on narrow screens the row swipes, with room at
   the end and a fade that says there's more. */
.lib-nav { gap: 6px; }
@media (max-width: 860px) {
  .lib-nav {
    gap: 8px; padding-right: 32px; scroll-padding-right: 32px;
    -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent);
    mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent);
  }
}

/* A heading's grey note goes under it on phones, instead of breaking beside it. */
@media (max-width: 560px) {
  .sx-h, .c-title { flex-wrap: wrap; row-gap: 3px; }
  .sx-h .sub, .c-title .sub { flex-basis: 100%; }
  .c-title .sub { padding-left: 30px; }
}
/* A step title written as a label (Freestyle's "Describe the Image") sits
   on the same line as its number. */
.c-title label { display: inline; margin: 0; font: inherit; }
/* "+ PNG" stays together. */
.place .png-tag { white-space: nowrap; }

/* Page titles have room under the top bar on phones. */
@media (max-width: 700px) { .app-main { padding-top: 22px; } }

/* Gallery on tablets: search on its own line, the filters in one tidy row,
   and two images per row. */
@media (max-width: 980px) and (min-width: 701px) {
  .gl-search { flex: 1 1 100%; }
  .gl-bar .img-filter { flex: 1 1 150px; }
  .gl-bar .img-filter select, .gl-bar .img-filter input { max-width: none; width: 100%; min-width: 0; }
  .gl-sort { margin-left: 0; }
  .masonry { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* iPhone Safari: full-height areas use the height actually on screen, so
   the address bar never hides the Create button or the viewer's bottom. */
@supports (height: 100dvh) {
  .composer, .sx-resize { height: calc(100dvh - 100px); }
  .lb-stage img, .lb-frame { max-height: calc(100dvh - 56px); }
  dialog.type-picker, dialog.options-dialog { max-height: calc(100dvh - 40px); }
  dialog.product-picker { max-height: calc(100dvh - 48px); }
}
@media (max-width: 980px) { .sx .composer { height: auto; } }
/* Clear of the home indicator where the page reaches the bottom edge. */
.lb-side { padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px)); }
@media (max-width: 980px) { .sx .composer-foot { padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px)); } }

/* Touch screens (iPhone, iPad). */
@media (hover: none) and (pointer: coarse) {
  /* Under 16px, iPhone zooms the page in when a box is tapped. */
  input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="search"], select, textarea { font-size: 16px !important; }
  /* Small buttons get a bigger invisible tap area, without looking bigger. */
  .pill-link.sm, .chips.sm .chip, .sx-link, .st-x, .sx-sup-x, .sx-combo-x { position: relative; }
  .pill-link.sm::after, .chips.sm .chip::after, .sx-link::after, .st-x::after, .sx-sup-x::after, .sx-combo-x::after { content: ""; position: absolute; inset: -8px -4px; }
  /* The Studio's divider is easy to grab with a finger. */
  .sx-resize span { height: 64px; background: var(--ink-3); }
}
/* Hold to See the Original: no iPhone press-and-hold menu or magnifier. */
.lb-compare { -webkit-touch-callout: none; }

/* Elevate → Place Product: Create New's products and options, moved in. */
#placeSlot[hidden], #editOptional[hidden], #editNote[hidden] { display: none; }
.sx-place-options { margin-top: 6px; }
.sx-place-options > .c-title { margin-bottom: 4px; }
#editPane .sx-site-box { margin-top: 12px; }


/* --- Place Product: a spot per product; Colours & Finishes from standards ------------ */
.sx-site-who { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 10px; }
.sx-site-who .v-label { margin: 0 4px 0 0; }
.sx-site-who .chip { display: inline-flex; align-items: center; gap: 6px; padding-left: 6px; white-space: nowrap; }
.sx-site-who .member-letter { width: 22px; height: 22px; font-size: 12px; }
.sx-site-who .chip.has-spot .member-letter { background: #ff1a1a; color: #fff; }
.sx-who-x { display: inline-grid; place-items: center; width: 20px; height: 20px; margin-right: -4px; border-radius: 50%; font-size: 15px; line-height: 1; opacity: 0.7; }
.sx-who-x:hover { opacity: 1; background: rgba(0, 0, 0, 0.08); }
.sx-site-dot.lettered::after { content: attr(data-letter); width: auto; height: auto; margin: 0; left: 50%; top: 50%; transform: translate(-50%, -50%); background: none; color: #fff; font: 800 13px/1 var(--font); text-shadow: 0 0 3px rgba(0, 0, 0, 0.6); }
.sx-site-dot.lettered { width: 34px; height: 34px; margin: -17px 0 0 -17px; background: rgba(255, 26, 26, 0.55); }
.sx-site-dot.lettered.on { box-shadow: 0 0 0 2px #fff, 0 0 0 5px var(--lime), 0 2px 8px rgba(0, 0, 0, 0.35); }
.sx-std { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 10px; }
.sx-std .small { margin: 0; }
dialog.standards-dialog { width: min(600px, calc(100vw - 32px)); max-height: calc(100dvh - 48px); overflow-y: auto; }
.sd-groups { margin: 14px 0 6px; display: grid; gap: 14px; }
.sd-group .v-label { margin: 0 0 6px; }
.sd-group .chip .dot { margin-right: 6px; }
.sd-new { margin-top: 6px; }

/* --- Accounts you set up (Admin), Request Access, the welcome page ------------------ */
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.welcome-h { font-size: 20px; letter-spacing: -0.02em; margin: 0 0 6px; }
.email-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.email-form { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.email-form-h { font-size: 16px; margin: 0 0 6px; }
.email-form-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; flex-wrap: wrap; }
.setup-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.setup-grid label { margin-top: 12px; }
.pw-row { display: flex; gap: 8px; align-items: center; }
.pw-row input { flex: 1 1 auto; min-width: 0; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: 0.01em; }
.su-logo { display: flex; gap: 14px; align-items: center; margin-top: 16px; flex-wrap: wrap; }
.su-logo-box { width: 132px; height: 64px; flex: none; display: grid; place-items: center; border-radius: var(--r-sm); background: repeating-conic-gradient(#eef0ee 0 25%, #fff 0 50%) 0 0 / 14px 14px; border: 1px solid var(--line); overflow: hidden; }
.su-logo-box img { max-width: 88%; max-height: 80%; object-fit: contain; }
.setup-form .btn-primary[type=submit] { margin-top: 18px; }
.welcome-msg { margin: 0 0 12px; padding: 14px 16px; border-radius: var(--r-sm); background: #fff; color: var(--ink); font: 13.5px/1.55 var(--font); white-space: pre-wrap; word-break: break-word; max-height: 300px; overflow: auto; }
.invite-result .copy-row { flex-wrap: wrap; }
.co-name { display: inline-flex; align-items: center; gap: 8px; }
.co-logo { width: 44px; height: 24px; object-fit: contain; border-radius: 4px; background: repeating-conic-gradient(#eef0ee 0 25%, #fff 0 50%) 0 0 / 8px 8px; }
.row-faded td { color: var(--ink-3); }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; align-items: center; flex-wrap: wrap; }
td.row-actions { display: table-cell; white-space: normal; min-width: 200px; }
td.row-actions > * { margin-top: 2px; margin-bottom: 2px; }
td.row-actions > * + * { margin-left: 6px; }
td.row-actions .tag { margin-right: 4px; }
.dialog-actions.wrap { flex-wrap: wrap; }
dialog.message-dialog { width: min(560px, calc(100vw - 32px)); }
dialog.account-dialog label { display: block; margin-top: 12px; }
@media (max-width: 640px) {
  .setup-grid { grid-template-columns: minmax(0, 1fr); }
}
