/* BrixLab dashboard. Forest sidebar carries the brand; the work area stays
   quiet. Radii follow hierarchy: 14px surfaces, 8px controls, 999px status. */
:root {
  color-scheme: light;
  --bg: #f4f7f5;
  --surface: #ffffff;
  --surface-2: #f8faf9;
  --ink: #13201d;
  --ink-2: #33433f;
  --muted: #5f716c;
  --line: #dde5e1;
  --line-strong: #c9d5cf;
  --brand: #17624d;
  --brand-hover: #12503f;
  --brand-soft: #e5f0ea;
  --brand-ink: #0f3a31;
  --on-brand: #ffffff;
  --forest: #0f3a31;
  --forest-2: #164a3e;
  --forest-ink: #d9ebe2;
  --forest-muted: #8fb3a3;
  --danger: #a3381f;
  --danger-soft: #fbece6;
  --warn: #8a5a00;
  --warn-soft: #fbf1dc;
  --focus: #3c9b77;
  --shadow: 0 1px 2px rgb(19 32 29 / 5%), 0 4px 16px rgb(19 32 29 / 4%);
  --font:
    "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, monospace;
  font-family: var(--font);
  font-size: 15px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0e1513;
    --surface: #141e1b;
    --surface-2: #18231f;
    --ink: #e4ede9;
    --ink-2: #c2d0ca;
    --muted: #8fa29b;
    --line: #24322d;
    --line-strong: #31423c;
    --brand: #4bb088;
    --brand-hover: #5fc29a;
    --brand-soft: #18302a;
    --brand-ink: #b9e6d2;
    --on-brand: #07120f;
    --forest: #0a1f1a;
    --forest-2: #12302a;
    --danger: #f0907a;
    --danger-soft: #3a1d16;
    --warn: #e6b65c;
    --warn-soft: #33270f;
    --shadow: none;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0e1513;
  --surface: #141e1b;
  --surface-2: #18231f;
  --ink: #e4ede9;
  --ink-2: #c2d0ca;
  --muted: #8fa29b;
  --line: #24322d;
  --line-strong: #31423c;
  --brand: #4bb088;
  --brand-hover: #5fc29a;
  --brand-soft: #18302a;
  --brand-ink: #b9e6d2;
  --on-brand: #07120f;
  --forest: #0a1f1a;
  --forest-2: #12302a;
  --danger: #f0907a;
  --danger-soft: #3a1d16;
  --warn: #e6b65c;
  --warn-soft: #33270f;
  --shadow: none;
}

* {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
body.booting main {
  visibility: hidden;
}
[hidden] {
  display: none !important;
}
a {
  color: var(--brand);
  text-underline-offset: 2px;
}
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
.icon {
  flex-shrink: 0;
}

/* Type */
h1 {
  font-size: clamp(24px, 2.2vw, 30px);
  line-height: 1.2;
  font-weight: 650;
  letter-spacing: -0.02em;
  margin: 0;
}
h2 {
  font-size: 17px;
  line-height: 1.3;
  font-weight: 620;
  letter-spacing: -0.01em;
  margin: 0;
}
h3 {
  font-size: 15px;
  font-weight: 620;
  margin: 0 0 6px;
}
p {
  color: var(--muted);
  font-size: 14px;
  margin: 0 0 12px;
}
code,
pre,
textarea[spellcheck="false"] {
  font-family: var(--mono);
  font-size: 12.5px;
}
code {
  background: var(--brand-soft);
  color: var(--brand-ink);
  border-radius: 5px;
  padding: 1px 5px;
}
.eyebrow {
  display: block;
  font-size: 13px;
  font-weight: 560;
  color: var(--muted);
}
.hint {
  font-size: 13px;
  line-height: 1.55;
  color: var(--muted);
  overflow-wrap: anywhere;
}

/* App layout */
#sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 248px;
  background: var(--forest);
  color: var(--forest-ink);
  display: flex;
  flex-direction: column;
  z-index: 20;
}
.sidebar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 18px 14px;
}
.sidebar-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 0 12px 14px;
  overflow-y: auto;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
  text-decoration: none;
}
.mark {
  width: 26px;
  height: 26px;
  fill: #7fd1ad;
}
.menu-toggle {
  display: none;
}
.switcher-wrap {
  position: relative;
  margin: 4px 0 18px;
}
#sidebar button:hover {
  filter: none;
}
.switcher {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 8px 10px;
  background: var(--forest-2);
  color: #fff;
  border: 1px solid rgb(255 255 255 / 8%);
  border-radius: 10px;
  text-align: left;
  min-height: 52px;
}
#sidebar .switcher:hover {
  background: #1b5446;
  border-color: rgb(255 255 255 / 12%);
}
.switcher-avatar {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: #7fd1ad;
  color: #0f3a31;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}
.switcher-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}
.switcher-label {
  font-size: 11px;
  color: var(--forest-muted);
  font-weight: 500;
}
.switcher-name {
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.switcher-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgb(0 0 0 / 22%);
  padding: 6px;
  z-index: 30;
}
.switcher-option {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: none;
  border: 0;
  color: var(--ink);
  padding: 9px 10px;
  border-radius: 7px;
  font-size: 13.5px;
  font-weight: 500;
  min-height: 0;
  text-align: left;
  text-decoration: none;
}
.switcher-option span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#sidebar .switcher-option:hover {
  background: var(--surface-2);
  border-color: transparent;
}
.switcher-option .icon {
  color: var(--brand);
}
.switcher-option.create {
  justify-content: flex-start;
  color: var(--brand);
  border-top: 1px solid var(--line);
  border-radius: 0 0 7px 7px;
  margin-top: 4px;
}
#sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.nav-section {
  font-size: 12px;
  font-weight: 560;
  color: var(--forest-muted);
  margin: 18px 10px 6px;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 8px;
  color: var(--forest-ink);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
}
.nav-link:hover {
  background: rgb(255 255 255 / 6%);
  color: #fff;
}
.nav-link[aria-current="page"] {
  background: rgb(127 209 173 / 14%);
  color: #fff;
}
.nav-link.child {
  padding-left: 38px;
  font-size: 13.5px;
  color: var(--forest-muted);
}
.nav-link.child[aria-current="page"] {
  color: #fff;
  background: none;
}
.sidebar-footer {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid rgb(255 255 255 / 8%);
  display: flex;
  align-items: center;
  gap: 8px;
}
.user {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
  padding-left: 4px;
}
.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--forest-2);
  border: 1px solid rgb(255 255 255 / 12%);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 650;
  color: #fff;
  flex-shrink: 0;
}
.user-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.user-name,
.user-email {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-name {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
}
.user-email {
  font-size: 12px;
  color: var(--forest-muted);
}
.icon-button {
  background: none;
  border: 0;
  color: var(--forest-muted);
  min-height: 36px;
  width: 36px;
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: 8px;
}
#sidebar .icon-button:hover {
  background: rgb(255 255 255 / 8%);
  color: #fff;
}
main {
  margin-left: 248px;
  padding: 36px 40px 48px;
  max-width: 1480px;
}
.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
}
.page-header p {
  margin: 6px 0 0;
  font-size: 15px;
}
.product-title {
  display: flex;
  align-items: center;
  gap: 14px;
}
.product-icon {
  width: 44px;
  height: 44px;
  border-radius: 11px;
  background: var(--brand-soft);
  color: var(--brand);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.subnav,
.tabs,
.settings-nav {
  scrollbar-width: none;
}
.subnav::-webkit-scrollbar,
.tabs::-webkit-scrollbar,
.settings-nav::-webkit-scrollbar {
  display: none;
}
.subnav {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  margin: -8px 0 28px;
  overflow-x: auto;
}
.subnav a {
  padding: 10px 12px;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 550;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
}
.subnav a:hover {
  color: var(--ink);
}
.subnav a[aria-current="page"] {
  color: var(--ink);
  border-bottom-color: var(--brand);
}

/* Surfaces */
.panel {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}
.section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}
.section-title p {
  margin: 4px 0 0;
}
.card {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  padding: 14px 16px;
  text-align: left;
  color: var(--ink);
  overflow-wrap: anywhere;
  font-size: 14px;
}
button.card {
  display: block;
  white-space: normal;
  font-weight: 560;
  min-height: 0;
}
button.card:hover {
  border-color: var(--line-strong);
  background: var(--surface);
}
.card.selected,
button.card.selected:hover {
  border-color: var(--brand);
  background: var(--brand-soft);
}
.card small {
  display: block;
  color: var(--muted);
  font-weight: 450;
  font-size: 12.5px;
  margin-top: 4px;
}
.card-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.stack {
  display: grid;
  gap: 8px;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--ink-2);
}
.pill.ok {
  background: var(--brand-soft);
  border-color: transparent;
  color: var(--brand-ink);
}
.pill.ok::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand);
}
.pill.warn {
  background: var(--warn-soft);
  border-color: transparent;
  color: var(--warn);
}

/* Forms */
.row {
  display: flex;
  gap: 12px;
  align-items: end;
  flex-wrap: wrap;
}
.grow {
  flex: 1;
  min-width: 170px;
}
label {
  display: block;
  font-size: 13px;
  color: var(--ink-2);
  font-weight: 560;
  margin: 12px 0;
}
input,
textarea,
select {
  display: block;
  width: 100%;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  border-radius: 8px;
  padding: 10px 12px;
  margin-top: 6px;
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  min-height: 42px;
}
input::placeholder,
textarea::placeholder {
  color: var(--muted);
  opacity: 0.8;
}
textarea {
  resize: vertical;
  line-height: 1.55;
}
input:focus,
textarea:focus,
select:focus {
  outline: 2px solid var(--focus);
  outline-offset: 0;
  border-color: transparent;
}
button,
a.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--brand);
  border-radius: 8px;
  background: var(--brand);
  color: var(--on-brand);
  padding: 9px 16px;
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  min-height: 42px;
  text-decoration: none;
  white-space: nowrap;
}
button:hover,
a.button:hover {
  background: var(--brand-hover);
  border-color: var(--brand-hover);
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}
.row > button,
.row > a.button {
  margin-bottom: 12px;
}
.secondary,
a.button.secondary {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line-strong);
}
.secondary:hover,
a.button.secondary:hover {
  background: var(--surface-2);
  border-color: var(--line-strong);
}
button.link {
  background: none;
  border-color: transparent;
  color: var(--brand);
  padding: 9px 4px;
}
button.link:hover {
  background: none;
  border-color: transparent;
  text-decoration: underline;
}
button.danger {
  color: var(--danger);
}
.full {
  width: 100%;
}
.check {
  display: flex;
  align-items: center;
  gap: 10px;
}
.check input {
  width: auto;
  min-height: 0;
  margin: 0;
}
details {
  margin-top: 16px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}
summary {
  font-size: 13.5px;
  color: var(--brand);
  cursor: pointer;
  font-weight: 560;
}
pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 440px;
  overflow: auto;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
  color: var(--ink-2);
}
.field-error {
  color: var(--danger);
  font-size: 12.5px;
  white-space: pre-wrap;
  margin-top: 6px;
}
[aria-invalid="true"] {
  border-color: var(--danger);
}
#notice:not(:empty) {
  background: var(--brand-soft);
  color: var(--brand-ink);
  padding: 11px 16px;
  border-radius: 10px;
  margin: 0 0 20px;
  font-size: 13.5px;
  overflow-wrap: anywhere;
}
#notice.error {
  background: var(--danger-soft);
  color: var(--danger);
}

/* Tabs */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 20px;
  overflow-x: auto;
}
.tabs button {
  background: transparent;
  color: var(--muted);
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  padding: 10px 12px;
  margin-bottom: -1px;
  min-height: 0;
}
.tabs button:hover {
  background: transparent;
  color: var(--ink);
}
.tabs button[aria-selected="true"] {
  color: var(--ink);
  border-bottom-color: var(--brand);
}

/* Overview */
.overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr);
  gap: 20px;
  align-items: start;
}
.product-tile {
  display: grid;
  gap: 20px;
}
.product-tile > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.product-title p {
  margin: 2px 0 0;
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}
.stat {
  padding: 14px 16px;
  border-left: 1px solid var(--line);
}
.stat:first-child {
  border-left: 0;
}
.stat strong {
  display: block;
  font-size: 22px;
  font-weight: 650;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.stat span {
  font-size: 12.5px;
  color: var(--muted);
}
.tile-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  counter-reset: step;
}
.steps li {
  display: grid;
  grid-template-columns: 26px 1fr;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  counter-increment: step;
}
.steps li:first-child {
  border-top: 0;
  padding-top: 0;
}
.steps li::before {
  content: counter(step);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 650;
  color: var(--muted);
}
.steps li.done::before {
  content: "✓";
  background: var(--brand);
  border-color: var(--brand);
  color: var(--on-brand);
}
.steps strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
}
.steps p {
  margin: 2px 0 0;
  font-size: 13px;
}
.later {
  font-size: 13px;
  color: var(--muted);
  margin: 4px 0 0;
}

/* Settings */
.settings-layout {
  display: grid;
  grid-template-columns: 190px minmax(0, 760px);
  gap: 32px;
  align-items: start;
}
.settings-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  position: sticky;
  top: 24px;
}
.settings-nav a {
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 550;
  white-space: nowrap;
}
.settings-nav a:hover {
  color: var(--ink);
  background: var(--surface);
}
.settings-nav a[aria-current="true"] {
  color: var(--ink);
  background: var(--surface);
  box-shadow: inset 2px 0 0 var(--brand);
}
.list {
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}
.list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}
.list-row:first-child {
  border-top: 0;
}
.list-row .who {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.list-row .who > span:last-child {
  min-width: 0;
}
.list-row strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
}
.list-row small {
  display: block;
  font-size: 12.5px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
}
.list-row .avatar {
  background: var(--brand-soft);
  color: var(--brand-ink);
  border: 0;
}
.list-row .end {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.list-row button {
  min-height: 34px;
  padding: 6px 12px;
}
.empty {
  padding: 18px 16px;
  font-size: 13.5px;
  color: var(--muted);
  background: var(--surface);
}

/* Sign-in */
.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}
.auth-art {
  position: relative;
  background: var(--forest);
  color: var(--forest-ink);
  padding: 40px 48px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}
.auth-art .brand,
.auth-art blockquote {
  position: relative;
  z-index: 1;
}
.auth-art blockquote {
  margin: 0;
  max-width: 440px;
}
.auth-art blockquote p {
  color: #fff;
  font-size: clamp(22px, 2.3vw, 30px);
  line-height: 1.25;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 12px;
}
.auth-art blockquote footer {
  color: var(--forest-muted);
  font-size: 14px;
}
.wall {
  position: absolute;
  top: 20%;
  left: -60px;
  right: -60px;
  display: grid;
  grid-template-columns: repeat(14, 1fr);
  gap: 10px;
  transform: rotate(-8deg);
}
.wall i {
  grid-column: span 2;
  height: 46px;
  border-radius: 6px;
  background: var(--forest-2);
}
.wall i.half {
  grid-column: span 1;
}
.wall i.lit {
  background: #7fd1ad;
}
@media (prefers-reduced-motion: no-preference) {
  .wall i.lit {
    animation: lay 900ms cubic-bezier(0.2, 0.8, 0.2, 1) 300ms both;
  }
}
@keyframes lay {
  from {
    transform: translateY(-140px);
    opacity: 0;
  }
  to {
    transform: none;
    opacity: 1;
  }
}
main.auth-main {
  margin: 0;
  max-width: none;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  background: var(--surface);
}
.auth-card {
  width: 100%;
  max-width: 380px;
}
.auth-card h1 {
  margin-bottom: 8px;
}
.auth-card > p {
  margin-bottom: 26px;
  font-size: 15px;
}
.auth-card .brand {
  display: none;
  color: var(--ink);
  margin-bottom: 32px;
}
.auth-card .mark {
  fill: var(--brand);
}
.provider-buttons {
  display: grid;
  gap: 10px;
}
.provider-buttons svg {
  width: 18px;
  height: 18px;
}
.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0 4px;
  font-size: 12.5px;
  color: var(--muted);
}
.divider::before,
.divider::after {
  content: "";
  flex: 1;
  border-top: 1px solid var(--line);
}
.auth-card details {
  border-top: 0;
  padding-top: 0;
  margin-top: 18px;
}
.auth-card .row > button {
  margin-bottom: 0;
}
.auth-foot {
  margin-top: 28px;
  font-size: 12.5px;
  color: var(--muted);
}

/* Brix workspace */
.workspace-grid {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
.conversation {
  display: grid;
  gap: 10px;
  margin: 14px 0;
  max-height: 360px;
  overflow: auto;
}
.message {
  border-radius: 10px;
  padding: 12px 15px;
  background: var(--brand-soft);
  color: var(--ink);
  white-space: pre-wrap;
  font-size: 13.5px;
}
.message.user {
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.message small {
  display: block;
  font-size: 12px;
  font-weight: 650;
  color: var(--muted);
  margin-bottom: 4px;
}
#test-controls {
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
}
.test-field .test-field {
  margin: 12px 0 12px 8px;
  padding-left: 16px;
  border-left: 2px solid var(--line);
}
.test-field > label {
  margin-bottom: 4px;
}
.test-field > .secondary {
  margin-top: 8px;
  margin-right: 6px;
}
#test-submit {
  margin-top: 18px;
}
#test-result-summary {
  color: var(--ink);
}

/* Secure setup page (public, no shell) */
main.setup-page {
  margin: 0 auto;
  max-width: 650px;
  padding: 40px 20px;
}
.setup-page .brand {
  color: var(--brand);
  margin-bottom: 24px;
  font-size: 22px;
}
.setup-page h1 {
  margin: 10px 0 12px;
}
.consent {
  margin: 0 0 26px;
  padding: 6px 18px 18px;
  border: 1px solid var(--brand);
  border-radius: 12px;
  background: var(--brand-soft);
}
.consent legend {
  padding: 0 6px;
  font-size: 17px;
  font-weight: 700;
}
.consent ul {
  margin: 0 0 12px;
  padding-left: 20px;
}
.consent li {
  margin: 6px 0;
  overflow-wrap: anywhere;
}
.consent details {
  margin-top: 8px;
  padding-top: 10px;
}
.consent .check {
  margin-top: 16px;
  font-size: 14px;
  color: var(--ink);
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-weight: 600;
  align-items: flex-start;
}
.consent .check input {
  margin-top: 4px;
}

/* Integration guide */
.doc {
  max-width: 920px;
}
.doc pre code {
  background: none;
  padding: 0;
  color: inherit;
}
.doc li {
  margin: 8px 0;
}
.doc p,
.doc li {
  color: var(--ink-2);
  font-size: 14.5px;
  line-height: 1.65;
}
.doc h2 {
  margin: 34px 0 12px;
  font-size: 20px;
}
.doc h3 {
  margin: 24px 0 8px;
}
.doc-table {
  overflow-x: auto;
}
.doc table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.doc th,
.doc td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.doc th {
  background: var(--surface-2);
  font-weight: 600;
}
.doc section {
  scroll-margin-top: 20px;
}

/* Responsive */
@media (max-width: 1100px) {
  .workspace-grid,
  .overview-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  main {
    padding: 28px 24px 40px;
  }
}
@media (max-width: 860px) {
  #sidebar {
    position: sticky;
    top: 0;
    width: auto;
    max-height: 100vh;
  }
  .sidebar-top {
    padding: 12px 16px;
  }
  .menu-toggle {
    display: grid;
    place-items: center;
    background: none;
    border: 0;
    color: #fff;
    min-height: 40px;
    width: 40px;
    padding: 0;
  }
  #sidebar .menu-toggle:hover {
    background: rgb(255 255 255 / 8%);
  }
  .sidebar-body {
    display: none;
    padding: 0 12px 16px;
  }
  #sidebar.open .sidebar-body {
    display: flex;
  }
  main {
    margin-left: 0;
    padding: 24px 16px 40px;
  }
  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .settings-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }
  .settings-nav {
    flex-direction: row;
    position: static;
    overflow-x: auto;
  }
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .stat:nth-child(3) {
    border-left: 0;
  }
  .stat:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }
  .auth-shell {
    grid-template-columns: minmax(0, 1fr);
  }
  .auth-art {
    display: none;
  }
  .auth-card .brand {
    display: inline-flex;
  }
  .panel {
    padding: 18px;
  }
  .row {
    align-items: stretch;
  }
  .row > button,
  .row > a.button {
    margin: 0;
  }
  button,
  a.button {
    min-height: 44px;
  }
}
