:root {
    --site-header-height: 4.7rem;
    --site-max-width: 72rem;
    --page-wide-max-width: 86rem;
    --pico-background-color: #30354b;
    --pico-color: #edf2ff;
    --pico-muted-color: #bcc4df;
    --pico-muted-border-color: #555d79;
    --pico-card-background-color: #232839;
    --pico-card-sectioning-background-color: #2b3144;
    --pico-card-border-color: #646d8d;
    --pico-form-element-background-color: #232839;
    --pico-form-element-border-color: #697293;
    --pico-form-element-color: #edf2ff;
    --pico-form-element-placeholder-color: #97a2c3;
    --pico-primary: #74c887;
    --pico-primary-hover: #8ed79d;
    --pico-primary-focus: rgba(116, 200, 135, 0.28);
    --pico-primary-background: #5f9d6f;
    --pico-primary-hover-background: #6eac7d;
    --pico-primary-border: #5f9d6f;
    --pico-primary-hover-border: #6eac7d;
    --pico-primary-inverse: #142019;
    --surface-border: color-mix(in srgb, var(--pico-muted-border-color) 78%, var(--pico-card-border-color, var(--pico-muted-border-color)));
    --surface-bg: color-mix(in srgb, var(--pico-card-background-color) 92%, var(--pico-background-color));
    --surface-bg-strong: color-mix(in srgb, var(--pico-card-sectioning-background-color, var(--pico-card-background-color)) 82%, var(--pico-card-background-color));
    --surface-bg-soft: color-mix(in srgb, var(--pico-form-element-background-color) 84%, var(--pico-card-background-color));
    --surface-control-bg: var(--pico-card-background-color);
    --surface-header-bg: color-mix(in srgb, var(--pico-card-sectioning-background-color, var(--pico-card-background-color)) 60%, var(--pico-background-color));
    --surface-shadow: 0 1.1rem 2.6rem rgba(12, 15, 27, 0.22);
    --history-panel-bg: color-mix(in srgb, var(--surface-bg) 88%, transparent);
    --history-entry-bg: color-mix(in srgb, var(--surface-bg-soft) 36%, transparent);
    --history-divider: color-mix(in srgb, var(--pico-muted-border-color) 86%, var(--pico-card-border-color, var(--pico-muted-border-color)));
    --text-main: color-mix(in srgb, var(--pico-color) 92%, white 8%);
    --text-soft: color-mix(in srgb, var(--pico-muted-color) 84%, white 16%);
    --text-muted: color-mix(in srgb, var(--pico-muted-color) 74%, white 26%);
    --pico-font-size: 102%;
    --pico-line-height: 1.68;
    --pico-border-radius: 1.15rem;
    --pico-form-element-spacing-vertical: 0.7rem;
    --pico-form-element-spacing-horizontal: 0.9rem;
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
    margin: 0;
    background-color: var(--pico-background-color);
    color: var(--pico-color);
}

body {
    font-size: 1rem;
}

a {
    color: var(--pico-primary);
    text-underline-offset: 0.18em;
}

a:hover,
a:focus-visible {
    color: var(--pico-primary-hover);
}

p,
li,
dd,
input,
select,
textarea {
    font-size: 0.98rem;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    border-bottom: 1px solid var(--surface-border);
    background: var(--surface-header-bg);
    background-color: #25293a;
    backdrop-filter: blur(12px);
}

.site-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    width: min(100% - 2rem, var(--site-max-width));
    min-height: var(--site-header-height);
    margin: 0 auto;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.9rem;
    color: var(--text-main);
    text-decoration: none;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.brand:hover,
.brand:focus-visible {
    color: var(--text-main);
    text-decoration: none;
}

.brand-logo {
    width: 2.6rem;
    height: 2.6rem;
    padding: 0.32rem;
    border-radius: 1rem;
    object-fit: cover;
    background: color-mix(in srgb, var(--surface-bg-strong) 72%, black 28%);
    border: 1px solid var(--surface-border);
}

.nav-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 2.85rem;
    min-width: 2.85rem;
    height: 2.85rem;
    margin: 0;
    padding: 0;
    border: 1px solid var(--surface-border);
    border-radius: 0.95rem;
    background: color-mix(in srgb, var(--surface-bg) 92%, black 8%);
    color: var(--text-main);
    box-shadow: none;
}

.nav-toggle:hover,
.nav-toggle:focus-visible {
    color: var(--text-main);
    border-color: color-mix(in srgb, var(--surface-border) 68%, var(--pico-primary) 32%);
    background: color-mix(in srgb, var(--surface-bg-strong) 82%, var(--pico-primary) 18%);
}

.nav-toggle-box {
    display: grid;
    gap: 0.24rem;
}

.nav-toggle-box span {
    display: block;
    width: 1rem;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
    transition: transform 140ms ease, opacity 140ms ease;
}

.brand-title {
    display: flex;
    flex-direction: column;
    gap: 0.08rem;
    line-height: 1.2;
}

.brand-title strong {
    font-size: clamp(1.02rem, 2vw, 1.18rem);
}

.brand-title small {
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 500;
    letter-spacing: 0.01em;
}

.top-links {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: wrap;
}

.top-links a {
    color: var(--text-soft);
    text-decoration: none;
    padding: 0.48rem 0.8rem;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 0.94rem;
    transition: border-color 120ms ease, background-color 120ms ease, color 120ms ease;
}

.top-links a:hover,
.top-links a:focus-visible {
    color: var(--pico-primary);
    border-color: var(--surface-border);
    background: color-mix(in srgb, var(--surface-bg-strong) 84%, var(--pico-primary) 16%);
    text-decoration: none;
}

.nav-dropdown {
    position: relative;
}

.nav-dropdown summary {
    list-style: none;
    color: var(--text-soft);
    padding: 0.48rem 0.8rem;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 0.94rem;
    cursor: pointer;
    transition: border-color 120ms ease, background-color 120ms ease, color 120ms ease;
}

.nav-dropdown summary::-webkit-details-marker {
    display: none;
}

.nav-dropdown summary::marker {
    display: none;
    content: "";
}

.nav-dropdown summary:hover,
.nav-dropdown summary:focus-visible,
.nav-dropdown:hover summary {
    color: var(--pico-primary);
    border-color: var(--surface-border);
    background: color-mix(in srgb, var(--surface-bg-strong) 84%, var(--pico-primary) 16%);
}

.nav-dropdown-menu {
    position: absolute;
    top: calc(100% + 0.35rem);
    right: 0;
    z-index: 30;
    display: none;
    min-width: 10rem;
    padding: 0.35rem;
    border: 1px solid var(--surface-border);
    border-radius: 1rem;
    background: var(--surface-bg-strong);
    box-shadow: var(--surface-shadow);
}

.nav-dropdown[open] .nav-dropdown-menu,
.nav-dropdown:hover .nav-dropdown-menu {
    display: grid;
}

.nav-dropdown-menu a {
    display: block;
    width: 100%;
    padding: 0.55rem 0.7rem;
    border: 0;
    border-radius: 0.7rem;
}

.top-links .nav-dropdown {
    margin: 0;
}

.top-links .nav-dropdown > summary {
    display: inline-flex;
    align-items: center;
    color: var(--text-soft);
    font-family: inherit;
    font-size: 0.94rem;
    font-weight: inherit;
    line-height: inherit;
}

.top-links .nav-dropdown[open] > summary {
    margin-bottom: 0;
}

.top-links .nav-dropdown > summary::after {
    display: none;
    content: none;
}

.site-nav.is-menu-open .nav-toggle-box span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

.site-nav.is-menu-open .nav-toggle-box span:nth-child(2) {
    opacity: 0;
}

.site-nav.is-menu-open .nav-toggle-box span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

.page {
    width: min(100% - 2rem, var(--site-max-width));
    margin: 0 auto;
    padding: 2.1rem 0 3rem;
}

.site-footer {
    width: min(100% - 2rem, var(--site-max-width));
    margin: 0 auto;
    padding: 0 0 2rem;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.page-wide {
    width: min(100% - 2rem, var(--page-wide-max-width));
}

.stack {
    display: grid;
    gap: 1rem;
}

.page-header {
    display: grid;
    gap: 1rem;
    margin-bottom: 1.35rem;
}

.page-header-card,
.surface-panel,
.detail-card,
.empty-state {
    margin: 0;
    padding: 1.2rem 1.25rem;
    border: 1px solid var(--surface-border);
    border-radius: var(--pico-border-radius);
    background: var(--surface-bg);
    box-shadow: var(--surface-shadow);
}

.detail-card {
    background: var(--surface-bg-strong);
    gap: 0.85rem;
}

.eyebrow {
    display: inline-block;
    margin-bottom: 0.55rem;
    color: var(--text-soft);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.page-header h1,
.detail-card h1 {
    margin-bottom: 0.45rem;
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    line-height: 1.08;
    letter-spacing: -0.04em;
}

.detail-card h1 {
    margin: 0;
}

.page-header p,
.detail-note,
.record-subtle,
.empty-state p,
.field-note {
    margin: 0;
    color: var(--text-muted);
}

.page-header p,
.detail-note,
.field-note {
    font-size: 1rem;
}

.keyline {
    height: 1px;
    background: var(--pico-muted-border-color);
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    color: var(--text-soft);
    font-size: 0.95rem;
    text-decoration: none;
}

.back-link:hover,
.back-link:focus-visible {
    color: var(--pico-primary);
    text-decoration: none;
}

.detail-card {
    display: grid;
}

.detail-card > header {
    display: grid;
    gap: 0.14rem;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
}

.detail-meta {
    display: block;
    margin: 0;
    color: var(--text-soft);
    font-size: 0.84rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.badge-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.28rem 0.68rem;
    border-radius: 999px;
    background: var(--surface-bg-strong);
    border: 1px solid var(--surface-border);
    color: var(--text-main);
    font-size: 0.82rem;
    font-weight: 600;
    white-space: nowrap;
}

.motion-button,
.table-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    min-height: 2.3rem;
    margin: 0;
    padding: 0.48rem 0.86rem;
    border-radius: 999px;
    font-size: 0.9rem;
    line-height: 1.2;
}

:is(a[role="button"], button, input[type="submit"], input[type="button"], input[type="reset"]).primary,
.motion-button,
.table-button {
    color: white; /* var(--pico-primary-inverse); */
}

:is(a[role="button"], button, input[type="submit"], input[type="button"], input[type="reset"]).primary:hover,
:is(a[role="button"], button, input[type="submit"], input[type="button"], input[type="reset"]).primary:focus-visible,
.motion-button:hover,
.motion-button:focus-visible,
.table-button:hover,
.table-button:focus-visible {
    color: white; /* var(--pico-primary-inverse); */
    text-decoration: none;
}

.search-toolbar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.search-form {
    display: grid;
    gap: 0.68rem;
    flex: 1 1;
}

.search-form label,
.search-filter label,
.search-toggle legend {
    margin: 0;
    color: var(--text-soft);
    font-size: 0.86rem;
    font-weight: 600;
}

.search-form input[type="search"],
.search-filter select {
    margin: 0;
    background: var(--surface-control-bg);
    border-color: var(--pico-form-element-border-color);
}

.search-filter {
    display: grid;
    gap: 0.68rem;
    min-width: 14rem;
}

.search-controls {
    display: flex;
    align-items: flex-end;
    gap: 1rem;
    flex-wrap: wrap;
    flex: 1 1;
}

.search-toggle {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: wrap;
    margin: 0;
    padding: 0;
    border: 0;
}

.search-toggle label {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0;
    padding: 0.52rem 0.78rem;
    border: 1px solid var(--surface-border);
    border-radius: 999px;
    background: var(--surface-bg);
    color: var(--text-soft);
    font-size: 0.9rem;
    cursor: pointer;
}

.search-toggle input {
    margin: 0;
}

.search-count {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.9rem;
    white-space: nowrap;
}

.table-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.9rem;
    flex-wrap: wrap;
    margin-left: auto;
}

.table-panel {
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.table-scroll {
    overflow-x: auto;
    margin-top: 1.5rem;
    padding-bottom: 0.15rem;
}

.record-table {
    width: 100%;
    min-width: 40rem;
    border-collapse: collapse;
    border-spacing: 0;
    font-size: 0.96rem;
    background: transparent;
}

.record-table thead th {
    padding: 0 0 0.8rem;
    border-bottom: 1px solid var(--pico-muted-border-color);
    color: var(--text-soft);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    text-align: left;
}

.record-table tbody td {
    padding: 1rem 0;
    border-bottom: 1px solid var(--pico-muted-border-color);
    vertical-align: top;
    background: transparent;
}

.record-table tbody tr:last-child td {
    border-bottom: 0;
    padding-bottom: 0;
}

.record-main {
    min-width: 16rem;
}

.record-title {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0 0 0.4rem;
    color: var(--text-main);
    font-weight: 600;
    text-decoration: none;
}

.record-title:hover,
.record-title:focus-visible {
    color: var(--pico-primary);
    text-decoration: underline;
}

.record-subtle {
    font-size: 0.95rem;
    line-height: 1.55;
}

.record-meta {
    display: grid;
    gap: 0.32rem;
}

.record-meta strong {
    font-size: 0.98rem;
    font-weight: 600;
}

.mono {
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
}

.content-block {
    white-space: pre-wrap;
    line-height: 1.82;
    color: var(--text-main);
    font-size: 1rem;
    word-break: break-word;
}

.content-markdown {
    white-space: normal;
}

.content-markdown > :first-child {
    margin-top: 0;
}

.content-markdown > :last-child {
    margin-bottom: 0;
}

.content-markdown p,
.content-markdown ul,
.content-markdown ol,
.content-markdown blockquote,
.content-markdown pre,
.content-markdown table {
    margin: 0 0 1rem;
}

.content-markdown h1,
.content-markdown h2,
.content-markdown h3,
.content-markdown h4,
.content-markdown h5,
.content-markdown h6 {
    margin: 1.5rem 0 0.7rem;
    line-height: 1.24;
    letter-spacing: -0.03em;
    color: var(--text-main);
}

.content-markdown h1 {
    font-size: 1.85rem;
}

.content-markdown h2 {
    font-size: 1.55rem;
}

.content-markdown h3 {
    font-size: 1.28rem;
}

.content-markdown ul,
.content-markdown ol {
    padding-left: 1.35rem;
}

.content-markdown li + li {
    margin-top: 0.28rem;
}

.content-markdown blockquote {
    padding: 0.4rem 0 0.4rem 1rem;
    border-left: 3px solid color-mix(in srgb, var(--surface-border) 62%, var(--pico-primary) 38%);
    color: var(--text-soft);
}

.content-markdown code {
    padding: 0.1rem 0.32rem;
    border-radius: 0.45rem;
    background: color-mix(in srgb, var(--surface-bg-soft) 72%, transparent);
    font-size: 0.92em;
}

.content-markdown pre {
    overflow-x: auto;
    padding: 0.9rem 1rem;
    border: 1px solid var(--surface-border);
    border-radius: 0.95rem;
    background: color-mix(in srgb, var(--surface-bg-soft) 88%, black 12%);
}

.content-markdown pre code {
    padding: 0;
    border-radius: 0;
    background: transparent;
}

.content-markdown table {
    display: block;
    width: max-content;
    min-width: 100%;
    overflow-x: auto;
    border-collapse: collapse;
    border: 1px solid var(--surface-border);
    border-radius: 0.95rem;
}

.content-markdown th,
.content-markdown td {
    padding: 0.65rem 0.8rem;
    border-bottom: 1px solid var(--surface-border);
    text-align: left;
    vertical-align: top;
}

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

.content-markdown th {
    background: color-mix(in srgb, var(--surface-bg-soft) 72%, transparent);
    color: var(--text-main);
    font-size: 0.9rem;
}

.content-rendered {
    color: var(--text-main);
    line-height: 1.82;
    font-size: 1rem;
    word-break: break-word;
}

.content-gdoc-host {
    overflow-x: auto;
}

.content-gdoc-host .gdoc-rendered {
    --gdoc-neutral-text-color: var(--text-main);
    white-space: normal;
    overflow-wrap: anywhere;
    color: var(--text-main);
}

.content-gdoc-host .gdoc-rendered a {
    --gdoc-neutral-text-color: var(--pico-primary);
    color: var(--pico-primary);
}

.content-gdoc-host .gdoc-rendered a:hover,
.content-gdoc-host .gdoc-rendered a:focus-visible {
    --gdoc-neutral-text-color: var(--pico-primary-hover);
    color: var(--pico-primary-hover);
}

.content-gdoc-host .gdoc-rendered > :first-child {
    margin-top: 0 !important;
}

.content-gdoc-host .gdoc-rendered > :last-child {
    margin-bottom: 0 !important;
}

.content-gdoc-host .gdoc-rendered img {
    max-width: 100%;
    height: auto;
}

.content-gdoc-host .gdoc-rendered table {
    max-width: 100%;
}

.gdoc-font-toggle-row {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.65rem;
    flex-wrap: wrap;
    margin-top: 1.2rem;
}

.gdoc-font-toggle {
    margin: 0;
    min-height: 2.1rem;
    padding: 0.4rem 0.8rem;
    font-size: 0.88rem;
    touch-action: manipulation;
}

/*
.content-gdoc-host .gdoc-rendered[data-gdoc-font-mode="default"] {
    --gdoc-font-family-override: var(--pico-font-family);
}
*/
/*
.content-gdoc-host .gdoc-rendered[data-gdoc-font-mode="default"],
.content-gdoc-host .gdoc-rendered[data-gdoc-font-mode="default"] * {
  --gdoc-font-family-override: var(--pico-font-family);
  font-family: var(--pico-font-family) !important;
}*/

.content-gdoc-host .gdoc-rendered[data-gdoc-font-mode="default"] {
  --gdoc-font-family-override: var(--pico-font-family);
}

.content-gdoc-host .gdoc-rendered[data-gdoc-font-mode="default"],
.content-gdoc-host .gdoc-rendered[data-gdoc-font-mode="default"] * {
  font-family: var(--gdoc-font-family-override) !important;
}

.detail-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.95rem 1.1rem;
}

.field {
    display: grid;
    gap: 0.24rem;
}

.field dt {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.field dd {
    margin: 0;
    color: var(--text-main);
    word-break: break-word;
    font-size: 0.99rem;
}

.history-details {
    border: 1px solid var(--surface-border);
    border-radius: 1rem;
    background: transparent;
    overflow: hidden;
}

.history-details summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.95rem 1rem;
    cursor: pointer;
    list-style: none;
    color: var(--text-main);
    font-weight: 600;
}

/*
.history-details summary::marker {
    content: "";
}

.history-details summary::-webkit-details-marker {
    display: none;
}

.history-details summary::after {
    content: "+";
    color: var(--text-soft);
    font-size: 1.1rem;
    line-height: 1;
}

.history-details[open] summary::after {
    content: "−";
} */

.history-scroller {
    margin: 0;
    padding: 0.15rem 1rem 1rem;
    max-height: 16rem;
    overflow: auto;
    border: 0;
    border-top: 1px solid var(--history-divider);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.history-list {
    display: grid;
    gap: 0;
    margin: 0;
    padding: 0.4rem 0 0;
    list-style: none;
}

.history-entry {
    padding: 0.95rem 0 0.95rem 1rem;
    border: 0;
    border-left: 2px solid color-mix(in srgb, var(--surface-border) 72%, var(--pico-primary) 28%);
    background: transparent;
}

.history-entry + .history-entry {
    border-top: 1px solid var(--history-divider);
}

.history-entry time {
    display: block;
    margin-bottom: 0.28rem;
    color: var(--text-soft);
    font-size: 0.84rem;
    font-weight: 600;
}

.history-entry p {
    margin: 0;
    color: var(--text-main);
}

.code-list {
    display: grid;
    gap: 1rem;
}

.code-entry {
    display: grid;
    gap: 0.85rem;
    padding: 1.15rem 1.2rem;
    border: 1px solid var(--surface-border);
    border-radius: 1.1rem;
    background: var(--surface-bg-strong);
    box-shadow: var(--surface-shadow);
    content-visibility: auto;
    contain-intrinsic-size: 28rem;
}

.code-entry header {
    display: grid;
    gap: 0.25rem;
}

.code-entry h2 {
    margin: 0;
    font-size: 1.12rem;
    line-height: 1.28;
}

.toc-list {
    display: grid;
    gap: 0.45rem;
    margin: 0;
    padding-left: 1.15rem;
}

.toc-list a {
    color: var(--pico-primary);
    text-decoration-color: color-mix(in srgb, var(--pico-primary) 70%, transparent);
}

.toc-list a:hover,
.toc-list a:focus-visible {
    color: var(--pico-primary-hover);
    text-decoration-color: var(--pico-primary-hover);
}

.feature-grid {
    display: grid;
    gap: 1rem;
    margin-top: 1.5rem;
}

.feature-card {
    margin: 0;
    background: var(--surface-bg-strong);
    transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
    text-decoration: none;
    color: inherit;
}

.feature-card:hover,
.feature-card:focus-within {
    transform: translateY(-1px);
    border-color: color-mix(in srgb, var(--surface-border) 62%, var(--pico-primary) 38%);
    box-shadow: 0 1.35rem 2.8rem rgba(12, 15, 27, 0.28);
}

.feature-card h2 {
    margin-bottom: 0.35rem;
}

.feature-card h2 a {
    color: var(--text-main);
    text-decoration: none;
}

.feature-card h2 a:hover,
.feature-card h2 a:focus-visible {
    color: var(--pico-primary);
}

.dashboard-page {
    gap: 1rem;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    align-items: start;
}

.dashboard-card,
.dashboard-recent-laws {
    display: grid;
    gap: 1rem;
    min-width: 0;
}

.dashboard-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    min-width: 0;
}

.dashboard-card-header h1,
.dashboard-card-header h2 {
    margin: 0;
    color: var(--text-main);
    line-height: 1.16;
    letter-spacing: -0.03em;
    overflow-wrap: anywhere;
}

.dashboard-card-header h1 {
    font-size: clamp(1.45rem, 3vw, 2rem);
}

.dashboard-card-header h2 {
    font-size: 1.32rem;
}

.dashboard-card-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.25rem;
    padding: 0.45rem 0.75rem;
    border: 1px solid var(--surface-border);
    border-radius: 999px;
    background: color-mix(in srgb, var(--surface-bg-strong) 88%, var(--pico-primary) 12%);
    color: var(--text-main);
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    white-space: nowrap;
}

.dashboard-card-action:hover,
.dashboard-card-action:focus-visible {
    border-color: color-mix(in srgb, var(--surface-border) 62%, var(--pico-primary) 38%);
    color: var(--pico-primary);
    text-decoration: none;
}

.dashboard-tabs {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    width: fit-content;
    max-width: 100%;
    padding: 0.25rem;
    border: 1px solid var(--surface-border);
    border-radius: 999px;
    background: color-mix(in srgb, var(--surface-bg-soft) 80%, transparent);
    overflow-x: auto;
}

button.dashboard-tab {
    width: auto;
    min-width: 0;
    min-height: 2.05rem;
    margin: 0;
    padding: 0.38rem 0.78rem;
    border: 1px solid transparent;
    border-radius: 999px;
    background: transparent;
    color: var(--text-soft);
    box-shadow: none;
    font-size: 0.9rem;
    line-height: 1.2;
    white-space: nowrap;
}

button.dashboard-tab:hover,
button.dashboard-tab:focus-visible {
    border-color: color-mix(in srgb, var(--surface-border) 72%, var(--pico-primary) 28%);
    background: color-mix(in srgb, var(--surface-bg-strong) 84%, var(--pico-primary) 16%);
    color: var(--text-main);
}

button.dashboard-tab.is-active {
    border-color: color-mix(in srgb, var(--surface-border) 54%, var(--pico-primary) 46%);
    background: var(--pico-primary-background);
    color: white;
}

.dashboard-session-panels,
.dashboard-session-panel {
    display: grid;
    gap: 1rem;
    min-width: 0;
}

.dashboard-session-panel[hidden] {
    display: none;
}

.dashboard-session-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.8rem;
    min-width: 0;
}

.dashboard-session-header h3 {
    margin: 0;
    color: var(--text-main);
    font-size: 1.08rem;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.dashboard-field-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.8rem 1rem;
    margin: 0;
}

.dashboard-field-list .field dd {
    display: grid;
    gap: 0.08rem;
    min-width: 0;
}

.dashboard-subsection {
    display: grid;
    gap: 0.55rem;
    min-width: 0;
}

.dashboard-subsection h4 {
    margin: 0;
    color: var(--text-soft);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.dashboard-record-list {
    display: grid;
    gap: 0;
    margin: 0;
    padding: 0;
    list-style: none;
}

.dashboard-record-list li {
    display: grid;
    gap: 0.16rem;
    min-width: 0;
    padding: 0.72rem 0 0;
    border-top: 1px solid color-mix(in srgb, var(--history-divider) 78%, transparent);
}

.dashboard-record-list li:first-child {
    padding-top: 0;
    border-top: 0;
}

.dashboard-record-title {
    color: var(--text-main);
    font-weight: 600;
    line-height: 1.35;
    text-decoration: none;
    overflow-wrap: anywhere;
}

.dashboard-record-title:hover,
.dashboard-record-title:focus-visible {
    color: var(--pico-primary);
    text-decoration: underline;
}

.dashboard-author-line {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 0.45rem;
    min-width: 0;
}

.dashboard-empty-copy {
    margin: 0;
    color: var(--text-muted);
}

.dashboard-link-list {
    display: grid;
    gap: 0;
}

.dashboard-link-row {
    display: grid;
    gap: 0.16rem;
    min-width: 0;
    padding: 0.72rem 0;
    border-top: 1px solid color-mix(in srgb, var(--history-divider) 78%, transparent);
    color: inherit;
    text-decoration: none;
}

.dashboard-link-row:first-child {
    padding-top: 0;
    border-top: 0;
}

.dashboard-link-row:last-child {
    padding-bottom: 0;
}

.dashboard-link-row strong {
    color: var(--text-main);
    font-size: 0.98rem;
    line-height: 1.28;
    overflow-wrap: anywhere;
}

.dashboard-link-row span {
    color: var(--text-muted);
    font-size: 0.94rem;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.dashboard-link-row:hover,
.dashboard-link-row:focus-visible {
    text-decoration: none;
}

.dashboard-link-row:hover strong,
.dashboard-link-row:focus-visible strong {
    color: var(--pico-primary);
}

.empty-state {
    display: grid;
    gap: 0.65rem;
}

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

.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: 900px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .detail-fields {
        grid-template-columns: 1fr;
    }

    .search-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .search-form,
    .search-filter {
        min-width: 0;
        width: 100%;
    }
}

@media (max-width: 640px) {
    .mobile-hide {
        display: none;
    }

    .site-header {
        backdrop-filter: blur(8px);
    }

    .site-nav {
        align-items: center;
        min-height: 3.7rem;
        padding-top: 0.65rem;
        padding-bottom: 0.65rem;
    }

    .brand {
        gap: 0.72rem;
    }

    .brand-logo {
        width: 2.25rem;
        height: 2.25rem;
    }

    .brand-title strong {
        font-size: 1rem;
    }

    .nav-toggle {
        display: inline-flex;
        margin-left: auto;
    }

    .top-links {
        width: 100%;
        display: none;
        grid-template-columns: 1fr;
        gap: 0.35rem;
        padding-top: 0.8rem;
    }

    .site-nav.is-menu-open .top-links {
        display: grid;
    }

    .top-links a {
        width: 100%;
        padding: 0.72rem 0.85rem;
        border: 1px solid var(--surface-border);
        background: color-mix(in srgb, var(--surface-bg) 92%, black 8%);
    }

    .nav-dropdown {
        width: 100%;
    }

    .nav-dropdown summary {
        width: 100%;
        padding: 0.72rem 0.85rem;
        border-color: var(--surface-border);
        background: color-mix(in srgb, var(--surface-bg) 92%, black 8%);
    }

    .nav-dropdown-menu {
        position: static;
        min-width: 0;
        margin-top: 0.35rem;
        box-shadow: none;
    }

    .page,
    .page-wide {
        width: min(100% - 1rem, var(--page-wide-max-width));
        padding-top: 1rem;
        padding-bottom: 2rem;
    }

    .page-header {
        margin-bottom: 0.75rem;
    }

    .page-header-card,
    .surface-panel,
    .detail-card,
    .empty-state,
    .code-entry {
        padding: 1rem;
    }

    .dashboard-card,
    .dashboard-recent-laws {
        gap: 0.85rem;
    }

    .dashboard-card-header {
        gap: 0.75rem;
    }

    .dashboard-card-header h1 {
        font-size: 1.45rem;
    }

    .dashboard-card-header h2 {
        font-size: 1.2rem;
    }

    .dashboard-card-action {
        min-height: 2.1rem;
        padding: 0.4rem 0.7rem;
        font-size: 0.86rem;
    }

    .dashboard-field-list {
        grid-template-columns: 1fr;
        gap: 0.7rem;
    }

    .dashboard-session-header {
        display: grid;
        gap: 0.45rem;
    }

    .dashboard-tabs {
        width: 100%;
    }

    button.dashboard-tab {
        flex: 1 0 auto;
    }

    .detail-card {
        gap: 0.75rem;
    }

    .search-toolbar {
        display: grid;
        gap: 0.7rem;
        margin-bottom: 0.75rem;
    }

    .search-controls {
        gap: 0.7rem;
    }

    .search-form,
    .search-filter {
        gap: 0.45rem;
    }

    .search-toggle {
        gap: 0.4rem;
    }

    .search-toggle label {
        width: 100%;
        justify-content: flex-start;
    }

    .table-meta {
        align-items: stretch;
        gap: 0.65rem;
    }

    .table-scroll {
        margin-top: 0.95rem;
        overflow: visible;
    }

    .record-table {
        min-width: 0;
    }

    .record-table thead {
        display: none;
    }

    .record-table,
    .record-table tbody,
    .record-table tr,
    .record-table td {
        display: block;
    }

    .record-table tbody {
        display: grid;
        gap: 0.9rem;
    }

    .record-table tbody tr {
        padding: 0.95rem 1rem;
        border: 1px solid var(--surface-border);
        border-radius: 1rem;
        background: var(--surface-bg);
        box-shadow: var(--surface-shadow);
    }

    .record-table tbody td {
        display: grid;
        grid-template-columns: minmax(0, 6.4rem) minmax(0, 1fr);
        gap: 0.35rem 0.85rem;
        padding: 0.45rem 0;
        border-bottom: 1px solid color-mix(in srgb, var(--history-divider) 78%, transparent);
        align-items: start;
    }

    .record-table tbody td:last-child {
        border-bottom: 0;
        padding-bottom: 0;
    }

    .record-table tbody td::before {
        content: attr(data-label);
        color: var(--text-muted);
        font-size: 0.74rem;
        font-weight: 700;
        letter-spacing: 0.05em;
        text-transform: uppercase;
    }

    .record-main {
        min-width: 0;
    }

    .record-main .record-subtle {
        margin-top: 0.15rem;
    }

    .record-table td.action-cell {
        grid-template-columns: 1fr;
        padding-top: 0.75rem;
    }

    .record-table td.action-cell::before {
        display: none;
    }

    .record-table td.action-cell .table-button {
        width: 100%;
        justify-content: center;
    }

    .history-details summary {
        padding: 0.9rem 1rem;
    }

    .history-scroller {
        padding: 0.1rem 0.9rem 0.9rem;
    }

    .brand-title small {
        display: none;
    }
}
