:root {
  color-scheme: dark;
  --bg: #1c1814;
  --bg-deep: #14110e;
  --surface: #252019;
  --surface-elevated: #2c261f;
  --surface-muted: #201b16;
  --surface-input: #1a1612;
  --border: #4a4035;
  --border-strong: #5e5244;
  --text: #eee6d8;
  --text-secondary: #cfc2ae;
  --muted: #a89884;
  --primary: #c9a84c;
  --primary-hover: #dbb860;
  --primary-soft: rgba(201, 168, 76, 0.14);
  --accent: #8b6914;
  --accent-soft: rgba(139, 105, 20, 0.12);
  --accent-strong: #a08028;
  --header-bg: #181410;
  --header-text: #e8dfd0;
  --on-primary: #2a2010;
  --danger: #c87068;
  --danger-soft: rgba(200, 112, 104, 0.14);
  --danger-border: rgba(200, 112, 104, 0.35);
  --success: #8a9a70;
  --success-soft: rgba(138, 154, 112, 0.14);
  --success-border: rgba(138, 154, 112, 0.35);
  --placeholder: #8f7f6c;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 4px rgba(12, 8, 4, 0.4);
  --shadow-md: 0 6px 24px rgba(12, 8, 4, 0.48);
  --shadow-lg: 0 16px 48px rgba(12, 8, 4, 0.58);
  --font-serif: "Source Serif 4", "PT Serif", Georgia, serif;
  --font-sans: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --text-base: 0.9375rem;
  --text-sm: 0.875rem;
  --text-xs: 0.8125rem;
  --text-2xs: 0.75rem;
  --leading-body: 1.62;
  --leading-ui: 1.5;
  --leading-tight: 1.28;
  --leading-display: 1.32;
  --tracking-tight: -0.015em;
  --tracking-normal: 0;
  --tracking-wide: 0.04em;
  --tracking-caps: 0.06em;
  --strategy-so: #8a9a70;
  --strategy-st: #c9a84c;
  --strategy-wo: #8a7868;
  --strategy-wt: #c87068;
  --gradient-ambient:
    radial-gradient(ellipse 90% 55% at 12% 0%, rgba(220, 160, 80, 0.1) 0%, rgba(220, 160, 80, 0.035) 38%, var(--fade-deep) 72%),
    radial-gradient(ellipse 75% 50% at 88% 10%, rgba(120, 80, 50, 0.08) 0%, rgba(120, 80, 50, 0.025) 36%, var(--fade-deep) 70%),
    radial-gradient(ellipse 70% 50% at 50% 100%, rgba(180, 120, 60, 0.07) 0%, rgba(180, 120, 60, 0.02) 40%, var(--fade-deep) 75%);
  --gradient-surface:
    linear-gradient(155deg, rgba(255, 220, 160, 0.04) 0%, var(--fade-surface) 38%),
    linear-gradient(325deg, rgba(201, 168, 76, 0.05) 0%, rgba(160, 120, 80, 0.03) 50%, var(--fade-surface) 72%);
  --gradient-border: linear-gradient(
    135deg,
    rgba(201, 168, 76, 0.38),
    rgba(160, 120, 80, 0.28),
    rgba(220, 180, 100, 0.22),
    rgba(201, 168, 76, 0.32)
  );
  --gradient-primary: linear-gradient(135deg, #6b5018 0%, #a08028 45%, #c9a84c 100%);
  --gradient-primary-hover: linear-gradient(135deg, #7a5c20 0%, #b09030 45%, #dbb860 100%);
  --fade-header: rgba(24, 20, 16, 0);
  --gradient-header:
    linear-gradient(180deg, rgba(255, 220, 160, 0.04) 0%, var(--fade-header) 100%),
    linear-gradient(90deg, rgba(201, 168, 76, 0.06) 0%, var(--fade-header) 28%, var(--fade-header) 72%, rgba(160, 120, 80, 0.05) 100%);
  --gradient-sidebar:
    linear-gradient(180deg, rgba(201, 168, 76, 0.06) 0%, var(--fade-bg) 22%, var(--fade-bg) 78%, rgba(100, 70, 45, 0.05) 100%);
  --manzya-red: #c84848;
  --manzya-red-soft: rgba(200, 72, 72, 0.14);
  --glass-bg: rgba(36, 30, 24, 0.42);
  --glass-bg-strong: rgba(44, 38, 31, 0.58);
  --glass-bg-hover: rgba(52, 44, 36, 0.72);
  --glass-bg-active: rgba(201, 168, 76, 0.12);
  --glass-border: rgba(255, 235, 200, 0.16);
  --glass-border-strong: rgba(201, 168, 76, 0.28);
  --glass-highlight: inset 0 1px 0 rgba(255, 240, 210, 0.14), inset 0 -1px 0 rgba(0, 0, 0, 0.18);
  --glass-shadow: 0 2px 14px rgba(8, 6, 4, 0.32);
  --glass-blur: 12px;
  /* Fade stops must match background hue — plain "transparent" blends via black and causes muddy spots. */
  --fade-deep: rgba(20, 17, 14, 0);
  --fade-deep-mid: rgba(20, 17, 14, 0.55);
  --fade-bg: rgba(28, 24, 20, 0);
  --fade-bg-mid: rgba(28, 24, 20, 0.5);
  --fade-auth: rgba(16, 12, 8, 0);
  --fade-surface: rgba(44, 38, 31, 0);
}

@keyframes ambient-drift {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
    opacity: 0.65;
  }

  50% {
    transform: translate3d(1%, -0.5%, 0) scale(1.02);
    opacity: 0.85;
  }

  100% {
    transform: translate3d(-0.5%, 1%, 0) scale(0.99);
    opacity: 0.7;
  }
}

@keyframes border-shimmer {
  0% {
    background-position: 0% 50%;
  }

  100% {
    background-position: 200% 50%;
  }
}

@keyframes sheen-pass {
  0% {
    transform: translateX(-130%) skewX(-18deg);
  }

  100% {
    transform: translateX(230%) skewX(-18deg);
  }
}

* {
  box-sizing: border-box;
}

html {
  font-size: clamp(0.9375rem, 0.25vw + 0.875rem, 1rem);
  text-size-adjust: 100%;
}

html,
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: 400;
  line-height: var(--leading-body);
  letter-spacing: var(--tracking-normal);
  color: var(--text);
  background-color: var(--bg-deep);
  background-image:
    var(--gradient-ambient),
    linear-gradient(180deg, var(--bg-deep) 0%, var(--bg) 50%, #201b16 100%);
  background-attachment: scroll;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-optical-sizing: auto;
  font-feature-settings: "kern" 1, "liga" 1, "calt" 1;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
h4,
p {
  text-wrap: pretty;
}

body::before {
  content: "";
  position: fixed;
  inset: -15%;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 18% 25%, rgba(220, 160, 80, 0.09) 0%, rgba(220, 160, 80, 0.03) 42%, var(--fade-deep) 78%),
    radial-gradient(circle at 82% 15%, rgba(120, 80, 50, 0.07) 0%, rgba(120, 80, 50, 0.02) 40%, var(--fade-deep) 75%),
    radial-gradient(circle at 60% 88%, rgba(180, 120, 60, 0.06) 0%, rgba(180, 120, 60, 0.018) 44%, var(--fade-deep) 76%);
  filter: blur(42px);
  will-change: transform, opacity;
  animation: ambient-drift 40s ease-in-out infinite alternate;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.04;
  mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px 180px;
}

#app {
  position: relative;
  z-index: 1;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.screen {
  min-height: 100vh;
}

#workspace-screen {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: transparent;
}

/* ——— panels ——— */
.panel,
.project-card,
.item-card,
.matrix-card,
.auth-card {
  position: relative;
  border: 1px solid transparent;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  background:
    var(--gradient-surface),
    var(--surface-elevated) padding-box,
    var(--gradient-border) border-box;
  background-clip: padding-box, padding-box, border-box;
  background-origin: border-box;
}

.panel::before,
.project-card::before,
.item-card::before,
.matrix-card::before,
.auth-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 220, 160, 0.04), var(--fade-surface) 30%);
  opacity: 0.7;
}

/* ——— auth ——— */
.auth-shell {
  position: relative;
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 420px);
  align-items: stretch;
  gap: 0;
  padding: 0;
  overflow: hidden;
  background:
    radial-gradient(ellipse 85% 65% at 15% 20%, rgba(220, 160, 80, 0.1) 0%, rgba(220, 160, 80, 0.03) 40%, var(--fade-auth) 72%),
    radial-gradient(ellipse 75% 55% at 85% 15%, rgba(120, 80, 50, 0.07) 0%, rgba(120, 80, 50, 0.02) 38%, var(--fade-auth) 70%),
    linear-gradient(180deg, #100c08 0%, var(--bg) 100%);
}

.auth-hero {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 100vh;
  padding: 40px 48px 36px;
  border-right: 1px solid rgba(201, 168, 76, 0.12);
  background:
    linear-gradient(180deg, rgba(255, 220, 160, 0.03) 0%, var(--fade-bg) 35%),
    linear-gradient(135deg, rgba(80, 50, 40, 0.08) 0%, var(--fade-bg) 55%);
}

.auth-hero-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.auth-hero-tagline,
.study-hero-tagline {
  margin: 0;
  font-size: var(--text-sm);
  font-weight: 500;
  line-height: var(--leading-ui);
  letter-spacing: var(--tracking-normal);
  color: var(--text-secondary);
}

.auth-hero-brand,
.study-hero-brand {
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.auth-hero-brand:hover,
.study-hero-brand:hover {
  color: var(--manzya-red);
  border-bottom-color: rgba(200, 72, 72, 0.45);
}

.auth-hero-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 32px 0 24px;
  max-width: 560px;
}

.auth-hero-kicker,
.study-hero-kicker {
  margin: 0 0 16px;
  font-family: var(--font-sans);
  font-size: clamp(1.375rem, 2.8vw, 1.875rem);
  font-weight: 600;
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  text-transform: none;
  color: var(--text);
}

.auth-hero-rule,
.study-hero-rule {
  width: 100%;
  max-width: 280px;
  height: 1px;
  margin: 0 0 18px;
  border: none;
  background: linear-gradient(90deg, rgba(201, 168, 76, 0.65), rgba(160, 120, 80, 0.2), transparent);
}

.auth-hero-lead,
.study-hero-lead {
  margin: 0 0 8px;
  font-size: 1.0625rem;
  line-height: var(--leading-ui);
  color: var(--text-secondary);
}

.auth-hero-note {
  margin: 0 0 28px;
  font-size: var(--text-sm);
  line-height: var(--leading-ui);
  font-style: normal;
  color: var(--muted);
}

.auth-hero-statement,
.study-hero-statement,
.hero-statement-slide {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 3vw, 2.125rem);
  font-weight: 600;
  line-height: var(--leading-display);
  letter-spacing: 0.01em;
  text-transform: none;
  color: var(--primary);
}

.auth-hero-statement span,
.study-hero-statement span,
.hero-statement-slide span {
  display: block;
}

.hero-statement-slider {
  margin: 0 0 8px;
}

.hero-statement-track {
  position: relative;
  min-height: 4.5em;
}

.hero-statement-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.55s ease, visibility 0.55s ease;
}

.hero-statement-slide.is-active {
  position: relative;
  opacity: 1;
  visibility: visible;
}

.hero-statement-nav {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin-top: 12px;
}

.hero-statement-arrow {
  padding: 0;
  border: none;
  background: transparent;
  font-size: 1.25rem;
  line-height: 1;
  color: var(--primary);
  opacity: 0.7;
  cursor: pointer;
  transition: opacity 0.15s ease, color 0.15s ease;
}

.hero-statement-arrow:hover {
  opacity: 1;
  color: var(--primary-hover);
}

.hero-statement-dots {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.hero-statement-dot {
  width: 6px;
  height: 6px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--border-strong);
  opacity: 0.55;
  cursor: pointer;
  transition: opacity 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.hero-statement-dot.is-active {
  background: var(--manzya-red);
  opacity: 1;
  box-shadow: 0 0 8px rgba(200, 72, 72, 0.35);
}

.hero-statement-slider-compact {
  margin: 0;
}

.hero-statement-slider-compact .hero-statement-track {
  min-height: 2.8em;
}

.hero-statement-slider-compact .hero-statement-slide {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 0.35em;
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: var(--tracking-normal);
}

.hero-statement-slider-compact .hero-statement-slide span {
  display: inline;
}

.hero-statement-slider-compact .hero-statement-slide span:not(:last-child)::after {
  content: " ·";
  color: var(--muted);
  font-weight: 400;
}

.hero-statement-nav-compact {
  margin-top: 8px;
}

.hero-statement-nav-compact .hero-statement-arrow {
  font-size: 1rem;
}

.auth-hero-footer {
  margin: 0;
  padding-top: 20px;
  border-top: 1px solid rgba(201, 168, 76, 0.12);
}

.auth-hero-footer p {
  margin: 0;
  max-width: 420px;
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--muted);
}

.auth-shell::before {
  content: "";
  position: absolute;
  inset: -25%;
  pointer-events: none;
  background:
    radial-gradient(ellipse 55% 45% at 30% 40%, rgba(201, 168, 76, 0.08) 0%, var(--fade-auth) 70%),
    radial-gradient(ellipse 50% 40% at 72% 55%, rgba(160, 120, 80, 0.06) 0%, var(--fade-auth) 68%);
  filter: blur(36px);
  animation: ambient-drift 48s ease-in-out infinite alternate-reverse;
  opacity: 0.85;
}

.auth-card {
  position: relative;
  z-index: 1;
  align-self: center;
  justify-self: center;
  width: 100%;
  max-width: 400px;
  margin: 24px;
  padding: 28px 24px 24px;
  box-shadow:
    var(--shadow-lg),
    0 0 40px rgba(201, 168, 76, 0.1);
}

.auth-eyebrow {
  margin: 0 0 6px;
  font-size: var(--text-2xs);
  font-weight: 600;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--primary);
}

.auth-card h2 {
  margin: 0 0 20px;
  font-family: var(--font-serif);
  font-size: 1.75rem;
  font-weight: 600;
  line-height: var(--leading-tight);
  letter-spacing: 0;
  color: var(--text);
}

/* ——— typography ——— */
.page-title {
  margin: 0 0 4px;
  font-family: var(--font-sans);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--text);
}

.panel h2,
.section-title-compact {
  margin: 0 0 4px;
  font-family: var(--font-sans);
  font-size: 1.125rem;
  font-weight: 600;
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--text);
}

.keyboard-hint {
  margin: 0 0 12px;
  font-size: var(--text-sm);
  color: var(--muted);
  line-height: var(--leading-ui);
}

.keyboard-hint kbd {
  display: inline-block;
  min-width: 1.25em;
  padding: 1px 6px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface-muted);
  font-family: inherit;
  font-size: var(--text-2xs);
  font-weight: 600;
  color: var(--text-secondary);
  text-align: center;
  box-shadow: 0 1px 0 var(--border);
}

.brainstorm-block .keyboard-hint {
  margin: 6px 0 0;
}

.eyebrow {
  display: none;
}

.muted {
  color: var(--muted);
  font-size: var(--text-sm);
  line-height: var(--leading-ui);
}

.section-desc {
  margin: 0 0 12px;
  font-size: var(--text-sm);
  line-height: var(--leading-ui);
  color: var(--muted);
}

.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;
}

/* ——— forms ——— */
.stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: var(--text-sm);
  line-height: var(--leading-ui);
  color: var(--text-secondary);
  font-weight: 500;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 9px 11px;
  background: var(--surface-input);
  color: var(--text);
  font-size: var(--text-base);
  line-height: var(--leading-ui);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input::placeholder,
textarea::placeholder {
  color: var(--placeholder);
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

textarea {
  resize: vertical;
}

/* ——— buttons ——— */
.tab-row {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.tab-button,
.primary,
.secondary,
.ghost,
.icon-button {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-weight: 500;
  background: var(--surface);
  color: var(--text);
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.tab-button,
.primary,
.secondary,
.ghost {
  padding: 8px 14px;
  font-size: var(--text-sm);
  line-height: var(--leading-ui);
}

.tab-button.active {
  background: var(--primary-soft);
  color: var(--primary);
  border-color: var(--primary);
}

.primary {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background: var(--gradient-primary);
  color: var(--on-primary);
  border-color: rgba(201, 168, 76, 0.55);
  box-shadow:
    0 1px 0 rgba(255, 230, 180, 0.12) inset,
    0 4px 16px rgba(201, 168, 76, 0.2);
  font-weight: 600;
}

.primary::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 38%, rgba(255, 255, 255, 0.22) 50%, transparent 62%);
  transform: translateX(-130%) skewX(-18deg);
  pointer-events: none;
}

.primary:hover {
  background: var(--gradient-primary-hover);
  border-color: rgba(230, 200, 120, 0.65);
  box-shadow:
    0 1px 0 rgba(255, 230, 180, 0.14) inset,
    0 6px 20px rgba(201, 168, 76, 0.26);
}

.primary:hover::after {
  animation: sheen-pass 0.7s ease;
}

.ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: transparent;
}

.ghost:hover {
  color: var(--text);
  background: var(--surface-muted);
  border-color: var(--border);
}

.secondary {
  background: var(--surface);
  color: var(--text-secondary);
}

.secondary:hover {
  background: var(--surface-muted);
  border-color: var(--border-strong);
}

.danger,
.profile-dropdown-btn.danger {
  color: var(--danger);
  border-color: transparent;
  background: transparent;
}

.danger-outline {
  color: var(--muted);
  border-color: var(--border);
  background: var(--surface);
}

.danger-outline:hover {
  color: var(--danger);
  border-color: var(--danger-border);
  background: var(--danger-soft);
}

.icon-button {
  width: 36px;
  height: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.primary-icon {
  background: var(--gradient-primary);
  color: var(--on-primary);
  border-color: rgba(201, 168, 76, 0.55);
  box-shadow: 0 2px 10px rgba(201, 168, 76, 0.2);
}

.primary-icon:hover {
  background: var(--gradient-primary-hover);
}

.icon-slot svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ——— glass on interactive controls ——— */
@supports (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px)) {
  .tab-button,
  .secondary,
  .danger-outline,
  .icon-button:not(.primary-icon),
  .profile-trigger,
  .profile-dropdown-btn:not(.danger),
  .user-switcher,
  .nav-item,
  .nav-sub,
  .project-card,
  .matrix-add-idea-button {
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.12);
    backdrop-filter: blur(var(--glass-blur)) saturate(1.12);
  }

  .tab-button,
  .secondary,
  .danger-outline,
  .icon-button:not(.primary-icon),
  .profile-trigger,
  .user-switcher,
  .matrix-add-idea-button {
    background: var(--glass-bg-strong);
    border-color: var(--glass-border);
    box-shadow: var(--glass-highlight), var(--glass-shadow);
  }

  .tab-button:hover,
  .secondary:hover,
  .danger-outline:hover,
  .icon-button:not(.primary-icon):hover,
  .profile-trigger:hover,
  .matrix-add-idea-button:hover {
    background: var(--glass-bg-hover);
    border-color: var(--glass-border-strong);
  }

  .tab-button.active {
    background:
      linear-gradient(155deg, rgba(255, 220, 160, 0.08), transparent 45%),
      var(--glass-bg-active);
    border-color: var(--glass-border-strong);
    box-shadow:
      var(--glass-highlight),
      0 0 20px rgba(201, 168, 76, 0.12);
  }

  .nav-item:hover,
  .nav-sub:hover {
    background: var(--glass-bg);
    box-shadow: var(--glass-highlight);
  }

  .nav-item.active,
  .nav-sub.active {
    background:
      linear-gradient(155deg, rgba(255, 220, 160, 0.06), transparent 50%),
      var(--glass-bg-active);
    box-shadow: var(--glass-highlight), 0 0 16px rgba(201, 168, 76, 0.08);
  }

  .profile-dropdown-btn:hover:not(.danger) {
    background: var(--glass-bg);
    box-shadow: var(--glass-highlight);
  }

  .ghost:hover {
    -webkit-backdrop-filter: blur(10px) saturate(1.1);
    backdrop-filter: blur(10px) saturate(1.1);
    background: var(--glass-bg);
    border-color: var(--glass-border);
    box-shadow: var(--glass-highlight), var(--glass-shadow);
  }

  .project-card {
    background:
      linear-gradient(155deg, rgba(255, 220, 160, 0.05) 0%, transparent 40%),
      var(--glass-bg-strong) padding-box,
      var(--gradient-border) border-box;
    background-clip: padding-box, padding-box, border-box;
    background-origin: border-box;
  }

  .project-card:hover {
    background:
      linear-gradient(155deg, rgba(255, 220, 160, 0.07) 0%, transparent 42%),
      var(--glass-bg-hover) padding-box,
      var(--gradient-border) border-box;
    background-clip: padding-box, padding-box, border-box;
    background-origin: border-box;
  }

  .project-card.selected {
    background:
      linear-gradient(135deg, rgba(201, 168, 76, 0.14), rgba(160, 120, 80, 0.08)),
      var(--glass-bg-active) padding-box,
      var(--gradient-border) border-box;
    background-clip: padding-box, padding-box, border-box;
    background-origin: border-box;
  }

  .hero-statement-arrow:hover {
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    background: var(--glass-bg);
    border-radius: 6px;
    box-shadow: var(--glass-highlight);
  }

  .hero-statement-dot {
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-highlight);
  }

  .hero-statement-dot.is-active {
    background: rgba(200, 72, 72, 0.55);
    border-color: rgba(255, 180, 180, 0.25);
    box-shadow:
      var(--glass-highlight),
      0 0 10px rgba(200, 72, 72, 0.35);
  }
}

.primary,
.primary-icon {
  box-shadow:
    var(--glass-highlight),
    0 1px 0 rgba(255, 230, 180, 0.12) inset,
    0 4px 16px rgba(201, 168, 76, 0.2);
}

.primary:hover,
.primary-icon:hover {
  box-shadow:
    var(--glass-highlight),
    0 1px 0 rgba(255, 230, 180, 0.16) inset,
    0 6px 20px rgba(201, 168, 76, 0.26);
}

/* ——— messages ——— */
.message {
  padding: 10px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  font-size: var(--text-sm);
  line-height: var(--leading-ui);
  background: var(--surface);
}

.message.info {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--primary);
}

.message.error {
  border-color: var(--danger-border);
  background: var(--danger-soft);
  color: var(--danger);
}

.message.success {
  border-color: var(--success-border);
  background: var(--success-soft);
  color: var(--success);
}

/* ——— header ——— */
.app-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  border-bottom: 1px solid transparent;
  background:
    var(--gradient-header),
    var(--header-bg);
  box-shadow: var(--shadow-sm);
}

.app-header::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(201, 168, 76, 0.18) 15%,
    rgba(220, 180, 100, 0.4) 35%,
    rgba(160, 120, 80, 0.32) 50%,
    rgba(220, 180, 100, 0.4) 65%,
    rgba(201, 168, 76, 0.18) 85%,
    transparent 100%
  );
  background-size: 200% 100%;
  animation: border-shimmer 22s linear infinite;
}

.brand-mark {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-seal {
  display: block;
  width: 3px;
  height: 28px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(180deg, #dbb860 0%, #c9a84c 45%, #6b5018 100%);
  transform: none;
  flex-shrink: 0;
  box-shadow: 0 0 12px rgba(201, 168, 76, 0.35);
}

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.brand-name {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-transform: none;
  color: var(--header-text);
  line-height: 1.2;
}

.brand-tagline {
  margin: 0;
  font-size: var(--text-2xs);
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: var(--muted);
}

.app-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-switcher-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.user-switcher-label {
  font-size: var(--text-2xs);
  color: var(--muted);
  line-height: 1;
}

.user-switcher {
  min-width: 180px;
  max-width: min(42vw, 240px);
  padding: 6px 28px 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-muted);
  color: var(--text);
  font-size: 0.8125rem;
  font-family: inherit;
  cursor: pointer;
}

.user-switcher:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-soft);
}

.profile-dropdown-wrap {
  position: relative;
}

.profile-trigger {
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface-muted);
  color: var(--primary);
  font-size: 0.8125rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.profile-trigger:hover {
  background: var(--primary-soft);
  border-color: var(--primary);
}

.profile-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 6px;
  min-width: 200px;
  padding: 12px;
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 100;
}

.profile-dropdown-head {
  padding-bottom: 8px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.profile-dropdown-name {
  display: block;
  font-weight: 500;
  font-size: 0.875rem;
  color: var(--text);
}

.profile-dropdown-email {
  display: block;
  font-size: 0.8125rem;
  margin-top: 2px;
  color: var(--muted);
}

.profile-dropdown-btn {
  display: block;
  width: 100%;
  padding: 8px;
  text-align: left;
  border: none;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text);
  font-size: 0.875rem;
}

/* ——— layout ——— */
.workspace-main {
  display: flex;
  flex: 1;
  min-height: 0;
}

.workspace-sidebar {
  width: 220px;
  flex-shrink: 0;
  padding: 18px 14px;
  border-right: 1px solid var(--border);
  background:
    var(--gradient-sidebar),
    var(--surface);
}

.nav-main,
.nav-project {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item,
.nav-sub {
  display: block;
  width: 100%;
  text-align: left;
  padding: 9px 12px;
  border: none;
  border-radius: var(--radius);
  border-left: 2px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  font-size: var(--text-sm);
  line-height: var(--leading-ui);
  font-weight: 400;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.nav-item:hover,
.nav-sub:hover {
  color: var(--text);
  background: var(--surface-muted);
}

.nav-item.active,
.nav-sub.active {
  color: var(--primary);
  background: var(--primary-soft);
  border-left-color: var(--primary);
  font-weight: 600;
}

.nav-project-wrap {
  padding-top: 12px;
  margin-top: 12px;
  border-top: 1px solid var(--border);
}

.nav-project-label {
  margin: 0 0 6px;
  padding: 0 12px;
  font-size: var(--text-2xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 700;
}

.workspace-content {
  flex: 1;
  min-width: 0;
  padding: 16px 20px;
  overflow: auto;
}

.workspace-content .view,
.view {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.workspace-content .view.hidden {
  display: none;
}

/* ——— dashboard ——— */
.study-hero {
  position: relative;
  padding: 18px 20px 16px;
  border: 1px solid transparent;
  border-radius: var(--radius-lg);
  background:
    var(--gradient-surface),
    var(--surface-elevated) padding-box,
    var(--gradient-border) border-box;
  background-clip: padding-box, padding-box, border-box;
  background-origin: border-box;
  box-shadow: var(--shadow-sm);
}

.study-hero-compact {
  margin-bottom: 4px;
}

.study-hero-compact .study-hero-top {
  margin-bottom: 10px;
}

.study-hero-compact .study-hero-kicker {
  margin-bottom: 10px;
  font-size: 1.125rem;
  letter-spacing: var(--tracking-tight);
}

.study-hero-compact .study-hero-rule {
  max-width: 200px;
  margin-bottom: 10px;
}

.study-hero-compact .study-hero-lead {
  margin-bottom: 12px;
  font-size: var(--text-sm);
  line-height: var(--leading-ui);
}

.study-hero-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.page-title-dashboard {
  margin-top: 8px;
}

.dashboard-intro {
  padding: 0;
  background: none;
  border: none;
  box-shadow: none;
}

.dashboard-intro .page-title {
  margin-bottom: 16px;
}

.dashboard-intro .muted {
  display: none;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 16px;
}

.dashboard-heading h2 {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.panel {
  padding: 16px;
}

.creation-panel .muted {
  display: none;
}

.creation-panel {
  overflow: hidden;
}

.creation-panel::after {
  content: "";
  position: absolute;
  top: 0;
  left: 16px;
  right: 16px;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, #6b5018, #a08028, #c9a84c, #8b6040, #a08028, #6b5018);
  background-size: 220% 100%;
  animation: border-shimmer 18s linear infinite;
  z-index: 2;
  pointer-events: none;
}

.creation-panel h2 {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
}

.project-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dashboard-heading-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.project-bulk-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin-bottom: 10px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-muted);
}

.project-bulk-select-all {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8125rem;
  color: var(--text);
  cursor: pointer;
}

.project-bulk-count {
  flex: 1;
  min-width: 120px;
  font-size: 0.8125rem;
}

.project-card-top {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.project-select-label {
  flex-shrink: 0;
  padding-top: 2px;
  cursor: pointer;
}

.project-select-checkbox {
  width: 16px;
  height: 16px;
  margin: 0;
  cursor: pointer;
}

.project-card-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.project-card.selected {
  background:
    linear-gradient(135deg, rgba(201, 168, 76, 0.16), rgba(160, 120, 80, 0.1)),
    var(--primary-soft) padding-box,
    var(--gradient-border) border-box;
  background-clip: padding-box, padding-box, border-box;
  background-origin: border-box;
  box-shadow:
    var(--shadow-md),
    0 0 24px rgba(201, 168, 76, 0.12);
}

.project-card {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  border-left: 3px solid transparent;
}

.project-card:hover {
  border-left-color: var(--primary);
  box-shadow:
    var(--shadow-md),
    0 0 20px rgba(201, 168, 76, 0.1);
}

.project-card h4 {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.project-card-head {
  align-items: flex-start;
  gap: 10px;
}

.project-title-button {
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
  text-align: left;
  cursor: pointer;
}

.project-title-button:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

.project-card-description {
  margin: 0;
}

.project-card-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.project-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  font-size: var(--text-2xs);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.status-badge[data-status="completed"] {
  background: var(--success-soft);
  border-color: var(--success-border);
  color: var(--success);
}

.status-badge[data-status="matrix_ready"] {
  background: var(--primary-soft);
  border-color: rgba(201, 168, 76, 0.4);
  color: var(--primary);
}

.button-inline-icon svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

/* ——— project view ——— */
.project-top-bar {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.project-toolbar,
.row-between,
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.project-compact-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-left: 3px solid var(--primary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.project-title-inline {
  font-family: var(--font-sans);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  border: none;
  background: transparent;
  padding: 0;
  color: var(--text);
}

.project-compact-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.project-title-inline:focus {
  box-shadow: none;
}

.project-description-display {
  margin: 2px 0 0;
  max-width: 52rem;
  font-size: var(--text-sm);
  line-height: var(--leading-ui);
  color: var(--text-secondary);
}

.project-description-display.is-placeholder {
  color: var(--muted);
  font-style: italic;
}

.project-description-editor {
  margin: 4px 0 0;
  max-width: 52rem;
}

.project-description-label {
  display: block;
  margin: 0;
}

.project-description-inline {
  width: 100%;
  min-height: 4.5rem;
  resize: vertical;
}

.project-meta-inline {
  margin: 6px 0 0;
  font-size: var(--text-2xs);
  line-height: var(--leading-ui);
}

.project-compact-fields {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.inline-label select,
.inline-label textarea {
  padding: 6px 8px;
  font-size: 0.8125rem;
}

.status-inline {
  display: inline-flex;
  align-items: center;
}

.status-badge {
  font-size: 0.75rem;
  white-space: nowrap;
}

.project-metrics-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.75rem;
  color: var(--muted);
}

.metric-inline em {
  font-style: normal;
  font-weight: 600;
  color: var(--primary);
}

.section-header-compact {
  padding: 0;
  background: none;
  border: none;
  box-shadow: none;
}

.section-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.compact-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}

.compact-form-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.item-panel {
  padding: 14px;
}

.section-panel:has(.item-panel) {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.section-panel:has(.item-panel) .section-title-compact {
  flex-shrink: 0;
}

.section-panel:has(.item-panel) .item-panel {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: hidden;
}

.section-panel:has(.item-panel) .add-item-form {
  flex-shrink: 0;
  margin: 0;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.section-panel:has(.item-panel) .item-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.compact-item {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-lg);
  border: 1px solid transparent;
  box-shadow: none;
  background:
    linear-gradient(150deg, rgba(255, 255, 255, 0.03) 0%, transparent 40%),
    var(--surface) padding-box,
    linear-gradient(135deg, rgba(201, 168, 76, 0.28), rgba(160, 120, 80, 0.18), rgba(201, 168, 76, 0.22)) border-box;
  background-clip: padding-box, padding-box, border-box;
  background-origin: border-box;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.compact-item:hover {
  box-shadow:
    var(--shadow-sm),
    0 0 32px rgba(201, 168, 76, 0.18);
}

.item-main textarea {
  min-height: 56px;
  font-size: var(--text-base);
  line-height: var(--leading-body);
  background: var(--surface-input);
}

.item-actions {
  display: flex;
  align-items: flex-end;
  gap: 6px;
}

.item-actions-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  flex-shrink: 0;
}

.save-item-btn,
.add-item-btn {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 104px;
  height: 36px;
  padding: 0 14px;
  border: 1px solid rgba(201, 168, 76, 0.55);
  border-radius: var(--radius);
  background: var(--gradient-primary);
  color: var(--on-primary);
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: var(--leading-ui);
  white-space: nowrap;
  flex-shrink: 0;
  box-shadow: 0 2px 12px rgba(201, 168, 76, 0.2);
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.save-item-btn::after,
.add-item-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 38%, rgba(255, 255, 255, 0.2) 50%, transparent 62%);
  transform: translateX(-130%) skewX(-18deg);
  pointer-events: none;
}

.save-item-btn:hover,
.add-item-btn:hover {
  background: var(--gradient-primary-hover);
  border-color: rgba(230, 200, 120, 0.6);
  box-shadow: 0 4px 16px rgba(201, 168, 76, 0.22);
}

.save-item-btn:hover::after,
.add-item-btn:hover::after {
  animation: sheen-pass 0.7s ease;
}

.priority-dropdown {
  position: relative;
  flex-shrink: 0;
}

.priority-dropdown-trigger {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

.priority-dropdown-trigger:hover {
  border-color: var(--border-strong);
}

.priority-dropdown-trigger:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.priority-dropdown-trigger:disabled,
.priority-dropdown.is-saving .priority-dropdown-trigger {
  opacity: 0.65;
  cursor: wait;
}

.priority-dropdown-empty {
  width: 14px;
  height: 14px;
  border: 2px dashed var(--border-strong);
  border-radius: 50%;
}

.priority-dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: 30;
  min-width: 168px;
  margin: 0;
  padding: 4px;
  list-style: none;
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
}

.priority-dropdown-option {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border: none;
  border-radius: calc(var(--radius) - 2px);
  background: transparent;
  color: var(--text);
  font-size: 0.8125rem;
  text-align: left;
  cursor: pointer;
}

.priority-dropdown-option:hover,
.priority-dropdown-option.is-selected {
  background: var(--primary-soft);
}

.priority-dot {
  width: 14px;
  height: 14px;
  padding: 0;
  border: none;
  border-radius: 50%;
  flex-shrink: 0;
}

.priority-dot.significant {
  background: #e05252;
}

.priority-dot.medium {
  background: #e6b020;
}

.priority-dot.insignificant {
  background: #4caf6a;
}

.refined-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ——— strategy accents ——— */
[data-strategy="SO"] {
  border-left: 3px solid var(--strategy-so);
}

[data-strategy="ST"] {
  border-left: 3px solid var(--strategy-st);
}

[data-strategy="WO"] {
  border-left: 3px solid var(--strategy-wo);
}

[data-strategy="WT"] {
  border-left: 3px solid var(--strategy-wt);
}

[data-strategy="SO"] h2,
[data-strategy="SO"] h3 {
  color: var(--strategy-so);
}

[data-strategy="ST"] h2,
[data-strategy="ST"] h3 {
  color: var(--strategy-st);
}

[data-strategy="WO"] h2,
[data-strategy="WO"] h3 {
  color: var(--strategy-wo);
}

[data-strategy="WT"] h2,
[data-strategy="WT"] h3 {
  color: var(--strategy-wt);
}

/* ——— matrix ——— */
.matrix-section-lead {
  margin: 0 0 8px;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--text-secondary);
}

.matrix-section-lead strong {
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--text);
}

.matrix-lead-label {
  display: inline-block;
  margin-right: 8px;
  font-size: var(--text-2xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.matrix-sections-light {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.matrix-sections-light .matrix-group {
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--radius-lg);
  background:
    var(--gradient-surface),
    var(--surface-elevated) padding-box,
    var(--gradient-border) border-box;
  background-clip: padding-box, padding-box, border-box;
  background-origin: border-box;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.matrix-group-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 14px;
  border: none;
  background: var(--surface-muted);
  text-align: left;
  cursor: pointer;
  color: inherit;
}

.matrix-group-toggle:hover {
  background: var(--surface-muted);
}

.matrix-group-toggle:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}

.matrix-group-chevron {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--muted);
  transition: transform 0.15s ease;
}

.matrix-group.is-collapsed .matrix-group-chevron {
  transform: rotate(-90deg);
}

.matrix-group-heading {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.matrix-group-topline {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
}

.matrix-group-code {
  font-size: var(--text-2xs);
  font-weight: 700;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
}

[data-strategy="SO"] .matrix-group-code {
  color: var(--strategy-so);
}

[data-strategy="ST"] .matrix-group-code {
  color: var(--strategy-st);
}

[data-strategy="WO"] .matrix-group-code {
  color: var(--strategy-wo);
}

[data-strategy="WT"] .matrix-group-code {
  color: var(--strategy-wt);
}

.matrix-group-title {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text);
}

.matrix-group-sub {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: var(--text-2xs);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--muted);
}

.matrix-axis-internal {
  font-weight: 700;
  color: var(--text-secondary);
}

.matrix-axis-external {
  font-weight: 600;
  color: var(--muted);
}

.matrix-axis-sep {
  font-weight: 400;
  color: var(--border);
}

.matrix-group-count {
  flex-shrink: 0;
  min-width: 24px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-align: center;
}

.matrix-group .matrix-grid {
  padding: 0 14px 14px;
}

.matrix-group.is-collapsed .matrix-grid {
  display: none;
}

.matrix-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.matrix-card {
  padding: 12px 14px;
  background: var(--surface-muted);
  box-shadow: none;
  border: 1px solid var(--border);
}

.matrix-pair {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-bottom: 0;
}

.matrix-pair-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.matrix-pair-values {
  gap: 10px;
}

.matrix-pair-sep {
  flex-shrink: 0;
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--muted);
  line-height: 1;
}

.matrix-factor-role {
  font-size: var(--text-2xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

.matrix-factor-internal.matrix-factor-role {
  color: var(--text-secondary);
}

.matrix-factor-value {
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text);
  text-transform: uppercase;
}

.matrix-block-label,
.matrix-brainstorm-label {
  display: block;
  margin: 0 0 6px;
  font-size: var(--text-2xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 700;
}

.matrix-significance {
  margin-top: 10px;
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--border);
}

.matrix-significance-head {
  margin-bottom: 8px;
}

.matrix-significance-hint {
  margin: 4px 0 0;
  font-size: 0.75rem;
  line-height: 1.45;
  color: var(--muted);
  font-weight: 400;
  text-transform: none;
  letter-spacing: normal;
}

.matrix-auto-badge {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: var(--text-2xs);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: middle;
}

.matrix-evaluation {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
}

.matrix-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.matrix-control-label {
  font-size: var(--text-2xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.matrix-sections-light .matrix-controls label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.matrix-sections-light .matrix-controls select,
.matrix-sections-light .matrix-controls .save-matrix-entry {
  font-size: 0.8125rem;
  padding: 6px 10px;
}

.matrix-sections-light .matrix-controls select {
  font-weight: 600;
}

.matrix-ideas-block {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.matrix-ideas-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.matrix-ideas-empty {
  margin: 0;
  font-size: 0.75rem;
  font-style: italic;
}

.matrix-add-idea {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: start;
}

.matrix-sections-light .matrix-new-idea {
  min-height: 48px;
  font-size: 0.8125rem;
  background: var(--surface-input);
}

.matrix-add-idea-button {
  white-space: nowrap;
}

.matrix-sections-light .matrix-note {
  min-height: 48px;
  font-size: 0.8125rem;
  background: var(--surface-input);
}

.matrix-brainstorm-ideas {
  margin: 10px 0 0;
  padding: 10px 0;
  border-top: 1px dashed var(--border);
}

.matrix-brainstorm-label {
  margin-bottom: 8px;
}

.matrix-brainstorm-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.matrix-brainstorm-list li {
  padding: 0;
  background: transparent;
  border: none;
}

.brainstorm-idea-edit {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
  align-items: flex-start;
  padding: 6px 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.brainstorm-idea-content {
  min-height: 44px;
  font-size: 0.8125rem;
  background: var(--surface-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 8px;
  resize: vertical;
}

.idea-row-brainstorm {
  padding: 0;
  background: transparent;
  border: none;
}

.idea-row-brainstorm .brainstorm-idea-edit {
  background: var(--surface-muted);
}

.brainstorm-saved-item {
  list-style: none;
}

.brainstorm-saved-item .brainstorm-idea-edit {
  background: var(--surface-muted);
}

.matrix-brainstorm-empty {
  margin: 10px 0 0;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
  font-size: 0.75rem;
  font-style: italic;
}

/* ——— conclusion ——— */
.conclusion-section-lead {
  margin: 0 0 12px;
  font-size: var(--text-sm);
  line-height: var(--leading-ui);
  color: var(--muted);
}

.conclusion-groups {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}

.conclusion-group-card {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  border-left-width: 3px;
}

.conclusion-group-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.conclusion-group-title {
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: var(--leading-ui);
  color: var(--text);
}

[data-strategy="SO"] .conclusion-group-title {
  color: var(--strategy-so);
}

[data-strategy="ST"] .conclusion-group-title {
  color: var(--strategy-st);
}

[data-strategy="WO"] .conclusion-group-title {
  color: var(--strategy-wo);
}

[data-strategy="WT"] .conclusion-group-title {
  color: var(--strategy-wt);
}

.conclusion-group-sub {
  font-size: var(--text-2xs);
  color: var(--muted);
}

.conclusion-group-text {
  min-height: 72px;
  margin-top: 4px;
  font-size: 0.8125rem;
  line-height: 1.5;
  background: var(--surface-muted);
  resize: vertical;
  cursor: default;
}

.conclusion-group-text:focus {
  outline: none;
  box-shadow: none;
}

.conclusion-summary-panel {
  padding: 12px 14px;
}

.conclusion-summary-title {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
}

small {
  font-size: 0.75rem;
}

.profile-panel {
  max-width: 360px;
  padding: 16px;
}

.profile-panel h2 {
  margin: 0 0 4px;
  font-size: 1rem;
}

/* ——— brainstorm ——— */
#section-brainstorm {
  width: 100%;
  max-width: none;
}

.brainstorm-block {
  width: 100%;
  max-width: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.brainstorm-block label {
  width: 100%;
}

.brainstorm-block textarea {
  width: 100%;
  min-height: 6rem;
}

.brainstorm-block h3 {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text);
}

.brainstorm-progress {
  margin: 0;
  font-size: 0.75rem;
}

.brainstorm-pair {
  margin: 0;
  padding: 10px 12px;
  background: var(--primary-soft);
  border: 1px solid var(--border);
  border-left: 3px solid var(--primary);
  border-radius: var(--radius);
  font-size: 0.875rem;
  color: var(--text);
}

.brainstorm-actions {
  margin-top: 4px;
}

.brainstorm-saved-wrap {
  margin-top: 4px;
}

.brainstorm-saved-label {
  margin: 0 0 6px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.brainstorm-saved-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* ——— mobile ——— */
.mobile-section-bar {
  display: none;
}

.mobile-section-trigger {
  width: 100%;
  padding: 10px 12px;
  text-align: left;
  border: 1px solid transparent;
  border-radius: var(--radius-lg);
  background:
    linear-gradient(155deg, rgba(255, 255, 255, 0.04) 0%, transparent 45%),
    var(--surface-elevated) padding-box,
    var(--gradient-border) border-box;
  background-clip: padding-box, padding-box, border-box;
  background-origin: border-box;
  color: var(--text);
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow-sm);
}

.mobile-section-nav-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.mobile-section-swipe-hint {
  margin: 0;
  flex: 1;
  font-size: var(--text-2xs);
  line-height: 1.35;
  color: var(--muted);
}

.mobile-swipe-arrows {
  display: inline-block;
  margin-right: 4px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--primary);
}

.mobile-section-counter {
  flex-shrink: 0;
  font-size: var(--text-2xs);
  font-weight: 700;
  color: var(--text-secondary);
  white-space: nowrap;
}

.mobile-section-trigger-label {
  flex-shrink: 0;
  font-size: var(--text-2xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.mobile-section-trigger #mobile-section-label {
  flex: 1;
  min-width: 0;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text);
}

.mobile-section-chevron {
  flex-shrink: 0;
  font-size: var(--text-2xs);
  color: var(--muted);
}

.mobile-section-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 8px;
}

.mobile-section-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--border-strong);
  transition: transform 0.2s ease, background 0.2s ease;
}

.mobile-section-dot.is-active {
  background: var(--primary);
  transform: scale(1.25);
}

.mobile-sections-viewport {
  display: block;
}

.mobile-sections-track {
  display: block;
}

.mobile-sections-track > .section-panel.hidden {
  display: none !important;
}

.mobile-section-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 4px;
  padding: 4px;
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 50;
  max-height: 60vh;
  overflow: auto;
}

.mobile-section-option {
  display: block;
  width: 100%;
  padding: 10px 12px;
  text-align: left;
  border: none;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.mobile-section-option.active,
.mobile-section-option:hover {
  background: var(--primary-soft);
  color: var(--primary);
}

@media (max-width: 900px) {
  .auth-shell {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .auth-hero {
    min-height: auto;
    padding: 24px 20px 20px;
    border-right: none;
    border-bottom: 1px solid rgba(201, 168, 76, 0.12);
  }

  .auth-hero-body {
    padding: 16px 0 12px;
  }

  .auth-hero-footer {
    display: none;
  }

  .auth-card {
    margin: 16px auto 24px;
    max-width: min(400px, calc(100% - 32px));
  }

  .hero-statement-slider-compact .hero-statement-slide {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }

  .hero-statement-slider-compact .hero-statement-slide span:not(:last-child)::after {
    content: none;
  }

  .dashboard-grid {
    display: flex;
    flex-direction: column;
    grid-template-columns: 1fr;
  }

  #dashboard-view .dashboard-grid > .creation-panel {
    order: -1;
  }

  #dashboard-view .dashboard-grid > .panel:not(.creation-panel) {
    order: 0;
  }

  .compact-form {
    grid-template-columns: 1fr;
  }

  .compact-form-actions {
    justify-content: flex-end;
    width: 100%;
  }

  .compact-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .item-actions {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
  }

  .item-actions-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    flex-shrink: 0;
  }

  .item-actions .delete-item {
    margin-left: auto;
    flex-shrink: 0;
  }
}

@media (max-width: 768px) {
  body {
    font-size: 13px;
    line-height: 1.45;
  }

  .workspace-sidebar {
    display: none !important;
  }

  .app-header {
    padding: 8px 12px;
  }

  .user-switcher-wrap {
    align-items: stretch;
    flex: 1;
    min-width: 0;
  }

  .user-switcher {
    width: 100%;
    max-width: none;
    min-width: 0;
  }

  .profile-dropdown-wrap {
    flex-shrink: 0;
  }

  .workspace-content {
    padding: 10px 12px;
  }

  .panel {
    padding: 12px;
  }

  /* ——— dashboard: новый проект сверху ——— */
  #dashboard-view {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  #dashboard-view .dashboard-grid {
    display: contents;
  }

  #dashboard-view .creation-panel {
    order: -10;
    padding: 10px 12px;
  }

  #dashboard-view .dashboard-grid > .panel:not(.creation-panel) {
    order: 0;
    padding: 10px 12px;
  }

  #dashboard-view .creation-panel h2 {
    margin-bottom: 8px;
    font-size: 0.8125rem;
  }

  #dashboard-view .creation-panel .stack {
    gap: 8px;
  }

  #dashboard-view .creation-panel textarea {
    min-height: 56px;
  }

  #dashboard-view .page-title {
    order: -15;
    margin: 0;
    font-size: 1.125rem;
  }

  .dashboard-heading {
    margin-bottom: 8px;
  }

  .project-grid {
    gap: 6px;
  }

  .project-card {
    padding: 10px 12px;
    gap: 6px;
  }

  .project-card-footer {
    flex-direction: row;
    align-items: center;
  }

  /* ——— project view ——— */
  #project-view {
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow: visible;
    min-height: auto;
  }

  .project-top-bar {
    gap: 8px;
  }

  .project-toolbar {
    flex-direction: row;
    align-items: center;
    gap: 8px;
  }

  .project-toolbar .ghost,
  .project-toolbar .primary {
    flex: 1;
    padding: 7px 10px;
    text-align: center;
  }

  .project-compact-header {
    flex-direction: column;
    gap: 8px;
    padding: 10px 12px;
  }

  .project-compact-main {
    gap: 4px;
    width: 100%;
  }

  .project-title-inline {
    font-size: 0.9375rem;
  }

  .project-meta-inline {
    font-size: var(--text-2xs);
    line-height: 1.35;
  }

  .project-compact-fields {
    flex-direction: row;
    align-items: center;
    gap: 8px;
    width: 100%;
  }

  .project-description-display {
    font-size: var(--text-sm);
  }

  .project-description-inline {
    min-height: 3.5rem;
  }

  .project-metrics-inline {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px 10px;
    padding-top: 8px;
    margin-top: 2px;
    border-top: 1px solid var(--border);
    font-size: var(--text-2xs);
  }

  .mobile-section-bar {
    display: block;
    position: sticky;
    top: 0;
    z-index: 20;
    margin: 0;
    padding: 4px 0 6px;
    background:
      linear-gradient(180deg, rgba(28, 22, 16, 0.96) 0%, rgba(24, 18, 14, 0.93) 100%);
    border-bottom: 1px solid transparent;
    border-image: linear-gradient(90deg, transparent, rgba(201, 168, 76, 0.35), rgba(160, 120, 80, 0.25), transparent) 1;
  }

  #workspace-screen:has(#project-view:not(.hidden)) {
    height: 100dvh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }

  #workspace-screen:has(#project-view:not(.hidden)) .workspace-main {
    flex: 1;
    min-height: 0;
    overflow: hidden;
  }

  #workspace-screen:has(#project-view:not(.hidden)) .workspace-content {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
  }

  .mobile-sections-viewport {
    flex: none;
    display: flex;
    flex-direction: column;
    height: calc(100dvh - var(--app-header-h, 52px) - var(--mobile-section-bar-h, 100px));
    overflow: hidden;
    width: 100%;
    touch-action: pan-y;
  }

  .mobile-sections-track {
    display: flex;
    flex: 1;
    min-height: 0;
    width: 100%;
    transition: transform 0.28s ease-out;
    will-change: transform;
  }

  .mobile-sections-track > .section-panel {
    flex: 0 0 100%;
    width: 100%;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    -webkit-overflow-scrolling: touch;
  }

  .mobile-sections-track > .section-panel:not(:has(.item-panel)) {
    overflow-y: auto;
  }

  .mobile-sections-track > .section-panel.hidden {
    display: flex !important;
  }

  .section-panel:has(.item-panel) .item-list {
    max-height: none;
  }

  .mobile-section-trigger {
    padding: 8px 10px;
    font-size: 0.8125rem;
    font-weight: 600;
  }

  .mobile-section-option {
    padding: 8px 10px;
    font-size: 0.8125rem;
  }

  /* ——— sections ——— */
  .keyboard-hint {
    display: none;
  }

  .section-panel {
    gap: 6px;
  }

  .section-title-compact {
    margin: 0;
    padding: 0 0 6px;
    font-size: 0.9375rem;
    border-bottom: 1px solid var(--border);
  }

  .item-panel {
    padding: 10px;
    margin-top: 0;
  }

  .compact-form {
    gap: 6px;
  }

  .compact-form-actions {
    gap: 8px;
  }

  .compact-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 8px 10px;
  }

  .item-main textarea {
    min-height: 44px;
    font-size: 0.8125rem;
  }

  .item-actions {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
  }

  .item-actions-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
  }

  .item-actions .delete-item {
    margin-left: auto;
    flex-shrink: 0;
  }

  input,
  textarea,
  select {
    padding: 7px 9px;
  }

  .primary,
  .secondary,
  .ghost {
    padding: 7px 12px;
  }

  .matrix-section-lead,
  .conclusion-section-lead {
    margin: 0 0 6px;
    font-size: 0.75rem;
    line-height: 1.4;
  }

  .matrix-sections-light {
    gap: 10px;
  }

  .matrix-group-toggle {
    padding: 10px 12px;
    gap: 8px;
  }

  .matrix-group .matrix-grid {
    padding: 0 10px 10px;
  }

  .matrix-card {
    padding: 10px;
  }

  .matrix-grid {
    gap: 8px;
  }

  .matrix-significance {
    margin-top: 8px;
    padding-bottom: 8px;
  }

  .matrix-significance-hint {
    font-size: var(--text-2xs);
    line-height: 1.4;
  }

  .matrix-ideas-block {
    gap: 8px;
    margin-top: 6px;
  }

  .conclusion-groups {
    gap: 8px;
    margin-bottom: 10px;
  }

  .conclusion-group-card {
    padding: 8px 10px;
  }

  .conclusion-group-text {
    min-height: 56px;
    font-size: 0.8125rem;
  }

  .conclusion-summary-panel {
    padding: 10px 12px;
  }

  .brainstorm-block {
    padding: 10px 12px;
    gap: 8px;
  }

  .brainstorm-block h3 {
    font-size: 0.9375rem;
  }

  .brainstorm-pair {
    padding: 8px 10px;
    font-size: 0.8125rem;
  }

  .brainstorm-actions {
    flex-direction: row;
    align-items: center;
    gap: 8px;
  }

  .brainstorm-actions .ghost,
  .brainstorm-actions .primary {
    flex: 1;
  }

  .row-between:not(.project-toolbar):not(.dashboard-heading):not(.brainstorm-actions) {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (min-width: 769px) {
  .mobile-sections-viewport {
    display: block;
    height: auto;
    overflow: visible;
  }

  .mobile-sections-track {
    display: block;
    transform: none !important;
    width: 100%;
  }

  .mobile-sections-track > .section-panel {
    width: 100%;
  }

  .mobile-sections-track > .section-panel.hidden {
    display: none !important;
  }

  .section-panel:has(.item-panel) .item-list {
    max-height: calc(100vh - 320px);
  }
}

/* ——— billing ——— */
.billing-panel,
.billing-history-panel {
  padding: 16px;
}

.billing-status-card p {
  margin: 0 0 6px;
}

.billing-actions {
  margin-top: 14px;
  flex-wrap: wrap;
  gap: 8px;
}

.billing-stub-hint {
  margin: 10px 0 0;
  font-size: var(--text-sm);
}

.billing-payments-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.billing-payment-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-muted);
}

.billing-limit-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 20px;
}

.billing-limit-modal.hidden {
  display: none !important;
}

.billing-limit-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 6, 4, 0.62);
}

.billing-limit-dialog {
  position: relative;
  z-index: 1;
  width: min(100%, 420px);
  padding: 20px;
}

.billing-limit-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

@media (prefers-reduced-motion: reduce) {
  body::before,
  .auth-shell::before,
  .app-header::after,
  .creation-panel::after {
    animation: none;
  }

  .primary:hover::after,
  .save-item-btn:hover::after,
  .add-item-btn:hover::after {
    animation: none;
  }

  .hero-statement-slide {
    transition: none;
  }
}
