:root {
  --stage-bg: #e9ebef;
  --phone-shell: #ffffff;
  --surface: #ffffff;
  --surface-2: #f4f5f8;
  --line: #e4e7ec;
  --ink: #111214;
  --muted: #7c8290;

  --accent: #ff5233;         /* goodbe red-orange */
  --accent-soft: #ffe0d7;

  --panel-red: #ff5b3f;
  --panel-yellow: #ffdd44;
  --panel-blue: #7c9cff;
  --panel-green: #6dd39c;
  --panel-pink: #ff9ac8;
  --panel-ink: #14161a;

  --block-webcam: #7c9cff;
  --block-screen: #6dd39c;
  --block-text: #ffdd44;
  --block-callout: #ff8a5c;

  --radius: 18px;
  --radius-lg: 26px;

  --font: 16px/1.4 "Bricolage Grotesque", -apple-system, "Segoe UI", Inter, system-ui, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; margin: 0; overscroll-behavior: none; }
body {
  font: var(--font);
  background: var(--stage-bg);
  color: var(--ink);
  overflow: hidden;
  font-feature-settings: "ss01";
  letter-spacing: -0.005em;
}

button { font: inherit; color: inherit; }

.stage-bg {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

/* ---------- Phone frame ---------- */
.phone {
  position: relative;
  width: 390px;
  height: 844px;
  max-height: calc(100vh - 40px);
  aspect-ratio: 390 / 844;
  background: var(--phone-shell);
  border-radius: 48px;
  box-shadow:
    0 0 0 10px #1a1c22,
    0 30px 60px rgba(20,30,50,0.18),
    0 6px 20px rgba(20,30,50,0.10);
  overflow: hidden;
}
.phone-notch {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: 110px;
  height: 30px;
  background: #1a1c22;
  border-radius: 20px;
  z-index: 500;
}
@media (max-width: 500px) {
  .stage-bg { padding: 0; }
  .phone {
    width: 100vw; height: 100vh; max-height: 100vh;
    aspect-ratio: auto; border-radius: 0; box-shadow: none;
  }
  .phone-notch { display: none; }
}

/* ---------- Screens ---------- */
.screen {
  position: absolute;
  inset: 0;
  background: var(--surface);
  transform: translateX(100%);
  transition: transform 0.36s cubic-bezier(0.32, 0.72, 0, 1);
  z-index: 100;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.screen.open { transform: translateX(0); }
.screen.splash { z-index: 50; }
.screen.home {
  z-index: 100;
  transform: translateY(100%); /* start off-screen below; anime.js slides it up */
}

/* ---------- SPLASH (animated gradient bg) ---------- */
.splash {
  background: #f6f5f0;
  overflow: hidden;
}
.gradient-blobs {
  position: absolute;
  inset: 0;
  filter: blur(60px);
  pointer-events: none;
  z-index: 0;
}
.blob {
  position: absolute;
  width: 65%;
  aspect-ratio: 1;
  border-radius: 50%;
  opacity: 0.85;
  will-change: transform;
}
.blob-1 { background: #ff9ac8; top: -10%;  left: -15%; animation: drift-a 22s ease-in-out infinite; }
.blob-2 { background: #ffe066; top: -5%;   right: -20%; animation: drift-b 26s ease-in-out infinite; }
.blob-3 { background: #b8e8d4; bottom: -15%; left: 5%;  animation: drift-c 30s ease-in-out infinite; }
.blob-4 { background: #ffbfa4; bottom: -20%; right: -10%; animation: drift-d 34s ease-in-out infinite; }

@keyframes drift-a {
  0%,100% { transform: translate(0,0) scale(1); }
  33%     { transform: translate(20%, 25%) scale(1.15); }
  66%     { transform: translate(10%, 40%) scale(0.95); }
}
@keyframes drift-b {
  0%,100% { transform: translate(0,0) scale(1); }
  50%     { transform: translate(-25%, 30%) scale(1.1); }
}
@keyframes drift-c {
  0%,100% { transform: translate(0,0) scale(1); }
  40%     { transform: translate(25%, -25%) scale(1.2); }
  70%     { transform: translate(-15%, -15%) scale(0.9); }
}
@keyframes drift-d {
  0%,100% { transform: translate(0,0) scale(1); }
  50%     { transform: translate(-30%, -20%) scale(1.1); }
}

.splash-inner { position: relative; z-index: 1; }
.splash-inner {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 32px;
}
.splash-mark {
  display: flex;
  flex-direction: column;
  line-height: 0.9;
  font-weight: 800;
  font-size: 68px;
  letter-spacing: -0.04em;
}
.mark-line { opacity: 0; transform: translateY(30px); display: inline-block; }
.mark-line.accent { color: var(--accent); }
.splash-tag {
  margin-top: 24px;
  font-size: 15px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.02em;
  opacity: 0;
}

/* ---------- HOME ---------- */
.home {
  background: transparent;
}
/* Hidden until animateHome() fades them in — prevents flash during splash→home slide */
.home .stats-row,
.home .project-panel,
.home .panel-row .panel { opacity: 0; }
.home-hero {
  position: relative;
  padding: 56px 24px 28px;
  background: transparent; /* splash gradient shows through */
  min-height: 300px;
  flex-shrink: 0;
}
.phone-status {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 54px;
  padding: 0 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  z-index: 450;
  pointer-events: none;
}
.brand-mark {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--ink);
  padding-left: 4px;
  margin-bottom: 18px;
  opacity: 0;
  transform: translateY(12px);
}
.hero-title {
  margin: 0;
  font-weight: 800;
  font-size: 60px;
  line-height: 0.92;
  letter-spacing: -0.04em;
  display: flex;
  flex-direction: column;
}
.hero-title .line {
  opacity: 0;
  transform: translateY(24px);
  display: inline-block;
  cursor: pointer;
  width: max-content;
}
.hero-title .line:active { transform: translateY(0) scale(0.97); }
.hero-title .muted { color: var(--muted); }

.home-body {
  flex: 1;
  padding: 24px 20px 32px;
  overflow-y: auto;
  background: var(--surface);
}

.stats-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 18px;
  padding: 0 4px;
}
.stats-key {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.stats-big {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

/* Latest project panel */
.project-panel {
  width: 100%;
  background: var(--panel-red);
  color: #fff;
  border: none;
  border-radius: var(--radius-lg);
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  min-height: 155px;
  margin-bottom: 10px;
  text-align: left;
  transition: transform 0.15s ease;
}
.project-panel:active { transform: scale(0.98); }
.project-panel .panel-shape {
  font-size: 40px;
  line-height: 1;
  font-weight: 400;
  opacity: 0.95;
}
.project-title {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
  margin-top: 12px;
}
.project-sub {
  font-size: 13px;
  font-weight: 600;
  opacity: 0.85;
  margin-top: 6px;
}

/* Secondary panel row */
.panel-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.panel-row + .panel-row { margin-top: 10px; }
.panel {
  border: none;
  border-radius: var(--radius);
  padding: 18px;
  cursor: pointer;
  text-align: left;
  min-height: 130px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: var(--panel-ink);
  transition: transform 0.15s ease;
}
.panel:active { transform: scale(0.97); }
.panel-yellow { background: var(--panel-yellow); }
.panel-blue { background: var(--panel-blue); color: #fff; }
.panel-green { background: var(--panel-green); }
.panel-pink { background: var(--panel-pink); }
.panel-black { background: var(--panel-ink); color: #fff; }
.panel-shape {
  font-size: 40px;
  line-height: 1;
  font-weight: 400;
  opacity: 0.9;
}
.panel-name {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1;
}
.panel-sub {
  font-size: 12px;
  font-weight: 600;
  opacity: 0.75;
  margin-top: 4px;
}

/* ---------- Bottom nav ---------- */
.bottom-nav {
  position: absolute;
  bottom: 20px;
  left: 20px;
  right: 20px;
  height: 68px;
  background: var(--surface);
  border-radius: 34px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  padding: 0 12px;
  box-shadow: 0 12px 30px rgba(20,30,50,0.15);
  z-index: 30;
}
.nav-item {
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  padding: 8px 0;
}
.nav-item.active { color: var(--ink); }
.nav-item:active { transform: scale(0.94); }

.nav-record {
  position: relative;
  align-self: center;
}
.nav-record-inner {
  width: 56px;
  height: 56px;
  background: var(--panel-red);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px rgba(255,82,51,0.35);
  transform: translateY(-14px);
  border: 4px solid var(--surface);
}
.nav-record-dot {
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
}

/* ---------- RECORDING (editorial dark header, matches project pattern) ---------- */
.recording {
  background: #14161a;
  color: #fff;
  display: flex;
  flex-direction: column;
}
.rec-hero {
  background: #2a2d33;
  padding: 44px 22px 22px;
  position: relative;
  flex-shrink: 0;
}
.rec-close {
  position: absolute;
  top: 60px;
  right: 18px;
  width: 40px; height: 40px;
  border: none;
  background: rgba(255,255,255,0.14);
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.rec-close:active { transform: scale(0.94); }
.rec-title {
  margin: 14px 0 0;
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
  color: #fff;
}
.rec-sub {
  margin-top: 6px;
  font-size: 13px;
  font-weight: 600;
  opacity: 0.85;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.005em;
}
.rec-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 20px 20px 28px;
  gap: 16px;
}
.rec-frame {
  flex: 1;
  min-height: 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #14161a;
  position: relative;
  align-self: center;
  aspect-ratio: 9 / 16;
  max-height: 100%;
  width: auto;
  max-width: 100%;
}
.rec-frame video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.rec-countdown {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 160px;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: #fff;
  text-shadow: 0 4px 20px rgba(0,0,0,0.4);
  pointer-events: none;
}
.rec-countdown:empty { display: none; }
.rec-controls {
  display: flex;
  justify-content: center;
  padding-bottom: 8px;
  flex-shrink: 0;
}
.rec-button {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: transparent;
  border: 4px solid rgba(255,255,255,0.85);
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.rec-button:active { transform: scale(0.96); }
.rec-button-inner {
  width: 56px;
  height: 56px;
  background: var(--panel-red);
  border-radius: 50%;
  transition: all 0.2s cubic-bezier(0.32, 0.72, 0, 1);
}
.rec-button.recording .rec-button-inner {
  width: 26px;
  height: 26px;
  border-radius: 6px;
}

/* ---------- CREATE SECTION (same as project, dark grey header) ---------- */
.create-screen {
  background: var(--surface);
  display: flex;
  flex-direction: column;
}
.create-screen .proj-workspace,
.create-screen .proj-footer {
  opacity: 1; /* create doesn't run the morph animation */
}
.create-screen .proj-header { color: #fff; }
.create-screen .proj-bg { background: #2a2d33; }

/* editable header fields (title, category) — mobile: no hover, tap→edit */
.proj-meta {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}
.create-screen [data-field] {
  outline: none;
  border-radius: 6px;
  transition: background 0.15s ease, transform 0.1s ease;
}
.create-screen [data-field]:active { transform: scale(0.97); }
.create-screen [data-field][contenteditable="true"] {
  background: rgba(255,255,255,0.14);
}
.create-screen [data-field]:empty::before {
  content: attr(data-placeholder);
  opacity: 0.5;
}
.create-screen .proj-title {
  display: inline-block;
  padding: 4px 8px;
  margin-left: -8px;
}
.meta-field {
  padding: 4px 8px;
  margin: -4px -2px;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
}
.meta-category {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.meta-sep { opacity: 0.55; }

/* ---------- PROJECT SECTION (morphs from panel) ---------- */
.screen.project-screen {
  background: transparent;
  color: #fff;
  z-index: 200;
  overflow: hidden;
  transform: none;
  transition: none;
  opacity: 0;
  pointer-events: none;
  display: flex;
  flex-direction: column;
}
.screen.project-screen.open {
  opacity: 1;
  pointer-events: auto;
}
.proj-bg {
  position: absolute;
  inset: 0;
  background: var(--panel-red);
  z-index: 0;
  /* JS sets inline top/left/width/height for the morph */
}
.proj-header {
  position: relative;
  z-index: 1;
  padding: 44px 22px 16px;
  flex-shrink: 0;
}
.header-settings {
  position: absolute;
  top: 60px;
  right: 18px;
  width: 40px; height: 40px;
  border: none;
  background: rgba(255,255,255,0.18);
  border-radius: 50%;
  color: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  z-index: 2;
}
.header-settings:active { transform: scale(0.94); }
.proj-workspace {
  position: relative;
  z-index: 1;
  flex: 1;
  background: #f2f4f7;
  min-height: 0;
  opacity: 0;
  overflow: hidden;
}
.ws-bg-blur {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
  z-index: 0;
}
.ws-bg-blur.active { opacity: 1; }
.proj-footer {
  position: relative;
  z-index: 1;
  background: #fff;
  padding: 14px 24px 22px;
  display: flex;
  justify-content: space-around;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  opacity: 0;
  color: var(--ink);
}
.proj-nav {
  background: transparent;
  border: none;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  padding: 10px 10px;
}
.proj-nav svg { width: 30px; height: 30px; }
.proj-nav.active { color: var(--accent); }

/* Workspace views */
.ws-view {
  height: 100%;
  padding: 24px 20px;
  overflow-y: auto;
  box-sizing: border-box;
}
.ws-view[hidden] { display: none; }
.ws-view {
  position: relative;
  z-index: 1;
}
.ws-canvas {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
/* Tools/Settings panels get a frosted white glass over any custom bg */
.ws-tools, .ws-settings {
  background: rgba(255,255,255,0.68);
  backdrop-filter: blur(24px) saturate(140%);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
}
.canvas-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  height: 100%;
  min-height: 0;
}
.canvas-rect {
  aspect-ratio: 4 / 5;
  background: transparent;
  border: 1.5px dashed rgba(120,130,150,0.55);
  border-radius: 8px;
  box-shadow: none;
  display: flex;
  align-items: center;
  justify-content: center;
  /* JS sets explicit width/height so aspect-ratio fits available space */
}
.canvas-rect.has-content {
  border: none;
  aspect-ratio: auto;
  width: 100%;
  height: 100%;
}
.canvas-size {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
}

/* Tool grid — 3-col to fit 9 items */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.tool-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 10px;
  min-height: 92px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  cursor: pointer;
  text-align: left;
  color: var(--ink);
  font: inherit;
  transition: transform 0.15s ease;
}
.tool-card:active { transform: scale(0.96); }
.tool-icon {
  font-size: 24px;
  font-weight: 400;
  line-height: 1;
  opacity: 0.9;
}
.tool-name {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

/* Settings */
.settings-section {
  margin-bottom: 24px;
}
.settings-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--ink);
  text-transform: uppercase;
  margin-bottom: 10px;
}
.settings-swatches {
  display: flex;
  gap: 8px;
}
.ws-swatch {
  flex: 1;
  aspect-ratio: 1;
  min-width: 0;
  border-radius: 12px;
  border: 3px solid transparent;
  cursor: pointer;
  padding: 0;
  transition: transform 0.15s ease;
  box-shadow: inset 0 0 0 1px rgba(20,30,50,0.08);
}
.ws-swatch.active { border-color: var(--ink); transform: scale(1.05); }
.ws-swatch:active { transform: scale(0.92); }

.upload-btn {
  width: 100%;
  padding: 18px;
  border: 2px dashed var(--line);
  border-radius: 14px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.upload-btn:hover { border-color: var(--accent); color: var(--accent); }
.upload-btn:active { transform: scale(0.98); }
.settings-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.aspect-btn {
  padding: 10px 16px;
  border-radius: 12px;
  border: 2px solid var(--line);
  background: transparent;
  font: inherit;
  font-weight: 700;
  font-size: 14px;
  color: var(--ink);
  cursor: pointer;
}
.aspect-btn.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.aspect-btn:active { transform: scale(0.95); }
.proj-nav:active { transform: scale(0.94); }
.proj-shape {
  font-size: 40px;
  line-height: 1;
  font-weight: 400;
  opacity: 0.95;
  background: none;
  border: none;
  color: inherit;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
}
.proj-shape:active { transform: scale(0.9); }
.proj-title {
  margin: 14px 0 0;
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
}
.proj-sub {
  margin-top: 4px;
  font-size: 13px;
  font-weight: 600;
  opacity: 0.85;
}

/* ---------- RECORDING PREVIEW ---------- */
.rec-preview {
  background: #14161a;
  color: #fff;
  padding: 74px 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.rec-preview-header {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.rec-preview-discard, .rec-preview-retake {
  width: 44px; height: 44px;
  border: none;
  background: rgba(255,255,255,0.12);
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  padding: 0;
}
.rec-preview-discard:active, .rec-preview-retake:active { transform: scale(0.94); }
.rec-preview-title {
  text-align: center;
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -0.01em;
}
.rec-preview-frame {
  flex: 1;
  min-height: 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #000;
  align-self: center;
  aspect-ratio: 9/16;
  max-width: 100%;
  max-height: 100%;
}
.rec-preview-frame video {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.rec-preview-frame { position: relative; }
.preview-mute {
  position: absolute;
  bottom: 12px;
  right: 12px;
  width: 40px;
  height: 40px;
  border: none;
  background: rgba(0,0,0,0.55);
  color: #fff;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 2;
}
.preview-mute:active { transform: scale(0.92); }
.preview-mute .ico-sound { display: none; }
.preview-mute:not(.muted) .ico-mute { display: none; }
.preview-mute:not(.muted) .ico-sound { display: block; }
.rec-preview-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  flex-shrink: 0;
}
.rec-preview-btn {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.14);
  color: #fff;
  padding: 14px 12px;
  border-radius: 14px;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  letter-spacing: -0.005em;
}
.rec-preview-btn.primary {
  background: var(--accent);
  border-color: var(--accent);
}
.rec-preview-btn:active { transform: scale(0.97); }

/* ---------- shared page header (Projects, Agent, Assets share this) ---------- */
.page-header {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  padding: 60px 16px 12px;
  gap: 8px;
  flex-shrink: 0;
}
.page-close, .page-action {
  width: 44px; height: 44px;
  border: none;
  background: var(--surface-2);
  border-radius: 50%;
  color: var(--ink);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  padding: 0;
}
.page-close:active, .page-action:active { transform: scale(0.94); }
.page-title {
  text-align: center;
  font-weight: 800;
  font-size: 20px;
  letter-spacing: -0.01em;
}
.page-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 8px 20px 28px;
}

/* ---------- PROJECTS SCREEN ---------- */
.projects-screen {
  background: var(--surface);
  z-index: 400;
  color: var(--ink);
}
.projects-list { display: flex; flex-direction: column; gap: 8px; touch-action: pan-y; }

/* Project cards */
.project-item {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
}
.project-swipe-actions {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  display: flex;
  align-items: stretch;
  border-radius: 16px;
  overflow: hidden;
}
.swipe-action {
  width: 80px;
  border: none;
  color: #fff;
  font: inherit;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  padding: 0;
}
.swipe-action.duplicate { background: #55606f; }
.swipe-action.delete { background: #e5484d; }
.swipe-action:active { filter: brightness(0.9); }
.project-card {
  position: relative;
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  cursor: pointer;
  transition: transform 0.25s cubic-bezier(0.32, 0.72, 0, 1);
  user-select: none;
  -webkit-user-select: none;
}
.project-item.revealed .project-card { transform: translateX(-160px); }
.project-checkbox {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 2px solid var(--line);
  display: none;
  align-items: center;
  justify-content: center;
  color: transparent;
  flex-shrink: 0;
}
.projects-screen.select-mode .project-checkbox { display: flex; }
.project-item.selected .project-checkbox {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.project-thumb {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: #fff;
  flex-shrink: 0;
}
.project-info { min-width: 0; }
.project-name {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.project-meta {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}
.project-chev {
  color: var(--muted);
  flex-shrink: 0;
}
.projects-screen.select-mode .project-chev { display: none; }

/* Bottom action bar (visible in select mode) */
.select-action-bar {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 12px 16px 22px;
  background: rgba(255,255,255,0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
  display: flex;
  gap: 8px;
  transform: translateY(110%);
  transition: transform 0.25s cubic-bezier(0.32, 0.72, 0, 1);
  z-index: 10;
}
.projects-screen.select-mode .select-action-bar { transform: translateY(0); }
.sab-btn {
  flex: 1;
  padding: 14px;
  border-radius: 12px;
  font: inherit;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  border: none;
}
.sab-btn:active { transform: scale(0.97); }
.sab-cancel { background: transparent; border: 1.5px solid var(--line); color: var(--ink); }
.sab-duplicate { background: var(--ink); color: #fff; }
.sab-delete { background: #e5484d; color: #fff; }

/* ---------- AGENT SCREEN ---------- */
.agent-screen {
  background: var(--surface);
  z-index: 400;
  color: var(--ink);
}
.agent-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 24px 20px 12px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.agent-intro {
  padding: 24px 4px 8px;
}
.agent-mark {
  font-size: 30px;
  line-height: 1;
  color: var(--accent);
  margin-bottom: 14px;
}
.agent-hero {
  margin: 0 0 8px;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
}
.agent-lede {
  margin: 0;
  font-size: 15px;
  font-weight: 500;
  color: var(--muted);
  line-height: 1.4;
}
.agent-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.suggestion-chip {
  padding: 10px 14px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: transparent;
  font: inherit;
  font-weight: 700;
  font-size: 13px;
  color: var(--ink);
  cursor: pointer;
}
.suggestion-chip:active { transform: scale(0.96); }
.agent-input-bar {
  display: flex;
  gap: 8px;
  padding: 12px 16px 22px;
  flex-shrink: 0;
  background: var(--surface);
  border-top: 1px solid var(--line);
}
.agent-input-bar input {
  flex: 1;
  padding: 14px 16px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: var(--surface-2);
  font: inherit;
  font-size: 15px;
  color: var(--ink);
  outline: none;
}
.agent-input-bar input:focus { border-color: var(--ink); background: #fff; }
.agent-send {
  width: 46px; height: 46px;
  border: none;
  background: var(--accent);
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  padding: 0;
  flex-shrink: 0;
}
.agent-send:active { transform: scale(0.94); }

/* ---------- ASSETS SCREEN ---------- */
.assets-screen {
  background: var(--surface);
  z-index: 400;
  color: var(--ink);
}
.assets-header {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  padding: 60px 16px 12px;
  gap: 8px;
  flex-shrink: 0;
}
.assets-close, .assets-add-btn {
  width: 44px; height: 44px;
  border: none;
  background: var(--surface-2);
  border-radius: 50%;
  color: var(--ink);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  padding: 0;
}
.assets-close:active, .assets-add-btn:active { transform: scale(0.94); }
.assets-title {
  text-align: center;
  font-weight: 800;
  font-size: 20px;
  letter-spacing: -0.01em;
}
.assets-tabs {
  display: flex;
  gap: 8px;
  padding: 4px 20px 16px;
  flex-shrink: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.assets-tabs::-webkit-scrollbar { display: none; }
.assets-tab {
  flex-shrink: 0;
  padding: 10px 18px;
  border-radius: 999px;
  border: 2px solid var(--line);
  background: transparent;
  font: inherit;
  font-weight: 700;
  font-size: 14px;
  color: var(--ink);
  cursor: pointer;
}
.assets-tab.active {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}
.assets-tab:active { transform: scale(0.96); }
.assets-body {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  position: relative;
}
.assets-panel {
  position: absolute;
  inset: 0;
  padding: 4px 20px 28px;
  overflow-y: auto;
}
.assets-panel[hidden] { display: none; }
.assets-empty {
  padding: 60px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  text-align: center;
}
.assets-panel.has-items .assets-empty { display: none; }
.empty-icon { opacity: 0.5; margin-bottom: 6px; }
.empty-text {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}
.empty-hint {
  font-size: 13px;
  font-weight: 500;
}
.assets-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.assets-grid.colors-grid {
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}
.asset-item {
  aspect-ratio: 1;
  border-radius: 10px;
  background: #14161a;
  background-size: cover;
  background-position: center;
  border: none;
  padding: 0;
  cursor: pointer;
  overflow: hidden;
  position: relative;
}
.asset-item video {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.asset-item[data-type="video"]::after {
  content: '';
  position: absolute;
  bottom: 6px; right: 6px;
  width: 0; height: 0;
  border-left: 10px solid #fff;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.4));
}
.asset-item:active { transform: scale(0.95); }
.color-swatch {
  aspect-ratio: 1;
  border-radius: 12px;
  border: none;
  padding: 0;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(20,30,50,0.08);
}
.color-swatch:active { transform: scale(0.9); }
