/* ==========================================================
   Virtual Plant Tour — interface styles
   ========================================================== */

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

:root {
  --accent: #19c2b0;
  --accent-ink: #071412;
  --bg: #060a13;
  --panel: rgba(12, 18, 31, 0.84);
  --panel-solid: #0e1525;
  --panel-2: rgba(255, 255, 255, 0.045);
  --panel-3: rgba(255, 255, 255, 0.08);
  --line: rgba(255, 255, 255, 0.09);
  --line-2: rgba(255, 255, 255, 0.16);
  --text: #eaf0f8;
  --text-2: #a8b3c5;
  --text-3: #6f7b90;
  --ok: #34d399;
  --warn: #fbbf24;
  --danger: #f87171;
  --radius: 16px;
  --radius-sm: 11px;
  --shadow: 0 14px 38px -10px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 30px 80px -20px rgba(0, 0, 0, 0.75);
  --drawer-w: clamp(420px, 40vw, 620px);
  --zones-w: 300px;
  --font: 'Manrope Variable', 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
}
a {
  color: var(--accent);
}
h1,
h2,
h3 {
  margin: 0;
  letter-spacing: -0.01em;
}
.i {
  width: 1.15em;
  height: 1.15em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: -0.2em;
}
.i-fill {
  fill: currentColor;
  stroke: none;
}
.spin {
  animation: spin 0.9s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.eyebrow {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}
.muted {
  color: var(--text-2);
}
.help {
  color: var(--text-3);
  font-size: 13px;
  margin: 6px 0 0;
}
.help b {
  color: var(--text-2);
}

/* ---------------- Map ---------------- */
.map {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(1.5px 1.5px at 12% 22%, rgba(255, 255, 255, 0.7), transparent 60%),
    radial-gradient(1px 1px at 72% 18%, rgba(255, 255, 255, 0.55), transparent 60%),
    radial-gradient(1.2px 1.2px at 38% 78%, rgba(255, 255, 255, 0.5), transparent 60%),
    radial-gradient(1px 1px at 88% 62%, rgba(255, 255, 255, 0.5), transparent 60%),
    radial-gradient(1px 1px at 22% 58%, rgba(255, 255, 255, 0.4), transparent 60%),
    radial-gradient(1.3px 1.3px at 58% 40%, rgba(255, 255, 255, 0.35), transparent 60%),
    radial-gradient(1px 1px at 6% 88%, rgba(255, 255, 255, 0.45), transparent 60%),
    radial-gradient(1px 1px at 94% 8%, rgba(255, 255, 255, 0.45), transparent 60%),
    radial-gradient(ellipse at 50% 45%, #0f2140 0%, #071022 45%, #03060d 100%);
}
.map.mode-pick .maplibregl-canvas,
.map.mode-draw .maplibregl-canvas {
  cursor: crosshair !important;
}
.shade {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(4, 7, 14, 0.55) 0%, rgba(4, 7, 14, 0) 16%),
    linear-gradient(0deg, rgba(4, 7, 14, 0.45) 0%, rgba(4, 7, 14, 0) 14%);
  opacity: 0;
  transition: opacity 0.6s;
}
body[data-stage='plant'] .shade {
  opacity: 1;
}
.maplibregl-ctrl-attrib.maplibregl-compact {
  background: rgba(8, 12, 22, 0.6) !important;
  color: var(--text-2);
}
.maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-button {
  background-color: rgba(255, 255, 255, 0.85);
  border-radius: 50%;
}
.maplibregl-ctrl-attrib a {
  color: var(--text-2) !important;
}
.maplibregl-ctrl-bottom-left {
  margin-left: 4px;
}

.boot-splash {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  transition: opacity 0.6s;
}
.boot-splash span {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.12);
  border-top-color: var(--accent);
  animation: spin 0.9s linear infinite;
}
body:not([data-stage='boot']) .boot-splash {
  opacity: 0;
}
/* shown only if start-up never finishes (very old browser, blocked script) */
.boot-splash::after {
  content: 'Still loading? Please refresh the page. The tour opens from your website address, not from a downloaded folder.';
  position: absolute;
  left: 50%;
  top: calc(50% + 40px);
  transform: translateX(-50%);
  width: min(380px, calc(100% - 32px));
  text-align: center;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-3);
  opacity: 0;
  animation: splash-hint 0.5s 12s forwards;
}
@keyframes splash-hint {
  to {
    opacity: 1;
  }
}
.local-card .hs-ic {
  font-weight: 800;
  font-size: 15px;
}
.local-card .help-steps {
  margin: 18px 0 4px;
}
.noscript {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 18px;
}

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: var(--panel-3);
  color: var(--text);
  font-weight: 650;
  font-size: 14px;
  white-space: nowrap;
  transition: background 0.2s, border-color 0.2s, transform 0.15s, box-shadow 0.2s, opacity 0.2s;
  text-decoration: none;
  user-select: none;
}
.btn:hover {
  background: rgba(255, 255, 255, 0.13);
}
.btn:active {
  transform: scale(0.97);
}
.btn:disabled {
  opacity: 0.45;
  cursor: default;
  transform: none;
}
.btn.primary {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: transparent;
  box-shadow: 0 8px 22px -8px var(--accent);
}
.btn.primary:hover {
  filter: brightness(1.08);
}
.btn.ghost {
  background: rgba(255, 255, 255, 0.04);
}
.btn.accent {
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 26%, transparent), rgba(167, 139, 250, 0.22));
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
}
.btn.danger {
  background: #e5484d;
  border-color: transparent;
  color: #fff;
}
.btn.danger-ghost {
  background: transparent;
  border-color: rgba(248, 113, 113, 0.35);
  color: #fca5a5;
}
.btn.danger-ghost:hover {
  background: rgba(248, 113, 113, 0.12);
}
.btn.on {
  border-color: var(--accent);
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
}
.btn.sm {
  height: 34px;
  padding: 0 12px;
  font-size: 13px;
  gap: 6px;
}
.btn.lg {
  height: 50px;
  padding: 0 24px;
  font-size: 15.5px;
}
.btn.block {
  display: flex;
  width: 100%;
}
.btn.round {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
}
.btn.icon-only {
  width: 34px;
  padding: 0;
}
.btn.pulse {
  animation: pulse 1.8s ease-in-out infinite;
}
@keyframes pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 55%, transparent);
  }
  50% {
    box-shadow: 0 0 0 10px transparent;
  }
}
.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 50%;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-2);
  transition: background 0.2s, color 0.2s;
}
.icon-btn:hover {
  background: var(--panel-3);
  color: var(--text);
}
.icon-btn.sm {
  width: 32px;
  height: 32px;
}
.icon-btn.glass {
  background: rgba(8, 12, 22, 0.55);
  border-color: var(--line);
  color: var(--text);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.icon-btn.danger:hover {
  color: var(--danger);
}
.icon-btn:disabled {
  opacity: 0.35;
  cursor: default;
}
.link {
  border: 0;
  background: none;
  padding: 0;
  color: var(--accent);
  font-weight: 650;
  font-size: 13px;
}
.link:hover {
  text-decoration: underline;
}
.link.danger {
  color: #fca5a5;
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------------- Forms ---------------- */
.fld {
  display: block;
  margin: 0 0 14px;
}
.fld > span {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 650;
  color: var(--text-2);
}
.fld > span .i {
  align-self: center;
}
.fld small {
  font-weight: 500;
  color: var(--text-3);
}
.fld.inline {
  display: flex;
  align-items: center;
  gap: 10px;
}
.fld.inline > span {
  margin: 0;
}
.fld.inline input {
  width: 90px;
}
input:not([type='checkbox']):not([type='radio']):not([type='range']):not([type='color']),
textarea,
select {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-2);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
textarea {
  resize: vertical;
  line-height: 1.5;
}
input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent);
  background: rgba(0, 0, 0, 0.35);
}
input:disabled {
  opacity: 0.5;
}
input::placeholder,
textarea::placeholder {
  color: var(--text-3);
}
select {
  appearance: none;
  padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a8b3c5' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px;
}
select option,
select optgroup {
  background: var(--panel-solid);
  color: var(--text);
}
.sel.sm {
  min-height: 34px;
  height: 34px;
  padding: 0 30px 0 10px;
  border-radius: 999px;
  font-size: 13px;
  width: auto;
  max-width: 220px;
}
input[type='range'] {
  width: 100%;
  accent-color: var(--accent);
}
input[type='color'] {
  width: 46px;
  height: 36px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: none;
  padding: 2px;
}
.fld-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 14px;
}
.inline-form {
  display: flex;
  gap: 8px;
  align-items: center;
}
.inline-form input {
  flex: 1;
  min-width: 0;
}
.check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 4px 0 14px;
  color: var(--text-2);
  font-size: 13.5px;
  cursor: pointer;
}
.check input {
  margin-top: 2px;
  width: 17px;
  height: 17px;
  accent-color: var(--accent);
  flex: none;
}
.switch {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 10px 0;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
}
.switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.sw-ui {
  position: relative;
  flex: none;
  width: 42px;
  height: 24px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.15);
  transition: background 0.2s;
}
.sw-ui::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s var(--ease);
}
.switch input:checked + .sw-ui {
  background: var(--accent);
}
.switch input:checked + .sw-ui::after {
  transform: translateX(18px);
}
.switch input:focus-visible + .sw-ui {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.warn-box {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 0 0 16px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.35);
  color: #fde68a;
  font-size: 13px;
}
.warn-box .i {
  flex: none;
  margin-top: 2px;
}
.form-error {
  margin: 4px 0 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(248, 113, 113, 0.12);
  border: 1px solid rgba(248, 113, 113, 0.3);
  color: #fecaca;
  font-size: 13.5px;
}
.pw {
  position: relative;
}
.pw input {
  padding-right: 44px !important;
}
.pw-eye {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: none;
  color: var(--text-3);
  width: 32px;
  height: 32px;
  border-radius: 8px;
}
.pw-eye:hover {
  color: var(--text);
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 12.5px;
  font-weight: 650;
  background: var(--panel-3);
  color: var(--text-2);
  white-space: nowrap;
}
.pill.ok {
  background: rgba(52, 211, 153, 0.14);
  color: #6ee7b7;
}
.pill.warn {
  background: rgba(251, 191, 36, 0.13);
  color: #fcd34d;
}
.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.spacer {
  flex: 1;
}

/* ---------------- Auth & setup screens ---------------- */
.screen {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  overflow-y: auto;
  background: radial-gradient(ellipse at center, rgba(3, 6, 13, 0.25), rgba(3, 6, 13, 0.7));
}
@media (min-width: 761px) {
  .screen.auth-left {
    place-items: center start;
    padding-left: max(24px, 7vw);
    background: linear-gradient(90deg, rgba(3, 6, 13, 0.6), rgba(3, 6, 13, 0) 60%);
  }
}
.screen.side {
  place-items: start;
  background: linear-gradient(90deg, rgba(3, 6, 13, 0.55), rgba(3, 6, 13, 0) 520px);
  pointer-events: none;
}
.screen.side .auth-card {
  pointer-events: auto;
  margin: 8px 0 0 8px;
}
.auth-card {
  width: min(440px, 100%);
  padding: 32px 30px 26px;
  border-radius: 26px;
  background: var(--panel);
  border: 1px solid var(--line);
  backdrop-filter: blur(24px) saturate(1.3);
  -webkit-backdrop-filter: blur(24px) saturate(1.3);
  box-shadow: var(--shadow-lg);
  animation: rise 0.6s var(--ease) both;
}
.auth-card.wide,
.auth-card.setup {
  width: min(520px, 100%);
}
.auth-card.compact {
  width: min(430px, 100%);
}
.auth-card h1 {
  font-size: 28px;
  line-height: 1.15;
  margin: 8px 0 6px;
}
.auth-card .brand-mono.lg,
.auth-card .brand-logo.lg {
  margin-bottom: 18px;
}
.auth-place {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-2);
  margin: 0 0 22px;
}
.auth-form {
  margin-top: 6px;
}
.fine {
  margin: 18px 0 0;
  color: var(--text-3);
  font-size: 12.5px;
  text-align: center;
}
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes rise-x {
  from {
    opacity: 0;
    transform: translate(-50%, 14px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}
.steps {
  display: flex;
  gap: 6px;
  list-style: none;
  padding: 0;
  margin: 14px 0 20px;
  font-size: 12.5px;
  font-weight: 650;
  color: var(--text-3);
}
.steps li {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 1;
}
.steps li span {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  font-size: 12px;
}
.steps li.cur {
  color: var(--text);
}
.steps li.cur span {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: transparent;
}
.steps li.done span {
  background: color-mix(in srgb, var(--accent) 22%, transparent);
  color: var(--accent);
  border-color: transparent;
}
.setup h1 {
  font-size: 24px;
}
.setup .muted {
  margin: 0 0 18px;
  font-size: 14px;
}
.geo-results {
  list-style: none;
  margin: -6px 0 12px;
  padding: 6px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--line);
  max-height: 180px;
  overflow-y: auto;
}
.geo-results li.muted {
  padding: 8px;
  font-size: 13px;
}
.geo-results button {
  display: flex;
  gap: 8px;
  width: 100%;
  text-align: left;
  border: 0;
  background: none;
  padding: 8px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--text-2);
}
.geo-results button:hover {
  background: var(--panel-3);
  color: var(--text);
}
.loc-box {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px dashed var(--line-2);
  color: var(--text-2);
  font-size: 13.5px;
  margin: 4px 0 14px;
}
.loc-box.set {
  border-style: solid;
  border-color: color-mix(in srgb, var(--accent) 50%, transparent);
  background: color-mix(in srgb, var(--accent) 9%, transparent);
  color: var(--text);
}
.loc-box .i {
  margin-top: 2px;
  color: var(--accent);
}
.check-list {
  list-style: none;
  padding: 0;
  margin: 14px 0 20px;
}
.check-list li {
  display: flex;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  color: var(--text-2);
}
.check-list .i {
  color: var(--warn);
  margin-top: 2px;
}
.setup-pin {
  width: 30px;
  height: 30px;
  cursor: grab;
}
.setup-pin span {
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px #fff, 0 0 26px 6px var(--accent);
}
.setup-pin::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--accent);
  animation: ring 2.2s ease-out infinite;
}

/* ---------------- Brand marks ---------------- */
.brand-mono {
  display: inline-grid;
  place-items: center;
  flex: none;
  min-width: 38px;
  height: 38px;
  padding: 0 8px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 55%, #1e3a8a));
  color: var(--accent-ink);
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.04em;
}
.brand-mono.lg {
  min-width: 58px;
  height: 58px;
  border-radius: 18px;
  font-size: 18px;
  padding: 0 12px;
}
.brand-logo {
  height: 38px;
  max-width: 120px;
  object-fit: contain;
  border-radius: 8px;
}
.brand-logo.lg {
  height: 60px;
  max-width: 180px;
}

/* ---------------- Company dot (globe) ---------------- */
.plant {
  width: 24px;
  height: 24px;
}
.plant-in {
  position: relative;
  width: 100%;
  height: 100%;
  transition: opacity 0.4s, transform 0.4s;
}
.plant-dot {
  position: absolute;
  inset: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
}
.pd-core {
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px #fff, 0 0 20px 6px var(--accent);
}
.pd-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--accent);
  animation: ring 2.4s ease-out infinite;
}
.pd-ring2 {
  animation-delay: 1.2s;
}
@keyframes ring {
  from {
    transform: scale(0.6);
    opacity: 0.95;
  }
  to {
    transform: scale(3.4);
    opacity: 0;
  }
}
.plant-label {
  position: absolute;
  left: 36px;
  top: 50%;
  transform: translateY(-50%);
  display: none;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  padding: 10px 15px 11px;
  border-radius: 14px;
  border: 1px solid var(--line-2);
  background: rgba(8, 12, 22, 0.86);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #fff;
  white-space: nowrap;
  text-align: left;
  box-shadow: var(--shadow);
  animation: rise 0.7s 0.3s var(--ease) both;
}
.plant-label::before {
  content: '';
  position: absolute;
  left: -14px;
  top: 50%;
  width: 14px;
  height: 1px;
  background: rgba(255, 255, 255, 0.6);
}
.plant-label b {
  font-size: 15px;
}
.plant-label span {
  font-size: 12.5px;
  color: var(--text-2);
}
.plant-label em {
  margin-top: 3px;
  font-style: normal;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
}
.plant.invite .plant-label,
.plant.editable .plant-label {
  display: flex;
}
.plant.invite .plant-dot,
.plant.invite .plant-label {
  cursor: pointer;
}
.plant.editable .plant-dot {
  cursor: grab;
}
.plant.editable .plant-label em {
  display: none;
}
.plant.editable .plant-label::after {
  content: 'Drag to move';
  margin-top: 3px;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
}
.zc-near .plant:not(.editable),
.zc-close .plant:not(.editable) {
  pointer-events: none;
}
.zc-near .plant:not(.editable) .plant-in,
.zc-close .plant:not(.editable) .plant-in {
  opacity: 0;
  transform: scale(0.4);
}

/* ---------------- Zone pins ---------------- */
.zpin {
  width: 38px;
  height: 58px;
  z-index: 1;
}
.zpin:hover,
.zpin.selected,
.zpin.hover {
  z-index: 3;
}
.zpin-in {
  position: relative;
  width: 100%;
  height: 100%;
  transform-origin: 50% 100%;
  transition: opacity 0.35s, transform 0.35s var(--ease);
}
.zpin-badge {
  position: absolute;
  top: 0;
  left: 1px;
  width: 36px;
  height: 36px;
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 2.5px solid #fff;
  background: var(--c);
  color: #0b1220;
  font-weight: 800;
  font-size: 15px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.5), 0 0 0 5px color-mix(in srgb, var(--c) 32%, transparent);
  transition: transform 0.25s var(--ease), box-shadow 0.25s;
}
.zpin-stem {
  position: absolute;
  left: 50%;
  top: 34px;
  width: 2px;
  height: 20px;
  transform: translateX(-50%);
  background: linear-gradient(#fff, rgba(255, 255, 255, 0.25));
}
.zpin-foot {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 12px;
  height: 6px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: color-mix(in srgb, var(--c) 70%, #000);
  box-shadow: 0 0 10px 2px color-mix(in srgb, var(--c) 60%, transparent);
}
.zpin-label {
  position: absolute;
  left: 44px;
  top: 5px;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(8, 12, 22, 0.84);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #fff;
  font-size: 12.5px;
  font-weight: 650;
  white-space: nowrap;
  pointer-events: none;
  transition: opacity 0.25s;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
}
.zpin:hover .zpin-badge,
.zpin.hover .zpin-badge {
  transform: scale(1.12);
}
.zpin.selected .zpin-badge {
  transform: scale(1.18);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.55), 0 0 0 7px color-mix(in srgb, var(--c) 45%, transparent), 0 0 30px 6px var(--c);
}
.zpin.selected .zpin-label {
  border-color: var(--c);
}
.zc-far .zpin {
  pointer-events: none;
}
.zc-far .zpin-in {
  opacity: 0;
  transform: scale(0.3);
}
.zc-near .zpin-label {
  opacity: 0;
}
.zc-near .zpin:hover .zpin-label,
.zc-near .zpin.selected .zpin-label,
.zc-near .zpin.hover .zpin-label {
  opacity: 1;
}
.map-editing .zpin-badge {
  cursor: grab;
}
.map-editing .zpin.dragging .zpin-badge {
  cursor: grabbing;
  transform: scale(1.2);
}
.map-editing .zpin-badge::after {
  content: '';
  position: absolute;
  inset: -7px;
  border-radius: 50%;
  border: 1.5px dashed rgba(255, 255, 255, 0.7);
  animation: spin 9s linear infinite;
}
.zpin.drop-target .zpin-badge {
  transform: scale(1.35);
  box-shadow: 0 0 0 10px color-mix(in srgb, var(--c) 50%, transparent);
}
.vh {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  background: #fff;
  border: 2px solid #0b1220;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  cursor: grab;
}
.vh-mid {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  opacity: 0.65;
  border-width: 1.5px;
}
.vh:hover {
  transform: scale(1.25);
  opacity: 1;
}

/* ---------------- Intro card ---------------- */
.intro {
  position: fixed;
  left: 40px;
  bottom: 40px;
  z-index: 20;
  width: min(430px, calc(100vw - 32px));
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}
.intro.show {
  opacity: 1;
  transform: none;
}
.intro-card {
  padding: 30px 30px 24px;
  border-radius: 26px;
  background: var(--panel);
  border: 1px solid var(--line);
  backdrop-filter: blur(24px) saturate(1.3);
  -webkit-backdrop-filter: blur(24px) saturate(1.3);
  box-shadow: var(--shadow-lg);
}
.intro-brand {
  margin-bottom: 18px;
}
.intro-card h1 {
  font-size: clamp(26px, 3vw, 34px);
  line-height: 1.12;
  margin: 8px 0 8px;
}
.intro-tag {
  margin: 0 0 8px;
  color: var(--text-2);
  font-size: 15.5px;
}
.intro-place {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 22px;
  color: var(--text-2);
}
.intro-place .i {
  color: var(--accent);
}
.intro-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.intro-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 16px 0 0;
  font-size: 13px;
  color: var(--text-3);
}
.hint-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px 2px var(--accent);
  animation: pulse 1.8s infinite;
}
.intro-stats {
  display: flex;
  gap: 18px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--text-2);
  font-size: 13.5px;
}
.intro-stats b {
  color: var(--text);
  font-size: 17px;
  margin-right: 3px;
}

/* ---------------- Top bar ---------------- */
.topbar {
  position: fixed;
  top: 12px;
  left: 16px;
  right: 16px;
  z-index: 25;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  pointer-events: none;
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.5s, transform 0.5s var(--ease);
}
.plant-ui .topbar {
  opacity: 1;
  transform: none;
}
.topbar > * {
  pointer-events: auto;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 6px 16px 6px 6px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
  text-align: left;
  min-width: 0;
}
.brand .brand-mono {
  border-radius: 50%;
  min-width: 40px;
  height: 40px;
  padding: 0;
  font-size: 11.5px;
}
.brand .brand-logo {
  height: 36px;
  border-radius: 50%;
  max-width: 90px;
}
.brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.2;
}
.brand-text b {
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.brand-text small {
  font-size: 12px;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tb-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}
.tb-actions .icon-btn.glass {
  background: transparent;
  border-color: transparent;
}
.avatar {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 0;
  background: linear-gradient(135deg, #334155, #1e293b);
  color: #fff;
  font-weight: 750;
  font-size: 12.5px;
}
.avatar.sm {
  width: 34px;
  height: 34px;
  font-size: 12px;
  flex: none;
}
.menu {
  position: fixed;
  z-index: 80;
  min-width: 230px;
  padding: 6px;
  border-radius: 16px;
  background: var(--panel-solid);
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.18s, transform 0.18s var(--ease);
}
.menu.open {
  opacity: 1;
  transform: none;
}
.menu-head {
  padding: 10px 12px 10px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 4px;
  display: flex;
  flex-direction: column;
}
.menu-head span {
  font-size: 12.5px;
  color: var(--text-3);
}
.menu button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 10px;
  background: none;
  text-align: left;
  font-size: 14px;
  color: var(--text-2);
}
.menu button:hover {
  background: var(--panel-3);
  color: var(--text);
}

/* ---------------- Zones panel ---------------- */
.zones-panel {
  position: fixed;
  left: 16px;
  top: 84px;
  z-index: 20;
  width: var(--zones-w);
  max-height: calc(100vh - 84px - 24px);
  display: flex;
  flex-direction: column;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(20px) saturate(1.2);
  -webkit-backdrop-filter: blur(20px) saturate(1.2);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateX(-16px);
  transition: opacity 0.5s 0.1s, transform 0.5s 0.1s var(--ease);
}
.plant-ui .zones-panel {
  opacity: 1;
  transform: none;
}
.zp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 14px 10px 10px 18px;
  cursor: pointer;
}
.zp-title b {
  display: block;
  font-size: 14.5px;
  margin-top: 2px;
}
.zp-collapse .i {
  transition: transform 0.3s;
}
.zones-panel.collapsed .zp-collapse .i {
  transform: rotate(-90deg);
}
.zp-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  padding: 0 10px 12px;
}
.zones-panel.collapsed .zp-body {
  display: none;
}
.zp-list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  min-height: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  scrollbar-width: thin;
}
.zp-li.dragging {
  opacity: 0.4;
}
.zp-li.drop-before {
  box-shadow: inset 0 2px 0 var(--accent);
}
.zp-li.drop-after {
  box-shadow: inset 0 -2px 0 var(--accent);
}
.zp-item {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 8px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: none;
  text-align: left;
  transition: background 0.2s, border-color 0.2s;
}
.zp-item:hover,
.zp-item.hover {
  background: var(--panel-2);
}
.zp-item.active {
  background: color-mix(in srgb, var(--c) 13%, transparent);
  border-color: color-mix(in srgb, var(--c) 40%, transparent);
}
.zp-grip {
  color: var(--text-3);
  cursor: grab;
  display: grid;
}
.zp-num {
  display: grid;
  place-items: center;
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--c);
  color: #0b1220;
  font-weight: 800;
  font-size: 13px;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 25%, transparent);
}
.zp-text {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}
.zp-name {
  font-size: 14px;
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.zp-meta {
  font-size: 12px;
  color: var(--text-3);
}
.zp-thumb {
  flex: none;
  width: 46px;
  height: 36px;
  border-radius: 9px;
  object-fit: cover;
  background: var(--panel-3);
}
.zp-thumb.ph {
  display: grid;
  place-items: center;
  color: var(--text-3);
}
.zp-tip {
  margin: 0 6px;
  font-size: 12px;
  color: var(--text-3);
  text-align: center;
}

/* ---------------- Map controls ---------------- */
.map-controls {
  position: fixed;
  right: 16px;
  bottom: 30px;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 8px;
  opacity: 0;
  transition: opacity 0.5s 0.2s, right 0.45s var(--ease);
}
.plant-ui .map-controls {
  opacity: 1;
}
body.drawer-open .map-controls {
  right: calc(var(--drawer-w) + 26px);
}
.ctl-group {
  display: flex;
  flex-direction: column;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.ctl-group button {
  display: grid;
  place-items: center;
  width: 42px;
  height: 40px;
  border: 0;
  background: none;
  color: var(--text-2);
  transition: background 0.2s, color 0.2s;
}
.ctl-group button + button {
  border-top: 1px solid var(--line);
}
.ctl-group button:hover {
  background: var(--panel-3);
  color: var(--text);
}
.ctl-group button.on {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
}
.ctl-group button.txt {
  font-size: 12.5px;
  font-weight: 800;
}
.compass .i {
  transition: transform 0.1s;
  color: var(--text);
}
.compass .i path:first-child {
  stroke: #ef4444;
  fill: #ef4444;
}

/* ---------------- Drawer (zone panel) ---------------- */
.drawer {
  position: fixed;
  top: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 30;
  width: var(--drawer-w);
  display: flex;
  flex-direction: column;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: rgba(12, 18, 31, 0.94);
  backdrop-filter: blur(24px) saturate(1.3);
  -webkit-backdrop-filter: blur(24px) saturate(1.3);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  transform: translateX(calc(100% + 30px));
  visibility: hidden;
  transition: transform 0.5s var(--ease), visibility 0s 0.5s, top 0.35s, right 0.35s, bottom 0.35s, width 0.35s, border-radius 0.35s;
}
.drawer.open {
  transform: none;
  visibility: visible;
  transition: transform 0.5s var(--ease), visibility 0s, top 0.35s, right 0.35s, bottom 0.35s, width 0.35s, border-radius 0.35s;
}
.drawer.expanded {
  top: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  border-radius: 0;
  z-index: 45;
}
.drawer.drag-over {
  border-color: var(--accent);
  box-shadow: var(--shadow-lg), inset 0 0 0 2px var(--accent);
}
.dr-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px 14px 14px 18px;
}
.dr-num {
  display: grid;
  place-items: center;
  flex: none;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--c);
  color: #0b1220;
  font-weight: 800;
  font-size: 17px;
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--c) 25%, transparent);
}
.dr-titles {
  flex: 1;
  min-width: 0;
}
.dr-titles h2 {
  font-size: 21px;
  line-height: 1.2;
  margin-top: 2px;
}
.dr-titles p {
  margin: 4px 0 0;
  color: var(--text-2);
  font-size: 13.5px;
}
.stage {
  position: relative;
  margin: 0 14px;
  aspect-ratio: 16 / 10;
  border-radius: 18px;
  overflow: hidden;
  background: #000;
  flex: none;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.7);
}
.drawer.expanded .stage {
  flex: 1;
  aspect-ratio: auto;
  min-height: 0;
}
.stage-media {
  position: absolute;
  inset: 0;
  overflow: hidden;
}
.stage-media::before {
  content: '';
  position: absolute;
  inset: -30px;
  background: var(--bg-img, none) center / cover no-repeat;
  filter: blur(26px) brightness(0.45) saturate(1.2);
}
.stage-el {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  transition: opacity 0.6s ease;
}
.stage-el.in {
  opacity: 1;
}
.stage-el.out {
  opacity: 0;
}
video.stage-el {
  background: transparent;
}
.stage-el.kb {
  animation: kenburns linear forwards;
}
.stage-el.kb-paused {
  animation-play-state: paused;
}
@keyframes kenburns {
  from {
    transform: scale(1);
  }
  to {
    transform: scale(1.09) translate(-1.2%, -1%);
  }
}
.stage-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(8, 12, 22, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #fff;
  opacity: 0;
  transition: opacity 0.25s, background 0.2s;
}
.stage:hover .stage-nav {
  opacity: 1;
}
.stage-nav:hover {
  background: rgba(8, 12, 22, 0.8);
}
.stage-nav:disabled {
  opacity: 0 !important;
  pointer-events: none;
}
.stage-nav.prev {
  left: 12px;
}
.stage-nav.next {
  right: 12px;
}
.stage-top {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  z-index: 3;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
}
.stage-top > * {
  pointer-events: auto;
}
.stage-count {
  padding: 4px 10px;
  border-radius: 99px;
  background: rgba(8, 12, 22, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-size: 12.5px;
  font-weight: 700;
}
.stage-tap {
  position: absolute;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 99px;
  border: 0;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  animation: pulse 1.8s infinite;
}
.stage-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  z-index: 3;
  background: rgba(255, 255, 255, 0.12);
}
.stage-progress i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
  transition: width 0.3s linear;
}
.dr-caption {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 20px 10px;
}
.drawer.expanded .dr-caption {
  flex: none;
  max-height: 22vh;
}
.cap-title {
  font-size: 16px;
  margin-bottom: 6px;
}
.cap-text {
  margin: 0;
  color: var(--text-2);
  font-size: 15px;
  line-height: 1.65;
}
.thumbs {
  display: flex;
  gap: 8px;
  padding: 4px 14px 12px;
  overflow-x: auto;
  scrollbar-width: thin;
  flex: none;
}
.thumb {
  position: relative;
  flex: none;
  width: 76px;
  height: 54px;
  padding: 0;
  border-radius: 11px;
  border: 2px solid transparent;
  overflow: hidden;
  background: var(--panel-3);
  opacity: 0.65;
  transition: opacity 0.2s, border-color 0.2s, transform 0.2s;
}
.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.thumb:hover {
  opacity: 1;
}
.thumb.active {
  opacity: 1;
  border-color: var(--accent);
  transform: translateY(-2px);
}
.thumb-ph {
  display: grid;
  place-items: center;
  height: 100%;
  color: var(--text-3);
}
.thumb-badge {
  position: absolute;
  right: 4px;
  bottom: 4px;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.65);
  font-size: 11px;
}
.dr-foot {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px 14px;
  border-top: 1px solid var(--line);
  flex: none;
}
.dr-foot-info {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  font-size: 13px;
  color: var(--text-2);
}
.foot-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.eq {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 16px;
  flex: none;
}
.eq i {
  width: 3px;
  height: 4px;
  border-radius: 2px;
  background: var(--text-3);
}
.eq.on i {
  background: var(--accent);
  animation: eq 0.9s ease-in-out infinite;
}
.eq.on i:nth-child(2) {
  animation-delay: 0.15s;
}
.eq.on i:nth-child(3) {
  animation-delay: 0.3s;
}
.eq.on i:nth-child(4) {
  animation-delay: 0.45s;
}
@keyframes eq {
  0%,
  100% {
    height: 4px;
  }
  50% {
    height: 15px;
  }
}
.dr-empty {
  flex: 1;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 8px;
  padding: 30px;
  color: var(--text-3);
  text-align: center;
}
.dr-empty .i {
  width: 34px;
  height: 34px;
}
.interstitial {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: 40px;
  animation: rise 0.6s var(--ease) both;
}
.inter-num {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin: 18px 0 16px;
  border-radius: 50%;
  background: var(--c);
  color: #0b1220;
  font-size: 26px;
  font-weight: 800;
  box-shadow: 0 0 0 8px color-mix(in srgb, var(--c) 25%, transparent), 0 0 40px 6px color-mix(in srgb, var(--c) 50%, transparent);
}
.interstitial h2 {
  font-size: 30px;
  line-height: 1.15;
}
.interstitial p {
  color: var(--text-2);
  font-size: 16px;
  margin: 10px 0 0;
}
.inter-bar {
  width: 100%;
  height: 3px;
  margin-top: 28px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}
.inter-bar i {
  display: block;
  height: 100%;
  background: var(--c);
  animation: fill 2.2s linear forwards;
}
@keyframes fill {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

/* ---------------- Guided tour bar & subtitles ---------------- */
.tourbar {
  position: fixed;
  top: 76px;
  left: 50%;
  z-index: 40;
  transform: translateX(-50%);
  width: max-content;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 8px 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: var(--panel-solid);
  box-shadow: var(--shadow);
  animation: rise-x 0.4s var(--ease) both;
}
.tb-live {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6);
  animation: live 1.6s infinite;
}
@keyframes live {
  70% {
    box-shadow: 0 0 0 8px transparent;
  }
}
.tb-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}
.tb-text b {
  font-size: 13px;
}
.tb-text span {
  font-size: 12px;
  color: var(--text-2);
  max-width: 260px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tb-steps {
  display: flex;
  gap: 4px;
}
.tb-steps i {
  width: 14px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.15);
}
.tb-steps i.done {
  background: color-mix(in srgb, var(--accent) 60%, transparent);
}
.tb-steps i.cur {
  background: var(--accent);
  width: 22px;
}
body.guided .topbar .tb-actions [data-act='guided'] {
  display: none;
}
.subtitle {
  position: fixed;
  left: 50%;
  bottom: 48px;
  z-index: 35;
  transform: translate(-50%, 12px);
  width: max-content;
  max-width: min(760px, calc(100vw - 32px));
  pointer-events: none;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 10px 14px 22px;
  border-radius: 18px;
  background: rgba(5, 8, 15, 0.78);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--line);
  font-size: 18px;
  line-height: 1.5;
  text-align: center;
  opacity: 0;
  transition: opacity 0.4s, transform 0.4s var(--ease);
}
.subtitle.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
.subtitle span {
  flex: 1;
}
.subtitle button {
  pointer-events: auto;
}

/* ---------------- Edit mode ---------------- */
.editbar {
  position: fixed;
  top: 76px;
  left: 50%;
  z-index: 26;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: calc(100vw - 24px);
  padding: 7px 7px 7px 14px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  background: var(--panel-solid);
  box-shadow: var(--shadow), 0 0 0 4px color-mix(in srgb, var(--accent) 10%, transparent);
  animation: rise-x 0.4s var(--ease) both;
}
body.editing .zones-panel {
  top: 140px;
  max-height: calc(100vh - 140px - 24px);
}
.eb-left {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  min-width: 132px;
}
.eb-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 800;
  font-size: 13px;
  color: var(--accent);
}
.eb-status {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  color: var(--text-3);
  white-space: nowrap;
}
.eb-status .i {
  width: 13px;
  height: 13px;
}
.eb-status.st-saved {
  color: var(--ok);
}
.eb-status.st-error {
  color: var(--danger);
}
.eb-tools {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}
.eb-tools::-webkit-scrollbar {
  display: none;
}
.hintbar {
  position: fixed;
  left: 50%;
  top: 136px;
  z-index: 40;
  transform: translate(-50%, -8px);
  width: max-content;
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: calc(100vw - 24px);
  padding: 10px 10px 10px 18px;
  border-radius: 18px;
  border: 1px solid color-mix(in srgb, var(--accent) 50%, transparent);
  background: var(--panel-solid);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s var(--ease);
}
.hintbar.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
.hint-text {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  font-size: 14px;
  line-height: 1.4;
}
.hint-text .i {
  flex: none;
}
.hint-text .i {
  color: var(--accent);
}
.hint-count {
  color: var(--accent);
  font-weight: 700;
}
.hint-actions {
  display: flex;
  gap: 6px;
  flex: none;
}
@media (min-width: 761px) {
  /* keep the hint between the zone list and the side panel */
  .hintbar {
    left: calc((var(--zones-w) + 32px + 100vw - 72px) / 2);
    max-width: calc(100vw - var(--zones-w) - 120px);
    flex-wrap: wrap;
  }
  body.drawer-open .hintbar {
    left: calc((var(--zones-w) + 32px + 100vw - var(--drawer-w) - 24px) / 2);
    max-width: calc(100vw - var(--drawer-w) - var(--zones-w) - 72px);
  }
}
.ed-head {
  align-items: center;
}
.ed-name {
  margin-top: 4px;
  font-size: 19px !important;
  font-weight: 750;
  padding: 6px 10px !important;
  min-height: 40px !important;
}
.ed-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0 18px 24px;
  scrollbar-width: thin;
}
.ed-sec {
  padding: 16px 0;
  border-top: 1px solid var(--line);
}
.ed-sec:first-child {
  border-top: 0;
  padding-top: 4px;
}
.ed-sec.end {
  padding-bottom: 0;
}
.sec-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.sec-head h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
}
.sec-head .help {
  margin: 0;
}
.count {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  height: 22px;
  padding: 0 7px;
  border-radius: 99px;
  background: var(--panel-3);
  font-size: 12px;
  color: var(--text-2);
}
.swatches,
.color-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.sw {
  width: 26px;
  height: 26px;
  padding: 0;
  border-radius: 50%;
  border: 2px solid transparent;
  background: var(--c);
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.25);
  transition: transform 0.15s;
}
.sw:hover {
  transform: scale(1.12);
}
.sw.on {
  border-color: #fff;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 45%, transparent);
}
.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 18px;
  border-radius: 16px;
  border: 1.5px dashed var(--line-2);
  background: rgba(255, 255, 255, 0.025);
  color: var(--text-2);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.dropzone .i {
  width: 26px;
  height: 26px;
  color: var(--accent);
}
.dropzone b {
  color: var(--text);
}
.dropzone span {
  font-size: 12.5px;
  color: var(--text-3);
}
.dropzone:hover,
.drawer.drag-over .dropzone {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}
.ed-items {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ed-item {
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  transition: border-color 0.2s, background 0.2s;
}
.ed-item.open {
  border-color: var(--line-2);
  background: rgba(255, 255, 255, 0.055);
}
.ed-item.dragging {
  opacity: 0.4;
}
.ed-item.drop-before {
  box-shadow: 0 -3px 0 var(--accent);
}
.ed-item.drop-after {
  box-shadow: 0 3px 0 var(--accent);
}
.ei-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px 8px 6px;
  cursor: pointer;
}
.ei-grip {
  color: var(--text-3);
  cursor: grab;
  padding: 4px 0;
  display: grid;
}
.ei-thumb {
  position: relative;
  flex: none;
  display: grid;
  place-items: center;
  width: 70px;
  height: 50px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--panel-3);
  color: var(--text-3);
}
.ei-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ei-dur {
  position: absolute;
  left: 4px;
  bottom: 4px;
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 1px 5px;
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
}
.ei-dur .i {
  width: 11px;
  height: 11px;
}
.ei-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.ei-main b {
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 11.5px;
  font-weight: 650;
  background: var(--panel-3);
  color: var(--text-3);
}
.chip .i {
  width: 12px;
  height: 12px;
}
.chip.ok,
.chip.v-ready {
  background: rgba(52, 211, 153, 0.13);
  color: #6ee7b7;
}
.chip.v-stale,
.chip.v-todo {
  background: rgba(251, 191, 36, 0.13);
  color: #fcd34d;
}
.chip.v-browser {
  background: rgba(96, 165, 250, 0.13);
  color: #93c5fd;
}
.ei-caret {
  color: var(--text-3);
  transition: transform 0.25s;
  display: grid;
}
.ed-item.open .ei-caret {
  transform: rotate(180deg);
}
.ei-body {
  padding: 4px 14px 14px;
}
.ei-preview {
  margin: 0 0 14px;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
  aspect-ratio: 16 / 9;
}
.ei-preview img,
.ei-preview video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.ai-row,
.voice-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin: -2px 0 14px;
}
.voice-row {
  margin: -2px 0 8px;
}
.tweaks {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.voice-status {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin: 0 0 14px;
  font-size: 12.5px;
  color: var(--text-3);
}
.voice-status .i {
  margin-top: 1px;
  flex: none;
}
.seg {
  display: inline-flex;
  padding: 3px;
  border-radius: 99px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--line);
}
.seg button {
  border: 0;
  background: none;
  padding: 6px 14px;
  border-radius: 99px;
  font-size: 13px;
  font-weight: 650;
  color: var(--text-2);
}
.seg button.on {
  background: var(--accent);
  color: var(--accent-ink);
}
.ei-foot {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.bulk {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.ed-item.job .ei-row {
  cursor: default;
}
.ed-item.job .ei-thumb .i {
  width: 20px;
  height: 20px;
  color: var(--accent);
}
.ed-item.job.error .ei-thumb .i {
  color: var(--danger);
}
.job-line {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--text-3);
}
.bar {
  display: block;
  flex: 1;
  height: 5px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}
.bar i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
  border-radius: 5px;
  transition: width 0.3s;
}
.uploads {
  position: fixed;
  left: 16px;
  bottom: 30px;
  z-index: 40;
  width: 300px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid var(--line-2);
  background: var(--panel-solid);
  box-shadow: var(--shadow-lg);
  animation: rise 0.35s var(--ease) both;
}
.uploads.done {
  border-color: color-mix(in srgb, var(--ok) 50%, transparent);
}
.up-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
}
.up-head .i {
  color: var(--accent);
}
.uploads.done .up-head .i {
  color: var(--ok);
}
.up-head span {
  margin-left: auto;
  font-size: 11.5px;
  color: var(--text-3);
}
.up-cur {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin: 10px 0 7px;
  font-size: 12.5px;
  color: var(--text-2);
}
.up-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.import-list {
  list-style: none;
  margin: 10px 0 18px;
  padding: 0;
  max-height: 40vh;
  overflow-y: auto;
}
.import-list li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
}
.import-list li span:nth-child(2) {
  color: var(--text-3);
}
.import-list li span:last-child {
  grid-column: 1 / -1;
  font-size: 12.5px;
}
.import-list .ok {
  color: #6ee7b7;
}
.import-list .new {
  color: var(--accent);
}

/* ---------------- Toasts ---------------- */
.toasts {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 100;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  width: min(560px, calc(100vw - 24px));
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 8px 10px 16px;
  border-radius: 16px;
  border: 1px solid var(--line-2);
  background: var(--panel-solid);
  box-shadow: var(--shadow-lg);
  font-size: 14px;
  pointer-events: auto;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.25s, transform 0.25s var(--ease);
}
.toast.show {
  opacity: 1;
  transform: none;
}
.toast > .i {
  color: var(--accent);
}
.toast-success > .i {
  color: var(--ok);
}
.toast-error {
  border-color: rgba(248, 113, 113, 0.4);
}
.toast-error > .i {
  color: var(--danger);
}
.toast-msg {
  flex: 1;
}
.toast-act {
  border: 0;
  background: var(--panel-3);
  border-radius: 99px;
  padding: 6px 12px;
  font-weight: 700;
  font-size: 13px;
  color: var(--accent);
}
.toast-x {
  border: 0;
  background: none;
  color: var(--text-3);
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 8px;
}
.toast-x:hover {
  color: var(--text);
}

/* ---------------- Modals ---------------- */
.modal-wrap {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(3, 6, 13, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.2s;
}
.modal-wrap.open {
  opacity: 1;
}
.modal {
  width: min(480px, 100%);
  max-height: calc(100vh - 40px);
  max-height: calc(100dvh - 40px);
  display: flex;
  flex-direction: column;
  border-radius: 24px;
  border: 1px solid var(--line-2);
  background: var(--panel-solid);
  box-shadow: var(--shadow-lg);
  transform: translateY(14px) scale(0.98);
  transition: transform 0.25s var(--ease);
  overflow: hidden;
}
.modal-wrap.open .modal {
  transform: none;
}
.modal-wide {
  width: min(940px, 100%);
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 14px 6px 24px;
}
.modal-head h2 {
  font-size: 19px;
}
.modal-body {
  padding: 10px 24px 22px;
  overflow-y: auto;
  min-height: 0;
}
.confirm-msg {
  margin: 4px 0 18px;
  color: var(--text-2);
  line-height: 1.55;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}
.modal-actions.center {
  justify-content: center;
}
.endcard .modal-body {
  padding: 34px 30px 28px;
}
.end-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.end-inner .brand-mono,
.end-inner .brand-logo {
  margin-bottom: 18px;
}
.end-inner h2 {
  font-size: 26px;
  margin-top: 8px;
}
.end-inner h3 {
  font-size: 19px;
  color: var(--accent);
  margin-top: 4px;
}
.end-msg {
  color: var(--text-2);
  margin: 14px 0 6px;
  line-height: 1.6;
}
.contact-list {
  list-style: none;
  margin: 12px 0 18px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 14px;
}
.contact-list li {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text-2);
}
.contact-list a {
  color: var(--text);
  text-decoration: none;
}
.contact-list a:hover {
  color: var(--accent);
}

/* ---------------- Settings ---------------- */
.settings .modal-body {
  padding: 0;
  overflow: hidden;
  display: flex;
}
.set-wrap {
  display: flex;
  flex: 1;
  min-height: 0;
  height: min(680px, calc(100vh - 110px));
  height: min(680px, calc(100dvh - 110px));
}
.set-nav {
  flex: none;
  width: 210px;
  padding: 8px 10px 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-right: 1px solid var(--line);
  overflow-y: auto;
}
.set-nav button {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 0;
  border-radius: 12px;
  background: none;
  color: var(--text-2);
  text-align: left;
  font-size: 14px;
  font-weight: 600;
}
.set-nav button:hover {
  background: var(--panel-3);
  color: var(--text);
}
.set-nav button.on {
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  color: var(--accent);
}
.set-body {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  padding: 6px 26px 30px;
}
.set-body h3 {
  font-size: 15px;
  margin: 22px 0 10px;
  color: var(--text);
}
.set-body h3:first-child {
  margin-top: 8px;
}
.logo-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.logo-prev {
  display: grid;
  place-items: center;
  min-width: 80px;
  min-height: 64px;
  padding: 6px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--line);
}
.logo-prev .brand-mono.lg,
.logo-prev .brand-logo.lg {
  margin: 0;
}
.loc-now {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--line);
  font-size: 14px;
}
.loc-now .i {
  color: var(--accent);
}
.loc-now a {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  text-decoration: none;
}
.key-card {
  padding: 14px 16px;
  margin-bottom: 12px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}
.kc-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.kc-head > .i {
  width: 22px;
  height: 22px;
  color: var(--accent);
}
.kc-head > div {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.kc-head span {
  font-size: 12.5px;
  color: var(--text-3);
}
.welcome-box {
  padding: 14px 16px 4px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}
.users {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.u-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--line);
}
.u-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.u-main b {
  font-size: 14px;
}
.u-main em {
  font-style: normal;
  color: var(--accent);
  font-weight: 600;
}
.u-main span {
  font-size: 12px;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cred-box {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}
.cred-box > div {
  flex: 1;
}
.cred-box pre {
  margin: 8px 0 0;
  font: 13px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre-wrap;
  color: var(--text);
}
.snippet-preview {
  display: grid;
  place-items: center;
  padding: 26px;
  margin-bottom: 10px;
  border-radius: 16px;
  background: #f4f6fa;
}
textarea.code {
  font: 12.5px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  margin-bottom: 8px;
  color: var(--text-2);
}
.b-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  margin-bottom: 6px;
}
.b-row > div {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.b-row span {
  font-size: 12.5px;
  color: var(--text-3);
}


/* ---------------- Help list ---------------- */
.help-steps {
  list-style: none;
  margin: 4px 0 14px;
  padding: 0;
  display: grid;
  gap: 12px;
}
.help-steps li {
  display: flex;
  gap: 12px;
}
.hs-ic {
  display: grid;
  place-items: center;
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent);
}
.help-steps b {
  font-size: 14px;
}
.help-steps p {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--text-2);
}
.help-steps p b {
  font-size: 13px;
  color: var(--text);
}

/* Keep top controls, toasts and bars clear of the open side panel (desktop) */
@media (min-width: 761px) {
  .topbar,
  .tourbar,
  .editbar,
  .toasts,
  .subtitle {
    transition-property: opacity, transform, right, left;
    transition-duration: 0.45s;
    transition-timing-function: var(--ease);
  }
  body.drawer-open .topbar {
    right: calc(var(--drawer-w) + 26px);
  }
  body.drawer-open .tourbar,
  body.drawer-open .editbar,
  body.drawer-open .toasts,
  body.drawer-open .subtitle {
    left: calc((100vw - var(--drawer-w) - 12px) / 2);
  }
  body.drawer-open .editbar {
    max-width: calc(100vw - var(--drawer-w) - 40px);
  }
  body.plant-ui .subtitle {
    left: calc((var(--zones-w) + 32px + 100vw - 70px) / 2);
    max-width: min(760px, calc(100vw - var(--zones-w) - 150px));
  }
  body.plant-ui.drawer-open .subtitle {
    left: calc((var(--zones-w) + 32px + 100vw - var(--drawer-w) - 80px) / 2);
    max-width: min(700px, calc(100vw - var(--drawer-w) - var(--zones-w) - 140px));
  }
  body.drawer-open .eb-tools .btn span {
    display: none;
  }
  body.drawer-open .eb-tools .btn {
    width: 36px;
    padding: 0;
  }
  .uploads {
    left: calc(var(--zones-w) + 32px);
  }
}

/* ---------------- Mobile ---------------- */
@media (max-width: 760px) {
  :root {
    --drawer-w: 100vw;
  }
  html,
  body {
    font-size: 14.5px;
  }
  .topbar {
    top: max(8px, env(safe-area-inset-top));
    left: 8px;
    right: 8px;
  }
  .brand {
    padding-right: 12px;
  }
  .brand-text small {
    display: none;
  }
  .hide-sm {
    display: none !important;
  }
  .tb-actions .btn span {
    display: none;
  }
  .tb-actions .btn.sm {
    width: 36px;
    padding: 0;
  }
  .intro {
    left: 8px;
    right: 8px;
    bottom: max(8px, env(safe-area-inset-bottom));
    width: auto;
  }
  .intro-card {
    padding: 22px 20px 18px;
    border-radius: 22px;
  }
  .intro-brand {
    display: none;
  }
  .intro-actions .btn {
    flex: 1;
  }
  .zones-panel,
  body.editing .zones-panel {
    left: 8px;
    right: 8px;
    top: auto;
    bottom: max(8px, env(safe-area-inset-bottom));
    width: auto;
    max-height: 58vh;
    border-radius: 20px;
    transform: translateY(16px);
  }
  .plant-ui .zones-panel {
    transform: none;
  }
  .zones-panel.collapsed .zp-collapse .i {
    transform: rotate(180deg);
  }
  .map-controls {
    right: 8px;
    bottom: 96px;
    gap: 6px;
  }
  .map-controls .ctl-group:nth-child(1),
  .map-controls .hide-ios {
    display: none;
  }
  .ctl-group button {
    width: 40px;
    height: 38px;
  }
  body.drawer-open .map-controls,
  #zones:not(.collapsed) ~ #controls {
    right: 8px;
    opacity: 0 !important;
    pointer-events: none;
  }
  .drawer,
  .drawer.open {
    top: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    border-radius: 0;
    border: 0;
    padding-top: env(safe-area-inset-top);
  }
  .drawer {
    transform: translateY(105%);
  }
  .dr-titles h2 {
    font-size: 18px;
  }
  .stage {
    margin: 0 10px;
  }
  .stage-nav {
    opacity: 1;
    width: 36px;
    height: 36px;
  }
  .editbar {
    top: auto;
    bottom: max(8px, env(safe-area-inset-bottom));
    left: 8px;
    right: 8px;
    transform: none;
    border-radius: 18px;
    animation: rise 0.4s var(--ease) both;
  }
  .eb-left {
    display: none;
  }
  .eb-tools .btn span {
    display: none;
  }
  body.editing .zones-panel {
    bottom: 72px;
  }
  .hintbar {
    top: auto;
    bottom: 80px;
    flex-direction: column;
    align-items: stretch;
  }
  body.drawer-open .hintbar {
    left: 8px;
    max-width: none;
  }
  .tourbar {
    top: auto;
    bottom: max(10px, env(safe-area-inset-bottom));
    max-width: calc(100vw - 16px);
  }
  .tb-steps {
    display: none;
  }
  body.guided.drawer-open .dr-foot {
    padding-bottom: 76px;
  }
  .subtitle {
    font-size: 15px;
    top: calc(max(8px, env(safe-area-inset-top)) + 60px);
    bottom: auto;
    padding: 10px 6px 10px 14px;
    text-align: left;
  }
  .toasts {
    top: calc(max(8px, env(safe-area-inset-top)) + 60px);
    bottom: auto;
  }
  .maplibregl-ctrl-bottom-left {
    bottom: 76px;
  }
  .hintbar {
    width: auto;
    left: 8px;
    right: 8px;
    transform: none;
  }
  .hintbar.show {
    transform: none;
  }
  .uploads {
    left: 8px;
    right: 8px;
    width: auto;
    bottom: 80px;
  }
  .fld-row {
    grid-template-columns: 1fr;
  }
  .set-wrap {
    flex-direction: column;
    height: calc(100vh - 100px);
    height: calc(100dvh - 100px);
  }
  .set-nav {
    width: auto;
    flex-direction: row;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    overflow-x: auto;
    padding: 4px 10px 8px;
  }
  .set-nav button span {
    white-space: nowrap;
  }
  .set-body {
    padding: 4px 16px 24px;
  }
  .modal-wrap {
    padding: 8px;
  }
  .u-row {
    flex-wrap: wrap;
  }
  .auth-card {
    padding: 26px 20px 20px;
  }
  .screen.side {
    place-items: end stretch;
    background: none;
  }
  .screen.side .auth-card {
    margin: 0;
    max-height: 62vh;
    overflow-y: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
