:root {
  --color-brand-primary-strong: #005456;
  --color-danger: #b42318;
  --color-warning: #b54708;
  --button-primary-action-background: #007477;
  --button-primary-action-background-hover: #005456;
  --button-primary-action-color: #f6f7f8;
  --button-secondary-background: #dcefe7;
  --button-secondary-color: #005456;
  --button-quiet-background: #ffffff;
  --button-quiet-color: #102626;
  --radius-control: 10px;
  --radius-card: 14px;
  --radius-surface: 18px;
  --radius-pill: 999px;
  --duration-fast: 160ms;
  --ease-standard: ease;
}

.reference-main { grid-area: content; min-width: 0; width: min(100%, var(--reading-width)); }
.reference-intro { max-width: 46rem; }
.reference-intro h1 { margin: 0 0 12px; font-size: clamp(2rem, 5vw, 2.75rem); line-height: 1.2; letter-spacing: -.02em; }
.reference-intro p { margin: 0 0 24px; color: var(--color-ink-muted); }
.profile-switch { display: inline-flex; gap: 4px; padding: 4px; border: 1px solid var(--color-divider); border-radius: var(--radius-control); background: var(--color-surface); }
.profile-switch button { min-height: 36px; padding: 6px 12px; border: 0; border-radius: 7px; background: transparent; color: var(--color-ink-muted); font: inherit; font-weight: 600; cursor: pointer; }
.profile-switch button[aria-pressed="true"] { background: var(--color-brand-soft); color: var(--color-brand-primary-strong); }
.reference-index { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 36px 0 72px; padding: 18px 0; border-block: 1px solid var(--color-divider); }
.reference-section { margin-top: 72px; scroll-margin-top: 24px; }
.reference-section > h2 { margin: 0 0 12px; color: var(--color-ink); font-size: 1.6rem; line-height: 1.3; }
.reference-section > p { max-width: 46rem; margin: 0 0 24px; color: var(--color-ink-muted); }
.spec-link { font-size: .875rem; }
.example-stage { min-width: 0; padding: 24px; border: 1px solid var(--color-divider); border-radius: var(--radius-surface); background: var(--color-surface); }
.example-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.example-stack { display: grid; gap: 24px; }
.ref-button { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; padding: 8px 18px; border: 1px solid transparent; border-radius: var(--radius-control); font: inherit; font-weight: 650; cursor: pointer; }
.ref-button--pill { border-radius: var(--radius-pill); }
.ref-button--primary { background: var(--button-primary-action-background); color: var(--button-primary-action-color); }
.ref-button--primary:hover { background: var(--button-primary-action-background-hover); }
.ref-button--secondary { background: var(--button-secondary-background); color: var(--button-secondary-color); }
.ref-button--quiet { border-color: var(--color-border); background: var(--button-quiet-background); color: var(--button-quiet-color); }
.ref-button--danger { background: var(--color-danger); color: #fff; }
.ref-button--warning { border-color: var(--color-warning); background: #fff; color: var(--color-warning); }
.ref-button:disabled { cursor: not-allowed; opacity: .55; }
.ref-button:focus-visible, .ref-tab:focus-visible, .ref-accordion__trigger:focus-visible { outline: 3px solid var(--color-focus); outline-offset: 3px; }
.ref-card { max-width: 22rem; padding: 24px; border: 1px solid var(--color-border); border-radius: var(--radius-card); background: var(--color-surface); }
.ref-card h3 { margin: 0 0 12px; font-size: 1.125rem; }
.ref-card p { margin: 0; color: var(--color-ink-muted); }
.ref-label { display: inline-flex; padding: 3px 10px; border-radius: var(--radius-pill); background: var(--color-brand-soft); color: var(--color-brand-primary-strong); font-size: .8125rem; font-weight: 650; }
.ref-label--warning { background: #fff3e8; color: var(--color-warning); }
.ref-label--danger { background: #fbe9e7; color: var(--color-danger); }
.ref-field { display: grid; gap: 6px; max-width: 28rem; }
.ref-field label { font-weight: 650; }
.ref-field input, .ref-field textarea { width: 100%; padding: 8px 12px; border: 1px solid var(--color-border); border-radius: var(--radius-control); background: transparent; color: var(--color-ink); font: inherit; box-sizing: border-box; }
.ref-field textarea { min-height: 7rem; resize: vertical; }
.ref-field input:focus-visible, .ref-field textarea:focus-visible { outline: 3px solid var(--color-focus); outline-offset: 2px; }
.ref-search { position: relative; width: min(100%, 20rem); }
.ref-search svg { position: absolute; top: 50%; left: 12px; width: 16px; height: 16px; transform: translateY(-50%); fill: none; stroke: var(--color-brand-primary-hover); stroke-width: 1.75; pointer-events: none; }
.ref-search input { width: 100%; height: 36px; padding: 6px 12px 6px 36px; border: 1px solid var(--color-brand-primary-hover); border-radius: var(--radius-pill); background: transparent; color: var(--color-ink); font: inherit; box-sizing: border-box; }
.ref-search input:focus-visible { outline: none; border: 2px solid var(--color-brand-primary-strong); padding: 5px 11px 5px 35px; }
.ref-tabs { display: flex; gap: 24px; border-bottom: 1px solid var(--color-divider); }
.ref-tab { margin-bottom: -1px; padding: 8px 0; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--color-ink-muted); font: inherit; cursor: pointer; }
.ref-tab[aria-selected="true"] { border-color: var(--color-brand-primary-hover); color: var(--color-ink); font-weight: 650; }
.ref-tabpanel { padding-top: 24px; }
.ref-accordion { border-block: 1px solid var(--color-divider); }
.ref-accordion__trigger { display: flex; width: 100%; align-items: center; justify-content: space-between; padding: 12px 0; border: 0; background: transparent; color: var(--color-ink); font: inherit; font-weight: 650; text-align: left; cursor: pointer; }
.ref-accordion__trigger span { transition: transform var(--duration-fast) var(--ease-standard); }
.ref-accordion__trigger[aria-expanded="true"] span { transform: rotate(180deg); }
.ref-accordion__panel { padding: 0 0 24px; }
.ref-progress { width: min(100%, 24rem); height: 8px; overflow: hidden; border-radius: var(--radius-pill); background: var(--color-brand-soft); }
.ref-progress span { display: block; width: 62%; height: 100%; background: var(--color-brand-primary-hover); }
.ref-progress--half span { width: 50%; }
.example-stage table { width: 100%; min-width: 28rem; border-collapse: collapse; }
.example-stage th, .example-stage td { padding: 12px; border-bottom: 1px solid var(--color-divider); text-align: left; }
.example-stage th { background: var(--color-brand-soft); }
.ref-chat { display: grid; gap: 12px; max-width: 36rem; }
.ref-bubble { max-width: 82%; padding: 12px 16px; border: 1px solid var(--color-border); border-radius: var(--radius-card); background: var(--color-surface); }
.ref-bubble--user { justify-self: end; background: var(--color-brand-soft); border-end-end-radius: 4px; }
.ref-bubble--assistant { border-end-start-radius: 4px; }
.ref-bubble small { display: block; margin-bottom: 4px; color: var(--color-ink-muted); font: 600 .75rem var(--font-interface); }
.ref-composer { display: flex; align-items: end; gap: 6px; padding: 6px; border: 1px solid var(--color-brand-primary-hover); border-radius: var(--radius-pill); background: var(--color-surface); }
.ref-composer textarea { min-height: 30px; max-height: 8rem; flex: 1; padding: 4px 8px; border: 0; resize: none; color: var(--color-ink); font: inherit; }
.ref-composer textarea:focus-visible { outline: none; }
.ref-composer:focus-within { box-shadow: inset 0 0 0 1px var(--color-brand-primary-strong); }
.ref-composer .ref-button { width: 44px; min-width: 44px; padding: 0; border-radius: 50%; }
.ref-dialog { width: min(calc(100% - 24px), 30rem); padding: 24px; border: 1px solid var(--color-border); border-radius: var(--radius-surface); color: var(--color-ink); }
.ref-dialog::backdrop { background: rgb(16 38 38 / .36); }
.ref-dialog h3 { margin: 0 0 12px; }
.ref-dialog p { margin: 0 0 24px; }
.ref-dialog__actions { display: flex; justify-content: flex-end; gap: 12px; }
.pattern-shell { display: grid; grid-template-columns: 11rem 1fr; min-height: 18rem; overflow: hidden; border: 1px solid var(--color-border); border-radius: var(--radius-surface); background: var(--color-surface); }
.pattern-sidebar { padding: 24px; border-right: 1px solid var(--color-divider); background: var(--color-brand-soft); }
.pattern-sidebar strong { display: block; margin-bottom: 24px; }
.pattern-sidebar a { display: block; padding: 6px 0; }
.pattern-content { padding: 36px; }
.pattern-content h3 { margin-top: 0; }
.status-example { display: grid; place-items: center; min-height: 12rem; text-align: center; }
.status-example p { margin: 12px 0; }
.guideline-reference-gallery { margin: 48px 0 72px; padding: 24px 0; border-block: 1px solid var(--color-divider); font-family: var(--font-interface); }
.guideline-reference-gallery__header { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.guideline-reference-gallery__header h4 { margin: 0 0 6px; color: var(--color-ink); font-size: 1.25rem; }
.guideline-reference-gallery__header p { max-width: 38rem; margin: 0; color: var(--color-ink-muted); font-family: var(--font-interface); }
.guideline-reference-gallery__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.guideline-reference-example { min-width: 0; }
.guideline-reference-example h5 { margin: 0 0 12px; color: var(--color-heading-detail); font-size: 1rem; }
.guideline-reference-example .example-stage { height: calc(100% - 36px); box-sizing: border-box; }
.guideline-reference-gallery__links { display: flex; flex-wrap: wrap; gap: 12px 24px; margin: 24px 0 0; font-family: var(--font-interface); }
.profile-boundary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin-top: 36px; padding-block: 24px; border-block: 1px solid var(--color-divider); }
.profile-boundary p { margin: 0; color: var(--color-ink); }
.profile-page-document { max-width: var(--reading-width); }
.profile-source-link { margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--color-divider); }
.auth-example h3, .dashboard-example h3, .list-detail-example h3 { margin-top: 0; }
.dashboard-example { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.dashboard-example section + section { padding-left: 24px; border-left: 1px solid var(--color-divider); }
.list-detail-example { display: grid; grid-template-columns: 12rem minmax(0, 1fr); min-height: 14rem; }
.list-detail-example nav { padding-right: 24px; border-right: 1px solid var(--color-divider); }
.list-detail-example nav a { display: block; padding: 6px 0; }
.list-detail-example nav a[aria-current="page"] { color: var(--color-ink); font-weight: 700; }
.list-detail-example section { padding-left: 24px; }
.danger-section { padding-top: 24px; border-top: 1px solid var(--color-danger); }
@media (max-width: 48rem) {
  .example-stage { padding: 18px; }
  .pattern-shell { grid-template-columns: 1fr; }
  .pattern-sidebar { border-right: 0; border-bottom: 1px solid var(--color-divider); }
  .ref-dialog__actions { align-items: stretch; flex-direction: column-reverse; }
  .guideline-reference-gallery__header { align-items: flex-start; flex-direction: column; }
  .guideline-reference-gallery__grid, .profile-boundary { grid-template-columns: 1fr; }
  .dashboard-example, .list-detail-example { grid-template-columns: 1fr; }
  .dashboard-example section + section { padding: 24px 0 0; border-top: 1px solid var(--color-divider); border-left: 0; }
  .list-detail-example nav { padding: 0 0 24px; border-right: 0; border-bottom: 1px solid var(--color-divider); }
  .list-detail-example section { padding: 24px 0 0; }
}
@media (prefers-reduced-motion: reduce) { .ref-accordion__trigger span { transition: none; } }
@media (forced-colors: active) { .profile-switch button[aria-pressed="true"], .ref-label, .ref-bubble--user { border: 1px solid ButtonBorder; } }
@media print { .profile-switch, .ref-dialog { display: none; } .example-stage { break-inside: avoid; } }
