:root {
  color-scheme: light;
  --bg: #f7f9fc;
  --surface: #ffffff;
  --surface-2: #f0f5ff;
  --surface-3: #eef7f6;
  --text: #101828;
  --muted: #667085;
  --muted-2: #98a2b3;
  --line: #d9e2f1;
  --line-soft: #e8eef7;
  --primary: #0b4db8;
  --primary-strong: #083f98;
  --primary-soft: #e8f1ff;
  --teal: #0f9f8f;
  --teal-soft: #e6f7f5;
  --red: #c2413d;
  --red-soft: #fff0ef;
  --green: #16825d;
  --green-soft: #e8f7ef;
  --warning: #b7791f;
  --warning-soft: #fff7e6;
  --shadow: 0 18px 42px rgba(16, 24, 40, 0.08);
  --shadow-soft: 0 8px 24px rgba(16, 24, 40, 0.06);
  --radius: 8px;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Noto Sans SC", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
}

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

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.64;
}

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

img {
  max-width: 100%;
}

.primary,
.secondary,
.danger-button,
.ghost,
.compact-button,
.submit-button,
.preset-actions button,
.job-actions button,
.work-actions button,
.work-actions a,
.prompt-header button,
.template-actions button,
.drawer-section a,
.drawer-section button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  padding: 0 16px;
  font-weight: 760;
  line-height: 1;
  transition:
    background 0.16s ease,
    border-color 0.16s ease,
    color 0.16s ease,
    transform 0.16s ease,
    box-shadow 0.16s ease;
}

.primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 10px 20px rgba(11, 77, 184, 0.2);
}

.primary:hover {
  background: var(--primary-strong);
  transform: translateY(-1px);
}

.secondary {
  border-color: rgba(11, 77, 184, 0.2);
  background: var(--primary-soft);
  color: var(--primary);
}

.secondary:hover {
  border-color: rgba(11, 77, 184, 0.34);
  background: #dcebff;
}

.danger-button {
  border-color: rgba(194, 65, 61, 0.24);
  background: var(--red-soft);
  color: var(--red);
}

.danger-button:hover {
  border-color: rgba(194, 65, 61, 0.36);
  background: #ffe4e2;
}

.ghost {
  border-color: var(--line);
  background: #fff;
  color: #344054;
}

.ghost:hover {
  border-color: #c5d4e8;
  background: #f8fbff;
}

.compact-button {
  min-height: 36px;
  padding: 0 12px;
  font-size: 13px;
}

.danger {
  color: var(--red) !important;
  border-color: rgba(194, 65, 61, 0.18) !important;
  background: var(--red-soft) !important;
}

.surface {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.eyebrow,
.section-heading p,
.compact-heading p {
  margin: 0 0 8px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

.section-heading h2,
.drawer-head h2,
.template-head h2 {
  margin: 0;
  color: var(--text);
  font-size: 20px;
  line-height: 1.2;
}

.page-heading {
  margin-bottom: 18px;
}

.public-shell {
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(232, 241, 255, 0.64), rgba(232, 241, 255, 0) 380px),
    #ffffff;
}

.public-nav {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  width: min(1280px, calc(100% - 40px));
  margin: 0 auto;
  padding: 10px 0;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(18px);
}

.public-nav nav,
.public-actions,
.hero-actions,
.topbar-actions,
.admin-toolbar,
.template-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.public-nav nav a {
  border-radius: 999px;
  color: #0b1f44;
  font-size: 14px;
  font-weight: 820;
  padding: 10px 14px;
}

.public-nav nav a:hover {
  background: var(--primary-soft);
  color: var(--primary);
}

.public-nav nav a.active {
  background: var(--primary-soft);
  color: var(--primary);
}

.brand-lockup,
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-home {
  width: auto;
  min-height: 0;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  text-align: left;
}

.brand-home:hover .brand-mark {
  border-color: rgba(11, 77, 184, 0.28);
  box-shadow: 0 10px 22px rgba(11, 77, 184, 0.16);
}

.brand-lockup p {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 820;
  letter-spacing: 0;
  text-transform: uppercase;
}

.brand-lockup h1,
.brand-lockup strong {
  margin: 0;
  color: var(--text);
  line-height: 1.05;
}

.brand-lockup h1 {
  font-size: 30px;
}

.brand-lockup strong {
  font-size: 20px;
}

.brand-mark {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(11, 77, 184, 0.16);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 8px 18px rgba(11, 77, 184, 0.12);
  overflow: hidden;
}

.brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.marketing-hero {
  display: grid;
  grid-template-columns: minmax(360px, 0.82fr) minmax(520px, 1.18fr);
  gap: 54px;
  align-items: center;
  width: min(1280px, calc(100% - 40px));
  margin: 0 auto;
  padding: 64px 0 0;
}

.hero-copy h1 {
  margin: 0;
  max-width: 680px;
  color: #0b1f44;
  font-size: clamp(44px, 5.2vw, 72px);
  line-height: 1;
  letter-spacing: 0;
}

.hero-copy > p:not(.eyebrow) {
  margin: 22px 0 0;
  max-width: 620px;
  color: #475467;
  font-size: 18px;
  line-height: 1.75;
}

.hero-actions {
  margin-top: 30px;
}

.hero-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.hero-metrics span,
.template-chips span,
.meta-pill,
.status-pill,
.counter {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.84);
  color: #475467;
  padding: 0 11px;
  font-size: 12px;
  font-weight: 760;
}

.product-preview {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  gap: 16px;
  align-items: center;
}

.product-preview::before {
  content: "";
  position: absolute;
  inset: -24px -18px 28px 42px;
  z-index: 0;
  border-radius: 28px;
  background:
    linear-gradient(90deg, rgba(167, 225, 247, 0.55), rgba(11, 77, 184, 0.08)),
    #eff8ff;
}

.preview-canvas,
.preview-stack {
  position: relative;
  z-index: 1;
}

.preview-canvas {
  border: 1px solid rgba(11, 77, 184, 0.12);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 26px 70px rgba(11, 77, 184, 0.18);
  overflow: hidden;
}

.preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 52px;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.94);
  padding: 0 16px;
}

.preview-toolbar span {
  color: #0b1f44;
  font-size: 13px;
  font-weight: 900;
}

.preview-toolbar div {
  display: flex;
  gap: 6px;
}

.preview-toolbar i {
  display: block;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #c9d8ee;
}

.preview-stage {
  position: relative;
  min-height: 420px;
  background: linear-gradient(135deg, #eaf5ff, #f7f0ff);
}

.preview-stage img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 420px;
  object-fit: cover;
}

.preview-prompt {
  position: absolute;
  left: 22px;
  bottom: 22px;
  width: min(360px, calc(100% - 44px));
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.82);
  padding: 16px;
  box-shadow: 0 18px 36px rgba(16, 24, 40, 0.12);
  backdrop-filter: blur(16px);
}

.preview-prompt span,
.mini-preview span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 820;
}

.preview-prompt strong {
  display: block;
  margin-top: 6px;
  color: #0b1f44;
  font-size: 20px;
  line-height: 1.25;
}

.preview-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  border-top: 1px solid var(--line-soft);
  padding: 13px;
}

.preview-controls span {
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 850;
}

.preview-stack {
  display: grid;
  gap: 12px;
}

.mini-preview {
  border: 1px solid rgba(11, 77, 184, 0.12);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.mini-preview.image-card {
  position: relative;
}

.mini-preview.image-card img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.mini-preview.image-card span {
  position: absolute;
  left: 10px;
  bottom: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  color: #0b1f44;
  padding: 6px 9px;
  backdrop-filter: blur(10px);
}

.mini-preview.soft-card,
.mini-preview.queue-card {
  padding: 16px;
}

.mini-preview strong {
  display: block;
  color: #0b1f44;
  font-size: 22px;
}

.mini-preview.queue-card {
  background: #0b1f44;
}

.mini-preview.queue-card strong,
.mini-preview.queue-card span {
  color: #fff;
}

.public-page {
  min-height: calc(100vh - 64px);
}

.public-page[hidden] {
  display: none !important;
}

.product-feature-band,
.templates-route,
.pricing-route {
  width: min(1280px, calc(100% - 40px));
  margin: 0 auto;
}

.product-feature-band {
  margin-top: 74px;
  padding: 76px 0;
}

.public-feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.public-feature-grid article,
.template-showcase-card,
.public-pricing-grid article,
.pricing-rules {
  border: 1px solid rgba(11, 77, 184, 0.14);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 18px 42px rgba(11, 77, 184, 0.1);
}

.public-feature-grid article {
  padding: 24px;
}

.public-feature-grid span,
.template-showcase-card span,
.public-pricing-grid span {
  color: var(--primary);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.public-feature-grid h3,
.template-showcase-card h3 {
  margin: 12px 0 0;
  color: #0b1f44;
  font-size: 22px;
  line-height: 1.25;
}

.public-feature-grid p {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.templates-route,
.pricing-route {
  padding: 72px 0 90px;
}

.public-route-head {
  display: grid;
  gap: 16px;
  max-width: 720px;
  margin-bottom: 30px;
}

.public-route-head.centered {
  margin-right: auto;
  margin-left: auto;
  text-align: center;
}

.public-route-head h1 {
  margin: 0;
  color: #0b1f44;
  font-size: clamp(40px, 5vw, 64px);
  line-height: 1.05;
}

.public-route-head p:not(.eyebrow) {
  margin: 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.72;
}

.template-showcase-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: minmax(240px, auto);
  gap: 16px;
}

.template-showcase-card {
  position: relative;
  min-height: 260px;
  overflow: hidden;
}

.template-showcase-card.large {
  grid-column: span 2;
  grid-row: span 2;
}

.template-showcase-card img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 260px;
  object-fit: cover;
}

.template-showcase-card div {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 16px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.86);
  padding: 14px;
  backdrop-filter: blur(14px);
}

.public-pricing-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-top: 28px;
}

.public-pricing-grid article {
  display: grid;
  align-content: space-between;
  gap: 16px;
  min-height: 360px;
  padding: 24px;
}

.public-pricing-grid article.featured {
  border-color: rgba(11, 77, 184, 0.45);
  box-shadow: 0 24px 56px rgba(11, 77, 184, 0.18);
}

.public-pricing-grid strong {
  display: block;
  color: #0b1f44;
  font-size: 42px;
  line-height: 1;
}

.public-pricing-grid p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.pricing-rules {
  display: grid;
  grid-template-columns: minmax(240px, 0.35fr) minmax(0, 1fr);
  gap: 20px;
  margin-top: 18px;
  padding: 24px;
}

.pricing-rules h2 {
  margin: 0;
  color: #0b1f44;
}

.pricing-rules p {
  margin: 8px 0 0;
  color: var(--muted);
}

.public-plans {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
}

.public-plans article {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 14px;
}

.public-plans article.highlight {
  border-color: rgba(11, 77, 184, 0.4);
  background: var(--primary-soft);
}

.public-plans span,
.public-plans small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.public-plans strong {
  display: block;
  margin: 8px 0 2px;
  color: #0b1f44;
  font-size: 30px;
  line-height: 1;
}

.auth-view {
  display: block;
  min-height: calc(100vh - 64px);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.94) 0 42%, rgba(198, 235, 255, 0.95) 42% 100%),
    #c7ebff;
  overflow: hidden;
}

.auth-card {
  display: grid;
  grid-template-columns: minmax(360px, 520px) minmax(0, 1fr);
  gap: 42px;
  align-items: center;
  width: min(1380px, 100%);
  min-height: calc(100vh - 64px);
  margin: 0 auto;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.auth-forms {
  width: min(440px, calc(100% - 40px));
  margin: 0 auto;
  padding: 48px 0;
}

.auth-copy {
  margin-top: 68px;
}

.auth-copy h2 {
  margin: 0;
  color: #0b1f44;
  font-size: 48px;
  line-height: 1.05;
  font-weight: 760;
}

.auth-copy p {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

.login-form {
  display: grid;
  gap: 16px;
  margin-top: 26px;
}

.login-form label,
.field {
  display: grid;
  gap: 8px;
  color: #344054;
  font-size: 13px;
  font-weight: 760;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  outline: none;
}

input,
select {
  height: 44px;
  padding: 0 13px;
}

textarea {
  min-height: 214px;
  resize: vertical;
  padding: 13px;
  line-height: 1.58;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(11, 77, 184, 0.12);
}

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

.turnstile-slot {
  min-height: 0;
}

.form-error {
  min-height: 20px;
  margin: 0;
  color: var(--red);
  font-size: 13px;
  line-height: 1.5;
}

.form-error.success {
  color: var(--green);
}

.auth-switch-row {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 720;
  text-align: center;
}

.auth-switch-row button,
.auth-recovery button {
  border: 0;
  background: transparent;
  color: var(--primary);
  padding: 0;
  font-weight: 850;
}

.auth-switch-row button:hover,
.auth-recovery button:hover {
  text-decoration: underline;
}

.auth-recovery {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(194, 65, 61, 0.18);
  border-radius: var(--radius);
  background: var(--red-soft);
  padding: 12px;
}

.auth-recovery span {
  color: #7f2f2c;
  font-size: 13px;
  line-height: 1.5;
}

.auth-recovery button {
  justify-self: start;
}

.auth-showcase {
  position: relative;
  min-height: calc(100vh - 64px);
  background: transparent;
  padding: 0;
}

.auth-collage {
  overflow: hidden;
}

.auth-collage-track {
  position: absolute;
  inset: -8% -8% -12% 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(190px, 1fr));
  grid-auto-rows: 190px;
  gap: 18px;
  transform: rotate(-10deg);
  transform-origin: center;
}

.collage-card {
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 18px 42px rgba(11, 77, 184, 0.2);
  overflow: hidden;
}

.collage-card.image-card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.collage-card.tall {
  grid-row: span 2;
}

.collage-card.text-card {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 18px;
}

.collage-card.text-card strong {
  color: #0b1f44;
  font-size: 28px;
  line-height: 1;
}

.collage-card.text-card span {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 760;
  line-height: 1.45;
}

.collage-card.text-card.dark {
  background: #0b1f44;
}

.collage-card.text-card.dark strong,
.collage-card.text-card.dark span,
.collage-card.text-card.blue strong,
.collage-card.text-card.blue span {
  color: #fff;
}

.collage-card.text-card.blue {
  background: linear-gradient(135deg, var(--primary), #66b6ef);
}

.native-select {
  display: none;
}

.custom-select {
  position: relative;
  width: 100%;
}

.select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  padding: 0 12px;
  text-align: left;
}

.select-trigger:hover,
.custom-select.open .select-trigger {
  border-color: rgba(11, 77, 184, 0.32);
  box-shadow: 0 0 0 3px rgba(11, 77, 184, 0.08);
}

.select-chevron {
  width: 9px;
  height: 9px;
  border-right: 2px solid #667085;
  border-bottom: 2px solid #667085;
  transform: rotate(45deg) translateY(-2px);
}

.select-menu {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  z-index: 60;
  display: none;
  max-height: 260px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
  padding: 6px;
}

.custom-select.open .select-menu {
  display: grid;
  gap: 4px;
}

.select-option {
  min-height: 36px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #344054;
  padding: 0 10px;
  text-align: left;
}

.select-option:hover,
.select-option[aria-selected="true"] {
  background: var(--primary-soft);
  color: var(--primary);
}

.workspace-shell {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  min-height: 100vh;
  background: var(--bg);
}

.workspace-sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 22px;
  height: 100vh;
  border-right: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.92);
  padding: 20px 14px;
}

.sidebar-brand {
  width: 100%;
  padding: 0 6px 10px;
}

.sidebar-brand strong,
.sidebar-brand span {
  display: block;
}

.sidebar-brand strong {
  font-size: 18px;
}

.sidebar-brand span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.side-nav {
  display: grid;
  gap: 6px;
}

.side-nav button {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: #475467;
  padding: 0 12px;
  font-weight: 760;
  text-align: left;
}

.side-nav button:hover {
  background: #f4f7fb;
  color: var(--primary);
}

.side-nav button.active {
  border-color: rgba(11, 77, 184, 0.15);
  background: var(--primary-soft);
  color: var(--primary);
  box-shadow: inset 3px 0 0 var(--primary);
}

.sidebar-user {
  display: grid;
  gap: 10px;
  margin-top: auto;
  border-top: 1px solid var(--line-soft);
  padding: 16px 6px 0;
}

.sidebar-user span {
  overflow: hidden;
  color: #344054;
  font-size: 13px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.workspace-topbar {
  position: sticky;
  top: 0;
  z-index: 15;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: -24px -24px 24px;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(247, 249, 252, 0.88);
  padding: 20px 24px;
  backdrop-filter: blur(18px);
}

.workspace-topbar h1 {
  margin: 0;
  color: #0b1f44;
  font-size: 26px;
  line-height: 1.2;
}

.workspace-topbar p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.topbar-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.status-pill.ok {
  border-color: rgba(22, 130, 93, 0.18);
  background: var(--green-soft);
  color: var(--green);
}

.status-pill.bad {
  border-color: rgba(194, 65, 61, 0.2);
  background: var(--red-soft);
  color: var(--red);
}

.credit-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  border: 1px solid rgba(11, 77, 184, 0.18);
  border-radius: 999px;
  background: #fff;
  color: var(--primary);
  padding: 0 12px;
  font-weight: 820;
}

.credit-chip span {
  color: var(--muted);
  font-size: 12px;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(180px, 0.55fr));
  gap: 16px;
  margin-bottom: 16px;
}

.dashboard-hero,
.dashboard-card,
.recent-panel,
.composer,
.prompt-library,
.settings-page,
.plans-box,
.recharge-box,
.redeem-box,
.faq-box,
.ledger-box,
.admin-code-box,
.admin-panel {
  padding: 22px;
}

.dashboard-hero {
  min-height: 240px;
  background:
    linear-gradient(135deg, rgba(11, 77, 184, 0.95), rgba(15, 159, 143, 0.84)),
    var(--primary);
  color: #fff;
}

.dashboard-hero .eyebrow,
.dashboard-hero p {
  color: rgba(255, 255, 255, 0.82);
}

.dashboard-hero h2 {
  margin: 0;
  max-width: 620px;
  color: #fff;
  font-size: 34px;
  line-height: 1.14;
}

.dashboard-hero > p {
  max-width: 600px;
  line-height: 1.7;
}

.dashboard-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 240px;
}

.dashboard-card span,
.account-summary span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 760;
}

.dashboard-card strong,
.account-summary strong {
  margin-top: 12px;
  color: #0b1f44;
  font-size: 34px;
  line-height: 1;
}

.dashboard-card p {
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.composer {
  display: grid;
  gap: 18px;
}

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

.mode-cards button {
  display: grid;
  gap: 6px;
  min-height: 86px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  padding: 14px;
  text-align: left;
}

.mode-cards button strong {
  font-size: 16px;
}

.mode-cards button span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.mode-cards button.active {
  border-color: rgba(11, 77, 184, 0.28);
  background: var(--primary-soft);
  color: var(--primary);
  box-shadow: inset 0 0 0 1px rgba(11, 77, 184, 0.08);
}

.template-entry,
.cost-strip,
.cost-breakdown {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: #f8fbff;
}

.template-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
}

.template-entry strong,
.template-entry span {
  display: block;
}

.template-entry strong {
  color: #0b1f44;
  font-size: 14px;
}

.template-entry span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.label-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.tip {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border: 1px solid #cbd6e8;
  border-radius: 999px;
  background: #fff;
  color: var(--primary);
  padding: 0;
  font-size: 12px;
  font-weight: 900;
}

.tip.active {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.tip:focus-visible {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(11, 77, 184, 0.12);
}

.tip-callout {
  position: relative;
  display: block;
  grid-column: 1 / -1;
  margin: 2px 0 4px;
  border: 1px solid rgba(11, 77, 184, 0.16);
  border-left: 3px solid var(--primary);
  border-radius: var(--radius);
  background: #f4f8ff;
  color: #344054;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.58;
}

.tip-callout::before {
  content: "";
  position: absolute;
  top: -5px;
  left: 14px;
  width: 8px;
  height: 8px;
  border-top: 1px solid rgba(11, 77, 184, 0.16);
  border-left: 1px solid rgba(11, 77, 184, 0.16);
  background: #f4f8ff;
  transform: rotate(45deg);
}

.panel-head + .tip-callout {
  margin: -2px 0 12px;
}

.prompt-field textarea {
  min-height: 260px;
}

.reference-panel,
.mask-panel,
.advanced-settings {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: #fff;
  padding: 16px;
}

.panel-head {
  margin-bottom: 12px;
}

.file-drop {
  display: grid;
  place-items: center;
  min-height: 120px;
  border: 1px dashed #b8c7dc;
  border-radius: var(--radius);
  background: #f8fbff;
  color: var(--muted);
  font-weight: 800;
}

.file-drop input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.reference-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.reference-item {
  position: relative;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: #fff;
  overflow: hidden;
}

.reference-item img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.reference-item button {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 999px;
  background: rgba(16, 24, 40, 0.72);
  color: #fff;
}

.mask-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 380px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: #101828;
  overflow: hidden;
}

.mask-stage img,
.mask-stage canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.mask-stage span {
  position: relative;
  z-index: 2;
  color: rgba(255, 255, 255, 0.72);
  font-weight: 800;
}

.field.compact {
  margin-top: 12px;
}

.advanced-settings summary {
  cursor: pointer;
  color: #0b1f44;
  font-weight: 850;
}

.param-grid,
.custom-size {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

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

.compression-field {
  grid-column: span 2;
}

.cost-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
}

.cost-strip span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.cost-strip strong {
  display: block;
  margin-top: 5px;
  color: var(--primary);
  font-size: 24px;
}

.cost-breakdown {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 12px;
}

.cost-breakdown span {
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  padding: 6px 9px;
  font-size: 12px;
  font-weight: 760;
}

.submit-button {
  width: 100%;
  min-height: 48px;
}

.library-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(210px, 260px);
  gap: 12px;
  margin: 18px 0;
}

.preset-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.preset-card {
  display: grid;
  grid-template-rows: auto 1fr;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: #fff;
  overflow: hidden;
  transition:
    border-color 0.16s ease,
    transform 0.16s ease,
    box-shadow 0.16s ease;
}

.preset-card:hover,
.work-card:hover,
.job-card:hover {
  border-color: #c9d8ee;
  box-shadow: var(--shadow-soft);
  transform: translateY(-1px);
}

.preset-thumb-button {
  display: block;
  width: 100%;
  border: 0;
  background: #eef3fb;
  padding: 0;
}

.preset-thumb-button img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.preset-card > div {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.preset-card span {
  color: var(--primary);
  font-size: 12px;
  font-weight: 850;
}

.preset-card h3 {
  margin: 0;
  color: #0b1f44;
  font-size: 16px;
  line-height: 1.35;
}

.preset-card p {
  display: -webkit-box;
  min-height: 62px;
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.preset-actions,
.job-actions,
.work-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.preset-actions button,
.job-actions button,
.work-actions button,
.work-actions a {
  min-height: 32px;
  border: 1px solid var(--line);
  background: #fff;
  color: #344054;
  padding: 0 10px;
  font-size: 12px;
}

.jobs-more {
  width: 100%;
  margin-top: 16px;
}

.preset-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 18px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: #f8fbff;
  padding: 12px;
}

.page-size-field {
  display: grid;
  grid-template-columns: auto 112px;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.pagination-pages,
.pagination-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pagination-pages {
  justify-content: center;
  flex: 1;
}

.pagination-pages button {
  min-width: 36px;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: #344054;
  font-weight: 820;
}

.pagination-pages button:hover,
.pagination-pages button.active {
  border-color: rgba(11, 77, 184, 0.32);
  background: var(--primary);
  color: #fff;
}

.pagination-pages span,
.pagination-actions span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 760;
}

.works-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.work-card {
  display: grid;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: #fff;
  overflow: hidden;
  transition:
    border-color 0.16s ease,
    transform 0.16s ease,
    box-shadow 0.16s ease;
}

.work-thumb {
  display: block;
  width: 100%;
  border: 0;
  background: #eef3fb;
  padding: 0;
}

.work-thumb img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.work-body {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.work-body h3 {
  margin: 0;
  color: #0b1f44;
  font-size: 15px;
  line-height: 1.35;
}

.work-body p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.job-list {
  display: grid;
  gap: 12px;
}

.job-card {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: #fff;
  padding: 14px;
  transition:
    border-color 0.16s ease,
    transform 0.16s ease,
    box-shadow 0.16s ease;
}

.large .job-card {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.job-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.job-thumb {
  flex: 0 0 auto;
  width: 76px;
  height: 76px;
  border-radius: var(--radius);
  object-fit: cover;
}

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

.job-copy h3 {
  margin: 0;
  overflow: hidden;
  color: #0b1f44;
  font-size: 15px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.job-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 8px;
}

.job-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  background: #f2f5f9;
  color: var(--muted);
  padding: 0 8px;
  font-size: 12px;
  font-weight: 720;
}

.job-meta .state.queued {
  background: var(--warning-soft);
  color: var(--warning);
}

.job-meta .state.running {
  background: var(--primary-soft);
  color: var(--primary);
}

.job-meta .state.completed {
  background: var(--green-soft);
  color: var(--green);
}

.job-meta .state.failed {
  background: var(--red-soft);
  color: var(--red);
}

.job-error {
  margin: 8px 0 0;
  color: var(--red);
  font-size: 13px;
}

.progress-track {
  grid-column: 1 / -1;
  height: 6px;
  border-radius: 999px;
  background: #edf2f8;
  overflow: hidden;
}

.progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), var(--teal));
}

.empty-block,
.empty-state {
  border: 1px dashed #cbd6e8;
  border-radius: var(--radius);
  background: #f8fbff;
  color: var(--muted);
  padding: 18px;
  text-align: center;
}

.empty-state {
  display: grid;
  place-items: center;
  gap: 10px;
  min-height: 260px;
  grid-column: 1 / -1;
}

.empty-state strong {
  color: #0b1f44;
  font-size: 18px;
}

.billing-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.28fr) minmax(340px, 0.72fr);
  align-items: start;
  gap: 18px;
}

.billing-primary,
.billing-side {
  display: grid;
  align-content: start;
  gap: 18px;
  min-width: 0;
}

.account-summary {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.account-summary > div {
  display: grid;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: #fff;
  padding: 18px;
  box-shadow: var(--shadow-soft);
}

.recharge-box {
  display: grid;
  gap: 18px;
}

.ledger-box,
.faq-box,
.admin-code-box {
  align-self: start;
}

.wallet-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(11, 77, 184, 0.95), rgba(17, 164, 182, 0.9)),
    #0b4db8;
  color: #fff;
  padding: 20px;
}

.wallet-banner span,
.wallet-banner p {
  color: rgba(255, 255, 255, 0.78);
}

.wallet-banner strong {
  display: block;
  margin-top: 8px;
  font-size: 28px;
  line-height: 1.1;
}

.wallet-banner p {
  margin: 8px 0 0;
  font-size: 13px;
}

.payment-status {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: #f8fbff;
  color: #475467;
  padding: 12px 14px;
  font-size: 13px;
  font-weight: 720;
}

.payment-status.ok {
  border-color: rgba(22, 179, 100, 0.22);
  background: #f0fdf6;
  color: #067647;
}

.payment-status.warn {
  border-color: rgba(245, 158, 11, 0.28);
  background: #fffbeb;
  color: #92400e;
}

.recharge-section-title {
  margin-top: 2px;
  color: #0b1f44;
  font-size: 14px;
  font-weight: 850;
}

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

.plan-card {
  display: grid;
  gap: 6px;
  min-height: 142px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 16px;
  text-align: left;
  transition:
    border-color 0.16s ease,
    box-shadow 0.16s ease,
    transform 0.16s ease;
}

.plan-card:hover,
.plan-card.active {
  border-color: rgba(11, 77, 184, 0.38);
  box-shadow: 0 14px 30px rgba(11, 77, 184, 0.1);
  transform: translateY(-1px);
}

.plan-card.active {
  background: #f4f8ff;
}

.plan-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.plan-card strong {
  display: block;
  color: #0b1f44;
  font-size: 26px;
}

.plan-card p,
.plan-note {
  margin: 0;
  color: var(--muted);
}

.plan-card em {
  color: var(--primary);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.plan-card small {
  align-self: end;
  color: var(--primary);
  font-size: 12px;
  font-weight: 850;
}

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

.payment-method {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 12px 14px;
  color: #0b1f44;
  font-weight: 850;
}

.payment-method span {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: #eef5ff;
  color: var(--primary);
  font-size: 11px;
}

.payment-method.active,
.payment-method:hover {
  border-color: rgba(11, 77, 184, 0.38);
  background: #f8fbff;
}

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

.redeem-form {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.transaction-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

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

.transaction-item strong,
.transaction-item span {
  display: block;
}

.transaction-item strong {
  color: #0b1f44;
}

.transaction-item span,
.transaction-item time {
  color: var(--muted);
  font-size: 12px;
}

.transaction-amount {
  font-weight: 850;
  text-align: right;
}

.transaction-amount.positive {
  color: var(--green);
}

.transaction-amount.negative {
  color: var(--red);
}

.settings-table {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.settings-table span {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: #f8fbff;
  color: #475467;
  padding: 12px;
  font-size: 13px;
  line-height: 1.5;
}

.admin-page {
  display: grid;
  gap: 16px;
}

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

.admin-stat {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: #fff;
  padding: 16px;
  box-shadow: var(--shadow-soft);
}

.admin-stat span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.admin-stat strong {
  display: block;
  margin-top: 8px;
  color: #0b1f44;
  font-size: 26px;
}

.admin-stat p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

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

.admin-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.admin-filters {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(180px, 220px);
  gap: 12px;
}

.admin-code-filters {
  grid-template-columns: minmax(260px, 1fr) minmax(160px, 200px) auto auto;
}

.admin-table-list {
  min-height: 180px;
}

.admin-row {
  display: grid;
  gap: 5px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: #f8fbff;
  padding: 12px;
}

.admin-user-row {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
}

.admin-job-row {
  background: #fff;
}

.admin-code-row {
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.admin-check {
  display: grid;
  place-items: center;
  width: 28px;
}

.admin-check input {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
}

.admin-row strong {
  color: #0b1f44;
  font-size: 14px;
}

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

.admin-row span b {
  font-weight: 850;
}

.admin-row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.admin-action-note {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  border-radius: var(--radius);
  background: #eef3fb;
  color: var(--muted);
  padding: 0 10px;
  font-size: 12px;
  font-weight: 760;
  white-space: nowrap;
}

.admin-status {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
}

.admin-status.ok {
  background: #ecfdf3;
  color: #067647;
}

.admin-status.neutral {
  background: var(--primary-soft);
  color: var(--primary);
}

.admin-status.danger {
  background: var(--red-soft);
  color: var(--red);
}

.admin-error-line {
  color: var(--red) !important;
}

.admin-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
}

.admin-pagination span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 760;
}

.admin-note {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.admin-code-list-panel {
  overflow: hidden;
}

.admin-code-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.import-codes-field,
#adminGeneratedCodes,
.admin-code-form button {
  grid-column: 1 / -1;
}

#adminGeneratedCodes {
  margin-top: 12px;
  min-height: 140px;
}

.drawer,
.image-lightbox,
.template-modal,
.payment-modal,
.account-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
}

.drawer-backdrop,
.lightbox-backdrop,
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(16, 24, 40, 0.46);
  backdrop-filter: blur(4px);
}

.drawer-panel {
  position: absolute;
  top: 0;
  right: 0;
  display: grid;
  grid-template-rows: auto 1fr;
  width: min(720px, 100%);
  height: 100%;
  background: #fff;
  box-shadow: -20px 0 48px rgba(16, 24, 40, 0.18);
}

.drawer-head,
.template-head {
  border-bottom: 1px solid var(--line-soft);
  padding: 18px 20px;
}

.drawer-head p,
.template-head p {
  margin: 0 0 6px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 850;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: #475467;
  font-weight: 900;
}

.drawer-body {
  display: grid;
  align-content: start;
  gap: 16px;
  overflow: auto;
  padding: 20px;
}

.drawer-section {
  display: grid;
  gap: 12px;
}

.drawer-section h3 {
  margin: 0;
  color: #0b1f44;
  font-size: 16px;
}

.drawer-section pre {
  max-height: 320px;
  overflow: auto;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: #f8fbff;
  color: #344054;
  padding: 14px;
  white-space: pre-wrap;
}

.result-grid,
.input-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}

.result-item {
  margin: 0;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: #fff;
  overflow: hidden;
}

.result-image-button {
  display: block;
  width: 100%;
  border: 0;
  background: #eef3fb;
  padding: 0;
}

.result-image-button img,
.input-grid img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.result-item figcaption {
  display: flex;
  gap: 8px;
  padding: 10px;
}

.prompt-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.lightbox-panel,
.template-panel {
  position: relative;
  z-index: 2;
  margin: 0;
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}

.lightbox-panel {
  position: absolute;
  inset: 40px;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  overflow: hidden;
}

.lightbox-panel img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #101828;
}

.lightbox-panel figcaption {
  padding: 12px 16px;
  color: var(--muted);
  font-size: 13px;
}

.lightbox-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
}

.template-panel {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(980px, calc(100% - 40px));
  max-height: calc(100vh - 60px);
  transform: translate(-50%, -50%);
  overflow: hidden;
}

.payment-dialog,
.payment-history-panel {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(620px, calc(100% - 40px));
  max-height: calc(100vh - 60px);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
  transform: translate(-50%, -50%);
  overflow: hidden;
}

.payment-history-panel {
  width: min(920px, calc(100% - 40px));
}

.payment-confirm-body,
.payment-history-body {
  display: grid;
  gap: 12px;
  overflow: auto;
  padding: 20px;
}

.modal-copy {
  margin: 0;
  color: #344054;
  font-size: 14px;
  line-height: 1.6;
}

.payment-confirm-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--line-soft);
  padding: 10px 0;
}

.payment-confirm-row span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 780;
}

.payment-confirm-row strong {
  color: #0b1f44;
}

.payment-confirm-row .danger {
  color: var(--red);
}

.payment-order-list {
  display: grid;
  gap: 10px;
}

.payment-order {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: #f8fbff;
  padding: 12px;
}

.payment-order strong,
.payment-order span {
  display: block;
}

.payment-order strong {
  color: #0b1f44;
}

.payment-order span,
.payment-order time {
  color: var(--muted);
  font-size: 12px;
}

.payment-order b {
  display: block;
  color: #0b1f44;
  text-align: right;
}

.order-status {
  text-align: right;
}

.order-status.success {
  color: var(--green);
}

.order-status.pending {
  color: #b54708;
}

.template-body {
  display: grid;
  grid-template-columns: minmax(240px, 0.7fr) minmax(0, 1fr);
  gap: 16px;
  overflow: auto;
  padding: 18px;
}

.template-preview-media img {
  width: 100%;
  border-radius: var(--radius);
}

.template-fields {
  display: grid;
  gap: 14px;
}

.template-field-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.template-field-head h3 {
  margin: 0;
  color: #0b1f44;
}

.template-field-head span,
.template-note {
  color: var(--muted);
  font-size: 13px;
}

.template-final-field textarea {
  min-height: 300px;
}

.template-final-field em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 650;
  line-height: 1.55;
}

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

.template-actions {
  justify-content: flex-end;
  border-top: 1px solid var(--line-soft);
  padding: 14px 18px;
}

@media (max-width: 1080px) {
  .marketing-hero,
  .auth-card,
  .dashboard-grid,
  .billing-layout,
  .admin-columns,
  .template-body {
    grid-template-columns: 1fr;
  }

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

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

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

  .pricing-rules {
    grid-template-columns: 1fr;
  }

  .auth-view {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0 48%, #c7ebff 48% 100%);
  }

  .auth-card {
    gap: 0;
  }

  .auth-showcase {
    min-height: 520px;
  }

  .auth-collage-track {
    inset: 0 -4% -18% -4%;
    grid-template-columns: repeat(4, minmax(170px, 1fr));
    grid-auto-rows: 170px;
  }

  .dashboard-card {
    min-height: 180px;
  }

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

@media (max-width: 820px) {
  .public-nav {
    width: min(100% - 28px, 1180px);
    flex-wrap: wrap;
  }

  .public-nav nav {
    order: 3;
    width: 100%;
    justify-content: space-between;
  }

  .marketing-hero {
    width: min(100% - 28px, 1180px);
    padding: 38px 0 0;
  }

  .hero-copy h1 {
    font-size: 42px;
  }

  .product-preview::before {
    inset: -16px -10px 18px 18px;
  }

  .preview-stage,
  .preview-stage img {
    min-height: 320px;
  }

  .public-feature-grid,
  .template-showcase-grid,
  .public-pricing-grid,
  .template-entry,
  .cost-strip {
    grid-template-columns: 1fr;
  }

  .template-showcase-card.large {
    grid-column: span 1;
    grid-row: span 1;
  }

  .auth-card,
  .mode-cards,
  .param-grid,
  .custom-size,
  .library-tools,
  .account-summary,
  .settings-table,
  .admin-code-form,
  .transaction-item,
  .payment-order {
    grid-template-columns: 1fr;
  }

  .auth-copy {
    margin-top: 38px;
  }

  .auth-copy h2 {
    font-size: 40px;
  }

  .auth-showcase {
    min-height: 380px;
  }

  .auth-collage-track {
    inset: -2% -18% -26% -18%;
    grid-template-columns: repeat(3, minmax(160px, 1fr));
    grid-auto-rows: 150px;
  }

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

  .workspace-sidebar {
    position: sticky;
    z-index: 30;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line-soft);
  }

  .side-nav {
    display: flex;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .side-nav button {
    flex: 0 0 auto;
  }

  .sidebar-user {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    margin-top: 0;
  }

  .workspace-main {
    padding: 16px;
  }

  .workspace-topbar {
    position: static;
    align-items: flex-start;
    flex-direction: column;
    margin: -16px -16px 16px;
    padding: 16px;
  }

  .topbar-actions {
    justify-content: flex-start;
  }

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

  .admin-filters,
  .admin-user-row,
  .admin-code-row {
    grid-template-columns: 1fr;
  }

  .admin-check {
    justify-content: start;
  }

  .admin-row-actions,
  .admin-pagination {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .pagination-pages,
  .pagination-actions {
    flex-wrap: wrap;
    justify-content: center;
  }

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

  .job-main {
    align-items: flex-start;
  }

  .drawer-panel,
  .lightbox-panel {
    inset: 0;
    width: 100%;
    height: 100%;
    border-radius: 0;
  }

  .template-panel {
    width: 100%;
    height: 100%;
    max-height: none;
    border-radius: 0;
  }
}

@media (max-width: 560px) {
  .public-actions {
    width: 100%;
  }

  .public-actions button,
  .hero-actions button {
    flex: 1;
  }

  .product-preview,
  .preview-stack,
  .public-plans,
  .public-feature-grid,
  .template-showcase-grid,
  .public-pricing-grid,
  .pricing-rules,
  .plans-grid,
  .payment-method-grid,
  .admin-grid,
  .template-field-grid {
    grid-template-columns: 1fr;
  }

  .preview-stack {
    display: none;
  }

  .product-feature-band,
  .templates-route,
  .pricing-route {
    width: min(100% - 28px, 1280px);
  }

  .product-feature-band {
    margin-top: 44px;
    padding: 44px 0;
  }

  .auth-view {
    background: #ffffff;
  }

  .auth-showcase {
    display: none;
  }

  .hero-actions,
  .topbar-actions,
  .admin-toolbar,
  .template-actions {
    flex-wrap: wrap;
  }

  .auth-forms,
  .dashboard-hero,
  .dashboard-card,
  .recent-panel,
  .composer,
  .prompt-library,
  .settings-page,
  .plans-box,
  .recharge-box,
  .redeem-box,
  .faq-box,
  .ledger-box,
  .admin-code-box,
  .admin-panel {
    padding: 16px;
  }
}
