.ai-lab {
  --lab-ink:#18373e; --lab-link:#086a66; --lab-surface:#fff;
  --lab-soft:#f0f7f6; --lab-border:#cfdfdc; --lab-accent:#098c83;
  --lab-button:#086a66; --lab-on-button:#fff;
  --lab-disabled:#e6eeec; --lab-disabled-ink:#667c7b;
  --lab-muted:#526c70; --lab-success:#176647; --lab-success-bg:#e7f5ed;
  --lab-review:#8b4b16; --lab-review-bg:#fff2e4;
  max-width:1120px; padding-top:56px; padding-bottom:80px; color:var(--lab-ink);
}
:root[data-site-theme=dark] .ai-lab {
  --lab-ink:#e4efed; --lab-link:#8ae5db; --lab-surface:#11282e;
  --lab-soft:#17353b; --lab-border:#35575c; --lab-accent:#6cddd3;
  --lab-button:#086a66; --lab-disabled:#29464c; --lab-disabled-ink:#b4c8c8;
  --lab-muted:#b1c8c6; --lab-success:#9ce4bd; --lab-success-bg:#173e33;
  --lab-review:#ffd2a1; --lab-review-bg:#443329;
}
.ai-lab, .ai-lab * { box-sizing:border-box; }
.ai-lab h1 { font-size:clamp(48px,7vw,80px); line-height:1.05; margin:20px 0 24px; letter-spacing:-.04em; }
.ai-lab h2 { font-size:clamp(24px,3vw,32px); line-height:1.23; margin:16px 0; letter-spacing:-.025em; }
.ai-lab h3 { font-size:18px; line-height:1.4; margin:0 0 16px; letter-spacing:-.01em; }
.ai-lab p { line-height:1.65; max-width:76ch; margin:0 0 20px; }
.ai-lab a { color:var(--lab-link); text-underline-offset:4px; }
.lab-intro > nav:first-child { font-size:13px; margin-bottom:28px; color:var(--lab-muted); }
.lab-intro > .eyebrow { font-size:12px; letter-spacing:.06em; margin-bottom:0; }
.lab-intro > p:not(.eyebrow) { font-size:20px; color:var(--lab-muted); max-width:60ch; margin-bottom:28px; }
.lab-note { padding:22px 24px; border:1px solid var(--lab-border); border-radius:20px; background:var(--lab-soft); }
.lab-badge, .lab-card > .eyebrow { display:inline-flex; align-items:center; width:fit-content; padding:6px 11px; border-radius:999px; background:var(--lab-soft); color:var(--lab-link); font-size:12px; font-weight:700; line-height:1.5; }
.lab-note .lab-badge { padding:0; background:none; margin-bottom:10px; }
.lab-note > p { font-size:15px; margin:0 0 12px; }
.lab-note details { font-size:14px; color:var(--lab-muted); }
.lab-note summary { cursor:pointer; color:var(--lab-link); width:fit-content; padding:4px 0; font-weight:600; }
.lab-note details p { margin:12px 0 0; }
.ai-lab .lab-tabs { display:flex; flex-wrap:wrap; gap:10px; margin:28px 0 36px; }
.ai-lab .lab-tabs a { display:inline-flex; align-items:center; gap:9px; min-height:46px; padding:9px 15px; border:1px solid var(--lab-border); border-radius:999px; background:var(--lab-surface); color:var(--lab-ink); text-decoration:none; font-size:14px; font-weight:600; line-height:1.3; transition:background .18s,color .18s,border-color .18s; }
.lab-tab-number { display:grid; place-items:center; width:24px; height:24px; flex-shrink:0; border-radius:50%; background:var(--lab-soft); color:var(--lab-link); font-size:10px; font-variant-numeric:tabular-nums; }
.ai-lab .lab-tabs a[aria-current] { background:var(--lab-button); border-color:var(--lab-button); color:var(--lab-on-button); box-shadow:0 4px 12px #086a661a; }
.lab-tabs a[aria-current] .lab-tab-number { background:#ffffff24; color:#fff; }
@media(hover:hover) { .ai-lab .lab-tabs a:hover { border-color:var(--lab-accent); } .ai-lab .lab-links a:hover { background:var(--lab-soft); border-color:var(--lab-accent); } }
.lab-card { min-width:0; border:1px solid var(--lab-border); border-radius:24px; padding:32px; margin:28px 0; scroll-margin-top:calc(var(--header-h,80px) + 24px); background:var(--lab-surface); box-shadow:0 8px 30px #17343a05; }
.lab-card > .eyebrow { margin:0; }
.lab-card > p:not(.eyebrow):not(.lab-status) { color:var(--lab-muted); font-size:16px; }
.lab-grid { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:20px; margin:24px 0; }
.lab-panel { min-width:0; background:var(--lab-soft); border:1px solid var(--lab-border); border-radius:18px; padding:20px; }
.ai-lab label { display:block; font-size:14px; line-height:1.5; font-weight:600; margin:24px 0 8px; }
.lab-panel > label:first-child { margin-top:0; }
.ai-lab input:not([type=checkbox]), .ai-lab select { display:block; box-sizing:border-box; width:100%; max-width:100%; min-width:0; min-inline-size:0; min-height:50px; margin:0; padding:13px 14px; border:1px solid var(--lab-border); border-radius:13px; font:inherit; font-size:16px; line-height:1.4; background:var(--lab-surface); color:var(--lab-ink); }
.ai-lab select { padding-right:36px; text-overflow:ellipsis; }
.ai-lab input[type=date] { appearance:none; -webkit-appearance:none; min-height:52px; }
.ai-lab input[type=date]::-webkit-date-and-time-value { text-align:left; min-height:1.4em; }
.ai-lab input[type=date]::-webkit-datetime-edit { min-width:0; padding:0; }
.ai-lab button { border:1px solid transparent; border-radius:999px; padding:13px 22px; min-height:48px; background:var(--lab-button); color:var(--lab-on-button); cursor:pointer; font:inherit; font-size:14px; font-weight:600; line-height:1.4; white-space:normal; }
.ai-lab button:disabled { background:var(--lab-disabled); color:var(--lab-disabled-ink); cursor:not-allowed; }
.ai-lab .lab-button-secondary { background:var(--lab-surface); color:var(--lab-link); border-color:var(--lab-border); }
.lab-actions { display:flex; flex-wrap:wrap; gap:10px; margin:24px 0; }
.ai-lab :is(button,input,select,a,summary):focus-visible { outline:3px solid var(--lab-accent); outline-offset:4px; }
.ai-lab pre { padding:18px; margin:0 0 20px; border-radius:12px; background:var(--lab-surface); border:1px solid var(--lab-border); white-space:pre-wrap; overflow-wrap:anywhere; color:var(--lab-ink); font-size:14px; line-height:1.8; }
.ai-lab .lab-check { display:flex; gap:12px; align-items:flex-start; font-size:14px; font-weight:500; line-height:1.55; margin:22px 0; }
.ai-lab input[type=checkbox] { width:21px; height:21px; flex-shrink:0; margin:0; accent-color:var(--lab-button); }
.ai-lab .lab-status { border:1px solid var(--lab-border); border-radius:16px; padding:18px; margin:24px 0; background:var(--lab-soft); color:var(--lab-ink); font-size:14px; line-height:1.7; overflow-wrap:anywhere; }
.lab-status::before { content:'Result'; display:block; width:fit-content; padding:4px 9px; margin-bottom:10px; border-radius:999px; background:var(--lab-surface); color:var(--lab-link); font-size:11px; font-weight:700; line-height:1.5; }
.lab-status[data-state=review]::before { content:'Review required'; background:var(--lab-review-bg); color:var(--lab-review); }
.lab-status[data-state=success]::before { content:'Checks passed'; background:var(--lab-success-bg); color:var(--lab-success); }
.lab-status[data-state=ready]::before { content:'Ready for review'; }
.lab-table { overflow:auto; margin:24px 0; border:1px solid var(--lab-border); border-radius:16px; }
.ai-lab table { border-collapse:collapse; width:100%; font-size:14px; }
.ai-lab th,.ai-lab td { padding:18px; border-bottom:1px solid var(--lab-border); text-align:left; min-width:150px; line-height:1.6; vertical-align:top; }
.ai-lab tr:last-child td { border-bottom:0; }
.ai-lab th { background:var(--lab-soft); font-size:12px; font-weight:700; }
.lab-result { display:inline-flex; padding:4px 12px; border-radius:999px; font-size:12px; font-weight:700; line-height:1.5; white-space:nowrap; }
.lab-result.is-pass { color:var(--lab-success); background:var(--lab-success-bg); }
.lab-result.is-fail { color:var(--lab-review); background:var(--lab-review-bg); }
.ai-lab dl { display:grid; gap:0; margin:24px 0; padding:18px; border:1px solid var(--lab-border); border-radius:16px; }
.ai-lab dt { font-size:12px; font-weight:700; color:var(--lab-muted); margin:0 0 8px; }
.ai-lab dd { margin:0 0 20px; font-size:15px; line-height:1.6; }
.ai-lab dd:last-child { margin-bottom:0; }
.ai-lab .lab-links { display:flex; flex-wrap:wrap; gap:10px; border-top:1px solid var(--lab-border); margin-top:28px; padding-top:22px; }
.ai-lab .lab-links a { display:inline-flex; align-items:center; gap:12px; padding:10px 14px; min-height:44px; border:1px solid var(--lab-border); border-radius:999px; text-decoration:none; font-size:13px; font-weight:600; line-height:1.5; }
.lab-links a::after { content:'↗'; margin-left:auto; font-size:16px; flex-shrink:0; }
.lab-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; }
@media(max-width:650px) {
  .ai-lab { padding-top:32px; padding-bottom:64px; }
  .ai-lab h1 { margin:16px 0 22px; font-size:52px; }
  .lab-intro > p:not(.eyebrow) { font-size:17px; margin-bottom:24px; }
  .lab-intro > nav:first-child { margin-bottom:24px; }
  .lab-note { padding:18px; border-radius:18px; }
  .lab-note > p { font-size:14px; }
  .lab-note details { font-size:13px; }
  .ai-lab .lab-tabs { gap:8px; margin:24px 0 30px; }
  .ai-lab .lab-tabs a { padding:9px 12px; font-size:13px; gap:7px; }
  .lab-tab-number { width:20px; height:20px; font-size:9px; }
  .lab-card { padding:24px 18px; margin:22px 0; border-radius:22px; }
  .ai-lab h2 { font-size:25px; margin:18px 0 16px; }
  .lab-card > p:not(.eyebrow):not(.lab-status) { font-size:15px; margin-bottom:22px; }
  .lab-grid { grid-template-columns:minmax(0,1fr); gap:16px; margin:24px 0; }
  .lab-panel { padding:16px; }
  .ai-lab h3 { font-size:16px; }
  .lab-actions { display:grid; grid-template-columns:minmax(0,1fr); margin:24px 0; }
  .lab-actions button, #doc-approve { width:100%; }
  .ai-lab .lab-status { margin:24px 0; padding:16px; }
  .lab-table { border:0; border-radius:0; overflow:visible; }
  .lab-table table, .lab-table tbody { display:block; }
  .lab-table thead { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0,0,0,0); }
  .lab-table tbody { display:grid; gap:14px; }
  .lab-table tr { display:block; padding:16px; border:1px solid var(--lab-border); border-radius:16px; background:var(--lab-soft); }
  .ai-lab .lab-table td { display:block; width:100%; min-width:0; padding:0; margin:0 0 16px; border:0; font-size:14px; }
  .ai-lab .lab-table td:last-child { display:flex; align-items:center; justify-content:space-between; margin:0; }
  .lab-table td::before { content:attr(data-label); display:block; margin-bottom:6px; color:var(--lab-muted); font-size:11px; font-weight:700; line-height:1.5; }
  .lab-table td:last-child::before { margin:0; }
  .ai-lab .lab-links { gap:10px; padding-top:22px; }
  .ai-lab .lab-links a { width:100%; border-radius:16px; padding:12px 14px; font-size:13px; }
}
@media(prefers-reduced-motion:reduce) { .ai-lab .lab-tabs a { transition:none; } }
