:root {
  color-scheme: light;
  --bg: #f5f6f3;
  --sidebar: #111412;
  --sidebar-muted: #aeb7ad;
  --ink: #151713;
  --muted: #656a61;
  --soft: #8b9187;
  --line: #d9ddd4;
  --line-dark: #242821;
  --panel: #ffffff;
  --panel-subtle: #f9faf6;
  --panel-tint: #edf3ed;
  --accent: #0d6b4b;
  --accent-soft: #dcece2;
  --blue: #245c91;
  --blue-soft: #e3edf8;
  --warning: #97610d;
  --warning-soft: #faecd8;
  --danger: #a2362e;
  --danger-soft: #f6e2df;
  --shadow: 0 18px 44px rgba(20, 23, 19, 0.08);
  --select-chevron: url("data:image/svg+xml,%3Csvg width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23151713' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
}

.hidden {
  display: none !important;
}

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

.utility-hidden {
  display: none !important;
}

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  appearance: none;
  border: 1px solid var(--line-dark);
  border-radius: 6px;
  background: var(--ink);
  color: white;
  font-size: 0.88rem;
  font-weight: 780;
  letter-spacing: 0;
  padding: 10px 13px;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease, transform 140ms ease;
}

button:hover {
  background: var(--accent);
  border-color: var(--accent);
  transform: translateY(-1px);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  transform: none;
}

button.secondary,
button.iconish,
.button-link.secondary {
  background: var(--panel);
  color: var(--ink);
  border-color: var(--line);
}

button.secondary:hover,
button.iconish:hover,
.button-link.secondary:hover {
  background: var(--panel-tint);
  border-color: var(--accent);
}

button.danger {
  background: #fff9f8;
  border-color: #eccfca;
  color: var(--danger);
}

button.danger:hover {
  background: var(--danger);
  border-color: var(--danger);
  color: white;
}

h1,
h2,
h3,
h4,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(1.9rem, 3vw, 3.15rem);
  line-height: 1;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 1.24rem;
  line-height: 1.1;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 0;
  font-size: 1.05rem;
}

.auth-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
  background:
    linear-gradient(90deg, rgba(17, 20, 18, 0.98) 0 42%, rgba(245, 246, 243, 0) 42%),
    var(--bg);
}

.auth-shell {
  width: min(1120px, 100%);
  min-height: min(720px, calc(100vh - 64px));
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 430px);
  gap: 34px;
  align-items: stretch;
  padding: 28px;
  border: 1px solid rgba(21, 23, 19, 0.14);
  background: var(--panel);
  box-shadow: 0 32px 90px rgba(17, 20, 18, 0.14);
}

.auth-brand {
  grid-column: 1 / -1;
  display: flex;
  gap: 11px;
  align-items: center;
}

.auth-brand p {
  margin: 0;
  color: var(--ink);
  font-weight: 950;
}

.auth-brand span:last-child {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.82rem;
}

.auth-copy {
  display: grid;
  align-content: end;
  min-height: 430px;
  padding: 28px;
  background: var(--sidebar);
  color: white;
}

.auth-copy h1 {
  max-width: 690px;
  font-size: clamp(3rem, 7vw, 7.2rem);
  line-height: 0.88;
}

.auth-copy p {
  max-width: 620px;
  margin: 22px 0 0;
  color: #d9dfd6;
  font-size: clamp(1rem, 1.5vw, 1.18rem);
  line-height: 1.5;
}

.auth-link-row {
  margin-top: 20px !important;
}

.auth-link-row a {
  color: white;
  font-size: 0.9rem;
  font-weight: 780;
  text-decoration-color: rgba(255, 255, 255, 0.38);
  text-underline-offset: 4px;
}

.auth-link-row a:hover {
  color: #dcece2;
}

/* WS-4: auth-link-row inside the light auth card (Forgot password? /
   Back to sign in) — the base rule above is white-on-dark for the hero
   panel and would be invisible here. */
.auth-card .auth-link-row {
  margin-top: 0 !important;
}

.auth-card .auth-link-row a {
  color: var(--ink);
  text-decoration-color: rgba(21, 23, 19, 0.35);
}

.auth-card .auth-link-row a:hover {
  color: var(--accent);
}

.auth-card {
  align-self: end;
  display: grid;
  gap: 14px;
  padding: 20px;
  border: 1px solid var(--line);
  background: #fbfcf8;
}

.auth-card label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 760;
}

.auth-card input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  color: var(--ink);
  padding: 12px 12px;
}

.auth-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #eef1ea;
}

.auth-switch button {
  border: 0;
  background: transparent;
  color: var(--muted);
  transform: none;
}

.auth-switch button.active {
  background: var(--ink);
  color: white;
}

/* WS-6: "Continue with Google" — a navigation link styled as a neutral
   federated-login button (white, not the dark primary, so the email/password
   submit stays the primary action). Hidden in reset mode by .hidden. */
.auth-alt {
  display: grid;
  gap: 12px;
  justify-items: center;
}

.auth-alt-divider {
  position: relative;
  width: 100%;
  text-align: center;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 760;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.auth-alt-divider::before,
.auth-alt-divider::after {
  content: "";
  position: absolute;
  top: 50%;
  width: calc(50% - 22px);
  border-top: 1px solid var(--line);
}

.auth-alt-divider::before { left: 0; }
.auth-alt-divider::after { right: 0; }

.google-signin-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 780;
  text-decoration: none;
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}

.google-signin-btn:hover {
  border-color: var(--ink);
  background: #f7f8f4;
  transform: translateY(-1px);
}

.google-g {
  flex: 0 0 auto;
}

.auth-message {
  min-height: 1.35em;
  margin: 0;
  color: var(--danger);
  font-size: 0.84rem;
  line-height: 1.35;
}

.auth-assurance {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid #bdd3c5;
  background: #edf7ef;
}

.auth-assurance strong {
  color: var(--accent);
}

.auth-assurance span {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.42;
}

.app-frame {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  display: grid;
  grid-template-rows: auto auto;
  align-content: start;
  gap: 26px;
  min-height: 100vh;
  padding: 22px 18px;
  background: var(--sidebar);
  color: white;
}

.brand,
.top-actions,
.section-head,
.button-row,
.connector-actions,
.modal-head,
.modal-actions,
.publish-total,
.publish-item {
  display: flex;
  align-items: center;
}

.brand {
  gap: 11px;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
}

.brand-mark img {
  display: block;
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.brand p {
  margin: 0;
  font-size: 1rem;
  font-weight: 900;
}

.brand span:last-child {
  display: block;
  margin-top: 2px;
  color: var(--sidebar-muted);
  font-size: 0.8rem;
}

.nav-list {
  display: grid;
  gap: 4px;
}

.nav-list a {
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: 6px;
  padding: 10px 12px;
  color: var(--sidebar-muted);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 760;
}

.nav-icon {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-list a span {
  min-width: 0;
}

.nav-list a:hover,
.nav-list a.active {
  background: rgba(255, 255, 255, 0.08);
  color: white;
}

.app-main {
  min-width: 0;
  width: min(1380px, 100%);
  padding: 24px 30px 58px;
}

.app-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(460px, 680px);
  gap: 22px;
  align-items: start;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.screen-label,
.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  text-transform: uppercase;
  font-size: 0.69rem;
  font-weight: 900;
  letter-spacing: 0;
}

.screen-subtitle {
  max-width: 720px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.45;
}

.top-actions {
  display: grid;
  justify-items: end;
  justify-self: end;
  gap: 10px;
  min-width: 0;
  width: min(720px, 100%);
}

.connection-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, 220px);
  justify-content: flex-end;
  align-items: stretch;
  gap: 8px;
  width: 100%;
}

.connection-chips {
  display: contents;
}

.status-pill,
.connection-chip {
  display: grid;
  align-content: center;
  gap: 1px;
  min-height: 46px;
  width: 100%;
  min-width: 0;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--ink);
  text-align: left;
  transform: none;
}

.status-pill:hover,
.connection-chip:hover {
  background: var(--panel-tint);
  border-color: #bfcbbd;
  color: var(--ink);
  transform: none;
}

.status-pill:focus-visible,
.connection-chip:focus-visible {
  outline: 2px solid rgba(13, 107, 75, 0.28);
  outline-offset: 2px;
}

.status-pill strong,
.status-pill span,
.connection-chip strong,
.connection-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-pill strong,
.connection-chip strong {
  font-size: 0.78rem;
  line-height: 1.15;
}

.status-pill span,
.connection-chip span {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 720;
  line-height: 1.15;
}

.status-pill[data-connection="connected"] span,
.connection-chip[data-connection="connected"] span {
  color: var(--accent);
}

.connection-chip.managed {
  border-color: #bdd3c5;
  background: #edf7ef;
}

.account-menu {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
}

.account-menu span {
  max-width: 240px;
  padding: 0 6px 0 8px;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 760;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-menu button {
  min-height: 36px;
  border-radius: 6px;
  padding: 7px 9px;
  font-size: 0.78rem;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0;
}

.status-card {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  box-shadow: 0 10px 28px rgba(20, 23, 19, 0.04);
}

.status-card span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 850;
  text-transform: uppercase;
}

.status-card strong {
  display: block;
  min-height: 2.5em;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 0.98rem;
  line-height: 1.28;
}

.panel {
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.start-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.52fr);
  gap: 18px;
  align-items: stretch;
  margin-bottom: 14px;
  border-color: #cfd8c8;
  background:
    linear-gradient(135deg, rgba(220, 236, 226, 0.62), rgba(255, 255, 255, 0) 44%),
    var(--panel);
}

.start-copy {
  display: grid;
  align-content: center;
  gap: 10px;
}

.start-copy h2 {
  max-width: 760px;
  font-size: clamp(1.62rem, 2.7vw, 2.72rem);
  line-height: 1.02;
}

.start-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.start-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 9px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 820;
}

.start-meta span:first-child {
  border-color: #bdd3c5;
  background: #edf7ef;
  color: var(--accent);
}

.start-copy p:last-child,
.start-action p {
  margin: 0;
  color: var(--muted);
  line-height: 1.48;
}

.start-action {
  display: grid;
  align-content: center;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.74);
}

.start-action span {
  color: var(--muted);
  font-size: 0.73rem;
  font-weight: 900;
  text-transform: uppercase;
}

.trust-strip {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  background: var(--panel-subtle);
}

.trust-strip div {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border-right: 1px solid var(--line);
}

.trust-strip div:last-child {
  border-right: 0;
}

.trust-strip strong {
  color: var(--accent);
}

.trust-strip span {
  color: var(--muted);
  font-size: 0.86rem;
}

.section-head {
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.section-head.compact {
  margin-bottom: 14px;
}

.section-intro {
  max-width: 720px;
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.44;
}

.source-card-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.source-card {
  min-width: 0;
  display: grid;
  grid-template-rows: minmax(116px, 1fr) auto auto;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-subtle);
}

.source-card.connected {
  border-color: #bdd3c5;
  background: #f4faf5;
}

.source-card-main {
  display: grid;
  align-content: start;
  gap: 7px;
}

.source-state {
  display: inline-flex;
  width: fit-content;
  min-height: 24px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px 7px;
  background: var(--panel);
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.source-card.connected .source-state {
  border-color: #bdd3c5;
  background: #edf7ef;
  color: var(--accent);
}

.source-card h3 {
  margin: 0;
  font-size: 1.02rem;
  line-height: 1.14;
}

.source-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.42;
}

.source-capabilities {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.source-capabilities span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px 7px;
  background: var(--panel);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 760;
}

.source-card button {
  width: 100%;
  align-self: end;
}

.skills-layout {
  display: grid;
  grid-template-columns: minmax(420px, 1fr) minmax(460px, 620px);
  gap: 18px;
  align-items: start;
}

.skill-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(245px, 1fr));
  gap: 10px;
}

.skill-card {
  min-width: 0;
  display: grid;
  grid-template-rows: auto auto minmax(88px, 1fr) auto auto;
  gap: 11px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-subtle);
}

.skill-card.active {
  border-color: #aebfb4;
  background: #f3f8f1;
}

.skill-card-head,
.skill-editor-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}

.skill-status {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 820;
}

.skill-package-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 14px;
}

.skill-package-meta div {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-subtle);
}

.skill-package-meta div.wide {
  grid-column: 1 / -1;
}

.skill-package-meta strong,
.skill-package-meta span {
  display: block;
  min-width: 0;
}

.skill-package-meta strong {
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
}

.skill-package-meta span {
  overflow: hidden;
  color: var(--ink);
  font-size: 0.79rem;
  font-weight: 720;
  line-height: 1.32;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.skill-card h3 {
  margin: 0;
  font-size: 1.02rem;
  line-height: 1.18;
}

.skill-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.42;
}

.skill-form {
  display: grid;
  gap: 12px;
}

.skill-form label,
.skill-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 760;
}

.skill-form input,
.skill-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-subtle);
  color: var(--ink);
  padding: 10px 11px;
}

.skill-form textarea {
  resize: vertical;
}

.skill-body-editor {
  min-height: 360px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.86rem;
  font-weight: 520;
  line-height: 1.45;
}

.skill-form input:disabled,
.skill-form textarea:disabled {
  color: var(--muted);
  background: #f2f4ef;
}

.skill-guardrail-box {
  display: grid;
  gap: 8px;
  padding: 11px;
  border: 1px solid #cfd8c8;
  border-radius: 6px;
  background: #f6faf4;
}

.skill-guardrail-box strong {
  color: var(--accent);
  font-size: 0.86rem;
}

.skill-guardrail-box div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.skill-guardrail-box span {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  border: 1px solid #cfd8c8;
  border-radius: 6px;
  padding: 4px 7px;
  background: var(--panel);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 760;
}

.skill-editor-actions button {
  min-width: 122px;
}

.checklist-panel,
.workspace-grid,
.grid,
.panel + .panel {
  margin-bottom: 18px;
}

.guide-shell {
  display: block;
}

.guide-progress {
  display: grid;
  gap: 10px;
  margin-bottom: 10px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-subtle);
}

.guide-progress > div:first-child {
  display: grid;
  grid-template-columns: minmax(120px, auto) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.guide-progress strong {
  color: var(--ink);
}

.guide-progress span {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
  text-align: right;
}

.progress-track {
  height: 9px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #eef1ea;
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 220ms ease;
}

.checklist {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}

.checklist.guided {
  grid-template-columns: 1fr;
  gap: 0;
}

.check-step {
  display: grid;
  gap: 9px;
  min-height: 122px;
  padding: 14px;
  border-right: 1px solid var(--line);
  background: var(--panel-subtle);
}

.checklist.guided .check-step {
  grid-template-columns: 44px minmax(0, 1fr) minmax(96px, auto);
  align-items: center;
  min-height: 74px;
  border-right: 0;
  border-bottom: 1px solid var(--line);
}

.checklist.guided .check-step:last-child {
  border-bottom: 0;
}

.check-step button {
  white-space: nowrap;
}

.step-controls {
  display: grid;
  justify-items: end;
  gap: 8px;
}

.step-controls button {
  min-width: 116px;
}

.step-state {
  justify-self: end;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 850;
}

.step-state.complete {
  color: var(--accent);
}

.step-state.waiting {
  color: var(--soft);
}

.check-step:last-child {
  border-right: 0;
}

.check-step span {
  color: var(--soft);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.76rem;
}

.check-step strong {
  display: block;
  margin-bottom: 5px;
  color: var(--ink);
}

.check-step p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.38;
}

.check-step.complete {
  background: var(--accent-soft);
}

.check-step.complete span,
.check-step.complete strong {
  color: var(--accent);
}

.check-step.current {
  background: var(--sidebar);
  color: white;
}

.check-step.current span,
.check-step.current p,
.check-step.current strong {
  color: white;
}

.check-step.current p {
  opacity: 0.72;
}

.check-step.current button {
  background: white;
  color: var(--ink);
  border-color: white;
}

.check-step.current button:hover {
  background: var(--accent-soft);
  border-color: var(--accent-soft);
}

.guide-sidecar {
  display: grid;
  gap: 11px;
  min-height: 100%;
  padding: 16px;
  border: 1px solid #bdd3c5;
  border-radius: 6px;
  background: #edf7ef;
}

.guide-sidecar h3 {
  font-size: 1.08rem;
}

.guide-sidecar p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.button-stack {
  display: grid;
  gap: 8px;
}

.guide-note {
  font-size: 0.82rem;
}

.empty-state {
  display: grid;
  gap: 10px;
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 6px;
  background: var(--panel-subtle);
}

.empty-state strong {
  font-size: 1rem;
}

.empty-state p {
  max-width: 620px;
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.empty-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

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

.workflow-help div {
  display: grid;
  gap: 5px;
  min-height: 112px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-subtle);
}

.workflow-help strong {
  color: var(--ink);
}

.workflow-help span {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.4;
}

.publish-guard {
  display: grid;
  gap: 16px;
  margin-bottom: 18px;
  border-color: #cfd8c8;
  background:
    linear-gradient(135deg, rgba(237, 243, 237, 0.88), rgba(255, 255, 255, 0) 58%),
    var(--panel);
}

.publish-guard.guard-collapsed {
  display: none;
}

.publish-guard .section-head {
  margin-bottom: 0;
}

.guard-copy,
.guard-note {
  max-width: 880px;
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.guard-note {
  font-size: 0.86rem;
}

.publish-flow,
.guard-grid {
  display: grid;
  gap: 12px;
}

.publish-flow {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

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

.flow-step,
.guard-item {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 176px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-subtle);
}

.flow-step-head {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.flow-step-number {
  display: inline-grid;
  place-items: center;
  min-width: 58px;
  height: 24px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
}

.guard-item span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.flow-step strong,
.guard-item strong {
  color: var(--ink);
  font-size: 1.24rem;
  line-height: 1.12;
}

.flow-step p,
.guard-item p {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.38;
}

.flow-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 26px;
  margin-top: auto;
}

.flow-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 760;
  line-height: 1.2;
}

.flow-step button {
  justify-self: start;
  margin-top: 2px;
  white-space: nowrap;
}

.flow-step.ready,
.guard-item.ready {
  border-color: #bdd3c5;
  background: #edf7ef;
}

.flow-step.ready strong,
.flow-step.ready .flow-step-head,
.flow-step.ready .flow-step-number,
.guard-item.ready strong,
.guard-item.ready span {
  color: var(--accent);
}

.flow-step.ready .flow-step-number {
  border-color: #bdd3c5;
  background: #f7fcf8;
}

.flow-step.approved {
  border-color: #bdd3c5;
  background: #edf7ef;
}

.flow-step.approved strong,
.flow-step.approved .flow-step-head,
.flow-step.approved .flow-step-number {
  color: var(--accent);
}

.flow-step.approved .flow-step-number {
  border-color: #bdd3c5;
  background: #f7fcf8;
}

.flow-step.warning,
.guard-item.warning {
  border-color: #e1c791;
  background: #fff7e9;
}

.flow-step.warning strong,
.flow-step.warning .flow-step-head,
.flow-step.warning .flow-step-number,
.guard-item.warning strong,
.guard-item.warning span {
  color: var(--warning);
}

.flow-step.warning .flow-step-number {
  border-color: #e1c791;
  background: #fffdf8;
}

.flow-step.locked,
.guard-item.locked {
  border-color: var(--line-dark);
  background: var(--sidebar);
}

.flow-step.locked strong,
.flow-step.locked .flow-step-head,
.flow-step.locked .flow-step-number,
.guard-item.locked strong,
.guard-item.locked span {
  color: white;
}

.flow-step.locked p,
.guard-item.locked p {
  color: var(--sidebar-muted);
}

.flow-step.locked .flow-step-number,
.flow-step.locked .flow-meta span {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.07);
  color: white;
}

.flow-step.locked button.secondary {
  border-color: rgba(255, 255, 255, 0.22);
  background: white;
}

.workspace-grid,
.grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.68fr);
  gap: 18px;
}

.workspace-grid > *,
.grid > * {
  min-width: 0;
}

.workspace-grid {
  align-items: start;
}

.app-frame[data-view="work"] .workspace-grid,
.app-frame[data-view="settings"] .workspace-grid,
.app-frame[data-view="work"] .mixed-grid,
.app-frame[data-view="settings"] .mixed-grid {
  grid-template-columns: 1fr;
}

.app-frame[data-view="settings"] .source-connection-panel {
  grid-column: 1 / -1;
}

.side-stack {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.lower-grid {
  align-items: stretch;
}

.app-frame[data-view="agent"] .app-main {
  width: min(1440px, 100%);
  height: 100vh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  padding-bottom: 0;
}

.assistant-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 292px;
  gap: 28px;
  min-height: 0;
  height: 100%;
  align-items: stretch;
  overflow: hidden;
}

.assistant-panel {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.agent-chat-topbar {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  min-height: 54px;
  padding: 10px 2px 14px;
  border-bottom: 1px solid rgba(217, 221, 212, 0.78);
}

.agent-model-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.agent-model-picker label {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 860;
}

.agent-model-picker select {
  appearance: none;
  -webkit-appearance: none;
  max-width: min(360px, 56vw);
  border: 1px solid var(--line);
  border-radius: 8px;
  background-color: var(--panel);
  background-image: var(--select-chevron);
  background-position: right 16px center;
  background-repeat: no-repeat;
  background-size: 18px 18px;
  color: var(--ink);
  padding: 9px 48px 9px 11px;
  font-size: 0.9rem;
  font-weight: 780;
}

.agent-model-picker span {
  min-width: 0;
  color: var(--soft);
  font-size: 0.8rem;
  line-height: 1.35;
}

.agent-topbar-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
  align-items: center;
}

.agent-topbar-actions button {
  padding: 8px 11px;
  white-space: nowrap;
}

.assistant-thread {
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 42px 18px 28px;
  background: transparent;
  overscroll-behavior: contain;
  scroll-behavior: smooth;
}

.agent-empty {
  width: min(680px, 100%);
  margin: auto;
  text-align: center;
}

.agent-empty h2 {
  margin-bottom: 12px;
  font-size: clamp(1.78rem, 4vw, 2.8rem);
  line-height: 1.02;
}

.agent-empty p {
  width: min(560px, 100%);
  margin: 0 auto 22px;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.55;
}

.quick-prompts,
.attachment-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.quick-prompts {
  justify-content: center;
}

.quick-prompts button {
  min-height: 38px;
  border-color: var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  font-size: 0.84rem;
}

.assistant-message {
  width: min(820px, 100%);
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.assistant-message.user {
  width: min(720px, 100%);
  grid-template-columns: minmax(0, 1fr);
  align-self: flex-end;
}

.assistant-message.user .message-avatar {
  grid-column: 2;
  grid-row: 1;
}

.assistant-message.user .message-content {
  grid-column: 1;
  grid-row: 1;
  justify-self: end;
  border: 1px solid #e2e5dc;
  border-radius: 8px;
  padding: 11px 13px;
  background: #eff1eb;
}

.assistant-message.assistant .message-content {
  padding-top: 2px;
}

.message-avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  font-size: 0.74rem;
  font-weight: 920;
}

.message-avatar svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.message-avatar img {
  display: block;
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.assistant-message.assistant .message-avatar {
  border-color: #bdd3c5;
  background: #edf7ef;
  color: var(--accent);
}

.message-role {
  display: block;
  margin-bottom: 5px;
  color: var(--soft);
  font-size: 0.72rem;
  font-weight: 840;
}

.message-markdown {
  color: var(--ink);
  line-height: 1.58;
  overflow-wrap: anywhere;
}

.assistant-message.assistant .message-markdown {
  color: #2f342e;
}

.assistant-message.thinking .message-markdown {
  color: var(--muted);
}

.message-markdown > * {
  margin: 0;
}

.message-markdown > * + * {
  margin-top: 9px;
}

.message-markdown h3,
.message-markdown h4,
.message-markdown h5 {
  color: var(--ink);
  font-size: 0.96rem;
  line-height: 1.35;
}

.message-markdown ul,
.message-markdown ol {
  padding-left: 20px;
}

.message-markdown li + li {
  margin-top: 5px;
}

.message-markdown a {
  color: var(--accent);
  font-weight: 820;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.message-markdown code {
  border: 1px solid #dfe5dc;
  border-radius: 5px;
  padding: 1px 5px;
  background: #f7f8f5;
  color: #253125;
  font-size: 0.88em;
}

.message-markdown pre {
  max-width: 100%;
  overflow: auto;
  border: 1px solid #dfe5dc;
  border-radius: 8px;
  padding: 10px 12px;
  background: #f7f8f5;
}

.message-markdown pre code {
  border: 0;
  padding: 0;
  background: transparent;
  white-space: pre;
}

.message-markdown blockquote {
  border-left: 3px solid #bdd3c5;
  padding-left: 10px;
  color: var(--soft);
}

.message-table-wrap {
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid #dfe5dc;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
}

.message-markdown table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
  font-size: 0.86rem;
  line-height: 1.45;
}

.message-markdown th,
.message-markdown td {
  border-bottom: 1px solid #e4e8df;
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
}

.message-markdown th {
  background: #f3f6ef;
  color: var(--ink);
  font-weight: 900;
}

.message-markdown td {
  color: #30362f;
}

.message-markdown tr:last-child td {
  border-bottom: 0;
}

.assistant-message .message-action {
  margin-top: 12px;
}

/* Streaming-event UX (2026-05-08): commentary, tool cards, validation
   notes, and proposal chips render progressively above the bubble
   text as SSE events arrive. Visual language stays consistent with
   the existing chat — muted text + small pills, no new design system. */

.assistant-message.streaming .message-markdown:empty::after {
  content: "";
  display: inline-block;
  width: 8px;
  height: 14px;
  background: rgba(0, 0, 0, 0.18);
  vertical-align: text-bottom;
  animation: stream-cursor 1s steps(2, start) infinite;
}

@keyframes stream-cursor {
  to { visibility: hidden; }
}

.stream-commentary {
  font-size: 12.5px;
  font-style: italic;
  color: rgba(40, 38, 34, 0.62);
  padding: 2px 0;
  line-height: 1.4;
}

.stream-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 6px 0;
}

.stream-tool-card {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  color: rgba(40, 38, 34, 0.78);
}

.stream-tool-card.stream-tool-running .stream-tool-icon {
  color: #b67c00;
  animation: stream-pulse 1.4s ease-in-out infinite;
}
.stream-tool-card.stream-tool-ok .stream-tool-icon { color: #2f7d3a; }
.stream-tool-card.stream-tool-failed .stream-tool-icon { color: #b03030; }

@keyframes stream-pulse {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 1; }
}

.stream-tool-summary {
  color: rgba(40, 38, 34, 0.6);
  font-size: 11.5px;
  margin-left: 4px;
}

.stream-validation {
  margin: 6px 0;
  padding: 6px 10px;
  border-left: 3px solid #c98b1c;
  background: rgba(201, 139, 28, 0.08);
  font-size: 12.5px;
  border-radius: 0 6px 6px 0;
}

.stream-validation strong {
  color: #8a5a00;
  margin-right: 6px;
  font-size: 11.5px;
  /* Codex-run-10 P2 fix: server now sends a humanized kind label
   * ("Vendor not found") instead of the raw "missing_vendor_ref"
   * hold code, so the legacy uppercase + letter-spacing styling
   * is no longer needed and would scream the label at SMB users. */
  letter-spacing: 0;
}

.stream-proposals {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 4px;
}

.stream-proposal-chip {
  display: inline-flex;
  padding: 3px 10px;
  border-radius: 11px;
  background: rgba(60, 110, 70, 0.12);
  color: #235c30;
  font-size: 12px;
  text-decoration: none;
  border: 1px solid rgba(60, 110, 70, 0.22);
}

.stream-proposal-chip:hover {
  background: rgba(60, 110, 70, 0.2);
}

.stream-proposal-chip.blocked {
  background: rgba(176, 48, 48, 0.08);
  color: #883030;
  border-color: rgba(176, 48, 48, 0.22);
}

.stream-error {
  margin: 8px 0;
  padding: 6px 10px;
  border-left: 3px solid #b03030;
  background: rgba(176, 48, 48, 0.06);
  color: #883030;
  font-size: 12.5px;
  border-radius: 0 6px 6px 0;
}

.draft-findings {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.62);
}

.draft-findings.stale {
  border-style: dashed;
  background: rgba(245, 242, 235, 0.72);
}

.draft-findings-head {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: baseline;
  justify-content: space-between;
}

.draft-findings-head strong {
  font-size: 0.92rem;
}

.draft-findings-head span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 680;
}

.draft-finding-list {
  display: grid;
  gap: 8px;
}

.draft-finding {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  border: 1px solid #e0e5da;
  border-radius: 8px;
  padding: 10px;
  background: var(--panel);
}

.draft-finding input {
  margin-top: 2px;
}

.draft-finding span {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.draft-finding strong,
.draft-finding em,
.draft-finding small {
  overflow-wrap: anywhere;
}

.draft-finding em {
  color: var(--muted);
  font-size: 0.8rem;
  font-style: normal;
  font-weight: 700;
}

.draft-finding small {
  color: var(--soft);
  font-size: 0.72rem;
  font-weight: 760;
}

.draft-finding-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.draft-finding-actions button {
  min-height: 34px;
  padding: 7px 11px;
  font-size: 0.78rem;
}

.assistant-form {
  position: sticky;
  bottom: 0;
  display: grid;
  gap: 8px;
  padding: 14px 0 18px;
  background: linear-gradient(180deg, rgba(245, 246, 243, 0), var(--bg) 32%);
}

.agent-scroll-bottom {
  justify-self: center;
  width: 38px;
  height: 38px;
  min-height: 38px;
  padding: 0;
  border-radius: 999px;
  border-color: #cfd4ca;
  background: var(--panel);
  color: var(--ink);
  box-shadow: 0 12px 28px rgba(20, 23, 19, 0.12);
}

.agent-scroll-bottom:hover {
  border-color: var(--accent);
  background: var(--panel-tint);
  color: var(--accent);
}

.agent-scroll-bottom svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.attachment-list {
  width: min(860px, 100%);
  margin: 0 auto;
  padding: 0 6px;
}

.attachment-notice {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border: 1px solid #ded7bd;
  border-radius: 6px;
  padding: 5px 10px;
  background: #fffaf0;
  color: #6f5b1f;
  font-size: 0.78rem;
  font-weight: 780;
}

.attachment-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  border: 1px solid #bdd3c5;
  border-radius: 6px;
  padding: 5px 7px 5px 10px;
  background: #edf7ef;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 820;
}

.attachment-chip strong {
  max-width: 260px;
  overflow: hidden;
  color: var(--ink);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-chip em {
  border: 1px solid #bdd3c5;
  border-radius: 5px;
  padding: 2px 5px;
  background: rgba(255, 255, 255, 0.68);
  color: var(--accent);
  font-size: 0.66rem;
  font-style: normal;
  font-weight: 900;
  text-transform: uppercase;
}

.attachment-chip button {
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--accent);
  line-height: 1;
}

.agent-composer {
  width: min(860px, 100%);
  min-width: 0;
  margin: 0 auto;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
  padding: 8px;
  border: 1px solid #cfd4ca;
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 14px 36px rgba(20, 23, 19, 0.08);
}

.composer-input {
  min-width: 0;
}

.assistant-form textarea {
  display: block;
  width: 100%;
  max-height: 168px;
  min-height: 40px;
  border: 0;
  resize: none;
  outline: 0;
  background: transparent;
  color: var(--ink);
  padding: 10px 4px 8px;
  line-height: 1.45;
}

.assistant-form textarea::placeholder {
  color: #8a9086;
}

.file-control {
  display: inline-flex !important;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 11px;
  background: var(--panel-subtle);
  color: var(--ink);
  cursor: pointer;
  font-size: 0.84rem;
  font-weight: 780;
}

.file-control input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.agent-composer button {
  min-height: 40px;
  border-radius: 8px;
  padding: 0 13px;
}

.agent-composer button:hover,
.file-control:hover,
.quick-prompts button:hover {
  transform: none;
}

.assistant-panel.drag-over .agent-composer {
  border-color: var(--accent);
  background: #f8fbf7;
  box-shadow: 0 16px 40px rgba(13, 107, 75, 0.12);
}

.assistant-panel.drag-over .file-control {
  border-color: var(--accent);
  color: var(--accent);
}

.agent-context-rail {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  padding: 6px 0 0 22px;
  border-left: 1px solid rgba(217, 221, 212, 0.9);
}

.app-frame.agent-focus[data-view="agent"] .app-header,
.app-frame.agent-focus[data-view="agent"] .agent-context-rail {
  display: none;
}

.app-frame.agent-focus[data-view="agent"] .app-main {
  width: min(1680px, 100%);
  grid-template-rows: minmax(0, 1fr);
}

.app-frame.agent-focus[data-view="agent"] .assistant-layout {
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
}

.app-frame.agent-focus[data-view="agent"] .assistant-thread {
  padding-right: clamp(16px, 4vw, 52px);
  padding-left: clamp(16px, 4vw, 52px);
}

.app-frame.agent-focus[data-view="agent"] .agent-composer,
.app-frame.agent-focus[data-view="agent"] .attachment-list {
  width: min(1120px, 100%);
}

.agent-context-section {
  display: grid;
  gap: 14px;
  padding: 16px 0 18px;
  border-bottom: 1px solid rgba(217, 221, 212, 0.9);
}

.agent-context-section:last-child {
  border-bottom: 0;
}

.agent-context-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
}

.agent-context-section h2 {
  font-size: 1rem;
}

.agent-context-head p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.42;
}

.agent-context-head button {
  padding: 8px 10px;
}

.assistant-snapshot,
.provider-form {
  display: grid;
  gap: 10px;
}

.assistant-stat {
  display: grid;
  gap: 4px;
  padding: 0 0 10px;
  border-bottom: 1px solid rgba(217, 221, 212, 0.9);
}

.assistant-stat:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.assistant-stat strong {
  color: var(--ink);
  font-size: 0.9rem;
}

.assistant-stat span {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.42;
}

.assistant-stat.ready strong {
  color: var(--accent);
}

.contract-list.compact {
  border: 0;
  border-radius: 0;
}

.contract-list.compact div {
  grid-template-columns: 74px minmax(0, 1fr);
  padding: 9px 0;
  background: transparent;
}

.contract-list.compact strong {
  font-size: 0.82rem;
}

.contract-list.compact span {
  font-size: 0.82rem;
}

.settings-subsection-title,
.model-connections-section h3 {
  margin: 0;
  color: var(--ink);
  font-size: 0.98rem;
  line-height: 1.25;
}

.source-connection-panel .provider-form {
  margin-top: 10px;
}

.provider-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.84rem;
}

.provider-form input,
.provider-form select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-subtle);
  color: var(--ink);
  padding: 11px 12px;
}

.provider-form select {
  appearance: none;
  -webkit-appearance: none;
  background-image: var(--select-chevron);
  background-position: right 16px center;
  background-repeat: no-repeat;
  background-size: 18px 18px;
  padding-right: 48px;
}

.provider-form .provider-help {
  margin: 0;
}

.model-connections-section {
  display: grid;
  gap: 12px;
  margin-top: 34px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.model-connection-list {
  margin-top: 0;
}

.model-connections-section + .small {
  margin-top: 20px;
}

.danger-zone {
  border-color: #ead0ca;
  background: #fffafa;
}

.danger-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-top: 12px;
}

.danger-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.84rem;
}

.danger-form input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-subtle);
  color: var(--ink);
  padding: 10px 11px;
}

.danger-form button {
  align-self: end;
  min-width: 142px;
}

.danger-notice {
  border-color: #ead0ca;
  background: #fff9f8;
  color: var(--danger);
  font-family: inherit;
  font-size: 0.86rem;
}

.oauth-card {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid #bdd3c5;
  border-radius: 6px;
  background: #edf7ef;
}

.oauth-card strong,
.oauth-card span {
  display: block;
}

.oauth-card strong {
  color: var(--accent);
}

.oauth-card span {
  color: var(--muted);
  line-height: 1.45;
}

.oauth-code {
  width: fit-content;
  min-width: 120px;
  border: 1px solid rgba(16, 88, 61, 0.28);
  border-radius: 6px;
  background: white;
  color: var(--ink);
  padding: 10px 12px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 1.05rem;
  font-weight: 820;
  letter-spacing: 0.08em;
}

.oauth-actions {
  justify-content: flex-start;
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 1px solid var(--line-dark);
  border-radius: 6px;
  background: var(--ink);
  padding: 9px 13px;
  color: white;
  font-size: 0.88rem;
  font-weight: 780;
  text-decoration: none;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease, transform 140ms ease;
}

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

.help-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
}

.help-panel {
  display: grid;
  align-content: start;
  gap: 14px;
}

.help-panel h2,
.help-panel p {
  margin-bottom: 0;
}

.help-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 1.1rem;
  color: var(--muted);
  line-height: 1.45;
}

.help-stack {
  display: grid;
  gap: 10px;
}

.help-stack div {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-subtle);
}

.help-stack strong {
  color: var(--ink);
}

.help-stack span {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.whitepaper-card {
  border-color: var(--sage);
  background: #fbfdf8;
}

.whitepaper-page {
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
}

.whitepaper-shell {
  width: min(980px, calc(100% - 36px));
  margin: 0 auto;
  padding: 32px 0 56px;
}

.whitepaper-hero {
  display: grid;
  gap: 22px;
  margin-bottom: 18px;
  padding: 34px;
  border-radius: 8px;
  background: #0d130f;
  color: white;
}

.whitepaper-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  width: fit-content;
  color: white;
  font-weight: 850;
  text-decoration: none;
}

.whitepaper-brand img {
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.whitepaper-hero .eyebrow {
  color: #b7c2b4;
}

.whitepaper-hero h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(2.2rem, 4vw, 4.4rem);
  line-height: 0.98;
  letter-spacing: 0;
}

.whitepaper-hero p {
  max-width: 760px;
  margin: 0;
  color: #d9e0d5;
  font-size: 1.05rem;
  line-height: 1.55;
}

.whitepaper-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.whitepaper-actions .secondary-link {
  background: transparent;
}

.whitepaper-toc {
  display: grid;
  gap: 20px;
  margin: 18px 0 4px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdf8;
}

.whitepaper-toc-head {
  display: grid;
  gap: 8px;
}

.whitepaper-toc h2,
.whitepaper-toc p {
  margin: 0;
}

.whitepaper-toc h2 {
  max-width: 760px;
  color: var(--ink);
  font-size: clamp(1.35rem, 2.3vw, 2rem);
  line-height: 1.08;
  letter-spacing: 0;
}

.whitepaper-toc p {
  max-width: 800px;
  color: var(--muted);
  line-height: 1.55;
}

.whitepaper-toc-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.whitepaper-toc-group {
  display: grid;
  align-content: start;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.whitepaper-toc-group strong {
  color: var(--ink);
  font-size: 0.92rem;
}

.whitepaper-toc-group a {
  width: fit-content;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.35;
  text-decoration: none;
}

.whitepaper-toc-group a:hover {
  color: var(--green);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.whitepaper-section {
  display: grid;
  gap: 14px;
  padding: 30px 0;
  border-bottom: 1px solid var(--line);
}

.whitepaper-section h2,
.whitepaper-section h3,
.whitepaper-section p {
  margin: 0;
}

.whitepaper-section h2 {
  max-width: 780px;
  font-size: clamp(1.6rem, 3vw, 2.6rem);
  line-height: 1.05;
  letter-spacing: 0;
}

.whitepaper-section h3 {
  font-size: 1rem;
}

.whitepaper-section p,
.whitepaper-section li {
  max-width: 820px;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.62;
}

.whitepaper-grid,
.whitepaper-two-col {
  display: grid;
  gap: 12px;
}

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

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

.whitepaper-grid article,
.whitepaper-two-col > div {
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.whitepaper-grid strong {
  color: var(--ink);
}

.whitepaper-grid span {
  color: var(--muted);
  line-height: 1.5;
}

.whitepaper-section ul,
.whitepaper-steps {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 1.2rem;
}

.whitepaper-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding-top: 28px;
}

.whitepaper-footer p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.code-card {
  margin: 0;
  max-width: 100%;
  min-height: 190px;
  max-height: 320px;
  overflow: auto;
  padding: 14px;
  border: 1px solid var(--line-dark);
  border-radius: 6px;
  background: #111412;
  color: #eff5ec;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.77rem;
  line-height: 1.5;
  white-space: pre-wrap;
}

.openclaw-setup-card {
  gap: 18px;
}

.openclaw-setup-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.openclaw-step {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-subtle);
}

.openclaw-step.current {
  border-color: #bdd3c5;
  background: #f4faf5;
}

.openclaw-step span {
  display: inline-flex;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--ink);
  color: white;
  font-size: 0.8rem;
  font-weight: 900;
}

.openclaw-step.current span {
  background: var(--accent);
}

.openclaw-step strong {
  color: var(--ink);
}

.openclaw-step p {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.35;
}

.openclaw-config-head {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
  margin-bottom: 12px;
}

.openclaw-config-head.compact {
  margin-top: 10px;
  margin-bottom: 10px;
}

.openclaw-config-head div {
  display: grid;
  gap: 4px;
}

.openclaw-config-head strong {
  color: var(--ink);
}

.openclaw-config-head span {
  color: var(--muted);
  font-size: 0.9rem;
}

.openclaw-agentic-setup {
  display: grid;
  gap: 10px;
  margin-top: 16px;
  padding: 14px;
  border: 1px solid #bdd3c5;
  border-radius: 6px;
  background: #f4faf5;
}

.setup-prompt-summary,
.openclaw-completion-card {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid #d7e2d8;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.7);
}

.setup-prompt-summary strong,
.openclaw-completion-card strong {
  color: var(--ink);
}

.setup-prompt-summary p,
.openclaw-completion-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.prompt-preview {
  border-top: 1px solid #d7e2d8;
  padding-top: 10px;
}

.prompt-preview summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 850;
}

.prompt-preview .prompt-card {
  margin-top: 10px;
}

.prompt-card {
  margin: 0;
  max-width: 100%;
  max-height: 260px;
  overflow: auto;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfa;
  color: var(--ink);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.78rem;
  line-height: 1.5;
  white-space: pre-wrap;
}

.openclaw-instructions {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding: 14px;
  border: 1px solid #bdd3c5;
  border-radius: 6px;
  background: #f4faf5;
}

.openclaw-instructions strong {
  color: var(--ink);
}

.openclaw-instructions ol {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 1.2rem;
  color: var(--muted);
  line-height: 1.45;
}

.openclaw-instructions p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.advanced-config {
  display: grid;
  gap: 10px;
  margin-top: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-subtle);
}

.advanced-config.nested {
  margin-top: 12px;
  background: var(--panel);
}

.technical-config .openclaw-config-head:first-of-type {
  margin-top: 12px;
}

.manual-test-details {
  margin-top: 12px;
}

.advanced-config summary {
  cursor: pointer;
  color: var(--ink);
  font-weight: 900;
}

.advanced-config p {
  margin: 10px 0 0;
  max-width: 780px;
  color: var(--muted);
  line-height: 1.45;
}

.advanced-config .code-card {
  margin-top: 10px;
  min-height: 150px;
}

.connector-actions {
  justify-content: flex-end;
  margin-top: 10px;
}

.token-tools,
.test-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-top: 12px;
}

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

.test-form button {
  grid-column: 1 / -1;
}

.token-tools label,
.test-form label,
.policy-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.84rem;
}

.token-tools input,
.test-form input,
.policy-form input[type="number"] {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-subtle);
  color: var(--ink);
  padding: 10px 11px;
}

.token-tools button {
  align-self: end;
}

.token-management {
  display: grid;
  gap: 12px;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-subtle);
}

.token-management h3,
.token-management p {
  margin: 0;
}

.token-management h3 {
  font-size: 1.05rem;
  line-height: 1.2;
}

.token-management p:not(.eyebrow) {
  max-width: 760px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.token-list {
  display: grid;
  gap: 8px;
}

.token-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
}

.token-title-line {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.token-row strong,
.token-row span {
  display: block;
}

.token-row span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.78rem;
}

.token-title-line .token-state {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  margin-top: 0;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 0.73rem;
  font-weight: 760;
}

.token-title-line .token-state.used {
  border-color: var(--sage);
  color: var(--green);
  background: #eef8f0;
}

.token-title-line .token-state.unused {
  color: var(--muted);
  background: #f5f6f1;
}

.row-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.kv {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 10px 14px;
  margin: 0;
}

.kv dt {
  color: var(--muted);
}

.kv dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.82rem;
}

.button-row {
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

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

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

.persona-form label {
  display: grid;
  gap: 6px;
  font-weight: 600;
  font-size: 14px;
}

.persona-form input,
.persona-form textarea {
  font-family: inherit;
  font-size: 14px;
  padding: 10px 12px;
  border: 1px solid #d4d4d4;
  border-radius: 8px;
  background: #fff;
  font-weight: 400;
}

.persona-form textarea {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 13px;
  line-height: 1.5;
  resize: vertical;
  min-height: 220px;
}

.persona-form .persona-instructions {
  font-weight: 600;
}

.section-head-actions {
  display: flex;
  gap: 8px;
}

.policy-form input:focus,
.token-tools input:focus,
.test-form input:focus,
.assistant-form textarea:focus,
.agent-model-picker select:focus,
.provider-form input:focus,
.provider-form select:focus,
.filter-chip:focus,
button:focus {
  outline: 2px solid #8ab49d;
  outline-offset: 2px;
}

.checkline {
  display: flex !important;
  grid-column: span 1;
  align-items: center;
  gap: 10px !important;
}

.checkline input {
  width: 18px;
  height: 18px;
}

.contract-list,
.setup-list {
  display: grid;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}

.contract-list div,
.setup-list div {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 12px;
  padding: 13px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-subtle);
}

.contract-list div:last-child,
.setup-list div:last-child {
  border-bottom: 0;
}

.contract-list strong,
.setup-list strong {
  color: var(--accent);
}

.contract-list span,
.setup-list span {
  color: var(--muted);
  line-height: 1.4;
}

.sync-status {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}

.sync-card,
.entity-count {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-subtle);
}

.sync-card span,
.entity-count span {
  color: var(--muted);
}

.entity-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.entity-count strong {
  color: var(--accent);
}

.notice {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid #bdd3c5;
  border-radius: 6px;
  background: #edf7ef;
  color: var(--accent);
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.78rem;
}

.version-notice {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: min(420px, calc(100vw - 36px));
  padding: 12px 14px;
  border: 1px solid var(--line-dark);
  border-radius: 6px;
  background: var(--sidebar);
  color: #f8faf5;
  box-shadow: var(--shadow);
}

.version-notice span {
  min-width: 0;
}

.version-notice button {
  flex: 0 0 auto;
  background: #f8faf5;
}

.small {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.queue {
  display: grid;
  gap: 10px;
}

.queue-notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 10px;
  padding: 10px 12px;
  border: 1px solid var(--warning, #b9770e);
  border-left-width: 3px;
  border-radius: 6px;
  background: rgba(185, 119, 14, 0.08);
  color: var(--text, #1d2b16);
  font-size: 14px;
  line-height: 1.45;
}

.queue-notice.hidden {
  display: none;
}

.queue-notice button {
  flex: 0 0 auto;
  margin-left: auto;
  padding: 4px 10px;
  font-size: 13px;
}

.bulk-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-subtle);
}

.bulk-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.bulk-copy strong {
  color: var(--ink);
  font-size: 0.9rem;
}

.bulk-copy span {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.bulk-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.bulk-actions button {
  min-height: 38px;
  padding: 8px 10px;
}

.change {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-subtle);
}

.change.selected {
  border-color: #a9c9b8;
  background: #f4faf5;
}

.change-select {
  display: flex;
  align-items: flex-start;
  padding-top: 4px;
}

.change-select input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.change h4 {
  margin: 0 0 6px;
  font-size: 1rem;
}

.change-timestamp {
  margin: -2px 0 8px;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.01em;
  cursor: help;
}

.change p {
  margin-bottom: 12px;
  color: var(--muted);
  line-height: 1.45;
}

.impact-statement {
  display: grid;
  gap: 5px;
  margin: 12px 0;
  padding: 12px;
  border: 1px solid #bdd3c5;
  border-radius: 6px;
  background: #edf7ef;
}

.source-panel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.source-panel div {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
}

.source-panel span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.source-panel strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 0.82rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.impact-statement span {
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
}

.impact-statement strong {
  color: var(--ink);
  line-height: 1.36;
}

.status-note {
  margin: 0 0 12px !important;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  font-size: 0.88rem;
}

.status-note.approved {
  border-color: #bdd3c5;
  color: var(--accent);
}

.status-note.committed {
  border-color: #b7c9df;
  color: var(--blue);
}

.status-note.blocked {
  border-color: #eccfca;
  color: var(--danger);
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  font-size: 0.77rem;
}

.tag {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 4px 8px;
  background: #edf0e8;
  color: var(--muted);
}

.tag.low,
.tag.approved {
  color: var(--accent);
  background: var(--accent-soft);
}

.tag.medium {
  color: var(--warning);
  background: var(--warning-soft);
}

.tag.committed {
  color: var(--blue);
  background: var(--blue-soft);
}

.tag.blocked,
.tag.rejected,
.tag.undone,
.tag.high {
  color: var(--danger);
  background: var(--danger-soft);
}

.change-details {
  margin-top: 12px;
}

.change-details summary {
  color: var(--accent);
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 800;
}

.diff-table {
  display: grid;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  background: var(--panel);
}

.diff-head,
.diff-row {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) minmax(0, 1fr);
  gap: 0;
}

.diff-head {
  background: var(--sidebar);
  color: white;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.diff-head span,
.diff-row strong,
.diff-row span {
  padding: 10px 12px;
  border-right: 1px solid var(--line);
}

.diff-head span:last-child,
.diff-row span:last-child {
  border-right: 0;
}

.diff-row {
  border-top: 1px solid var(--line);
  font-size: 0.88rem;
}

.diff-row strong {
  color: var(--accent);
  font-size: 0.84rem;
}

.diff-row span {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.diff-row.changed span:last-child {
  color: var(--accent);
  background: #edf7ef;
  font-weight: 800;
}

.diff-row.changed span:nth-child(2) {
  background: #fff6ee;
}

.review-block {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
}

.review-block strong {
  color: var(--accent);
}

.checks {
  margin: 10px 0 0;
  padding-left: 20px;
  color: var(--muted);
}

.checks li {
  margin: 5px 0;
}

.checks .block {
  color: var(--danger);
}

.checks .review {
  color: var(--warning);
}

.checks .pass {
  color: var(--accent);
}

.commit-result {
  display: grid;
  gap: 4px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid #bdd3c5;
  border-radius: 6px;
  background: #edf7ef;
  color: var(--accent);
}

.commit-result span {
  color: var(--muted);
}

.change-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 116px;
}

.edit-hint {
  grid-column: 1 / -1;
  margin: 8px 0 0 0;
  padding: 8px 12px;
  font-size: 0.83rem;
  color: var(--muted);
  background: var(--panel-subtle);
  border-left: 3px solid var(--accent);
  border-radius: 4px;
}

.edit-hint strong {
  color: var(--danger);
  font-weight: 600;
}

.empty {
  padding: 24px;
  text-align: center;
  color: var(--muted);
  background: var(--panel-subtle);
  border: 1px dashed var(--line);
  border-radius: 6px;
}

.empty.compact {
  padding: 13px;
  text-align: left;
  font-size: 0.84rem;
}

.batches {
  display: grid;
  gap: 10px;
}

.batch-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-subtle);
}

.batch-row div {
  display: grid;
  gap: 4px;
}

.batch-row span {
  color: var(--muted);
  font-size: 0.88rem;
}

.filter-row {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
}

.filter-chip {
  border-color: var(--line);
  background: var(--panel);
  color: var(--muted);
  padding: 7px 9px;
  font-size: 0.78rem;
}

.filter-chip span {
  margin-left: 5px;
  color: var(--soft);
}

.filter-chip.active {
  background: var(--ink);
  border-color: var(--ink);
  color: white;
}

.filter-chip.active span {
  color: rgba(255, 255, 255, 0.72);
}

.audit {
  display: grid;
  gap: 8px;
}

.audit-body {
  padding: 13px;
  border: 1px solid var(--line);
  border-left: 5px solid #aeb5a9;
  border-radius: 6px;
  background: var(--panel-subtle);
}

.audit-row.success .audit-body {
  border-left-color: var(--accent);
}

.audit-row.warning .audit-body {
  border-left-color: var(--warning);
}

.audit-row.danger .audit-body {
  border-left-color: var(--danger);
}

.audit-marker {
  display: none;
}

.audit-main {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

.audit-main strong {
  color: var(--ink);
}

.audit-main p {
  margin: 4px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.audit-main time {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.8rem;
  white-space: nowrap;
}

.audit-technical {
  margin-top: 10px;
}

.audit-technical summary {
  color: var(--accent);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 800;
}

.audit-technical pre {
  margin: 8px 0 0;
  max-height: 260px;
  overflow: auto;
  padding: 10px;
  border-radius: 6px;
  background: #111412;
  color: #eff5ec;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.76rem;
  line-height: 1.45;
  white-space: pre-wrap;
}

.publish-modal {
  width: min(690px, calc(100vw - 32px));
  max-height: calc(100vh - 40px);
  margin: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
}

.publish-modal::backdrop {
  background: rgba(18, 19, 15, 0.64);
}

.modal-card {
  display: grid;
  gap: 18px;
  margin: 0;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  box-shadow: 0 28px 72px rgba(18, 19, 15, 0.26);
}

.modal-head {
  justify-content: space-between;
  gap: 18px;
}

.modal-copy {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.55;
}

.icon-button {
  width: 38px;
  height: 38px;
  padding: 0;
  font-size: 1.35rem;
  line-height: 1;
}

.publish-summary {
  display: grid;
  gap: 10px;
}

.publish-total {
  justify-content: space-between;
  gap: 14px;
  padding: 12px;
  border: 1px solid #bdd3c5;
  border-radius: 6px;
  background: #edf7ef;
  color: var(--accent);
}

.publish-total span {
  color: var(--muted);
  font-size: 0.9rem;
}

.publish-list {
  display: grid;
  gap: 8px;
  max-height: min(320px, 40vh);
  overflow: auto;
  padding-right: 2px;
}

.publish-item {
  justify-content: space-between;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-subtle);
}

.publish-item strong {
  display: block;
  margin-bottom: 4px;
}

.publish-item p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.4;
}

.modal-warning {
  padding: 12px;
  border: 1px solid #e1c791;
  border-radius: 6px;
  background: #fff7e9;
  color: #704408;
  line-height: 1.45;
}

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

@media (max-width: 1340px) {
  .app-frame[data-view="agent"] .app-main {
    height: auto;
    display: block;
    overflow: visible;
  }

  .app-frame[data-view="agent"] .assistant-layout {
    grid-template-columns: 1fr;
    height: auto;
    overflow: visible;
    min-height: auto;
  }

  .app-frame[data-view="agent"] .agent-context-rail {
    overflow: visible;
    padding: 2px 0 34px;
    border-top: 1px solid rgba(217, 221, 212, 0.9);
    border-left: 0;
  }
}

@media (max-width: 1180px) {
  .app-frame {
    grid-template-columns: 212px minmax(0, 1fr);
  }

  .app-header {
    grid-template-columns: 1fr;
  }

  .top-actions {
    justify-self: stretch;
    width: 100%;
  }

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

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

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

	  .workspace-grid,
	  .grid,
	  .start-panel,
	  .guide-shell,
	  .assistant-layout,
	  .skills-layout {
	    grid-template-columns: 1fr;
	  }

  .assistant-layout {
    min-height: auto;
  }

  .agent-context-rail {
    padding: 2px 0 34px;
    border-top: 1px solid rgba(217, 221, 212, 0.9);
    border-left: 0;
  }

  .assistant-thread {
    min-height: 500px;
  }
	}

@media (max-width: 1340px) and (min-width: 821px) {
  .app-frame.agent-focus[data-view="agent"] .app-main {
    height: 100vh;
    display: grid;
    grid-template-rows: minmax(0, 1fr);
    overflow: hidden;
    padding-bottom: 0;
  }

  .app-frame.agent-focus[data-view="agent"] .assistant-layout {
    height: 100%;
    min-height: 0;
    overflow: hidden;
  }

  .app-frame.agent-focus[data-view="agent"] .assistant-thread {
    min-height: 0;
    overflow: auto;
  }

  .app-frame.agent-focus[data-view="agent"] .assistant-form {
    position: sticky;
  }
}

@media (max-width: 820px) {
  .auth-screen {
    padding: 14px;
    background: var(--bg);
  }

  .auth-shell {
    min-height: auto;
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 14px;
  }

  .auth-brand {
    grid-column: auto;
  }

  .auth-copy {
    min-height: auto;
    padding: 24px;
  }

  .auth-copy h1 {
    font-size: clamp(2.4rem, 16vw, 4.8rem);
  }

  .app-frame {
    display: block;
  }

  .sidebar {
    position: static;
    min-height: auto;
    grid-template-rows: auto auto;
    gap: 14px;
    padding: 14px;
  }

  .nav-list {
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    margin: 0 -14px;
    padding: 0 14px 4px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .nav-list::-webkit-scrollbar {
    display: none;
  }

	  .nav-list a {
	    flex: 0 0 auto;
	    text-align: center;
	    white-space: nowrap;
	  }

  .nav-icon {
    display: none;
  }

	  .app-main {
	    padding: 16px 14px 46px;
	  }

  .app-frame[data-view="agent"] .app-main {
    padding-bottom: 0;
  }

  .app-header,
  .top-actions,
  .section-head,
  .change,
  .audit-main {
    display: grid;
    grid-template-columns: 1fr;
  }

  .top-actions,
  .connection-strip,
  .button-row,
  .filter-row {
    justify-content: stretch;
  }

  .connection-strip {
    grid-template-columns: 1fr;
  }

  .status-pill,
  .connection-chip {
    width: 100%;
  }

  .account-menu {
    justify-content: space-between;
  }

  .top-actions button,
  .connection-strip button,
  .button-row button,
  .connector-actions button,
  .token-tools button {
    width: 100%;
  }

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

  .trust-strip {
    grid-template-columns: 1fr;
  }

  .workflow-help {
    grid-template-columns: 1fr;
  }

  .openclaw-setup-steps {
    grid-template-columns: 1fr;
  }

  .openclaw-config-head {
    align-items: stretch;
    flex-direction: column;
  }

  .whitepaper-grid,
  .whitepaper-two-col,
  .whitepaper-toc-grid {
    grid-template-columns: 1fr;
  }

  .whitepaper-hero {
    padding: 24px;
  }

  .whitepaper-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .trust-strip div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .trust-strip div:last-child {
    border-bottom: 0;
  }

  .check-step {
    min-height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .checklist.guided .check-step {
    grid-template-columns: 36px minmax(0, 1fr);
  }

  .step-controls {
    grid-column: 1 / -1;
    width: 100%;
    justify-items: stretch;
  }

  .step-controls button,
  .step-state {
    width: 100%;
  }

  .step-state {
    justify-self: stretch;
  }

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

  .agent-model-picker {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .agent-model-picker select {
    max-width: none;
  }

  .agent-topbar-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-self: stretch;
  }

  .agent-topbar-actions button {
    width: 100%;
  }

  .guide-progress > div:first-child {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .guide-progress span {
    text-align: left;
  }

  .check-step:last-child {
    border-bottom: 0;
  }
}

@media (max-width: 640px) {
  .nav-list {
    gap: 4px;
  }

  .nav-list a {
    padding: 10px 9px;
    font-size: 0.82rem;
  }

  .status-grid,
  .publish-flow,
  .guard-grid,
  .kv,
  .token-tools,
  .test-form,
  .agent-switcher,
  .agent-composer-tools,
  .assistant-actions,
  .agent-composer,
  .token-row,
  .danger-form,
  .policy-form,
  .contract-list div,
  .setup-list div,
  .source-card-grid,
  .skill-card-grid,
  .sync-status,
  .entity-grid,
  .diff-head,
  .diff-row,
  .source-panel {
    grid-template-columns: 1fr;
  }

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

  .bulk-action-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .flow-step button {
    width: 100%;
  }

  .bulk-actions {
    justify-content: stretch;
  }

  .bulk-actions button {
    flex: 1 1 100%;
  }

  .change {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .change-actions {
    grid-column: 1 / -1;
  }

  .panel {
    padding: 15px;
  }

  .assistant-thread {
    min-height: auto;
    overflow: visible;
    padding: 26px 0 18px;
  }

  .assistant-form {
    position: static;
    padding-top: 8px;
  }

  .agent-empty {
    margin: 18px 0 0;
    text-align: left;
  }

  .agent-empty h2 {
    font-size: clamp(1.72rem, 9vw, 2.18rem);
  }

  .agent-empty p {
    margin-left: 0;
  }

  .quick-prompts {
    justify-content: flex-start;
  }

  .quick-prompts button {
    flex: 1 1 100%;
  }

  .assistant-message,
  .assistant-message.user {
    width: 100%;
  }

  .agent-composer {
    grid-template-columns: auto minmax(0, 1fr);
  }

  #assistantAskBtn {
    grid-column: 1 / -1;
    width: 100%;
  }

  .diff-head {
    display: none;
  }

  .diff-row strong,
  .diff-row span {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .diff-row span:last-child {
    border-bottom: 0;
  }

  .diff-row span::before {
    display: block;
    margin-bottom: 3px;
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 900;
    text-transform: uppercase;
  }

  .diff-row span:nth-child(2)::before {
    content: "Before";
  }

  .diff-row span:nth-child(3)::before {
    content: "After";
  }

  .change-actions {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .batch-row,
  .publish-total,
  .publish-item,
  .modal-head,
  .modal-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .modal-actions button,
  .filter-chip {
    width: 100%;
  }

  .icon-button {
    align-self: flex-start;
  }
}
