:root {
  --ink: #111316;
  --paper: #fbfaf6;
  --surface: #ffffff;
  --muted: #626a73;
  --line: #dfe5e1;
  --leaf: #2f6f61;
  --blue: #2468d8;
  --coral: #e85d4a;
  --amber: #f2b84b;
  --shadow: 0 20px 70px rgba(18, 29, 35, 0.13);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(47, 111, 97, 0.12), transparent 38%),
    linear-gradient(315deg, rgba(232, 93, 74, 0.12), transparent 34%),
    var(--paper);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  line-height: 1.6;
}

a {
  color: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(17, 19, 22, 0.08);
  background: rgba(251, 250, 246, 0.88);
  backdrop-filter: blur(18px);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 14px 22px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 900;
  letter-spacing: 0;
  white-space: nowrap;
}

.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: var(--ink);
  box-shadow: 0 10px 24px rgba(17, 19, 22, 0.18);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.nav-links a,
.button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 8px;
  padding: 10px 14px;
  text-decoration: none;
  font-weight: 800;
  transition: transform 180ms ease, background 180ms ease, color 180ms ease;
}

.nav-links a:hover,
.button:hover {
  transform: translateY(-1px);
}

.button.primary {
  color: #fff;
  background: var(--ink);
}

.button.secondary {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
}

.hero {
  min-height: calc(100dvh - 66px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 460px);
  align-items: center;
  gap: 36px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 56px 22px 44px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.68);
  color: var(--muted);
  font-weight: 800;
  font-size: 14px;
}

h1,
h2,
h3 {
  line-height: 1.1;
  letter-spacing: 0;
}

h1 {
  margin: 18px 0 18px;
  font-size: clamp(44px, 7vw, 92px);
}

h2 {
  margin: 0 0 12px;
  font-size: clamp(30px, 4vw, 54px);
}

h3 {
  margin: 0 0 8px;
  font-size: 22px;
}

.lead {
  max-width: 680px;
  color: #394047;
  font-size: 20px;
}

.hero-actions,
.action-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 26px;
}

.phone-stage {
  position: relative;
  min-height: 610px;
}

.phone {
  position: absolute;
  inset: 0 20px auto auto;
  width: min(390px, 100%);
  min-height: 590px;
  border: 10px solid #15171a;
  border-radius: 34px;
  background: #f7f8f5;
  box-shadow: var(--shadow);
  overflow: hidden;
  transform: rotate(1.5deg);
}

.phone-inner {
  padding: 24px 18px;
}

.status-row,
.mini-row,
.feature-grid,
.cards-grid {
  display: grid;
  gap: 12px;
}

.status-row {
  grid-template-columns: repeat(3, 1fr);
}

.mini-stat,
.screen-card,
.feature,
.doc-block {
  border: 1px solid rgba(17, 19, 22, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 12px 36px rgba(18, 29, 35, 0.08);
}

.mini-stat {
  padding: 12px;
}

.mini-stat strong {
  display: block;
  font-size: 24px;
}

.screen-card {
  margin-top: 14px;
  padding: 16px;
}

.tag {
  display: inline-flex;
  border-radius: 999px;
  padding: 4px 9px;
  color: #fff;
  background: var(--leaf);
  font-size: 12px;
  font-weight: 900;
}

.tag.coral {
  background: var(--coral);
}

.tag.blue {
  background: var(--blue);
}

.mini-row {
  grid-template-columns: 36px 1fr auto;
  align-items: center;
  margin-top: 12px;
}

.mini-icon {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: var(--ink);
}

.section {
  max-width: 1180px;
  margin: 0 auto;
  padding: 66px 22px;
}

.section-intro {
  max-width: 760px;
  color: var(--muted);
  font-size: 18px;
}

.feature-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 24px;
}

.feature {
  padding: 22px;
}

.feature-icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  margin-bottom: 16px;
  border-radius: 8px;
  color: #fff;
  background: var(--ink);
}

.band {
  background: #111316;
  color: #f8f4e8;
}

.band .section-intro,
.band .muted {
  color: #c8d0ca;
}

.cards-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.doc-block {
  padding: 24px;
}

.doc-block ul {
  padding-left: 22px;
}

.muted {
  color: var(--muted);
}

.site-footer {
  border-top: 1px solid rgba(17, 19, 22, 0.08);
  padding: 28px 22px;
}

.footer-inner {
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

.table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: 8px;
}

.table th,
.table td {
  border-bottom: 1px solid var(--line);
  padding: 12px;
  text-align: left;
  vertical-align: top;
}

.admin-shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 34px 22px 66px;
}

.admin-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 18px;
  margin-bottom: 20px;
}

.admin-hero h1 {
  margin: 14px 0 12px;
  font-size: clamp(34px, 5vw, 64px);
}

.admin-hero .lead {
  margin: 0;
}

.admin-session {
  min-width: 150px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--muted);
  font-weight: 900;
  text-align: center;
}

.admin-session.active {
  border-color: rgba(47, 111, 97, 0.38);
  color: var(--leaf);
  background: rgba(47, 111, 97, 0.09);
}

.admin-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.metric-card,
.admin-card,
.admin-panel,
.detail-card,
.audit-check,
.queue-row,
.crash-row {
  border: 1px solid rgba(17, 19, 22, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 12px 36px rgba(18, 29, 35, 0.08);
}

.metric-card {
  display: grid;
  align-content: start;
  min-height: 132px;
  padding: 18px;
}

.metric-label,
.detail-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.metric-card strong {
  margin-top: 10px;
  font-size: 28px;
  line-height: 1.1;
}

.metric-card small,
.detail-card small,
.queue-row span,
.crash-row small {
  color: var(--muted);
}

.metric-card.ok {
  border-color: rgba(47, 111, 97, 0.34);
}

.metric-card.warning {
  border-color: rgba(242, 184, 75, 0.6);
}

.metric-card.failed {
  border-color: rgba(232, 93, 74, 0.6);
}

.admin-layout {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.admin-card,
.admin-panel {
  padding: 20px;
}

.admin-controls {
  position: sticky;
  top: 88px;
}

.admin-form {
  margin-top: 16px;
}

.control-group {
  margin-top: 18px;
}

.admin-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 18px;
}

.admin-actions .button,
.admin-form .button {
  width: 100%;
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.panel-heading h2 {
  margin: 8px 0 0;
  font-size: 26px;
}

.eyebrow.compact {
  padding: 5px 9px;
  font-size: 12px;
}

.button.subtle {
  min-height: 38px;
  padding: 8px 11px;
  font-size: 14px;
}

.button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.admin-empty {
  border: 1px dashed rgba(17, 19, 22, 0.18);
  border-radius: 8px;
  padding: 18px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.58);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 10px;
  background: #fff;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.status-pill.ok {
  border-color: rgba(47, 111, 97, 0.36);
  color: var(--leaf);
  background: rgba(47, 111, 97, 0.1);
}

.status-pill.warning {
  border-color: rgba(242, 184, 75, 0.6);
  color: #7a5200;
  background: rgba(242, 184, 75, 0.18);
}

.status-pill.failed {
  border-color: rgba(232, 93, 74, 0.58);
  color: #9b2d20;
  background: rgba(232, 93, 74, 0.12);
}

.queue-list,
.audit-checks,
.crash-list {
  display: grid;
  gap: 10px;
}

.queue-row,
.audit-check,
.crash-row {
  padding: 14px;
}

.queue-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.queue-stats {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.queue-stats span {
  border-radius: 8px;
  padding: 4px 8px;
  background: rgba(17, 19, 22, 0.06);
  font-size: 12px;
  font-weight: 800;
}

.audit-check {
  display: grid;
  gap: 6px;
}

.audit-check.ok {
  border-left: 4px solid var(--leaf);
}

.audit-check.warning {
  border-left: 4px solid var(--amber);
}

.audit-check.failed {
  border-left: 4px solid var(--coral);
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.detail-grid.compact-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 14px;
}

.detail-card {
  display: grid;
  gap: 7px;
  min-width: 0;
  padding: 14px;
  box-shadow: none;
}

.detail-card strong {
  overflow-wrap: anywhere;
}

.detail-card.wide {
  grid-column: 1 / -1;
}

.detail-card ul {
  margin: 0;
  padding-left: 18px;
}

.detail-card .button {
  width: fit-content;
  margin-top: 4px;
}

.crash-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.crash-row p {
  margin: 8px 0 6px;
}

.raw-panel {
  grid-column: 2;
}

.table-wrap {
  min-width: 0;
}

.table-scroll {
  overflow-x: auto;
  border: 1px solid rgba(17, 19, 22, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.74);
}

.data-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  border-bottom: 1px solid rgba(17, 19, 22, 0.08);
  padding: 11px 12px;
  text-align: left;
  vertical-align: top;
}

.data-table th {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  background: rgba(17, 19, 22, 0.035);
  white-space: nowrap;
}

.data-table td {
  max-width: 260px;
  overflow-wrap: anywhere;
}

.data-table tr:last-child td {
  border-bottom: 0;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  font: inherit;
  background: #fff;
}

textarea {
  resize: vertical;
}

button.button {
  border: 0;
  cursor: pointer;
}

button.button.secondary {
  border: 1px solid var(--line);
}

label {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
  font-weight: 800;
}

.create-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.admin-mini-form {
  min-width: 0;
  border: 1px solid rgba(17, 19, 22, 0.08);
  border-radius: 8px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.7);
}

.admin-mini-form h3 {
  margin-bottom: 14px;
  font-size: 20px;
}

.admin-mini-form .button {
  width: 100%;
}

.toggle-row {
  display: flex;
  gap: 10px 14px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.toggle-row label {
  display: flex;
  align-items: center;
  min-height: 34px;
  gap: 8px;
  margin: 0;
  font-weight: 800;
}

.toggle-row input {
  width: auto;
  min-height: auto;
}

pre {
  overflow: auto;
  border-radius: 8px;
  padding: 16px;
  background: #111316;
  color: #f8f4e8;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

@media (max-width: 860px) {
  .hero,
  .admin-hero,
  .admin-layout,
  .feature-grid,
  .cards-grid {
    grid-template-columns: 1fr;
  }

  .admin-metrics,
  .detail-grid,
  .detail-grid.compact-grid,
  .create-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-controls,
  .raw-panel {
    position: static;
    grid-column: auto;
  }

  .phone-stage {
    min-height: 520px;
  }

  .phone {
    position: relative;
    width: 100%;
    min-height: 500px;
    inset: auto;
    transform: none;
  }
}

@media (max-width: 560px) {
  .nav {
    gap: 8px 10px;
    padding: 12px 20px;
  }

  .nav-links {
    flex: 1;
    justify-content: flex-end;
    gap: 4px;
  }

  .nav-links a {
    min-height: 40px;
    padding: 8px 9px;
  }

  .admin-shell {
    padding: 24px 16px 54px;
  }

  .admin-metrics,
  .detail-grid,
  .detail-grid.compact-grid,
  .admin-actions,
  .create-grid {
    grid-template-columns: 1fr;
  }

  .metric-card {
    min-height: 112px;
  }

  .panel-heading,
  .queue-row {
    display: grid;
  }

  .queue-stats {
    justify-content: flex-start;
  }
}
