:root {
  color-scheme: only light;
  --bg: #f0ede4;
  --surface: #f7f6f2;
  --surface-soft: #ece9e0;
  --text: #1e2a27;
  --text-muted: #5d6a66;
  --border: #c7d4cb;
  --shadow: 0 18px 36px -22px rgba(7, 36, 31, 0.24);
  --radius: 18px;
  --accent: #0f6b61;
  --accent-strong: #004741;
  --danger: #cf3b52;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Inter", "Segoe UI", "Roboto", sans-serif;
  font-size: clamp(15px, 0.35vw + 14px, 17px);
  line-height: 1.35;
  background: var(--bg);
  color: var(--text);
}

.board-page {
  --bg: #e2ebe5;
  background: linear-gradient(180deg, #edf3ef 0%, #d9e6de 100%);
}

.background-glow {
  position: fixed;
  inset: -220px;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(circle at 12% 12%, rgba(0, 71, 65, 0.2), transparent 40%),
    radial-gradient(circle at 88% 20%, rgba(40, 126, 110, 0.17), transparent 35%),
    radial-gradient(circle at 70% 90%, rgba(194, 181, 147, 0.2), transparent 45%);
}

.board-page .background-glow {
  background: radial-gradient(circle at 12% 10%, rgba(46, 115, 92, 0.25), transparent 42%),
    radial-gradient(circle at 86% 18%, rgba(0, 71, 65, 0.2), transparent 36%),
    radial-gradient(circle at 68% 90%, rgba(159, 176, 149, 0.2), transparent 46%);
}

.board-shell,
.admin-shell {
  width: min(1650px, calc(100vw - 36px));
  margin: 18px auto 24px;
  display: grid;
  gap: 14px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent-strong);
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  font-weight: 700;
}

.subtle {
  margin: 6px 0 0;
  color: var(--text-muted);
}

.board-header,
.admin-header {
  padding: 18px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.board-header h1,
.admin-header h1 {
  margin: 0;
  font-size: clamp(1.25rem, 2vw, 1.9rem);
}

.board-meta {
  min-width: 250px;
  display: grid;
  gap: 6px;
  justify-items: end;
}

.meta-row {
  margin: 0;
  font-size: 0.86rem;
  color: var(--text-muted);
}

.meta-row span {
  margin-right: 6px;
}

.meta-value {
  color: var(--text);
  font-size: 1rem;
  font-weight: 700;
}

.meta-value-live {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 12px;
}

.board-top-row {
  display: grid;
  grid-template-columns: minmax(320px, 1.5fr) minmax(420px, 2.2fr);
  gap: 12px;
  align-items: stretch;
}

.board-title-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  min-width: 0;
}

.board-top-stats {
  align-content: stretch;
}

.board-title-main {
  min-width: 0;
}

.board-title-meta {
  min-width: 240px;
  border-left: 1px solid var(--border);
  padding-left: 14px;
  display: grid;
  gap: 6px;
  justify-items: end;
  align-content: center;
}

.board-meta-card {
  padding: 18px 20px;
  min-width: 0;
}

.stat {
  padding: 12px 14px;
}

.stat p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat strong {
  display: block;
  margin-top: 4px;
  font-size: clamp(1.2rem, 2vw, 1.8rem);
}

.board-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.board-layout-stacked {
  width: 100%;
}

.board-layout > * {
  min-width: 0;
}

.board-sidebar-top {
  grid-area: sidebar-top;
}

.board-main-top {
  grid-area: main-top;
}

.board-sidebar-bottom {
  grid-area: sidebar-bottom;
}

.board-main-bottom {
  grid-area: main-bottom;
}

.board-notes-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}

.board-notes-grid .board-section {
  min-width: 0;
}

.board-notes-tab {
  padding: 0;
}

.board-notes-details {
  padding: 12px;
}

.board-notes-details summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 10px;
}

.board-notes-details summary::-webkit-details-marker {
  display: none;
}

.board-notes-summary-main {
  display: grid;
  gap: 2px;
}

.board-notes-summary-main strong {
  font-size: 1rem;
}

.board-notes-summary-main span {
  color: var(--text-muted);
  font-size: 0.82rem;
}

.board-notes-inner-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.board-note-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-soft);
  padding: 10px;
}

.board-note-item h3 {
  margin: 0 0 6px;
  font-size: 0.9rem;
}

.board-sidebar {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.board-sidebar-pair {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.board-main {
  display: grid;
  gap: 12px;
  width: 100%;
  min-width: 0;
}

.board-main > .board-section,
.board-lower-grid,
.board-lower-grid > .board-section,
.board-bottom-gantt {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.board-bottom-gantt {
  width: 100%;
}

.board-section {
  padding: 12px;
}

.board-jobs-card {
  padding: 0;
}

.board-jobs-details {
  padding: 12px;
}

.board-jobs-details summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 10px;
}

.board-jobs-details summary::-webkit-details-marker {
  display: none;
}

.board-jobs-summary-main {
  display: grid;
  gap: 2px;
}

.board-jobs-summary-main strong {
  font-size: 1rem;
}

.board-jobs-summary-main span {
  color: var(--text-muted);
  font-size: 0.86rem;
}

.board-section h2 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.section-heading {
  margin-bottom: 10px;
}

.section-heading h2 {
  margin-bottom: 2px;
}

.section-heading p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.86rem;
}

.crew-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.crew-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-soft);
  padding: 8px 10px;
}

.crew-name {
  margin: 0 0 2px;
  font-weight: 700;
  font-size: 0.9rem;
}

.crew-update {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.84rem;
  line-height: 1.25;
}

.area-text {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.86rem;
  line-height: 1.35;
  white-space: pre-wrap;
}

.area-list {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--text-muted);
  font-size: 0.86rem;
  line-height: 1.35;
  display: grid;
  gap: 4px;
}

.area-list-empty {
  list-style: none;
  margin-left: -1.1rem;
}

.board-lower-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.board-notes-grid .board-sidebar-pair {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.board-row-separator {
  grid-area: separator;
  height: 1px;
  border: 0;
  background: linear-gradient(
    90deg,
    rgba(145, 176, 163, 0.14) 0%,
    rgba(145, 176, 163, 0.8) 12%,
    rgba(145, 176, 163, 0.8) 88%,
    rgba(145, 176, 163, 0.14) 100%
  );
  margin: 0;
}

.button {
  border: 1px solid var(--border);
  background: var(--surface-soft);
  color: var(--text);
  border-radius: 10px;
  font-weight: 600;
  padding: 9px 14px;
  text-decoration: none;
  cursor: pointer;
  transition: transform 120ms ease, background-color 120ms ease, border-color 120ms ease;
}

.button:hover {
  transform: translateY(-1px);
  border-color: #9fbdb4;
}

.button:active {
  transform: translateY(0);
}

.primary-button {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.primary-button:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
}

.subtle-button {
  background: var(--surface);
}

.button:disabled {
  opacity: 0.56;
  cursor: not-allowed;
  transform: none;
}

.restart-app-button {
  border-color: rgba(207, 131, 62, 0.38);
  background: #fff0dc;
}

.restart-app-button.is-working {
  border-color: rgba(47, 143, 91, 0.42);
  background: #edf8f0;
}

.dark-button {
  background: #111;
  border-color: #111;
  color: #fff;
}

.dark-button:hover {
  background: #000;
  border-color: #000;
}

.dark-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.admin-header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-start;
  justify-content: flex-end;
}

.admin-page {
  position: relative;
  background:
    radial-gradient(circle at 14% 10%, rgba(70, 129, 108, 0.36), transparent 34%),
    radial-gradient(circle at 86% 18%, rgba(107, 150, 130, 0.3), transparent 36%),
    radial-gradient(circle at 72% 88%, rgba(161, 176, 145, 0.26), transparent 44%),
    linear-gradient(180deg, #e6eee9 0%, #cfddd3 48%, #bfd3c6 100%);
}

.admin-page.admin-identity-locked {
  overflow: hidden;
}

.admin-page.admin-identity-locked .admin-shell {
  opacity: 0.58;
  filter: blur(12px) saturate(0.72) brightness(0.72);
  transform: scale(0.985);
  pointer-events: none;
  user-select: none;
}

.admin-identity-gate {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(8px);
  transition:
    opacity 560ms ease,
    transform 560ms ease,
    visibility 0s linear 560ms;
  background:
    radial-gradient(
      circle at 50% 46%,
      rgba(20, 39, 30, 0.04) 0%,
      rgba(15, 30, 23, 0.18) 52%,
      rgba(8, 16, 12, 0.44) 100%
    ),
    linear-gradient(to bottom, rgba(5, 22, 18, 0.52), rgba(15, 43, 33, 0.42)),
    url("https://images.unsplash.com/photo-1558974708-a164926a5a83?auto=format&fit=crop&w=2400&q=80");
  background-size: cover;
  background-position: center 42%;
}

.admin-identity-center {
  width: min(1040px, 100%);
  min-height: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 8px 0;
}

.admin-page.admin-identity-locked .admin-identity-gate {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
  transition-delay: 0s;
}

.admin-identity-card {
  position: relative;
  z-index: 3;
  width: min(350px, calc(100% - 20px));
  padding: 18px;
  background: rgba(236, 246, 242, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.72);
  box-shadow: 0 22px 40px rgba(11, 23, 47, 0.32);
  backdrop-filter: blur(12px) saturate(1.02) brightness(0.96);
  margin: 14px auto 8px;
}

.admin-identity-card h2 {
  margin: 0;
  font-size: 1.35rem;
}

.admin-identity-sky-dock {
  position: relative;
  z-index: 3;
  width: fit-content;
  max-width: min(1040px, calc(100% - 20px));
  margin: 0 auto;
  padding: 14px 16px;
  border: 1px solid rgba(178, 209, 193, 0.58);
  border-radius: 20px;
  background: rgba(67, 93, 84, 0.22);
  backdrop-filter: blur(11px) saturate(1.08) brightness(0.94);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.14),
    0 12px 28px rgba(8, 22, 17, 0.24);
  pointer-events: auto;
}

.admin-identity-sky-label {
  margin: 0 0 10px;
  text-align: center;
  color: rgba(231, 245, 255, 0.95);
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.admin-identity-sky-dock .admin-identity-grid {
  margin-top: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: stretch;
  gap: 10px;
  width: fit-content;
  max-width: 100%;
  margin-inline: auto;
}

.admin-identity-sky-dock .admin-identity-option {
  aspect-ratio: 1 / 1;
  min-height: 0;
  width: 148px;
  flex: 0 0 148px;
  border-radius: 20px;
  padding: 12px 10px;
  align-content: center;
  justify-items: center;
  border-color: rgba(194, 225, 210, 0.52);
  background: linear-gradient(to bottom, rgba(63, 89, 81, 0.36), rgba(45, 64, 58, 0.24));
  box-shadow: 0 10px 24px rgba(6, 16, 12, 0.28);
}

.admin-identity-sky-dock .admin-identity-option:hover {
  border-color: rgba(213, 239, 228, 0.82);
  box-shadow: 0 13px 28px rgba(6, 16, 12, 0.34);
  transform: translateY(-2px);
}

.admin-identity-sky-dock .admin-identity-option.is-add-option {
  border-style: dashed;
  border-color: rgba(205, 234, 222, 0.74);
  background: linear-gradient(to bottom, rgba(74, 108, 97, 0.28), rgba(55, 78, 70, 0.2));
}

.admin-identity-sky-dock .admin-identity-option.is-add-option .admin-identity-avatar {
  font-size: 1.5rem;
  font-weight: 800;
  color: rgba(234, 247, 241, 0.95);
  background: rgba(0, 71, 65, 0.48);
}

.admin-identity-sky-dock .admin-identity-avatar {
  border-color: rgba(255, 255, 255, 0.72);
  box-shadow:
    inset 0 0 0 1px rgba(17, 22, 45, 0.08),
    0 6px 14px rgba(10, 17, 33, 0.15);
}

.admin-identity-sky-dock .admin-identity-name {
  color: rgba(239, 249, 245, 0.98);
  text-shadow: 0 1px 2px rgba(6, 13, 10, 0.56);
}

.admin-identity-add {
  border-top-color: rgba(203, 227, 255, 0.48);
}

.admin-identity-card .subtle,
.admin-identity-card label {
  color: var(--text-muted);
}

.admin-identity-card input {
  border-color: rgba(190, 206, 231, 0.7);
  background: rgba(255, 255, 255, 0.95);
}

.admin-identity-card .button {
  border-color: rgba(176, 198, 227, 0.82);
}

.admin-page .admin-shell {
  opacity: 1;
  filter: blur(0) saturate(1);
  transform: none;
  transition: opacity 520ms ease, filter 520ms ease, transform 520ms ease;
}

@media (max-width: 980px) {
  .admin-identity-center {
    min-height: calc(100dvh - 24px);
  }

  .admin-identity-sky-dock {
    padding: 12px;
  }

  .admin-identity-sky-dock .admin-identity-grid {
    flex-wrap: wrap;
  }

  .admin-identity-sky-dock .admin-identity-option {
    width: 144px;
    flex-basis: 144px;
  }
}

@media (max-width: 700px) {
  .admin-page.admin-identity-locked .admin-shell {
    opacity: 0.25;
  }

  .admin-identity-sky-dock {
    width: fit-content;
    max-width: calc(100% - 18px);
  }

  .admin-identity-sky-dock .admin-identity-grid {
    flex-wrap: wrap;
  }

  .admin-identity-sky-dock .admin-identity-option {
    width: min(170px, calc(100vw - 120px));
    flex-basis: min(170px, calc(100vw - 120px));
  }

  .admin-identity-add-row {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-identity-add-row .button {
    width: 100%;
  }
}

@media (min-width: 1025px) {
  .admin-identity-sky-dock .admin-identity-grid {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 2px;
  }
}

@media (max-width: 980px), (max-height: 820px) {
  .admin-identity-gate {
    justify-content: center;
    align-items: center;
    padding: 12px;
    overflow-y: auto;
    overflow-x: hidden;
  }

  .admin-identity-center {
    min-height: auto;
    width: min(900px, 100%);
  }

  .admin-identity-sky-dock {
    width: fit-content;
    max-width: min(860px, 100%);
    margin: 0 auto;
  }

  .admin-identity-card {
    width: min(350px, 100%);
    margin: 12px auto 4px;
  }
}

.admin-identity-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
}

.admin-identity-option {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  padding: 10px 8px;
  display: grid;
  justify-items: center;
  gap: 8px;
  cursor: pointer;
  transition: transform 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}

.admin-identity-option:hover {
  transform: translateY(-1px);
  border-color: #9fc5b7;
  box-shadow: 0 8px 16px -12px rgba(0, 71, 65, 0.4);
}

.admin-identity-avatar {
  width: 52px;
  height: 52px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  border: 1px solid rgba(255, 255, 255, 0.65);
  box-shadow: inset 0 0 0 1px rgba(17, 22, 45, 0.08);
}

.admin-identity-name {
  font-size: clamp(0.9rem, 0.2vw + 0.84rem, 1rem);
  font-weight: 700;
  color: var(--text);
  text-align: center;
}

.admin-identity-add {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
  display: grid;
  gap: 8px;
}

.admin-identity-add label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 700;
}

.admin-identity-add-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.admin-identity-add-row input {
  flex: 1;
  min-width: 0;
}

.admin-identity-feedback {
  margin: 0;
  min-height: 1.15em;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.admin-identity-feedback.is-error {
  color: #b41f3a;
}

.admin-identity-feedback.is-success {
  color: #2f7258;
}

.admin-active-identity {
  appearance: none;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 8px;
  width: 112px;
  min-height: 108px;
  padding: 10px 8px;
  border: 1px solid rgba(194, 225, 210, 0.52);
  border-radius: 20px;
  background: linear-gradient(to bottom, rgba(63, 89, 81, 0.36), rgba(45, 64, 58, 0.24));
  box-shadow: 0 10px 24px rgba(6, 16, 12, 0.28);
  color: rgba(239, 249, 245, 0.98);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  transition: transform 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}

.admin-active-identity:hover {
  border-color: rgba(213, 239, 228, 0.82);
  box-shadow: 0 13px 28px rgba(6, 16, 12, 0.34);
  transform: translateY(-2px);
}

.admin-active-identity-avatar {
  width: 52px;
  height: 52px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.28rem;
  border: 1px solid rgba(255, 255, 255, 0.72);
  box-shadow:
    inset 0 0 0 1px rgba(17, 22, 45, 0.08),
    0 6px 14px rgba(10, 17, 33, 0.15);
}

.admin-active-identity-name {
  max-width: 90px;
  font-size: 0.76rem;
  line-height: 1.15;
  color: rgba(239, 249, 245, 0.98);
  text-align: center;
  text-shadow: 0 1px 2px rgba(6, 13, 10, 0.56);
  overflow-wrap: anywhere;
}

.admin-identity-menu {
  position: relative;
  margin-left: auto;
}

.admin-identity-menu-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 35;
  min-width: 126px;
  display: none;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(247, 246, 242, 0.98);
  box-shadow: 0 12px 30px rgba(9, 30, 24, 0.14);
}

.admin-identity-menu.is-open .admin-identity-menu-panel {
  display: block;
}

.admin-identity-menu-panel .button {
  width: 100%;
  justify-content: center;
}

.admin-active-identity.is-hidden {
  display: none;
}

.settings-card,
.table-card {
  padding: 16px;
}

.admin-collapsible-controls {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.admin-collapsible-controls .subtle {
  margin: 0;
}

.admin-collapsible {
  display: grid;
  gap: 0;
}

.admin-collapsible-summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.admin-collapsible-summary::-webkit-details-marker {
  display: none;
}

.admin-summary-left {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.admin-drag-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.55rem;
  height: 1.55rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.86rem;
  letter-spacing: -1px;
  cursor: grab;
  user-select: none;
  touch-action: none;
}

.admin-drag-handle:active {
  cursor: grabbing;
}

.admin-collapsible-heading {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
  color: var(--text);
}

.admin-collapsible-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.admin-section-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.8rem;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.74rem;
  font-weight: 700;
}

.admin-collapsible-content {
  padding-top: 10px;
  display: grid;
  gap: 10px;
}

.admin-reorderable-section.is-dragging {
  opacity: 0.35;
  transform: scale(0.995);
}

.admin-reorderable-section.is-drop-target {
  outline: 2px dashed rgba(0, 71, 65, 0.38);
  outline-offset: 2px;
  transform: translateY(2px);
}

.admin-reorderable-section {
  transition: transform 120ms ease, opacity 120ms ease, outline-color 120ms ease;
}

.admin-drop-placeholder {
  border: 2px dashed rgba(0, 71, 65, 0.42);
  background: rgba(0, 71, 65, 0.1);
  box-shadow: none;
}

body.admin-reordering {
  cursor: grabbing;
}

body.admin-reordering .admin-drag-handle {
  cursor: grabbing;
}

.admin-touch-order-controls {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.admin-order-button {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  border-radius: 7px;
  width: 1.6rem;
  height: 1.6rem;
  font-size: 0.8rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.admin-order-button:hover {
  border-color: #9fbdb4;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.health-safety-editor-label {
  align-content: start;
}

.health-safety-editor {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  padding: 10px;
  display: grid;
  gap: 8px;
}

.health-safety-editor-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.health-safety-editor-toolbar .subtle {
  margin: 0;
}

.health-safety-editor-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 6px;
}

.health-safety-editor-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 8px;
}

.health-safety-editor-dot {
  font-size: 1rem;
  color: var(--accent);
  line-height: 1;
  padding-top: 10px;
}

.health-safety-editor-item .compact-delete-button {
  margin-top: 2px;
}

.health-safety-editor-textarea {
  min-height: 42px;
  max-height: none;
  resize: none;
  overflow: hidden;
  box-sizing: border-box;
  line-height: 1.35;
  white-space: pre-wrap;
  word-break: break-word;
}

.health-safety-editor-empty {
  color: var(--text-muted);
  font-size: 0.84rem;
}

label {
  display: grid;
  gap: 6px;
  font-size: 0.84rem;
  color: var(--text-muted);
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  padding: 8px 10px;
  font-size: 0.9rem;
  font-family: inherit;
}

textarea {
  resize: vertical;
  min-height: 78px;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(0, 71, 65, 0.22);
  border-color: var(--accent);
}

.table-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.expandable-settings summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  list-style: none;
  margin: 0;
  padding: 0;
  font-weight: 700;
  color: var(--text);
}

.expandable-settings summary::-webkit-details-marker {
  display: none;
}

.expandable-settings > .subtle {
  margin-top: 6px;
  margin-bottom: 0;
  color: var(--text-muted);
  font-size: 0.84rem;
}

.options-settings-grid {
  margin-top: 14px;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.options-settings-group {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  background: var(--surface-soft);
}

.options-settings-group .table-toolbar {
  margin-bottom: 8px;
}

.options-settings-group h3 {
  margin: 0;
  font-size: 0.95rem;
}

.compact-table-wrapper {
  border-radius: 10px;
  max-height: none;
  width: fit-content;
  max-width: 100%;
  overflow: hidden;
}

.compact-sheet-table {
  width: auto;
  min-width: 0;
  table-layout: auto;
}

.compact-sheet-table th,
.compact-sheet-table td {
  padding: 5px 8px;
  white-space: nowrap;
  width: auto;
}

.compact-sheet-table input {
  padding: 6px 8px;
  font-size: 0.84rem;
}

.compact-option-row {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.65rem;
  width: fit-content;
  max-width: 100%;
  min-width: 0;
}

.compact-option-row input {
  width: auto;
  max-width: 100%;
  min-width: 8ch;
  flex: 0 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
}

.compact-delete-button {
  border: 1px solid #ffd2dc;
  background: #fff5f8;
  color: var(--danger);
  border-radius: 8px;
  width: 28px;
  height: 28px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.compact-delete-button:hover {
  background: #ffecef;
}

.toolbar-actions {
  display: flex;
  gap: 8px;
}

.section-actions {
  margin-bottom: 2px;
}

.section-actions-wrap {
  flex-wrap: wrap;
}

.inline-date-picker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.inline-date-picker input {
  width: 170px;
}

.gantt-calendar-picker {
  width: min(560px, 100%);
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-soft);
  padding: 10px;
  display: grid;
  gap: 8px;
}

.gantt-calendar-toolbar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
}

.gantt-calendar-toolbar strong {
  text-align: center;
  font-size: 0.9rem;
}

.gantt-calendar-native-input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(100%);
  white-space: nowrap;
}

.gantt-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.gantt-calendar-weekday {
  text-align: center;
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.gantt-calendar-day {
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  position: relative;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 4px;
  padding: 4px;
  cursor: pointer;
}

.gantt-calendar-day:hover {
  border-color: #a9c4b9;
}

.gantt-calendar-day.is-placeholder {
  border-color: transparent;
  background: transparent;
  pointer-events: none;
}

.gantt-calendar-day-number {
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1;
}

.gantt-calendar-day-dots {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 6px;
  max-width: 100%;
  flex-wrap: wrap;
}

.gantt-calendar-day-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: transparent;
}

.gantt-calendar-day-dot.is-visible {
  background: var(--accent-strong);
}

.gantt-calendar-day.is-today {
  border-color: rgba(0, 71, 65, 0.45);
}

.gantt-calendar-day.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(0, 71, 65, 0.16);
  background: #e7f1ed;
}

.gantt-calendar-popover {
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  min-width: 150px;
  max-width: 220px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 8px;
  display: none;
  gap: 4px;
  text-align: left;
}

.gantt-calendar-popover strong {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.gantt-calendar-popover-item {
  font-size: 0.82rem;
  line-height: 1.2;
  color: var(--text);
}

@media (hover: hover) and (pointer: fine) {
  .gantt-calendar-day.has-members:hover .gantt-calendar-popover,
  .gantt-calendar-day.has-members:focus-visible .gantt-calendar-popover {
    display: grid;
  }
}

.table-wrapper {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 14px;
}

.gantt-shell {
  display: grid;
  gap: 10px;
}

.gantt-now-readout {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  background: #edf3ef;
  border-radius: 10px;
  padding: 6px 10px;
  width: fit-content;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.gantt-now-readout strong {
  color: #cb2b46;
  font-size: 0.9rem;
}

.gantt-scroll {
  position: relative;
  overflow-x: auto;
  overflow-y: hidden;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
}

.gantt-canvas {
  position: relative;
  min-width: calc(var(--week-width, 0px) + 170px);
}

.gantt-now-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: rgba(15, 107, 97, 0.72);
  box-shadow: 0 0 0 1px rgba(0, 71, 65, 0.3);
  z-index: 6;
  pointer-events: none;
  left: 0;
  transform: translateX(170px);
}

.gantt-now-line.is-hidden {
  display: none;
}

.gantt-header-row {
  display: grid;
  grid-template-columns: 170px minmax(0, var(--week-width, 0px));
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 4;
  background: #eef3ee;
}

.gantt-header-label {
  display: flex;
  align-items: center;
  padding: 10px;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-right: 1px solid var(--border);
}

.gantt-timeline-header {
  display: flex;
}

.gantt-day-header {
  flex: 0 0 auto;
  padding: 8px 0 7px;
  border-right: 1px solid var(--border);
  box-sizing: border-box;
}

.gantt-session-scale {
  display: flex;
  align-items: stretch;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface);
  box-sizing: border-box;
}

.gantt-session-segment {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 3px 3px;
  border-right: 1px solid var(--border);
  min-height: 44px;
  overflow: hidden;
}

.gantt-session-segment:last-child {
  border-right: none;
}

.gantt-session-segment.is-session {
  background: #edf4ef;
}

.gantt-session-segment.is-break {
  background: #fff4df;
  padding-inline: 2px;
}

.gantt-session-segment.is-break .gantt-session-name {
  font-size: 0.58rem;
  color: #8f4f0f;
  letter-spacing: 0.02em;
}

.gantt-session-segment.is-break .gantt-session-time {
  margin-top: 1px;
  font-size: 0.54rem;
  color: #9d6727;
  letter-spacing: 0;
}

.gantt-session-segment.is-active {
  background: #e9fbf1;
  box-shadow: inset 0 0 0 2px rgba(0, 128, 74, 0.45);
}

.gantt-session-segment.is-active .gantt-session-name,
.gantt-session-segment.is-active .gantt-session-time {
  color: #0d6a3e;
}

.gantt-session-name {
  font-size: 0.65rem;
  font-weight: 700;
  color: #25403a;
  line-height: 1.1;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
  text-align: center;
}

.gantt-session-time {
  margin-top: 2px;
  font-size: 0.62rem;
  color: var(--text-muted);
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
  text-align: center;
}

.gantt-body {
  position: relative;
}

.gantt-grid-layer {
  position: absolute;
  left: var(--resource-width, 170px);
  top: 0;
  pointer-events: none;
  z-index: 1;
}

.gantt-break-overlay {
  position: absolute;
  left: var(--resource-width, 170px);
  top: 0;
  pointer-events: none;
  z-index: 9;
}

.gantt-day-boundary,
.gantt-session-boundary {
  position: absolute;
  top: 0;
  bottom: 0;
}

.gantt-day-boundary {
  border-left: 1px solid #b4c7bc;
}

.gantt-session-boundary {
  border-left: 1px dashed #c7d5cc;
}

.gantt-break-band {
  position: absolute;
  top: 8px;
  bottom: 8px;
  background: rgba(255, 179, 71, 0.32);
  border-left: 1px solid rgba(196, 116, 18, 0.5);
  border-right: 1px solid rgba(196, 116, 18, 0.5);
  border-radius: 8px;
  z-index: 9;
  pointer-events: none;
}

.gantt-break-band.is-active {
  background: rgba(63, 191, 116, 0.36);
  border-left-color: rgba(13, 106, 62, 0.68);
  border-right-color: rgba(13, 106, 62, 0.68);
  box-shadow: inset 0 0 0 2px rgba(13, 106, 62, 0.32);
}

.gantt-resource-row {
  position: absolute;
  left: 0;
  right: 0;
  display: grid;
  grid-template-columns: 170px minmax(0, var(--week-width, 0px));
  border-bottom: 1px solid var(--border);
}

.gantt-resource-name {
  background: #edf3ef;
  border-right: 1px solid var(--border);
  font-size: 0.82rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  padding: 0 10px;
  z-index: 2;
}

.gantt-resource-lane {
  position: relative;
}

.gantt-empty-note {
  margin: 0;
  padding: 24px 12px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.gantt-block {
  position: absolute;
  top: 8px;
  bottom: 8px;
  border: 1px solid rgba(15, 107, 97, 0.34);
  border-left: 4px solid var(--accent);
  background: #eaf3ef;
  border-radius: 10px;
  padding: 5px 7px;
  overflow: hidden;
  z-index: 3;
}

.gantt-block-task {
  margin: 0;
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gantt-block-meta {
  margin: 2px 0 0;
  color: var(--text-muted);
  font-size: 0.69rem;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gantt-block.is-active {
  border-color: #1f9d63;
  border-left-color: #0d6a3e;
  box-shadow: 0 0 0 2px rgba(13, 106, 62, 0.22);
  background: #ebfff3;
}

.sheet-table {
  width: 100%;
  min-width: 1100px;
  border-collapse: collapse;
}

.board-table {
  min-width: 1300px;
}

.board-table.jobs-tracker-table {
  min-width: 1160px;
}

.admin-jobs-card-list {
  display: grid;
  gap: 10px;
}

.admin-jobs-empty {
  margin: 10px 0 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.job-filter-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 4px;
  border: 1px solid rgba(199, 212, 203, 0.8);
  border-radius: 8px;
  background: #f1eee6;
}

.job-filter-tab {
  min-height: 34px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px 10px;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 800;
}

.job-filter-tab:hover,
.job-filter-tab.is-active {
  border-color: rgba(15, 107, 97, 0.25);
  background: #fffefa;
  color: var(--accent-strong);
}

.admin-job-card {
  position: relative;
  z-index: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: stretch;
  padding: 14px;
  border: 1px solid rgba(148, 169, 157, 0.35);
  border-radius: 8px;
  background: #fffefa;
  box-shadow: 0 12px 24px -20px rgba(7, 36, 31, 0.42);
  cursor: pointer;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.admin-job-card:hover,
.admin-job-card:focus-visible {
  border-color: rgba(15, 107, 97, 0.55);
  box-shadow: 0 16px 30px -22px rgba(7, 36, 31, 0.58);
  transform: translateY(-1px);
  outline: none;
}

.admin-job-card.is-actions-open {
  z-index: 40;
  border-color: rgba(15, 107, 97, 0.58);
  box-shadow:
    0 18px 36px -24px rgba(7, 36, 31, 0.62),
    0 0 0 2px rgba(15, 107, 97, 0.08);
}

.admin-job-card-main {
  min-width: 0;
  display: grid;
  gap: 10px;
}

.admin-job-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
}

.admin-job-header-badges {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
}

.admin-job-title-wrap {
  min-width: 0;
}

.admin-job-ticket-label {
  display: inline-flex;
  margin-bottom: 4px;
  padding: 2px 6px;
  border-radius: 6px;
  background: #eef2ef;
  color: var(--text-muted);
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 0.7rem;
  font-weight: 800;
}

.admin-job-card h3 {
  margin: 0;
  color: var(--text);
  font-size: clamp(1rem, 0.35vw + 0.96rem, 1.2rem);
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.admin-job-install-pill {
  flex: 0 0 auto;
  padding: 5px 8px;
  border: 1px solid rgba(15, 107, 97, 0.18);
  border-radius: 7px;
  background: #eff8f3;
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
}

.admin-job-status-badge {
  flex: 0 0 auto;
  padding: 5px 8px;
  border-radius: 7px;
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.admin-job-status-badge.is-active {
  border: 1px solid rgba(47, 143, 91, 0.25);
  background: #eaf8ef;
  color: #17643a;
}

.admin-job-status-badge.is-closed {
  border: 1px solid rgba(184, 130, 40, 0.28);
  background: #fff6e4;
  color: #8a5a11;
}

.admin-job-status-badge.is-archived {
  border: 1px solid rgba(114, 124, 119, 0.22);
  background: #ecefed;
  color: #4e5854;
}

.admin-job-meta-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 8px;
}

.admin-job-meta-item {
  min-width: 0;
  display: grid;
  gap: 2px;
  padding: 8px;
  border: 1px solid rgba(199, 212, 203, 0.6);
  border-radius: 7px;
  background: #f8faf7;
}

.admin-job-meta-item span {
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.admin-job-meta-item strong {
  min-width: 0;
  color: var(--text);
  font-size: 0.85rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-job-next-action {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid rgba(207, 131, 62, 0.42);
  border-left: 4px solid #cf833e;
  border-radius: 8px;
  background: #fff6e8;
  color: #5f3b12;
}

.admin-job-next-action span {
  font-size: 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.admin-job-next-action strong {
  color: #302214;
  font-size: 0.9rem;
  line-height: 1.28;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.admin-job-status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.job-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 4px 8px;
  border: 1px solid #d7ddd8;
  border-radius: 999px;
  background: #f2f4f0;
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 800;
  max-width: 100%;
}

.job-status-pill-label {
  color: inherit;
  font-weight: 800;
}

.job-status-pill strong {
  color: inherit;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.job-status-pill.is-done {
  border-color: rgba(47, 143, 91, 0.28);
  background: #eaf8ef;
  color: #17643a;
}

.job-status-pill.is-pending {
  border-color: rgba(184, 130, 40, 0.28);
  background: #fff6e4;
  color: #8a5a11;
}

.job-status-pill.is-blocked {
  border-color: rgba(207, 59, 82, 0.25);
  background: #fff0f2;
  color: #9f2638;
}

.job-status-pill.is-empty {
  border-color: rgba(148, 169, 157, 0.28);
  background: #f2f4f0;
  color: #6b746f;
}

.admin-job-card-actions {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-end;
  gap: 8px;
  position: relative;
}

.admin-job-card-action,
.admin-job-card-delete {
  min-width: 74px;
}

.admin-job-actions-menu {
  position: relative;
  z-index: 1;
}

.admin-job-actions-menu[open] {
  z-index: 80;
}

.admin-job-actions-menu summary {
  list-style: none;
}

.admin-job-actions-menu summary::-webkit-details-marker {
  display: none;
}

.admin-job-actions-summary {
  min-width: 92px;
  text-align: center;
}

.admin-job-actions-menu[open] .admin-job-actions-summary {
  border-color: rgba(15, 107, 97, 0.38);
  background: #eef6f1;
  color: var(--accent-strong);
}

.admin-job-actions-list {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 120;
  min-width: 178px;
  display: grid;
  gap: 4px;
  padding: 8px;
  border: 1px solid rgba(15, 107, 97, 0.28);
  border-radius: 8px;
  background: #fffefa;
  box-shadow:
    0 22px 44px -20px rgba(7, 36, 31, 0.58),
    0 0 0 1px rgba(255, 255, 255, 0.88);
}

.admin-job-menu-action {
  width: 100%;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  padding: 9px 10px;
  text-align: left;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 800;
}

.admin-job-menu-action:hover,
.admin-job-menu-action:focus-visible {
  background: #eef4ef;
  outline: none;
}

.admin-job-menu-action.is-danger {
  color: var(--danger);
}

.admin-job-menu-action.is-danger:hover,
.admin-job-menu-action.is-danger:focus-visible {
  background: #fff0f2;
}

.job-editor-is-open {
  overflow: hidden;
}

.job-history-is-open {
  overflow: hidden;
}

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

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

.job-editor-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  height: 100dvh;
  padding: max(14px, env(safe-area-inset-top)) 18px max(14px, env(safe-area-inset-bottom));
  overflow: hidden;
  overscroll-behavior: contain;
}

.job-history-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  height: 100dvh;
  padding: max(14px, env(safe-area-inset-top)) 18px max(14px, env(safe-area-inset-bottom));
  overflow: hidden;
  overscroll-behavior: contain;
}

.job-editor-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(30, 42, 39, 0.58);
  backdrop-filter: blur(8px);
}

.job-history-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(30, 42, 39, 0.58);
  backdrop-filter: blur(8px);
}

.job-editor-panel {
  position: relative;
  z-index: 1;
  width: min(920px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  max-height: calc(100dvh - 28px);
  margin: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  border: 1px solid rgba(199, 212, 203, 0.9);
  border-radius: 8px;
  background: #fffefa;
  box-shadow: 0 28px 60px -30px rgba(7, 36, 31, 0.55);
}

.job-history-panel {
  position: relative;
  z-index: 1;
  width: min(760px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  max-height: calc(100dvh - 28px);
  margin: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  border: 1px solid rgba(199, 212, 203, 0.9);
  border-radius: 8px;
  background: #fffefa;
  box-shadow: 0 28px 60px -30px rgba(7, 36, 31, 0.55);
}

.job-editor-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  padding: 18px 20px;
  border-bottom: 1px solid rgba(199, 212, 203, 0.75);
  background: rgba(255, 254, 250, 0.96);
  backdrop-filter: blur(10px);
}

.job-history-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  padding: 18px 20px;
  border-bottom: 1px solid rgba(199, 212, 203, 0.75);
  background: rgba(255, 254, 250, 0.96);
  backdrop-filter: blur(10px);
}

.job-editor-header h2 {
  margin: 0;
  font-size: 1.35rem;
}

.job-history-header h2 {
  margin: 0;
  font-size: 1.35rem;
}

.job-editor-summary {
  margin: 5px 0 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.job-history-summary {
  margin: 5px 0 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.job-editor-close-button {
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f6f4ee;
  color: var(--text);
  cursor: pointer;
  font-size: 1.35rem;
  line-height: 1;
}

.job-history-close-button {
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f6f4ee;
  color: var(--text);
  cursor: pointer;
  font-size: 1.35rem;
  line-height: 1;
}

.job-editor-close-button:hover {
  background: #ece9e0;
}

.job-history-close-button:hover {
  background: #ece9e0;
}

.job-editor-form {
  display: grid;
  gap: 12px;
  padding: 16px 20px 20px;
}

.job-history-body {
  padding: 16px 20px 20px;
}

.job-history-list {
  list-style: none;
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
}

.job-history-item {
  display: grid;
  grid-template-columns: minmax(120px, 0.35fr) minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(199, 212, 203, 0.72);
  border-radius: 8px;
  background: #f8faf7;
}

.job-history-item time {
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.job-history-item-content {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.job-history-item-content strong {
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.25;
}

.job-history-item-meta,
.job-history-item-detail {
  color: var(--text-muted);
  font-size: 0.82rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.job-history-empty {
  padding: 14px;
  border: 1px dashed rgba(148, 169, 157, 0.7);
  border-radius: 8px;
  background: #f8faf7;
  color: var(--text-muted);
}

.job-editor-group {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(199, 212, 203, 0.7);
  border-radius: 8px;
  background: #f7f6f2;
}

.job-editor-group h3 {
  margin: 0;
  font-size: 0.95rem;
}

.job-editor-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
}

.job-editor-wide-field {
  grid-column: span 2;
}

.job-editor-wide-field textarea[data-job-editor-field="whenJakesNeedsIt"] {
  min-height: 96px;
  line-height: 1.35;
}

.job-editor-checkline {
  min-height: 42px;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border: 1px solid rgba(199, 212, 203, 0.78);
  border-radius: 8px;
  background: #fffefa;
  color: var(--text);
  font-weight: 800;
}

.job-editor-checkline input {
  width: 18px;
  height: 18px;
  padding: 0;
  accent-color: var(--accent);
}

.job-editor-footer {
  position: sticky;
  bottom: 0;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 10px;
  padding-bottom: max(4px, env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(255, 254, 250, 0), #fffefa 30%);
}

.jobs-tracker-table th {
  white-space: normal;
  vertical-align: middle;
  text-align: left;
  letter-spacing: 0.01em;
  font-size: 0.79rem;
  font-weight: 800;
  padding: 8px 8px;
  text-transform: none;
}

.jobs-header-text {
  display: inline-block;
  max-width: 12ch;
  margin: 0;
  text-align: left;
  line-height: 1.2;
  text-wrap: pretty;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
}

.jobs-tracker-table th,
.jobs-tracker-table td {
  border-right: 1px solid rgba(148, 169, 157, 0.16);
}

.jobs-tracker-table th:nth-child(odd),
.jobs-tracker-table td:nth-child(odd) {
  border-right-color: rgba(148, 169, 157, 0.12);
}

.jobs-tracker-table th:nth-child(even),
.jobs-tracker-table td:nth-child(even) {
  border-right-color: rgba(148, 169, 157, 0.2);
}

.jobs-tracker-table th:last-child,
.jobs-tracker-table td:last-child {
  border-right: none;
}

.job-when-jakes-needs-it {
  min-width: 180px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: #302214;
  font-weight: 700;
}

.sheet-table th {
  text-align: left;
  font-size: clamp(0.78rem, 0.28vw + 0.72rem, 0.9rem);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: #eff4ef;
  border-bottom: 1px solid var(--border);
  padding: 8px 10px;
  position: sticky;
  top: 0;
  z-index: 1;
}

.sheet-table td {
  border-bottom: 1px solid var(--border);
  padding: 5px;
  vertical-align: top;
  font-size: clamp(0.88rem, 0.25vw + 0.82rem, 1rem);
}

.board-table td {
  padding: 8px 10px;
}

.job-checkbox-cell {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  min-height: 32px;
}

.job-checkbox-cell input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: #1f9d63;
  margin: 0;
  flex: 0 0 auto;
}

.job-checkbox-cell span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sheet-table tr:last-child td {
  border-bottom: none;
}

.empty-cell {
  text-align: center;
  color: var(--text-muted);
  padding: 18px;
}

.icon-button {
  border: 1px solid #ffd2dc;
  background: #fff5f8;
  color: var(--danger);
  border-radius: 10px;
  padding: 8px 10px;
  cursor: pointer;
  font-weight: 600;
}

.icon-button:hover {
  background: #ffecef;
}

.save-indicator {
  width: 11px;
  height: 11px;
  margin-left: 8px;
  border-radius: 999px;
  border: 1px solid transparent;
  display: inline-block;
  flex: 0 0 auto;
  align-self: center;
  background: #2f8f5b;
  box-shadow: 0 0 0 3px rgba(47, 143, 91, 0.16);
}

.save-indicator.is-green {
  background: #2f8f5b;
  border-color: rgba(23, 94, 58, 0.4);
  box-shadow: 0 0 0 3px rgba(47, 143, 91, 0.16);
}

.save-indicator.is-red {
  background: #cf3b52;
  border-color: rgba(121, 31, 45, 0.42);
  box-shadow: 0 0 0 3px rgba(207, 59, 82, 0.16);
}

.owner-monitor-shell {
  width: min(1700px, calc(100vw - 36px));
}

.owner-monitor-filters-card {
  padding: 14px 16px;
}

.owner-monitor-filters-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(7, minmax(140px, 1fr));
  align-items: end;
}

.owner-filter-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.owner-monitor-summary-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.owner-summary-stat {
  padding: 12px;
}

.owner-summary-stat p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.owner-summary-stat strong {
  display: block;
  margin-top: 4px;
  font-size: 1.15rem;
}

.owner-admin-manager-card {
  padding: 14px;
}

.owner-admin-manager-controls {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}

.owner-admin-add-field {
  display: grid;
  gap: 6px;
  font-size: 0.84rem;
  color: var(--text-muted);
}

.owner-admin-add-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.owner-admin-add-row input {
  flex: 1;
  min-width: 220px;
}

.owner-admin-manage-feedback {
  margin: 0;
  min-height: 1.1em;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.owner-admin-manage-feedback.is-error {
  color: var(--danger);
}

.owner-admin-manage-feedback.is-success {
  color: #2f8f5b;
}

.owner-admin-table-wrap {
  margin-top: 10px;
  max-height: 260px;
}

.owner-admin-table {
  min-width: 560px;
}

.owner-admin-icon-badge {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  font-size: 1rem;
}

.owner-admin-color-swatch {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 1px solid var(--border);
  display: inline-block;
  vertical-align: middle;
  margin-right: 8px;
}

.owner-admin-color-code {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.owner-admin-delete-button {
  min-width: 88px;
}

.owner-login-safety-card {
  padding: 14px;
}

.owner-login-safety-wrap {
  margin-top: 10px;
}

.owner-login-safety-table {
  min-width: 760px;
}

.owner-login-safety-table td {
  vertical-align: middle;
}

.owner-login-safety-badge {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--surface-soft);
  color: var(--text-muted);
}

.owner-login-safety-badge.is-ok {
  border-color: #b8d8ca;
  background: #edf6f1;
  color: #0c5f56;
}

.owner-login-safety-badge.is-new {
  border-color: #ffe4bf;
  background: #fff7ea;
  color: #8a4d08;
}

.owner-login-safety-badge.is-review {
  border-color: #ffd0d9;
  background: #fff2f5;
  color: #b12246;
}

.owner-login-device-id {
  display: inline-block;
  margin-left: 8px;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

.owner-insights-card {
  padding: 14px;
}

.owner-insights-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.owner-insight-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-soft);
  padding: 10px 12px;
  display: grid;
  gap: 4px;
}

.owner-insight-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.owner-insight-head strong {
  font-size: 0.92rem;
}

.owner-insight-level {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 7px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  background: var(--surface);
}

.owner-insight-item.is-high .owner-insight-level {
  border-color: #ffd0d9;
  color: #b12246;
  background: #fff2f5;
}

.owner-insight-item.is-medium .owner-insight-level {
  border-color: #ffe4bf;
  color: #8a4d08;
  background: #fff7ea;
}

.owner-insight-item.is-low .owner-insight-level {
  border-color: #b8d8ca;
  color: #0c5f56;
  background: #edf6f1;
}

.owner-insight-detail,
.owner-insight-suggestion {
  margin: 0;
  font-size: 0.84rem;
  color: var(--text-muted);
}

.owner-insight-suggestion {
  color: var(--text);
}

.owner-clicks-card,
.owner-replay-card {
  padding: 14px;
}

.owner-replay-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 10px;
  margin-bottom: 10px;
}

.owner-replay-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.owner-replay-controls label {
  min-width: 110px;
}

.owner-replay-table-wrap {
  margin-top: 10px;
}

.owner-replay-table {
  min-width: 980px;
}

.owner-replay-table tr.is-selected td {
  background: #e5f1eb;
}

.owner-click-items {
  margin-top: 12px;
  display: grid;
  gap: 8px;
}

.owner-click-items-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
}

.owner-click-items-head h3 {
  margin: 0;
  font-size: 0.95rem;
}

.owner-click-items-wrap {
  max-height: 220px;
}

.owner-click-items-table {
  min-width: 720px;
}

.gantt-day-groups {
  display: grid;
  gap: 10px;
}

.gantt-day-empty {
  margin-top: 10px;
  border: 1px dashed var(--border);
  border-radius: 12px;
  padding: 14px;
  color: var(--text-muted);
  font-size: 0.85rem;
  background: var(--surface-soft);
}

.gantt-day-empty.is-hidden {
  display: none;
}

.gantt-day-group {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-soft);
  overflow: visible;
}

.gantt-day-group summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  background: #eff4ef;
  border-bottom: 1px solid var(--border);
}

.gantt-day-group summary::-webkit-details-marker {
  display: none;
}

.gantt-day-summary-main {
  display: grid;
  gap: 2px;
}

.gantt-day-title {
  font-size: 0.9rem;
}

.gantt-day-subtitle {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.gantt-day-count {
  font-size: 0.76rem;
  color: var(--text-muted);
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 999px;
  padding: 4px 8px;
}

.gantt-day-content {
  padding: 10px;
  display: grid;
  gap: 10px;
}

.gantt-member-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.gantt-member-tabs-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
}

.gantt-member-add-row {
  position: relative;
  z-index: 20;
  display: flex;
  justify-content: flex-end;
}

.gantt-member-add-menu {
  position: relative;
  display: inline-flex;
  max-width: 100%;
}

.gantt-member-add-task {
  background: #fff1d6;
  border-color: #f1bd72;
  color: #6f3f06;
  white-space: nowrap;
}

.gantt-member-add-task:hover {
  background: #ffe7bd;
  border-color: #e3a24d;
}

.gantt-member-picker {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 80;
  min-width: 190px;
  max-width: min(280px, calc(100vw - 32px));
  padding: 8px;
  border: 1px solid #f1bd72;
  border-radius: 12px;
  background: #fffaf1;
  box-shadow: 0 14px 30px rgba(70, 45, 15, 0.18);
  display: none;
  gap: 6px;
}

.gantt-member-add-menu.is-open .gantt-member-picker:not([hidden]) {
  display: grid;
}

.gantt-member-picker-option {
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  padding: 8px 10px;
  font: inherit;
  font-size: 0.9rem;
  text-align: left;
  cursor: pointer;
}

.gantt-member-picker-option:hover {
  border-color: #f1bd72;
  background: #fff1d6;
  color: #6f3f06;
}

.gantt-member-picker-option.is-disabled,
.gantt-member-picker-option:disabled {
  color: var(--text-muted);
  cursor: not-allowed;
  opacity: 0.72;
}

.gantt-member-picker-option.is-disabled:hover,
.gantt-member-picker-option:disabled:hover {
  border-color: transparent;
  background: transparent;
  color: var(--text-muted);
}

.gantt-member-picker-empty {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.gantt-member-tab {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  max-width: 100%;
  border: 1px solid rgba(15, 107, 97, 0.22);
  border-radius: 8px;
  background: #fffefa;
  color: var(--text);
  padding: 8px 12px;
  font-size: 0.98rem;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 10px 18px -18px rgba(7, 36, 31, 0.45);
}

.gantt-member-tab:hover {
  border-color: rgba(15, 107, 97, 0.46);
  background: #f2f8f4;
}

.gantt-member-tab:focus-visible {
  border-color: var(--accent);
  outline: 3px solid rgba(15, 107, 97, 0.16);
  outline-offset: 2px;
}

.gantt-member-tab.is-active {
  border-color: var(--accent);
  background: #e3f2ea;
  box-shadow:
    0 14px 24px -20px rgba(7, 36, 31, 0.58),
    inset 0 0 0 1px rgba(15, 107, 97, 0.18);
}

.gantt-member-tab-name {
  min-width: 0;
  max-width: 24ch;
  line-height: 1.1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gantt-member-tab-count {
  min-width: 28px;
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(15, 107, 97, 0.3);
  border-radius: 999px;
  background: #0f6b61;
  color: #fffefa;
  font-size: 0.88rem;
  font-weight: 900;
  line-height: 1;
  padding: 4px 8px;
}

.gantt-member-tab.is-active .gantt-member-tab-count {
  background: var(--accent-strong);
  border-color: rgba(0, 71, 65, 0.42);
}

.gantt-member-tab.is-dragging {
  opacity: 0.55;
}

.gantt-member-tab.is-drop-before {
  box-shadow: inset 2px 0 0 var(--accent);
}

.gantt-member-tab.is-drop-after {
  box-shadow: inset -2px 0 0 var(--accent);
}

.gantt-inline-add-row td {
  background: var(--surface-soft);
  border-bottom: none;
  padding: 8px 5px;
}

.gantt-inline-add-cell {
  text-align: left;
}

.gantt-inline-add-button {
  width: 34px;
  height: 34px;
  border: 1px solid #f1bd72;
  border-radius: 999px;
  background: #fff1d6;
  color: #6f3f06;
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}

.gantt-inline-add-button:hover {
  background: #ffe7bd;
  border-color: #e3a24d;
}

.gantt-day-table {
  min-width: 1080px;
}

.gantt-job-link-select {
  min-width: 190px;
}

.gantt-row-member-label {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  color: var(--text);
  font-weight: 700;
}

.gantt-row-member-label.is-missing {
  color: var(--text-muted);
  font-weight: 500;
}

.gantt-row-delete-cell {
  width: 42px;
  min-width: 42px;
  position: relative;
  padding: 0 !important;
}

.gantt-delete-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  min-width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 1px solid #ffc5d2;
  background: #fff1f5;
  color: transparent;
  padding: 0;
}

.gantt-delete-dot::before {
  content: "";
  display: block;
  width: 10px;
  height: 2px;
  margin: 0 auto;
  border-radius: 2px;
  background: #d13a57;
}

.gantt-delete-dot:hover {
  background: #ffe7ee;
}

@media (max-width: 1180px) {
  .board-top-row {
    grid-template-columns: 1fr;
  }

  .board-layout {
    grid-template-columns: 1fr;
  }

  .board-notes-inner-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .board-sidebar-pair {
    grid-template-columns: 1fr;
  }

  .admin-job-meta-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .board-shell,
  .admin-shell {
    width: calc(100vw - 18px);
    margin: 10px auto 16px;
  }

  .board-header,
  .admin-header {
    padding: 14px;
    flex-direction: column;
    align-items: stretch;
  }

  .admin-header-actions {
    align-items: center;
  }

  .admin-active-identity {
    width: 96px;
    min-height: 94px;
    padding: 8px 6px;
  }

  .admin-active-identity-avatar {
    width: 44px;
    height: 44px;
    font-size: 1.1rem;
  }

  .admin-active-identity-name {
    max-width: 78px;
    font-size: 0.72rem;
  }

  .board-title-card {
    grid-template-columns: 1fr;
  }

  .board-title-meta {
    min-width: 0;
    border-left: none;
    border-top: 1px solid var(--border);
    padding-left: 0;
    padding-top: 10px;
    justify-items: start;
  }

  .board-meta {
    justify-items: start;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(130px, 1fr));
  }

  .gantt-calendar-toolbar {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .owner-monitor-shell {
    width: calc(100vw - 18px);
  }

  .owner-monitor-filters-grid {
    grid-template-columns: 1fr 1fr;
  }

  .owner-monitor-summary-grid {
    grid-template-columns: 1fr;
  }

  .owner-replay-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .owner-replay-controls {
    flex-wrap: wrap;
  }

  .admin-job-card {
    grid-template-columns: 1fr;
  }

  .admin-job-card-actions {
    flex-direction: row;
    justify-content: flex-end;
  }

  .admin-job-meta-grid,
  .job-editor-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .job-editor-wide-field {
    grid-column: span 2;
  }

  .button,
  .icon-button,
  input,
  select,
  textarea {
    min-height: 42px;
    font-size: 1rem;
  }

  .gantt-calendar-toolbar strong {
    grid-column: 1 / -1;
    order: -1;
  }

  .board-lower-grid,
  .board-notes-grid,
  .board-notes-inner-grid {
    grid-template-columns: 1fr;
  }

  .gantt-header-row,
  .gantt-resource-row {
    grid-template-columns: 130px minmax(0, var(--week-width, 0px));
  }

  .gantt-header-label,
  .gantt-resource-name {
    padding-left: 8px;
    padding-right: 8px;
  }

  .gantt-grid-layer {
    left: var(--resource-width, 130px);
  }

  .gantt-break-overlay {
    left: var(--resource-width, 130px);
  }

  .gantt-canvas {
    min-width: calc(var(--week-width, 0px) + 130px);
  }

  .gantt-now-line {
    transform: translateX(130px);
  }
}

@media (pointer: coarse) {
  .admin-shell {
    width: min(1300px, calc(100vw - 20px));
    gap: 12px;
  }

  .admin-header,
  .settings-card,
  .table-card {
    padding: 18px;
  }

  .button,
  .icon-button,
  input,
  select,
  textarea {
    min-height: 44px;
    font-size: 1rem;
  }

  .admin-collapsible-summary {
    min-height: 52px;
  }

  .admin-drag-handle {
    width: 2.1rem;
    height: 2.1rem;
    font-size: 1rem;
    border-radius: 10px;
  }

  .admin-touch-order-controls {
    gap: 6px;
  }

  .admin-order-button {
    width: 2rem;
    height: 2rem;
    border-radius: 9px;
    font-size: 0.92rem;
  }

  .table-wrapper,
  .gantt-scroll {
    -webkit-overflow-scrolling: touch;
  }
}

@media (max-width: 700px) {
  .owner-admin-add-row {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-job-card-header {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-job-install-pill {
    width: fit-content;
  }

  .admin-job-meta-grid,
  .job-editor-grid {
    grid-template-columns: 1fr;
  }

  .job-editor-wide-field {
    grid-column: auto;
  }

  .job-editor-modal {
    padding: max(6px, env(safe-area-inset-top)) 8px max(6px, env(safe-area-inset-bottom));
  }

  .job-history-modal {
    padding: max(6px, env(safe-area-inset-top)) 8px max(6px, env(safe-area-inset-bottom));
  }

  .job-editor-panel {
    width: calc(100vw - 16px);
    max-height: calc(100vh - 12px);
    max-height: calc(100dvh - 12px);
  }

  .job-history-panel {
    width: calc(100vw - 16px);
    max-height: calc(100vh - 12px);
    max-height: calc(100dvh - 12px);
  }

  .job-editor-header,
  .job-editor-form,
  .job-history-header,
  .job-history-body {
    padding-left: 12px;
    padding-right: 12px;
  }

  .job-history-item {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 1000px) and (max-width: 1400px) {
  .admin-shell {
    width: min(1320px, calc(100vw - 24px));
  }

  .sheet-table th {
    font-size: 0.76rem;
    padding: 10px;
  }

  .sheet-table td {
    padding: 7px;
    font-size: 0.9rem;
  }
}

@media (min-width: 1800px) {
  .board-shell {
    width: min(2400px, calc(100vw - 48px));
    gap: 18px;
  }

  .board-header,
  .board-meta-card,
  .board-section {
    padding: 18px;
  }

  .board-header h1 {
    font-size: clamp(1.8rem, 2.3vw, 2.7rem);
  }

  .board-section h2 {
    font-size: 1.25rem;
  }

  .sheet-table th {
    font-size: 0.82rem;
    padding: 10px 12px;
  }

  .board-table td {
    padding: 10px 12px;
    font-size: 0.95rem;
  }

  .job-checkbox-cell input[type="checkbox"] {
    width: 24px;
    height: 24px;
  }

  .gantt-block-task {
    font-size: 0.88rem;
  }

  .gantt-block-meta {
    font-size: 0.78rem;
  }
}

/* Device-profile polish: small phone */
@media (max-width: 430px) {
  .board-shell,
  .admin-shell,
  .owner-monitor-shell {
    width: calc(100vw - 12px);
    margin: 8px auto 12px;
    gap: 10px;
  }

  .board-header,
  .admin-header,
  .settings-card,
  .table-card {
    padding: 12px;
  }

  .admin-header-actions,
  .toolbar-actions {
    gap: 8px;
    flex-wrap: wrap;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .owner-monitor-filters-grid {
    grid-template-columns: 1fr;
  }

  .sheet-table {
    min-width: 760px;
  }

  .board-table {
    min-width: 980px;
  }

  .board-table.jobs-tracker-table {
    min-width: 920px;
  }

  .admin-identity-sky-dock {
    padding: 10px;
  }

  .admin-identity-sky-dock .admin-identity-grid {
    justify-content: center;
  }

  .admin-identity-sky-dock .admin-identity-option {
    width: min(160px, calc(100vw - 74px));
    flex-basis: min(160px, calc(100vw - 74px));
  }
}

/* Device-profile polish: large phone */
@media (min-width: 431px) and (max-width: 767px) {
  .board-shell,
  .admin-shell,
  .owner-monitor-shell {
    width: calc(100vw - 14px);
    margin: 9px auto 14px;
    gap: 12px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }

  .owner-monitor-filters-grid {
    grid-template-columns: 1fr;
  }

  .sheet-table {
    min-width: 820px;
  }

  .board-table {
    min-width: 1080px;
  }

  .board-table.jobs-tracker-table {
    min-width: 980px;
  }

  .admin-identity-sky-dock .admin-identity-grid {
    justify-content: center;
  }

  .admin-identity-sky-dock .admin-identity-option {
    width: 148px;
    flex-basis: 148px;
  }
}

/* Device-profile polish: tablet portrait/landscape */
@media (min-width: 768px) and (max-width: 1024px) {
  .board-shell,
  .admin-shell,
  .owner-monitor-shell {
    width: 100%;
    max-width: 100%;
    margin: 0;
  }

  .admin-identity-gate {
    padding: 0;
  }

  .admin-identity-center {
    width: 100%;
  }

  .admin-identity-sky-dock {
    max-width: 100%;
  }

  .stats-grid {
    grid-template-columns: repeat(3, minmax(140px, 1fr));
  }

  .owner-monitor-filters-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .admin-identity-sky-dock .admin-identity-grid {
    justify-content: center;
  }

  .admin-identity-sky-dock .admin-identity-option {
    width: 146px;
    flex-basis: 146px;
  }
}

/* Device-profile polish: laptops */
@media (min-width: 1025px) and (max-width: 1366px) {
  .admin-shell,
  .owner-monitor-shell {
    width: calc(100vw - 28px);
  }

  .sheet-table th {
    font-size: 0.82rem;
  }

  .sheet-table td {
    font-size: 0.95rem;
    padding: 7px;
  }
}

@media (min-width: 768px) and (max-width: 2560px) {
  .admin-page .admin-shell {
    width: calc(100vw - 24px);
    max-width: calc(100vw - 24px);
    margin: 12px auto 20px;
  }

  .admin-page .admin-shell > .card {
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
    border-radius: var(--radius);
  }

  .owner-monitor-page .owner-monitor-shell {
    width: min(1700px, calc(100vw - 48px));
    max-width: calc(100vw - 48px);
    margin: 24px auto 32px;
    gap: 16px;
  }
}

/* iPad Pro 12.9 and large touch tablets */
@media (min-width: 1024px) and (max-width: 1366px) and (pointer: coarse) {
  .board-shell,
  .admin-shell {
    width: 100%;
    max-width: 100%;
    margin: 0;
  }

  .admin-page .admin-shell {
    width: calc(100vw - 20px);
    max-width: calc(100vw - 20px);
    margin: 10px auto 18px;
  }

  .owner-monitor-shell {
    width: calc(100vw - 40px);
    max-width: calc(100vw - 40px);
    margin: 20px auto 28px;
  }

  .admin-identity-gate {
    padding: 0;
  }

  .admin-identity-center {
    width: 100%;
  }

  .admin-identity-sky-dock {
    max-width: 100%;
  }
}
