/* Shared screen layout; document geometry is kept separate from printing. */
.sidebar-header { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.sidebar-panel { display: flex; flex: 1; flex-direction: column; gap: 1.35rem; min-width: 0; }
.navigation-toggle, .mobile-cell-label { display: none; }

@media screen {
    body { overflow-wrap: anywhere; letter-spacing: 0; }
    h1, h2, h3, .brand strong, .metric > strong, .schedule-total, .print-title,
    .login-intro p, .login-form h2 { letter-spacing: 0; }
    h1 { font-size: 3rem; line-height: 1.12; }
    .login-intro h1 { font-size: 4rem; }
    .login-intro p { font-size: 1.2rem; }
    .metric > strong { font-size: 3rem; line-height: 1.15; }
    .finance-metrics .metric > strong { font-size: 2.25rem; }
    .main-content > *, .card, .card > *, .form-grid > *, .form-card form > div > *,
    .form-section > *, .role-reference > *, .document-grid > *, .details > div > *,
    .print-header > *, .actions > *, .filter-bar > *, .import-settings > * { min-width: 0; }
    img { max-width: 100%; }
    input, select, textarea, fieldset { min-width: 0; max-width: 100%; }
    fieldset { margin-inline: 0; }
    .button { max-width: 100%; text-align: center; white-space: normal; }
    .badge, .member-total, .recipient-count { max-width: 100%; white-space: normal; }
    .section-tabs { max-width: 100%; flex-wrap: wrap; border-radius: 16px; }
    .section-tabs a { min-width: 0; }
    .table-wrap { max-width: 100%; overscroll-behavior-x: contain; }
    .table-wrap:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
    .table-actions { flex-wrap: wrap; white-space: normal; }
    .recipient-grid .form-check, .role-choice-grid .form-check { align-items: flex-start; }
    .form-check label { flex: 1; min-width: 0; }
    .form-check input { flex-shrink: 0; }
}

@media screen and (min-width: 901px) and (max-width: 1200px) {
    .form-section, .role-reference, .import-layout, .import-settings, .filter-bar, .callout { grid-template-columns: minmax(0, 1fr); }
    .page-header { flex-wrap: wrap; }
    .form-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .login-panel { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 2rem; }
}

@media screen and (max-width: 900px) {
    .sidebar { gap: 0; padding: .75rem 1rem; overflow: visible; }
    .sidebar-panel { padding-top: 1rem; }
    .navigation-ready .navigation-toggle { display: inline-flex; flex-shrink: 0; gap: .5rem; min-height: 44px; }
    .navigation-ready .sidebar-panel:not(.is-open) { display: none; }
    .main-nav a, .sidebar-footer a, .context-card a { display: flex; align-items: center; min-height: 44px; }
    .form-control, .form-select, input:not([type="checkbox"]):not([type="radio"]), select, textarea { font-size: 16px; }
    .button, .link-button { min-height: 44px; }
    .page-header { flex-wrap: wrap; }
    h1 { font-size: 2.25rem; }
    .form-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media screen and (max-width: 620px) {
    body { font-size: 16px; line-height: 1.55; }
    .main-content { padding: 1rem; }
    h1, .login-intro h1 { font-size: 2rem; line-height: 1.15; }
    .login-intro p { font-size: 1rem; }
    h2 { line-height: 1.3; }
    .card, .metric, .empty-state, .print-sheet { padding: 1rem; }
    .form-section, .role-reference { gap: 1rem; }
    .form-grid-3 { grid-template-columns: minmax(0, 1fr); }
    .form-grid > span:empty { display: none; }
    .form-label, label { font-size: .95rem; }
    .form-text, .form-note, small { font-size: .875rem; }
    .button, .section-tabs a { font-size: .95rem; }
    .form-submit .button, .actions .button, .actions form, .actions form .button { width: 100%; }
    .section-tabs { width: 100%; border-radius: 12px; margin-top: 0; }
    .section-tabs a { flex: 1 1 100%; min-height: 44px; border-radius: 8px; text-align: center; }
    .section-title-row, .document-meta { align-items: flex-start; flex-direction: column; }
    .section-title-row > .button { width: 100%; }
    .recipient-count { line-height: 1.5; }
    .table-wrap > table { min-width: 640px; }
    .table-wrap > .mobile-table { display: block; min-width: 0; }
    .mobile-table > thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
    .mobile-table > tbody, .mobile-table > tbody > tr { display: block; }
    .mobile-table > tbody > tr { padding: .75rem 1rem; border-bottom: 1px solid var(--line-strong); }
    .mobile-table > tbody > tr:last-child { border-bottom: 0; }
    .mobile-table > tbody > tr > td { display: block; width: 100%; padding: .4rem 0; border: 0; }
    .mobile-cell-label { display: block; margin-bottom: .15rem; color: var(--text-secondary); font-size: .8rem; font-weight: 650; }
    .mobile-table .actions, .mobile-table .table-actions { justify-content: flex-start; gap: .4rem 1rem; }
    .mobile-table td a, .mobile-table .link-button { display: inline-flex; align-items: center; min-height: 44px; }
    .mobile-table td a { max-width: 100%; }
    .mobile-table .badge { font-size: .75rem; line-height: 1.4; }
    .print-header { grid-template-columns: 1fr 1fr; gap: .75rem; }
    .print-header > :nth-child(2) { grid-column: 1 / -1; grid-row: 2; }
    .print-header > :first-child { justify-self: start; }
    .print-header > :last-child { justify-self: end; }
    .print-header-logo { width: 56px; height: 56px; }
    .print-title { font-size: 1.4rem; }
    .print-signature, .print-field span, .print-footer { font-size: .875rem; }
    .legal-copy { padding: .75rem; font-size: 1rem; line-height: 1.6; }
    .public-shell .main-content { min-height: 100svh; }
    .login-panel { gap: 1.5rem; }
}

@media print {
    .mobile-cell-label, .navigation-toggle { display: none !important; }
    .document-grid, .check-grid, .print-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .print-signatures { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .convocation-body-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
}
