*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--bg-page);
    color: var(--text-primary);
    font-family: var(--font-ui);
    font-size: var(--type-ui);
    line-height: var(--leading-ui);
    font-variant-numeric: tabular-nums;
}

h1,
h2,
h3,
h4,
p,
ul,
ol,
dl,
figure,
table {
    margin: 0;
}

h1 {
    font-size: var(--type-h1);
    line-height: var(--leading-h1);
    font-weight: 600;
}

h2 {
    font-size: var(--type-h2);
    line-height: var(--leading-h2);
    font-weight: 600;
}

h3 {
    font-size: var(--type-h3);
    line-height: var(--leading-h3);
    font-weight: 600;
}

a {
    color: var(--link);
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

a:visited {
    color: var(--link-visited);
}

a:hover {
    text-decoration-thickness: 2px;
}

:focus-visible {
    outline: var(--focus-ring-width) solid var(--focus-ring);
    outline-offset: var(--focus-ring-offset);
}

img,
svg {
    max-width: 100%;
    height: auto;
}

.prose {
    font-family: var(--font-prose);
    font-size: var(--type-body);
    line-height: var(--leading-body);
    max-width: var(--prose-measure);
}

.prose > * + * {
    margin-top: var(--space-4);
}

.muted {
    color: var(--text-muted);
}

.small {
    font-size: var(--type-small);
}

.micro {
    font-size: var(--type-micro);
    line-height: var(--leading-micro);
    font-weight: 500;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 100;
}

.skip-link:focus {
    left: var(--space-2);
    top: var(--space-2);
    padding: var(--space-2) var(--space-4);
    background: var(--bg-page);
    border: var(--border-strong-width) solid var(--border-strong);
    border-radius: var(--radius-input);
}

.site-header {
    display: flex;
    align-items: center;
    gap: var(--space-5);
    flex-wrap: wrap;
    padding: var(--space-3) var(--gutter);
    background: var(--bg-surface);
    border-bottom: var(--border-hairline-width) solid var(--border-hairline);
}

.site-title {
    font-size: var(--type-h3);
    font-weight: 600;
    text-decoration: none;
    color: var(--text-primary);
}

main {
    display: block;
    max-width: var(--content-max);
    margin: 0 auto;
    padding: var(--space-5) var(--gutter);
}

.site-footer {
    max-width: var(--content-max);
    margin: 0 auto;
    padding: var(--space-6) var(--gutter);
    color: var(--text-muted);
    font-size: var(--type-small);
    border-top: var(--border-hairline-width) solid var(--border-hairline);
}

.card {
    background: var(--bg-surface);
    border: var(--border-hairline-width) solid var(--border-hairline);
    border-radius: var(--radius-card);
    padding: var(--space-4);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--type-dense);
    line-height: var(--leading-dense);
}

.data-table th {
    text-align: left;
    font-weight: 600;
    background: var(--bg-surface);
    border-bottom: var(--border-strong-width) solid var(--border-strong);
}

.data-table th,
.data-table td {
    height: var(--row-height);
    padding: var(--space-1) var(--space-3);
    border-bottom: var(--border-hairline-width) solid var(--border-hairline);
    vertical-align: top;
}

@media (max-width: 47.9375rem) {
    .data-table th,
    .data-table td {
        height: 48px;
    }
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: 2px var(--space-2);
    font-size: var(--type-micro);
    font-weight: 500;
    border: var(--border-hairline-width) solid var(--border-strong);
    border-radius: var(--radius-input);
    background: var(--bg-surface);
    color: var(--text-primary);
}

.chip--warning {
    border-color: var(--warning);
    color: var(--warning);
}

.chip--success {
    border-color: var(--success);
    color: var(--success);
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    min-height: var(--touch-target);
    padding: var(--space-2) var(--space-4);
    font: inherit;
    font-weight: 500;
    cursor: pointer;
    border: var(--border-strong-width) solid var(--border-strong);
    border-radius: var(--radius-input);
    background: var(--bg-page);
    color: var(--text-primary);
    text-decoration: none;
}

.button--primary {
    background: var(--link);
    border-color: var(--link);
    color: var(--on-primary);
}

.button--danger {
    border-color: var(--danger);
    color: var(--danger);
}

input,
select,
textarea {
    font: inherit;
    min-height: var(--touch-target);
    padding: var(--space-2);
    color: var(--text-primary);
    background: var(--bg-page);
    border: var(--border-strong-width) solid var(--border-strong);
    border-radius: var(--radius-input);
}

textarea {
    min-height: calc(var(--touch-target) * 3);
}

label {
    display: inline-block;
    font-weight: 500;
    margin-bottom: var(--space-1);
}

.field + .field {
    margin-top: var(--space-4);
}

.error-summary {
    border: var(--border-strong-width) solid var(--danger);
    border-radius: var(--radius-card);
    padding: var(--space-4);
    color: var(--danger);
}

@media print {
    .site-header,
    .site-footer,
    .skip-link,
    .no-print {
        display: none;
    }

    body {
        background: #fff;
        color: #000;
    }

    main {
        padding: 0;
    }

    a {
        color: #000;
        text-decoration: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

.site-header__end {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-left: auto;
}

.site-header__account {
    font-weight: 500;
}

.site-nav__list,
.site-footer__list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-4);
    margin: 0;
    padding: 0;
    list-style: none;
}

.site-nav a {
    display: inline-block;
    padding: var(--space-2) 0;
    font-weight: 500;
    text-decoration: none;
}

.site-nav a:hover,
.site-nav a:focus-visible {
    text-decoration: underline;
    text-decoration-thickness: 2px;
}

.site-nav a[aria-current="page"] {
    color: var(--text-primary);
    border-bottom: var(--border-strong-width) solid var(--link);
}

.button--quiet {
    min-height: var(--touch-target);
    border-color: var(--border-strong);
    background: transparent;
    font-size: var(--type-small);
}

.button--quiet[aria-pressed="true"] {
    background: var(--bg-page);
    border-color: var(--link);
    color: var(--link);
}

.breadcrumb {
    max-width: var(--content-max);
    margin: 0 auto;
    padding: var(--space-3) var(--gutter) 0;
    font-size: var(--type-small);
}

.breadcrumb ol {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin: 0;
    padding: 0;
    list-style: none;
}

.breadcrumb li + li::before {
    content: "/";
    margin-right: var(--space-2);
    color: var(--text-muted);
}

.site-footer__list {
    margin-bottom: var(--space-4);
}

.pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-4);
    margin-top: var(--space-5);
    padding-top: var(--space-4);
    border-top: var(--border-hairline-width) solid var(--border-hairline);
    font-size: var(--type-small);
}

.pagination__count {
    color: var(--text-muted);
}

.pagination__list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-1);
    margin: 0;
    padding: 0;
    list-style: none;
}

.pagination__list a,
.pagination__list span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: var(--touch-target);
    min-height: var(--touch-target);
    padding: 0 var(--space-2);
    border-radius: var(--radius-input);
}

.pagination__list a {
    text-decoration: none;
    border: var(--border-hairline-width) solid var(--border-strong);
}

.pagination__list a:hover,
.pagination__list a:focus-visible {
    text-decoration: underline;
}

.pagination__list [aria-current="page"] {
    font-weight: 600;
    border: var(--border-strong-width) solid var(--link);
    color: var(--link);
}

.empty-state {
    padding: var(--space-6) var(--space-4);
    text-align: center;
    color: var(--text-muted);
    border: var(--border-hairline-width) dashed var(--border-strong);
    border-radius: var(--radius-card);
}
