/* Shared interaction fixes. Colors inherit the existing identity in either theme. */
body.ui-dialog-open { overflow: hidden; }
:is(.report-preview-backdrop, .flexible-day-dialog-backdrop, .student-calendar-popout) { z-index: 1000; }
[data-ui-dialog] { overscroll-behavior: contain; }
.plan-delete-dialog { max-height: calc(100dvh - 2rem); overflow-y: auto; }
:is(.report-preview-dialog-header, .report-preview-student-picker) { background: var(--surface); }
.report-preview-dialog { grid-template-rows: auto minmax(0, 1fr) auto; }
.report-preview-dialog:has(.report-preview-student-picker) { grid-template-rows: auto auto minmax(0, 1fr) auto; }
.hijri-picker-menu button:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.hijri-picker-trigger > span { min-width: 0; }

/* A report is a preview of a light printed page; its chrome follows the active theme. */
.report-preview-paper {
    color-scheme: light;
    --ink: #17332a;
    --muted: #60756d;
    --green: #12654f;
    --green2: #e8f5ef;
    --line: #d7e5de;
    --surface: #fff;
    --surface-subtle: #f6faf8;
}
html[data-theme="dark"] .report-preview-paper .brand-artwork--light { display: block; }
html[data-theme="dark"] .report-preview-paper .brand-artwork--dark { display: none; }

.journey-days :is(.journey-day-card > header small, .journey-requirement em,
    .journey-requirement small, .journey-requirement strong) { font-size: 11px; }
.journey-days .journey-requirement b { font-size: 12px; }
.journey-summary small, .journey-plan-copy small { font-size: 11px; }
.journey-month-day :is(small, span) { font-size: 10px; }

:is(button, a, summary, input, select, textarea):focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 3px;
}

@media (pointer: coarse) {
    :is(.table-action, .edit-action, .report-preview-close, .student-calendar-close,
        .flexible-dialog-close, .journey-nav-button, .journey-open-plan,
        .journey-today-button, .journey-scale-tabs button, .hijri-picker-menu button) {
        min-width: 44px;
        min-height: 44px;
        touch-action: manipulation;
    }
    .check-item, .flexible-kind-toggle { min-height: 44px; }
}

@media (max-width: 700px) {
    /* Prevent iOS zooming and shifting the layout when an editable field receives focus. */
    input:not([type="checkbox"]):not([type="radio"]), select, textarea { font-size: 16px; }
    .report-preview-backdrop { padding: 8px; }
    .report-preview-dialog { width: 100%; max-height: calc(100dvh - 16px); }
    .report-preview-dialog-header, .report-preview-student-picker { padding: 14px; }
    .report-preview-student-picker { align-items: stretch; flex-direction: column; gap: 6px; }
    .report-preview-student-picker select { width: 100%; }
    .report-preview-scroll { padding: 10px; }
    .report-preview-paper { padding: 14px; }
    .week-registration-control { align-items: stretch; flex-direction: column; gap: 12px; }
    .week-registration-control button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    #components-reconnect-modal[open] { animation: none; opacity: 1; }
}
