/* Opt-in components for pages migrating from the legacy box layout. */
.app-page {
    height: auto;
    min-height: 100vh;
}

.app-page > .main-container,
.app-page > .main-container > .content {
    min-width: 0;
}

.app-page > .main-container > .content {
    padding-bottom: 30px;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 30px;
}

/* Reuse .box for the card surface; the collection owns width and spacing. */
.card-grid > .box {
    width: auto;
    min-width: 0;
    margin: 0;
    padding: 32px 30px;
}

.card-grid > .box.full-width-box {
    width: auto;
    grid-column: 1 / -1;
}

.ui-card-title,
.box-header .ui-card-title {
    margin: 0;
    color: #150f4d;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.24px;
}

.ui-card-description {
    margin: 8px 0 0;
}

.disclosure-toggle {
    appearance: none;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 44px;
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

/* Keep standalone chevrons beside wrapping labels; status groups may still wrap. */
.disclosure-toggle:has(> [data-disclosure-icon]) {
    flex-wrap: nowrap;
}

.disclosure-toggle [data-disclosure-icon] {
    flex-shrink: 0;
}

.disclosure-toggle[aria-expanded="true"] [data-disclosure-icon] {
    transform: rotate(180deg);
}

.disclosure-panel {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e0e0e0;
}

/* Keep long native options within the control in narrow WebKit layouts. */
.disclosure-panel select {
    white-space: normal;
}

/* Author display rules (including the stack variant) must not override hidden. */
.disclosure-panel[hidden] {
    display: none !important;
}

.disclosure-panel--stack {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.dark-mode .disclosure-panel {
    border-top-color: rgba(255, 255, 255, 0.2);
}

@media (max-width: 1330px) {
    .card-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 600px) {
    .card-grid > .box {
        padding: 24px 20px;
    }
}
