/* Adjective catalog, lexical reference, and selected-adjective surfaces. */
.rh-adjective-catalog,
.rh-adjective-detail {
    width: min(100%, var(--rh-wide-width));
}

.rh-adjective-catalog__hero {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: var(--rh-space-4);
    padding: clamp(1rem, 2.4vw, 1.55rem);
}

.rh-adjective-catalog__hero > div,
.rh-adjective-detail__hero-layout > * {
    min-width: 0;
}

.rh-adjective-catalog__hero h1 {
    margin-bottom: var(--rh-space-1);
}

.rh-adjective-catalog__hero .rh-panel__lead {
    max-width: 65ch;
    margin: 0;
}

.rh-adjective-catalog__count {
    flex: 0 0 auto;
    padding: 0.48rem 0.72rem;
    border: 1px solid var(--rh-border);
    border-radius: var(--rh-radius-control);
    background: var(--rh-surface-subtle);
    color: var(--rh-text);
    font-size: 0.88rem;
}

.rh-adjective-catalog__tools {
    display: grid;
    gap: var(--rh-space-3);
    padding: clamp(0.85rem, 2vw, 1.2rem);
}

.rh-adjective-catalog__tools-heading,
.rh-adjective-catalog__search-row,
.rh-adjective-filter-panel__heading,
.rh-adjective-filter-panel__actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--rh-space-3);
    min-width: 0;
}

.rh-adjective-catalog__tools-heading > div,
.rh-adjective-filter-panel__heading > div {
    display: grid;
    gap: 0.12rem;
    min-width: 0;
}

.rh-adjective-catalog__tools-heading strong,
.rh-adjective-filter-panel__heading strong {
    color: var(--rh-text);
}

.rh-adjective-filter-count {
    color: var(--rh-action);
    font-size: 0.8rem;
    font-weight: 780;
}

.rh-adjective-catalog__search-row .rh-search-field {
    flex: 1 1 auto;
    min-width: 0;
}

.rh-adjective-catalog__filter-actions {
    display: flex;
    align-items: end;
    gap: var(--rh-space-2);
    padding-top: 1.25rem;
}

.rh-adjective-catalog__filter-actions .rh-button,
.rh-adjective-filter-panel__actions .rh-button {
    min-height: 2.85rem;
    white-space: nowrap;
}

.rh-adjective-catalog .rh-button--quiet {
    border: 1px solid transparent;
    background: transparent;
    color: var(--rh-text-muted);
}

.rh-adjective-catalog .rh-button--quiet:hover,
.rh-adjective-catalog .rh-button--quiet:focus-visible {
    border-color: var(--rh-border);
    background: var(--rh-surface-subtle);
    color: var(--rh-text);
}

.rh-adjective-catalog .rh-button:disabled {
    cursor: not-allowed;
    opacity: 0.46;
}

.rh-adjective-filter-toggle {
    display: none;
}

.rh-adjective-filter-panel {
    display: grid;
    gap: var(--rh-space-3);
    padding-top: var(--rh-space-3);
    border-top: 1px solid var(--rh-border);
}

.rh-adjective-filter-panel__heading span {
    color: var(--rh-text-muted);
    font-size: 0.82rem;
}

.rh-adjective-filter-panel__close {
    display: none;
    min-height: 2.75rem;
    padding: 0.55rem 0.72rem;
    border: 1px solid var(--rh-border);
    border-radius: var(--rh-radius-control);
    background: var(--rh-surface);
    color: var(--rh-text);
    font: inherit;
    font-weight: 700;
}

.rh-adjective-filter-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--rh-space-3);
}

.rh-adjective-filter-grid label {
    display: grid;
    gap: var(--rh-space-2);
    min-width: 0;
    color: var(--rh-text-muted);
    font-size: 0.78rem;
    font-weight: 760;
}

.rh-adjective-filter-grid select {
    width: 100%;
    min-width: 0;
    min-height: 2.9rem;
    padding: 0.65rem 2rem 0.65rem 0.75rem;
    border: 1px solid var(--rh-border-strong);
    border-radius: var(--rh-radius-control);
    background: var(--rh-surface);
    color: var(--rh-text);
    font: inherit;
}

.rh-adjective-filter-panel__actions {
    justify-content: flex-end;
}

.rh-adjective-card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--rh-space-3);
}

.rh-adjective-family--hard {
    --rh-adjective-accent: #3773a8;
    --rh-adjective-border: color-mix(in srgb, var(--rh-adjective-accent) 40%, var(--rh-border));
    --rh-adjective-surface: color-mix(in srgb, var(--rh-action-soft) 38%, var(--rh-surface));
}

.rh-adjective-family--soft {
    --rh-adjective-accent: #7452a8;
    --rh-adjective-border: color-mix(in srgb, var(--rh-adjective-accent) 42%, var(--rh-border));
    --rh-adjective-surface: color-mix(in srgb, #8c68c7 10%, var(--rh-surface));
}

.rh-adjective-family--spelling {
    --rh-adjective-accent: #197c74;
    --rh-adjective-border: color-mix(in srgb, var(--rh-adjective-accent) 42%, var(--rh-border));
    --rh-adjective-surface: color-mix(in srgb, #1a9389 9%, var(--rh-surface));
}

.rh-adjective-family--stressed {
    --rh-adjective-accent: #9b6812;
    --rh-adjective-border: color-mix(in srgb, var(--rh-adjective-accent) 42%, var(--rh-border));
    --rh-adjective-surface: color-mix(in srgb, var(--rh-warning-soft) 52%, var(--rh-surface));
}

.rh-adjective-family--possessive {
    --rh-adjective-accent: #a34f66;
    --rh-adjective-border: color-mix(in srgb, var(--rh-adjective-accent) 42%, var(--rh-border));
    --rh-adjective-surface: color-mix(in srgb, #c75f7d 9%, var(--rh-surface));
}

.rh-adjective-family--special {
    --rh-adjective-accent: var(--rh-text-muted);
    --rh-adjective-border: var(--rh-border-strong);
    --rh-adjective-surface: var(--rh-surface-subtle);
}

.rh-adjective-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.48rem;
    min-width: 0;
    min-height: 9.4rem;
    padding: 1rem;
    border: 1px solid var(--rh-adjective-border, var(--rh-border));
    border-radius: var(--rh-radius-card);
    background: var(--rh-adjective-surface, var(--rh-surface));
    color: var(--rh-text);
    box-shadow: var(--rh-shadow-1);
    text-decoration: none;
    transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.rh-adjective-card::before,
.rh-adjective-detail__hero::before {
    position: absolute;
    inset: 0.85rem auto 0.85rem 0;
    width: 0.24rem;
    border-radius: 0 999px 999px 0;
    background: var(--rh-adjective-accent, var(--rh-action));
    content: "";
}

.rh-adjective-card:hover {
    border-color: var(--rh-adjective-accent, var(--rh-action));
    box-shadow: var(--rh-shadow-2);
    transform: translateY(-2px);
}

.rh-adjective-card:focus-visible {
    border-color: var(--rh-action);
    outline: 3px solid var(--rh-focus-ring);
    outline-offset: 3px;
}

.rh-adjective-card__heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--rh-space-3);
    min-width: 0;
}

.rh-adjective-card__heading > span:first-child {
    display: grid;
    gap: 0.18rem;
    min-width: 0;
}

.rh-adjective-card__heading strong {
    color: var(--rh-text);
    font-family: var(--rh-font-display);
    font-size: clamp(1.35rem, 2.2vw, 1.7rem);
    line-height: 1.08;
    overflow-wrap: anywhere;
}

.rh-adjective-card__heading > span > span,
.rh-adjective-card__detail {
    color: var(--rh-text-muted);
}

.rh-adjective-card__arrow {
    flex: 0 0 auto;
    color: var(--rh-adjective-accent, var(--rh-action));
    font-size: 1.2rem;
}

.rh-adjective-card__meta {
    margin-top: auto;
    color: var(--rh-adjective-accent, var(--rh-action));
    font-size: 0.78rem;
    font-weight: 800;
}

.rh-adjective-card__detail {
    font-size: 0.78rem;
}

.rh-adjective-detail__hero {
    position: relative;
    padding: clamp(1rem, 3vw, 1.75rem);
    border-color: var(--rh-adjective-border, var(--rh-border));
    background: var(--rh-adjective-surface, var(--rh-surface));
    overflow: hidden;
}

.rh-adjective-detail__back {
    margin-bottom: var(--rh-space-4);
}

.rh-adjective-detail__hero-layout {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: var(--rh-space-5);
}

.rh-adjective-detail__hero h1 {
    margin-bottom: var(--rh-space-1);
    font-size: clamp(2rem, 5vw, 3.6rem);
}

.rh-adjective-detail__primary-meta {
    margin: var(--rh-space-3) 0 0;
    color: var(--rh-adjective-accent, var(--rh-action));
    font-weight: 800;
}

.rh-adjective-detail__actions {
    flex: 0 0 auto;
}

.rh-adjective-detail > .rh-reference-panel,
.rh-adjective-limitations,
.rh-adjective-detail__learning-action {
    padding: clamp(1rem, 2.6vw, 1.6rem);
}

.rh-adjective-detail .rh-reference-panel > h2 {
    margin-bottom: var(--rh-space-2);
}

.rh-adjective-table-wrap {
    position: relative;
    max-width: 100%;
    margin-top: var(--rh-space-4);
    border: 1px solid var(--rh-border);
    border-radius: var(--rh-radius-control);
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
}

.rh-adjective-table {
    width: 100%;
    min-width: 50rem;
    border-collapse: collapse;
    color: var(--rh-text);
}

.rh-adjective-table th,
.rh-adjective-table td {
    padding: 0.72rem;
    border-right: 1px solid var(--rh-border);
    border-bottom: 1px solid var(--rh-border);
    text-align: left;
    vertical-align: top;
}

.rh-adjective-table th:last-child,
.rh-adjective-table td:last-child {
    border-right: 0;
}

.rh-adjective-table tbody tr:last-child > * {
    border-bottom: 0;
}

.rh-adjective-table thead th {
    background: var(--rh-surface-subtle);
    color: var(--rh-text-muted);
    font-size: 0.76rem;
    letter-spacing: 0.02em;
}

.rh-adjective-table tbody th {
    width: 8.5rem;
    background: color-mix(in srgb, var(--rh-surface-subtle) 72%, var(--rh-surface));
}

.rh-adjective-table tbody th strong,
.rh-adjective-table tbody th small {
    display: block;
}

.rh-adjective-table tbody th small {
    margin-top: 0.16rem;
    color: var(--rh-text-muted);
    font-weight: 600;
}

.rh-adjective-form-cell {
    display: grid;
    gap: 0.2rem;
}

.rh-adjective-form-cell strong {
    color: var(--rh-text);
    font-family: var(--rh-font-ui);
    font-size: 1.08rem;
}

.rh-adjective-form-cell small,
.rh-adjective-form-cell__empty {
    color: var(--rh-text-muted);
    font-size: 0.72rem;
}

.rh-adjective-diagnostic__forms {
    display: flex;
    flex-wrap: wrap;
    gap: var(--rh-space-2);
    margin: var(--rh-space-4) 0 var(--rh-space-3);
}

.rh-adjective-diagnostic__forms strong {
    padding: 0.5rem 0.68rem;
    border: 1px solid var(--rh-adjective-border, var(--rh-border));
    border-radius: var(--rh-radius-control);
    background: var(--rh-adjective-surface, var(--rh-surface-subtle));
    color: var(--rh-text);
    font-family: var(--rh-font-ui);
    font-size: 1.12rem;
}

.rh-adjective-form-grid,
.rh-adjective-comparison__grid,
.rh-adjective-example-list,
.rh-adjective-definition-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--rh-space-3);
    margin-top: var(--rh-space-4);
}

.rh-adjective-form-grid article,
.rh-adjective-comparison__grid article,
.rh-adjective-example-list article,
.rh-adjective-definition-grid > div {
    display: grid;
    gap: 0.3rem;
    min-width: 0;
    padding: 0.85rem;
    border: 1px solid var(--rh-border);
    border-radius: var(--rh-radius-control);
    background: var(--rh-surface-subtle);
}

.rh-adjective-form-grid span,
.rh-adjective-comparison__grid span,
.rh-adjective-example-list span,
.rh-adjective-definition-grid dt {
    color: var(--rh-text-muted);
    font-size: 0.74rem;
    font-weight: 800;
}

.rh-adjective-form-grid strong,
.rh-adjective-comparison__grid strong,
.rh-adjective-example-list strong {
    color: var(--rh-text);
    font-family: var(--rh-font-ui);
    font-size: 1.22rem;
    overflow-wrap: anywhere;
}

.rh-adjective-form-grid small,
.rh-adjective-comparison__grid p,
.rh-adjective-example-list p,
.rh-adjective-definition-grid dd {
    margin: 0;
    color: var(--rh-text-muted);
    overflow-wrap: anywhere;
}

.rh-adjective-detail__learning-action {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--rh-space-4);
}

.rh-adjective-detail__learning-action p {
    margin: 0.2rem 0 0;
    color: var(--rh-text-muted);
}

@media (max-width: 62rem) {
    .rh-adjective-card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 48rem) {
    .rh-filter-modal-open {
        overflow: hidden;
    }

    .rh-adjective-catalog__hero,
    .rh-adjective-detail__hero-layout,
    .rh-adjective-detail__learning-action {
        align-items: stretch;
        flex-direction: column;
    }

    .rh-adjective-catalog__count {
        align-self: flex-start;
    }

    .rh-adjective-catalog__search-row {
        align-items: stretch;
        flex-direction: column;
    }

    .rh-adjective-catalog__filter-actions {
        justify-content: space-between;
        padding-top: 0;
    }

    .rh-adjective-filter-toggle {
        display: inline-flex;
    }

    .rh-adjective-filter-panel {
        position: fixed;
        inset: auto 0 0;
        z-index: 1300;
        display: none;
        max-height: min(86dvh, 44rem);
        padding: 1rem max(1rem, env(safe-area-inset-right)) calc(1rem + env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
        border: 1px solid var(--rh-border-strong);
        border-bottom: 0;
        border-radius: 1.2rem 1.2rem 0 0;
        background: var(--rh-surface-elevated);
        box-shadow: 0 -18px 55px rgba(5, 20, 38, 0.25);
        overflow-y: auto;
    }

    .rh-adjective-filter-panel.is-open {
        display: grid;
    }

    .rh-adjective-filter-panel.is-open::before {
        position: fixed;
        inset: 0;
        z-index: -1;
        background: rgba(5, 20, 38, 0.48);
        content: "";
    }

    .rh-adjective-filter-panel__close {
        display: inline-flex;
        align-items: center;
    }

    .rh-adjective-filter-grid {
        grid-template-columns: 1fr;
    }

    .rh-adjective-filter-panel__actions {
        position: sticky;
        bottom: calc(-1rem - env(safe-area-inset-bottom));
        padding: var(--rh-space-3) 0 calc(var(--rh-space-3) + env(safe-area-inset-bottom));
        background: var(--rh-surface-elevated);
    }

    .rh-adjective-detail__actions .rh-button,
    .rh-adjective-detail__learning-action .rh-button {
        width: 100%;
    }
}

@media (max-width: 40rem) {
    .rh-adjective-card-grid,
    .rh-adjective-form-grid,
    .rh-adjective-comparison__grid,
    .rh-adjective-example-list,
    .rh-adjective-definition-grid {
        grid-template-columns: 1fr;
    }

    .rh-adjective-card {
        min-height: 8.7rem;
    }

    .rh-adjective-filter-panel__actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .rh-adjective-filter-panel__actions .rh-button:last-child {
        grid-column: 1 / -1;
    }
}

@media (prefers-reduced-motion: reduce) {
    .rh-adjective-card {
        transition: none;
    }
}
