:root {
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;

  color: #f4f4f5;
  background: #070707;

  --panel: #0d0d0f;
  --panel-2: #121216;
  --panel-3: #18181c;
  --line: #242429;
  --line-strong: #32323a;
  --muted: #74747c;
  --soft: #b0b0b8;
  --white: #f4f4f5;
  --green: #74f29b;
  --green-glow: rgba(116, 242, 155, 0.25);
  --yellow: #fcd34d;
  --red: #ff7d7d;
  --blue: #8dbbff;
  --purple: #c084fc;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: #070707;
  color: var(--white);
  overflow-x: hidden;
}

button,
textarea,
input {
  font: inherit;
}

button {
  cursor: pointer;
  user-select: none;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

/* APP SHELL */
.app-shell {
  min-height: 100vh;
  background:
    radial-gradient(
      circle at 50% -20%,
      rgba(255, 255, 255, 0.05),
      transparent 45%
    ),
    #070707;
  display: flex;
  flex-direction: column;
}

/* TOPBAR */
.topbar {
  height: 64px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  background: rgba(7, 7, 7, 0.95);
  backdrop-filter: blur(14px);
  z-index: 100;
}

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

.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: #f4f4f5;
  color: #070707;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 14px;
}

.brand-mark.small {
  width: 22px;
  height: 22px;
  font-size: 12px;
}

.brand-word {
  font-weight: 800;
  letter-spacing: 0.09em;
  font-size: 14px;
}

.version-pill {
  border: 1px solid #333339;
  border-radius: 999px;
  padding: 3px 8px;
  color: #9d9da4;
  font-size: 9px;
  letter-spacing: 0.12em;
}

.connection-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: #a3a3aa;
  border: 1px solid #28282e;
  border-radius: 999px;
  padding: 6px 12px;
  background: #0d0d0f;
  transition: all 0.2s ease;
}

.connection-pill .dot,
.live-dot,
.environment-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #666;
  display: inline-block;
  transition: background 0.3s ease;
}

.connection-pill.online .dot,
.live-dot,
.environment-dot.online {
  background: var(--green);
  box-shadow: 0 0 10px var(--green-glow);
}

.ghost-btn,
.icon-btn,
.micro-btn {
  background: transparent;
  border: 1px solid #2d2d34;
  border-radius: 8px;
  color: #dfdfe4;
  transition: all 0.2s ease;
}

.ghost-btn {
  padding: 7px 14px;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.ghost-btn:hover {
  background: #141418;
  border-color: #3f3f48;
}

.ghost-btn.danger {
  color: var(--red);
  border-color: rgba(255, 125, 125, 0.3);
}

.ghost-btn.danger:hover {
  background: rgba(255, 125, 125, 0.1);
  border-color: var(--red);
}

.icon-btn {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  font-size: 14px;
}

.icon-btn:hover {
  background: #18181d;
  border-color: #40404a;
}

.micro-btn {
  padding: 3px 8px;
  font-size: 10px;
  border-radius: 4px;
}

.micro-btn:hover {
  background: #1b1b22;
}

/* WORKSPACE GRID */
.workspace {
  flex: 1;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr) 280px;
  min-height: calc(100vh - 64px);
}

/* SIDEBARS */
.sidebar {
  padding: 20px 16px;
  background: #09090b;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.left-sidebar {
  border-right: 1px solid var(--line);
}

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

.section-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: #63636c;
  margin: 6px 4px 6px;
  text-transform: uppercase;
}

.section-spaced {
  margin-top: 18px;
}

.nav-item {
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  color: #92929c;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 12px;
  transition: all 0.15s ease;
  text-align: left;
}

.nav-icon {
  font-size: 13px;
  color: #7b7b85;
}

.nav-item:hover {
  background: #111115;
  color: #e5e5ea;
}

.nav-item.active {
  background: #15151a;
  border-color: #2b2b32;
  color: #fff;
}

.nav-item.active .nav-icon {
  color: var(--white);
}

.sidebar-spacer {
  flex: 1;
}

/* MODEL CONTROLS IN SIDEBAR */
.sidebar-model-controls {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 8px;
}

.tool-action-btn {
  background: #111116;
  border: 1px solid #292931;
  color: #d1d1d8;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 7px;
  transition: all 0.2s ease;
}

.tool-action-btn:hover {
  background: #171720;
  border-color: #3e3e4a;
  color: #fff;
}

.tool-action-btn.primary-tool {
  background: #151824;
  border-color: #2e3550;
  color: #b5cbf8;
}

.tool-action-btn.primary-tool:hover {
  background: #1c2134;
  border-color: #434f78;
}

.project-mini {
  padding: 10px;
  background: #0e0e12;
  border: 1px solid #23232a;
  border-radius: 10px;
}

.project-name {
  font-size: 12px;
  font-weight: 700;
  color: #f1f1f4;
  margin: 4px 0 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.project-meta {
  font-size: 10px;
  color: #787882;
}

/* MAIN CANVAS */
.main-canvas {
  padding: 30px 36px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  max-width: 1140px;
  margin: 0 auto;
  width: 100%;
}

.hero-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
}

.eyebrow {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.2em;
  color: #72727c;
  margin-bottom: 8px;
}

.hero-row h1 {
  font-size: 38px;
  line-height: 1.05;
  margin: 0 0 10px;
  letter-spacing: -0.02em;
  font-weight: 800;
}

.hero-copy {
  margin: 0;
  color: #8c8c96;
  font-size: 14px;
  line-height: 1.5;
  max-width: 620px;
}

.hero-badge-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.hero-badge {
  font-size: 10px;
  border: 1px solid #2f2f36;
  background: #111115;
  color: #a3a3ac;
  border-radius: 999px;
  padding: 5px 10px;
  letter-spacing: 0.08em;
  font-weight: 600;
}

.status-summary-chip {
  font-size: 10px;
  color: #787883;
  padding: 2px 8px;
}

/* COMMAND CARD / PROMPT INPUT */
.command-card {
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: linear-gradient(180deg, #101013, #0a0a0c);
  padding: 16px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45);
}

.command-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.command-title {
  font-size: 12px;
  font-weight: 700;
  color: #e2e2e7;
}

.command-hint {
  font-size: 10px;
  color: #6d6d76;
}

#promptInput {
  width: 100%;
  min-height: 80px;
  background: #08080a;
  border: 1px solid #1f1f24;
  border-radius: 10px;
  color: #f1f1f5;
  padding: 12px;
  font-size: 13px;
  line-height: 1.5;
  resize: vertical;
  outline: none;
  transition: border-color 0.2s ease;
}

#promptInput:focus {
  border-color: #3b3b45;
}

.prompt-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  gap: 12px;
  flex-wrap: wrap;
}

.prompt-tools {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.chip {
  border: 1px solid #232328;
  background: #111114;
  color: #8c8c95;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  transition: all 0.15s ease;
}

.chip:hover {
  background: #17171c;
  color: #e5e5eb;
}

.chip.active {
  background: #1e1e24;
  border-color: #373740;
  color: #fff;
}

.prompt-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* EFFORT CONTROL POPOVER */
.effort-wrapper {
  position: relative;
}

.effort-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #2a2a32;
  background: #111115;
  color: #dfdfe6;
  border-radius: 8px;
  padding: 7px 11px;
  font-size: 11px;
  font-weight: 600;
  transition: all 0.2s ease;
}

.effort-btn:hover {
  background: #18181f;
  border-color: #3d3d49;
}

.effort-label {
  color: #7b7b84;
}

.effort-value {
  color: var(--white);
  font-weight: 700;
}

.effort-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 250px;
  background: #101014;
  border: 1px solid #2c2c36;
  border-radius: 10px;
  padding: 6px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.effort-menu.hidden {
  display: none;
}

.effort-menu-head {
  font-size: 9px;
  letter-spacing: 0.14em;
  font-weight: 700;
  color: #6c6c76;
  padding: 6px 8px 4px;
  text-transform: uppercase;
  border-bottom: 1px solid #1c1c22;
  margin-bottom: 2px;
}

.effort-opt {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 8px 10px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: all 0.15s ease;
}

.effort-opt b {
  font-size: 12px;
  color: #e5e5eb;
}

.effort-opt small {
  font-size: 10px;
  color: #74747e;
}

.effort-opt:hover {
  background: #181820;
}

.effort-opt.selected {
  background: #1c1c24;
  border-color: #353540;
}

.effort-opt.selected b {
  color: var(--green);
}

/* STOP BUTTON */
.stop-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 125, 125, 0.08);
  border: 1px solid rgba(255, 125, 125, 0.3);
  color: var(--red);
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  transition: all 0.2s ease;
}

.stop-btn:not(:disabled):hover {
  background: rgba(255, 125, 125, 0.2);
  border-color: var(--red);
}

.stop-icon {
  font-size: 9px;
}

/* BUILD BUTTON */
.build-btn {
  background: #f4f4f5;
  color: #070707;
  border: none;
  border-radius: 8px;
  padding: 7px 16px;
  font-size: 12px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.build-btn:hover:not(:disabled) {
  background: #ffffff;
  transform: translateY(-1px);
}

/* SUGGESTIONS */
.suggestions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
}

.suggestion {
  background: #0d0d10;
  border: 1px solid #1f1f25;
  border-radius: 8px;
  color: #9c9ca5;
  padding: 8px 12px;
  font-size: 11px;
  text-align: left;
  transition: all 0.15s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.suggestion:hover {
  background: #141419;
  border-color: #303038;
  color: #e5e5eb;
}

/* AGENT SHELL */
.agent-shell {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #0a0a0d;
  overflow: hidden;
}

.agent-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  background: #0e0e11;
}

.pane-kicker {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.18em;
  color: #6e6e78;
}

.agent-title,
.pane-title {
  font-size: 13px;
  font-weight: 700;
  color: #e6e6eb;
}

.agent-top-indicators {
  display: flex;
  align-items: center;
  gap: 8px;
}

.job-badge,
.mission-badge {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.1em;
  border-radius: 999px;
  padding: 3px 8px;
  text-transform: uppercase;
}

.job-badge.idle,
.mission-badge.idle {
  background: #15151a;
  border: 1px solid #2b2b34;
  color: #7b7b85;
}

.job-badge.running,
.mission-badge.running {
  background: rgba(141, 187, 255, 0.1);
  border: 1px solid var(--blue);
  color: var(--blue);
}

.job-badge.success,
.mission-badge.success {
  background: rgba(116, 242, 155, 0.1);
  border: 1px solid var(--green);
  color: var(--green);
}

.job-badge.failed,
.mission-badge.failed,
.job-badge.stopped,
.mission-badge.stopped {
  background: rgba(255, 125, 125, 0.1);
  border: 1px solid var(--red);
  color: var(--red);
}

/* AGENT LAYOUT (CHAT + WORKFLOW) */
.agent-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 300px;
  border-bottom: 1px solid var(--line);
}

/* CHAT PANEL */
.chat-panel {
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
}

.chat-header {
  padding: 10px 14px;
  border-bottom: 1px solid #1c1c22;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  color: #8c8c96;
}

.mission-tag {
  font-size: 10px;
  color: #63636c;
  font-family: monospace;
}

.chat-messages {
  flex: 1;
  padding: 14px;
  overflow-y: auto;
  max-height: 220px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chat-message {
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.45;
}

.chat-message.agent {
  background: #121216;
  border: 1px solid #23232c;
  color: #dfdfe6;
}

.chat-message.user {
  background: #171720;
  border: 1px solid #2e2e3c;
  color: #fff;
  align-self: flex-end;
}

.message-label {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: #777782;
  margin-bottom: 4px;
}

.chat-compose {
  padding: 10px;
  border-top: 1px solid #1c1c22;
  display: flex;
  gap: 8px;
}

#chatInput {
  flex: 1;
  background: #0a0a0d;
  border: 1px solid #23232a;
  border-radius: 6px;
  color: #fff;
  padding: 8px;
  font-size: 11px;
  resize: none;
  outline: none;
}

#chatInput:focus {
  border-color: #3f3f4c;
}

.chat-send-btn {
  background: #1f1f26;
  border: 1px solid #33333e;
  border-radius: 6px;
  color: #e2e2e8;
  font-size: 11px;
  font-weight: 700;
  padding: 0 12px;
  transition: all 0.15s ease;
}

.chat-send-btn:hover {
  background: #282834;
  color: #fff;
}

/* WORKFLOW PIPELINE PANEL */
.workflow-panel {
  display: flex;
  flex-direction: column;
}

.workflow-header {
  padding: 10px 14px;
  border-bottom: 1px solid #1c1c22;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.workflow-mode {
  font-size: 10px;
  font-weight: 700;
  color: var(--blue);
}

.workflow-steps {
  flex: 1;
  padding: 14px;
  overflow-y: auto;
  max-height: 280px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.workflow-step {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: #0d0d10;
  transition: all 0.2s ease;
}

.step-icon {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  background: #17171d;
  color: #72727e;
  display: grid;
  place-items: center;
  font-size: 9px;
  font-weight: 800;
}

.step-content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.step-content b {
  font-size: 11px;
  color: #b0b0b8;
}

.step-content small {
  font-size: 9px;
  color: #63636c;
}

.step-state {
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.1em;
  padding: 2px 6px;
  border-radius: 4px;
  background: #141418;
  color: #666670;
}

.workflow-step.active {
  background: #13151f;
  border-color: #2b3552;
}

.workflow-step.active .step-icon {
  background: var(--blue);
  color: #070707;
}

.workflow-step.active .step-content b {
  color: #fff;
}

.workflow-step.active .step-state {
  background: rgba(141, 187, 255, 0.15);
  color: var(--blue);
}

.workflow-step.complete {
  background: #0e1310;
  border-color: #1e2c22;
}

.workflow-step.complete .step-icon {
  background: var(--green);
  color: #070707;
}

.workflow-step.complete .step-state {
  background: rgba(116, 242, 155, 0.15);
  color: var(--green);
}

.workflow-step.failed {
  background: #180e0e;
  border-color: #3b1c1c;
}

.workflow-step.failed .step-icon {
  background: var(--red);
  color: #070707;
}

.workflow-step.failed .step-state {
  background: rgba(255, 125, 125, 0.15);
  color: var(--red);
}

.workflow-connector {
  width: 2px;
  height: 6px;
  background: #1b1b22;
  margin-left: 19px;
}

/* STREAMING ACTIVITY LOG CONSOLE */
.agent-console {
  padding: 12px 16px;
}

.console-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.activity-log {
  background: #060608;
  border: 1px solid #1a1a20;
  border-radius: 8px;
  padding: 10px;
  height: 120px;
  overflow-y: auto;
  font-family: ui-monospace, Menlo, Monaco, "Courier New", monospace;
  font-size: 11px;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.log-line {
  display: flex;
  gap: 8px;
  color: #a4a4ad;
}

.log-time {
  color: #55555e;
  flex-shrink: 0;
}

.log-line.success {
  color: var(--green);
}

.log-line.error {
  color: var(--red);
}

.log-line.info {
  color: var(--blue);
}

/* LIVE PREVIEW SHELL */
.preview-shell {
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: #09090c;
  overflow: hidden;
}

.preview-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 18px;
  border-bottom: 1px solid var(--line);
  background: #0d0d10;
}

.preview-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  color: #e5e5eb;
}

.preview-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.preview-status {
  font-size: 11px;
  color: #797984;
}

.preview-frame-wrap {
  height: 380px;
  background: #060608;
}

#previewFrame {
  width: 100%;
  height: 100%;
  border: none;
  background: #060608;
}

/* RIGHT SIDEBAR CARDS */
.environment-card,
.side-card,
.mission-card,
.model-card {
  border: 1px solid #202027;
  border-radius: 10px;
  background: #0c0c0f;
  padding: 12px;
  margin-bottom: 6px;
}

.environment-status {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid #1a1a20;
}

.environment-status b {
  font-size: 12px;
  display: block;
}

.environment-status small {
  font-size: 10px;
  color: #70707a;
}

.environment-line,
.mission-line,
.model-line,
.user-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  margin-bottom: 6px;
}

.environment-line span,
.mission-line span,
.model-line span,
.user-line span {
  color: #767680;
}

.environment-line b,
.mission-line b,
.model-line b,
.user-line b {
  color: #e2e2e8;
  font-weight: 600;
}

.side-card-title {
  font-size: 12px;
  font-weight: 700;
  color: #f1f1f4;
  margin-bottom: 4px;
}

.side-card-copy {
  font-size: 11px;
  line-height: 1.45;
  color: #83838d;
}

.model-actions-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid #1c1c22;
}

.model-btn {
  background: #141419;
  border: 1px solid #2b2b35;
  border-radius: 6px;
  color: #dedee6;
  padding: 7px;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.model-btn:hover {
  background: #1c1c24;
  border-color: #3e3e4c;
  color: #fff;
}

.model-btn.primary {
  background: #131929;
  border-color: #263354;
  color: #93b4ff;
}

.model-btn.primary:hover {
  background: #1a233b;
  border-color: #3a4e80;
}

.model-msg {
  font-size: 10px;
  margin-top: 6px;
  text-align: center;
  color: #7b7b86;
}

.text-green {
  color: var(--green);
}

/* MODAL / AUTH DIALOG */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  z-index: 1000;
  padding: 16px;
}

.modal-backdrop.hidden {
  display: none;
}

.modal-dialog {
  background: #0f0f13;
  border: 1px solid #2c2c36;
  border-radius: 14px;
  width: 100%;
  max-width: 440px;
  padding: 24px;
  position: relative;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.8);
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: transparent;
  border: none;
  color: #777;
  font-size: 16px;
  padding: 4px;
}

.modal-close:hover {
  color: #fff;
}

.modal-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

.modal-title {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: #f4f4f5;
}

.auth-view h3 {
  font-size: 16px;
  margin: 0 0 6px;
  font-weight: 700;
}

.auth-desc {
  font-size: 12px;
  color: #8b8b95;
  margin: 0 0 16px;
  line-height: 1.5;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.field label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #83838d;
}

.field input {
  background: #070709;
  border: 1px solid #24242d;
  border-radius: 7px;
  padding: 8px 10px;
  color: #fff;
  font-size: 12px;
  outline: none;
  transition: border-color 0.2s ease;
}

.field input:focus {
  border-color: #444455;
}

.code-input {
  letter-spacing: 0.2em;
  font-family: ui-monospace, monospace;
  font-weight: 700;
  font-size: 15px !important;
  text-align: center;
}

.turnstile-container {
  min-height: 65px;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #09090c;
  border: 1px solid #202028;
  border-radius: 8px;
  padding: 6px;
  overflow: hidden;
}

.auth-submit-btn {
  background: #f4f4f5;
  color: #070707;
  border: none;
  border-radius: 7px;
  padding: 9px;
  font-size: 12px;
  font-weight: 800;
  margin-top: 4px;
  transition: all 0.2s ease;
}

.auth-submit-btn:hover {
  background: #ffffff;
}

.verify-btn-row {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.verify-btn-row .auth-submit-btn {
  flex: 2;
  margin-top: 0;
}

.verify-btn-row .ghost-btn {
  flex: 1;
}

.auth-feedback {
  font-size: 11px;
  line-height: 1.4;
  margin-top: 4px;
}

.auth-feedback.error {
  color: var(--red);
}

.auth-feedback.success {
  color: var(--green);
}

.auth-feedback.notice {
  color: var(--yellow);
}

.user-session-card {
  background: #141419;
  border: 1px solid #282832;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 14px;
}

/* VIEW MANAGEMENT */
.view-panel {
  display: block;
}

.view-panel.hidden,
.hidden {
  display: none !important;
}

/* TOPBAR NAVIGATION */
.brand-link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}

.topbar-nav {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-link {
  color: #9d9da6;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: color 0.15s ease;
}

.nav-link:hover {
  color: #fff;
}

.ghost-btn.highlight {
  background: #f4f4f5;
  color: #070707;
  border-color: transparent;
  font-weight: 700;
}

.ghost-btn.highlight:hover {
  background: #fff;
  color: #000;
}

/* PRIMARY BUTTON */
.primary-btn {
  background: #f4f4f5;
  color: #070707;
  border: none;
  border-radius: 8px;
  padding: 8px 18px;
  font-size: 12px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.primary-btn:hover:not(:disabled) {
  background: #ffffff;
  transform: translateY(-1px);
}

.primary-btn.big-btn,
.ghost-btn.big-btn {
  padding: 12px 26px;
  font-size: 14px;
  border-radius: 10px;
}

/* ========================================================================= */
/* PUBLIC LANDING PAGE STYLES (#home)                                        */
/* ========================================================================= */
.landing-container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 60px 24px 80px;
  display: flex;
  flex-direction: column;
  gap: 64px;
}

.landing-hero {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.landing-headline {
  font-size: 56px;
  line-height: 1.05;
  font-weight: 900;
  margin: 0;
  letter-spacing: -0.03em;
}

.text-gradient {
  background: linear-gradient(180deg, #ffffff 30%, #777782 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.landing-subhead {
  font-size: 16px;
  line-height: 1.6;
  color: #92929e;
  max-width: 680px;
  margin: 8px 0 16px;
}

.landing-cta-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 8px;
}

.landing-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #27272e;
  background: #0f0f13;
  color: #92929c;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 11px;
  margin-top: 16px;
}

.center {
  text-align: center;
}

.center-title {
  text-align: center;
  font-size: 28px;
  font-weight: 800;
  margin: 4px 0 24px;
}

/* CATEGORIES SHOWCASE */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 14px;
}

.category-card {
  background: #0c0c0f;
  border: 1px solid #1f1f26;
  border-radius: 12px;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all 0.2s ease;
}

.category-card:hover {
  background: #111116;
  border-color: #333340;
  transform: translateY(-2px);
}

.category-icon {
  font-size: 24px;
  color: #8dbbff;
  margin-bottom: 4px;
}

.category-card h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: #f4f4f5;
}

.category-card p {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: #82828e;
  flex: 1;
}

.category-tag {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #74f29b;
  background: rgba(116, 242, 155, 0.08);
  border: 1px solid rgba(116, 242, 155, 0.2);
  border-radius: 6px;
  padding: 4px 8px;
  width: fit-content;
  margin-top: 8px;
}

/* LOOP SECTION */
.loop-cards-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.loop-card {
  background: #0a0a0d;
  border: 1px solid #1c1c22;
  border-radius: 10px;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.loop-num {
  font-size: 12px;
  font-weight: 800;
  color: var(--blue);
}

.loop-card h4 {
  margin: 0;
  font-size: 14px;
  color: #f1f1f5;
}

.loop-card p {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  color: #7a7a85;
}

/* BOTTOM CTA */
.landing-bottom-cta {
  background: linear-gradient(180deg, #121217, #0c0c0f);
  border: 1px solid #292933;
  border-radius: 16px;
  padding: 36px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.landing-bottom-cta h3 {
  margin: 0 0 6px;
  font-size: 20px;
  font-weight: 800;
}

.landing-bottom-cta p {
  margin: 0;
  font-size: 13px;
  color: #8b8b96;
}

/* ========================================================================= */
/* AUTHENTICATION VIEW (#register, #login, #verify)                          */
/* ========================================================================= */
.auth-page-container {
  min-height: calc(100vh - 64px);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 40px 20px;
}

.auth-card {
  background: #0e0e12;
  border: 1px solid #282832;
  border-radius: 16px;
  max-width: 440px;
  width: 100%;
  padding: 32px 28px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7);
}

.auth-header {
  margin-bottom: 20px;
}

.auth-header h2 {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 800;
  color: #fff;
}

.auth-header p {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: #8b8b95;
}

.auth-btn {
  width: 100%;
  justify-content: center;
  padding: 10px;
  margin-top: 6px;
}

.auth-switch {
  text-align: center;
  font-size: 12px;
  color: #787882;
  margin-top: 20px;
}

.auth-switch a {
  color: #f4f4f5;
  text-decoration: underline;
  font-weight: 600;
}

.flex-2 {
  flex: 2;
}

.flex-1 {
  flex: 1;
}

.full-width {
  width: 100%;
  justify-content: center;
}

/* ========================================================================= */
/* AUTHENTICATED DASHBOARD STYLES (#dashboard)                               */
/* ========================================================================= */
.dashboard-shell {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr) 280px;
  min-height: calc(100vh - 64px);
}

.dashboard-main {
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  overflow-y: auto;
}

.dashboard-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.workspace-title-group h2 {
  margin: 2px 0 0;
  font-size: 20px;
  font-weight: 800;
}

.workspace-status-chips {
  display: flex;
  align-items: center;
  gap: 8px;
}

.effort-indicator-chip {
  font-size: 10px;
  font-weight: 700;
  color: #8dbbff;
  background: rgba(141, 187, 255, 0.08);
  border: 1px solid rgba(141, 187, 255, 0.2);
  border-radius: 999px;
  padding: 3px 10px;
}

/* SPLIT WORKSPACE: BUILDER + INTEGRATED LIVE PREVIEW */
.dashboard-split-workspace {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  min-height: 440px;
}

.dashboard-agent-column {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #09090c;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.dashboard-preview-column {
  display: flex;
  flex-direction: column;
}

.dashboard-preview-column .preview-shell {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.dashboard-preview-column .preview-frame-wrap {
  flex: 1;
  min-height: 380px;
}

@media (max-width: 1200px) {
  .dashboard-split-workspace {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 992px) {
  .dashboard-shell {
    grid-template-columns: 200px minmax(0, 1fr);
  }
  .dashboard-shell .right-sidebar {
    display: none;
  }
}

@media (max-width: 768px) {
  .dashboard-shell {
    grid-template-columns: 1fr;
  }
  .dashboard-shell .left-sidebar {
    display: none;
  }
  .landing-headline {
    font-size: 38px;
  }
  .landing-bottom-cta {
    flex-direction: column;
    text-align: center;
  }
}


.toast {
  pointer-events: auto;
  background: #121217;
  border: 1px solid #2e2e38;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 12px;
  color: #ededf2;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  gap: 8px;
  animation: toastIn 0.2s ease;
}

.toast.success {
  border-color: rgba(116, 242, 155, 0.4);
}

.toast.error {
  border-color: rgba(255, 125, 125, 0.4);
}

@keyframes toastIn {
  from {
    transform: translateY(10px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* RESPONSIVE BREAKPOINTS */
@media (max-width: 1080px) {
  .workspace {
    grid-template-columns: 200px minmax(0, 1fr);
  }
  .right-sidebar {
    display: none;
  }
}

@media (max-width: 768px) {
  .workspace {
    grid-template-columns: 1fr;
  }
  .left-sidebar {
    display: none;
  }
  .main-canvas {
    padding: 16px;
  }
  .agent-layout {
    grid-template-columns: 1fr;
  }
  .chat-panel {
    border-right: none;
    border-bottom: 1px solid var(--line);
  }
}
