/* Padigo — the parent brand of KITCHEN, COOKBOOK, DASHBOARD, COUNTER and CHAT.
   The one design language all five apps share: colours, type, radii, focus, the Padigo wordmark, the "Padigo / APP" lockup and
   the switcher between apps. Each app's build puts this file FIRST, then its own CSS, which builds on these tokens.
   Components (brand.jsx): <Wordmark/>, <Lockup app="Kitchen"/>, <AppSwitcher/>, <PlatformLinks/>. Fonts: brand-head.mjs. */

:root {
  /* brand */
  --pd-green: #0f6b4f;          /* Padigo green: primary actions, links, the app name in the lockup */
  --pd-green-strong: #0b573f;   /* hover / pressed */
  --pd-green-soft: #e8f4ee;     /* selected rows, info notes, chips */
  --pd-green-line: #b9dccb;
  --pd-green-ink: #0a4433;      /* text on --pd-green-soft */
  --pd-marigold: #f0a020;       /* the wordmark's dot; small highlights only, never text on white */
  --pd-ink: #11201a;            /* sidebars and dark surfaces */
  --pd-ink-2: #1a2c25;
  --pd-ink-3: #233a31;
  --pd-ink-text: #c6d3cd;
  --pd-ink-muted: #8a9b94;
  --pd-ink-accent: #8fd8b6;     /* the app name and links on --pd-ink */

  /* neutrals */
  --pd-paper: #f7f7f4;
  --pd-panel: #ffffff;
  --pd-line: #e3e6e1;
  --pd-line-strong: #c9cec7;
  --pd-text: #17201c;
  --pd-muted: #64706a;

  /* meaning */
  --pd-success: #2b8a3e; --pd-success-soft: #ebfbee;
  --pd-warning: #b35c00; --pd-warning-soft: #fff4e6;
  --pd-danger: #d0352b;  --pd-danger-soft: #fff3f2;
  --pd-info: #1f5fa8;    --pd-info-soft: #eaf2fc;

  /* shape and type */
  --pd-radius-sm: 6px; --pd-radius: 8px; --pd-radius-lg: 12px; --pd-radius-xl: 16px;
  --pd-shadow: 0 1px 2px rgba(17, 32, 26, .05), 0 12px 32px -16px rgba(17, 32, 26, .22);
  --pd-shadow-pop: 0 18px 44px -18px rgba(17, 32, 26, .38);
  --pd-font-ui: Inter, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --pd-font-brand: 'Bricolage Grotesque', var(--pd-font-ui);
  --pd-focus: 0 0 0 3px color-mix(in srgb, var(--pd-green) 32%, transparent);

  /* the names every app's CSS already uses, pointed at the brand */
  --bg: var(--pd-paper); --panel: var(--pd-panel); --line: var(--pd-line); --text: var(--pd-text); --muted: var(--pd-muted);
  --accent: var(--pd-green); --accent-strong: var(--pd-green-strong); --accent-soft: var(--pd-green-soft);
  --accent-line: var(--pd-green-line); --accent-ink: var(--pd-green-ink); --danger: var(--pd-danger);
  --side: var(--pd-ink); --side-2: var(--pd-ink-2); --side-3: var(--pd-ink-3); --side-text: var(--pd-ink-text);
  --side-muted: var(--pd-ink-muted); --side-link: var(--pd-ink-accent);
}

/* keyboard focus looks the same everywhere */
:focus-visible { outline: none; box-shadow: var(--pd-focus); }
a:focus-visible, button:focus-visible { border-radius: var(--pd-radius-sm); }

/* ---------- the wordmark ----------
   Bricolage Grotesque ExtraBold at its display optical size, set tight. The i is dotless and wears a marigold dot instead:
   that dot is the one signature detail (there is no logo yet). Screen readers hear "Padigo". */
.pd-wordmark {
  display: inline-block; font-family: var(--pd-font-brand); font-weight: 800; font-size: 22px; line-height: 1;
  letter-spacing: -.03em; font-variation-settings: 'opsz' 96; font-kerning: normal; color: inherit; white-space: nowrap;
}
.pd-wordmark .pd-P { margin-right: -.02em; }          /* close the P–a gap the bowl leaves */
/* the i gets a little air on both sides, so the dot reads as its own mark between d and g */
.pd-wordmark .pd-i { position: relative; display: inline-block; letter-spacing: 0; margin: 0 .005em 0 .015em; }
.pd-wordmark .pd-i::after {
  content: ''; position: absolute; left: 50%; top: var(--pd-dot-top, .09em); width: .19em; height: .19em; transform: translateX(-50%);
  border-radius: 50%; background: var(--pd-marigold);
}

/* ---------- Padigo / APP ---------- */
.pd-lockup {
  display: inline-flex; align-items: baseline; gap: .5em; min-width: 0; color: var(--pd-text); text-decoration: none; white-space: nowrap;
}
.pd-lockup .pd-wordmark { font-size: 21px; }
.pd-sep { font-family: var(--pd-font-ui); font-weight: 300; font-size: 17px; color: var(--pd-line-strong); transform: translateY(-.02em); }
.pd-app {
  font-family: var(--pd-font-ui); font-size: 11px; font-weight: 700; letter-spacing: .17em; text-transform: uppercase; color: var(--pd-green);
}
.pd-lockup.sm .pd-wordmark { font-size: 18px; }
.pd-lockup.sm .pd-sep { font-size: 15px; }
.pd-lockup.sm .pd-app { font-size: 10px; letter-spacing: .15em; }
.pd-lockup.lg .pd-wordmark { font-size: 28px; }
.pd-lockup.lg .pd-sep { font-size: 22px; }
.pd-lockup.lg .pd-app { font-size: 12.5px; }
.pd-on-dark .pd-lockup, .pd-lockup.pd-on-dark { color: #fff; }
.pd-on-dark .pd-sep { color: rgba(255, 255, 255, .3); }
.pd-on-dark .pd-app { color: var(--pd-ink-accent); }
a.pd-lockup:hover .pd-app { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- moving between the apps ---------- */
.pd-switch { position: relative; display: inline-flex; }
.pd-switch-btn {
  display: inline-grid; place-items: center; width: 32px; height: 32px; padding: 0; border-radius: var(--pd-radius);
  border: 1px solid transparent; background: transparent; color: var(--pd-muted); cursor: pointer;
}
.pd-switch-btn:hover, .pd-switch-btn[aria-expanded='true'] { background: color-mix(in srgb, var(--pd-text) 6%, transparent); color: var(--pd-text); }
.pd-on-dark .pd-switch-btn { color: var(--pd-ink-muted); }
.pd-on-dark .pd-switch-btn:hover, .pd-on-dark .pd-switch-btn[aria-expanded='true'] { background: var(--pd-ink-2); color: #fff; }
.pd-switch-btn svg { width: 16px; height: 16px; }
.pd-switch-menu {
  position: absolute; z-index: 300; top: calc(100% + 6px); left: 0; width: 270px; padding: 6px; background: var(--pd-panel);
  border: 1px solid var(--pd-line); border-radius: var(--pd-radius-lg); box-shadow: var(--pd-shadow-pop); display: flex; flex-direction: column;
  font-family: var(--pd-font-ui); font-size: 14px; text-align: left;
}
.pd-switch-menu.right { left: auto; right: 0; }
.pd-switch-head { display: flex; align-items: baseline; justify-content: space-between; padding: 8px 10px 10px; border-bottom: 1px solid var(--pd-line); margin-bottom: 4px; color: var(--pd-text); }
.pd-switch-head .pd-wordmark { font-size: 18px; }
.pd-switch-head small { color: var(--pd-muted); font-size: 11.5px; }
.pd-switch-menu a {
  display: grid; grid-template-columns: 1fr auto; gap: 1px 8px; padding: 8px 10px; border-radius: var(--pd-radius); color: var(--pd-text); text-decoration: none;
}
.pd-switch-menu a:hover { background: var(--pd-green-soft); }
.pd-switch-menu a[aria-current='page'] { background: color-mix(in srgb, var(--pd-text) 5%, transparent); }
.pd-switch-menu .pd-app { grid-column: 1; }
.pd-switch-menu .what { grid-column: 1; font-size: 12.5px; color: var(--pd-muted); }
.pd-switch-menu .here { grid-column: 2; grid-row: 1 / span 2; align-self: center; font-size: 11px; color: var(--pd-muted); }

/* in a dark sidebar: the other apps as a list */
.pd-platforms { display: flex; flex-direction: column; gap: 2px; }
.pd-platforms .side-title { display: flex; align-items: baseline; gap: 6px; }
.side-group.pd-platforms a { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 7px 10px; border-radius: var(--pd-radius); color: var(--side-text); text-decoration: none; }
.side-group.pd-platforms a:hover { background: var(--side-2); color: #fff; }
.pd-platforms a .pd-app { color: inherit; font-size: 10.5px; letter-spacing: .15em; }
.pd-platforms a .what { font-size: 12px; color: var(--side-muted); }
.pd-platforms a:hover .what { color: var(--side-text); }

@media (max-width: 760px) {
  /* tight top bars on a phone: smaller, but both names stay (which app this is matters most on a small screen) */
  .pd-lockup.collapse { gap: .35em; }
  .pd-lockup.collapse .pd-wordmark { font-size: 16px; }
  .pd-lockup.collapse .pd-sep { font-size: 13px; }
  .pd-lockup.collapse .pd-app { font-size: 9px; letter-spacing: .12em; }
  .pd-switch-menu { position: fixed; left: 12px; right: 12px; top: 56px; width: auto; }
}

/* Shared by Kitchen and the Dashboard. Uses each app's --bg --panel --line --text --muted --accent --danger. */
.theme-list { display: flex; flex-direction: column; gap: 10px; }
.theme-subhead { margin: 14px 0 2px; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.theme-card { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px 16px; padding: 14px 16px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
.theme-card.is-live { border-color: color-mix(in srgb, #2b8a3e 45%, var(--line)); }
.theme-list:not(.compact) .theme-card.is-live { grid-template-columns: 260px 1fr auto; }
.theme-preview { display: block; width: 260px; height: 170px; overflow: hidden; border-radius: 8px; border: 1px solid var(--line);
  background: var(--bg); position: relative; }
.theme-preview iframe { width: 1280px; height: 836px; border: 0; transform: scale(.203); transform-origin: 0 0; pointer-events: none; }
.theme-main { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.theme-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.theme-title b { font-size: 15px; }
.theme-actions { display: flex; align-items: center; gap: 8px; }
.pill { font-size: 11.5px; padding: 3px 8px; border-radius: 99px; background: #f1f3f5; color: var(--muted); font-weight: 600; white-space: nowrap; }
.pill.live { background: #ebfbee; color: #2b8a3e; }
.menu-wrap { position: relative; }
.icon-btn { width: 34px; height: 34px; padding: 0; border-radius: 8px; font-size: 18px; line-height: 1; }
.menu-wrap .menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 50; min-width: 180px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 16px 40px -16px rgba(0,0,0,.3); padding: 6px; display: flex; flex-direction: column; }
.menu-wrap .menu a, .menu-wrap .menu button { text-align: left; padding: 8px 10px; border: 0; border-radius: 6px; background: none;
  color: var(--text); text-decoration: none; font: inherit; cursor: pointer; }
.menu-wrap .menu a:hover, .menu-wrap .menu button:hover { background: var(--bg); }
.menu-wrap .menu .danger { color: var(--danger); }
.add-theme { align-self: flex-start; border: 1px dashed #c5cad6; background: none; color: var(--accent); border-radius: 10px; padding: 9px 14px; font-weight: 500; }
.add-theme-form { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
.add-theme-form label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 500; }
.note.info { background: var(--accent-soft); color: var(--accent-ink); }
.theme-chip { display: inline-flex; align-items: center; gap: 6px; margin-left: 10px; padding: 3px 4px 3px 10px; border-radius: 99px;
  background: var(--bg); border: 1px solid var(--line); font-weight: 500; font-size: 12.5px; }
@media (max-width: 760px) {
  .theme-card, .theme-list:not(.compact) .theme-card.is-live { grid-template-columns: 1fr; }
  .theme-preview { width: 100%; height: 190px; }
  .theme-preview iframe { transform: scale(calc(100vw / 1400)); }
  .theme-actions { justify-content: flex-start; }
}

/* media library + picker */
.media-lib { display: flex; flex-direction: column; gap: 12px; position: relative; }
.media-lib.dragging::after { content: 'Drop to upload'; position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; border: 2px dashed var(--accent);
  border-radius: 12px; background: color-mix(in srgb, var(--accent) 8%, transparent); color: var(--accent); font-weight: 600; }
.media-toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.media-toolbar .seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.media-toolbar .seg button { border: 0; border-radius: 0; padding: 7px 12px; background: var(--panel); }
.media-toolbar .seg button.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.media-search { flex: 1; min-width: 140px; width: auto; }
.media-body { display: grid; grid-template-columns: 1fr; gap: 14px; align-items: start; }
.media-lib:not(.compact) .media-body:has(.media-detail) { grid-template-columns: 1fr 300px; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.media-lib.compact .media-grid { max-height: 52vh; overflow: auto; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); padding: 2px; }
.media-tile { position: relative; aspect-ratio: 1; padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: #f1f3f5; cursor: pointer; }
.media-tile.on { outline: 2px solid var(--accent); outline-offset: 1px; }
.media-tile:hover { border-color: var(--accent); }
.media-tile img, .media-tile video { width: 100%; height: 100%; object-fit: cover; display: block; }
.media-kind { position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; border-radius: 99px; display: grid; place-items: center; font-size: 11px;
  background: rgba(0,0,0,.6); color: #fff; }
.media-name { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 7px 5px; font-size: 11px; color: #fff; text-align: left;
  background: linear-gradient(transparent, rgba(0,0,0,.6)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.media-empty { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 40px 16px; border: 1.5px dashed #cfd4de; border-radius: 12px; text-align: center; }
.media-detail { display: flex; flex-direction: column; gap: 10px; padding: 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; position: sticky; top: 16px; }
.media-detail label { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; font-weight: 500; }
.media-preview { border-radius: 8px; overflow: hidden; background: #f1f3f5; }
.media-preview img, .media-preview video { width: 100%; display: block; max-height: 240px; object-fit: contain; }
.media-title { overflow-wrap: anywhere; }
.copy-row { display: flex; gap: 6px; } .copy-row input { flex: 1; min-width: 0; font-size: 12px; }
.modal-back { position: fixed; inset: 0; z-index: 200; background: rgba(15,17,22,.5); display: grid; place-items: center; padding: 16px; }
.modal { width: min(860px, 100%); max-height: calc(100dvh - 32px); overflow: auto; background: var(--panel); border-radius: 14px; padding: 16px;
  display: flex; flex-direction: column; gap: 12px; box-shadow: 0 30px 80px -30px rgba(0,0,0,.5); }
.modal-head { display: flex; align-items: center; justify-content: space-between; }
.modal-foot { display: flex; gap: 8px; align-items: center; border-top: 1px solid var(--line); padding-top: 12px; }
.modal-foot input { flex: 1; min-width: 0; }
.media-field { display: flex; gap: 8px; align-items: center; }
.media-field .thumb-lg { width: 54px; height: 54px; flex: none; border-radius: 8px; background: #f1f3f5 center / cover no-repeat; border: 1px solid var(--line); overflow: hidden; }
.media-field .thumb-lg video { width: 100%; height: 100%; object-fit: cover; }
.media-field input { flex: 1; min-width: 0; }
@media (max-width: 760px) {
  .media-lib:not(.compact) .media-body:has(.media-detail) { grid-template-columns: 1fr; }
  .media-grid { grid-template-columns: repeat(3, 1fr); }
}

/* Colours, type and the Padigo lockup come from brand.css (prepended by kitchen/build.mjs). */
:root { font-family: var(--pd-font-ui); font-size: 14px; color: var(--text); }
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); }
button, input, select, textarea { font: inherit; }
button { border: 1px solid var(--line); background: #fff; border-radius: 6px; padding: 6px 10px; cursor: pointer; }
button:hover { border-color: #c5cad6; }
button.primary { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 600; padding: 7px 16px; }
button.primary:hover:not(:disabled) { background: var(--accent-strong); border-color: var(--accent-strong); }
button.primary:disabled { opacity: .6; }
button.danger { color: var(--danger); }
button.link { border: 0; background: none; color: var(--accent); padding: 4px; }
input, select, textarea { border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; width: 100%; background: #fff; }
input[type=checkbox] { width: auto; }
code { font-family: ui-monospace, monospace; font-size: 12px; }
.muted { color: var(--muted); } .small { font-size: 12px; }
.boot { padding: 40px; color: var(--muted); }

.app { height: 100vh; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 8px 14px; background: var(--panel); border-bottom: 1px solid var(--line); }
.topbar select { width: auto; }
.topbar-brand { display: inline-flex; align-items: center; gap: 2px; flex: none; }
.store-name { font-weight: 600; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.seg button { border: 0; border-radius: 0; }
.seg button.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.save { font-size: 12px; color: var(--muted); min-width: 60px; }
.save.unsaved, .save.saving { color: #e67700; } .save.error { color: var(--danger); }
.banner { padding: 8px 14px; font-size: 13px; }
.banner.ok { background: #ebfbee; color: #2b8a3e; } .banner.err { background: #fff5f5; color: var(--danger); white-space: pre-wrap; }

.main { flex: 1; display: grid; min-height: 0; }
.left, .right { background: var(--panel); overflow: auto; }
.left { border-right: 1px solid var(--line); } .right { border-left: 1px solid var(--line); padding: 14px; }
.canvas { display: flex; flex-direction: column; padding: 14px; min-width: 0; }
.canvas iframe { border: 1px solid var(--line); border-radius: 8px; background: #fff; box-shadow: 0 2px 10px rgba(0,0,0,.04); }

.tabs { display: flex; border-bottom: 1px solid var(--line); }
.tabs button { flex: 1; border: 0; border-radius: 0; padding: 10px; text-transform: capitalize; background: none; color: var(--muted); }
.tabs button.on { color: var(--accent); box-shadow: inset 0 -2px var(--accent); font-weight: 600; }
.panel { padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.panel h4 { margin: 8px 0 2px; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; justify-content: space-between; padding: 8px; border-radius: 6px; cursor: pointer; }
.list li:hover { background: var(--bg); } .list li.on { background: var(--accent-soft); color: var(--accent); }
.lib-item { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); gap: 8px; }
.prod { border-bottom: 1px solid var(--line); padding-bottom: 8px; display: flex; flex-direction: column; gap: 6px; }
.prod label { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); }

.form { display: flex; flex-direction: column; gap: 10px; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field.boolean { flex-direction: row-reverse; justify-content: flex-end; align-items: center; gap: 8px; }
.field label { font-size: 12px; color: var(--muted); }
.row { display: flex; gap: 6px; margin: 10px 0; }
.insp-head { display: flex; justify-content: space-between; align-items: flex-start; }
.insp-title { font-weight: 600; font-size: 15px; margin-bottom: 2px; }
.swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.swatches button.on { border-color: var(--accent); color: var(--accent); font-weight: 600; }

/* ---- v2 controls */
.main { grid-template-columns: 280px 1fr 320px; }
.canvas { background: #eef0f4; }
.stage { flex: 1; display: flex; justify-content: center; min-height: 0; overflow: auto; }
.stage iframe { height: 100%; flex: none; max-width: 100%; transition: width .25s ease; }
.stage iframe.framed { border-radius: 22px; border: 8px solid #1c1f26; box-shadow: 0 20px 50px -20px rgba(0,0,0,.35); }
.small { font-size: 12px; }
.hint { margin-top: 16px; line-height: 1.5; }
.small-tabs { margin: 4px -14px 14px; }
.small-tabs button { padding: 8px; }
.row { flex-wrap: wrap; }
.row > label { flex: 1; display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); min-width: 70px; }

.field.toggle { flex-direction: row; align-items: center; gap: 10px; cursor: pointer; font-size: 13px; color: var(--text); }
.field.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.switch { width: 32px; height: 18px; border-radius: 99px; background: #ced4da; position: relative; flex: none; transition: background .2s; }
.switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 99px; background: #fff; transition: transform .2s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.field.toggle input:checked + .switch { background: var(--accent); }
.field.toggle input:checked + .switch::after { transform: translateX(14px); }
.color-row, .image-row, .number-row, .link-row { display: flex; gap: 6px; align-items: center; }
.link-row { flex-direction: column; align-items: stretch; }
.color-row input[type=color] { width: 36px; height: 32px; padding: 2px; flex: none; }
.number-row input[type=range] { flex: 1; accent-color: var(--accent); padding: 0; border: 0; }
.number-row input[type=number] { width: 76px; flex: none; }
.thumb { width: 36px; height: 36px; border-radius: 6px; flex: none; background: #f1f3f5 center / cover no-repeat; border: 1px solid var(--line); }

.list-field { display: flex; flex-direction: column; gap: 6px; }
.list-item { border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.list-item.open { border-color: #c5cad6; }
.list-head { display: flex; align-items: center; gap: 6px; padding: 6px 8px; cursor: pointer; font-size: 13px; }
.list-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.caret { color: var(--muted); width: 10px; }
.list-actions button { border: 0; padding: 2px 6px; background: none; color: var(--muted); }
.list-actions button:hover { color: var(--text); background: var(--bg); }
.list-body { padding: 4px 10px 12px; border-top: 1px solid var(--line); }
.add-item { border-style: dashed; color: var(--accent); }

.presets { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.preset { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 10px; border-radius: 8px; text-transform: capitalize; font-weight: 600; }
.preset .dots { display: flex; gap: 3px; }
.preset .dots i { width: 14px; height: 14px; border-radius: 99px; border: 1px solid rgba(0,0,0,.1); }
.theme-group { border-top: 1px solid var(--line); padding-top: 8px; }
.theme-group summary, .add-page summary { cursor: pointer; font-weight: 600; padding: 4px 0 10px; }
.add-page { margin: 4px 0 8px; }
.add-page summary { color: var(--accent); font-weight: 500; }
.layers .list li { font-size: 13px; padding: 6px 8px; }
.layer-group { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 10px 0 2px; font-weight: 600; }
.lib-item .muted.small { margin-top: 2px; line-height: 1.4; }
.prod { border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; }
.prod summary { display: flex; align-items: center; gap: 10px; cursor: pointer; list-style: none; }
.prod-name { display: flex; flex-direction: column; font-size: 13px; }
.prod .form { padding-top: 10px; }
.new-product { border-top: 1px solid var(--line); padding-top: 10px; }

/* ---- dependencies */
.banner.info { background: var(--accent-soft); color: var(--accent-ink); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.banner.info code { background: #fff; padding: 2px 6px; border-radius: 4px; }
.library-link { display: flex; flex-direction: column; gap: 2px; padding: 12px; border-radius: 10px; text-decoration: none; color: var(--text);
  background: linear-gradient(135deg, var(--accent-soft), #fff6e3); border: 1px solid var(--accent-soft); }
.library-link b { color: var(--accent); }
.library-link span { font-size: 12px; color: var(--muted); }
.import-box { display: flex; flex-direction: column; gap: 6px; }
.import-box label { font-size: 12px; color: var(--muted); }
.import-box textarea { font-family: ui-monospace, monospace; font-size: 12px; resize: vertical; }
.import-result { display: flex; flex-direction: column; gap: 6px; padding: 10px; border-radius: 8px; background: var(--bg); font-size: 12.5px; }
.import-result .ok { color: #2b8a3e; } .import-result .err, .err { color: var(--danger); }
.tpl-offer { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.dep { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin-bottom: 6px; background: #fff; }
.dep.on-page { border-color: var(--accent-line); }
.dep-main { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.dep-name { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.dep-name code { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag { font-style: normal; font-size: 10.5px; color: var(--accent); background: var(--accent-soft); padding: 1px 6px; border-radius: 99px; margin-left: 6px; }
.dep-more { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.dep-more .row { justify-content: space-between; align-items: center; margin: 0; }
.btn-link { color: var(--accent); font-size: 12.5px; text-decoration: none; }
button:disabled { opacity: .5; cursor: not-allowed; }
.main { grid-template-columns: 300px 1fr 320px; }
.left .tabs button { padding: 10px 4px; font-size: 13px; white-space: nowrap; }
.dep-name > span { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 6px; }
.tag { margin-left: 0; white-space: nowrap; }
.stage { position: relative; overflow: hidden; flex: 1; min-height: 0; }
.device { position: absolute; top: 0; left: 50%; transform-origin: top center; }
.device iframe { width: 100%; height: 100%; display: block; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.device.framed iframe { border: 8px solid #1c1f26; border-radius: 26px; box-shadow: 0 20px 50px -20px rgba(0,0,0,.35); }
.zoom { position: absolute; right: 10px; bottom: 10px; font-size: 11px; color: var(--muted); background: #fff; border: 1px solid var(--line); padding: 2px 6px; border-radius: 6px; }
.layer-block { border-radius: 8px; padding: 2px 4px; margin: 0 -4px; }
.layer-block.target { background: var(--accent-soft); }
.layer-group { display: flex; justify-content: space-between; align-items: center; }
.layer-group .link { text-transform: none; letter-spacing: 0; font-weight: 500; padding: 0; }

/* ================= responsive editor ================= */
.tools { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.tools .live-ver { margin-left: auto; }
/* the tool groups keep their size; on a narrower desktop the row scrolls instead of squeezing labels */
.tools { overflow-x: auto; scrollbar-width: none; }
.tools::-webkit-scrollbar { display: none; }
.tools > * { flex: none; }
.seg button { white-space: nowrap; }
@media (max-width: 1440px) { .topbar .store-name .ns { display: none; } }
.sheet-head, .bottombar, .drawer-toggle { display: none; }
.app { height: 100dvh; }

/* Tablet: left panel stays, the inspector becomes a drawer over the preview */
@media (max-width: 1100px) {
  .main { grid-template-columns: 280px 1fr; }
  .right { position: fixed; top: 0; right: 0; bottom: 0; width: min(380px, 92vw); z-index: 50; border-left: 1px solid var(--line);
    box-shadow: -20px 0 40px -20px rgba(0,0,0,.3); transform: translateX(105%); transition: transform .25s ease; }
  .app.sheet-right .right { transform: none; }
  .right .sheet-head { display: flex; margin: -14px -14px 12px; }
  .drawer-toggle { display: block; position: fixed; right: 14px; bottom: 14px; z-index: 40; padding: 10px 16px; border-radius: 999px;
    background: #1c1f26; color: #fff; border: 0; font-weight: 600; box-shadow: 0 8px 24px -8px rgba(0,0,0,.4); }
}
.sheet-head { align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); background: var(--panel);
  position: sticky; top: 0; z-index: 2; }
.sheet-head b { flex: 1; }
.sheet-close { border: 0; background: var(--bg); width: 32px; height: 32px; border-radius: 99px; padding: 0; }
.grip { display: none; }

/* Phone: the preview fills the screen; panels are bottom sheets opened from a tab bar */
@media (max-width: 760px) {
  .topbar { flex-wrap: wrap; gap: 8px; padding: 8px 10px; }
  .topbar .store-name { display: none; }
  .topbar select[data-testid=page-select] { flex: 1; min-width: 0; }
  .tools { order: 3; flex: 1 1 100%; overflow-x: auto; scrollbar-width: none; gap: 8px; padding-bottom: 2px; }
  .tools::-webkit-scrollbar { display: none; }
  .tools > * { flex: none; }
  .seg button { padding: 7px 10px; }
  .banner { font-size: 12.5px; }
  .main { grid-template-columns: 1fr; }
  .canvas { padding: 8px 8px 72px; }
  .left, .right { position: fixed; left: 0; right: 0; bottom: 0; top: auto; width: auto; height: min(68dvh, 620px); z-index: 50;
    border: 0; border-radius: 16px 16px 0 0; box-shadow: 0 -18px 40px -18px rgba(0,0,0,.35); transform: translateY(105%);
    transition: transform .25s ease; overflow: auto; }
  .app.sheet-left .left, .app.sheet-right .right { transform: none; }
  .right { padding: 0 14px 90px; }
  .left { padding-bottom: 76px; }
  .left .sheet-head, .right .sheet-head { display: flex; margin: 0 -14px 12px; padding-top: 18px; }
  .left .sheet-head { margin: 0; }
  .grip { display: block; position: absolute; top: 6px; left: 50%; width: 40px; height: 4px; margin-left: -20px; border-radius: 99px; background: #ced4da; }
  .left .tabs { display: none; }
  .drawer-toggle { display: none; }
  .bottombar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; height: 62px; background: var(--panel);
    border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
  .bottombar button { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    border: 0; border-radius: 0; background: none; font-size: 11px; color: var(--muted); }
  .bottombar button.on { color: var(--accent); font-weight: 600; }
  .bb-icon { font-size: 18px; line-height: 1; }
  input, select, textarea { font-size: 16px; } /* stops iOS zooming into fields */
  button { min-height: 34px; }
  .row button { flex: 1; }
  .presets { grid-template-columns: repeat(3, 1fr); }
}
.topbar { position: relative; z-index: 55; }
@media (max-width: 1100px) {
  .right { top: var(--topbar-h, 49px); }
  .tools { overflow-x: auto; scrollbar-width: none; }
  .tools::-webkit-scrollbar { display: none; }
  .tools > * { flex: none; }
  .topbar .store-name { display: none; }
}
@media (max-width: 760px) {
  .right { top: auto; }
}

/* ---------- account: sign in, home, user menu ---------- */
.landing h1, .landing h3, .auth-card h1, .home-main h2, .section-head h2, .empty-state h3 { font-family: var(--pd-font-brand); letter-spacing: -.02em; }
.landing-apps b { color: var(--text); }
.store-name .ns { font-weight: 400; margin-left: 6px; }
.note { padding: 9px 12px; border-radius: 8px; font-size: 13px; }
.note.ok { background: #ebfbee; color: #2b8a3e; } .note.err { background: #fff5f5; color: var(--danger); }
.note .token-value { display: block; margin-top: 8px; padding: 8px 10px; background: #fff; border-radius: 6px; word-break: break-all; user-select: all; color: var(--text); }
small.err { color: var(--danger); }
.at-input { display: flex; align-items: stretch; border: 1px solid var(--line); border-radius: 6px; background: #fff; overflow: hidden; }
.at-input > span { display: flex; align-items: center; padding: 0 2px 0 9px; color: var(--muted); }
.at-input input { border: 0; padding-left: 2px; min-width: 0; }
.at-input:focus-within { border-color: var(--accent); }

.auth { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px;
  background: radial-gradient(1200px 500px at 50% -10%, #dcefe5 0, transparent 70%), var(--bg); }
.auth-card { width: min(400px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 28px;
  display: flex; flex-direction: column; gap: 14px; box-shadow: 0 20px 50px -30px rgba(28,31,38,.35); }
.auth-card h1 { font-size: 22px; margin: 0; letter-spacing: -.01em; }
.auth-card label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 500; }
.auth-card label small { font-weight: 400; }
.auth-card button.primary { padding: 10px; font-size: 15px; }
.auth-logo { align-self: flex-start; }
.auth-links { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px; font-size: 13px; color: var(--muted); }
.google { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 8px;
  color: var(--text); text-decoration: none; font-weight: 500; }
.google:hover { background: var(--bg); }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--line); }

.user-menu { position: relative; }
.avatar { width: 32px; height: 32px; border-radius: 99px; padding: 0; background: #1c1f26; color: #fff; border: 0; font-weight: 600; }
.menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 100; min-width: 220px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; box-shadow: 0 16px 40px -16px rgba(0,0,0,.3); padding: 6px; display: flex; flex-direction: column; }
.menu-head { display: flex; flex-direction: column; padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.menu a, .menu button { text-align: left; padding: 8px 10px; border: 0; border-radius: 6px; background: none; color: var(--text); text-decoration: none; }
.menu a:hover, .menu button:hover { background: var(--bg); }

.home { min-height: 100dvh; }
.home-top { display: flex; align-items: center; gap: 18px; padding: 10px 20px; background: var(--panel); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20; }
.home-tabs { display: flex; gap: 4px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.home-tabs button { border: 0; background: none; color: var(--muted); padding: 7px 12px; border-radius: 7px; white-space: nowrap; }
.home-tabs button.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.home-main { max-width: 1040px; margin: 0 auto; padding: 28px 20px 60px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.section-head h2 { margin: 0; font-size: 22px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 18px; margin-bottom: 18px; display: flex; flex-direction: column; gap: 12px; }
.card h3 { margin: 0; }
.card label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 500; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row-end { display: flex; justify-content: flex-end; gap: 8px; }
.empty-state { text-align: center; padding: 48px 20px; border: 1px dashed #cfd4de; border-radius: 12px; background: var(--panel); }
.empty-state h3 { margin: 0 0 6px; }
.store-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.store-card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.store-card:hover { border-color: #c5cad6; }
.store-open { display: flex; gap: 12px; align-items: center; color: inherit; text-decoration: none; }
.store-open span:last-child { display: flex; flex-direction: column; min-width: 0; }
.store-open b { font-size: 15px; }
.store-initial { width: 40px; height: 40px; flex: none; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent);
  font-weight: 700; font-size: 17px; text-transform: uppercase; }
.store-initial.small { width: 32px; height: 32px; font-size: 14px; }
.store-meta { display: flex; align-items: center; justify-content: space-between; }
.pill { font-size: 11.5px; padding: 3px 8px; border-radius: 99px; background: #f1f3f5; color: var(--muted); font-weight: 600; }
.pill.live { background: #ebfbee; color: #2b8a3e; }
.store-actions { display: flex; align-items: center; justify-content: space-between; }
a.btn { border: 1px solid var(--line); border-radius: 6px; padding: 6px 12px; color: var(--text); text-decoration: none; }
a.btn:hover { border-color: #c5cad6; }
.ns-list, .token-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.ns-row { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; }
.ns-head { display: flex; gap: 12px; align-items: center; width: 100%; border: 0; background: none; text-align: left; padding: 12px 14px; }
.ns-head:disabled { cursor: default; color: inherit; }
.ns-head span:last-child { display: flex; flex-direction: column; }
.verified { display: inline-grid; place-items: center; width: 16px; height: 16px; margin-left: 6px; border-radius: 99px; background: var(--accent);
  color: #fff; font-size: 10px; vertical-align: 1px; }
.members { border-top: 1px solid var(--line); padding: 10px 14px 14px; display: flex; flex-direction: column; gap: 6px; }
.member { display: flex; align-items: center; gap: 10px; justify-content: space-between; padding: 6px 0; }
.member > span:first-child { flex: 1; min-width: 0; }
.member select { width: auto; }
.member.add { justify-content: flex-start; }
.member.add .at-input { flex: 1; }
.token-list .member { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; }
.token-new { display: flex; gap: 8px; margin: 14px 0; }
.token-new input { flex: 1; }
.link.danger { color: var(--danger); }
.boot h2 { color: var(--text); margin: 0 0 6px; }
@media (max-width: 760px) {
  .home-top { gap: 10px; padding: 8px 12px; }
  .home-main { padding: 18px 14px 40px; }
  .grid2 { grid-template-columns: 1fr; }
  .auth-card { padding: 22px 18px; }
  .member { flex-wrap: wrap; }
}
.seg button, .live-ver, .save { white-space: nowrap; }

/* ---------- products: fields, attributes, variants ---------- */
.seg.full { display: flex; } .seg.full button { flex: 1; }
.subsection { border-top: 1px solid var(--line); padding-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.subsection h4 { margin: 0; }
.checks { display: flex; flex-wrap: wrap; gap: 6px 12px; }
label.check { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text); }
.option-row { display: grid; grid-template-columns: 90px 1fr auto; gap: 6px; align-items: center; }
.row-actions { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
button.small-btn { padding: 5px 10px; font-size: 12.5px; }
table.variants { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.variants th { text-align: left; font-weight: 500; color: var(--muted); padding: 4px; }
table.variants td { padding: 3px 4px; border-top: 1px solid var(--line); }
table.variants td:first-child { white-space: nowrap; }
table.variants input { padding: 4px 6px; }
.fields-editor { display: flex; flex-direction: column; gap: 10px; }
.field-list { display: flex; flex-direction: column; gap: 6px; }
.field-item { border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.field-item.open { border-color: #c5cad6; }
.field-item > .form { padding: 0 10px 12px; }
.field-sum { display: flex; justify-content: space-between; align-items: center; gap: 8px; width: 100%; border: 0; background: none; padding: 9px 10px; text-align: left; }
input.invalid { border-color: var(--danger); }

/* ---------- landing ---------- */
.landing { min-height: 100dvh; background: radial-gradient(1200px 600px at 80% -10%, #dcefe5 0, transparent 60%), var(--bg); }
.landing-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; max-width: 1160px; margin: 0 auto; padding: 18px 20px; }
.landing-top nav { display: flex; align-items: center; gap: 18px; }
.landing-top nav a { color: var(--text); text-decoration: none; font-weight: 500; }
.landing-top .auth-logo { text-decoration: none; color: var(--text); }
a.btn.primary, a.btn.primary:hover { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 600; }
a.btn.big { padding: 12px 20px; font-size: 15px; border-radius: 10px; }
.landing-note { max-width: 1120px; margin: 0 auto; }
.landing-hero { max-width: 1160px; margin: 0 auto; padding: 56px 20px 40px; display: grid; grid-template-columns: 1.05fr 1fr; gap: 48px; align-items: center; }
.landing-hero .eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.landing-hero h1 { font-size: clamp(34px, 5vw, 58px); line-height: 1.05; letter-spacing: -.03em; margin: 12px 0 18px; }
.landing-hero .lead { font-size: 17px; line-height: 1.6; color: var(--muted); max-width: 520px; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 26px; }
.art-window { background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 40px 80px -40px rgba(28,31,38,.45); overflow: hidden; }
.art-bar { display: flex; gap: 6px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.art-bar i { width: 10px; height: 10px; border-radius: 99px; background: #e6e8ee; }
.art-body { display: grid; grid-template-columns: 70px 1fr 90px; min-height: 300px; }
.art-side, .art-panel { padding: 12px 10px; display: flex; flex-direction: column; gap: 8px; background: #fbfbfd; }
.art-side { border-right: 1px solid var(--line); } .art-panel { border-left: 1px solid var(--line); }
.art-side b, .art-panel b { height: 8px; border-radius: 4px; background: #e6e8ee; }
.art-side b.on { background: var(--accent); }
.art-panel .swatches { display: flex; gap: 4px; } .art-panel .swatches i { width: 14px; height: 14px; border-radius: 4px; background: #16161a; }
.art-panel .swatches i:nth-child(2) { background: #b4532a; } .art-panel .swatches i:nth-child(3) { background: #f5efe6; } .art-panel .swatches i:nth-child(4) { background: var(--accent); }
.art-page { padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.art-hero { height: 130px; border-radius: 8px; background: linear-gradient(135deg, #16161a, #3b3f4a); padding: 16px; display: flex; flex-direction: column; justify-content: flex-end; gap: 6px;
  box-shadow: inset 0 0 0 2px var(--accent); }
.art-hero span { height: 10px; width: 70%; border-radius: 5px; background: #fff; } .art-hero span.short { width: 45%; opacity: .6; }
.art-hero em { width: 60px; height: 16px; border-radius: 5px; background: #fff; margin-top: 4px; }
.art-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.art-grid i { aspect-ratio: 4 / 5; border-radius: 6px; background: #f1ece4; }
.landing-features { max-width: 1160px; margin: 0 auto; padding: 20px 20px 50px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.feature { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 18px; }
.feature h3 { margin: 0 0 6px; font-size: 16px; } .feature p { margin: 0; line-height: 1.55; }
.landing-foot { max-width: 1160px; margin: 0 auto; padding: 20px 20px 40px; border-top: 1px solid var(--line); }
.store-section { margin-top: 22px; display: flex; flex-direction: column; gap: 10px; }
.store-section-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.store-section-head > div { flex: 1; min-width: 0; }
@media (max-width: 900px) {
  .landing-hero { grid-template-columns: 1fr; padding-top: 24px; }
  .landing-features { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .landing-features { grid-template-columns: 1fr; }
  .landing-top nav a:not(.btn) { display: none; }
  .art-body { grid-template-columns: 1fr; } .art-side, .art-panel { display: none; }
}
.media-btn { flex: none; padding: 6px 10px; font-size: 12.5px; }
.thumb video { width: 100%; height: 100%; object-fit: cover; border-radius: 6px; }
.stat-line { font-size: 13px; }
.panel a.btn { text-align: center; justify-content: center; display: flex; }

/* route fields and field maps */
.route-hint { display: flex; flex-direction: column; gap: 3px; font-size: 12px; }
.route-fields { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.route-field { background: #e7f5ff; color: #1864ab; border-radius: 99px; padding: 1px 8px; font-size: 12px; margin-right: 4px; }
.fieldmap { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; display: flex; flex-direction: column; gap: 8px; margin: 0; }
.fieldmap legend { font-size: 12px; font-weight: 600; padding: 0 4px; }
