/* ═══════════════════════════════════════════════════════════
     DESIGN TOKENS. See usage style guide in STYLE.HTML
   ═══════════════════════════════════════════════════════════ */

:root {
    /* Colors - Warm Tropical Ocean Theme */
    --canvas: #f8faf9;
    --surface: #ffffff;
    --surface-subtle: #f2f5f4;
    --surface-hover: #e8edeb;
    --surface-dark: #1f2826;
    --surface-dark-subtle: #2a3330;

    --text-primary: #1f2826;
    --text-secondary: #4a5854;
    --text-muted: #7a8680;
    --text-inverse: #f8faf9;
    --text-on-dark: #f2f5f4;

    --border: #d4ddd9;
    --border-strong: #b8c5bf;
    --border-subtle: #e3e9e6;
    --border-on-dark: #3d4a45;

    --primary: #3d9b8f;
    --primary-hover: #2f8478;
    --primary-active: #246b61;

    --link: #3d9b8f;
    --link-hover: #2f8478;
    --link-visited: #5a8a7f;
    --link-on-dark: #6ec4b6;
    --link-on-dark-hover: #8dd4c9;

    --success: #5a9f70;
    --success-bg: rgba(90, 159, 112, 0.12);
    --success-border: rgba(90, 159, 112, 0.3);

    --warning: #c9a658;
    --warning-bg: rgba(201, 166, 88, 0.12);
    --warning-border: rgba(201, 166, 88, 0.3);

    --danger: #c76b5f;
    --danger-hover: #b55f54;
    --danger-bg: rgba(199, 107, 95, 0.12);
    --danger-border: rgba(199, 107, 95, 0.3);

    --info: #5b8ca8;
    --info-bg: rgba(91, 140, 168, 0.12);
    --info-border: rgba(91, 140, 168, 0.3);

    --neutral: #7a8680;
    --neutral-bg: rgba(122, 134, 128, 0.12);
    --neutral-border: rgba(122, 134, 128, 0.25);

    /* Typography */
    --font-base: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    --font-mono: Menlo, Consolas, Monaco, monospace;

    --text-xs: 0.6875rem;
    --text-sm: 0.8125rem;
    --text-md: 0.9375rem;
    --text-lg: 1.0625rem;
    --text-xl: 1.375rem;
    --text-2xl: 1.75rem;

    --weight-normal: 400;
    --weight-medium: 500;
    --weight-semibold: 600;

    --leading-tight: 1.25;
    --leading-normal: 1.5;
    --leading-relaxed: 1.65;

    /* Spacing */
    --space-2xs: 0.25rem;
    --space-xs: 0.5rem;
    --space-sm: 0.75rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;

    /* Layout */
    --container-max: 900px;

    /* Borders */
    --radius-sm: 3px;
    --radius-md: 4px;
    --radius-lg: 6px;
    --radius-pill: 999px;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(31, 40, 38, 0.04), 0 1px 3px rgba(31, 40, 38, 0.02);
    --shadow-md: 0 2px 4px rgba(31, 40, 38, 0.06), 0 2px 6px rgba(31, 40, 38, 0.03);
    --shadow-lg: 0 4px 8px rgba(31, 40, 38, 0.08), 0 4px 12px rgba(31, 40, 38, 0.04);

    /* Motion */
    --duration-fast: 150ms;
    --duration-normal: 250ms;
    --easing: cubic-bezier(0.4, 0.0, 0.2, 1);

    /* Z-index */
    --z-header: 300;
    --z-modal-backdrop: 400;
    --z-modal: 500;
}

/* ═══════════════════════════════════════════════════════════
   BASE & RESET
   ═══════════════════════════════════════════════════════════ */

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-base);
    font-size: var(--text-md);
    line-height: var(--leading-normal);
    color: var(--text-primary);
    background: var(--canvas);
}

a {
    color: var(--link);
    text-decoration: none;
    transition: color var(--duration-fast) var(--easing);
}

a:hover {
    color: var(--link-hover);
    text-decoration: underline;
}

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

/* ═══════════════════════════════════════════════════════════
   LAYOUT
   ═══════════════════════════════════════════════════════════ */

.header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: var(--z-header);
}

.header__container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: var(--space-sm) var(--space-lg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-lg);
}

.header__brand {
    font-size: var(--text-lg);
    font-weight: var(--weight-semibold);
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.header__brand:hover {
    text-decoration: none;
}

.header__nav {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.section {
    padding: var(--space-xl) var(--space-lg);
}

.section--subtle {
    background: var(--surface-subtle);
}

.section--dark {
    background: var(--surface-dark);
    color: var(--text-on-dark);
}

.section--dark a {
    color: var(--link-on-dark);
}

.section--dark a:hover {
    color: var(--link-on-dark-hover);
}

.section__container {
    max-width: var(--container-max);
    margin: 0 auto;
}

.section__header {
    margin-bottom: var(--space-lg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
}

.section__title {
    font-size: var(--text-xl);
    font-weight: var(--weight-semibold);
    letter-spacing: -0.02em;
}

.section__description {
    color: var(--text-secondary);
    margin-top: var(--space-xs);
    max-width: 60ch;
}

.section--dark .section__description {
    color: var(--text-on-dark);
    opacity: 0.8;
}

.grid {
    display: grid;
    gap: var(--space-md);
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

/* ═══════════════════════════════════════════════════════════
   COMPONENTS
   ═══════════════════════════════════════════════════════════ */

/* Hero */
.hero {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.hero--dark {
    background: var(--surface-dark);
    border-bottom-color: var(--border-on-dark);
    color: var(--text-on-dark);
}

.hero__container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: var(--space-2xl) var(--space-lg);
    display: flex;
    align-items: center;
    gap: var(--space-xl);
}

.hero__content {
    flex: 1;
    text-align: left;
}

.hero__logo {
    width: 120px;
    height: 120px;
    flex-shrink: 0;
}

.hero__title {
    font-size: var(--text-2xl);
    font-weight: var(--weight-semibold);
    margin-bottom: var(--space-sm);
    letter-spacing: -0.02em;
}

.hero__subtitle {
    font-size: var(--text-lg);
    color: var(--text-secondary);
    margin-bottom: var(--space-md);
}

.hero--dark .hero__subtitle {
    color: var(--text-on-dark);
    opacity: 0.85;
}

.hero__description {
    font-size: var(--text-md);
    color: var(--text-secondary);
    max-width: 60ch;
    margin-bottom: var(--space-lg);
    line-height: var(--leading-relaxed);
}

.hero--dark .hero__description {
    color: var(--text-on-dark);
    opacity: 0.75;
}

/* Card */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    transition: border-color var(--duration-fast) var(--easing);
}

.card:hover {
    border-color: var(--border-strong);
}

.card--dark {
    background: var(--surface-dark-subtle);
    border-color: var(--border-on-dark);
    color: var(--text-on-dark);
}

.card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-sm);
    margin-bottom: var(--space-sm);
}

.card__title {
    font-size: var(--text-lg);
    font-weight: var(--weight-semibold);
    letter-spacing: -0.01em;
}

.card__body {
    color: var(--text-secondary);
    font-size: var(--text-sm);
    line-height: var(--leading-relaxed);
}

.card--dark .card__body {
    color: var(--text-on-dark);
    opacity: 0.85;
}

.card__footer {
    margin-top: var(--space-md);
    padding-top: var(--space-md);
    border-top: 1px solid var(--border-subtle);
    display: flex;
    gap: var(--space-xs);
    align-items: center;
}

.card--dark .card__footer {
    border-top-color: var(--border-on-dark);
}

/* Table */
.table-container {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--text-xs);
}

.table th {
    background: var(--surface-subtle);
    padding: var(--space-2xs) var(--space-xs);
    text-align: left;
    font-weight: var(--weight-medium);
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    line-height: 1.3;
}

.table td {
    padding: var(--space-2xs) var(--space-xs);
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-primary);
    line-height: 1.4;
}

.table tr:last-child td {
    border-bottom: none;
}

.table tr:hover {
    background: var(--surface-hover);
}

/* Badge */
.badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2xs);
    padding: var(--space-2xs) var(--space-xs);
    border-radius: var(--radius-pill);
    font-size: var(--text-xs);
    font-weight: var(--weight-medium);
    line-height: 1;
    border: 1px solid;
}

.badge--neutral {
    background: var(--neutral-bg);
    color: var(--neutral);
    border-color: var(--neutral-border);
}

.badge--success {
    background: var(--success-bg);
    color: var(--success);
    border-color: var(--success-border);
}

.badge--warning {
    background: var(--warning-bg);
    color: var(--warning);
    border-color: var(--warning-border);
}

.badge--danger {
    background: var(--danger-bg);
    color: var(--danger);
    border-color: var(--danger-border);
}

.badge--info {
    background: var(--info-bg);
    color: var(--info);
    border-color: var(--info-border);
}

/* Stats */
.stats-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-lg);
    padding: var(--space-md);
    margin: var(--space-xl) auto;
    max-width: var(--container-max);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2xs);
    min-width: 80px;
}

.stat__label {
    font-size: var(--text-xs);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    line-height: 1.2;
    text-align: center;
}

.stat__value {
    font-size: var(--text-xl);
    font-weight: var(--weight-semibold);
    line-height: 1;
    margin-top: var(--space-2xs);
    text-align: center;
}

/* Log */
.log {
    display: flex;
    flex-direction: column;
    gap: 1px;
    background: var(--border-subtle);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.log-entry {
    background: var(--surface);
}

.log-entry__header {
    padding: var(--space-2xs) var(--space-xs);
    display: grid;
    grid-template-columns: 52px 1fr auto;
    gap: var(--space-xs);
    align-items: center;
    min-height: 22px;
    cursor: pointer;
    transition: background var(--duration-fast) var(--easing);
}

.log-entry__header:hover {
    background: var(--surface-hover);
}

.log-entry__timestamp {
    font-size: var(--text-xs);
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.log-entry__text {
    font-size: var(--text-xs);
    font-family: var(--font-mono);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.log-entry__category {
    font-size: var(--text-xs);
    font-weight: var(--weight-medium);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.log-entry__content {
    padding: var(--space-xs);
    border-top: 1px solid var(--border-subtle);
    background: var(--surface-subtle);
    display: none;
    font-size: var(--text-xs);
}

.log-entry__content[data-expanded="true"] {
    display: block;
}

/* Code */
.code-block {
    background: var(--surface-subtle);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--space-sm);
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    overflow-x: auto;
}

.code-block__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-xs);
    padding-bottom: var(--space-xs);
    border-bottom: 1px solid var(--border-subtle);
}

.code-block__label {
    font-size: var(--text-xs);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.code-block pre {
    margin: 0;
    line-height: var(--leading-relaxed);
}

.code-inline {
    font-family: var(--font-mono);
    font-size: 0.9em;
    padding: 0.15em 0.35em;
    background: var(--surface-subtle);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

/* Alert */
.alert {
    padding: var(--space-sm) var(--space-md);
    border: 1px solid;
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    display: flex;
    gap: var(--space-sm);
    align-items: flex-start;
}

.alert__icon {
    flex-shrink: 0;
    margin-top: 0.1em;
}

.alert__content {
    flex: 1;
}

.alert__title {
    font-weight: var(--weight-medium);
    margin-bottom: var(--space-2xs);
}

.alert--info {
    background: #ebf2f6;
    border-color: var(--info);
}

.alert--warning {
    background: #f8f4eb;
    border-color: var(--warning);
}

.alert--error {
    background: #f7edeb;
    border-color: var(--danger);
}

.alert--success {
    background: #eef5f1;
    border-color: var(--success);
}

/* Empty State */
.empty-state {
    padding: var(--space-2xl) var(--space-lg);
    text-align: center;
    color: var(--text-muted);
}

.empty-state__icon {
    font-size: var(--text-2xl);
    margin-bottom: var(--space-md);
    opacity: 0.5;
}

.empty-state__message {
    font-size: var(--text-md);
    margin-bottom: var(--space-md);
}

/* Activity Feed (Hacker News style) */
.activity-feed {
    display: flex;
    flex-direction: column;
}

.activity-item {
    display: grid;
    grid-template-columns: auto auto 1fr;
    gap: var(--space-xs);
    padding: var(--space-xs) 0;
    align-items: start;
}

.activity-item:not(:last-child) {
    border-bottom: 1px solid var(--border-subtle);
}

.activity-item__rank {
    font-size: var(--text-xs);
    color: var(--text-muted);
    font-family: var(--font-mono);
    padding-top: 1px;
}

.activity-item__vote {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.activity-item__vote-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 10px;
    line-height: 1;
    padding: 0;
    transition: color var(--duration-fast) var(--easing);
}

.activity-item__vote-btn:hover {
    color: var(--primary);
}

.activity-item__score {
    font-size: var(--text-xs);
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.activity-item__content {
    min-width: 0;
}

.activity-item__title {
    font-size: var(--text-sm);
    line-height: var(--leading-normal);
    margin-bottom: var(--space-2xs);
}

.activity-item__title a {
    color: var(--text-primary);
}

.activity-item__title a:hover {
    color: var(--link);
}

.activity-item__domain {
    font-size: var(--text-xs);
    color: var(--text-muted);
}

.activity-item__meta {
    font-size: var(--text-xs);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: var(--space-2xs);
    flex-wrap: wrap;
}

.activity-item__separator {
    color: var(--text-muted);
    opacity: 0.5;
}

/* Document Viewer */
.document-viewer {
    min-height: 100vh;
    background: var(--canvas);
    padding: var(--space-lg);
}

.document-viewer__container {
    max-width: 720px;
    margin: 0 auto;
}

.document-viewer__header {
    margin-bottom: var(--space-xl);
    padding-bottom: var(--space-lg);
    border-bottom: 1px solid var(--border);
}

.document-viewer__back {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: var(--text-sm);
    color: var(--text-secondary);
    margin-bottom: var(--space-md);
    transition: color var(--duration-fast) var(--easing);
}

.document-viewer__back:hover {
    color: var(--primary);
    text-decoration: none;
}

.document-viewer__title {
    font-size: var(--text-2xl);
    font-weight: var(--weight-semibold);
    margin-bottom: var(--space-xs);
    letter-spacing: -0.02em;
}

.document-viewer__subtitle {
    font-size: var(--text-sm);
    color: var(--text-muted);
}

.document-viewer__content {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--space-2xl) var(--space-xl);
}

.document-viewer__content h2 {
    font-size: var(--text-xl);
    font-weight: var(--weight-semibold);
    margin-top: var(--space-xl);
    margin-bottom: var(--space-md);
    letter-spacing: -0.01em;
}

.document-viewer__content h2:first-child {
    margin-top: 0;
}

.document-viewer__content h3 {
    font-size: var(--text-lg);
    font-weight: var(--weight-semibold);
    margin-top: var(--space-lg);
    margin-bottom: var(--space-sm);
}

.document-viewer__content p {
    line-height: var(--leading-relaxed);
    margin-bottom: var(--space-md);
    color: var(--text-secondary);
}

.document-viewer__content ul,
.document-viewer__content ol {
    margin-bottom: var(--space-md);
    padding-left: var(--space-lg);
    line-height: var(--leading-relaxed);
}

.document-viewer__content li {
    margin-bottom: var(--space-xs);
    color: var(--text-secondary);
}

.document-viewer__content strong {
    font-weight: var(--weight-semibold);
    color: var(--text-primary);
}

.document-viewer__footer {
    margin-top: var(--space-xl);
    padding-top: var(--space-lg);
    border-top: 1px solid var(--border);
    font-size: var(--text-sm);
    color: var(--text-muted);
    text-align: center;
}

/* Button */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    padding: var(--space-xs) var(--space-md);
    font-family: var(--font-base);
    font-size: var(--text-sm);
    font-weight: var(--weight-medium);
    line-height: 1;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--duration-fast) var(--easing);
    text-decoration: none;
}

/* Ensure anchor tags styled as buttons behave like buttons */
a.btn:hover {
    text-decoration: none;
}

.btn:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.btn--primary {
    background: var(--primary);
    color: var(--text-inverse);
    border-color: var(--primary);
}

.btn--primary:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    text-decoration: none;
}

/* Ensure visited state doesn't override button colors */
a.btn--primary,
a.btn--primary:visited {
    color: var(--text-inverse);
}

.btn--secondary {
    background: var(--surface);
    color: var(--text-primary);
    border-color: var(--border-strong);
}

.btn--secondary:hover {
    background: var(--surface-hover);
    border-color: var(--text-secondary);
    text-decoration: none;
}

a.btn--secondary,
a.btn--secondary:visited {
    color: var(--text-primary);
}

.btn--ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn--ghost:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
    text-decoration: none;
}

a.btn--ghost,
a.btn--ghost:visited {
    color: var(--text-secondary);
}

a.btn--ghost:hover {
    color: var(--text-primary);
}

.btn--danger {
    background: var(--danger);
    color: var(--text-inverse);
    border-color: var(--danger);
}

.btn--danger:hover {
    background: var(--danger-hover);
    border-color: var(--danger-hover);
    text-decoration: none;
}

a.btn--danger,
a.btn--danger:visited {
    color: var(--text-inverse);
}

.btn--xs {
    padding: var(--space-2xs) var(--space-xs);
    font-size: var(--text-xs);
}

.btn--sm {
    padding: var(--space-xs) var(--space-sm);
    font-size: var(--text-sm);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-group {
    display: flex;
    gap: var(--space-xs);
}

/* Form */
.form-field {
    display: flex;
    flex-direction: column;
    gap: var(--space-2xs);
}

.form-field__label {
    font-size: var(--text-sm);
    font-weight: var(--weight-medium);
}

.form-field__input,
.form-field__select,
.form-field__textarea {
    padding: var(--space-xs) var(--space-sm);
    font-family: var(--font-base);
    font-size: var(--text-sm);
    color: var(--text-primary);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: border-color var(--duration-fast) var(--easing),
    box-shadow var(--duration-fast) var(--easing);
}

.form-field__input:focus,
.form-field__select:focus,
.form-field__textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(61, 155, 143, 0.1);
}

.form-field__input--mono {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
}

.form-field__textarea {
    resize: vertical;
    min-height: 80px;
}

.form-field__help {
    font-size: var(--text-xs);
    color: var(--text-muted);
}

.form-field__error {
    font-size: var(--text-xs);
    color: var(--danger);
}

.form-field--error .form-field__input,
.form-field--error .form-field__select,
.form-field--error .form-field__textarea {
    border-color: var(--danger);
}

.form--stacked {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

/* Modal */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(31, 40, 38, 0.4);
    backdrop-filter: blur(2px);
    z-index: var(--z-modal-backdrop);
    display: none;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
    opacity: 0;
    transition: opacity var(--duration-normal) var(--easing);
}

.modal-backdrop.is-open {
    display: flex;
}

.modal-backdrop.is-visible {
    opacity: 1;
}

.modal {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    max-width: 480px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    transform: scale(0.95) translateY(10px);
    transition: transform var(--duration-normal) var(--easing);
}

.modal-backdrop.is-visible .modal {
    transform: scale(1) translateY(0);
}

.modal--wide {
    max-width: 720px;
}

.modal__header {
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
}

.modal__title {
    font-size: var(--text-lg);
    font-weight: var(--weight-semibold);
}

.modal__close {
    color: var(--text-muted);
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--space-2xs);
    font-size: var(--text-lg);
    line-height: 1;
    transition: color var(--duration-fast) var(--easing);
}

.modal__close:hover {
    color: var(--text-primary);
}

.modal__body {
    padding: var(--space-lg);
    overflow-y: auto;
    flex: 1;
}

.modal__footer {
    padding: var(--space-md) var(--space-lg);
    border-top: 1px solid var(--border);
    display: flex;
    gap: var(--space-xs);
    justify-content: flex-end;
}

/* ═══════════════════════════════════════════════════════════
   UTILITIES
   ═══════════════════════════════════════════════════════════ */

.styleguide-section {
    margin-bottom: var(--space-2xl);
}

.component-example {
    margin-bottom: var(--space-lg);
}

.component-example__label {
    font-size: var(--text-xs);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: var(--space-xs);
}

.component-example__preview {
    padding: var(--space-lg);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

.token-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: var(--space-sm);
}

.token-swatch {
    padding: var(--space-sm);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: var(--text-xs);
    font-family: var(--font-mono);
}

.token-swatch__color {
    height: 48px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: var(--space-xs);
}

/* Footer */
.footer {
    margin-top: var(--space-xl);
    padding: var(--space-lg);
    border-top: 1px solid var(--border);
    font-size: var(--text-sm);
    color: var(--text-muted);
    text-align: center;
}

.footer p {
    margin: 0;
}