:root {
  --studio-bg: #f5f7fb;
  --studio-bg-soft: #eef3f8;
  --studio-surface: #ffffff;
  --studio-surface-muted: #f8fafc;
  --studio-border: #dbe3ee;
  --studio-border-strong: #c8d3e0;
  --studio-text: #111827;
  --studio-muted: #667085;
  --studio-faint: #98a2b3;
  --studio-primary: #1769e0;
  --studio-primary-strong: #0f5ccc;
  --studio-primary-soft: #eaf2ff;
  --studio-success: #159557;
  --studio-warning: #b7791f;
  --studio-danger: #c83d3d;
  --studio-shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --studio-shadow-md: 0 14px 38px rgba(15, 23, 42, .07);
  --studio-radius-sm: 8px;
  --studio-radius-md: 12px;
  --studio-radius-lg: 16px;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--studio-bg);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body {
  color: var(--studio-text);
}

.app-body {
  background:
    linear-gradient(rgba(37, 99, 235, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37, 99, 235, .03) 1px, transparent 1px),
    radial-gradient(circle at 84% 8%, rgba(23, 105, 224, .10), transparent 30%),
    linear-gradient(180deg, #fbfcfe 0%, var(--studio-bg) 46%, var(--studio-bg-soft) 100%);
  background-size: 28px 28px, 28px 28px, auto, auto;
}

.sidebar {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .045), transparent 18%),
    linear-gradient(180deg, #0f172a 0%, #111827 56%, #0b1120 100%);
  border-right: 1px solid rgba(148, 163, 184, .16);
  padding: 22px 14px;
}

.brand {
  gap: 12px;
}

.brand-mark {
  background:
    radial-gradient(circle at 35% 30%, #fff, #dbeafe 58%, #bcd7ff 100%);
  border: 1px solid rgba(255, 255, 255, .72);
  box-shadow: 0 16px 42px rgba(37, 99, 235, .28);
}

.brand strong {
  font-size: 19px;
  line-height: 1.15;
}

.brand span {
  color: #a8b4c5;
}

.nav-link {
  min-height: 46px;
}

.nav-icon {
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 9px;
  color: #bfdbfe;
  font-size: 12px;
  font-weight: 900;
  height: 30px;
  min-width: 30px;
}

.nav-link:hover,
.nav-link.active {
  background: rgba(255, 255, 255, .09);
  border-color: rgba(255, 255, 255, .12);
}

.nav-link.active {
  box-shadow: inset 3px 0 0 var(--studio-primary), 0 14px 34px rgba(0, 0, 0, .20);
}

.nav-link.active .nav-icon {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  border-color: rgba(255, 255, 255, .18);
  color: #fff;
}

.workspace-header {
  background: rgba(255, 255, 255, .9);
  border-bottom: 1px solid rgba(203, 213, 225, .72);
  box-shadow: 0 8px 30px rgba(15, 23, 42, .05);
}

.workspace-kicker,
.section-kicker {
  color: #64748b;
  letter-spacing: .12em;
}

.workspace-header h1 {
  color: var(--studio-text);
  font-weight: 900;
}

.status-strip {
  align-items: center;
}

.status-chip,
.header-link {
  border-radius: 999px;
}

.header-link {
  border: 1px solid transparent;
  color: #344054;
  padding: 7px 9px;
}

.header-link:hover {
  background: var(--studio-primary-soft);
  border-color: #cfe0ff;
  color: var(--studio-primary-strong);
}

.workspace-content {
  max-width: 1460px;
}

.panel {
  background: rgba(255, 255, 255, .96);
  border: 1px solid var(--studio-border);
  border-radius: var(--studio-radius-lg);
  box-shadow: var(--studio-shadow-md);
}

.panel-header {
  gap: 12px;
}

.panel-header h1,
.panel-header h2,
.command-title h2 {
  letter-spacing: 0;
}

.command-card,
.recent-panel,
.admin-record-panel,
.settings-hero-panel,
.admin-hero-panel {
  overflow: hidden;
}

.voice-layout,
.image-layout {
  gap: 18px;
  grid-template-columns: minmax(0, 1fr) minmax(304px, 348px);
}

.studio-grid {
  gap: 18px;
}

.command-title {
  align-items: center;
}

.title-icon {
  background: linear-gradient(135deg, var(--studio-primary), #3b82f6);
  box-shadow: 0 10px 24px rgba(23, 105, 224, .22);
}

input,
textarea,
select {
  border-color: var(--studio-border-strong);
  border-radius: var(--studio-radius-sm);
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

input:focus,
textarea:focus,
select:focus {
  border-color: #74a8ff;
  box-shadow: 0 0 0 4px rgba(23, 105, 224, .12);
  outline: none;
}

button,
.button-link {
  border-radius: var(--studio-radius-sm);
  box-shadow: var(--studio-shadow-sm);
  font-weight: 850;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease, border-color .16s ease;
}

button:hover,
.button-link:hover {
  transform: translateY(-1px);
}

button:active,
.button-link:active {
  transform: translateY(0);
}

.assist-card,
.preset-card,
.metric-card,
.compact-history-card,
.voice-feature-card,
.image-result-card,
.learning-card {
  border-radius: var(--studio-radius-md);
  box-shadow: var(--studio-shadow-sm);
}

.controls-grid {
  gap: 14px;
}

.range-control {
  background: linear-gradient(180deg, #fff, #fbfdff);
  border-color: var(--studio-border);
}

.range-control input[type="number"] {
  background: #fff;
}

.table-wrap {
  border: 1px solid var(--studio-border);
  border-radius: var(--studio-radius-md);
  overflow: auto;
}

table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
}

th {
  background: #f8fafc;
  color: #536171;
  font-size: 12px;
  letter-spacing: .02em;
  position: sticky;
  top: 0;
  z-index: 1;
}

td,
th {
  border-bottom: 1px solid #edf1f6;
  vertical-align: top;
}

tbody tr:hover td {
  background: #fbfdff;
}

.status-badge,
.queue-badge {
  border-radius: 999px;
  font-weight: 850;
}

.compact-history-panel .panel-header,
.mini-tasks .panel-header,
.image-preview-panel .panel-header {
  margin-bottom: 10px;
}

.mini-tasks,
.image-preview-panel,
.spanish-memory-panel,
.chat-context {
  position: sticky;
  top: 98px;
}

.chat-workbench {
  gap: 14px;
  grid-template-columns: 230px minmax(0, 1fr) 260px;
}

.chat-rail,
.chat-canvas,
.chat-context {
  border-radius: var(--studio-radius-lg);
}

.conversation-link {
  padding: 9px 10px;
}

.conversation-title {
  font-size: 13px;
}

.conversation-meta {
  font-size: 11px;
}

.chat-message-list {
  border-radius: var(--studio-radius-md);
}

.chat-bubble {
  border-radius: 14px;
}

.chat-message.user .chat-bubble {
  background: linear-gradient(135deg, var(--studio-primary-strong), #2563eb);
}

.chat-command-bar {
  border-radius: var(--studio-radius-md);
}

.chat-composer textarea {
  min-height: 76px;
}

.chat-context section + section {
  border-top: 1px solid #e8edf4;
  padding-top: 14px;
}

@media (max-width: 1240px) {
  .chat-workbench {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .chat-context {
    display: none;
  }

  .chat-utility-popover {
    display: block;
  }
}

@media (max-width: 1120px) {
  .voice-layout,
  .image-layout,
  .studio-grid {
    grid-template-columns: 1fr;
  }

  .mini-tasks,
  .image-preview-panel,
  .spanish-memory-panel,
  .chat-context {
    position: static;
  }
}

@media (max-width: 760px) {
  .workspace-header {
    padding: 16px 18px;
  }

  .workspace-header h1 {
    white-space: normal;
  }

  .workspace-content {
    padding: 18px 14px 30px;
  }

  .chat-workbench {
    height: auto;
    max-height: none;
    overflow: visible;
  }
}

/* Young Studio v2: lighter, faster, and more product-like without changing app logic. */
:root {
  --studio-bg: #f6f8ff;
  --studio-bg-soft: #eef6ff;
  --studio-surface: rgba(255, 255, 255, .9);
  --studio-surface-muted: #f8fbff;
  --studio-border: rgba(174, 191, 216, .72);
  --studio-border-strong: rgba(142, 161, 190, .86);
  --studio-text: #101828;
  --studio-muted: #667085;
  --studio-faint: #98a2b3;
  --studio-primary: #2563eb;
  --studio-primary-strong: #1d4ed8;
  --studio-primary-soft: #ecf5ff;
  --studio-cyan: #06b6d4;
  --studio-violet: #7c3aed;
  --studio-mint: #16a34a;
  --studio-pink: #db2777;
  --studio-orange: #f97316;
  --studio-shadow-sm: 0 6px 18px rgba(15, 23, 42, .06);
  --studio-shadow-md: 0 18px 48px rgba(15, 23, 42, .09);
  --studio-shadow-glow: 0 18px 40px rgba(37, 99, 235, .16);
  --studio-radius-sm: 12px;
  --studio-radius-md: 16px;
  --studio-radius-lg: 22px;
}

html {
  background: #f6f8ff;
}

.app-body {
  background:
    linear-gradient(115deg, rgba(37, 99, 235, .08) 0 1px, transparent 1px 34%),
    linear-gradient(155deg, rgba(124, 58, 237, .07) 0 1px, transparent 1px 36%),
    repeating-linear-gradient(90deg, rgba(37, 99, 235, .035) 0 1px, transparent 1px 72px),
    repeating-linear-gradient(0deg, rgba(6, 182, 212, .03) 0 1px, transparent 1px 72px),
    linear-gradient(180deg, #fbfdff 0%, #f6f8ff 45%, #eef6ff 100%);
  background-attachment: fixed;
}

.app-body::before {
  background:
    linear-gradient(130deg, transparent 0 58%, rgba(37, 99, 235, .08) 58% 58.3%, transparent 58.3%),
    linear-gradient(38deg, transparent 0 68%, rgba(6, 182, 212, .09) 68% 68.3%, transparent 68.3%);
  content: "";
  inset: 0;
  pointer-events: none;
  position: fixed;
  z-index: 0;
}

.sidebar {
  background:
    linear-gradient(160deg, rgba(37, 99, 235, .22), transparent 34%),
    linear-gradient(22deg, rgba(6, 182, 212, .18), transparent 40%),
    linear-gradient(180deg, #0b1220 0%, #0f172a 54%, #101827 100%);
  border-right: 1px solid rgba(148, 163, 184, .18);
  left: 0;
  padding: 18px 14px;
  position: fixed;
  top: 0;
  width: 252px;
  z-index: 3;
}

.workspace {
  margin-left: 252px;
  position: relative;
  z-index: 1;
}

.brand {
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .11);
  border-radius: 20px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08);
  gap: 12px;
  margin-bottom: 18px;
  padding: 12px;
}

.brand-mark {
  background: linear-gradient(135deg, #ffffff 0%, #dff6ff 45%, #e9ddff 100%);
  border: 0;
  border-radius: 15px;
  box-shadow: 0 16px 34px rgba(37, 99, 235, .24);
  color: #1d4ed8;
  height: 42px;
  width: 42px;
}

.brand strong {
  font-size: 21px;
}

.brand span {
  color: #b6c5d8;
}

.side-nav {
  gap: 9px;
  margin-top: 0;
}

.nav-link {
  border: 1px solid transparent;
  border-radius: 16px;
  color: #cbd5e1;
  grid-template-columns: 38px 1fr auto;
  min-height: 54px;
  overflow: hidden;
  padding: 9px 10px;
  position: relative;
}

.nav-link::after {
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .13), transparent);
  content: "";
  height: 100%;
  left: -80%;
  opacity: 0;
  position: absolute;
  top: 0;
  transform: skewX(-18deg);
  transition: left .38s ease, opacity .22s ease;
  width: 55%;
}

.nav-link:hover::after,
.nav-link.active::after {
  left: 120%;
  opacity: 1;
}

.nav-link:hover {
  background: rgba(255, 255, 255, .08);
  border-color: rgba(148, 163, 184, .22);
  color: #fff;
}

.nav-link.active {
  background: linear-gradient(135deg, rgba(37, 99, 235, .95), rgba(124, 58, 237, .78));
  border-color: rgba(255, 255, 255, .20);
  box-shadow: 0 18px 40px rgba(37, 99, 235, .28);
  color: #fff;
}

.nav-icon {
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .10);
  border-radius: 13px;
  color: #bfdbfe;
  height: 36px;
  min-width: 36px;
  width: 36px;
}

.nav-link.active .nav-icon {
  background: rgba(255, 255, 255, .18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16);
  color: #fff;
}

.queue-badge {
  background: rgba(255, 255, 255, .18);
  color: #fff;
}

.sidebar-footer {
  gap: 10px;
}

.user-card {
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .10);
  border-radius: 18px;
  grid-template-columns: 42px 1fr;
  padding: 12px;
}

.user-avatar {
  background: linear-gradient(135deg, #06b6d4, #2563eb 56%, #7c3aed);
  box-shadow: 0 14px 30px rgba(37, 99, 235, .25);
  height: 42px;
  width: 42px;
}

.sidebar-logout button {
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .10);
  border-radius: 15px;
  min-height: 44px;
}

.sidebar-logout button:hover {
  background: rgba(255, 255, 255, .14);
}

.workspace-header {
  background: rgba(255, 255, 255, .78);
  backdrop-filter: blur(24px);
  border-bottom: 1px solid rgba(203, 213, 225, .66);
  box-shadow: 0 16px 44px rgba(15, 23, 42, .07);
  padding: 18px 32px;
}

.workspace-kicker,
.section-kicker {
  color: #667085;
  letter-spacing: .14em;
}

.workspace-kicker {
  align-items: center;
  display: inline-flex;
  gap: 8px;
}

.workspace-kicker::before {
  background: linear-gradient(135deg, var(--studio-cyan), var(--studio-primary));
  border-radius: 999px;
  content: "";
  height: 7px;
  width: 7px;
}

.workspace-header h1 {
  color: #0f172a;
  font-size: 28px;
}

.status-chip,
.header-link {
  backdrop-filter: blur(14px);
  border-radius: 999px;
}

.status-chip {
  background: rgba(255, 255, 255, .72);
  border-color: rgba(190, 206, 228, .9);
  box-shadow: 0 10px 24px rgba(15, 23, 42, .055);
  color: #344054;
  padding: 8px 12px;
}

.status-chip.online {
  background: linear-gradient(135deg, rgba(220, 252, 231, .96), rgba(224, 242, 254, .92));
  border-color: rgba(134, 239, 172, .8);
  color: #047857;
}

.header-link {
  background: rgba(255, 255, 255, .58);
  border: 1px solid rgba(203, 213, 225, .7);
  padding: 8px 11px;
}

.header-link:hover {
  background: #fff;
  border-color: rgba(37, 99, 235, .34);
  box-shadow: var(--studio-shadow-sm);
}

.workspace-content {
  max-width: 1480px;
  padding: 26px 26px 48px;
}

.panel {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .96), rgba(255, 255, 255, .88));
  border-color: rgba(183, 199, 224, .8);
  border-radius: var(--studio-radius-lg);
  box-shadow: var(--studio-shadow-md);
}

.command-card {
  overflow: hidden;
  padding: 24px;
  position: relative;
}

.command-card::before,
.settings-hero-panel::before,
.admin-hero-panel::before {
  background: linear-gradient(90deg, var(--studio-cyan), var(--studio-primary), var(--studio-violet), var(--studio-orange));
  content: "";
  height: 4px;
  left: 18px;
  position: absolute;
  right: 18px;
  top: 0;
}

.section-heading {
  gap: 16px;
}

.section-heading h2,
.panel h2,
.command-title h2 {
  color: #101828;
  font-weight: 900;
}

.section-heading h2 {
  font-size: 22px;
}

.title-icon {
  background: linear-gradient(135deg, var(--studio-cyan), var(--studio-primary) 52%, var(--studio-violet));
  border-radius: 13px;
  box-shadow: 0 14px 28px rgba(37, 99, 235, .20);
  height: 34px;
  margin-right: 10px;
  width: 34px;
}

.model-badge {
  background: linear-gradient(135deg, #ecfeff, #eff6ff);
  border-color: rgba(125, 211, 252, .8);
  color: #0f66cc;
  padding: 8px 12px;
}

input,
textarea,
select {
  background: rgba(255, 255, 255, .86);
  border-color: rgba(165, 180, 203, .86);
  border-radius: 14px;
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(6, 182, 212, .9);
  box-shadow: 0 0 0 4px rgba(6, 182, 212, .14), 0 10px 30px rgba(37, 99, 235, .08);
}

.voice-style-selector,
.image-mode-selector,
.parameter-presets,
.script-coach,
.audio-checklist,
.settings-help,
.source-image-box,
.submit-flow {
  background:
    linear-gradient(135deg, rgba(37, 99, 235, .055), rgba(6, 182, 212, .035) 48%, rgba(124, 58, 237, .045)),
    rgba(255, 255, 255, .72);
  border-color: rgba(188, 204, 228, .78);
  border-radius: 18px;
}

.assist-card {
  background: rgba(255, 255, 255, .78);
  border-color: rgba(190, 206, 228, .86);
  border-radius: 18px;
  min-height: 92px;
  overflow: hidden;
  padding: 14px;
  position: relative;
}

.assist-card::before {
  background: linear-gradient(180deg, var(--studio-cyan), var(--studio-primary));
  border-radius: 999px;
  content: "";
  height: 62%;
  left: 0;
  opacity: 0;
  position: absolute;
  top: 19%;
  transition: opacity .18s ease;
  width: 3px;
}

.assist-card:hover,
.assist-card.active,
.template-button:hover,
.param-preset-button:hover,
.param-preset-button.active {
  background: linear-gradient(135deg, #ffffff, #eef7ff);
  border-color: rgba(37, 99, 235, .44);
  box-shadow: var(--studio-shadow-sm);
  color: #0f4fb8;
}

.assist-card.active::before,
.assist-card:hover::before {
  opacity: 1;
}

.assist-card strong {
  font-size: 15px;
}

.assist-card span {
  color: #667085;
}

.drop-box {
  background:
    linear-gradient(#fff, #fff) padding-box,
    linear-gradient(135deg, rgba(6, 182, 212, .55), rgba(37, 99, 235, .48), rgba(124, 58, 237, .48)) border-box;
  border: 1px dashed transparent;
  border-radius: 18px;
}

.drop-icon,
.preset-icon {
  background: linear-gradient(135deg, rgba(6, 182, 212, .12), rgba(37, 99, 235, .12));
  color: var(--studio-primary);
}

.template-button,
.param-preset-button,
.task-action,
.button-link {
  border-radius: 999px;
}

.template-button,
.param-preset-button {
  background: rgba(255, 255, 255, .84);
}

.controls-grid {
  gap: 14px;
}

.range-control {
  border-radius: 18px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, .045);
  grid-template-columns: minmax(120px, .78fr) minmax(160px, 1.2fr) 96px;
}

.range-control input[type="range"] {
  accent-color: var(--studio-primary);
}

.range-copy small {
  color: #667085;
}

.primary-action {
  background: linear-gradient(100deg, var(--studio-cyan), var(--studio-primary) 50%, var(--studio-violet));
  border-radius: 18px;
  box-shadow: 0 18px 42px rgba(37, 99, 235, .24);
  min-height: 56px;
}

.primary-action:hover {
  box-shadow: 0 22px 52px rgba(37, 99, 235, .30);
}

.flow-step {
  border-radius: 999px;
}

.flow-step.active {
  background: linear-gradient(135deg, #ecfeff, #eff6ff);
  border-color: rgba(6, 182, 212, .5);
  color: #075985;
}

.preset-card,
.compact-history-card,
.metric-card,
.voice-feature-card,
.image-result-card,
.learning-card,
.memory-rule-item,
.mini-task {
  background: rgba(255, 255, 255, .78);
  border-color: rgba(204, 216, 235, .84);
  border-radius: 18px;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.preset-card:hover,
.compact-history-card:hover,
.metric-card:hover,
.voice-feature-card:hover,
.image-result-card:hover,
.memory-rule-item:hover,
.mini-task:hover {
  border-color: rgba(37, 99, 235, .28);
  box-shadow: var(--studio-shadow-sm);
  transform: translateY(-1px);
}

.preset-card.green .preset-icon {
  background: linear-gradient(135deg, #dcfce7, #ccfbf1);
  color: #059669;
}

.preset-card.blue .preset-icon {
  background: linear-gradient(135deg, #dbeafe, #cffafe);
  color: #2563eb;
}

.preset-card.violet .preset-icon {
  background: linear-gradient(135deg, #ede9fe, #fae8ff);
  color: #7c3aed;
}

.mini-tasks,
.image-preview-panel,
.spanish-memory-panel,
.chat-context {
  top: 106px;
}

.voice-feature-card audio {
  max-width: 100%;
  min-width: 0;
  width: 100%;
}

.feature-actions {
  align-items: stretch;
  display: grid;
  gap: 8px;
}

.compact-history-grid {
  gap: 12px;
}

.compact-history-card {
  padding: 14px;
}

.table-wrap {
  border-color: rgba(204, 216, 235, .84);
  border-radius: 18px;
}

th {
  background: #f4f8ff;
}

tbody tr:hover td {
  background: #f8fbff;
}

.chat-workbench {
  gap: 16px;
  grid-template-columns: 212px minmax(0, 1fr) 250px;
}

.chat-rail,
.chat-canvas,
.chat-context {
  border-radius: 22px;
}

.chat-rail {
  padding: 14px;
}

.chat-rail-search {
  border-radius: 14px;
}

.conversation-list {
  gap: 7px;
}

.conversation-link {
  border-radius: 15px;
  gap: 4px;
  padding: 9px 10px;
}

.conversation-title {
  font-size: 13px;
}

.conversation-meta {
  font-size: 11px;
}

.conversation-link:hover,
.conversation-link.active {
  background: linear-gradient(135deg, #ffffff, #edf7ff);
  border-color: rgba(37, 99, 235, .30);
}

.chat-canvas {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .98), rgba(255, 255, 255, .9));
}

.chat-message-list {
  background:
    linear-gradient(120deg, rgba(37, 99, 235, .06) 0 1px, transparent 1px 36%),
    linear-gradient(180deg, #f8fbff, #f2f7ff);
  border-color: rgba(204, 216, 235, .9);
  border-radius: 18px;
}

.chat-bubble {
  border-radius: 18px;
}

.chat-message.assistant .chat-bubble {
  border-left: 0;
  box-shadow: 0 10px 28px rgba(15, 23, 42, .055);
}

.chat-message.user .chat-bubble {
  background: linear-gradient(135deg, var(--studio-primary), var(--studio-violet));
}

.chat-command-bar,
.chat-empty,
.context-status,
.chat-utility-menu,
.chat-utility-popover summary,
.chat-prompt-row button,
.context-actions button,
.chat-starter {
  border-radius: 16px;
}

.chat-composer textarea {
  border-radius: 16px;
  min-height: 78px;
}

.chat-composer button,
.icon-action {
  border-radius: 15px;
}

.settings-metrics {
  gap: 14px;
}

.metric-card {
  overflow: hidden;
  position: relative;
}

.metric-card::before {
  background: linear-gradient(180deg, var(--studio-cyan), var(--studio-primary));
  content: "";
  inset: 14px auto 14px 0;
  opacity: .55;
  position: absolute;
  width: 3px;
}

.metric-card strong {
  color: #0f172a;
}

.spanish-report-grid article {
  border-radius: 18px;
}

.login-body {
  background: #06101f;
}

.login-body::before,
.login-body::after {
  display: none;
}

.login-bg-video {
  filter: saturate(1.12) contrast(1.06) brightness(.72);
}

.login-grid {
  background:
    repeating-linear-gradient(90deg, rgba(148, 163, 184, .16) 0 1px, transparent 1px 72px),
    repeating-linear-gradient(0deg, rgba(148, 163, 184, .12) 0 1px, transparent 1px 72px);
  opacity: .58;
}

.login-stage {
  gap: clamp(32px, 6vw, 86px);
  max-width: 1280px;
}

.login-hero {
  max-width: 620px;
}

.login-brand {
  background: rgba(255, 255, 255, .10);
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 22px;
  display: inline-flex;
  padding: 10px 14px;
}

.login-brand-mark {
  background: linear-gradient(135deg, #fff, #dff6ff 48%, #e9ddff);
  border-radius: 16px;
}

.login-kicker {
  color: #93c5fd;
}

.login-hero h1 {
  font-size: clamp(52px, 7vw, 92px);
  letter-spacing: 0;
  line-height: .96;
  margin-top: 24px;
  text-wrap: balance;
}

.login-copy {
  color: rgba(232, 241, 255, .86);
  font-size: 18px;
  max-width: 520px;
}

.login-metrics span {
  background: rgba(255, 255, 255, .11);
  border-color: rgba(255, 255, 255, .18);
  border-radius: 999px;
  min-width: 96px;
}

.login-panel {
  background:
    linear-gradient(180deg, rgba(15, 23, 42, .84), rgba(8, 16, 32, .82));
  border-color: rgba(148, 163, 184, .26);
  border-radius: 28px;
  box-shadow: 0 38px 90px rgba(0, 0, 0, .36);
  max-width: 460px;
}

.login-panel::before {
  background: linear-gradient(90deg, var(--studio-cyan), var(--studio-primary), var(--studio-violet), var(--studio-orange));
  height: 4px;
  opacity: 1;
}

.login-status {
  background: rgba(255, 255, 255, .08);
  border-radius: 999px;
}

.login-panel input {
  background: rgba(2, 6, 23, .62);
  border-color: rgba(125, 211, 252, .44);
  border-radius: 16px;
}

.login-panel input:focus {
  border-color: rgba(6, 182, 212, .95);
  box-shadow: 0 0 0 4px rgba(6, 182, 212, .18), 0 18px 38px rgba(37, 99, 235, .18);
}

.login-panel button {
  background: linear-gradient(100deg, var(--studio-cyan), var(--studio-primary) 52%, var(--studio-violet));
  border-radius: 18px;
  min-height: 58px;
}

.login-panel button:hover {
  box-shadow: 0 24px 55px rgba(37, 99, 235, .34);
}

@media (max-width: 1240px) {
  .chat-workbench {
    grid-template-columns: 204px minmax(0, 1fr);
  }
}

@media (max-width: 980px) {
  .sidebar {
    width: 220px;
  }

  .workspace {
    margin-left: 220px;
  }

  .workspace-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .assist-card-grid,
  .image-mode-selector .assist-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .range-control,
  .source-image-box,
  .image-options {
    grid-template-columns: 1fr;
  }

  .submit-flow {
    display: flex;
    flex-wrap: wrap;
  }

  .flow-line {
    display: none;
  }

  .chat-workbench {
    grid-template-columns: 1fr;
    height: auto;
    max-height: none;
    overflow: visible;
  }

  .chat-rail,
  .chat-canvas {
    height: auto;
    overflow: visible;
  }

  .chat-context {
    display: none;
  }

  .chat-message-list {
    min-height: 360px;
  }
}

@media (max-width: 760px) {
  .app-body {
    overflow: auto;
  }

  .sidebar {
    height: auto;
    position: static;
    width: auto;
  }

  .workspace {
    height: auto;
    margin-left: 0;
    overflow: visible;
  }

  .workspace-header {
    position: static;
  }

  .assist-card-grid,
  .image-mode-selector .assist-card-grid {
    grid-template-columns: 1fr;
  }

  .login-stage {
    grid-template-columns: 1fr;
    padding: 26px 18px;
  }

  .login-hero h1 {
    font-size: clamp(42px, 13vw, 62px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .nav-link::after,
  .assist-card,
  .preset-card,
  .compact-history-card,
  .metric-card,
  .voice-feature-card,
  .image-result-card,
  .learning-card,
  .memory-rule-item,
  .mini-task,
  button,
  .button-link {
    transition: none;
  }
}

/* Clean Studio v3: shadcn/Tabler-inspired density, calmer login, less visual noise. */
:root {
  --studio-bg: #f7f8fb;
  --studio-bg-soft: #eef2f7;
  --studio-surface: #ffffff;
  --studio-surface-muted: #f8fafc;
  --studio-border: #dbe3ee;
  --studio-border-strong: #c8d2df;
  --studio-text: #111827;
  --studio-muted: #64748b;
  --studio-faint: #94a3b8;
  --studio-primary: #2563eb;
  --studio-primary-strong: #1d4ed8;
  --studio-primary-soft: #eef5ff;
  --studio-cyan: #0891b2;
  --studio-violet: #6d5efc;
  --studio-mint: #16a34a;
  --studio-orange: #f97316;
  --studio-shadow-sm: 0 1px 2px rgba(15, 23, 42, .05), 0 8px 20px rgba(15, 23, 42, .04);
  --studio-shadow-md: 0 1px 2px rgba(15, 23, 42, .04), 0 18px 45px rgba(15, 23, 42, .065);
  --studio-radius-sm: 9px;
  --studio-radius-md: 12px;
  --studio-radius-lg: 16px;
}

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

.app-body {
  background:
    repeating-linear-gradient(90deg, rgba(37, 99, 235, .025) 0 1px, transparent 1px 80px),
    repeating-linear-gradient(0deg, rgba(37, 99, 235, .018) 0 1px, transparent 1px 80px),
    linear-gradient(180deg, #fbfcff 0%, var(--studio-bg) 46%, #f1f5f9 100%);
}

.app-body::before {
  display: none;
}

.sidebar {
  background: linear-gradient(180deg, #0f172a 0%, #111827 55%, #0f172a 100%);
  border-right: 1px solid rgba(148, 163, 184, .14);
  padding: 16px 12px;
  width: 232px;
}

.workspace {
  margin-left: 232px;
}

.brand {
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(148, 163, 184, .16);
  border-radius: 0;
  box-shadow: none;
  margin: 0 0 16px;
  padding: 4px 8px 18px;
}

.brand-mark {
  border-radius: 12px;
  box-shadow: 0 8px 22px rgba(37, 99, 235, .18);
  height: 38px;
  width: 38px;
}

.brand strong {
  font-size: 19px;
}

.brand span {
  color: #9aa8ba;
  font-size: 12px;
}

.side-nav {
  gap: 5px;
}

.nav-link {
  border-radius: 12px;
  grid-template-columns: 32px 1fr auto;
  min-height: 44px;
  padding: 7px 8px;
}

.nav-link::after {
  display: none;
}

.nav-link:hover {
  background: rgba(255, 255, 255, .065);
  border-color: transparent;
}

.nav-link.active {
  background: #1d4ed8;
  border-color: rgba(255, 255, 255, .08);
  box-shadow: 0 10px 24px rgba(37, 99, 235, .24);
}

.nav-icon {
  border-radius: 9px;
  height: 30px;
  min-width: 30px;
  width: 30px;
}

.user-card {
  background: rgba(255, 255, 255, .055);
  border-radius: 13px;
  grid-template-columns: 36px 1fr;
  padding: 10px;
}

.user-avatar {
  height: 36px;
  width: 36px;
}

.sidebar-logout button {
  border-radius: 12px;
  min-height: 40px;
}

.workspace-header {
  background: rgba(255, 255, 255, .86);
  box-shadow: 0 1px 0 rgba(203, 213, 225, .72);
  padding: 15px 28px;
}

.workspace-kicker,
.section-kicker {
  font-size: 11px;
  letter-spacing: .16em;
}

.workspace-header h1 {
  font-size: 24px;
  line-height: 1.18;
}

.status-strip {
  gap: 6px;
}

.status-chip,
.header-link {
  box-shadow: none;
  font-size: 12px;
  padding: 6px 10px;
}

.header-link {
  background: #fff;
}

.workspace-content {
  max-width: 1380px;
  padding: 22px 24px 38px;
}

.studio-grid {
  gap: 16px;
  grid-template-columns: minmax(0, 1fr) minmax(292px, 320px);
}

.panel {
  border-radius: var(--studio-radius-lg);
  box-shadow: var(--studio-shadow-sm);
  margin-bottom: 16px;
}

.command-card {
  padding: 20px;
}

.command-card::before,
.settings-hero-panel::before,
.admin-hero-panel::before {
  height: 3px;
  left: 16px;
  right: 16px;
}

.section-heading {
  margin-bottom: 12px;
}

.section-heading h2,
.panel h2 {
  font-size: 19px;
}

.section-heading.compact h2 {
  font-size: 17px;
}

.command-card .hint,
.hint {
  color: #526071;
  font-size: 14px;
  line-height: 1.55;
}

.title-icon {
  border-radius: 10px;
  box-shadow: none;
  height: 28px;
  width: 28px;
}

.model-badge {
  padding: 6px 10px;
}

.task-form {
  gap: 13px;
}

input,
textarea,
select {
  border-radius: 10px;
}

textarea {
  font-size: 14px;
}

.voice-style-selector,
.image-mode-selector,
.parameter-presets,
.script-coach,
.audio-checklist,
.settings-help,
.source-image-box,
.submit-flow {
  background: #f8fafc;
  border-color: #dde6f1;
  border-radius: 14px;
  padding: 12px;
}

.assist-card-grid {
  gap: 9px;
}

.assist-card {
  border-radius: 12px;
  min-height: 74px;
  padding: 11px 12px;
}

.assist-card strong {
  font-size: 14px;
}

.assist-card span,
.assist-note,
.script-coach p,
.source-image-box p,
.preset-card p,
.guide-list p {
  font-size: 12px;
}

.assist-card:hover,
.assist-card.active,
.template-button:hover,
.param-preset-button:hover,
.param-preset-button.active {
  box-shadow: 0 1px 2px rgba(15, 23, 42, .05);
}

.drop-box {
  border-radius: 13px;
}

.controls-grid {
  gap: 11px;
}

.range-control {
  border-radius: 13px;
  box-shadow: none;
  padding: 11px;
}

.primary-action {
  border-radius: 12px;
  box-shadow: 0 10px 22px rgba(37, 99, 235, .18);
  min-height: 50px;
}

.primary-action:hover {
  box-shadow: 0 12px 26px rgba(37, 99, 235, .22);
}

.preset-card,
.compact-history-card,
.metric-card,
.voice-feature-card,
.image-result-card,
.learning-card,
.memory-rule-item,
.mini-task,
.chat-rail,
.chat-canvas,
.chat-context,
.chat-message-list,
.chat-command-bar,
.chat-empty {
  border-radius: 14px;
}

.preset-card:hover,
.compact-history-card:hover,
.metric-card:hover,
.voice-feature-card:hover,
.image-result-card:hover,
.memory-rule-item:hover,
.mini-task:hover {
  transform: none;
}

.mini-tasks,
.image-preview-panel,
.spanish-memory-panel,
.chat-context {
  top: 88px;
}

.chat-workbench {
  gap: 14px;
  grid-template-columns: 204px minmax(0, 1fr) 236px;
  height: calc(100vh - 132px);
  max-height: calc(100vh - 132px);
}

.chat-rail,
.chat-canvas,
.chat-context {
  padding: 13px;
}

.chat-toolbar {
  gap: 10px;
}

.conversation-link,
.chat-rail-search,
.context-status,
.chat-utility-menu,
.chat-utility-popover summary,
.chat-prompt-row button,
.context-actions button,
.chat-starter {
  border-radius: 11px;
}

.chat-message-list {
  background: #f8fafc;
}

.chat-bubble {
  border-radius: 13px;
}

.chat-composer textarea {
  border-radius: 12px;
  min-height: 72px;
}

.login-body {
  background: #07111f;
}

.login-bg-video {
  filter: saturate(.94) contrast(1.02) brightness(.46);
  opacity: .72;
}

.login-particles {
  opacity: .4;
}

.login-grid,
.login-orbit,
.login-wave {
  opacity: .18;
}

.login-stage {
  align-items: center;
  gap: clamp(28px, 5vw, 72px);
  grid-template-columns: minmax(360px, 500px) minmax(360px, 430px);
  max-width: 1060px;
  min-height: 100vh;
  padding: 48px 28px;
}

.login-hero {
  max-width: 500px;
}

.login-brand {
  background: rgba(255, 255, 255, .08);
  border-color: rgba(255, 255, 255, .13);
  border-radius: 16px;
  padding: 8px 10px;
}

.login-brand-mark {
  border-radius: 12px;
  height: 40px;
  width: 40px;
}

.login-kicker {
  color: #93c5fd;
  font-size: 12px;
  margin-top: 42px;
}

.login-hero h1 {
  font-size: clamp(42px, 5vw, 58px);
  line-height: 1.05;
  margin: 12px 0 0;
  max-width: 460px;
}

.login-copy {
  color: rgba(226, 232, 240, .88);
  font-size: 16px;
  line-height: 1.8;
  max-width: 420px;
}

.login-product-card {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 128px));
  margin-top: 28px;
}

.login-product-card span {
  background: rgba(255, 255, 255, .09);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 999px;
  color: #e5edf7;
  font-size: 13px;
  font-weight: 850;
  padding: 8px 12px;
  text-align: center;
}

.login-metrics {
  display: none;
}

.login-panel {
  background: rgba(8, 17, 34, .82);
  border-color: rgba(148, 163, 184, .24);
  border-radius: 22px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .35);
  padding: 28px;
}

.login-panel::before {
  height: 3px;
}

.login-panel h2 {
  font-size: 32px;
}

.login-panel p {
  font-size: 14px;
}

.login-panel label {
  gap: 8px;
}

.login-panel input {
  border-radius: 12px;
  min-height: 50px;
}

.login-panel button {
  border-radius: 12px;
  min-height: 52px;
}

@media (max-width: 1240px) {
  .chat-workbench {
    grid-template-columns: 200px minmax(0, 1fr);
  }
}

@media (max-width: 980px) {
  .sidebar {
    width: 212px;
  }

  .workspace {
    margin-left: 212px;
  }

  .chat-workbench {
    grid-template-columns: 1fr;
  }

  .login-stage {
    grid-template-columns: 1fr;
    max-width: 720px;
  }

  .login-hero {
    max-width: none;
  }
}

@media (max-width: 760px) {
  .sidebar {
    width: auto;
  }

  .workspace {
    margin-left: 0;
  }

  .workspace-content {
    padding: 18px 14px 30px;
  }

  .workspace-header h1 {
    font-size: 22px;
  }

  .login-stage {
    padding: 24px 18px;
  }

  .login-hero h1 {
    font-size: clamp(36px, 12vw, 48px);
  }

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

/* Studio Layers v4: compact overview cards and restrained motion. */
.workspace-overview {
  animation: studioFadeUp .42s cubic-bezier(.2, .8, .2, 1) both;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin-bottom: 16px;
}

.overview-card {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .94), rgba(248, 251, 255, .86)),
    radial-gradient(circle at 100% 0, rgba(37, 99, 235, .10), transparent 36%);
  border: 1px solid rgba(174, 191, 216, .72);
  border-radius: 16px;
  box-shadow: 0 8px 22px rgba(15, 23, 42, .055);
  color: var(--studio-text);
  display: grid;
  gap: 2px;
  min-height: 82px;
  overflow: hidden;
  padding: 13px 14px 13px 16px;
  position: relative;
  text-decoration: none;
  transition:
    background .2s ease,
    border-color .2s ease,
    box-shadow .2s ease,
    transform .2s ease;
}

.overview-card::before {
  background: var(--overview-accent, var(--studio-primary));
  border-radius: 999px;
  bottom: 14px;
  content: "";
  left: 0;
  position: absolute;
  top: 14px;
  width: 4px;
}

.overview-card::after {
  background: linear-gradient(110deg, transparent 0 36%, rgba(255, 255, 255, .62) 48%, transparent 62% 100%);
  content: "";
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-54%);
  transition: opacity .2s ease, transform .46s ease;
}

.overview-card span {
  color: #64748b;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .08em;
  line-height: 1.2;
  text-transform: uppercase;
}

.overview-card strong {
  color: #101828;
  font-size: 20px;
  font-weight: 950;
  line-height: 1.14;
}

.overview-card small {
  color: var(--studio-muted);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.25;
}

.overview-card:hover,
.overview-card.active {
  border-color: color-mix(in srgb, var(--overview-accent, var(--studio-primary)) 34%, #ffffff);
  box-shadow: 0 14px 30px rgba(15, 23, 42, .075);
  transform: translateY(-2px);
}

.overview-card:hover::after,
.overview-card.active::after {
  opacity: .8;
  transform: translateX(46%);
}

.overview-card.active {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .98), rgba(239, 246, 255, .92)),
    radial-gradient(circle at 100% 0, color-mix(in srgb, var(--overview-accent, var(--studio-primary)) 18%, transparent), transparent 42%);
}

.overview-voice {
  --overview-accent: #2563eb;
}

.overview-image {
  --overview-accent: #7c3aed;
}

.overview-spanish {
  --overview-accent: #f97316;
}

.overview-chat {
  --overview-accent: #0891b2;
}

.overview-queue {
  --overview-accent: #64748b;
}

.overview-today {
  --overview-accent: #16a34a;
}

.workspace-content > .panel,
.voice-layout,
.image-layout,
.studio-grid,
.chat-workbench {
  animation: studioFadeUp .46s cubic-bezier(.2, .8, .2, 1) both;
  animation-delay: .04s;
}

.command-card::before,
.recent-panel::before,
.settings-hero-panel::before,
.admin-hero-panel::before {
  animation: studioSoftPulse 4.2s ease-in-out infinite;
}

.primary-action {
  isolation: isolate;
  overflow: hidden;
  position: relative;
}

.primary-action::after {
  background: linear-gradient(110deg, transparent 0 38%, rgba(255, 255, 255, .34) 50%, transparent 62% 100%);
  content: "";
  inset: 0;
  opacity: 0;
  pointer-events: none;
  position: absolute;
  transform: translateX(-58%);
  transition: opacity .18s ease, transform .5s ease;
  z-index: -1;
}

.primary-action:hover::after {
  opacity: 1;
  transform: translateX(58%);
}

.nav-link.active::before {
  animation: studioSoftGlow 2.8s ease-in-out infinite;
  background: radial-gradient(circle, rgba(59, 130, 246, .55), transparent 60%);
  border-radius: 999px;
  content: "";
  height: 22px;
  left: 18px;
  pointer-events: none;
  position: absolute;
  top: 16px;
  width: 22px;
}

@keyframes studioFadeUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes studioSoftPulse {
  0%,
  100% {
    opacity: .72;
  }

  50% {
    opacity: 1;
  }
}

@keyframes studioSoftGlow {
  0%,
  100% {
    opacity: .16;
    transform: scale(.86);
  }

  50% {
    opacity: .34;
    transform: scale(1.08);
  }
}

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

@media (max-width: 760px) {
  .workspace-overview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Product shell v1: product home and reusable product-grade patterns. */
.product-home-hero {
  align-items: center;
  background:
    radial-gradient(circle at 86% 18%, rgba(37, 99, 235, .12), transparent 34%),
    radial-gradient(circle at 18% 0, rgba(6, 182, 212, .10), transparent 32%),
    linear-gradient(135deg, rgba(255, 255, 255, .95), rgba(246, 250, 255, .82));
  display: flex;
  gap: 24px;
  justify-content: space-between;
  margin-bottom: 16px;
  min-height: 150px;
}

.product-home-hero h2 {
  font-size: 34px;
  letter-spacing: -.03em;
  margin: 4px 0 8px;
}

.product-home-hero .hint {
  max-width: 620px;
}

.product-home-status {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(86px, 1fr));
  min-width: 330px;
}

.product-home-status span {
  background: rgba(255, 255, 255, .74);
  border: 1px solid rgba(145, 164, 194, .34);
  border-radius: 16px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .72);
  display: grid;
  gap: 2px;
  padding: 14px 16px;
}

.product-home-status strong {
  color: #0f172a;
  font-size: 26px;
  line-height: 1;
}

.product-home-status small {
  color: #64748b;
  font-weight: 800;
}

.product-home-layout {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr) 330px;
}

.product-module-panel,
.product-standard-card,
.product-usage-card,
.product-activity-panel {
  position: relative;
}

.product-module-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 14px;
}

.product-module-card {
  align-items: center;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .88), rgba(248, 251, 255, .76)),
    radial-gradient(circle at 100% 0, color-mix(in srgb, var(--module-card-accent, #2563eb) 13%, transparent), transparent 42%);
  border: 1px solid rgba(145, 164, 194, .34);
  border-radius: 18px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .03);
  color: #0f172a;
  display: grid;
  gap: 12px;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  min-height: 116px;
  padding: 16px;
  text-decoration: none;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.product-module-card:hover {
  border-color: color-mix(in srgb, var(--module-card-accent, #2563eb) 32%, #ffffff);
  box-shadow: 0 16px 34px rgba(15, 23, 42, .08);
  transform: translateY(-2px);
}

.module-icon {
  align-items: center;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--module-card-accent, #2563eb) 92%, #ffffff), color-mix(in srgb, var(--module-card-accent, #2563eb) 56%, #0ea5e9));
  border-radius: 14px;
  box-shadow: 0 12px 26px color-mix(in srgb, var(--module-card-accent, #2563eb) 24%, transparent);
  color: #fff;
  display: inline-flex;
  font-size: 13px;
  font-weight: 950;
  height: 42px;
  justify-content: center;
  width: 42px;
}

.product-module-card strong {
  display: block;
  font-size: 18px;
  letter-spacing: -.01em;
  margin-bottom: 4px;
}

.product-module-card p {
  color: #5d6b7d;
  font-size: 13px;
  line-height: 1.6;
  margin: 0;
}

.product-module-card small {
  align-self: start;
  background: rgba(255, 255, 255, .74);
  border: 1px solid rgba(145, 164, 194, .30);
  border-radius: 999px;
  color: #536171;
  font-size: 11px;
  font-weight: 900;
  padding: 5px 8px;
  white-space: nowrap;
}

.module-voice {
  --module-card-accent: #2563eb;
}

.module-image {
  --module-card-accent: #7c3aed;
}

.module-spanish {
  --module-card-accent: #f97316;
}

.module-chat {
  --module-card-accent: #0891b2;
}

.module-queue {
  --module-card-accent: #64748b;
}

.module-settings {
  --module-card-accent: #16a34a;
}

.product-home-rail {
  display: grid;
  gap: 16px;
}

.standard-list,
.usage-bars {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.standard-list p {
  background: rgba(255, 255, 255, .68);
  border: 1px solid rgba(145, 164, 194, .30);
  border-radius: 14px;
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 12px;
}

.standard-list strong {
  color: #0f172a;
}

.standard-list span {
  color: #64748b;
  font-size: 13px;
  line-height: 1.5;
}

.usage-bars span {
  --bar-width: min(100%, calc((var(--bar, 0) + 1) * 18%));
  background: rgba(255, 255, 255, .70);
  border: 1px solid rgba(145, 164, 194, .30);
  border-radius: 14px;
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr auto;
  overflow: hidden;
  padding: 10px 12px;
  position: relative;
}

.usage-bars span::after {
  background: linear-gradient(90deg, rgba(37, 99, 235, .18), rgba(6, 182, 212, .14));
  border-radius: 999px;
  bottom: 0;
  content: "";
  height: 3px;
  left: 0;
  position: absolute;
  width: var(--bar-width);
}

.usage-bars strong,
.usage-bars small {
  position: relative;
}

.product-activity-panel {
  margin-top: 16px;
}

.product-activity-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 12px;
}

.product-activity-grid article {
  background: rgba(255, 255, 255, .68);
  border: 1px solid rgba(145, 164, 194, .30);
  border-radius: 16px;
  padding: 14px;
}

.product-activity-grid article > strong {
  display: block;
  margin-bottom: 10px;
}

.product-activity-grid p {
  align-items: flex-start;
  color: #5d6b7d;
  display: flex;
  gap: 8px;
  line-height: 1.45;
  margin: 0 0 8px;
  max-height: 46px;
  overflow: hidden;
}

.muted-row {
  color: #94a3b8 !important;
}

@media (max-width: 1180px) {
  .product-home-hero,
  .product-home-layout {
    grid-template-columns: 1fr;
  }

  .product-home-hero {
    align-items: flex-start;
    display: grid;
  }

  .product-home-status {
    min-width: 0;
  }

  .product-home-layout {
    display: grid;
  }
}

@media (max-width: 900px) {
  .product-module-grid,
  .product-activity-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .workspace-overview,
  .workspace-content > .panel,
  .voice-layout,
  .image-layout,
  .studio-grid,
  .chat-workbench,
  .command-card::before,
  .recent-panel::before,
  .settings-hero-panel::before,
  .admin-hero-panel::before,
  .nav-link.active::before {
    animation: none;
  }

  .overview-card,
  .overview-card::after,
  .primary-action::after {
    transition: none;
  }
}

/* Studio v5: lighter navigation, sharper hierarchy, and more polished desk surfaces. */
:root {
  --studio-bg: #f3f7fb;
  --studio-bg-soft: #edf4fb;
  --studio-ink: #0b1220;
  --studio-panel: rgba(255, 255, 255, .92);
  --studio-panel-soft: rgba(248, 251, 255, .76);
  --studio-hairline: rgba(141, 160, 188, .34);
  --studio-hairline-strong: rgba(104, 126, 158, .48);
  --studio-depth: 0 1px 2px rgba(15, 23, 42, .04), 0 18px 46px rgba(15, 23, 42, .075);
  --studio-depth-soft: 0 1px 2px rgba(15, 23, 42, .035), 0 10px 28px rgba(15, 23, 42, .055);
  --module-accent: #2563eb;
}

.app-body {
  background:
    linear-gradient(115deg, rgba(37, 99, 235, .065) 0 1px, transparent 1px 34%),
    linear-gradient(155deg, rgba(6, 182, 212, .052) 0 1px, transparent 1px 36%),
    repeating-linear-gradient(90deg, rgba(37, 99, 235, .027) 0 1px, transparent 1px 86px),
    repeating-linear-gradient(0deg, rgba(14, 165, 233, .022) 0 1px, transparent 1px 86px),
    linear-gradient(180deg, #fbfdff 0%, #f4f8fc 42%, #edf4fb 100%);
}

.app-body::before {
  background:
    linear-gradient(120deg, transparent 0 46%, rgba(37, 99, 235, .055) 46% 46.12%, transparent 46.12%),
    linear-gradient(28deg, transparent 0 70%, rgba(124, 58, 237, .045) 70% 70.12%, transparent 70.12%);
}

.sidebar {
  background:
    linear-gradient(150deg, rgba(59, 130, 246, .22), transparent 28%),
    linear-gradient(30deg, rgba(20, 184, 166, .12), transparent 42%),
    linear-gradient(180deg, #08111f 0%, #0c1424 56%, #0b1020 100%);
  box-shadow: 18px 0 52px rgba(15, 23, 42, .10);
}

.brand {
  background: rgba(255, 255, 255, .065);
  border-color: rgba(255, 255, 255, .10);
  border-radius: 18px;
}

.brand-mark {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .96), rgba(219, 234, 254, .9) 54%, rgba(224, 231, 255, .86)),
    radial-gradient(circle at 28% 24%, rgba(255, 255, 255, .9), transparent 28%);
  box-shadow: 0 14px 32px rgba(37, 99, 235, .24), inset 0 1px 0 rgba(255, 255, 255, .72);
}

.nav-link {
  border-radius: 14px;
  color: rgba(226, 232, 240, .84);
}

.nav-link:hover {
  background: rgba(255, 255, 255, .075);
}

.nav-link.active {
  background:
    linear-gradient(100deg, rgba(37, 99, 235, .98), rgba(29, 78, 216, .84)),
    linear-gradient(180deg, rgba(255, 255, 255, .14), transparent);
  border-color: rgba(147, 197, 253, .24);
  box-shadow: 0 14px 34px rgba(37, 99, 235, .25);
  color: #fff;
}

.workspace {
  background: linear-gradient(180deg, rgba(255, 255, 255, .58), transparent 260px);
}

.workspace-header {
  backdrop-filter: blur(18px);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .88), rgba(255, 255, 255, .74)),
    linear-gradient(90deg, rgba(37, 99, 235, .06), transparent 42%, rgba(6, 182, 212, .05));
  border-bottom-color: rgba(174, 191, 216, .42);
  min-height: 82px;
}

.workspace-kicker {
  color: #3b6fb9;
  font-size: 11px;
  letter-spacing: .2em;
}

.workspace-header h1 {
  font-size: 25px;
  letter-spacing: -.01em;
}

.status-chip,
.header-link,
.model-badge {
  backdrop-filter: blur(12px);
  background: rgba(255, 255, 255, .68);
  border: 1px solid rgba(151, 170, 199, .38);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .72), 0 6px 18px rgba(15, 23, 42, .045);
}

.status-chip.online {
  background: rgba(236, 253, 245, .78);
  border-color: rgba(22, 163, 74, .24);
}

.workspace-content {
  padding-top: 20px;
}

.workspace-overview {
  align-items: center;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .72), rgba(248, 251, 255, .62)),
    linear-gradient(90deg, rgba(37, 99, 235, .035), transparent 38%, rgba(124, 58, 237, .032));
  border: 1px solid rgba(155, 174, 205, .34);
  border-radius: 20px;
  box-shadow: var(--studio-depth-soft);
  display: grid;
  gap: 7px;
  grid-template-columns: repeat(4, minmax(0, 1.18fr)) repeat(2, minmax(0, .82fr));
  margin-bottom: 16px;
  padding: 8px;
}

.overview-card {
  align-items: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 14px;
  box-shadow: none;
  display: grid;
  gap: 1px;
  min-height: 54px;
  padding: 8px 12px 8px 14px;
}

.overview-card::before {
  bottom: 12px;
  opacity: .78;
  top: 12px;
  width: 3px;
}

.overview-card::after {
  display: none;
}

.overview-card span {
  color: #6b7890;
  font-size: 10px;
  letter-spacing: .16em;
}

.overview-card strong {
  font-size: 16px;
  letter-spacing: -.01em;
}

.overview-card small {
  color: #718096;
  font-size: 11px;
}

.overview-card:hover,
.overview-card.active {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .88), rgba(241, 247, 255, .72)),
    radial-gradient(circle at 100% 0, color-mix(in srgb, var(--overview-accent, #2563eb) 14%, transparent), transparent 40%);
  border-color: color-mix(in srgb, var(--overview-accent, #2563eb) 28%, rgba(255, 255, 255, .68));
  box-shadow: 0 8px 20px rgba(15, 23, 42, .055);
  transform: translateY(-1px);
}

.panel,
.chat-rail,
.chat-canvas,
.chat-context {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .94), rgba(250, 252, 255, .88)),
    linear-gradient(115deg, rgba(37, 99, 235, .028), transparent 42%, rgba(6, 182, 212, .022));
  border-color: rgba(153, 172, 203, .42);
  box-shadow: var(--studio-depth);
}

.command-card,
.recent-panel,
.admin-record-panel,
.settings-hero-panel,
.admin-hero-panel,
.chat-canvas {
  position: relative;
}

.command-card::before,
.recent-panel::before,
.admin-record-panel::before,
.settings-hero-panel::before,
.admin-hero-panel::before,
.chat-canvas::before {
  background: linear-gradient(90deg, #22d3ee, #2563eb 46%, #8b5cf6 74%, #f97316);
  content: "";
  height: 3px;
  inset: 0 16px auto 16px;
  opacity: .9;
  position: absolute;
}

.voice-command-card {
  --module-accent: #2563eb;
}

.image-command-card {
  --module-accent: #7c3aed;
}

.spanish-command-card {
  --module-accent: #f97316;
}

.command-card {
  border-radius: 18px;
  padding-top: 20px;
}

.section-heading h2,
.command-title h2 {
  letter-spacing: -.015em;
}

.title-icon {
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--module-accent) 90%, #ffffff), #1d4ed8),
    linear-gradient(180deg, rgba(255, 255, 255, .24), transparent);
  border: 1px solid rgba(255, 255, 255, .36);
  box-shadow: 0 12px 28px color-mix(in srgb, var(--module-accent) 24%, transparent);
}

.hint {
  color: #58667a;
}

.voice-style-selector,
.image-mode-selector,
.source-image-box,
.script-coach,
.audio-checklist,
.settings-help,
.parameter-presets,
.task-tracker {
  background:
    linear-gradient(180deg, rgba(248, 251, 255, .86), rgba(255, 255, 255, .72)),
    linear-gradient(100deg, rgba(37, 99, 235, .035), transparent 58%);
  border: 1px solid rgba(159, 178, 210, .36);
  border-radius: 16px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .74);
}

.assist-card {
  background: rgba(255, 255, 255, .72);
  border-color: rgba(145, 164, 194, .38);
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .035);
}

.assist-card::before {
  background: linear-gradient(180deg, color-mix(in srgb, var(--module-accent) 90%, #ffffff), color-mix(in srgb, var(--module-accent) 42%, #ffffff));
  opacity: .85;
}

.assist-card:hover,
.assist-card.active {
  background: rgba(255, 255, 255, .92);
  border-color: color-mix(in srgb, var(--module-accent) 34%, #ffffff);
  box-shadow: 0 10px 24px rgba(15, 23, 42, .075);
  transform: translateY(-2px);
}

input,
textarea,
select {
  background: rgba(255, 255, 255, .82);
  border-color: rgba(128, 150, 183, .5);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .74);
}

input:focus,
textarea:focus,
select:focus {
  background: #fff;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--module-accent) 14%, transparent), 0 10px 26px rgba(15, 23, 42, .055);
}

.drop-upload,
.drop-box {
  border-color: rgba(133, 154, 188, .38);
  border-radius: 16px;
}

.drop-box {
  background:
    repeating-linear-gradient(90deg, rgba(37, 99, 235, .035) 0 1px, transparent 1px 26px),
    linear-gradient(180deg, rgba(248, 251, 255, .78), rgba(255, 255, 255, .58));
}

.range-control {
  background: rgba(255, 255, 255, .72);
  border-color: rgba(150, 169, 198, .38);
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .035);
}

.range-control:hover {
  border-color: color-mix(in srgb, var(--module-accent) 26%, #ffffff);
}

.primary-action {
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--module-accent) 90%, #0ea5e9), #1d4ed8 58%, #553cf0),
    linear-gradient(180deg, rgba(255, 255, 255, .28), transparent);
  border: 1px solid rgba(255, 255, 255, .28);
  box-shadow: 0 16px 34px color-mix(in srgb, var(--module-accent) 24%, transparent), inset 0 1px 0 rgba(255, 255, 255, .32);
}

.primary-action:hover {
  box-shadow: 0 20px 44px color-mix(in srgb, var(--module-accent) 30%, transparent), inset 0 1px 0 rgba(255, 255, 255, .36);
  transform: translateY(-2px);
}

.studio-aside .panel,
.guidance-panel,
.mini-tasks,
.prompt-template-panel,
.image-preview-panel,
.spanish-memory-panel,
.chat-context {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .90), rgba(246, 249, 253, .78)),
    linear-gradient(110deg, rgba(37, 99, 235, .03), transparent 52%, rgba(124, 58, 237, .026));
  border-color: rgba(151, 170, 199, .38);
}

.preset-card,
.voice-feature-card,
.image-result-spotlight,
.image-result-card,
.mini-task,
.compact-history-card,
.metric-card,
.learning-card,
.memory-rule-item,
.context-status,
.chat-starter,
.conversation-link,
.chat-rail-search {
  background: rgba(255, 255, 255, .72);
  border-color: rgba(145, 164, 194, .34);
  box-shadow: 0 1px 2px rgba(15, 23, 42, .03);
}

.preset-card:hover,
.voice-feature-card:hover,
.image-result-card:hover,
.mini-task:hover,
.compact-history-card:hover,
.conversation-link:hover,
.chat-starter:hover {
  background: rgba(255, 255, 255, .92);
  border-color: rgba(96, 165, 250, .34);
  box-shadow: 0 10px 24px rgba(15, 23, 42, .06);
  transform: translateY(-1px);
}

.compact-history-panel {
  margin-top: 16px;
}

.compact-history-grid {
  gap: 10px;
}

.compact-history-card {
  border-radius: 14px;
}

.chat-workbench {
  grid-template-columns: 196px minmax(0, 1fr) 228px;
}

.chat-rail,
.chat-canvas,
.chat-context {
  border-radius: 18px;
}

.chat-rail {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .86), rgba(248, 251, 255, .74)),
    linear-gradient(145deg, rgba(37, 99, 235, .04), transparent 50%);
}

.conversation-link {
  border-radius: 12px;
  padding: 8px 9px;
}

.conversation-link.active {
  background:
    linear-gradient(135deg, rgba(37, 99, 235, .12), rgba(14, 165, 233, .07)),
    rgba(255, 255, 255, .82);
  border-color: rgba(37, 99, 235, .24);
}

.chat-message-list {
  background:
    repeating-linear-gradient(90deg, rgba(37, 99, 235, .018) 0 1px, transparent 1px 42px),
    linear-gradient(180deg, rgba(248, 251, 255, .72), rgba(255, 255, 255, .62));
  border: 1px solid rgba(151, 170, 199, .28);
}

.chat-bubble {
  box-shadow: 0 8px 22px rgba(15, 23, 42, .055);
}

.chat-command-bar {
  background: rgba(255, 255, 255, .78);
  border-color: rgba(151, 170, 199, .34);
  box-shadow: 0 -10px 28px rgba(15, 23, 42, .045);
}

.chat-message.streaming .chat-bubble {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .96), rgba(244, 249, 255, .88)),
    radial-gradient(circle at 100% 0, rgba(37, 99, 235, .10), transparent 42%);
}

.chat-composer button:disabled {
  filter: saturate(.7);
}

@media (max-width: 1280px) {
  .workspace-overview {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .workspace-overview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
