:root {
  color-scheme: light;
  --ink: #14201d;
  --muted: #63716d;
  --line: rgba(20, 32, 29, 0.12);
  --paper: #f6f7f4;
  --surface: rgba(255, 255, 255, 0.86);
  --forest: #16372f;
  --blue: #dcecff;
  --blue-ink: #164a7a;
  --yellow: #fff0b8;
  --yellow-ink: #6b4c00;
  --red: #d94336;
}

* { box-sizing: border-box; }

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 286px 1fr;
  background: var(--paper);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  letter-spacing: 0;
}

body.auth-locked {
  display: block;
  min-height: 100vh;
  overflow: hidden;
  background: url("./assets/admin-alpine-login.png") center / cover no-repeat fixed;
}

body.auth-locked::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: url("./assets/admin-alpine-login-misty-heavy.png") center / cover no-repeat fixed;
  filter: none;
  opacity: 1;
  transform: none;
  animation: none;
  transition: opacity 6s ease;
  z-index: 0;
}

body.auth-locked::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 4px);
  mix-blend-mode: soft-light;
  opacity: 0.42;
  transition: opacity 6s ease;
  z-index: 0;
}

body.auth-locked.auth-revealed::before {
  opacity: 0;
}

body.auth-locked.auth-revealed::after {
  opacity: 0;
}

body.auth-locked .sidebar {
  display: none;
}

body:not(.auth-unlocked) #dashboardShell {
  display: none !important;
}

body.auth-unlocked .auth-panel {
  display: none !important;
}

button, input, summary {
  font: inherit;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 28px 18px;
  background-image: url("./assets/misty-forest-sidebar.png");
  background-size: auto 112%;
  background-position: 58% center;
  color: white;
  overflow: hidden;
}

.sidebar-scrim {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 46% 26%, rgba(235, 242, 236, 0.42), transparent 34%),
    linear-gradient(180deg, rgba(3, 14, 12, 0.58), rgba(220, 232, 224, 0.18) 38%, rgba(3, 14, 12, 0.82));
  backdrop-filter: saturate(0.9);
}

.brand, .main-nav, .sidebar-actions {
  position: relative;
  z-index: 1;
}

.brand {
  display: grid;
  gap: 2px;
  margin-bottom: 32px;
}

.brand strong {
  font-size: 25px;
  line-height: 1;
  font-weight: 800;
}

.brand span {
  font-size: 13px;
  font-weight: 650;
  color: rgba(255, 255, 255, 0.78);
}

.main-nav {
  display: grid;
  gap: 9px;
}

.main-nav button,
.utility,
.signout {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 10px;
  padding: 11px 12px;
  color: white;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(18px);
  text-align: left;
  cursor: pointer;
}

.main-nav button.active,
.utility.active {
  background: rgba(255, 255, 255, 0.94);
  color: var(--forest);
  font-weight: 760;
}

.sidebar-actions {
  margin-top: auto;
  display: grid;
  gap: 9px;
}

.signout {
  text-align: center;
  background: rgba(217, 67, 54, 0.86);
  border-color: rgba(255, 255, 255, 0.34);
  font-weight: 760;
}

.workspace {
  padding: 26px;
  min-width: 0;
}

body.auth-locked .workspace {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

body.auth-locked .workspace > :not(.auth-panel) {
  display: none !important;
}

.auth-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  box-shadow: 0 12px 34px rgba(20, 32, 29, 0.07);
}

body.auth-locked .auth-panel {
  position: relative;
  width: min(430px, calc(100vw - 34px));
  min-height: clamp(220px, 38vh, 330px);
  grid-template-columns: 1fr;
  align-content: center;
  gap: 0;
  overflow: hidden;
  padding: clamp(22px, 4.5vw, 30px);
  border-color: rgba(255, 253, 244, 0.34);
  border-radius: 30px;
  background:
    linear-gradient(145deg, rgba(255, 253, 244, 0.34), rgba(191, 220, 211, 0.13)),
    url("./assets/admin-alpine-login.png") center / cover no-repeat fixed;
  color: #17352e;
  box-shadow:
    0 38px 110px rgba(8, 23, 20, 0.42),
    0 10px 28px rgba(8, 23, 20, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    inset 0 -1px 0 rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(22px) saturate(1.16);
  cursor: pointer;
  transition: box-shadow 1.2s ease, background 1.2s ease, border-color 1.2s ease;
}

body.auth-locked.auth-revealed .auth-panel {
  border-color: rgba(232, 220, 196, 0.9);
  background: #fff7e8;
  box-shadow:
    0 34px 90px rgba(8, 23, 20, 0.3),
    0 10px 26px rgba(8, 23, 20, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.82);
  backdrop-filter: none;
  cursor: default;
}

body.auth-locked .auth-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(118deg, rgba(255, 255, 255, 0.5), transparent 16% 50%, rgba(255, 255, 255, 0.26) 74%, transparent),
    radial-gradient(circle at 18% 0%, rgba(255, 255, 255, 0.46), transparent 34%),
    linear-gradient(rgba(255, 253, 244, 0.05), rgba(255, 253, 244, 0.14));
  opacity: 0.72;
}

.auth-welcome-mark {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  pointer-events: none;
  opacity: 0.7;
  transform: translateY(2px) scale(1);
  transition: opacity 1s ease, transform 1s ease;
}

.auth-welcome-mark img {
  width: min(34%, 150px);
  height: auto;
  object-fit: contain;
  animation: welcomePulse 4.8s ease-in-out infinite;
  will-change: transform;
  filter:
    drop-shadow(0 18px 24px rgba(9, 31, 27, 0.22))
    drop-shadow(0 2px 1px rgba(255, 255, 255, 0.28));
}

body.auth-locked.auth-revealed .auth-welcome-mark {
  opacity: 0;
  transform: translateY(-10px) scale(0.96);
}

@keyframes welcomePulse {
  0%, 100% {
    transform: scale(0.96);
  }
  50% {
    transform: scale(1.06);
  }
}

body.auth-locked .auth-reveal-content {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 14px;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 2.4s ease, transform 2.4s ease;
}

body.auth-locked.auth-revealed .auth-reveal-content {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.auth-brand-panel {
  display: grid;
  justify-items: center;
  gap: 8px;
  text-align: center;
  padding-bottom: 4px;
}

.auth-brand-panel img {
  width: 62px;
  height: 62px;
  object-fit: contain;
  filter: drop-shadow(0 10px 18px rgba(10, 28, 23, 0.2));
}

.auth-brand-panel strong {
  font-size: clamp(21px, 5vw, 28px);
  line-height: 1.05;
  color: #17372f;
  font-weight: 820;
}

.auth-panel strong,
.auth-panel span {
  display: block;
}

.auth-panel strong {
  font-size: 13px;
}

.auth-panel span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

body.auth-locked .auth-panel span {
  color: rgba(23, 53, 46, 0.76);
}

.auth-panel[data-mode="live"] {
  border-color: rgba(47, 107, 87, 0.35);
  background: #f3faf5;
}

.auth-panel[data-mode="error"] {
  border-color: rgba(217, 67, 54, 0.35);
  background: #fff7f5;
}

body.auth-locked .auth-panel[data-mode],
body.auth-locked .auth-panel[data-mode="live"],
body.auth-locked .auth-panel[data-mode="error"] {
  background:
    linear-gradient(145deg, rgba(255, 253, 244, 0.34), rgba(191, 220, 211, 0.13)),
    url("./assets/admin-alpine-login.png") center / cover no-repeat fixed;
}

body.auth-locked.auth-revealed .auth-panel[data-mode],
body.auth-locked.auth-revealed .auth-panel[data-mode="live"],
body.auth-locked.auth-revealed .auth-panel[data-mode="error"] {
  background: #fff7e8;
  backdrop-filter: none;
}

body.auth-locked .auth-panel[data-mode="error"] {
  border-color: rgba(217, 67, 54, 0.42);
}

.auth-form {
  display: flex;
  gap: 8px;
}

body.auth-locked .auth-form {
  display: none;
  grid-template-columns: 1fr;
  gap: 8px;
}

body.auth-locked .auth-form:not([hidden]) {
  display: grid;
}

.auth-form input {
  width: 170px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 10px;
}

body.auth-locked .auth-form input {
  width: 100%;
  min-height: 40px;
  border-color: rgba(22, 55, 47, 0.16);
  border-radius: 12px;
  background: rgba(255, 255, 250, 0.86);
  color: #17352e;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    0 8px 18px rgba(12, 34, 30, 0.08);
  font-size: 14px;
}

#adminEmailCode {
  text-align: center;
  letter-spacing: 0.14em;
}

#adminEmailCode::placeholder {
  letter-spacing: 0;
  text-align: center;
}

.auth-form button {
  border: 1px solid var(--forest);
  border-radius: 10px;
  background: var(--forest);
  color: white;
  padding: 0 13px;
  font-weight: 760;
  cursor: pointer;
}

body.auth-locked .auth-form button {
  min-height: 38px;
  border-radius: 999px;
  border-color: rgba(32, 81, 70, 0.42);
  background: rgba(32, 81, 70, 0.9);
  color: #fffdf4;
  box-shadow: 0 10px 18px rgba(10, 38, 32, 0.16);
  font-size: 13px;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.remember-row {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  color: #17352e;
  font-size: 13px;
  font-weight: 740;
}

.remember-row input {
  width: 16px !important;
  min-height: 16px !important;
  accent-color: #17372f;
}

.sidebar-remember {
  width: 100%;
  justify-content: center;
  min-height: 34px;
  border: 1px solid rgba(28, 70, 56, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.48);
  font-size: 12px;
}

.link-button,
body.auth-locked .auth-form .link-button {
  border: 0;
  background: transparent;
  color: #1f5b52;
  min-height: 18px;
  padding: 0;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
  box-shadow: none;
}

.auth-form button:disabled {
  border-color: var(--line);
  background: #e8eee9;
  color: var(--muted);
  cursor: not-allowed;
}

.auth-form button.danger {
  border-color: rgba(217, 67, 54, 0.72);
  background: #fff1ef;
  color: #9b2017;
}

.auth-panel [hidden],
.auth-panel form[hidden],
body.auth-locked .auth-panel [hidden],
body.auth-locked .auth-panel form[hidden] {
  display: none !important;
  visibility: hidden !important;
}

@keyframes mistDrift {
  from { transform: translate3d(-1.5%, -0.5%, 0) scale(1.03); }
  to { transform: translate3d(1.5%, 0.8%, 0) scale(1.05); }
}

@media (prefers-reduced-motion: reduce) {
  body.auth-locked::before,
  body.auth-locked .auth-panel,
  body.auth-locked .auth-welcome-mark img,
  body.auth-locked .auth-reveal-content {
    animation: none;
    transition-duration: 0.01ms;
  }
}

@media (max-width: 560px) {
  body.auth-locked .workspace {
    padding: 16px;
  }

  body.auth-locked .auth-panel {
    width: min(360px, calc(100vw - 32px));
    min-height: clamp(190px, 34vh, 280px);
    border-radius: 24px;
  }

  body.auth-locked.auth-revealed .auth-panel {
    min-height: auto;
    padding: 22px;
  }
}

.page {
  display: none;
}

.page.active {
  display: block;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
  text-transform: uppercase;
}

h1, h2, p {
  margin: 0;
}

h1 {
  font-size: 30px;
  line-height: 1.05;
}

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

.header-actions button {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
  color: var(--ink);
  padding: 9px 12px;
  font-weight: 680;
  cursor: pointer;
}

.header-actions .primary {
  background: var(--forest);
  color: white;
}

button.danger,
.header-actions button.danger,
.recovery-actions button.danger {
  border-color: rgba(217, 67, 54, 0.5);
  background: #fff1ef;
  color: #9b2017;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 18px 45px rgba(20, 32, 29, 0.08);
  overflow: hidden;
  margin-bottom: 16px;
}

.band {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.68);
}

.band h2 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 14px;
}

.metric {
  min-height: 86px;
  border-radius: 10px;
  padding: 13px;
  display: grid;
  align-content: space-between;
  border: 1px solid rgba(20, 32, 29, 0.08);
}

.metric span {
  font-size: 13px;
  font-weight: 700;
}

.metric strong {
  font-size: 30px;
  line-height: 1;
}

.metric.blue {
  background: var(--blue);
  color: var(--blue-ink);
}

.metric.yellow {
  background: var(--yellow);
  color: var(--yellow-ink);
}

.home-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.home-metric {
  min-height: 92px;
  display: grid;
  align-content: space-between;
  gap: 12px;
  padding: 13px;
  border: 1px solid rgba(20, 32, 29, 0.08);
  border-radius: 10px;
  background: #f7faf8;
  color: var(--ink);
  box-shadow: 0 12px 28px rgba(20, 32, 29, 0.06);
}

.home-metric.wide {
  grid-column: span 2;
}

.home-metric:nth-child(6) {
  grid-column: 1;
}

.home-metric span {
  color: rgba(20, 32, 29, 0.68);
  font-size: 12px;
  font-weight: 800;
}

.home-metric strong {
  font-size: 24px;
  line-height: 1.1;
}

.home-metric.wide strong {
  font-size: 14px;
  line-height: 1.35;
}

.home-metric.navy {
  background: #17385f;
  color: white;
}

.home-metric.navy span,
.home-metric.dark-red span {
  color: rgba(255, 255, 255, 0.78);
}

.home-metric.light-blue {
  background: #cfe8f7;
}

.home-metric.light-yellow {
  background: #fff0b8;
}

.home-metric.dark-red {
  background: #7f1d1d;
  color: white;
}

.home-metric.white {
  background: white;
  color: #111815;
}

.home-metric.light-red {
  background: #f9d7d5;
}

.home-metric.medium-red {
  background: #efb5b0;
}

.home-metric.deep-red {
  background: #dc8f88;
}

.home-control-panel {
  overflow: visible;
  position: relative;
  z-index: 20;
}

.home-filter-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.2fr) repeat(8, minmax(92px, 1fr));
  gap: 8px;
  padding: 12px;
  align-items: start;
}

.home-filter-row input[type="search"] {
  min-height: 34px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 10px;
  font-size: 12px;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.filter {
  position: relative;
  min-width: 148px;
}

.filter summary {
  list-style: none;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
  padding: 9px 11px;
  font-size: 13px;
  font-weight: 760;
  cursor: pointer;
}

.filter.compact {
  min-width: 0;
}

.filter.compact summary {
  min-height: 34px;
  padding: 8px 10px;
  font-size: 12px;
}

.filter summary::-webkit-details-marker {
  display: none;
}

.filter > div,
.filter label {
  display: grid;
  gap: 8px;
}

.filter[open] > div,
.filter[open] > label {
  position: absolute;
  z-index: 10;
  min-width: 212px;
  max-height: min(360px, 58vh);
  overflow: auto;
  padding: 10px;
  margin-top: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  box-shadow: 0 18px 34px rgba(20, 32, 29, 0.16);
}

.filter.compact[open] > div {
  min-width: 230px;
}

.filter label {
  grid-template-columns: 18px 1fr;
  align-items: center;
  font-size: 13px;
  color: var(--ink);
}

.home-content-table td:nth-child(3) {
  white-space: normal;
}

.icon-button {
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #f7faf8;
  color: var(--forest);
  cursor: pointer;
}

#timelineDialog {
  width: min(1480px, calc(100vw - 20px));
  max-width: calc(100vw - 20px);
}

.timeline-modal {
  width: 100%;
  max-height: calc(100vh - 20px);
  overflow-x: hidden;
  overflow-y: auto;
}

.timeline-toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}

.timeline-toolbar select {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 10px;
  background: white;
}

.segmented-control {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f6f8f5;
}

.segmented-control label {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 0 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.segmented-control input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented-control label:has(input:checked) {
  background: var(--forest);
  color: white;
}

.timeline-chart {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
  min-height: 340px;
  padding: 28px 18px;
  width: 100%;
}

.timeline-chart[data-axis="season"] {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.timeline-month {
  display: grid;
  justify-items: center;
  align-items: end;
  gap: 6px;
}

.timeline-month i {
  display: block;
  width: 100%;
  max-width: 48px;
  min-height: 4px;
  border-radius: 999px 999px 4px 4px;
  background: #5d9b8d;
}

.timeline-month span,
.timeline-month strong {
  font-size: 11px;
}

.timeline-modal .usage-table-wrap {
  overflow-x: hidden;
}

.timeline-modal table {
  table-layout: fixed;
}

:is(#page-statistics, #page-content-management) {
  --home-line: rgba(31, 67, 58, 0.11);
  --home-shadow: 0 18px 42px rgba(28, 55, 48, 0.08);
}

:is(#page-statistics, #page-content-management) .page-header {
  position: relative;
  overflow: hidden;
  align-items: end;
  margin-bottom: 14px;
  padding: 18px;
  border: 1px solid var(--home-line);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(245, 250, 247, 0.78)),
    radial-gradient(circle at 12% 12%, rgba(255, 240, 184, 0.48), transparent 34%),
    radial-gradient(circle at 92% 0%, rgba(207, 232, 247, 0.62), transparent 28%);
  box-shadow: var(--home-shadow);
}

:is(#page-statistics, #page-content-management) .page-header h1 {
  font-size: 28px;
  line-height: 1;
}

.home-subtitle {
  margin-top: 6px;
  color: #60736d;
  font-size: 13px;
  font-weight: 650;
}

:is(#page-statistics, #page-content-management) .header-actions button {
  min-height: 30px;
  border-radius: 999px;
  background: #ffffff;
  color: #17385f;
  border-color: rgba(23, 56, 95, 0.18);
  box-shadow: 0 8px 16px rgba(23, 56, 95, 0.08);
  padding: 6px 11px;
  font-size: 12px;
}

:is(#page-statistics, #page-content-management) .refresh-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.refresh-note {
  color: #5f706a;
  font-size: 12px;
  font-weight: 720;
  white-space: nowrap;
}

.header-actions button[data-live-refresh],
.table-toolbar button[data-live-refresh] {
  min-height: 30px;
  padding: 6px 10px;
  font-size: 12px;
}

:is(#page-statistics, #page-content-management) .home-metrics {
  gap: 8px;
  margin-bottom: 12px;
}

:is(#page-statistics, #page-content-management) .home-metric {
  min-height: 82px;
  padding: 12px;
  border-radius: 16px;
  border-color: rgba(255, 255, 255, 0.72);
  box-shadow: 0 14px 30px rgba(30, 55, 49, 0.09);
}

:is(#page-statistics, #page-content-management) .home-metric span {
  font-size: 11px;
  text-transform: uppercase;
}

:is(#page-statistics, #page-content-management) .home-metric strong {
  font-size: 26px;
  font-weight: 860;
}

:is(#page-statistics, #page-content-management) .home-control-panel {
  margin-bottom: 12px;
  border-color: var(--home-line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--home-shadow);
  backdrop-filter: blur(12px);
}

:is(#page-statistics, #page-content-management) .home-filter-row {
  grid-template-columns: minmax(190px, 1.4fr) repeat(8, minmax(88px, 1fr));
  gap: 7px;
  padding: 10px;
}

:is(#page-statistics, #page-content-management) .home-filter-row input[type="search"],
:is(#page-statistics, #page-content-management) .filter.compact summary {
  min-height: 32px;
  border-radius: 999px;
  border-color: rgba(31, 67, 58, 0.12);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.84);
}

:is(#page-statistics, #page-content-management) .filter.compact summary {
  display: flex;
  align-items: center;
  justify-content: center;
}

:is(#page-statistics, #page-content-management) .filter[open] > div {
  border-radius: 16px;
  box-shadow: 0 22px 44px rgba(28, 55, 48, 0.18);
}

:is(#page-statistics, #page-content-management) .panel:not(.home-control-panel) {
  border-color: var(--home-line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--home-shadow);
}

:is(#page-statistics, #page-content-management) .usage-table-wrap {
  padding: 8px;
}

:is(#page-statistics, #page-content-management) table {
  border-collapse: separate;
  border-spacing: 0 6px;
  background: transparent;
}

:is(#page-statistics, #page-content-management) thead th {
  border: 0;
  padding: 5px 10px;
  color: #6d7b75;
}

:is(#page-statistics, #page-content-management) tbody tr {
  background: white;
  box-shadow: 0 10px 22px rgba(30, 55, 49, 0.055);
}

:is(#page-statistics, #page-content-management) tbody td {
  border: 0;
  padding: 12px 10px;
}

:is(#page-statistics, #page-content-management) tbody td:first-child {
  border-radius: 14px 0 0 14px;
}

:is(#page-statistics, #page-content-management) tbody td:last-child {
  border-radius: 0 14px 14px 0;
}

:is(#page-statistics, #page-content-management) .status-pill {
  background: #edf4ef;
  color: #17372f;
}

:is(#page-statistics, #page-content-management) .icon-button {
  background: #fff7df;
  border-color: rgba(107, 76, 0, 0.12);
}

.content-list {
  display: grid;
  gap: 8px;
  padding: 12px 14px 16px;
}

.connections-panel {
  scroll-margin-top: 18px;
}

.connection-map {
  position: relative;
  min-height: 520px;
  margin: 14px;
  border-radius: 14px;
  background:
    linear-gradient(rgba(20, 32, 29, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20, 32, 29, 0.045) 1px, transparent 1px),
    #fbfcfa;
  background-size: 34px 34px;
  overflow: hidden;
}

.connection-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.connection-lines line {
  stroke: rgba(22, 55, 47, 0.34);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-dasharray: 7 8;
}

.connection-node {
  position: absolute;
  width: 190px;
  min-height: 82px;
  padding: 12px;
  border: 1px solid rgba(20, 32, 29, 0.13);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 16px 34px rgba(20, 32, 29, 0.10);
}

.connection-node strong {
  display: block;
  font-size: 14px;
  margin-bottom: 4px;
}

.connection-node span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.connection-node.central {
  left: 50%;
  top: 50%;
  width: 220px;
  min-height: 94px;
  transform: translate(-50%, -50%);
  background: var(--forest);
  color: white;
  border-color: rgba(255, 255, 255, 0.26);
}

.connection-node.central span {
  color: rgba(255, 255, 255, 0.74);
}

.supabase { left: 6%; top: 7%; }
.cloudflare { right: 6%; top: 7%; }
.google-maps { left: 50%; top: 3.5%; transform: translateX(-50%); }
.worker { right: 2.5%; top: 43%; }
.app { right: 14%; bottom: 7%; }
.admin-domain { left: 14%; bottom: 7%; }
.public-domain { left: 2.5%; top: 43%; }
.github { left: 50%; bottom: 3.5%; transform: translateX(-50%); }

.connection-label {
  position: absolute;
  border-radius: 999px;
  padding: 5px 8px;
  background: #e8eee9;
  color: var(--forest);
  font-size: 11px;
  font-weight: 760;
  border: 1px solid rgba(20, 32, 29, 0.08);
}

.label-db { left: 28%; top: 24%; }
.label-r2 { right: 27%; top: 24%; }
.label-maps { left: 49%; top: 25%; transform: translateX(-50%); }
.label-worker { right: 23%; top: 49%; }
.label-app { right: 30%; bottom: 23%; }
.label-admin { left: 30%; bottom: 23%; }
.label-public { left: 22%; top: 49%; }
.label-github { left: 50%; bottom: 27%; transform: translateX(-50%); }

.content-card {
  position: relative;
  display: grid;
  grid-template-columns: 78px 70px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 82px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: white;
}

.thumb {
  width: 78px;
  height: 58px;
  border-radius: 8px;
  object-fit: cover;
  background: #d8dfda;
}

.marks {
  display: flex;
  gap: 6px;
  align-items: center;
}

.mark {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 850;
}

.mark.type {
  color: white;
  background: var(--forest);
}

.mark.draft {
  color: #000;
  background: #ffd33f;
}

.discontinued-ribbon {
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  border-top: 24px solid var(--red);
  border-right: 24px solid transparent;
}

.item-copy {
  min-width: 0;
}

.item-copy h3 {
  margin: 0 0 4px;
  font-size: 15px;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-copy p {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-actions {
  display: flex;
  gap: 6px;
}

.card-actions button {
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #f7f8f6;
  color: var(--forest);
  width: 36px;
  height: 34px;
  cursor: pointer;
}

.card-actions.wide button {
  width: auto;
  padding: 0 12px;
}

.table-toolbar {
  display: flex;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.notice-row {
  display: grid;
  gap: 3px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: #f9fbf8;
}

.notice-row strong {
  font-size: 13px;
}

.notice-row span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.table-toolbar input {
  min-width: 260px;
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  background: white;
}

.table-toolbar button,
.bulk-box button,
.admin-actions button,
.moderation-actions button,
.integration-card button {
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #f7f8f6;
  color: var(--forest);
  min-height: 34px;
  padding: 0 11px;
  font-weight: 700;
  cursor: pointer;
}

.codex-panel {
  display: grid;
  min-height: min(720px, calc(100vh - 160px));
  grid-template-rows: auto auto 1fr;
}

.codex-workspace {
  display: grid;
  grid-template-columns: 238px minmax(0, 1fr);
  min-height: 500px;
}

.codex-cost-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
}

.codex-cost-bar span,
.codex-cost-bar a,
.codex-cost-note {
  border: 1px solid rgba(47, 107, 87, 0.14);
  border-radius: 999px;
  background: #f6faf7;
  color: var(--forest);
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 760;
}

.codex-cost-bar a {
  text-decoration: none;
}

.codex-usage-modal {
  width: min(880px, calc(100vw - 24px));
}

.codex-usage-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfa;
}

.codex-usage-summary article {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
  padding: 10px;
}

.codex-usage-summary span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
  text-transform: uppercase;
}

.codex-usage-summary strong {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.35;
}

.codex-usage-actions {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.codex-usage-actions a {
  display: inline-grid;
  place-items: center;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #f7f8f6;
  color: var(--forest);
  padding: 0 11px;
  font-size: 12px;
  font-weight: 760;
  text-decoration: none;
}

.muted-cell {
  color: var(--muted);
  font-size: 11px;
}

.codex-sidebar {
  border-right: 1px solid var(--line);
  background: #f7f9f6;
  overflow: hidden;
}

.codex-sidebar-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border-bottom: 1px solid var(--line);
}

.codex-sidebar-head strong {
  flex: 1 0 100%;
  font-size: 11px;
  text-transform: uppercase;
  color: var(--forest);
}

.codex-sidebar-head button {
  border: 1px solid var(--line);
  border-radius: 9px;
  background: white;
  color: var(--forest);
  min-height: 28px;
  padding: 0 9px;
  font-size: 11px;
  font-weight: 740;
  cursor: pointer;
}

.codex-thread-list {
  display: grid;
  gap: 7px;
  max-height: calc(100vh - 320px);
  overflow-y: auto;
  padding: 8px;
}

.codex-thread-item {
  display: grid;
  gap: 6px;
  width: 100%;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  padding: 8px;
}

.codex-thread-item.active,
.codex-thread-item:hover {
  border-color: rgba(47, 107, 87, 0.22);
  background: white;
}

.codex-thread-item > button {
  display: grid;
  gap: 3px;
  width: 100%;
  border: 0;
  background: transparent;
  padding: 0;
  text-align: left;
  cursor: pointer;
}

.codex-thread-item > div {
  display: flex;
  gap: 5px;
}

.codex-thread-item > div button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7f8f6;
  color: var(--forest);
  min-height: 24px;
  padding: 0 7px;
  font-size: 10px;
  font-weight: 760;
  cursor: pointer;
}

.codex-thread-list strong {
  color: var(--ink);
  font-size: 12px;
}

.codex-thread-list strong[contenteditable="true"] {
  min-width: 0;
  border-radius: 6px;
  padding: 2px 4px;
  outline: none;
  cursor: text;
  overflow-wrap: anywhere;
}

.codex-thread-list strong[contenteditable="true"]:focus {
  background: #fff;
  box-shadow: 0 0 0 2px rgba(39, 107, 94, 0.22);
}

.codex-thread-list strong[contenteditable="true"]:empty::before {
  content: "New chat";
  color: var(--muted);
}

.codex-thread-list span {
  color: var(--muted);
  font-size: 10px;
}

.codex-chat {
  display: grid;
  min-width: 0;
  grid-template-rows: 1fr auto auto;
}

.codex-messages {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 360px;
  max-height: calc(100vh - 340px);
  overflow-y: auto;
  padding: 12px;
  background: #fbfcfa;
}

.codex-message {
  width: min(760px, 100%);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
  padding: 10px 12px;
  box-shadow: 0 10px 24px rgba(20, 32, 29, 0.06);
}

.codex-message.user {
  justify-self: end;
  background: #eff6f2;
  border-color: rgba(47, 107, 87, 0.22);
}

.codex-message strong {
  display: block;
  margin-bottom: 6px;
  color: var(--forest);
  font-size: 11px;
  text-transform: uppercase;
}

.codex-message p {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.codex-cost-note {
  display: inline-block;
  margin-top: 8px;
}

.codex-message-files {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.codex-message-files span,
.codex-attachments span {
  border: 1px solid rgba(47, 107, 87, 0.16);
  border-radius: 999px;
  background: #f7faf7;
  color: var(--forest);
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 720;
}

.codex-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  background: #fbfcfa;
}

.codex-attachments button {
  margin-left: 6px;
  border: 0;
  background: transparent;
  color: var(--forest);
  cursor: pointer;
  font-weight: 900;
}

.codex-composer {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  padding: 14px;
  border-top: 1px solid var(--line);
  background: white;
}

.codex-upload {
  align-self: end;
  display: grid;
  place-items: center;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f7f8f6;
  color: var(--forest);
  padding: 0 12px;
  font-weight: 760;
  cursor: pointer;
}

.codex-upload input {
  display: none;
}

.codex-composer textarea {
  width: 100%;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 12px;
  font: inherit;
  line-height: 1.45;
}

.codex-composer button {
  align-self: end;
  border: 1px solid var(--forest);
  border-radius: 10px;
  background: var(--forest);
  color: white;
  min-height: 42px;
  padding: 0 16px;
  font-weight: 760;
  cursor: pointer;
}

.codex-composer button:disabled {
  cursor: progress;
  opacity: 0.72;
}

.table-wrap {
  overflow-x: auto;
}

.usage-table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: white;
}

th, td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 13px;
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

td span {
  color: var(--muted);
  font-size: 12px;
}

.content-chip {
  display: inline-flex;
  margin: 2px 5px 2px 0;
  border-radius: 999px;
  padding: 4px 8px;
  background: #eef3ef;
  color: var(--forest);
  font-size: 11px;
  font-weight: 760;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 9px;
  background: #e8eee9;
  color: var(--forest);
  font-size: 11px;
  font-weight: 800;
}

.status-pill.warning {
  background: var(--yellow);
  color: var(--yellow-ink);
}

.status-pill.red {
  background: #ffe3df;
  color: #9b2017;
}

.status-pill.danger {
  background: #ffe3df;
  color: #9b2017;
}

.moderation-list,
.admin-card-grid,
.integration-grid,
.role-grid,
.workflow-grid {
  display: grid;
  gap: 10px;
  padding: 14px;
}

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

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

.insight-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 14px;
}

.usage-insight-list {
  display: grid;
  gap: 8px;
  padding: 14px;
}

.insight-grid .usage-insight-list {
  padding: 0;
}

.usage-insight-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
}

.usage-insight-row strong,
.usage-insight-row span {
  display: block;
}

.usage-insight-row strong {
  font-size: 13px;
}

.usage-insight-row span {
  color: var(--muted);
  font-size: 12px;
}

.usage-mini-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.usage-mini-stats span {
  min-height: 24px;
  border-radius: 999px;
  padding: 5px 8px;
  background: #e8eee9;
  color: var(--forest);
  font-size: 11px;
  font-weight: 800;
}

.moderation-card,
.admin-card,
.integration-card,
.role-card,
.workflow-lane,
.bulk-box {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  padding: 12px;
}

.workflow-lane {
  display: grid;
  gap: 12px;
  align-content: start;
}

.workflow-head {
  display: grid;
  gap: 5px;
}

.workflow-head h3 {
  margin: 0;
  font-size: 15px;
}

.workflow-head p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.workflow-path {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.workflow-path span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 8px;
  background: #f7f8f3;
  color: var(--forest);
  font-size: 11px;
  font-weight: 750;
}

.workflow-lane strong {
  color: var(--forest);
  font-size: 12px;
}

.moderation-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
}

.moderation-card h3,
.admin-card h3,
.integration-card h3,
.role-card h3 {
  margin: 0 0 5px;
  font-size: 15px;
}

.moderation-card p,
.admin-card p,
.integration-card p,
.role-card p,
.bulk-box span {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.role-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.role-card strong {
  display: block;
  margin-bottom: 7px;
  color: var(--forest);
  font-size: 12px;
}

.recovery-flow {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 14px;
}

.recovery-step {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  min-height: 118px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
}

.recovery-step > span {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--forest);
  color: white;
  font-size: 11px;
  font-weight: 850;
}

.recovery-step h3 {
  margin: 0 0 5px;
  font-size: 14px;
}

.recovery-step p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.recovery-console {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.recovery-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.recovery-stats article {
  min-height: 72px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
}

.recovery-stats span,
.recovery-code-list span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.recovery-stats strong {
  display: block;
  margin-top: 6px;
  font-size: 20px;
}

.recovery-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.recovery-actions button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
  color: var(--ink);
  padding: 0 12px;
  font-weight: 750;
  cursor: pointer;
}

.recovery-actions .primary {
  border-color: var(--forest);
  background: var(--forest);
  color: white;
}

.generated-codes {
  padding: 12px;
  border: 1px solid rgba(107, 76, 0, 0.22);
  border-radius: 12px;
  background: #fff9e2;
}

.generated-codes strong {
  display: block;
  margin-bottom: 9px;
  color: var(--yellow-ink);
  font-size: 13px;
}

.generated-codes div {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.generated-codes code {
  padding: 8px 9px;
  border: 1px solid rgba(107, 76, 0, 0.18);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

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

.recovery-code-list article,
.empty-note {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
}

.recovery-code-list strong {
  display: block;
  margin-bottom: 3px;
  font-size: 13px;
}

.empty-note {
  color: var(--muted);
  font-size: 12px;
}

.moderation-meta,
.integration-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 9px;
}

.moderation-actions,
.admin-actions,
.integration-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-content: start;
  justify-content: flex-end;
}

.usage-stack {
  display: grid;
  gap: 8px;
  margin: 10px 0;
}

.usage-row {
  display: grid;
  gap: 4px;
}

.usage-row span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.usage-row em {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  font-style: normal;
}

.usage-bar {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e3e8e4;
}

.usage-bar i {
  display: block;
  height: 100%;
  width: var(--value);
  border-radius: inherit;
  background: linear-gradient(90deg, #2f6b57, #91b38a);
}

.usage-bar.unknown i {
  width: 100%;
  background: repeating-linear-gradient(90deg, #c9d2ce, #c9d2ce 8px, #edf1ee 8px, #edf1ee 16px);
}

.connection-facts {
  display: grid;
  gap: 5px;
  margin: 12px 0;
}

.connection-facts dt {
  color: var(--forest);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.connection-facts dd {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.bulk-box {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin: 14px;
}

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

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

.admin-role-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

dialog {
  border: 0;
  border-radius: 16px;
  padding: 0;
  width: min(620px, calc(100vw - 34px));
  box-shadow: 0 24px 80px rgba(20, 32, 29, 0.28);
}

dialog::backdrop {
  background: rgba(7, 12, 11, 0.42);
}

.modal-card {
  background: white;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.modal-header h2 {
  font-size: 17px;
}

.modal-header button {
  border: 0;
  background: #eef0ec;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  cursor: pointer;
}

.permission-list {
  display: grid;
  gap: 10px;
  padding: 14px 16px 18px;
}

.permission-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
}

.permission-item strong {
  display: block;
  font-size: 14px;
}

.permission-item span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.switch {
  position: relative;
  width: 46px;
  height: 28px;
}

.switch input {
  opacity: 0;
}

.slider {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #ccd3cf;
}

.slider::after {
  content: "";
  position: absolute;
  width: 22px;
  height: 22px;
  top: 3px;
  left: 3px;
  border-radius: 50%;
  background: white;
  transition: transform 0.18s ease;
}

.switch input:checked + .slider {
  background: #2f6b57;
}

.switch input:checked + .slider::after {
  transform: translateX(18px);
}

@media (max-width: 900px) {
  body {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: relative;
    height: auto;
    min-height: 360px;
  }

  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-metric.wide {
    grid-column: span 2;
  }

  .auth-panel {
    grid-template-columns: 1fr;
    display: grid;
  }

  .auth-form:not([hidden]) {
    grid-template-columns: 1fr;
  }

  .auth-form input {
    width: 100%;
  }

  .content-card {
    grid-template-columns: 64px 1fr auto;
  }

  .marks {
    grid-column: 1;
  }

  .connection-map {
    display: grid;
    gap: 10px;
    min-height: auto;
    padding: 12px;
  }

  .connection-lines,
  .connection-label {
    display: none;
  }

  .connection-node,
  .connection-node.central {
    position: static;
    width: auto;
    min-height: auto;
    transform: none;
  }

  .integration-grid,
  .workflow-grid,
  .insight-grid,
  .role-grid,
  .recovery-flow,
  .admin-card-grid,
  .codex-usage-summary,
  .recovery-stats,
  .generated-codes div {
    grid-template-columns: 1fr;
  }

  .moderation-card,
  .bulk-box {
    grid-template-columns: 1fr;
    display: grid;
  }

  .codex-composer {
    grid-template-columns: 1fr;
  }

  .codex-workspace {
    grid-template-columns: 1fr;
  }

  .codex-sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .codex-thread-list {
    max-height: 180px;
  }

  .codex-composer button {
    width: 100%;
  }

  .moderation-actions,
  .admin-actions {
    justify-content: flex-start;
  }
}
