:root {
  color-scheme: dark;
  --bg: #08080a;
  --bg-soft: #0d0d10;
  --surface: #111114;
  --surface-2: #151519;
  --surface-3: #1a1a1f;
  --surface-4: #202027;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #f4f2ef;
  --text-soft: #c2c0c4;
  --muted: #86858d;
  --muted-2: #8e8c96;
  --gold: #c7a86b;
  --gold-strong: #e2c684;
  --violet: #8b78ff;
  --violet-soft: rgba(139, 120, 255, 0.15);
  --green: #62d59b;
  --green-soft: rgba(98, 213, 155, 0.14);
  --blue: #6ca7ff;
  --blue-soft: rgba(108, 167, 255, 0.14);
  --amber: #e7b764;
  --amber-soft: rgba(231, 183, 100, 0.14);
  --pink: #ef8ab8;
  --pink-soft: rgba(239, 138, 184, 0.14);
  --cyan: #58cfda;
  --cyan-soft: rgba(88, 207, 218, 0.14);
  --danger: #f18484;
  --danger-soft: rgba(241, 132, 132, 0.14);
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.48);
  --sidebar: 238px;
  --font-ui: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: Georgia, "Times New Roman", serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-width: 320px;
  min-height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

html {
  background: var(--bg);
}

@media (display-mode: standalone) {
  body {
    user-select: none;
    -webkit-user-select: none;
  }

  input,
  textarea,
  [contenteditable="true"] {
    user-select: text;
    -webkit-user-select: text;
  }
}

body {
  min-height: 100vh;
  overflow: hidden;
}

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

button {
  color: inherit;
}

button,
a,
[role="button"] {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 2px solid rgba(139, 120, 255, 0.72);
  outline-offset: 2px;
}

.input:focus-visible,
.textarea:focus-visible,
.select:focus-visible,
.output-control:focus-visible,
.design-system-picker select:focus-visible {
  outline: 2px solid #a99cff;
  outline-offset: 2px;
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

svg {
  display: block;
}

.icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-sm {
  width: 15px;
  height: 15px;
}

.icon-lg {
  width: 22px;
  height: 22px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-2);
  color: var(--text-soft);
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease, transform 150ms ease;
  white-space: nowrap;
}

.btn:hover {
  background: var(--surface-3);
  border-color: var(--line-strong);
  color: var(--text);
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--text);
  border-color: var(--text);
  color: #111114;
  font-weight: 650;
}

.btn-primary:hover {
  background: #ffffff;
  border-color: #ffffff;
  color: #0c0c0e;
}

.btn-gold {
  background: linear-gradient(180deg, #d9bd80, #b99352);
  border-color: #d8bd80;
  color: #18130b;
  font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.34);
}

.btn-gold:hover {
  background: linear-gradient(180deg, #e3ca90, #c5a05f);
  border-color: #ead39e;
  color: #120f09;
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.055);
  border-color: rgba(255, 255, 255, 0.055);
}

.btn-danger {
  color: #ffb2b2;
  background: var(--danger-soft);
  border-color: rgba(241, 132, 132, 0.25);
}

.btn-icon {
  width: 38px;
  min-width: 38px;
  padding: 0;
}

.btn-sm {
  min-height: 32px;
  padding: 0 11px;
  border-radius: 8px;
  font-size: 12.5px;
}

.btn-lg {
  min-height: 46px;
  padding: 0 18px;
}

/* Form controls */
.field {
  display: grid;
  gap: 8px;
}

.field label,
.field-label {
  color: var(--text-soft);
  font-size: 12.5px;
  font-weight: 600;
}

.input,
.textarea,
.select {
  width: 100%;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #0d0d10;
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.015);
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.input::placeholder,
.textarea::placeholder {
  color: var(--muted-2);
}

.input:focus,
.textarea:focus,
.select:focus {
  outline: none;
  border-color: rgba(139, 120, 255, 0.65);
  box-shadow: 0 0 0 3px rgba(139, 120, 255, 0.12);
  background: #101014;
}

.textarea {
  min-height: 100px;
  padding: 11px 12px;
  resize: vertical;
}

.select {
  appearance: none;
  padding-right: 36px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position:
    calc(100% - 16px) calc(50% - 2px),
    calc(100% - 11px) calc(50% - 2px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 160px;
  gap: 12px;
}

.helper {
  color: var(--muted);
  font-size: 12px;
}

.error-text {
  color: #ff9a9a;
  font-size: 12px;
}

/* Brand */
.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--text);
}

.brand-symbol {
  display: inline-block;
  width: 28px;
  height: 24px;
  flex: 0 0 auto;
  background: url('/logo.svg') center / contain no-repeat;
  filter: invert(1) opacity(0.82) drop-shadow(0 8px 12px rgba(0, 0, 0, 0.35));
}

.brand-symbol::before,
.brand-symbol::after { content: none; }

.brand-name {
  font-family: var(--font-display);
  font-size: 17px;
  letter-spacing: 0.045em;
  white-space: nowrap;
}

.brand-prefix {
  color: rgba(210, 208, 211, 0.68);
}

.brand-product {
  color: var(--text);
}

/* Auth */
.auth-shell {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(440px, 0.82fr);
  width: 100vw;
  height: 100vh;
  min-height: 680px;
  overflow: hidden;
  background:
    radial-gradient(circle at 10% 5%, rgba(255, 255, 255, 0.06), transparent 32%),
    linear-gradient(125deg, #121216 0%, #08080a 62%, #050506 100%);
}

.auth-visual {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
  padding: 46px 54px 48px;
  overflow: hidden;
  border-right: 0;
}

.auth-visual::before {
  content: "";
  position: absolute;
  width: 920px;
  height: 748px;
  left: -180px;
  top: -42px;
  background: url('/logo.svg') center / contain no-repeat;
  filter: invert(1);
  opacity: 0.045;
  transform: rotate(-8deg);
  pointer-events: none;
}

.auth-visual::after {
  content: none;
}

.auth-glow {
  display: none;
}

.auth-copy {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin: auto 0;
  padding: 40px 0 70px;
}

.auth-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 22px;
  color: var(--gold-strong);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.auth-eyebrow::before {
  content: "";
  width: 34px;
  height: 1px;
  background: currentColor;
  opacity: 0.75;
}

.auth-title {
  max-width: 660px;
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(54px, 5.2vw, 86px);
  font-weight: 400;
  line-height: 0.98;
  letter-spacing: -0.035em;
}

.auth-title em {
  color: var(--text-soft);
  font-style: normal;
}

.auth-description {
  max-width: 540px;
  margin: 28px 0 0;
  color: var(--text-soft);
  font-size: 16px;
  line-height: 1.7;
}

.auth-proof {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 24px;
  color: var(--muted);
  font-size: 12px;
}

.auth-proof-group {
  display: flex;
  align-items: center;
}

.auth-proof .avatar {
  margin-left: -8px;
  border-color: transparent;
}

.auth-proof .avatar:first-child {
  margin-left: 0;
}

.auth-panel {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
  padding: 40px;
  background:
    radial-gradient(circle at 50% 35%, rgba(255, 255, 255, 0.04), transparent 48%);
}

.auth-card {
  width: min(100%, 430px);
  padding: 34px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(25, 25, 29, 0.92), rgba(13, 13, 16, 0.94));
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(22px);
}

.auth-card-header {
  margin-bottom: 26px;
  text-align: center;
}

.auth-card-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin: 0 auto 18px;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.auth-card-mark .brand-symbol {
  transform: scale(1.25);
}

.auth-card h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 400;
  line-height: 1.15;
}

.auth-title-prefix {
  color: rgba(210, 208, 211, 0.68);
}

.auth-card p {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.provider-list {
  display: grid;
  gap: 10px;
}

.provider-btn {
  position: relative;
  display: grid;
  grid-template-columns: 28px 1fr 18px;
  align-items: center;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #151519;
  color: var(--text-soft);
  cursor: pointer;
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease, color 150ms ease;
  text-align: left;
}

.provider-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.2);
  background: #1a1a1f;
  color: var(--text);
}

.provider-name {
  justify-self: center;
  padding-right: 22px;
  font-weight: 560;
}

.provider-mark {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  font-size: 20px;
  font-weight: 800;
}

.provider-mark .icon {
  width: 20px;
  height: 20px;
}

.microsoft-mark {
  display: grid;
  grid-template-columns: repeat(2, 6px);
  gap: 2px;
  width: 14px;
  height: 14px;
  justify-self: center;
  transform: translateX(-2px);
}

.microsoft-mark i {
  display: block;
  width: 6px;
  height: 6px;
}

.microsoft-mark i:nth-child(1) { background: #f35325; }
.microsoft-mark i:nth-child(2) { background: #81bc06; }
.microsoft-mark i:nth-child(3) { background: #05a6f0; }
.microsoft-mark i:nth-child(4) { background: #ffba08; }

.google-mark {
  font-family: Arial, sans-serif;
  font-size: 21px;
  line-height: 20px;
  background: conic-gradient(from -45deg, #4285f4 0 25%, #34a853 0 41%, #fbbc05 0 66%, #ea4335 0 84%, #4285f4 0);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.provider-chevron {
  color: var(--muted-2);
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  color: var(--muted-2);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--line);
}

.magic-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-top: 10px;
}

.auth-legal {
  margin-top: 22px;
  color: var(--muted-2);
  font-size: 10.5px;
  line-height: 1.55;
  text-align: center;
}

.auth-legal a {
  color: var(--muted);
  text-decoration: none;
}

.auth-demo-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 18px;
  padding: 11px 12px;
  border: 1px solid rgba(199, 168, 107, 0.16);
  border-radius: 9px;
  background: rgba(199, 168, 107, 0.07);
  color: #c9b890;
  font-size: 11px;
  line-height: 1.5;
}

/* App shell */
.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
  width: 100vw;
  height: 100vh;
  background: var(--bg);
}

.sidebar {
  position: relative;
  z-index: 12;
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100vh;
  border-right: 1px solid var(--line);
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.035), transparent 38%),
    #0c0c0f;
}

.sidebar-header {
  display: flex;
  align-items: center;
  height: 72px;
  padding: 0 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 12px 24px;
}

.sidebar-section {
  margin-top: 20px;
}

.sidebar-section:first-child {
  margin-top: 0;
}

.sidebar-label {
  margin: 0 10px 7px;
  color: var(--muted-2);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.nav-list {
  display: grid;
  gap: 3px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 38px;
  padding: 0 11px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #a8a7ad;
  cursor: pointer;
  text-decoration: none;
  text-align: left;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.045);
  color: var(--text);
}

.nav-item.active {
  border-color: rgba(255, 255, 255, 0.055);
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.085), rgba(255, 255, 255, 0.035));
  color: var(--text);
}

.nav-item .nav-badge {
  margin-left: auto;
  min-width: 20px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--muted);
  font-size: 10px;
  text-align: center;
}

.sidebar-user {
  display: grid;
  grid-template-columns: 34px 1fr 20px;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 66px;
  padding: 12px 14px;
  border: 0;
  border-top: 1px solid var(--line);
  background: #09090b;
  color: #f4f2ef;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.sidebar-user:hover {
  background: rgba(255, 255, 255, 0.025);
}

.sidebar-user-meta {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.sidebar-user-name {
  overflow: hidden;
  color: #f4f2ef;
  font-size: 12.5px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-user-role {
  display: block;
  overflow: hidden;
  margin-top: 0;
  color: #929198;
  font-size: 10.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-user > .icon {
  justify-self: end;
  color: #a4a3aa;
}

.avatar {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 50%;
  background: linear-gradient(145deg, #302d3f, #17171c);
  color: #ece8f5;
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.02em;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.24);
}

.avatar-sm {
  width: 24px;
  height: 24px;
  font-size: 8px;
}

.avatar-lg {
  width: 38px;
  height: 38px;
  font-size: 11px;
}

.avatar.violet { background: linear-gradient(145deg, #554a91, #201d31); }
.avatar.blue { background: linear-gradient(145deg, #325f98, #162233); }
.avatar.green { background: linear-gradient(145deg, #2b7458, #152b22); }
.avatar.amber { background: linear-gradient(145deg, #80623a, #2d2418); }
.avatar.pink { background: linear-gradient(145deg, #7e3f63, #2c1924); }
.avatar.cyan { background: linear-gradient(145deg, #2f6f76, #142b2f); }

.avatar-stack {
  display: flex;
  align-items: center;
}

.avatar-stack .avatar {
  margin-left: -7px;
  border-color: transparent;
}

.avatar-stack .avatar:first-child {
  margin-left: 0;
}

.avatar-more {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin-left: -7px;
  border: 2px solid transparent;
  border-radius: 50%;
  background: var(--surface-3);
  color: var(--muted);
  font-size: 9px;
}

.main-shell {
  min-width: 0;
  height: 100vh;
  overflow: hidden;
  background:
    radial-gradient(circle at 70% -10%, rgba(255, 255, 255, 0.035), transparent 34%),
    #09090b;
}

.main-scroll {
  height: 100%;
  overflow-y: auto;
}

.topbar {
  position: sticky;
  z-index: 10;
  top: 0;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 72px;
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(9, 9, 11, 0.88);
  backdrop-filter: blur(18px);
}

.topbar-title {
  min-width: 0;
  margin-right: auto;
}

.topbar-title h1,
.topbar-heading {
  overflow: hidden;
  margin: 0;
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 400;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-subtitle {
  overflow: hidden;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-box {
  position: relative;
  width: min(360px, 32vw);
}

.search-box .icon {
  position: absolute;
  left: 12px;
  top: 50%;
  color: var(--muted-2);
  transform: translateY(-50%);
  pointer-events: none;
}

.search-box input {
  width: 100%;
  min-height: 38px;
  padding: 0 38px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.028);
  color: var(--text);
}

.search-box input:focus {
  outline: none;
  border-color: rgba(139, 120, 255, 0.45);
  background: rgba(255, 255, 255, 0.045);
}

.search-shortcut {
  position: absolute;
  right: 10px;
  top: 50%;
  padding: 1px 6px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--muted-2);
  font-size: 9px;
  transform: translateY(-50%);
}

.page {
  width: 100%;
  max-width: 1520px;
  margin: 0 auto;
  padding: 34px 36px 52px;
}

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
}

.page-kicker {
  margin-bottom: 7px;
  color: var(--gold);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.page-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(34px, 3vw, 46px);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.025em;
}

.page-description {
  max-width: 660px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
}

/* Dashboard */
.dashboard-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(300px, 0.5fr);
  gap: 30px;
  min-height: 260px;
  margin-bottom: 30px;
  padding: 38px 40px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 85% 35%, rgba(255, 255, 255, 0.11), transparent 12%),
    linear-gradient(120deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.008));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.dashboard-hero::after {
  content: "";
  position: absolute;
  width: 620px;
  height: 620px;
  right: -240px;
  top: -220px;
  border: 58px solid rgba(255, 255, 255, 0.035);
  border-bottom-color: transparent;
  border-left-color: rgba(255, 255, 255, 0.01);
  border-radius: 50%;
  transform: rotate(-18deg);
}

.hero-copy {
  position: relative;
  z-index: 1;
  align-self: center;
}

.hero-greeting {
  margin-bottom: 8px;
  color: var(--text-soft);
  font-size: 14px;
}

.hero-title {
  max-width: 760px;
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(38px, 4vw, 58px);
  font-weight: 400;
  line-height: 1.03;
  letter-spacing: -0.035em;
}

.hero-subtitle {
  max-width: 600px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}

.hero-activity {
  position: relative;
  z-index: 1;
  align-self: center;
  min-height: 170px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background: rgba(7, 7, 9, 0.52);
  backdrop-filter: blur(14px);
}

.hero-activity-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 650;
}

.hero-activity-item {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.hero-activity-item:first-of-type {
  border-top: 0;
}

.hero-activity-name {
  overflow: hidden;
  color: var(--text-soft);
  font-size: 11.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hero-activity-time {
  color: var(--muted-2);
  font-size: 9px;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 30px 0 14px;
}

.section-heading h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 23px;
  font-weight: 400;
}

.section-heading p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 11.5px;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 11.5px;
  text-decoration: none;
}

.text-link:hover {
  color: var(--text);
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.project-card {
  position: relative;
  min-height: 190px;
  padding: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.012));
  cursor: pointer;
  color: inherit;
  text-decoration: none;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.project-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.16);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.016));
}

.project-card::after {
  content: "";
  position: absolute;
  width: 160px;
  height: 160px;
  right: -65px;
  top: -70px;
  border-radius: 50%;
  background: var(--card-glow, var(--violet-soft));
  filter: blur(16px);
  opacity: 0.55;
}

.project-card[data-accent="green"] { --card-glow: var(--green-soft); }
.project-card[data-accent="blue"] { --card-glow: var(--blue-soft); }
.project-card[data-accent="amber"] { --card-glow: var(--amber-soft); }
.project-card[data-accent="pink"] { --card-glow: var(--pink-soft); }
.project-card[data-accent="cyan"] { --card-glow: var(--cyan-soft); }

.project-card-top {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.project-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--violet);
}

.project-card[data-accent="green"] .project-icon { color: var(--green); }
.project-card[data-accent="blue"] .project-icon { color: var(--blue); }
.project-card[data-accent="amber"] .project-icon { color: var(--amber); }
.project-card[data-accent="pink"] .project-icon { color: var(--pink); }
.project-card[data-accent="cyan"] .project-icon { color: var(--cyan); }

.status-pill,
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 23px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  font-size: 9.5px;
  white-space: nowrap;
}

.status-pill::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.status-pill.published { color: var(--green); border-color: rgba(98, 213, 155, 0.18); background: var(--green-soft); }
.status-pill.review { color: var(--amber); border-color: rgba(231, 183, 100, 0.18); background: var(--amber-soft); }
.status-pill.draft { color: var(--muted); }

.project-card-title {
  position: relative;
  z-index: 1;
  margin: 18px 0 6px;
  color: var(--text);
  font-size: 15px;
  font-weight: 650;
}

.project-card-description {
  position: relative;
  z-index: 1;
  display: -webkit-box;
  min-height: 38px;
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.project-card-footer {
  position: absolute;
  z-index: 1;
  left: 18px;
  right: 18px;
  bottom: 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.project-meta {
  color: var(--muted-2);
  font-size: 9.5px;
}

.dashboard-lower {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(290px, 0.6fr);
  gap: 18px;
  margin-top: 18px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.018);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 54px;
  padding: 0 17px;
  border-bottom: 1px solid var(--line);
}

.panel-title {
  margin: 0;
  font-size: 12.5px;
  font-weight: 650;
}

.workspace-list,
.activity-list,
.member-list,
.comment-list,
.version-list {
  display: grid;
}

.workspace-row {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  align-items: center;
  gap: 12px;
  min-height: 66px;
  padding: 10px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.workspace-row:first-child {
  border-top: 0;
}

.workspace-logo {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  background: rgba(139, 120, 255, 0.1);
  color: #c1b7ff;
  font-size: 10px;
  font-weight: 750;
}

.row-title {
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 600;
}

.row-subtitle {
  margin-top: 2px;
  color: var(--muted-2);
  font-size: 10px;
}

.activity-row {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.activity-row:first-child {
  border-top: 0;
}

.activity-copy {
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.45;
}

.activity-copy strong {
  color: var(--text-soft);
  font-weight: 600;
}

.activity-time {
  margin-top: 3px;
  color: var(--muted-2);
  font-size: 9px;
}

/* Data tables */
.table-shell {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.014);
}

.table-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px;
  border-bottom: 1px solid var(--line);
}

.table-toolbar .search-box {
  width: min(420px, 50%);
  margin-right: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  height: 38px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  color: var(--muted-2);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-align: left;
  text-transform: uppercase;
}

.data-table td {
  height: 58px;
  padding: 0 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--muted);
  font-size: 11px;
}

.data-table tr:last-child td {
  border-bottom: 0;
}

.data-table tbody tr {
  cursor: pointer;
  transition: background 130ms ease;
}

.data-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.028);
}

.table-name {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-soft);
  font-weight: 600;
}

.table-project-link {
  color: var(--text-soft);
  text-decoration: none;
}

.table-project-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.mini-file-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--violet);
}

/* Templates */
.template-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.template-card {
  display: flex;
  min-height: 206px;
  flex-direction: column;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.018);
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease;
}

.template-card:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.03);
}

.template-card .project-icon {
  margin-bottom: 18px;
}

.template-card h3 {
  margin: 0 0 6px;
  color: var(--text-soft);
  font-size: 13px;
}

.template-card p {
  margin: 0;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.55;
}

.template-card .btn {
  width: 100%;
  margin-top: auto;
}

/* Editor */
.editor-shell {
  display: flex;
  height: 100vh;
  flex-direction: column;
  overflow: hidden;
  background: #08080a;
}

.editor-topbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  align-items: center;
  gap: 16px;
  min-height: 68px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(8, 8, 10, 0.96);
}

.editor-title-group {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
}

.editor-brand-button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.025);
  cursor: pointer;
}

.editor-brand-button:hover {
  background: rgba(255, 255, 255, 0.055);
}

.editor-project-meta {
  min-width: 0;
}

.editor-project-name {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.editor-project-name h1 {
  overflow: hidden;
  margin: 0;
  font-family: var(--font-ui);
  font-size: 16px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.editor-save-state {
  margin-top: 2px;
  color: var(--muted-2);
  font-size: 9.5px;
}

.editor-collaborators {
  display: flex;
  align-items: center;
  gap: 10px;
}

.presence-label {
  color: var(--muted-2);
  font-size: 10px;
}

.editor-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.editor-body {
  position: relative;
  display: grid;
  grid-template-columns: minmax(360px, var(--intent-width, 40%)) minmax(520px, 1fr);
  min-height: 0;
  flex: 1;
  overflow: hidden;
}

.pane-resizer {
  position: absolute;
  z-index: 5;
  top: 0;
  bottom: 0;
  left: var(--intent-width, 40%);
  width: 9px;
  border: 0;
  background: transparent;
  cursor: col-resize;
  transform: translateX(-5px);
}

.pane-resizer::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 4px;
  width: 1px;
  background: var(--line);
  transition: width 120ms ease, background 120ms ease;
}

.pane-resizer:hover::after,
.pane-resizer:focus-visible::after {
  width: 2px;
  background: var(--violet);
}

.editor-pane {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: #0b0b0d;
}

.editor-pane:last-child {
  border-right: 0;
}

.pane-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 54px;
  padding: 0 13px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.012);
}

.pane-title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.075em;
  text-transform: uppercase;
}

.step-number {
  display: inline-grid;
  place-items: center;
  width: 19px;
  height: 19px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  font-size: 9px;
}

.pane-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
}

.pane-tab {
  min-height: 32px;
  padding: 0 11px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted-2);
  cursor: pointer;
  font-size: 11px;
}

.pane-tab.active,
.pane-tab:hover {
  background: rgba(255, 255, 255, 0.045);
  color: var(--text-soft);
}

.editor-content {
  position: relative;
  min-height: 0;
  flex: 1;
  overflow: hidden;
}

.structured-editor {
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 22px 22px 90px 54px;
  border: 0;
  outline: none;
  resize: none;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 0 40px, transparent 40px),
    #0c0c0f;
  color: #dedce2;
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.75;
  tab-size: 2;
  white-space: pre-wrap;
}

.structured-editor::selection {
  background: rgba(139, 120, 255, 0.28);
}

.editor-line-guide {
  position: absolute;
  top: 22px;
  left: 13px;
  z-index: 1;
  color: #4f4e56;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 2.23;
  pointer-events: none;
  user-select: none;
}

.editor-statusbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 38px;
  padding: 0 12px;
  border-top: 1px solid var(--line);
  background: #0b0b0d;
  color: var(--muted-2);
  font-size: 11px;
}

.validation-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.validation-state.valid { color: var(--green); }
.validation-state.invalid { color: var(--danger); }

.json-view {
  height: 100%;
  min-height: 0;
  overflow: auto;
  background: #0b0b0e;
}

.json-code {
  margin: 0;
  padding: 22px 22px 70px;
  color: #cac8d0;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}

.intent-legend {
  display: flex;
  align-items: center;
  gap: 5px;
}

.intent-legend span {
  padding: 3px 7px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  opacity: 0.85;
}

.intent-legend .given { color: var(--violet); }
.intent-legend .when { color: var(--blue); }
.intent-legend .then { color: var(--green); }

.editor-pane-output {
  border-right: 0;
}

.output-pane-header {
  display: grid;
  grid-template-columns: auto minmax(220px, 1fr) auto;
}

.output-tabs {
  justify-self: center;
}

.output-tools {
  display: flex;
  align-items: center;
  gap: 7px;
}

.output-control {
  min-height: 32px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-2);
  color: var(--text-soft);
  font-size: 11px;
}

.output-content {
  background: var(--bg-soft);
}

#generated-preview {
  width: 100%;
  height: 100%;
}

.output-content.viewport-desktop .prototype-window {
  width: min(100%, 560px);
}

.output-content.viewport-mobile .prototype-window {
  width: min(100%, 390px);
}

.output-content.zoom-75 .prototype-window {
  transform: scale(0.75);
  transform-origin: top center;
}

.output-content.zoom-125 .prototype-window {
  transform: scale(1.25);
  transform-origin: top center;
}

.editor-publish {
  min-width: max-content;
}

.editor-utility-action {
  color: var(--muted);
}

.json-key { color: #c9a9ff; }
.json-string { color: #84d6a6; }
.json-boolean { color: #f0bc72; }
.json-number { color: #7eb8ff; }

.flow-view {
  height: 100%;
  min-height: 0;
  overflow: auto;
  background:
    radial-gradient(circle at 50% 0%, rgba(139, 120, 255, 0.07), transparent 26%),
    linear-gradient(rgba(255, 255, 255, 0.016) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.016) 1px, transparent 1px),
    #0a0a0d;
  background-size: auto, 26px 26px, 26px 26px, auto;
}

.flow-canvas {
  display: flex;
  min-height: 100%;
  flex-direction: column;
  align-items: center;
  padding: 34px 20px 80px;
}

.flow-node {
  position: relative;
  width: min(100%, 246px);
  padding: 13px 14px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 10px;
  background: linear-gradient(145deg, rgba(31, 31, 37, 0.96), rgba(18, 18, 22, 0.96));
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.25);
  text-align: center;
}

.flow-node-type {
  margin-bottom: 5px;
  color: var(--violet);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.flow-node[data-type="WHEN"] .flow-node-type { color: var(--blue); }
.flow-node[data-type="THEN"] .flow-node-type { color: var(--green); }
.flow-node[data-type="AND"] .flow-node-type { color: var(--amber); }

.flow-node-text {
  color: var(--text-soft);
  font-size: 11px;
  line-height: 1.45;
}

.flow-connector {
  position: relative;
  width: 1px;
  height: 40px;
  background: rgba(255, 255, 255, 0.2);
}

.flow-connector::after {
  content: "";
  position: absolute;
  left: -3px;
  bottom: 0;
  width: 6px;
  height: 6px;
  border-right: 1px solid rgba(255, 255, 255, 0.45);
  border-bottom: 1px solid rgba(255, 255, 255, 0.45);
  transform: rotate(45deg);
}

.flow-empty {
  display: grid;
  place-items: center;
  min-height: 100%;
  padding: 40px;
  color: var(--muted);
  text-align: center;
}

/* Generated product interface */
.preview-controls,
.preview-modal-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.design-system-picker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 9px;
  white-space: nowrap;
}

.design-system-picker > span {
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.design-system-picker select {
  min-height: 30px;
  max-width: 176px;
  padding: 0 28px 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  appearance: none;
  background:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%) calc(100% - 13px) 50% / 4px 4px no-repeat,
    linear-gradient(135deg, var(--muted) 50%, transparent 50%) calc(100% - 9px) 50% / 4px 4px no-repeat,
    var(--surface-2);
  color: var(--text-soft);
  cursor: pointer;
  font-size: 10px;
}

.design-system-picker-compact > span {
  display: none;
}

.design-system-picker-compact select {
  max-width: 122px;
}

.preview-modal-header {
  align-items: center;
}

.prototype-stage {
  --prototype-accent: var(--violet);
  --prototype-window-bg: #111115;
  --prototype-control-bg: #17171c;
  --prototype-radius: 14px;
  --prototype-card-radius: 10px;
  --prototype-border: rgba(255, 255, 255, 0.13);
  --prototype-font: var(--font-ui);
  min-height: 100%;
  padding: 22px 16px 70px;
  overflow: auto;
  background:
    radial-gradient(circle at 50% 0, rgba(139, 120, 255, 0.1), transparent 38%),
    #0a0a0d;
}

.prototype-window {
  width: min(100%, 350px);
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid var(--prototype-border);
  border-radius: var(--prototype-radius);
  background: var(--prototype-window-bg);
  font-family: var(--prototype-font);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.36);
}

.prototype-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
}

.prototype-product,
.prototype-badge {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 650;
}

.prototype-product .brand-symbol {
  width: 16px;
  height: 14px;
  transform: scale(0.62);
  transform-origin: center;
}

.prototype-badge {
  color: var(--green);
}

.prototype-content {
  display: grid;
  gap: 16px;
  padding: 24px;
}

.prototype-heading h2 {
  margin: 3px 0 5px;
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 500;
  line-height: 1.15;
}

.prototype-heading p,
.prototype-card small {
  display: block;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.prototype-eyebrow {
  color: var(--prototype-accent);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.12em;
}

.prototype-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--prototype-card-radius);
  background: rgba(255, 255, 255, 0.018);
}

.prototype-card-title {
  display: flex;
  gap: 9px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.prototype-card-title > span {
  color: var(--prototype-accent);
}

.prototype-card-title strong {
  display: block;
  margin-bottom: 2px;
  font-size: 12px;
}

.prototype-check {
  display: grid;
  grid-template-columns: 19px 1fr auto;
  align-items: center;
  gap: 7px;
  min-height: 42px;
  padding: 0 14px;
  color: var(--text-soft);
  font-size: 11px;
}

.prototype-check + .prototype-check {
  border-top: 1px solid var(--line);
}

.prototype-check b {
  color: var(--green);
  font-size: 10.5px;
}

.prototype-checkmark {
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--green-soft);
  color: var(--green);
}

.prototype-field {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.prototype-field button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--prototype-control-bg);
  color: var(--text-soft);
  cursor: pointer;
  font-size: 12px;
  text-align: left;
}

.prototype-insight {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 11px 12px;
  border: 1px solid rgba(108, 167, 255, 0.18);
  border-radius: 8px;
  background: var(--blue-soft);
  color: #aebdd7;
  font-size: 11px;
  line-height: 1.45;
}

.prototype-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.prototype-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 650;
}

.prototype-secondary {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text-soft);
}

.prototype-primary {
  max-width: 70%;
  border: 1px solid color-mix(in srgb, var(--prototype-accent) 55%, transparent);
  background: var(--prototype-accent);
  color: white;
}

.prototype-stage.ds-material {
  --prototype-accent: #90caf9;
  --prototype-window-bg: #1f1f1f;
  --prototype-control-bg: #242424;
  --prototype-radius: 4px;
  --prototype-card-radius: 4px;
  --prototype-border: rgba(255, 255, 255, 0.2);
  --prototype-font: Roboto, var(--font-ui);
}

.prototype-stage.ds-material .prototype-window {
  box-shadow: 0 5px 18px rgba(0, 0, 0, 0.42);
}

.prototype-stage.ds-material .prototype-heading h2 {
  font-family: var(--prototype-font);
  font-weight: 500;
}

.prototype-stage.ds-ant {
  --prototype-accent: #1677ff;
  --prototype-window-bg: #141414;
  --prototype-control-bg: #1f1f1f;
  --prototype-radius: 8px;
  --prototype-card-radius: 6px;
  --prototype-border: #424242;
  --prototype-font: -apple-system, BlinkMacSystemFont, "Segoe UI", var(--font-ui);
}

.prototype-stage.ds-ant .prototype-window {
  box-shadow: none;
}

.prototype-stage.ds-ant .prototype-heading h2 {
  font-family: var(--prototype-font);
  font-weight: 600;
}

.prototype-stage.ds-connected {
  --prototype-accent: #58cfda;
  --prototype-window-bg: #10191b;
  --prototype-control-bg: #162326;
  --prototype-radius: 16px;
  --prototype-card-radius: 12px;
  --prototype-border: rgba(88, 207, 218, 0.28);
}

.mcp-connect-body {
  display: grid;
  gap: 16px;
}

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

.mcp-capability {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.018);
  color: var(--green);
}

.mcp-capability span {
  display: grid;
  color: var(--text-soft);
}

.mcp-capability strong {
  font-size: 10.5px;
}

.mcp-capability small {
  margin-top: 2px;
  color: var(--muted-2);
  font-size: 9px;
}

.prototype-primary:disabled {
  border-color: rgba(98, 213, 155, 0.35);
  background: var(--green-soft);
  color: var(--green);
  cursor: default;
}

.prototype-modal-body {
  height: 660px;
  padding: 0;
  overflow: hidden;
}

.prototype-stage-expanded {
  display: grid;
  place-items: center;
  height: 100%;
  padding: 32px;
}

.prototype-stage-expanded .prototype-window {
  width: min(100%, 520px);
}

.prototype-stage-expanded .prototype-content {
  padding: 28px;
}

.editor-floating-tip {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border: 1px solid rgba(139, 120, 255, 0.2);
  border-radius: 8px;
  background: rgba(24, 21, 39, 0.9);
  color: #aaa2d8;
  font-size: 9.5px;
  backdrop-filter: blur(10px);
}

/* Settings */
.settings-layout {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 18px;
}

.settings-nav {
  align-self: start;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.014);
}

.settings-nav button {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 42px;
  padding: 0 13px;
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.045);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  text-align: left;
}

.settings-nav button:first-child {
  border-top: 0;
}

.settings-nav button.active,
.settings-nav button:hover {
  background: rgba(255, 255, 255, 0.055);
  color: var(--text-soft);
}

.settings-content {
  display: grid;
  gap: 16px;
}

.settings-section {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.014);
}

.settings-section-header {
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.settings-section-header h3 {
  margin: 0;
  color: var(--text-soft);
  font-size: 13px;
}

.settings-section-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 10.5px;
}

.settings-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 20px;
  min-height: 68px;
  padding: 13px 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.settings-row:first-of-type {
  border-top: 0;
}

.settings-row-title {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 600;
}

.settings-row-description {
  margin-top: 3px;
  color: var(--muted-2);
  font-size: 10px;
}

.switch {
  position: relative;
  display: inline-flex;
  width: 38px;
  height: 22px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 999px;
  background: #2b2b31;
  cursor: pointer;
  transition: background 150ms ease;
}

.switch::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  left: 3px;
  top: 3px;
  border-radius: 50%;
  background: #aaa8af;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
  transition: transform 150ms ease, background 150ms ease;
}

.switch.on {
  background: rgba(98, 213, 155, 0.35);
}

.switch.on::after {
  background: var(--green);
  transform: translateX(16px);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.stat-card {
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.018);
}

.stat-value {
  font-family: var(--font-display);
  font-size: 28px;
}

.stat-label {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

/* Modals and drawers */
.modal-backdrop {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.68);
  backdrop-filter: blur(8px);
  animation: fade-in 130ms ease;
}

.modal {
  width: min(100%, 620px);
  max-height: min(88vh, 850px);
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: #111114;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  animation: modal-in 160ms ease;
}

.modal-lg {
  width: min(100%, 1050px);
}

.modal-xl {
  width: min(100%, 1260px);
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  min-height: 68px;
  padding: 17px 19px;
  border-bottom: 1px solid var(--line);
}

.modal-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 400;
}

.modal-subtitle {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10.5px;
}

.modal-body {
  max-height: calc(88vh - 136px);
  overflow: auto;
  padding: 20px;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  min-height: 64px;
  padding: 12px 19px;
  border-top: 1px solid var(--line);
}

.share-layout {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr) 230px;
  min-height: 470px;
}

.share-nav {
  padding: 14px 10px;
  border-right: 1px solid var(--line);
}

.share-nav button {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 38px;
  padding: 0 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  text-align: left;
}

.share-nav button.active,
.share-nav button:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-soft);
}

.share-main {
  min-width: 0;
  padding: 20px;
}

.share-main h3,
.role-guide h3 {
  margin: 0 0 14px;
  color: var(--text-soft);
  font-size: 12px;
}

.invite-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px auto;
  gap: 8px;
  margin-bottom: 22px;
}

.people-list {
  display: grid;
  gap: 4px;
}

.people-row {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 112px;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 7px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.people-row:first-child {
  border-top: 0;
}

.person-name {
  overflow: hidden;
  color: var(--text-soft);
  font-size: 11.5px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.person-email {
  overflow: hidden;
  margin-top: 1px;
  color: var(--muted-2);
  font-size: 9.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.role-guide {
  padding: 20px 16px;
  border-left: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.012);
}

.role-card {
  margin-top: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.018);
}

.role-card strong {
  display: block;
  color: var(--text-soft);
  font-size: 10.5px;
}

.role-card span {
  display: block;
  margin-top: 3px;
  color: var(--muted-2);
  font-size: 9.5px;
  line-height: 1.4;
}

.share-link-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.018);
}

.share-link-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-top: 10px;
}

.comments-drawer {
  position: fixed;
  z-index: 90;
  top: 0;
  right: 0;
  display: flex;
  width: min(420px, 100vw);
  height: 100vh;
  flex-direction: column;
  border-left: 1px solid var(--line-strong);
  background: #111114;
  box-shadow: -30px 0 80px rgba(0, 0, 0, 0.45);
  animation: drawer-in 170ms ease;
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 66px;
  padding: 0 17px;
  border-bottom: 1px solid var(--line);
}

.drawer-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 20px;
}

.drawer-body {
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  padding: 14px;
}

.comment-card {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.018);
}

.comment-card + .comment-card {
  margin-top: 9px;
}

.comment-head {
  display: flex;
  align-items: center;
  gap: 9px;
}

.comment-author {
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 650;
}

.comment-time {
  margin-left: auto;
  color: var(--muted-2);
  font-size: 9px;
}

.comment-anchor {
  display: inline-flex;
  margin-top: 10px;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--violet-soft);
  color: #aea2ff;
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.comment-body {
  margin-top: 8px;
  color: var(--text-soft);
  font-size: 11px;
  line-height: 1.55;
}

.comment-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}

.drawer-composer {
  padding: 13px;
  border-top: 1px solid var(--line);
  background: #0e0e11;
}

.composer-row {
  display: grid;
  grid-template-columns: 1fr 105px;
  gap: 8px;
  margin-top: 8px;
}

.version-layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr) 220px;
  min-height: 560px;
}

.version-sidebar {
  overflow-y: auto;
  border-right: 1px solid var(--line);
}

.version-item {
  display: grid;
  grid-template-columns: 12px 1fr;
  gap: 9px;
  padding: 13px 14px;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.version-item:hover,
.version-item.active {
  background: rgba(255, 255, 255, 0.045);
}

.version-dot {
  width: 8px;
  height: 8px;
  margin-top: 5px;
  border: 2px solid var(--muted-2);
  border-radius: 50%;
}

.version-item.active .version-dot {
  border-color: var(--gold);
  background: var(--gold);
  box-shadow: 0 0 0 4px rgba(199, 168, 107, 0.12);
}

.version-number {
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 650;
}

.version-message {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9.5px;
  line-height: 1.4;
}

.version-time {
  margin-top: 5px;
  color: var(--muted-2);
  font-size: 8.5px;
}

.diff-panel {
  min-width: 0;
  overflow: auto;
  background: #0b0b0e;
}

.diff-toolbar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 46px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(11, 11, 14, 0.95);
}

.diff-code {
  padding: 14px 0 40px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  line-height: 1.7;
}

.diff-line {
  display: grid;
  grid-template-columns: 36px 18px minmax(0, 1fr);
  min-height: 22px;
  padding: 1px 12px 1px 0;
}

.diff-line-number {
  color: #4d4c54;
  text-align: right;
  user-select: none;
}

.diff-sign {
  color: var(--muted-2);
  text-align: center;
}

.diff-line.added {
  background: rgba(45, 135, 82, 0.18);
  color: #9de1b8;
}

.diff-line.removed {
  background: rgba(153, 61, 61, 0.18);
  color: #f0aaaa;
}

.version-detail {
  padding: 16px;
  border-left: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.012);
}

.detail-group {
  margin-top: 16px;
}

.detail-group:first-child {
  margin-top: 0;
}

.detail-label {
  color: var(--muted-2);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.detail-value {
  margin-top: 4px;
  color: var(--text-soft);
  font-size: 10.5px;
  line-height: 1.45;
}

.empty-state {
  display: grid;
  min-height: 260px;
  place-items: center;
  padding: 40px;
  color: var(--muted);
  text-align: center;
}

.empty-state-icon {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  margin: 0 auto 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
}

.empty-state h3 {
  margin: 0;
  color: var(--text-soft);
  font-size: 13px;
}

.empty-state p {
  max-width: 360px;
  margin: 6px auto 0;
  font-size: 10.5px;
}

/* Toasts */
.toast-root {
  position: fixed;
  z-index: 200;
  right: 18px;
  bottom: 18px;
  display: grid;
  width: min(360px, calc(100vw - 36px));
  gap: 9px;
  pointer-events: none;
}

.toast {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: rgba(21, 21, 25, 0.96);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.4);
  color: var(--text-soft);
  pointer-events: auto;
  animation: toast-in 180ms ease;
  backdrop-filter: blur(18px);
}

.toast.success .toast-icon { color: var(--green); }
.toast.error .toast-icon { color: var(--danger); }
.toast.info .toast-icon { color: var(--blue); }

.toast-message {
  font-size: 11px;
  line-height: 1.4;
}

.toast-close {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.toast-close:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.loading-screen {
  display: grid;
  width: 100vw;
  height: 100vh;
  place-items: center;
  background: #08080a;
}

.loading-mark {
  display: grid;
  justify-items: center;
  gap: 18px;
  color: var(--muted);
  font-size: 11px;
}

.spinner {
  width: 34px;
  height: 34px;
  border: 2px solid rgba(255, 255, 255, 0.09);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}

.mobile-only {
  display: none;
}

.mobile-nav {
  display: none;
}

/* Animations */
@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(8px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes drawer-in {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Responsive */
@media (max-width: 1280px) {
  :root { --sidebar: 214px; }
  .page { padding-left: 26px; padding-right: 26px; }
  .dashboard-hero { grid-template-columns: 1.35fr 0.65fr; }
  .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .template-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .editor-body { grid-template-columns: minmax(340px, var(--intent-width, 40%)) minmax(500px, 1fr); }
}

@media (max-width: 1050px) {
  body { overflow: auto; }
  .auth-shell {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 100vh;
  }
  .auth-visual {
    min-height: 470px;
    padding: 34px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .auth-copy { padding: 80px 0 50px; }
  .auth-panel { min-height: 610px; }
  .app-shell { grid-template-columns: 76px minmax(0, 1fr); }
  .sidebar-header { justify-content: center; padding: 0; }
  .sidebar .brand-name,
  .sidebar-label,
  .nav-item span:not(.nav-badge),
  .sidebar-user-meta,
  .sidebar-user > .icon,
  .nav-badge {
    display: none;
  }
  .nav-item { justify-content: center; padding: 0; }
  .sidebar-user { grid-template-columns: 1fr; justify-items: center; padding: 12px 0; }
  .dashboard-hero { grid-template-columns: 1fr; }
  .hero-activity { display: none; }
  .dashboard-lower { grid-template-columns: 1fr; }
  .template-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .share-layout { grid-template-columns: 150px minmax(0, 1fr); }
  .role-guide { display: none; }
  .version-layout { grid-template-columns: 220px minmax(0, 1fr); }
  .version-detail { display: none; }
  .editor-topbar { grid-template-columns: minmax(200px, 1fr) auto; }
  .editor-collaborators { display: none; }
  .editor-body { grid-template-columns: minmax(320px, var(--intent-width, 42%)) minmax(460px, 1fr); }
  .output-pane-header { grid-template-columns: auto 1fr auto; }
  .output-control { display: none; }
}

@media (max-width: 760px) {
  :root { --sidebar: 0px; }
  body { overflow: hidden; }
  .auth-visual { display: none; }
  .auth-panel { min-height: 100vh; padding: 20px; }
  .auth-card { padding: 26px 22px; }
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .mobile-only { display: inline-flex; }
  .topbar { padding: 0 14px; }
  .topbar .search-box { display: none; }
  .page { padding: 24px 15px 42px; }
  .page-header { align-items: flex-start; flex-direction: column; }
  .page-title { font-size: 36px; }
  .dashboard-hero { min-height: 310px; padding: 28px 22px; }
  .hero-title { font-size: 42px; }
  .project-grid,
  .template-grid,
  .stats-grid { grid-template-columns: 1fr; }
  .table-shell { overflow-x: auto; }
  .data-table { min-width: 780px; }
  .settings-layout { grid-template-columns: 1fr; }
  .settings-nav { display: flex; overflow-x: auto; }
  .settings-nav button { width: auto; min-width: max-content; border-top: 0; border-left: 1px solid rgba(255, 255, 255, 0.045); }
  .settings-nav button:first-child { border-left: 0; }
  .editor-topbar { grid-template-columns: minmax(0, 1fr) auto; padding: 0 10px; }
  .editor-actions .btn span { display: none; }
  .editor-actions .btn { width: 36px; min-width: 36px; padding: 0; }
  .editor-body {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(250px, 42%) minmax(0, 58%);
  }
  .pane-resizer { display: none; }
  .output-pane-header {
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    padding: 8px 10px;
  }
  .output-tabs { justify-self: end; }
  .output-tools { grid-column: 1 / -1; justify-content: flex-end; }
  .share-layout { grid-template-columns: 1fr; min-height: 0; }
  .share-nav { display: flex; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .share-nav button { width: auto; min-width: max-content; }
  .invite-row { grid-template-columns: 1fr; }
  .people-row { grid-template-columns: 32px minmax(0, 1fr); }
  .people-row .select { grid-column: 1 / -1; }
  .version-layout { grid-template-columns: 1fr; min-height: 0; }
  .version-sidebar { max-height: 220px; border-right: 0; border-bottom: 1px solid var(--line); }
  .modal-backdrop { padding: 0; align-items: end; }
  .modal { width: 100%; max-height: 94vh; border-radius: 18px 18px 0 0; }
  .modal-lg,
  .modal-xl { width: 100%; }
  .preview-modal-header { align-items: flex-start; }
  .preview-modal-actions .design-system-picker > span { display: none; }
  .preview-modal-actions .design-system-picker select { max-width: 140px; }
  .mcp-capabilities { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
}

/* Mobile application shell */
@media (max-width: 760px) {
  :root {
    --mobile-nav-height: 68px;
  }

  html,
  body {
    min-height: 100%;
    overscroll-behavior: none;
  }

  body {
    min-height: 100dvh;
  }

  .auth-shell {
    min-height: 100dvh;
    background:
      radial-gradient(circle at 50% 2%, rgba(139, 120, 255, 0.11), transparent 35%),
      var(--bg);
  }

  .auth-panel {
    min-height: 100dvh;
    align-items: center;
    padding: max(68px, env(safe-area-inset-top)) 18px max(24px, env(safe-area-inset-bottom));
  }

  .auth-card {
    width: 100%;
    max-width: 420px;
    padding: 28px 20px 22px;
    border-radius: 20px;
  }

  .auth-card-mark {
    width: 46px;
    height: 46px;
  }

  .auth-card h2 {
    font-size: clamp(30px, 9vw, 38px);
    line-height: 1.04;
  }

  .auth-card p {
    font-size: 13px;
  }

  .provider-btn,
  .magic-form .btn,
  .magic-form .input {
    min-height: 48px;
  }

  .auth-theme-toggle {
    top: max(14px, env(safe-area-inset-top));
    right: 14px;
  }

  .app-shell {
    position: relative;
    height: 100dvh;
    padding-bottom: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom));
  }

  .main-shell {
    height: 100%;
  }

  .main-scroll {
    height: 100%;
    overscroll-behavior-y: contain;
  }

  .main-scroll,
  .sidebar-scroll,
  .editor-content,
  .settings-nav,
  .output-tools {
    -webkit-overflow-scrolling: touch;
  }

  input,
  textarea,
  select {
    font-size: 16px;
  }

  .topbar {
    min-height: 60px;
    padding: max(6px, env(safe-area-inset-top)) 12px 6px;
    gap: 6px;
  }

  .topbar > .mobile-only {
    display: none;
  }

  .topbar-heading {
    font-size: 18px;
  }

  .topbar-subtitle {
    max-width: 42vw;
  }

  .topbar > .btn-icon {
    width: 40px;
    min-width: 40px;
    min-height: 40px;
  }

  .page {
    padding: 18px 14px 34px;
  }

  .page-header {
    gap: 16px;
    margin-bottom: 24px;
  }

  .page-title {
    font-size: clamp(32px, 10vw, 42px);
    line-height: 1;
  }

  .dashboard-hero {
    min-height: 0;
    padding: 28px 20px;
    border-radius: 18px;
  }

  .hero-title {
    font-size: clamp(36px, 11vw, 48px);
    line-height: .98;
  }

  .hero-title br {
    display: none;
  }

  .hero-subtitle {
    font-size: 14px;
  }

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

  .hero-actions .btn {
    width: 100%;
    min-height: 48px;
  }

  .project-card,
  .template-card,
  .workspace-card,
  .activity-card,
  .settings-section,
  .table-shell {
    border-radius: 14px;
  }

  .project-card {
    min-height: 220px;
    padding: 20px;
  }

  .settings-row {
    align-items: flex-start;
    gap: 14px;
  }

  .mobile-nav {
    position: fixed;
    z-index: 30;
    right: 0;
    bottom: 0;
    left: 0;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    min-height: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom));
    padding: 7px 6px max(7px, env(safe-area-inset-bottom));
    border-top: 1px solid var(--line-strong);
    background: color-mix(in srgb, var(--bg) 90%, transparent);
    box-shadow: 0 -14px 36px rgba(0, 0, 0, .22);
    backdrop-filter: blur(22px);
  }

  .mobile-nav .nav-item {
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    min-height: 54px;
    padding: 4px 2px;
    border: 0;
    border-radius: 10px;
    font-size: 10px;
  }

  .mobile-nav .nav-item span:not(.nav-badge) {
    display: block;
  }

  .mobile-nav .nav-item .icon {
    width: 20px;
    height: 20px;
  }

  .mobile-nav .nav-item.active {
    background: var(--surface-3);
  }

  .editor-shell {
    height: 100dvh;
  }

  .editor-topbar {
    min-height: 58px;
    padding: max(6px, env(safe-area-inset-top)) 8px 6px;
  }

  .editor-project-name h1 {
    max-width: 38vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .editor-project-name .status-pill,
  .editor-save-state,
  .editor-actions [data-action="comments"],
  .editor-actions [data-action="share"] {
    display: none;
  }

  .editor-actions {
    gap: 5px;
  }

  .editor-actions .editor-publish,
  .editor-actions [data-action="editor-more"] {
    display: inline-flex;
    width: 38px;
    min-width: 38px;
    min-height: 38px;
  }

  .editor-body {
    grid-template-rows: minmax(230px, 44%) minmax(0, 56%);
  }

  .pane-header {
    min-height: 46px;
  }

  .intent-blocks {
    padding: 12px 10px 64px;
  }

  .intent-block {
    grid-template-columns: 58px minmax(0, 1fr);
    margin-bottom: 8px;
  }

  .intent-block-rail,
  .intent-block-body {
    padding: 11px 10px;
  }

  .intent-step-input {
    min-height: 42px;
    font-size: 16px;
  }

  .editor-floating-tip {
    display: none;
  }

  .output-pane-header {
    min-height: 50px;
    padding: 6px 8px;
  }

  .pane-tab {
    min-height: 36px;
    padding-inline: 9px;
  }

  .output-toolbar {
    min-height: 0;
    padding: 7px 9px;
    gap: 6px;
  }

  .output-system-summary {
    display: none;
  }

  .output-tools {
    scrollbar-width: none;
  }

  .output-tools::-webkit-scrollbar {
    display: none;
  }

  .output-content {
    padding: 10px;
  }

  .modal {
    padding-bottom: max(18px, env(safe-area-inset-bottom));
  }

  .toast-root {
    right: 12px;
    bottom: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom) + 12px);
    left: 12px;
  }
}

@media (display-mode: standalone) and (max-width: 760px) {
  .topbar,
  .editor-topbar {
    padding-top: max(8px, env(safe-area-inset-top));
  }

  .auth-panel {
    padding-top: max(72px, calc(env(safe-area-inset-top) + 34px));
  }
}

@media (max-width: 380px) {
  .auth-card {
    padding-inline: 16px;
  }

  .topbar .theme-toggle {
    display: none;
  }

  .mobile-nav .nav-item {
    font-size: 9px;
  }
}

/* Layered dark editor surfaces */
[data-theme="dark"] .editor-shell {
  background: #101115;
}

[data-theme="dark"] .editor-topbar {
  border-bottom-color: rgba(255, 255, 255, 0.11);
  background: #17181d;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.38);
}

[data-theme="dark"] .editor-topbar .btn,
[data-theme="dark"] .editor-brand-button {
  border-color: rgba(255, 255, 255, 0.12);
  background: #202127;
}

[data-theme="dark"] .editor-topbar .btn:hover,
[data-theme="dark"] .editor-brand-button:hover {
  border-color: rgba(255, 255, 255, 0.2);
  background: #292b32;
}

[data-theme="dark"] .editor-pane {
  border-right-color: rgba(255, 255, 255, 0.11);
  background: #131419;
}

[data-theme="dark"] .editor-pane-language {
  background: #15161b;
}

[data-theme="dark"] .editor-pane-output {
  background: #16171c;
}

[data-theme="dark"] .pane-header {
  border-bottom-color: rgba(255, 255, 255, 0.1);
  background: #1b1c22;
}

[data-theme="dark"] .pane-tab.active,
[data-theme="dark"] .pane-tab:hover {
  background: #2a2b32;
  color: #eeeeef;
}

[data-theme="dark"] .step-number {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.035);
}

[data-theme="dark"] .structured-editor {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 0 40px, transparent 40px),
    #15161b;
  color: #e8e7eb;
}

[data-theme="dark"] .json-view {
  background: #111319;
}

[data-theme="dark"] .editor-statusbar {
  border-top-color: rgba(255, 255, 255, 0.1);
  background: #18191e;
}

[data-theme="dark"] .prototype-stage,
[data-theme="dark"] .flow-view {
  background:
    radial-gradient(circle at 50% 0%, rgba(139, 120, 255, 0.1), transparent 34%),
    linear-gradient(rgba(255, 255, 255, 0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.022) 1px, transparent 1px),
    #14161b;
  background-size: auto, 26px 26px, 26px 26px, auto;
}

[data-theme="dark"] .design-system-picker select {
  border-color: rgba(255, 255, 255, 0.14);
  background-color: #25262c;
}

/* Light theme */
[data-theme="light"] {
  color-scheme: light;
  --bg: #f5f5f3;
  --bg-soft: #eeeeeb;
  --surface: #ffffff;
  --surface-2: #f7f7f5;
  --surface-3: #efefec;
  --surface-4: #e7e7e3;
  --line: rgba(24, 24, 27, 0.11);
  --line-strong: rgba(24, 24, 27, 0.2);
  --text: #1d1d20;
  --text-soft: #4e4e55;
  --muted: #686870;
  --muted-2: #606068;
  --violet-soft: rgba(111, 86, 229, 0.1);
  --green-soft: rgba(26, 151, 91, 0.1);
  --blue-soft: rgba(56, 114, 205, 0.1);
  --amber-soft: rgba(179, 116, 18, 0.1);
  --danger-soft: rgba(194, 65, 65, 0.09);
  --shadow: 0 24px 70px rgba(37, 37, 31, 0.12);
}

[data-theme="light"] body,
[data-theme="light"] .main-shell,
[data-theme="light"] .main-scroll,
[data-theme="light"] .editor-shell {
  background: var(--bg);
  color: var(--text);
}

[data-theme="light"] .sidebar,
[data-theme="light"] .topbar,
[data-theme="light"] .editor-topbar,
[data-theme="light"] .pane-header,
[data-theme="light"] .editor-statusbar,
[data-theme="light"] .modal,
[data-theme="light"] .settings-nav,
[data-theme="light"] .settings-section,
[data-theme="light"] .table-shell,
[data-theme="light"] .project-card,
[data-theme="light"] .template-card,
[data-theme="light"] .stat-card,
[data-theme="light"] .activity-card,
[data-theme="light"] .workspace-card {
  background: #ffffff;
  color: var(--text);
}

[data-theme="light"] .sidebar {
  border-right-color: rgba(24, 24, 27, 0.035);
  box-shadow: none;
}

[data-theme="light"] .editor-pane,
[data-theme="light"] .share-nav,
[data-theme="light"] .version-sidebar {
  border-right-color: rgba(24, 24, 27, 0.045);
}

[data-theme="light"] .nav-item:hover,
[data-theme="light"] .nav-item.active,
[data-theme="light"] .sidebar-user:hover,
[data-theme="light"] .btn-ghost:hover,
[data-theme="light"] .pane-tab:hover,
[data-theme="light"] .settings-nav button:hover,
[data-theme="light"] .settings-nav button.active {
  background: rgba(29, 29, 32, 0.055);
  border-color: rgba(29, 29, 32, 0.07);
}

[data-theme="light"] .btn-primary {
  border-color: #242428;
  background: #242428;
  color: #ffffff;
}

[data-theme="light"] .btn-primary:hover {
  border-color: #09090b;
  background: #09090b;
  color: #ffffff;
}

[data-theme="light"] .input,
[data-theme="light"] .textarea,
[data-theme="light"] .select,
[data-theme="light"] .search-box,
[data-theme="light"] .provider-btn,
[data-theme="light"] .prototype-field button {
  border-color: var(--line);
  background-color: #ffffff;
  color: var(--text);
  box-shadow: none;
}

[data-theme="light"] .input:focus,
[data-theme="light"] .textarea:focus,
[data-theme="light"] .select:focus {
  background: #ffffff;
}

[data-theme="light"] .provider-btn {
  color: rgba(29, 29, 32, 0.72);
}

[data-theme="light"] .provider-btn:hover {
  color: rgba(29, 29, 32, 0.86);
}

[data-theme="light"] .brand-symbol {
  filter: opacity(0.78) drop-shadow(0 6px 9px rgba(0, 0, 0, 0.12));
}

[data-theme="light"] .brand-prefix {
  color: rgba(29, 29, 32, 0.55);
}

[data-theme="light"] .auth-title-prefix {
  color: rgba(29, 29, 32, 0.54);
}

[data-theme="light"] .auth-shell {
  background:
    radial-gradient(circle at 10% 5%, rgba(255, 255, 255, 0.9), transparent 34%),
    linear-gradient(125deg, #e8e8e5 0%, #f5f5f2 62%, #ffffff 100%);
}

[data-theme="light"] .auth-visual::before {
  opacity: 0.035;
  filter: none;
}

[data-theme="light"] .auth-panel {
  background: transparent;
}

[data-theme="light"] .auth-card {
  border-color: rgba(24, 24, 27, 0.14);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 28px 80px rgba(45, 44, 38, 0.12);
}

[data-theme="light"] .auth-demo-note {
  background: rgba(29, 29, 32, 0.035);
}

[data-theme="light"] .auth-card-mark {
  background: transparent;
}

.auth-theme-toggle {
  position: absolute;
  z-index: 8;
  top: 22px;
  right: 22px;
  background: rgba(17, 17, 20, 0.48);
  border-color: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(12px);
}

[data-theme="light"] .auth-theme-toggle {
  border-color: rgba(24, 24, 27, 0.12);
  background: rgba(255, 255, 255, 0.72);
}

[data-theme="light"] .dashboard-hero {
  background:
    radial-gradient(circle at 80% 10%, rgba(111, 86, 229, 0.13), transparent 34%),
    linear-gradient(135deg, #ffffff, #efefec);
}

[data-theme="light"] .hero-activity {
  border-color: rgba(24, 24, 27, 0.12);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 14px 36px rgba(35, 35, 31, 0.08);
  backdrop-filter: blur(14px);
}

[data-theme="light"] .hero-activity-title {
  color: #303036;
}

[data-theme="light"] .hero-activity-title .text-link {
  color: #686870;
}

[data-theme="light"] .hero-activity-item {
  border-top-color: rgba(24, 24, 27, 0.09);
}

[data-theme="light"] .hero-activity-name {
  color: #3f3f46;
}

[data-theme="light"] .hero-activity-time {
  color: #85858d;
}

[data-theme="light"] .sidebar-user {
  border-top-color: rgba(24, 24, 27, 0.12);
  background: #fafaf8;
  color: var(--text);
}

[data-theme="light"] .sidebar-user-name {
  color: #303036;
}

[data-theme="light"] .sidebar-user-role {
  color: #77777f;
}

[data-theme="light"] .sidebar-user > .icon {
  color: #686870;
}

[data-theme="light"] .avatar {
  border-color: rgba(24, 24, 27, 0.06);
  background: linear-gradient(145deg, #f5f4f2, #e9e8e5);
  color: #55545a;
  box-shadow: 0 5px 14px rgba(37, 37, 31, 0.1);
}

[data-theme="light"] .avatar-stack .avatar,
[data-theme="light"] .auth-proof .avatar {
  border-color: transparent;
}

[data-theme="light"] .avatar.violet { background: linear-gradient(145deg, #eeeafd, #ddd6f7); color: #594a91; }
[data-theme="light"] .avatar.blue { background: linear-gradient(145deg, #e7f2fc, #d3e7f8); color: #285884; }
[data-theme="light"] .avatar.green { background: linear-gradient(145deg, #e5f4ed, #cee8db); color: #27644e; }
[data-theme="light"] .avatar.amber { background: linear-gradient(145deg, #f7efe3, #eadbc4); color: #725431; }
[data-theme="light"] .avatar.pink { background: linear-gradient(145deg, #faeaf2, #f1d4e3); color: #7b3e60; }
[data-theme="light"] .avatar.cyan { background: linear-gradient(145deg, #e4f4f5, #cce8eb); color: #2a626a; }

[data-theme="light"] .editor-pane {
  border-color: var(--line);
  background: #ffffff;
}

[data-theme="light"] .structured-editor,
[data-theme="light"] .json-view {
  background: #fbfbfa;
  color: #29292d;
}

[data-theme="light"] .structured-editor::selection {
  background: rgba(111, 86, 229, 0.18);
}

[data-theme="light"] .editor-line-guide {
  border-color: var(--line);
  background: #f3f3f0;
  color: #a0a0a5;
}

[data-theme="light"] .json-key { color: #7955b7; }
[data-theme="light"] .json-string { color: #16734c; }
[data-theme="light"] .json-boolean,
[data-theme="light"] .json-number { color: #a05b19; }

[data-theme="light"] .flow-view,
[data-theme="light"] .prototype-stage {
  background:
    linear-gradient(rgba(29, 29, 32, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(29, 29, 32, 0.035) 1px, transparent 1px),
    #f7f7f5;
  background-size: 26px 26px;
}

[data-theme="light"] .flow-node,
[data-theme="light"] .prototype-window {
  border-color: rgba(24, 24, 27, 0.14);
  background: #ffffff;
  box-shadow: 0 12px 30px rgba(36, 36, 31, 0.1);
}

[data-theme="light"] .flow-connector {
  background: rgba(24, 24, 27, 0.2);
}

[data-theme="light"] .prototype-topbar,
[data-theme="light"] .prototype-card,
[data-theme="light"] .editor-floating-tip {
  background: #f7f7f5;
}

[data-theme="light"] .prototype-primary {
  border-color: var(--prototype-accent);
  background: var(--prototype-accent);
  color: white;
}

[data-theme="light"] .prototype-stage.ds-material .prototype-primary {
  color: #102033;
}

[data-theme="light"] .design-system-picker select,
[data-theme="light"] .mcp-capability {
  border-color: var(--line);
  background-color: #ffffff;
}

[data-theme="light"] .modal-backdrop {
  background: rgba(43, 43, 39, 0.32);
}

[data-theme="light"] .toast {
  border-color: rgba(24, 24, 27, 0.14);
  background: #ffffff;
  color: var(--text);
  box-shadow: 0 16px 40px rgba(36, 36, 31, 0.16);
}

.editor-save-state,
.presence-label,
.modal-subtitle,
.settings-row-description,
.helper,
.toast-message {
  font-size: max(11px, 0.6875rem);
}

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

/* Visual system convergence: quiet workspace, expressive output */
:root {
  --radius-control: 6px;
  --radius-card: 10px;
  --radius-panel: 14px;
  --radius-round: 999px;
}

.editor-topbar {
  grid-template-columns: minmax(260px, 1fr) auto auto;
  min-height: 64px;
  padding-inline: 16px;
  border-bottom-color: color-mix(in srgb, var(--line) 72%, transparent);
}

.editor-brand-button,
.editor-actions .btn,
.output-control,
.design-system-picker select {
  border-radius: var(--radius-control);
}

.editor-project-name h1 { font-size: 16px; }
.editor-save-state,
.presence-label { font-size: 11px; }

.editor-project-name .status-pill {
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--muted);
  font-size: 11px;
  text-transform: capitalize;
}

.editor-project-name .status-pill::before {
  content: "·";
  margin-right: 7px;
  color: var(--muted-2);
}

.editor-pane { border-right: 0; }

.pane-header {
  min-height: 52px;
  border-bottom-color: color-mix(in srgb, var(--line) 72%, transparent);
}

.pane-title { font-size: 11px; letter-spacing: .08em; }
.step-number { border: 0; background: var(--surface-3); }
.validation-state { font-size: 12px; font-weight: 650; }

.pane-resizer { width: 15px; transform: translateX(-7px); }
.pane-resizer::after { left: 7px; background: color-mix(in srgb, var(--line) 82%, transparent); }
.pane-resizer span {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 3px;
  width: 9px;
  height: 30px;
  border-radius: var(--radius-round);
  background: var(--surface-4);
  box-shadow: inset 0 0 0 1px var(--line-strong);
  opacity: 0;
  transform: translateY(-50%);
  transition: opacity 120ms ease;
}
.pane-resizer:hover span,
.pane-resizer:focus-visible span { opacity: 1; }

.intent-blocks {
  height: 100%;
  overflow: auto;
  padding: 20px 20px 92px;
  background: #15161b;
}

.intent-block {
  --intent-accent: var(--violet);
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  overflow: hidden;
  margin-bottom: 12px;
  border-radius: var(--radius-card);
  background: #1b1c21;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.07);
  transition: background 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}
.intent-block:focus-within {
  background: #202127;
  box-shadow: inset 3px 0 0 var(--intent-accent), inset 0 0 0 1px rgba(255,255,255,.12);
  transform: translateX(2px);
}
.intent-when { --intent-accent: var(--blue); }
.intent-then { --intent-accent: var(--green); }
.intent-and { --intent-accent: var(--amber); }
.intent-block-rail {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 14px 12px;
  background: color-mix(in srgb, var(--intent-accent) 8%, transparent);
  color: var(--intent-accent);
}
.intent-block-rail span { font: 700 11px/1 var(--font-mono); letter-spacing: .08em; }
.intent-block-rail small { color: var(--muted-2); font: 11px/1 var(--font-mono); }
.intent-block-body { padding: 12px 14px 14px; }
.intent-block-body label {
  display: block;
  margin-bottom: 5px;
  color: var(--muted-2);
  font-size: 11px;
  font-weight: 650;
}
.intent-step-input {
  display: block;
  width: 100%;
  min-height: 54px;
  padding: 0;
  resize: vertical;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: 13px/1.55 var(--font-mono);
}
.intent-step-input::placeholder { color: var(--muted-2); }

.output-pane-header {
  display: grid;
  grid-template-columns: auto 1fr;
}
.output-tabs { justify-self: end; }
.pane-tab { font-size: 12px; }
.pane-tab.active { box-shadow: inset 0 -2px 0 var(--violet); }

.output-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 7px 13px;
  background: color-mix(in srgb, var(--surface-2) 92%, transparent);
}
.output-system-summary {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.output-tools { margin-left: auto; }
.output-control,
.design-system-picker select { min-height: 32px; font-size: 12px; }

.editor-floating-tip {
  border: 0;
  border-radius: var(--radius-card);
  box-shadow: inset 0 0 0 1px rgba(139,120,255,.25);
}

.prototype-window { border-radius: var(--radius-panel); }
.prototype-card { border-radius: var(--radius-card); }
.prototype-field button,
.prototype-insight,
.prototype-actions button { border-radius: var(--radius-control); }
.prototype-product { color: var(--muted); font-weight: 500; }
.prototype-badge { font-weight: 700; }
.prototype-heading h2 { font-size: 32px; }
.prototype-heading p,
.prototype-card small,
.prototype-check,
.prototype-insight { font-size: 13px; }
.prototype-card-title strong,
.prototype-field button { font-size: 14px; }
.prototype-actions button { font-size: 13px; }

.prototype-stage.ds-material .prototype-card {
  border: 0;
  border-radius: 4px;
  background: #252525;
  box-shadow: 0 2px 6px rgba(0,0,0,.38);
}
.prototype-stage.ds-material .prototype-primary { border-radius: 20px; text-transform: uppercase; letter-spacing: .04em; }
.prototype-stage.ds-material .prototype-secondary { border: 0; text-transform: uppercase; }
.prototype-stage.ds-ant .prototype-card { border-radius: 8px; background: #1f1f1f; }
.prototype-stage.ds-ant .prototype-field button { border-radius: 6px; }
.prototype-stage.ds-ant .prototype-primary { border-radius: 6px; box-shadow: 0 2px 0 rgba(0,0,0,.2); }
.prototype-stage.ds-dls .prototype-window { background: linear-gradient(160deg, #15151a, #101014); }
.prototype-stage.ds-dls .prototype-card { border-color: rgba(139,120,255,.22); }

[data-theme="light"] .intent-blocks { background: #f7f7f5; }
[data-theme="light"] .intent-block { background: #fff; box-shadow: 0 1px 3px rgba(30,30,26,.06); }
[data-theme="light"] .intent-block:focus-within { background: #fff; box-shadow: inset 3px 0 0 var(--intent-accent), 0 6px 18px rgba(30,30,26,.08); }
[data-theme="light"] .intent-step-input { color: var(--text); }
[data-theme="light"] .output-toolbar { background: #fafaf8; }

/* Preserve the original light-mode visual treatment. */
[data-theme="light"] .editor-topbar {
  min-height: 68px;
  padding-inline: 18px;
  border-bottom-color: var(--line);
}
[data-theme="light"] .editor-brand-button { border-radius: 9px; }
[data-theme="light"] .editor-project-name .status-pill {
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  font-size: 10px;
}
[data-theme="light"] .editor-project-name .status-pill::before { content: none; }
[data-theme="light"] .editor-pane { border-right: 1px solid var(--line); }
[data-theme="light"] .editor-pane:last-child { border-right: 0; }
[data-theme="light"] .pane-header {
  min-height: 54px;
  border-bottom-color: var(--line);
  background: #fff;
}
[data-theme="light"] .step-number {
  border: 1px solid var(--line);
  background: transparent;
}
[data-theme="light"] .pane-tab.active {
  background: rgba(29, 29, 32, .055);
  box-shadow: none;
}
[data-theme="light"] .pane-resizer::after { background: var(--line); }
[data-theme="light"] .intent-blocks {
  padding: 22px 22px 90px 54px;
  background:
    linear-gradient(90deg, rgba(29,29,32,.025) 0 40px, transparent 40px),
    #fbfbfa;
}
[data-theme="light"] .intent-block {
  display: block;
  overflow: visible;
  margin: 0 0 18px;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  transform: none;
}
[data-theme="light"] .intent-block:focus-within {
  background: transparent;
  box-shadow: none;
  transform: none;
}
[data-theme="light"] .intent-block-rail {
  display: flex;
  padding: 0 0 6px;
  flex-direction: row;
  background: transparent;
}
[data-theme="light"] .intent-block-rail small { display: none; }
[data-theme="light"] .intent-block-body { padding: 0; }
[data-theme="light"] .intent-block-body label { display: none; }
[data-theme="light"] .intent-step-input {
  min-height: 48px;
  resize: none;
  color: #29292d;
  font-size: 14px;
  line-height: 1.75;
}
[data-theme="light"] .output-toolbar {
  min-height: 46px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}
[data-theme="light"] .editor-floating-tip {
  border: 1px solid rgba(111,86,229,.22);
  border-radius: 8px;
  background: #f7f7f5;
  box-shadow: none;
}
[data-theme="light"] .prototype-window { border-radius: 14px; }
[data-theme="light"] .prototype-card { border-radius: 10px; }
[data-theme="light"] .prototype-field button,
[data-theme="light"] .prototype-insight,
[data-theme="light"] .prototype-actions button { border-radius: 8px; }
[data-theme="light"] .prototype-heading h2 { font-size: 26px; }
[data-theme="light"] .prototype-heading p,
[data-theme="light"] .prototype-card small,
[data-theme="light"] .prototype-check,
[data-theme="light"] .prototype-insight { font-size: 11px; }
[data-theme="light"] .prototype-card-title strong,
[data-theme="light"] .prototype-field button { font-size: 12px; }
[data-theme="light"] .prototype-actions button { font-size: 11px; }
[data-theme="light"] .prototype-stage.ds-material .prototype-card,
[data-theme="light"] .prototype-stage.ds-ant .prototype-card {
  border: 1px solid var(--line);
  background: #f7f7f5;
  box-shadow: none;
}
[data-theme="light"] .prototype-stage.ds-material .prototype-primary,
[data-theme="light"] .prototype-stage.ds-material .prototype-secondary {
  border-radius: 8px;
  text-transform: none;
  letter-spacing: normal;
}
[data-theme="light"] .prototype-stage.ds-dls .prototype-window { background: #fff; }

@media (max-width: 760px) {
  .editor-collaborators { display: none; }
  .editor-actions .btn:not(.editor-publish):not([data-action="editor-more"]) { display: none; }
  .intent-blocks { padding: 14px 12px 76px; }
  .intent-block { grid-template-columns: 64px minmax(0, 1fr); }
  .output-toolbar { align-items: flex-start; flex-direction: column; }
  .output-tools { width: 100%; margin-left: 0; overflow-x: auto; }
}

/* Final theme overrides: keep borders neutral and primary actions legible. */
[data-theme="light"] .dashboard-hero,
[data-theme="light"] .project-card,
[data-theme="light"] .table-shell,
[data-theme="light"] .workspace-card,
[data-theme="light"] .activity-card,
[data-theme="light"] .template-card,
[data-theme="light"] .stat-card,
[data-theme="light"] .settings-section { border-color: transparent; }

[data-theme="light"] button:focus-visible,
[data-theme="light"] a:focus-visible,
[data-theme="light"] input:focus-visible,
[data-theme="light"] textarea:focus-visible,
[data-theme="light"] select:focus-visible { outline-color: rgba(45, 45, 50, .42); }

[data-theme="dark"] button:focus-visible,
[data-theme="dark"] a:focus-visible,
[data-theme="dark"] input:focus-visible,
[data-theme="dark"] textarea:focus-visible,
[data-theme="dark"] select:focus-visible { outline-color: rgba(218, 217, 224, .52); }

[data-theme="dark"] .pane-tab.active {
  box-shadow: inset 0 -2px 0 rgba(235, 234, 240, .72);
}

[data-theme="dark"] .pane-resizer:hover::after,
[data-theme="dark"] .pane-resizer:focus-visible::after {
  background: rgba(218, 217, 224, .58);
}

/* Primary actions use the original clean white treatment. */
[data-theme="dark"] .btn.btn-primary,
[data-theme="light"] .btn.btn-primary {
  border-color: #f2f1f4;
  background: #f2f1f4;
  color: #151519;
  box-shadow: none;
  font-weight: 700;
  opacity: 1;
}

[data-theme="dark"] .btn.btn-primary:hover,
[data-theme="light"] .btn.btn-primary:hover {
  border-color: #ffffff;
  background: #ffffff;
  color: #0c0c0e;
}

[data-theme="dark"] .btn.btn-primary:focus-visible,
[data-theme="light"] .btn.btn-primary:focus-visible {
  outline-color: rgba(218, 217, 224, .62);
}

[data-theme="dark"] .btn.btn-primary .icon,
[data-theme="light"] .btn.btn-primary .icon { color: #151519; }
