.auth-main,
.admin-main {
  width: min(1500px, 100%);
}

.admin-main {
  padding: 0 clamp(18px, 2.6vw, 34px) 48px;
}

.site-header {
  align-items: center;
  flex-direction: row;
  flex-wrap: nowrap;
  min-height: 66px;
  padding: 10px clamp(18px, 3vw, 44px);
}

.top-nav {
  flex: 0 0 auto;
  margin-left: auto;
  overflow: visible;
  width: auto;
}

.nav-button {
  min-height: 38px;
}

.auth-main {
  display: grid;
  min-height: calc(100vh - 100px);
  place-items: center;
  padding-top: 34px;
}

.auth-main-wide {
  align-items: start;
  padding-top: clamp(34px, 6vw, 74px);
}

.auth-panel,
.register-panel,
.asset-form,
.category-manager,
.asset-manager {
  border: 1px solid rgba(23, 33, 27, 0.11);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 34px rgba(23, 33, 27, 0.065);
}

.auth-panel {
  width: min(460px, 100%);
  padding: 34px;
}

.register-panel {
  display: grid;
  grid-template-columns: minmax(260px, 0.82fr) minmax(320px, 1fr);
  gap: clamp(24px, 5vw, 54px);
  width: min(940px, 100%);
  padding: clamp(24px, 5vw, 42px);
}

.register-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.auth-panel h1 {
  margin-bottom: 24px;
  font-size: clamp(34px, 7vw, 54px);
}

.register-copy h1 {
  margin-bottom: 18px;
  font-size: clamp(42px, 7vw, 72px);
}

.register-copy p:not(.eyebrow) {
  color: var(--muted);
  font-size: 17px;
  line-height: 1.8;
}

.auth-form,
.category-form,
.asset-form,
.code-form {
  display: grid;
  gap: 16px;
}

.honeypot {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.auth-form label,
.category-form label,
.asset-form label,
.batch-form label,
.code-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.auth-form input,
.category-form input,
.asset-form input,
.asset-form textarea,
.asset-form select,
.batch-form input,
.batch-form select,
.code-form input,
.manager-head input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 12px 13px;
  outline: 0;
}

.auth-form input:focus,
.category-form input:focus,
.asset-form input:focus,
.asset-form textarea:focus,
.asset-form select:focus,
.batch-form input:focus,
.batch-form select:focus,
.code-form input:focus,
.manager-head input:focus {
  border-color: var(--mint);
  box-shadow: 0 0 0 3px rgba(47, 143, 120, 0.14);
}

.form-message {
  min-height: 22px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.form-message[data-tone="error"] {
  color: #b33f2c;
}

.form-message[data-tone="success"] {
  color: #14604d;
}

.auth-switch {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.auth-switch a {
  color: #14604d;
  font-weight: 900;
}

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

.password-meter {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.password-meter span {
  height: 6px;
  border-radius: 999px;
  background: #e4e9e3;
}

.password-meter span[data-active="true"] {
  background: var(--mint);
}

.captcha-block {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid rgba(47, 143, 120, 0.22);
  border-radius: 8px;
  background: #f5fbf7;
  padding: 12px;
}

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

.captcha-block span[data-tone="success"] {
  color: #14604d;
}

.captcha-block span[data-tone="error"] {
  color: #b33f2c;
}

.sms-code-block {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(47, 143, 120, 0.22);
  border-radius: 8px;
  background: #f5fbf7;
  padding: 12px;
}

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

.sms-code-row .secondary-action {
  white-space: nowrap;
}

.sms-code-block > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.6;
}

.sms-code-block > span[data-tone="success"] {
  color: #14604d;
}

.sms-code-block > span[data-tone="error"] {
  color: #b33f2c;
}

.nav-button,
.danger-action {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 0 13px;
  font-weight: 800;
}

.admin-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: clamp(22px, 3vw, 42px) 0 22px;
}

.admin-hero h1 {
  max-width: none;
  margin: 0 0 10px;
  font-size: clamp(48px, 5vw, 72px);
  line-height: 0.98;
}

.admin-hero .lead {
  max-width: 760px;
  font-size: clamp(15px, 1.5vw, 17px);
  line-height: 1.65;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(88px, 1fr));
  gap: 12px;
  min-width: min(450px, 100%);
}

.admin-stats div {
  border: 1px solid rgba(47, 143, 120, 0.24);
  border-radius: 8px;
  background: #f5fbf7;
  padding: 14px 16px;
}

.admin-stats strong,
.admin-stats span {
  display: block;
}

.admin-stats strong {
  font-size: 28px;
  line-height: 1;
}

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

.admin-tabs {
  display: flex;
  gap: 10px;
  margin: 0 0 18px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.admin-tab {
  flex: 0 0 auto;
  min-height: 46px;
  border: 1px solid rgba(47, 143, 120, 0.28);
  border-radius: 8px;
  background: #fff;
  color: #14604d;
  padding: 0 20px;
  font-weight: 900;
}

.admin-tab.is-active {
  border-color: var(--mint);
  background: #eaf5f0;
  color: #0f5f4c;
}

.admin-layout[hidden],
.admin-support-grid[hidden],
[data-admin-panel][hidden] {
  display: none !important;
}

.admin-layout {
  display: grid;
  grid-template-columns: minmax(320px, 430px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

body[data-admin-tab="tags"] .admin-layout {
  grid-template-columns: minmax(0, 760px);
}

body[data-admin-tab="tags"] .admin-sidebar {
  max-width: 760px;
}

.admin-support-grid {
  display: grid;
  grid-template-columns: minmax(0, 920px);
  gap: 20px;
  margin-top: 20px;
}

.admin-sidebar {
  display: grid;
  gap: 18px;
}

.asset-form,
.category-manager {
  padding: 20px;
}

.upload-panel {
  display: grid;
  gap: 10px;
  border: 1px solid rgba(47, 143, 120, 0.22);
  border-radius: 8px;
  background: #f7fbf8;
  padding: 12px;
}

.upload-panel[hidden] {
  display: none;
}

.upload-label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.upload-label input {
  width: 100%;
  border: 1px dashed rgba(47, 143, 120, 0.42);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.upload-label small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.6;
}

.upload-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.upload-preview img {
  width: 92px;
  height: 92px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  object-fit: cover;
}

.upload-message {
  min-height: 20px;
  margin: 0;
  color: #14604d;
  font-size: 12px;
  font-weight: 850;
  line-height: 1.6;
}

.upload-message[data-tone="error"] {
  color: #b33f2c;
}

.hint {
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

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

.form-heading,
.manager-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.form-heading .eyebrow,
.manager-head .eyebrow {
  margin-bottom: 7px;
}

.form-heading h2,
.manager-head h2 {
  font-size: clamp(25px, 2.4vw, 34px);
  line-height: 1.05;
}

.form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: end;
}

.check-label {
  min-height: 43px;
  align-items: center;
  grid-template-columns: auto 1fr;
  justify-content: start;
}

.check-label input {
  width: 18px;
  height: 18px;
}

.asset-manager {
  padding: 20px;
}

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

.manager-head input {
  max-width: 330px;
}

.category-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.category-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease;
}

.category-item.is-dragging {
  border-color: var(--mint);
  box-shadow: 0 12px 30px rgba(23, 33, 27, 0.13);
  opacity: 0.72;
}

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

.category-drag-handle {
  display: grid;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7f8f4;
  color: var(--muted);
  cursor: grab;
  font-weight: 900;
}

.category-drag-handle:active {
  cursor: grabbing;
}

.category-main strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.category-title-line {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.category-asset-count {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

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

.category-order-action {
  min-height: 36px;
  padding-inline: 10px;
  font-size: 13px;
}

.category-order-action:disabled {
  box-shadow: none;
  cursor: not-allowed;
  opacity: 0.4;
  transform: none;
}

.bulk-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid rgba(47, 143, 120, 0.22);
  border-radius: 8px;
  background: #f7fbf8;
  margin-bottom: 12px;
  padding: 9px 12px;
}

.bulk-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
  white-space: nowrap;
}

.bulk-check input,
.asset-select input {
  width: 18px;
  height: 18px;
  accent-color: var(--mint);
}

#selectedCount {
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

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

.batch-form {
  display: grid;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
  margin-bottom: 12px;
  padding: 12px;
}

.batch-form[hidden] {
  display: none;
}

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

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

.credit-form,
.code-form {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

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

.sms-settings-summary {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

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

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

.sms-settings-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
  line-height: 1.6;
}

.subsection-head {
  border-top: 1px solid var(--line);
  margin-top: 16px;
  padding-top: 14px;
}

.subsection-head.compact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 0;
  margin-top: 0;
  padding-top: 0;
}

.featured-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.featured-column {
  display: grid;
  gap: 12px;
}

.featured-list {
  display: grid;
  gap: 10px;
  max-height: 64vh;
  overflow: auto;
  padding-right: 4px;
}

.featured-item {
  display: grid;
  grid-template-columns: auto 72px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
}

.featured-order {
  display: inline-grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid rgba(47, 143, 120, 0.26);
  border-radius: 999px;
  background: #f5fbf7;
  color: #14604d;
  font-size: 12px;
  font-weight: 900;
}

.featured-thumb {
  display: grid;
  width: 72px;
  height: 54px;
  place-items: center;
}

.featured-thumb img {
  width: 100%;
  height: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  object-fit: cover;
}

.featured-item h3 {
  margin: 0 0 4px;
  font-size: 15px;
}

.featured-item p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.5;
}

.featured-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.compact-action {
  min-height: 36px;
  padding-inline: 10px;
}

.admin-asset-list {
  display: grid;
  gap: 10px;
  max-height: 76vh;
  overflow: auto;
  padding-right: 4px;
}

.admin-asset {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 78px;
  padding: 11px 12px;
}

.admin-asset.is-selected {
  border-color: rgba(47, 143, 120, 0.55);
  background: #f5fbf7;
}

.asset-select {
  display: inline-grid;
  place-items: center;
}

.admin-asset h3 {
  margin: 0 0 5px;
  font-size: 16px;
}

.admin-asset p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.asset-thumb {
  display: grid;
  width: 76px;
  height: 52px;
  place-items: center;
}

.asset-thumb img {
  width: 100%;
  height: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  object-fit: cover;
}

.swatches {
  display: flex;
  gap: 5px;
}

.swatches span {
  width: 22px;
  height: 22px;
  border: 1px solid rgba(23, 33, 27, 0.16);
  border-radius: 999px;
}

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

.danger-action {
  border-color: #efc8bd;
  color: #b33f2c;
}

.admin-empty {
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  padding: 28px;
  text-align: center;
}

.admin-empty.compact {
  padding: 18px;
}

.support-list {
  display: grid;
  gap: 10px;
  max-height: 76vh;
  overflow: auto;
  padding-right: 4px;
}

.support-item,
.log-item {
  display: grid;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

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

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

.log-item.is-undone {
  background: #fbfaf7;
}

.support-item h3,
.log-item h3 {
  margin: 0;
  font-size: 15px;
}

.support-item p,
.log-item p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.6;
}

.log-description {
  color: var(--ink) !important;
  font-weight: 850 !important;
}

.support-badge {
  display: inline-flex;
  width: fit-content;
  border: 1px solid rgba(47, 143, 120, 0.25);
  border-radius: 999px;
  background: #f5fbf7;
  color: #14604d;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 900;
}

.support-badge.is-used {
  border-color: #efc8bd;
  background: #fff2ef;
  color: #b33f2c;
}

.support-badge.is-ready {
  border-color: rgba(47, 143, 120, 0.35);
  background: #eaf5f0;
}

.code-token {
  display: inline-block;
  border-radius: 8px;
  background: #f4f6f2;
  color: var(--ink);
  padding: 4px 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 14px;
  letter-spacing: 0;
}

.code-title {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.copy-code-action {
  min-width: 76px;
}

.restore-action,
.undo-action {
  min-height: 38px;
  border: 1px solid rgba(47, 143, 120, 0.28);
  border-radius: 8px;
  background: #f7fbf8;
  color: #14604d;
  padding: 0 12px;
  font-weight: 900;
}

.undo-action {
  border-color: #efc8bd;
  background: #fff8f5;
  color: #b33f2c;
}

.restore-action:disabled,
.undo-action:disabled {
  cursor: wait;
  opacity: 0.62;
}

@media (max-width: 920px) {
  .admin-hero,
  .admin-layout,
  .admin-support-grid,
  .admin-asset,
  .featured-grid,
  .featured-item,
  .register-panel,
  .batch-grid,
  .credit-grid,
  .code-grid,
  .two-col {
    grid-template-columns: 1fr;
  }

  .admin-hero,
  .manager-head,
  .bulk-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-tabs {
    margin-inline: -2px;
  }

  .admin-tab {
    min-height: 42px;
    padding-inline: 14px;
  }

  .site-header {
    align-items: center;
    flex-direction: row;
    gap: 12px;
    min-height: 60px;
    padding-inline: 22px;
  }

  .brand {
    gap: 10px;
  }

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

  .top-nav {
    gap: 4px;
    margin-left: auto;
    overflow: visible;
    width: auto;
  }

  .top-nav a {
    padding: 8px 9px;
  }

  .admin-stats,
  .manager-head input {
    width: 100%;
    max-width: none;
  }

  .admin-main {
    padding-inline: 14px;
  }

  .admin-hero {
    gap: 16px;
    padding-top: 20px;
  }

  .admin-hero h1 {
    font-size: clamp(42px, 10vw, 56px);
  }

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

  .admin-stats div {
    padding: 12px;
  }

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

  .category-item {
    align-items: flex-start;
    flex-direction: column;
  }

  .category-main,
  .category-actions {
    width: 100%;
  }

  .category-actions {
    justify-content: flex-end;
  }

  .bulk-actions {
    width: 100%;
  }

  .bulk-actions button {
    flex: 1;
  }

  .support-item,
  .log-item {
    grid-template-columns: 1fr;
  }

  .upload-preview img {
    width: 84px;
    height: 84px;
  }

  .sms-code-row {
    grid-template-columns: 1fr;
  }
}
