/* ==========================================================================
   Planner Studio — "Liquid Glass" interface
   ---------------------------------------------------------------------------
   How the interface is layered (this is the whole idea, nothing here is random):
     0  AMBIENT   a slow, soft colour field that takes its tint from the planner you are designing
     1  CONTENT   the planner on its device, the landing sections: solid, never glass
     2  GLASS     everything you operate: the settings sheet, the preview toolbars, the viewer
               bar, the contents drawer, menus, dialogs, toasts. Controls float above content.
   Rules: one blur recipe per level, concentric radii (sheet 30 → card 22 → control 14 → pill),
   a bright rim on the top-left edge and a hairline outside, light that follows the pointer,
   and spring feedback on touch. Colour comes from one tint (the accent), never from decoration.
   Loaded after app.css / ps-ui.css / platform.css so it re-skins the same markup.
   ========================================================================== */

/* ---------- tokens ---------- */
:root {
  --acc:#0b64d8; --acc-t:#0b64d8; --acc-h:#0953b5; --acc2:rgba(11,100,216,.13); --acc-ink:#fff; --good-t:#14803d;
  --g-over:rgba(255,255,255,.80);
  --panel:rgba(255,255,255,.72); --bg:#eef0f6; --ink:#16181d; --mut:#5d6370; --line:rgba(40,48,80,.12); --hover:rgba(255,255,255,.55); --field:rgba(255,255,255,.62);
  --amb1:#ffbfd5; --amb2:#b4d0ff; --amb3:#bdeed3; --amb4:#d9c5ff;
  --g-fill:rgba(255,255,255,.50); --g-fill-hi:rgba(255,255,255,.74); --g-fill-lo:rgba(255,255,255,.30);
  --g-rim:rgba(255,255,255,.92); --g-border:rgba(255,255,255,.62); --g-hair:rgba(38,48,92,.11);
  --g-shadow:0 1px 2px rgba(30,40,90,.06), 0 10px 34px rgba(30,40,90,.12), 0 28px 70px -20px rgba(30,40,90,.18);
  --g-blur:26px; --g-sat:185%;
  --r-sheet:30px; --r-card:22px; --r-ctl:14px;
  --spring:cubic-bezier(.34,1.46,.64,1); --glide:cubic-bezier(.22,.9,.2,1);
  --sh:var(--g-shadow);
}
:root[data-ui="dark"] {
  --acc:#0b6fe6; --acc-t:#7dbaff; --acc-h:#2f86f0; --acc2:rgba(60,150,255,.22); --good-t:#5fe08a;
  --g-over:rgba(26,29,40,.82);
  --panel:rgba(46,50,66,.72); --bg:#07080c; --ink:#f2f3f6; --mut:#a1a6b2; --line:rgba(255,255,255,.12); --hover:rgba(255,255,255,.08); --field:rgba(255,255,255,.075);
  --amb1:#3b2a9c; --amb2:#124a9a; --amb3:#0c6a6e; --amb4:#7a2a86;
  --g-fill:rgba(38,42,56,.46); --g-fill-hi:rgba(52,57,76,.62); --g-fill-lo:rgba(255,255,255,.05);
  --g-rim:rgba(255,255,255,.24); --g-border:rgba(255,255,255,.13); --g-hair:rgba(0,0,0,.5);
  --g-shadow:0 1px 2px rgba(0,0,0,.4), 0 14px 40px rgba(0,0,0,.45), 0 32px 80px -24px rgba(0,0,0,.6);
}
@media (prefers-color-scheme: dark) {
  :root[data-ui="auto"] {
    --acc:#0b6fe6; --acc-t:#7dbaff; --acc-h:#2f86f0; --acc2:rgba(60,150,255,.22); --good-t:#5fe08a; --g-over:rgba(26,29,40,.82);
    --panel:rgba(46,50,66,.72); --bg:#07080c; --ink:#f2f3f6; --mut:#a1a6b2; --line:rgba(255,255,255,.12); --hover:rgba(255,255,255,.08); --field:rgba(255,255,255,.075);
    --amb1:#3b2a9c; --amb2:#124a9a; --amb3:#0c6a6e; --amb4:#7a2a86;
    --g-fill:rgba(38,42,56,.46); --g-fill-hi:rgba(52,57,76,.62); --g-fill-lo:rgba(255,255,255,.05);
    --g-rim:rgba(255,255,255,.24); --g-border:rgba(255,255,255,.13); --g-hair:rgba(0,0,0,.5);
    --g-shadow:0 1px 2px rgba(0,0,0,.4), 0 14px 40px rgba(0,0,0,.45), 0 32px 80px -24px rgba(0,0,0,.6);
  }
}

/* ---------- 0 · ambient field ---------- */
body { background:var(--bg); }
body::before { content:''; position:fixed; inset:-12%; z-index:-1; pointer-events:none;
  background:
    radial-gradient(46% 42% at 12% 12%, var(--amb1), transparent 70%),
    radial-gradient(42% 46% at 92% 16%, var(--amb2), transparent 70%),
    radial-gradient(52% 50% at 78% 98%, var(--amb3), transparent 70%),
    radial-gradient(40% 40% at 6% 92%, var(--amb4), transparent 70%);
  animation:g-drift 48s ease-in-out infinite alternate; transition:filter .6s; }
@keyframes g-drift { 0% { transform:translate3d(0,0,0) scale(1); } 50% { transform:translate3d(2.5%,-2%,0) scale(1.06); } 100% { transform:translate3d(-2%,2.5%,0) scale(1.02); } }

/* ---------- glass recipe ---------- */
.panel, .pv-bar > *, .vbar, .outline, .vmini, dialog, .ps-dlg, .zmenu, .ps-menu, .ps-pop, .ps-toast, #toast, .vzbadge, .mk-hud, .pj-top, .nav, .ps-sheet {
  --mx:50%; --my:0%;
  background-color:var(--g-fill);
  background-image:radial-gradient(260px 180px at var(--mx) var(--my), rgba(255,255,255,.34), transparent 62%), linear-gradient(180deg, rgba(255,255,255,.26), rgba(255,255,255,0) 34%);
  -webkit-backdrop-filter:blur(var(--g-blur)) saturate(var(--g-sat)); backdrop-filter:blur(var(--g-blur)) saturate(var(--g-sat));
  border:1px solid var(--g-border);
  box-shadow:inset 0 1.5px 0 var(--g-rim), inset 1.5px 0 0 rgba(255,255,255,.28), inset 0 -1px 0 rgba(255,255,255,.1), 0 0 0 .5px var(--g-hair), var(--g-shadow);
}
:root[data-ui="dark"] .panel, :root[data-ui="dark"] .pv-bar > *, :root[data-ui="dark"] .vbar, :root[data-ui="dark"] .outline, :root[data-ui="dark"] .vmini, :root[data-ui="dark"] dialog, :root[data-ui="dark"] .ps-dlg, :root[data-ui="dark"] .zmenu, :root[data-ui="dark"] .ps-menu, :root[data-ui="dark"] .ps-pop, :root[data-ui="dark"] .nav { background-image:radial-gradient(260px 180px at var(--mx) var(--my), rgba(255,255,255,.12), transparent 62%), linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,0) 30%); }
@media (prefers-color-scheme: dark) { :root[data-ui="auto"] .panel, :root[data-ui="auto"] .pv-bar > *, :root[data-ui="auto"] .vbar, :root[data-ui="auto"] .outline, :root[data-ui="auto"] .vmini, :root[data-ui="auto"] dialog, :root[data-ui="auto"] .ps-dlg, :root[data-ui="auto"] .zmenu, :root[data-ui="auto"] .ps-menu, :root[data-ui="auto"] .ps-pop, :root[data-ui="auto"] .nav { background-image:radial-gradient(260px 180px at var(--mx) var(--my), rgba(255,255,255,.12), transparent 62%), linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,0) 30%); } }
@supports not ((backdrop-filter:blur(1px)) or (-webkit-backdrop-filter:blur(1px))) {
  .panel, .pv-bar > *, .vbar, .outline, .vmini, dialog, .ps-dlg, .zmenu, .ps-menu, .ps-pop, .ps-toast, #toast, .nav { background-color:var(--g-fill-hi); }
  :root[data-ui="dark"] .panel, :root[data-ui="dark"] dialog { background-color:#1b1d24; }
}

/* ======================================================================
   BUILDER — settings sheet (left) + canvas (right)
   ====================================================================== */
#builder { grid-template-columns:minmax(380px,430px) 1fr; gap:0; padding:14px 14px 14px 14px; }
.panel { border-radius:var(--r-sheet); overflow:hidden; border-right:1px solid var(--g-border); padding-left:0; height:100%; min-height:0; }
.brand { padding:16px 14px 10px 18px; gap:12px; }
.logo { width:38px; height:38px; gap:4px; filter:drop-shadow(0 4px 8px rgba(30,40,90,.18)); }
.logo i { border-radius:9px; box-shadow:inset 0 1px 0 rgba(255,255,255,.6); }
.brand h1 { font-size:18px; letter-spacing:-.02em; }
.brand p { font-size:12.5px; }
.presets { border-bottom:0; padding:2px 16px 10px; flex-wrap:nowrap; overflow-x:auto; scrollbar-width:none; -webkit-mask-image:linear-gradient(90deg,#000 88%,transparent); mask-image:linear-gradient(90deg,#000 88%,transparent); }
.presets::-webkit-scrollbar { display:none; }
.presets .chip { flex:none; }
.panel-scroll { padding:4px 0 18px; scrollbar-width:thin; scrollbar-color:rgba(120,125,140,.4) transparent; }
.panel-scroll::-webkit-scrollbar { width:10px; } .panel-scroll::-webkit-scrollbar-thumb { background:rgba(120,125,140,.35); border-radius:99px; border:3px solid transparent; background-clip:padding-box; }

/* the guest / project strip becomes an inset glass card */
.ps-bar { border-bottom:0; margin:2px 14px 10px; padding:10px 12px; border-radius:var(--r-card); background:var(--g-fill-lo); box-shadow:inset 0 1px 0 var(--g-rim), 0 0 0 .5px var(--g-hair); }
.ps-bar.guest { background:color-mix(in srgb,var(--acc) 10%,var(--g-fill-lo)); padding:12px 14px; }
.ps-guest > span:first-child { color:var(--acc); }

/* sections = grouped inset cards with a coloured icon tile (like Settings on iPad) */
details.sec-c { margin:0 14px 10px; border:0; border-radius:var(--r-card); background:var(--g-fill-lo); box-shadow:inset 0 1px 0 var(--g-rim), 0 0 0 .5px var(--g-hair); overflow:hidden; transition:background-color .25s; }
details.sec-c[open] { background:color-mix(in srgb,var(--g-fill-hi) 70%,transparent); }
details.sec-c > summary { padding:11px 14px 11px 12px; gap:12px; font-size:14px; font-weight:600; letter-spacing:-.005em; }
details.sec-c > summary::before { content:''; width:30px; height:30px; flex:none; border-radius:9px; font-size:0; transform:none !important;
  background:var(--ico, none) center/58% no-repeat, linear-gradient(145deg, var(--t1,#8e8e93), var(--t2,#636366)); box-shadow:inset 0 1px 0 rgba(255,255,255,.45), 0 2px 6px rgba(30,40,90,.18); transition:transform .3s var(--spring) !important; }
details.sec-c:hover > summary::before { transform:scale(1.07) !important; }
details.sec-c > summary::after { content:''; width:8px; height:8px; margin-left:8px; flex:none; border-right:2px solid var(--mut); border-bottom:2px solid var(--mut); transform:rotate(-45deg); transition:transform .3s var(--spring); opacity:.7; }
details.sec-c[open] > summary::after { transform:rotate(45deg); }
details.sec-c > summary small { margin-left:auto; font-size:12px; }
details.sec-c > summary:hover { background:rgba(255,255,255,.18); }
.sec-body { padding:2px 14px 16px; gap:15px; }
details[data-sec="pstyle"] { --t1:#ff9f0a; --t2:#ff375f; --ico:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linejoin='round'%3E%3Cpath d='M12 3l1.9 5.1L19 10l-5.1 1.9L12 17l-1.9-5.1L5 10l5.1-1.9z'/%3E%3C/svg%3E"); }
details[data-sec="basics"] { --t1:#64d2ff; --t2:#0a84ff; --ico:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M4 7h9M18 7h2M4 17h2M11 17h9'/%3E%3Ccircle cx='15.5' cy='7' r='2.2'/%3E%3Ccircle cx='8.5' cy='17' r='2.2'/%3E%3C/svg%3E"); }
details[data-sec="device"] { --t1:#5e5ce6; --t2:#3634a3; --ico:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round'%3E%3Crect x='5' y='3' width='14' height='18' rx='2.6'/%3E%3Cpath d='M11 18h2'/%3E%3C/svg%3E"); }
details[data-sec="style"] { --t1:#bf5af2; --t2:#7d3bd1; --ico:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linejoin='round'%3E%3Cpath d='M12 3c4 5 6 8 6 11a6 6 0 0 1-12 0c0-3 2-6 6-11z'/%3E%3C/svg%3E"); }
details[data-sec="layoutui"] { --t1:#30d5c8; --t2:#0a9f95; --ico:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linejoin='round'%3E%3Crect x='4' y='4' width='16' height='16' rx='3'/%3E%3Cpath d='M4 10h16M10 10v10'/%3E%3C/svg%3E"); }
details[data-sec="layouts"] { --t1:#7d7aff; --t2:#4b48d9; --ico:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linejoin='round'%3E%3Crect x='4' y='5' width='7' height='14' rx='2'/%3E%3Crect x='13' y='5' width='7' height='14' rx='2'/%3E%3C/svg%3E"); }
details[data-sec="pages"], details[data-sec="blpages"] { --t1:#32d74b; --t2:#1e9e3a; --ico:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linejoin='round'%3E%3Cpath d='M7 3h7l4 4v14H7zM14 3v4h4'/%3E%3C/svg%3E"); }
details[data-sec="custom"] { --t1:#ff9f0a; --t2:#e07a00; --ico:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M12 5v14M5 12h14'/%3E%3C/svg%3E"); }
details[data-sec="events"] { --t1:#ff6961; --t2:#e0301e; --ico:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round'%3E%3Crect x='4' y='5' width='16' height='15' rx='3'/%3E%3Cpath d='M4 10h16M9 3v4M15 3v4'/%3E%3C/svg%3E"); }
details[data-sec="data"] { --t1:#a1a6b2; --t2:#6a6f7d; --ico:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linejoin='round'%3E%3Cpath d='M7 18a4 4 0 0 1-.5-8A6 6 0 0 1 18 9.5 4 4 0 0 1 17 18z'/%3E%3C/svg%3E"); }

/* footer: page counter + actions */
.panel-foot { margin:0; padding:12px 14px calc(12px + var(--sab)); border-top:0; background:transparent; position:relative; gap:8px; }
.panel-foot::before { content:''; position:absolute; left:14px; right:14px; top:0; height:1px; background:linear-gradient(90deg,transparent,var(--g-hair),transparent); }
.stat b { font-size:24px; letter-spacing:-.03em; }
.stat span { letter-spacing:.1em; }

/* ---------- controls ---------- */
.f input[type=text], .f input[type=number], .f input[type=date], .f select, .ev-row input[type=text], .ev-row input[type=date], .srch, .cs-list input, .ps-input {
  background:var(--field); border:1px solid transparent; border-radius:var(--r-ctl); padding:10px 12px; box-shadow:inset 0 1px 2px rgba(30,40,90,.1), inset 0 0 0 .5px var(--g-hair); transition:box-shadow .2s, background-color .2s; }
:root[data-ui="dark"] .f input, :root[data-ui="dark"] .f select, :root[data-ui="dark"] .ps-input { box-shadow:inset 0 1px 2px rgba(0,0,0,.35), inset 0 0 0 .5px rgba(255,255,255,.1); }
.f input:focus, .f select:focus, .ev-row input:focus, .srch:focus, .cs-list input:focus, .ps-input:focus { background:var(--g-fill-hi); border-color:transparent; box-shadow:0 0 0 3.5px color-mix(in srgb,var(--acc) 30%,transparent), inset 0 0 0 1px var(--acc); }
.f > label, .f > .fl { font-size:12px; letter-spacing:.01em; }
.grp-h { color:var(--mut); font-size:11.5px; letter-spacing:.09em; }
.grp-h button { color:var(--acc-t); font-weight:600; }

/* chips → glass capsules; the selected one is a tinted lens */
.chip, .chip.sm { background:var(--g-fill-lo); border:1px solid var(--g-border); border-radius:99px; box-shadow:inset 0 1px 0 var(--g-rim), 0 0 0 .5px var(--g-hair); font-weight:500; color:var(--ink); transition:transform .28s var(--spring), background-color .2s, box-shadow .2s, color .2s; }
.chip:hover { background:var(--g-fill-hi); border-color:var(--g-border); transform:translateY(-1px); }
.chip:active { transform:scale(.94); }
.chip.on { background:linear-gradient(180deg, color-mix(in srgb,var(--acc) 90%,#fff), var(--acc)); color:var(--acc-ink); border-color:transparent; box-shadow:inset 0 1px 0 rgba(255,255,255,.5), inset 0 -1px 0 rgba(0,0,0,.12), 0 4px 14px color-mix(in srgb,var(--acc) 42%,transparent); }
/* segmented control (built by glass.js for short option groups): one sliding lens under the choice */
.chips.seg { position:relative; display:inline-flex; flex-wrap:nowrap; gap:0; padding:3px; border-radius:99px; background:rgba(120,125,145,.16); box-shadow:inset 0 1px 3px rgba(30,40,90,.14), inset 0 0 0 .5px var(--g-hair); max-width:100%; align-self:flex-start; }
.chips.seg .chip { position:relative; z-index:1; background:none !important; border:0; box-shadow:none !important; flex:1 1 auto; text-align:center; padding:7px 13px; color:var(--mut); transform:none; }
.chips.seg .chip.on { color:var(--ink); font-weight:600; }
.chips.seg .seg-thumb { position:absolute; z-index:0; top:3px; bottom:3px; left:0; border-radius:99px; background:var(--g-fill-hi); backdrop-filter:blur(8px); box-shadow:inset 0 1px 0 var(--g-rim), 0 3px 10px rgba(30,40,90,.2), 0 0 0 .5px var(--g-hair); pointer-events:none; }
:root[data-ui="dark"] .chips.seg .seg-thumb { background:rgba(255,255,255,.22); }
@media (prefers-color-scheme: dark) { :root[data-ui="auto"] .chips.seg .seg-thumb { background:rgba(255,255,255,.22); } }

/* cards: swatches, fonts, devices, styles */
.sw, .fn, .dev, .stl, .devinfo { background:var(--g-fill-lo); border:1px solid var(--g-border); border-radius:var(--r-ctl); box-shadow:inset 0 1px 0 var(--g-rim), 0 0 0 .5px var(--g-hair); transition:transform .3s var(--spring), box-shadow .25s, background-color .2s; }
.stl { border-radius:18px; border:1px solid var(--g-border); }
.sw:hover, .fn:hover, .dev:hover, .stl:hover { background:var(--g-fill-hi); transform:translateY(-2px); box-shadow:inset 0 1px 0 var(--g-rim), 0 0 0 .5px var(--g-hair), 0 10px 24px rgba(30,40,90,.14); }
.sw.on, .fn.on, .dev.on, .stl.on { border-color:transparent; background:color-mix(in srgb,var(--acc) 11%,var(--g-fill-hi)); box-shadow:inset 0 1px 0 var(--g-rim), 0 0 0 2px var(--acc), 0 8px 22px color-mix(in srgb,var(--acc) 26%,transparent); }
.sw .bars { border-radius:6px; box-shadow:inset 0 0 0 .5px rgba(0,0,0,.08); }
.stl-art { border-radius:9px; box-shadow:0 4px 12px rgba(30,40,90,.18); }
.devinfo { background:var(--g-fill-lo); border-radius:var(--r-card); }
.detect { background:color-mix(in srgb,var(--acc) 12%,var(--g-fill-lo)); border:0; border-radius:var(--r-ctl); }
.di-note.good { color:var(--good-t); }

/* iOS switches for every checkbox */
.tg { gap:12px; min-height:30px; }
.tg input[type=checkbox] { -webkit-appearance:none; appearance:none; position:relative; width:46px; height:28px; border-radius:99px; background:rgba(120,125,145,.34); flex:none; order:2; margin:0 0 0 auto; cursor:pointer; box-shadow:inset 0 1px 3px rgba(0,0,0,.18); transition:background-color .25s; }
.tg input[type=checkbox]::after { content:''; position:absolute; left:2px; top:2px; width:24px; height:24px; border-radius:50%; background:#fff; box-shadow:0 2px 6px rgba(0,0,0,.3), 0 0 0 .5px rgba(0,0,0,.06); transition:transform .38s var(--spring), width .2s; }
.tg input[type=checkbox]:checked { background:#34c759; }
.tg input[type=checkbox]:checked::after { transform:translateX(18px); }
.tg input[type=checkbox]:active::after { width:29px; } .tg input[type=checkbox]:checked:active::after { transform:translateX(13px); }
.tg input[type=checkbox]:focus-visible { outline:3px solid color-mix(in srgb,var(--acc) 50%,transparent); outline-offset:2px; }
.checks { gap:2px 18px; } .checks .tg { padding:3px 0; font-size:12.5px; }

/* sliders with a glass thumb and a filled track (--p is set by glass.js) */
input[type=range] { -webkit-appearance:none; appearance:none; background:transparent; height:30px; --p:50%; }
input[type=range]::-webkit-slider-runnable-track { height:6px; border-radius:99px; background:linear-gradient(90deg,var(--acc) var(--p),rgba(120,125,145,.3) var(--p)); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance:none; width:26px; height:26px; margin-top:-10px; border-radius:50%; background:#fff; border:0; box-shadow:0 3px 10px rgba(0,0,0,.3), 0 0 0 .5px rgba(0,0,0,.08), inset 0 -2px 3px rgba(0,0,0,.05); transition:transform .25s var(--spring); }
input[type=range]:active::-webkit-slider-thumb { transform:scale(1.18); }
input[type=range]::-moz-range-track { height:6px; border-radius:99px; background:rgba(120,125,145,.3); }
input[type=range]::-moz-range-progress { height:6px; border-radius:99px; background:var(--acc); }
input[type=range]::-moz-range-thumb { width:26px; height:26px; border-radius:50%; background:#fff; border:0; box-shadow:0 3px 10px rgba(0,0,0,.3); }
.rng output { color:var(--acc-t); }

/* buttons */
.btn, .vb-btn, .ps-btn { background:var(--g-fill-lo); border:1px solid var(--g-border); border-radius:var(--r-ctl); box-shadow:inset 0 1px 0 var(--g-rim), 0 0 0 .5px var(--g-hair); color:var(--ink); font-weight:600; transition:transform .3s var(--spring), background-color .2s, box-shadow .2s; }
.btn:hover, .vb-btn:hover:not(:disabled), .ps-btn:hover { background:var(--g-fill-hi); border-color:var(--g-border); }
.btn:active, .vb-btn:active, .ps-btn:active { transform:scale(.95); }
.btn.primary, .ps-btn.primary { background:linear-gradient(180deg, color-mix(in srgb,var(--acc) 90%,#fff), var(--acc)); color:#fff; border-color:rgba(255,255,255,.25); box-shadow:inset 0 1.5px 0 rgba(255,255,255,.55), inset 0 -1px 0 rgba(0,0,0,.15), 0 8px 22px color-mix(in srgb,var(--acc) 45%,transparent); font-weight:650; letter-spacing:-.005em; }
.btn.primary:hover, .ps-btn.primary:hover { background:linear-gradient(180deg, color-mix(in srgb,var(--acc) 86%,#fff), var(--acc-h)); }
.btn.primary { border-radius:16px; }
.vb-btn.ghost, .ps-btn.ghost { background:transparent; border-color:transparent; box-shadow:none; }
.vb-btn.ghost:hover, .ps-btn.ghost:hover { background:var(--g-fill-lo); }
.vb-btn.on, .vb-btn.tog.on { background:color-mix(in srgb,var(--acc) 18%,var(--g-fill-hi)); border-color:color-mix(in srgb,var(--acc) 45%,transparent); color:var(--acc-t); }
.vb-btn.icon { border-radius:99px; }
.ps-acct { border-radius:99px; } .ps-acct:hover, .ps-acct[aria-expanded="true"] { background:var(--g-fill-lo); border-color:var(--g-border); }
#uiTheme { border-radius:99px; }

/* ---------- canvas: preview toolbars float over the ambient field ---------- */
.preview { padding:0 0 0 14px; position:relative; }
.pv-bar { display:flex; flex-wrap:nowrap; align-items:center; gap:10px; margin:0 0 10px; justify-content:flex-start; min-width:0; }
.pv-bar > * { border-radius:99px; }
.pv-chips { flex:1 1 0; min-width:0; flex-wrap:nowrap; overflow-x:auto; scrollbar-width:none; padding:5px; gap:2px; -webkit-mask-image:linear-gradient(90deg,transparent 0,#000 14px,#000 calc(100% - 28px),transparent); mask-image:linear-gradient(90deg,transparent 0,#000 14px,#000 calc(100% - 28px),transparent); }
.pv-chips::-webkit-scrollbar { display:none; }
.pv-chips .chip { flex:none; background:transparent; border-color:transparent; box-shadow:none; color:var(--mut); padding:6px 13px; }
.pv-chips .chip:hover { background:var(--g-fill-lo); color:var(--ink); transform:none; }
.pv-chips .chip.on { background:var(--g-fill-hi); color:var(--ink); border-color:var(--g-border); box-shadow:inset 0 1px 0 var(--g-rim), 0 3px 10px rgba(30,40,90,.16); font-weight:650; }
:root[data-ui="dark"] .pv-chips .chip.on { background:rgba(255,255,255,.2); }
@media (prefers-color-scheme: dark) { :root[data-ui="auto"] .pv-chips .chip.on { background:rgba(255,255,255,.2); } }
.pv-tools { margin-left:0; padding:5px; gap:4px; flex:none; }
.pv-tools .vb-btn { background:transparent; border-color:transparent; box-shadow:none; }
.pv-tools .vb-btn:hover:not(:disabled) { background:var(--g-fill-lo); }
.pv-tools .zoomer { background:rgba(120,125,145,.14); border:0; box-shadow:inset 0 1px 3px rgba(30,40,90,.12); }
.pv-tools .vb-btn.on { background:color-mix(in srgb,var(--acc) 18%,var(--g-fill-hi)); }
.zoomer { border-radius:99px; background:var(--g-fill-lo); border-color:var(--g-border); }
.zoomer .zl { border-color:var(--g-hair); }
.pv-meta { order:3; align-self:center; margin:8px 0 0; padding:5px 14px; border-radius:99px; background:var(--g-fill); border:1px solid var(--g-border); -webkit-backdrop-filter:blur(18px) saturate(170%); backdrop-filter:blur(18px) saturate(170%); box-shadow:inset 0 1px 0 var(--g-rim), 0 0 0 .5px var(--g-hair), 0 6px 18px rgba(30,40,90,.12); font-size:11.5px; color:var(--mut); pointer-events:none; }
.pv-stage { order:2; }
.pv-hint { order:4; padding:6px 0 2px; font-size:11.5px; opacity:.75; }
.pv-stage { border-radius:var(--r-sheet); }
.mk-stage { background:radial-gradient(60% 55% at 50% 45%, rgba(255,255,255,.28), transparent 72%) !important; border-radius:var(--r-sheet); }
:root[data-ui="dark"] .mk-stage { background:radial-gradient(60% 55% at 50% 45%, rgba(255,255,255,.07), transparent 72%) !important; }
.mk-hud { border-radius:99px; }
.mk-x { background:rgba(120,125,145,.22); color:var(--ink); }
.mk-pulse { background:var(--acc); }
.mk-ring { border-color:var(--acc); box-shadow:0 0 0 9999px rgba(10,14,30,.2), 0 0 26px 2px color-mix(in srgb,var(--acc) 70%,transparent); }
.zmenu { border-radius:18px; padding:6px; box-shadow:inset 0 1.5px 0 var(--g-rim), 0 0 0 .5px var(--g-hair), var(--g-shadow); }
.zmenu button { border-radius:11px; padding:9px 12px; }
.zmenu button:hover { background:color-mix(in srgb,var(--acc) 14%,transparent); }
.zmenu button.on { color:var(--acc-t); }

/* ======================================================================
   VIEWER — a floating bar, a floating contents drawer, the page in the middle
   ====================================================================== */
#viewer { position:relative; background:transparent; }
.vbar { position:absolute; z-index:12; top:calc(12px + var(--sat)); left:calc(14px + var(--sal)); right:calc(14px + var(--sar)); padding:8px 12px; border-radius:26px; gap:8px; }
.vbody { padding-top:0; }
.vstage { padding:calc(84px + var(--sat)) 18px 18px; }
.vtitle { font-size:14px; letter-spacing:-.01em; }
.vnav { background:rgba(120,125,145,.14); border-radius:99px; padding:3px; box-shadow:inset 0 1px 3px rgba(30,40,90,.12); }
.vnav .vb-btn { border-color:transparent; background:transparent; box-shadow:none; }
.vnav .vb-btn:hover:not(:disabled) { background:var(--g-fill-hi); }
.vpage input { background:var(--g-fill-hi); border:0; border-radius:99px; box-shadow:inset 0 1px 2px rgba(30,40,90,.1); }
.outline { margin:calc(86px + var(--sat)) 0 14px calc(14px + var(--sal)); border-radius:var(--r-sheet); width:300px; border:1px solid var(--g-border); padding-left:0; height:auto; }
.outline.closed { margin-left:-320px; }
.ol-search { padding:14px 14px 6px; }
.ol-search input, .ol-date input { background:var(--field); border:0; border-radius:99px; padding:9px 14px; box-shadow:inset 0 1px 2px rgba(30,40,90,.1), inset 0 0 0 .5px var(--g-hair); }
.ol-list { padding:0 8px 18px; }
.ol-list details > summary { border-radius:13px; padding:9px 10px; }
.ol-list details > summary:hover, .ol-list a:hover { background:var(--g-fill-lo); }
.ol-list a { border-radius:11px; }
.ol-list a.cur { background:color-mix(in srgb,var(--acc) 18%,transparent); color:var(--acc-t); }
.vscrim { background:rgba(10,14,30,.28); -webkit-backdrop-filter:blur(4px); backdrop-filter:blur(4px); }
.vmini { border-radius:99px; padding:6px 8px; opacity:.9; }
.vzbadge { border-radius:99px; background-color:var(--g-fill-hi); color:var(--ink); }
#toast, .ps-toast { border-radius:99px; color:var(--ink); background-color:var(--g-fill-hi); padding:11px 20px; }
:root[data-ui="dark"] #toast { background-color:var(--g-fill-hi); color:var(--ink); }

/* ======================================================================
   SHEETS, DIALOGS, MENUS
   ====================================================================== */
dialog, dialog.ps-dlg { border-radius:var(--r-sheet); border:1px solid var(--g-border); background-color:var(--g-fill-hi); color:var(--ink); }
dialog::backdrop { background:rgba(12,16,34,.32); -webkit-backdrop-filter:blur(10px) saturate(120%); backdrop-filter:blur(10px) saturate(120%); }
dialog h2 { font-size:20px; letter-spacing:-.02em; }
dialog form { gap:16px; }
.exp-fmt { background:var(--g-fill-lo); border-radius:var(--r-card); box-shadow:inset 0 1px 0 var(--g-rim), 0 0 0 .5px var(--g-hair); }
.bar { height:12px; background:rgba(120,125,145,.2); border:0; box-shadow:inset 0 1px 3px rgba(0,0,0,.15); }
.bar i { background:linear-gradient(90deg,#ff9ec4,#ffd27a,#8be3a8,#7cc4ff,#b79bff); }
.done-ic { background:linear-gradient(180deg,#5fe08a,#27b45c); box-shadow:inset 0 1.5px 0 rgba(255,255,255,.5), 0 8px 20px rgba(39,180,92,.4); }
.ps-menu, .ps-pop { border-radius:20px; padding:7px; }
.ps-menu-item { border-radius:12px; }
.ps-menu-item:hover { background:color-mix(in srgb,var(--acc) 14%,transparent); }
.keys kbd { background:var(--g-fill-hi); border:1px solid var(--g-border); box-shadow:0 1px 0 var(--g-hair); }

/* ======================================================================
   PHONES & NARROW TABLETS: the preview is pinned on top as one glass sheet
   ====================================================================== */
@media (max-width:960px) {
  #builder { padding:0; display:flex; }
  .preview { padding:calc(8px + var(--sat)) 10px 8px; margin:0; background-color:var(--g-fill-hi); -webkit-backdrop-filter:blur(26px) saturate(180%); backdrop-filter:blur(26px) saturate(180%); border-bottom:1px solid var(--g-border); border-radius:0 0 26px 26px; box-shadow:0 10px 30px rgba(30,40,90,.14); }
  .pv-bar { margin-bottom:6px; } .pv-bar > * { background:transparent; border:0; box-shadow:none; -webkit-backdrop-filter:none; backdrop-filter:none; }
  .pv-bar > * { background-image:none; }
  .panel { margin:12px 10px 0; border-radius:26px; height:auto; overflow:visible; }
  .panel-foot { position:sticky; bottom:0; border-radius:0 0 26px 26px; background-color:var(--g-fill-hi); -webkit-backdrop-filter:blur(24px) saturate(180%); backdrop-filter:blur(24px) saturate(180%); box-shadow:0 -8px 24px rgba(30,40,90,.1); }
  .outline { top:calc(76px + var(--sat)); bottom:10px; left:10px; margin:0; border-radius:26px; }
  .outline.closed { margin-left:0; }
  .vstage { padding:calc(76px + var(--sat)) 8px 8px; }
  .vbar { left:calc(8px + var(--sal)); right:calc(8px + var(--sar)); top:calc(8px + var(--sat)); border-radius:24px; }
}
#viewer.focus .vbar, #viewer.focus .outline { display:none; }
#viewer.focus .vstage { padding:10px; }

/* ======================================================================
   LANDING PAGE
   ====================================================================== */
.nav { top:10px; margin:10px max(12px,calc((100vw - 1200px)/2)); padding:9px 14px 9px 16px; border-radius:24px; border:1px solid var(--g-border); background-color:var(--g-fill); box-shadow:inset 0 1.5px 0 var(--g-rim), 0 0 0 .5px var(--g-hair), var(--g-shadow); }
.nav.on { border-color:var(--g-border); }
.nav-links a:hover { color:var(--ink); }
.sec.alt { background:transparent; }
.demo-ctl, .dates-form, .faq details, .grid article, .plan, .steps li, .vars figure, .logos ul, .sellers .listing-art {
  background-color:var(--g-fill); background-image:linear-gradient(180deg, rgba(255,255,255,.26), rgba(255,255,255,0) 40%);
  -webkit-backdrop-filter:blur(var(--g-blur)) saturate(var(--g-sat)); backdrop-filter:blur(var(--g-blur)) saturate(var(--g-sat));
  border:1px solid var(--g-border); border-radius:var(--r-card); box-shadow:inset 0 1.5px 0 var(--g-rim), 0 0 0 .5px var(--g-hair), var(--g-shadow); }
.plan.hot { box-shadow:inset 0 1.5px 0 var(--g-rim), 0 0 0 2px var(--acc), var(--g-shadow); }
.vars figure { padding:10px; }
.vstage, .vars .vstage { border-radius:var(--r-card); }
.btn.primary.lg, .btn.lg { border-radius:18px; }
.fc { background-color:var(--g-fill-hi); -webkit-backdrop-filter:blur(18px) saturate(180%); backdrop-filter:blur(18px) saturate(180%); border:1px solid var(--g-border); box-shadow:inset 0 1px 0 var(--g-rim), 0 8px 22px rgba(30,40,90,.16); }
.demo-ctl .ch button, .demo-bar button { border-radius:99px; }
.final { background:transparent; }

/* ---------- projects / account screens ---------- */
.pj-top { border-radius:0 0 24px 24px; border-top:0; }
.pj-card { background-color:var(--g-fill); border:1px solid var(--g-border); border-radius:var(--r-card); box-shadow:inset 0 1.5px 0 var(--g-rim), 0 0 0 .5px var(--g-hair), var(--g-shadow); -webkit-backdrop-filter:blur(var(--g-blur)) saturate(var(--g-sat)); backdrop-filter:blur(var(--g-blur)) saturate(var(--g-sat)); }
.pj, .ac { background:transparent; }

@media (prefers-reduced-motion:reduce) { body::before { animation:none; } }
@media print { body::before { display:none; } }

/* footer actions stay on one line */
.panel-foot .btn { white-space:nowrap; padding:11px 14px; }
.panel-foot .btn.primary { flex:1 1 auto; padding:12px 16px; }
#uiTheme { width:38px; height:38px; padding:0; font-size:17px; line-height:1; display:inline-flex; align-items:center; justify-content:center; background:var(--g-fill-lo); border:1px solid var(--g-border); box-shadow:inset 0 1px 0 var(--g-rim), 0 0 0 .5px var(--g-hair); }
.brand-t p { opacity:.9; }

/* scroll edges fade into the glass instead of being cut */
.panel-scroll { -webkit-mask-image:linear-gradient(180deg,transparent 0,#000 14px,#000 calc(100% - 18px),transparent 100%); mask-image:linear-gradient(180deg,transparent 0,#000 14px,#000 calc(100% - 18px),transparent 100%); }
.ps-bar.guest { padding:9px 12px; gap:6px 10px; margin-bottom:8px; } .ps-guest { font-size:12px; line-height:1.35; }
.presets { padding-bottom:8px; }

dialog :focus-visible { outline:2px solid var(--acc); outline-offset:2px; }
.vstage { padding:calc(66px + var(--sat)) 0 0; }
#viewer.focus .vstage { padding:0; }
@media (max-width:960px) { .vstage { padding:calc(58px + var(--sat)) 0 0; } }
/* the page itself is content: a solid sheet lifted above the field */
.vstage .pl-scale { border-radius:16px; overflow:hidden; box-shadow:0 2px 6px rgba(30,40,90,.1), 0 24px 60px -12px rgba(30,40,90,.28); }
:root[data-ui="dark"] .vstage .pl-scale { box-shadow:0 2px 6px rgba(0,0,0,.4), 0 28px 70px -12px rgba(0,0,0,.7); }
.vars .vstage { background:transparent; border:0; box-shadow:none; }

/* ---------- readable text: rules that came out of a contrast audit ---------- */
.eyebrow, .hero h1 em, .ps-badge.acc, .ps-link, .link, .stl-t em { color:var(--acc-t); }
.ps-guest > span:first-child { color:var(--acc-t); }
/* surfaces that can sit on top of a planner page (white or black) get a denser fill so their text never fights the page */
.vbar, .vmini, .vzbadge, .zmenu, .ps-menu, .ps-pop, #toast, .ps-toast, dialog, .mk-hud { background-color:var(--g-over); }
.outline { background-color:color-mix(in srgb,var(--g-over) 82%,transparent); }
.mk-hud { color:var(--ink); }
.mk-hud b { color:var(--ink); }
.final { background:linear-gradient(160deg,var(--acc),color-mix(in srgb,var(--acc) 55%,#000)); color:#fff; }
.final .btn.primary { background:#fff; color:var(--acc); }
.logos li, .logos ul { color:var(--mut); }
.plan li span, .plan li i { color:var(--acc-t); }
.final p { opacity:1; color:#fff; }
.final .btn.primary { color:var(--acc); }
