  /* ---------- design tokens (sourced from stlabs.com) ---------- */
  :root {
    --bg: #fefefe;
    --surface: #f4f5f7;                           /* soft light grey for surfaces */
    --surface-2: #eeeff1;                         /* slightly stronger — for inline code, icon chips on white */
    --hover: rgba(26, 26, 31, 0.05);              /* black-alpha; darkens any base */
    --border: rgba(26, 26, 31, 0.10);             /* --border light */
    --border-strong: rgba(26, 26, 31, 0.20);
    --text: #2c2f36;                              /* primary — softened from #1a1a1f */
    --text-muted: #5a5a63;                        /* secondary — descriptions, body meta */
    --text-soft: #7a7f87;                         /* tertiary — inactive nav, table meta */
    --text-faint: #9a9aa3;                        /* quaternary — eyebrows, captions */
    --brand: #DC5A1C;                            /* stlabs logo orange */
    --brand-hover: #B84817;
    --brand-soft: rgba(220, 90, 28, 0.06);
    --brand-soft-strong: rgba(220, 90, 28, 0.10);
    --brand-border: rgba(220, 90, 28, 0.20);
    --brand-text: #B84817;
    --info: #2f6fed;                              /* --color-blue */
    --success: #1c8a5a;                           /* --color-green */
    --warn: #f59e0b;                              /* --color-gold */
    --danger: #b93737;                            /* --color-error */
    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 14px;
    --shadow-sm: 0 1px 2px rgba(20, 20, 20, 0.04);
    --shadow: 0 1px 3px rgba(20, 20, 20, 0.06), 0 6px 20px -8px rgba(20, 20, 20, 0.08);
    --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  }

  * { box-sizing: border-box; }
  html, body { margin: 0; padding: 0; }
  body {
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--text);
    background: var(--surface);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
  }
  /* display font on hero/section headings */
  .page-title,
  .section-head h2 {
    font-family: "DM Sans", "Inter", sans-serif;
  }

  a { color: inherit; }
  button { font: inherit; cursor: pointer; }

  /* ---------- page chrome ---------- */
  .page {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 24px 96px;
  }
  .page-header { margin-bottom: 24px; }
  .page-eyebrow {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--brand-text);
    background: var(--brand-soft);
    padding: 4px 8px;
    border-radius: 999px;
  }
  .page-title { font-size: 22px; line-height: 28px; font-weight: 600; margin: 12px 0 4px; letter-spacing: -0.01em; }
  .page-sub { color: var(--text-muted); margin: 0; }

  .section {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin-top: 28px;
    overflow: hidden;
  }
  .section-head {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
  }
  .section-head h2 { font-size: 14px; font-weight: 600; margin: 0; letter-spacing: -0.005em; }
  .section-head p { font-size: 13px; color: var(--text-muted); margin: 0; }
  .section-body { padding: 20px; }

  /* ===================================================================
     1. CHAT APP — refined version of the current screen
     =================================================================== */
  .app {
    display: grid;
    grid-template-columns: 220px 280px 1fr;
    height: 760px;
    background: var(--bg);
    overflow: hidden;
  }
  .app > * { min-height: 0; min-width: 0; }

  /* --- workspace nav (left) --- */
  .nav {
    border-right: 1px solid var(--border);
    background: var(--bg);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
  }
  .nav-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 14px;
    font-weight: 600;
    letter-spacing: -0.005em;
  }
  .nav-brand-logo { height: 16px; width: auto; display: block; }
  .brand-mark {
    width: 24px; height: 24px;
    background: var(--brand);
    border-radius: 6px;
    display: grid; place-items: center;
    color: white;
    font-size: 12px; font-weight: 700;
  }
  .nav-section { padding: 6px 8px; }
  .nav-label {
    font-size: 11px; font-weight: 600;
    color: var(--text-faint);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 8px 10px 4px;
  }
  .nav-item {
    display: flex; align-items: center; gap: 10px;
    padding: 7px 10px;
    border-radius: var(--radius-sm);
    color: var(--text-soft);
    font-size: 13px;
    cursor: pointer;
    user-select: none;
  }
  .nav-item:hover { background: var(--hover); color: var(--text); }
  .nav-item.is-active {
    background: var(--brand-soft);
    color: var(--brand-text);
    font-weight: 500;
  }
  .nav-item .count { margin-left: auto; color: var(--text-faint); font-size: 12px; }
  .nav-item.is-active .count { color: var(--brand-text); }
  .nav-divider { height: 1px; background: var(--border); margin: 8px 12px; }
  .nav-footer {
    margin-top: auto;
    padding: 12px;
    border-top: 1px solid var(--border);
    display: flex; align-items: center; gap: 10px;
  }
  .avatar {
    width: 28px; height: 28px; border-radius: 999px;
    background: #1b1a17; color: white;
    display: grid; place-items: center;
    font-size: 11px; font-weight: 600;
    flex-shrink: 0;
  }
  .avatar.sm { width: 22px; height: 22px; font-size: 10px; }
  .avatar.lg { width: 36px; height: 36px; font-size: 13px; }
  .nav-footer .meta { font-size: 12px; line-height: 1.3; }
  .nav-footer .meta .who { font-weight: 500; color: var(--text); }
  .nav-footer .meta .role { color: var(--text-faint); }

  /* --- chat list (middle) --- */
  .list {
    border-right: 1px solid var(--border);
    background: var(--bg);
    display: flex; flex-direction: column;
    overflow-y: auto;
  }
  .list-head {
    padding: 12px;
    display: flex; flex-direction: column; gap: 8px;
    border-bottom: 1px solid var(--border);
  }
  .new-chat-btn {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 10px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-weight: 500;
    color: var(--text);
    box-shadow: var(--shadow-sm);
  }
  .new-chat-btn .kbd {
    margin-left: auto;
    font-family: var(--mono);
    font-size: 11px;
    color: var(--text-faint);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 1px 5px;
  }
  .search {
    display: flex; align-items: center; gap: 8px;
    padding: 7px 10px;
    background: var(--surface);
    border: 1px solid transparent;
    border-radius: var(--radius);
    color: var(--text-faint);
    font-size: 13px;
  }
  .list-group { padding: 8px 0; }
  .list-group-label {
    font-size: 11px; font-weight: 600;
    color: var(--text-faint);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 8px 16px 4px;
  }
  .list-item {
    padding: 10px 16px;
    border-left: 2px solid transparent;
    cursor: pointer;
  }
  .list-item:hover { background: var(--hover); }
  .list-item.is-active {
    background: var(--hover);
    border-left-color: var(--brand);
  }
  .list-item .title {
    font-size: 13px; font-weight: 500;
    color: var(--text);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .list-item .sub {
    margin-top: 2px;
    font-size: 12px;
    color: var(--text-faint);
    display: flex; align-items: center; gap: 6px;
  }
  .dot { width: 4px; height: 4px; border-radius: 999px; background: currentColor; opacity: 0.5; }

  /* --- thread (right) --- */
  .thread { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
  .thread-head {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 24px;
    border-bottom: 1px solid var(--border);
  }
  .thread-eyebrow {
    font-size: 11px; font-weight: 600; letter-spacing: 0.06em;
    text-transform: uppercase; color: var(--text-faint);
  }
  .thread-title { font-size: 14px; font-weight: 500; }
  .thread-actions { margin-left: auto; display: flex; gap: 4px; color: var(--text-muted); }
  .icon-btn {
    width: 30px; height: 30px;
    display: grid; place-items: center;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
  }
  .icon-btn:hover { background: var(--hover); color: var(--text); }

  .thread-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 24px 28px 8px;
  }
  .day-divider {
    display: flex; align-items: center; gap: 12px;
    color: var(--text-faint);
    font-size: 11px; font-weight: 600;
    letter-spacing: 0.06em;
    margin: 8px 0 20px;
    text-transform: uppercase;
  }
  .day-divider::before, .day-divider::after {
    content: ""; flex: 1; height: 1px; background: var(--border);
  }

  /* user bubble */
  .msg-user {
    display: flex; justify-content: flex-end;
    margin-bottom: 24px;
  }
  .msg-user .bubble {
    max-width: 70%;
    background: var(--surface);
    border: none;
    padding: 10px 14px;
    border-radius: 16px 16px 4px 16px;
  }

  /* assistant message */
  .msg-ai { margin-bottom: 28px; }
  .msg-ai .row {
    display: flex; align-items: center; gap: 8px;
    margin-bottom: 10px;
  }
  .msg-ai .name { font-weight: 500; }
  .msg-ai .model {
    font-size: 12px; color: var(--text-faint);
  }
  .ai-badge {
    font-size: 10px; font-weight: 700;
    color: var(--brand-text);
    background: var(--brand-soft);
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: 0.04em;
  }
  .msg-ai .body {
    font-size: 14.5px;
    color: var(--text);
    line-height: 1.6;
  }
  .msg-ai .body > * + * { margin-top: 14px; }
  .msg-ai .body h3 {
    font-size: 13px; font-weight: 500;
    margin: 4px 0 0;
    color: var(--text);
  }

  /* tool-call pill */
  .tool-pill {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 6px 0;
    background: transparent;
    border: none;
    border-radius: 999px;
    font-size: 13px;
    color: var(--text-muted);
  }
  .tool-pill .check {
    width: 16px; height: 16px;
    background: #d1fae5;
    color: #065f46;
    border-radius: 999px;
    display: grid; place-items: center;
  }
  .tool-pill strong { color: var(--text); font-weight: 500; }
  .tool-pill .sep { color: var(--text-faint); }

  /* inline code */
  code.inline {
    font-family: var(--mono);
    font-size: 0.88em;
    padding: 1px 6px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 5px;
    color: var(--text);
  }

  /* numbered list with circle badges */
  ol.numbered {
    list-style: none;
    margin: 0; padding: 0;
    counter-reset: nlist;
  }
  ol.numbered > li {
    counter-increment: nlist;
    position: relative;
    padding: 6px 0 6px 34px;
    min-height: 28px;
  }
  ol.numbered > li::before {
    content: counter(nlist);
    position: absolute;
    left: 0;
    top: 7px;
    width: 22px; height: 22px;
    background: var(--brand-soft-strong);
    border: 1px solid var(--brand-border);
    border-radius: 999px;
    display: grid; place-items: center;
    font-size: 11px; font-weight: 600;
    color: var(--brand-text);
    box-sizing: border-box;
  }

  /* tab group */
  .tabs {
    display: inline-flex;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 3px;
    gap: 2px;
  }
  .tab {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 5px 12px;
    border-radius: 7px;
    font-size: 13px;
    color: var(--text-muted);
    border: none; background: transparent;
  }
  .tab.is-active {
    background: var(--bg);
    color: var(--text);
    box-shadow: var(--shadow-sm);
    font-weight: 500;
  }

  /* sources grid */
  .sources {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .source-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 14px;
    background: var(--bg);
    transition: background 0.15s;
    cursor: pointer;
  }
  .source-card:hover { background: var(--hover); }
  .source-card .meta {
    font-size: 11px; font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--text-faint);
    text-transform: uppercase;
    display: flex; align-items: center; gap: 6px;
    margin-bottom: 6px;
  }
  .source-card .meta .pill-dot { width: 6px; height: 6px; border-radius: 999px; background: var(--brand); }
  .source-card.kb-blue .meta .pill-dot { background: var(--info); }
  .source-card .meta .id { color: var(--text-muted); font-weight: 500; }
  .source-card .title { font-size: 13px; font-weight: 500; line-height: 1.4; }

  /* buttons */
  .btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    border: 1px solid transparent;
    transition: background 0.12s, border-color 0.12s;
    line-height: 1;
    white-space: nowrap;
  }
  .btn-primary {
    background: var(--brand);
    color: white;
  }
  .btn-primary:hover { background: var(--brand-hover); }
  .btn-secondary {
    background: var(--bg);
    border-color: var(--border-strong);
    color: var(--text);
  }
  .btn-secondary:hover { background: var(--hover); }
  .btn-ghost {
    background: transparent;
    color: var(--text-muted);
  }
  .btn-ghost:hover { background: var(--hover); color: var(--text); }
  .btn-danger {
    background: #dc2626; color: white;
  }
  .btn-link-ext {
    /* external link button */
    background: var(--bg);
    border-color: var(--border-strong);
    color: var(--text);
    font-family: var(--mono);
    font-size: 12px;
  }
  .btn-link-ext:hover { background: var(--hover); }

  /* multi-choice / quick reply */
  .choices {
    display: flex; flex-wrap: wrap; gap: 8px;
  }
  .choice {
    padding: 7px 12px;
    border: 1px solid var(--border-strong);
    background: var(--bg);
    border-radius: 999px;
    font-size: 13px;
    color: var(--text);
    transition: background 0.12s, border-color 0.12s;
  }
  .choice:hover { background: var(--hover); border-color: var(--text-muted); }
  .choice.is-selected {
    background: var(--brand-soft);
    border-color: var(--brand);
    color: var(--brand-text);
    font-weight: 500;
  }
  /* "Other" inline text input pairs with an "Other" choice pill */
  .other-input {
    padding: 7px 14px;
    border: 1px solid var(--border-strong);
    background: var(--bg);
    border-radius: 999px;
    font-size: 13px;
    color: var(--text);
    outline: none;
    font-family: inherit;
    min-width: 160px;
  }
  .other-input::placeholder { color: var(--text-faint); }
  .other-input:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(220, 90, 28, 0.14);
  }

  /* status pill */
  .status {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px; font-weight: 600;
    letter-spacing: 0.02em;
  }
  .status::before {
    content: ""; width: 6px; height: 6px; border-radius: 999px;
    background: currentColor;
  }
  .status-open { background: #fef3c7; color: #92400e; }
  .status-resolved { background: #dcfce7; color: #166534; }
  .status-escalated { background: #fee2e2; color: #991b1b; }
  .status-processing { background: #e0e7ff; color: #3730a3; }

  /* composer */
  .composer-wrap {
    border-top: 1px solid var(--border);
    padding: 14px 24px 12px;
    background: var(--bg);
  }
  .composer {
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    padding: 10px 12px;
    background: var(--bg);
    transition: border-color 0.15s, box-shadow 0.15s;
  }
  .composer:focus-within {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(220, 90, 28, 0.14);
  }
  .composer textarea {
    width: 100%; border: none; outline: none; resize: none;
    font: inherit; color: var(--text);
    background: transparent;
    min-height: 22px;
    padding: 2px 0 6px;
  }
  .composer textarea::placeholder { color: var(--text-faint); }
  .composer-row {
    display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  }
  .chip {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 12px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text-muted);
  }
  .chip:hover { background: var(--hover); }
  .chip.is-on {
    background: var(--brand-soft);
    border-color: var(--brand-border);
    color: var(--brand-text);
  }
  .composer-send {
    margin-left: auto;
    width: 30px; height: 30px;
    border-radius: var(--radius-sm);
    background: var(--brand);
    color: white;
    border: none;
    display: grid; place-items: center;
  }
  .composer-foot {
    display: flex; justify-content: space-between;
    margin-top: 8px;
    color: var(--text-faint);
    font-size: 12px;
  }
  .composer-foot .kbd-hint {
    display: inline-flex; gap: 12px;
  }
  kbd {
    font-family: var(--mono); font-size: 10px;
    padding: 1px 5px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 4px;
  }

  /* ===================================================================
     2. BUILDING BLOCKS LIBRARY
     =================================================================== */
  .blocks {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
  .blocks.full > .block { grid-column: 1 / -1; }
  .block {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    background: var(--bg);
  }
  .block h3 {
    font-size: 13px; font-weight: 600;
    margin: 0 0 4px;
  }
  .block .desc {
    font-size: 12px; color: var(--text-muted);
    margin: 0 0 14px;
  }
  .block .demo {
    padding: 16px;
    background: var(--surface);
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-sm);
    display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  }
  .block .demo.stack { flex-direction: column; align-items: stretch; }
  .block .demo.stack > * + * { margin-top: 10px; }
  .label-row {
    display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
    font-size: 11px; color: var(--text-faint); margin-bottom: 6px;
    text-transform: uppercase; letter-spacing: 0.06em;
  }

  /* prior activity (stlabs-specific block) */
  .prior {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 14px;
    background: var(--bg);
  }
  .prior-head {
    display: flex; align-items: center; gap: 8px;
    font-size: 12px; color: var(--text-muted);
    margin-bottom: 8px;
  }
  .prior-list { list-style: none; margin: 0; padding: 0; }
  .prior-list li {
    display: grid;
    grid-template-columns: 16px 1fr auto;
    gap: 10px;
    padding: 6px 0;
    font-size: 13px;
    border-bottom: 1px dashed var(--border);
  }
  .prior-list li:last-child { border-bottom: none; }
  .prior-list .when { color: var(--text-faint); font-size: 12px; }
  .prior-list .icon {
    width: 16px; height: 16px;
    border-radius: 4px;
    background: var(--surface-2);
    display: grid; place-items: center;
    color: var(--text-muted);
  }

  /* workflow card (recommended runbook) */
  .workflow {
    display: grid;
    grid-template-columns: 36px 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
  }
  .workflow-icon {
    width: 36px; height: 36px;
    background: var(--brand-soft);
    color: var(--brand-text);
    border-radius: 8px;
    display: grid; place-items: center;
  }
  .workflow .title { font-weight: 500; font-size: 13px; }
  .workflow .sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

  /* external link inline */
  a.ext {
    color: var(--brand-text);
    text-decoration: none;
    border-bottom: 1px solid var(--brand-border);
    padding-bottom: 1px;
  }
  a.ext:hover { border-bottom-color: var(--brand); }
  a.ext .arrow { font-size: 0.85em; opacity: 0.7; margin-left: 2px; }

  /* mention chip */
  .mention {
    display: inline-flex; align-items: center; gap: 4px;
    background: var(--brand-soft);
    color: var(--brand-text);
    padding: 1px 6px 1px 4px;
    border-radius: 4px;
    font-weight: 500;
    font-size: 0.92em;
  }

  /* checklist */
  ul.checklist { list-style: none; margin: 0; padding: 0; }
  ul.checklist li {
    display: grid;
    grid-template-columns: 18px 1fr;
    gap: 10px;
    padding: 4px 0;
    font-size: 13px;
  }
  ul.checklist li .box {
    width: 16px; height: 16px;
    border: 1.5px solid var(--border-strong);
    border-radius: 4px;
    margin-top: 3px;
  }
  ul.checklist li.done .box {
    background: var(--brand);
    border-color: var(--brand);
    color: white;
    display: grid; place-items: center;
    font-size: 11px;
  }
  ul.checklist li.done .label { color: var(--text-muted); text-decoration: line-through; }

  /* bulleted list */
  ul.bulleted { list-style: none; margin: 0; padding: 0; }
  ul.bulleted li {
    position: relative;
    padding: 4px 0 4px 16px;
  }
  ul.bulleted li::before {
    content: "";
    position: absolute;
    left: 4px;
    top: 13px;
    width: 5px; height: 5px;
    background: var(--text-muted);
    border-radius: 999px;
  }

  /* disclaimer */
  .ai-disclaimer {
    font-size: 11.5px;
    color: var(--text-faint);
    display: inline-flex; align-items: center; gap: 6px;
  }
  .ai-disclaimer::before {
    content: "i";
    width: 14px; height: 14px;
    border: 1px solid currentColor;
    border-radius: 999px;
    display: grid; place-items: center;
    font-size: 9px; font-style: italic;
    font-family: Georgia, serif;
  }

  /* utility */
  .row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
  .stack { display: flex; flex-direction: column; gap: 8px; }

  /* top-level group divider (Pages / Components / Foundations) */
  .group-divider {
    margin-top: 56px;
    margin-bottom: 12px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
  }
  .group-divider:first-of-type { margin-top: 32px; }
  .group-divider .group-eyebrow {
    font-size: 11px; font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-faint);
    margin: 0 0 4px;
  }
  .group-divider h2 {
    font-family: "DM Sans", "Inter", sans-serif;
    font-size: 24px;
    line-height: 30px;
    font-weight: 600;
    letter-spacing: -0.01em;
    margin: 0 0 4px;
    color: var(--text);
  }
  .group-divider p {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0;
    max-width: 560px;
  }

  /* always-visible thin scrollbars on the chat window panes */
  .nav, .list, .thread-scroll {
    scrollbar-width: thin;
    scrollbar-color: var(--border-strong) transparent;
  }
  .nav::-webkit-scrollbar,
  .list::-webkit-scrollbar,
  .thread-scroll::-webkit-scrollbar { width: 8px; }
  .nav::-webkit-scrollbar-track,
  .list::-webkit-scrollbar-track,
  .thread-scroll::-webkit-scrollbar-track { background: transparent; }
  .nav::-webkit-scrollbar-thumb,
  .list::-webkit-scrollbar-thumb,
  .thread-scroll::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border-radius: 999px;
    border: 2px solid var(--bg);
  }
  .nav::-webkit-scrollbar-thumb:hover,
  .list::-webkit-scrollbar-thumb:hover,
  .thread-scroll::-webkit-scrollbar-thumb:hover {
    background: var(--text-soft);
  }

  /* ---------- foundations (type + color) ---------- */
  .found-h {
    font-size: 11px; font-weight: 600;
    letter-spacing: 0.06em; text-transform: uppercase;
    color: var(--text-faint);
    margin: 0 0 4px;
  }
  .found-h:not(:first-of-type) { margin-top: 36px; }
  .found-sub { color: var(--text-muted); font-size: 12px; margin: 0 0 16px; }

  .type-table {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg);
  }
  .type-row {
    display: grid;
    grid-template-columns: 1fr 260px;
    gap: 24px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--border);
    align-items: center;
  }
  .type-row:last-child { border-bottom: none; }
  .type-sample { color: var(--text); }
  .type-spec { font-size: 12px; color: var(--text-muted); }
  .type-spec .type-name { font-weight: 500; color: var(--text); margin-bottom: 2px; }
  .type-spec code {
    display: block;
    font-family: var(--mono);
    font-size: 11px;
    color: var(--text-muted);
    background: transparent;
    border: none;
    padding: 0;
    margin-bottom: 2px;
  }
  .type-spec .type-use { font-size: 12px; color: var(--text-faint); }

  /* body-type: vertical, full-width samples for evaluating real reading */
  .type-stack { display: grid; gap: 28px; margin-top: 4px; }
  .type-stack-label {
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-faint);
    margin-bottom: 10px;
  }
  .type-stack-sample { color: var(--text); max-width: 720px; }
  .type-stack-sample .muted { color: var(--text-muted); }

  /* icons foundation */
  .icon-table {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    overflow: hidden;
  }
  .icon-row {
    display: grid;
    grid-template-columns: 56px 220px 1fr;
    gap: 20px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    align-items: center;
  }
  .icon-row:last-child { border-bottom: none; }
  .icon-sample { color: var(--text-muted); display: flex; align-items: center; }
  .icon-meta { font-family: var(--mono); font-size: 11px; color: var(--text-muted); letter-spacing: 0.02em; }
  .icon-use { font-size: 12px; color: var(--text-faint); }

  /* persistent top toolbar on inbox/ticket pages */
  .ticket-toolbar {
    display: flex; align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    overflow-x: auto;
  }
  .ticket-toolbar .toolbar-left { display: flex; gap: 2px; }
  .ticket-toolbar .toolbar-divider {
    width: 1px; height: 18px;
    background: var(--border);
    flex-shrink: 0;
  }
  .filter-pill {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 5px 12px;
    border-radius: 999px;
    border: 1px solid transparent;
    background: transparent;
    font-size: 13px;
    color: var(--text-muted);
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
  }
  .filter-pill:hover { background: var(--hover); color: var(--text); }
  .filter-pill.is-active {
    background: var(--brand-soft);
    border-color: var(--brand-border);
    color: var(--brand-text);
    font-weight: 500;
  }
  .filter-pill .count {
    font-size: 11px;
    background: rgba(220, 90, 28, 0.16);
    color: var(--brand-text);
    padding: 1px 6px;
    border-radius: 999px;
    margin-left: 2px;
  }
  .ticket-page-head { margin-bottom: 18px; }
  .ticket-page-head .breadcrumb {
    font-size: 11px; font-weight: 600;
    letter-spacing: 0.06em; text-transform: uppercase;
    color: var(--text-faint);
  }
  .ticket-title-large {
    font-family: "DM Sans", "Inter", sans-serif;
    font-size: 22px;
    line-height: 28px;
    font-weight: 600;
    letter-spacing: -0.01em;
    margin: 4px 0 0;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
  }
  .ticket-page-head .ticket-id {
    font-size: 12px; color: var(--text-faint);
    margin-top: 6px;
    font-family: var(--mono);
  }

  /* ticket page + approval block */
  .ticket-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 24px;
    padding: 12px 14px;
    background: var(--surface);
    border-radius: var(--radius);
    margin-bottom: 18px;
    font-size: 13px;
  }
  .ticket-meta .meta-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-faint);
    margin-bottom: 2px;
  }
  .approval-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    padding: 16px;
  }
  .approval-card > * + * { margin-top: 14px; }
  .approval-head {
    display: flex; align-items: center; justify-content: space-between;
  }
  .assignee-row {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px;
    background: var(--surface);
    border-radius: var(--radius-sm);
    font-size: 13px;
  }
  .assignee-row .name { flex: 1; }
  .assignee-row .name .muted { color: var(--text-muted); }
  .approval-reason label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-faint);
    margin-bottom: 6px;
  }
  .approval-reason label .hint {
    font-weight: 400; letter-spacing: 0; text-transform: none;
    color: var(--text-faint);
    margin-left: 6px;
  }
  .approval-reason textarea {
    width: 100%;
    font: inherit;
    font-size: 13px;
    padding: 10px 12px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    resize: vertical;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    box-sizing: border-box;
  }
  .approval-reason textarea:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(220, 90, 28, 0.14);
  }
  .approval-actions {
    display: flex; justify-content: flex-end; gap: 8px;
  }
  .btn-approve {
    background: var(--success);
    color: white;
    border-color: var(--success);
  }
  .btn-approve:hover { background: #168251; border-color: #168251; }

  .activity-feed {
    list-style: none; margin: 0; padding: 0;
    font-size: 13px;
    color: var(--text-muted);
  }
  .activity-feed li {
    padding: 8px 0;
    border-bottom: 1px dashed var(--border);
  }
  .activity-feed li:last-child { border-bottom: none; }
  .activity-feed .when { color: var(--text-faint); }

  /* inbox-style filter pills above the list */
  .filter-row {
    display: flex; gap: 6px; flex-wrap: wrap;
    padding: 8px 12px 0;
  }
  .filter-row .choice {
    padding: 5px 10px;
    font-size: 12px;
  }

  /* long-form thread refinements */
  .tldr-card {
    border: 1px solid var(--brand-border);
    background: var(--brand-soft);
    border-radius: var(--radius);
    padding: 12px 14px;
  }
  .tldr-card .tldr-eyebrow {
    font-family: "Inter", sans-serif;
    font-size: 11px; font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--brand-text);
    margin: 0 0 4px;
  }
  .tldr-card p {
    margin: 0;
    color: var(--text);
    font-size: 14px;
    line-height: 1.5;
  }
  .option-list {
    display: flex; flex-direction: column;
    gap: 8px;
  }
  .option-card {
    display: grid;
    grid-template-columns: 28px 1fr;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
  }
  .option-num {
    width: 22px; height: 22px;
    border-radius: 999px;
    background: var(--brand-soft-strong);
    border: 1px solid var(--brand-border);
    color: var(--brand-text);
    display: grid; place-items: center;
    font-size: 11px; font-weight: 600;
    margin-top: 1px;
  }
  .option-title { font-weight: 500; font-size: 14px; color: var(--text); }
  .option-desc { font-size: 13px; color: var(--text-muted); margin: 4px 0 6px; line-height: 1.5; }
  .option-card ul.bulleted li { font-size: 13px; line-height: 1.5; }
  .msg-ai .body.measured { max-width: 620px; }

  /* empty state — new chat */
  .thread-empty .empty-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 32px;
    width: 100%;
  }
  .greeting-block {
    text-align: center;
    margin-bottom: 28px;
  }
  .hero-logo {
    position: absolute;
    right: 100%;
    top: 50%;
    transform: translateY(-50%);
    margin-right: 12px;
    width: 44px;
    height: 44px;
    color: var(--brand);
    pointer-events: none;
  }
  .empty-state .greeting {
    font-family: "DM Sans", "Inter", sans-serif;
    font-size: 36px;
    line-height: 42px;
    font-weight: 500;
    letter-spacing: -0.01em;
    color: var(--text);
    margin: 0;
    position: relative;
  }
  .empty-state .greeting-sub {
    font-size: 16px;
    color: var(--text-muted);
    margin: 4px 0 0;
  }
  .hero-composer-wrap {
    width: 100%;
    max-width: 680px;
    margin-bottom: 20px;
  }
  .hero-composer {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 7px 7px 14px;
    border: 1px solid rgba(220, 90, 28, 0.45);
    border-radius: 12px;
    background: var(--bg);
    transition: border-color 0.15s, box-shadow 0.15s;
  }
  .hero-composer:focus-within {
    box-shadow: 0 0 10px 0 rgba(220, 90, 28, 0.3);
  }
  .hero-composer .icon-btn,
  .hero-composer .composer-send {
    width: 28px;
    height: 28px;
  }
  .hero-prefix {
    width: 26px;
    height: 26px;
    background: var(--brand);
    border-radius: 6px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    color: white;
  }
  .hero-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font: inherit;
    font-size: 14px;
    color: var(--text);
    padding: 0;
  }
  .hero-input::placeholder { color: var(--text-faint); }
  .suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    max-width: 760px;
  }
  .suggestion {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid var(--border-strong);
    background: var(--bg);
    font-size: 13px;
    color: var(--text);
    font-family: inherit;
    cursor: pointer;
  }
  .suggestion:hover { background: var(--hover); }
  .suggestion .sparkle { color: var(--brand); flex-shrink: 0; }

  /* external-link confirmation modal */
  .modal-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px 18px 16px;
    box-shadow: 0 10px 30px -10px rgba(0,0,0,0.18), 0 4px 12px -4px rgba(0,0,0,0.06);
    width: 100%; max-width: 380px;
  }
  .modal-card .modal-title { font-size: 14px; font-weight: 600; color: var(--text); margin: 0 0 6px; }
  .modal-card .modal-body { font-size: 13px; color: var(--text-muted); margin: 0 0 12px; }
  .modal-url {
    font-family: var(--mono);
    font-size: 12px;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--text);
    word-break: break-all;
    margin-bottom: 14px;
  }
  .modal-actions { display: flex; justify-content: flex-end; gap: 8px; }

  /* nav/list demo rows in foundations */
  .nav-list-demo .nav-item-demo,
  .nav-list-demo .list-item-demo {
    pointer-events: none;
    user-select: none;
  }
  .nav-list-demo .nav-item-demo {
    width: 200px;
  }

  .color-cluster + .color-cluster { margin-top: 20px; }
  .cluster-label {
    font-size: 11px; font-weight: 600;
    letter-spacing: 0.06em; text-transform: uppercase;
    color: var(--text-faint);
    margin-bottom: 8px;
  }
  .color-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .swatch {
    display: grid;
    grid-template-columns: 44px 1fr;
    gap: 12px;
    align-items: center;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
  }
  .swatch .chip {
    width: 44px;
    height: 28px;
    border-radius: 4px;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.05);
  }
  .swatch .sw-body { min-width: 0; }
  .swatch .sw-name { font-family: var(--mono); font-size: 11px; color: var(--text); display: inline; }
  .swatch .sw-hex { font-family: var(--mono); font-size: 11px; color: var(--text-muted); margin-left: 8px; display: inline; }
  .swatch .sw-use { font-size: 12px; color: var(--text-faint); margin-top: 2px; line-height: 1.35; display: block; }

  /* sticky top nav with anchor links to each group */
  html { scroll-behavior: smooth; scroll-padding-top: 116px; }

  /* on-page right-rail TOC (jump between mockups within Pages) */
  .pages-with-rail {
    display: grid;
    grid-template-columns: 1fr 200px;
    gap: 40px;
    align-items: start;
  }
  .pages-main { min-width: 0; }
  .page-rail {
    position: sticky;
    top: 72px;
    align-self: start;
    padding-top: 4px;
  }
  .page-rail-group + .page-rail-group { margin-top: 18px; }
  .page-rail-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-faint);
    margin-bottom: 6px;
    padding-left: 10px;
  }
  .page-rail-link {
    display: block;
    padding: 5px 10px;
    font-size: 13px;
    color: var(--text-muted);
    text-decoration: none;
    border-left: 2px solid transparent;
    transition: color 0.12s, border-color 0.12s, background 0.12s;
    line-height: 1.4;
  }
  .page-rail-link:hover {
    color: var(--text);
    border-left-color: var(--border-strong);
  }
  .topnav {
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: saturate(140%) blur(8px);
    -webkit-backdrop-filter: saturate(140%) blur(8px);
  }
  .topnav-sticky {
    position: sticky;
    top: 0;
    z-index: 50;
    margin-bottom: 28px;
  }
  .topnav-inner {
    max-width: 1440px;
    margin: 0 auto;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  /* sub-group dividers within Pages (Ask / Inbox) */
  .subgroup-divider {
    display: flex;
    align-items: baseline;
    gap: 14px;
    margin: 36px 0 16px;
    padding-bottom: 10px;
    border-bottom: 1px dashed var(--border);
  }
  .subgroup-divider .label {
    display: inline-block;
    padding: 4px 10px;
    background: var(--brand-soft);
    color: var(--brand-text);
    border: 1px solid var(--brand-border);
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }
  .subgroup-divider .hint {
    font-size: 12px;
    color: var(--text-muted);
  }

  .topnav-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    text-decoration: none;
    line-height: 1;
  }
  .topnav-logo { height: 22px; width: auto; display: block; }
  .topnav-brand .dim {
    color: var(--text-faint);
    font-weight: 400;
    font-size: 13px;
  }
  .topnav-links { display: flex; gap: 4px; }
  .topnav-link {
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 13px;
    text-decoration: none;
    font-weight: 500;
  }
  .topnav-link:hover { background: var(--hover); color: var(--text); }
  .topnav-link.is-active {
    background: var(--brand-soft);
    color: var(--brand-text);
  }

  /* landing-page section cards */
  .section-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-top: 32px;
  }
  .section-card {
    display: flex;
    flex-direction: column;
    padding: 22px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--bg);
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
  }
  .section-card:hover {
    border-color: var(--brand-border);
    box-shadow: 0 4px 14px -6px rgba(0, 0, 0, 0.08);
  }
  .section-card .num {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--text-faint);
    margin-bottom: 6px;
  }
  .section-card h2 {
    font-family: "DM Sans", "Inter", sans-serif;
    font-size: 22px;
    line-height: 28px;
    font-weight: 600;
    letter-spacing: -0.01em;
    margin: 0 0 6px;
    color: var(--text);
  }
  .section-card p {
    margin: 0 0 14px;
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.5;
    flex: 1;
  }
  .section-card .arrow {
    color: var(--brand-text);
    font-weight: 500;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
  }
