:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f4f6f8;
  color: #18212f;
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-2: #f9fafb;
  --line: #d9e0e8;
  --line-strong: #b8c2cf;
  --text: #18212f;
  --muted: #647084;
  --accent: #0f766e;
  --accent-strong: #0b5d57;
  --blue: #2563eb;
  --amber: #b45309;
  --danger: #b42318;
  --shadow: 0 16px 36px rgba(25, 38, 56, 0.08);
}

body:has(.landing-page) {
  overflow: auto;
  background: #f4f7f5;
}

.landing-page {
  --landing-ink: #10201d;
  --landing-muted: #60716d;
  --landing-line: #dbe5e1;
  --landing-green: #1e8b72;
  --landing-lime: #d8f56c;
  min-height: 100vh;
  color: var(--landing-ink);
  background: #f4f7f5;
}

.landing-nav,
.landing-hero,
.landing-section,
.landing-trust-strip,
.landing-cta,
.landing-footer {
  width: min(1160px, calc(100% - 48px));
  margin-inline: auto;
}

.landing-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
  gap: 24px;
}

.landing-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--landing-ink);
  text-decoration: none;
}

.landing-brand img { width: 30px; height: 30px; border-radius: 7px; }
.landing-brand span { font-size: 17px; font-weight: 800; letter-spacing: .01em; }
.landing-brand small { border-left: 1px solid #c8d5d1; padding-left: 10px; color: var(--landing-muted); font-size: 11px; }
.landing-nav-links { display: flex; gap: 28px; margin-left: auto; margin-right: 14px; }
.landing-nav-links a { color: var(--landing-muted); font-size: 13px; text-decoration: none; }
.landing-nav-links a:hover { color: var(--landing-ink); }
.landing-nav-login { border: 1px solid #b7c8c2; border-radius: 5px; padding: 9px 14px; color: var(--landing-ink); font-size: 13px; font-weight: 700; text-decoration: none; }
.landing-nav-login:hover { border-color: var(--landing-green); background: #e7f2ed; }

.landing-hero {
  display: grid;
  grid-template-columns: minmax(0, .88fr) minmax(420px, 1.12fr);
  align-items: center;
  gap: 68px;
  min-height: 650px;
  padding-block: 76px 94px;
}

.landing-kicker { display: inline-block; color: var(--landing-green); font-size: 11px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.landing-hero h1 { max-width: 610px; margin: 18px 0 0; color: var(--landing-ink); font-size: 64px; line-height: 1.05; letter-spacing: -.045em; }
.landing-hero-copy > p { max-width: 540px; margin: 26px 0 0; color: var(--landing-muted); font-size: 18px; line-height: 1.8; }
.landing-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 34px; }
.landing-button { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 45px; border-radius: 5px; padding: 0 18px; font-size: 13px; font-weight: 800; text-decoration: none; }
.landing-button-primary { background: var(--landing-ink); color: #fff; }
.landing-button-primary:hover { background: #1d3630; }
.landing-button-secondary { border: 1px solid #bdcbc6; color: var(--landing-ink); }
.landing-button-secondary:hover { border-color: var(--landing-green); background: #e7f2ed; }
.landing-proof-row { display: flex; flex-wrap: wrap; gap: 13px 20px; margin-top: 25px; color: #70817d; font-size: 11px; }
.landing-proof-row span { display: inline-flex; align-items: center; gap: 7px; }
.landing-proof-row span::before { width: 5px; height: 5px; border-radius: 50%; background: var(--landing-green); content: ""; }

.landing-hero-visual { position: relative; padding: 22px 0 44px; }
.landing-release-art { display: block; width: 100%; height: auto; border: 1px solid #273b36; border-radius: 9px; box-shadow: 0 24px 55px rgba(16, 32, 29, .2); }
.landing-window { position: relative; z-index: 1; overflow: hidden; border: 1px solid #273b36; border-radius: 9px; background: #11221f; box-shadow: 0 24px 55px rgba(16, 32, 29, .2); }
.landing-window-bar { display: flex; align-items: center; gap: 6px; min-height: 42px; padding: 0 14px; border-bottom: 1px solid #29413b; color: #86a098; font-size: 10px; }
.landing-window-bar > span { width: 7px; height: 7px; border-radius: 50%; background: #779087; opacity: .8; }
.landing-window-bar code { margin-left: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.landing-window-bar b { margin-left: auto; border: 1px solid #397264; border-radius: 3px; padding: 4px 7px; color: #a2dfc5; font-size: 9px; font-weight: 700; text-transform: uppercase; }
.landing-window-body { display: grid; grid-template-columns: .82fr 1.18fr; gap: 20px; padding: 26px; }
.landing-chat { min-width: 0; padding-top: 8px; }
.landing-mini-label { display: block; color: #77c9aa; font-size: 9px; font-weight: 800; letter-spacing: .15em; }
.landing-chat p { margin: 12px 0 24px; color: #eff7f2; font-size: 16px; line-height: 1.55; }
.landing-plan-line { display: flex; align-items: center; gap: 9px; margin-top: 12px; color: #9ab1aa; font-size: 11px; }
.landing-plan-line i { display: inline-flex; align-items: center; justify-content: center; width: 17px; height: 17px; border-radius: 50%; background: #21483e; color: #9be8c2; font-size: 10px; font-style: normal; }
.landing-plan-line i.is-waiting { color: #d7ef82; }
.landing-site-preview { overflow: hidden; min-height: 272px; border: 1px solid #cddbd4; border-radius: 6px; background: #f5f7f4; color: #152522; }
.preview-site-top { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid #d7e2dc; padding: 13px 15px; font-size: 9px; font-weight: 800; }
.preview-site-top small { color: #79908a; font-size: 8px; font-weight: 600; }
.preview-site-copy { display: grid; min-height: 210px; align-content: center; gap: 13px; padding: 22px; background: #eaf2e8; }
.preview-site-copy small { color: #5e776d; font-size: 9px; }
.preview-site-copy strong { max-width: 220px; font-size: 25px; line-height: 1.12; letter-spacing: -.04em; }
.preview-site-copy span { width: 74px; height: 8px; border-radius: 2px; background: #153e35; }
.preview-site-footer { display: flex; gap: 10px; border-top: 1px solid #d7e2dc; padding: 10px 13px; color: #758a83; font-size: 8px; }
.preview-site-footer b { color: #1a896e; }
.landing-trust-strip { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--landing-line); border-bottom: 1px solid var(--landing-line); }
.landing-trust-strip > div { display: grid; gap: 7px; padding: 25px 27px; border-right: 1px solid var(--landing-line); }
.landing-trust-strip > div:last-child { border-right: 0; }
.landing-trust-strip strong { color: var(--landing-ink); font-size: 13px; }
.landing-trust-strip span { color: var(--landing-muted); font-size: 12px; line-height: 1.5; }
.landing-section { padding-block: 112px; }
.landing-section-heading { max-width: 630px; }
.landing-section h2, .landing-security-copy h2, .landing-cta h2 { margin: 16px 0 0; color: var(--landing-ink); font-size: 46px; line-height: 1.1; letter-spacing: -.04em; }
.landing-section-heading p, .landing-security-copy p, .landing-cta p { max-width: 560px; margin: 18px 0 0; color: var(--landing-muted); font-size: 16px; line-height: 1.75; }
.landing-step-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 53px; }
.landing-step-grid article { min-height: 285px; border-top: 2px solid #b8cec5; padding: 22px 22px 28px 0; }
.landing-step-grid article b { color: var(--landing-green); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.landing-step-grid h3 { margin: 45px 0 0; color: var(--landing-ink); font-size: 21px; letter-spacing: -.02em; }
.landing-step-grid p { margin: 12px 0 0; color: var(--landing-muted); font-size: 14px; line-height: 1.7; }
.landing-step-tag { display: inline-block; margin-top: 23px; border: 1px solid #c8d9d2; border-radius: 3px; padding: 5px 7px; color: #527369; font-size: 10px; font-weight: 700; }
.landing-security-section { display: grid; grid-template-columns: .75fr 1.25fr; gap: 70px; border-top: 1px solid var(--landing-line); }
.landing-security-copy > a { display: inline-flex; gap: 10px; margin-top: 29px; color: var(--landing-green); font-size: 13px; font-weight: 800; text-decoration: none; }
.landing-security-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.landing-security-grid > div { display: grid; align-content: start; min-height: 148px; border: 1px solid var(--landing-line); border-radius: 6px; background: #fff; padding: 22px; }
.landing-security-grid strong { color: var(--landing-ink); font-size: 15px; }
.landing-security-grid span { margin-top: 12px; color: var(--landing-muted); font-size: 13px; line-height: 1.65; }
.landing-cta { display: flex; align-items: center; justify-content: space-between; gap: 34px; border-top: 1px solid var(--landing-line); padding-block: 79px; }
.landing-cta h2 { font-size: 40px; }
.landing-cta p { margin-top: 11px; }
.landing-footer { display: flex; justify-content: space-between; gap: 18px; border-top: 1px solid var(--landing-line); padding-block: 24px 30px; color: #788a84; font-size: 11px; }
.landing-footer a { color: var(--landing-green); font-weight: 700; text-decoration: none; }

@media (max-width: 900px) {
  .landing-hero { grid-template-columns: 1fr; gap: 35px; padding-block: 55px 75px; }
  .landing-hero-visual { max-width: 680px; }
  .landing-security-section { grid-template-columns: 1fr; gap: 38px; }
  .landing-hero h1 { font-size: 54px; }
  .landing-section h2, .landing-security-copy h2 { font-size: 40px; }
}

@media (max-width: 640px) {
  .landing-nav, .landing-hero, .landing-section, .landing-trust-strip, .landing-cta, .landing-footer { width: min(100% - 32px, 1160px); }
  .landing-nav { min-height: 67px; }
  .landing-brand small, .landing-nav-links { display: none; }
  .landing-nav-login { padding: 8px 11px; font-size: 11px; }
  .landing-hero { min-height: 0; padding-block: 43px 60px; }
  .landing-hero h1 { font-size: 42px; }
  .landing-hero-copy > p { font-size: 16px; line-height: 1.7; }
  .landing-window-body { grid-template-columns: 1fr; padding: 19px; }
  .landing-chat { padding-top: 0; }
  .landing-chat p { margin-bottom: 18px; font-size: 14px; }
  .landing-site-preview { min-height: 244px; }
  .landing-status-card { right: 7px; bottom: -3px; min-width: 200px; }
  .landing-trust-strip, .landing-step-grid { grid-template-columns: 1fr; }
  .landing-trust-strip > div { border-right: 0; border-bottom: 1px solid var(--landing-line); padding: 18px 0; }
  .landing-trust-strip > div:last-child { border-bottom: 0; }
  .landing-section { padding-block: 75px; }
  .landing-step-grid { gap: 12px; margin-top: 35px; }
  .landing-step-grid article { min-height: 0; padding: 19px 0 25px; }
  .landing-step-grid h3 { margin-top: 24px; }
  .landing-security-grid { grid-template-columns: 1fr; }
  .landing-cta { align-items: flex-start; flex-direction: column; padding-block: 58px; }
  .landing-cta h2 { font-size: 34px; }
  .landing-footer { align-items: flex-start; flex-direction: column; padding-bottom: 24px; }
}

html,
body {
  width: 100%;
  max-width: 100%;
}

* {
  box-sizing: border-box;
  min-width: 0;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  overflow: hidden;
}

button,
textarea,
input {
  font: inherit;
}

[hidden] {
  display: none !important;
}

button {
  white-space: nowrap;
}

.app-shell {
  display: grid;
  grid-template-columns: 292px minmax(0, 1fr);
  width: 100%;
  max-width: 100vw;
  height: 100vh;
  min-height: 100vh;
  overflow: hidden;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: 100vh;
  overflow: auto;
  border-right: 1px solid var(--line);
  background: var(--surface);
  padding: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 42px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  display: block;
  object-fit: cover;
}

.brand strong,
.brand span {
  display: block;
}

.brand span,
.eyebrow,
.section-heading,
.metric-item span,
.field-label {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0;
}

.host-link {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  color: var(--muted);
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.host-link:hover {
  color: var(--accent);
  text-decoration: underline;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 32px;
  font-weight: 700;
  text-transform: uppercase;
}

.sidebar-section {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.advanced-section,
.advanced-action {
  display: none;
}

.project-list,
.template-list {
  display: grid;
  gap: 8px;
}

.project-item,
.template-item {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 10px;
  text-align: left;
}

.project-item {
  cursor: pointer;
}

.project-item:hover,
.project-item.active {
  border-color: #8bc0bd;
  background: #f0faf9;
}

.project-item strong,
.template-item strong {
  display: block;
  overflow: hidden;
  color: var(--text);
  text-overflow: ellipsis;
}

.project-item span,
.template-item span {
  display: block;
  overflow: hidden;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
}

.workspace {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  min-width: 0;
  min-height: 100vh;
  overflow: auto;
  padding: 18px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 58px;
}

.title-block {
  min-width: 0;
}

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

.project-title-row h1 {
  min-width: 0;
}

.title-action {
  flex: 0 0 auto;
  width: 32px;
  min-height: 32px;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  overflow: hidden;
  font-size: 25px;
  line-height: 1.2;
  text-overflow: ellipsis;
}

h2 {
  font-size: 20px;
}

.topbar-actions,
.chat-actions,
.dialog-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-actions {
  justify-content: flex-end;
}

.metric-strip {
  display: none;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  min-width: 0;
  order: 3;
  margin: 12px 0 14px;
}

.metric-item {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 11px 12px;
}

.metric-item strong {
  display: block;
  overflow: hidden;
  margin-top: 4px;
  text-overflow: ellipsis;
}

.onboarding-panel {
  display: grid;
  grid-template-columns: minmax(300px, 0.72fr) minmax(520px, 1.28fr);
  gap: 18px;
  order: 2;
  width: 100%;
  max-width: 100%;
  min-height: 360px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 18px;
}

.onboarding-copy {
  display: grid;
  align-content: center;
  gap: 10px;
  min-width: 0;
}

.onboarding-copy h2 {
  font-size: 32px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.onboarding-copy p {
  max-width: 48ch;
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.preset-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-content: stretch;
}

.preset-card {
  display: grid;
  grid-template-rows: 128px auto auto auto;
  gap: 9px;
  min-height: 260px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  color: var(--text);
  cursor: pointer;
  padding: 14px;
  text-align: left;
  white-space: normal;
}

.preset-card img {
  width: 100%;
  height: 128px;
  border-radius: 6px;
  object-fit: cover;
}

.preset-card:hover {
  border-color: #86bcb8;
  background: #f0faf9;
  transform: translateY(-1px);
}

.preset-card.primary-preset {
  border-color: #8bc0bd;
  background: #f3fbfa;
}

.preset-card.locked-preset {
  cursor: pointer;
}

.preset-card.locked-preset img,
.preset-card.locked-preset strong {
  opacity: 0.72;
}

.preset-card span {
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
}

.preset-card strong {
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.preset-card small {
  align-self: end;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.workbench-grid {
  display: grid;
  grid-template-columns: minmax(360px, 0.92fr) minmax(460px, 1.36fr);
  grid-template-rows: minmax(540px, calc(100vh - 126px));
  gap: 14px;
  order: 4;
  min-height: 0;
}

.details,
.audit {
  display: none;
}

.conversation,
.preview-workspace,
.details,
.audit {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.conversation {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-height: 440px;
}

.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  min-height: 58px;
  border-bottom: 1px solid var(--line);
  padding: 12px;
}

.panel-title strong {
  display: block;
}

.panel-title > div {
  min-width: 0;
}

.conversation-tools {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.conversation-tools select {
  width: min(190px, 28vw);
  min-height: 36px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  padding: 0 8px;
}

.messages {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 0;
  overflow: auto;
  padding: 12px;
}

.message {
  max-width: 92%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  padding: 11px 12px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.message-content {
  white-space: pre-wrap;
}

.message-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
  margin-top: 8px;
}

.message-action {
  min-height: 26px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  cursor: pointer;
  padding: 3px 8px;
  font-size: 12px;
}

.message-action:hover {
  border-color: #8fa0b3;
  color: var(--text);
}

.message.user {
  justify-self: end;
  border-color: #9ac7c3;
  background: #ecfdfb;
}

.message.assistant {
  justify-self: start;
}

.message.system {
  max-width: 100%;
  border-color: #f2d49b;
  background: #fff8eb;
  color: #6b3f08;
}

.message.loading {
  position: relative;
  padding-left: 36px;
}

.message.loading::before {
  position: absolute;
  top: 16px;
  left: 14px;
  width: 12px;
  height: 12px;
  border: 2px solid rgba(107, 63, 8, 0.22);
  border-top-color: #9a5a0a;
  border-radius: 999px;
  content: "";
  animation: spin 0.9s linear infinite;
}

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

.chat-form {
  display: grid;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding: 12px;
}

textarea,
input {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  padding: 10px;
  line-height: 1.5;
  outline: none;
}

textarea {
  resize: vertical;
}

textarea:focus,
input:focus {
  border-color: #74aaa6;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.primary-button,
.secondary-button,
.icon-button,
.guide-button,
.logout-button,
.danger-button {
  min-height: 36px;
  border-radius: 8px;
  cursor: pointer;
}

.primary-button,
.secondary-button,
.danger-button {
  border: 1px solid transparent;
  padding: 8px 12px;
  font-weight: 700;
}

.primary-button {
  background: var(--accent);
  color: #ffffff;
}

.primary-button:hover {
  background: var(--accent-strong);
}

.secondary-button {
  border-color: var(--line-strong);
  background: #ffffff;
  color: var(--text);
}

.secondary-button:hover {
  border-color: #8fa0b3;
  background: #f8fafc;
}

.icon-button {
  display: grid;
  width: 36px;
  place-items: center;
  border: 1px solid var(--line-strong);
  background: #ffffff;
  color: var(--text);
  font-weight: 800;
}

.icon-button:disabled {
  border-color: var(--line);
  background: #f8fafc;
  color: #a0aaba;
  cursor: not-allowed;
}

.guide-button {
  border: 1px solid #99d2ca;
  background: #e9fbf8;
  box-shadow: 0 8px 18px rgba(15, 118, 110, 0.12);
  color: #0b5d57;
  padding: 7px 12px;
  font-weight: 800;
}

.guide-button:hover {
  border-color: #62bdb1;
  background: #d8f7f1;
}

.guide-button:focus-visible {
  outline: 3px solid rgba(15, 118, 110, 0.18);
  outline-offset: 2px;
}

.logout-button {
  border: 1px solid #d7dee8;
  background: #ffffff;
  color: #4f5d73;
  padding: 7px 12px;
  font-weight: 800;
}

.logout-button:hover {
  border-color: #b7c2d0;
  background: #f7fafc;
  color: #172033;
}

.danger-button {
  border-color: #f0b7af;
  background: #fff3f2;
  color: var(--danger);
}

.danger-button:hover {
  border-color: #d4746b;
  background: #ffe8e5;
}

.danger-button:disabled {
  border-color: var(--line);
  background: #f8fafc;
  color: #a0aaba;
  cursor: not-allowed;
}

.full-width {
  width: 100%;
}

.sidebar-note {
  margin: 8px 2px 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.status-badge,
.identity-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid #94bdb9;
  border-radius: 999px;
  background: #ecfdfb;
  color: #0f5f59;
  padding: 4px 10px;
  font-size: 13px;
  font-weight: 700;
}

.status-badge.muted {
  border-color: var(--line);
  background: #ffffff;
  color: var(--muted);
}

.identity-pill {
  border-color: #b8d6d2;
  background: #f0fbf8;
  color: #0f5f59;
}

.identity-pill.muted {
  border-color: var(--line);
  background: #ffffff;
  color: var(--muted);
}

.status-badge.warn {
  border-color: #f1c06d;
  background: #fff8eb;
  color: var(--amber);
}

.status-badge.danger {
  border-color: #f3b6af;
  background: #fff1f0;
  color: var(--danger);
}

.preview-workspace {
  display: grid;
  grid-template-rows: 48px minmax(0, 1fr);
  min-height: 440px;
  overflow: hidden;
}

.browser-bar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfd;
  padding: 8px 10px;
}

.browser-dots {
  display: flex;
  gap: 6px;
  padding: 0 4px;
}

.browser-dots span {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #c5ceda;
}

.browser-dots span:nth-child(1) {
  background: #ef7d72;
}

.browser-dots span:nth-child(2) {
  background: #e7bc4f;
}

.browser-dots span:nth-child(3) {
  background: #67b384;
}

.address-bar {
  overflow: hidden;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--muted);
  padding: 6px 10px;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-empty {
  display: grid;
  place-items: center;
  color: var(--muted);
}

iframe {
  width: 100%;
  height: 100%;
  min-height: 360px;
  border: 0;
  background: #ffffff;
}

.preview-workspace.empty iframe {
  display: none;
}

.preview-workspace:not(.empty) .preview-empty {
  display: none;
}

.details,
.audit {
  overflow: hidden;
}

.details-grid,
.audit-log {
  display: grid;
  gap: 8px;
  max-height: 178px;
  overflow: auto;
  padding: 12px;
}

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

.detail-item,
.audit-item {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  padding: 10px;
}

.detail-item strong,
.audit-item strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

.detail-item a {
  color: var(--accent);
}

.detail-item span,
.audit-item span {
  display: block;
  overflow: hidden;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
}

.audit-detail {
  white-space: nowrap;
}

.empty-state {
  color: var(--muted);
  padding: 8px;
}

.dialog {
  width: min(480px, calc(100vw - 28px));
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 28px 80px rgba(16, 24, 40, 0.22);
}

.dialog::backdrop {
  background: rgba(17, 24, 39, 0.42);
}

.dialog-body {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.dialog label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.dialog-note {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.confirm-name {
  overflow: hidden;
  border: 1px solid #f0b7af;
  border-radius: 8px;
  background: #fff7f6;
  color: var(--danger);
  padding: 10px 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dialog-actions {
  justify-content: flex-end;
}

.toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 20;
  max-width: min(420px, calc(100vw - 32px));
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
  color: var(--text);
  opacity: 0;
  padding: 11px 12px;
  transform: translateY(12px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast.error {
  border-color: #f3b6af;
  color: var(--danger);
}

.tour-layer {
  position: fixed;
  inset: 0;
  z-index: 30;
  pointer-events: none;
}

.tour-layer::before {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.16);
  content: "";
}

.tour-highlight {
  position: fixed;
  z-index: 31;
  border: 2px solid #0f766e;
  border-radius: 10px;
  box-shadow:
    0 0 0 9999px rgba(15, 23, 42, 0.18),
    0 0 0 6px rgba(15, 118, 110, 0.12);
  transition: inset 0.18s ease, width 0.18s ease, height 0.18s ease;
}

.tour-highlight::after {
  position: absolute;
  inset: -8px;
  border: 2px solid rgba(20, 184, 166, 0.38);
  border-radius: 14px;
  animation: tourPulse 1.8s ease-out infinite;
  content: "";
}

.tour-pointer {
  position: fixed;
  z-index: 32;
  width: 18px;
  height: 18px;
  background: #0f766e;
  box-shadow: 0 10px 22px rgba(15, 118, 110, 0.22);
  transform: rotate(45deg);
  transition: top 0.18s ease, left 0.18s ease;
}

.tour-pointer::after {
  position: absolute;
  inset: 5px;
  border-radius: 999px;
  background: #d8f7f1;
  content: "";
}

.tour-pointer.top {
  animation: tourNudgeDown 1.25s ease-in-out infinite;
}

.tour-pointer.bottom {
  animation: tourNudgeUp 1.25s ease-in-out infinite;
}

.tour-pointer.left {
  animation: tourNudgeRight 1.25s ease-in-out infinite;
}

.tour-pointer.right {
  animation: tourNudgeLeft 1.25s ease-in-out infinite;
}

.tour-card {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 32;
  display: grid;
  gap: 12px;
  width: min(390px, calc(100vw - 36px));
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 24px 70px rgba(16, 24, 40, 0.2);
  padding: 14px;
  pointer-events: auto;
}

.tour-kicker,
.tour-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.tour-kicker span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.tour-card h2 {
  font-size: 19px;
  line-height: 1.25;
}

.tour-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.tour-actions {
  justify-content: flex-end;
}

@keyframes tourPulse {
  from {
    opacity: 0.7;
    transform: scale(0.98);
  }

  to {
    opacity: 0;
    transform: scale(1.05);
  }
}

@keyframes tourNudgeDown {
  0%,
  100% {
    transform: translateY(0) rotate(45deg);
  }

  50% {
    transform: translateY(5px) rotate(45deg);
  }
}

@keyframes tourNudgeUp {
  0%,
  100% {
    transform: translateY(0) rotate(45deg);
  }

  50% {
    transform: translateY(-5px) rotate(45deg);
  }
}

@keyframes tourNudgeRight {
  0%,
  100% {
    transform: translateX(0) rotate(45deg);
  }

  50% {
    transform: translateX(5px) rotate(45deg);
  }
}

@keyframes tourNudgeLeft {
  0%,
  100% {
    transform: translateX(0) rotate(45deg);
  }

  50% {
    transform: translateX(-5px) rotate(45deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .tour-highlight,
  .tour-highlight::after,
  .tour-pointer {
    animation: none;
    transition: none;
  }
}

@media (max-width: 1120px) {
  .app-shell {
    grid-template-columns: 260px minmax(0, 1fr);
  }

  .workbench-grid {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(420px, auto) minmax(420px, 60vh);
  }

  .onboarding-panel {
    grid-template-columns: 1fr;
  }

  .details-grid,
  .audit-log {
    max-height: none;
  }
}

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

  .app-shell {
    grid-template-columns: 1fr;
    height: auto;
    overflow: visible;
  }

  .sidebar {
    min-height: auto;
    max-height: 360px;
    overflow: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .workspace {
    min-height: auto;
    overflow: visible;
    width: 100%;
    max-width: 100vw;
    padding: 12px;
  }

  .workbench-grid,
  .conversation,
  .preview-workspace,
  .details,
  .audit {
    width: 100%;
    max-width: calc(100vw - 24px);
  }

  .panel-title {
    flex-wrap: wrap;
  }

  .conversation-tools,
  .conversation-tools select {
    width: 100%;
  }

  .topbar,
  .topbar-actions,
  .chat-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .metric-strip,
  .details-grid {
    grid-template-columns: 1fr;
  }

  .metric-strip {
    width: 100%;
    max-width: calc(100vw - 24px);
  }

  .onboarding-panel {
    max-width: calc(100vw - 24px);
  }

  .preset-grid {
    grid-template-columns: 1fr;
  }

  .preset-card {
    grid-template-columns: 118px minmax(0, 1fr);
    grid-template-rows: auto auto auto;
    min-height: 136px;
  }

  .preset-card img {
    grid-row: 1 / 4;
    height: 112px;
  }

  .panel-title .secondary-button {
    width: 100%;
  }

  .chat-actions button,
  .topbar-actions span {
    width: 100%;
    justify-content: center;
  }

  .topbar-actions .icon-button,
  .topbar-actions .guide-button,
  .topbar-actions .logout-button,
  .topbar-actions .danger-button {
    width: 100%;
  }

  .tour-card {
    right: 12px;
    bottom: 12px;
    width: calc(100vw - 24px);
  }

  .tour-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .tour-actions button {
    width: 100%;
  }
}
