:root {
  font:
    15px/1.42 Inter,
    "Segoe UI",
    Arial,
    sans-serif;
  color: var(--text, #22262b);
  background: var(--bg, #ffffff);
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-alt: #f7f8fa;
  --text: #22262b;
  --action: #28533f;
  --action-hover: #1c402f;
  --action-rgb: 40, 83, 63;
  --action-soft: rgba(var(--action-rgb), 0.10);
  --action-soft-strong: rgba(var(--action-rgb), 0.18);
  --action-border: rgba(var(--action-rgb), 0.32);
  --line: #d9dde1;
  --muted: #5a626a;
}
* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a {
  touch-action: manipulation;
}
button {
  cursor: pointer;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 5px;
  padding: 6px 11px;
  color: var(--text);
  font-weight: 600;
  line-height: 1.25;
}
button:hover {
  background: var(--surface-alt);
}
button:disabled {
  opacity: 0.45;
  cursor: default;
}
button:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--action);
  outline-offset: 2px;
}
.primary {
  background: var(--action);
  color: white;
  border-color: var(--action);
}
.primary:hover {
  background: var(--action-hover);
}
.danger {
  color: #a03f2d;
}

/* Standalone signed-out and sign-in error screens */
.signed-out {
  display: grid;
  place-items: center;
  height: 100vh;
  height: 100dvh;
  max-width: none;
  padding: 16px;
  background: var(--surface-alt);
  overflow-y: auto;
}
.signed-out-card {
  width: min(100%, 420px);
  padding: clamp(20px, 4vw, 34px);
  background: white;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 6px 24px rgb(28 55 41 / 6%);
}
.signed-out-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  color: var(--action);
  font-weight: 700;
}
.signed-out-card p {
  margin: 8px 0 20px;
  color: var(--muted);
}
.sign-in-link {
  display: grid;
  place-items: center;
  padding: 11px 16px;
  min-height: 44px;
  border-radius: 5px;
  font-weight: 600;
  text-decoration: none;
}

/* Viewport-locked application shell */
.shell {
  display: grid;
  grid-template-columns: 188px minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}
aside {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px 11px;
  background: #fafbfc;
  border-right: 1px solid var(--line);
  min-height: 0;
  overflow-y: auto;
}
nav {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 4px;
}
nav button {
  position: relative;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 0;
  background: transparent;
  font-weight: 550;
  padding: 9px 12px;
}
nav button.on {
  background: #e6ece8;
  color: #1d3d2d;
  font-weight: 700;
}
.nav-badge {
  margin-left: auto;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--action);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}
.userbtn {
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: #393f45;
  padding: 8px 10px;
}
.userbtn:hover {
  background: #eceff2;
}
#user {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: middle;
}
main {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px clamp(14px, 1.8vw, 28px);
  max-width: 1780px;
  width: 100%;
  height: 100%;
  min-height: 0;
  min-width: 0;
  margin: 0 auto;
  overflow: hidden;
}
h1,
h2,
h3,
h4,
p {
  margin: 0;
}
h1 {
  font-size: clamp(20px, 1.7vw, 25px);
  letter-spacing: -0.5px;
  line-height: 1.15;
}
h2 {
  font-size: 16.5px;
  letter-spacing: -0.3px;
  line-height: 1.22;
}
h3 {
  font-size: 14px;
  line-height: 1.25;
}
.heading,
.toolbar,
.line,
.footer,
.cardhead,
.row,
.subbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.heading {
  flex-shrink: 0;
  flex-wrap: wrap;
}
.line,
.cardhead,
.subbar {
  flex-wrap: wrap;
}
.subbar {
  flex-shrink: 0;
}
.actions,
.controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.sub,
small,
.quiet {
  color: var(--muted);
}
.quiet {
  font-size: 12.5px;
}
.pill {
  display: inline-block;
  background: #eef0f2;
  color: #495057;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 700;
  padding: 2px 9px;
  line-height: 1.35;
}
.pill.live {
  background: #e3eee7;
  color: #244b37;
}
.pill-btn {
  padding: 3px 9px;
  border-radius: 16px;
  font-size: 12px;
  background: #f5f6f8;
}
.pill-btn.on {
  background: var(--action);
  color: #fff;
  border-color: var(--action);
}
.filter-pills {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.board,
.panel,
.item {
  background: white;
  border: 1px solid var(--line);
  border-radius: 6px;
}

/* Weekly schedule and Store schedules board */
.board {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  container-type: inline-size;
}
.toolbar {
  padding: 7px 12px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
  background: #fcfdfd;
  flex-shrink: 0;
}
.tb-top {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  flex: 1;
  min-width: 0;
}
.tb-title,
.tb-sub {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}
.tb-title {
  margin-right: auto;
}
.arrows button {
  padding: 4px 10px;
}
.pager .page-ind {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  padding: 0 4px;
  white-space: nowrap;
}
#storeFilter {
  width: auto;
  max-width: 100%;
  padding: 5px 8px;
}
.gridwrap {
  flex: 1;
  min-height: 0;
  overflow: auto;
}
.grid {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
}
.grid th,
.grid td {
  border-right: 1px solid #e5e7ea;
  border-bottom: 1px solid #e5e7ea;
  vertical-align: middle;
}
.grid th:last-child,
.grid td:last-child {
  border-right: 0;
}
.grid th:first-child,
.grid td.labelcell {
  width: 148px;
}
.grid thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 5px 7px;
  background: #f5f7f9;
  font-size: 11.5px;
  font-weight: 600;
  color: #4f565e;
  text-align: left;
}
.th-day strong {
  font-size: 13px;
  color: #202428;
  margin-left: 2px;
}
.grid thead th.today {
  color: #1f3c2d;
  background: #e3ede7;
}
.grid tr.store-first td {
  border-top: 2px solid #cbd2d9;
}
.grid tbody tr:first-child td {
  border-top: 0;
}
.grid td {
  padding: 2px 4px;
}
.s0 {
  --tint: #eef5f1;
  --ink: #3d7557;
}
.s1 {
  --tint: #eef2f7;
  --ink: #496b8a;
}
.s2 {
  --tint: #f6f2ea;
  --ink: #8a6b36;
}
.s3 {
  --tint: #f6efed;
  --ink: #8f5444;
}
.s4 {
  --tint: #f1f2f4;
  --ink: #5d6670;
}
.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--ink, #5d6670);
  margin-right: 6px;
  flex-shrink: 0;
}
.labelcell {
  padding: 3px 7px;
  background: #fafbfc;
  font-size: 11.5px;
  font-weight: 650;
  color: #4f5760;
  overflow-wrap: anywhere;
}
.store-badge {
  display: flex;
  align-items: center;
  font-size: 12px;
  color: #20252a;
  line-height: 1.2;
}
.shift-label {
  display: block;
  padding-left: 14px;
  font-size: 11px;
  font-weight: 550;
  color: #5b636c;
  line-height: 1.2;
}
.cell-shifts {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 2px;
}
.cell-cards {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.shift {
  display: block;
  width: 100%;
  border: 0;
  border-left: 3px solid var(--ink);
  border-radius: 4px;
  background: var(--tint);
  padding: 2px 5px;
  margin: 0;
  text-align: left;
  font-size: 11.5px;
  color: #23272c;
  line-height: 1.24;
  overflow-wrap: anywhere;
}
.shift:hover {
  filter: brightness(0.96);
  background: var(--tint);
}
.shift strong,
.shift span {
  display: block;
}
.shift span {
  font-weight: 450;
  font-size: 11px;
  color: #3b4148;
}
.shift.bad {
  outline: 1.5px solid #bd4929;
}
.shift.mine {
  border-left-width: 4px;
  box-shadow: inset 0 0 0 1px var(--ink);
  font-weight: 700;
}
.grid.dense td {
  padding: 1px 3px;
}
.grid.dense .labelcell {
  padding: 2px 6px;
}
.grid.dense .store-badge {
  font-size: 11.5px;
}
.grid.dense .shift-label {
  font-size: 10.5px;
}
.grid.dense .shift {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px;
  padding: 2px 4px;
  font-size: 11px;
  line-height: 1.15;
}
.grid.dense .shift strong {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.grid.dense .shift span {
  flex-shrink: 0;
  font-size: 10.5px;
}
.grid.dense .plus.empty-plus {
  min-height: 20px;
}
.plus {
  border: 0;
  background: none;
  color: #606973;
  padding: 0;
  font-size: 14px;
  line-height: 1;
}
.plus.empty-plus {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 26px;
  border-radius: 4px;
}
.plus.mini {
  width: 18px;
  min-height: 22px;
  border-radius: 4px;
  font-size: 13px;
  opacity: 0.6;
}
.cell-shifts:hover .plus.mini,
.plus.mini:focus-visible,
.plus.empty-plus:hover {
  opacity: 1;
  background: #edf0f2;
}
.mobileagenda {
  display: none;
}
.footer {
  padding: 4px 12px;
  border-top: 1px solid var(--line);
  background: #fafbfc;
  flex-shrink: 0;
  flex-wrap: wrap;
}
.footer-btn {
  padding: 2px 9px;
  font-size: 12px;
  border-radius: 5px;
}
.warning {
  color: #843b1e;
  background: #fff3e8;
  border: 1px solid #ebcfb0;
  border-radius: 6px;
  padding: 6px 10px;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12.5px;
  flex-shrink: 0;
}
.conflict-list {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  max-height: 60px;
  overflow-y: auto;
}
.chip-btn {
  padding: 3px 8px;
  font-size: 12px;
}
.hours-note {
  font-size: 12.5px;
  margin-top: 6px;
  color: #7c3b20;
}
.stats {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-top: 8px;
  max-height: 50dvh;
  overflow-y: auto;
}
.stat {
  border-radius: 5px;
  background: #f0f2f4;
  padding: 4px 9px;
  font-size: 12.5px;
}
.publish-delta {
  margin: 6px 0 12px;
  font-weight: 600;
}

/* Panels, My shifts, Time off, Alerts */
.panel {
  padding: 12px 14px;
  margin: 0;
}
.item {
  padding: 9px 12px;
  margin: 0;
}
.item h2 {
  font-size: 14.5px;
  letter-spacing: normal;
}
.hero {
  overflow-wrap: anywhere;
  background: #eff5f1;
  border: 1px solid #d6e3db;
  color: #23282e;
  border-radius: 6px;
  padding: 9px 13px;
  margin: 0;
  flex-shrink: 0;
}
.hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.hero small {
  color: #335844;
  font-weight: 650;
}
.hero h2 {
  font-size: 16.5px;
  margin: 2px 0 1px;
}
.hero p {
  margin: 0;
  font-size: 13.5px;
}
.shifts-panel {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: hidden;
}
.shift-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  gap: 6px;
}
.shift-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px 10px;
  flex-wrap: wrap;
  padding: 7px 10px;
  font-size: 13px;
}
.cards-grid {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  gap: 8px;
}
.leave-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.leave-main {
  flex: 1;
  min-width: 0;
}
.leave-main p {
  font-size: 13px;
  margin-top: 2px;
}
.full-note {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.leave-note {
  display: block;
  max-width: 100%;
  min-width: 0;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.compact-btn {
  flex-shrink: 0;
  padding: 5px 10px;
  font-size: 12.5px;
}
.failure-panel {
  flex-shrink: 0;
  background: #fff9f5;
  border-color: #ead3c1;
  padding: 8px 12px;
}
.failure-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 4px;
  font-size: 13px;
}
.failure-meta {
  min-width: 0;
  flex: 1;
}
.failure-meta p {
  margin-top: 1px;
  font-size: 12.5px;
}
.notices-wrap {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow: hidden;
}
.notice-card p {
  margin-top: 2px;
  font-size: 13px;
}
.empty {
  padding: 18px;
  text-align: center;
  color: var(--muted);
}
.stack {
  display: grid;
  gap: 10px;
}

/* Spreadsheet import workflow */
.import-panel {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
}
.import-top {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  align-items: end;
  flex-shrink: 0;
}
.import-top:has(#sheet:not(:empty)) {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.sheet-inline {
  display: contents;
}
.import-step {
  min-width: 0;
}
.import-step details {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 7px 10px;
  background: #fbfcfd;
}
.map-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px 12px;
  margin-top: 8px;
}
.match-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.id-body {
  display: grid;
  gap: 8px;
  margin-top: 6px;
  max-height: 44dvh;
  overflow-y: auto;
}
.match-group h2 {
  font-size: 13.5px;
  color: #3c434a;
}
.step-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}
.importrow {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: 12.5px;
}
.importrow span {
  overflow-wrap: anywhere;
}
.preview-step {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow: hidden;
}
.preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  flex-shrink: 0;
}
.scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 5px;
}
.listtable {
  width: 100%;
  border-collapse: collapse;
}
.listtable td,
.listtable th {
  padding: 5px 7px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 12.5px;
}
.listtable thead th {
  position: sticky;
  top: 0;
  background: #f5f7f9;
}

/* Dialogs, forms, and toast */
dialog {
  padding: 0;
  width: min(540px, 95vw);
  max-height: 94dvh;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: inherit;
  box-shadow: 0 20px 80px #20232826;
}
dialog::backdrop {
  background: #20232866;
}
#modalBody {
  padding: 14px 16px;
}
.cardhead {
  margin-bottom: 10px;
}
.form {
  display: grid;
  gap: 8px;
  min-width: 0;
}
#modalBody .form {
  grid-template-columns: minmax(0, 1fr);
}
.pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
label {
  display: grid;
  gap: 3px;
  font-size: 12.5px;
  font-weight: 650;
  min-width: 0;
}
input,
select,
textarea {
  width: 100%;
  min-width: 0;
  padding: 6px 9px;
  border: 1px solid #c8cdd2;
  border-radius: 5px;
  background: white;
  color: #252a30;
}
textarea {
  resize: vertical;
}
input[type="checkbox"] {
  width: auto;
}
.check {
  display: flex;
  align-items: center;
  gap: 7px;
}
.modal-foot {
  justify-content: space-between;
  margin-top: 2px;
}
.spacer {
  flex: 1;
}
.review-summary {
  font-size: 13px;
  margin-bottom: 8px;
}
.account-head {
  font-size: 13.5px;
}
.disclosure {
  line-height: 1.32;
  font-size: 11.5px;
}
fieldset {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 8px 10px;
}
fieldset .pair + .pair {
  margin-top: 6px;
}
.error {
  color: #962c22;
  font-size: 13px;
}
.actions.end {
  justify-content: flex-end;
}
#toast {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 5px;
  background: #32373c;
  color: white;
  padding: 8px 14px;
  z-index: 3;
  max-width: 90vw;
  font-size: 13.5px;
}
#toast:empty {
  display: none;
}
details summary {
  cursor: pointer;
  font-weight: 650;
  font-size: 13px;
}
.item,
.panel,
.cardhead,
#modalBody,
.userbtn {
  overflow-wrap: anywhere;
}

.compact-label,
.compact-account,
#sheet:empty,
#mapping:empty,
#identities:empty,
#preview:empty,
.error:empty {
  display: none;
}
.menu-list {
  display: grid;
  gap: 5px;
}
.menu-list button {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  text-align: left;
}
.menu-list .on {
  background: #e7f0eb;
}

/* Tablet and compact top-bar navigation */
@media (max-width: 70rem) {
  .shell {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
  }
  aside {
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px 10px;
    padding: 6px 12px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    overflow: visible;
  }
  nav {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
  }
  nav button {
    padding: 7px 10px;
    gap: 6px;
  }
  #user {
    margin: 0 0 0 auto;
    padding: 0;
    border: 0;
  }
  .userbtn {
    width: auto;
  }
  main {
    padding: 10px 12px;
  }
}

@media (max-width: 64rem) {
  .map-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Mobile schedule agenda inside narrow board container */
@container (max-width: 48rem) {
  .gridwrap {
    display: none;
  }
  .mobileagenda {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  .daytabs {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 2px;
    padding: 3px 6px;
    border-bottom: 1px solid var(--line);
    background: #f6f8f9;
    flex-shrink: 0;
  }
  .daytab {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    min-width: 0;
    min-height: 36px;
    padding: 2px 1px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    font-size: 11px;
    line-height: 1.05;
  }
  .daytab strong {
    font-size: 12px;
  }
  .dt-w {
    font-size: 9.5px;
    color: var(--muted);
  }
  .dt-c {
    font-style: normal;
    font-size: 9px;
    color: var(--muted);
  }
  .daytab.is-today:not(.on) {
    background: #e7f0eb;
    border-color: #c5d9cd;
  }
  .daytab.on {
    background: var(--action);
    color: #fff;
    border-color: var(--action);
  }
  .daytab.on .dt-w,
  .daytab.on .dt-c {
    color: #dcebe3;
  }
  .agenda-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 4px 6px;
    display: flex;
    flex-direction: column;
    gap: 3px;
  }
  .agenda-store {
    min-width: 0;
    overflow-wrap: anywhere;
  }
  .agenda-store > h3 {
    display: flex;
    align-items: center;
    padding-bottom: 2px;
    margin-bottom: 3px;
    border-bottom: 1px solid var(--line);
  }
  .compact-store {
    border: 1px solid #e6e9ec;
    border-radius: 6px;
    padding: 3px 6px;
    background: #fff;
  }
  .compact-day {
    display: grid;
    grid-template-columns: 4.2rem minmax(0, 1fr);
    align-items: center;
    gap: 5px;
    border: 1px solid #e6e9ec;
    border-radius: 6px;
    padding: 3px 6px;
    background: #fff;
  }
  .compact-day + .compact-day {
    margin-top: 3px;
  }
  .store-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
  }
  .store-line h3 {
    font-size: 11.5px;
    display: flex;
    align-items: center;
    min-width: 0;
    flex: 1;
  }
  .day-col {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 3px;
    min-width: 0;
  }
  .day-col h4 {
    font-size: 11.5px;
    line-height: 1.15;
  }
  .no-shift {
    font-size: 10.5px;
  }
  .day-plus {
    width: 22px;
    min-height: 19px;
    border-radius: 4px;
    background: #f1f3f5;
    font-size: 14px;
    flex-shrink: 0;
  }
  .day-shifts {
    display: grid;
    gap: 3px;
    margin-top: 2px;
  }
  .compact-day .day-shifts {
    margin-top: 0;
  }
  .day-shifts.two-col {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .mobileagenda .shift {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 4px;
    padding: 3px 5px;
    min-height: 24px;
    font-size: 11px;
    line-height: 1.15;
  }
  .mobileagenda .shift strong {
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .mobileagenda .shift span {
    flex-shrink: 0;
    font-size: 10px;
  }
  .mobileagenda .shift em {
    font-style: normal;
    color: #545d66;
  }
  .mobileagenda .day-shifts.two-col .shift em {
    display: none;
  }
}

/* Keep the primary navigation in a single row at compact widths */
@media (max-width: 52rem) {
  aside {
    display: grid;
    grid-template-columns: minmax(0, 4fr) minmax(0, 1fr);
    gap: 2px;
    padding: 4px max(6px, env(safe-area-inset-right)) 4px max(6px, env(safe-area-inset-left));
  }
  #nav {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 2px;
  }
  #user {
    margin: 0;
    align-self: stretch;
  }
  #nav .secondary-tab,
  .wide-label,
  .userbtn {
    display: none;
  }
  .compact-label {
    display: inline;
  }
  #nav button,
  .compact-account {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    text-align: center;
    min-width: 0;
    min-height: 44px;
    padding: 3px 1px;
    border: 0;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.12;
  }
  #nav .nav-badge {
    position: absolute;
    top: 2px;
    right: 6px;
    margin: 0;
    min-width: 15px;
    height: 15px;
    padding: 0 4px;
    font-size: 10px;
    line-height: 15px;
  }
  .compact-account {
    width: 100%;
    height: 100%;
    background: transparent;
  }
  #nav button.on,
  .compact-account.on {
    color: #244f39;
    background: #e6f0e9;
  }
  #nav .icon,
  .compact-account .icon {
    width: 18px;
    height: 18px;
  }
  .cards-grid,
  .shift-list {
    grid-template-columns: minmax(0, 1fr);
  }
  .import-top,
  .import-top:has(#sheet:not(:empty)) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 37rem) {
  main {
    padding: 5px clamp(7px, 2.2vw, 10px) max(5px, env(safe-area-inset-bottom));
    gap: 4px;
  }
  h1 {
    font-size: 16.5px;
  }
  h2 {
    font-size: 14px;
  }
  .heading {
    gap: 5px;
  }
  .heading.compact-hide-heading {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    margin: 0;
    padding: 0;
  }
  .heading > .actions {
    gap: 4px;
  }
  .heading > .actions:empty {
    display: none;
  }
  .heading button {
    padding: 4px 8px;
    font-size: 12px;
  }
  .toolbar {
    padding: 4px 7px;
    gap: 4px;
  }
  .tb-top,
  .tb-sub {
    width: 100%;
    justify-content: space-between;
  }
  #storeFilter {
    flex: 1;
    min-width: 0;
  }
  .arrows {
    display: inline-grid;
    grid-template-columns: 30px auto 30px;
    gap: 0;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: white;
  }
  .arrows button {
    border: 0;
    border-radius: 6px;
    min-height: 29px;
    padding: 2px 7px;
    font-size: 12px;
  }
  .arrows button + button {
    border-left: 1px solid var(--line);
  }
  .arrows [aria-label*="week"] {
    font-size: 16px;
    line-height: 1;
  }
  .panel,
  #modalBody {
    padding: 9px 11px;
  }
  .hero {
    padding: 6px 10px;
  }
  .hero h2 {
    font-size: 14.5px;
  }
  .item {
    padding: 6px 10px;
  }
  .pair:not(.keep-pair) {
    grid-template-columns: minmax(0, 1fr);
  }
  input:not([type="checkbox"]),
  select,
  textarea {
    font-size: 16px;
    padding: 5px 8px;
    min-height: 34px;
  }
  #modalBody button {
    min-height: 36px;
  }
  .map-grid,
  .match-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
  }
  .importrow {
    grid-template-columns: 6.8rem minmax(0, 1fr);
    gap: 6px;
  }
  .scroll {
    border: 0;
  }
  .listtable,
  .listtable tbody {
    display: block;
  }
  .listtable thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
  .listtable tr {
    display: grid;
    padding: 5px 9px;
    margin-bottom: 5px;
    border: 1px solid var(--line);
    border-radius: 7px;
  }
  .listtable td {
    display: grid;
    grid-template-columns: 6.2em minmax(0, 1fr);
    gap: 5px;
    padding: 1px 0;
    border: 0;
    font-size: 12px;
    overflow-wrap: anywhere;
  }
  .listtable td::before {
    content: attr(data-label);
    color: var(--muted);
  }
  .listtable td:empty {
    display: none;
  }
  #toast {
    width: max-content;
    bottom: max(12px, env(safe-area-inset-bottom));
  }
}

@media (max-width: 22.5rem) {
  .keep-pair {
    grid-template-columns: minmax(0, 1fr);
  }
}

body.checking-identity > * {
  visibility: hidden;
}

#chatLog, #draftReview { max-height: 28dvh; overflow: auto; overflow-wrap: anywhere; }
#chatLog p { white-space: pre-wrap; }
#draftReview:empty, #chatLog:empty { display: none; }
#availabilityForm fieldset { min-width: 0; border: 1px solid #ccd3da; border-radius: .45rem; }
.availability-window { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; margin: .4rem 0; }
.availability-window input { width: auto; }

/* ==========================================================================
   Schdule.com Multi-Tenant, Branding, Dark Mode, Settings, Hub & Super Admin
   ========================================================================== */

/* Sidebar business brand header */
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 8px 12px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--line);
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
}
.sidebar-brand img {
  border-radius: 7px;
  object-fit: cover;
  flex: none;
}
.sidebar-brand span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@media (max-width: 52rem) {
  .sidebar-brand {
    display: none;
  }
}

/* Override active nav tint with tenant color */
aside nav button.on,
.menu-list button.on {
  background: var(--action-soft);
  color: var(--action);
  border-color: var(--action-border);
}

/* Login & signed-out enhancements */
.signed-out-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.06);
}
.signed-out-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 16px;
  margin-bottom: 14px;
}
.signed-out-brand img {
  border-radius: 8px;
  object-fit: cover;
}
.login-form {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}
.login-form label {
  display: grid;
  gap: 5px;
  font-size: 13px;
  font-weight: 600;
}
.login-form input {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
}
.full-btn {
  width: 100%;
  text-align: center;
  padding: 10px 14px;
  display: inline-block;
  text-decoration: none;
}
.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: 5px;
  padding: 6px 11px;
  font-weight: 600;
  line-height: 1.25;
}
.button-link:hover {
  background: var(--surface-alt);
}
.form-error {
  background: rgba(160, 63, 45, 0.12);
  border: 1px solid rgba(160, 63, 45, 0.35);
  color: #a03f2d;
  padding: 9px 12px;
  border-radius: 6px;
  font-size: 13px;
  margin: 8px 0;
}
.login-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 0;
  color: var(--muted);
  font-size: 12px;
}
.login-divider::before,
.login-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}
.demo-box {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
  display: grid;
  gap: 8px;
}
.demo-box-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.demo-box-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.demo-box-links,
.signed-out-sub {
  font-size: 13px;
  color: var(--muted);
  margin: 4px 0 0;
}
.demo-box-links a,
.signed-out-sub a {
  color: var(--action);
}

/* Business Settings screen (inside zero-scroll main frame) */
.settings-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 2px 2px 16px;
  display: grid;
  gap: 14px;
  align-content: start;
}
.settings-form {
  display: grid;
  gap: 14px;
  max-width: 820px;
}
.settings-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  display: grid;
  gap: 12px;
}
.settings-card h3 {
  margin: 0;
  font-size: 15px;
}
.settings-card label {
  display: grid;
  gap: 5px;
  font-size: 13px;
  font-weight: 600;
}
.settings-card label.check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}
.settings-card input[type="text"],
.settings-card input[type="email"],
.settings-card input[type="password"],
.settings-card select,
.settings-card textarea {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
}
.settings-card input[type="color"] {
  width: 100%;
  height: 36px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  cursor: pointer;
}
.settings-grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}
.settings-grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}
.settings-domains {
  font-size: 13px;
  color: var(--muted);
}
.theme-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.preset-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13px;
}
.preset-chip.on {
  border-color: var(--action);
  background: var(--action-soft);
  color: var(--action);
}
.swatch-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: inline-block;
  border: 1px solid rgba(0, 0, 0, 0.18);
  flex: none;
}
.brand-upload {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px dashed var(--line);
  border-radius: 8px;
}
.brand-preview {
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand-preview img {
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--line);
}
.settings-team-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.team-list {
  display: grid;
  gap: 8px;
}
.team-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-alt);
}
.team-row.inactive {
  opacity: 0.6;
}
.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--action-soft);
  color: var(--action);
  vertical-align: middle;
}
.badge.warn {
  background: rgba(160, 63, 45, 0.14);
  color: #a03f2d;
}

/* Platform Hub & Super Admin Console (scrollable pages) */
.hub-body,
.admin-body {
  overflow-y: auto;
  background: var(--surface-alt);
}
.hub-page {
  max-width: 960px;
  margin: 0 auto;
  padding: 28px 18px 48px;
  display: grid;
  gap: 24px;
}
.hub-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.hub-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.hub-brand h1 {
  margin: 0;
  font-size: 22px;
}
.hub-brand p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 14px;
}
.hub-logo {
  width: 44px;
  height: 44px;
  border-radius: 11px;
  background: var(--action);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 22px;
  flex: none;
}
.hub-logo.small {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  font-size: 16px;
}
.hub-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 22px;
}
.hub-card h2,
.hub-section h2 {
  margin: 0 0 8px;
  font-size: 17px;
}
.hub-finder {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.subdomain-input {
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  overflow: hidden;
  flex: 1;
  min-width: 220px;
}
.subdomain-input input {
  border: 0;
  padding: 9px 11px;
  flex: 1;
  outline: none;
  background: transparent;
  color: var(--text);
}
.subdomain-input span {
  padding: 0 12px;
  color: var(--muted);
  font-weight: 600;
  background: var(--surface-alt);
  border-left: 1px solid var(--line);
  align-self: stretch;
  display: flex;
  align-items: center;
}
.hub-grid,
.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 14px;
}
.biz-card {
  display: grid;
  gap: 10px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.biz-card:hover {
  border-color: var(--action);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}
.biz-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.biz-card-head img,
.admin-biz-head img {
  border-radius: 8px;
  object-fit: cover;
  flex: none;
}
.biz-card-head > div {
  flex: 1;
  min-width: 0;
}
.biz-card-name {
  font-weight: 700;
  font-size: 15px;
}
.biz-card-sub {
  font-size: 12px;
  color: var(--muted);
}
.biz-card-domains {
  font-size: 12px;
  color: var(--muted);
}
.biz-card-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

/* Super Admin layout */
.admin-app {
  min-height: 100vh;
}
.admin-topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.admin-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.admin-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.admin-main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 22px 18px 48px;
  display: grid;
  gap: 28px;
}
.admin-section-head h2,
.admin-section h2 {
  margin: 0 0 6px;
  font-size: 18px;
}
.admin-biz-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
  display: grid;
  gap: 12px;
}
.admin-biz-card.inactive {
  opacity: 0.65;
}
.admin-biz-head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.admin-biz-title {
  flex: 1;
  min-width: 0;
}
.admin-biz-title h3 {
  margin: 0;
  font-size: 15px;
}
.admin-biz-details {
  display: grid;
  gap: 5px;
  font-size: 13px;
}
.admin-biz-foot {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}
.admin-list {
  display: grid;
  gap: 8px;
  max-width: 640px;
}
.admin-list-row {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
#adminModal {
  width: min(94vw, 660px);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0;
  background: var(--surface);
  color: var(--text);
}
#adminModal::backdrop {
  background: rgba(15, 23, 42, 0.45);
}
.modal-form {
  padding: 18px 20px;
  display: grid;
  gap: 12px;
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.modal-head h2 {
  margin: 0;
  font-size: 17px;
}
.modal-form label {
  display: grid;
  gap: 4px;
  font-size: 13px;
  font-weight: 600;
}
.modal-form label.inline-check {
  display: flex;
  align-items: center;
  gap: 7px;
  font-weight: 500;
}
.modal-form input[type="text"],
.modal-form input[type="email"],
.modal-form input[type="password"],
.modal-form select,
.modal-form textarea {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
}
.modal-form input[type="color"] {
  width: 100%;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 2px;
}
.form-grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}
.form-grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}
.sub-fieldset {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  margin: 0;
}
.sub-fieldset legend {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  padding: 0 6px;
}
.muted {
  color: var(--muted);
}

/* ==========================================================================
   Dark Mode Support (explicit dark or auto following OS preference)
   ========================================================================== */
html[data-theme-mode="dark"] {
  color-scheme: dark;
  --bg: #0f141a;
  --surface: #171e26;
  --surface-alt: #1e2732;
  --text: #e6edf3;
  --muted: #93a1b1;
  --line: #2d3846;
}
@media (prefers-color-scheme: dark) {
  html[data-theme-mode="auto"] {
    color-scheme: dark;
    --bg: #0f141a;
    --surface: #171e26;
    --surface-alt: #1e2732;
    --text: #e6edf3;
    --muted: #93a1b1;
    --line: #2d3846;
  }
}
html[data-theme-mode="dark"] aside,
html[data-theme-mode="dark"] .panel,
html[data-theme-mode="dark"] dialog,
html[data-theme-mode="dark"] .grid th,
html[data-theme-mode="dark"] .grid td,
html[data-theme-mode="dark"] .shift,
html[data-theme-mode="dark"] input,
html[data-theme-mode="dark"] select,
html[data-theme-mode="dark"] textarea {
  background-color: var(--surface);
  color: var(--text);
  border-color: var(--line);
}
html[data-theme-mode="dark"] .grid thead th {
  background-color: var(--surface-alt);
}
html[data-theme-mode="dark"] .shift.mine {
  background-color: var(--action-soft-strong);
  border-color: var(--action);
}
@media (prefers-color-scheme: dark) {
  html[data-theme-mode="auto"] aside,
  html[data-theme-mode="auto"] .panel,
  html[data-theme-mode="auto"] dialog,
  html[data-theme-mode="auto"] .grid th,
  html[data-theme-mode="auto"] .grid td,
  html[data-theme-mode="auto"] .shift,
  html[data-theme-mode="auto"] input,
  html[data-theme-mode="auto"] select,
  html[data-theme-mode="auto"] textarea {
    background-color: var(--surface);
    color: var(--text);
    border-color: var(--line);
  }
  html[data-theme-mode="auto"] .grid thead th {
    background-color: var(--surface-alt);
  }
  html[data-theme-mode="auto"] .shift.mine {
    background-color: var(--action-soft-strong);
    border-color: var(--action);
  }
}
