.next-board, .next-board *, .next-editor, .next-editor * { box-sizing: border-box; }
body.next-active {
  background: #1b171f !important;
  color: #edf4f2;
}
body.next-active .sidebar,
body.next-active .topbar,
body.next-active .summary,
body.next-active .planner-panel,
body.next-active .bottom-panels,
body.next-active .page-footer,
body.next-active #export-pdf { display: none !important; }
body.next-active .workspace {
  margin: 0 auto !important;
  width: min(1040px, 100%) !important;
  min-width: 0 !important;
}
body.next-active .workspace > main {
  max-width: none !important;
  padding: 0 clamp(12px,4vw,36px) calc(86px + env(safe-area-inset-bottom)) !important;
}
body.next-active .page-heading {
  position: sticky;
  top: 0;
  z-index: 35;
  padding: max(14px, env(safe-area-inset-top)) 0 10px;
  background: #1b171f;
  border-bottom: 1px solid #57465e;
  display: grid !important;
  grid-template-columns: minmax(0,1fr);
  gap: 10px 14px !important;
  margin-bottom: 14px !important;
  align-items: center;
}
body.next-active .page-heading h1 {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 5px 12px;
  font: 750 clamp(24px,5vw,36px)/1.05 system-ui, sans-serif !important;
  color: #edf4f2 !important;
  margin: 0;
}
body.next-active .page-heading h1 small { color: #a7c1bb; font: 600 12px/1.25 system-ui,sans-serif; }
body.next-active .heading-actions { grid-column: 1 / -1; margin: 0 !important; }
body.next-active #spv-top-controls { gap: 6px; }
body.next-active #spv-top-controls :is(.spv-top-button, .spv-save-indicator) { min-height: 38px; font-size: 11px; padding: 6px 8px; }
.next-board, .next-editor {
  --next-panel: #28212d;
  --next-line: #57465e;
  --next-text: #edf4f2;
  --next-muted: #b0c4c4;
  --next-accent: #c8acd0;
}
.next-board { font: 500 15px/1.4 system-ui, sans-serif; color: var(--next-text); }
.next-board button, .next-editor button, .next-tools button, .next-back {
  appearance: none;
  border: 1px solid #57465e;
  border-radius: 11px;
  min-height: 44px;
  padding: 7px 11px;
  background: #34293a;
  color: #edf4f2;
  font: 650 14px/1.2 system-ui, sans-serif;
  cursor: pointer;
}
.next-board button:disabled, .next-editor button:disabled { opacity: .55; cursor: default; }
.next-board button:focus-visible, .next-editor button:focus-visible, .next-board input:focus-visible {
  outline: 2px solid #c8acd0; outline-offset: 2px;
}
.next-board button[aria-pressed="true"], .next-editor button[aria-pressed="true"],
.next-board .next-primary, .next-editor .next-primary {
  background: #c8acd0; color: #251a28; border-color: #c8acd0;
}
.next-calendar { background: var(--next-panel); border: 1px solid var(--next-line); border-radius: 18px; padding: 8px; }
.next-week-nav { display: grid; grid-template-columns: 44px 1fr 44px; gap: 5px; margin-bottom: 6px; }
.next-week-nav button { background: transparent; border-color: transparent; }
.next-week-nav button:first-child, .next-week-nav button:last-child { font-size: 26px; }
.next-days, .next-views { display: grid; gap: 5px; }
.next-days { grid-template-columns: repeat(7,minmax(0,1fr)); }
.next-days button { padding: 4px 1px; min-height: 47px; font-size: 11px; }
.next-days strong { display: block; font-size: 15px; }
.next-views { grid-template-columns: repeat(4,minmax(0,1fr)); margin: 11px 0 14px; }
.next-views button { padding-inline: 4px; }
.next-summary { display: flex; gap: 8px; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.next-summary h2 { margin: 0; color: var(--next-text); font: 740 23px/1.2 system-ui,sans-serif; }
.next-summary span, .next-board small { color: var(--next-muted); }
.next-search, .next-editor input {
  display: block;
  width: 100%;
  min-height: 44px;
  background: #28212d;
  color: #edf4f2;
  border: 1px solid #465f66;
  border-radius: 10px;
  padding: 8px 12px;
  font: 500 16px/1.2 system-ui,sans-serif;
}
.next-search::placeholder, .next-editor input::placeholder { color: #afc3c5; opacity: 1; }
.next-list { display: grid; gap: 10px; margin-top: 12px; }
.next-list h3 { color: var(--next-text); margin: 0 0 6px; font: 720 15px/1.25 system-ui,sans-serif; }
.next-person, .next-week-card, .next-site-card {
  border: 1px solid var(--next-line);
  background: var(--next-panel);
  border-radius: 13px;
  padding: 9px 12px;
  min-width: 0;
}
.next-person { display: flex; align-items: center; gap: 10px; margin: 5px 0 0; }
.next-person-main { min-width: 0; flex: 1; }
.next-board .next-name { color: var(--next-text); background: transparent; border: 0; padding: 4px 0; min-height: 44px; text-align: left; font-size: 16px; }
.next-board .next-name:disabled { opacity: 1; }
.next-person-fields, .next-choices { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.next-board .next-location, .next-board .next-status { padding: 5px 8px; font-size: 12px; overflow-wrap: anywhere; min-height: 44px; }
.next-status::before { content: ''; background: #a9b9bc; display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; }
.next-status[data-status="site"]::before { background: #c8acd0; }
.next-status[data-status="travel"]::before { background: #9bc9fb; }
.next-status[data-status="office"]::before { background: #cbbaf7; }
.next-status[data-status="off"]::before, .next-status[data-status="leave"]::before { background: #f1b6ca; }
.next-review, .next-extra { color: #ffce92; font-size: 12px; }
.next-person small { display: block; margin-top: 6px; overflow-wrap: anywhere; }
.next-site-card > p, .next-week-card > p { margin: 0 0 6px; }
.next-site-card a { display: block; color: #c8acd0; width: fit-content; padding: 10px 0; }
.next-week-card button { margin-top: 8px; display: block; }
.next-site-card .next-person { background: #27202d; }
.next-board .next-pick { min-width: 44px; }
.next-dock {
  position: fixed;
  z-index: 28;
  inset: auto 0 0;
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 8px max(10px,env(safe-area-inset-right)) calc(8px + env(safe-area-inset-bottom)) max(10px,env(safe-area-inset-left));
  background: #27202d;
  border-top: 1px solid #57465e;
}
.next-dock button { flex: 1; max-width: 200px; padding-inline: 5px; font-size: 13px; }
.next-editor, .next-tools { display: grid; gap: 10px; }
.next-editor label { display: grid; gap: 5px; }
.next-editor :is(label,.next-choices)[hidden], .next-board[hidden], .next-back[hidden] { display: none !important; }
.next-editor p { margin: 0; }
.next-editor .error-message:empty { display: none; }
.next-back { margin-bottom: 10px; }
@media (min-width: 740px) {
  .next-list:has(.next-site-card), .next-list:has(.next-week-card) { grid-template-columns: repeat(2,minmax(0,1fr)); align-items: start; }
  .next-group { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 6px; }
  .next-group > h3 { grid-column: 1 / -1; }
  .next-group .next-person { margin: 0; }
}

/* Test Version 4 entry and manager controls. */
html body #spv-demo-login { background: #201923 !important; }
html body #spv-demo-login .spv-login-card,
html body .spv-demo-auth-panel {
  background: #332839 !important;
  border-color: #705d78 !important;
}
html body #spv-demo-login .spv-role-card {
  background: #3c3043 !important;
  border-color: #796481 !important;
}
html body #spv-demo-login .spv-login-card > .spv-test-title,
html body #spv-demo-login .spv-login-meta .spv-version-indicator,
html body #spv-demo-login .spv-role-card b { color: #efe2f1 !important; }
html body #spv-demo-login #spv-worker-enter:not(:disabled),
html body .spv-demo-auth-panel button[type=submit] {
  background: #d3bfd8 !important;
  border-color: #d3bfd8 !important;
  color: #271d2a !important;
}
html body #spv-user-menu #spv-menu-publish {
  background: #d9e7db !important;
  border: 1px solid #acc5b1 !important;
  color: #294b37 !important;
}
html body #spv-user-menu #spv-menu-publish:hover,
html body #spv-user-menu #spv-menu-publish:focus-visible { background: #c8decc !important; }

body:has(#spv-menu-publish) .toolbar-stack #spv-publish-main { display: none !important; }

.spv-save-exit-dialog > button {
  display: block;
  width: 100%;
  box-sizing: border-box;
  min-height: 44px;
  margin: 8px 0 0;
}

.spv-release-dialog { width: min(520px, calc(100vw - 24px)); }
.spv-release-guide { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 1.4; }
.spv-release-guide :is(th,td) {
  padding: 9px 6px;
  border-bottom: 1px solid #667b75;
  text-align: left;
  vertical-align: top;
}

.spv-release-dialog > button { display: block; margin: 14px 0 0; width: 100%; min-height: 44px; }

.next-board .next-search[hidden] { display: none; }
.next-board .next-primary,
#modal .next-form-dock > .next-primary {
  background: #66516d;
  color: #ffffff;
  border-color: #8c7593;
}
.next-form-dock {
  position: sticky;
  bottom: 0;
  display: flex;
  gap: 6px;
  padding: 8px 0 max(8px, env(safe-area-inset-bottom));
  background: #ffffff;
  z-index: 4;
}
#modal .next-form-dock > button {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  padding: 6px 4px;
  overflow-wrap: anywhere;
}
#modal:has(.next-form-dock) > .spv-navigation-footer { display: none !important; }

.next-dock { display: grid; justify-items: center; }
.next-dock > :is(.next-days, .next-dock-actions) { width: min(100%, 610px); }
.next-dock-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}
.next-dock-actions button { width: 100%; max-width: none; }
.next-dock:has(> .next-days) .next-days button { max-width: none; }
.next-board:has(.next-dock > .next-days) { padding-bottom: 56px; }
.next-board .next-pick-row {
  width: 100%;
  text-align: left;
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  align-items: center;
  column-gap: 10px;
}
.next-pick-row > small { grid-column: 1; margin: 3px 0 0; }
.next-pick-row[aria-pressed="true"] > small { color: #251a28; }
.next-pick-state { grid-column: 2; grid-row: 1 / span 2; font-size: 12px; }
