:root {
  color: #17172b;
  background: #f1f0f5;
  font-family: "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  font-synthesis: none;
  --blue: #5c48e8;
  --blue-strong: #4935d4;
  --blue-soft: #f1efff;
  --green: #269d68;
  --green-soft: #ecf8f1;
  --red: #dc4252;
  --red-soft: #fff0f2;
  --amber: #c87815;
  --amber-soft: #fff6e8;
  --ink: #17172b;
  --muted: #7c8295;
  --line: #e7e7ef;
  --surface: #ffffff;
  --canvas: #fbfbfd;
  --shadow: 0 12px 34px rgba(30, 27, 73, 0.07);
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #f1f0f5;
}

button, textarea, input { font: inherit; }
button { color: inherit; }
button, label { -webkit-tap-highlight-color: transparent; }
button:focus-visible, textarea:focus-visible, input:focus-visible, summary:focus-visible {
  outline: 3px solid rgba(33, 103, 237, 0.24);
  outline-offset: 2px;
}
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

[hidden] { display: none !important; }

.icon {
  width: 24px;
  height: 24px;
  display: block;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.app-shell {
  position: relative;
  width: min(100%, 430px);
  height: 100dvh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  background: var(--canvas);
  box-shadow: 0 24px 80px rgba(30, 43, 66, 0.16);
}

.topbar {
  min-height: 82px;
  padding: calc(14px + env(safe-area-inset-top)) 18px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(248, 250, 252, 0.96);
  z-index: 5;
}

.brand { display: flex; align-items: center; min-width: 0; gap: 12px; }
.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 14px;
  background: var(--blue);
  color: #fff;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.04em;
  box-shadow: 0 8px 20px rgba(33, 103, 237, 0.22);
}
.brand-mark.small { width: 34px; height: 34px; border-radius: 11px; font-size: 17px; box-shadow: none; }
.brand-copy { min-width: 0; display: grid; gap: 3px; }
.brand-copy strong { overflow: hidden; font-size: 17px; font-weight: 740; letter-spacing: -0.02em; text-overflow: ellipsis; white-space: nowrap; }
.pc-status, .status-label { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; line-height: 1.2; }
.pc-status i, .status-label i {
  width: 8px;
  height: 8px;
  display: block;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #aab2c0;
}
.pc-status.online, .status-label.online { color: var(--green); }
.pc-status.online i, .status-label.online i { background: var(--green); }
.pc-status.offline, .status-label.offline { color: var(--red); }
.pc-status.offline i, .status-label.offline i { background: var(--red); }

.icon-button {
  position: relative;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(229, 233, 240, 0.8);
  border-radius: 15px;
  background: var(--surface);
  box-shadow: 0 6px 20px rgba(27, 42, 68, 0.06);
  cursor: pointer;
}
.icon-button .icon { width: 23px; height: 23px; }
.notification-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 7px;
  height: 7px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--blue);
}

main { min-height: 0; position: relative; overflow: hidden; }
.page { display: none; height: 100%; min-height: 0; }
.page.active { display: flex; flex-direction: column; }
.content-page { overflow-y: auto; padding: 14px 18px 28px; overscroll-behavior: contain; }

.conversation-scroll {
  min-height: 0;
  flex: 1;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 6px 18px 24px;
  overscroll-behavior: contain;
  scroll-behavior: smooth;
}
.chat-toolbar { padding: 7px 14px 9px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; border-bottom: 1px solid rgba(229, 233, 240, 0.82); background: rgba(248, 250, 252, 0.97); }
.chat-toolbar select { min-width: 0; height: 42px; padding: 0 34px 0 12px; overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); color: var(--ink); font-size: 13px; font-weight: 700; text-overflow: ellipsis; }
.chat-toolbar button { min-height: 42px; padding: 0 13px; border: 1px solid #d7e2f7; border-radius: 13px; background: var(--blue-soft); color: var(--blue); font-size: 12px; font-weight: 750; cursor: pointer; }
.chat-toolbar button span { font-size: 18px; line-height: 0; vertical-align: -1px; }
.chat-toolbar button:disabled, .chat-toolbar select:disabled { opacity: 0.55; cursor: wait; }
.conversation-scroll::-webkit-scrollbar, .detail-scroll::-webkit-scrollbar, .content-page::-webkit-scrollbar { width: 0; height: 0; }

.page-intro { padding: 8px 2px 22px; }
.page-intro .eyebrow {
  display: block;
  margin-bottom: 7px;
  color: #9aa2b1;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}
.page-intro h1 { margin: 0; font-size: 29px; line-height: 1.15; font-weight: 760; letter-spacing: -0.04em; }
.page-intro p { margin: 7px 0 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.tasks-page.has-messages .page-intro { display: none; }

.conversation-list { display: grid; gap: 2px; }
.poll-status { margin: 12px 0 0; padding: 10px 12px; border: 1px solid #f0d9b8; border-radius: 12px; background: var(--amber-soft); color: #815014; font-size: 12px; line-height: 1.45; }
.date-divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 14px;
  margin: 14px 0 18px;
  color: #9ba3b1;
  font-size: 12px;
}
.date-divider::before, .date-divider::after { content: ""; height: 1px; background: var(--line); }

.message { min-width: 0; }
.user-message {
  max-width: 84%;
  justify-self: end;
  margin: 0 0 18px auto;
  padding: 13px 15px 10px;
  border-radius: 22px 22px 7px 22px;
  background: var(--blue);
  color: #fff;
  box-shadow: 0 7px 18px rgba(33, 103, 237, 0.15);
}
.user-message p { margin: 0; overflow-wrap: anywhere; font-size: 14px; line-height: 1.48; white-space: pre-wrap; }
.user-expand { margin: 8px 0 0; padding: 0; border: 0; background: transparent; color: rgba(255, 255, 255, 0.86); font-size: 11px; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.user-message footer { margin-top: 7px; display: flex; align-items: center; justify-content: flex-end; gap: 5px; color: rgba(255, 255, 255, 0.76); font-size: 10px; }
.user-message footer .icon { width: 14px; height: 14px; stroke-width: 2.4; }

.assistant-message { margin: 0 0 18px; padding: 0 0 18px; border-bottom: 1px solid var(--line); }
.assistant-header { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; color: var(--muted); }
.assistant-avatar {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--blue);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
}
.assistant-header strong { margin-right: auto; font-size: 13px; font-weight: 650; color: #687183; }
.assistant-header time { font-size: 11px; }
.answer-summary {
  overflow-wrap: anywhere;
  color: #1e2633;
  font-size: 15px;
  line-height: 1.62;
}
.answer-summary p { margin: 0 0 10px; }
.answer-summary p:last-child { margin-bottom: 0; }
.answer-summary.is-preview { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 6; }
.answer-summary.is-structured { font-size: 14px; line-height: 1.48; }
.summary-intro { color: #313a49; }
.summary-list { display: grid; gap: 10px; margin: 13px 0 0; padding: 0; list-style: none; }
.summary-row {
  min-width: 0;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  color: #4d5665;
}
.summary-row > span:last-child { padding-top: 3px; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.summary-icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: #eaf1ff;
  color: var(--blue);
}
.summary-icon .icon { width: 17px; height: 17px; stroke-width: 2.1; }
.summary-row-2 .summary-icon { background: #e7f8ef; color: #15945f; }
.summary-row-3 .summary-icon { background: #f1edff; color: #7459dd; }

.answer-actions { display: grid; gap: 9px; margin-top: 14px; }
.open-answer {
  width: 100%;
  min-height: 50px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 11px;
  border: 0;
  border-radius: 16px;
  background: var(--blue);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.open-answer .icon:last-child { margin-left: auto; }
.open-answer:active { background: var(--blue-strong); }

.work-details {
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.74);
  overflow: hidden;
}
.work-details summary {
  min-height: 48px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  list-style: none;
  color: #313a49;
  font-size: 13px;
  cursor: pointer;
}
.work-details summary::-webkit-details-marker { display: none; }
.work-details summary .icon { width: 20px; height: 20px; color: var(--blue); }
.work-details summary .chevron { margin-left: auto; color: var(--muted); transition: transform 160ms ease; }
.work-details[open] summary .chevron { transform: rotate(180deg); }
.work-steps { display: grid; gap: 11px; margin: 0; padding: 0 14px 14px 44px; list-style: none; }
.work-steps li { position: relative; color: #687183; font-size: 12px; line-height: 1.45; }
.work-steps li::before { content: ""; position: absolute; left: -17px; top: 0.5em; width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
.work-steps li { display: flex; justify-content: space-between; gap: 12px; }
.work-steps time { flex: 0 0 auto; color: var(--muted); font-size: 10px; }
.work-fallback { margin: 10px 13px 13px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.activity-updated { margin: 8px 13px 13px; color: var(--muted); font-size: 10px; }

.system-message {
  margin: 0 0 16px;
  padding: 12px 14px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border-radius: 14px;
  background: var(--red-soft);
  color: #aa3342;
  font-size: 13px;
  line-height: 1.45;
}
.system-message .icon { width: 20px; height: 20px; }

.execution-panel {
  margin: 2px 0 18px;
  padding: 16px;
  border: 1px solid #d8e5ff;
  border-radius: 18px;
  background: var(--blue-soft);
}
.execution-panel.failed { border-color: #f2d6da; background: var(--red-soft); }
.execution-heading { display: flex; align-items: center; gap: 10px; }
.execution-heading .pulse {
  width: 11px;
  height: 11px;
  border: 3px solid rgba(33, 103, 237, 0.22);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 900ms linear infinite;
}
.execution-panel.failed .pulse { border: 0; background: var(--red); animation: none; }
.execution-heading div { min-width: 0; }
.execution-heading strong { display: block; color: var(--blue-strong); font-size: 14px; }
.execution-panel.failed .execution-heading strong { color: var(--red); }
.execution-heading span { display: block; margin-top: 2px; overflow: hidden; color: #71809a; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.execution-track { height: 3px; margin: 14px 0 12px; overflow: hidden; border-radius: 999px; background: #d7e4fb; }
.execution-track i { display: block; width: 42%; height: 100%; border-radius: inherit; background: var(--blue); animation: progress 2.2s ease-in-out infinite alternate; }
.execution-panel.failed .execution-track { display: none; }
.execution-steps { display: grid; gap: 8px; }
.execution-step { display: flex; align-items: center; gap: 9px; color: #758198; font-size: 12px; }
.execution-step .icon { width: 17px; height: 17px; }
.execution-step.done { color: #3a6f57; }
.execution-step.active { color: #2459b9; font-weight: 650; }
.execution-activity { display: grid; gap: 8px; }
.execution-activity .execution-step span { min-width: 0; margin-right: auto; overflow-wrap: anywhere; }
.execution-activity time { flex: 0 0 auto; color: var(--muted); font-size: 10px; font-weight: 400; }
.execution-activity > small { color: var(--muted); font-size: 10px; }
.execution-warning { margin: 12px 0 0; padding: 10px 11px; border-radius: 11px; background: var(--amber-soft); color: #815014; font-size: 12px; line-height: 1.45; }

.empty-state, .list-state {
  min-height: 220px;
  padding: 30px 22px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  text-align: center;
  color: var(--muted);
}
.empty-state .empty-icon, .list-state .empty-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 17px;
  background: var(--blue-soft);
  color: var(--blue);
}
.empty-state strong, .list-state strong { color: var(--ink); font-size: 17px; }
.empty-state p, .list-state p { max-width: 280px; margin: 0; font-size: 13px; line-height: 1.5; }
.executive-empty { min-height: 360px; }
.task-suggestions {
  width: min(100%, 620px);
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  text-align: left;
}
.task-suggestions button {
  min-width: 0;
  min-height: 82px;
  padding: 14px;
  display: grid;
  align-content: center;
  gap: 5px;
  border: 1px solid #dce5f4;
  border-radius: 16px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 7px 20px rgba(30, 46, 73, 0.04);
  cursor: pointer;
}
.task-suggestions button:hover { border-color: #b7cdf5; background: #f8fbff; }
.task-suggestions button:focus-visible { outline: 3px solid rgba(33, 103, 237, 0.2); outline-offset: 2px; }
.task-suggestions button strong { font-size: 13px; line-height: 1.35; }
.task-suggestions button span { color: var(--blue); font-size: 11px; font-weight: 700; }
.list-state.error .empty-icon { background: var(--red-soft); color: var(--red); }
.retry-button {
  min-height: 42px;
  margin-top: 3px;
  padding: 0 16px;
  border: 0;
  border-radius: 13px;
  background: var(--blue);
  color: #fff;
  font-weight: 700;
}

.composer-dock {
  padding: 10px 14px 9px;
  flex: 0 0 auto;
  border-top: 1px solid rgba(229, 233, 240, 0.82);
  background: rgba(248, 250, 252, 0.97);
  z-index: 4;
}
.composer-field {
  min-height: 58px;
  padding: 5px 6px 5px 7px;
  display: flex;
  align-items: flex-end;
  gap: 4px;
  border: 1px solid #dfe4ec;
  border-radius: 22px;
  background: var(--surface);
  box-shadow: 0 7px 20px rgba(30, 46, 73, 0.06);
}
.composer-icon {
  width: 44px;
  height: 46px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  color: #697386;
  cursor: pointer;
}
.composer-icon:disabled { opacity: 0.42; cursor: not-allowed; }
.voice-input-button {
  border-radius: 15px;
  touch-action: none;
  transition: color 140ms ease, background 140ms ease, transform 140ms ease;
}
.voice-input-button[data-voice-state="starting"],
.voice-input-button[data-voice-state="listening"] {
  background: var(--red-soft);
  color: var(--red);
  transform: scale(1.04);
}
.voice-input-button[data-voice-state="stopping"] { color: var(--amber); }
.voice-input-status {
  margin: 5px 7px 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
}
.composer-dock.voice-input-active .voice-input-status { color: var(--red); font-weight: 700; }
.composer-field textarea, .detail-composer textarea {
  width: 100%;
  max-height: 112px;
  resize: none;
  overflow-y: auto;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.42;
}
.composer-field textarea { min-width: 0; min-height: 46px; padding: 12px 6px 9px; flex: 1 1 auto; }
textarea::placeholder { color: #a4acb9; }
.send-button {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 0;
  border-radius: 16px;
  background: var(--blue);
  color: #fff;
  box-shadow: 0 7px 16px rgba(33, 103, 237, 0.2);
  cursor: pointer;
}
.send-button .icon { width: 22px; height: 22px; }
.send-button:disabled { opacity: 0.55; cursor: not-allowed; }
.send-button.is-loading .icon { animation: spin 900ms linear infinite; }
.composer-meta {
  max-height: 0;
  padding: 0 7px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  overflow: hidden;
  color: #929baa;
  font-size: 9px;
  opacity: 0;
  transition: max-height 160ms ease, padding 160ms ease, opacity 160ms ease;
}
.composer-dock.has-draft .composer-meta { max-height: 26px; padding-top: 6px; opacity: 1; }

.bottom-nav {
  min-height: calc(70px + env(safe-area-inset-bottom));
  padding: 7px 5px calc(6px + env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.97);
  z-index: 6;
}
.bottom-nav button {
  position: relative;
  min-height: 56px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 3px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: #8a93a2;
  font-size: 10px;
  cursor: pointer;
}
.bottom-nav button .icon { width: 21px; height: 21px; }
.bottom-nav button.active { color: var(--blue); font-weight: 700; }
.bottom-nav button i {
  position: absolute;
  top: 5px;
  left: calc(50% + 10px);
  width: 8px;
  height: 8px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--red);
}

.computer-hero {
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 15px;
  border: 1px solid #dfe7f5;
  border-radius: 21px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.computer-hero.offline { border-color: #f1dade; }
.hero-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 18px;
  background: var(--blue-soft);
  color: var(--blue);
}
.hero-icon .icon { width: 30px; height: 30px; }
.computer-hero h2 { margin: 6px 0 3px; font-size: 17px; }
.computer-hero p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.remote-control-panel {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid #dfe5ef;
  border-radius: 21px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.remote-control-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.remote-control-kicker { display: block; margin-bottom: 4px; color: var(--muted); font-size: 10px; font-weight: 750; letter-spacing: 0.1em; text-transform: uppercase; }
.remote-control-header h2 { margin: 0; font-size: 17px; }
.remote-control-badge { padding: 5px 8px; flex: 0 0 auto; border-radius: 999px; background: #eef1f5; color: #687183; font-size: 10px; font-weight: 750; }
.remote-control-panel[data-remote-state="connecting"] .remote-control-badge { background: var(--amber-soft); color: var(--amber); }
.remote-control-panel[data-remote-state="view_only"] .remote-control-badge { background: var(--green-soft); color: #148554; }
.remote-control-panel[data-remote-state="agent_control"] .remote-control-badge { background: var(--blue-soft); color: var(--blue-strong); }
.remote-control-panel[data-remote-state="takeover_pending"] .remote-control-badge,
.remote-control-panel[data-remote-state="return_pending"] .remote-control-badge { background: var(--amber-soft); color: var(--amber); }
.remote-control-panel[data-remote-state="user_takeover"] .remote-control-badge { background: #f1edff; color: #674fc8; }
.remote-control-panel[data-remote-state="disconnected"] .remote-control-badge,
.remote-control-panel[data-remote-state="error"] .remote-control-badge { background: var(--red-soft); color: var(--red); }
.remote-control-panel[data-remote-state="unsafe_unknown"] { border-color: #e6b661; box-shadow: 0 12px 32px rgba(145, 83, 13, 0.12); }
.remote-control-panel[data-remote-state="unsafe_unknown"] .remote-control-badge { background: var(--amber-soft); color: #9b5b0d; }
.remote-emergency-stop {
  width: 100%;
  min-height: 46px;
  margin-top: 13px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid #efc9cf;
  border-radius: 14px;
  background: var(--red-soft);
  color: #b82f40;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}
.remote-emergency-stop .icon { width: 18px; height: 18px; }
.remote-emergency-stop:disabled { opacity: 0.55; cursor: not-allowed; }
.remote-control-panel[data-remote-state="unsafe_unknown"] .remote-emergency-stop:disabled { opacity: 1; border-style: dashed; background: #fff7f8; }
.remote-safety-warning {
  margin-top: 12px;
  padding: 13px 14px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid #e8ba6b;
  border-radius: 14px;
  background: var(--amber-soft);
  color: #75450d;
}
.remote-safety-warning > .icon { width: 20px; height: 20px; flex: 0 0 auto; color: #b46910; }
.remote-safety-warning strong { display: block; font-size: 12px; }
.remote-safety-warning p { margin: 4px 0 0; font-size: 11px; line-height: 1.5; }
.remote-view-stage {
  min-height: 190px;
  margin-top: 14px;
  padding: 24px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 13px;
  border: 1px solid #29364a;
  border-radius: 17px;
  background:
    radial-gradient(circle at 50% 12%, rgba(65, 128, 235, 0.2), transparent 42%),
    #17202e;
  color: #fff;
  text-align: center;
}
.remote-view-stage.is-live { border-color: rgba(61, 202, 130, 0.72); }
.remote-view-frame {
  width: 100%;
  max-height: 320px;
  object-fit: contain;
  border: 1px solid rgba(169, 197, 249, 0.3);
  border-radius: 12px;
  background: #0b111b;
}
.remote-view-frame.is-input-enabled { cursor: crosshair; touch-action: none; }
.remote-input-form {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid #d9d0fa;
  border-radius: 14px;
  background: #f8f6ff;
}
.remote-input-form > label { display: block; margin-bottom: 7px; color: #6049bd; font-size: 11px; font-weight: 750; }
.remote-input-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.remote-input-row input {
  min-width: 0;
  min-height: 42px;
  padding: 0 11px;
  border: 1px solid #cfc4f8;
  border-radius: 11px;
  background: #fff;
  font: inherit;
}
.remote-input-row button {
  min-height: 42px;
  padding: 0 13px;
  border: 0;
  border-radius: 11px;
  background: #674fc8;
  color: #fff;
  font-size: 11px;
  font-weight: 750;
}
.remote-input-row :disabled { opacity: 0.55; cursor: not-allowed; }
.remote-input-form > p { min-height: 16px; margin: 7px 0 0; color: var(--muted); font-size: 10px; }
.remote-view-placeholder { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 16px; background: rgba(255, 255, 255, 0.08); color: #a9c5f9; }
.remote-view-placeholder .icon { width: 27px; height: 27px; }
.remote-control-panel[data-remote-state="connecting"] .remote-view-placeholder { animation: remote-pulse 1.4s ease-in-out infinite; }
.remote-view-copy strong { display: block; font-size: 14px; }
.remote-view-copy p { max-width: 360px; margin: 6px auto 0; color: #aeb9ca; font-size: 11px; line-height: 1.5; }
.remote-view-copy .remote-view-freshness { color: #d7e5ff; font-variant-numeric: tabular-nums; }
.remote-control-actions { margin-top: 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.remote-control-actions button {
  min-height: 46px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid #d7e2f7;
  border-radius: 14px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 11px;
  font-weight: 750;
  cursor: pointer;
}
.remote-control-actions button .icon { width: 17px; height: 17px; }
.remote-control-actions button:disabled { border-color: var(--line); background: #f4f6f9; color: #9aa3b1; cursor: not-allowed; }
.remote-control-panel[data-remote-state="user_takeover"] #take-over-control {
  border-color: #cfc4f8;
  background: #f5f2ff;
  color: #6049bd;
}
.remote-control-panel[data-remote-state="takeover_pending"] #take-over-control:disabled,
.remote-control-panel[data-remote-state="return_pending"] #take-over-control:disabled {
  border-color: #ead7ae;
  background: #fff8e9;
  color: #976117;
}
.remote-controls-note { margin: 10px 2px 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.info-section { margin-top: 24px; }
.info-section > h2 { margin: 0 0 9px; color: #929aa9; font-size: 11px; font-weight: 750; letter-spacing: 0.12em; text-transform: uppercase; }
.settings-group { overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.setting-row {
  min-height: 68px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}
.setting-row:last-child { border-bottom: 0; }
.setting-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 12px;
  background: var(--blue-soft);
  color: var(--blue);
}
.setting-icon .icon { width: 20px; height: 20px; }
.setting-row > div { min-width: 0; margin-right: auto; }
.setting-row strong, .setting-row small { display: block; }
.setting-row strong { font-size: 13px; }
.setting-row small { margin-top: 3px; color: var(--muted); font-size: 10px; line-height: 1.35; }
.setting-row > span:last-child { color: var(--muted); font-size: 10px; text-align: right; }
.setting-row .value-good { color: var(--green); font-weight: 700; }
.secondary-action {
  width: 100%;
  min-height: 48px;
  margin-top: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid #d7e2f7;
  border-radius: 15px;
  background: var(--surface);
  color: var(--blue);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.secondary-action .icon { width: 19px; height: 19px; }
.profile-row {
  padding: 15px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
}
.profile-row .profile-avatar { width: 46px; height: 46px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 15px; background: var(--blue); color: #fff; font-size: 20px; font-weight: 800; }
.profile-row > div { min-width: 0; margin-right: auto; }
.profile-row strong, .profile-row span { display: block; }
.profile-row strong { font-size: 15px; }
.profile-row div span { margin-top: 3px; overflow-wrap: anywhere; color: var(--muted); font-size: 11px; }
.profile-check { width: 22px; height: 22px; color: var(--green); }
.profile-edit {
  min-height: 40px;
  padding: 0 11px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  border: 1px solid #d7e2f7;
  border-radius: 12px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 11px;
  font-weight: 750;
  cursor: pointer;
}
.profile-edit .icon { width: 17px; height: 17px; }

.setting-action {
  min-height: 38px;
  padding: 0 12px;
  flex: 0 0 auto;
  border: 1px solid #d7e2f7;
  border-radius: 12px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 11px;
  font-weight: 750;
  cursor: pointer;
}
.setting-action:disabled { opacity: 0.58; cursor: wait; }
.browser-code-panel {
  padding: 18px;
  display: grid;
  justify-items: center;
  border-top: 1px solid var(--line);
  background: linear-gradient(145deg, #f8fbff, #edf4ff);
  text-align: center;
}
.browser-code-panel > span { color: var(--muted); font-size: 10px; font-weight: 750; letter-spacing: 0.12em; text-transform: uppercase; }
.browser-code-panel output { margin-top: 8px; color: var(--ink); font-size: clamp(26px, 8vw, 34px); font-weight: 800; letter-spacing: 0.18em; line-height: 1.1; }
.browser-code-panel p { margin: 8px 0 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.browser-code-panel .browser-code-error { color: var(--red); }
.browser-access-link {
  min-height: 44px;
  margin-top: 7px;
  padding: 0 4px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}
.browser-access-link .icon { width: 16px; height: 16px; }
.logout-action {
  width: 100%;
  min-height: 48px;
  margin-top: 20px;
  border: 1px solid #f0d5d9;
  border-radius: 15px;
  background: var(--surface);
  color: var(--red);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.browser-login {
  position: fixed;
  inset: 0;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(360px, 0.92fr) minmax(460px, 1.08fr);
  overflow-x: hidden;
  overflow-y: auto;
  background: var(--canvas);
  z-index: 60;
}
.browser-login-visual {
  position: relative;
  min-height: 100%;
  padding: clamp(40px, 7vw, 96px);
  display: grid;
  align-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 14%, rgba(75, 154, 255, 0.56), transparent 31%),
    linear-gradient(145deg, #1558d8 0%, #2167ed 48%, #14a5e9 100%);
  color: #fff;
}
.browser-login-orbit { position: absolute; border: 1px solid rgba(255, 255, 255, 0.19); border-radius: 50%; }
.browser-login-orbit::after { content: ""; position: absolute; width: 10px; height: 10px; border-radius: 50%; background: #6ff0a8; box-shadow: 0 0 18px rgba(111, 240, 168, 0.8); }
.browser-login-orbit.orbit-one { width: 430px; height: 430px; right: -160px; top: -130px; }
.browser-login-orbit.orbit-one::after { left: 76px; bottom: 44px; }
.browser-login-orbit.orbit-two { width: 270px; height: 270px; left: -110px; bottom: -80px; }
.browser-login-orbit.orbit-two::after { right: 42px; top: 24px; }
.browser-login-promise { position: relative; max-width: 560px; z-index: 1; }
.browser-login-promise .brand-mark { background: #fff; color: var(--blue); box-shadow: 0 10px 30px rgba(7, 37, 91, 0.2); }
.browser-login-promise > p { margin: 32px 0 10px; color: rgba(255, 255, 255, 0.72); font-size: 12px; font-weight: 750; letter-spacing: 0.14em; text-transform: uppercase; }
.browser-login-promise h2 { max-width: 520px; margin: 0; font-size: clamp(32px, 4vw, 54px); line-height: 1.08; letter-spacing: -0.045em; }
.browser-login-promise ul { margin: 38px 0 0; padding: 0; display: grid; gap: 17px; list-style: none; }
.browser-login-promise li { display: flex; align-items: center; gap: 11px; color: rgba(255, 255, 255, 0.88); font-size: 14px; }
.browser-login-promise li .icon { width: 21px; height: 21px; color: #91f3bb; }
.browser-login-content { min-height: 100%; padding: 36px clamp(24px, 6vw, 92px); display: grid; place-items: center; }
.browser-login-card { width: min(100%, 450px); }
.browser-login-brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; }
.browser-login-brand > span:last-child { display: grid; gap: 2px; }
.browser-login-brand strong { font-size: 16px; }
.browser-login-brand small { color: var(--muted); font-size: 11px; }
.browser-login-heading { margin: clamp(42px, 7vh, 70px) 0 30px; }
.browser-login-heading .eyebrow { display: block; margin-bottom: 10px; color: var(--blue); font-size: 11px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; }
.browser-login-heading h1 { margin: 0; color: var(--ink); font-size: clamp(30px, 4vw, 42px); line-height: 1.12; letter-spacing: -0.04em; }
.browser-login-heading p { margin: 13px 0 0; color: #687183; font-size: 15px; line-height: 1.58; }
.browser-login-form, .browser-login-fields { display: grid; }
.browser-login-form label { margin-bottom: 9px; color: #384253; font-size: 13px; font-weight: 750; }
.browser-login-form input {
  width: 100%;
  height: 64px;
  padding: 0 18px;
  border: 1px solid #d9e0ea;
  border-radius: 18px;
  outline: 0;
  background: #fff;
  color: var(--ink);
  font-size: 24px;
  font-weight: 760;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  box-shadow: 0 8px 24px rgba(27, 42, 68, 0.06);
}
.browser-login-form input:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(33, 103, 237, 0.12), 0 8px 24px rgba(27, 42, 68, 0.06); }
.browser-login-form input[aria-invalid="true"] { border-color: var(--red); box-shadow: 0 0 0 4px rgba(220, 66, 82, 0.1); }
.preview-login-fields { gap: 9px; }
.preview-login-fields label:not(:first-child) { margin-top: 8px; }
.preview-login-fields input { height: 56px; font-size: 16px; font-weight: 650; letter-spacing: 0; text-transform: none; }
.preview-login-fields code { padding: 2px 5px; border-radius: 5px; background: #edf2f8; color: #3b4658; font-size: 10px; }
.browser-login-hint { margin: 7px 2px 0; color: var(--muted); font-size: 11px; }
.browser-login-feedback { min-height: 0; margin: 10px 2px 0; color: var(--green); font-size: 12px; line-height: 1.45; }
.browser-login-feedback:empty { margin-top: 0; }
.browser-login-feedback.error { color: var(--red); }
.browser-login-submit {
  min-height: 54px;
  margin-top: 18px;
  border: 0;
  border-radius: 17px;
  background: var(--blue);
  color: #fff;
  font-size: 14px;
  font-weight: 750;
  box-shadow: 0 10px 24px rgba(33, 103, 237, 0.22);
  cursor: pointer;
}
.browser-login-submit:hover { background: var(--blue-strong); }
.browser-login-submit:disabled { opacity: 0.62; cursor: wait; }
.browser-login-help { min-height: 46px; margin-top: 16px; display: inline-flex; align-items: center; gap: 7px; color: var(--blue); font-size: 13px; font-weight: 700; text-decoration: none; }
.browser-login-help .icon { width: 18px; height: 18px; }
.browser-login-security { margin: 24px 0 0; padding-top: 20px; display: flex; align-items: flex-start; gap: 9px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; line-height: 1.5; }
.browser-login-security .icon { width: 18px; height: 18px; color: var(--green); }

.onboarding {
  position: fixed;
  inset: 0;
  min-height: 100dvh;
  padding: clamp(16px, 4vw, 48px);
  display: grid;
  place-items: center;
  overflow-x: hidden;
  overflow-y: auto;
  background: rgba(18, 28, 45, 0.56);
  backdrop-filter: blur(14px);
  z-index: 70;
}
.onboarding-card {
  width: min(100%, 1080px);
  max-height: min(820px, calc(100dvh - 32px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 30px;
  background: var(--surface);
  box-shadow: 0 36px 100px rgba(10, 22, 42, 0.28);
}
.onboarding-header {
  min-height: 88px;
  padding: 17px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
}
.onboarding-brand { min-width: 0; display: flex; align-items: center; gap: 12px; }
.onboarding-brand > span:last-child { min-width: 0; display: grid; gap: 3px; }
.onboarding-brand strong { overflow: hidden; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.onboarding-brand small { color: var(--muted); font-size: 11px; }
.onboarding-skip {
  min-height: 42px;
  padding: 0 14px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
  color: #667184;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.onboarding-layout { min-height: 0; display: grid; grid-template-columns: minmax(300px, 0.86fr) minmax(420px, 1.14fr); overflow: hidden; }
.onboarding-aside {
  min-width: 0;
  padding: clamp(38px, 6vw, 68px);
  overflow-y: auto;
  background:
    radial-gradient(circle at 90% 10%, rgba(96, 167, 255, 0.35), transparent 33%),
    linear-gradient(145deg, #1558d8, #2374ef 64%, #18a5df);
  color: #fff;
}
.onboarding-aside .eyebrow { color: #c6dcff; }
.onboarding-aside h1 { margin: 15px 0 0; font-size: clamp(30px, 4vw, 43px); line-height: 1.08; letter-spacing: -0.045em; }
.onboarding-aside > p { margin: 17px 0 0; color: rgba(255, 255, 255, 0.74); font-size: 13px; line-height: 1.6; }
.onboarding-progress { margin: 42px 0 0; padding: 0; display: grid; list-style: none; }
.onboarding-progress li { position: relative; min-height: 59px; padding: 0 0 15px 44px; display: flex; align-items: flex-start; color: rgba(255, 255, 255, 0.58); }
.onboarding-progress li::before { content: ""; position: absolute; top: 31px; bottom: -1px; left: 14px; width: 1px; background: rgba(255, 255, 255, 0.22); }
.onboarding-progress li:last-child::before { display: none; }
.onboarding-progress li > span { position: absolute; top: 0; left: 0; width: 29px; height: 29px; display: grid; place-items: center; border: 1px solid rgba(255, 255, 255, 0.28); border-radius: 10px; font-size: 10px; font-weight: 800; }
.onboarding-progress li strong { padding-top: 6px; font-size: 12px; }
.onboarding-progress li.active { color: #fff; }
.onboarding-progress li.active > span { border-color: #fff; background: #fff; color: var(--blue); box-shadow: 0 7px 18px rgba(5, 36, 90, 0.18); }
.onboarding-progress li.complete { color: rgba(255, 255, 255, 0.82); }
.onboarding-progress li.complete > span { border-color: #8cf0b8; background: #8cf0b8; color: #0c7444; }
.onboarding-form { min-height: 0; padding: clamp(38px, 6vw, 68px); display: flex; flex-direction: column; overflow-y: auto; background: #fbfcfe; }
.onboarding-step-label { margin: 0 0 22px; color: var(--blue); font-size: 11px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; }
.onboarding-step { min-width: 0; margin: 0; padding: 0; display: flex; flex: 1; flex-direction: column; border: 0; }
.onboarding-step legend { display: block; width: 100%; padding: 0; color: var(--ink); font-size: clamp(27px, 3.2vw, 36px); font-weight: 760; line-height: 1.16; letter-spacing: -0.035em; }
.onboarding-step > p { margin: 12px 0 30px; color: var(--muted); font-size: 13px; line-height: 1.58; }
.onboarding-step label { margin-bottom: 9px; color: #384253; font-size: 12px; font-weight: 750; }
.onboarding-step input, .onboarding-step textarea {
  width: 100%;
  border: 1px solid #dce3ed;
  border-radius: 16px;
  outline: 0;
  background: var(--surface);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
  box-shadow: 0 7px 20px rgba(27, 42, 68, 0.04);
}
.onboarding-step input { height: 56px; padding: 0 16px; }
.onboarding-step textarea { min-height: 136px; padding: 14px 16px; resize: vertical; }
.onboarding-step input:focus, .onboarding-step textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(33, 103, 237, 0.11); }
.onboarding-step input[aria-invalid="true"], .onboarding-step textarea[aria-invalid="true"] { border-color: var(--red); }
.onboarding-actions { margin-top: auto; padding-top: 34px; display: flex; justify-content: flex-end; gap: 10px; }
.onboarding-actions.split { justify-content: space-between; }
.onboarding-next, .onboarding-submit, .onboarding-back { min-height: 50px; padding: 0 17px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 15px; font-size: 13px; font-weight: 750; cursor: pointer; }
.onboarding-next, .onboarding-submit { border: 0; background: var(--blue); color: #fff; box-shadow: 0 8px 20px rgba(33, 103, 237, 0.2); }
.onboarding-back { border: 1px solid var(--line); background: var(--surface); color: #5f6a7b; }
.onboarding-actions .icon { width: 18px; height: 18px; }
.onboarding-feedback { margin: 12px 0 0; color: var(--green); font-size: 12px; line-height: 1.45; }
.onboarding-feedback:empty { margin: 0; }
.onboarding-feedback.error { color: var(--red); }

.page-heading-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.page-heading-row .page-intro { min-width: 0; flex: 1; }
.primary-action, .secondary-action.compact {
  min-height: 46px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 14px;
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}
.primary-action { border: 0; background: var(--blue); color: #fff; box-shadow: 0 8px 20px rgba(33, 103, 237, 0.18); }
.primary-action:hover { background: var(--blue-strong); }
.primary-action:disabled { opacity: 0.58; cursor: wait; }
.primary-action .icon { width: 18px; height: 18px; }
.primary-action.compact, .secondary-action.compact { flex: 0 0 auto; width: auto; margin: 4px 0 0; }
.secondary-action.compact { border: 1px solid var(--line); background: var(--surface); color: #596476; box-shadow: none; }

.active-assistant-card {
  min-height: 140px;
  padding: 22px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  border: 1px solid #d9e6ff;
  border-radius: 22px;
  background: #f4f8ff;
}
.assistant-mark {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 17px;
  background: var(--blue);
  color: #fff;
}
.assistant-mark .icon { width: 26px; height: 26px; }
.assistant-mark.green { background: #15945f; }
.assistant-mark.violet { background: #7459dd; }
.assistant-mark.amber { background: #d38713; }
.active-assistant-copy { min-width: 0; }
.active-assistant-copy > span { color: var(--blue); font-size: 10px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; }
.active-assistant-copy h2 { margin: 5px 0 5px; font-size: 20px; letter-spacing: -0.025em; }
.active-assistant-copy p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.active-assistant-meta { display: grid; justify-items: end; gap: 7px; color: #55719e; font-size: 11px; }
.active-assistant-meta strong { padding: 6px 9px; border-radius: 10px; background: #e6efff; color: var(--blue); }

.workspace-section { margin-top: 28px; }
.section-heading { margin-bottom: 13px; display: flex; align-items: end; justify-content: space-between; gap: 16px; }
.section-heading .eyebrow { display: block; margin-bottom: 5px; color: #9aa2b1; font-size: 9px; font-weight: 800; letter-spacing: 0.13em; text-transform: uppercase; }
.section-heading h2 { margin: 0; font-size: 19px; letter-spacing: -0.025em; }
.section-count { min-width: 29px; height: 29px; padding: 0 8px; display: grid; place-items: center; border-radius: 10px; background: #edf2fa; color: #657188; font-size: 11px; font-weight: 800; }
.assistant-list { display: grid; gap: 10px; }
.assistant-row {
  padding: 15px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--surface);
}
.assistant-row.active { border-color: #bfd3fa; box-shadow: 0 8px 20px rgba(33, 103, 237, 0.06); }
.assistant-row .assistant-mark { width: 42px; height: 42px; border-radius: 14px; }
.assistant-row .assistant-mark .icon { width: 21px; height: 21px; }
.assistant-row-copy { min-width: 0; }
.assistant-row-copy strong { display: block; overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.assistant-row-copy span { display: block; margin-top: 4px; overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.assistant-row-action { min-height: 38px; padding: 0 12px; border: 1px solid #d8e3f5; border-radius: 12px; background: #f7faff; color: var(--blue); font-size: 11px; font-weight: 750; cursor: pointer; }
.assistant-row-action.active { border-color: transparent; background: var(--green-soft); color: var(--green); cursor: default; }

.knowledge-drop-zone {
  width: 100%;
  min-height: 176px;
  padding: 24px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 6px;
  border: 1px dashed #b9cbed;
  border-radius: 22px;
  background: #f8fbff;
  color: var(--ink);
  text-align: center;
  cursor: pointer;
}
.knowledge-drop-zone:hover, .knowledge-drop-zone.dragging { border-color: var(--blue); background: var(--blue-soft); }
.drop-zone-icon { width: 48px; height: 48px; margin-bottom: 5px; display: grid; place-items: center; border-radius: 16px; background: #e7f0ff; color: var(--blue); }
.drop-zone-icon .icon { width: 24px; height: 24px; }
.knowledge-drop-zone strong { font-size: 15px; }
.knowledge-drop-zone > span:not(.drop-zone-icon) { color: var(--muted); font-size: 12px; }
.knowledge-drop-zone small { margin-top: 4px; color: #9aa4b4; font-size: 10px; }
.knowledge-upload-status { min-height: 19px; margin: 9px 0 0; color: var(--blue); font-size: 11px; text-align: center; }
.knowledge-summary { margin-top: 16px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.knowledge-summary article { min-height: 84px; padding: 15px; display: grid; align-content: center; gap: 4px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.knowledge-summary strong { font-size: 19px; letter-spacing: -0.025em; }
.knowledge-summary span { color: var(--muted); font-size: 10px; }
.knowledge-list { display: grid; gap: 9px; }
.knowledge-row { padding: 14px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.knowledge-file-icon { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 13px; background: var(--blue-soft); color: var(--blue); }
.knowledge-file-icon .icon { width: 20px; height: 20px; }
.knowledge-row-copy { min-width: 0; }
.knowledge-row-copy strong { display: block; overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.knowledge-row-copy span { display: flex; gap: 7px; margin-top: 4px; color: var(--muted); font-size: 10px; }
.knowledge-row-copy .ready { color: var(--green); font-weight: 700; }
.knowledge-delete { min-height: 38px; padding: 0 10px; border: 0; border-radius: 12px; background: transparent; color: #7c8798; font-size: 10px; font-weight: 700; cursor: pointer; }
.knowledge-delete:hover { background: var(--red-soft); color: var(--red); }
.workspace-empty { min-height: 116px; padding: 22px; display: grid; place-items: center; align-content: center; gap: 6px; border: 1px solid var(--line); border-radius: 17px; color: var(--muted); text-align: center; }
.workspace-empty strong { color: var(--ink); font-size: 14px; }
.workspace-empty span { font-size: 11px; }

.agent-studio { position: fixed; inset: 0; padding: 22px; display: grid; place-items: center; background: rgba(18, 28, 45, 0.55); backdrop-filter: blur(12px); z-index: 80; }
.agent-studio-card { width: min(100%, 1080px); height: min(760px, calc(100dvh - 44px)); display: grid; grid-template-rows: auto minmax(0, 1fr); overflow: hidden; border: 1px solid rgba(255, 255, 255, 0.9); border-radius: 26px; background: var(--surface); box-shadow: 0 34px 100px rgba(18, 31, 54, 0.28); }
.agent-studio-header { min-height: 82px; padding: 17px 20px; display: flex; align-items: center; justify-content: space-between; gap: 18px; border-bottom: 1px solid var(--line); }
.agent-studio-header .eyebrow { color: var(--blue); font-size: 9px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; }
.agent-studio-header h1 { margin: 5px 0 0; font-size: 21px; letter-spacing: -0.03em; }
.studio-close-button { min-height: 40px; padding: 0 13px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--muted); font-size: 11px; font-weight: 700; cursor: pointer; }
.studio-close-button:hover { border-color: #cbd4e2; color: var(--ink); }
.agent-catalog { min-height: 0; display: grid; grid-template-columns: 310px minmax(0, 1fr); }
.agent-catalog-sidebar { min-height: 0; padding: 15px; display: flex; flex-direction: column; gap: 10px; overflow-y: auto; border-right: 1px solid var(--line); background: #fbfcfe; }
.catalog-search input { width: 100%; height: 44px; padding: 0 13px; border: 1px solid var(--line); border-radius: 13px; outline: 0; background: var(--surface); font-size: 12px; }
.catalog-search input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(33, 103, 237, 0.1); }
.custom-agent-option { min-height: 58px; padding: 10px 11px; display: flex; align-items: center; gap: 11px; border: 1px dashed #bfd0ed; border-radius: 14px; background: #f7faff; color: var(--blue); text-align: left; cursor: pointer; }
.custom-agent-option > span:first-child { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 10px; background: #e5efff; font-size: 19px; }
.custom-agent-option > span:last-child { min-width: 0; display: grid; gap: 2px; }
.custom-agent-option strong { font-size: 12px; }
.custom-agent-option small { color: #7c899d; font-size: 9px; }
.template-list { display: grid; gap: 5px; }
.template-option { min-height: 56px; padding: 9px 10px; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 10px; border: 1px solid transparent; border-radius: 13px; background: transparent; color: #4d5768; text-align: left; cursor: pointer; }
.template-option:hover { background: #f1f4f8; }
.template-option.active { border-color: #d8e4fa; background: #eaf2ff; color: var(--ink); }
.template-option .assistant-mark { width: 34px; height: 34px; border-radius: 11px; }
.template-option .assistant-mark .icon { width: 17px; height: 17px; }
.template-option strong { display: block; overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.template-option small { display: block; margin-top: 3px; color: #8b95a4; font-size: 9px; }
.template-detail { min-height: 0; padding: clamp(28px, 5vw, 56px); overflow-y: auto; }
.template-detail > .assistant-mark { width: 58px; height: 58px; border-radius: 19px; }
.template-detail .template-category { display: block; margin-top: 22px; color: var(--blue); font-size: 9px; font-weight: 800; letter-spacing: 0.13em; text-transform: uppercase; }
.template-detail h2 { margin: 7px 0 10px; font-size: clamp(25px, 3vw, 33px); letter-spacing: -0.04em; }
.template-detail > p { max-width: 660px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.65; }
.template-detail-grid { margin-top: 30px; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.template-detail-grid section { padding: 17px; border: 1px solid var(--line); border-radius: 16px; background: #fbfcfe; }
.template-detail-grid h3 { margin: 0 0 10px; font-size: 12px; }
.template-detail-grid ul { margin: 0; padding-left: 18px; color: #667184; font-size: 11px; line-height: 1.65; }
.template-use { margin-top: 26px; }

.agent-wizard { min-height: 0; display: grid; grid-template-columns: 250px minmax(0, 1fr); }
.wizard-sidebar { min-height: 0; padding: 25px 20px; border-right: 1px solid var(--line); background: #f7f9fc; }
.wizard-back-to-catalog { padding: 0; display: inline-flex; align-items: center; gap: 7px; border: 0; background: transparent; color: var(--blue); font-size: 11px; font-weight: 750; cursor: pointer; }
.wizard-back-to-catalog .icon { width: 17px; height: 17px; }
.wizard-progress { margin: 34px 0 0; padding: 0; display: grid; list-style: none; }
.wizard-progress li { position: relative; min-height: 64px; padding: 2px 0 18px 43px; color: #929baa; }
.wizard-progress li::before { content: ""; position: absolute; top: 31px; bottom: -1px; left: 14px; width: 1px; background: #dce2eb; }
.wizard-progress li:last-child::before { display: none; }
.wizard-progress li > span { position: absolute; top: 0; left: 0; width: 29px; height: 29px; display: grid; place-items: center; border: 1px solid #d7dee9; border-radius: 10px; background: #fff; font-size: 10px; font-weight: 800; }
.wizard-progress li strong { display: block; padding-top: 6px; font-size: 11px; }
.wizard-progress li.active { color: var(--ink); }
.wizard-progress li.active > span { border-color: var(--blue); background: var(--blue); color: #fff; }
.wizard-progress li.complete { color: #4d7c66; }
.wizard-progress li.complete > span { border-color: #bce7d1; background: var(--green-soft); color: var(--green); }
.wizard-content { min-height: 0; padding: clamp(28px, 5vw, 52px); display: flex; flex-direction: column; overflow-y: auto; }
.wizard-step-label { margin: 0 0 17px; color: var(--blue); font-size: 9px; font-weight: 800; letter-spacing: 0.13em; text-transform: uppercase; }
.wizard-step { min-width: 0; margin: 0; padding: 0; display: grid; gap: 10px; border: 0; }
.wizard-step legend { width: 100%; padding: 0; font-size: 28px; font-weight: 760; letter-spacing: -0.035em; }
.wizard-step > p { margin: 0 0 12px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.wizard-step > label:not(.choice-row) { margin-top: 6px; color: #3f4959; font-size: 11px; font-weight: 750; }
.wizard-step input:not([type="checkbox"]):not([type="radio"]), .wizard-step textarea { width: 100%; padding: 12px 14px; border: 1px solid #dce3ed; border-radius: 14px; outline: 0; background: var(--surface); color: var(--ink); font: inherit; font-size: 13px; line-height: 1.5; }
.wizard-step input:not([type="checkbox"]):not([type="radio"]) { height: 48px; }
.wizard-step textarea { resize: vertical; }
.wizard-step input:focus, .wizard-step textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(33, 103, 237, 0.1); }
.wizard-step [aria-invalid="true"] { border-color: var(--red) !important; }
.field-hint { color: #9099a8; font-size: 10px; line-height: 1.5; }
.choice-row { min-height: 64px; padding: 12px 13px; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: 11px; border: 1px solid var(--line); border-radius: 14px; background: #fbfcfe; cursor: pointer; }
.choice-row input { margin-top: 3px; accent-color: var(--blue); }
.choice-row span { display: grid; gap: 4px; }
.choice-row strong { font-size: 12px; }
.choice-row small { color: var(--muted); font-size: 10px; line-height: 1.45; }
.strong-choice { border-color: #cfddf6; background: #f5f9ff; }
.wizard-document-list { display: grid; gap: 7px; }
.wizard-document-list .choice-row { min-height: 50px; }
.inline-action { width: fit-content; margin-top: 3px; padding: 7px 0; border: 0; background: transparent; color: var(--blue); font-size: 11px; font-weight: 750; cursor: pointer; }
.wizard-upload-status { min-height: 16px; margin: 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.agent-review { margin-top: 8px; padding: 14px; border-radius: 14px; background: #f2f6fc; color: #5e697a; font-size: 11px; line-height: 1.55; }
.agent-review strong { color: var(--ink); }
.wizard-feedback { margin: 12px 0 0; color: var(--red); font-size: 11px; }
.wizard-actions { margin-top: auto; padding-top: 24px; display: flex; justify-content: flex-end; gap: 9px; }


.detail-view {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  background: var(--canvas);
  z-index: 20;
}
.detail-topbar {
  min-height: 72px;
  padding: calc(12px + env(safe-area-inset-top)) 16px 10px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 10px;
  background: rgba(248, 250, 252, 0.97);
}
.detail-brand { min-width: 0; display: flex; align-items: center; justify-content: center; gap: 9px; }
.detail-brand strong { overflow: hidden; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.detail-scroll { min-height: 0; overflow-y: auto; padding: 15px 20px 32px; overscroll-behavior: contain; }
.detail-scroll > h1 { margin: 2px 0 0; font-size: 28px; line-height: 1.18; font-weight: 760; letter-spacing: -0.035em; overflow-wrap: anywhere; }
.detail-status { margin: 7px 0 20px; color: var(--muted); font-size: 12px; }
.detail-tabs {
  margin-bottom: 25px;
  padding: 3px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #f0f3f7;
}
.detail-tabs button {
  min-height: 40px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #747e8e;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.detail-tabs button.active { background: var(--surface); color: var(--blue); box-shadow: 0 4px 12px rgba(27, 42, 68, 0.07); }
.detail-panel { min-width: 0; }
.markdown-body { overflow-wrap: anywhere; color: #202835; font-size: 15px; line-height: 1.68; }
.markdown-body > :first-child { margin-top: 0; }
.markdown-body > :last-child { margin-bottom: 0; }
.markdown-body h1, .markdown-body h2, .markdown-body h3 { color: var(--ink); line-height: 1.25; letter-spacing: -0.025em; }
.markdown-body h1 { margin: 28px 0 12px; font-size: 24px; }
.markdown-body h2 { margin: 25px 0 10px; font-size: 20px; }
.markdown-body h3 { margin: 22px 0 8px; font-size: 17px; }
.markdown-body p { margin: 0 0 15px; }
.markdown-body ul, .markdown-body ol { margin: 0 0 17px; padding-left: 23px; }
.markdown-body li { margin: 6px 0; padding-left: 2px; }
.markdown-body strong { color: #101722; }
.markdown-body a { color: var(--blue); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.markdown-body blockquote { margin: 18px 0; padding: 13px 15px; border-left: 3px solid var(--blue); border-radius: 0 12px 12px 0; background: var(--blue-soft); color: #4b5d79; }
.markdown-body code { padding: 2px 5px; border-radius: 6px; background: #eef1f5; font: 0.9em/1.45 ui-monospace, "Cascadia Code", Consolas, monospace; }
.markdown-body pre { max-width: 100%; margin: 17px 0; padding: 14px; overflow-x: auto; border-radius: 14px; background: #17202e; color: #eaf0f8; }
.markdown-body pre code { padding: 0; background: transparent; color: inherit; font-size: 12px; white-space: pre; }
.markdown-body hr { margin: 24px 0; border: 0; border-top: 1px solid var(--line); }
.worklog-panel { display: grid; gap: 0; }
.worklog-item { position: relative; min-height: 72px; padding: 0 0 20px 42px; }
.worklog-item::before { content: ""; position: absolute; left: 14px; top: 26px; bottom: -2px; width: 1px; background: var(--line); }
.worklog-item:last-child::before { display: none; }
.worklog-marker { position: absolute; top: 1px; left: 0; width: 29px; height: 29px; display: grid; place-items: center; border-radius: 50%; background: var(--green-soft); color: var(--green); }
.worklog-marker .icon { width: 16px; height: 16px; }
.worklog-item strong { display: block; font-size: 14px; }
.worklog-item p { margin: 4px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.detail-composer {
  padding: 9px 14px calc(10px + env(safe-area-inset-bottom));
  display: flex;
  align-items: flex-end;
  gap: 7px;
  border-top: 1px solid var(--line);
  background: rgba(248, 250, 252, 0.98);
}
.detail-composer textarea { min-height: 48px; padding: 13px 15px; border: 1px solid #dfe4ec; border-radius: 17px; background: var(--surface); box-shadow: 0 5px 16px rgba(30, 46, 73, 0.05); }

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  max-width: min(340px, calc(100vw - 28px));
  padding: 11px 15px;
  border-radius: 13px;
  background: #17202e;
  color: #fff;
  font-size: 12px;
  line-height: 1.4;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity 160ms ease, transform 160ms ease;
  z-index: 40;
}
.toast.visible { opacity: 1; transform: translate(-50%, 0); }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes progress { from { transform: translateX(-35%); } to { transform: translateX(175%); } }
@keyframes remote-pulse { 50% { opacity: 0.55; transform: scale(0.96); } }

@media (min-width: 600px) and (max-width: 719px) {
  body { padding: 16px; }
  .app-shell { height: min(844px, calc(100dvh - 32px)); border-radius: 28px; }
}

@media (max-width: 719px) {
  .browser-login { display: block; }
  .browser-login-visual { display: none; }
  .browser-login-content { min-height: 100dvh; padding: calc(26px + env(safe-area-inset-top)) 20px calc(28px + env(safe-area-inset-bottom)); align-items: start; }
  .browser-login-card { margin: 0 auto; }
  .browser-login-heading { margin: 48px 0 27px; }
  .browser-login-heading h1 { font-size: 31px; }
  .browser-login-form input { height: 60px; }
  .browser-access-row { align-items: flex-start; flex-wrap: wrap; }
  .browser-access-row > div { width: calc(100% - 50px); }
  .browser-access-row .setting-action { width: 100%; margin-left: 50px; }
  .onboarding { padding: 0; }
  .onboarding-card { width: 100%; height: 100dvh; max-height: none; border: 0; border-radius: 0; }
  .onboarding-header { min-height: 78px; padding: calc(12px + env(safe-area-inset-top)) 16px 12px; }
  .onboarding-brand .brand-mark { width: 38px; height: 38px; border-radius: 12px; font-size: 18px; }
  .onboarding-brand strong { font-size: 13px; }
  .onboarding-brand small { display: none; }
  .onboarding-skip { min-height: 40px; padding: 0 11px; font-size: 11px; }
  .onboarding-aside { padding: 18px 20px 10px; }
  .onboarding-form { padding: 22px 20px calc(22px + env(safe-area-inset-bottom)); }
  .onboarding-step-label { margin-bottom: 16px; }
  .onboarding-step legend { font-size: 28px; }
  .onboarding-step > p { margin-bottom: 24px; }
  .onboarding-actions { padding-top: 26px; }
  .onboarding-next, .onboarding-submit { flex: 1; }
  .onboarding-actions.split .onboarding-back { min-width: 92px; }
  .task-suggestions { grid-template-columns: 1fr; }
  .task-suggestions button { min-height: 70px; }
  .page-heading-row { align-items: center; }
  .page-heading-row .page-intro { padding-bottom: 16px; }
  .primary-action.compact { min-height: 42px; padding: 0 12px; font-size: 11px; }
  .active-assistant-card { grid-template-columns: auto minmax(0, 1fr); padding: 17px; }
  .active-assistant-meta { grid-column: 1 / -1; grid-template-columns: auto 1fr; justify-items: start; }
  .assistant-row { grid-template-columns: auto minmax(0, 1fr); }
  .assistant-row-action { grid-column: 2; justify-self: start; }
  .knowledge-summary { gap: 6px; }
  .knowledge-summary article { min-height: 72px; padding: 11px; }
  .knowledge-summary strong { font-size: 16px; }
  .knowledge-drop-zone { min-height: 154px; padding: 18px; }
  .agent-studio { padding: 0; }
  .agent-studio-card { width: 100%; height: 100dvh; border: 0; border-radius: 0; }
  .agent-studio-header { min-height: 74px; padding: calc(11px + env(safe-area-inset-top)) 16px 11px; }
  .agent-catalog { grid-template-columns: 1fr; grid-template-rows: minmax(250px, 0.88fr) minmax(280px, 1.12fr); }
  .agent-catalog-sidebar { border-right: 0; border-bottom: 1px solid var(--line); }
  .template-detail { padding: 22px 20px calc(24px + env(safe-area-inset-bottom)); }
  .template-detail h2 { font-size: 25px; }
  .template-detail-grid { margin-top: 20px; grid-template-columns: 1fr 1fr; gap: 8px; }
  .template-detail-grid section { padding: 13px; }
  .agent-wizard { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); }
  .wizard-sidebar { padding: 12px 16px; border-right: 0; border-bottom: 1px solid var(--line); }
  .wizard-progress { margin: 12px 0 0; grid-template-columns: repeat(4, 1fr); gap: 6px; }
  .wizard-progress li { min-height: 30px; padding: 0; display: grid; place-items: center; }
  .wizard-progress li::before { top: 14px; right: -6px; bottom: auto; left: calc(50% + 15px); width: calc(100% - 24px); height: 1px; }
  .wizard-progress li > span { position: static; z-index: 1; }
  .wizard-progress li strong { display: none; }
  .wizard-content { padding: 22px 18px calc(20px + env(safe-area-inset-bottom)); }
  .wizard-step legend { font-size: 24px; }
}

@media (min-width: 720px) {
  body { padding: 0; place-items: stretch; }
  .app-shell {
    width: 100%;
    max-width: none;
    height: 100dvh;
    grid-template-columns: 86px minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    border-radius: 0;
    box-shadow: none;
  }
  .topbar { grid-column: 1 / -1; grid-row: 1; padding-right: 24px; padding-left: 24px; border-bottom: 1px solid var(--line); }
  main { grid-column: 2; grid-row: 2; }
  .bottom-nav {
    min-height: 0;
    padding: 14px 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    grid-column: 1;
    grid-row: 2;
    border-top: 0;
    border-right: 1px solid var(--line);
  }
  .bottom-nav button { width: 100%; min-height: 68px; flex: 0 0 auto; }
  .bottom-nav button i { top: 8px; }
  .chat-toolbar { padding: 12px 24px; grid-template-columns: minmax(0, 760px) auto; justify-content: center; }
  .conversation-scroll { padding: 18px clamp(28px, 6vw, 72px) 34px; }
  .conversation-list, .conversation-scroll > .page-intro, .conversation-scroll > .poll-status { width: min(100%, 820px); margin-right: auto; margin-left: auto; }
  .composer-dock { padding: 13px clamp(28px, 6vw, 72px) 14px; }
  .composer-dock > * { width: min(100%, 820px); margin-right: auto; margin-left: auto; }
  .content-page { padding: 34px clamp(32px, 8vw, 92px) 48px; }
  .content-page > * { width: min(100%, 760px); margin-right: auto; margin-left: auto; }
  .content-page > .info-section { margin-top: 24px; }
  .content-page > .secondary-action, .content-page > .logout-action { margin-top: 18px; }
  .detail-view { left: auto; width: min(570px, calc(100% - 86px)); border-left: 1px solid var(--line); box-shadow: -24px 0 60px rgba(23, 35, 58, 0.16); }
  .detail-scroll { padding: 24px 34px 40px; }
}

@media (min-width: 1024px) {
  body {
    padding: 16px;
    place-items: center;
    background:
      radial-gradient(circle at 12% 8%, rgba(33, 103, 237, 0.08), transparent 29%),
      #e9edf4;
  }
  .app-shell {
    width: min(calc(100vw - 32px), 1460px);
    height: calc(100dvh - 32px);
    grid-template-columns: 248px minmax(0, 1fr);
    grid-template-rows: 96px minmax(0, 1fr);
    border: 1px solid rgba(255, 255, 255, 0.75);
    border-radius: 26px;
    box-shadow: 0 24px 80px rgba(30, 43, 66, 0.16);
  }
  .topbar {
    min-height: 0;
    padding: 18px;
    grid-column: 1;
    grid-row: 1;
    border-right: 1px solid var(--line);
    border-bottom: 0;
    background: rgba(255, 255, 255, 0.98);
  }
  .topbar .brand { gap: 9px; }
  .topbar .brand-mark { width: 40px; height: 40px; border-radius: 13px; font-size: 20px; }
  .topbar .brand-copy strong { font-size: 13px; }
  .topbar .pc-status { font-size: 10px; }
  .topbar > .icon-button { display: none; }
  main { grid-column: 2; grid-row: 1 / -1; }
  .bottom-nav {
    padding: 18px 14px;
    grid-column: 1;
    grid-row: 2;
    gap: 8px;
    border-right: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.98);
  }
  .bottom-nav button {
    min-height: 54px;
    padding: 0 16px;
    display: flex;
    justify-content: flex-start;
    gap: 13px;
    border-radius: 15px;
    font-size: 13px;
  }
  .bottom-nav button .icon { width: 21px; height: 21px; }
  .bottom-nav button.active { background: var(--blue-soft); }
  .bottom-nav button i { top: 12px; left: 38px; }
  .chat-toolbar { min-height: 66px; padding: 11px 28px; background: rgba(248, 250, 252, 0.92); }
  .conversation-scroll { padding-top: 22px; }
  .content-page { padding-top: 48px; }
  .detail-view { width: min(590px, calc(100% - 248px)); border-radius: 0 25px 25px 0; }
}

@media (min-width: 1280px) {
  .app-shell:has(.detail-view:not([hidden])) { grid-template-columns: 248px minmax(500px, 1fr) minmax(340px, 400px); }
  .app-shell:has(.detail-view:not([hidden])) main { grid-column: 2; }
  .detail-view:not([hidden]) {
    position: relative;
    inset: auto;
    width: auto;
    min-width: 0;
    grid-column: 3;
    grid-row: 1 / -1;
    border-radius: 0 25px 25px 0;
    box-shadow: none;
  }
  .detail-view:not([hidden]) .detail-topbar { border-bottom: 1px solid var(--line); }
  .detail-view:not([hidden]) .detail-scroll { padding-right: 30px; padding-left: 30px; }
  .app-shell:has(.detail-view:not([hidden])) .conversation-scroll { padding-right: clamp(26px, 3vw, 50px); padding-left: clamp(26px, 3vw, 50px); }
  .app-shell:has(.detail-view:not([hidden])) .composer-dock { padding-right: clamp(26px, 3vw, 50px); padding-left: clamp(26px, 3vw, 50px); }
}

@media (max-width: 899px) {
  .browser-login { grid-template-columns: 1fr; }
  .browser-login-visual { display: none; }
  .onboarding-layout { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); }
  .onboarding-aside { padding: 20px 30px 14px; overflow: visible; }
  .onboarding-aside > .eyebrow, .onboarding-aside > h1, .onboarding-aside > p { display: none; }
  .onboarding-progress { margin: 0; grid-template-columns: repeat(4, 1fr); gap: 7px; }
  .onboarding-progress li { min-height: 40px; padding: 0; display: grid; place-items: center; }
  .onboarding-progress li::before { top: 14px; right: -7px; bottom: auto; left: calc(50% + 15px); width: calc(100% - 23px); height: 1px; }
  .onboarding-progress li > span { position: static; z-index: 1; }
  .onboarding-progress li strong { display: none; }
}

@media (min-width: 720px) and (max-width: 899px) {
  .onboarding-card { max-height: calc(100dvh - 24px); }
}

@media (max-width: 350px) {
  .topbar { padding-left: 14px; padding-right: 14px; }
  .brand-mark { width: 40px; height: 40px; border-radius: 13px; }
  .brand-copy strong { font-size: 15px; }
  .conversation-scroll { padding-left: 14px; padding-right: 14px; }
  .composer-dock { padding-left: 10px; padding-right: 10px; }
  .setting-row { padding-left: 11px; padding-right: 11px; }
  .remote-control-actions { grid-template-columns: 1fr; }
  .profile-edit span { display: none; }
  .onboarding-brand > span:last-child { display: none; }
}

@media (orientation: landscape) and (max-height: 520px) {
  .topbar { min-height: 64px; padding-top: 8px; padding-bottom: 8px; }
  .brand-mark { width: 38px; height: 38px; }
  .brand-copy strong { font-size: 15px; }
  .bottom-nav { min-height: 58px; padding-top: 3px; padding-bottom: 3px; }
  .bottom-nav button { min-height: 50px; }
  .composer-dock { padding-top: 6px; padding-bottom: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* Executive workspace — selected light desktop direction */
.tasks-workspace {
  min-height: 0;
  flex: 1;
  display: grid;
  overflow: hidden;
  background: var(--canvas);
}

.tasks-canvas {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-select-shell {
  min-width: 0;
  position: relative;
  display: block;
}

.chat-select-shell > .icon {
  position: absolute;
  top: 50%;
  left: 14px;
  width: 19px;
  height: 19px;
  z-index: 1;
  color: #747b90;
  transform: translateY(-50%);
  pointer-events: none;
}

.chat-toolbar .chat-select-shell select { width: 100%; padding-left: 42px; }

.workspace-context { display: none; }
.executive-empty { display: none; }

.executive-intro {
  padding: 8px 0 20px;
}

.workspace-date {
  display: block;
  margin-bottom: 22px;
  color: #7b8196;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.01em;
}

.executive-intro h1 {
  max-width: 620px;
  font-size: clamp(35px, 7.5vw, 54px);
  line-height: 1.08;
  font-weight: 600;
  letter-spacing: -0.055em;
}

.executive-intro p {
  max-width: 650px;
  margin-top: 18px;
  font-size: 14px;
  line-height: 1.65;
}

.composer-dock {
  position: relative;
  padding: 0 18px 14px;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.composer-field {
  min-height: 164px;
  padding: 18px;
  display: grid;
  grid-template-rows: minmax(78px, 1fr) auto;
  gap: 14px;
  border: 1px solid #dcdee8;
  border-radius: 17px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(33, 29, 82, 0.035);
}

.composer-field textarea {
  width: 100%;
  min-height: 78px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.55;
  resize: none;
}

.composer-field textarea::placeholder { color: #aaafbf; }

.composer-tools {
  min-width: 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
}

.composer-tools-left {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 15px;
}

.composer-icon {
  width: auto;
  height: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  background: transparent;
  color: #70778d;
  font-size: 12px;
  font-weight: 650;
  box-shadow: none;
}

.composer-icon:hover:not(:disabled) { color: var(--blue); }
.composer-icon .icon { width: 18px; height: 18px; }
.composer-icon.voice-input-button { width: 36px; justify-content: center; }

.composer-knowledge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #72798d;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.composer-knowledge .icon { width: 18px; height: 18px; }

.composer-send-group {
  display: grid;
  justify-items: end;
  gap: 7px;
  flex: 0 0 auto;
}

.composer-send-group > span {
  color: #a4a9b8;
  font-size: 11px;
}

.send-button {
  width: 48px;
  height: 48px;
  border-radius: 13px;
  background: var(--blue);
  box-shadow: 0 8px 20px rgba(92, 72, 232, 0.22);
}

.send-button:hover:not(:disabled) { background: var(--blue-strong); }
.composer-meta { display: none; }

.quick-starts {
  padding: 10px 18px calc(24px + env(safe-area-inset-bottom));
  display: grid;
  gap: 8px;
}

.quick-starts h2 {
  margin: 0 0 2px;
  color: #747b90;
  font-size: 10px;
  font-weight: 760;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.quick-starts > button {
  width: 100%;
  min-height: 72px;
  padding: 13px 15px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  border: 1px solid #e2e3ea;
  border-radius: 14px;
  background: #fff;
  text-align: left;
  cursor: pointer;
  transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.quick-starts > button:hover {
  border-color: #c9c3f7;
  box-shadow: 0 8px 22px rgba(40, 35, 91, 0.055);
  transform: translateY(-1px);
}

.quick-start-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--blue-soft);
  color: var(--blue);
}

.quick-start-icon .icon { width: 19px; height: 19px; }
.quick-starts button > span:nth-child(2) { min-width: 0; display: grid; gap: 4px; }
.quick-starts strong { font-size: 13px; font-weight: 650; }
.quick-starts small { overflow: hidden; color: #878d9f; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.quick-start-result { display: inline-flex; align-items: center; gap: 10px; color: #777e93; font-size: 11px; white-space: nowrap; }
.quick-start-result .icon { width: 17px; height: 17px; }

.tasks-page.has-messages .quick-starts { display: none; }
.tasks-page.has-messages .composer-field { min-height: 118px; grid-template-rows: minmax(48px, auto) auto; }
.tasks-page.has-messages .composer-field textarea { min-height: 48px; }

.context-section {
  padding: 0 0 30px;
  border-bottom: 1px solid var(--line);
}

.context-section + .context-section { padding-top: 30px; }
.context-computer-section { border-bottom: 0; }
.context-label {
  display: block;
  margin-bottom: 20px;
  color: #757c91;
  font-size: 10px;
  font-weight: 780;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.context-agent,
.context-knowledge-summary,
.context-document,
.context-computer {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.context-agent-mark {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 13px;
  background: var(--blue);
  color: #fff;
  box-shadow: 0 8px 20px rgba(92, 72, 232, 0.18);
}

.context-agent-mark .icon { width: 22px; height: 22px; }
.context-agent > div,
.context-knowledge-summary > div,
.context-document > div,
.context-computer > div { min-width: 0; display: grid; gap: 4px; }
.context-agent strong { font-size: 15px; font-weight: 650; line-height: 1.35; }
.context-agent span,
.context-knowledge-summary span,
.context-computer span { color: #858b9d; font-size: 11px; line-height: 1.55; }

.context-link {
  margin-top: 20px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border: 0;
  background: transparent;
  color: var(--blue);
  font-size: 12px;
  font-weight: 720;
  cursor: pointer;
}

.context-link .icon { width: 16px; height: 16px; }
.context-knowledge-summary > .icon { width: 22px; height: 22px; margin-top: 1px; color: #70778b; }
.context-knowledge-summary strong { font-size: 12px; }
.context-document-list { margin-top: 22px; display: grid; gap: 16px; }
.context-document > span { color: #737a8f; }
.context-document > span .icon { width: 18px; height: 18px; }
.context-document strong { overflow: hidden; font-size: 11px; font-weight: 690; text-overflow: ellipsis; white-space: nowrap; }
.context-document small { overflow: hidden; color: #9398a8; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.context-empty { margin: 0; color: #9398a8; font-size: 11px; line-height: 1.55; }

.context-computer {
  padding: 14px;
  border: 1px solid #e1e3eb;
  border-radius: 12px;
  background: #fff;
}

.context-computer > .icon { width: 22px; height: 22px; color: #7b8295; }
.context-computer strong { font-size: 12px; }
.context-computer.online { border-color: #b9e4cc; background: var(--green-soft); }
.context-computer.online > .icon,
.context-computer.online strong,
.context-computer.online span { color: var(--green); }
.context-computer.offline { background: #fafafc; }

@media (max-width: 719px) {
  .tasks-workspace { display: block; overflow-y: auto; overscroll-behavior: contain; }
  .tasks-canvas { min-height: 100%; overflow: visible; }
  .tasks-page:not(.has-messages) .conversation-scroll { min-height: 0; flex: 0 0 auto; overflow: visible; padding-top: 20px; padding-bottom: 4px; }
  .tasks-page.has-messages .conversation-scroll { min-height: 220px; }
  .workspace-date { margin-bottom: 14px; font-size: 11px; }
  .executive-intro { padding-bottom: 12px; }
  .executive-intro h1 { font-size: clamp(34px, 10.5vw, 44px); }
  .executive-intro p { margin-top: 12px; font-size: 12px; line-height: 1.55; }
  .composer-field { min-height: 150px; padding: 15px; }
  .composer-tools-left { gap: 12px; }
  .composer-icon > span:not(.sr-only), .composer-knowledge { display: none; }
  .composer-send-group > span { display: none; }
  .quick-start-result { display: none; }
  .quick-starts > button { grid-template-columns: auto minmax(0, 1fr); }
  .quick-starts small { white-space: normal; }
}

@media (min-width: 720px) and (max-width: 1023px) {
  .tasks-page:not(.has-messages) .conversation-scroll { min-height: 0; flex: 0 0 auto; padding-top: 34px; padding-bottom: 16px; }
  .tasks-page:not(.has-messages) .conversation-scroll > .page-intro,
  .tasks-page:not(.has-messages) .composer-dock > *,
  .quick-starts { width: min(100%, 820px); margin-right: auto; margin-left: auto; }
  .quick-starts { padding-right: clamp(28px, 6vw, 72px); padding-left: clamp(28px, 6vw, 72px); }
}

@media (min-width: 1024px) {
  body { padding: 0; background: #f1f0f5; }

  .app-shell {
    width: 100vw;
    height: 100dvh;
    grid-template-columns: 176px minmax(0, 1fr);
    grid-template-rows: 92px minmax(0, 1fr);
    border: 0;
    border-radius: 0;
    background: #fff;
    box-shadow: none;
  }

  .topbar {
    padding: 18px;
    justify-content: center;
    border-right: 1px solid var(--line);
    background: #fff;
  }

  .topbar .brand-copy { display: none; }
  .topbar .brand-mark {
    width: 40px;
    height: 40px;
    border: 1px solid #dcd8fb;
    border-radius: 12px;
    background: #f5f3ff;
    color: var(--blue);
    box-shadow: none;
  }

  .topbar .brand-mark { visibility: hidden; }

  main { grid-column: 2; grid-row: 1 / -1; }

  .bottom-nav {
    padding: 20px 24px 28px;
    align-items: center;
    gap: 14px;
    border-right: 1px solid var(--line);
    background: #fff;
  }

  .bottom-nav button {
    width: 112px;
    min-height: 100px;
    padding: 12px 8px;
    flex-direction: column;
    justify-content: center;
    gap: 9px;
    border-radius: 18px;
    color: #747b90;
    font-size: 12px;
    font-weight: 620;
  }

  .bottom-nav button .icon { width: 25px; height: 25px; }
  .bottom-nav button.active { background: #f3f1ff; color: var(--blue); }
  .bottom-nav button:last-child { margin-top: auto; }

  .tasks-page.active {
    display: grid;
    grid-template-rows: 92px minmax(0, 1fr);
  }

  .chat-toolbar {
    min-height: 92px;
    padding: 18px 36px;
    grid-template-columns: minmax(180px, 238px) auto;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.98);
  }

  .chat-toolbar select {
    height: 50px;
    padding-left: 16px;
    border-color: #dddfe8;
    border-radius: 12px;
    font-size: 13px;
  }

  .chat-toolbar button {
    min-height: 46px;
    min-width: 144px;
    padding: 0 18px;
    border: 0;
    border-radius: 10px;
    background: var(--blue);
    color: #fff;
    font-size: 12px;
    box-shadow: 0 8px 20px rgba(92, 72, 232, 0.2);
  }

  .tasks-workspace {
    grid-template-columns: minmax(0, 1fr) 310px;
  }

  .tasks-canvas { background: #fcfcfe; }
  .tasks-page:not(.has-messages) .conversation-scroll {
    min-height: 0;
    flex: 0 0 auto;
    padding: 54px clamp(42px, 5vw, 68px) 24px;
    overflow: visible;
  }

  .conversation-list,
  .conversation-scroll > .page-intro,
  .conversation-scroll > .poll-status {
    width: min(100%, 820px);
  }

  .executive-intro { padding: 0; }
  .workspace-date { margin-bottom: 28px; }
  .executive-intro h1 { font-size: 55px; letter-spacing: -0.075em; }
  .executive-intro p { margin-top: 20px; font-size: 14px; }

  .composer-dock {
    width: 100%;
    padding: 15px clamp(42px, 5vw, 68px) 0;
  }

  .composer-dock > * { width: min(100%, 820px); }
  .composer-field { min-height: 220px; padding: 22px; grid-template-rows: minmax(86px, 1fr) auto; }
  .composer-field textarea { min-height: 96px; font-size: 15px; }

  .quick-starts {
    width: 100%;
    padding: 49px clamp(42px, 5vw, 68px) 48px;
    overflow-y: auto;
  }

  .quick-starts > * { width: min(100%, 820px); margin-right: auto; margin-left: auto; }
  .quick-starts h2 { margin-bottom: 7px; }
  .quick-starts > button { min-height: 74px; padding: 14px 20px; }

  .tasks-page.has-messages .conversation-scroll { padding: 28px clamp(42px, 5vw, 68px) 24px; }
  .tasks-page.has-messages .composer-dock { padding-bottom: 22px; }
  .tasks-page.has-messages .composer-field { min-height: 124px; grid-template-rows: minmax(48px, auto) auto; }

  .workspace-context {
    min-width: 0;
    min-height: 0;
    padding: 48px 30px 36px;
    display: block;
    overflow-y: auto;
    border-left: 1px solid var(--line);
    background: #fff;
    overscroll-behavior: contain;
  }

  .content-page { padding-right: clamp(40px, 7vw, 92px); padding-left: clamp(40px, 7vw, 92px); }
  .detail-view { width: min(590px, calc(100% - 176px)); }
}

@media (min-width: 1280px) {
  .tasks-workspace { grid-template-columns: minmax(0, 1fr) 302px; }
  .workspace-context { padding-right: 36px; padding-left: 36px; }
  .app-shell:has(.detail-view:not([hidden])) { grid-template-columns: 176px minmax(500px, 1fr) minmax(340px, 400px); }
}

@media (max-height: 820px) and (min-width: 1024px) {
  .tasks-page:not(.has-messages) .conversation-scroll { padding-top: 26px; padding-bottom: 10px; }
  .workspace-date { margin-bottom: 10px; }
  .executive-intro h1 { font-size: 42px; line-height: 1.04; }
  .executive-intro p { margin-top: 9px; font-size: 12px; line-height: 1.45; }
  .composer-dock { padding-top: 4px; }
  .composer-field { min-height: 170px; padding: 18px; grid-template-rows: minmax(64px, 1fr) auto; }
  .tasks-page:not(.has-messages) .composer-field textarea { height: 64px !important; min-height: 64px; }
  .quick-starts { padding-top: 16px; padding-bottom: 18px; gap: 6px; }
  .quick-starts > button { min-height: 54px; padding-top: 8px; padding-bottom: 8px; }
  .quick-starts h2 { margin-bottom: 0; }
  .quick-start-icon { width: 32px; height: 32px; }
  .workspace-context { padding-top: 32px; }
  .context-section { padding-bottom: 22px; }
  .context-section + .context-section { padding-top: 22px; }
}

/* Company Computer: rooms, approvals and internal app factory */
select:focus-visible {
  outline: 3px solid rgba(92, 72, 232, 0.2);
  outline-offset: 2px;
}

.context-room {
  min-height: 104px;
  padding: 15px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 11px;
  overflow: hidden;
  border: 1px solid #dedced;
  border-radius: 15px;
  background: linear-gradient(145deg, #fff 0%, #f8f6ff 100%);
}

.context-room-header,
.context-room-meta,
.context-approval-actions,
.room-card-meta,
.room-detail-meta,
.app-card-meta,
.app-preview-status,
.record-form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.context-room-header,
.context-room-meta { width: 100%; min-width: 0; }
.context-room-header strong {
  min-width: 0;
  flex: 1;
  display: -webkit-box;
  overflow: hidden;
  font-size: 12px;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.context-room-header .icon { width: 18px; height: 18px; color: var(--blue); }
.context-room-header .icon,
.context-room-header .workspace-status { flex: 0 0 auto; }
.context-room p { margin: 0; color: #6f7589; font-size: 10px; line-height: 1.5; }
.context-room-meta { color: #8c91a1; font-size: 9px; }
.context-room-meta span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.workspace-status,
.room-status,
.app-status,
.risk-chip {
  min-height: 25px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #f0eefc;
  color: var(--blue);
  font-size: 9px;
  font-weight: 760;
  white-space: nowrap;
}

.workspace-status.attention,
.room-status.attention,
.risk-chip.medium { background: var(--amber-soft); color: var(--amber); }
.workspace-status.archived,
.room-status.archived,
.app-status.draft { background: #f1f2f5; color: #70778a; }
.app-status.pending_approval { background: var(--amber-soft); color: var(--amber); }
.app-status.published,
.risk-chip.low { background: var(--green-soft); color: var(--green); }
.risk-chip.high { background: var(--red-soft); color: var(--red); }

.context-approval-list { display: grid; gap: 10px; }
.context-approval {
  padding: 13px;
  display: grid;
  gap: 8px;
  border: 1px solid #eee1c9;
  border-radius: 14px;
  background: #fffaf2;
}
.context-approval > div:first-child { min-width: 0; display: grid; gap: 5px; }
.context-approval strong { font-size: 11px; line-height: 1.35; }
.context-approval p { margin: 0; color: #7f735f; font-size: 9px; line-height: 1.5; }
.context-approval-actions { justify-content: flex-start; }
.context-approval-actions button,
.approval-action {
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid #ddd8ca;
  border-radius: 10px;
  background: #fff;
  color: #676153;
  font-size: 9px;
  font-weight: 750;
  cursor: pointer;
}
.context-approval-actions button[data-approval-decision="approved"],
.approval-action.approve { border-color: #c3e3d1; background: var(--green-soft); color: var(--green); }
.context-approval-actions button:hover,
.approval-action:hover { border-color: #bbb3dd; }

.company-page {
  background: #fafafd;
}
.company-page > * {
  width: min(100%, 1260px) !important;
  margin-right: auto;
  margin-left: auto;
}
.company-heading { align-items: end; }
.company-heading .page-intro { max-width: 760px; padding-bottom: 0; }
.company-heading .page-intro h1 { font-size: clamp(34px, 4vw, 52px); font-weight: 620; letter-spacing: -0.055em; }
.company-heading .page-intro p { max-width: 690px; margin-top: 14px; font-size: 14px; line-height: 1.6; }

.company-metrics {
  margin-top: 30px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.company-metrics article {
  min-height: 112px;
  padding: 18px;
  display: grid;
  align-content: space-between;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
}
.company-metrics span { color: #777d90; font-size: 10px; font-weight: 720; letter-spacing: 0.09em; text-transform: uppercase; }
.company-metrics strong { font-size: 30px; font-weight: 620; letter-spacing: -0.055em; }
.company-metrics small { color: #969baa; font-size: 10px; }

.rooms-layout,
.factory-layout {
  min-height: 460px;
  margin-top: 10px;
  padding-bottom: 28px;
  display: grid;
  grid-template-columns: minmax(300px, 0.72fr) minmax(430px, 1.28fr);
  gap: 10px;
}
.company-panel {
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fff;
}
.compact-heading { margin-bottom: 18px; align-items: center; }
.compact-heading h2 { font-size: 17px; font-weight: 650; }

.room-list,
.internal-app-list { display: grid; gap: 8px; }
.room-card,
.internal-app-card {
  width: 100%;
  min-height: 108px;
  padding: 14px;
  display: grid;
  gap: 9px;
  border: 1px solid #e8e8ef;
  border-radius: 15px;
  background: #fff;
  text-align: left;
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease, transform 150ms ease;
}
.room-card:hover,
.internal-app-card:hover { border-color: #cac5ef; transform: translateY(-1px); }
.room-card.active,
.internal-app-card.active { border-color: #c7c0f5; background: #f7f5ff; }
.room-card > strong,
.internal-app-card > strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.room-card > p,
.internal-app-card > p { margin: 0; overflow: hidden; color: #7d8394; font-size: 10px; line-height: 1.5; text-overflow: ellipsis; white-space: nowrap; }
.room-card-meta,
.app-card-meta { color: #9297a7; font-size: 9px; }

.room-detail-panel,
.app-preview-panel { min-height: 460px; }
.room-detail,
.app-preview { height: 100%; display: flex; flex-direction: column; }
.room-detail-header,
.app-preview-header { padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.app-preview-header { order: 0; }
.app-preview > .approval-explanation { order: 1; }
.app-preview > .app-blueprint-summary { order: 2; }
.app-preview > .app-workspace { order: 3; }
.room-detail-header h2,
.app-preview-header h2 { margin: 8px 0 9px; font-size: clamp(24px, 2.8vw, 34px); font-weight: 620; letter-spacing: -0.045em; }
.room-detail-header p,
.app-preview-header p { max-width: 720px; margin: 0; color: #717789; font-size: 12px; line-height: 1.6; }
.room-detail-meta,
.app-preview-status { justify-content: flex-start; }
.room-detail-block { padding: 18px 0; border-bottom: 1px solid var(--line); }
.room-detail-block span,
.app-data-label { display: block; margin-bottom: 7px; color: #8b90a1; font-size: 9px; font-weight: 760; letter-spacing: 0.1em; text-transform: uppercase; }
.room-detail-block strong { font-size: 13px; line-height: 1.5; }
.room-resource-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.room-resource-chips span,
.field-chip,
.stage-chip {
  min-height: 30px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  border: 1px solid #e1e1ea;
  border-radius: 10px;
  background: #fafafd;
  color: #666c7e;
  font-size: 10px;
  font-weight: 650;
}
.room-detail-actions { margin-top: auto; padding-top: 22px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.room-detail-actions button {
  min-height: 46px;
  padding: 0 13px;
  border: 1px solid #e0ddeb;
  border-radius: 12px;
  background: #fff;
  color: #4e5263;
  font-size: 10px;
  font-weight: 730;
  cursor: pointer;
}
.room-detail-actions button:hover { border-color: #bbb3ed; background: #f8f6ff; color: var(--blue); }

.factory-principles {
  margin-top: 30px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.factory-principles article {
  min-height: 116px;
  padding: 17px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 13px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: #fff;
}
.principle-number { color: var(--blue); font-size: 10px; font-weight: 800; }
.factory-principles article > div { display: grid; gap: 6px; }
.factory-principles strong { font-size: 12px; }
.factory-principles small { color: #818697; font-size: 10px; line-height: 1.5; }

.app-blueprint-summary { padding: 18px 0; display: grid; gap: 17px; border-bottom: 1px solid var(--line); }
.field-chip-list,
.stage-chip-list { display: flex; flex-wrap: wrap; gap: 7px; }
.stage-chip { border-color: #d9d4f4; background: #f6f4ff; color: var(--blue); }
.app-workspace { min-height: 0; padding-top: 18px; display: grid; gap: 16px; }
.app-workspace-heading { display: flex; align-items: end; justify-content: space-between; gap: 12px; }
.app-workspace-heading h3 { margin: 0; font-size: 16px; }
.app-workspace-heading small { color: #8d92a2; font-size: 9px; }
.app-record-list { display: grid; gap: 7px; }
.app-record {
  padding: 12px;
  display: grid;
  grid-template-columns: minmax(150px, 1.3fr) repeat(2, minmax(90px, 0.7fr));
  gap: 10px;
  border: 1px solid #e8e8ef;
  border-radius: 13px;
  background: #fff;
}
.app-record div { min-width: 0; display: grid; gap: 4px; }
.app-record span { color: #959aaa; font-size: 8px; font-weight: 760; letter-spacing: 0.08em; text-transform: uppercase; }
.app-record strong { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.app-record-form {
  padding: 15px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
  border: 1px solid #ded9f5;
  border-radius: 15px;
  background: #faf9ff;
}
.app-record-form label { display: grid; gap: 6px; color: #626879; font-size: 9px; font-weight: 720; }
.app-record-form input,
.app-record-form select {
  width: 100%;
  min-height: 42px;
  padding: 0 11px;
  border: 1px solid #dddde7;
  border-radius: 11px;
  background: #fff;
  color: var(--ink);
  font-size: 11px;
}
.record-form-actions { grid-column: 1 / -1; justify-content: flex-end; }
.approval-explanation { margin-top: 18px; padding: 15px; border: 1px solid #eee1c9; border-radius: 14px; background: #fffaf2; color: #786d5d; font-size: 11px; line-height: 1.55; }

.workspace-modal {
  position: fixed;
  inset: 0;
  padding: 22px;
  display: grid;
  place-items: center;
  background: rgba(23, 23, 43, 0.58);
  backdrop-filter: blur(14px);
  z-index: 85;
}
.workspace-modal-card {
  width: min(100%, 1120px);
  max-height: calc(100dvh - 44px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 34px 100px rgba(18, 20, 48, 0.28);
}
.workspace-modal-header {
  min-height: 82px;
  padding: 17px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--line);
}
.workspace-modal-header .eyebrow { color: var(--blue); font-size: 9px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; }
.workspace-modal-header h1 { margin: 5px 0 0; font-size: 22px; letter-spacing: -0.035em; }
.room-form-grid {
  min-height: 0;
  padding: 22px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  overflow-y: auto;
  background: #fbfbfd;
}
.workspace-form-section { padding: 18px; display: grid; align-content: start; gap: 9px; border: 1px solid var(--line); border-radius: 17px; background: #fff; }
.workspace-form-section.span-two { grid-column: 1 / -1; }
.form-step { margin-bottom: 4px; color: var(--blue); font-size: 9px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; }
.workspace-form-section > label { margin-top: 4px; color: #52586a; font-size: 10px; font-weight: 730; }
.workspace-form-section > input,
.workspace-form-section > textarea {
  width: 100%;
  padding: 12px 13px;
  border: 1px solid #dfe0e9;
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.5;
}
.workspace-form-section > textarea { resize: vertical; }
.choice-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.choice-cards label { min-width: 0; cursor: pointer; }
.choice-cards input { position: absolute; opacity: 0; pointer-events: none; }
.choice-cards label > span { min-height: 78px; padding: 12px; display: grid; align-content: center; gap: 5px; border: 1px solid var(--line); border-radius: 13px; background: #fafafd; }
.choice-cards strong { font-size: 10px; }
.choice-cards small { color: #8c91a1; font-size: 9px; line-height: 1.4; }
.choice-cards input:checked + span { border-color: #bfb7f0; background: #f5f2ff; box-shadow: inset 0 0 0 1px #cfc8f5; }
.choice-cards input:focus-visible + span { outline: 3px solid rgba(92, 72, 232, 0.2); outline-offset: 2px; }
.room-resource-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.room-resource-grid h2 { margin: 0 0 8px; font-size: 12px; }
.resource-choice-list { display: grid; gap: 6px; }
.resource-choice {
  min-height: 50px;
  padding: 10px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fafafd;
  cursor: pointer;
}
.resource-choice input { accent-color: var(--blue); }
.resource-choice span { min-width: 0; display: grid; gap: 3px; }
.resource-choice strong { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.resource-choice small { overflow: hidden; color: #8d92a2; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.workspace-modal-actions { min-height: 70px; padding: 12px 20px; display: flex; align-items: center; justify-content: space-between; gap: 18px; border-top: 1px solid var(--line); }
.workspace-modal-actions > span { color: #858a9a; font-size: 10px; }
.room-studio-card > .wizard-feedback { margin: 0; padding: 0 22px 8px; }

.factory-studio-card { height: min(740px, calc(100dvh - 44px)); grid-template-rows: auto minmax(0, 1fr); }
.factory-wizard-layout { min-height: 0; display: grid; grid-template-columns: 250px minmax(0, 1fr); }
.factory-wizard-sidebar { min-height: 0; padding: 25px 20px; border-right: 1px solid var(--line); background: #f7f7fb; }
.factory-wizard-content { min-height: 0; padding: clamp(28px, 5vw, 52px); display: flex; flex-direction: column; overflow-y: auto; }
.factory-wizard-content .wizard-step select { width: 100%; min-height: 48px; padding: 0 13px; border: 1px solid #dce3ed; border-radius: 14px; background: #fff; color: var(--ink); font-size: 12px; }
.factory-source-summary,
.factory-review { margin-top: 8px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: #f8f8fc; color: #656b7d; font-size: 11px; line-height: 1.55; }
.factory-source-summary strong,
.factory-review strong { color: var(--ink); }
.blueprint-preview { display: grid; gap: 18px; }
.blueprint-block { display: grid; gap: 9px; }
.blueprint-block > span { color: #818697; font-size: 9px; font-weight: 760; letter-spacing: 0.1em; text-transform: uppercase; }
.blueprint-row { padding: 11px 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.blueprint-row strong { font-size: 11px; }
.blueprint-row small { color: #9297a7; font-size: 9px; }

@media (max-width: 719px) {
  .bottom-nav { overflow-x: auto; justify-content: flex-start; scrollbar-width: none; }
  .bottom-nav::-webkit-scrollbar { display: none; }
  .bottom-nav button { min-width: 72px; }
  .company-page { padding-top: 22px; }
  .company-heading { align-items: flex-start; flex-direction: column; }
  .company-heading .page-intro h1 { font-size: 34px; }
  .company-heading .primary-action { width: 100%; margin: 0; }
  .company-metrics,
  .factory-principles { grid-template-columns: 1fr; }
  .company-metrics article { min-height: 92px; }
  .rooms-layout,
  .factory-layout { grid-template-columns: 1fr; }
  .company-panel { padding: 15px; }
  .room-detail-panel,
  .app-preview-panel { min-height: 390px; }
  .app-record { grid-template-columns: 1fr 1fr; }
  .app-record div:first-child { grid-column: 1 / -1; }
  .app-record-form { grid-template-columns: 1fr; }
  .record-form-actions { grid-column: 1; }
  .workspace-modal { padding: 0; }
  .workspace-modal-card,
  .factory-studio-card { width: 100%; height: 100dvh; max-height: none; border: 0; border-radius: 0; }
  .workspace-modal-header { min-height: 74px; padding: calc(11px + env(safe-area-inset-top)) 16px 11px; }
  .room-form-grid { grid-template-columns: 1fr; padding: 14px; }
  .workspace-form-section.span-two { grid-column: 1; }
  .choice-cards,
  .room-resource-grid { grid-template-columns: 1fr; }
  .workspace-modal-actions { padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
  .workspace-modal-actions > span { display: none; }
  .workspace-modal-actions .primary-action { width: 100%; }
  .factory-wizard-layout { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); }
  .factory-wizard-sidebar { padding: 12px 16px; border-right: 0; border-bottom: 1px solid var(--line); }
  .factory-wizard-content { padding: 22px 18px calc(20px + env(safe-area-inset-bottom)); }
}

@media (min-width: 720px) and (max-width: 1023px) {
  .company-page > * { width: min(100%, 960px) !important; }
  .rooms-layout,
  .factory-layout { grid-template-columns: minmax(250px, 0.72fr) minmax(360px, 1.28fr); }
}

@media (min-width: 1024px) {
  .app-shell {
    grid-template-columns: 216px minmax(0, 1fr);
  }
  .topbar {
    position: relative;
    padding: 18px 22px;
    justify-content: flex-start;
    isolation: isolate;
    z-index: 20;
  }
  .topbar .brand { position: relative; z-index: 1; }
  .topbar .brand-mark { visibility: visible; }
  .topbar .brand-copy { display: grid; }
  .topbar .brand-copy strong { white-space: normal; line-height: 1.15; }
  .bottom-nav {
    padding: 14px 16px 22px;
    align-items: stretch;
    gap: 5px;
  }
  .bottom-nav button {
    width: 100%;
    min-height: 50px;
    padding: 0 13px;
    flex-direction: row;
    justify-content: flex-start;
    gap: 12px;
    border-radius: 12px;
    font-size: 11px;
  }
  .bottom-nav button .icon { width: 20px; height: 20px; }
  .bottom-nav button:last-child { margin-top: auto; }
  .content-page { padding-top: 42px; }
  .detail-view { width: min(590px, calc(100% - 216px)); }
}

@media (min-width: 1280px) {
  .app-shell:has(.detail-view:not([hidden])) { grid-template-columns: 216px minmax(500px, 1fr) minmax(340px, 400px); }
}
