:root {
  color-scheme: dark;
  --bg: #101312;
  --panel: #171b1a;
  --panel-2: #1d2321;
  --line: rgba(231, 239, 235, 0.12);
  --text: #f2f6f1;
  --muted: #98a39e;
  --accent: #9dbdca;
  --accent-2: #d8eceb;
  --danger: #e98b7b;
  --ok: #9fcca2;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.32);
}

body[data-page="ops"] {
  min-height: 100dvh;
  background:
    radial-gradient(circle at 7% 0%, rgba(157, 189, 202, 0.14), transparent 34%),
    radial-gradient(circle at 100% 10%, rgba(159, 204, 162, 0.09), transparent 28%),
    linear-gradient(135deg, #0f1312, #151a19 54%, #0e1110);
}

.login-shell {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-panel {
  width: min(100%, 430px);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px;
  background: rgba(25, 23, 20, 0.82);
  box-shadow: var(--shadow);
}

.login-panel h1 {
  margin: 0 0 22px;
  font-size: 44px;
  line-height: 0.95;
}

.ops-shell {
  width: min(100% - 40px, 1320px);
  margin: 0 auto;
  padding: 34px 0 72px;
}

.ops-topbar,
.ops-hero,
.ops-grid,
.ops-generate,
.ops-metrics,
.ops-links,
.ops-code,
.va-grid {
  display: grid;
  gap: 14px;
}

.ops-topbar {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  margin-bottom: 20px;
}

.ops-topbar h1 {
  margin: 0;
  font-size: clamp(36px, 6vw, 76px);
  line-height: 0.9;
  letter-spacing: 0;
}

.ops-links {
  grid-auto-flow: column;
  align-items: center;
}

.ops-links a,
.ops-code code {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--text);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.035);
}

.ops-layout {
  display: grid;
  gap: 16px;
}

.ops-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.058), rgba(255,255,255,0.024)),
    rgba(17, 21, 20, 0.72);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.18);
}

.ops-hero {
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 1.1fr);
  align-items: end;
  min-height: 230px;
}

.ops-hero h2 {
  margin: 0 0 10px;
  font-size: clamp(28px, 4vw, 54px);
  line-height: 0.98;
}

.ops-hero p,
.ops-note,
.ops-empty {
  max-width: 68ch;
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

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

.ops-metrics span {
  border-top: 1px solid var(--line);
  padding-top: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.ops-metrics strong {
  display: block;
  color: var(--accent-2);
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 28px;
  line-height: 1;
}

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

.ops-wide-grid {
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
}

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

.inline-form,
.ops-generate {
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  align-items: end;
}

.ops-generate {
  grid-template-columns: repeat(4, minmax(0, 1fr)) minmax(130px, 0.5fr) auto;
}

.check-row {
  display: flex;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
}

.ops-code {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 14px;
}

.gemini-mode-form {
  grid-template-columns: minmax(220px, 360px) auto;
  align-items: end;
  margin-top: 12px;
}

.ops-code code {
  color: var(--accent-2);
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 12px;
}

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

.ops-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  border-top: 1px solid var(--line);
  padding: 13px 0 4px;
}

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

.ops-row strong {
  color: var(--text);
  font-size: 14px;
}

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

.ops-row.is-posted {
  border-color: rgba(141, 186, 139, 0.38);
}

.ops-row.is-error {
  border-color: rgba(233, 139, 123, 0.45);
}

.va-grid {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.va-card {
  display: grid;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: rgba(255,255,255,0.026);
}

.va-card strong,
.va-card span {
  display: block;
}

.va-card strong {
  color: var(--text);
  font-size: 15px;
}

.va-card span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

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

.va-stats span {
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.va-stats b {
  color: var(--accent-2);
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 18px;
}

.template-preview {
  display: grid;
  grid-template-columns: minmax(360px, 520px) minmax(0, 1fr);
  gap: 24px;
  align-items: center;
}

.template-preview-stage {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1 / 1;
  width: 100%;
  max-width: 520px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 8px;
  padding: 54px 44px 72px;
  background: var(--preview-bg);
  color: var(--preview-text);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.18);
}

.template-preview-stage p {
  position: relative;
  z-index: 1;
  margin: 0;
  max-width: 16ch;
  color: var(--preview-text);
  font-family: Georgia, serif;
  font-size: clamp(34px, 4.8vw, 58px);
  line-height: 1.08;
  text-align: center;
}

.template-preview-stage span {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 28px;
  z-index: 1;
  color: color-mix(in srgb, var(--preview-text) 78%, transparent);
  font-size: 16px;
  text-align: center;
}

.preview-drips {
  position: absolute;
  inset: 0 0 auto;
  height: 28%;
  background:
    radial-gradient(ellipse at 12% 0%, var(--preview-accent) 0 18%, transparent 19%),
    radial-gradient(ellipse at 46% 0%, var(--preview-accent) 0 24%, transparent 25%),
    radial-gradient(ellipse at 78% 0%, var(--preview-accent) 0 16%, transparent 17%);
  opacity: 0.24;
}

.template-preview-meta {
  display: grid;
  gap: 8px;
}

.template-preview-meta strong {
  color: var(--text);
  font-size: 18px;
}

.template-preview-meta span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.small-action {
  min-height: 34px;
  padding: 0 10px;
  font-size: 12px;
}

.doc-page h2 {
  margin: 0 0 12px;
  font-size: 24px;
}

.doc-code {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 14px 0 0;
  padding: 16px;
  color: var(--accent-2);
  background: rgba(0, 0, 0, 0.18);
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 12px;
  line-height: 1.55;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100dvh;
  background:
    linear-gradient(135deg, rgba(157, 189, 202, 0.08), transparent 34%),
    radial-gradient(circle at 84% 8%, rgba(159, 204, 162, 0.08), transparent 30%),
    var(--bg);
  color: var(--text);
  font-family: Geist, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  text-rendering: geometricPrecision;
}

html {
  scroll-behavior: smooth;
}

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

button {
  cursor: pointer;
}

.shell {
  width: min(1400px, calc(100% - 48px));
  margin: 0 auto;
  padding: 42px 0 64px;
}

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

.workflow-nav {
  position: sticky;
  top: 12px;
  z-index: 4;
  display: flex;
  gap: 6px;
  margin-bottom: 24px;
  padding: 6px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(17, 16, 14, 0.82);
  backdrop-filter: blur(18px);
}

.workflow-nav a {
  flex: 0 0 auto;
  border-radius: 6px;
  padding: 9px 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition: background 180ms ease, color 180ms ease, transform 180ms ease;
}

.workflow-nav a:hover,
.workflow-nav a:focus-visible {
  color: var(--text);
  background: rgba(216, 161, 95, 0.1);
  outline: none;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(34px, 4vw, 58px);
  line-height: 0.98;
}

h2 {
  font-size: 24px;
  line-height: 1.1;
}

.status-pill {
  min-width: 260px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 12px 16px;
  color: var(--muted);
  text-align: center;
  background: rgba(25, 23, 20, 0.74);
}

.small-pill {
  min-width: 180px;
  padding: 9px 12px;
  font-size: 13px;
}

.integration-panel {
  margin-bottom: 24px;
  padding: 18px;
}

.compact-head {
  margin-bottom: 14px;
}

.integration-form {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(180px, 0.45fr) auto;
  gap: 12px;
  align-items: end;
}

.layout {
  display: grid;
  grid-template-columns: minmax(430px, 0.82fr) minmax(520px, 1fr);
  gap: 24px;
  align-items: start;
  min-width: 0;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(25, 23, 20, 0.92);
  box-shadow: var(--shadow);
  min-width: 0;
}

.form-panel {
  padding: 24px;
}

.history-panel {
  padding: 24px 24px 18px;
}

.preview-panel {
  position: sticky;
  top: 24px;
  padding: 24px;
}

.section-head,
.slides-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.section-head {
  margin-bottom: 24px;
}

.slides-head {
  margin: 20px 0 12px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

form,
.slides-list {
  display: grid;
  gap: 14px;
}

.workflow-block,
.custom-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.025);
}

.workflow-block {
  scroll-margin-top: 84px;
}

.workflow-block + .workflow-block {
  margin-top: 4px;
}

.button-row,
.preview-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.mini-note {
  color: var(--muted);
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 11px;
}

.field-grid,
.media-fields,
.swatch-grid {
  display: grid;
  gap: 12px;
}

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

.media-fields {
  grid-template-columns: minmax(0, 1fr) minmax(150px, 0.5fr) minmax(120px, 0.35fr);
  align-items: end;
}

.swatch-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 12px;
}

.field {
  display: grid;
  gap: 8px;
}

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

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
  background: var(--panel-2);
  color: var(--text);
  padding: 13px 14px;
  resize: vertical;
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

textarea[hidden] {
  display: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(157, 189, 202, 0.75);
  background: #222928;
}

input[type="color"] {
  min-height: 44px;
  padding: 4px;
}

input[type="file"] {
  min-height: 46px;
  color: var(--muted);
  font-size: 12px;
}

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

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

.slide-card {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.025);
}

.element-workshop {
  display: grid;
  gap: 14px;
}

.builder-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 12px;
}

.builder-panel {
  display: grid;
  gap: 12px;
  min-width: 0;
  border: 1px solid rgba(244, 237, 226, 0.09);
  border-radius: 8px;
  padding: 14px;
  background: rgba(17, 16, 14, 0.28);
}

.builder-title {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.builder-title strong {
  font-size: 14px;
  line-height: 1.2;
}

.builder-title span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  text-wrap: pretty;
}

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

.element-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.element-summary span {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
  background: rgba(255, 255, 255, 0.025);
}

.element-summary strong {
  color: var(--accent-2);
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 13px;
}

.advanced-json {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.advanced-json summary {
  cursor: pointer;
  color: var(--accent-2);
  font-size: 13px;
  font-weight: 700;
}

.advanced-json[open] {
  display: grid;
  gap: 12px;
}

.slide-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.slide-index {
  color: var(--accent-2);
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 12px;
}

.primary-button,
.ghost-button,
.icon-button,
.download-link {
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.primary-button:focus-visible,
.ghost-button:focus-visible,
.icon-button:focus-visible,
.download-link:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid rgba(157, 189, 202, 0.6);
  outline-offset: 2px;
}

.primary-button:active,
.ghost-button:active,
.icon-button:active,
.download-link:active {
  transform: translateY(1px) scale(0.99);
}

.primary-button {
  min-height: 50px;
  margin-top: 6px;
  border-color: rgba(157, 189, 202, 0.55);
  background: var(--accent);
  color: #101312;
  font-weight: 700;
}

.primary-button[disabled] {
  cursor: wait;
  opacity: 0.72;
}

.ghost-button {
  background: transparent;
  padding: 9px 12px;
  color: var(--accent-2);
  font-size: 13px;
  font-weight: 600;
}

.ghost-button:hover,
.icon-button:hover,
.download-link:hover {
  border-color: rgba(157, 189, 202, 0.52);
  background: rgba(157, 189, 202, 0.08);
}

.icon-button {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  background: transparent;
}

.remove-slide span {
  width: 12px;
  height: 2px;
  background: var(--danger);
}

.chevron {
  width: 9px;
  height: 9px;
  border-top: 2px solid var(--accent-2);
  border-right: 2px solid var(--accent-2);
}

.chevron.left {
  transform: rotate(-135deg);
}

.chevron.right {
  transform: rotate(45deg);
}

.preview-stage {
  width: min(100%, 520px);
  aspect-ratio: 1;
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--panel-2);
  container-type: inline-size;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}

.preview-slide {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--slide-bg);
  color: var(--slide-text);
  font-family: var(--slide-font);
  display: grid;
  isolation: isolate;
}

.preview-slide::before {
  content: "";
  position: absolute;
  top: -1%;
  left: 0;
  width: 100%;
  height: 21%;
  background:
    radial-gradient(15% 62% at 8% 0%, var(--slide-decoration) 0 63%, transparent 64%),
    radial-gradient(13% 72% at 48% 0%, var(--slide-decoration) 0 61%, transparent 62%),
    radial-gradient(15% 68% at 80% 0%, var(--slide-decoration) 0 62%, transparent 63%),
    linear-gradient(180deg, var(--slide-decoration), transparent 82%);
  clip-path: polygon(0 0, 100% 0, 100% 28%, 92% 45%, 84% 24%, 77% 64%, 68% 28%, 59% 53%, 49% 31%, 43% 59%, 35% 24%, 27% 56%, 17% 27%, 9% 53%, 0 33%);
  opacity: 1;
  z-index: -1;
}

.preview-number {
  position: absolute;
  top: 5%;
  right: 6%;
  width: 6.5%;
  height: 6.5%;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--slide-badge);
  color: #fff;
  font-family: "Geist", sans-serif;
  font-size: 2.05cqw;
  font-weight: 500;
}

.preview-handle {
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: 5.5%;
  color: var(--slide-handle);
  text-align: center;
  font-size: var(--preview-handle-size, 2.65cqw);
  font-weight: 300;
  letter-spacing: 0.8px;
}

.preview-content {
  align-self: center;
  justify-self: center;
  width: 78%;
  text-align: center;
}

.preview-title {
  margin: 0;
  color: var(--slide-text);
  font-size: var(--preview-title-size, 7.2cqw);
  line-height: 0.98;
  font-weight: 400;
}

.preview-subtitle {
  margin: 3.4% auto 0;
  max-width: 82%;
  font-size: var(--preview-subtitle-size, 3.2cqw);
  line-height: 1.2;
}

.preview-content-title {
  position: absolute;
  top: 8.5%;
  left: 9.5%;
  right: 18%;
  margin: 0;
  color: var(--slide-text);
  font-size: 4.8cqw;
  line-height: 1.05;
}

.preview-body {
  margin: 0 auto;
  max-width: 78%;
  text-align: center;
  white-space: pre-line;
  font-size: var(--preview-body-size, 4.3cqw);
  line-height: 1.16;
  font-weight: 600;
}

.preview-bullet {
  display: block;
  margin-bottom: 2.4%;
  color: var(--slide-accent);
  font-size: 3.4cqw;
}

.preview-media {
  position: absolute;
  overflow: hidden;
}

.preview-media.has-frame {
  right: auto !important;
  bottom: auto !important;
  transform: translate(-50%, -50%);
  cursor: grab;
}

.preview-media.has-frame:active {
  cursor: grabbing;
}

.resize-handle {
  position: absolute;
  right: 6px;
  bottom: 6px;
  width: 12px;
  height: 12px;
  border-right: 2px solid rgba(255,255,255,0.8);
  border-bottom: 2px solid rgba(255,255,255,0.8);
  cursor: nwse-resize;
}

.preview-media img {
  width: 100%;
  height: 100%;
  object-fit: var(--image-fit);
  object-position: var(--image-position);
  display: block;
}

.preview-cover .preview-media {
  left: 7%;
  right: 7%;
  bottom: 12%;
  height: 23%;
  border-radius: 7%;
  opacity: 0.22;
  z-index: -1;
}

.preview-content-slide.has-media {
  grid-template-rows: 22% 32% 1fr;
}

.preview-content-slide .preview-media {
  top: 22%;
  left: 14%;
  right: 14%;
  height: 30%;
  border: 2px solid color-mix(in srgb, var(--slide-accent) 42%, transparent);
  border-radius: 7%;
}

.preview-content-slide.has-media .preview-body {
  align-self: end;
  padding-bottom: 14%;
  font-size: 3.8cqw;
}

.preview-cta {
  background: var(--slide-cta-bg);
}

.preview-cta .preview-media {
  inset: 6%;
  border-radius: 8%;
  opacity: 0.18;
  z-index: -1;
}

.preview-line {
  width: 18%;
  height: 0.7%;
  margin: 0 auto 4.5%;
  border-radius: 999px;
  background: var(--slide-accent);
}

.preview-decor {
  position: absolute;
  display: block;
  pointer-events: none;
  z-index: 3;
}

.preview-decor-arrow {
  overflow: visible;
}

.preview-decor-circle {
  border-style: solid;
  border-color: currentColor;
  border-radius: 52% 48% 46% 54% / 44% 58% 42% 56%;
}

.preview-decor-line,
.preview-decor-underline {
  height: 0.5% !important;
  border-radius: 999px;
  background: currentColor;
}

.preview-decor-text {
  height: auto !important;
  color: currentColor;
  text-align: center;
  font-weight: 700;
  white-space: nowrap;
}

.preview-slide .template-mark,
.preview-slide .mark-circle,
.preview-slide .mark-underline {
  position: relative;
  display: inline-block;
  z-index: 1;
  opacity: var(--mark-opacity, 1);
}

.preview-slide .template-mark::after,
.preview-slide .mark-circle::after,
.preview-slide .mark-underline::after {
  content: "";
  position: absolute;
  pointer-events: none;
  opacity: var(--mark-opacity, 1);
  z-index: -1;
}

.preview-slide .mark-circle::after {
  left: -0.24em;
  right: -0.24em;
  top: 0.07em;
  bottom: -0.05em;
  border: var(--mark-stroke, 2px) solid var(--mark-color, var(--slide-annotation));
  border-radius: 52% 48% 46% 54% / 44% 58% 42% 56%;
  transform: rotate(var(--mark-rotation, -3deg));
}

.preview-slide .mark-underline::after {
  left: -0.08em;
  right: -0.1em;
  bottom: 0.03em;
  height: var(--mark-stroke, 4px);
  border-radius: 999px;
  background: var(--mark-color, var(--slide-annotation));
  transform: rotate(var(--mark-rotation, -1.8deg));
}

.form-error {
  position: sticky;
  bottom: 16px;
  z-index: 5;
  border: 1px solid rgba(233, 139, 123, 0.38);
  border-radius: 8px;
  padding: 12px 14px;
  color: #ffd4cd;
  background: rgba(233, 139, 123, 0.09);
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.28);
  font-size: 14px;
}

.form-error[data-kind="success"] {
  border-color: rgba(159, 204, 162, 0.42);
  color: #dff7df;
  background: rgba(159, 204, 162, 0.1);
}

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

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

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 14px 10px;
  text-align: left;
  vertical-align: middle;
}

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

td {
  color: var(--text);
  font-size: 14px;
}

.muted {
  color: var(--muted);
}

.mono {
  font-family: "Geist Mono", ui-monospace, monospace;
}

.download-link {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 11px;
  color: var(--accent-2);
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
}

.loading-state {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.skeleton {
  height: 42px;
  border-radius: 8px;
  background: linear-gradient(90deg, rgba(255,255,255,0.05), rgba(255,255,255,0.11), rgba(255,255,255,0.05));
  background-size: 220% 100%;
  animation: shimmer 1.2s ease-in-out infinite;
}

.skeleton.wide {
  height: 56px;
}

.empty-state {
  display: grid;
  place-items: center;
  gap: 14px;
  padding: 48px 0 28px;
  color: var(--muted);
  text-align: center;
}

.empty-mark {
  width: 46px;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 50%;
  position: relative;
}

.empty-mark::before,
.empty-mark::after {
  content: "";
  position: absolute;
  left: 13px;
  right: 13px;
  height: 2px;
  background: var(--accent);
}

.empty-mark::before { top: 17px; }
.empty-mark::after { top: 26px; }

@keyframes shimmer {
  from { background-position: 100% 0; }
  to { background-position: -100% 0; }
}

@media (max-width: 980px) {
  .ops-topbar,
  .ops-hero,
  .ops-grid,
  .ops-wide-grid,
  .inline-form,
  .gemini-mode-form,
  .ops-generate {
    grid-template-columns: 1fr;
  }

  .ops-links {
    grid-auto-flow: row;
  }

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

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

  .integration-form {
    grid-template-columns: 1fr;
  }

  .preview-panel {
    position: static;
  }

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

@media (max-width: 680px) {
  .ops-shell {
    width: min(100% - 28px, 1320px);
    padding-top: 24px;
  }

  .ops-metrics,
  .ops-code,
  .template-preview {
    grid-template-columns: 1fr;
  }

  .shell {
    width: min(100% - 28px, 1400px);
    padding-top: 24px;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .status-pill {
    min-width: 0;
    text-align: left;
  }

  .form-panel,
  .history-panel,
  .preview-panel {
    padding: 18px;
  }

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

  .field-grid,
  .media-fields,
  .swatch-grid,
  .compact-controls,
  .element-summary {
    grid-template-columns: 1fr;
  }

  .preview-panel {
    position: static;
  }

  .workflow-nav {
    top: 0;
    margin-left: -14px;
    margin-right: -14px;
    border-left: 0;
    border-right: 0;
    border-radius: 0;
  }
}

/* Admin portal DA */
body[data-page="ops"] {
  color-scheme: light;
  --bg: #eef7fb;
  --panel: #ffffff;
  --panel-2: #f7fbfe;
  --line: rgba(30, 83, 121, 0.15);
  --text: #18364d;
  --muted: #657c91;
  --accent: #2f80c8;
  --accent-2: #0e5f9f;
  --danger: #c75a4a;
  --ok: #25836d;
  --sidebar: #0f4168;
  --sidebar-2: #155782;
  --sidebar-text: #eaf6ff;
  --sidebar-muted: #a9d4ef;
  --shadow: 0 22px 70px rgba(21, 72, 110, 0.13);
  min-height: 100dvh;
  background:
    radial-gradient(circle at 88% 4%, rgba(47, 128, 200, 0.11), transparent 32%),
    linear-gradient(135deg, #f2fbff 0%, #eef7fb 52%, #eaf4fa 100%);
  color: var(--text);
}

body[data-page="ops"] .ops-shell {
  display: grid;
  grid-template-columns: 288px minmax(0, 1fr);
  width: 100%;
  min-height: 100dvh;
  margin: 0;
  padding: 0;
}

body[data-page="ops"] .ops-sidebar {
  position: sticky;
  top: 0;
  height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.05), transparent 34%),
    var(--sidebar);
  color: var(--sidebar-text);
  box-shadow: inset -1px 0 0 rgba(255,255,255,0.08);
}

body[data-page="ops"] .ops-brand {
  padding: 28px 22px 26px;
  border-bottom: 1px solid rgba(255,255,255,0.12);
}

body[data-page="ops"] .ops-brand strong,
body[data-page="ops"] .ops-brand span,
body[data-page="ops"] .ops-sidebar-footer span,
body[data-page="ops"] .ops-sidebar-footer strong {
  display: block;
}

body[data-page="ops"] .ops-brand strong {
  font-size: 24px;
  line-height: 1;
  letter-spacing: 0;
}

body[data-page="ops"] .ops-brand span {
  margin-top: 8px;
  color: var(--sidebar-muted);
  font-size: 15px;
  font-weight: 600;
}

body[data-page="ops"] .ops-side-nav {
  display: grid;
  align-content: start;
  padding: 14px 0;
}

body[data-page="ops"] .ops-side-nav a {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 0 22px;
  color: color-mix(in srgb, var(--sidebar-text) 78%, transparent);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: background 180ms ease, color 180ms ease, transform 180ms ease;
}

body[data-page="ops"] .ops-side-nav a::before {
  content: "";
  width: 7px;
  height: 7px;
  margin-right: 12px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.42;
  transition: opacity 180ms ease, transform 180ms ease;
}

body[data-page="ops"] .ops-side-nav a:hover,
body[data-page="ops"] .ops-side-nav a:focus-visible,
body[data-page="ops"] .ops-side-nav a.is-active {
  color: var(--sidebar-text);
  background: rgba(255,255,255,0.09);
  outline: none;
}

body[data-page="ops"] .ops-side-nav a:hover {
  transform: translateX(3px);
}

body[data-page="ops"] .ops-side-nav a.is-active::before {
  opacity: 1;
  transform: scale(1.2);
}

body[data-page="ops"] .ops-sidebar-footer {
  display: grid;
  gap: 7px;
  padding: 22px;
  border-top: 1px solid rgba(255,255,255,0.14);
}

body[data-page="ops"] .ops-sidebar-footer span {
  color: var(--sidebar-muted);
  font-size: 13px;
  font-weight: 600;
}

body[data-page="ops"] .ops-sidebar-footer strong {
  font-size: 15px;
}

body[data-page="ops"] .ops-main {
  min-width: 0;
  padding: 34px 38px 72px;
}

body[data-page="ops"] .ops-layout {
  display: grid;
  gap: 18px;
}

body[data-page="ops"] .ops-topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 22px;
  margin-bottom: 28px;
}

body[data-page="ops"] .ops-topbar h1 {
  margin: 0;
  color: #173c5a;
  font-size: clamp(36px, 4vw, 52px);
  line-height: 1.02;
  letter-spacing: 0;
}

body[data-page="ops"] .ops-topbar p:not(.eyebrow) {
  max-width: 780px;
  margin: 12px 0 0;
  color: #477393;
  font-size: 18px;
  line-height: 1.55;
}

body[data-page="ops"] .ops-admin-link {
  border: 1px solid rgba(30, 83, 121, 0.18);
  border-radius: 999px;
  padding: 11px 17px;
  color: #244a65;
  background: rgba(255,255,255,0.78);
  text-decoration: none;
  box-shadow: 0 10px 28px rgba(21, 72, 110, 0.08);
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

body[data-page="ops"] .ops-admin-link:hover,
body[data-page="ops"] .ops-admin-link:focus-visible {
  border-color: rgba(47, 128, 200, 0.42);
  background: #fff;
  transform: translateY(-1px);
  outline: none;
}

body[data-page="ops"] .ops-panel,
body[data-page="ops"] .va-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,0.88);
  box-shadow: var(--shadow);
}

body[data-page="ops"] .ops-panel {
  padding: 24px;
}

body[data-page="ops"] .ops-hero {
  grid-template-columns: minmax(260px, 0.65fr) minmax(420px, 1fr);
  align-items: end;
  min-height: 188px;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.94), rgba(239, 249, 255, 0.9)),
    radial-gradient(circle at 100% 0%, rgba(47, 128, 200, 0.12), transparent 28%);
}

body[data-page="ops"] .ops-hero h2 {
  color: #173c5a;
  font-size: clamp(28px, 3vw, 42px);
}

body[data-page="ops"] .ops-metrics span {
  border-top: 1px solid rgba(30, 83, 121, 0.14);
  color: var(--muted);
}

body[data-page="ops"] .ops-metrics strong,
body[data-page="ops"] .va-stats b,
body[data-page="ops"] .element-summary strong {
  color: var(--accent-2);
}

body[data-page="ops"] .ops-grid,
body[data-page="ops"] .ops-wide-grid {
  gap: 18px;
}

body[data-page="ops"] .section-head h2,
body[data-page="ops"] .compact-head h2,
body[data-page="ops"] .ops-row strong,
body[data-page="ops"] .va-card strong,
body[data-page="ops"] .template-preview-meta strong {
  color: #1c3145;
}

body[data-page="ops"] .eyebrow {
  color: var(--accent-2);
  text-transform: none;
}

body[data-page="ops"] .ops-note,
body[data-page="ops"] .ops-empty,
body[data-page="ops"] .ops-row span,
body[data-page="ops"] .va-card span,
body[data-page="ops"] .template-preview-meta span,
body[data-page="ops"] .field span,
body[data-page="ops"] .check-row {
  color: var(--muted);
}

body[data-page="ops"] input,
body[data-page="ops"] select,
body[data-page="ops"] textarea {
  border-color: rgba(30, 83, 121, 0.16);
  background: #f8fcff;
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.78);
}

body[data-page="ops"] input:focus,
body[data-page="ops"] select:focus,
body[data-page="ops"] textarea:focus {
  border-color: rgba(47, 128, 200, 0.62);
  background: #fff;
}

body[data-page="ops"] .primary-button {
  border-color: #1f70b6;
  background: #1f70b6;
  color: #fff;
  box-shadow: 0 12px 26px rgba(31, 112, 182, 0.22);
}

body[data-page="ops"] .primary-button:hover,
body[data-page="ops"] .primary-button:focus-visible {
  border-color: #155f9f;
  background: #155f9f;
  transform: translateY(-1px);
}

body[data-page="ops"] .ghost-button {
  border-color: rgba(255,255,255,0.16);
  background: rgba(255,255,255,0.1);
  color: var(--sidebar-text);
}

body[data-page="ops"] .ops-panel .ghost-button,
body[data-page="ops"] .ops-main > .ghost-button {
  border-color: rgba(30, 83, 121, 0.16);
  background: #eef7fc;
  color: var(--accent-2);
}

body[data-page="ops"] .ghost-button:hover,
body[data-page="ops"] .ghost-button:focus-visible {
  border-color: rgba(47, 128, 200, 0.38);
  background: rgba(47, 128, 200, 0.12);
  transform: translateY(-1px);
}

body[data-page="ops"] .ops-code code,
body[data-page="ops"] .doc-code {
  border-color: rgba(30, 83, 121, 0.12);
  color: #1d6ba7;
  background: #f4faff;
}

body[data-page="ops"] .status-pill {
  border-color: rgba(30, 83, 121, 0.14);
  color: var(--accent-2);
  background: #f3faff;
}

body[data-page="ops"] .ops-row,
body[data-page="ops"] .va-stats span {
  border-top-color: rgba(30, 83, 121, 0.12);
}

body[data-page="ops"] .va-card {
  background: #f9fdff;
  box-shadow: none;
}

body[data-page="ops"] .template-preview-stage {
  border-color: rgba(30, 83, 121, 0.16);
  box-shadow: 0 20px 48px rgba(21, 72, 110, 0.14);
}

body[data-page="ops"] .form-error {
  border-color: rgba(199, 90, 74, 0.25);
  color: #8f3529;
  background: #fff5f3;
}

@media (max-width: 1120px) {
  body[data-page="ops"] .ops-shell {
    grid-template-columns: 238px minmax(0, 1fr);
  }

  body[data-page="ops"] .ops-main {
    padding: 26px 24px 58px;
  }

  body[data-page="ops"] .ops-hero,
  body[data-page="ops"] .ops-grid,
  body[data-page="ops"] .ops-wide-grid,
  body[data-page="ops"] .inline-form,
  body[data-page="ops"] .ops-generate {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  body[data-page="ops"] .ops-shell {
    display: block;
  }

  body[data-page="ops"] .ops-sidebar {
    position: relative;
    height: auto;
  }

  body[data-page="ops"] .ops-side-nav {
    grid-auto-flow: column;
    grid-auto-columns: max-content;
    overflow-x: auto;
    padding: 10px 12px;
  }

  body[data-page="ops"] .ops-side-nav a {
    min-height: 40px;
    padding: 0 12px;
    border-radius: 999px;
  }

  body[data-page="ops"] .ops-side-nav a::before {
    display: none;
  }

  body[data-page="ops"] .ops-sidebar-footer {
    display: none;
  }

  body[data-page="ops"] .ops-main {
    padding: 22px 16px 46px;
  }

  body[data-page="ops"] .ops-topbar,
  body[data-page="ops"] .ops-metrics,
  body[data-page="ops"] .ops-code,
  body[data-page="ops"] .template-preview,
  body[data-page="ops"] .gemini-mode-form {
    grid-template-columns: 1fr;
  }

  body[data-page="ops"] .ops-admin-link {
    width: max-content;
  }
}
