/* Shared spacing and interaction polish. Each entry keeps its existing palette.
   Table dimensions, saved preferences and sticky-header positioning are owned
   by the table components; this layer intentionally does not set them. */
body.ui-refresh:not([data-entry=representative]) {
  --ui-accent: var(--red);
  --ui-surface: var(--surface);
  --ui-stroke: var(--line);
  --ui-subtle: var(--muted);
}
body.ui-refresh[data-entry=representative] {
  --ui-accent: var(--wine);
  --ui-surface: #fffdf9;
  --ui-stroke: #e8dfd5;
  --ui-subtle: #8a776f;
}

/* Clear page rhythm, with the working surface closer to its title. */
body.ui-refresh:not([data-entry=representative]) .app-header { min-height:76px; padding:14px 30px; gap:20px; }
body.ui-refresh:not([data-entry=representative]) .brand-block { gap:4px; }
body.ui-refresh:not([data-entry=representative]) .brand { font-size:20px; }
body.ui-refresh:not([data-entry=representative]) main { padding-top:20px; }
body.ui-refresh:not([data-entry=representative]) .page-path { min-height:36px; padding:0; margin:0 0 16px; gap:12px; }
body.ui-refresh:not([data-entry=representative]) .page-path .page-back { border-color:var(--ui-stroke); }
body.ui-refresh:not([data-entry=representative]) .home-heading { padding:4px 0 20px; align-items:flex-end; }
body.ui-refresh:not([data-entry=representative]) .home-heading h1 { font-size:28px; margin:4px 0 6px; line-height:1.35; }
body.ui-refresh:not([data-entry=representative]) .home-eyebrow { margin-bottom:8px; }
body.ui-refresh:not([data-entry=representative]) .module-cards { gap:14px; margin-bottom:22px; }
body.ui-refresh:not([data-entry=representative]) button.module-card { min-height:136px; padding:20px; gap:8px; }
body.ui-refresh:not([data-entry=representative]) .module-card>.ui-icon:first-child { margin-bottom:6px; }
body.ui-refresh:not([data-entry=representative]) .module-card strong { font-size:16px; }
body.ui-refresh:not([data-entry=representative]) .home-section { padding:20px 22px; margin-bottom:18px; }
body.ui-refresh:not([data-entry=representative]) .home-section-title { margin-bottom:10px; }
body.ui-refresh:not([data-entry=representative]) button.home-event { padding:12px 8px; }

/* Controls use a consistent silhouette. Existing primary, danger, selected,
   disabled and validation colors remain with their original components. */
body.ui-refresh:not([data-entry=representative]) :is(.page-action-bar,.activity-ledger-actions,.sheet-ledger-buttons,.activity-header-tools) > button,
body.ui-refresh:not([data-entry=representative]) .table-edit-toolbar > button,
body.ui-refresh:not([data-entry=representative]) .page-more-actions > summary {
  min-height:36px;
  padding:8px 12px;
  border-radius:7px;
  font-size:13px;
  line-height:1.4;
}
body.ui-refresh:not([data-entry=representative]) :is(.page-action-bar,.activity-ledger-actions,.sheet-ledger-buttons,.activity-header-tools) > button:not(.primary):not([data-tone]),
body.ui-refresh:not([data-entry=representative]) .table-edit-toolbar > button:not(.primary):not([data-tone]) {
  background:var(--ui-surface);
  border-color:var(--ui-stroke);
  color:var(--ink);
  box-shadow:none;
}
body.ui-refresh:not([data-entry=representative]) :is(.page-action-bar,.activity-ledger-actions,.sheet-ledger-buttons,.activity-header-tools) > button:not(.primary):not([data-tone]):hover,
body.ui-refresh:not([data-entry=representative]) .table-edit-toolbar > button:not(.primary):not([data-tone]):hover {
  background:var(--red-soft);
  border-color:var(--ui-accent);
  color:var(--ui-accent);
}
body.ui-refresh:not([data-entry=representative]) .page-action-bar:not([hidden]) { gap:8px!important; padding:10px 0!important; }
body.ui-refresh:not([data-entry=representative]) .page-action-bar>.action-heading { margin-bottom:4px!important; }
body.ui-refresh:not([data-entry=representative]) :is(.page-filter-bar,#workspace-content>.searchbar,.activity-list-filters):not([hidden]) {
  padding:10px 0 14px!important;
  border-top:0;
}
body.ui-refresh:not([data-entry=representative]) :is(.page-filter-bar,.searchbar,.activity-list-filters,.custom-filter-bar) :is(input,select) {
  min-height:38px;
  border-radius:7px;
}
body.ui-refresh:not([data-entry=representative]) :is(input,select,textarea):focus-visible {
  outline:2px solid var(--ui-accent);
  outline-offset:2px;
}
body.ui-refresh:not([data-entry=representative]) .ledger-bulk-actions:not([hidden]) { border-radius:8px; margin-bottom:12px!important; }
body.ui-refresh:not([data-entry=representative]) :is(.page-more-content,.file-tools-menu,.file-more-menu) { border-radius:10px; }

/* The activity summary is a compact header; its navigation is a separate,
   continuous tab strip instead of a mixture of tabs and outlined buttons. */
body.ui-refresh:not([data-entry=representative]) #registration-root .activity-overview {
  padding:16px 20px;
  margin-bottom:10px;
  border-radius:12px;
  background:var(--ui-surface);
}
body.ui-refresh:not([data-entry=representative]) #registration-root .activity-title-row { margin-bottom:8px; gap:12px; }
body.ui-refresh:not([data-entry=representative]) #registration-root .activity-title { gap:10px; }
body.ui-refresh:not([data-entry=representative]) #registration-root .activity-title h2 { font-size:23px; line-height:1.4; }
body.ui-refresh:not([data-entry=representative]) #registration-root .activity-overview>p {
  display:inline-block;
  width:auto;
  margin:3px 20px 3px 0;
  font-size:13px;
  line-height:1.7;
  vertical-align:top;
}
body.ui-refresh:not([data-entry=representative]) #registration-root .activity-ledger-tabs {
  display:flex;
  flex-wrap:nowrap;
  align-items:stretch;
  gap:4px;
  padding:0;
  margin:0 0 2px;
  max-width:100%;
  overflow-x:auto;
  overscroll-behavior-x:contain;
  scrollbar-width:thin;
}
body.ui-refresh:not([data-entry=representative]) #registration-root .activity-ledger-tabs>:is(strong,button) {
  display:flex;
  align-items:center;
  justify-content:center;
  flex:0 0 auto;
  min-height:44px;
  padding:10px 16px;
  margin:0;
  font-size:14px;
  line-height:1.4;
  white-space:nowrap;
  background:transparent;
  border:0;
  border-bottom:2px solid transparent;
  border-radius:0;
  box-shadow:none;
  color:var(--ui-subtle);
}
body.ui-refresh:not([data-entry=representative]) #registration-root .activity-ledger-tabs>strong {
  color:var(--ui-accent);
  border-bottom-color:var(--ui-accent);
  font-weight:600;
}
body.ui-refresh:not([data-entry=representative]) #registration-root .activity-ledger-tabs>button:hover { background:var(--red-soft); color:var(--ui-accent); }
body.ui-refresh:not([data-entry=representative]) #registration-root .activity-ledger-toolbar,
body.ui-refresh:not([data-entry=representative]) .sheet-ledger-toolbar { padding:10px 0 12px; gap:10px; }
body.ui-refresh:not([data-entry=representative]) #registration-root .activity-view-switch { padding:3px; gap:2px; }
body.ui-refresh:not([data-entry=representative]) #registration-root .activity-section { margin-top:12px; }
body.ui-refresh:not([data-entry=representative]) #registration-root .activity-section .section-heading { padding:10px 14px; }
body.ui-refresh:not([data-entry=representative]) .signup-group { border-radius:10px; }

/* Calm table boundaries, while preserving alert cells and all saved sizes. */
body.ui-refresh:not([data-entry=representative]) :is(#main-grid,.custom-grid,.registration-grid,.original-sheet-grid) {
  border-color:var(--ui-stroke);
  border-radius:8px;
}
body.ui-refresh:not([data-entry=representative]) table:not(.mobile-record-cards):not(.operation-cards) th { font-weight:600; }
body.ui-refresh:not([data-entry=representative]) .table-pagination { gap:10px; padding:12px 4px; border-top:1px solid var(--ui-stroke); }
body.ui-refresh:not([data-entry=representative]) .table-pagination :is(button,select) { border-radius:7px; }
body.ui-refresh:not([data-entry=representative]) .table-pagination>button:disabled { opacity:.55; }
body.ui-refresh:not([data-entry=representative]) :is(.personal-info,.personal-info-form,.activity-create-form) { border-radius:12px; }
body.ui-refresh:not([data-entry=representative]) .personal-info-item { border-radius:8px; }
body.ui-refresh:not([data-entry=representative]) :is(.personal-info-item,.profile-value)>span { line-height:1.5; }
body.ui-refresh:not([data-entry=representative]) .file-explorer { padding:18px 20px; border-color:var(--ui-stroke); border-radius:12px; }
body.ui-refresh:not([data-entry=representative]) .explorer-location { margin-bottom:10px; }
body.ui-refresh:not([data-entry=representative]) .explorer-toolbar { gap:8px; }
body.ui-refresh:not([data-entry=representative]) .explorer-grid td.explorer-name>button { border:0; }

/* The representative entry retains its warm paper, wine accent, seal and
   editorial title treatment. Shared sizing never imports the staff palette. */
body.ui-refresh[data-entry=representative] .rep-header { padding-top:18px; padding-bottom:18px; gap:24px; }
body.ui-refresh[data-entry=representative] #rep-breadcrumb { padding:14px 0; min-height:48px; margin-bottom:4px; }
body.ui-refresh[data-entry=representative] .discover-heading { margin:6px 0 20px; }
body.ui-refresh[data-entry=representative] #rep-content>.rep-section-heading { margin:6px 0 18px; }
body.ui-refresh[data-entry=representative] .rep-filters { gap:8px; margin-bottom:16px; }
body.ui-refresh[data-entry=representative] .rep-filters :is(input,select) { min-height:42px; }
body.ui-refresh[data-entry=representative] .activity-spotlight.cover-spotlight { border-radius:14px; margin-bottom:24px; }
body.ui-refresh[data-entry=representative] .cover-spotlight .spotlight-copy { padding:28px; }
body.ui-refresh[data-entry=representative] .cover-spotlight .spotlight-copy h2 { margin:14px 0 10px; font-size:28px; }
body.ui-refresh[data-entry=representative] .rep-cards { gap:18px; }
body.ui-refresh[data-entry=representative] .rep-card { box-shadow:none; }
body.ui-refresh[data-entry=representative] .rep-card .rep-card-body { padding:18px 20px; gap:16px; }
body.ui-refresh[data-entry=representative] .rep-card .event-copy h3 { margin:8px 0; font-size:19px; }
body.ui-refresh[data-entry=representative] .rep-card-footer { padding:10px 20px; }
body.ui-refresh[data-entry=representative] .rep-card-footer button { min-height:40px; }
body.ui-refresh[data-entry=representative] .participation-tabs { gap:6px; margin:16px 0 20px; }
body.ui-refresh[data-entry=representative] .participation-tabs button { border-radius:8px; }
body.ui-refresh[data-entry=representative] .rep-detail { padding:30px; border:1px solid var(--ui-stroke); }
body.ui-refresh[data-entry=representative] .detail-meta { margin:22px 0; padding:20px 0; gap:20px; }
body.ui-refresh[data-entry=representative] .my-unified .my-account { padding:20px 24px; margin-bottom:18px; }
body.ui-refresh[data-entry=representative] .unified-profile { padding:22px; }
body.ui-refresh[data-entry=representative] .profile-fields { gap:22px; }
body.ui-refresh[data-entry=representative] .representative-library.file-explorer { padding:18px; }
body.ui-refresh[data-entry=representative] .representative-library .explorer-toolbar { gap:8px; padding-bottom:12px; margin-bottom:12px; }
body.ui-refresh[data-entry=representative] .representative-library :is(.explorer-settings,.file-tools)>summary { background:var(--ui-surface); border:1px solid var(--ui-stroke); }
body.ui-refresh[data-entry=representative] .representative-library .explorer-grid td.explorer-name>button { border:0; background:transparent; }

/* Responsive controls stay reachable; tab scrolling is local to the strip.
   Full table, cards, manual sizing and bottom navigation remain available. */
@media (max-width:1150px) and (min-width:761px) {
  body.ui-refresh:not([data-entry=representative]) .app-header { padding:14px 24px; gap:12px; }
}
@media (max-width:760px) {
  body.ui-refresh:not([data-entry=representative]) main { padding:12px 12px calc(100px + env(safe-area-inset-bottom)); }
  .mobile-layout body.ui-refresh:not([data-entry=representative]) .app-header { padding:14px 16px 12px; gap:6px; }
  .mobile-layout body.ui-refresh:not([data-entry=representative]) .brand { font-size:18px; }
  body.ui-refresh:not([data-entry=representative]) .page-path { gap:8px; margin-bottom:12px; min-height:40px; }
  body.ui-refresh:not([data-entry=representative]) .page-path .page-back { min-height:40px; padding:8px 10px; }
  body.ui-refresh:not([data-entry=representative]) .home-heading { padding:2px 0 16px; }
  body.ui-refresh:not([data-entry=representative]) .home-heading h1 { font-size:24px; }
  body.ui-refresh:not([data-entry=representative]) .module-cards { margin-bottom:16px; }
  .mobile-layout body.ui-refresh:not([data-entry=representative]) button.module-card { min-height:78px; padding:0 2px; gap:8px; }
  .mobile-layout body.ui-refresh:not([data-entry=representative]) .module-card strong { font-size:12px; }
  .mobile-layout body.ui-refresh:not([data-entry=representative]) .module-cards { gap:14px 4px; padding:16px 8px; border-radius:12px; }
  body.ui-refresh:not([data-entry=representative]) .home-section { padding:16px; border-radius:12px; }
  body.ui-refresh:not([data-entry=representative]) :is(.page-action-bar,.activity-ledger-actions,.sheet-ledger-buttons,.activity-header-tools) > button,
  body.ui-refresh:not([data-entry=representative]) .table-edit-toolbar > button,
  body.ui-refresh:not([data-entry=representative]) .page-more-actions > summary { min-height:44px; }
  body.ui-refresh:not([data-entry=representative]) :is(.page-filter-bar,.searchbar,.activity-list-filters,.custom-filter-bar) :is(input,select) { min-height:44px; }
  body.ui-refresh:not([data-entry=representative]) #registration-root .activity-overview { padding:14px!important; margin-bottom:8px; }
  body.ui-refresh:not([data-entry=representative]) #registration-root .activity-title-row { gap:8px; margin-bottom:6px!important; }
  body.ui-refresh:not([data-entry=representative]) #registration-root .activity-title h2 { font-size:21px; }
  body.ui-refresh:not([data-entry=representative]) #registration-root .activity-overview>p { display:block; margin:3px 0!important; width:100%; font-size:12px; }
  body.ui-refresh:not([data-entry=representative]) #registration-root .activity-header-tools { gap:6px!important; }
  body.ui-refresh:not([data-entry=representative]) #registration-root .activity-header-tools>button { min-height:40px; }
  body.ui-refresh:not([data-entry=representative]) #registration-root .activity-ledger-tabs { gap:0; margin-bottom:0; }
  body.ui-refresh:not([data-entry=representative]) #registration-root .activity-ledger-tabs>:is(strong,button) { padding:10px 12px; font-size:13px; }
  body.ui-refresh:not([data-entry=representative]) #registration-root .activity-ledger-toolbar,
  body.ui-refresh:not([data-entry=representative]) .sheet-ledger-toolbar { padding:8px 0 10px; }
  body.ui-refresh:not([data-entry=representative]) .sheet-ledger-buttons { gap:6px; }
  body.ui-refresh:not([data-entry=representative]) .sheet-ledger-buttons>button { min-height:44px; }
  .mobile-layout body.ui-refresh:not([data-entry=representative]) .mobile-record-tools { gap:6px; padding:6px 0; margin-bottom:6px; }
  .mobile-layout body.ui-refresh:not([data-entry=representative]) .mobile-record-cards tbody>tr { border-radius:10px; margin-bottom:10px; }
  .mobile-layout body.ui-refresh:not([data-entry=representative]) .mobile-section-categories { display:flex; flex-wrap:nowrap; overflow-x:auto; max-width:100%; gap:4px; scrollbar-width:thin; overscroll-behavior-x:contain; }
  .mobile-layout body.ui-refresh:not([data-entry=representative]) .mobile-section-categories>button { flex:0 0 auto; min-height:44px; white-space:nowrap; padding:8px 12px; }
  body.ui-refresh:not([data-entry=representative]) .table-pagination { gap:6px; }
  body.ui-refresh:not([data-entry=representative]) .table-pagination :is(button,select) { min-height:44px; }
  body.ui-refresh:not([data-entry=representative]) .file-explorer { border-radius:10px; }

  /* The representative search occupies one row; the remaining file controls
     wrap compactly without hiding their menus or the complete-table switch. */
  body.ui-refresh[data-entry=representative] .representative-library .explorer-toolbar { column-gap:6px; row-gap:8px; }
  body.ui-refresh[data-entry=representative] .representative-library .explorer-toolbar>select { width:104px!important; padding:8px; }
  body.ui-refresh[data-entry=representative] .representative-library .explorer-toolbar>button,
  body.ui-refresh[data-entry=representative] .representative-library .explorer-toolbar :is(.explorer-settings,.file-tools)>summary { min-height:44px; padding:10px 9px; font-size:12px; }
  body.ui-refresh[data-entry=representative] .representative-library .explorer-toolbar>.explorer-select { margin-left:0; }
  body.ui-refresh[data-entry=representative] .representative-library .explorer-toolbar>.file-tools { margin-left:0; }
}
@media (max-width:650px) {
  body.ui-refresh[data-entry=representative] .rep-header { padding:16px 16px; gap:10px; }
  body.ui-refresh[data-entry=representative] main { padding:0 16px calc(110px + env(safe-area-inset-bottom)); }
  body.ui-refresh[data-entry=representative] #rep-breadcrumb { padding:8px 0; margin-bottom:4px; min-height:44px; }
  body.ui-refresh[data-entry=representative] #rep-breadcrumb button { min-height:40px; }
  body.ui-refresh[data-entry=representative] .discover-heading { margin:4px 0 16px; }
  body.ui-refresh[data-entry=representative] .rep-filters { gap:7px; margin-bottom:14px; }
  body.ui-refresh[data-entry=representative] .rep-filters :is(input,select) { min-height:44px; }
  body.ui-refresh[data-entry=representative] .activity-spotlight.cover-spotlight { margin-bottom:20px; border-radius:12px; }
  body.ui-refresh[data-entry=representative] .cover-spotlight .spotlight-copy { padding:20px; }
  body.ui-refresh[data-entry=representative] .cover-spotlight .spotlight-copy h2 { font-size:23px; margin:10px 0 8px; }
  body.ui-refresh[data-entry=representative] .rep-cards { gap:14px; }
  body.ui-refresh[data-entry=representative] .rep-card .rep-card-body { padding:16px; }
  body.ui-refresh[data-entry=representative] .rep-card .event-copy h3 { font-size:18px; }
  body.ui-refresh[data-entry=representative] .rep-card-footer { padding:8px 16px; }
  body.ui-refresh[data-entry=representative] .rep-card-footer button { min-height:44px; }
  body.ui-refresh[data-entry=representative] .participation-tabs { flex-wrap:nowrap; max-width:100%; overflow-x:auto; scrollbar-width:thin; gap:4px; }
  body.ui-refresh[data-entry=representative] .participation-tabs>button { flex:0 0 auto; min-height:44px; padding:10px 12px; white-space:nowrap; }
  body.ui-refresh[data-entry=representative] .rep-detail { padding:20px 16px; }
  body.ui-refresh[data-entry=representative] .detail-meta { gap:16px; margin:18px 0; padding:16px 0; }
  body.ui-refresh[data-entry=representative] .my-unified .my-account { padding:18px; margin-bottom:16px; gap:14px; }
  body.ui-refresh[data-entry=representative] .unified-profile { padding:18px 16px; }
  body.ui-refresh[data-entry=representative] .profile-fields { gap:18px 14px; }
  body.ui-refresh[data-entry=representative] .representative-library.file-explorer { padding:12px; }
}
@media (max-width:360px) {
  body.ui-refresh:not([data-entry=representative]) #registration-root .activity-ledger-tabs>:is(strong,button) { padding-inline:10px; font-size:12px; }
  body.ui-refresh[data-entry=representative] .rep-header { padding-inline:14px; }
  body.ui-refresh[data-entry=representative] main { padding-left:14px; padding-right:14px; }
}
