:root {
  --bg: #f3f1ec;
  --bg-deep: #e5e0d6;
  --panel: rgba(252, 250, 246, 0.9);
  --panel-strong: rgba(255, 253, 249, 0.98);
  --line: rgba(31, 32, 34, 0.1);
  --line-strong: rgba(31, 32, 34, 0.18);
  --text: #131416;
  --muted: #6d7178;
  --brand: #0f1115;
  --brand-soft: rgba(15, 17, 21, 0.06);
  --brand-strong: #000000;
  --accent: #ff5a36;
  --danger: #d94646;
  --shadow-lg: 0 28px 80px rgba(14, 18, 24, 0.08);
  --shadow-md: 0 16px 36px rgba(14, 18, 24, 0.06);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --phone-width: min(100vw, 460px);
  color-scheme: light;
  font-family: "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  color: var(--text);
  background:
    radial-gradient(circle at 0% 0%, rgba(255, 255, 255, 0.7), transparent 22%),
    radial-gradient(circle at 100% 0%, rgba(231, 224, 211, 0.8), transparent 28%),
    linear-gradient(180deg, #f8f5ef 0%, #efebe2 100%);
}

img {
  display: block;
  max-width: 100%;
}

button,
input,
textarea,
select {
  font: inherit;
}

.is-hidden {
  display: none !important;
}

.field {
  display: grid;
  gap: 8px;
}

.field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(104, 126, 158, 0.22);
  background: #fff;
  color: var(--text);
}

.field textarea {
  resize: vertical;
}

.primary-button,
.secondary-button,
.ghost-button,
.delete-button {
  min-height: 42px;
  padding: 0 16px;
  border: 0;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  cursor: pointer;
  font-weight: 700;
}

.primary-button {
  background: var(--brand);
  color: #fff;
}

.secondary-button,
.ghost-button {
  background: rgba(19, 20, 22, 0.05);
  color: var(--text);
}

.ghost-button {
  border: 1px solid var(--line);
}

.delete-button {
  background: rgba(228, 88, 105, 0.12);
  color: var(--danger);
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--brand);
  color: #fff;
  font-size: 22px;
  font-weight: 800;
}

.portal-body {
  min-height: 100vh;
}

.portal-page {
  display: flex;
  justify-content: center;
  padding: 0;
}

.portal-phone-shell {
  width: var(--phone-width);
  min-height: 100vh;
  background: rgba(255, 255, 255, 0.24);
  backdrop-filter: blur(6px);
}

.portal-canvas-card {
  width: 100%;
}

.portal-canvas-wrap {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: linear-gradient(180deg, #dff0ff 0%, #eff7fc 100%);
}

.portal-canvas-wrap.is-admin {
  border-radius: 22px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.6);
}

.portal-canvas-image {
  width: 100%;
  height: auto;
}

.portal-hotspots {
  position: absolute;
  inset: 0;
}

.hotspot-link,
.hotspot-editor {
  position: absolute;
  display: block;
  border-radius: 6px;
}

.hotspot-link:focus-visible {
  outline: 2px solid rgba(35, 104, 242, 0.92);
  outline-offset: -2px;
  background: rgba(35, 104, 242, 0.12);
}

.marketing-body {
  min-height: 100vh;
}

.marketing-shell {
  padding: 24px;
}

.marketing-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 0 22px;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  border-bottom: 1px solid rgba(19, 20, 22, 0.08);
}

.marketing-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.marketing-brand p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.12em;
}

.marketing-brand strong {
  display: block;
  margin-top: 4px;
  font-size: 16px;
}

.marketing-links {
  display: flex;
  align-items: center;
  gap: 18px;
}

.marketing-links a {
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.marketing-main {
  display: grid;
  gap: 28px;
  padding-top: 26px;
}

.hero-section,
.marketing-section {
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.hero-section {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(380px, 0.9fr);
  gap: 44px;
  padding: 24px 0 12px;
  align-items: start;
  min-height: calc(100vh - 140px);
}

.hero-grid-tag {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.hero-copy h1 {
  margin: 22px 0 0;
  max-width: 10ch;
  font-size: clamp(46px, 6.6vw, 92px);
  line-height: 0.96;
  letter-spacing: -0.07em;
  font-weight: 900;
}

.hero-copy p {
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.95;
  max-width: 56ch;
}

.hero-badge {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  padding: 0 12px;
  border-radius: 0;
  background: transparent;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.16em;
  border-bottom: 2px solid var(--accent);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  margin-top: 34px;
  border-top: 1px solid rgba(19, 20, 22, 0.1);
  border-bottom: 1px solid rgba(19, 20, 22, 0.1);
}

.hero-stat {
  padding: 18px 18px 20px 0;
  border-radius: 0;
  background: transparent;
  border-right: 1px solid rgba(19, 20, 22, 0.08);
}

.hero-stat:last-child {
  border-right: 0;
}

.hero-stat span {
  color: var(--muted);
  font-size: 12px;
}

.hero-stat strong {
  display: block;
  margin-top: 8px;
  font-size: 32px;
  letter-spacing: -0.05em;
}

.hero-stage {
  display: grid;
  align-items: center;
}

.hero-stage-panel {
  padding: 22px;
  border-radius: 0;
  background: #fdfbf7;
  box-shadow: none;
  border: 1px solid rgba(19, 20, 22, 0.1);
}

.hero-stage-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(19, 20, 22, 0.08);
}

.hero-stage-caption,
.hero-stage-index {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.hero-stage-caption {
  color: var(--muted);
}

.hero-stage-index {
  color: var(--text);
}

.hero-stage-body {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) 132px;
  gap: 16px;
  margin-top: 18px;
  min-height: 420px;
}

.hero-sidebar,
.hero-inspector {
  display: grid;
  gap: 10px;
}

.hero-sidebar-pill,
.hero-inspector-card,
.hero-canvas-card {
  border-radius: 14px;
  background: #ffffff;
  box-shadow: none;
  border: 1px solid rgba(19, 20, 22, 0.08);
}

.hero-sidebar-pill {
  height: 54px;
}

.hero-sidebar-pill.is-active {
  background: rgba(255, 90, 54, 0.08);
  border-color: rgba(255, 90, 54, 0.4);
}

.hero-canvas {
  position: relative;
  padding: 16px;
  border-radius: 18px;
  background:
    linear-gradient(rgba(19, 20, 22, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(19, 20, 22, 0.06) 1px, transparent 1px),
    linear-gradient(180deg, #f3efe8, #fbfaf7);
  background-size: 28px 28px, 28px 28px, auto;
  border: 1px solid rgba(19, 20, 22, 0.08);
}

.hero-canvas-card-large {
  height: 100%;
}

.hero-canvas-axis {
  position: absolute;
  background: rgba(255, 90, 54, 0.28);
}

.hero-canvas-axis-x {
  left: 12%;
  right: 12%;
  top: 50%;
  height: 1px;
}

.hero-canvas-axis-y {
  top: 12%;
  bottom: 12%;
  left: 50%;
  width: 1px;
}

.hero-hotspot {
  position: absolute;
  padding: 8px 10px;
  border-radius: 999px;
  background: #131416;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  box-shadow: none;
}

.hero-hotspot-a {
  top: 18%;
  left: 12%;
}

.hero-hotspot-b {
  top: 44%;
  right: 12%;
}

.hero-hotspot-c {
  bottom: 14%;
  left: 28%;
}

.hero-inspector-card {
  min-height: 118px;
}

.hero-inspector-card.small {
  min-height: 74px;
}

.marketing-section {
  padding: 32px 0 0;
  border-top: 1px solid rgba(19, 20, 22, 0.08);
}

.section-head p {
  margin: 0;
  color: var(--accent);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.section-head h2 {
  margin: 12px 0 0;
  max-width: 14ch;
  font-size: clamp(34px, 4vw, 58px);
  line-height: 0.98;
  letter-spacing: -0.05em;
}

.section-rule {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  padding: 12px 0 0;
  border-top: 1px solid rgba(19, 20, 22, 0.08);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.feature-grid,
.template-grid,
.scenario-grid {
  display: grid;
  gap: 16px;
  margin-top: 22px;
}

.feature-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.template-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.scenario-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.feature-card,
.template-card,
.scenario-card {
  padding: 20px 0 22px;
  border-radius: 0;
  background: transparent;
  border-top: 1px solid rgba(19, 20, 22, 0.08);
}

.feature-card strong,
.scenario-card strong {
  display: block;
  font-size: 18px;
}

.feature-card p,
.scenario-card p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.75;
}

.template-card {
  display: grid;
  gap: 12px;
}

.template-card-preview {
  min-height: 180px;
  border-radius: 16px;
  background:
    linear-gradient(rgba(19, 20, 22, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(19, 20, 22, 0.06) 1px, transparent 1px),
    linear-gradient(180deg, #f1ede6, #fbfaf7);
  background-size: 24px 24px, 24px 24px, auto;
  border: 1px solid rgba(19, 20, 22, 0.08);
}

.template-card-body {
  display: grid;
  gap: 8px;
}

.template-card-body p {
  margin: 0;
  color: var(--brand);
  font-size: 12px;
  font-weight: 700;
}

.template-card-body strong {
  font-size: 18px;
}

.template-card-body span,
.template-card-body small {
  color: var(--muted);
  line-height: 1.7;
}

.studio-app,
.console-body {
  min-height: 100vh;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
}

.auth-card {
  width: min(100%, 560px);
  padding: 34px;
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(16px);
}

.auth-card-wide {
  width: min(100%, 540px);
}

.auth-kicker,
.panel-kicker {
  margin: 0 0 8px;
  color: var(--brand);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.auth-brand h1 {
  margin: 0;
  font-size: clamp(34px, 5vw, 48px);
  line-height: 1.02;
}

.auth-brand p {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.auth-tabs {
  display: inline-grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 28px;
  padding: 6px;
  background: rgba(21, 39, 65, 0.06);
  border-radius: 999px;
}

.auth-tab,
.icon-button,
.rail-button,
.compact-row,
.context-menu-item,
.user-pill-button,
.hotspot-editor {
  border: 0;
  cursor: pointer;
}

.auth-tab {
  min-height: 40px;
  padding: 0 18px;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}

.auth-tab.is-active {
  background: #fff;
  color: var(--text);
  box-shadow: var(--shadow-md);
}

.auth-form {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}

.auth-message {
  min-height: 24px;
  margin: 14px 0 0;
  color: var(--muted);
}

.auth-message.is-error {
  color: var(--danger);
}

.studio-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: 74px 1fr;
  background:
    radial-gradient(circle at 0% 0%, rgba(255, 255, 255, 0.84), transparent 20%),
    linear-gradient(180deg, #eff3f8 0%, #e7edf5 100%);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 18px;
  background: rgba(244, 247, 251, 0.86);
  border-bottom: 1px solid rgba(121, 139, 163, 0.16);
  backdrop-filter: blur(10px);
}

.topbar-brand,
.topbar-metrics,
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.brand-copy strong {
  display: block;
  margin-top: 4px;
  font-size: 16px;
}

.metric-pill,
.status-pill,
.user-pill {
  border-radius: 14px;
  border: 1px solid rgba(121, 139, 163, 0.16);
  background: rgba(255, 255, 255, 0.68);
  box-shadow: 0 10px 24px rgba(44, 66, 94, 0.06);
}

.metric-pill {
  min-width: 86px;
  padding: 10px 12px;
  display: grid;
  gap: 4px;
}

.metric-pill span {
  color: var(--muted);
  font-size: 11px;
}

.metric-pill strong {
  font-size: 13px;
}

.status-pill {
  padding: 10px 14px;
  color: #37506f;
  font-size: 12px;
  font-weight: 700;
  background: rgba(227, 235, 245, 0.88);
}

.status-pill.is-dirty {
  color: var(--danger);
  background: rgba(228, 88, 105, 0.1);
}

.user-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px 6px 14px;
  font-weight: 700;
}

.user-pill-button {
  min-height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(88, 107, 132, 0.1);
  color: var(--text);
}

.studio-main {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 14px;
  padding: 14px;
}

.studio-rail {
  padding: 12px 8px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(243, 246, 250, 0.94), rgba(232, 238, 246, 0.94));
  box-shadow: 0 18px 34px rgba(55, 74, 101, 0.08);
  display: grid;
  align-content: start;
  gap: 10px;
  border: 1px solid rgba(255, 255, 255, 0.7);
}

.rail-button {
  display: grid;
  gap: 6px;
  justify-items: center;
  padding: 12px 6px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.38);
  color: #73839a;
  border: 1px solid transparent;
}

.rail-button.is-active {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(244, 247, 251, 0.96));
  color: #1f2f45;
  border-color: rgba(150, 167, 189, 0.26);
  box-shadow: 0 10px 18px rgba(62, 84, 114, 0.1);
}

.rail-button-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(133, 149, 171, 0.12);
  font-size: 13px;
  font-weight: 800;
}

.rail-button-label {
  font-size: 12px;
  font-weight: 700;
}

.workspace-grid {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr) 350px;
  gap: 16px;
  min-width: 0;
}

.library-panel,
.stage-panel,
.inspector-panel {
  min-height: 0;
}

.library-panel,
.inspector-panel {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 14px;
  padding: 14px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(247, 249, 252, 0.94), rgba(239, 243, 248, 0.94));
  box-shadow: 0 18px 40px rgba(49, 69, 96, 0.08);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.76);
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.panel-head h2 {
  margin: 0;
  font-size: 24px;
}

.panel-subhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.panel-subhead-label {
  opacity: 0.78;
}

.panel-subhead-value {
  color: #60758f;
}

.layer-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.layer-toolbar-chip {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(233, 239, 246, 0.86);
  color: #71849e;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border: 1px solid rgba(148, 164, 185, 0.12);
}

.panel-scroll {
  min-height: 0;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 12px;
}

.inspector-frame {
  min-height: 0;
  padding: 12px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(251, 252, 254, 0.7), rgba(242, 246, 251, 0.74));
  border: 1px solid rgba(140, 157, 179, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.icon-button {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: rgba(219, 227, 237, 0.9);
  color: #324864;
  font-weight: 800;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.mini-card,
.inspector-group {
  display: grid;
  gap: 12px;
  padding: 18px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(251, 252, 254, 0.94), rgba(242, 246, 251, 0.94));
  border: 1px solid rgba(140, 157, 179, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.mini-card.is-selected {
  border-color: rgba(90, 124, 170, 0.28);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 10px 24px rgba(63, 89, 123, 0.08);
}

.mini-card-kicker {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.mini-card strong,
.fact-row strong {
  font-size: 14px;
}

.mini-card small,
.fact-row span {
  color: var(--muted);
  line-height: 1.6;
}

.list-section,
.fact-list,
.menu-tree,
.menu-tree-children {
  display: grid;
  gap: 10px;
}

.compact-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border-radius: 16px;
  background: rgba(248, 250, 253, 0.92);
  color: var(--text);
  text-align: left;
  border: 1px solid rgba(142, 158, 179, 0.1);
  position: relative;
}

.compact-row.is-selected {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(241, 246, 252, 0.96));
  border-color: rgba(94, 126, 169, 0.2);
  box-shadow: 0 8px 18px rgba(71, 97, 132, 0.08);
}

.compact-row.is-selected::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 999px;
  background: linear-gradient(180deg, #5c7ea9, #8ca9ca);
}

.compact-row.is-drag-over {
  border-color: rgba(255, 122, 89, 0.46);
  background: rgba(255, 122, 89, 0.08);
}

.compact-row-index {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: rgba(21, 39, 65, 0.08);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.compact-row-main {
  display: grid;
  gap: 3px;
  min-width: 0;
  flex: 1;
}

.compact-row-main small {
  color: var(--muted);
  font-size: 12px;
}

.row-tag {
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(228, 88, 105, 0.12);
  color: var(--danger);
  font-size: 11px;
  font-weight: 700;
}

.menu-tree-children {
  padding-left: 18px;
  margin-left: 10px;
  border-left: 2px solid rgba(35, 104, 242, 0.1);
}

.fact-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(203, 214, 228, 0.58);
}

.fact-row:last-child {
  border-bottom: 0;
}

.stage-panel {
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 14px;
}

.stage-system-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 4px;
}

.stage-system-chip {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(236, 241, 247, 0.84);
  border: 1px solid rgba(148, 164, 185, 0.16);
  color: #70839d;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.stage-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(244, 247, 251, 0.94), rgba(236, 242, 248, 0.94));
  border: 1px solid rgba(255, 255, 255, 0.74);
  box-shadow: 0 14px 28px rgba(57, 77, 104, 0.06);
}

.stage-toolbar-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.tool-chip,
.tool-readout {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.tool-chip {
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(148, 164, 185, 0.16);
  color: #2f4663;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.tool-readout {
  background: rgba(228, 235, 244, 0.9);
  color: #6c8099;
  border: 1px solid rgba(148, 164, 185, 0.12);
}

.shortcut-help-panel {
  padding: 14px 16px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(244, 247, 251, 0.94), rgba(236, 242, 248, 0.94));
  border: 1px solid rgba(255, 255, 255, 0.74);
  box-shadow: 0 14px 28px rgba(57, 77, 104, 0.06);
}

.shortcut-help-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 18px;
}

.shortcut-help-grid span {
  color: #5a7190;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.shortcut-help-grid strong {
  color: #243a57;
  font-size: 13px;
  font-weight: 700;
}

.stage-topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(247, 249, 252, 0.94), rgba(238, 243, 249, 0.94));
  box-shadow: 0 18px 40px rgba(49, 69, 96, 0.08);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.76);
}

.selection-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(223, 232, 243, 0.94);
  color: #35506f;
  font-size: 12px;
  font-weight: 700;
}

.stage-title {
  margin: 10px 0 0;
  font-size: 26px;
}

.stage-hint {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.stage-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.stage-surface {
  position: relative;
  min-height: 620px;
  overflow: hidden;
  border-radius: 28px;
  background: linear-gradient(180deg, #dde6f1 0%, #d2dde9 100%);
  box-shadow: 0 24px 50px rgba(52, 71, 98, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.7);
}

.stage-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(112, 131, 156, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(112, 131, 156, 0.08) 1px, transparent 1px);
  background-size: 24px 24px;
}

.stage-float-card {
  position: absolute;
  top: 18px;
  left: 18px;
  z-index: 2;
  max-width: 320px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(248, 250, 253, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.74);
  box-shadow: 0 16px 34px rgba(56, 74, 103, 0.08);
  backdrop-filter: blur(10px);
}

.stage-float-card strong {
  display: block;
  font-size: 14px;
}

.stage-float-card p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.stage-statusbar {
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: 18px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(247, 249, 252, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.74);
  box-shadow: 0 14px 30px rgba(56, 74, 103, 0.08);
  backdrop-filter: blur(10px);
}

.stage-status-group {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.stage-status-label {
  color: #7f90a6;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.stage-status-value {
  color: #2a3f5d;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 2px;
}

.action-row .secondary-button,
.action-row .ghost-button,
.action-row .delete-button {
  flex: 1 1 140px;
}

.preview-shell {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  min-height: 100%;
  padding: 72px 30px 56px 66px;
}

.preview-phone {
  width: min(100%, 560px);
  padding: 12px;
  border-radius: 36px;
  background: linear-gradient(180deg, rgba(248, 250, 253, 0.88), rgba(226, 235, 245, 0.94));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.74), 0 26px 56px rgba(53, 72, 100, 0.16);
  transform-origin: center center;
  transition: transform 140ms ease;
}

.canvas-ruler {
  position: absolute;
  z-index: 1;
  color: #7a8da6;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  pointer-events: none;
}

.canvas-ruler-x {
  top: 28px;
  left: 84px;
  right: 42px;
  display: flex;
  justify-content: space-between;
}

.canvas-ruler-y {
  left: 24px;
  top: 92px;
  bottom: 84px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  writing-mode: vertical-rl;
  text-orientation: mixed;
}

.hotspot-editor {
  padding: 0;
  border: 2px solid rgba(64, 102, 152, 0.84);
  background: rgba(119, 155, 210, 0.16);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.34);
  transition: border-color 120ms ease, background 120ms ease, box-shadow 120ms ease;
}

.hotspot-editor:hover,
.hotspot-editor.is-selected {
  border-color: rgba(255, 122, 89, 0.94);
  background: rgba(255, 122, 89, 0.18);
  box-shadow: 0 0 0 3px rgba(255, 122, 89, 0.12);
}

.hotspot-editor.is-selected .hotspot-editor-label,
.hotspot-editor.is-selected .hotspot-editor-order {
  background: rgba(255, 122, 89, 0.94);
}

.hotspot-editor-order {
  position: absolute;
  left: 6px;
  bottom: 6px;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(15, 25, 39, 0.84);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
}

.hotspot-editor-label {
  position: absolute;
  left: 6px;
  top: 6px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(15, 25, 39, 0.84);
  color: #fff;
  font-size: 12px;
  line-height: 1.35;
  white-space: nowrap;
}

.hotspot-resize {
  position: absolute;
  right: -7px;
  bottom: -7px;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  border: 2px solid var(--danger);
  background: #fff;
  cursor: nwse-resize;
}

.selection-marquee {
  position: absolute;
  border: 1px solid rgba(255, 122, 89, 0.94);
  background: rgba(255, 122, 89, 0.14);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.46) inset;
  pointer-events: none;
  z-index: 5;
}

.inspector-group-head h3 {
  margin: 0;
  font-size: 16px;
  letter-spacing: -0.02em;
}

.inspector-group-head p,
.inspector-note {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.72;
}

.inspector-note {
  padding: 13px 14px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(231, 238, 247, 0.96), rgba(223, 232, 243, 0.9));
  color: #35506f;
  border: 1px solid rgba(150, 167, 189, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.76);
}

.grid-two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.inspector-frame .field span {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.inspector-frame .field input,
.inspector-frame .field textarea,
.inspector-frame .field select {
  min-height: 44px;
  border-radius: 14px;
  border: 1px solid rgba(160, 175, 196, 0.18);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.inspector-frame .field textarea {
  min-height: 92px;
}

.inspector-frame .upload-box {
  border-radius: 16px;
  border: 1px dashed rgba(136, 156, 181, 0.38);
  background: linear-gradient(180deg, rgba(248, 250, 253, 0.96), rgba(241, 246, 252, 0.94));
  padding: 16px;
  display: grid;
  gap: 8px;
}

.inspector-frame .upload-box strong {
  font-size: 14px;
}

.inspector-frame .upload-box small {
  color: var(--muted);
  line-height: 1.65;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.upload-box {
  display: grid;
  gap: 6px;
  padding: 18px;
  border-radius: 16px;
  border: 1px dashed rgba(35, 104, 242, 0.26);
  background: rgba(255, 255, 255, 0.9);
  cursor: pointer;
}

.upload-box input {
  display: none;
}

.upload-box strong {
  font-size: 15px;
}

.upload-box small {
  color: var(--muted);
  line-height: 1.6;
}

.context-menu {
  position: fixed;
  z-index: 100;
  min-width: 236px;
  padding: 10px;
  border-radius: 18px;
  background: rgba(18, 26, 39, 0.97);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 24px 48px rgba(8, 14, 23, 0.32);
  backdrop-filter: blur(20px);
}

.context-menu-section {
  padding: 8px 10px 6px;
  color: rgba(187, 202, 222, 0.88);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.context-menu-divider {
  height: 1px;
  margin: 8px 4px;
  background: rgba(255, 255, 255, 0.08);
}

.context-menu-item {
  width: 100%;
  min-height: 40px;
  padding: 0 12px;
  border-radius: 12px;
  background: transparent;
  color: #edf4ff;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.context-menu-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.context-menu-item-label {
  font-size: 13px;
  font-weight: 700;
}

.context-menu-item-shortcut {
  color: rgba(187, 202, 222, 0.76);
  font-size: 11px;
  font-weight: 700;
}

.context-menu-item.is-danger {
  color: #ffadb6;
}

.inspector-overview {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(233, 239, 246, 0.98), rgba(223, 232, 243, 0.94));
  border: 1px solid rgba(143, 160, 183, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.inspector-overview-head {
  display: grid;
  gap: 8px;
}

.inspector-overview-label {
  display: inline-flex;
  width: fit-content;
  min-height: 24px;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: #46627f;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.inspector-overview-head strong {
  font-size: 24px;
  letter-spacing: -0.04em;
}

.inspector-overview-head p {
  margin: 0;
  color: #4d6683;
  font-size: 13px;
  line-height: 1.72;
}

.inspector-overview-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.inspector-overview-fact {
  display: grid;
  gap: 6px;
  padding: 12px 12px 13px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.56);
  border: 1px solid rgba(153, 168, 188, 0.14);
}

.inspector-overview-fact span {
  color: #71849c;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.inspector-overview-fact strong {
  font-size: 13px;
  color: #22364f;
}

.inspector-shortcuts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.inspector-shortcut-chip {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.64);
  color: #536f8d;
  font-size: 11px;
  font-weight: 700;
}

@media (max-width: 1440px) {
  .workspace-grid {
    grid-template-columns: 248px minmax(0, 1fr) 320px;
  }

  .feature-grid,
  .scenario-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .template-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

  .inspector-panel {
    grid-column: 1 / -1;
  }

  .hero-section {
    grid-template-columns: 1fr;
  }

  .inspector-overview-facts {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 960px) {
  .topbar,
  .marketing-nav {
    flex-direction: column;
    align-items: stretch;
  }

  .topbar-brand,
  .topbar-metrics,
  .topbar-actions,
  .marketing-links,
  .stage-tools {
    flex-wrap: wrap;
  }

  .studio-main {
    grid-template-columns: 1fr;
  }

  .studio-rail {
    grid-auto-flow: column;
    justify-content: start;
  }

  .workspace-grid,
  .template-grid,
  .feature-grid,
  .scenario-grid {
    grid-template-columns: 1fr;
  }

  .hero-stats {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .auth-shell,
  .studio-main,
  .marketing-shell {
    padding: 14px;
  }

  .auth-card,
  .studio-rail,
  .library-panel,
  .inspector-panel,
  .stage-topbar,
  .stage-surface,
  .marketing-nav,
  .hero-section,
  .marketing-section {
    border-radius: 20px;
  }

  .topbar {
    padding: 14px;
  }

  .stage-topbar,
  .panel-head {
    flex-direction: column;
    align-items: stretch;
  }

  .grid-two,
  .hero-stage-body {
    grid-template-columns: 1fr;
  }

  .preview-phone {
    width: 100%;
  }

  .stage-float-card {
    position: static;
    margin: 18px 18px 0;
    max-width: none;
  }

  .preview-shell {
    padding-top: 18px;
  }
}
