:root {
  color-scheme: light;
  --page: #e9e8e3;
  --page-2: #f2f1ed;
  --paper: #ffffff;
  --paper-warm: #faf9f6;
  --sidebar: #f3f3f1;
  --ink: #202124;
  --ink-soft: #4f5155;
  --muted: #8a8d91;
  --line: #deded9;
  --line-strong: #c9c9c3;
  --purple: #7856d8;
  --purple-soft: #eee9fb;
  --blue: #3978d6;
  --blue-soft: #eaf2fc;
  --green: #257a54;
  --green-soft: #e8f5ee;
  --amber: #9b6720;
  --amber-soft: #fff3dd;
  --red: #ae453f;
  --red-soft: #faecea;
  --shadow: 0 30px 80px rgba(29, 31, 35, 0.18), 0 2px 10px rgba(29, 31, 35, 0.08);
  --radius-window: 22px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Noto Sans SC", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-width: 320px;
  min-height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
  background: var(--page);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

button,
textarea,
input {
  font: inherit;
}

button {
  color: inherit;
}

button,
[role="button"] {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
[role="button"]:focus-visible,
input:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(120, 86, 216, 0.3);
  outline-offset: 2px;
}

a {
  color: inherit;
}

svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.guide-header {
  position: relative;
  z-index: 100;
  height: 76px;
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto minmax(240px, 1fr);
  align-items: center;
  gap: 24px;
  padding: 0 24px;
  background: rgba(248, 247, 243, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(22px) saturate(130%);
}

.guide-brand,
.guide-actions,
.guide-tabs,
.guide-tab,
.ghost-button,
.coverage-pill {
  display: flex;
  align-items: center;
}

.guide-brand {
  gap: 11px;
  min-width: 0;
}

.brand-mark {
  width: 36px;
  height: 36px;
  position: relative;
  flex: 0 0 auto;
}

.brand-mark span {
  position: absolute;
  width: 17px;
  height: 17px;
  border: 2px solid var(--ink);
  border-radius: 7px;
}

.brand-mark span:nth-child(1) { left: 2px; top: 2px; }
.brand-mark span:nth-child(2) { right: 2px; top: 2px; }
.brand-mark span:nth-child(3) { left: 2px; bottom: 2px; }
.brand-mark span:nth-child(4) { right: 2px; bottom: 2px; background: var(--purple); border-color: var(--purple); }

.brand-kicker {
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.brand-title {
  margin-top: 2px;
  font-size: 16px;
  font-weight: 760;
  letter-spacing: -0.02em;
}

.guide-tabs {
  gap: 3px;
  padding: 4px;
  background: #e6e5e0;
  border: 1px solid #dad9d4;
  border-radius: 12px;
}

.guide-tab {
  justify-content: center;
  min-height: 34px;
  padding: 0 14px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #66686c;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease, box-shadow 150ms ease;
}

.guide-tab:hover {
  color: var(--ink);
}

.guide-tab.is-active {
  background: #ffffff;
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.11);
}

.guide-actions {
  justify-content: flex-end;
  gap: 10px;
}

.ghost-button,
.text-button,
.source-button,
.primary-action,
.secondary-action {
  border: 0;
  cursor: pointer;
}

.ghost-button {
  gap: 7px;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  font-weight: 680;
}

.ghost-button:hover,
.ghost-button[aria-pressed="true"] {
  background: var(--paper);
  border-color: #aca9a1;
}

.button-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--purple);
}

.coverage-pill {
  justify-content: center;
  min-width: 61px;
  height: 36px;
  gap: 3px;
  padding: 0 10px;
  border-radius: 10px;
  background: #27282b;
  color: #dadadd;
  font-size: 12px;
}

.coverage-pill strong {
  color: #ffffff;
  font-size: 14px;
}

.guide-main {
  height: calc(100vh - 76px);
}

.guide-screen {
  display: none;
  width: 100%;
  height: 100%;
  overflow: auto;
}

.guide-screen.is-active {
  display: block;
  animation: screen-in 220ms ease both;
}

@keyframes screen-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

#screen-simulator {
  overflow: hidden;
  padding: 14px 18px 18px;
}

.simulator-meta {
  height: 34px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 2px 10px;
}

.live-label {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 680;
}

.live-label span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #28a76b;
  box-shadow: 0 0 0 4px rgba(40, 167, 107, 0.12);
}

.simulator-hint {
  flex: 1;
  color: var(--muted);
  font-size: 12px;
}

.text-button {
  padding: 4px 0;
  background: transparent;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 650;
}

.text-button:hover {
  color: var(--purple);
}

.simulator-layout {
  height: calc(100% - 34px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 336px;
  gap: 14px;
}

.codex-stage {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  display: grid;
  place-items: center;
  padding: 12px;
  border: 1px solid #d3d2cc;
  border-radius: 18px;
  background: #d9d8d2;
  background-image: linear-gradient(#d2d1cb 1px, transparent 1px), linear-gradient(90deg, #d2d1cb 1px, transparent 1px);
  background-size: 24px 24px;
}

.codex-window {
  position: relative;
  width: min(100%, 1180px);
  min-width: 900px;
  height: min(100%, 780px);
  min-height: 540px;
  display: grid;
  grid-template-columns: 246px minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-window);
  background: var(--paper);
  box-shadow: var(--shadow);
  transition: grid-template-columns 220ms cubic-bezier(.2,.8,.2,1);
}

.codex-window.sidebar-collapsed {
  grid-template-columns: 58px minmax(0, 1fr);
}

.app-sidebar {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: rgba(244, 244, 242, 0.96);
  border-right: 1px solid #dededb;
  transition: width 220ms ease;
}

.sidebar-chrome {
  height: 50px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  flex: 0 0 auto;
}

.traffic-lights {
  display: flex;
  gap: 7px;
  margin-right: 6px;
  cursor: pointer;
}

.traffic {
  width: 12px;
  height: 12px;
  border: 0.5px solid rgba(0, 0, 0, 0.16);
  border-radius: 50%;
}

.traffic.red { background: #ff6159; }
.traffic.amber { background: #ffbd2e; }
.traffic.green { background: #28c840; }

.icon-button {
  position: relative;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #626468;
  cursor: pointer;
  transition: background 130ms ease, color 130ms ease;
}

.icon-button:hover {
  background: rgba(0, 0, 0, 0.06);
  color: var(--ink);
}

.icon-button.is-muted {
  opacity: 0.3;
}

.workspace-row {
  height: 44px;
  display: flex;
  align-items: center;
  padding: 0 10px 4px 14px;
  flex: 0 0 auto;
}

.workspace-switch {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  padding: 7px 6px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  font-size: 15px;
  font-weight: 750;
  cursor: pointer;
}

.workspace-switch svg {
  width: 14px;
  height: 14px;
}

.primary-nav {
  display: grid;
  gap: 1px;
  padding: 2px 8px 10px;
  flex: 0 0 auto;
}

.sidebar-item,
.project-row,
.chat-row,
.profile-button {
  position: relative;
  min-width: 0;
  display: flex;
  align-items: center;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.sidebar-item {
  height: 33px;
  gap: 10px;
  padding: 0 10px;
  border-radius: 8px;
  color: #434549;
  font-size: 13px;
  font-weight: 560;
}

.sidebar-item:hover,
.project-row:hover,
.chat-row:hover,
.profile-button:hover {
  background: rgba(0, 0, 0, 0.05);
}

.sidebar-item svg {
  width: 17px;
  height: 17px;
}

.quick-chat-dot {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  margin-left: auto;
  border: 1px solid #c7c7c2;
  border-radius: 6px;
  color: #707276;
  font-size: 9px;
  font-weight: 800;
  opacity: 0;
  transition: opacity 130ms ease;
}

.sidebar-item:hover .quick-chat-dot,
.show-annotations .quick-chat-dot {
  opacity: 1;
}

.unread-dot,
.task-status {
  width: 7px;
  height: 7px;
  margin-left: auto;
  border-radius: 50%;
  background: #3289e8;
}

.sidebar-scroll {
  min-height: 0;
  overflow: auto;
  flex: 1;
  padding: 2px 8px 12px;
  scrollbar-width: thin;
}

.sidebar-group + .sidebar-group {
  margin-top: 12px;
}

.sidebar-label {
  padding: 6px 9px;
  color: #999b9e;
  font-size: 11px;
  font-weight: 650;
}

.project-row {
  width: 100%;
  height: 31px;
  gap: 7px;
  padding: 0 8px;
  border-radius: 7px;
  color: #4a4c50;
  font-size: 12px;
  font-weight: 610;
}

.project-row > svg:first-child {
  width: 15px;
  height: 15px;
}

.row-chevron {
  width: 13px;
  height: 13px;
  margin-left: auto;
  transform: rotate(180deg);
  transition: transform 140ms ease;
}

.project-row.is-collapsed .row-chevron {
  transform: rotate(0deg);
}

.project-chats {
  display: grid;
  gap: 1px;
}

.chat-row {
  width: 100%;
  min-height: 30px;
  gap: 7px;
  padding: 6px 8px 6px 28px;
  border-radius: 7px;
  color: #595b60;
  font-size: 11.5px;
  line-height: 1.25;
}

.chat-row.is-selected {
  background: #e3e3e0;
  color: #242529;
  font-weight: 620;
}

.pin-icon {
  width: 12px;
  height: 12px;
  margin-left: auto;
}

.sidebar-footer {
  height: 48px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  padding: 6px 10px;
  border-top: 1px solid #dededb;
}

.profile-button {
  height: 34px;
  gap: 8px;
  flex: 1;
  padding: 0 5px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 620;
}

.avatar {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #3e4651;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
}

.codex-window.sidebar-collapsed .traffic-lights,
.codex-window.sidebar-collapsed .sidebar-chrome .icon-button:not(:first-of-type),
.codex-window.sidebar-collapsed .workspace-switch span,
.codex-window.sidebar-collapsed .workspace-switch svg,
.codex-window.sidebar-collapsed .workspace-row > .icon-button,
.codex-window.sidebar-collapsed .sidebar-item span:not(.unread-dot),
.codex-window.sidebar-collapsed .sidebar-label,
.codex-window.sidebar-collapsed .project-row span,
.codex-window.sidebar-collapsed .project-row .row-chevron,
.codex-window.sidebar-collapsed .project-chats,
.codex-window.sidebar-collapsed .chat-row,
.codex-window.sidebar-collapsed .profile-button span:not(.avatar),
.codex-window.sidebar-collapsed .sidebar-footer > .icon-button {
  display: none;
}

.codex-window.sidebar-collapsed .sidebar-chrome,
.codex-window.sidebar-collapsed .workspace-row,
.codex-window.sidebar-collapsed .primary-nav,
.codex-window.sidebar-collapsed .sidebar-scroll,
.codex-window.sidebar-collapsed .sidebar-footer {
  padding-left: 8px;
  padding-right: 8px;
  justify-content: center;
}

.codex-window.sidebar-collapsed .sidebar-item,
.codex-window.sidebar-collapsed .project-row,
.codex-window.sidebar-collapsed .profile-button {
  width: 40px;
  justify-content: center;
  padding: 0;
}

.app-main {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: 50px minmax(0, 1fr);
  background: #fff;
}

.task-toolbar {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0 12px;
  border-bottom: 1px solid #ecece9;
}

.task-identity {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 6px;
  border-radius: 8px;
  cursor: pointer;
}

.task-identity:hover {
  background: #f3f3f1;
}

.task-identity > svg {
  width: 16px;
  height: 16px;
  color: #64666a;
}

.task-identity div {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.task-identity strong {
  overflow: hidden;
  color: #343539;
  font-size: 12.5px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-identity span {
  color: #989a9e;
  font-size: 9.5px;
  line-height: 1.25;
}

.toolbar-spacer,
.composer-spacer {
  flex: 1;
}

.toolbar-feature {
  border: 1px solid transparent;
}

.toolbar-feature.is-active {
  border-color: #d6d4ce;
  background: #f2f1ee;
  color: var(--purple);
}

.app-workspace {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 222px;
  transition: grid-template-columns 200ms ease;
}

.app-workspace.outputs-hidden {
  grid-template-columns: minmax(0, 1fr) 0;
}

.conversation-column {
  position: relative;
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  overflow: hidden;
}

.view-host {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  padding: 28px 28px 154px;
  scrollbar-width: thin;
}

.view-host.panel-open {
  padding-bottom: 300px;
}

.chat-view {
  width: min(100%, 760px);
  margin: 0 auto;
}

.user-message {
  width: fit-content;
  max-width: 78%;
  margin: 0 0 32px auto;
  padding: 13px 16px;
  border-radius: 16px 16px 5px 16px;
  background: #f0f0ee;
  color: #37393d;
  font-size: 13px;
  line-height: 1.65;
}

.assistant-block {
  display: grid;
  gap: 15px;
}

.working-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #717378;
  font-size: 12px;
}

.working-label .spinner {
  width: 14px;
  height: 14px;
  border: 2px solid #d2d2ce;
  border-top-color: var(--purple);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

.assistant-copy {
  padding-top: 13px;
  border-top: 1px solid #e6e6e2;
  color: #3e4044;
  font-size: 13px;
  line-height: 1.75;
}

.assistant-copy p {
  margin: 0 0 12px;
}

.assistant-copy code,
.dialog-icon + div code,
.template-preview code,
.scope-box code {
  padding: 2px 5px;
  border-radius: 5px;
  background: #efefec;
  font-family: var(--mono);
  font-size: 0.9em;
}

.activity-stream {
  display: grid;
  gap: 7px;
}

.activity-item {
  display: grid;
  grid-template-columns: 19px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid #ecece8;
  border-radius: 9px;
  background: #fbfbfa;
  color: #65676b;
  font-size: 11px;
}

.activity-item svg {
  width: 15px;
  height: 15px;
}

.activity-item em {
  color: #a1a3a6;
  font-size: 9px;
  font-style: normal;
}

.activity-item.is-done svg,
.activity-item.is-done em {
  color: var(--green);
}

.activity-item.is-active {
  border-color: #d9d2f2;
  background: #faf8ff;
  color: #4c3f70;
}

.view-intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.view-intro h2 {
  margin: 4px 0 4px;
  font-size: 24px;
  letter-spacing: -0.035em;
}

.view-intro p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.view-intro .view-action {
  height: 34px;
  padding: 0 13px;
  border: 0;
  border-radius: 8px;
  background: #292a2e;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.feature-list {
  display: grid;
  gap: 9px;
}

.feature-row {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  padding: 13px 14px;
  border: 1px solid #e5e5e0;
  border-radius: 10px;
  background: #fff;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.feature-row:hover {
  border-color: #cbc9c2;
}

.feature-row strong {
  display: block;
  margin-bottom: 4px;
  font-size: 12.5px;
}

.feature-row p {
  margin: 0;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.5;
}

.feature-row .status-badge {
  align-self: center;
}

.status-badge,
.status-chip,
.inspector-status,
.lesson-level,
.source-group {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 999px;
  font-size: 9.5px;
  font-weight: 760;
}

.status-badge {
  padding: 5px 8px;
  background: var(--green-soft);
  color: var(--green);
}

.status-badge.is-paused { background: #eeeeeb; color: #717277; }
.status-badge.is-unread { background: var(--blue-soft); color: var(--blue); }
.status-badge.is-installed { background: var(--purple-soft); color: var(--purple); }

.site-grid,
.plugin-grid,
.skill-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
}

.site-card,
.plugin-card,
.skill-card {
  min-height: 120px;
  padding: 14px;
  border: 1px solid #e2e1dc;
  border-radius: 12px;
  background: #fafaf8;
}

.site-thumb {
  height: 54px;
  margin-bottom: 11px;
  border: 1px solid #deddd8;
  border-radius: 7px;
  background: linear-gradient(90deg, #eae8e1 32%, #f6f5f0 32%);
}

.site-card strong,
.plugin-card strong,
.skill-card strong {
  font-size: 12px;
}

.site-card p,
.plugin-card p,
.skill-card p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.plugin-icon,
.skill-icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  margin-bottom: 12px;
  border-radius: 9px;
  background: #282a2d;
  color: #fff;
}

.plugin-card button,
.skill-card button {
  margin-top: 11px;
  padding: 6px 10px;
  border: 1px solid #d3d1ca;
  border-radius: 7px;
  background: #fff;
  font-size: 10px;
  font-weight: 680;
  cursor: pointer;
}

.plugin-card button:disabled {
  border-color: #cfe0d5;
  background: var(--green-soft);
  color: var(--green);
  cursor: default;
}

.new-chat-view,
.quick-chat-view {
  min-height: 390px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.new-chat-view > p,
.quick-chat-view > p {
  max-width: 520px;
  margin: 0;
  color: #737579;
  font-size: 11.5px;
  line-height: 1.7;
}

.new-chat-view h2,
.quick-chat-view h2 {
  margin: 8px 0 9px;
  font-size: 28px;
  letter-spacing: -0.045em;
}

.new-chat-orbit {
  position: relative;
  width: 70px;
  height: 70px;
  margin-bottom: 22px;
  border: 1px solid #d1cfc8;
  border-radius: 50%;
}

.new-chat-orbit::before,
.new-chat-orbit::after {
  content: "";
  position: absolute;
  border-radius: 50%;
}

.new-chat-orbit::before {
  inset: 12px;
  border: 1px solid #dddcd6;
}

.new-chat-orbit::after {
  inset: 25px;
  background: #292a2d;
}

.new-chat-orbit span {
  position: absolute;
  width: 8px;
  height: 8px;
  border: 2px solid var(--purple);
  border-radius: 50%;
  background: #fff;
}

.new-chat-orbit span:nth-child(1) { top: 4px; left: 30px; }
.new-chat-orbit span:nth-child(2) { right: 6px; bottom: 14px; }
.new-chat-orbit span:nth-child(3) { left: 5px; bottom: 10px; }

.new-chat-config {
  width: min(100%, 610px);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 22px;
}

.new-chat-config button {
  min-width: 0;
  min-height: 62px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px;
  border: 1px solid #deddd8;
  border-radius: 10px;
  background: #fafaf8;
  color: #55575b;
  text-align: left;
  cursor: pointer;
}

.new-chat-config button:hover {
  border-color: #aaa79f;
  background: #fff;
}

.new-chat-config button > span {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.new-chat-config small {
  color: #999b9e;
  font-size: 8px;
}

.new-chat-config strong {
  overflow: hidden;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quick-mark {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  margin-bottom: 20px;
  border-radius: 18px;
  background: var(--purple-soft);
  color: var(--purple);
}

.quick-mark svg {
  width: 28px;
  height: 28px;
}

.quick-chat-view .primary-action {
  margin-top: 20px;
}

.completion-card {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 11px;
  margin-top: 4px;
  padding: 13px;
  border: 1px solid #c8ddd1;
  border-radius: 11px;
  background: #f4fbf7;
}

.completion-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--green-soft);
  color: var(--green);
}

.completion-card strong {
  display: block;
  margin: 2px 0 4px;
  color: #345843;
  font-size: 11px;
}

.completion-card p {
  margin: 0;
  color: #65806f;
  font-size: 9.5px;
  line-height: 1.5;
}

.completion-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 4px;
}

.completion-actions button {
  min-height: 29px;
  padding: 0 9px;
  border: 1px solid #bfd3c6;
  border-radius: 7px;
  background: #fff;
  color: #37634a;
  font-size: 9px;
  font-weight: 700;
  cursor: pointer;
}

.stopped-note,
.steer-note {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 10px 11px;
  border-radius: 9px;
  font-size: 9.5px;
  line-height: 1.5;
}

.stopped-note {
  border: 1px solid #e6d4d0;
  background: var(--red-soft);
  color: #7a4c47;
}

.stopped-note strong {
  flex: 0 0 auto;
  color: var(--red);
}

.steer-note {
  border: 1px solid #d8d1ef;
  background: #f8f5ff;
  color: #5f537d;
}

.steer-note span {
  flex: 0 0 auto;
  color: var(--purple);
  font-weight: 800;
}

.attachment-chip {
  width: fit-content;
  max-width: 100%;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  padding: 5px 7px;
  border: 1px solid #dad8d1;
  border-radius: 7px;
  background: #f6f5f1;
  color: #5e6064;
  font-size: 9px;
}

.attachment-chip svg {
  width: 12px;
  height: 12px;
}

.attachment-chip button {
  width: 16px;
  height: 16px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #999b9e;
  cursor: pointer;
}

.listening-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0 4px rgba(174, 69, 63, 0.14);
  animation: listening 800ms ease-in-out infinite alternate;
}

@keyframes listening {
  to { transform: scale(.72); opacity: .6; }
}

.composer-wrap {
  position: absolute;
  z-index: 20;
  right: 22px;
  bottom: 18px;
  left: 22px;
}

.composer {
  min-height: 94px;
  padding: 12px 12px 9px;
  border: 1px solid #d8d8d4;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 10px 32px rgba(32, 34, 38, 0.09);
  backdrop-filter: blur(18px);
}

.composer textarea {
  width: 100%;
  min-height: 40px;
  resize: none;
  border: 0;
  outline: 0;
  background: transparent;
  color: #34363a;
  font-size: 12px;
  line-height: 1.55;
}

.composer textarea::placeholder {
  color: #a5a7aa;
}

.composer-footer {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 5px;
}

.composer-chip {
  min-width: 0;
  height: 29px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #6e7074;
  font-size: 10px;
  cursor: pointer;
}

.composer-chip:hover {
  background: #f0f0ed;
  color: #393a3e;
}

.composer-chip svg {
  width: 13px;
  height: 13px;
}

.chip-status {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
}

.model-chip strong {
  color: #3f4044;
}

.model-chip span {
  color: var(--purple);
}

.send-button {
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #222326;
  color: #fff;
  cursor: pointer;
  transition: transform 120ms ease, background 120ms ease;
}

.send-button:hover {
  transform: scale(1.04);
  background: #000;
}

.send-button svg {
  width: 15px;
  height: 15px;
}

.send-button.is-running {
  background: #242529;
}

.queued-message,
.running-actions {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 10px 7px;
  padding: 7px 9px;
  border: 1px solid #d9d4ec;
  border-radius: 8px;
  background: #f8f5ff;
  color: #5e5180;
  font-size: 10px;
}

.queued-message.is-visible,
.running-actions.is-visible {
  display: flex;
}

.queued-message button,
.running-actions button {
  border: 0;
  background: transparent;
  color: var(--purple);
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}

.running-actions {
  justify-content: flex-end;
  border: 0;
  background: transparent;
}

.running-actions button {
  padding: 5px 8px;
  border: 1px solid #d8d4e5;
  border-radius: 7px;
  background: #fff;
}

.outputs-panel {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  padding: 14px 12px;
  border-left: 1px solid #ecece9;
  background: #fbfbfa;
  transition: opacity 160ms ease, transform 180ms ease;
}

.outputs-hidden .outputs-panel {
  opacity: 0;
  transform: translateX(20px);
  pointer-events: none;
}

.outputs-header,
.create-output,
.subagents-row {
  display: flex;
  align-items: center;
}

.outputs-header {
  justify-content: space-between;
  padding: 0 3px 8px 6px;
}

.outputs-header strong {
  color: #77797d;
  font-size: 12px;
}

.create-output,
.subagents-row {
  width: 100%;
  gap: 9px;
  padding: 10px 8px;
  border: 0;
  border-top: 1px solid #e6e6e2;
  background: transparent;
  color: #85878b;
  text-align: left;
  cursor: pointer;
}

.create-output:hover,
.subagents-row:hover {
  background: #f0f0ed;
}

.create-output span {
  font-size: 11px;
}

.subagents-row div {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.subagents-row span {
  color: #77797d;
  font-size: 11px;
}

.subagents-row strong {
  color: #4a4c50;
  font-size: 10px;
}

.agent-list {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 180ms ease, opacity 180ms ease;
}

.agent-list.is-open {
  max-height: 140px;
  opacity: 1;
}

.agent-list > div {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  color: #6f7175;
  font-size: 9.5px;
}

.agent-list em {
  color: #aaa;
  font-size: 8.5px;
  font-style: normal;
}

.agent-orb {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.agent-orb.yellow { background: #e8bd42; }
.agent-orb.blue { background: #4e8be0; }
.agent-orb.pink { background: #e276ad; }

.output-tip {
  margin-top: 12px;
  padding: 10px;
  border: 1px solid #e5e3dc;
  border-radius: 9px;
  background: #fffefa;
}

.output-tip span {
  color: var(--amber);
  font-size: 9px;
  font-weight: 800;
}

.output-tip p {
  margin: 5px 0 0;
  color: #737579;
  font-size: 9.5px;
  line-height: 1.55;
}

.terminal-panel,
.review-panel {
  position: absolute;
  z-index: 25;
  right: 0;
  bottom: 0;
  left: 0;
  display: none;
  border-top: 1px solid #cecec9;
  background: #fff;
  box-shadow: 0 -16px 36px rgba(31, 33, 37, 0.08);
}

.terminal-panel.is-open,
.review-panel.is-open {
  display: block;
  animation: panel-up 180ms ease both;
}

@keyframes panel-up {
  from { transform: translateY(18px); opacity: 0; }
  to { transform: none; opacity: 1; }
}

.terminal-panel {
  height: 190px;
  background: #202226;
  color: #e8e9eb;
}

.panel-header,
.review-header {
  height: 37px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.panel-header > div,
.review-header > div {
  display: flex;
  align-items: center;
  gap: 7px;
}

.panel-header svg,
.review-header svg {
  width: 14px;
  height: 14px;
}

.panel-header strong,
.review-header strong {
  font-size: 10.5px;
}

.panel-header span,
.review-header span {
  color: #8f9298;
  font-size: 9px;
}

.panel-close {
  border: 0;
  background: transparent;
  color: #999ca2;
  font-size: 9px;
  cursor: pointer;
}

.terminal-output {
  padding: 13px 15px;
  font-family: var(--mono);
  font-size: 10px;
  line-height: 1.8;
}

.terminal-output .prompt { color: #8c8f95; }
.terminal-output .success { color: #70d29f; }
.terminal-output .cursor { display: inline-block; width: 6px; height: 12px; background: #d9dadd; animation: blink 1s step-end infinite; }
@keyframes blink { 50% { opacity: 0; } }

.review-panel {
  height: 330px;
  overflow: auto;
}

.review-header {
  border-bottom-color: #e6e6e2;
}

.review-filters {
  display: flex;
  gap: 4px;
  padding: 7px 10px;
  border-bottom: 1px solid #eeeeea;
}

.review-filter {
  padding: 5px 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #797b7f;
  font-size: 9px;
  cursor: pointer;
}

.review-filter.is-active {
  background: #e9e8e4;
  color: #35363a;
  font-weight: 700;
}

.diff-file {
  margin: 8px 10px 0;
  border: 1px solid #e0e0dc;
  border-radius: 8px;
  overflow: hidden;
}

.diff-file-header {
  display: flex;
  justify-content: space-between;
  padding: 7px 9px;
  background: #f6f6f3;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
}

.diff-count {
  color: var(--green);
}

.diff-line {
  position: relative;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  min-height: 23px;
  align-items: center;
  border-top: 1px solid rgba(0, 0, 0, 0.03);
  font-family: var(--mono);
  font-size: 8.5px;
}

.diff-line > span {
  padding-right: 6px;
  color: #a2a4a7;
  text-align: right;
  user-select: none;
}

.diff-line code {
  white-space: pre;
}

.diff-line.added { background: #edf8f1; }
.diff-line.removed { background: #fbedeb; }

.inline-add {
  position: absolute;
  right: 5px;
  width: 18px;
  height: 18px;
  padding: 0;
  border: 1px solid #b9cfc0;
  border-radius: 4px;
  background: #fff;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  opacity: 0;
}

.diff-line:hover .inline-add,
.show-annotations .inline-add {
  opacity: 1;
}

.inline-comment-box {
  display: none;
  gap: 6px;
  padding: 7px 8px;
  border-top: 1px solid #d5e4da;
  background: #f6fbf8;
}

.inline-comment-box.is-open {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
}

.inline-comment-box textarea {
  min-height: 48px;
  resize: vertical;
  border: 1px solid #cbd7cf;
  border-radius: 6px;
  padding: 7px;
  font-size: 9px;
}

.inline-comment-box button {
  align-self: end;
  height: 27px;
  border: 0;
  border-radius: 6px;
  background: #2f6f4f;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  cursor: pointer;
}

.saved-inline-comment {
  margin: 7px 8px;
  padding: 8px 9px;
  border: 1px solid #c8ddcf;
  border-radius: 7px;
  background: #f2faf5;
}

.saved-inline-comment[hidden] {
  display: none;
}

.saved-inline-comment span {
  display: block;
  margin-bottom: 3px;
  color: #2f6f4f;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.saved-inline-comment p {
  margin: 0;
  color: #35423a;
  font-size: 9px;
  line-height: 1.45;
}

.review-actions {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
  padding: 9px 10px 10px;
}

.primary-action,
.secondary-action,
.source-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 13px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 720;
  text-decoration: none;
}

.primary-action {
  background: #27282b;
  color: #fff;
}

.primary-action:hover {
  background: #0f1012;
}

.primary-action:disabled {
  background: #d7d7d3;
  color: #9a9b9f;
  cursor: not-allowed;
}

.secondary-action {
  border: 1px solid #d5d3cc;
  background: #fff;
  color: #4d4f53;
}

.settings-shell {
  position: absolute;
  z-index: 60;
  inset: 0;
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-columns: 224px minmax(0, 1fr);
  overflow: hidden;
  background: #fff;
  color: #222326;
}

.settings-shell[hidden] {
  display: none;
}

.settings-sidebar {
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  padding: 12px 10px 24px;
  border-right: 1px solid #dfdfdc;
  background: #f7f7f5;
  scrollbar-width: thin;
}

.settings-sidebar-top {
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 8px 8px;
}

.settings-sidebar-top > strong {
  font-size: 14px;
  letter-spacing: -0.01em;
}

.settings-close {
  height: 28px;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0 8px;
  border: 1px solid #dadad6;
  border-radius: 8px;
  background: #fff;
  color: #66686c;
  cursor: pointer;
}

.settings-close:hover {
  background: #eeeeeb;
  color: #222326;
}

.settings-close svg {
  display: none;
  width: 14px;
  height: 14px;
}

.settings-close span {
  font-size: 10px;
  font-weight: 700;
}

.settings-group + .settings-group {
  margin-top: 14px;
}

.settings-group-label {
  padding: 7px 9px 5px;
  color: #aaa9a6;
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.01em;
}

.settings-nav-item {
  width: 100%;
  min-height: 34px;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 0 9px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: #25262a;
  text-align: left;
  cursor: pointer;
}

.settings-nav-item:hover {
  background: #efefed;
}

.settings-nav-item.is-active,
.settings-nav-item[aria-current="page"] {
  background: #e8e8e6;
}

.settings-nav-item svg {
  width: 16px;
  height: 16px;
  color: #24262a;
}

.settings-nav-item span {
  overflow: hidden;
  font-size: 12px;
  font-weight: 520;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-nav-item em {
  color: #a7a8ab;
  font-size: 12px;
  font-style: normal;
}

.settings-content {
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  padding: 29px 34px 46px;
  background: #fff;
  scrollbar-width: thin;
  transition: background 160ms ease, color 160ms ease;
}

.settings-page {
  width: min(100%, 650px);
  margin: 0 auto;
}

.settings-page-header {
  margin-bottom: 22px;
}

.settings-page-kicker {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 8px;
  color: #8f9094;
  font-size: 9px;
  font-weight: 760;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.settings-page-kicker span:first-child {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #2e8a60;
}

.settings-page-kicker.is-observed span:first-child {
  background: #d08a2c;
}

.settings-page-kicker.is-conditional span:first-child {
  background: #6d7fc3;
}

.settings-page-header h2 {
  margin: 0;
  color: #232428;
  font-size: 25px;
  font-weight: 670;
  letter-spacing: -0.035em;
}

.settings-page-header p {
  max-width: 580px;
  margin: 8px 0 0;
  color: #6f7176;
  font-size: 12px;
  line-height: 1.65;
}

.settings-evidence-note {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 8px;
  margin: 0 0 14px;
  padding: 10px 12px;
  border: 1px solid #e2dfd3;
  border-radius: 10px;
  background: #fbfaf5;
  color: #696a6e;
  font-size: 10px;
  line-height: 1.5;
}

.settings-evidence-note svg {
  width: 15px;
  height: 15px;
  margin-top: 1px;
  color: #a57528;
}

.settings-card {
  overflow: hidden;
  border: 1px solid #deded9;
  border-radius: 13px;
  background: #fff;
}

.settings-row {
  min-height: 67px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 13px 15px;
}

.settings-row + .settings-row {
  border-top: 1px solid #ecece8;
}

.settings-row-copy {
  min-width: 0;
}

.settings-row-copy strong {
  display: block;
  color: #2d2e32;
  font-size: 11.5px;
  font-weight: 650;
  line-height: 1.35;
}

.settings-row-copy p {
  margin: 4px 0 0;
  color: #85868a;
  font-size: 9.5px;
  line-height: 1.45;
}

.settings-switch {
  position: relative;
  width: 34px;
  height: 20px;
  flex: 0 0 auto;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: #cdceca;
  cursor: pointer;
  transition: background 140ms ease;
}

.settings-switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.22);
  transition: transform 140ms ease;
}

.settings-switch[aria-checked="true"] {
  background: var(--purple);
}

.settings-switch[aria-checked="true"]::after {
  transform: translateX(14px);
}

.settings-segmented {
  display: flex;
  align-items: center;
  padding: 2px;
  border: 1px solid #d9d9d5;
  border-radius: 8px;
  background: #f4f4f2;
}

.settings-segmented button {
  min-height: 25px;
  padding: 0 9px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #77787c;
  font-size: 9.5px;
  cursor: pointer;
}

.settings-segmented button.is-active {
  background: #fff;
  color: #292a2e;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.settings-row-action {
  min-height: 30px;
  padding: 0 11px;
  border: 1px solid #d8d8d3;
  border-radius: 8px;
  background: #fff;
  color: #45464a;
  font-size: 9.5px;
  font-weight: 650;
  white-space: nowrap;
  cursor: pointer;
}

.settings-row-action:hover {
  border-color: #c3b8e2;
  background: #f4f0fb;
  color: #6245b4;
}

.settings-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border-radius: 999px;
  background: #f1f1ee;
  color: #67686c;
  font-size: 9px;
  font-weight: 700;
  white-space: nowrap;
}

.settings-status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #999a9e;
}

.settings-status.is-good {
  background: #eaf5ee;
  color: #2d7654;
}

.settings-status.is-good::before {
  background: #319064;
}

.settings-input,
.settings-textarea {
  width: min(260px, 42vw);
  border: 1px solid #d9d9d5;
  border-radius: 8px;
  background: #fff;
  color: #3e4044;
  font-size: 10px;
  outline: 0;
}

.settings-input {
  height: 32px;
  padding: 0 10px;
}

.settings-textarea {
  min-height: 64px;
  padding: 9px 10px;
  resize: vertical;
  line-height: 1.45;
}

.settings-row.is-textarea {
  align-items: start;
}

.settings-code {
  max-width: 260px;
  padding: 8px 10px;
  overflow: hidden;
  border-radius: 8px;
  background: #f3f3f1;
  color: #505258;
  font-family: var(--mono);
  font-size: 8.5px;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(64px, 1fr));
  gap: 7px;
}

.settings-stat {
  min-width: 66px;
  padding: 9px 10px;
  border-radius: 9px;
  background: #f5f5f2;
}

.settings-stat strong {
  display: block;
  color: #303136;
  font-size: 13px;
  letter-spacing: -0.02em;
}

.settings-stat span {
  display: block;
  margin-top: 2px;
  color: #8b8c90;
  font-size: 7.5px;
  white-space: nowrap;
}

.settings-row.is-stats {
  display: block;
}

.settings-row.is-stats .settings-stats {
  margin-top: 10px;
}

.settings-meter {
  width: 180px;
}

.settings-meter-top {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 6px;
  color: #696a6e;
  font-size: 8.5px;
  font-weight: 700;
}

.settings-meter-track {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8e8e5;
}

.settings-meter-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #7552d3, #9b7de6);
}

.settings-feedback {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 11px;
  padding: 9px 11px;
  border-radius: 9px;
  background: #eef6f1;
  color: #367056;
  font-size: 9.5px;
  line-height: 1.45;
}

.settings-feedback svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
}

.settings-source {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-top: 15px;
  padding: 11px 12px;
  border-top: 1px solid #e5e5e1;
  color: #8a8b8f;
  font-size: 9px;
  line-height: 1.5;
}

.settings-source a {
  flex: 0 0 auto;
  color: #6750ad;
  font-weight: 700;
  text-decoration: none;
}

.settings-source a:hover {
  text-decoration: underline;
}

.settings-shell[data-preview-theme="dark"] .settings-content {
  background: #202124;
  color: #f0f0ee;
}

.settings-shell[data-preview-theme="dark"] .settings-page-header h2,
.settings-shell[data-preview-theme="dark"] .settings-row-copy strong {
  color: #f0f0ee;
}

.settings-shell[data-preview-theme="dark"] .settings-page-header p,
.settings-shell[data-preview-theme="dark"] .settings-row-copy p,
.settings-shell[data-preview-theme="dark"] .settings-source {
  color: #adaeb2;
}

.settings-shell[data-preview-theme="dark"] .settings-card,
.settings-shell[data-preview-theme="dark"] .settings-row-action,
.settings-shell[data-preview-theme="dark"] .settings-input,
.settings-shell[data-preview-theme="dark"] .settings-textarea {
  border-color: #46474b;
  background: #292a2e;
  color: #e9e9e6;
}

.settings-shell[data-preview-theme="dark"] .settings-row + .settings-row,
.settings-shell[data-preview-theme="dark"] .settings-source {
  border-color: #3a3b3f;
}

.settings-shell[data-preview-theme="dark"] .settings-code,
.settings-shell[data-preview-theme="dark"] .settings-stat {
  background: #303135;
  color: #dbdbd8;
}

.menu-popover {
  position: absolute;
  z-index: 80;
  display: none;
  width: 218px;
  overflow: hidden;
  padding: 6px;
  border: 1px solid #d4d3cd;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 50px rgba(30, 32, 35, 0.22);
  backdrop-filter: blur(20px);
}

.menu-popover.is-open {
  display: block;
  animation: pop-in 130ms ease both;
}

@keyframes pop-in {
  from { opacity: 0; transform: scale(.97) translateY(-3px); }
  to { opacity: 1; transform: none; }
}

.menu-title {
  padding: 7px 9px 5px;
  color: #999a9e;
  font-size: 9px;
  font-weight: 760;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.menu-item {
  width: 100%;
  min-height: 32px;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  padding: 6px 8px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.menu-item:hover,
.menu-item.is-selected {
  background: #eeeeeb;
}

.menu-item svg {
  width: 14px;
  height: 14px;
  color: #6e7074;
}

.menu-item strong {
  font-size: 10.5px;
}

.menu-item small {
  display: block;
  margin-top: 2px;
  color: #96989c;
  font-size: 8.5px;
  font-weight: 500;
  line-height: 1.3;
}

.menu-item .menu-check {
  color: var(--purple);
  font-size: 11px;
}

.menu-separator {
  height: 1px;
  margin: 5px 4px;
  background: #e2e2de;
}

.search-overlay {
  position: absolute;
  z-index: 90;
  inset: 0;
  display: none;
  padding: 72px 18% 0;
  background: rgba(245, 245, 242, 0.78);
  backdrop-filter: blur(12px);
}

.search-overlay.is-open {
  display: block;
}

.search-box {
  height: 48px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 13px;
  border: 1px solid #c9c8c2;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 15px 45px rgba(37, 39, 42, 0.18);
}

.search-box input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  font-size: 12px;
}

.search-close {
  min-width: 72px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0 5px 0 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #77797d;
  cursor: pointer;
}

.search-close:hover {
  background: #f0f0ed;
  color: #292a2e;
}

.search-close > span {
  font-size: 10px;
  font-weight: 650;
  line-height: 1;
}

.search-close kbd {
  pointer-events: none;
}

kbd {
  padding: 3px 6px;
  border: 1px solid #d6d5cf;
  border-radius: 5px;
  background: #f4f4f1;
  color: #8b8d91;
  font-family: var(--font);
  font-size: 8px;
}

.search-results {
  margin-top: 8px;
  overflow: hidden;
  border: 1px solid #d4d3ce;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 15px 45px rgba(37, 39, 42, 0.15);
}

.search-result {
  width: 100%;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid #eeeeea;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.search-result:last-child {
  border-bottom: 0;
}

.search-result:hover {
  background: #f2f1ee;
}

.search-result .result-icon {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: #eceae4;
}

.search-result strong {
  display: block;
  font-size: 10.5px;
}

.search-result span {
  color: #96989c;
  font-size: 8.5px;
}

.search-result em {
  color: #aaa;
  font-size: 8px;
  font-style: normal;
}

.approval-dialog {
  position: absolute;
  z-index: 95;
  inset: 50% auto auto 50%;
  width: min(520px, calc(100% - 32px));
  display: none;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 14px;
  padding: 19px;
  border: 1px solid #d1cfc7;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(22, 24, 27, 0.3);
  transform: translate(-50%, -50%);
}

.approval-dialog::before {
  content: "";
  position: fixed;
  z-index: -1;
  inset: -100vh -100vw;
  background: rgba(36, 37, 39, 0.34);
  backdrop-filter: blur(5px);
}

.approval-dialog.is-open {
  display: grid;
  animation: dialog-in 160ms ease both;
}

@keyframes dialog-in {
  from { opacity: 0; transform: translate(-50%, -47%) scale(.98); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.dialog-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--amber-soft);
  color: var(--amber);
}

.dialog-kicker {
  color: var(--amber);
  font-size: 9px;
  font-weight: 800;
}

.approval-dialog h3 {
  margin: 4px 0 7px;
  font-size: 15px;
}

.approval-dialog p {
  margin: 0;
  color: #6c6e72;
  font-size: 10.5px;
  line-height: 1.6;
}

.scope-box {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 11px;
  padding: 9px 10px;
  border: 1px solid #e0ded7;
  border-radius: 8px;
  background: #faf9f6;
  font-size: 9.5px;
}

.scope-box span { color: #929498; }

.dialog-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 7px;
  margin-top: 3px;
}

.dialog-actions button {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid #d6d4cd;
  border-radius: 8px;
  background: #fff;
  font-size: 9.5px;
  font-weight: 700;
  cursor: pointer;
}

.dialog-actions button.primary {
  border-color: #2b2c2f;
  background: #2b2c2f;
  color: #fff;
}

.toast-stack {
  position: absolute;
  z-index: 85;
  top: 62px;
  right: 12px;
  width: 248px;
  display: grid;
  gap: 7px;
  pointer-events: none;
}

.toast {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 9px;
  padding: 10px;
  border: 1px solid #d5d4ce;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 14px 40px rgba(29, 31, 34, 0.18);
  pointer-events: auto;
  cursor: pointer;
  animation: toast-in 200ms ease both;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateX(12px); }
  to { opacity: 1; transform: none; }
}

.toast-icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--purple-soft);
  color: var(--purple);
}

.toast strong {
  display: block;
  margin-bottom: 2px;
  font-size: 9.5px;
}

.toast p {
  margin: 0;
  color: #7b7d81;
  font-size: 8.5px;
  line-height: 1.35;
}

.control-target,
[data-control] {
  position: relative;
}

.control-target.is-explained,
[data-control].is-explained {
  z-index: 5;
  outline: 2px solid rgba(120, 86, 216, 0.75);
  outline-offset: 2px;
}

.show-annotations .control-target[data-index]::after,
.show-annotations [data-control][data-index]::after {
  content: attr(data-index);
  position: absolute;
  z-index: 40;
  top: -7px;
  right: -7px;
  min-width: 17px;
  height: 17px;
  display: grid;
  place-items: center;
  padding: 0 4px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: var(--purple);
  color: #fff;
  font-size: 8px;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 2px 8px rgba(49, 34, 94, 0.28);
  pointer-events: none;
}

.inspector {
  min-height: 0;
  overflow: auto;
  border: 1px solid #d7d6d0;
  border-radius: 18px;
  background: #f8f7f3;
  scrollbar-width: thin;
}

.inspector-empty,
.inspector-content {
  min-height: 100%;
  padding: 26px 24px;
}

.inspector-empty {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
}

.inspect-orbit {
  position: relative;
  width: 84px;
  height: 84px;
  margin-bottom: 28px;
  border: 1px solid #cfcdc5;
  border-radius: 50%;
}

.inspect-orbit::before,
.inspect-orbit::after {
  content: "";
  position: absolute;
  border: 1px solid #d9d7d0;
  border-radius: 50%;
}

.inspect-orbit::before { inset: 12px; }
.inspect-orbit::after { inset: 26px; background: var(--purple); border-color: var(--purple); }

.inspect-orbit span {
  position: absolute;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--paper);
  border: 2px solid var(--ink);
}

.inspect-orbit span:nth-child(1) { top: 5px; left: 38px; }
.inspect-orbit span:nth-child(2) { right: 4px; bottom: 23px; }
.inspect-orbit span:nth-child(3) { left: 8px; bottom: 13px; border-color: var(--purple); }

.eyebrow {
  color: var(--purple);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.inspector-empty h2 {
  margin: 8px 0 10px;
  font-size: 26px;
  line-height: 1.18;
  letter-spacing: -0.04em;
}

.inspector-empty p {
  margin: 0 0 22px;
  color: #6e7074;
  font-size: 12px;
  line-height: 1.75;
}

.inspector-content {
  display: none;
}

.inspector-content.is-active {
  display: block;
  animation: inspect-in 180ms ease both;
}

@keyframes inspect-in {
  from { opacity: 0; transform: translateX(5px); }
  to { opacity: 1; transform: none; }
}

.inspector-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.inspector-status {
  padding: 5px 8px;
}

.inspector-status.confirmed { background: var(--green-soft); color: var(--green); }
.inspector-status.observed { background: var(--blue-soft); color: var(--blue); }
.inspector-status.conditional { background: var(--amber-soft); color: var(--amber); }
.inspector-status.system { background: #ececea; color: #696b6f; }

.inspector-content h2 {
  margin: 14px 0 7px;
  font-size: 23px;
  line-height: 1.2;
  letter-spacing: -0.035em;
}

.inspector-summary {
  margin: 0;
  color: #55575b;
  font-size: 12px;
  line-height: 1.7;
}

.inspector-sections {
  display: grid;
  gap: 0;
  margin-top: 19px;
  border-top: 1px solid #deddd7;
}

.inspector-section {
  padding: 13px 0;
  border-bottom: 1px solid #deddd7;
}

.inspector-section span {
  display: block;
  margin-bottom: 5px;
  color: #939599;
  font-size: 9px;
  font-weight: 760;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.inspector-section p {
  margin: 0;
  color: #4d4f53;
  font-size: 11px;
  line-height: 1.65;
}

.inspector-section.is-warning {
  color: var(--amber);
}

.inspector-section.is-warning p {
  color: #765423;
}

.inspector-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 15px;
}

.inspector-meta span {
  padding: 5px 7px;
  border: 1px solid #d9d7d0;
  border-radius: 7px;
  color: #77797d;
  font-size: 9px;
}

.inspector-source {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 16px;
  color: var(--purple);
  font-size: 10px;
  font-weight: 700;
  text-decoration: none;
}

.try-button {
  width: 100%;
  min-height: 38px;
  margin-top: 18px;
  border: 0;
  border-radius: 9px;
  background: var(--purple);
  color: #fff;
  font-size: 11px;
  font-weight: 740;
  cursor: pointer;
}

.try-button:hover {
  background: #6544c1;
}

.section-heading {
  width: min(1180px, calc(100% - 48px));
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  margin: 0 auto;
  padding: 48px 0 28px;
}

.section-heading h1 {
  margin: 7px 0 8px;
  font-size: clamp(34px, 4vw, 54px);
  line-height: 1.02;
  letter-spacing: -0.055em;
}

.section-heading p {
  max-width: 680px;
  margin: 0;
  color: #686a6e;
  font-size: 14px;
  line-height: 1.75;
}

.section-stat {
  min-width: 170px;
  padding: 14px 0;
  border-top: 2px solid var(--ink);
}

.section-stat span,
.section-stat strong {
  display: block;
}

.section-stat span {
  color: #8d8f93;
  font-size: 10px;
}

.section-stat strong {
  margin-top: 5px;
  font-size: 13px;
}

.source-button {
  border: 1px solid #c9c7c0;
  background: transparent;
  color: #47494d;
}

.source-button:hover {
  background: #fff;
}

.lesson-layout {
  width: min(1180px, calc(100% - 48px));
  display: grid;
  grid-template-columns: minmax(0, 1fr) 350px;
  gap: 20px;
  margin: 0 auto 54px;
}

.lesson-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.lesson-card {
  min-height: 218px;
  display: flex;
  flex-direction: column;
  padding: 20px;
  border: 1px solid #d5d3cc;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.62);
  text-align: left;
  cursor: pointer;
  transition: border 160ms ease, background 160ms ease, transform 160ms ease;
}

.lesson-card:hover,
.lesson-card.is-active {
  transform: translateY(-2px);
  border-color: #aaa79f;
  background: #fff;
}

.lesson-card.is-active {
  box-shadow: 0 12px 34px rgba(34, 36, 40, 0.08);
}

.lesson-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.lesson-number {
  font-family: var(--mono);
  color: #a09e97;
  font-size: 12px;
}

.lesson-level {
  padding: 5px 7px;
  background: #ecebe6;
  color: #66686c;
}

.lesson-card h3 {
  margin: 30px 0 8px;
  font-size: 21px;
  line-height: 1.2;
  letter-spacing: -0.035em;
}

.lesson-card p {
  margin: 0;
  color: #6e7074;
  font-size: 11.5px;
  line-height: 1.65;
}

.lesson-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: 18px;
  color: #87898d;
  font-size: 10px;
}

.lesson-runner {
  position: sticky;
  top: 20px;
  align-self: start;
  min-height: 454px;
  padding: 24px;
  border-radius: 16px;
  background: #242629;
  color: #fff;
  box-shadow: 0 18px 50px rgba(29, 31, 34, 0.18);
}

.runner-empty {
  min-height: 406px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.runner-empty .eyebrow { color: #b7a5ee; }
.runner-empty h2 { margin: 9px 0 11px; font-size: 27px; line-height: 1.17; letter-spacing: -0.04em; }
.runner-empty p { margin: 0; color: #adafb3; font-size: 12px; line-height: 1.7; }

.runner-header {
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.13);
}

.runner-header .eyebrow { color: #b7a5ee; }
.runner-header h2 { margin: 7px 0; font-size: 24px; letter-spacing: -0.035em; }
.runner-header p { margin: 0; color: #afb1b5; font-size: 10.5px; line-height: 1.55; }

.runner-steps {
  display: grid;
  gap: 0;
  margin: 14px 0 18px;
}

.runner-step {
  position: relative;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 9px;
  padding: 9px 0;
}

.runner-step:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 32px;
  bottom: -3px;
  left: 11px;
  width: 1px;
  background: rgba(255, 255, 255, 0.14);
}

.runner-step-index {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 50%;
  color: #bfc1c5;
  font-family: var(--mono);
  font-size: 8px;
}

.runner-step strong {
  display: block;
  margin: 1px 0 3px;
  font-size: 10px;
}

.runner-step p {
  margin: 0;
  color: #9ea0a5;
  font-size: 9.5px;
  line-height: 1.45;
}

.runner-start {
  width: 100%;
  height: 40px;
  border: 0;
  border-radius: 9px;
  background: #fff;
  color: #242629;
  font-size: 11px;
  font-weight: 760;
  cursor: pointer;
}

#practice-content,
.template-layout,
.reference-tools,
.reference-content {
  width: min(1180px, calc(100% - 48px));
  margin-right: auto;
  margin-left: auto;
}

.principle-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 20px;
  border: 1px solid #ceccc5;
  border-radius: 14px;
  overflow: hidden;
  background: #f8f7f3;
}

.principle-item {
  min-height: 130px;
  padding: 18px;
  border-right: 1px solid #d9d7d0;
}

.principle-item:last-child { border-right: 0; }
.principle-item span { color: var(--purple); font-family: var(--mono); font-size: 10px; }
.principle-item strong { display: block; margin: 14px 0 6px; font-size: 14px; }
.principle-item p { margin: 0; color: #75777b; font-size: 10.5px; line-height: 1.6; }

.practice-block {
  margin: 20px 0;
  padding: 28px;
  border: 1px solid #d2d0c8;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.58);
}

.block-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.block-heading h2 {
  margin: 5px 0 0;
  font-size: 26px;
  letter-spacing: -0.04em;
}

.block-heading p {
  max-width: 480px;
  margin: 0;
  color: #77797d;
  font-size: 11px;
  line-height: 1.6;
  text-align: right;
}

.knowledge-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid #d9d7d0;
  border-left: 1px solid #d9d7d0;
}

.knowledge-card {
  min-height: 180px;
  padding: 16px;
  border-right: 1px solid #d9d7d0;
  border-bottom: 1px solid #d9d7d0;
  background: rgba(255, 255, 255, 0.55);
}

.knowledge-card span {
  color: #9b9da1;
  font-family: var(--mono);
  font-size: 9px;
  text-transform: uppercase;
}

.knowledge-card h3 {
  margin: 14px 0 9px;
  font-size: 15px;
}

.knowledge-card p {
  margin: 0;
  color: #5d5f63;
  font-size: 10.5px;
  line-height: 1.55;
}

.knowledge-card code {
  display: block;
  margin-top: 12px;
  color: var(--purple);
  font-family: var(--mono);
  font-size: 9px;
  line-height: 1.45;
}

.knowledge-card em {
  display: block;
  margin-top: 7px;
  color: #999b9e;
  font-size: 9px;
  font-style: normal;
  line-height: 1.45;
}

.lifecycle-table {
  display: grid;
  gap: 0;
  border: 1px solid #d7d5ce;
  border-radius: 12px;
  overflow: hidden;
}

.lifecycle-row {
  display: grid;
  grid-template-columns: 110px 1fr 1fr 1fr;
  border-bottom: 1px solid #dedcd5;
}

.lifecycle-row:last-child { border-bottom: 0; }
.lifecycle-row.is-header { background: #292a2d; color: #fff; }
.lifecycle-row > div { padding: 12px 14px; border-right: 1px solid #dedcd5; font-size: 10.5px; line-height: 1.5; }
.lifecycle-row > div:last-child { border-right: 0; }
.lifecycle-row.is-header > div { border-color: #45464a; color: #bfc0c4; font-size: 9px; font-weight: 760; text-transform: uppercase; }
.lifecycle-row strong { font-size: 11px; }
.lifecycle-row .proof { color: var(--green); }

.case-tabs {
  display: flex;
  gap: 5px;
  margin-bottom: 15px;
}

.case-tab {
  padding: 7px 10px;
  border: 1px solid #d4d2cb;
  border-radius: 8px;
  background: transparent;
  color: #737579;
  font-size: 10px;
  font-weight: 680;
  cursor: pointer;
}

.case-tab.is-active {
  border-color: #292a2d;
  background: #292a2d;
  color: #fff;
}

.case-body {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 20px;
}

.project-blueprint {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, .85fr);
  gap: 16px;
}

.project-tree {
  margin: 0;
  overflow: auto;
  padding: 20px;
  border-radius: 11px;
  background: #26272a;
  color: #d9dade;
  font-family: var(--mono);
  font-size: 10px;
  line-height: 2;
}

.project-tree > span {
  color: #c7b8f3;
  font-weight: 800;
}

.project-tree strong {
  color: #ffffff;
}

.project-tree em {
  color: #8f9298;
  font-style: normal;
}

.project-rules {
  display: grid;
  align-content: start;
  border: 1px solid #d9d7d0;
  border-radius: 11px;
  overflow: hidden;
  background: #fff;
}

.project-rule {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 10px;
  padding: 12px 13px;
  border-bottom: 1px solid #e1dfd9;
}

.project-rule:last-child {
  border-bottom: 0;
}

.project-rule > span {
  color: var(--purple);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 800;
}

.project-rule strong {
  display: block;
  margin-bottom: 3px;
  font-size: 10.5px;
}

.project-rule p {
  margin: 0;
  color: #85878b;
  font-size: 9px;
  line-height: 1.45;
}

.case-overview,
.case-system {
  padding: 19px;
  border: 1px solid #d9d7d0;
  border-radius: 11px;
  background: #fff;
}

.case-overview .case-type {
  color: var(--purple);
  font-size: 9px;
  font-weight: 800;
}

.case-overview h3 {
  margin: 7px 0 10px;
  font-size: 21px;
}

.case-overview p {
  margin: 0;
  color: #686a6e;
  font-size: 11px;
  line-height: 1.65;
}

.case-system h4 {
  margin: 0 0 9px;
  color: #85878b;
  font-size: 9px;
  text-transform: uppercase;
}

.case-system ul {
  margin: 0 0 15px;
  padding-left: 17px;
  color: #4f5155;
  font-size: 10.5px;
  line-height: 1.75;
}

.automation-note {
  padding: 10px;
  border-radius: 8px;
  background: var(--amber-soft);
  color: #75511c;
  font-size: 9.5px;
  line-height: 1.55;
}

.openai-evidence {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 11px;
  margin-bottom: 54px;
}

.evidence-card {
  min-height: 170px;
  display: flex;
  flex-direction: column;
  padding: 18px;
  border: 1px solid #d4d2ca;
  border-radius: 12px;
  background: #f7f6f2;
  text-decoration: none;
}

.evidence-card span { color: var(--purple); font-size: 9px; font-weight: 800; }
.evidence-card strong { margin: 23px 0 8px; font-size: 15px; line-height: 1.35; }
.evidence-card p { margin: 0; color: #6f7175; font-size: 10px; line-height: 1.55; }
.evidence-card em { margin-top: auto; padding-top: 15px; color: #999b9f; font-size: 9px; font-style: normal; }
.evidence-card:hover { border-color: #aaa79f; background: #fff; }

.template-filter {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px;
}

.template-filter button,
.reference-tabs button {
  padding: 7px 10px;
  border: 1px solid #d3d1ca;
  border-radius: 8px;
  background: transparent;
  color: #76787c;
  font-size: 10px;
  font-weight: 680;
  cursor: pointer;
}

.template-filter button.is-active,
.reference-tabs button.is-active {
  border-color: #2b2c2f;
  background: #2b2c2f;
  color: #fff;
}

.template-layout {
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  gap: 16px;
  margin-bottom: 50px;
}

.template-list {
  display: grid;
  align-content: start;
  gap: 7px;
}

.template-item {
  width: 100%;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 10px;
  padding: 12px;
  border: 1px solid #d6d4cd;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.5);
  text-align: left;
  cursor: pointer;
}

.template-item:hover,
.template-item.is-active {
  border-color: #aaa79f;
  background: #fff;
}

.template-item-index {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #e7e5df;
  font-family: var(--mono);
  font-size: 9px;
}

.template-item strong { display: block; margin-bottom: 4px; font-size: 11.5px; }
.template-item p { margin: 0; color: #86888c; font-size: 9.5px; line-height: 1.4; }

.template-preview {
  min-height: 560px;
  overflow: hidden;
  border: 1px solid #d2d0c8;
  border-radius: 14px;
  background: #fff;
}

.template-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid #e2e0da;
}

.template-preview-header span { color: var(--purple); font-size: 9px; font-weight: 800; }
.template-preview-header h2 { margin: 5px 0 0; font-size: 22px; }
.copy-button {
  height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 11px;
  border: 1px solid #cfcdc6;
  border-radius: 8px;
  background: #fff;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}
.copy-button svg { width: 14px; height: 14px; }

.template-code {
  margin: 0;
  padding: 24px;
  overflow: auto;
  color: #35373b;
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.8;
  white-space: pre-wrap;
}

.verified-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border: 1px solid #bdd8c8;
  border-radius: 9px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 10px;
  font-weight: 720;
}

.verified-badge svg { width: 14px; height: 14px; }

.reference-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.reference-search {
  width: min(420px, 100%);
  height: 39px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 11px;
  border: 1px solid #d1cfc7;
  border-radius: 9px;
  background: #fff;
}

.reference-search svg { width: 15px; height: 15px; color: #8a8c90; }
.reference-search input { min-width: 0; flex: 1; border: 0; outline: 0; font-size: 11px; }

.reference-tabs {
  display: flex;
  gap: 5px;
}

.reference-content {
  margin-bottom: 50px;
}

.control-index {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.control-index-card {
  min-height: 132px;
  padding: 14px;
  border: 1px solid #d4d2ca;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.55);
  cursor: pointer;
}

.control-index-card:hover { background: #fff; border-color: #aaa79f; }
.control-index-top { display: flex; justify-content: space-between; gap: 10px; }
.control-index-top span { color: #9a9c9f; font-size: 9px; }
.control-index-card h3 { margin: 15px 0 7px; font-size: 14px; }
.control-index-card p { margin: 0; color: #707276; font-size: 10px; line-height: 1.55; }

.glossary-table {
  overflow: hidden;
  border: 1px solid #d3d1ca;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.55);
}

.glossary-row {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr) minmax(0, .9fr);
  border-bottom: 1px solid #dedcd5;
}

.glossary-row:last-child { border-bottom: 0; }
.glossary-row > div { padding: 12px 14px; border-right: 1px solid #dedcd5; font-size: 10.5px; line-height: 1.55; }
.glossary-row > div:last-child { border-right: 0; color: #85878b; }
.glossary-row strong { display: block; font-size: 11px; }
.glossary-row span { display: block; margin-top: 2px; color: var(--purple); font-size: 9px; }

.source-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.source-card {
  min-height: 108px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 22px;
  gap: 12px;
  padding: 15px;
  border: 1px solid #d4d2ca;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.58);
  text-decoration: none;
}

.source-card:hover { background: #fff; border-color: #aaa79f; }
.source-group { padding: 4px 7px; background: var(--purple-soft); color: var(--purple); }
.source-card strong { display: block; margin: 10px 0 5px; font-size: 12px; }
.source-card p { margin: 0; color: #7a7c80; font-size: 9.5px; line-height: 1.45; }
.source-card .source-arrow { color: #8e9094; font-size: 16px; }

.tour-overlay {
  position: fixed;
  z-index: 200;
  inset: 0;
  display: none;
  pointer-events: none;
}

.tour-overlay.is-open {
  display: block;
}

.tour-card {
  position: absolute;
  right: 26px;
  bottom: 26px;
  width: 340px;
  padding: 20px;
  border: 1px solid #cbc8bf;
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 22px 70px rgba(25, 27, 30, 0.28);
  pointer-events: auto;
}

.tour-progress {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 16px;
  color: #8b8d91;
  font-size: 9px;
}

.tour-progress > div {
  height: 3px;
  overflow: hidden;
  flex: 1;
  border-radius: 999px;
  background: #e7e5df;
}

.tour-progress i {
  display: block;
  width: 16%;
  height: 100%;
  background: var(--purple);
  transition: width 220ms ease;
}

.tour-card h3 {
  margin: 7px 0 8px;
  font-size: 20px;
  letter-spacing: -0.035em;
}

.tour-card p {
  margin: 0;
  color: #6c6e72;
  font-size: 11px;
  line-height: 1.65;
}

.tour-actions {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
  margin-top: 17px;
}

.tour-actions > button:first-child {
  border: 0;
  background: transparent;
  color: #898b8f;
  font-size: 10px;
  cursor: pointer;
}

.empty-search {
  padding: 42px 20px;
  color: #8b8d91;
  text-align: center;
  font-size: 11px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
}

@media (max-width: 1240px) {
  .guide-header {
    grid-template-columns: auto 1fr auto;
    gap: 12px;
  }
  .brand-kicker { display: none; }
  .guide-tab { padding: 0 9px; font-size: 11px; }
  .simulator-layout { grid-template-columns: minmax(0, 1fr) 300px; }
  .codex-window { min-width: 880px; }
  .knowledge-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 980px) {
  body { overflow: auto; }
  .guide-header {
    position: sticky;
    top: 0;
    height: auto;
    grid-template-columns: 1fr auto;
    padding: 10px 14px;
  }
  .guide-tabs {
    grid-column: 1 / -1;
    order: 3;
    overflow-x: auto;
    justify-content: flex-start;
  }
  .guide-tab { flex: 0 0 auto; }
  .guide-main { height: auto; min-height: calc(100vh - 108px); }
  #screen-simulator { height: auto; min-height: calc(100vh - 108px); overflow: visible; }
  .simulator-hint { display: none; }
  .simulator-layout { height: auto; grid-template-columns: 1fr; }
  .codex-stage { min-height: 680px; place-items: start; }
  .codex-window { width: 980px; height: 660px; }
  .inspector { min-height: 420px; }
  .inspector-empty, .inspector-content { min-height: 420px; }
  .section-heading { padding-top: 34px; }
  .lesson-layout { grid-template-columns: 1fr; }
  .lesson-runner { position: static; }
  .principle-strip { grid-template-columns: repeat(2, 1fr); }
  .principle-item:nth-child(2) { border-right: 0; }
  .principle-item:nth-child(-n+2) { border-bottom: 1px solid #d9d7d0; }
  .lifecycle-row { grid-template-columns: 90px 1fr 1fr; }
  .lifecycle-row > div:nth-child(4) { display: none; }
  .template-layout { grid-template-columns: 1fr; }
  .template-list { grid-template-columns: repeat(2, 1fr); }
  .control-index { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
  .guide-actions .ghost-button { display: none; }
  .brand-title { font-size: 14px; }
  .guide-header { padding: 9px 10px; }
  #screen-simulator { padding: 10px; }
  .simulator-meta { gap: 8px; }
  .live-label { font-size: 10px; }
  .codex-stage { padding: 7px; border-radius: 12px; }
  .section-heading,
  .lesson-layout,
  #practice-content,
  .template-layout,
  .reference-tools,
  .reference-content { width: min(100% - 24px, 1180px); }
  .section-heading { align-items: flex-start; flex-direction: column; padding-bottom: 20px; }
  .section-heading h1 { font-size: 38px; }
  .section-stat { width: 100%; }
  .lesson-grid { grid-template-columns: 1fr; }
  .principle-strip { grid-template-columns: 1fr; }
  .principle-item { border-right: 0; border-bottom: 1px solid #d9d7d0; }
  .principle-item:last-child { border-bottom: 0; }
  .practice-block { padding: 18px; }
  .block-heading { align-items: flex-start; flex-direction: column; }
  .block-heading p { text-align: left; }
  .knowledge-grid { grid-template-columns: 1fr; }
  .lifecycle-table { overflow-x: auto; }
  .lifecycle-row { min-width: 660px; grid-template-columns: 90px 1fr 1fr 1fr; }
  .lifecycle-row > div:nth-child(4) { display: block; }
  .case-body { grid-template-columns: 1fr; }
  .project-blueprint { grid-template-columns: 1fr; }
  .openai-evidence { grid-template-columns: 1fr; }
  .template-filter { justify-content: flex-start; }
  .template-list { grid-template-columns: 1fr; }
  .reference-tools { align-items: stretch; flex-direction: column; }
  .reference-search { width: 100%; }
  .reference-tabs { overflow-x: auto; }
  .control-index { grid-template-columns: 1fr; }
  .glossary-table { overflow-x: auto; }
  .glossary-row { min-width: 660px; }
  .source-list { grid-template-columns: 1fr; }
  .tour-card { right: 12px; bottom: 12px; left: 12px; width: auto; }
}
