/* SRT Grids v21 - modern operations workspace */
@media screen {
  :root {
    --ink: #151a2d;
    --purple: #39345f;
    --purple-2: #565074;
    --green: #00ac73;
    --green-2: #00885b;
    --paper: #f6f8fa;
    --panel: #ffffff;
    --panel-2: #f8fafb;
    --line: #e3e8ed;
    --line-2: #ccd5df;
    --muted: #687386;
    --danger: #c83d3d;
    --amber: #a96f12;
    --shadow-soft: 0 1px 2px rgba(21, 26, 45, .04), 0 10px 28px rgba(21, 26, 45, .045);
    --focus: 0 0 0 3px rgba(0, 172, 115, .16);
  }

  html,
  body {
    background: var(--paper);
    color: var(--ink);
    font-family: Inter, "Segoe UI", Arial, sans-serif;
  }

  body {
    overflow-x: hidden;
  }

  .shell {
    min-height: 100vh;
    grid-template-columns: 248px minmax(0, 1fr);
    background: var(--paper);
  }

  .sidebar {
    width: auto;
    padding: 24px 18px;
    border-right: 1px solid var(--line);
    background: #fff;
    box-shadow: none;
  }

  .brand-block {
    padding: 2px 10px 25px;
    border-bottom: 1px solid #edf0f3;
  }

  .brand-block img {
    width: 176px;
  }

  .nav {
    gap: 5px;
    margin-top: 18px;
    padding: 0;
  }

  .nav button {
    min-height: 46px;
    justify-content: flex-start;
    gap: 12px;
    padding: 0 13px;
    border: 1px solid transparent;
    border-radius: 7px;
    color: #525d70;
    font-size: 14px;
    font-weight: 700;
  }

  .nav button svg {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    color: #7a8494;
  }

  .nav button:hover {
    border-color: #e7ebef;
    background: #f8fafb;
    color: var(--ink);
  }

  .nav button.active {
    border-color: #ccece0;
    background: #edf8f4;
    color: #075f43;
    box-shadow: none;
  }

  .nav button.active svg {
    color: var(--green-2);
  }

  .main {
    min-width: 0;
    grid-template-rows: auto auto minmax(0, 1fr);
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    min-height: 70px;
    padding: 10px 26px;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, .96);
    backdrop-filter: blur(16px);
  }

  .topbar-context {
    display: none;
  }

  .top-actions {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(130px, .45fr) minmax(220px, 1fr) minmax(320px, 1.5fr) auto auto auto;
    align-items: end;
    justify-content: stretch;
    gap: 10px;
  }

  .top-select,
  .top-select.tour-select,
  .top-select.event-select,
  .top-select.season-select {
    width: auto;
    min-width: 0;
    gap: 6px;
    color: #707b8e;
    font-size: 10px;
    font-weight: 800;
    text-transform: none;
  }

  .top-select select {
    width: 100%;
    min-width: 0;
    min-height: 42px;
    padding: 0 36px 0 12px;
    border: 1px solid #d9e0e7;
    border-radius: 7px;
    background-color: #fff;
    color: #24283d;
    font-size: 13px;
    font-weight: 650;
  }

  .sync-status,
  .user-pill {
    min-height: 38px;
    align-self: end;
    border-radius: 7px;
    font-size: 11px;
  }

  .sync-status {
    border-color: #bce8d8;
    background: #edfaf5;
    color: #087a57;
  }

  .user-pill {
    max-width: 150px;
    overflow: hidden;
    border-color: #e0e5eb;
    background: #fff;
    color: #5f697a;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .context-tabs {
    min-height: 48px;
    gap: 18px;
    padding: 0 30px;
    border-bottom: 1px solid var(--line);
    background: #fff;
  }

  .context-tabs button {
    min-height: 48px;
    padding: 0 2px;
    border-bottom-width: 2px;
    color: #6d7789;
    font-size: 13px;
    font-weight: 700;
  }

  .context-tabs button.active {
    border-bottom-color: var(--green);
    color: var(--ink);
  }

  .workspace {
    width: 100%;
    max-width: 1720px;
    margin: 0 auto;
    padding: 30px 34px 56px;
  }

  .section {
    min-width: 0;
  }

  .page-heading,
  .hero-board {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin: 0 0 22px;
  }

  .page-heading h2,
  .hero-board h2,
  .archive-hero h2 {
    max-width: 760px;
    margin: 0;
    color: var(--ink);
    font-size: 29px;
    font-weight: 760;
    line-height: 1.15;
  }

  .eyebrow {
    display: block;
    margin-bottom: 6px;
    color: var(--green-2);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
  }

  .page-actions,
  .toolbar-right,
  .row-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
  }

  .button,
  .file-button {
    min-height: 40px;
    padding: 0 14px;
    border: 1px solid #d8e0e7;
    border-radius: 7px;
    background: #fff;
    color: #293044;
    box-shadow: none;
    font-size: 12px;
    font-weight: 750;
    text-transform: none;
  }

  .button:hover,
  .file-button:hover,
  .button.active {
    border-color: #aebac6;
    background: #f8fafb;
  }

  .button.primary,
  .file-button.primary {
    border-color: var(--green-2);
    background: var(--green-2);
    color: #fff;
  }

  .button.primary:hover,
  .file-button.primary:hover {
    border-color: #006f4c;
    background: #006f4c;
  }

  .button.danger {
    border-color: #efcaca;
    background: #fff;
    color: #b63333;
  }

  .button.danger:hover {
    border-color: #dca8a8;
    background: #fff5f5;
  }

  .button:focus-visible,
  .file-button:focus-within,
  input:focus,
  select:focus,
  textarea:focus {
    outline: 0;
    box-shadow: var(--focus);
  }

  .icon-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
  }

  .icon-label svg,
  .icon-only svg {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
  }

  .icon-only {
    width: 40px;
    padding: 0;
    display: inline-grid;
    place-items: center;
  }

  input,
  select,
  textarea {
    border: 1px solid #d8e0e7;
    border-radius: 7px;
    background: #fff;
    color: var(--ink);
  }

  label {
    color: #616c7e;
    font-size: 11px;
    font-weight: 750;
  }

  .summary-rail {
    display: grid;
    grid-template-columns: repeat(3, minmax(120px, 170px)) minmax(220px, 1fr);
    align-items: stretch;
    margin: 0 0 30px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
  }

  .summary-rail > div {
    min-width: 0;
    padding: 15px 18px;
    border-right: 1px solid var(--line);
  }

  .summary-rail > div > strong,
  .summary-rail > div > span {
    display: block;
  }

  .summary-rail > div > strong {
    margin-bottom: 2px;
    color: #22273b;
    font-size: 22px;
    line-height: 1;
  }

  .summary-rail > div > span {
    color: #788294;
    font-size: 11px;
    font-weight: 700;
  }

  .summary-rail .summary-links {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    border-right: 0;
  }

  .summary-links button {
    min-height: 34px;
    padding: 0 12px;
    border: 0;
    border-radius: 6px;
    background: #f1f4f6;
    color: #4c5769;
    font-size: 11px;
    font-weight: 750;
  }

  .summary-links button:hover {
    background: #e8edef;
    color: var(--ink);
  }

  .fair-list-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    margin-bottom: 10px;
  }

  .fair-list-head h3 {
    margin: 0 0 3px;
    font-size: 18px;
  }

  .fair-list-head span {
    color: var(--muted);
    font-size: 12px;
  }

  .event-board.fair-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
  }

  .fair-list .event-card {
    position: relative;
    display: grid;
    grid-template-columns: minmax(260px, 1.5fr) 170px minmax(260px, .9fr) auto;
    align-items: center;
    gap: 20px;
    min-width: 0;
    padding: 15px 16px;
    border: 0;
    border-bottom: 1px solid #e9edf1;
    border-radius: 0;
    background: #fff;
    box-shadow: none;
  }

  .fair-list .event-card:last-child {
    border-bottom: 0;
  }

  .fair-list .event-card.active {
    background: #f2faf7;
    box-shadow: inset 3px 0 0 var(--green);
  }

  .fair-list .event-card:hover {
    background: #f8fafb;
    transform: none;
  }

  .fair-identity {
    min-width: 0;
    display: grid;
    gap: 3px;
  }

  .fair-identity .fair-date {
    color: var(--green-2);
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
  }

  .fair-identity strong {
    overflow: hidden;
    color: var(--ink);
    font-size: 15px;
    font-weight: 760;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .fair-identity span:last-child {
    overflow: hidden;
    color: var(--muted);
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

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

  .fair-metrics > div {
    min-width: 0;
    padding: 8px 10px;
    border-left: 2px solid #dce3e8;
  }

  .fair-metrics > div.needs-attention {
    border-left-color: #d69a30;
  }

  .fair-metrics > div.complete {
    border-left-color: var(--green);
  }

  .fair-metrics strong,
  .fair-metrics span {
    display: block;
  }

  .fair-metrics strong {
    font-size: 17px;
  }

  .fair-metrics span {
    margin-top: 1px;
    color: #7a8493;
    font-size: 9px;
    font-weight: 750;
    text-transform: uppercase;
  }

  .fair-quick-settings.fair-controls {
    display: grid;
    grid-template-columns: 70px minmax(170px, 1fr);
    align-items: end;
    gap: 8px;
    min-width: 0;
    padding: 0;
    border: 0;
  }

  .fair-controls label {
    display: grid;
    gap: 5px;
  }

  .fair-controls select {
    min-height: 38px;
  }

  .fair-qr-control {
    min-width: 0;
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    align-items: center;
    gap: 7px;
  }

  .fair-logo-control {
    min-width: 0;
    display: grid;
    grid-column: 2;
    grid-template-columns: 38px minmax(0, 1fr);
    align-items: center;
    gap: 7px;
  }

  .fair-qr-thumb,
  .fair-qr-empty,
  .fair-logo-thumb,
  .fair-logo-empty {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border: 1px solid #dbe2e8;
    border-radius: 6px;
    background: #f7f9fa;
    object-fit: contain;
  }

  .fair-qr-empty svg,
  .fair-logo-empty svg {
    width: 17px;
    color: #8a94a3;
  }

  .fair-qr-control .file-button {
    min-width: 0;
    width: 100%;
    min-height: 38px;
  }

  .fair-logo-control .file-button {
    min-width: 0;
    width: 100%;
    min-height: 38px;
  }

  .fair-actions {
    flex-wrap: nowrap;
  }

  .configuration-drawer,
  .validation-drawer {
    margin-top: 18px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
  }

  .configuration-drawer > summary,
  .validation-drawer > summary {
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 0 16px;
    color: #424b5d;
    cursor: pointer;
    font-size: 12px;
    font-weight: 750;
    list-style: none;
  }

  .configuration-drawer > summary::-webkit-details-marker,
  .validation-drawer > summary::-webkit-details-marker {
    display: none;
  }

  .configuration-drawer > summary span,
  .validation-drawer > summary span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
  }

  .configuration-drawer > summary svg,
  .validation-drawer > summary svg {
    width: 16px;
    height: 16px;
  }

  .configuration-drawer[open] > summary,
  .validation-drawer[open] > summary {
    border-bottom: 1px solid var(--line);
  }

  .configuration-drawer[open] > summary > svg:last-child,
  .validation-drawer[open] > summary > svg:last-child {
    transform: rotate(180deg);
  }

  .configuration-content {
    padding: 18px;
  }

  .configuration-content.split {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
  }

  .settings-group h3 {
    margin: 0 0 14px;
    font-size: 14px;
  }

  .danger-zone {
    display: flex;
    justify-content: flex-end;
    padding: 0 18px 18px;
  }

  .grid-page-heading {
    align-items: flex-end;
  }

  .grid-page-heading h2 {
    max-width: 900px;
    font-size: 23px;
  }

  .grid-print-settings {
    margin: 0 0 14px;
  }

  .grid-print-settings .configuration-content {
    display: grid;
    grid-template-columns: 1fr 1.6fr .8fr .7fr;
    gap: 12px;
  }

  .grid-print-settings .wide {
    grid-column: span 2;
  }

  .print-logo-setting {
    display: grid;
    gap: 7px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
  }

  .print-logo-setting > div {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
  }

  .print-logo-setting img {
    width: 124px;
    height: 42px;
    padding: 5px 8px;
    object-fit: contain;
    background: #fff;
    border: 1px solid var(--line);
  }

  .validation-drawer {
    margin: 0 0 14px;
    border-color: #ecd8ac;
    background: #fffdf8;
  }

  .validation-state.warn {
    color: #835712;
  }

  .validation-state.bad {
    color: #ac3030;
  }

  .validation-content {
    display: grid;
    gap: 0;
    max-height: 280px;
    padding: 0 16px;
    overflow: auto;
  }

  .validation-item {
    display: grid;
    grid-template-columns: minmax(170px, .7fr) minmax(220px, 1.3fr) auto;
    align-items: center;
    gap: 14px;
    padding: 10px 0;
    border-bottom: 1px solid #efe7d8;
    font-size: 11px;
  }

  .validation-item:last-child {
    border-bottom: 0;
  }

  .grid-stage {
    position: relative;
    min-height: 690px;
    margin-top: 0;
    overflow: hidden;
    border: 1px solid #d9e0e7;
    border-radius: 8px;
    background: #e9edf1;
    box-shadow: none;
  }

  .grid-stage-toolbar {
    min-height: 58px;
    padding: 9px 12px 9px 16px;
    border-bottom: 1px solid #d9e0e7;
    background: #fff;
  }

  .grid-stage-toolbar > div:first-child {
    gap: 2px;
  }

  .grid-stage-toolbar strong {
    font-size: 13px;
  }

  .grid-stage-toolbar span {
    color: #778193;
    font-size: 10px;
  }

  .grid-stage-toolbar .button.active {
    border-color: #b9decf;
    background: #edf8f4;
    color: #087554;
  }

  .grid-stage-scroll {
    padding: 22px;
    background: #e9edf1;
  }

  .grid-stage-scroll .srt-grid-card {
    margin: 0 auto;
    box-shadow: 0 18px 44px rgba(28, 35, 49, .12);
  }

  .grid-stage-scroll .major-head .major-icon {
    width: 34px;
    height: 34px;
    display: block;
    margin: 0 auto 5px;
    object-fit: contain;
  }

  .grid-stage-scroll .major-head,
  .grid-stage-scroll .sub-head {
    overflow: hidden;
  }

  .grid-archive,
  .grid-rows-drawer {
    position: absolute;
    top: 58px;
    right: 0;
    bottom: 0;
    z-index: 9;
    width: min(520px, 100%);
    padding: 16px;
    border-left: 1px solid #d9e0e7;
    background: #fff;
    box-shadow: -18px 0 44px rgba(21, 26, 45, .12);
  }

  .grid-archive {
    display: grid;
    grid-template-rows: auto auto auto auto minmax(0, 1fr);
    gap: 12px;
  }

  .grid-add-provider-toggle {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr);
    align-items: start;
    gap: 9px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fafbfc;
    cursor: pointer;
  }

  .grid-add-provider-toggle.active {
    border-color: #8bd1ba;
    background: #edf8f4;
  }

  .grid-add-provider-toggle input {
    width: 18px;
    height: 18px;
    margin: 1px 0 0;
    accent-color: var(--green);
  }

  .grid-add-provider-toggle > span {
    min-width: 0;
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    align-items: center;
    gap: 2px 6px;
  }

  .grid-add-provider-toggle svg {
    width: 16px;
    height: 16px;
    color: var(--muted);
  }

  .grid-add-provider-toggle strong {
    font-size: 12px;
  }

  .grid-add-provider-toggle small {
    grid-column: 2;
    color: var(--muted);
    font-size: 10px;
    line-height: 1.35;
  }

  .grid-add-provider-toggle.active svg,
  .grid-add-provider-toggle.active strong {
    color: var(--green-2);
  }

  .grid-rows-drawer {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 12px;
  }

  .grid-row-editor-list {
    min-height: 0;
    overflow-y: auto;
  }

  .grid-row-editor {
    display: grid;
    grid-template-columns: 58px minmax(150px, 1.2fr) minmax(100px, .7fr) minmax(150px, 1fr) 40px;
    align-items: end;
    gap: 8px;
    padding: 11px 0;
    border-bottom: 1px solid #edf0f3;
  }

  .grid-row-editor label,
  .row-source-field {
    min-width: 0;
    display: grid;
    gap: 5px;
  }

  .grid-row-editor label > span,
  .row-source-field > span {
    color: #788294;
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
  }

  .grid-row-editor input,
  .grid-row-editor select {
    width: 100%;
    min-width: 0;
    min-height: 36px;
    font-size: 11px;
  }

  .grid-row-editor .source-control {
    width: 100%;
  }

  .grid-row-editor .source-control .pill {
    display: none;
  }

  .panel,
  .season-card,
  .tour-tile,
  .stat,
  .archive-list-row,
  .archive-detail-panel {
    border-color: var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow-soft);
  }

  .stat-grid {
    gap: 10px;
  }

  .stat {
    min-height: 92px;
    padding: 15px 17px;
    border-left: 0;
  }

  .stat strong {
    font-size: 26px;
  }

  .panel-head {
    min-height: 52px;
    padding: 0 16px;
  }

  .panel-head h3 {
    font-size: 14px;
  }

  .data-table th {
    background: #f7f9fa;
    color: #657083;
    font-size: 10px;
  }

  .data-table td {
    border-color: #edf0f3;
  }

  .login-screen {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: none;
    place-items: center;
    padding: 24px;
    background: #f3f6f7;
  }

  .login-screen::before {
    content: "";
    position: fixed;
    inset: 0 0 auto;
    height: 6px;
    background: var(--green);
  }

  .login-screen.active {
    display: grid;
  }

  .login-card {
    width: min(420px, 100%);
    display: grid;
    gap: 18px;
    padding: 38px;
    border: 1px solid #dfe5e9;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(24, 31, 43, .1);
  }

  .login-card img {
    width: 230px;
    max-width: 80%;
    margin: 0 auto 10px;
  }

  .login-card h1 {
    display: none;
  }

  .login-card label {
    display: grid;
    gap: 7px;
  }

  .login-card input,
  .login-card .button {
    min-height: 46px;
  }

  .login-card .button.primary {
    width: 100%;
  }
}

/* v24: stable full-screen grid editing */
@media screen {
  .grid-stage-identity {
    display: flex !important;
    align-items: center;
    gap: 10px !important;
  }

  .grid-stage-title {
    display: grid;
    gap: 2px;
  }

  .grid-toolbar-qr {
    display: grid;
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    place-items: center;
    overflow: hidden;
    border: 1px solid #d9e0e7;
    border-radius: 4px;
    background: #fff;
    color: #7b8394 !important;
  }

  .grid-toolbar-qr img {
    width: 100%;
    height: 100%;
    object-fit: contain;
  }

  .grid-toolbar-qr svg {
    width: 20px;
    height: 20px;
  }

  .grid-stage-scroll .grid-table .table-col,
  .grid-stage-scroll .grid-table .name-col,
  .grid-stage-scroll .grid-table .table-cell,
  .grid-stage-scroll .grid-table .name-cell {
    position: sticky;
    background: #fff;
  }

  .grid-stage-scroll .grid-table .table-col,
  .grid-stage-scroll .grid-table .table-cell {
    left: 0;
    z-index: 4;
  }

  .grid-stage-scroll .grid-table .name-col,
  .grid-stage-scroll .grid-table .name-cell {
    left: 36px;
    z-index: 4;
    box-shadow: 3px 0 0 rgba(23, 21, 50, 0.12);
  }

  .grid-stage-scroll .grid-table .table-col,
  .grid-stage-scroll .grid-table .name-col {
    z-index: 6;
  }
}

@media screen and (max-width: 1280px) {
  .shell {
    grid-template-columns: 210px minmax(0, 1fr);
  }

  .sidebar {
    padding-inline: 13px;
  }

  .brand-block img {
    width: 156px;
  }

  .topbar {
    padding-inline: 18px;
  }

  .top-actions {
    grid-template-columns: minmax(110px, .4fr) minmax(190px, .8fr) minmax(260px, 1.3fr) auto auto;
  }

  .top-actions .user-pill {
    display: none;
  }

  .workspace {
    padding: 26px 24px 48px;
  }

  .fair-list .event-card {
    grid-template-columns: minmax(240px, 1.3fr) 150px minmax(240px, .9fr) auto;
    gap: 14px;
  }
}

@media screen and (max-width: 1020px) {
  .shell {
    display: block;
  }

  .sidebar {
    position: relative;
    width: 100%;
    height: auto;
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 10px 18px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    overflow: visible;
  }

  .brand-block {
    flex: 0 0 auto;
    padding: 0;
    border: 0;
  }

  .brand-block img {
    width: 145px;
  }

  .nav {
    flex: 1 1 auto;
    display: flex;
    justify-content: flex-end;
    gap: 4px;
    margin: 0;
    overflow-x: auto;
  }

  .nav button {
    width: auto;
    flex: 0 0 auto;
    min-height: 38px;
    padding: 0 10px;
  }

  .topbar {
    position: relative;
  }

  .fair-list .event-card {
    grid-template-columns: minmax(260px, 1fr) 150px minmax(250px, .9fr);
  }

  .fair-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
    padding-top: 10px;
    border-top: 1px solid #edf0f3;
  }
}

@media screen and (max-width: 720px) {
  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  .sidebar {
    display: block;
    padding: 12px 12px 0;
  }

  .brand-block {
    padding: 0 4px 10px;
  }

  .brand-block img {
    width: 138px;
  }

  .nav {
    justify-content: flex-start;
    padding-bottom: 8px;
  }

  .nav button {
    min-height: 38px;
    gap: 7px;
    font-size: 11px;
  }

  .nav button svg {
    width: 15px;
    height: 15px;
  }

  .topbar {
    padding: 10px 12px 12px;
  }

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

  .top-select,
  .top-select.tour-select,
  .top-select.event-select,
  .top-select.season-select {
    width: 100%;
    min-width: 0;
  }

  .top-select.event-select,
  .top-actions .sync-status {
    grid-column: 1 / -1;
  }

  .top-actions .user-pill {
    display: none;
  }

  .top-actions > .button {
    width: 100%;
  }

  .context-tabs {
    width: 100%;
    display: flex !important;
    gap: 16px;
    padding: 0 12px;
    overflow-x: auto;
  }

  .context-tabs button {
    width: auto;
    min-width: max-content;
    padding: 0;
    white-space: nowrap;
  }

  .workspace {
    padding: 20px 12px 38px;
  }

  .page-heading,
  .hero-board {
    display: grid;
    gap: 15px;
    margin-bottom: 18px;
  }

  .page-heading h2,
  .hero-board h2,
  .archive-hero h2 {
    font-size: 23px;
  }

  .page-actions,
  .hero-board .toolbar-right {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .page-actions > *,
  .hero-board .toolbar-right > * {
    width: 100%;
  }

  .summary-rail {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .summary-rail > div {
    padding: 13px 10px;
  }

  .summary-rail > div:nth-child(3) {
    border-right: 0;
  }

  .summary-rail .summary-links {
    grid-column: 1 / -1;
    justify-content: stretch;
    padding: 8px;
    border-top: 1px solid var(--line);
  }

  .summary-links button {
    flex: 1 1 0;
  }

  .fair-list-head span {
    display: none;
  }

  .fair-list .event-card {
    grid-template-columns: 1fr;
    gap: 13px;
    padding: 16px;
  }

  .fair-identity strong,
  .fair-identity span:last-child {
    white-space: normal;
  }

  .fair-metrics {
    max-width: 240px;
  }

  .fair-quick-settings.fair-controls {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  .fair-actions {
    grid-column: auto;
    display: grid;
    grid-template-columns: 1fr auto;
  }

  .fair-actions .button.primary {
    width: 100%;
  }

  .configuration-content.split,
  .grid-print-settings .configuration-content {
    grid-template-columns: 1fr;
  }

  .grid-print-settings .wide {
    grid-column: auto;
  }

  .print-logo-setting > div {
    flex-wrap: wrap;
  }

  .validation-item {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .grid-page-heading .page-actions {
    grid-template-columns: auto 1fr;
  }

  .grid-stage {
    min-height: 72vh;
  }

  .grid-stage-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .grid-stage-toolbar .row-actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .grid-stage-toolbar .button {
    width: 100%;
    min-width: 0;
    padding-inline: 8px;
  }

  .grid-stage-toolbar .button span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .grid-stage-scroll {
    padding: 10px;
  }

  .grid-archive,
  .grid-rows-drawer {
    top: 104px;
    width: 100%;
    border-left: 0;
  }

  .grid-row-editor {
    grid-template-columns: 54px minmax(0, 1fr) 40px;
  }

  .grid-row-editor > label:nth-of-type(3),
  .grid-row-editor .row-source-field {
    grid-column: 1 / -1;
  }

  .login-card {
    padding: 28px 22px;
  }
}

/* v29: persistent multi-select program editor */
@media screen {
  .grid-archive-row[hidden],
  .grid-row-editor[hidden] {
    display: none !important;
  }

  .archive-program-actions {
    position: sticky;
    top: 0;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, .98);
  }

  .archive-program-actions > span {
    min-width: 180px;
    flex: 1 1 auto;
    display: grid;
    gap: 2px;
  }

  .archive-program-actions > span strong {
    font-size: 12px;
  }

  .archive-program-actions > span small {
    color: var(--muted);
    font-size: 10px;
  }

  .archive-program-actions + .archive-category-grid {
    padding-top: 10px;
  }

  .archive-program-editor .category-option::before {
    content: "";
    width: 14px;
    height: 14px;
    flex: 0 0 14px;
    border: 1px solid #bac3cf;
    border-radius: 3px;
    background: #fff;
  }

  .archive-program-editor .category-option.active::before {
    content: "\2713";
    display: grid;
    place-items: center;
    border-color: var(--green);
    background: var(--green);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
  }
}

@media screen and (max-width: 720px) {
  .archive-program-actions {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .archive-program-actions > span {
    flex-basis: 100%;
  }

  .archive-program-actions .button {
    flex: 1 1 calc(50% - 4px);
    min-width: 0;
  }
}

/* v25: restrained grid typography */
@font-face {
  font-family: "SRT Montserrat";
  src: url("./assets/fonts/Montserrat-Regular.ttf?v=25") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "SRT Montserrat";
  src: url("./assets/fonts/Montserrat-Bold.ttf?v=25") format("truetype");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

.srt-grid-card {
  font-family: "SRT Montserrat", "Segoe UI", Arial, sans-serif;
  font-weight: 400;
}

.srt-grid-card .print-title h2,
.srt-grid-card .major-head,
.srt-grid-card .name-cell {
  font-weight: 700;
}

.srt-grid-card .grid-table .name-cell {
  color: #001f5b;
  font-size: 9px;
  line-height: 1.12;
}

.srt-grid-card .grid-table .name-cell span {
  margin-top: 3px;
  font-size: 7.4px;
  line-height: 1.15;
}

.srt-grid-card .standalone-service-head {
  height: auto;
  vertical-align: bottom;
}

.srt-grid-card .standalone-service-head > div {
  max-height: 180px;
}

.srt-grid-card .grid-table th,
.srt-grid-card .sub-head,
.srt-grid-card .name-cell span,
.srt-grid-card .print-title span,
.srt-grid-card .qr-block span,
.srt-grid-card .print-footer {
  font-weight: 400;
}

.srt-grid-card .sub-head > div {
  color: #001f5b;
  font-weight: 700;
}

/* v51: isolated Parents Day country-table layout */
.srt-grid-card .print-header.without-qr {
  grid-template-columns: minmax(0, 1fr);
}

.parents-day-grid .grid-table .country-col {
  width: 88px;
}

.parents-day-grid .grid-table .country-cell {
  padding: 6px;
  color: #001f5b;
  font-size: 8px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  vertical-align: middle;
}

.new-record-badge {
  display: inline-flex;
  align-items: center;
  width: max-content;
  margin-left: 6px;
  padding: 2px 5px;
  border: 1px solid #efc46e;
  border-radius: 4px;
  background: #fff8e9;
  color: #8a5a00;
  font-size: 9px;
  font-style: normal;
  font-weight: 700;
  line-height: 1;
  text-transform: uppercase;
}

.setting-check {
  display: flex !important;
  align-items: center;
  gap: 9px;
}

.setting-check input {
  width: 18px;
  height: 18px;
}

@media screen {
  .grid-stage-scroll .parents-day-grid .grid-table .country-col,
  .grid-stage-scroll .parents-day-grid .grid-table .country-cell {
    position: sticky;
    left: 36px;
    z-index: 4;
    background: #fff;
  }

  .grid-stage-scroll .parents-day-grid .grid-table .name-col,
  .grid-stage-scroll .parents-day-grid .grid-table .name-cell {
    left: 124px;
  }

  .grid-stage-scroll .parents-day-grid .grid-table .country-col {
    z-index: 6;
  }

  .parents-day-row-editor .grid-row-editor {
    grid-template-columns: 34px 190px minmax(250px, 1fr) minmax(300px, 1.25fr) 40px;
  }
}

/* v26: university archive records */
@media screen {
  .archive-workspace .archive-hero {
    align-items: center;
    min-height: 68px;
  }

  .archive-layout {
    grid-template-columns: minmax(400px, .95fr) minmax(620px, 1.35fr);
    gap: 12px;
  }

  .archive-directory-head,
  .archive-detail-head {
    min-height: 56px;
    padding: 11px 14px;
  }

  .archive-list-row {
    min-height: 72px;
    grid-template-columns: minmax(150px, .85fr) minmax(180px, 1.15fr) 84px;
    gap: 12px;
    padding: 10px 13px;
  }

  .archive-material-preview {
    min-width: 0;
    display: grid;
    gap: 3px;
  }

  .archive-material-preview strong {
    overflow: hidden;
    color: #30384a;
    font-size: 11px;
    font-weight: 650;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .archive-material-preview small {
    overflow: hidden;
    color: #7a8494;
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .archive-record-status {
    display: grid;
    justify-items: end;
    gap: 4px;
    text-align: right;
  }

  .archive-record-status strong {
    padding: 4px 7px;
    border-radius: 999px;
    background: #eef1f4;
    color: #5f6979;
    font-size: 9px;
    font-weight: 700;
  }

  .archive-record-status.ok strong {
    background: #e7f8f1;
    color: #087554;
  }

  .archive-record-status.warn strong {
    background: #fff3d9;
    color: #94610b;
  }

  .archive-record-status small {
    color: #7b8594;
    font-size: 9px;
  }

  .archive-detail-body {
    padding: 0;
  }

  .archive-detail-body > .form-grid {
    padding: 16px 18px;
    border-bottom: 1px solid #e6eaee;
  }

  .archive-current-material {
    padding: 17px 18px;
    border-bottom: 1px solid #dce8e3;
    background: #f5faf8;
  }

  .archive-current-head,
  .archive-current-actions,
  .archive-section-head,
  .submission-record-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
  }

  .archive-current-head > div,
  .submission-record-head > div {
    min-width: 0;
    display: grid;
    gap: 3px;
  }

  .archive-current-head small,
  .submission-record-head span,
  .archive-section-head span {
    color: #737d8d;
    font-size: 10px;
  }

  .archive-current-head h4,
  .archive-section-head h4 {
    margin: 0;
    color: #171b32;
    font-size: 15px;
  }

  .archive-current-meta,
  .submission-record-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    margin-top: 10px;
    color: #667184;
    font-size: 10px;
  }

  .archive-current-meta span:not(:last-child)::after {
    content: "";
    display: inline-block;
    width: 3px;
    height: 3px;
    margin-left: 14px;
    border-radius: 50%;
    background: #9fa8b5;
    vertical-align: middle;
  }

  .archive-current-actions {
    align-items: center;
    margin-top: 12px;
    color: #087554;
    font-size: 11px;
    font-weight: 700;
  }

  .archive-current-actions .button {
    min-height: 32px;
    padding: 0 10px;
    font-size: 10px;
  }

  .archive-submission-library {
    padding: 18px;
  }

  .archive-section-head {
    align-items: center;
    margin-bottom: 8px;
  }

  .archive-section-head > div {
    display: flex;
    align-items: baseline;
    gap: 8px;
  }

  .submission-stack {
    gap: 0;
    border-top: 1px solid #e4e8ed;
  }

  .submission-mini {
    display: block;
    min-height: 0;
    padding: 13px 2px;
    border: 0;
    border-bottom: 1px solid #e4e8ed;
    border-radius: 0;
    background: transparent;
  }

  .submission-mini.current {
    padding-left: 11px;
    border-left: 3px solid #00ad73;
    background: #f7fbf9;
  }

  .submission-record-head input {
    width: 100%;
    min-height: 30px;
    padding: 3px 6px;
    border-color: transparent;
    background: transparent;
    color: #20253b;
    font-size: 12px;
    font-weight: 700;
  }

  .submission-record-head input:hover,
  .submission-record-head input:focus {
    border-color: #cfd7df;
    background: #fff;
  }

  .submission-record-head .chips {
    flex: 0 0 auto;
  }

  .submission-record-meta span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
  }

  .submission-record-meta svg,
  .submission-material-link svg {
    width: 13px;
    height: 13px;
  }

  .submission-material-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 9px;
    color: #087554;
    font-size: 10px;
    font-weight: 700;
  }

  .submission-mini .program-audit {
    margin-top: 9px;
    border-top: 1px dashed #dce2e8;
  }

  .archive-empty-submissions {
    padding: 18px 0;
    border-top: 1px solid #e4e8ed;
    color: #7a8494;
    font-size: 11px;
  }

  .archive-change-history {
    margin-top: 12px;
    color: #566174;
    font-size: 11px;
  }

  .archive-change-history > summary {
    cursor: pointer;
  }

  .archive-change-history .history-list {
    margin-top: 8px;
  }

  .archive-program-editor {
    border-top: 1px solid #e4e8ed;
  }

  .archive-program-editor > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 15px 18px;
    cursor: pointer;
    list-style: none;
  }

  .archive-program-editor > summary::-webkit-details-marker {
    display: none;
  }

  .archive-program-editor > summary span {
    display: grid;
    gap: 2px;
  }

  .archive-program-editor > summary strong {
    color: #282d43;
    font-size: 12px;
  }

  .archive-program-editor > summary small {
    color: #778193;
    font-size: 10px;
  }

  .archive-program-editor > summary svg {
    width: 17px;
    height: 17px;
    transition: transform .16s ease;
  }

  .archive-program-editor[open] > summary svg {
    transform: rotate(180deg);
  }

  .archive-program-editor .archive-category-grid {
    padding: 0 18px 18px;
  }
}

@media screen and (max-width: 1100px) {
  .archive-list-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .archive-material-preview {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .archive-record-status {
    grid-column: 2;
    grid-row: 1;
  }
}

/* v46: compact application header, focused roster and quick grid repair */
@media screen {
  .main {
    grid-template-rows: auto minmax(0, 1fr);
  }

  .app-header {
    position: sticky;
    top: 0;
    z-index: 30;
    background: rgba(255, 255, 255, .98);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(16px);
  }

  .app-header .topbar {
    position: static;
    min-height: 62px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 18px;
    padding: 8px 28px;
    border-bottom: 0;
    background: transparent;
    backdrop-filter: none;
  }

  .topbar-brand {
    min-width: 142px;
    display: flex;
    align-items: center;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
  }

  .topbar-brand:focus-visible {
    outline: 0;
    border-radius: 5px;
    box-shadow: var(--focus);
  }

  .topbar-brand img {
    width: 142px;
    height: auto;
    display: block;
  }

  .app-header .topnav {
    justify-self: start;
  }

  .account-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    min-width: 0;
  }

  .account-actions .sync-status,
  .account-actions .user-pill {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 13px;
  }

  .account-actions .button {
    min-height: 40px;
  }

  .workspace-navigation {
    min-height: 58px;
    display: flex;
    align-items: flex-end;
    gap: 22px;
    padding: 7px 28px 0;
    border-top: 1px solid #eef1f4;
    background: #fff;
  }

  .context-selectors {
    flex: 1 1 auto;
    min-width: 0;
    display: grid;
    grid-template-columns: 110px minmax(210px, 310px) minmax(320px, 520px);
    align-items: end;
    gap: 9px;
    padding-bottom: 7px;
  }

  .context-selectors .top-select,
  .context-selectors .top-select.season-select,
  .context-selectors .top-select.tour-select,
  .context-selectors .top-select.event-select {
    width: 100%;
  }

  .workspace-navigation > .context-tabs {
    flex: 0 0 auto;
    min-height: 50px;
    display: flex;
    align-items: flex-end;
    gap: 20px;
    padding: 0;
    border: 0;
    background: transparent;
  }

  .workspace-navigation > .context-tabs button {
    min-height: 50px;
    padding: 0 1px;
    white-space: nowrap;
  }

  .grid-validation-region {
    position: relative;
    display: flex;
    justify-content: flex-start;
    margin: 0 0 14px;
  }

  .grid-readiness-button,
  .grid-readiness-ready {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    gap: 24px;
    padding: 0 14px;
    border-radius: 7px;
    font-size: 12px;
  }

  .grid-readiness-button {
    justify-content: space-between;
    border: 1px solid #ebc5bb;
    background: #fff8f5;
    color: #a4322d;
    cursor: pointer;
  }

  .grid-readiness-button.warn {
    border-color: #ecd8ac;
    background: #fffaf0;
    color: #865a13;
  }

  .grid-readiness-button > span,
  .grid-readiness-ready {
    display: inline-flex;
    align-items: center;
    gap: 7px;
  }

  .grid-readiness-button svg,
  .grid-readiness-ready svg {
    width: 16px;
    height: 16px;
  }

  .grid-readiness-ready {
    border: 1px solid #c6eadc;
    background: #f2fbf7;
    color: #087653;
  }

  .quick-fix-backdrop {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(20, 27, 43, .42);
    backdrop-filter: blur(3px);
  }

  .quick-fix-modal {
    width: min(900px, 100%);
    max-height: min(760px, calc(100vh - 48px));
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    overflow: hidden;
    border: 1px solid var(--line-2);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 28px 80px rgba(17, 25, 40, .24);
  }

  .quick-fix-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding: 22px 24px 18px;
    border-bottom: 1px solid var(--line);
  }

  .quick-fix-head h3 {
    margin: 0;
    font-size: 22px;
  }

  .quick-fix-head p {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 13px;
  }

  .quick-fix-batch {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 11px 24px;
    border-bottom: 1px solid #eee4ce;
    background: #fffaf0;
    color: #74501a;
    font-size: 12px;
  }

  .quick-fix-list {
    overflow: auto;
    padding: 0 24px;
  }

  .quick-fix-item {
    display: grid;
    grid-template-columns: minmax(180px, .8fr) minmax(280px, 1.25fr) auto;
    align-items: center;
    gap: 16px;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
  }

  .quick-fix-item:last-child {
    border-bottom: 0;
  }

  .quick-fix-copy strong,
  .quick-fix-copy span {
    display: block;
  }

  .quick-fix-copy strong {
    font-size: 13px;
  }

  .quick-fix-copy span {
    margin-top: 4px;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.4;
  }

  .quick-fix-source .source-control {
    display: grid;
    gap: 4px;
  }

  .quick-fix-source select {
    width: 100%;
    min-width: 0;
  }

  .quick-fix-source .pill {
    display: none;
  }

  .quick-fix-duplicates {
    display: grid;
    gap: 6px;
    margin-top: 8px;
    padding: 9px;
    border: 1px solid #b9dfd2;
    border-radius: 6px;
    background: #f3fbf8;
  }

  .quick-fix-duplicates > small {
    color: var(--green-2);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
  }

  .duplicate-program-action {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--green);
    border-radius: 5px;
    background: #fff;
    color: var(--ink);
    text-align: left;
    cursor: pointer;
  }

  .duplicate-program-action:hover {
    border-color: var(--green-2);
    background: #eaf8f3;
  }

  .duplicate-program-action span {
    min-width: 0;
    font-size: 12px;
    font-weight: 650;
    line-height: 1.3;
  }

  .duplicate-program-action strong {
    min-width: 26px;
    padding: 3px 6px;
    border-radius: 4px;
    background: var(--green);
    color: #fff;
    font-size: 11px;
    text-align: center;
  }

  .quick-fix-duplicate-note {
    color: var(--muted);
    font-size: 10px;
    line-height: 1.35;
  }

  .service-provider-toggle {
    display: grid !important;
    grid-template-columns: 18px minmax(0, 1fr);
    align-items: center;
    gap: 4px 9px !important;
    margin-top: 7px;
    cursor: pointer;
  }

  .service-provider-toggle input[type="checkbox"] {
    width: 18px !important;
    min-width: 18px;
    height: 18px;
    min-height: 18px !important;
    margin: 0;
    accent-color: var(--green);
  }

  .service-provider-toggle > span {
    display: flex !important;
    align-items: center;
    gap: 6px;
    color: var(--ink) !important;
    font-size: 12px !important;
    font-weight: 650 !important;
    line-height: 1.25;
    text-transform: none !important;
  }

  .service-provider-toggle > span svg {
    width: 16px;
    height: 16px;
    color: var(--muted);
  }

  .service-provider-toggle.active > span,
  .service-provider-toggle.active > span svg {
    color: var(--green-2) !important;
  }

  .service-provider-toggle small {
    grid-column: 2;
    color: var(--muted);
    font-size: 10px;
    line-height: 1.35;
  }

  .quick-fix-source .service-provider-toggle {
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fafbfc;
  }

  .quick-fix-footer {
    min-height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 10px 24px;
    border-top: 1px solid var(--line);
    background: #fafbfc;
  }

  .quick-fix-footer span {
    min-width: 0;
    overflow: hidden;
    color: var(--muted);
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .grid-row-editor.attention {
    outline: 3px solid rgba(0, 172, 115, .25);
    outline-offset: -3px;
    background: #f1fbf7;
  }

  .tour-matrix-table th:not(:first-child):not(:nth-child(2)) {
    width: 132px;
    padding-inline: 8px;
    text-align: center;
  }

  .tour-matrix-table td:not(:first-child):not(:nth-child(2)) {
    text-align: center;
  }
}

@media screen and (max-width: 1450px) {
  .workspace-navigation {
    display: grid;
    gap: 0;
    padding-top: 8px;
  }

  .context-selectors {
    width: 100%;
    grid-template-columns: 110px minmax(220px, .8fr) minmax(320px, 1.2fr);
  }

  .workspace-navigation > .context-tabs {
    width: 100%;
  }
}

@media screen and (max-width: 760px) {
  .app-header {
    position: relative;
  }

  .app-header .topbar {
    grid-template-columns: 1fr auto;
    gap: 8px 12px;
    padding: 10px 12px;
  }

  .app-header .topnav {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    overflow-x: auto;
  }

  .account-actions .user-pill {
    display: none;
  }

  .workspace-navigation {
    padding: 8px 12px 0;
  }

  .context-selectors {
    grid-template-columns: 1fr 1fr;
  }

  .context-selectors .event-select {
    grid-column: 1 / -1;
  }

  .workspace-navigation > .context-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0 8px;
  }

  .workspace-navigation > .context-tabs button {
    min-width: 0;
    white-space: normal;
  }

  .quick-fix-backdrop {
    padding: 8px;
  }

  .quick-fix-modal {
    max-height: calc(100vh - 16px);
  }

  .quick-fix-item {
    grid-template-columns: 1fr;
    gap: 9px;
  }

  .quick-fix-item > .button {
    width: 100%;
  }

  .quick-fix-batch,
  .quick-fix-footer {
    align-items: stretch;
    flex-direction: column;
  }
}

@media screen {
  .archive-subnav {
    display: flex;
    align-items: center;
    gap: 4px;
    margin: -8px 0 22px;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    width: fit-content;
  }

  .archive-subnav button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    padding: 0 14px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--muted);
    font-weight: 700;
    cursor: pointer;
  }

  .archive-subnav button:hover { background: #f3f6f8; color: var(--ink); }
  .archive-subnav button.active { background: #e9f7f2; color: #006c4c; }
  .archive-subnav svg { width: 18px; height: 18px; }

  .archive-all-insights,
  .archive-duplicates-page {
    display: grid;
    gap: 20px;
  }

  .archive-overview-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
  }

  .archive-overview-metrics > div {
    display: grid;
    gap: 4px;
    min-height: 116px;
    padding: 18px;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
  }

  .archive-overview-metrics > div:nth-child(4n) { border-right: 0; }
  .archive-overview-metrics > div:nth-last-child(-n + 4) { border-bottom: 0; }
  .archive-overview-metrics span { color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; }
  .archive-overview-metrics strong { color: var(--ink); font-size: 30px; line-height: 1; }
  .archive-overview-metrics small { color: var(--muted); }

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

  .archive-insight-columns > section,
  .archive-country-stats,
  .archive-duplicates-page {
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
  }

  .archive-insight-title,
  .archive-page-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
  }

  .archive-insight-title h3,
  .archive-page-heading h3 { margin: 0 0 4px; }
  .archive-insight-title p,
  .archive-page-heading p { margin: 0; color: var(--muted); }
  .archive-insight-title > span { color: var(--muted); font-size: 12px; white-space: nowrap; }

  .archive-ranking { display: grid; }

  .archive-ranking button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 44px;
    padding: 8px 4px;
    border: 0;
    border-bottom: 1px solid var(--line);
    background: transparent;
    color: var(--ink);
    text-align: left;
    cursor: pointer;
  }

  .archive-ranking button:hover { color: #007c58; }
  .archive-ranking button:last-child { border-bottom: 0; }
  .archive-ranking button span { display: flex; align-items: center; gap: 10px; min-width: 0; }
  .archive-ranking button span b { color: var(--muted); min-width: 20px; font-size: 11px; }
  .archive-ranking button span { font-size: 12px; font-weight: 650; }
  .archive-ranking button > strong { min-width: 32px; text-align: right; }

  .archive-country-stats > div:last-child {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
  }

  .archive-country-stats > div:last-child span {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
    font-size: 12px;
  }

  .archive-duplicates-page > .archive-search-field { max-width: 560px; }

  .archive-insights {
    display: grid;
    gap: 14px;
    margin: 0 0 22px;
    padding: 18px 20px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
  }

  .archive-insight-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    border-bottom: 1px solid var(--line);
    padding-bottom: 14px;
  }

  .archive-insight-metrics span {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
    padding: 2px 16px;
    color: var(--muted);
    font-size: 12px;
  }

  .archive-insight-metrics span:first-child { padding-left: 0; }
  .archive-insight-metrics span + span { border-left: 1px solid var(--line); }

  .archive-insight-metrics strong {
    color: var(--ink);
    font-size: 22px;
    line-height: 1;
  }

  .archive-program-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
  }

  .archive-program-heading > div {
    display: grid;
    gap: 3px;
  }

  .archive-program-heading small { color: var(--muted); }

  .archive-program-bars {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px 18px;
    max-height: 250px;
    overflow: auto;
    padding-right: 4px;
  }

  .archive-program-bar {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 64px 34px;
    align-items: center;
    gap: 10px;
    min-height: 38px;
    padding: 7px 8px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--ink);
    text-align: left;
    cursor: pointer;
  }

  .archive-program-bar:hover,
  .archive-program-bar.active { background: #edf8f4; }

  .archive-program-bar span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
    font-weight: 650;
  }

  .archive-program-bar i {
    width: 64px;
    height: 5px;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--green) var(--program-share), #e5eaf0 var(--program-share));
  }

  .archive-program-bar strong { text-align: right; }

  .archive-country-breakdown {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    color: var(--muted);
    font-size: 12px;
  }

  .archive-country-breakdown span {
    padding: 5px 8px;
    border: 1px solid var(--line);
    border-radius: 5px;
    background: #fff;
  }

  .archive-duplicate-panel {
    display: grid;
    gap: 12px;
    margin: 0 0 22px;
    padding: 18px 20px;
    border: 1px solid #efcf83;
    border-radius: 8px;
    background: #fffdf8;
  }

  .archive-duplicate-panel .archive-search-field { max-width: 520px; }
  .archive-duplicate-list { display: grid; gap: 8px; }

  .program-label-settings { max-width: 1200px; }

  .program-label-section {
    margin-bottom: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
  }

  .program-label-section > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
    cursor: pointer;
  }

  .program-label-section > summary span { display: grid; gap: 2px; }
  .program-label-section > summary small { color: var(--muted); }
  .program-label-list { border-top: 1px solid var(--line); }

  .program-label-row {
    display: grid;
    grid-template-columns: minmax(220px, .8fr) minmax(280px, 1.2fr) 44px;
    align-items: center;
    gap: 14px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--line);
  }

  .program-label-row:last-child { border-bottom: 0; }
  .program-label-row > span { display: grid; gap: 2px; min-width: 0; }
  .program-label-row small { color: var(--muted); }
  .program-label-row input { width: 100%; }
}

@media screen and (max-width: 760px) {
  .archive-subnav { width: 100%; overflow-x: auto; }
  .archive-subnav button { flex: 1 0 auto; justify-content: center; }
  .archive-overview-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .archive-overview-metrics > div:nth-child(4n) { border-right: 1px solid var(--line); }
  .archive-overview-metrics > div:nth-child(2n) { border-right: 0; }
  .archive-overview-metrics > div:nth-last-child(-n + 4) { border-bottom: 1px solid var(--line); }
  .archive-overview-metrics > div:nth-last-child(-n + 2) { border-bottom: 0; }
  .archive-insight-columns { grid-template-columns: 1fr; }
  .archive-country-stats > div:last-child { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .archive-insight-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 0; }
  .archive-insight-metrics span:nth-child(3) { padding-left: 0; border-left: 0; }
  .archive-program-bars { grid-template-columns: 1fr; }
  .program-label-row { grid-template-columns: minmax(0, 1fr) 44px; }
  .program-label-row > span { grid-column: 1 / -1; }
}

/* v35: season-aware HubSpot submission inbox */
@media screen {
  .season-submitted-count {
    color: #087554;
    font-weight: 700;
  }

  .hubspot-form-manager,
  .hubspot-inbox,
  .hubspot-sync-history {
    margin-top: 16px;
  }

  .hubspot-program-settings .status-line {
    grid-template-columns: minmax(130px, .28fr) minmax(0, 1fr);
  }

  .hubspot-form-add {
    display: grid;
    grid-template-columns: minmax(190px, 1.2fr) minmax(270px, 1.6fr) 110px 150px auto auto;
    align-items: end;
    gap: 10px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--line);
    background: #f8fafb;
  }

  .hubspot-form-add label,
  .hubspot-form-card > label:not(.hubspot-form-toggle),
  .hubspot-inbox-filters label {
    min-width: 0;
    display: grid;
    gap: 5px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
  }

  .hubspot-form-add input,
  .hubspot-form-add select,
  .hubspot-form-card input,
  .hubspot-form-card select,
  .hubspot-inbox-filters select {
    width: 100%;
    min-width: 0;
    min-height: 38px;
    margin: 0;
    border: 1px solid #d8e0e7;
    border-radius: 6px;
    background: #fff;
    color: var(--ink);
    font-size: 12px;
  }

  .hubspot-form-list {
    display: grid;
  }

  .hubspot-form-card {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(280px, 1fr) 120px 140px auto 40px;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--line);
  }

  .hubspot-form-card:last-child {
    border-bottom: 0;
  }

  .hubspot-form-toggle {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .hubspot-form-toggle input {
    width: 18px;
    min-height: 18px;
    flex: 0 0 18px;
  }

  .hubspot-form-toggle > span {
    min-width: 0;
    display: grid;
    gap: 3px;
  }

  .hubspot-form-toggle strong,
  .hubspot-form-toggle small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .hubspot-form-toggle strong {
    font-size: 13px;
    font-weight: 650;
  }

  .hubspot-form-toggle small {
    color: var(--muted);
    font-size: 10px;
  }

  .hubspot-inbox-head {
    align-items: end;
  }

  .hubspot-inbox-filters {
    display: flex;
    align-items: end;
    gap: 8px;
  }

  .hubspot-inbox-filters label {
    min-width: 140px;
  }

  .hubspot-inbox-summary {
    display: flex;
    align-items: baseline;
    gap: 14px;
    padding: 11px 18px;
    border-bottom: 1px solid var(--line);
    background: #f8fafb;
    color: var(--muted);
    font-size: 11px;
  }

  .hubspot-inbox-summary strong {
    color: var(--ink);
    font-size: 18px;
  }

  .hubspot-inbox-list,
  .hubspot-sync-log {
    max-height: 520px;
    overflow: auto;
  }

  .hubspot-inbox-row {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(190px, 1fr) minmax(210px, 1.15fr) minmax(170px, .8fr) auto;
    align-items: center;
    gap: 16px;
    padding: 13px 18px;
    border-bottom: 1px solid var(--line);
  }

  .hubspot-inbox-row > div:not(.hubspot-inbox-actions) {
    min-width: 0;
    display: grid;
    gap: 3px;
  }

  .hubspot-inbox-row strong,
  .hubspot-inbox-row span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .hubspot-inbox-row strong {
    font-size: 12px;
    font-weight: 650;
  }

  .hubspot-inbox-row span {
    color: var(--muted);
    font-size: 10px;
  }

  .hubspot-inbox-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 7px;
  }

  .hubspot-inbox-actions .button {
    min-height: 34px;
    padding-inline: 10px;
  }

  .hubspot-sync-log-row {
    display: grid;
    grid-template-columns: 120px minmax(240px, .8fr) minmax(300px, 1.4fr);
    align-items: center;
    gap: 16px;
    padding: 13px 18px;
    border-bottom: 1px solid var(--line);
  }

  .hubspot-sync-log-row > span {
    min-width: 0;
    display: grid;
    gap: 3px;
  }

  .hubspot-sync-log-row strong,
  .hubspot-sync-log-row small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .hubspot-sync-log-row strong {
    font-size: 11px;
  }

  .hubspot-sync-log-row small {
    color: var(--muted);
    font-size: 10px;
  }

  .hubspot-sync-log-state {
    grid-template-columns: 17px 1fr;
    align-items: center;
    color: #087554;
  }

  .hubspot-sync-log-state svg {
    width: 16px;
    height: 16px;
  }

  .hubspot-sync-log-row.failed .hubspot-sync-log-state {
    color: var(--danger);
  }
}

@media screen and (max-width: 980px) {
  .hubspot-form-add,
  .hubspot-form-card {
    grid-template-columns: 1fr 1fr;
  }

  .hubspot-form-toggle {
    grid-column: 1 / -1;
  }

  .hubspot-form-card > .pill {
    justify-self: start;
  }

  .hubspot-inbox-row {
    grid-template-columns: 1fr 1fr;
  }

  .hubspot-inbox-actions {
    justify-content: flex-start;
  }
}

@media screen and (max-width: 620px) {
  .hubspot-form-add,
  .hubspot-form-card,
  .hubspot-inbox-row,
  .hubspot-sync-log-row {
    grid-template-columns: 1fr;
  }

  .hubspot-form-toggle {
    grid-column: auto;
  }

  .hubspot-form-add .button,
  .hubspot-form-card .button {
    width: 100%;
  }

  .hubspot-inbox-head {
    align-items: stretch;
  }

  .hubspot-inbox-filters {
    width: 100%;
  }

  .hubspot-inbox-filters label {
    min-width: 0;
    flex: 1 1 0;
  }

  .hubspot-inbox-summary {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .hubspot-program-settings .status-line {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

@media screen {
  .roster-workspace [hidden] {
    display: none !important;
  }

  .roster-hero {
    align-items: center;
    margin-bottom: 14px;
  }

  .roster-hero p {
    max-width: 760px;
    margin: 7px 0 0;
    color: var(--muted);
    font-size: 14px;
  }

  .roster-view-switch {
    display: inline-flex;
    padding: 3px;
    border: 1px solid var(--line-2);
    border-radius: 7px;
    background: #f2f5f7;
  }

  .roster-view-switch button {
    min-height: 36px;
    padding: 0 14px;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: #667184;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
  }

  .roster-view-switch button.active {
    background: #fff;
    color: var(--ink);
    box-shadow: 0 1px 3px rgba(21, 26, 45, .12);
  }

  .roster-context {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    min-height: 54px;
    padding: 10px 16px;
    border: 1px solid #cee9df;
    border-left: 3px solid var(--green);
    background: #f4fbf8;
  }

  .roster-context > span {
    color: var(--green-2);
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
  }

  .roster-context > strong {
    min-width: 0;
    overflow: hidden;
    font-size: 14px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .roster-context > em {
    color: var(--muted);
    font-size: 12px;
    font-style: normal;
    white-space: nowrap;
  }

  .roster-context > em b {
    color: var(--ink);
    font-size: 17px;
  }

  .roster-toolbar {
    margin: 12px 0;
    padding: 0;
    border: 0;
    background: transparent;
  }

  .roster-toolbar .toolbar-left {
    flex: 1 1 420px;
  }

  .roster-toolbar input[type="search"] {
    width: min(520px, 100%);
  }

  .roster-visible-count {
    color: var(--muted);
    font-size: 12px;
    white-space: nowrap;
  }

  .roster-table-panel {
    margin-bottom: 20px;
    overflow: hidden;
  }

  .roster-table-wrap {
    max-height: 58vh;
    overflow: auto;
  }

  .roster-table {
    margin: 0;
  }

  .roster-table thead {
    position: sticky;
    top: 0;
    z-index: 4;
    background: #f7f9fb;
  }

  .roster-table th,
  .roster-table td {
    padding: 11px 14px;
    vertical-align: middle;
  }

  .roster-table tbody tr {
    height: 58px;
  }

  .roster-table tbody tr:hover {
    background: #fbfcfd;
  }

  .roster-table .button.ghost {
    min-height: 0;
    height: auto;
    padding: 0;
    border: 0;
    color: var(--ink);
    text-align: left;
  }

  .fair-roster-table {
    width: 100%;
    min-width: 760px;
  }

  .fair-roster-table th:first-child {
    width: 42%;
  }

  .fair-roster-table th:nth-child(2) {
    width: 20%;
  }

  .fair-roster-table th:nth-child(4) {
    width: 92px;
  }

  .fair-roster-table th:last-child {
    width: 120px;
  }

  .roster-program-status {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border: 1px solid #cbe9de;
    border-radius: 999px;
    background: #eef9f5;
    color: #087653;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
  }

  .roster-program-status.missing {
    border-color: #efd7a9;
    background: #fff8e9;
    color: #96600e;
  }

  .roster-table-input {
    width: 68px !important;
    min-height: 38px !important;
    padding: 0 10px !important;
    text-align: center;
  }

  .tour-matrix-table {
    min-width: 1120px;
    table-layout: fixed;
  }

  .tour-matrix-table th:first-child,
  .tour-matrix-table td:first-child {
    position: sticky;
    left: 0;
    z-index: 3;
    width: 260px;
    background: #fff;
  }

  .tour-matrix-table th:nth-child(2),
  .tour-matrix-table td:nth-child(2) {
    position: sticky;
    left: 260px;
    z-index: 3;
    width: 130px;
    background: #fff;
    box-shadow: 8px 0 12px -12px rgba(21, 26, 45, .45);
  }

  .tour-matrix-table thead th:first-child,
  .tour-matrix-table thead th:nth-child(2) {
    z-index: 6;
    background: #f7f9fb;
  }

  .tour-matrix-table th:not(:first-child):not(:nth-child(2)):not(:last-child) {
    width: 118px;
    padding-inline: 8px;
    text-align: center;
  }

  .tour-matrix-table th > span,
  .tour-matrix-table th > small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .tour-matrix-table th > span {
    color: var(--ink);
    font-size: 11px;
  }

  .tour-matrix-table th > small {
    margin-top: 3px;
    color: var(--muted);
    font-size: 9px;
    white-space: nowrap;
  }

  .tour-matrix-table td:not(:first-child):not(:nth-child(2)) {
    text-align: center;
  }

  .roster-add-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(320px, .8fr);
    gap: 18px;
    align-items: start;
  }

  .roster-archive-picker {
    margin: 0;
  }

  .roster-archive-picker .panel-head small {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 400;
  }

  .roster-archive-picker .search-field {
    margin-bottom: 10px;
  }

  .roster-archive-results {
    max-height: 390px;
    overflow: auto;
    border-top: 1px solid var(--line);
  }

  .roster-archive-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 62px;
    padding: 10px 2px;
    border-bottom: 1px solid var(--line);
  }

  .roster-archive-row > span {
    min-width: 0;
  }

  .roster-archive-row strong,
  .roster-archive-row small {
    display: block;
  }

  .roster-archive-row strong {
    overflow: hidden;
    color: var(--ink);
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .roster-archive-row small {
    margin-top: 4px;
    color: var(--muted);
    font-size: 11px;
  }

  .roster-add-secondary {
    display: grid;
    gap: 12px;
  }

  .roster-add-secondary .configuration-drawer {
    margin: 0;
  }

  .roster-add-secondary .configuration-content {
    padding: 16px;
  }

  .roster-add-secondary .configuration-content > p {
    margin: 0 0 14px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5;
  }

  .roster-add-secondary textarea {
    min-height: 150px;
  }
}

@media screen and (max-width: 960px) {
  .roster-hero,
  .roster-hero .toolbar-right {
    align-items: stretch;
  }

  .roster-hero {
    display: grid;
  }

  .roster-add-layout {
    grid-template-columns: 1fr;
  }
}

@media screen and (max-width: 720px) {
  .roster-hero .toolbar-right,
  .roster-toolbar,
  .roster-toolbar .toolbar-left {
    display: grid;
    width: 100%;
  }

  .roster-view-switch {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .roster-context {
    grid-template-columns: 1fr auto;
  }

  .roster-context > span {
    grid-column: 1 / -1;
  }

  .roster-context > strong {
    white-space: normal;
  }

  .roster-toolbar .toolbar-right {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .roster-toolbar input[type="search"] {
    width: 100% !important;
    max-width: none;
  }

  .roster-table-wrap {
    max-height: 62vh;
  }

  .fair-roster-table {
    min-width: 0;
  }

  .fair-roster-table thead {
    display: none;
  }

  .fair-roster-table,
  .fair-roster-table tbody,
  .fair-roster-table tr,
  .fair-roster-table td {
    display: block;
    width: 100%;
  }

  .fair-roster-table tbody {
    padding: 0 12px;
  }

  .fair-roster-table tr[data-roster-row] {
    height: auto;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
  }

  .fair-roster-table tr[data-roster-row] td {
    padding: 4px 0;
    border: 0;
    text-align: left;
  }

  .fair-roster-table tr[data-roster-row] td:first-child {
    margin-bottom: 6px;
  }

  .fair-roster-table tr[data-roster-row] td:nth-child(2)::before,
  .fair-roster-table tr[data-roster-row] td:nth-child(3)::before,
  .fair-roster-table tr[data-roster-row] td:nth-child(4)::before {
    display: inline-block;
    width: 78px;
    color: var(--muted);
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
  }

  .fair-roster-table tr[data-roster-row] td:nth-child(2)::before {
    content: "Country";
  }

  .fair-roster-table tr[data-roster-row] td:nth-child(3)::before {
    content: "Programs";
  }

  .fair-roster-table tr[data-roster-row] td:nth-child(4)::before {
    content: "Table";
  }

  .fair-roster-table tr[data-roster-row] td:last-child {
    margin-top: 6px;
  }

  .fair-roster-table tr[data-roster-row] td:last-child .button {
    width: 100%;
  }

  .fair-roster-table .roster-empty-row td {
    padding: 24px 12px;
  }
}

/* v27: practical fair row editor */
@media screen {
  .grid-rows-drawer {
    width: min(920px, 100%);
    grid-template-rows: auto auto minmax(0, 1fr);
  }

  .grid-row-tools {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) auto auto;
    gap: 8px;
  }

  .grid-row-tools input {
    width: 100%;
    min-width: 0;
  }

  .grid-row-editor {
    grid-template-columns: 34px 58px minmax(250px, 1fr) minmax(300px, 1.25fr) 40px;
    align-items: center;
    gap: 9px;
    padding: 10px 2px;
  }

  .grid-row-order {
    display: grid;
    gap: 4px;
  }

  .grid-row-order .button {
    width: 30px;
    min-width: 30px;
    min-height: 27px;
    padding: 0;
  }

  .grid-row-order .button:disabled {
    opacity: .28;
    cursor: default;
  }

  .grid-row-editor .source-context {
    display: block;
    overflow: hidden;
    color: var(--muted);
    font-size: 9px;
    font-weight: 500;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .grid-row-identity {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(160px, 1.45fr) minmax(100px, .75fr);
    gap: 8px;
  }

  .grid-row-identity label {
    min-width: 0;
  }

  .grid-bulk-add {
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--panel-2);
  }

  .grid-bulk-add summary {
    padding: 10px 12px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
  }

  .grid-bulk-add[open] {
    padding: 0 10px 10px;
  }

  .grid-bulk-add[open] summary {
    margin: 0 -10px 9px;
  }
}

@media screen and (max-width: 720px) {
  .grid-row-tools {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grid-row-tools input {
    grid-column: 1 / -1;
  }

  .grid-row-editor {
    grid-template-columns: 34px 54px minmax(0, 1fr) 38px;
    align-items: start;
  }

  .grid-row-identity {
    grid-template-columns: minmax(0, 1fr);
  }

  .grid-row-editor .row-source-field {
    grid-column: 2 / -1;
  }
}

@media screen and (max-width: 620px) {
  .archive-current-head,
  .submission-record-head {
    align-items: stretch;
    flex-direction: column;
  }

  .archive-current-head .pill,
  .submission-record-head .chips {
    align-self: flex-start;
  }

  .archive-current-meta,
  .submission-record-meta {
    display: grid;
  }

  .archive-current-meta span::after {
    display: none !important;
  }
}

@media screen and (max-width: 420px) {
  .summary-rail > div > strong {
    font-size: 19px;
  }

  .summary-rail > div > span {
    font-size: 9px;
  }
}

/* University archive: stable two-pane editing workspace. */
@media screen {
  .sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .archive-workspace .archive-hero {
    margin-bottom: 14px;
  }

  .archive-workspace .archive-hero p {
    max-width: 620px;
    margin: 6px 0 0;
  }

  .archive-controls {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(280px, 1.5fr) minmax(210px, .9fr) minmax(160px, .65fr) minmax(155px, .6fr) 42px;
    align-items: end;
    gap: 8px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--shadow-soft);
  }

  .archive-search-field {
    min-width: 0;
    position: relative;
    display: block;
  }

  .archive-search-field > svg {
    position: absolute;
    left: 13px;
    top: 50%;
    width: 17px;
    height: 17px;
    transform: translateY(-50%);
    color: #7b8595;
    pointer-events: none;
  }

  .archive-search-field input,
  .archive-compact-filter select {
    width: 100%;
    min-width: 0;
    height: 42px;
    min-height: 42px;
    margin: 0;
    border: 1px solid #dbe2e8;
    border-radius: 6px;
    background: #fff;
    color: var(--ink);
    font-size: 12px;
  }

  .archive-search-field input {
    padding-left: 40px;
  }

  .archive-compact-filter {
    min-width: 0;
    display: grid;
    gap: 4px;
  }

  .archive-compact-filter > span {
    color: #747e8f;
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
  }

  .archive-controls .icon-only {
    width: 42px;
    min-width: 42px;
    padding: 0;
  }

  .archive-summary-line {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 16px;
    min-height: 38px;
    padding: 0 4px;
    color: #6c7687;
    font-size: 11px;
  }

  .archive-summary-line strong {
    color: var(--ink);
  }

  .archive-summary-line .needs-review-count {
    color: #9a650e;
    font-weight: 750;
  }

  .archive-layout {
    height: max(540px, calc(100vh - 330px));
    align-items: stretch;
  }

  .archive-directory,
  .archive-detail {
    height: 100%;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .archive-directory-head,
  .archive-detail-head {
    position: relative;
    z-index: 2;
  }

  .archive-list,
  .archive-detail-body {
    min-height: 0;
    max-height: none;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-gutter: stable;
    overscroll-behavior: contain;
  }

  .archive-list-row {
    min-width: 0;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 5px 12px;
  }

  .archive-program-preview {
    grid-column: 1 / -1;
    grid-row: 2;
    padding-right: 4px;
  }

  .archive-counts {
    grid-column: 2;
    grid-row: 1;
  }

  .archive-detail-body {
    padding: 16px 18px 24px;
  }

  .archive-detail .archive-category-grid {
    max-height: none;
    overflow: visible;
  }
}

@media screen and (max-width: 1180px) {
  .archive-controls {
    grid-template-columns: minmax(240px, 1fr) repeat(3, minmax(145px, .6fr)) 42px;
  }
}

@media screen and (max-width: 1100px) {
  .archive-controls {
    grid-template-columns: 1fr 1fr;
  }

  .archive-search-field {
    grid-column: 1 / -1;
  }

  .archive-controls .icon-only {
    width: 100%;
  }

  .archive-layout {
    height: auto;
  }

  .archive-directory,
  .archive-detail {
    height: auto;
  }

  .archive-list {
    max-height: 360px;
  }

  .archive-detail-body {
    overflow: visible;
  }
}

@media screen and (max-width: 620px) {
  .archive-controls {
    grid-template-columns: 1fr;
  }

  .archive-search-field,
  .archive-controls .icon-only {
    grid-column: auto;
  }

  .archive-summary-line {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
    padding: 9px 4px;
  }

  .archive-detail .category-grid {
    grid-template-columns: 1fr;
  }
}

/* Full-width application frame */
@media screen {
  .shell {
    display: block;
    min-height: 100vh;
  }

  .main {
    width: 100%;
    min-width: 0;
  }

  .topbar {
    width: 100%;
    min-height: 68px;
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr);
    align-items: end;
    gap: 18px;
    padding: 9px 24px;
  }

  .topbar-brand {
    align-self: center;
    display: flex;
    align-items: center;
    min-width: 138px;
  }

  .topbar-brand img {
    width: 138px;
    height: auto;
    display: block;
  }

  .topnav {
    align-self: center;
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 0;
    padding: 0;
    overflow: visible;
  }

  .topnav button {
    width: auto;
    min-width: max-content;
    min-height: 40px;
    justify-content: center;
    gap: 8px;
    padding: 0 11px;
    border-radius: 6px;
    font-size: 12px;
  }

  .topnav button.active {
    box-shadow: inset 0 -2px 0 var(--green);
  }

  .top-actions {
    width: auto;
    min-width: 0;
    justify-self: end;
    display: flex;
    align-items: end;
    justify-content: flex-end;
    gap: 8px;
  }

  .top-actions .season-select {
    width: 108px;
  }

  .top-actions .tour-select {
    width: clamp(180px, 18vw, 280px);
  }

  .top-actions .event-select {
    width: clamp(260px, 27vw, 430px);
  }

  .top-actions .sync-status {
    min-width: 66px;
    padding-inline: 10px;
  }

  .top-actions .button.icon-label {
    min-height: 42px;
    padding-inline: 12px;
  }

  .workspace {
    width: 100%;
  }
}

@media screen and (max-width: 1500px) {
  .topbar:has(.tour-select) {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 8px 18px;
    padding-block: 10px;
  }

  .topbar:has(.tour-select) .topnav {
    justify-self: end;
  }

  .topbar:has(.tour-select) .top-actions {
    grid-column: 1 / -1;
    width: 100%;
  }

  .top-actions .tour-select {
    width: min(29vw, 300px);
  }

  .top-actions .event-select {
    width: min(42vw, 470px);
  }
}

@media screen and (max-width: 720px) {
  .topbar {
    position: relative;
    grid-template-columns: 1fr;
    gap: 9px;
    padding: 12px;
  }

  .topbar-brand {
    min-width: 0;
  }

  .topbar-brand img {
    width: 132px;
  }

  .topnav {
    width: 100%;
    justify-self: stretch;
    justify-content: flex-start;
    gap: 3px;
    padding-bottom: 2px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .topnav::-webkit-scrollbar {
    display: none;
  }

  .topnav button {
    flex: 0 0 auto;
    min-height: 38px;
    padding-inline: 10px;
    font-size: 11px;
  }

  .top-actions {
    grid-column: auto;
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .top-actions .season-select,
  .top-actions .tour-select,
  .top-actions .event-select {
    width: 100%;
  }

  .top-actions .tour-select,
  .top-actions .event-select {
    grid-column: 1 / -1;
  }

  .top-actions .sync-status {
    grid-column: auto;
  }

  .top-actions > .button.icon-label {
    width: 100%;
  }

  .top-actions .user-pill {
    display: none;
  }
}

@media screen and (max-width: 1100px) {
  .archive-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
  }

  .archive-directory,
  .archive-detail {
    width: 100%;
    min-width: 0;
  }
}
