:root {
  --bg: #faf6ec;
  --surface: rgba(255, 255, 255, 0.64);
  --surface-soft: #fffaf1;
  --ink: #19140d;
  --muted: #6f6558;
  --line: rgba(80, 60, 30, .13);
  --accent: #ff7a1a;
  --accent-soft: #fff0dd;
  --green: #10a878;
  --green-soft: #eefbf6;
  --blue: #5569ff;
  --red: #d85b4a;
  --shadow: 0 14px 44px rgba(98, 67, 24, 0.055);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 18% 4%, rgba(255, 138, 35, 0.10), transparent 28rem),
    radial-gradient(circle at 80% 10%, rgba(16, 168, 120, 0.08), transparent 24rem),
    linear-gradient(145deg, #fffdf8, var(--bg));
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 20px;
  align-items: center;
  padding: 12px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(250, 246, 236, .88);
  backdrop-filter: blur(18px);
}
.brand {
  border: 0;
  background: transparent;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
}
.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 15px;
  color: white;
  background: var(--ink);
  display: grid;
  place-items: center;
  font-weight: 900;
}
.brand strong, .brand small { display: block; }
.brand small { color: var(--muted); margin-top: 2px; }
nav {
  display: flex;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
}
nav button {
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  min-height: 38px;
  padding: 0 13px;
}
nav button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
nav button span {
  width: 20px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(255, 122, 26, .08);
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
}
nav button.active, nav button:hover {
  border-color: var(--line);
  background: white;
  color: var(--ink);
}
.account-topbar {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
}
.balance-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: default;
  user-select: none;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 700;
  pointer-events: none;
}
.balance-label strong { color: var(--accent); }
.balance-label span { color: var(--ink); }
.balance-label.loading { color: var(--muted); }
.auth-top-button {
  min-height: 38px;
  padding: 0 14px;
}
.top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}
.account-menu-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.account-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 90;
  width: 258px;
  border: 1px solid var(--line);
  background: rgba(255, 252, 246, .98);
  border-radius: 22px;
  box-shadow: 0 24px 70px rgba(25, 20, 13, .18);
  padding: 8px;
}
.account-dropdown::before {
  content: '';
  position: absolute;
  top: -6px;
  right: 16px;
  width: 12px;
  height: 12px;
  background: rgba(255, 252, 246, .98);
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
  transform: rotate(45deg);
}
.account-dropdown-head {
  padding: 12px 12px 10px;
  border-bottom: 1px solid rgba(80, 60, 30, .10);
  margin-bottom: 4px;
}
.account-dropdown-head span,
.account-dropdown-head strong {
  display: block;
}
.account-dropdown-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.account-dropdown-head strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 3px;
}
.account-dropdown button {
  width: 100%;
  min-height: 44px;
  border: 0;
  border-radius: 16px;
  background: transparent;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  text-align: left;
  color: var(--ink);
}
.account-dropdown button:hover {
  background: rgba(255, 122, 26, .08);
}
.account-dropdown button.danger:hover {
  background: #fff0ec;
  color: var(--red);
}
.account-dropdown button strong,
.account-dropdown button small {
  display: block;
}
.account-dropdown button small {
  margin-top: 2px;
  color: var(--muted);
}
.top-actions .account-dropdown,
.top-actions .account-dropdown * {
  pointer-events: auto;
}
.menu-dot {
  width: 30px;
  height: 30px;
  border-radius: 12px;
  display: inline-grid;
  place-items: center;
  background: rgba(255, 122, 26, .10);
  color: var(--accent);
  font-weight: 900;
  font-size: 12px;
}
.dev-bar {
  width: min(1240px, calc(100% - 32px));
  margin: 10px auto 0;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12px;
}
.dev-bar span {
  border-radius: 999px;
  padding: 6px 10px;
  font-weight: 900;
  color: var(--muted);
  background: rgba(255, 255, 255, .62);
}
.dev-bar.online span {
  color: #087c58;
  background: var(--green-soft);
}
.dev-bar.offline span {
  color: var(--red);
  background: #fff0ec;
}
.dev-bar label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.dev-bar input {
  width: 160px;
  min-height: 30px;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
}
.dev-bar label:nth-of-type(2) input {
  width: 220px;
}
.dev-bar .ghost {
  min-height: 30px;
  padding: 0 10px;
  font-size: 12px;
}
.dev-bar small {
  color: var(--muted);
}

main, .page {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
}
main {
  width: min(1880px, calc(100% - 12px));
  padding: 12px 0 36px;
}
.generate-page { width: min(1680px, calc(100% - 16px)); }
.generate-page.batch-mode-page {
  width: min(1880px, calc(100% - 10px));
}
.eyebrow {
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}
h1, h2, h3, p { margin-top: 0; }
h1 {
  max-width: 860px;
  margin: 8px 0 12px;
  font-size: clamp(36px, 5.4vw, 62px);
  line-height: .96;
  letter-spacing: -.075em;
}
h2 {
  margin-bottom: 8px;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.05;
  letter-spacing: -.04em;
}
p { color: var(--muted); line-height: 1.7; }

.hero, .page-hero {
  display: grid;
  grid-template-columns: 1fr 330px;
  gap: 22px;
  align-items: end;
  padding: 12px 0 18px;
}
.compact-hero {
  grid-template-columns: 1fr 330px;
  align-items: center;
  padding: 8px 0 10px;
}
.hero p, .page-hero p { max-width: 760px; font-size: 18px; }
.compact-hero h1 {
  max-width: none;
  margin-bottom: 8px;
  font-size: clamp(42px, 6vw, 78px);
  line-height: .9;
}
.compact-hero p {
  max-width: 680px;
  margin-bottom: 12px;
}
.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.hero-badges span {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .72);
  color: var(--muted);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 800;
}
.page-hero.small {
  display: block;
  padding-bottom: 20px;
}
.page-hero.small h1 { font-size: clamp(36px, 5vw, 60px); }
.notice-card, .creator-panel, .result-panel, .quick-section, .pack, .rules article, .table-section, .gallery-card, .card, .docs-box, .wallet-grid article, .capability-panel {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 28px;
  box-shadow: var(--shadow);
}
.creator-panel, .result-panel, .quick-section {
  border: 0;
  background: rgba(255, 255, 255, .42);
  box-shadow: none;
}
.creator-panel {
  border-radius: 30px;
  border-right: 1px solid rgba(80, 60, 30, .08);
  min-height: calc(100vh - 170px);
}
.result-panel {
  background: transparent;
  min-height: calc(100vh - 170px);
}
.quick-section {
  background: transparent;
}
.modal-layer {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(25, 20, 13, .28);
  backdrop-filter: blur(10px);
}
.modal-window {
  width: min(1120px, 100%);
  max-height: min(86vh, 920px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  border: 1px solid var(--line);
  background: rgba(255, 252, 246, .96);
  border-radius: 30px;
  box-shadow: 0 30px 90px rgba(25, 20, 13, .22);
  overflow: hidden;
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}
.modal-head strong {
  display: block;
  margin-top: 4px;
  font-size: 24px;
  letter-spacing: -.04em;
}
.modal-close {
  min-height: 42px;
  border: 1px solid var(--line);
  background: var(--ink);
  position: relative;
  z-index: 2;
  color: white;
  border-radius: 999px;
  padding: 0 18px;
  font-weight: 900;
}
.modal-body {
  overflow: auto;
  padding: 20px;
  user-select: text;
}
.modal-body * {
  user-select: text;
}
.modal-page {
  width: 100%;
}
.image-preview-layer {
  z-index: 180;
  background: rgba(18, 16, 13, .72);
}
.image-preview-window {
  width: min(1080px, 100%);
  max-height: min(90vh, 940px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 24px;
  overflow: hidden;
  background: #14110d;
  box-shadow: 0 30px 90px rgba(0, 0, 0, .38);
}
.image-preview-head,
.image-preview-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  color: white;
}
.image-preview-head small {
  display: block;
  margin-top: 6px;
  color: rgba(255, 255, 255, .66);
}
.image-preview-body {
  min-height: 0;
  display: grid;
  place-items: center;
  background: #0f0d0a;
  overflow: hidden;
}
.image-preview-body img {
  max-width: 100%;
  max-height: calc(90vh - 160px);
  object-fit: contain;
}
.image-preview-foot {
  border-top: 1px solid rgba(255, 255, 255, .12);
}
.image-preview-foot p {
  min-width: 0;
  margin: 0;
  color: rgba(255, 255, 255, .78);
  line-height: 1.55;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.ops-standalone-shell {
  min-height: 100vh;
}
.ops-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 0;
  width: min(1900px, calc(100% - 24px));
  margin: 0 auto;
}
.ops-secure-note strong {
  white-space: nowrap;
}
.ops-secure-note {
  color: var(--muted);
}
.ops-sidebar {
  position: sticky;
  top: 78px;
  display: grid;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255,255,255,.64);
}
.ops-sidebar-head strong {
  display: block;
  margin-top: 4px;
  font-size: 18px;
  letter-spacing: 0;
}
.ops-top-nav {
  justify-content: center;
  flex-wrap: wrap;
}
.ops-top-nav button {
  white-space: nowrap;
}
.ops-standalone-main {
  width: 100%;
  min-width: 0;
  padding: 14px 0 42px;
}
.ops-standalone-main .ops-page {
  width: 100%;
  min-width: 0;
}
.auth-window {
  width: min(520px, 100%);
}
.auth-window .modal-body {
  padding: 0;
}
.auth-form {
  display: grid;
  gap: 14px;
  padding: 20px;
}
.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, .58);
}
.auth-tabs button {
  border: 0;
  min-height: 40px;
  border-radius: 14px;
  background: transparent;
  color: var(--muted);
  font-weight: 900;
}
.auth-tabs button.active {
  background: var(--ink);
  color: white;
}
.auth-code-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}
.auth-message {
  margin: 0;
  padding: 12px 14px;
  border-radius: 14px;
  color: #8a3d1b;
  background: #fff1e7;
  line-height: 1.5;
}
.auth-message.success {
  color: #087c58;
  background: #effbf6;
}
.auth-message.error {
  color: #8a3d1b;
  background: #fff1e7;
}
.auth-required-card {
  margin-top: 12px;
}
.auth-required-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}
.modal-page .page-hero.small {
  padding-top: 0;
}
.modal-page .page-hero.small h1 {
  font-size: clamp(28px, 4vw, 48px);
}
.modal-page .packs,
.modal-page .rules,
.modal-page .wallet-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.notice-card {
  padding: 18px;
}
.notice-card.soft {
  background: rgba(255, 255, 255, .68);
  box-shadow: none;
}
.notice-card strong, .notice-card span { display: block; }
.notice-card span { color: var(--muted); margin-top: 8px; line-height: 1.6; }
.router-card span {
  color: var(--accent);
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 900;
}
.router-card small {
  display: block;
  color: var(--muted);
  margin-top: 8px;
  line-height: 1.6;
}

.generate-switchbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 14px;
  margin: 2px 0 16px;
}

.mode-tabs {
  justify-self: center;
  width: fit-content;
  display: flex;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px;
  margin: 0;
  background: white;
}
.mode-tabs button {
  border: 0;
  background: transparent;
  border-radius: 999px;
  min-width: 116px;
  padding: 10px 24px;
  color: var(--muted);
  font-weight: 800;
}
.mode-tabs button span,
.mode-tabs button small {
  display: block;
  line-height: 1.2;
}
.mode-tabs button small {
  margin-top: 3px;
  font-size: 11px;
  color: inherit;
  opacity: .78;
}
.mode-tabs button.active {
  background: var(--accent);
  color: white;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(520px, .92fr) minmax(560px, 1.08fr);
  gap: 14px;
  align-items: start;
}
.workspace.batch-workspace {
  grid-template-columns: minmax(0, 1fr);
}
.creator-panel, .result-panel, .quick-section, .table-section, .card, .docs-box {
  padding: 20px;
}
.creator-panel { padding: clamp(14px, 1.2vw, 20px); }
.batch-creator-panel {
  padding: clamp(10px, .9vw, 16px);
  min-height: calc(100vh - 150px);
}
.batch-mode-page .batch-creator-panel {
  min-height: calc(100vh - 96px);
}
.result-panel {
  position: static;
  top: auto;
  align-self: stretch;
  display: grid;
  gap: 12px;
  padding: clamp(8px, .9vw, 12px);
}
.panel-head, .section-head, .task-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.panel-head p { margin-bottom: 0; }
.panel-head h2 {
  margin-bottom: 0;
  font-size: clamp(28px, 3.2vw, 42px);
}
.panel-head .eyebrow {
  display: block;
  margin-bottom: 6px;
}
.panel-tools {
  display: flex;
  gap: 8px;
  align-items: center;
}
.mini-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  margin-bottom: 10px;
}
.upload-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.upload-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}
.ref-uploader {
  display: grid;
  grid-template-columns: minmax(180px, .72fr) 1fr;
  gap: 10px;
  align-items: stretch;
  margin: 2px 0 18px;
}
.ref-dropzone,
.ref-empty {
  border: 1px dashed rgba(151, 112, 54, .32);
  background: rgba(255, 250, 241, .64);
  color: var(--muted);
}
.ref-dropzone {
  min-height: 92px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 7px;
  padding: 14px;
  text-align: center;
}
.ref-dropzone svg,
.ref-empty svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ref-dropzone strong {
  color: var(--ink);
  font-size: 14px;
}
.ref-dropzone span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}
.ref-dropzone:disabled {
  opacity: .45;
  cursor: not-allowed;
}
.ref-slots {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.ref-thumb {
  position: relative;
  min-height: 92px;
  border: 1px solid rgba(80, 60, 30, .10);
  border-radius: 18px;
  padding: 10px;
  display: grid;
  align-content: end;
  overflow: hidden;
  color: white;
  background: linear-gradient(145deg, #ff9b3d, #ffd89f);
}
.ref-thumb.green { background: linear-gradient(145deg, #0fae78, #a7e9cf); }
.ref-thumb.amber { background: linear-gradient(145deg, #d98a13, #ffd188); }
.ref-thumb.gray { background: linear-gradient(145deg, #777, #ddd); }
.ref-thumb button {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 999px;
  background: rgba(25, 20, 13, .52);
  color: white;
  font-size: 16px;
  line-height: 1;
}
.ref-thumb strong {
  font-size: 22px;
  line-height: 1;
}
.ref-thumb span {
  margin-top: 4px;
  font-size: 12px;
  font-weight: 800;
  text-shadow: 0 1px 8px rgba(25, 20, 13, .22);
}
.ref-empty {
  min-height: 92px;
  border-radius: 18px;
  display: grid;
  place-items: center;
}
.hint {
  font-size: 13px;
  margin: 9px 0 16px;
}
.input-block {
  display: grid;
  gap: 10px;
  margin-bottom: 20px;
}
.compose-box {
  border: 0;
  background: transparent;
  border-radius: 0;
  padding: 4px 0 0;
  margin: 16px 0 18px;
}
.input-block.compact {
  margin-bottom: 12px;
}
.input-block.compact textarea {
  min-height: 92px;
  border-radius: 16px;
}
.compose-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: space-between;
}
.compose-actions .primary {
  min-width: 132px;
}
.compose-actions span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}
.inline-error {
  margin: 10px 0 0;
  color: var(--red);
  font-size: 13px;
  font-weight: 800;
}
.inline-success {
  margin: 10px 0 0;
  color: #087c58;
  font-size: 13px;
  font-weight: 800;
}
.inline-success code {
  display: block;
  margin-top: 6px;
  word-break: break-all;
}
.input-block span { font-weight: 900; }
textarea, input, select {
  width: 100%;
  border: 1px solid rgba(80, 60, 30, .12);
  border-radius: 20px;
  background: rgba(255, 255, 255, .72);
  color: var(--ink);
  padding: 14px;
  outline: none;
}
textarea {
  min-height: 104px;
  resize: vertical;
}
textarea:focus, input:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(255, 122, 26, .12);
}
.param-block { display: grid; gap: 18px; }
.single-estimate-line {
  display: grid;
  grid-template-columns: auto auto 1fr;
  gap: 8px 12px;
  align-items: baseline;
  width: fit-content;
  max-width: 100%;
  border: 1px solid rgba(255, 122, 26, .20);
  border-radius: 16px;
  background: rgba(255, 240, 221, .62);
  padding: 10px 14px;
  color: var(--muted);
}
.single-estimate-line strong {
  color: var(--accent);
  font-size: 18px;
}
.single-estimate-line small {
  color: var(--muted);
  font-weight: 800;
}
.model-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  gap: 8px;
}
.model-card, .pill-grid button, .ratio-card {
  border: 1px solid transparent;
  background: rgba(255, 255, 255, .56);
  border-radius: 18px;
  color: var(--ink);
}
.model-card {
  min-height: 82px;
  padding: 12px;
  text-align: left;
  position: relative;
}
.model-card .model-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: var(--surface-soft);
  margin-bottom: 8px;
}
.model-card strong, .model-card small { display: block; }
.model-card strong { margin: 0 0 4px; }
.model-card small { color: var(--muted); line-height: 1.45; }
.model-card.selected, .pill-grid button.selected, .advanced-toggle.selected, .ratio-card.selected {
  border-color: rgba(255, 122, 26, .38);
  background: var(--accent-soft);
  color: var(--accent);
}
.param-row {
  display: grid;
  grid-template-columns: 1.3fr .7fr;
  gap: 14px;
}
.param-row.compact {
  grid-template-columns: 1fr 1fr;
}
.pill-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}
.pill-grid.three { grid-template-columns: repeat(auto-fit, minmax(70px, 1fr)); }
.pill-grid button { min-height: 42px; font-weight: 800; }
.ratio-card-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}
.ratio-card {
  min-height: 72px;
  padding: 10px 8px;
  display: grid;
  place-items: center;
  gap: 4px;
  text-align: center;
}
.ratio-shape {
  width: 38px;
  height: 34px;
  display: grid;
  place-items: center;
}
.ratio-shape i {
  width: var(--ratio-w);
  height: var(--ratio-h);
  display: block;
  border: 2px solid currentColor;
  border-radius: 6px;
  background: rgba(255, 122, 26, .08);
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .62);
}
.ratio-card strong {
  font-size: 14px;
  line-height: 1;
}
.ratio-card small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
}
.ratio-card.selected small { color: var(--accent); }
.advanced-toggle {
  width: fit-content;
  min-height: 38px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, .56);
  color: var(--muted);
  border-radius: 999px;
  padding: 0 13px;
  font-weight: 800;
}
.advanced-box {
  display: grid;
  grid-template-columns: 1fr 180px;
  gap: 12px;
  border-top: 1px solid rgba(80, 60, 30, .10);
  padding-top: 14px;
}
.advanced-box label {
  display: grid;
  gap: 8px;
}
.advanced-box span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.primary, .secondary, .ghost {
  min-height: 42px;
  padding: 0 18px;
  border-radius: 14px;
  font-weight: 900;
}
.primary {
  border: 0;
  color: white;
  background: linear-gradient(135deg, var(--accent), #f05c00);
}
.primary:disabled {
  background: #d9d2c7;
  color: #766c5f;
}
.secondary, .ghost {
  border: 1px solid rgba(80, 60, 30, .13);
  background: rgba(255, 255, 255, .62);
  color: var(--ink);
}
.ghost { color: var(--accent); }
.wide { width: 100%; margin-top: 22px; min-height: 52px; }
.wide-soft { width: 100%; margin-top: 10px; }
.soft-badge {
  border: 1px solid var(--line);
  background: white;
  color: var(--muted);
  border-radius: 999px;
  padding: 8px 12px;
}

.estimate-card, .task-card, .result-box {
  border: 1px solid rgba(80, 60, 30, .10);
  border-radius: 22px;
  background: rgba(255, 255, 255, .68);
  padding: 16px;
}
.result-box {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 8px;
  min-height: calc(100vh - 190px);
}
.result-box.no-status {
  grid-template-rows: minmax(0, 1fr);
}
.estimate-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
}
.estimate-card > strong {
  display: block;
  font-size: 48px;
  letter-spacing: -.08em;
  color: var(--accent);
}
.estimate-card small { font-size: 18px; }
.estimate-card p { margin-bottom: 8px; }
.estimate-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}
.refund-note {
  background: #effbf6;
  color: #247a5c;
  border: 1px solid #ccebdc;
  border-radius: 14px;
  padding: 11px;
  font-size: 13px;
  line-height: 1.55;
}
.compact-task {
  min-height: 58px;
  display: grid;
  align-items: center;
}
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin: 14px 0;
}
.steps span {
  text-align: center;
  border-radius: 999px;
  padding: 6px 8px;
  background: #f5eee1;
  color: var(--muted);
  font-size: 12px;
}
.steps span.done {
  background: var(--green);
  color: white;
}
.task-card.failed_refunded { border-color: #d9d9d9; background: #fbfbfb; }
.task-card.blocked { border-color: #f2c6bd; }
.result-art {
  position: relative;
  min-height: clamp(460px, 63vh, 820px);
  height: 100%;
  display: grid;
  place-items: center;
  text-align: center;
  border-radius: 20px;
  background: linear-gradient(145deg, #fff3dd, #fff, #e9f9f2);
}
.result-art span {
  display: block;
  font-size: 48px;
  font-weight: 900;
  color: var(--accent);
}
.result-art strong, .result-art small { display: block; }
.result-box.completed .result-art {
  background: linear-gradient(145deg, #ffc36d, #fff1bf 46%, #bce9d7);
}
.result-box.failed_refunded .result-art {
  background: linear-gradient(145deg, #f3f3f3, #fff);
}
.result-art.has-image {
  padding: 0;
  overflow: hidden;
  background: #f8f1e6;
}
.result-art.multi-result {
  padding: 8px;
}
.result-gallery {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.result-gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 14px;
  background: #f8f1e6;
}
.result-art > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.result-art img,
.thumb img,
.gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.result-status-line {
  min-height: 34px;
  display: flex;
  align-items: center;
}
.result-status-line:empty { display: none; }
.compact-task-line {
  width: 100%;
  min-height: 32px;
  padding: 7px 10px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  background: rgba(255,255,255,.62);
}
.compact-task-line strong { color: var(--ink); }
.compact-task-line span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.compact-task-line span:empty { display: none; }
.compact-task-line.queued,
.compact-task-line.processing {
  background: var(--accent-soft);
  color: var(--accent);
}
.compact-task-line.completed {
  background: #effbf6;
  color: #087c58;
}
.compact-task-line.failed_refunded,
.compact-task-line.blocked {
  background: #fff1e7;
  color: #8a3d1b;
}
.compact-task-line.queued strong,
.compact-task-line.processing strong { color: var(--accent); }
.compact-task-line.completed strong { color: #087c58; }
.compact-task-line.failed_refunded strong,
.compact-task-line.blocked strong { color: #8a3d1b; }
.model-label-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.model-label-line b {
  color: var(--accent);
  font-size: 13px;
}
.result-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  align-items: center;
  justify-content: flex-end;
}
.result-actions.two-actions { justify-content: flex-end; }
.compact-result-actions {
  align-self: end;
}
.compact-result-actions .secondary {
  width: auto;
  min-width: 54px;
  max-width: 76px;
  height: 30px;
  min-height: 30px;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 12px;
  line-height: 1;
  flex: 0 0 auto;
}

.result-overlay-actions {
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: auto;
  margin: 0;
  padding: 5px;
  border: 1px solid rgba(80, 60, 30, .10);
  border-radius: 999px;
  background: rgba(255, 252, 246, .78);
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 28px rgba(25, 20, 13, .10);
}
.result-overlay-actions .secondary {
  background: rgba(255,255,255,.76);
}
.result-placeholder {
  display: grid;
  gap: 8px;
  color: var(--muted);
}
.result-placeholder span {
  font-size: 42px;
  color: rgba(25,20,13,.28);
}
.result-inspiration-section {
  margin-top: 12px;
  padding: 10px 12px 14px;
}
.below-inspiration-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.quick-section {
  margin-top: 20px;
  padding: 8px 0 0;
}
.quick-section.compact {
  box-shadow: none;
  background: transparent;
}
.template-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.template-card {
  border: 1px solid var(--line);
  background: white;
  border-radius: 20px;
  padding: 16px;
  text-align: left;
}
.template-card span { color: var(--accent); font-size: 12px; font-weight: 900; }
.template-card strong { display: block; margin: 8px 0; font-size: 18px; }
.template-card p { font-size: 13px; margin-bottom: 0; }
.recent-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.mini-history {
  border: 0;
  background: rgba(255, 255, 255, .46);
  border-radius: 20px;
  padding: 12px;
}
.thumb, .gallery-thumb {
  min-height: 120px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  color: white;
  text-align: center;
  overflow: hidden;
  background: linear-gradient(145deg, #ff9b3d, #ffd89f);
}
.thumb.green, .gallery-thumb.green { background: linear-gradient(145deg, #0fae78, #a7e9cf); }
.thumb.amber, .gallery-thumb.amber { background: linear-gradient(145deg, #d98a13, #ffd188); }
.thumb.gray, .gallery-thumb.gray { background: linear-gradient(145deg, #777, #ddd); }
.thumb.red, .gallery-thumb.red { background: linear-gradient(145deg, #d85b4a, #ffc5ba); }
.mini-history strong, .mini-history span { display: block; margin-top: 8px; }
.mini-history span { color: var(--muted); font-size: 13px; }

.batch-head-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}
.batch-head-meta span,
.batch-head-meta strong {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, .66);
  padding: 0 12px;
}
.batch-head-meta strong { color: var(--accent); }

.batch-global-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
  margin: 10px 0 12px;
  padding: 10px;
  border-radius: 20px;
  background: rgba(255, 255, 255, .46);
  border: 1px solid rgba(80, 60, 30, .08);
}
.batch-global-controls {
  display: grid;
  grid-template-columns: 1.25fr repeat(3, minmax(96px, .6fr));
  gap: 8px;
}
.batch-global-controls label,
.batch-mini-controls label {
  display: grid;
  gap: 5px;
}
.batch-global-controls span,
.batch-mini-controls span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}
.batch-global-controls select,
.batch-mini-controls select {
  min-height: 40px;
  border-radius: 13px;
  padding: 8px 28px 8px 10px;
  background: rgba(255, 255, 255, .78);
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 14px;
}
.batch-toolbar {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  background: white;
  border-radius: 18px;
  padding: 14px;
  margin-bottom: 14px;
}
.batch-toolbar.compact-toolbar {
  border: 0;
  background: transparent;
  padding: 0;
  gap: 8px;
  flex-wrap: wrap;
}
.batch-layout-toggle.active {
  color: var(--accent);
  border-color: rgba(255, 122, 26, .34);
  background: var(--accent-soft);
}
.batch-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(360px, 1fr));
  gap: clamp(8px, .75vw, 12px);
  align-items: stretch;
}
.result-box {
  padding: 12px;
}
.batch-mode-page .batch-grid {
  margin-top: clamp(8px, 1vh, 16px);
}
.batch-card {
  position: relative;
  display: grid;
  gap: 8px;
  grid-template-rows: auto auto minmax(0, 1fr) auto auto auto;
  border: 1px solid rgba(80, 60, 30, .09);
  border-radius: 20px;
  background: rgba(255, 255, 255, .56);
  padding: 9px;
  min-width: 0;
  min-height: clamp(448px, calc((100vh - 132px) / 2), 540px);
}
.batch-card.is-editing {
  border-color: rgba(255, 122, 26, .26);
  background: rgba(255, 250, 241, .74);
}
.batch-delete-button {
  position: absolute;
  top: -10px;
  right: -8px;
  z-index: 2;
  width: 28px;
  height: 28px;
  min-height: 28px;
  border: 1px solid rgba(216, 91, 74, .28);
  border-radius: 999px;
  background: white;
  color: var(--red);
  display: grid;
  place-items: center;
  padding: 0;
  font-weight: 900;
  box-shadow: 0 10px 24px rgba(25, 20, 13, .12);
}
.batch-card-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  color: var(--muted);
}
.batch-card-head strong { color: var(--ink); }
.batch-card-head span {
  font-size: 12px;
  font-weight: 800;
}
.batch-prompt-box { display: block; }
.batch-card textarea {
  min-height: 78px;
  margin: 0;
  resize: vertical;
  border-radius: 14px;
  padding: 10px;
  background: rgba(255, 255, 255, .70);
}
.batch-ref-block,
.single-ref-block {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 0;
  min-width: 0;
  border: 1px solid rgba(80, 60, 30, .12);
  border-radius: 18px;
  background: rgba(255, 250, 241, .56);
  overflow: hidden;
}

.single-ref-block {
  margin: 2px 0 18px;
}
.single-ref-strip {
  min-height: 148px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  align-content: start;
  padding: 8px;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.single-ref-strip.is-empty {
  min-height: 132px;
  align-items: stretch;
}
.single-ref-thumb {
  position: relative;
  min-height: 100px;
  aspect-ratio: 4 / 3;
  border-radius: 16px;
  overflow: hidden;
  color: white;
  background: linear-gradient(145deg, #ff9b3d, #ffd89f);
}
.single-ref-thumb.green { background: linear-gradient(145deg, #0fae78, #a7e9cf); }
.single-ref-thumb.amber { background: linear-gradient(145deg, #d98a13, #ffd188); }
.single-ref-thumb.gray { background: linear-gradient(145deg, #777, #ddd); }
.single-ref-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.single-ref-thumb strong {
  height: 100%;
  display: grid;
  place-items: center;
}
.single-ref-thumb span {
  position: absolute;
  left: 9px;
  right: 9px;
  bottom: 8px;
  z-index: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 900;
  text-shadow: 0 1px 8px rgba(25, 20, 13, .35);
}
.single-ref-thumb .ref-status,
.batch-ref-thumb .ref-status {
  position: absolute;
  left: 7px;
  bottom: 7px;
  z-index: 2;
  display: inline-flex;
  width: fit-content;
  max-width: calc(100% - 14px);
  border-radius: 999px;
  padding: 2px 7px;
  background: rgba(25, 20, 13, .58);
  color: white;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.4;
  white-space: nowrap;
}
.single-ref-thumb.has-image > span {
  bottom: 28px;
}
.single-ref-thumb .ref-status.uploaded,
.batch-ref-thumb .ref-status.uploaded { background: rgba(16, 168, 120, .82); }
.single-ref-thumb .ref-status.failed,
.batch-ref-thumb .ref-status.failed { background: rgba(216, 91, 74, .88); }
.single-ref-thumb .ref-status.uploading,
.batch-ref-thumb .ref-status.uploading { background: rgba(255, 122, 26, .88); }
.single-ref-thumb button {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 2;
  width: 22px;
  height: 22px;
  min-height: 22px;
  border: 0;
  border-radius: 999px;
  background: rgba(25, 20, 13, .55);
  color: white;
  padding: 0;
}
.reference-line-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 6px 8px 4px 10px;
  background: rgba(255, 250, 241, .78);
  border-bottom: 1px solid rgba(80, 60, 30, .07);
}
.reference-line-head span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}
.ref-icon-add {
  min-height: 30px;
  min-width: 52px;
  border: 1px dashed rgba(80, 60, 30, .18);
  border-radius: 999px;
  background: rgba(255, 255, 255, .72);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 0 10px;
}
.ref-icon-add b {
  font-size: 18px;
  line-height: 1;
}
.ref-icon-add svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.batch-ref-strip {
  min-height: clamp(200px, 24vh, 280px);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  align-content: start;
  height: 100%;
  padding: 7px;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.batch-ref-strip.is-empty {
  align-items: stretch;
}
.batch-ref-thumb {
  position: relative;
  aspect-ratio: 4 / 3;
  min-height: 48px;
  min-width: 0;
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(145deg, #ff9b3d, #ffd89f);
}
.batch-ref-thumb.green { background: linear-gradient(145deg, #0fae78, #a7e9cf); }
.batch-ref-thumb.amber { background: linear-gradient(145deg, #d98a13, #ffd188); }
.batch-ref-thumb.gray { background: linear-gradient(145deg, #777, #ddd); }
.batch-ref-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.batch-ref-thumb span {
  height: 100%;
  display: grid;
  place-items: center;
  color: white;
  font-weight: 900;
}
.batch-ref-thumb button {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  min-height: 20px;
  border: 0;
  border-radius: 999px;
  background: rgba(25, 20, 13, .55);
  color: white;
  padding: 0;
  line-height: 1;
}
.ref-empty-tile {
  min-height: 100%;
  width: 100%;
  border: 1px dashed rgba(80, 60, 30, .16);
  border-radius: 14px;
  background: rgba(255, 255, 255, .54);
  color: rgba(80, 60, 30, .36);
  display: grid;
  place-items: center;
  align-content: center;
  gap: 4px;
  padding: 10px;
  pointer-events: none;
}
.single-ref-strip > .ref-empty-tile,
.batch-ref-strip > .ref-empty-tile {
  grid-column: 1 / -1;
}
.batch-ref-strip > .ref-empty-tile {
  min-height: clamp(184px, 23vh, 270px);
}
.ref-empty-tile b {
  font-size: 26px;
  line-height: 1;
}
.ref-empty-tile svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.batch-mini-controls {
  display: grid;
  grid-template-columns: minmax(116px, 1.2fr) minmax(78px, .8fr) minmax(86px, .85fr) minmax(72px, .72fr);
  gap: 6px;
}
.batch-media-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
  align-items: stretch;
}
.batch-result-pane {
  min-width: 0;
  display: grid;
  align-items: stretch;
}
.batch-result-mini {
  min-height: clamp(200px, 24vh, 280px);
  height: 100%;
  border: 1px dashed rgba(80, 60, 30, .14);
  border-radius: 16px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: linear-gradient(145deg, #fff7e9, #f6fbf5);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}
.batch-result-mini.has-image {
  padding: 0;
  background: #f8f1e6;
}
.batch-result-mini img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.batch-result-mini.multi-result {
  padding: 6px;
}
.batch-result-gallery {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}
.batch-result-gallery img {
  border-radius: 10px;
}
.batch-card-actions {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(118px, 1fr) auto;
  align-items: center;
  gap: 8px;
}
.batch-bottom-actions {
  align-self: end;
  padding-top: 2px;
}
.batch-generate-button {
  width: 100%;
  min-height: 44px;
}
.batch-result-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
}
.batch-result-actions .secondary {
  min-height: 40px;
  padding: 0 12px;
  border-radius: 12px;
}
.batch-result-actions .compact-icon-button {
  min-width: 34px;
  min-height: 34px;
  padding: 0 8px;
}
.batch-result-actions small,
.batch-message {
  color: var(--muted);
  font-size: 12px;
}
.batch-message {
  display: block;
  text-align: left;
  min-height: 16px;
}
.batch-add-tile {
  min-height: 420px;
  border: 1px dashed rgba(80, 60, 30, .18);
  border-radius: 22px;
  background: rgba(255, 255, 255, .32);
  display: grid;
  place-items: center;
  padding: 0;
}
.batch-add-tile span {
  width: 76px;
  height: 76px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid rgba(255, 122, 26, .24);
  font-size: 46px;
  line-height: 1;
  box-shadow: 0 18px 40px rgba(255, 122, 26, .14);
}
.packs, .rules, .wallet-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 22px;
}
.pack {
  padding: 22px;
}
.pack.featured { border-color: var(--accent); }
.pack span { color: var(--muted); }
.pack-code {
  display: inline-flex;
  margin-bottom: 10px;
  font-size: 12px;
  font-weight: 900;
}
.pack > strong {
  display: block;
  margin: 16px 0;
  font-size: 36px;
  letter-spacing: -.05em;
}
.pack small {
  display: block;
  color: var(--muted);
  margin: -4px 0 14px;
}
.pack.featured {
  background: var(--ink);
  color: white;
}
.pack.featured p,
.pack.featured small,
.pack.featured .pack-code { color: rgba(255,255,255,.68); }
.pack-actions {
  display: grid;
  gap: 8px;
}
.pack button { width: 100%; }
.rules { grid-template-columns: repeat(4, 1fr); }
.pricing-rules { grid-template-columns: repeat(3, 1fr); }
.rules article { padding: 22px; }
.inline-link {
  min-height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  font-weight: 900;
}
.table-section { margin: 22px 0; }
.pricing-note {
  margin: 0 0 16px;
  padding: 18px 20px;
}
.pricing-note h2 {
  margin: 4px 0 8px;
}
.pricing-note p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}
.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: white;
}
table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}
th, td {
  padding: 14px;
  border-bottom: 1px solid #f0e6d5;
  text-align: left;
  vertical-align: top;
}
th {
  background: #fff6e8;
  color: #775431;
}
td small { display: block; color: var(--muted); margin-top: 4px; }
code {
  display: inline-block;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  border-radius: 8px;
  padding: 3px 7px;
}

.filters {
  display: grid;
  grid-template-columns: 1fr 180px 180px;
  gap: 12px;
  margin-bottom: 18px;
}
.template-filter {
  grid-template-columns: minmax(260px, 680px);
}
.template-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -4px 0 18px;
}
.template-categories button {
  min-height: 36px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .64);
  color: var(--muted);
  border-radius: 999px;
  padding: 0 14px;
  font-weight: 900;
}
.template-categories button.active {
  color: white;
  border-color: transparent;
  background: var(--ink);
}
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.empty-state {
  grid-column: 1 / -1;
  min-height: 220px;
  border: 1px dashed var(--line);
  background: rgba(255, 255, 255, .68);
  border-radius: 24px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  text-align: center;
  padding: 28px;
}
.empty-state strong {
  font-size: 22px;
}
.empty-state p {
  max-width: 460px;
  margin-bottom: 4px;
}
.gallery-card { overflow: hidden; border-radius: 24px; }
.gallery-thumb {
  min-height: 210px;
  border-radius: 0;
}
.template-thumb {
  background: #f7efe4;
}
.template-thumb::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(180deg, transparent 52%, rgba(0, 0, 0, .42)),
    linear-gradient(90deg, rgba(0, 0, 0, .12), transparent 42%);
  pointer-events: none;
}
.template-sample-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: scale(1.01);
  transition: transform .28s ease;
}
.template-thumb:hover .template-sample-image {
  transform: scale(1.045);
}
.gallery-thumb strong, .gallery-thumb span { display: block; }
.gallery-body { padding: 16px; }
.gallery-body > span { color: var(--muted); font-size: 13px; }
.gallery-body h3 {
  margin: 8px 0 6px;
  font-size: 18px;
  letter-spacing: -.02em;
}
.gallery-body div:last-child { display: flex; gap: 12px; flex-wrap: wrap; }
.text {
  border: 0;
  background: transparent;
  color: var(--accent);
  padding: 0;
  font-weight: 900;
}
.text.danger { color: var(--red); }

.history-list {
  display: grid;
  gap: 10px;
}
.history-retention-note {
  display: grid;
  grid-template-columns: minmax(220px, .55fr) 1fr;
  gap: 18px;
  align-items: center;
  margin-bottom: 16px;
  padding: 18px 20px;
}
.history-retention-note h2 {
  margin-top: 4px;
  font-size: 20px;
}
.history-retention-note p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}
.history-notice {
  margin: -4px 0 12px;
  color: #8a5200;
  background: #fff6e3;
  border: 1px solid rgba(217, 138, 19, .22);
  border-radius: 14px;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 800;
}
.history-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 104px 110px minmax(220px, auto);
  gap: 14px;
  align-items: center;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .66);
  border-radius: 20px;
  padding: 12px;
}
.history-thumb {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  color: white;
  text-align: center;
  font-size: 12px;
  font-weight: 900;
  overflow: hidden;
  background: linear-gradient(145deg, #ff9b3d, #ffd89f);
}
button.history-thumb {
  border: 0;
  padding: 0;
  cursor: zoom-in;
  font: inherit;
}
.history-thumb.no-image {
  padding: 8px;
  color: var(--ink);
  background: #f4efe6;
  border: 1px solid rgba(80, 60, 30, .12);
}
.history-thumb.no-image span {
  margin: 0;
  color: inherit;
  line-height: 1.25;
}
.history-thumb.green { background: linear-gradient(145deg, #0fae78, #a7e9cf); }
.history-thumb.amber { background: linear-gradient(145deg, #d98a13, #ffd188); }
.history-thumb.gray { background: linear-gradient(145deg, #777, #ddd); }
.history-thumb.red { background: linear-gradient(145deg, #d85b4a, #ffc5ba); }
.history-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.history-thumb-status {
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: 6px;
  min-height: 20px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: white;
  background: rgba(20, 17, 13, .72);
  font-size: 11px;
}
.history-title-line {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.history-row strong,
.history-row span,
.history-row small {
  display: block;
}
.history-row .history-prompt {
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.45;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.history-status-pill {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 900;
  color: #6f4a00;
  background: #fff0ce;
}
.history-status-pill.completed {
  color: #087c58;
  background: #dff8ed;
}
.history-status-pill.queued,
.history-status-pill.processing {
  color: #8a5200;
  background: #fff0ce;
}
.history-status-pill.failed_refunded {
  color: #565656;
  background: #eeeeee;
}
.history-status-pill.blocked {
  color: #8a3d1b;
  background: #ffe3dc;
}
.history-row .history-meta,
.history-row small {
  color: var(--muted);
  margin-top: 5px;
  font-size: 13px;
}
.history-row .history-message {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.history-row .history-credit {
  color: var(--accent);
}
.history-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.history-actions .text:disabled {
  color: var(--muted);
  cursor: not-allowed;
  opacity: .55;
}

.wallet-grid article {
  padding: 20px;
}
.wallet-grid span, .wallet-grid small { display: block; color: var(--muted); }
.wallet-grid strong {
  display: block;
  color: var(--accent);
  font-size: 34px;
  margin: 8px 0;
}
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.account-actions-grid,
.api-reference-grid,
.feedback-layout {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.api-reference-grid,
.feedback-layout { grid-template-columns: 1fr 1fr; }
.account-action {
  min-height: 118px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .66);
  color: var(--ink);
  border-radius: 24px;
  padding: 18px;
  display: grid;
  align-content: start;
  gap: 8px;
  text-align: left;
  box-shadow: var(--shadow);
}
.account-action:hover {
  border-color: rgba(255, 122, 26, .32);
  transform: translateY(-1px);
}
.account-action span {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: var(--accent);
  background: rgba(255, 122, 26, .10);
  font-weight: 900;
}
.account-action strong,
.account-action small { display: block; }
.account-action small { color: var(--muted); }
.account-action.primary-action {
  background: var(--ink);
  color: white;
}
.account-action.primary-action span {
  background: rgba(255,255,255,.14);
  color: white;
}
.account-action.primary-action small { color: rgba(255,255,255,.70); }
.account-detail-grid { margin-top: 4px; }
.account-main-grid,
.api-console-grid,
.billing-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.account-security-card {
  display: grid;
  gap: 12px;
}
.password-form,
.redeem-row {
  display: grid;
  gap: 10px;
}
.password-form input,
.redeem-row input {
  min-height: 46px;
}
.redeem-row {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}
.recharge-record-card .compact-list {
  max-height: 260px;
  overflow: auto;
}
.account-simple-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.danger-light {
  color: var(--red);
  border-color: rgba(216, 91, 74, .22);
}
.api-console-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.api-console-hero h1 {
  font-size: clamp(42px, 5vw, 64px);
  margin-bottom: 0;
}
.api-console-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.api-key-panel {
  margin-bottom: 16px;
}
.compact-api-hero { margin-bottom: 10px; }
.compact-key-panel { padding: 12px 16px; }
.compact-key-panel details { display: grid; gap: 12px; }
.compact-key-panel summary { cursor: pointer; font-weight: 900; color: var(--muted); }
.compact-key-panel .api-key-list { margin-top: 12px; }
.compact-key-panel details:not([open]) .api-key-list {
  display: none;
}

.primary-key-box {
  margin: 8px 0 16px;
  border-color: rgba(255, 122, 26, .24);
  background: var(--accent-soft);
}
.api-key-head code {
  color: var(--muted);
  word-break: break-all;
}
.api-key-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}
.api-key-row.revoked {
  opacity: .72;
}
.api-key-row .secondary {
  min-height: 38px;
  border-radius: 999px;
  padding: 0 14px;
}
.new-key-box {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  border: 1px solid rgba(255, 122, 26, .24);
  background: var(--accent-soft);
  border-radius: 18px;
  padding: 12px;
  margin: 12px 0;
}
.new-key-box span {
  color: var(--accent);
  font-weight: 900;
}
.new-key-box code {
  word-break: break-all;
}
.api-console-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.coding-dashboard-grid {
  margin: 12px 0 16px;
}
.api-status-card strong {
  display: block;
  color: var(--accent);
  font-size: 34px;
  line-height: 1;
  margin: 8px 0 4px;
}
.api-status-card span {
  color: var(--muted);
}
.api-status-card.muted-card {
  display: grid;
  align-content: space-between;
}
.api-status-card small {
  color: var(--muted);
}
.api-docs-hero code {
  color: var(--accent);
}
.coding-key-builder,
.coding-usage-panel,
.coding-client-stats,
.coding-chart-card {
  margin-bottom: 16px;
}
.coding-insight-grid {
  display: grid;
  grid-template-columns: 1.25fr .75fr;
  gap: 16px;
}
.coding-insight-grid.single {
  grid-template-columns: 1fr;
}
.tiny-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.tiny-tabs span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 9px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}
.tiny-tabs span.active {
  color: var(--accent);
  background: var(--accent-soft);
}
.trend-bars {
  min-height: 150px;
  display: flex;
  align-items: end;
  gap: 5px;
  margin-top: 16px;
  overflow-x: auto;
}
.trend-bars span {
  min-width: 20px;
  display: grid;
  grid-template-rows: 1fr auto;
  align-items: end;
  gap: 6px;
  color: var(--muted);
  font-size: 10px;
}
.trend-bars i {
  display: block;
  height: var(--h);
  min-height: 6px;
  border-radius: 999px 999px 4px 4px;
  background: linear-gradient(180deg, var(--accent), #ffd4a5);
}
.model-distribution {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}
.model-distribution div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 52px;
  gap: 6px 10px;
  align-items: center;
}
.model-distribution span,
.model-distribution small {
  color: var(--muted);
}
.model-distribution b {
  grid-column: 1 / -1;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--green) var(--w), rgba(80,60,30,.08) var(--w));
}
.client-stat-table {
  display: grid;
  gap: 8px;
}
.client-stat-head,
.client-stat-row {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) .7fr .9fr .7fr auto;
  gap: 10px;
  align-items: center;
}
.client-stat-head {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  padding: 0 12px;
}
.client-stat-row {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 12px;
  background: rgba(255,255,255,.58);
}
.ghost.small {
  min-height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
}
.coding-key-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.coding-key-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 800;
}
.coding-key-form label.wide {
  grid-column: 1 / -1;
}
.coding-key-form input,
.coding-key-form select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0 12px;
  background: rgba(255,255,255,.8);
  color: var(--ink);
}
.form-hint {
  margin: 12px 0 0;
  color: var(--muted);
}
.usage-stat-table {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0;
}
.coding-usage-filters {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr auto;
  gap: 10px;
  align-items: end;
  margin: 12px 0;
}
.coding-usage-filters label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 800;
}
.coding-usage-filters select {
  min-height: 42px;
  border-radius: 14px;
}
.filter-actions {
  display: flex;
  gap: 8px;
}
.usage-stat-table div {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255,255,255,.58);
  padding: 12px;
}
.usage-stat-table strong,
.usage-stat-table span {
  display: block;
}
.usage-stat-table span {
  margin-top: 5px;
  font-weight: 900;
}
.usage-detail-list {
  display: grid;
  gap: 8px;
}
.usage-detail-list article {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 12px;
  background: rgba(255,255,255,.56);
}
.usage-detail-list span,
.usage-detail-list small,
.empty-state-mini {
  color: var(--muted);
}
.btn-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 14px;
}
.btn-row.compact { margin-top: 12px; }
.feedback-card textarea { min-height: 180px; }
.list {
  display: grid;
  gap: 10px;
}
.list > div {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: white;
  padding: 13px;
}
.list strong, .list span, .list small, .list code {
  display: block;
}
.list span, .list small { color: var(--muted); margin-top: 5px; }
.docs-box {
  display: grid;
  grid-template-columns: .85fr 1.15fr;
  gap: 18px;
  margin-bottom: 18px;
}
.capability-panel {
  margin: 22px 0;
  padding: 20px;
}
.capability-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 12px 0 14px;
}
.capability-summary span {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .62);
  border-radius: 999px;
  padding: 8px 12px;
  color: var(--muted);
  font-size: 13px;
}
.capability-summary strong {
  color: var(--accent);
}
.capability-summary small {
  color: var(--muted);
}
.capability-list {
  display: grid;
  gap: 8px;
}
.capability-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .62);
  border-radius: 16px;
  padding: 12px 14px;
}
.capability-item strong,
.capability-item span,
.capability-item small,
.capability-item b {
  display: block;
}
.capability-item span,
.capability-item small {
  color: var(--muted);
  margin-top: 3px;
  font-size: 12px;
}
.capability-item > div:last-child {
  text-align: right;
}
.capability-item.ready b {
  color: var(--green);
}
.capability-item.partial b {
  color: #b27600;
}
.capability-item.missing b {
  color: var(--red);
}
pre {
  margin: 0;
  white-space: pre-wrap;
  color: #ffe9bd;
  background: #15110c;
  border-radius: 20px;
  padding: 18px;
  line-height: 1.6;
}

@media (min-width: 1560px) {
  .batch-grid { grid-template-columns: repeat(3, minmax(440px, 1fr)); }
  .batch-media-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}

@media (min-width: 1800px) {
  .batch-grid { grid-template-columns: repeat(3, minmax(520px, 1fr)); }
}

@media (min-width: 2100px) {
  .batch-grid { grid-template-columns: repeat(4, minmax(460px, 1fr)); }
}

@media (max-width: 1440px) {
  .workspace {
    grid-template-columns: minmax(470px, .92fr) minmax(520px, 1.08fr);
  }
  .result-art {
    min-height: clamp(420px, 58vh, 720px);
  }
}

@media (max-width: 1320px) {
  .batch-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .batch-global-controls { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .workspace {
    grid-template-columns: minmax(450px, .94fr) minmax(500px, 1.06fr);
  }
  .generate-page { width: min(100% - 10px, 1680px); }
}

@media (max-width: 1120px) {
  .workspace {
    grid-template-columns: minmax(0, 1fr);
  }
  .batch-media-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}

@media (max-width: 1050px) {
  .topbar { grid-template-columns: 1fr; }
  nav { justify-content: flex-start; }
  .top-actions { justify-content: flex-start; }
  .hero, .workspace, .workspace.batch-workspace, .two-col, .docs-box, .capability-item, .account-actions-grid, .api-reference-grid, .feedback-layout, .account-main-grid, .api-console-grid, .billing-detail-grid, .batch-global-panel, .coding-key-form, .coding-insight-grid, .coding-usage-filters, .usage-stat-table, .usage-detail-list article, .client-stat-head, .client-stat-row, .history-retention-note { grid-template-columns: 1fr; }
  .generate-switchbar { grid-template-columns: 1fr; }
  .result-panel { position: static; }
  .model-grid { grid-template-columns: repeat(2, 1fr); }
  .batch-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .batch-media-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .batch-global-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ratio-card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .packs, .wallet-grid, .template-grid, .recent-row, .account-actions-grid { grid-template-columns: repeat(2, 1fr); }
  .modal-page .packs,
  .modal-page .rules,
  .modal-page .wallet-grid,
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .auth-code-row { grid-template-columns: 1fr; }
  .ref-uploader, .history-row { grid-template-columns: 1fr; }
  .api-console-hero { align-items: flex-start; }
  .api-console-actions { justify-content: flex-start; }
  .history-actions { justify-content: flex-start; }
}

@media (max-width: 900px) {
  .batch-grid { grid-template-columns: 1fr; }
  .batch-media-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}

@media (max-width: 760px) {
  .batch-media-row { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  main, .page, .dev-bar { width: min(100% - 22px, 1180px); }
  .topbar { padding: 12px; }
  .dev-bar {
    align-items: stretch;
    gap: 8px;
  }
  .dev-bar label {
    width: 100%;
  }
  .dev-bar input,
  .dev-bar label:nth-of-type(2) input {
    flex: 1;
    width: auto;
  }
  .capability-item > div:last-child {
    text-align: left;
  }
  .modal-layer { padding: 10px; align-items: stretch; }
  .modal-window { max-height: calc(100vh - 20px); border-radius: 22px; }
  .modal-head, .modal-body { padding: 14px; }
  h1 { font-size: 40px; }
  .hero, .panel-head, .section-head, .param-row, .param-row.compact, .model-grid, .template-grid, .recent-row, .packs, .rules, .gallery-grid, .wallet-grid, .two-col, .filters, .batch-grid, .advanced-box, .batch-stats,
  .batch-mini-controls, .batch-global-controls, .batch-media-row, .account-actions-grid, .api-reference-grid, .feedback-layout, .account-main-grid, .api-console-grid, .billing-detail-grid, .coding-key-form, .coding-insight-grid, .coding-usage-filters, .usage-stat-table, .usage-detail-list article, .client-stat-head, .client-stat-row,
  .modal-page .packs, .modal-page .rules, .modal-page .wallet-grid, .redeem-row {
    grid-template-columns: 1fr;
  }
  .api-console-hero { display: grid; }
  .api-console-actions, .account-simple-actions, .batch-toolbar.compact-toolbar { justify-content: stretch; }
  .api-console-actions button, .account-simple-actions button, .batch-toolbar.compact-toolbar button { flex: 1; }
  .new-key-box { grid-template-columns: 1fr; }
  .api-key-row { grid-template-columns: 1fr; }
  .upload-head { align-items: center; }
  .ref-slots { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ratio-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pill-grid { grid-template-columns: repeat(2, 1fr); }
  .mode-tabs { width: 100%; }
  .mode-tabs button { flex: 1; padding: 10px; }
  .compact-hero h1 { font-size: 46px; }
  .compose-actions, .estimate-actions { grid-template-columns: 1fr; display: grid; }
  .compose-actions .primary { width: 100%; }
  .single-estimate-line { grid-template-columns: 1fr; width: 100%; }
  .batch-card-actions { grid-template-columns: 1fr; }
  .batch-result-actions { justify-content: stretch; }
  .batch-result-actions .secondary { flex: 1; }
  .history-title-line { flex-direction: column; gap: 6px; }
  .image-preview-window { max-height: calc(100vh - 20px); border-radius: 18px; }
  .image-preview-head,
  .image-preview-foot { align-items: stretch; flex-direction: column; }
  .image-preview-foot .secondary { width: 100%; }
}

.ref-file-input {
  position: fixed;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.icon-only-upload {
  min-width: 74px;
  grid-template-columns: 1fr;
  background: rgba(255, 255, 255, .72);
}
.icon-only-upload svg {
  width: 34px;
  height: 34px;
}
.icon-only-upload:hover,
.ref-empty:hover {
  border-color: rgba(255, 122, 26, .45);
  background: rgba(255, 245, 229, .86);
}
.ref-uploader {
  grid-template-columns: 74px minmax(0, 1fr);
}
.ref-thumb.has-image {
  padding: 0;
  background: #f8f1e6;
  overflow: hidden;
}
.ref-thumb.has-image img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ref-thumb.has-image::after {
  content: '';
  position: absolute;
  inset: auto 0 0;
  height: 52%;
  background: linear-gradient(to top, rgba(25, 20, 13, .58), rgba(25, 20, 13, 0));
  pointer-events: none;
}
.ref-thumb.has-image span,
.ref-thumb.has-image small {
  position: absolute;
  left: 9px;
  right: 9px;
  z-index: 1;
  color: white;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ref-thumb.has-image span { bottom: 23px; }
.ref-thumb.has-image small {
  bottom: 8px;
  font-size: 11px;
  opacity: .86;
}
.ref-thumb.has-image button { z-index: 2; }
.result-art.with-inspiration {
  align-content: start;
  place-items: stretch;
  gap: 12px;
  padding: 14px;
  text-align: left;
}
.inspiration-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}
.inspiration-head strong { color: var(--ink); }
.inspiration-head small { color: var(--muted); }
.inspiration-list {
  display: grid;
  gap: 10px;
}
.inspiration-card {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(80, 60, 30, .10);
  background: rgba(255, 255, 255, .72);
  border-radius: 18px;
  padding: 8px;
  color: var(--ink);
  text-align: left;
}
.inspiration-card:hover {
  border-color: rgba(255, 122, 26, .34);
  transform: translateY(-1px);
}
.inspiration-card span {
  font-size: 13px;
  font-weight: 900;
  color: var(--ink);
}
.result-inspiration-image {
  width: 68px;
  height: 54px;
  border-radius: 14px;
  object-fit: cover;
  display: block;
  box-shadow: inset 0 0 0 1px rgba(80, 60, 30, .10);
}
.template-thumb {
  width: 100%;
  border: 0;
  min-height: 218px;
  position: relative;
  cursor: pointer;
}
.template-thumb span {
  position: absolute;
  left: 14px;
  bottom: 12px;
  z-index: 2;
  color: white;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .06em;
}
.template-art {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  min-height: 76px;
  border-radius: inherit;
  overflow: hidden;
}
.inspiration-card .template-art {
  width: 68px;
  height: 54px;
  min-height: 54px;
  border-radius: 14px;
}
.template-art::before,
.template-art::after {
  content: '';
  position: absolute;
  border-radius: 999px;
}
.template-art.studio { background: linear-gradient(145deg, #f8f2e7, #ffffff); }
.template-art.studio::before { width: 58%; height: 42%; left: 21%; top: 30%; background: linear-gradient(145deg, #e7ddd0, #b9d9ca); border-radius: 22px; box-shadow: 0 18px 28px rgba(76, 54, 28, .14); }
.template-art.studio::after { width: 70%; height: 14%; left: 15%; bottom: 19%; background: rgba(80, 60, 30, .10); filter: blur(12px); }
.template-art.photo { background: linear-gradient(135deg, #ffe0b7, #fff9ef 52%, #d8efe2); }
.template-art.photo::before { width: 64%; height: 44%; left: 19%; bottom: 22%; background: #d78b4d; border-radius: 18px; box-shadow: 24px -18px 0 rgba(255,255,255,.52); }
.template-art.photo::after { width: 34%; height: 34%; right: 14%; top: 15%; background: rgba(15, 174, 120, .32); }
.template-art.poster { background: radial-gradient(circle at 32% 24%, #fff, transparent 22%), linear-gradient(145deg, #ffd7a1, #fff4d8, #e4fff2); }
.template-art.poster::before { width: 58%; height: 58%; right: 14%; top: 19%; background: rgba(255, 122, 26, .45); filter: blur(4px); }
.template-art.poster::after { width: 52%; height: 8%; left: 18%; bottom: 19%; background: rgba(25, 20, 13, .20); border-radius: 8px; }
.template-art.launch { background: linear-gradient(145deg, #3b342d, #f5eadf); }
.template-art.launch::before { width: 34%; height: 58%; left: 33%; top: 22%; background: linear-gradient(145deg, #f6b15d, #fff1cf); border-radius: 24px; box-shadow: 0 0 44px rgba(255, 184, 95, .42); }
.template-art.launch::after { width: 72%; height: 1px; left: 14%; bottom: 22%; background: rgba(255,255,255,.62); }
.template-art.figure { background: linear-gradient(145deg, #ffe2a6, #fff8ea); }
.template-art.figure::before { width: 38%; height: 52%; left: 31%; top: 18%; background: #f2a73d; border-radius: 50% 50% 38% 38%; box-shadow: 0 42px 0 -20px rgba(91, 57, 22, .35); }
.template-art.figure::after { width: 62%; height: 28%; left: 19%; bottom: 12%; background: rgba(255,255,255,.78); border-radius: 20px; }
.template-art.series { background: linear-gradient(145deg, #fff1cd, #f7fff9); }
.template-art.series::before { width: 24%; height: 42%; left: 18%; bottom: 25%; background: #f4a23a; box-shadow: 42px 4px 0 #0fae78, 84px -3px 0 #d98a13; border-radius: 20px; }
.template-art.series::after { width: 78%; height: 14%; left: 11%; bottom: 16%; background: rgba(80,60,30,.10); }
.template-art.avatar { background: radial-gradient(circle at 50% 34%, #ffe2c5 0 18%, transparent 19%), linear-gradient(145deg, #dff6eb, #fffdf8); }
.template-art.avatar::before { width: 48%; height: 48%; left: 26%; top: 22%; background: rgba(15,174,120,.34); border-radius: 50%; }
.template-art.avatar::after { width: 60%; height: 38%; left: 20%; bottom: 7%; background: rgba(255,255,255,.72); }
.template-art.portrait { background: linear-gradient(145deg, #efe7dd, #fff, #d7d0c7); }
.template-art.portrait::before { width: 34%; height: 66%; left: 34%; bottom: 12%; background: linear-gradient(#f0c39f 0 28%, #2f2c29 29%); border-radius: 48% 48% 22px 22px; }
.template-art.portrait::after { width: 30%; height: 72%; right: 10%; top: 0; background: rgba(255,255,255,.52); border-radius: 0; }
.template-art.brand { background: linear-gradient(135deg, #e7fff1, #ffffff 42%, #f4dfbd); }
.template-art.brand::before { width: 58%; height: 58%; right: -4%; top: 12%; background: rgba(15,174,120,.24); filter: blur(5px); }
.template-art.brand::after { width: 46%; height: 12%; left: 14%; bottom: 22%; background: rgba(25,20,13,.16); border-radius: 10px; }
.template-art.cover { background: linear-gradient(145deg, #ffc66f, #fff3df); }
.template-art.cover::before { width: 48%; height: 48%; left: 15%; top: 20%; background: rgba(255,255,255,.68); border-radius: 18px; }
.template-art.cover::after { width: 58%; height: 10%; right: 12%; bottom: 24%; background: rgba(25,20,13,.18); border-radius: 10px; box-shadow: 0 18px 0 rgba(25,20,13,.10); }
.template-art.infographic { background: linear-gradient(145deg, #fff7e9, #eaf9f1); }
.template-art.infographic::before { width: 26%; height: 26%; left: 14%; top: 18%; background: #ffb35f; box-shadow: 54px 0 0 #0fae78, 108px 0 0 #ffd188; border-radius: 14px; }
.template-art.infographic::after { width: 76%; height: 8%; left: 12%; bottom: 22%; background: rgba(80,60,30,.14); border-radius: 8px; box-shadow: 0 -18px 0 rgba(80,60,30,.10); }
.template-art.interior { background: linear-gradient(145deg, #f6efe4, #ffffff); }
.template-art.interior::before { width: 72%; height: 42%; left: 14%; bottom: 18%; background: #d9c1a5; border-radius: 18px; box-shadow: 0 -40px 0 -26px rgba(15,174,120,.38); }
.template-art.interior::after { width: 24%; height: 64%; right: 14%; top: 0; background: rgba(255, 207, 134, .30); border-radius: 0; }
.tag-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 10px 0 14px;
}
.tag-row em {
  font-style: normal;
  color: var(--muted);
  background: rgba(80, 60, 30, .06);
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 800;
}
.template-card-full .gallery-body p {
  max-height: 72px;
  overflow: hidden;
}
.user-icon {
  width: 40px;
  height: 40px;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
  display: grid;
  place-items: center;
  color: var(--ink);
  padding: 0;
  flex: 0 0 auto;
  box-shadow: 0 8px 22px rgba(25, 20, 13, .05);
}
.user-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.user-icon:hover {
  color: var(--accent);
  border-color: rgba(255, 122, 26, .34);
}
.user-icon.active {
  color: var(--accent);
  border-color: rgba(255, 122, 26, .40);
  background: var(--accent-soft);
}


@media (max-width: 520px) {
  .batch-grid { grid-template-columns: 1fr; }
  .batch-ref-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .batch-add-tile { min-height: 180px; }
  .redeem-row { grid-template-columns: 1fr; }
}

.api-key-builder-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  align-items: center;
  margin-top: 14px;
}
.api-key-summary-grid {
  margin-bottom: 16px;
}
.api-usage-page .coding-usage-panel {
  margin-top: 16px;
}
.usage-detail-list-rich article {
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1.25fr);
}
@media (max-width: 720px) {
  .api-key-builder-actions { justify-content: stretch; }
  .api-key-builder-actions button { flex: 1; }
}
.pricing-note-grid {
  display: grid;
  grid-template-columns: minmax(220px, .7fr) minmax(0, 1.3fr);
  gap: 16px;
  align-items: center;
}
.pricing-note-grid strong {
  color: var(--accent);
}
.pricing-table td strong,
.pricing-table td small {
  display: block;
}
.pricing-table td strong {
  color: var(--ink);
}
.pricing-table td small {
  margin-top: 5px;
  font-weight: 700;
  line-height: 1.35;
}
.image-pricing-table {
  min-width: 980px;
}
.coding-pricing-table {
  min-width: 900px;
}
.image-pricing-table td:nth-child(n+5),
.image-pricing-table th:nth-child(n+5),
.coding-pricing-table td:nth-child(4),
.coding-pricing-table th:nth-child(4),
.coding-pricing-table td:nth-child(5),
.coding-pricing-table th:nth-child(5) {
  text-align: center;
}
.image-pricing-table td:nth-child(n+5) strong,
.coding-pricing-table td:nth-child(4) strong,
.coding-pricing-table td:nth-child(5) strong {
  color: var(--accent);
}
.pricing-page td:first-child strong {
  white-space: nowrap;
}

.ops-page {
  display: grid;
  gap: 16px;
  color: var(--ink);
}
.ops-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: end;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.ops-toolbar h1 {
  margin: 4px 0 6px;
  font-size: clamp(28px, 4vw, 44px);
  letter-spacing: 0;
}
.ops-toolbar p,
.ops-section p,
.ops-route-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}
.ops-actions {
  display: flex;
  align-items: end;
  gap: 10px;
  flex-wrap: wrap;
}
.ops-actions label,
.ops-request-search {
  display: grid;
  gap: 6px;
}
.ops-actions label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}
.ops-access-panel {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(360px, 1.1fr);
  gap: 18px;
  align-items: end;
  border: 1px solid var(--line);
  background: linear-gradient(135deg, rgba(255,255,255,.82), rgba(255,246,232,.74));
  border-radius: 24px;
  padding: 16px;
}
.ops-access-panel.is-authenticated {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  background: rgba(239, 251, 246, .78);
  border-color: rgba(16,168,120,.18);
}
.ops-access-panel h2 {
  margin: 4px 0 6px;
  letter-spacing: 0;
}
.ops-access-panel small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.45;
}
.ops-login-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
}
.ops-login-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}
.ops-login-form input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,.84);
  color: var(--ink);
  padding: 0 12px;
  font: inherit;
}
.ops-summary-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}
.ops-verification-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.ops-overview-grid,
.ops-sync-plan {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}
.ops-sync-plan {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.ops-summary-grid article {
  border: 1px solid var(--line);
  background: rgba(255,255,255,.66);
  border-radius: 20px;
  padding: 14px;
}
.ops-overview-grid article,
.ops-sync-plan div,
.ops-verification-grid article {
  border: 1px solid rgba(80,60,30,.12);
  background: rgba(255,255,255,.70);
  border-radius: 16px;
  padding: 13px;
}
.ops-summary-grid span,
.ops-overview-grid span,
.ops-sync-plan span,
.ops-verification-grid span,
.ops-summary-grid small,
.ops-overview-grid small,
.ops-sync-plan small,
.ops-verification-grid small,
.ops-margin-row span,
.ops-route-card span,
.ops-route-card small {
  color: var(--muted);
}
.ops-summary-grid strong,
.ops-overview-grid strong,
.ops-sync-plan strong,
.ops-verification-grid strong {
  display: block;
  margin: 7px 0 3px;
  color: var(--accent);
  font-size: 25px;
  letter-spacing: 0;
}
.ops-sync-plan strong {
  color: var(--ink);
}
.ops-section {
  border: 1px solid var(--line);
  background: rgba(255,255,255,.62);
  border-radius: 24px;
  padding: 16px;
}
.ops-focus-section {
  display: grid;
  gap: 14px;
}
.ops-utility-section {
  background: rgba(255,255,255,.54);
}
.ops-subsection-stack {
  display: grid;
  gap: 14px;
}
.ops-subsection {
  display: grid;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid rgba(80,60,30,.10);
}
.ops-subsection:first-child {
  padding-top: 0;
  border-top: 0;
}
.ops-subsection-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: end;
}
.ops-subsection-head h3 {
  margin: 0 0 3px;
  font-size: 18px;
  letter-spacing: 0;
}
.ops-subsection-head p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}
.ops-subsection-head > span {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(255,255,255,.76);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}
.ops-table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: white;
}
.ops-table {
  min-width: 1040px;
}
.ops-table th {
  background: #fff6e8;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.ops-table td strong,
.ops-table td small {
  display: block;
}
.ops-table td small {
  margin-top: 5px;
  color: var(--muted);
  line-height: 1.4;
}
.ops-table tr.ops-muted-row td {
  background: rgba(255,255,255,.42);
  color: rgba(61,48,36,.72);
}
.ops-table tr.ops-muted-row td:first-child {
  border-left: 3px solid rgba(137,122,105,.25);
}
.ops-table tr.ops-muted-row strong {
  color: rgba(61,48,36,.78);
}
.ops-row-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  min-width: 132px;
}
.ops-row-actions.single {
  grid-template-columns: minmax(0, 1fr);
}
.ops-row-actions .tiny {
  min-height: 30px;
  padding: 0 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.78);
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}
.ops-row-actions .tiny:hover {
  border-color: rgba(16, 168, 120, .45);
  background: var(--green-soft);
}
.ops-row-actions .tiny.danger:hover {
  border-color: rgba(220, 68, 45, .45);
  background: #fff0ec;
  color: var(--red);
}
.ops-row-actions .tiny:disabled {
  opacity: .55;
  cursor: wait;
}
.health-badge,
.margin-badge,
.verification-badge,
.level-badge,
.ops-link-status,
.ops-detection-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 900;
  border: 1px solid transparent;
}
.health-badge.healthy,
.margin-badge.safe,
.verification-badge.passed,
.level-badge.matched,
.ops-link-status.primary,
.ops-link-status.enabled,
.ops-detection-badge.matched,
.ops-detection-badge.passed {
  color: #087c58;
  background: var(--green-soft);
  border-color: rgba(16,168,120,.18);
}
.health-badge.degraded,
.health-badge.unknown,
.margin-badge.unknown,
.verification-badge.attention,
.verification-badge.mixed,
.verification-badge.skipped,
.verification-badge.unknown,
.level-badge.pending,
.level-badge.attention,
.ops-link-status.pending,
.ops-link-status.quality_attention,
.ops-detection-badge.pending,
.ops-detection-badge.attention,
.ops-detection-badge.mixed {
  color: #9a5a00;
  background: #fff6df;
  border-color: rgba(255,122,26,.18);
}
.health-badge.down,
.health-badge.disabled,
.margin-badge.thin,
.verification-badge.failed,
.verification-badge.blocked,
.level-badge.mismatch,
.level-badge.blocked,
.ops-link-status.quality_failed,
.ops-link-status.connection_issue,
.ops-link-status.balance_issue,
.ops-link-status.config_issue,
.ops-link-status.cost_issue,
.ops-link-status.disabled,
.ops-detection-badge.failed,
.ops-detection-badge.blocked {
  color: var(--red);
  background: #fff0ec;
  border-color: rgba(216,91,74,.18);
}
.health-badge.draining,
.ops-link-status.draining {
  color: #7a4a00;
  background: #fff1cf;
  border-color: rgba(194, 124, 0, .22);
}
.ops-model-table {
  min-width: 1180px;
}
.ops-model-dimension-table {
  min-width: 1280px;
}
.ops-model-table td:first-child strong {
  color: var(--accent);
}
.ops-health-note {
  color: var(--muted);
  line-height: 1.45;
  padding: 10px 13px;
  border: 1px solid rgba(80,60,30,.10);
  border-radius: 14px;
  background: rgba(255,255,255,.62);
}
.ops-model-summary-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.ops-model-summary-card {
  display: grid;
  gap: 13px;
  padding: 15px;
  border: 1px solid rgba(80,60,30,.12);
  border-radius: 20px;
  background: rgba(255,255,255,.68);
}
.ops-model-summary-card.is-priority {
  border-color: rgba(255, 96, 0, .36);
  box-shadow: 0 16px 34px rgba(255, 96, 0, .10);
  background: linear-gradient(135deg, rgba(255,255,255,.92), rgba(255,245,232,.82));
}
.ops-model-summary-card.is-muted {
  opacity: .72;
}
.ops-model-summary-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}
.ops-model-summary-head h3 {
  margin: 4px 0 2px;
  font-size: 22px;
  letter-spacing: 0;
}
.ops-model-summary-head p,
.ops-model-summary-footer,
.ops-model-summary-footer small {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}
.ops-model-summary-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}
.ops-model-summary-metrics div {
  border-top: 1px solid rgba(80,60,30,.10);
  padding-top: 10px;
}
.ops-model-summary-metrics span,
.ops-model-summary-metrics small,
.ops-model-summary-footer span {
  display: block;
  color: var(--muted);
}
.ops-model-summary-metrics strong {
  display: block;
  margin: 4px 0 3px;
  color: var(--accent);
}
.ops-matrix-table {
  min-width: 1660px;
}
.ops-balance-table {
  min-width: 1380px;
}
.ops-verification-table {
  min-width: 1380px;
}
.ops-priority-list {
  display: grid;
  gap: 9px;
}
.ops-priority-list > div {
  display: grid;
  grid-template-columns: minmax(220px, .8fr) minmax(0, 1.2fr) minmax(220px, .8fr);
  gap: 12px;
  align-items: center;
  border: 1px solid rgba(80,60,30,.10);
  border-radius: 14px;
  background: rgba(255,255,255,.66);
  padding: 11px;
}
.ops-priority-list strong,
.ops-priority-list span,
.ops-priority-list small {
  display: block;
}
.ops-priority-list small,
.ops-empty-note {
  color: var(--muted);
}
.ops-provider-chip,
.ops-failure-line {
  display: grid;
  gap: 2px;
  padding: 7px 0;
  border-top: 1px solid rgba(80,60,30,.08);
}
.ops-provider-chip:first-child,
.ops-failure-line:first-child {
  border-top: 0;
  padding-top: 0;
}
.ops-provider-chip span,
.ops-failure-line small {
  color: var(--muted);
  line-height: 1.35;
}
.ops-grid-two {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, .85fr);
  gap: 16px;
}
.ops-route-card {
  display: grid;
  gap: 10px;
  padding: 14px 0;
  border-top: 1px solid rgba(80,60,30,.10);
}
.ops-route-card:first-of-type {
  border-top: 0;
}
.ops-price-line,
.route-chain {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.ops-price-line span {
  border: 1px solid var(--line);
  background: rgba(255,255,255,.72);
  border-radius: 999px;
  padding: 7px 10px;
  font-weight: 800;
}
.route-chain span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border-radius: 14px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.70);
  font-weight: 900;
}
.route-chain span b {
  width: 20px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: var(--ink);
  color: white;
  font-size: 11px;
}
.route-chain span.safe {
  border-color: rgba(16,168,120,.24);
}
.route-chain span.backup {
  border-color: rgba(255,122,26,.24);
}
.route-chain span small {
  color: var(--accent);
  font-weight: 900;
}
.ops-margin-list {
  display: grid;
  gap: 8px;
}
.ops-margin-row {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) .55fr .65fr .75fr .65fr auto;
  align-items: center;
  gap: 10px;
  padding: 11px;
  border: 1px solid rgba(80,60,30,.10);
  border-radius: 16px;
  background: rgba(255,255,255,.64);
}
.ops-margin-row strong,
.ops-margin-row span {
  display: block;
}
.ops-request-search {
  grid-template-columns: minmax(0, 1fr) auto;
  margin: 12px 0;
}
.ops-request-detail {
  display: grid;
  gap: 12px;
}
.ops-request-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.64);
  border-radius: 18px;
  padding: 12px;
}
.ops-request-head span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}
.request-timeline {
  display: grid;
  gap: 8px;
}
.request-timeline > div {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.2fr);
  gap: 10px;
  align-items: center;
  border: 1px solid rgba(80,60,30,.10);
  border-radius: 16px;
  background: rgba(255,255,255,.66);
  padding: 10px;
}
.request-timeline b {
  width: 26px;
  height: 26px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: var(--ink);
  color: white;
}
.request-timeline .success {
  border-color: rgba(16,168,120,.22);
}
.request-timeline .failed {
  border-color: rgba(216,91,74,.22);
}
.request-timeline span,
.request-timeline small,
.ops-explain-list {
  color: var(--muted);
}
.ops-explain-list {
  margin: 0;
  padding-left: 18px;
  line-height: 1.65;
}

@media (max-width: 1100px) {
  .ops-toolbar,
  .ops-workspace,
  .ops-grid-two,
  .ops-model-summary-list,
  .ops-model-summary-metrics,
  .ops-access-panel,
  .ops-login-form,
  .ops-subsection-head,
  .ops-summary-grid,
  .ops-overview-grid,
  .ops-sync-plan,
  .ops-verification-grid,
  .ops-margin-row,
  .ops-priority-list > div,
  .request-timeline > div {
    grid-template-columns: 1fr;
  }
  .ops-sidebar {
    position: static;
  }
  .ops-actions,
  .ops-request-head {
    align-items: stretch;
  }
}

@media (max-width: 760px) {
  .ops-topbar {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px;
  }
  .ops-brand .brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 12px;
    font-size: 13px;
  }
  .ops-brand > span:not(.brand-mark) {
    display: none;
  }
  .ops-secure-note {
    display: none;
  }
  .ops-workspace {
    width: min(1900px, calc(100% - 16px));
  }
  .ops-top-nav button {
    padding: 0 10px;
    min-height: 34px;
  }
}

