:root {
  --bg: #f4f6f1;
  --surface: #ffffff;
  --surface-soft: #f9faf6;
  --ink: #202624;
  --muted: #66706a;
  --line: #d9ded4;
  --cocoa: #583526;
  --cocoa-dark: #2c201b;
  --leaf: #16745f;
  --wine: #9a3148;
  --gold: #b7791f;
  --blue: #2d63b8;
  --danger: #b3261e;
  --shadow: 0 18px 50px rgba(41, 35, 29, 0.11);
  --radius: 8px;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  letter-spacing: 0;
}

button,
input,
textarea {
  font: inherit;
}

button {
  border: 0;
}

svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  flex: 0 0 auto;
}

.sprite {
  display: none;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 22px;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 250px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: var(--radius);
  background: var(--cocoa);
  color: #fff;
  font-weight: 800;
}

.brand h1,
.brand p,
h2,
h3 {
  margin: 0;
}

.brand h1 {
  font-size: 19px;
  line-height: 1.1;
}

.brand p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.view-tabs {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 13px;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
}

.tab.is-active {
  background: var(--cocoa-dark);
  color: #fff;
}

.app-shell {
  width: min(1500px, 100%);
  margin: 0 auto;
  padding: 18px;
}

.view {
  display: none;
}

.view.is-active {
  display: block;
}

.toolbar,
.request-panel,
.employee-pool,
.assignment-section,
.panel,
.directory-panel,
.share-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.toolbar,
.request-panel,
.employee-pool,
.assignment-section,
.panel,
.directory-panel {
  padding: 16px;
}

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

.toolbar h2,
.section-head h2 {
  font-size: 20px;
  line-height: 1.25;
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.eyebrow {
  display: block;
  margin-bottom: 4px;
  color: var(--leaf);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.counter {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: #edf5f2;
  color: var(--leaf);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.primary-button,
.secondary-button,
.text-button,
.mini-button,
.remove-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 800;
}

.primary-button,
.secondary-button {
  min-height: 42px;
  padding: 0 13px;
}

.primary-button {
  background: var(--leaf);
  color: #fff;
}

.secondary-button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.secondary-button.full {
  width: 100%;
}

.text-button {
  min-height: 32px;
  padding: 0 8px;
  background: transparent;
  color: var(--danger);
}

.request-panel {
  margin-bottom: 16px;
}

.request-panel textarea,
.field input,
.field textarea,
.search-box,
.note-box {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  color: var(--ink);
}

.request-panel textarea,
.field input,
.field textarea,
.note-box {
  padding: 10px;
}

textarea {
  resize: vertical;
}

.workbench {
  display: grid;
  grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.employee-pool {
  position: sticky;
  top: 88px;
  display: grid;
  gap: 12px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
}

.search-box input {
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
}

.search-box.compact {
  width: min(280px, 100%);
  box-shadow: none;
}

.selected-strip,
.assigned-list,
.share-people {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.selected-strip {
  min-height: 34px;
}

.pool-list {
  display: grid;
  max-height: 470px;
  overflow: auto;
  gap: 7px;
  padding-right: 4px;
}

.person-option {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  min-height: 38px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  cursor: pointer;
}

.person-option:hover {
  border-color: #a8b7ad;
}

.person-option.is-assigned {
  border-color: #d88b84;
  background: #fff0ef;
  color: #8c1d18;
}

.person-option.is-assigned input {
  accent-color: var(--danger);
}

.person-option input {
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  accent-color: var(--leaf);
}

.person-option span {
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.25;
}

.cleaning-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
  align-items: start;
}

.cleaning-card {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-top: 7px solid var(--plant-color, var(--leaf));
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.cleaning-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.cleaning-title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.cleaning-number {
  display: inline-grid;
  place-items: center;
  min-width: 34px;
  height: 34px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--plant-color, var(--leaf));
  color: #fff;
  font-weight: 900;
}

.cleaning-title h3 {
  font-size: 18px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.card-actions,
.row-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.mini-button {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.mini-button.delete {
  color: var(--danger);
}

.cleaning-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.meta-tile {
  min-width: 0;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.meta-tile.wide {
  grid-column: 1 / -1;
}

.meta-tile span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.meta-tile strong {
  display: block;
  overflow-wrap: anywhere;
  line-height: 1.25;
}

.note-box {
  min-height: 68px;
}

.assignment-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.assignment-row strong {
  font-size: 14px;
}

.name-chip {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  gap: 5px;
  padding: 5px 8px;
  border: 1px solid #d5d9d0;
  border-radius: 999px;
  background: #fff;
  font-size: 13px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.remove-chip {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #eef1ea;
  color: var(--danger);
}

.remove-chip svg {
  width: 14px;
  height: 14px;
}

.source-line,
.empty-state {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.source-line {
  padding: 9px;
  border-radius: var(--radius);
  background: #fff;
}

.field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.field span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.share-layout {
  display: grid;
  grid-template-columns: minmax(260px, 330px) minmax(320px, 520px);
  gap: 18px;
  align-items: start;
  justify-content: center;
}

.share-controls {
  position: sticky;
  top: 88px;
  display: grid;
  gap: 14px;
}

.share-buttons {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.share-card {
  width: min(520px, 100%);
  min-height: 640px;
  padding: 0;
  overflow: hidden;
}

.share-cover {
  padding: 22px;
  background: var(--cocoa-dark);
  color: #fff;
}

.share-cover .eyebrow {
  color: #f1bf6f;
}

.share-cover h2 {
  margin-top: 4px;
  font-size: 28px;
}

.share-cover p {
  margin: 8px 0 0;
  color: rgba(255, 255, 255, 0.76);
}

.share-body {
  display: grid;
  gap: 10px;
  padding: 14px;
  background: #fff;
}

.share-item {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-left: 7px solid var(--plant-color, var(--leaf));
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.share-item-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.share-item h3 {
  margin: 0;
  font-size: 18px;
  overflow-wrap: anywhere;
}

.share-time {
  color: var(--cocoa-dark);
  font-size: 22px;
  font-weight: 900;
  white-space: nowrap;
}

.share-note {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.share-footer {
  padding: 14px 18px 18px;
  border-top: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.35;
  text-align: center;
}

.employees-layout {
  display: grid;
  grid-template-columns: minmax(300px, 380px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.employee-form {
  display: grid;
  gap: 12px;
}

.employee-list {
  display: grid;
  gap: 8px;
}

.employee-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.employee-row strong {
  overflow-wrap: anywhere;
  line-height: 1.25;
}

.app-footer {
  width: min(1500px, 100%);
  margin: 0 auto 18px;
  padding: 0 18px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  text-align: center;
}

.modal-open {
  overflow: hidden;
}

.employee-modal[hidden] {
  display: none;
}

.employee-modal {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 18px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(32, 38, 36, 0.45);
}

.modal-panel {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 12px;
  width: min(560px, 100%);
  max-height: min(760px, calc(100vh - 36px));
  overflow: hidden;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.modal-list {
  max-height: min(460px, 52vh);
}

.modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 50;
  max-width: min(420px, calc(100vw - 36px));
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--cocoa-dark);
  color: #fff;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.exit-shot {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 80;
  display: none;
  min-height: 42px;
  padding: 0 14px;
  border-radius: var(--radius);
  background: var(--cocoa-dark);
  color: #fff;
  cursor: pointer;
  font-weight: 800;
}

body.shot-mode {
  background: #e9ece4;
}

body.shot-mode .app-header,
body.shot-mode .app-footer,
body.shot-mode .share-controls,
body.shot-mode .view:not([data-view="share"]) {
  display: none;
}

body.shot-mode .app-shell {
  width: 100%;
  padding: 16px;
}

body.shot-mode .share-layout {
  display: grid;
  grid-template-columns: minmax(320px, 520px);
  justify-content: center;
}

body.shot-mode .exit-shot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

body.shot-mode .share-card {
  box-shadow: none;
}

@media (max-width: 980px) {
  .app-header {
    align-items: stretch;
    flex-direction: column;
  }

  .brand {
    min-width: 0;
  }

  .view-tabs {
    width: 100%;
    overflow-x: auto;
  }

  .tab {
    flex: 1 0 auto;
  }

  .toolbar,
  .section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .toolbar-actions {
    width: 100%;
  }

  .workbench,
  .share-layout,
  .employees-layout {
    grid-template-columns: 1fr;
  }

  .employee-pool,
  .share-controls {
    position: static;
  }
}

@media (max-width: 620px) {
  .app-shell {
    padding: 10px;
  }

  .app-header {
    padding: 12px;
  }

  .brand h1 {
    font-size: 18px;
  }

  .tab {
    padding: 0 10px;
  }

  .tab span {
    font-size: 13px;
  }

  .toolbar,
  .request-panel,
  .employee-pool,
  .assignment-section,
  .panel,
  .directory-panel {
    padding: 12px;
  }

  .toolbar-actions,
  .primary-button,
  .secondary-button {
    width: 100%;
  }

  .cleaning-board {
    grid-template-columns: 1fr;
  }
}
