:root {
  color-scheme: dark;
  --bg: #05070b;
  --surface: #0d1117;
  --surface-2: #121821;
  --surface-3: #171f2b;
  --ink: #f4f7fb;
  --muted: #9aa5b5;
  --subtle: #778294;
  --line: #232b38;
  --line-strong: #344052;
  --accent: #7c5cff;
  --accent-2: #9b87ff;
  --accent-soft: rgba(124, 92, 255, 0.16);
  --teal: #35c7d4;
  --green: #41d990;
  --green-soft: rgba(65, 217, 144, 0.13);
  --amber: #f0b45a;
  --amber-soft: rgba(240, 180, 90, 0.13);
  --red: #ff6b7d;
  --red-soft: rgba(255, 107, 125, 0.13);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
  --shadow-soft: 0 14px 34px rgba(0, 0, 0, 0.24);
  --radius: 14px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--ink);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

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

.app-shell {
  display: grid;
  grid-template-columns: 256px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 24px;
  height: 100vh;
  padding: 22px 18px;
  overflow-y: auto;
  border-right: 1px solid var(--line);
  background: rgba(8, 11, 17, 0.88);
  backdrop-filter: blur(24px);
}

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

.brand-mark,
.avatar {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  font-weight: 950;
}

.brand strong,
.brand small,
.profile-card strong,
.profile-card small,
.workspace-card strong,
.workspace-card small {
  display: block;
}

.brand strong {
  font-size: 24px;
  letter-spacing: -0.02em;
}

.brand small,
.profile-card small,
.workspace-card small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.nav-list {
  display: grid;
  align-content: start;
  gap: 6px;
}

.nav-item,
.workspace-card,
.profile-card,
.logout-button {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  padding: 0 12px;
  text-align: left;
  font-weight: 760;
}

.nav-item svg,
.workspace-card svg,
.logout-button svg,
.button svg,
.link-row svg {
  width: 18px;
  height: 18px;
  stroke-width: 1.9;
  flex: 0 0 auto;
}

.nav-item.active {
  border-color: rgba(124, 92, 255, 0.42);
  background: var(--accent-soft);
  color: var(--ink);
  box-shadow: inset 3px 0 0 var(--accent);
}

.nav-item:hover,
.workspace-card:hover,
.profile-card:hover,
.logout-button:hover {
  border-color: var(--line);
  background: var(--surface-3);
  color: var(--ink);
}

.sidebar-footer {
  display: grid;
  gap: 10px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.workspace-card,
.profile-card,
.logout-button {
  min-height: 56px;
  border-color: var(--line);
  background: var(--surface-2);
}

.workspace-card > span,
.profile-card > span:not(.avatar) {
  flex: 1;
  min-width: 0;
}

.logout-button {
  justify-content: flex-start;
  min-height: 44px;
}

.main {
  min-width: 0;
  padding: 24px 28px 32px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.eyebrow {
  margin-bottom: 8px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.topbar h1 {
  font-size: clamp(34px, 4vw, 46px);
  line-height: 1.02;
  letter-spacing: -0.04em;
}

.topbar #viewSubtitle {
  max-width: 760px;
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.5;
}

.topbar-actions {
  display: flex;
  align-items: end;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.field {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.field.compact {
  min-width: 190px;
}

.command-field {
  min-width: min(340px, 38vw);
}

select,
input,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--ink);
  padding: 0 12px;
  outline: none;
}

textarea {
  min-height: 108px;
  padding: 10px 12px;
  resize: vertical;
}

select:focus,
input:focus,
textarea:focus {
  border-color: rgba(124, 92, 255, 0.7);
  box-shadow: 0 0 0 4px rgba(124, 92, 255, 0.14);
}

.button,
.file-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--ink);
  padding: 0 14px;
  font-weight: 850;
  white-space: nowrap;
}

.button.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  box-shadow: 0 10px 24px rgba(53, 28, 255, 0.22);
}

.button.ghost {
  background: var(--surface);
}

.button.small,
.file-button {
  min-height: 38px;
  padding: 0 12px;
  font-size: 13px;
}

.file-button {
  position: relative;
  overflow: hidden;
}

.file-button input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

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

.alert-item,
.panel,
.site-card,
.kpi-card,
.action-card,
.media-card,
.engine-card,
.timeline-card,
.setting-card,
.setup-guide-card,
.connection-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.alert-item {
  display: grid;
  gap: 4px;
  min-height: 82px;
  padding: 14px;
}

.alert-item span,
.kpi-card span,
.site-card span,
.action-card span,
.media-card span,
.engine-card span,
.inspector-item span,
.guard-card span,
.setting-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.alert-item strong {
  font-size: 15px;
}

.alert-item.ready {
  border-color: rgba(65, 217, 144, 0.38);
  background: var(--green-soft);
}

.alert-item.warn {
  border-color: rgba(240, 180, 90, 0.38);
  background: var(--amber-soft);
}

.view {
  display: none;
}

.view.active {
  display: block;
}

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

.panel {
  overflow: hidden;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.panel-head h2 {
  font-size: 20px;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.panel-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.audit-form,
.update-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: end;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.audit-form {
  grid-template-columns: minmax(0, 1fr) 220px auto;
}

.audit-result {
  display: none;
  padding: 18px 20px;
}

.audit-result.active {
  display: grid;
  gap: 12px;
}

.audit-onboarding {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.audit-onboarding article {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-2);
  padding: 14px;
}

.audit-onboarding span {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
}

.audit-onboarding p {
  color: var(--muted);
  line-height: 1.45;
}

.audit-next {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

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

.audit-summary article {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
  padding: 12px;
}

.audit-summary strong {
  display: block;
  margin-top: 6px;
  overflow-wrap: anywhere;
}

.audit-issues {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.kpi-card {
  display: grid;
  gap: 10px;
  min-height: 150px;
  padding: 22px;
}

.kpi-card svg {
  width: 26px;
  height: 26px;
  color: var(--accent);
  padding: 4px;
  border-radius: 10px;
  background: var(--accent-soft);
}

.kpi-card strong {
  font-size: 34px;
  line-height: 1;
  letter-spacing: -0.04em;
}

.kpi-card small {
  color: var(--muted);
  line-height: 1.35;
}

.split-layout,
.site-ops-layout,
.reports-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(318px, 0.31fr);
  gap: 16px;
}

.split-layout.wide-left {
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.34fr);
}

.site-ops-layout {
  grid-template-columns: minmax(0, 1fr) 370px;
}

.reports-layout {
  grid-template-columns: 360px minmax(0, 1fr);
}

.site-grid,
.action-list,
.media-grid,
.engine-grid,
.geo-blocks,
.checklist,
.takeover-list,
.connection-summary,
.settings-grid,
.report-list,
.page-strip,
.month-board {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.site-card {
  display: grid;
  gap: 14px;
  padding: 14px;
}

.site-card-main {
  display: grid;
  grid-template-columns: 188px minmax(0, 1fr) minmax(220px, 0.36fr) 28px;
  gap: 18px;
  align-items: center;
}

.site-thumb {
  display: grid;
  align-content: end;
  min-height: 118px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(124, 92, 255, 0.32), transparent 52%),
    linear-gradient(160deg, #10151e, #202838);
  color: #fff;
  padding: 16px;
  overflow: hidden;
}

.site-thumb span {
  color: rgba(255, 255, 255, 0.62);
  font-size: 12px;
}

.site-thumb strong {
  margin-top: 4px;
  font-size: 20px;
  letter-spacing: -0.03em;
}

.site-identity {
  display: grid;
  gap: 8px;
}

.site-identity strong {
  font-size: 24px;
  letter-spacing: -0.03em;
}

.site-identity small {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--green);
  flex: 0 0 auto;
}

.site-score-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

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

.score-box {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.score-box b {
  font-size: 30px;
  line-height: 1;
  letter-spacing: -0.04em;
}

.progress {
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-3);
}

.progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.progress.good i {
  background: var(--green);
}

.progress.warn i {
  background: var(--amber);
}

.progress.bad i {
  background: var(--red);
}

.icon-more {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
}

.icon-more svg {
  width: 18px;
  height: 18px;
}

.card-actions {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.site-card footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 2px;
}

.link-button {
  border: 0;
  background: transparent;
  color: var(--accent);
  padding: 0;
  font-weight: 900;
}

.link-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  padding: 0;
  text-align: left;
  font-weight: 780;
}

.link-row:last-child {
  border-bottom: 0;
}

.security-stack,
.quick-actions,
.mini-task-list {
  display: grid;
  gap: 10px;
}

.quick-actions {
  padding-top: 6px;
}

.pill,
.priority {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  padding: 0 10px;
  font-size: 12px;
  font-weight: 850;
}

.priority.high {
  background: var(--red-soft);
  color: var(--red);
}

.priority.medium {
  background: var(--amber-soft);
  color: var(--amber);
}

.priority.low,
.pill.ready {
  background: var(--green-soft);
  color: var(--green);
}

.action-card {
  display: grid;
  gap: 9px;
  padding: 14px;
}

.action-card header,
.media-card header,
.draft-card header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.action-card p,
.media-card p,
.action-card small,
.media-card small {
  color: var(--muted);
  line-height: 1.42;
}

.browser-preview {
  margin: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}

.browser-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  padding: 0 12px;
}

.browser-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #c9c7c0;
}

.browser-url {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 18px;
  padding: 20px;
}

.preview-body h3 {
  margin-bottom: 10px;
  font-size: 28px;
  letter-spacing: -0.04em;
}

.preview-body p,
.geo-block p,
.guard-card p,
.setting-card p {
  color: var(--muted);
  line-height: 1.48;
}

.preview-checks,
.inspector-stack {
  display: grid;
  gap: 10px;
}

.preview-checks span,
.inspector-item,
.check-row,
.guard-card,
.geo-block,
.setting-card,
.connection-card,
.takeover-row,
.timeline-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
  padding: 12px;
}

.preview-checks b {
  float: right;
}

.access-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 0 20px 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-2);
  padding: 14px;
}

.access-panel.ready {
  border-color: rgba(65, 217, 144, 0.38);
  background: var(--green-soft);
}

.access-panel.locked {
  border-color: rgba(240, 180, 90, 0.38);
  background: var(--amber-soft);
}

.access-panel span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.access-panel strong {
  display: block;
  margin-top: 4px;
  font-size: 16px;
}

.access-panel p {
  max-width: 720px;
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.45;
}

.site-empty-state {
  display: grid;
  gap: 12px;
  padding: 24px;
}

.site-empty-state span {
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.site-empty-state strong {
  font-size: 24px;
  letter-spacing: -0.02em;
}

.site-empty-state p {
  max-width: 680px;
  color: var(--muted);
  line-height: 1.5;
}

.quick-audit-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 190px auto;
  gap: 12px;
  align-items: end;
  max-width: 760px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-2);
  padding: 14px;
  box-shadow: var(--shadow-soft);
}

.empty-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.page-strip {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  padding-top: 0;
}

.page-strip button {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--ink);
  padding: 12px;
  text-align: left;
}

.page-strip button.active {
  border-color: rgba(124, 92, 255, 0.52);
  background: var(--accent-soft);
}

.inspector-panel {
  align-self: start;
}

.inspector-stack {
  padding: 16px;
}

.inspector-item {
  display: grid;
  gap: 6px;
}

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

.chip {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  padding: 0 12px;
  font-weight: 800;
}

.chip.active {
  border-color: rgba(124, 92, 255, 0.52);
  background: var(--accent-soft);
  color: var(--accent);
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 13px 12px;
  text-align: left;
  vertical-align: top;
}

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

td {
  font-size: 14px;
  line-height: 1.38;
}

.table-actions {
  display: grid;
  gap: 8px;
  min-width: 180px;
}

.media-grid {
  grid-template-columns: 1fr;
}

.media-card {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 14px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-2);
  padding: 12px;
  color: var(--ink);
  text-align: left;
}

.media-card.active,
.media-card:hover {
  border-color: rgba(124, 92, 255, 0.52);
  background: var(--surface-3);
}

.media-row-main {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.media-card header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.media-card strong,
.media-editor-head strong {
  overflow-wrap: anywhere;
}

.media-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.media-thumb {
  display: grid;
  place-items: center;
  width: 74px;
  height: 74px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
}

.media-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-thumb.missing {
  gap: 4px;
  color: var(--muted);
  font-size: 10px;
  text-align: center;
}

.media-thumb.missing span {
  color: var(--ink);
  font-size: 13px;
}

.media-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.media-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  padding: 6px 9px;
  font-size: 12px;
  font-weight: 850;
}

.media-chip b {
  color: var(--muted);
}

.media-chip strong {
  color: var(--ink);
}

.media-chip.ok {
  border-color: rgba(65, 217, 144, 0.38);
  background: var(--green-soft);
}

.media-chip.warn {
  border-color: rgba(240, 180, 90, 0.38);
  background: var(--amber-soft);
}

.media-editor {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.media-preview-frame {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-2);
}

.media-preview-frame .media-thumb {
  width: 100%;
  height: min(280px, 34vh);
  border: 0;
  border-radius: 0;
}

.media-editor-head {
  display: grid;
  gap: 6px;
}

.media-editor-head span {
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.media-editor-head p {
  color: var(--muted);
  line-height: 1.45;
}

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

.media-action-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
  padding: 12px;
}

.media-action-row p {
  color: var(--muted);
  line-height: 1.4;
}

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

.mini-actions button {
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-2);
  color: var(--ink);
  padding: 0 9px;
  font-size: 12px;
  font-weight: 820;
}

.chart-card {
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.chart-summary {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.chart-summary div {
  display: grid;
  gap: 3px;
}

.chart-summary > small {
  flex-basis: 100%;
  color: var(--muted);
  font-weight: 750;
}

.chart {
  display: grid;
  grid-template-columns: repeat(12, minmax(12px, 1fr));
  align-items: end;
  gap: 8px;
  height: 220px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-2);
  padding: 14px;
}

.bar {
  display: grid;
  align-items: end;
  gap: 4px;
  height: 100%;
}

.bar i {
  display: block;
  min-height: 4px;
  border-radius: 6px 6px 0 0;
  background: var(--accent);
}

.bar small {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.engine-card {
  display: grid;
  gap: 8px;
  padding: 14px;
}

.engine-card strong {
  font-size: 24px;
}

.geo-blocks {
  align-content: start;
}

.geo-block {
  display: grid;
  gap: 8px;
}

.month-board {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: start;
}

.month-column {
  display: grid;
  gap: 10px;
  min-height: 360px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-2);
  padding: 12px;
}

.month-column h3 {
  font-size: 15px;
}

.plan-item {
  display: grid;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
  padding: 11px;
}

.plan-item p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

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

.takeover-row div {
  min-width: 0;
}

.takeover-row p,
.takeover-row small {
  color: var(--muted);
  line-height: 1.35;
}

.switch {
  position: relative;
  display: inline-flex;
  width: 52px;
  height: 30px;
  flex: 0 0 auto;
}

.switch input {
  position: absolute;
  opacity: 0;
}

.switch i {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: var(--line-strong);
}

.switch i::after {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.16);
  content: "";
  transition: transform 0.18s ease;
}

.switch input:checked + i {
  background: var(--accent);
}

.switch input:checked + i::after {
  transform: translateX(22px);
}

.report-list {
  padding: 10px;
}

.report-list button {
  width: 100%;
  border: 0;
  border-radius: 12px;
  background: transparent;
  padding: 12px;
  text-align: left;
}

.report-list button.active,
.report-list button:hover {
  background: var(--surface-2);
}

.report-list span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.report-content {
  padding: 18px 20px;
}

.report-content h3 {
  margin: 16px 0 8px;
}

.report-content p {
  color: var(--muted);
  line-height: 1.5;
}

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

.setting-card {
  display: grid;
  gap: 8px;
}

.setup-guide {
  padding: 0 16px 16px;
}

.setup-guide-card {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.setup-guide-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.setup-guide-card p {
  color: var(--muted);
  line-height: 1.5;
}

.setup-guide-card pre {
  max-height: 230px;
  margin: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #070a10;
  color: var(--ink);
  padding: 14px;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.setup-steps {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.setup-steps span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  padding: 9px 10px;
  text-transform: none;
}

.data-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding: 0 16px 16px;
}

.timeline-card {
  display: grid;
  gap: 8px;
  margin: 16px;
}

.timeline-card p {
  color: var(--muted);
  line-height: 1.45;
}

.draft-panel {
  padding: 16px;
}

.draft-card {
  display: grid;
  gap: 14px;
}

.draft-card header,
.draft-card section {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
  padding: 12px;
}

.draft-card section {
  display: grid;
  gap: 8px;
  background: var(--surface);
}

.draft-card h3 {
  font-size: 14px;
}

.draft-card p,
.draft-card small {
  color: var(--muted);
  line-height: 1.45;
}

.draft-card pre {
  max-width: 100%;
  overflow: auto;
  border-radius: 12px;
  background: #070a10;
  color: var(--ink);
  padding: 12px;
  font-size: 12px;
}

.publish-guard {
  display: grid;
  gap: 10px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.guard-card {
  display: grid;
  gap: 6px;
}

.modal-backdrop {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(17, 18, 22, 0.5);
  padding: 20px;
}

.modal-backdrop[hidden] {
  display: none !important;
}

.modal {
  width: min(760px, 100%);
  max-height: min(760px, calc(100vh - 40px));
  overflow: auto;
  border-radius: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 30px 90px rgba(17, 18, 22, 0.28);
}

.modal-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.modal-body {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 18px;
}

.modal-body .span-2 {
  grid-column: 1 / -1;
}

.modal-feedback {
  grid-column: 1 / -1;
  border: 1px solid rgba(255, 107, 125, 0.36);
  border-radius: 12px;
  background: var(--red-soft);
  color: var(--red);
  padding: 12px;
  font-size: 13px;
  font-weight: 850;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  grid-column: 1 / -1;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 90;
  max-width: min(420px, calc(100vw - 32px));
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-2);
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.18);
  color: var(--ink);
  padding: 14px 16px;
  font-size: 14px;
  font-weight: 850;
}

.toast.error {
  border-color: rgba(255, 107, 125, 0.36);
  background: var(--red-soft);
  color: var(--red);
}

.toast.success {
  border-color: rgba(65, 217, 144, 0.38);
  background: var(--green-soft);
  color: var(--green);
}

.toast.warn {
  border-color: rgba(240, 180, 90, 0.38);
  background: var(--amber-soft);
}

.empty {
  padding: 14px;
  color: var(--muted);
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 230px minmax(0, 1fr);
  }

  .alert-bar,
  .audit-onboarding,
  .kpi-grid,
  .month-board,
  .engine-grid,
  .settings-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .site-card-main {
    grid-template-columns: 150px minmax(0, 1fr);
  }

  .site-score-pair,
  .icon-more {
    grid-column: 1 / -1;
  }

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

  .split-layout,
  .split-layout.wide-left,
  .site-ops-layout,
  .reports-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    position: sticky;
    z-index: 20;
    height: auto;
    gap: 12px;
    padding: 12px;
    overflow: visible;
  }

  .brand {
    min-height: 38px;
  }

  .nav-list {
    display: flex;
    gap: 8px;
    margin: 0 -12px;
    padding: 0 12px 2px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .nav-item {
    flex: 0 0 auto;
    width: auto;
    white-space: nowrap;
  }

  .sidebar-footer {
    display: none;
  }

  .main {
    padding: 16px 12px 26px;
  }

  .topbar,
  .topbar-actions,
  .panel-head,
  .site-card-main,
  .access-panel,
  .action-card header,
  .media-card header,
  .draft-card header {
    display: grid;
  }

  .command-field,
  .field.compact {
    min-width: 0;
  }

  .topbar h1 {
    font-size: 32px;
  }

  .alert-bar,
  .kpi-grid,
  .audit-form,
  .audit-summary,
  .update-toolbar,
  .quick-audit-box,
  .site-grid,
  .media-grid,
  .month-board,
  .engine-grid,
  .settings-grid,
  .setup-steps,
  .audit-onboarding,
  .page-strip,
  .score-row,
  .site-score-pair,
  .media-meta,
  .preview-body,
  .card-actions {
    grid-template-columns: 1fr;
  }

  .site-card-main {
    gap: 12px;
  }

  .site-thumb {
    min-height: 100px;
  }

  .modal-body {
    grid-template-columns: 1fr;
  }

  .chart {
    height: 180px;
  }
}
