:root {
  --bg: #f5f3ee;
  --surface: #ffffff;
  --surface-2: #efece5;
  --ink: #17161a;
  --ink-2: #5d5b63;
  --ink-3: #8c8a92;
  --line: #e1ddd3;
  --accent: #ff5a1f;
  --accent-2: #ffe8dd;
  --lime: #c8f03c;
  --stage: #e8e5dd;
  --stage-grid: rgba(0,0,0,.045);
  --shadow: 0 1px 2px rgba(20,18,12,.06), 0 8px 24px rgba(20,18,12,.07);
  --radius: 12px;
  --nav-h: 56px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111113; --surface: #19191c; --surface-2: #222226; --ink: #f2f0ea; --ink-2: #a8a6ad; --ink-3: #75737a;
    --line: #2c2c31; --accent-2: #3a1d12; --stage: #0c0c0e; --stage-grid: rgba(255,255,255,.04);
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.35); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #111113; --surface: #19191c; --surface-2: #222226; --ink: #f2f0ea; --ink-2: #a8a6ad; --ink-3: #75737a;
  --line: #2c2c31; --accent-2: #3a1d12; --stage: #0c0c0e; --stage-grid: rgba(255,255,255,.04);
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.35); color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 14px/1.45 Inter, system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
body.in-studio { overflow: hidden; }
h1, h2, h3, .display { font-family: "Space Grotesk", Inter, sans-serif; letter-spacing: -.02em; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* ---------- nav ---------- */
.nav { position: sticky; top: 0; z-index: 1000; height: var(--nav-h); display: flex; align-items: center; gap: 20px; padding: 0 20px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; font: 600 17px "Space Grotesk", sans-serif; }
.brand b { color: var(--accent); font-weight: 700; }
.nav-links { display: flex; gap: 2px; margin-left: auto; overflow-x: auto; scrollbar-width: none; }
.nav-links a { text-decoration: none; padding: 7px 11px; border-radius: 8px; color: var(--ink-2); font-weight: 500; white-space: nowrap; }
.nav-links a:hover { background: var(--surface-2); color: var(--ink); }
.nav-links a.active { background: var(--ink); color: var(--bg); }
.icon-btn { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; flex: none; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 600; text-decoration: none; white-space: nowrap; transition: transform .08s, background .15s; }
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: color-mix(in srgb, var(--accent) 88%, #000); }
.btn.dark { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; border-radius: 8px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- landing ---------- */
.landing { max-width: 1180px; margin: 0 auto; padding: 0 20px 80px; }
.hero { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; padding: 64px 0 40px; }
.eyebrow { display: inline-flex; gap: 8px; align-items: center; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }
.eyebrow::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 3px color-mix(in srgb, var(--lime) 35%, transparent); }
.hero h1 { font-size: clamp(38px, 6vw, 68px); line-height: 1; margin: 16px 0 18px; }
.hero h1 .swap { color: var(--accent); display: inline-block; min-width: 4ch; }
.hero p { font-size: 17px; color: var(--ink-2); max-width: 540px; margin: 0 0 26px; }
.hero .cta { display: flex; gap: 10px; flex-wrap: wrap; }
.hero-art { aspect-ratio: 1; border-radius: 22px; background: var(--surface); box-shadow: var(--shadow); border: 1px solid var(--line); display: grid; place-items: center; overflow: hidden; perspective: 900px; }
.hero-art .stack3d { width: 70%; aspect-ratio: 1; position: relative; transform-style: preserve-3d; transform: rotateX(56deg) rotateZ(-36deg); animation: float 8s ease-in-out infinite; }
.hero-art .stack3d svg { position: absolute; inset: 0; transform: translateZ(calc(var(--z) * 16px)); filter: drop-shadow(0 2px 3px rgba(0,0,0,.35)); }
@keyframes float { 50% { transform: rotateX(50deg) rotateZ(-30deg) translateZ(12px); } }
.formats { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 22px; }
.chip { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); font-size: 12px; font-weight: 600; color: var(--ink-2); }
.section-h { margin: 56px 0 20px; display: flex; align-items: end; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.section-h h2 { font-size: 32px; margin: 0; }
.section-h p { margin: 0; color: var(--ink-2); max-width: 460px; }
.apps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.app-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; text-decoration: none; transition: transform .15s, box-shadow .15s; }
.app-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.app-card .art { aspect-ratio: 16/10; background: var(--stage); display: grid; place-items: center; }
.app-card .art svg { width: 64%; height: 76%; }
.app-card .body { padding: 16px 18px 18px; }
.app-card h3 { margin: 0 0 4px; font-size: 19px; }
.app-card p { margin: 0 0 12px; color: var(--ink-2); }
.app-card .tags { display: flex; gap: 6px; flex-wrap: wrap; }
.app-card .tags .chip { height: 22px; font-size: 11px; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.step { padding: 22px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); }
.step b { font: 700 13px "Space Grotesk"; color: var(--accent); }
.step h3 { margin: 8px 0 6px; }
.step p { margin: 0; color: var(--ink-2); }
.devices { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.device { padding: 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.device b { display: block; margin-bottom: 4px; }
.device span { color: var(--ink-2); font-size: 13px; }
.foot { margin-top: 64px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--ink-3); font-size: 12px; }

/* ---------- studio shell ---------- */
.studio { position: fixed; inset: var(--nav-h) 0 0 0; display: grid; grid-template-columns: 320px 1fr; }
.studio.has-right { grid-template-columns: 320px 1fr 300px; }
.panel { display: flex; flex-direction: column; min-height: 0; background: var(--surface); border-right: 1px solid var(--line); }
.panel.right { border-right: 0; border-left: 1px solid var(--line); }
.panel-head { padding: 16px 18px 12px; border-bottom: 1px solid var(--line); }
.panel-head .back { font-size: 12px; color: var(--ink-3); text-decoration: none; }
.panel-head .back:hover { color: var(--accent); }
.panel-head h1 { margin: 6px 0 2px; font-size: 22px; }
.panel-head p { margin: 0; color: var(--ink-2); font-size: 13px; }
.panel-body { flex: 1; overflow-y: auto; padding: 6px 18px 18px; }
.panel-foot { padding: 12px 18px; border-top: 1px solid var(--line); display: grid; gap: 8px; }
.panel-foot .row { display: flex; gap: 8px; }
.panel-foot .row > * { flex: 1; }
.stage { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--stage); background-image: linear-gradient(var(--stage-grid) 1px, transparent 1px), linear-gradient(90deg, var(--stage-grid) 1px, transparent 1px); background-size: 24px 24px; }
.stage-bar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; flex-wrap: wrap; }
.tabs { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); }
.tabs button { border: 0; background: none; height: 28px; padding: 0 12px; border-radius: 7px; cursor: pointer; font-weight: 600; color: var(--ink-2); }
.tabs button.on { background: var(--ink); color: var(--bg); }
.stage-info { margin-left: auto; font-size: 12px; color: var(--ink-2); display: flex; gap: 12px; flex-wrap: wrap; }
.stage-info b { color: var(--ink); font-weight: 600; }
.stage-body { position: relative; flex: 1; min-height: 0; }
.stage-body > .pane { position: absolute; inset: 0; }
.empty { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; color: var(--ink-2); padding: 20px; }
.empty h3 { color: var(--ink); margin: 0 0 6px; }

/* ---------- controls ---------- */
.sec { margin: 18px 0 8px; font-size: 11px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-3); }
.ctl { display: block; margin: 10px 0; }
.ctl-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 4px; }
.ctl-label { font-weight: 500; }
.ctl output { font-variant-numeric: tabular-nums; color: var(--ink-2); font-size: 13px; }
.ctl input[type=range] { width: 100%; accent-color: var(--accent); }
.ctl select, .ctl input[type=text], .ctl input[type=number] { width: 100%; height: 34px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface-2); }
.ctl.inline { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ctl.inline .num { display: flex; align-items: center; gap: 6px; }
.ctl.inline input[type=number] { width: 92px; text-align: right; }
.ctl.inline .unit { color: var(--ink-3); font-size: 12px; width: 22px; }
.ctl.check { display: flex; align-items: center; gap: 9px; cursor: pointer; }
.ctl.check input { width: 17px; height: 17px; accent-color: var(--accent); margin: 0; }
.ctl .hint { display: block; font-size: 12px; color: var(--ink-3); margin-top: 3px; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 3px; padding: 3px; background: var(--surface-2); border-radius: 9px; border: 1px solid var(--line); }
.seg button { border: 0; background: none; border-radius: 6px; height: 28px; cursor: pointer; font-weight: 600; font-size: 12.5px; color: var(--ink-2); }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.12); }

/* ---------- location picker ---------- */
.picker { position: absolute; inset: 0; overflow: hidden; }
.pk-map { position: absolute; inset: 0; background: var(--stage); }
.pk-frame { position: absolute; z-index: 500; pointer-events: none; border: 2px solid var(--accent); box-shadow: 0 0 0 9999px rgba(10,10,12,.38); }
.pk-frame.round { border-radius: 50%; }
.pk-dim { position: absolute; left: 50%; top: -30px; transform: translateX(-50%); background: var(--accent); color: #fff; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 6px; white-space: nowrap; }
.pk-search { position: absolute; z-index: 600; top: 12px; left: 56px; width: min(340px, calc(100% - 120px)); }
.pk-search .box { display: flex; background: var(--surface); border-radius: 10px; box-shadow: var(--shadow); border: 1px solid var(--line); overflow: hidden; }
.pk-search input { flex: 1; border: 0; background: none; height: 38px; padding: 0 12px; outline: none; min-width: 0; }
.pk-search button { border: 0; background: var(--ink); color: var(--bg); padding: 0 14px; cursor: pointer; font-weight: 600; }
.pk-results { margin-top: 6px; background: var(--surface); border-radius: 10px; box-shadow: var(--shadow); overflow: hidden; }
.pk-results button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 9px 12px; cursor: pointer; border-bottom: 1px solid var(--line); font-size: 13px; }
.pk-results button:hover { background: var(--surface-2); }
.pk-chips { position: absolute; z-index: 600; left: 12px; right: 12px; bottom: 26px; display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.pk-chips button { border: 1px solid var(--line); background: var(--surface); border-radius: 99px; height: 28px; padding: 0 12px; cursor: pointer; font-size: 12px; font-weight: 600; box-shadow: var(--shadow); }
.leaflet-container { font: inherit; }

/* ---------- layered preview ---------- */
.preview { position: absolute; inset: 0; display: grid; place-items: center; perspective: 2200px; overflow: hidden; }
.stack { position: relative; transform-style: preserve-3d; transition: transform .7s cubic-bezier(.2,.8,.2,1); }
.stack .lyr { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; transition: transform .7s cubic-bezier(.2,.8,.2,1); }
.stack.exploded { transform: rotateX(58deg) rotateZ(-35deg) scale(.7); }
.stack.exploded .lyr { transform: translateZ(calc(var(--z) * var(--gap, 14px))); }
.stack .lyr.sel { filter: drop-shadow(0 0 0 var(--accent)) drop-shadow(0 0 3px var(--accent)); }
.floating { position: absolute; z-index: 5; display: flex; gap: 6px; }
.floating.br { right: 14px; bottom: 14px; }
.floating.bl { left: 14px; bottom: 14px; }

/* ---------- layer list ---------- */
.layers { display: grid; gap: 6px; }
.layer { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; }
.layer:hover { border-color: var(--ink-3); }
.layer.sel { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-2); }
.layer .sw { width: 26px; height: 26px; border-radius: 7px; border: 1px solid rgba(0,0,0,.15); padding: 0; cursor: pointer; overflow: hidden; }
.layer .sw input { opacity: 0; width: 100%; height: 100%; cursor: pointer; }
.layer .nm { font-weight: 600; font-size: 13px; line-height: 1.2; }
.layer .meta { font-size: 11.5px; color: var(--ink-3); }
.layer .acts { display: flex; gap: 2px; }
.layer .acts button { width: 26px; height: 26px; border: 0; border-radius: 6px; background: none; cursor: pointer; color: var(--ink-2); display: grid; place-items: center; }
.layer .acts button:hover { background: var(--surface-2); color: var(--ink); }
.layer.off .nm, .layer.off .sw { opacity: .4; }
.layer select { width: 100%; margin-top: 4px; height: 26px; border-radius: 6px; border: 1px solid var(--line); background: var(--surface-2); font-size: 12px; }

/* ---------- 2d doc preview ---------- */
.docview { position: absolute; inset: 0; overflow: auto; display: grid; place-items: center; padding: 28px; }
.docview .sheets { display: flex; gap: 24px; flex-wrap: wrap; justify-content: center; align-items: flex-start; }
.docview svg { background: var(--sheet, #fbf8f1); box-shadow: var(--shadow); border-radius: 3px; max-width: 100%; height: auto; }
.docview svg path, .docview svg rect, .docview svg circle, .docview svg ellipse, .docview svg line, .docview svg polyline, .docview svg polygon { vector-effect: non-scaling-stroke; }
.docview .cap { font-size: 12px; color: var(--ink-2); margin-top: 6px; text-align: center; }
.canvas3d { position: absolute; inset: 0; }
.canvas3d canvas { display: block; width: 100%; height: 100%; outline: none; }

/* ---------- parts list (nest) ---------- */
.parts { display: grid; gap: 6px; margin-top: 8px; }
.part { display: grid; grid-template-columns: 40px 1fr auto; gap: 10px; align-items: center; padding: 6px 8px; border: 1px solid var(--line); border-radius: 10px; }
.part .thumb { width: 40px; height: 40px; background: var(--surface-2); border-radius: 6px; display: grid; place-items: center; overflow: hidden; }
.part .thumb svg { max-width: 34px; max-height: 34px; }
.part .nm { font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.part .meta { font-size: 11.5px; color: var(--ink-3); }
.part .q { display: flex; align-items: center; gap: 4px; }
.part .q input { width: 46px; height: 28px; border-radius: 6px; border: 1px solid var(--line); background: var(--surface-2); text-align: center; }
.part .q button { width: 26px; height: 26px; border: 0; background: none; cursor: pointer; color: var(--ink-3); border-radius: 6px; }
.part .q button:hover { background: var(--surface-2); color: #d33; }
.drop { display: block; border: 2px dashed var(--line); border-radius: 12px; padding: 16px; text-align: center; color: var(--ink-2); cursor: pointer; }
.drop:hover, .drop.over { border-color: var(--accent); color: var(--accent); }

/* ---------- modal ---------- */
.modal-bg { position: fixed; inset: 0; z-index: 3000; background: rgba(8,8,10,.5); display: grid; place-items: center; padding: 16px; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.modal { width: min(720px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--surface); border-radius: 18px; box-shadow: 0 30px 80px rgba(0,0,0,.35); border: 1px solid var(--line); }
.modal-h { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); z-index: 1; }
.modal-h h2 { margin: 0; font-size: 20px; }
.modal-b { padding: 8px 22px 18px; }
.modal-f { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 22px; border-top: 1px solid var(--line); position: sticky; bottom: 0; background: var(--surface); }
.presets { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.preset { text-align: left; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; }
.preset b { display: block; font-size: 13px; }
.preset span { font-size: 11.5px; color: var(--ink-3); }
.preset.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-2); }
.fmt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.fmt { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); cursor: pointer; }
.fmt input { margin-top: 2px; accent-color: var(--accent); }
.fmt b { display: block; font-size: 13px; }
.fmt span { font-size: 11.5px; color: var(--ink-3); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 12px; }
.op-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--ink-2); }
.op-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }

/* ---------- toast / busy ---------- */
#toast { position: fixed; left: 50%; bottom: 22px; transform: translate(-50%, 30px); opacity: 0; z-index: 4000; background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-weight: 500; transition: .25s; pointer-events: none; max-width: calc(100vw - 32px); }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.err { background: #c62828; color: #fff; }
#busy { position: fixed; top: calc(var(--nav-h) + 14px); left: 50%; transform: translateX(-50%); z-index: 3500; display: flex; align-items: center; gap: 10px; padding: 9px 16px; border-radius: 99px; background: var(--ink); color: var(--bg); font-weight: 600; box-shadow: var(--shadow); }
#busy i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .studio.has-right { grid-template-columns: 300px 1fr; }
  .studio.has-right .panel.right { display: none; }
  .studio.has-right.show-right .panel.right { display: flex; position: absolute; right: 0; top: 0; bottom: 0; width: 300px; z-index: 50; box-shadow: var(--shadow); }
}
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding-top: 36px; }
  .hero-art { max-width: 420px; }
  .apps, .steps { grid-template-columns: 1fr 1fr; }
  .devices { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  body.in-studio { overflow: auto; }
  .studio, .studio.has-right { position: static; display: flex; flex-direction: column; }
  .panel { border-right: 0; border-bottom: 1px solid var(--line); }
  .panel-body { overflow: visible; }
  .stage { height: 70vh; order: -1; }
  .studio.has-right .panel.right { display: flex; }
  .apps, .steps, .devices { grid-template-columns: 1fr; }
  .nav { gap: 10px; padding: 0 12px; }
  .brand span { display: none; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
}
.part .thumb svg path { vector-effect: non-scaling-stroke; stroke-width: 1px; }
.ctl.inline { flex-wrap: wrap; }
.ctl.inline .hint { flex-basis: 100%; margin-top: 0; }

/* ---------- pan & zoom ---------- */
.pz { perspective: 2200px; }
.docview .sheets, .pz { will-change: transform; }
.docview { cursor: grab; }
.preview { cursor: grab; }
.zoombar { position: absolute; left: 14px; bottom: 14px; z-index: 6; display: flex; align-items: center; gap: 2px; padding: 3px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); cursor: default; }
.zoombar button { border: 0; background: none; min-width: 28px; height: 28px; padding: 0 8px; border-radius: 7px; cursor: pointer; font-weight: 600; color: var(--ink-2); }
.zoombar button:hover { background: var(--surface-2); color: var(--ink); }
.zoombar .zpct { min-width: 44px; text-align: center; font-size: 12px; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.docview svg path, .docview svg rect { stroke-width: calc(1.2px / var(--z, 1)); }
.head-links { display: flex; justify-content: space-between; align-items: center; }
.reset-link { border: 0; background: none; padding: 0; font-size: 12px; color: var(--ink-3); cursor: pointer; }
.reset-link:hover { color: var(--accent); }

/* ---------- accounts ---------- */
.acct-chip { flex: none; height: 34px; padding: 0 12px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 600; font-size: 13px; white-space: nowrap; }
.acct-chip b { color: var(--accent); }
.acct-chip:hover { border-color: var(--ink-3); }
.auth-form { display: grid; gap: 2px; margin-top: 8px; }
.auth-form .btn { margin-top: 10px; }
.auth-err { color: #d33; font-size: 13px; margin: 6px 0 0; }
.auth-note { color: var(--ink-3); font-size: 12.5px; margin: 14px 0 0; }
.auth-switch { font-size: 13px; color: var(--ink-2); margin: 12px 0 4px; }
.linkish { border: 0; background: none; padding: 0; color: var(--accent); font-weight: 600; cursor: pointer; }
.packs { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin: 14px 0 4px; }
.pack { display: grid; gap: 2px; padding: 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; text-align: center; }
.pack b { font: 700 24px "Space Grotesk", sans-serif; }
.pack span { color: var(--ink-2); font-size: 13px; }
.pack:hover { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-2); }
.pack:disabled { opacity: .5; }
@media (max-width: 760px) { .acct-chip { padding: 0 8px; font-size: 12px; } }
.head-acts { display: flex; gap: 10px; }

/* ---------- apps menu & shortcuts ---------- */
.apps-btn { flex: none; height: 34px; padding: 0 12px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 600; font-size: 13px; color: var(--ink-2); }
.apps-btn:hover, .apps-btn.active { color: var(--ink); border-color: var(--ink-3); }
.apps-btn.active { background: var(--ink); color: var(--bg); }
.apps-menu { position: fixed; top: calc(var(--nav-h) + 6px); right: 16px; z-index: 1200; width: min(640px, calc(100vw - 32px)); max-height: calc(100vh - var(--nav-h) - 24px); overflow: auto; display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 20px 50px rgba(0,0,0,.2); }
.apps-menu a { display: flex; gap: 10px; align-items: center; padding: 8px; border-radius: 10px; text-decoration: none; }
.apps-menu a:hover { background: var(--surface-2); }
.apps-menu .mi { flex: none; width: 54px; height: 36px; border-radius: 7px; background: var(--stage); display: grid; place-items: center; overflow: hidden; }
.apps-menu .mi svg { width: 100%; height: 100%; }
.apps-menu b { display: block; font-size: 13.5px; }
.apps-menu small { color: var(--ink-3); font-size: 11.5px; }
.keys { border-collapse: collapse; margin: 12px 0; width: 100%; }
.keys td { padding: 7px 8px; border-bottom: 1px solid var(--line); }
.keys td:first-child { white-space: nowrap; width: 1%; }
kbd { display: inline-block; min-width: 22px; padding: 2px 6px; border-radius: 5px; border: 1px solid var(--line); border-bottom-width: 2px; background: var(--surface-2); font: 600 12px Inter, sans-serif; text-align: center; }
@media (max-width: 760px) { .apps-menu { grid-template-columns: 1fr; } .nav-links { display: none; } }

.job-est { margin: 12px 0 4px; padding: 12px 14px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); font-size: 13px; line-height: 1.7; }
.job-est .dot { margin: 0 8px; color: var(--ink-3); }
.job-est small { display: block; color: var(--ink-3); font-size: 11.5px; line-height: 1.4; margin-top: 2px; }
@keyframes gearspin { to { transform: rotate(360deg); } }
.photo-cv { image-rendering: pixelated; background: #fff; box-shadow: var(--shadow); }

/* ---------- plans, gate & guides ---------- */
.modal.wide { width: min(1080px, 100%); }
.plans { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 14px 0 6px; }
.plan { position: relative; display: flex; flex-direction: column; padding: 18px 16px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); }
.plan.featured { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-2), var(--shadow); }
.plan .ribbon { position: absolute; top: -11px; left: 16px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 99px; letter-spacing: .03em; }
.plan h3 { margin: 0 0 6px; font-size: 18px; }
.plan .price { font: 700 30px "Space Grotesk", sans-serif; letter-spacing: -.02em; }
.plan .price small { font-size: 13px; font-weight: 500; color: var(--ink-3); margin-left: 2px; }
.plan .psub { font-size: 12px; color: var(--ink-3); margin-bottom: 10px; }
.plan p { margin: 0 0 10px; color: var(--ink-2); font-size: 13px; }
.plan ul { margin: 0 0 16px; padding-left: 18px; color: var(--ink-2); font-size: 13px; display: grid; gap: 5px; flex: 1; }
.upsell { margin: 14px 0 0; padding: 10px 14px; border-radius: 10px; background: var(--accent-2); color: var(--ink); font-weight: 600; text-align: center; }
.plan-badge { display: inline-block; padding: 1px 7px; border-radius: 99px; font-size: 11px; font-weight: 700; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); }
.plan-badge.p-basic { background: #e6f0ff; color: #1d4f9c; border-color: #c6dafc; }
.plan-badge.p-power { background: var(--accent-2); color: #b83c0e; border-color: #ffc9b0; }
.plan-badge.p-pro { background: #1c1c1e; color: #ffd66b; border-color: #1c1c1e; }
.acct-chip.cta { background: var(--accent); border-color: var(--accent); color: #fff; }
.acct-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 14px; }
.acct-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.acct-sec { border-top: 1px solid var(--line); padding: 10px 0; }
.acct-sec summary { cursor: pointer; font-weight: 600; }
.pw-form { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.pw-form input { flex: 1; min-width: 160px; height: 32px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface-2); }
.admin-t th { text-align: left; font-size: 12px; color: var(--ink-3); padding: 6px 8px; }
.admin-t select { height: 28px; border-radius: 6px; border: 1px solid var(--line); background: var(--surface-2); }
.gate { position: absolute; inset: 0; z-index: 60; display: grid; place-items: center; padding: 20px; background: color-mix(in srgb, var(--bg) 55%, transparent); backdrop-filter: blur(6px); }
.gate-card { max-width: 440px; padding: 28px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 30px 80px rgba(0,0,0,.2); text-align: center; }
.gate-card h2 { margin: 0 0 8px; }
.gate-card p { color: var(--ink-2); margin: 0 0 18px; }
.gate-acts { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.tut-intro { color: var(--ink-2); margin: 14px 0 12px; }
.tut-steps { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.tut-dot { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 700; color: var(--ink-3); }
.tut-dot.done { background: var(--surface-2); color: var(--ink-2); }
.tut-dot.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.tut-card { padding: 18px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); min-height: 130px; }
.tut-n { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.tut-card h3 { margin: 6px 0 6px; }
.tut-card p { margin: 0; color: var(--ink-2); line-height: 1.55; }
.tut-tips { margin-top: 12px; padding: 12px 14px; border-radius: 12px; border: 1px dashed var(--line); font-size: 13px; }
.tut-tips ul { margin: 6px 0 0; padding-left: 18px; color: var(--ink-2); }
.tut-skip { font-size: 12px; color: var(--ink-3); display: flex; gap: 6px; align-items: center; }
@media (max-width: 900px) { .plans { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .plans { grid-template-columns: 1fr; } }
