:root {
  --bg: #f6f8fa;
  --surface: #ffffff;
  --surface-soft: #f9fbfa;
  --text: #213547;
  --text-soft: #47566a;
  --muted: #6b7280;
  --line: #dfe7e2;
  --line-strong: #c9d6cf;
  --primary: #42b883;
  --primary-dark: #369870;
  --primary-soft: #e8f7f0;
  --success: #42b883;
  --success-soft: #e8f7f0;
  --warning: #d97706;
  --warning-soft: #fff7e6;
  --danger: #d92d20;
  --danger-soft: #fff1f0;
  --shadow: 0 14px 36px rgba(33, 53, 71, 0.08);
  --shadow-soft: 0 8px 22px rgba(33, 53, 71, 0.06);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 20% 0%, rgba(66, 184, 131, 0.12), transparent 300px),
    linear-gradient(180deg, rgba(246, 248, 250, 0.9) 0, rgba(246, 248, 250, 1) 280px),
    var(--bg);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  letter-spacing: 0;
}

body.has-dialog,
body.is-generating {
  overflow: hidden;
}

a {
  color: var(--primary);
  text-decoration: none;
}

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

button {
  border: 0;
}

button:not(:disabled) {
  cursor: pointer;
}

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

.hidden {
  display: none !important;
}

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

.app-topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  min-height: 64px;
  margin-bottom: 16px;
  padding: 10px 14px;
  border: 1px solid rgba(223, 231, 226, 0.96);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.topbar-brand {
  min-width: 0;
  width: fit-content;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: linear-gradient(135deg, #42d392 0%, #42b883 52%, #33a06f 100%);
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  box-shadow: 0 10px 22px rgba(66, 184, 131, 0.28);
}

.brand-mark svg {
  width: 30px;
  height: 30px;
  display: block;
}

.brand-mark .icon-frame,
.brand-mark .icon-line,
.brand-mark .icon-dot {
  fill: none;
  stroke: #ffffff;
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand-mark .ai-spark {
  fill: #b7f7d5;
  stroke: #ffffff;
  stroke-width: 0.6;
}

.brand-mark .ai-spark.small {
  fill: #ffffff;
  stroke: none;
  opacity: 0.92;
}

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

.eyebrow,
.brand-copy .eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
}

h1,
h2 {
  margin: 0;
  color: var(--text);
  line-height: 1.18;
  letter-spacing: 0;
}

h1 {
  overflow: hidden;
  font-size: 24px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

h2 {
  font-size: 20px;
  font-weight: 750;
}

.topbar-right {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.topbar-nav,
.topbar-account {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 42px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfdfc;
}

.topbar-nav a,
.topbar-account .balance,
.topbar-account .nav-redeem,
.topbar-account .logout-link {
  height: 34px;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  padding: 0 12px;
  color: var(--text-soft);
  background: transparent;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.topbar-nav a.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 8px 16px rgba(66, 184, 131, 0.22);
}

.topbar-nav a:not(.active):hover,
.topbar-account .logout-link:hover {
  background: var(--primary-soft);
  color: var(--primary);
}

.topbar-account .balance {
  min-width: 88px;
  background: #fff;
  color: var(--primary);
}

.topbar-account .nav-redeem {
  min-width: 68px;
  background: linear-gradient(135deg, #42d392 0%, var(--primary) 100%);
  color: #fff;
  box-shadow: 0 8px 16px rgba(66, 184, 131, 0.2);
}

.topbar-account .nav-redeem:hover {
  background: linear-gradient(180deg, var(--primary) 0%, var(--primary-dark) 100%);
}

.grid {
  display: grid;
  gap: 16px;
}

.two-col {
  grid-template-columns: minmax(320px, 400px) minmax(0, 1fr);
  align-items: stretch;
}

.narrow-left {
  grid-template-columns: minmax(280px, 380px) minmax(0, 1fr);
}

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

.card {
  padding: 20px;
}

.section-card {
  margin-top: 16px;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 50px;
  margin-bottom: 16px;
}

.card-head > div {
  min-width: 0;
}

.card-head-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
  flex-wrap: wrap;
}

.form {
  display: grid;
  gap: 14px;
}

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

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

.field span {
  color: var(--text-soft);
  font-size: 14px;
  font-weight: 700;
}

.field-hint {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  outline: none;
  background: #fbfdff;
  color: var(--text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

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

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

input:hover,
select:hover,
textarea:hover {
  border-color: #9bdcbf;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(66, 184, 131, 0.14);
}

input[readonly] {
  background: var(--surface-soft);
  color: var(--muted);
}

.button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 0 14px;
  font-weight: 750;
  line-height: 1;
  text-align: center;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.button.primary {
  background: linear-gradient(135deg, #42d392 0%, var(--primary) 100%);
  color: #fff;
  box-shadow: 0 10px 20px rgba(66, 184, 131, 0.22);
}

.button.primary:hover {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
}

.button.secondary {
  border-color: var(--line);
  background: #fff;
  color: var(--text-soft);
}

.button.secondary:hover,
.button.secondary.active {
  border-color: #9bdcbf;
  background: var(--primary-soft);
  color: var(--primary);
}

.button.secondary.disabled {
  pointer-events: none;
  opacity: 0.5;
}

.button.danger {
  border-color: #fecaca;
  background: #fff;
  color: var(--danger);
}

.button.danger:hover {
  background: var(--danger-soft);
}

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

.badge,
.status {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0 10px;
  background: var(--surface-soft);
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 750;
  white-space: nowrap;
}

.status.succeeded,
.alert.success,
.inline-message.success {
  background: var(--success-soft);
  color: #166534;
  border-color: #bbf7d0;
}

.status.failed,
.alert.error,
.inline-message.error {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: #fecaca;
}

.status.running,
.status.queued,
.alert.warning,
.inline-message.warning {
  background: var(--warning-soft);
  color: var(--warning);
  border-color: #fed7aa;
}

.status.deleted {
  background: #f2f4f7;
  color: var(--muted);
  border-color: var(--line-strong);
}

.alert,
.inline-message {
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  background: #fff;
  color: var(--text-soft);
  font-weight: 650;
}

.inline-message {
  margin: 14px 0 0;
}

.generation-notice {
  margin-bottom: 14px;
  border: 1px solid #f6d58b;
  border-radius: 10px;
  padding: 11px 12px;
  background: #fff8e6;
  color: #9a6700;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.6;
}

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

.mode-toggle label {
  min-height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--text-soft);
  font-weight: 800;
}

.mode-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.mode-toggle label:has(input:checked) {
  border-color: #9bdcbf;
  background: var(--primary-soft);
  color: var(--primary);
}

.edit-upload-field input {
  height: auto;
  padding: 10px 12px;
}

.edit-upload-box {
  position: relative;
  min-height: 92px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  border: 1px dashed #98a2b3;
  border-radius: 10px;
  padding: 16px;
  background: #f8fafc;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.edit-upload-box:hover {
  border-color: var(--primary);
  background: #f3fbf7;
  box-shadow: 0 0 0 3px rgba(22, 160, 109, 0.08);
}

.edit-upload-box input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.edit-upload-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: #e8f6ef;
  color: var(--primary-dark);
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
}

.edit-upload-box strong {
  display: block;
  color: #101828;
  font-size: 14px;
  font-weight: 850;
}

.edit-upload-box small {
  display: block;
  margin-top: 4px;
  color: #667085;
  font-size: 12px;
  font-weight: 650;
}

.edit-upload-preview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(78px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.edit-preview-item {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.edit-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.edit-preview-item button {
  position: absolute;
  right: 6px;
  bottom: 6px;
  border: 0;
  border-radius: 6px;
  padding: 4px 7px;
  background: rgba(17, 24, 39, 0.78);
  color: #fff;
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}

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

.auth-wrap {
  min-height: 62vh;
  display: grid;
  place-items: center;
}

.simple-auth {
  min-height: calc(100vh - 150px);
}

.auth-dashboard {
  min-height: calc(100vh - 142px);
  width: 100%;
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, 440px);
  gap: 24px;
  align-items: stretch;
  place-items: stretch;
}

.auth-info,
.auth-form-card {
  min-height: 520px;
}

.auth-info {
  position: relative;
  overflow: hidden;
  display: grid;
  align-content: space-between;
  border: 1px solid rgba(208, 213, 221, 0.92);
  border-radius: var(--radius);
  padding: 28px;
  background:
    linear-gradient(135deg, rgba(66, 184, 131, 0.12), transparent 42%),
    linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
  box-shadow: var(--shadow);
}

.auth-info::after {
  content: "";
  position: absolute;
  right: 28px;
  bottom: 28px;
  width: min(320px, 46%);
  height: 160px;
  border: 1px solid rgba(66, 184, 131, 0.16);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(249, 251, 250, 0.8)),
    repeating-linear-gradient(0deg, transparent 0 23px, rgba(66, 184, 131, 0.12) 24px);
  opacity: 0.76;
}

.auth-info::before {
  content: "";
  position: absolute;
  inset: 24px 24px auto auto;
  width: min(360px, 42%);
  aspect-ratio: 1;
  border: 1px solid rgba(66, 184, 131, 0.18);
  border-radius: 50%;
  background:
    linear-gradient(90deg, rgba(66, 184, 131, 0.16) 1px, transparent 1px),
    linear-gradient(180deg, rgba(66, 184, 131, 0.16) 1px, transparent 1px);
  background-size: 28px 28px;
  opacity: 0.72;
}

.auth-info-head,
.auth-metrics {
  position: relative;
  z-index: 2;
}

.auth-tag {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  border: 1px solid #9bdcbf;
  border-radius: 999px;
  padding: 0 12px;
  background: #fff;
  color: var(--primary);
  font-size: 13px;
  font-weight: 800;
}

.auth-info h2 {
  max-width: 560px;
  margin-top: 22px;
  font-size: 42px;
  line-height: 1.08;
}

.auth-info p {
  max-width: 500px;
  margin: 14px 0 0;
  color: var(--text-soft);
  font-size: 16px;
  font-weight: 650;
}

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

.auth-metrics div {
  min-height: 92px;
  display: grid;
  align-content: center;
  gap: 7px;
  border: 1px solid rgba(208, 213, 221, 0.88);
  border-radius: var(--radius);
  padding: 14px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow-soft);
}

.auth-metrics span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.auth-metrics strong {
  overflow: hidden;
  color: var(--text);
  font-size: 18px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-card {
  width: min(440px, 100%);
}

.auth-form-card {
  width: 100%;
  display: grid;
  align-content: center;
  align-self: stretch;
  padding: 30px;
}

.auth-card.wide {
  width: min(640px, 100%);
}

.auth-card h2 {
  margin-bottom: 18px;
}

.auth-card-head {
  margin-bottom: 22px;
}

.auth-card-head h2 {
  margin-bottom: 8px;
  font-size: 26px;
  color: var(--text);
}

.auth-form-card .field input {
  background: #fff;
}

.auth-form-card .field input::placeholder {
  color: #98a2b3;
}

.auth-card-head span,
.auth-switch {
  color: var(--muted);
  font-weight: 650;
}

.auth-form-card .button.primary {
  width: 100%;
  min-height: 46px;
  margin-top: 4px;
}

.auth-switch {
  margin: 18px 0 0;
  text-align: center;
}

.setup-card {
  width: min(920px, 100%);
  margin: 0 auto;
}

.setup-form {
  gap: 18px;
}

.setup-section {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  background: #fbfdfc;
}

.setup-section h3 {
  margin: 0;
  color: var(--text);
  font-size: 16px;
}

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

.preview-card {
  display: grid;
  grid-template-rows: auto minmax(390px, 1fr);
}

.preview-stage {
  min-height: 390px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(45deg, rgba(208, 213, 221, 0.42) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(208, 213, 221, 0.42) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(208, 213, 221, 0.42) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(208, 213, 221, 0.42) 75%),
    #f9fbff;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
  background-size: 20px 20px;
}

.preview-stage img {
  width: 100%;
  height: 100%;
  max-height: 620px;
  object-fit: contain;
  background: #fff;
}

.empty-state,
.preview-loading {
  width: min(240px, 90%);
  min-height: 116px;
  display: grid;
  place-items: center;
  gap: 8px;
  border: 1px dashed #b8c7dc;
  border-radius: var(--radius);
  padding: 18px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--muted);
  text-align: center;
  font-weight: 700;
}

.preview-loading span {
  font-size: 13px;
  font-weight: 600;
}

.preview-error {
  width: min(360px, 92%);
  min-height: 128px;
  display: grid;
  place-items: center;
  gap: 8px;
  border: 1px solid #fecaca;
  border-radius: var(--radius);
  padding: 18px;
  background: var(--danger-soft);
  color: var(--danger);
  text-align: center;
  font-weight: 700;
}

.preview-error span {
  color: #991b1b;
  font-size: 13px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.preview-spinner {
  width: 34px;
  height: 34px;
  border: 3px solid #dbeafe;
  border-top-color: var(--primary);
  border-radius: 999px;
  animation: spin 0.8s linear infinite;
}

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

.history-list .record-card {
  height: 236px;
  min-height: 236px;
  display: grid;
  grid-template-rows: 128px minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0;
  background: #fff;
  color: inherit;
  cursor: pointer;
  text-align: left;
  box-shadow: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.history-list .record-card:hover {
  border-color: #9bdcbf;
  background: #fbfdfc;
  box-shadow: var(--shadow-soft);
}

.history-list .record-card:focus-visible {
  outline: 3px solid rgba(66, 184, 131, 0.16);
  outline-offset: 2px;
}

.record-image {
  display: grid;
  place-items: center;
  overflow: hidden;
  background: linear-gradient(135deg, #e8f7f0, #f9fbfa);
  color: var(--muted);
  font-weight: 750;
}

.record-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.record-body {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 7px;
  padding: 10px;
}

.record-meta {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.record-meta span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.record-meta span:first-child {
  color: var(--primary);
}

.record-body p {
  max-height: 42px;
  margin: 0;
  overflow: hidden;
  color: #1f2937;
  font-size: 13px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.record-body time {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.record-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
}

.record-delete {
  min-height: 28px;
  border: 1px solid #fecaca;
  border-radius: 6px;
  padding: 0 9px;
  background: #fff;
  color: var(--danger);
  font-size: 12px;
  font-weight: 800;
}

.record-delete:hover {
  background: var(--danger-soft);
}

.history-empty-inline {
  grid-column: 1 / -1;
  min-height: 92px;
  display: grid;
  place-items: center;
  border: 1px dashed #b8c7dc;
  border-radius: var(--radius);
  color: var(--muted);
  background: #fbfdff;
  font-weight: 750;
}

.records-page-card {
  margin-top: 0;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 18px;
}

.pagination span {
  color: var(--muted);
  font-weight: 750;
}

.admin-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  overflow-x: auto;
  padding-bottom: 2px;
}

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

.stat-card {
  padding: 16px;
}

.stat-card span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.stat-card strong {
  display: block;
  margin-top: 6px;
  color: var(--text);
  font-size: 30px;
  line-height: 1.1;
}

.table-wrap {
  width: 100%;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

table {
  width: 100%;
  min-width: 760px;
  table-layout: fixed;
  border-collapse: collapse;
  background: #fff;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 11px 12px;
  text-align: left;
  vertical-align: top;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

tr:last-child td {
  border-bottom: 0;
}

th {
  background: #f8fafc;
  color: var(--muted);
  font-weight: 800;
  white-space: nowrap;
}

tr.is-deleted td {
  background: #fafafa;
  color: var(--muted);
}

[data-admin-records] {
  min-width: 1180px;
}

[data-admin-records] th:nth-child(1),
[data-admin-records] td:nth-child(1) {
  width: 110px;
}

[data-admin-records] th:nth-child(2),
[data-admin-records] td:nth-child(2) {
  width: 92px;
}

[data-admin-records] th:nth-child(3),
[data-admin-records] td:nth-child(3) {
  width: 130px;
}

[data-admin-records] th:nth-child(4),
[data-admin-records] td:nth-child(4) {
  width: 88px;
}

[data-admin-records] th:nth-child(5),
[data-admin-records] td:nth-child(5) {
  width: 92px;
}

[data-admin-records] th:nth-child(7),
[data-admin-records] td:nth-child(7) {
  width: 176px;
}

[data-admin-records] th:nth-child(8),
[data-admin-records] td:nth-child(8) {
  width: 150px;
}

[data-admin-users] {
  min-width: 1080px;
}

[data-admin-users] th:nth-child(1),
[data-admin-users] td:nth-child(1) {
  width: 260px;
}

[data-admin-users] th:nth-child(2),
[data-admin-users] td:nth-child(2) {
  width: 190px;
}

[data-admin-users] th:nth-child(3),
[data-admin-users] td:nth-child(3),
[data-admin-users] th:nth-child(4),
[data-admin-users] td:nth-child(4),
[data-admin-users] th:nth-child(5),
[data-admin-users] td:nth-child(5) {
  width: 96px;
}

[data-admin-users] th:nth-child(6),
[data-admin-users] td:nth-child(6) {
  width: 340px;
}

[data-admin-codes] {
  min-width: 980px;
}

[data-admin-codes] th:nth-child(1),
[data-admin-codes] td:nth-child(1) {
  width: 190px;
}

[data-admin-codes] th:nth-child(2),
[data-admin-codes] td:nth-child(2),
[data-admin-codes] th:nth-child(3),
[data-admin-codes] td:nth-child(3),
[data-admin-codes] th:nth-child(4),
[data-admin-codes] td:nth-child(4),
[data-admin-codes] th:nth-child(5),
[data-admin-codes] td:nth-child(5) {
  width: 96px;
}

[data-admin-codes] th:nth-child(6),
[data-admin-codes] td:nth-child(6),
[data-admin-codes] th:nth-child(8),
[data-admin-codes] td:nth-child(8) {
  width: 170px;
}

[data-admin-codes] th:nth-child(7),
[data-admin-codes] td:nth-child(7) {
  width: 120px;
}

.admin-prompt-cell {
  color: var(--text-soft);
  max-width: 360px;
}

.admin-record-row td {
  vertical-align: middle;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-user-cell {
  max-width: 130px;
  font-weight: 750;
}

.admin-record-id {
  margin-right: 8px;
  color: var(--text);
  font-weight: 850;
}

.deleted-time {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.table-thumb {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  color: var(--muted);
  padding: 0;
}

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

.inline-delete-form {
  display: inline-flex;
  margin: 0 0 0 6px;
}

.filter-bar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(150px, 190px) auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 14px;
}

.filter-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
}

.code-create-card .card-head {
  margin-bottom: 12px;
}

.code-create-form {
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
  align-items: end;
}

.code-create-form .button {
  min-width: 96px;
}

.user-identity {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.user-identity strong,
.user-identity span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-identity strong {
  color: var(--text);
  font-weight: 850;
}

.user-identity > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.inline-admin-form,
.table-action-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  margin: 0;
  vertical-align: middle;
}

.table-action-group {
  width: 100%;
  flex-wrap: nowrap;
}

.compact-input {
  width: 82px;
  height: 34px;
  border-radius: 8px;
  padding: 0 9px;
  font-size: 13px;
}

.compact-input.password-input {
  width: 132px;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 13px;
}

.redeem-dialog,
.record-dialog,
.generation-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.48);
  backdrop-filter: blur(10px);
}

.generation-overlay {
  z-index: 10002;
  pointer-events: auto;
}

.redeem-panel,
.record-dialog-panel,
.generation-modal {
  width: min(430px, 100%);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 28px 90px rgba(16, 24, 40, 0.3);
}

.record-dialog-panel {
  width: min(920px, 100%);
  max-height: min(860px, calc(100vh - 40px));
  overflow: auto;
}

.generation-modal {
  display: grid;
  justify-items: center;
  gap: 14px;
  padding: 26px 22px;
  text-align: center;
}

.generation-modal h2 {
  font-size: 22px;
}

.generation-modal p {
  margin: 0;
  color: var(--muted);
  font-weight: 650;
}

.generation-loader {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  height: 42px;
}

.generation-loader span {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--primary);
  animation: pulse 0.9s ease-in-out infinite;
}

.generation-loader span:nth-child(2) {
  animation-delay: 0.12s;
}

.generation-loader span:nth-child(3) {
  animation-delay: 0.24s;
}

.generation-progress {
  width: 100%;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--primary-soft);
}

.generation-progress i {
  width: 42%;
  height: 100%;
  display: block;
  border-radius: inherit;
  background: linear-gradient(90deg, #42d392, var(--primary));
  animation: progress 1.3s ease-in-out infinite;
}

.redeem-head,
.record-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--line);
  padding: 18px 20px;
  background: rgba(255, 255, 255, 0.96);
}

.record-dialog-head {
  position: sticky;
  top: 0;
  z-index: 1;
  backdrop-filter: blur(12px);
}

.redeem-form {
  padding: 20px;
}

.dialog-close {
  min-width: 72px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 0 12px;
  background: #fff;
  color: var(--text-soft);
  font-size: 14px;
  font-weight: 750;
}

.dialog-close:hover {
  border-color: #9bdcbf;
  background: var(--primary-soft);
  color: var(--primary);
}

.record-dialog-body {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  padding: 20px;
}

.record-dialog-image {
  min-height: 420px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(135deg, #e8f7f0, #f9fbfa);
  color: var(--muted);
  font-weight: 750;
}

.record-dialog-image-button {
  width: 100%;
  height: 100%;
  min-height: inherit;
  display: grid;
  place-items: center;
  border: 0;
  padding: 0;
  background: transparent;
}

.record-dialog-image-button img,
.record-dialog-image img {
  width: 100%;
  height: 100%;
  max-height: 640px;
  object-fit: contain;
  background: #fff;
}

.record-input-images {
  display: grid;
  gap: 10px;
}

.record-input-images > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.record-input-images [data-dialog-input-list] {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 10px;
}

.record-input-image-button {
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 0;
  cursor: zoom-in;
}

.record-input-image-button img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-viewer {
  position: fixed;
  inset: 0;
  z-index: 10020;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  padding: 16px;
  background: rgba(15, 23, 42, 0.86);
}

.image-viewer-toolbar {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.image-viewer-toolbar button,
.image-viewer-toolbar span {
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: var(--radius);
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-weight: 800;
}

.image-viewer-toolbar span {
  min-width: 72px;
}

.image-viewer-stage {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius);
  background: rgba(15, 23, 42, 0.48);
  cursor: grab;
}

.image-viewer-canvas {
  min-width: 100%;
  min-height: 100%;
  display: grid;
  place-items: center;
}

.image-viewer-stage.is-dragging {
  cursor: grabbing;
}

.image-viewer-stage img {
  display: block;
  max-width: none;
  max-height: none;
  object-fit: contain;
  background: #fff;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.34);
  user-select: none;
}

.record-detail-grid {
  display: grid;
  grid-template-columns: minmax(120px, 0.7fr) minmax(190px, 1fr) minmax(120px, 0.7fr) minmax(360px, 2fr);
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.record-detail-grid div {
  min-height: 62px;
  display: grid;
  align-content: center;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 11px;
  background: #fbfdff;
}

.record-detail-grid .record-detail-time {
  min-width: 360px;
}

.record-detail-grid .record-detail-status strong {
  width: fit-content;
}

.record-detail-grid span,
.record-full-prompt span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.record-detail-grid strong {
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 13px;
}

.record-detail-grid strong.status {
  color: inherit;
  font-size: 13px;
}

.record-full-prompt {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: #fff;
}

.record-full-prompt p {
  max-height: 132px;
  overflow: auto;
  margin: 0;
  color: #1f2937;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.record-error {
  grid-column: 1 / -1;
  border: 1px solid #fecaca;
  border-radius: var(--radius);
  padding: 12px;
  background: var(--danger-soft);
  color: var(--danger);
}

.history-list::-webkit-scrollbar,
.record-full-prompt p::-webkit-scrollbar,
.record-dialog-panel::-webkit-scrollbar,
.admin-nav::-webkit-scrollbar,
.table-wrap::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.history-list::-webkit-scrollbar-thumb,
.record-full-prompt p::-webkit-scrollbar-thumb,
.record-dialog-panel::-webkit-scrollbar-thumb,
.admin-nav::-webkit-scrollbar-thumb,
.table-wrap::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: #c8d5e6;
}

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

@keyframes pulse {
  0%,
  100% {
    transform: translateY(0);
    opacity: 0.45;
  }
  50% {
    transform: translateY(-7px);
    opacity: 1;
  }
}

@keyframes progress {
  0% {
    transform: translateX(-110%);
  }
  100% {
    transform: translateX(260%);
  }
}

@media (max-width: 1180px) {
  .history-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .app-topbar {
    grid-template-columns: 1fr;
    gap: 12px;
  }

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

  .two-col,
  .narrow-left,
  .auth-dashboard {
    grid-template-columns: 1fr;
  }

  .auth-info,
  .auth-form-card {
    min-height: auto;
  }

  .auth-info {
    gap: 28px;
  }

  .preview-card {
    grid-template-rows: auto minmax(300px, auto);
  }

  .preview-stage {
    min-height: 300px;
  }

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

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

  .code-create-form .button {
    width: 100%;
  }
}

@media (max-width: 720px) {
  .app-shell {
    width: min(100% - 16px, 1180px);
    padding-top: 8px;
    padding-bottom: 24px;
  }

  .app-topbar {
    min-height: auto;
    padding: 12px;
  }

  .topbar-brand {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .brand-mark {
    width: 38px;
    height: 38px;
    font-size: 18px;
  }

  h1 {
    font-size: 22px;
  }

  h2 {
    font-size: 19px;
  }

  .topbar-right {
    display: grid;
    gap: 8px;
    width: 100%;
  }

  .topbar-nav,
  .topbar-account {
    width: 100%;
    min-height: 40px;
  }

  .topbar-nav {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
  }

  .topbar-account {
    display: grid;
    grid-template-columns: minmax(78px, 1fr) auto auto auto;
  }

  .topbar-nav a,
  .topbar-account .balance,
  .topbar-account .nav-redeem,
  .topbar-account .logout-link {
    height: 32px;
    min-height: 32px;
    padding: 0 10px;
    font-size: 13px;
  }

  .card {
    padding: 14px;
  }

  .card-head {
    align-items: flex-start;
    min-height: auto;
    gap: 10px;
    margin-bottom: 14px;
  }

  .field-grid,
  .stats-grid,
  .auth-metrics,
  .generate-actions,
  .filter-bar,
  .code-create-form {
    grid-template-columns: 1fr;
  }

  .card-head-actions,
  .filter-actions {
    width: 100%;
  }

  .card-head-actions .button,
  .filter-actions .button {
    flex: 1;
  }

  .auth-dashboard {
    gap: 12px;
  }

  .auth-info,
  .auth-form-card {
    padding: 16px;
  }

  .auth-info h2 {
    font-size: 28px;
  }

  input,
  select {
    height: 42px;
  }

  textarea {
    min-height: 138px;
  }

  .button {
    min-height: 42px;
  }

  .history-list {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .history-list .record-card {
    height: 108px;
    min-height: 108px;
    grid-template-columns: 92px minmax(0, 1fr);
    grid-template-rows: 1fr;
    gap: 10px;
    padding: 8px;
  }

  .history-list .record-image {
    width: 92px;
    height: 92px;
    border-radius: var(--radius);
  }

  .history-list .record-body {
    align-content: center;
    padding: 0;
  }

  .redeem-dialog,
  .record-dialog,
  .generation-overlay {
    align-items: end;
    padding: 10px;
  }

  .redeem-panel,
  .generation-modal {
    width: 100%;
  }

  .record-dialog-panel {
    max-height: calc(100vh - 20px);
  }

  .redeem-head,
  .record-dialog-head,
  .redeem-form {
    padding: 14px;
  }

  .record-dialog-body {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 14px;
  }

  .record-dialog-image {
    min-height: 280px;
  }

  .pagination {
    display: grid;
    grid-template-columns: 1fr;
    text-align: center;
  }

  .image-viewer {
    padding: 10px;
  }

  .image-viewer-toolbar {
    justify-content: stretch;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .image-viewer-toolbar button,
  .image-viewer-toolbar span {
    width: 100%;
    padding: 0 8px;
    font-size: 13px;
  }

  .record-detail-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 380px) {
  .app-shell {
    width: min(100% - 12px, 1180px);
  }

  .topbar-account {
    grid-template-columns: 1fr 1fr;
  }

  .topbar-account .balance {
    grid-column: 1 / -1;
  }
}

/* Enterprise UI refresh */
:root {
  --bg: #f3f6f8;
  --surface: #ffffff;
  --surface-soft: #f6f8fb;
  --text: #172033;
  --text-soft: #344054;
  --muted: #667085;
  --line: #e4e7ec;
  --line-strong: #d0d5dd;
  --primary: #16a06d;
  --primary-dark: #087f5b;
  --primary-soft: #e8f6ef;
  --success: #16a06d;
  --success-soft: #e8f6ef;
  --warning: #b7791f;
  --warning-soft: #fff7e6;
  --danger: #d92d20;
  --danger-soft: #fff1f0;
  --shadow: 0 18px 44px rgba(16, 24, 40, 0.08);
  --shadow-soft: 0 8px 24px rgba(16, 24, 40, 0.05);
  --radius: 8px;
}

html {
  background: var(--bg);
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.74) 0, rgba(243, 246, 248, 0) 280px),
    linear-gradient(90deg, rgba(22, 160, 109, 0.06) 0, transparent 36%),
    var(--bg);
  color: var(--text);
  font-size: 14px;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

.app-shell {
  width: calc(100% - 36px);
  max-width: 1440px;
  padding-top: 14px;
}

.app-topbar,
.topbar-brand,
.topbar-right,
.topbar-nav,
.topbar-account,
.grid,
.two-col,
.section-card,
.preview-card {
  min-width: 0;
  max-width: 100%;
}

.app-topbar {
  position: sticky;
  top: 12px;
  z-index: 1000;
  min-height: 62px;
  margin-bottom: 18px;
  border-color: rgba(228, 231, 236, 0.92);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 10px 30px rgba(16, 24, 40, 0.07);
}

.brand-mark {
  border-radius: 8px;
  background: linear-gradient(135deg, #19b37b 0%, #12875f 100%);
  box-shadow: 0 10px 20px rgba(22, 160, 109, 0.22);
}

h1 {
  font-size: 21px;
  font-weight: 850;
}

h2 {
  font-size: 19px;
  font-weight: 800;
}

.eyebrow {
  color: #7a8699;
  font-size: 11px;
  text-transform: uppercase;
}

.topbar-nav,
.topbar-account {
  border-color: #eaecf0;
  border-radius: 8px;
  background: #f8fafc;
}

.topbar-nav a,
.topbar-account .balance,
.topbar-account .nav-redeem,
.topbar-account .logout-link {
  border-radius: 6px;
  color: #475467;
  font-size: 13px;
  font-weight: 750;
}

.topbar-nav a.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 8px 18px rgba(22, 160, 109, 0.2);
}

.topbar-nav a:not(.active):hover,
.topbar-account .logout-link:hover {
  background: #eef2f6;
  color: var(--text);
}

.topbar-account .balance {
  border: 1px solid #d6f0e4;
  background: #f1fbf6;
  color: var(--primary-dark);
}

.topbar-account .nav-redeem {
  border: 1px solid #087f5b;
  background: #087f5b;
  color: #ffffff;
  font-weight: 850;
  box-shadow: 0 8px 18px rgba(8, 127, 91, 0.22);
}

.topbar-account .nav-redeem:hover {
  border-color: #06684b;
  background: #06684b;
  color: #ffffff;
}

.grid {
  gap: 18px;
}

.two-col {
  grid-template-columns: minmax(360px, 430px) minmax(0, 1fr);
}

.card,
.stat-card {
  min-width: 0;
  border-color: #e4e7ec;
  border-radius: 10px;
  box-shadow: var(--shadow-soft);
}

.card {
  padding: 18px;
}

.section-card {
  margin-top: 18px;
}

.card-head {
  min-height: 46px;
  margin-bottom: 16px;
}

.card-head h2 {
  display: flex;
  align-items: center;
  gap: 8px;
}

.form {
  gap: 13px;
}

.field span {
  color: #475467;
  font-size: 13px;
  font-weight: 760;
}

input,
select,
textarea {
  border-color: #d0d5dd;
  border-radius: 8px;
  background: #fff;
  color: #101828;
}

input,
select {
  height: 42px;
}

textarea {
  min-height: 144px;
}

input:hover,
select:hover,
textarea:hover {
  border-color: #98a2b3;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(22, 160, 109, 0.13);
}

.button {
  min-height: 40px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 780;
  box-shadow: none;
}

.button.primary {
  border-color: var(--primary);
  background: var(--primary);
  box-shadow: none;
}

.button.primary:hover {
  background: var(--primary-dark);
}

.button.secondary {
  border-color: #d0d5dd;
  background: #fff;
  color: #344054;
}

.button.secondary:hover,
.button.secondary.active {
  border-color: #98a2b3;
  background: #f2f4f7;
  color: #101828;
}

.button.online-action {
  border-color: #9bdcbf;
  background: #e8f6ef;
  color: var(--primary-dark);
}

.button.online-action:hover,
.button.online-action:focus-visible {
  border-color: var(--primary);
  background: #d8f3e5;
  color: #06684b;
}

.button.danger {
  border-color: #fecdca;
  background: #fff;
}

.badge,
.status {
  min-height: 26px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 800;
}

.badge {
  border-color: #d0d5dd;
  background: #fff;
}

.alert,
.inline-message,
.generation-notice {
  border-radius: 8px;
  box-shadow: none;
}

.generation-notice {
  border-color: #f6d58b;
  background: #fffaf0;
}

.mode-toggle {
  gap: 10px;
}

.mode-toggle label {
  min-height: 40px;
  border-radius: 8px;
  background: #f8fafc;
}

.mode-toggle label:has(input:checked) {
  border-color: #8de0bb;
  background: #e8f6ef;
  color: var(--primary-dark);
}

.edit-upload-preview {
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
}

.preview-card {
  display: grid;
  grid-template-rows: auto minmax(520px, 1fr);
}

.preview-stage {
  min-height: 520px;
  border: 1px solid #e4e7ec;
  border-radius: 10px;
  background:
    linear-gradient(45deg, #f8fafc 25%, transparent 25%),
    linear-gradient(-45deg, #f8fafc 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #f8fafc 75%),
    linear-gradient(-45deg, transparent 75%, #f8fafc 75%),
    #fff;
  background-position: 0 0, 0 12px, 12px -12px, -12px 0;
  background-size: 24px 24px;
}

.preview-stage img {
  max-width: calc(100% - 24px);
  max-height: calc(100% - 24px);
  border-radius: 8px;
  box-shadow: 0 18px 42px rgba(16, 24, 40, 0.14);
}

.history-list {
  gap: 14px;
  padding-bottom: 4px;
}

.history-list .record-card {
  border-color: #e4e7ec;
  border-radius: 10px;
  background: #fff;
  box-shadow: none;
}

.history-list .record-card:hover {
  border-color: #b9c3d0;
  box-shadow: 0 12px 26px rgba(16, 24, 40, 0.08);
}

.history-list .record-image {
  border-radius: 8px;
  background: #f2f4f7;
}

.record-meta span:first-child {
  font-weight: 850;
}

.record-body p,
.admin-prompt-cell {
  color: #475467;
}

.admin-nav {
  gap: 8px;
  margin-bottom: 18px;
  padding: 6px;
  border: 1px solid #e4e7ec;
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.admin-nav .button {
  min-height: 36px;
  border: 0;
}

.admin-nav .button.secondary.active {
  background: var(--primary);
  color: #fff;
}

.admin-version-footer {
  margin-top: 22px;
  padding: 14px 0 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

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

.stat-card {
  min-height: 96px;
  padding: 16px;
  background: linear-gradient(180deg, #fff 0%, #fbfcfe 100%);
}

.stat-card span {
  color: #667085;
  font-size: 12px;
  font-weight: 760;
}

.stat-card strong {
  margin-top: 8px;
  color: #101828;
  font-size: 26px;
  font-weight: 880;
}

.table-wrap {
  border: 1px solid #e4e7ec;
  border-radius: 10px;
  background: #fff;
}

table {
  border-collapse: separate;
  border-spacing: 0;
}

th,
td {
  border-bottom: 1px solid #eaecf0;
  padding: 12px 14px;
}

th {
  background: #f8fafc;
  color: #667085;
  font-size: 12px;
  text-transform: uppercase;
}

tbody tr:hover td {
  background: #fbfcfe;
}

tr:last-child td {
  border-bottom: 0;
}

.table-thumb {
  width: 52px;
  height: 52px;
  border-radius: 8px;
}

.inline-admin-form,
.table-action-group {
  gap: 7px;
}

.compact-input {
  height: 34px;
  border-radius: 7px;
}

.filter-bar {
  grid-template-columns: minmax(260px, 1fr) minmax(170px, 220px) auto;
  padding: 12px;
  border: 1px solid #e4e7ec;
  border-radius: 10px;
  background: #f8fafc;
}

.code-create-card {
  background: linear-gradient(180deg, #fff 0%, #fbfcfe 100%);
}

.code-create-form {
  grid-template-columns: repeat(4, minmax(160px, 1fr)) auto;
}

.auth-dashboard {
  min-height: calc(100vh - 140px);
  grid-template-columns: minmax(0, 1fr) minmax(380px, 440px);
}

.auth-info,
.auth-form-card {
  min-height: 540px;
  border-radius: 10px;
}

.auth-info {
  background:
    linear-gradient(135deg, rgba(22, 160, 109, 0.12), transparent 42%),
    linear-gradient(180deg, #fff 0%, #f7fafc 100%);
}

.auth-info h2 {
  max-width: 620px;
  color: #101828;
}

.auth-info p {
  max-width: 560px;
  color: #475467;
}

.auth-tag {
  border-color: #b7ebcf;
  background: #edfcf4;
  color: var(--primary-dark);
}

.auth-metrics div {
  border-color: #e4e7ec;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
}

.record-dialog-panel,
.redeem-panel {
  border-radius: 10px;
}

.record-dialog-head,
.redeem-head {
  border-bottom: 1px solid #eaecf0;
  background: #f8fafc;
}

.record-dialog-image {
  border-radius: 10px;
  background: #f8fafc;
}

.record-detail-grid div,
.record-full-prompt,
.record-input-images {
  border-color: #e4e7ec;
  border-radius: 8px;
}

.image-viewer-toolbar button,
.image-viewer-toolbar span {
  border-radius: 8px;
}

@media (max-width: 1180px) {
  .app-shell {
    width: calc(100% - 24px);
    max-width: 1180px;
  }

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

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

@media (max-width: 980px) {
  .app-topbar {
    position: static;
  }

  .two-col,
  .auth-dashboard {
    grid-template-columns: 1fr;
  }

  .preview-card {
    grid-template-rows: auto minmax(340px, auto);
  }

  .preview-stage {
    min-height: 340px;
  }
}

@media (max-width: 720px) {
  .app-shell {
    width: calc(100% - 16px);
    max-width: 720px;
    padding-top: 8px;
  }

  .app-topbar,
  .card,
  .stat-card,
  .admin-nav,
  .table-wrap {
    border-radius: 8px;
  }

  .topbar-account {
    grid-template-columns: minmax(0, 1fr) repeat(3, auto);
  }

  .stats-grid,
  .filter-bar,
  .code-create-form,
  .field-grid {
    grid-template-columns: 1fr;
  }

  .auth-info,
  .auth-form-card {
    min-height: auto;
  }

  .auth-info h2 {
    font-size: 26px;
  }

  .history-list .record-card {
    min-height: 112px;
  }

  th,
  td {
    padding: 10px 12px;
  }
}

@media (max-width: 720px) {
  html,
  body.page-app {
    min-width: 0;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    overscroll-behavior-x: none;
  }

  body.page-app {
    position: relative;
    touch-action: pan-y;
  }

  body.page-app .app-shell {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    padding-right: 8px;
    padding-left: 8px;
  }

  body.page-app main,
  body.page-app section,
  body.page-app form,
  body.page-app label,
  body.page-app input,
  body.page-app select,
  body.page-app textarea,
  body.page-app button {
    max-width: 100%;
    min-width: 0;
  }

  body.page-app .app-topbar,
  body.page-app .card,
  body.page-app .generation-notice,
  body.page-app .preview-stage,
  body.page-app .history-list,
  body.page-app .history-list .record-card {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: hidden;
  }

  body.page-app .topbar-right,
  body.page-app .topbar-nav,
  body.page-app .topbar-account {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  body.page-app .topbar-account {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  body.page-app .topbar-nav a,
  body.page-app .topbar-account .balance,
  body.page-app .topbar-account .nav-redeem,
  body.page-app .topbar-account .logout-link {
    min-width: 0;
    padding-right: 6px;
    padding-left: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  body.page-app .card-head {
    min-width: 0;
    max-width: 100%;
  }

  body.page-app .generation-notice,
  body.page-app textarea {
    overflow-wrap: anywhere;
  }
}

/* Polished motion and depth layer */
:root {
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-soft: cubic-bezier(0.16, 1, 0.3, 1);
  --ring: 0 0 0 3px rgba(22, 160, 109, 0.16);
  --shadow-lift: 0 18px 44px rgba(16, 24, 40, 0.1);
}

html {
  scroll-behavior: smooth;
}

body {
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a,
button,
.button,
.topbar-nav a,
.topbar-account .balance,
.topbar-account .nav-redeem,
.topbar-account .logout-link,
.mode-toggle label,
.record-card,
.stat-card,
.table-thumb,
.record-input-image-button,
.record-dialog-image-button,
.dialog-close {
  transition:
    transform 0.22s var(--ease-out),
    border-color 0.22s var(--ease-out),
    background-color 0.22s var(--ease-out),
    color 0.22s var(--ease-out),
    box-shadow 0.22s var(--ease-out),
    opacity 0.22s var(--ease-out);
}

input,
select,
textarea {
  transition:
    border-color 0.2s var(--ease-out),
    box-shadow 0.2s var(--ease-out),
    background-color 0.2s var(--ease-out);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.record-card:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}

.app-topbar {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.9));
  backdrop-filter: blur(18px) saturate(1.18);
}

.topbar-brand:hover .brand-mark {
  transform: translateY(-1px) scale(1.03);
  box-shadow: 0 14px 26px rgba(22, 160, 109, 0.26);
}

.topbar-nav a.active,
.topbar-account .nav-redeem,
.button.primary {
  background: linear-gradient(135deg, #1dbf82 0%, var(--primary) 58%, #0d7f5b 100%);
}

.topbar-nav a:not(.active):hover,
.topbar-account .logout-link:hover,
.button.secondary:hover,
.dialog-close:hover {
  transform: translateY(-1px);
}

.button:not(:disabled):active,
.topbar-nav a:active,
.topbar-account .nav-redeem:active,
.dialog-close:active,
.mode-toggle label:active {
  transform: translateY(0) scale(0.985);
}

.button.primary:hover,
.topbar-account .nav-redeem:hover {
  box-shadow: 0 12px 24px rgba(8, 127, 91, 0.22);
}

.card,
.stat-card,
.auth-info,
.auth-form-card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.94)),
    var(--surface);
}

.card,
.stat-card {
  box-shadow: 0 1px 1px rgba(16, 24, 40, 0.03), var(--shadow-soft);
}

.card-head {
  position: relative;
}

.card-head::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -9px;
  left: 0;
  height: 1px;
  background: linear-gradient(90deg, rgba(22, 160, 109, 0.2), rgba(228, 231, 236, 0.72), transparent);
}

.badge {
  background: linear-gradient(180deg, #fff, #f8fafc);
}

.generation-notice {
  position: relative;
  overflow: hidden;
}

.generation-notice::before {
  content: "";
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: 0;
  width: 3px;
  border-radius: 999px;
  background: #d99a18;
}

.mode-toggle label {
  position: relative;
  overflow: hidden;
}

.mode-toggle label:has(input:checked) {
  box-shadow: inset 0 0 0 1px rgba(22, 160, 109, 0.12), 0 8px 20px rgba(22, 160, 109, 0.1);
}

.mode-toggle label:has(input:checked)::after {
  content: "";
  position: absolute;
  right: 12px;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--primary);
  box-shadow: 0 0 0 4px rgba(22, 160, 109, 0.12);
}

select {
  appearance: none;
  padding-right: 36px;
  background-image:
    linear-gradient(45deg, transparent 50%, #667085 50%),
    linear-gradient(135deg, #667085 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 18px,
    calc(100% - 13px) 18px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

textarea::placeholder,
input::placeholder {
  color: #98a2b3;
}

.edit-upload-box {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(248, 250, 252, 0.92)),
    #f8fafc;
}

.edit-upload-box:hover {
  transform: translateY(-1px);
}

.edit-preview-item,
.table-thumb,
.record-input-image-button {
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

.preview-stage {
  position: relative;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.preview-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.28), transparent 34%),
    radial-gradient(circle at 50% 0%, rgba(22, 160, 109, 0.08), transparent 46%);
}

.preview-stage > * {
  position: relative;
  z-index: 1;
}

.preview-stage img {
  animation: fadeLift 0.42s var(--ease-soft);
}

.empty-state,
.preview-loading,
.preview-error,
.history-empty-inline {
  box-shadow: 0 10px 28px rgba(16, 24, 40, 0.06);
}

.preview-spinner {
  border-color: rgba(22, 160, 109, 0.14);
  border-top-color: var(--primary);
}

.history-list .record-card {
  transform: translateZ(0);
}

.history-list .record-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lift);
}

.history-list .record-card:hover .record-image img,
.table-thumb:hover img,
.record-input-image-button:hover img {
  transform: scale(1.035);
}

.record-image img,
.table-thumb img,
.record-input-image-button img,
.record-dialog-image img {
  transition: transform 0.42s var(--ease-soft);
}

.record-delete:hover,
.button.danger:hover {
  transform: translateY(-1px);
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: #d0d5dd;
  box-shadow: var(--shadow-lift);
}

tbody tr td {
  transition: background-color 0.18s var(--ease-out);
}

.redeem-dialog,
.record-dialog,
.generation-overlay,
.image-viewer {
  animation: overlayIn 0.22s var(--ease-out);
}

.redeem-panel,
.record-dialog-panel,
.generation-modal {
  animation: panelIn 0.28s var(--ease-soft);
}

.image-viewer-stage img {
  animation: viewerIn 0.28s var(--ease-soft);
}

.jpt-layer-root {
  position: relative;
  z-index: 10040;
}

.jpt-toast-stack {
  position: fixed;
  top: 22px;
  right: 22px;
  z-index: 10060;
  display: grid;
  gap: 10px;
  width: min(360px, calc(100vw - 32px));
  pointer-events: none;
}

.jpt-toast {
  min-height: 46px;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  border: 1px solid rgba(228, 231, 236, 0.94);
  border-radius: 10px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--text-soft);
  box-shadow: 0 18px 44px rgba(16, 24, 40, 0.14);
  backdrop-filter: blur(18px) saturate(1.12);
  cursor: pointer;
  font-size: 14px;
  font-weight: 760;
  line-height: 1.45;
  overflow-wrap: anywhere;
  pointer-events: auto;
  animation: toastIn 0.28s var(--ease-soft);
}

.jpt-toast.is-leaving {
  animation: toastOut 0.18s var(--ease-out) forwards;
}

.jpt-toast-icon,
.jpt-layer-icon {
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: var(--primary);
}

.jpt-toast-icon {
  width: 18px;
  height: 18px;
  box-shadow: 0 0 0 4px rgba(22, 160, 109, 0.11);
}

.jpt-toast-icon::after,
.jpt-layer-icon::after {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: inherit;
  background: #fff;
}

.jpt-toast.success {
  border-color: #b7ebcf;
  color: #166534;
}

.jpt-toast.error {
  border-color: #fecdca;
  color: var(--danger);
}

.jpt-toast.warning {
  border-color: #fed7aa;
  color: var(--warning);
}

.jpt-toast.info {
  border-color: #d0d5dd;
}

.jpt-toast.success .jpt-toast-icon {
  background: var(--success);
}

.jpt-toast.error .jpt-toast-icon {
  background: var(--danger);
  box-shadow: 0 0 0 4px rgba(217, 45, 32, 0.1);
}

.jpt-toast.warning .jpt-toast-icon {
  background: var(--warning);
  box-shadow: 0 0 0 4px rgba(183, 121, 31, 0.12);
}

.jpt-toast.info .jpt-toast-icon {
  background: #475467;
  box-shadow: 0 0 0 4px rgba(71, 84, 103, 0.1);
}

.jpt-layer-overlay {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.48);
  backdrop-filter: blur(10px);
  animation: overlayIn 0.22s var(--ease-out);
}

.jpt-layer-overlay.is-leaving {
  animation: overlayOut 0.18s var(--ease-out) forwards;
}

.jpt-layer-panel {
  width: min(420px, 100%);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 28px 90px rgba(16, 24, 40, 0.3);
  animation: panelIn 0.28s var(--ease-soft);
}

.jpt-layer-overlay.is-leaving .jpt-layer-panel {
  animation: panelOut 0.18s var(--ease-out) forwards;
}

.jpt-layer-head {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 14px;
  padding: 22px 22px 18px;
}

.jpt-layer-icon {
  width: 40px;
  height: 40px;
  margin-top: 2px;
  background: var(--primary);
  box-shadow: 0 0 0 6px rgba(22, 160, 109, 0.1);
}

.jpt-layer-panel.warning .jpt-layer-icon {
  background: var(--warning);
  box-shadow: 0 0 0 6px rgba(183, 121, 31, 0.12);
}

.jpt-layer-panel.error .jpt-layer-icon {
  background: var(--danger);
  box-shadow: 0 0 0 6px rgba(217, 45, 32, 0.1);
}

.jpt-layer-panel.info .jpt-layer-icon {
  background: #475467;
  box-shadow: 0 0 0 6px rgba(71, 84, 103, 0.1);
}

.jpt-layer-head h2 {
  margin: 0;
  font-size: 19px;
  font-weight: 850;
}

.jpt-layer-head p {
  margin: 8px 0 0;
  color: var(--text-soft);
  font-size: 14px;
  font-weight: 650;
  line-height: 1.65;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.jpt-layer-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid #eaecf0;
  padding: 14px 18px;
  background: #f8fafc;
}

.jpt-layer-actions .button {
  min-width: 88px;
}

@keyframes fadeLift {
  from {
    transform: translateY(8px) scale(0.985);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

@keyframes overlayIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes panelIn {
  from {
    transform: translateY(12px) scale(0.98);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

@keyframes viewerIn {
  from {
    transform: scale(0.985);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes overlayOut {
  to {
    opacity: 0;
  }
}

@keyframes panelOut {
  to {
    transform: translateY(10px) scale(0.985);
    opacity: 0;
  }
}

@keyframes toastIn {
  from {
    transform: translateX(18px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes toastOut {
  to {
    transform: translateX(18px);
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
}

@media (max-width: 720px) {
  .card-head::after {
    bottom: -8px;
  }

  .jpt-toast-stack {
    top: 12px;
    right: 10px;
    left: 10px;
    width: auto;
  }

  .jpt-layer-overlay {
    align-items: end;
    padding: 10px;
  }

  .jpt-layer-panel {
    width: 100%;
    border-radius: 12px;
  }

  .jpt-layer-head {
    padding: 20px 18px 16px;
  }

  .jpt-layer-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    padding: 12px;
  }

  .jpt-layer-actions .button:only-child {
    grid-column: 1 / -1;
  }

  .mode-toggle label:has(input:checked)::after {
    right: 10px;
  }

  .history-list .record-card:hover,
  .stat-card:hover,
  .edit-upload-box:hover {
    transform: none;
  }
}

body.page-auth:has(.center-auth-page) {
  min-height: 100vh;
  background:
    linear-gradient(180deg, #ffffff 0%, rgba(248, 250, 252, 0) 260px),
    #f6f8fb;
}

body.page-auth:has(.center-auth-page) .app-shell {
  width: min(100% - 36px, 430px);
  min-height: 100vh;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  padding: 28px 0 34px;
}

body.page-auth:has(.center-auth-register) .app-shell {
  width: min(100% - 36px, 450px);
}

.center-auth-page {
  width: 100%;
  align-self: center;
  display: grid;
  place-items: center;
  padding: 0;
}

.center-auth-panel {
  width: 100%;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.center-auth-top {
  margin-bottom: 26px;
  padding: 0;
  background: transparent;
}

.center-auth-brand {
  display: grid;
  justify-items: center;
  gap: 12px;
  width: 100%;
  max-width: 100%;
  margin: 0 auto 28px;
  color: #101828;
  text-align: center;
  text-decoration: none;
}

.center-auth-mark {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(135deg, #19b37b 0%, #12875f 100%);
  color: #fff;
  font-size: 19px;
  font-weight: 850;
  box-shadow: 0 14px 28px rgba(22, 160, 109, 0.22);
}

.center-auth-mark svg {
  width: 37px;
  height: 37px;
  display: block;
}

.center-auth-mark .icon-frame,
.center-auth-mark .icon-line,
.center-auth-mark .icon-dot {
  fill: none;
  stroke: #fff;
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.center-auth-mark .ai-spark {
  fill: #b7f7d5;
  stroke: #fff;
  stroke-width: 0.6;
}

.center-auth-mark .ai-spark.small {
  fill: #fff;
  stroke: none;
  opacity: 0.92;
}

.center-auth-brand strong {
  display: block;
  color: #101828;
  font-size: 28px;
  font-weight: 850;
  line-height: 1.08;
}

.center-auth-brand small {
  display: block;
  margin-top: 5px;
  color: #667085;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.2;
}

.center-auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  width: 100%;
  min-height: 42px;
  border: 1px solid #dfe5ec;
  border-radius: 8px;
  padding: 4px;
  background: #edf1f5;
}

.center-auth-tabs a {
  display: grid;
  place-items: center;
  border-radius: 6px;
  color: #667085;
  font-size: 14px;
  font-weight: 780;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.center-auth-tabs a.active {
  background: #fff;
  color: #101828;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.08);
}

.center-auth-tabs a:not(.active):hover {
  color: #344054;
}

.center-auth-body {
  padding: 0;
}

.center-auth-form {
  display: grid;
  gap: 13px;
}

.center-auth-register .center-auth-form {
  gap: 12px;
}

.center-auth-field {
  display: grid;
  gap: 8px;
}

.center-auth-register .center-auth-field {
  gap: 7px;
}

.center-auth-field span {
  color: #344054;
  font-size: 13px;
  font-weight: 740;
}

.center-auth-field input {
  width: 100%;
  height: 48px;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  padding: 0 14px;
  background: #fff;
  color: #101828;
  font: inherit;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.center-auth-register .center-auth-field input {
  height: 46px;
}

.center-auth-field input::placeholder {
  color: #98a2b3;
}

.center-auth-field input:hover {
  border-color: #98a2b3;
}

.center-auth-field input:focus {
  border-color: #16a06d;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(22, 160, 109, 0.12);
}

.center-auth-submit {
  width: 100%;
  min-height: 48px;
  margin-top: 7px;
  border: 0;
  border-radius: 8px;
  background: linear-gradient(135deg, #19b37b 0%, #12875f 100%);
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 12px 22px rgba(22, 160, 109, 0.2);
  transition: box-shadow 0.15s ease, filter 0.15s ease, transform 0.15s ease;
}

.center-auth-submit:hover {
  filter: brightness(0.98);
  box-shadow: 0 14px 26px rgba(22, 160, 109, 0.24);
}

.center-auth-submit:active {
  transform: translateY(1px);
}

@media (max-width: 720px) {
  body.page-auth:has(.center-auth-page) .app-shell {
    width: min(100% - 32px, 390px);
    padding: 14px 0 20px;
  }

  body.page-auth:has(.center-auth-register) .app-shell {
    width: min(100% - 32px, 390px);
  }

  .center-auth-page {
    padding: 0;
    align-self: start;
    padding-top: clamp(18px, 8vh, 54px);
  }

  .center-auth-top {
    margin-bottom: 20px;
  }

  .center-auth-brand {
    gap: 9px;
    margin-bottom: 24px;
  }

  .center-auth-mark {
    width: 42px;
    height: 42px;
  }

  .center-auth-mark svg {
    width: 30px;
    height: 30px;
  }

  .center-auth-brand strong {
    font-size: 22px;
  }

  .center-auth-brand small {
    margin-top: 3px;
    font-size: 11px;
  }

  .center-auth-tabs {
    min-height: 40px;
    border-radius: 8px;
  }

  .center-auth-tabs a {
    font-size: 13px;
  }

  .center-auth-form {
    gap: 12px;
  }

  .center-auth-field {
    gap: 6px;
  }

  .center-auth-field span {
    font-size: 12px;
  }

  .center-auth-field input {
    height: 46px;
    border-radius: 8px;
    font-size: 14px;
  }

  .center-auth-submit {
    min-height: 46px;
    margin-top: 6px;
    font-size: 14px;
  }
}
