/* Screen-only refinement. Existing grids, card order and breakpoints are retained. */
@media screen {
  :root {
    --text-body:1rem;
    --text-ui:.875rem;
    --text-help:.8125rem;
    --text-meta:.75rem;
  }

  body { font-size:var(--text-body); line-height:1.55; }
  h1 { font-size:clamp(1.75rem,2.5vw,2.25rem); line-height:1.2; letter-spacing:-.035em; }
  h2 { font-size:1.375rem; line-height:1.3; letter-spacing:-.025em; }
  h3 { font-size:1.125rem; line-height:1.4; letter-spacing:-.015em; }
  h1,h2,h3,h4,.drink-recipe-heading,.purchase-section-title { overflow-wrap:anywhere; }
  .page-heading h1 { font-size:clamp(1.75rem,2.5vw,2.25rem); }
  .page-heading .muted { font-size:var(--text-ui); line-height:1.6; }
  .page-heading > div { min-width:0; }
  .page-heading > div > p:last-child { max-width:75ch; }
  .section-heading h2,.team-layout .panel > h2 { font-size:1.25rem; line-height:1.4; }
  p { line-height:1.6; }
  .small { font-size:var(--text-help); }
  .help,.purchase-dialog .help { font-size:var(--text-help); line-height:1.6; }
  .help { overflow-wrap:anywhere; }
  .eyebrow,.hero .eyebrow,.progress-panel .eyebrow,.auth-story .eyebrow,
  .countdown-panel .eyebrow,.purchase-eyebrow { font-size:.6875rem; font-weight:700; letter-spacing:.1em; line-height:1.6; }
  .brand { font-weight:700; }
  .sidebar-caption { font-size:.625rem; letter-spacing:.09em; line-height:1.6; }
  .nav-link { font-size:var(--text-ui); }
  .sidebar .profile small,.local-label { font-size:var(--text-meta); }
  .sidebar-note p { font-size:var(--text-help); line-height:1.6; }
  .sidebar-note strong,.profile strong { font-size:var(--text-ui); }
  .back-link,.text-link,.text-button { font-size:var(--text-help); line-height:1.5; }
  .event-tabs { font-size:var(--text-ui); }
  .button,.page-heading > .button,.section-heading > .button,.hero .button { font-size:var(--text-ui); font-weight:600; }
  .button-small,.filters a { font-size:var(--text-help); }
  .button { overflow-wrap:anywhere; }
  .field label,.schedule-filters legend,.team-picker legend { font-size:var(--text-ui); line-height:1.5; }
  input:not([type=hidden]):not([type=checkbox]):not([type=radio]):not([type=range]),select,textarea { font-size:var(--text-ui); line-height:1.5; }
  .optional { font-size:var(--text-meta); }
  .field-errors,.form-errors,.errorlist,.message { font-size:var(--text-ui); line-height:1.6; }
  .badge,.task-title-row .badge,.count { font-size:var(--text-meta); line-height:1.4; }
  .badge { max-width:100%; white-space:normal; overflow-wrap:anywhere; }
  .event-description,.task-description,.board-description { font-size:var(--text-ui); line-height:1.65; }
  .task-description { margin:8px 0; }
  .task-meta,.schedule-assignees,.board-creator,.board-person,.board-bottom,
  .member-info span,.membership-note,.task-event { font-size:var(--text-help); line-height:1.5; }
  .board-card h3,.task-title-row h3 { font-size:1rem; line-height:1.4; }
  .board-creator { line-height:1.55; }
  .board-person,.member-info,.board-bottom > span { min-width:0; overflow-wrap:anywhere; }
  .team-chip { font-size:var(--text-meta); line-height:1.5; white-space:normal; overflow-wrap:anywhere; }
  .board-empty,.quiet-empty { font-size:var(--text-ui); }
  .task-preview strong,.member-info strong { font-size:var(--text-ui); }
  .task-preview small,.task-preview .due,.due { font-size:var(--text-meta); }
  .task-preview > div { min-width:0; overflow-wrap:anywhere; }
  .task-actions select,.role-form select,.copy-row input { font-size:var(--text-help); }
  .invitation-panel > p { font-size:var(--text-ui); }
  .hero h2 { font-size:clamp(1.625rem,2.3vw,2rem); line-height:1.25; letter-spacing:-.035em; }
  .hero p:not(.eyebrow),.hero .hero-copy p:not(.eyebrow) { font-size:var(--text-ui); line-height:1.6; }
  .stats article div > span { font-size:var(--text-meta); line-height:1.5; min-height:0; }
  .stats article > div { min-width:0; overflow-wrap:anywhere; }
  .stats strong { font-size:1.75rem; line-height:1.3; font-variant-numeric:tabular-nums; }
  .event-card h3 { font-size:1.0625rem; line-height:1.4; }
  .event-card p { font-size:var(--text-help); margin-bottom:16px; }
  .card-bottom,.date-stamp span { font-size:var(--text-meta); }
  .card-bottom > span:first-child { min-width:0; overflow-wrap:anywhere; }
  .progress-panel p:last-child { font-size:var(--text-help); }
  .progress-panel h2 { font-size:1.375rem; }
  .finance-stats span { font-size:var(--text-help); line-height:1.5; }
  .finance-stats strong,.drink-totals strong,.finance-overview strong { font-size:clamp(1.375rem,2vw,1.75rem); line-height:1.3; font-variant-numeric:tabular-nums; }
  .budget-panel h2 { font-size:clamp(1.375rem,2vw,1.75rem); line-height:1.3; }
  .budget-panel p { font-size:var(--text-ui); }
  .cost-amount,.cost-preview output { font-variant-numeric:tabular-nums; }
  .cost-preview small { font-size:var(--text-help); }
  table { font-size:var(--text-help); line-height:1.5; }
  th { font-weight:600; }
  td { font-variant-numeric:tabular-nums; }
  .schedule-time { font-size:var(--text-ui); }
  .filter-actions,.department-filters label { font-size:var(--text-help); }
  .gantt-label strong { font-size:var(--text-help); line-height:1.4; }
  .gantt-label small,.gantt-header { font-size:var(--text-meta); }
  .gantt-bar-title { font-size:var(--text-meta); }
  .gantt-purchase-tooltip { font-size:var(--text-help); }
  .countdown-date { font-size:var(--text-help); }
  .countdown-grid span { font-size:var(--text-meta); }
  .countdown-grid strong { font-size:1.5rem; font-variant-numeric:tabular-nums; }
  .news-feed li { font-size:var(--text-help); line-height:1.55; }
  .news-feed time { font-size:var(--text-meta); }
  .news-feed li > div { min-width:0; overflow-wrap:anywhere; }
  .drink-toolbar label,.drink-recipe-bottom label,.shot-row label,
  .crate-choice,.drink-shopping .crate-choice,.drink-shopping .crate-field,
  .drink-shopping .single-deposit { font-size:var(--text-help); line-height:1.5; }
  .drink-recipe p { font-size:var(--text-help); line-height:1.65; margin:12px 0; }
  .drink-recipe h3 { font-size:1rem; line-height:1.4; }
  .drink-recipe p.help { font-size:var(--text-help); }
  .drink-shopping .shopping-price input,.drink-shopping .shopping-deposit input,
  .drink-shopping .crate-choice select { font-size:var(--text-ui); }
  .drink-shopping td::before,.shopping-progress,.shopping-edit-toggle,
  .drink-shopping [data-location-summary] { font-size:var(--text-help); line-height:1.55; }
  .drink-settings > summary,.drink-group > summary,.drink-locations > summary,
  .drink-sources > summary,[data-demand-choice] > summary { font-size:1rem; line-height:1.5; }
  details.panel[open] > summary { margin-bottom:12px; }
  .drink-sources { font-size:var(--text-help); line-height:1.65; }
  .autosave-status { font-size:var(--text-help); padding:10px 12px; }
  .purchase-dialog .field label { font-size:var(--text-ui); }
  .purchase-dialog .field input,.purchase-dialog .field select { font-size:var(--text-ui); }
  .purchase-dialog .button,.purchase-secondary-actions .button { font-size:var(--text-help); }
  .purchase-metric > span,.purchase-form-footer > span,.purchase-release,
  .purchase-receipt-price span,.purchase-status,.purchase-price-pending { font-size:var(--text-meta); line-height:1.5; }
  .purchase-section-title { font-size:var(--text-ui); }
  .purchase-section-title small,.purchase-dialog-heading p,
  .purchase-dialog-feedback [data-inline-purchase-status],.purchase-note,.purchase-note strong,
  .purchase-price-editor > summary,.purchase-empty p,.purchase-allocation-summary > span { font-size:var(--text-help); line-height:1.5; }
  .purchase-receipt-heading h4 { font-size:var(--text-ui); line-height:1.5; }
  .purchase-history-heading h3 { font-size:1rem; }
  .purchase-person { overflow-wrap:anywhere; }
  .purchase-allocation-summary strong { font-variant-numeric:tabular-nums; }
  .empty-state p,.purchase-empty strong { font-size:var(--text-ui); }
  .auth-story h1 { font-size:clamp(2rem,3.8vw,3.25rem); line-height:1.15; letter-spacing:-.04em; }
  .auth-inner h2 { font-size:1.875rem; line-height:1.25; letter-spacing:-.035em; }
  .auth-story p:not(.eyebrow),.auth-inner > .muted,.auth-switch { font-size:var(--text-ui); line-height:1.6; }
  .auth-story small { font-size:var(--text-help); }
  footer { font-size:var(--text-meta); line-height:1.5; }
  footer span { font-size:var(--text-help); font-weight:700; }

  /* Trim excessive vertical space while keeping the existing containers. */
  .topbar { height:64px; margin-bottom:24px; font-size:var(--text-help); }
  .page-heading { margin-bottom:24px; }
  .back-link { margin-bottom:16px; }
  .panel { padding:24px; }
  .stats { margin-bottom:24px; }
  .dashboard-tasks { margin-top:24px; }
  .section-heading { margin-bottom:16px; }
  .empty-state { padding:28px 24px; }
  .field { margin-bottom:18px; }
  .form-actions { margin-top:20px; }
  .auth-story > .brand { margin-bottom:48px; }
  .auth-story small { margin-top:64px; }
  .auth-inner > .muted { margin-bottom:24px; }
  .auth-switch { margin-top:20px; }
  .budget-panel { padding:24px; margin:24px 0; }
  .table-scroll,.timeline-panel { margin-bottom:24px; }
  .drink-settings,.drink-group,.drink-sources { margin-bottom:16px; }
  .drink-settings-grid { margin-top:16px; }
  .drink-export-tools { margin:20px 0; }
  .drink-toolbar { margin-top:24px; }
  .shopping-group-title { margin-top:24px; }
  .countdown-grid { margin:18px 0 12px; }
  .news-panel .section-heading { margin-bottom:10px; }
  .news-panel .help { margin-bottom:12px; }
  .news-feed:empty { margin:0; }
  footer { margin-top:32px; padding:20px 0; }
}

@media screen and (min-width:761px) {
  .auth-story { padding:40px clamp(28px,4vw,56px); }
  .auth-form { padding:36px; }
  .sidebar-caption { margin-bottom:32px; }
}

@media screen and (max-width:760px) {
  .topbar { height:48px; margin-bottom:20px; font-size:var(--text-meta); }
  .nav-link { font-size:var(--text-help); }
  .sidebar-caption { font-size:.625rem; }
  .page-heading,.event-start { margin-bottom:20px; }
  .panel,.form-panel { padding:20px; }
  .hero { padding:24px; }
  .hero h2 { font-size:1.625rem; }
  .event-card h3 { font-size:1rem; }
  .stats strong { font-size:1.5rem; }
  .stats article div > span { font-size:var(--text-meta); min-height:0; }
  .stats article { gap:8px; }
  .section-heading > .button { font-size:var(--text-help); }
  .field label { font-size:var(--text-ui); }
  input:not([type=hidden]):not([type=checkbox]):not([type=radio]):not([type=range]),select,textarea,
  .drink-shopping .shopping-price input,.drink-shopping .shopping-deposit input,
  .drink-shopping .crate-choice select,.purchase-dialog .field input,.purchase-dialog .field select,
  .task-actions select,.role-form select,.copy-row input { font-size:1rem; }
  .auth-story { padding:24px; }
  .auth-story > .brand { margin-bottom:24px; }
  .auth-story h1 { font-size:2rem; line-height:1.2; }
  .auth-story p:not(.eyebrow) { font-size:var(--text-ui); }
  .auth-story small { margin-top:32px; }
  .auth-form { padding:28px 24px; }
  .auth-inner h2 { font-size:1.625rem; }
  .empty-state { padding:24px 18px; }
  .budget-panel { padding:20px; }
  .timeline-panel { padding:18px; }
  .purchase-section-title { font-size:var(--text-ui); }
  .purchase-section-title small { font-size:var(--text-meta); }
}

/* Event navigation spans the content and sidebar, above both columns. */
@media screen {
  .event-tabs {
    padding:12px;
    gap:12px;
    margin:0 0 24px;
    border:1px solid var(--line);
    border-radius:14px;
    background:#fff;
    box-shadow:0 2px 8px #14223805;
    flex-wrap:wrap;
    overflow:visible;
    white-space:normal;
    font-size:1rem;
  }
  .event-tabs > a {
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-height:48px;
    padding:13px 22px;
    border:1px solid transparent;
    border-radius:9px;
    color:#142238;
    font-weight:600;
    line-height:1.5;
    white-space:normal;
    transition:background .15s,color .15s;
  }
  .event-tabs > a:hover { background:#e9edf3; color:#142238; }
  .event-tabs > a.selected,.event-tabs > a[aria-current=page] {
    background:#183765;
    color:white;
  }
  .event-tabs > a:focus-visible { outline:3px solid #ef8a28; outline-offset:2px; }
}
@media screen and (max-width:760px) {
  .event-tabs { padding:10px; gap:10px; margin-bottom:20px; font-size:var(--text-ui); }
  .event-tabs > a { min-height:44px; padding:12px 16px; }
}
@media(prefers-reduced-motion:reduce) { .event-tabs > a { transition:none; } }
