#library-link { color: #2563eb; font-weight: 750; }
#library-link.post-download-highlight {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
  animation: post-download-library-glow 700ms ease-in-out 3;
}
@keyframes post-download-library-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0); }
  50% { box-shadow: 0 0 0 8px rgba(37, 99, 235, 0.35); }
}
@media (prefers-reduced-motion: reduce) {
  #library-link.post-download-highlight { animation: none; }
}
.admin-user-identity-cell .admin-active-days{display:inline-block;color:#64748b;font-size:12px;margin-left:6px}
.admin-user-identity-cell .admin-active-days[data-returning="true"]{color:#087c5a;font-weight:750;background:#e6f5ed;padding:1px 5px;border-radius:4px}
.admin-identity-line{display:flex;align-items:center;min-width:0;max-width:100%}
.admin-identity-line .admin-user-identity-button{min-width:0;overflow:hidden;text-overflow:ellipsis}
.admin-identity-line .admin-active-days{flex-shrink:0}
#library-announcement { width: min(520px, calc(100% - 32px)); max-height: 85vh; padding: 26px; border: 1px solid #dce2e9; border-radius: 8px; color: #17202d; background: white; }
#library-announcement::backdrop { background: #11182770; }
#library-announcement h2 { font-size: 22px; margin: 0 0 16px; }
#library-announcement p { line-height: 1.7; margin: 12px 0; }
#library-announcement label { display: flex; align-items: center; gap: 8px; margin-top: 20px; }
#library-announcement .modal-footer { flex-wrap: wrap; }
#library-announcement-error { color: #b4232d; }
:root {
  color-scheme: light;
  --bg: #f8fafc;
  --panel: #ffffff;
  --panel-muted: #f1f5f9;
  --text: #111827;
  --muted: #64748b;
  --subtle: #94a3b8;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --accent: #2563eb;
  --accent-dark: #1d4ed8;
  --accent-soft: #eff6ff;
  --accent-line: #bfdbfe;
  --done: #047857;
  --done-bg: #ecfdf5;
  --warning: #a16207;
  --warning-bg: #fffbeb;
  --danger: #b91c1c;
  --danger-bg: #fef2f2;
  --shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
  font-family: "Pretendard", "Apple SD Gothic Neo", "Noto Sans KR", "Segoe UI", "Malgun Gothic", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-kerning: normal;
  text-rendering: optimizeLegibility;
}

body.is-submitting,
body.is-submitting * {
  cursor: progress !important;
}

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

button {
  letter-spacing: 0;
}

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

.app-shell {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 24px 0 40px;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 8px 0 20px;
}

html[data-page="admin"] .app-shell {
  width: calc(100% - 48px);
}

html[data-page="admin"] .app-shell > :not(.app-header):not(.admin-page),
html[data-page="admin"] #signup-bonus-badge,
html[data-page="admin"] #topup-button,
html[data-page="admin"] #history-button,
html[data-page="admin"] #admin-dashboard-button,
html[data-page="admin"] #admin-mail-button {
  display: none !important;
}

.admin-page,
.admin-dashboard-content {
  display: grid;
  min-width: 0;
  gap: 16px;
}

.admin-page-heading,
.admin-page-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.admin-page-heading {
  padding: 20px 0 8px;
  border-top: 1px solid var(--line);
}

.admin-page-heading h2 {
  margin: 0;
  font-size: 24px;
}

.admin-page-actions a {
  text-decoration: none;
}

.admin-page-access {
  padding: 24px 0;
  color: var(--muted);
}

.admin-page .admin-dashboard-section {
  min-width: 0;
  border: 0;
  border-top: 1px solid var(--line-strong);
  border-radius: 0;
  background: transparent;
}

.admin-page .admin-panel-body {
  min-width: 0;
  padding: 16px 0;
}

.admin-page .admin-dashboard-section-summary {
  padding: 18px 0;
}

.admin-page .admin-user-table-wrap {
  max-height: none;
  overflow-x: auto;
  overflow-y: visible;
}

.admin-page .admin-generated-rendered,
.admin-page .admin-user-job-output,
.admin-page .admin-markdown-block {
  max-height: none;
  overflow: visible;
}

.admin-page .admin-user-table th:first-child,
.admin-page .admin-user-table td:first-child {
  position: sticky;
  left: 0;
  width: 20ch;
  min-width: 20ch;
  max-width: 20ch;
  white-space: nowrap;
  background: #fff;
  z-index: 1;
}

.admin-page .admin-user-table th:first-child {
  z-index: 2;
  background: #f8fafc;
}

.admin-page .admin-user-table tr:hover td:first-child,
.admin-page .admin-user-table tr.is-selected td:first-child {
  background: #eff6ff;
}

@media (max-width: 680px) {
  html[data-page="admin"] .app-shell {
    width: calc(100% - 24px);
  }

  .admin-page-heading h2 {
    font-size: 22px;
  }

  .admin-page-actions {
    width: 100%;
    justify-content: flex-start;
  }

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

.brand-block {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 220px;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--accent-line);
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 18px;
  font-weight: 600;
}

.brand-eyebrow,
.hero-kicker,
.step-copy,
.help-text,
.point-estimate,
.status-label {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.brand-eyebrow {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  letter-spacing: 0;
}

h1,
h2,
h3 {
  margin: 0;
  word-break: keep-all;
}

h1 {
  font-size: 24px;
  font-weight: 600;
}

h2 {
  font-size: 22px;
  font-weight: 600;
}

h3 {
  font-size: 15px;
  font-weight: 600;
}

.account-panel {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  min-width: 0;
}

.account-summary {
  max-width: 360px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  text-align: right;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.account-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.signup-bonus-badge {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  align-items: center;
  min-height: 36px;
  padding: 7px 12px;
  border: 1px solid #fde68a;
  border-radius: 999px;
  background: #fffbeb;
  color: #92400e;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.15;
  white-space: nowrap;
}

.signup-bonus-badge small { font-size: 11px; }

.signup-bonus-badge[hidden] {
  display: none !important;
}

.signup-bonus-notice {
  margin: 10px 0 0;
  padding: 12px 15px;
  border: 1px solid #fcd34d;
  border-left: 4px solid #d97706;
  border-radius: 10px;
  background: #fffbeb;
  color: #78350f;
  font-size: 14px;
  line-height: 1.55;
}

.signup-bonus-notice[hidden] { display: none; }

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  line-height: 1.15;
  text-decoration: none;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.primary-button {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #ffffff;
}

.primary-button:hover:not(:disabled) {
  border-color: var(--accent-dark);
  background: var(--accent-dark);
  transform: translateY(-1px);
}

.secondary-button {
  border: 1px solid var(--line-strong);
  background: #ffffff;
  color: var(--text);
}

.secondary-button:hover:not(:disabled) {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.primary-button:disabled,
.secondary-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

.stacked-button {
  display: inline-grid;
  place-items: center;
  min-width: 54px;
  padding: 6px 12px;
  line-height: 1.05;
}

.hero-section {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(300px, 0.7fr);
  gap: 24px;
  align-items: end;
  padding: 28px 0 30px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.hero-copy {
  display: grid;
  gap: 14px;
}

.hero-kicker {
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
}

.hero-copy h2 {
  max-width: 680px;
  color: #1f2937;
  font-family: "Pretendard", "Apple SD Gothic Neo", "Noto Sans KR", "Segoe UI", "Malgun Gothic", system-ui, sans-serif;
  font-size: clamp(34px, 4.1vw, 56px);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: 0;
  text-wrap: balance;
}

.hero-description {
  max-width: 660px;
  margin: 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.65;
  word-break: keep-all;
  text-wrap: pretty;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
}

.hero-primary,
.hero-secondary {
  min-height: 50px;
  padding: 0 20px;
}

.hero-status-card {
  display: grid;
  gap: 8px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.status-label {
  font-size: 13px;
  font-weight: 600;
}

.status {
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-muted);
  color: var(--muted);
  line-height: 1.55;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.status[data-state="busy"] {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--warning);
  border-color: #fde68a;
  background: var(--warning-bg);
}

.status[data-state="busy"]::before {
  content: "";
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  border: 2px solid #facc15;
  border-top-color: transparent;
  border-radius: 999px;
  animation: spin 0.8s linear infinite;
}

.status[data-state="done"],
.status[data-state="ready"] {
  color: var(--done);
  border-color: #a7f3d0;
  background: var(--done-bg);
}

.status[data-state="error"] {
  color: var(--danger);
  border-color: #fecaca;
  background: var(--danger-bg);
}

.workflow-section {
  display: grid;
  gap: 18px;
  padding-top: 24px;
}

.workflow-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(360px, 0.96fr);
  gap: 18px;
  align-items: start;
}

.step-card {
  display: grid;
  gap: 18px;
  min-width: 0;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.step-heading {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.step-heading > div {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  height: 30px;
  padding: 0 10px;
  border: 1px solid var(--accent-line);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
}

.upload-step {
  min-height: 620px;
}

.drop-zone {
  display: grid;
  place-items: center;
  gap: 7px;
  min-height: 158px;
  padding: 18px;
  border: 1.5px dashed var(--line-strong);
  border-radius: 8px;
  background: #fbfdff;
  cursor: pointer;
  text-align: center;
}

.drop-zone input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

.drop-zone.is-dragover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.drop-icon {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--accent);
  color: #ffffff;
  font-size: 26px;
  font-weight: 600;
  line-height: 1;
}

.drop-title {
  color: var(--text);
  font-size: 17px;
  font-weight: 600;
}

.file-name {
  max-width: 100%;
  color: var(--muted);
  font-size: 14px;
  overflow-wrap: anywhere;
}

.preview-frame {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 330px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  overflow: hidden;
}

.preview-frame img {
  max-width: 100%;
  max-height: 540px;
  object-fit: contain;
}

.preview-frame img:not([hidden]) + .preview-placeholder {
  display: none;
}

.preview-placeholder {
  display: grid;
  gap: 6px;
  color: var(--subtle);
  text-align: center;
}

.preview-placeholder strong {
  color: var(--muted);
  font-size: 18px;
}

.option-step {
  position: sticky;
  top: 18px;
}

.option-group {
  display: grid;
  gap: 10px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.prompt-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.restored-request-indicator {
  color: var(--done);
  font-size: 12px;
  font-weight: 600;
}

.option-help {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.hwpx-download-options {
  display: grid;
  gap: 9px;
}

.hwpx-download-options label {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  cursor: pointer;
}

.hwpx-download-options label:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.preference-status {
  color: var(--danger);
}

.choice-cards,
.segmented {
  display: grid;
  gap: 10px;
}

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

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

.choice-cards label,
.segmented label,
.topup-product {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  cursor: pointer;
}

.choice-cards label:has(input:checked),
.segmented label:has(input:checked),
.topup-product:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.choice-cards span {
  display: grid;
  gap: 2px;
}

.choice-cards small {
  color: var(--muted);
  font-size: 12px;
}

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

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

.variation-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  align-content: start;
  min-height: 112px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

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

.check-label {
  font-weight: 600;
}

.difficulty-control {
  display: grid;
  gap: 6px;
}

.difficulty-label {
  color: var(--muted);
  font-size: 13px;
}

select,
textarea,
.form-field input,
.admin-topup-controls input {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
}

select {
  min-height: 40px;
  padding: 0 10px;
}

textarea {
  resize: vertical;
  min-height: 146px;
  padding: 12px;
  line-height: 1.6;
}

.submit-area {
  display: grid;
  gap: 10px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.point-estimate {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.55;
  white-space: pre-line;
}

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

.submit-button.is-login-cta {
  background: #111827;
}

.result-step {
  gap: 14px;
}

.result-heading {
  align-items: center;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.completion-notice {
  margin-top: 12px;
  padding: 12px 16px;
  border-left: 3px solid var(--warning);
  color: var(--warning);
  background: var(--warning-bg);
  line-height: 1.6;
}

.download-status,
.token-status,
.profile-status,
.contact-status,
.topup-status,
.history-status {
  min-height: 22px;
  color: var(--muted);
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.download-status[data-state="done"],
.token-status[data-state="done"],
.profile-status[data-state="done"],
.contact-status[data-state="done"],
.topup-status[data-state="done"],
.history-status[data-state="done"] {
  color: var(--done);
}

.download-status[data-state="error"],
.token-status[data-state="error"],
.profile-status[data-state="error"],
.contact-status[data-state="error"],
.topup-status[data-state="error"],
.history-status[data-state="error"] {
  color: var(--danger);
}

.result-details {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  overflow: hidden;
}

.result-details summary {
  cursor: pointer;
  padding: 13px 14px;
  font-weight: 600;
}

.formatted-result {
  max-height: 360px;
  padding: 14px;
  border-top: 1px solid var(--line);
  background: #fbfdff;
  color: var(--muted);
  line-height: 1.65;
  overflow: auto;
  overflow-wrap: anywhere;
}

.formatted-section {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  color: var(--text);
}

.formatted-section:first-child {
  padding-top: 0;
}

.formatted-section:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.formatted-section p {
  margin: 7px 0;
  white-space: pre-wrap;
}

.formatted-result mjx-container,
.history-preview mjx-container {
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
}

.formatted-result mjx-container[display="true"] {
  margin: 0.65em 0;
}

.math-line {
  color: var(--text);
}

.answer-line,
.change-line {
  font-weight: 600;
}

.answer-line {
  color: #0f766e;
}

.change-line {
  color: #7c3aed;
}

#debug-output {
  max-height: 220px;
  margin: 0;
  padding: 12px;
  border-top: 1px solid var(--line);
  background: #111827;
  color: #e5e7eb;
  overflow: auto;
  font-family: Consolas, "Cascadia Mono", monospace;
  font-size: 12px;
  line-height: 1.5;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.48);
}

.post-download-dialog,
.diagram-ask-dialog,
.profile-dialog,
.contact-dialog,
.topup-dialog,
.history-dialog,
.diagram-dialog,
.feedback-dialog,
.usage-guide-dialog,
.admin-manual-topup-alert-dialog,
.user-notice-dialog,
.manual-topup-event-dialog,
.admin-topup-dialog {
  position: relative;
  display: grid;
  gap: 16px;
  width: min(880px, 100%);
  max-height: min(92vh, 860px);
  overflow: auto;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.24);
}

.profile-dialog,
.contact-dialog,
.feedback-dialog,
.diagram-ask-dialog,
.manual-topup-event-dialog,
.admin-manual-topup-alert-dialog {
  width: min(520px, 100%);
}

.user-notice-dialog {
  width: min(560px, 100%);
}

#user-notice-body {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

#user-notice-status,
#admin-user-notice-status {
  min-height: 20px;
  color: var(--muted);
}

#user-notice-status[data-state="error"],
#admin-user-notice-status[data-state="error"] {
  color: var(--danger);
}

.topup-dialog {
  width: min(720px, 100%);
}

.usage-guide-dialog {
  width: min(960px, 100%);
}

.post-download-dialog {
  width: min(960px, 100%);
}

.post-download-dialog h2,
.diagram-ask-dialog h2,
.profile-dialog h2,
.contact-dialog h2,
.topup-dialog h2,
.history-dialog h2,
.diagram-dialog h2,
.feedback-dialog h2,
.usage-guide-dialog h2,
.admin-manual-topup-alert-dialog h2,
.manual-topup-event-dialog h2,
.admin-topup-dialog h2 {
  padding-right: 44px;
}

.post-download-dialog p,
.diagram-ask-dialog p,
.profile-dialog p,
.contact-dialog p,
.topup-dialog p,
.history-dialog p,
.diagram-dialog p,
.feedback-dialog p,
.usage-guide-dialog p,
.admin-manual-topup-alert-dialog p,
.manual-topup-event-dialog p,
.admin-topup-dialog p {
  margin: 0;
  color: var(--text);
  line-height: 1.55;
}

.profile-form,
.topup-form,
.manual-topup-form,
.post-download-description,
.topup-history,
.topup-request-list,
.admin-topup-list {
  display: grid;
  gap: 12px;
}

.form-field {
  display: grid;
  gap: 7px;
  color: var(--text);
  font-weight: 600;
}

.form-field input {
  min-height: 46px;
  padding: 10px 12px;
}

.profile-source-field {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.profile-source-field legend {
  padding: 0 4px;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
}

.profile-source-field legend span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

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

.profile-source-options label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  font-weight: 700;
}

.profile-source-options input {
  margin: 0;
  accent-color: var(--accent);
}

.privacy-consent,
.modal-check-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-weight: 600;
}

.privacy-notice,
.contact-email-row,
.topup-request-item,
.admin-topup-item {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.privacy-notice p,
.topup-request-item p,
.admin-topup-item p {
  color: var(--muted);
  font-size: 13px;
}

.topup-policy {
  color: var(--muted);
  white-space: pre-line;
}

.topup-test-notice {
  margin: 0;
  padding: 11px 12px;
  border: 1px solid #fecaca;
  border-radius: 8px;
  background: var(--danger-bg);
  color: var(--danger);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.45;
}

.manual-topup-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.manual-topup-panel h3,
.topup-history h3 {
  margin: 0;
  color: var(--text);
  font-size: 15px;
}

.manual-topup-copy {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.manual-topup-event-summary {
  margin: 0;
  padding: 10px 11px;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  background: #f0fdf4;
  color: #166534;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
}

.manual-topup-bank {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 11px 12px;
  border: 1px solid #c7d2fe;
  border-radius: 8px;
  background: #eef2ff;
  color: var(--text);
  font-size: 14px;
}

.manual-topup-bank strong {
  color: var(--accent);
  font-size: 16px;
}

.event-kicker {
  color: var(--accent) !important;
  font-size: 13px;
  font-weight: 700;
}

.manual-topup-event-options {
  display: grid;
  gap: 8px;
}

.manual-topup-event-options span {
  padding: 10px 12px;
  border: 1px solid #c7d2fe;
  border-radius: 8px;
  background: #eef2ff;
  color: var(--accent);
  font-weight: 700;
}

.manual-topup-event-hide {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.manual-topup-event-actions {
  justify-content: flex-end;
}

.topup-products {
  display: grid;
  gap: 10px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.topup-products legend {
  margin-bottom: 10px;
  font-weight: 600;
}

.topup-product-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.topup-product {
  align-items: flex-start;
  min-height: 112px;
}

.topup-product span:not(.topup-product-badge) {
  display: grid;
  gap: 3px;
}

.topup-product-title {
  color: var(--text);
  font-size: 17px;
  font-weight: 600;
}

.topup-product-meta {
  color: var(--muted);
  font-size: 13px;
}

.topup-product-manual-bonus {
  color: #166534;
  font-size: 12px;
  font-weight: 700;
}

.topup-product-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--accent);
  color: #ffffff;
  font-size: 11px;
  font-weight: 600;
}

.topup-request-item.is-approved,
.admin-topup-item.is-approved {
  border-color: #a7f3d0;
  background: var(--done-bg);
}

.topup-request-item.is-rejected,
.admin-topup-item.is-rejected {
  border-color: #fecaca;
  background: var(--danger-bg);
}

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

.admin-topup-toolbar {
  display: flex;
  align-items: end;
  gap: 10px;
}

.admin-topup-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
}

.admin-topup-controls input {
  min-height: 42px;
  padding: 9px 11px;
}

.admin-dashboard-status,
.admin-manual-topup-alert-status,
.feedback-status {
  min-height: 22px;
  color: var(--muted);
  line-height: 1.45;
}

.admin-dashboard-status[data-state="done"],
.admin-manual-topup-alert-status[data-state="done"],
.feedback-status[data-state="done"] {
  color: var(--done);
}

.admin-dashboard-status[data-state="error"],
.admin-manual-topup-alert-status[data-state="error"],
.feedback-status[data-state="error"] {
  color: var(--danger);
}

.admin-manual-topup-alert-list {
  display: grid;
  gap: 10px;
  max-height: min(52vh, 420px);
  overflow: auto;
}

.admin-alert-section {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.admin-alert-section h3 {
  margin: 0;
  color: var(--text);
  font-size: 15px;
}

.admin-alert-section-list {
  display: grid;
  gap: 8px;
}

.admin-manual-topup-alert-list .admin-list-item {
  background: #ffffff;
}

.admin-manual-topup-alert-actions {
  align-items: stretch;
}

.admin-panel {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.admin-panel.is-attention {
  border-color: var(--accent);
  background: #eff6ff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

.admin-dashboard-section {
  gap: 0;
  padding: 0;
  overflow: hidden;
}

.admin-dashboard-section-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px;
  cursor: pointer;
  list-style: none;
}

.admin-dashboard-section-summary::-webkit-details-marker {
  display: none;
}

.admin-dashboard-section-summary::after {
  content: "";
  flex-shrink: 0;
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 0.15s ease;
}

.admin-dashboard-section[open] > .admin-dashboard-section-summary::after {
  transform: rotate(225deg);
}

.admin-dashboard-section[open] > .admin-dashboard-section-summary {
  border-bottom: 1px solid var(--line);
}

.admin-dashboard-section-summary h3 {
  margin: 0;
}

.admin-panel-body {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.admin-panel-copy {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

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

.admin-tool-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.admin-tool-card h4 {
  margin: 0;
  color: var(--text);
}

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

.admin-tool-card textarea {
  min-height: 180px;
  resize: vertical;
}

.admin-paste-zone {
  min-height: 58px;
  padding: 12px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: #ffffff;
  color: var(--muted);
  cursor: text;
}

.admin-paste-zone:focus {
  outline: 2px solid rgba(37, 99, 235, 0.18);
  border-color: var(--accent);
}

.admin-tool-status {
  min-height: 22px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.admin-tool-status[data-state="done"] {
  color: var(--done);
}

.admin-tool-status[data-state="warning"] {
  color: var(--warning);
}

.admin-tool-status[data-state="error"] {
  color: var(--danger);
}

.admin-summary-list,
.admin-list {
  display: grid;
  gap: 8px;
}

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

.admin-summary-item,
.admin-list-item {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.admin-summary-item span,
.admin-list-item span,
.admin-list-item p {
  color: var(--muted);
  font-size: 13px;
}

.admin-list-item button {
  justify-self: start;
}

.admin-user-table-wrap {
  max-height: min(62vh, 620px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.admin-user-table-wrap .topup-empty {
  margin: 0;
  padding: 12px;
}

.admin-point-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
  font-size: 13px;
}

.admin-point-table th,
.admin-point-table td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  text-align: left;
  vertical-align: middle;
}

.admin-point-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8fafc;
  color: var(--muted);
  font-weight: 700;
}

.admin-point-table tbody tr:hover,
.admin-point-table-row.is-selected {
  background: #eff6ff;
}

.admin-point-table tbody tr:last-child td {
  border-bottom: 0;
}

.admin-user-table {
  width: max-content;
  min-width: 100%;
}

.admin-user-table th,
.admin-user-table td {
  vertical-align: top;
}

.admin-sort-button {
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.admin-sort-button:hover {
  color: var(--accent);
}

.admin-point-user-cell {
  min-width: 220px;
}

.admin-user-identity-button {
  border: 0;
  background: transparent;
  color: var(--accent);
  padding: 0;
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}
.admin-user-identity-button:hover { text-decoration: underline; }
.admin-user-identity-button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.admin-user-identity-cell {
  white-space: nowrap;
}

.admin-user-identity-button,
.admin-user-identity-cell > span {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-point-user-cell strong,
.admin-point-user-cell span {
  display: block;
}

.admin-point-user-cell span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.admin-point-number {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.admin-point-date {
  white-space: nowrap;
}

.admin-user-created-column,
.admin-user-created-cell,
.admin-user-phone-column,
.admin-user-phone-cell,
.admin-user-action-column,
.admin-user-action-cell {
  width: 1%;
  white-space: nowrap;
}

.admin-user-metric {
  min-width: 130px;
  white-space: nowrap;
}

.admin-point-row-delta {
  width: 92px;
}

.admin-point-row-reason {
  width: min(220px, 100%);
}

.admin-point-table input {
  min-height: 36px;
  padding: 8px 10px;
}

.admin-user-table-actions {
  display: flex;
  gap: 6px;
  flex-wrap: nowrap;
}

.admin-user-table-actions .primary-button,
.admin-user-table-actions .secondary-button {
  min-height: 34px;
  padding: 8px 10px;
  white-space: nowrap;
}

.admin-panel-heading,
.admin-list-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-panel-heading h3 {
  margin: 0;
}

.admin-panel-heading h4 {
  margin: 0;
  color: var(--text);
  font-size: 14px;
}

.admin-list-actions {
  justify-content: flex-start;
}

.admin-collapsible-details {
  margin-top: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  overflow: hidden;
}

.admin-collapsible-details summary {
  cursor: pointer;
  padding: 10px 12px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  list-style-position: inside;
}

.admin-collapsible-details[open] summary {
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
}

.admin-collapsible-body {
  display: grid;
  gap: 10px;
  padding: 10px;
}

.admin-user-detail {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--accent-line);
  border-radius: 8px;
  background: var(--accent-soft);
}

.admin-user-detail[hidden] {
  display: none;
}

.admin-user-notices {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.admin-user-notices h4,
.admin-user-notices h5,
.admin-user-notices p {
  margin: 0;
}

.admin-user-notice-form,
.admin-user-notice-list {
  display: grid;
  gap: 10px;
}

.admin-user-notice-form input,
.admin-user-notice-form textarea {
  width: 100%;
  min-width: 0;
}

.admin-user-notice-form button {
  justify-self: start;
}

.admin-user-notice-item {
  display: grid;
  gap: 4px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  overflow-wrap: anywhere;
}

.admin-user-notice-item p {
  white-space: pre-wrap;
}

.admin-user-notice-meta {
  color: var(--muted);
  font-size: 13px;
}

#admin-point-ledger {
  min-width: 0;
  max-width: 100%;
}

#admin-point-ledger > summary {
  cursor: pointer;
  font-weight: 600;
  padding: 8px 0;
}

#admin-point-ledger p,
#admin-point-ledger-status,
#admin-point-refunds strong,
#admin-point-refunds span {
  overflow-wrap: anywhere;
}

#admin-point-refunds .point-refund-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

#admin-point-refunds input,
.admin-list-item input[type="datetime-local"] {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 10px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: white;
  color: var(--text);
  font: inherit;
}

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

.admin-detail-list div {
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid #d8e2ee;
  border-radius: 8px;
  background: #ffffff;
}

.admin-detail-list dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.admin-detail-list dd {
  margin: 2px 0 0;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

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

.admin-generated-item,
.admin-user-job-item {
  content-visibility: auto;
  contain-intrinsic-size: auto 600px;
}

.admin-user-job-item {
  gap: 10px;
  background: #ffffff;
}

.admin-user-job-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

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

.admin-user-job-meta-grid div {
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.admin-user-job-meta-grid span,
.admin-user-job-meta-grid strong {
  display: block;
}

.admin-user-job-meta-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.admin-user-job-meta-grid strong {
  margin-top: 2px;
  color: var(--text);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.admin-user-job-prompt,
.admin-user-job-answer,
.admin-user-job-error {
  margin: 0;
  padding: 9px 10px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--text);
  font-size: 13px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.admin-user-job-answer {
  background: #f8fafc;
  font-weight: 700;
}

.admin-user-job-error {
  border: 1px solid #fecaca;
  background: #fef2f2;
  color: var(--danger);
}

.admin-user-job-output {
  max-height: 420px;
}

@media (max-width: 980px) {
  .admin-user-job-meta-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .admin-user-job-meta-grid,
  .admin-detail-list {
    grid-template-columns: 1fr;
  }
}

.admin-generated-preview {
  line-height: 1.55;
}

.admin-generated-rendered {
  max-height: 360px;
  overflow: auto;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.admin-feedback-generation {
  min-width: 0;
  margin-top: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.admin-feedback-result {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.admin-feedback-result .admin-generated-rendered {
  max-height: none;
  overflow: visible;
}

.admin-generated-rendered .formatted-section {
  margin-bottom: 14px;
}

.admin-generated-rendered .formatted-section:last-child {
  margin-bottom: 0;
}

.admin-generated-problem-block {
  padding: 18px 0 4px;
  border-top: 1px solid #d8e2ee;
}

.admin-generated-problem-block:first-child {
  padding-top: 0;
  border-top: 0;
}

.admin-generated-problem-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 10px;
  color: #2563eb;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
}

.admin-generated-problem-heading::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #d8e2ee;
}

.admin-generated-problem-body .formatted-section {
  margin-bottom: 10px;
}


.admin-diagram-section {
  min-width: 0;
  padding-top: 12px;
}

.admin-diagram-section h4 {
  margin: 0 0 12px;
  font-size: 15px;
}

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

.admin-diagram-card {
  min-width: 0;
  margin: 0;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.admin-diagram-card figcaption {
  font-size: 14px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.admin-diagram-meta,
.admin-diagram-prompt {
  margin: 8px 0;
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.admin-diagram-billing {
  margin: 8px 0;
  color: #166534;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
}

.admin-diagram-preview {
  display: grid;
  place-content: center;
  min-width: 0;
  height: 280px;
  margin-top: 10px;
  padding: 10px;
  overflow: hidden;
  background: #fff;
  color: var(--muted);
  font-size: 14px;
}

.admin-diagram-image-button {
  display: block;
  width: 100%;
  height: 260px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: #fff;
  cursor: zoom-in;
}

.admin-diagram-image-button:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

.admin-diagram-image-button img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.admin-diagram-lightbox {
  width: min(1100px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: auto;
}

.admin-diagram-lightbox::backdrop {
  background: rgb(0 0 0 / 55%);
}

.admin-diagram-lightbox > button {
  display: block;
  position: sticky;
  top: 0;
  margin-left: auto;
}

.admin-diagram-lightbox img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 12px auto 0;
}

@media (max-width: 680px) {
  .admin-diagram-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.admin-stage-usage {
  padding: 8px 10px;
  border: 1px solid #d8e2ee;
  border-radius: 8px;
  background: #f8fafc;
  color: #475569;
  font-size: 12px;
  line-height: 1.5;
}

.admin-debug-details summary {
  color: #2563eb;
}
.admin-markdown-details {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.admin-markdown-details summary {
  cursor: pointer;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 700;
}

.admin-markdown-block {
  max-height: 260px;
  overflow: auto;
  margin: 0;
  padding: 10px;
  border-top: 1px solid var(--line);
  background: #f8fafc;
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.admin-inline-form,
.admin-action-form,
.contact-form,
.feedback-form {
  display: grid;
  gap: 10px;
}

.admin-inline-form {
  grid-template-columns: minmax(0, 1fr) auto;
}

.admin-inline-form input {
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
}

.admin-action-form {
  padding: 12px;
  border: 1px solid var(--accent-line);
  border-radius: 8px;
  background: var(--accent-soft);
}

.admin-export-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
}

.admin-export-fields input {
  width: 100%;
  min-width: 0;
}

#admin-export-submit {
  justify-self: start;
}

.contact-form textarea,
.feedback-form textarea {
  min-height: 120px;
}

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

.contact-email-row strong {
  color: var(--text);
  overflow-wrap: anywhere;
}

.contact-actions,
.topup-actions {
  flex-wrap: wrap;
}

.post-download-dialog img {
  width: 100%;
  max-height: 62vh;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.post-download-dialog p.post-download-warning {
  padding: 12px 15px;
  border-left: 4px solid var(--danger);
  border-radius: 4px;
  background: var(--danger-bg);
  color: var(--danger);
  font-size: 17px;
  font-weight: 700;
}

.post-download-steps strong {
  display: inline-block;
  padding: 2px 5px;
  border-radius: 4px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  white-space: nowrap;
}

.post-download-steps .post-download-key-step { background: #dbeafe; }

.post-download-library-callout {
  display: grid;
  gap: 10px;
}

.post-download-dialog .post-download-library-callout p {
  padding: 12px 15px;
  border-left: 4px solid var(--accent);
  border-radius: 4px;
  background: var(--accent-soft);
}

.post-download-library-callout p strong { font-weight: 750; }
.post-download-library-callout p strong:first-child { color: var(--accent-dark); }

.post-download-dialog .post-download-library-callout img {
  width: min(100%, 520px);
  max-height: none;
  margin-inline: auto;
}

.usage-guide-video {
  width: 100%;
  max-height: min(68vh, 720px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0f172a;
}


.tutorial-sample-modal {
  z-index: 150;
  align-items: flex-start;
  overflow: auto;
  padding: 28px;
}

.tutorial-sample-dialog {
  position: relative;
  width: min(980px, calc(100vw - 56px));
  margin: 0 auto;
  padding: 24px;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.24);
}

.tutorial-sample-dialog h2 {
  margin: 0 44px 8px 0;
  color: var(--text);
  font-size: 22px;
}

.tutorial-sample-dialog p {
  margin: 0 44px 16px 0;
  color: var(--muted);
  line-height: 1.55;
}

.tutorial-sample-image {
  display: block;
  width: 100%;
  max-height: min(68vh, 680px);
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
}

.tutorial-overlay {
  position: fixed;
  inset: 0;
  z-index: 180;
  pointer-events: none;
}

.tutorial-spotlight {
  position: fixed;
  left: 0;
  top: 0;
  width: 120px;
  height: 80px;
  border: 2px solid var(--accent);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 9999px rgba(15, 23, 42, 0.62), 0 14px 34px rgba(15, 23, 42, 0.22);
  transition: left 180ms ease, top 180ms ease, width 180ms ease, height 180ms ease;
}

.tutorial-card {
  position: fixed;
  z-index: 182;
  display: grid;
  gap: 10px;
  width: min(380px, calc(100vw - 32px));
  max-height: min(76vh, 520px);
  overflow: auto;
  padding: 18px;
  border: 1px solid var(--accent-line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.28);
  pointer-events: auto;
}

.tutorial-card h2 {
  margin: 0;
  padding-right: 0;
  color: var(--text);
  font-size: 20px;
  line-height: 1.35;
}

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

.tutorial-step-count {
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 700;
}

.tutorial-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 6px;
}

.tutorial-actions div {
  display: flex;
  gap: 8px;
}

.tutorial-target-highlight {
  position: relative;
  z-index: 181;
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 8px;
}

body.is-tutorial-active {
  overflow-x: hidden;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

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

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 980px) {
  .example-board-section {
    grid-template-columns: 1fr;
  }

  .example-card-grid,
  .examples-list-grid {
    grid-template-columns: 1fr;
  }

  .app-shell {
    width: min(100% - 28px, 820px);
  }

  .app-header,
  .account-panel {
    align-items: flex-start;
    flex-direction: column;
  }

  .account-panel,
  .account-actions {
    width: 100%;
  }

  .account-summary {
    max-width: none;
    text-align: left;
  }

  .signup-bonus-badge {
    justify-content: center;
    width: 100%;
  }

  .hero-section,
  .workflow-grid,
  .policy-details-grid {
    grid-template-columns: 1fr;
  }

  .option-step {
    position: static;
  }

  .upload-step {
    min-height: 0;
  }
}

@media (max-width: 680px) {
  .app-shell {
    width: min(100% - 20px, 560px);
    padding-top: 16px;
  }

  .hero-copy h2 {
    font-size: 33px;
    line-height: 1.12;
  }

  .hero-description {
    font-size: 16px;
  }

  .hero-actions,
  .account-actions,
  .result-actions,
  .modal-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .hero-actions button,
  .account-actions button,
  .result-actions button,
  .modal-footer button {
    width: 100%;
  }

  .step-card {
    padding: 18px;
  }

  .step-heading {
    flex-direction: column;
  }

  .choice-cards,
  .segmented,
  .variation-list,
  .topup-product-grid,
  .admin-tool-grid,
  .admin-summary-list,
  .admin-inline-form,
  .admin-topup-controls {
    grid-template-columns: 1fr;
  }

  .preview-frame {
    min-height: 260px;
  }

  .modal-overlay {
    padding: 12px;
  }

  .post-download-dialog,
  .profile-dialog,
  .contact-dialog,
  .topup-dialog,
.history-dialog,
  .feedback-dialog,
  .usage-guide-dialog,
  .admin-topup-dialog {
    padding: 20px;
  }


  .tutorial-sample-modal {
    padding: 14px;
  }

  .tutorial-sample-dialog {
    width: calc(100vw - 28px);
    padding: 18px;
  }

  .tutorial-card {
    left: 16px !important;
    right: 16px;
    width: auto;
  }

  .tutorial-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .tutorial-actions div {
    justify-content: flex-end;
  }

  .admin-topup-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .policy-details-grid {
    grid-template-columns: 1fr;
  }

  .business-footer {

    padding-inline: 0;
  }
}


.history-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 4px;
}

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

/* The old result card is now history-only. Keep image loads lazy and bounded. */
#legacy-result-state[hidden], .generation-ready[hidden] { display: none; }
.generation-ready {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 16px 20px;
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  background: #eff6ff;
  color: #1e40af;
}
.history-result-details {
  border: 1px solid #dbeafe;
  border-radius: 10px;
  overflow: hidden;
}
.history-result-details > summary {
  cursor: pointer;
  padding: 14px 16px;
  color: #1d4ed8;
  background: #eff6ff;
  font-weight: 700;
}
.history-result-body { padding: 16px; min-width: 0; max-height: none; overflow: visible; overflow-wrap: anywhere; color: var(--text); }
.history-toolbar .history-filter { flex-shrink: 0; white-space: nowrap; }
.history-picture { margin: 16px 0; padding: 16px; border: 1px solid #e2e8f0; border-radius: 10px; background: #fff; }
.history-picture figcaption { font-weight: 700; color: #334155; margin-bottom: 12px; }
.history-picture-image { min-height: 100px; text-align: center; background: #fff; }
.history-picture-image img { display: block; width: auto; height: auto; max-width: 100%; max-height: 580px; margin: 0 auto; object-fit: contain; }
.history-picture-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
#diagram-edit-after { display: inline-flex; flex-direction: column; gap: 4px; }
#diagram-edit-after:empty { display: none; }
#diagram-edit-after small { color: var(--muted); }
#diagram-modal { z-index: 110; }
#feedback-modal { z-index: 120; }
.diagram-actions { flex-wrap: wrap; }

.history-item {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.history-item.is-succeeded {
  border-color: #bfdbfe;
}

.history-item.is-failed,
.history-item.is-cancelled {
  border-color: #fecaca;
  background: var(--danger-bg);
}

.history-item-head,
.history-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.history-badge,
.history-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 3px 9px;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 600;
}

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

.history-meta span {
  background: #f8fafc;
  color: var(--muted);
}

.history-preview {
  margin: 0;
  color: var(--text);
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.history-empty,
.history-error {
  color: var(--muted);
}

.history-error {
  color: var(--danger);
}

.history-rating-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 12px;
}

.history-rating-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.history-rating-heading strong {
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 700;
}

.history-rating-heading span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.history-rating-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.history-rating-list,
.history-rating-status {
  margin-top: 10px;
}



.public-products-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
  margin-top: 28px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.section-kicker {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
}

.public-products-copy h2 {
  margin: 0 0 10px;
  color: #1f2937;
  font-size: 24px;
  font-weight: 600;
}

.public-products-copy p,
.policy-detail p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.public-products-copy {
  max-width: 900px;
}

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

.public-product-card {
  position: relative;
  min-height: 132px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
}

.public-product-card.is-recommended {
  border-color: var(--accent-line);
  background: var(--accent-soft);
}

.public-product-card strong {
  display: block;
  color: var(--text);
  font-size: 28px;
  font-weight: 600;
  line-height: 1.1;
}

.public-product-card span:not(.public-product-badge) {
  display: block;
  margin-top: 8px;
  color: #1f2937;
  font-size: 17px;
}

.public-product-card small {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.45;
}

.public-product-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--accent);
  color: #ffffff;
  font-size: 12px;
  font-weight: 600;
}

@media (max-width: 760px) {
  .public-products-section {
    padding: 20px;
  }

  .public-product-grid {
    grid-template-columns: 1fr;
  }

  .public-product-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 5px 12px;
    align-items: center;
    min-height: 0;
    padding: 17px 18px;
  }

  .public-product-card span:not(.public-product-badge) {
    grid-column: 2;
    grid-row: 1;
    margin-top: 0;
  }

  .public-product-card small {
    grid-column: 1;
    grid-row: 2;
    margin-top: 0;
  }

  .public-product-badge {
    position: static;
    grid-column: 2;
    grid-row: 2;
    justify-self: end;
  }
}

.seo-service-summary {
  display: grid;
  gap: 8px;
  margin-top: 26px;
  padding: 18px 4px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.seo-service-summary h2 {
  margin: 0;
  color: var(--text);
  font-size: 16px;
  font-weight: 600;
}

.seo-service-summary p,
.seo-service-summary ul {
  margin: 0;
}

.seo-service-summary ul {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  padding-left: 18px;
}

.business-footer {
  margin-top: 26px;
  padding: 18px 4px 8px;
  border-top: 1px solid var(--line);
  color: var(--subtle);
}

.policy-details-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.policy-detail {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.64);
  overflow: hidden;
}

.policy-detail summary {
  cursor: pointer;
  padding: 12px 14px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.policy-detail p {
  padding: 0 14px 12px;
  font-size: 12px;
}

.policy-detail p + p {
  padding-top: 0;
}

.legal-business-info {
  display: grid;
  gap: 3px;
  margin-top: 16px;
  color: var(--subtle);
  font-size: 11px;
  line-height: 1.5;
  text-align: center;
}

.legal-business-info p {
  margin: 0;
}

.admin-dashboard-button {
  position: relative;
}

.admin-feedback-badge {
  position: absolute;
  top: -7px;
  right: -7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border: 2px solid #ffffff;
  border-radius: 999px;
  background: var(--danger);
  color: #ffffff;
  font-size: 11px;
  line-height: 1;
  font-weight: 600;
}

.admin-feedback-badge[hidden] {
  display: none;
}

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

.contact-history summary {
  cursor: pointer;
  font-weight: 600;
}

.contact-history[open] summary {
  margin-bottom: 10px;
}

#contact-history-items {
  list-style: none;
  padding: 0;
  margin: 12px 0;
}

#contact-history-items li {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 8px;
}

#contact-history-items p {
  margin-top: 4px;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.contact-phone-option {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
}

.contact-phone-option input {
  margin-top: 2px;
}

.contact-phone-panel {
  display: grid;
  gap: 6px;
}

.contact-phone-notice {
  margin: -2px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}


.example-board-section,
.examples-hero,
.examples-list-section,
.example-article {
  margin-top: 28px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.example-board-section {
  display: grid;
  grid-template-columns: minmax(0, 0.75fr) minmax(0, 1.25fr);
  gap: 24px;
  align-items: start;
}

.example-board-copy,
.examples-hero,
.examples-list-section,
.example-article,
.example-card,
.example-problem,
.example-solution,
.example-note {
  display: grid;
  gap: 12px;
}

.example-board-copy h2,
.examples-hero h1,
.examples-list-section h2,
.example-article h1,
.example-article h2,
.example-article h3,
.example-card h3 {
  margin: 0;
  color: var(--text);
  font-weight: 600;
  letter-spacing: 0;
}

.example-board-copy h2,
.examples-hero h1,
.example-article h1 {
  font-size: 28px;
  line-height: 1.25;
}

.examples-list-section h2,
.example-article h2 {
  font-size: 21px;
  line-height: 1.35;
}

.example-card h3,
.example-article h3 {
  font-size: 16px;
  line-height: 1.4;
}

.example-board-copy p,
.examples-hero p,
.examples-list-section p,
.example-article p,
.example-card p,
.example-note,
.example-meta {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.example-card-grid,
.examples-list-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.example-card,
.example-problem,
.example-solution,
.example-note {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.example-card span,
.example-meta span {
  width: fit-content;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 600;
}

.example-card a,
.example-article a,
.examples-hero a {
  color: var(--accent-dark);
  text-decoration: none;
}

.example-card a:hover,
.example-article a:hover,
.examples-hero a:hover {
  text-decoration: underline;
}

.example-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.example-problem table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  font-size: 14px;
}

.example-problem th,
.example-problem td {
  padding: 10px;
  border: 1px solid var(--line);
  text-align: center;
}

.example-problem th {
  background: var(--panel-muted);
  color: var(--text);
  font-weight: 600;
}

.example-choice-list,
.example-step-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 20px;
  color: var(--text);
  line-height: 1.65;
}

.example-section-stack {
  display: grid;
  gap: 18px;
}

.example-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
}

.example-formula {
  overflow-x: auto;
  color: var(--text);
  line-height: 1.7;
}


.diagram-panel {
  display: grid;
  gap: 12px;
  margin: 12px 0 4px;
}

.diagram-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

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

.diagram-card strong {
  color: var(--text);
}
.diagram-panel-hint,
.diagram-ask-hint {
  color: var(--muted);
  font-size: 14px;
}

.diagram-modal-context {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.78fr);
  gap: 14px;
  align-items: start;
}

.diagram-preview-block {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.diagram-preview-block h3 {
  margin: 0;
  color: var(--text);
  font-size: 15px;
}

.diagram-problem-preview,
.diagram-empty-preview {
  max-height: 260px;
  overflow: auto;
  color: var(--text);
  font-size: 14px;
  line-height: 1.65;
}

.diagram-problem-preview .formatted-section {
  padding: 0;
  border-bottom: 0;
}

.diagram-empty-preview {
  color: var(--muted);
}

.diagram-preview-image,
.diagram-modal-preview img {
  max-width: min(100%, 520px);
  height: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
}
.diagram-modal-preview img {
  display: block;
  width: 100%;
}

.diagram-status {
  min-height: 20px;
  color: var(--muted);
  font-size: 14px;
}

.diagram-status[data-state="done"] {
  color: var(--success);
}

.diagram-status[data-state="error"] {
  color: var(--danger);
}

.diagram-form textarea {
  min-height: 88px;
}

.diagram-targets { min-width: 0; margin: 16px 0; padding: 0; border: 0; }
.diagram-targets legend { margin-bottom: 8px; font-weight: 700; }
.diagram-target-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 8px;
}
.diagram-target-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  min-height: 52px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  cursor: pointer;
}
.diagram-target-row:has(input:checked) { border-color: var(--accent); background: #f0f5ff; }
.diagram-target-row input { flex: 0 0 auto; width: 18px; height: 18px; accent-color: var(--accent); }
.diagram-target-name { flex: 1; overflow-wrap: anywhere; }
.diagram-target-state { font-size: 13px; color: var(--muted); }
.diagram-target-state[data-state="done"] { color: var(--done); }
.diagram-target-state[data-state="failed"] { color: var(--danger); }
.diagram-preview-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  font-size: 14px;
}
.diagram-preview-toolbar select { width: auto; max-width: 100%; }
#diagram-progress { margin-left: auto; color: var(--muted); }
.diagram-status { overflow-wrap: anywhere; white-space: pre-line; }

@media (max-width: 980px) {
  .diagram-modal-context { grid-template-columns: minmax(0, 1fr); }
}

.rating-panel {
  display: grid;
  gap: 12px;
  margin: 12px 0 4px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.rating-heading {
  display: grid;
  gap: 4px;
}

.rating-heading p,
.rating-status {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.rating-status[data-state="done"] {
  color: var(--done);
}

.rating-status[data-state="error"] {
  color: var(--danger);
}

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

.rating-card {
  display: grid;
  grid-template-columns: minmax(90px, 0.45fr) minmax(80px, 0.35fr) minmax(220px, 1fr);
  gap: 10px;
  align-items: center;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.rating-card.is-like {
  border-color: #bfdbfe;
  background: #eff6ff;
}

.rating-card.is-dislike {
  border-color: #fecaca;
  background: #fff7f7;
}

.rating-card.is-compact {
  grid-template-columns: minmax(80px, 0.35fr) minmax(72px, 0.25fr) minmax(190px, 1fr);
  padding: 9px;
}

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

.rating-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.rating-button {
  min-height: 34px;
  padding-inline: 11px;
  border-width: 1px;
  font-weight: 700;
}

.rating-like-button {
  border-color: #bfdbfe;
  color: var(--accent-dark);
}

.rating-dislike-button {
  border-color: #fecaca;
  color: #b91c1c;
}

.rating-like-button.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-dark);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.rating-dislike-button.is-active {
  border-color: #dc2626;
  background: #fef2f2;
  color: #991b1b;
  box-shadow: inset 0 0 0 1px #dc2626;
}

.history-filter select {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
}

.history-filter select {
  min-height: 38px;
  padding: 0 10px;
}

.history-filter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.history-filter select {
  min-width: 110px;
}

@media (max-width: 720px) {
  .profile-source-options,
  .rating-card {
    grid-template-columns: 1fr;
  }

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

  .history-toolbar {
    align-items: stretch;
  }

  .history-filter {
    width: 100%;
  }
}

.exam-samples-page {
  gap: 18px;
}

.exam-sample-list {
  display: grid;
  gap: 22px;
}

.exam-sample-card {
  display: grid;
  gap: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
}

.exam-sample-head {
  display: grid;
  gap: 8px;
}

.exam-sample-head span {
  width: fit-content;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 600;
}

.exam-sample-head h2 {
  margin: 0;
  color: var(--text);
  font-size: 21px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: 0;
}

.exam-sample-head p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.exam-sample-source,
.exam-sample-keywords {
  font-size: 13px;
}

.exam-sample-pair {
  display: grid;
  grid-template-columns: minmax(0, 0.88fr) minmax(0, 1.12fr);
  gap: 18px;
  align-items: start;
}

.exam-sample-pair figure {
  margin: 0;
}

.exam-sample-pair figcaption {
  margin: 0 0 9px;
  color: var(--text);
  font-weight: 600;
}

.exam-sample-frame {
  padding: 10px;
  border: 1px solid var(--accent);
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 8px 22px rgba(68, 90, 232, 0.1);
}

.exam-sample-frame img {
  display: block;
  width: 100%;
  height: auto;
  background: #ffffff;
}

.exam-sample-scroll {
  max-height: 760px;
  overflow: auto;
}

@media (max-width: 860px) {
  .exam-sample-pair {
    grid-template-columns: 1fr;
  }
}


.featured-example-preview {
  display: grid;
  gap: 14px;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
}

.featured-example-head {
  display: grid;
  gap: 7px;
}

.featured-example-head span {
  width: fit-content;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 600;
}

.featured-example-head h3 {
  margin: 0;
  color: var(--text);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: 0;
}

.featured-example-head p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.featured-example-images {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 12px;
  align-items: start;
}

.featured-example-images figure {
  margin: 0;
}

.featured-example-images figcaption {
  margin: 0 0 8px;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
}

.featured-example-frame {
  padding: 8px;
  border: 1px solid var(--accent);
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 8px 22px rgba(68, 90, 232, 0.1);
}

.featured-example-frame img {
  display: block;
  width: 100%;
  height: auto;
  background: #ffffff;
}

.featured-example-scroll {
  max-height: 360px;
  overflow: auto;
}

@media (max-width: 980px) {
  .featured-example-images {
    grid-template-columns: 1fr;
  }
}

/* Completed promotion amounts remain visible but cannot be selected. */
.manual-event-product.is-unavailable {opacity:.48;background:#edf0f5;cursor:not-allowed;box-shadow:none;}
.manual-event-product.is-unavailable input {cursor:not-allowed;}
.manual-event-product > span {min-width:0;display:grid;gap:6px;overflow-wrap:anywhere;}
.manual-event-option {border:1px solid #cad3f1;border-radius:12px;padding:14px;background:#eef3ff;color:#3449ab;font:inherit;font-weight:700;cursor:pointer;}
.manual-event-option:disabled {opacity:.48;background:#edf0f5;color:#667085;cursor:not-allowed;}
#manual-topup-products {margin:16px 0;}
.manual-coupon {position:relative;display:block;min-width:0;border:1px solid #c7cdef;border-radius:16px;background:linear-gradient(145deg,#f6f5ff,#edf4ff);padding:18px 12px;overflow:hidden;}
.manual-coupon > input {position:absolute;left:8px;top:8px;margin:0;}
.manual-coupon::after {content:"";position:absolute;left:0;right:0;bottom:47px;border-top:1px dashed #bec6e6;pointer-events:none;}
.manual-coupon:has(input:checked) {border-color:#5a55c7;box-shadow:0 0 0 2px #5a55c733;}
.manual-coupon-content {display:grid;gap:8px;text-align:center;width:100%;padding-top:12px;}
.manual-topup-event-options {grid-template-columns:repeat(3,minmax(0,1fr));}
.manual-topup-event-options .manual-coupon-content,.manual-topup-event-options .manual-coupon-content > span {padding:0;border:0;border-radius:0;background:none;}
.manual-topup-event-options .manual-coupon-content > .manual-coupon-status {padding-top:16px;}
.manual-coupon-kicker {font-size:12px;font-weight:800;letter-spacing:.03em;color:#6059bd;}
.manual-coupon .manual-coupon-amount {font-size:22px;color:#24294a;}
.manual-coupon-points {font-size:16px;font-weight:750;color:#4d47b5;}
.manual-coupon-total {font-size:12px;color:#667085;}
.manual-coupon-status {display:block;padding-top:16px;font-size:13px;font-weight:750;color:#4d47b5;}
.manual-coupon.is-used .manual-coupon-status {color:#667085;text-decoration:none;}
.manual-coupon.is-used .manual-coupon-points {text-decoration:line-through;}
.manual-standard-title {margin:24px 0 6px;font-size:16px;}
.manual-standard-copy,.manual-coupon-policy {font-size:13px;color:#667085;line-height:1.65;}
#manual-topup-standard-products {margin:12px 0;}
.manual-standard-product {min-height:0;padding:12px;font-size:13px;}
.manual-standard-product strong {font-size:13px;}
.card-payment-section {margin-top:24px;border:1px solid #e1e5ed;border-radius:12px;background:#fafbfc;}
.card-payment-section > summary {padding:14px 16px;cursor:pointer;font-weight:700;color:#667085;}
.card-payment-badge {display:inline-block;margin-left:8px;padding:3px 8px;border-radius:6px;background:#eef0f4;font-size:12px;font-weight:600;}
.card-payment-section[open] > summary {border-bottom:1px solid #e1e5ed;}
.card-payment-content {padding:16px;}
.card-payment-content fieldset:disabled {opacity:.5;}
@media(max-width:640px) {.manual-coupon-grid,.manual-topup-event-options {grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;}.manual-coupon {padding:14px 6px;}.manual-coupon .manual-coupon-amount {font-size:17px;}.manual-coupon-points {font-size:12px;}.manual-coupon-kicker,.manual-coupon-total {font-size:10px;}.manual-coupon-status {font-size:11px;}#manual-topup-standard-products {grid-template-columns:1fr;}}

.withdrawal-dialog:not([open]) {
  display: none;
}

.withdrawal-dialog {
  border: 0;
  max-height: 90dvh;
  overflow: auto;
}

.withdrawal-dialog::backdrop {
  background: rgb(17 24 39 / 55%);
}
