:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-soft: #f1f5f9;
  --surface-strong: #0f172a;
  --text: #121826;
  --muted: #667085;
  --line: #d8e0eb;
  --accent: #2563eb;
  --accent-2: #14b8a6;
  --success: #16a34a;
  --warning: #f59e0b;
  --danger: #ef4444;
  --shadow: 0 18px 42px rgba(15, 23, 42, 0.08);
  --shadow-deep: 0 28px 70px rgba(15, 23, 42, 0.12);
  --radius-lg: 16px;
  --radius-md: 10px;
  --main-offset: 276px;
}

body.dark {
  color-scheme: dark;
  --bg: #0b1020;
  --surface: #111827;
  --surface-soft: #172033;
  --surface-strong: #f8fafc;
  --text: #f8fafc;
  --muted: #a8b0bf;
  --line: #263244;
  --accent: #60a5fa;
  --accent-2: #2dd4bf;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.34);
  --shadow-deep: 0 28px 80px rgba(0, 0, 0, 0.46);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(255,255,255,.9), rgba(245,247,251,.5) 260px, var(--bg) 720px),
    radial-gradient(circle at 82% 6%, rgba(20, 184, 166, .11), transparent 24%),
    radial-gradient(circle at 18% 0%, rgba(37, 99, 235, .09), transparent 26%),
    var(--bg);
  font-family: Inter, "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}

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

button {
  cursor: pointer;
}

h1,
h2,
h3,
h4,
p {
  margin-top: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 24px;
  letter-spacing: 0;
}

.app {
  min-height: 100vh;
}

.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 30;
  height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 24px 0 28px;
  border-bottom: 1px solid rgba(148, 163, 184, .22);
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  backdrop-filter: blur(18px);
  box-shadow: 0 10px 28px rgba(15, 23, 42, .04);
}

.brand {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
}

.brand-mark {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  border-radius: 10px;
  background: #050505 url("./assets/login-visual.png") center / contain no-repeat;
  box-shadow: 0 12px 26px rgba(37, 99, 235, .22);
}

.brand strong,
.brand small {
  display: block;
  line-height: 1.2;
}

.brand small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-btn,
.credit-pill,
.contact-btn,
.login-btn {
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
}

.icon-btn {
  width: 38px;
  font-weight: 900;
}

.credit-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 15px;
  color: var(--muted);
}

.credit-pill span {
  color: var(--warning);
}

.login-btn {
  min-width: 82px;
  padding: 0 18px;
  font-weight: 800;
}

.contact-btn {
  min-width: 92px;
  padding: 0 16px;
  font-weight: 800;
}

.sidebar {
  position: fixed;
  top: 66px;
  bottom: 0;
  left: 0;
  z-index: 20;
  width: 276px;
  padding: 14px 14px;
  overflow: auto;
  border-right: 1px solid rgba(148, 163, 184, .24);
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  backdrop-filter: blur(18px);
  transition: width .2s ease, transform .2s ease;
}

.sidebar.collapsed {
  width: 84px;
}

.menu-toggle {
  width: 100%;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  border: 0;
  border-radius: 10px;
  background: var(--surface-soft);
  color: var(--text);
  font-weight: 800;
}

.hamburger {
  font-size: 18px;
}

.nav-item {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  margin-top: 7px;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 12px;
  color: var(--text);
  text-decoration: none;
}

.nav-item:hover,
.nav-item.active {
  border-color: color-mix(in srgb, var(--accent) 20%, var(--line));
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 11%, transparent), color-mix(in srgb, var(--accent-2) 9%, transparent));
}

.nav-icon {
  color: var(--muted);
  font-size: 19px;
  text-align: center;
}

.nav-item.active .nav-icon,
.nav-item.active .nav-title {
  color: var(--accent);
}

.nav-title {
  display: block;
  font-size: 14px;
  font-weight: 900;
}

.nav-desc {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hot {
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}

.sidebar.collapsed .menu-toggle span:first-child,
.sidebar.collapsed .nav-text,
.sidebar.collapsed .hot {
  display: none;
}

.main {
  min-height: 100vh;
  margin-left: var(--main-offset);
  padding: 82px clamp(10px, 1.1vw, 18px) 34px;
  transition: margin-left .2s ease;
}

.sidebar.collapsed + .main {
  margin-left: 84px;
}

body.admin-route .sidebar {
  display: none;
}

body.admin-route .main {
  --main-offset: 0px;
  padding-left: clamp(16px, 2vw, 32px);
  padding-right: clamp(16px, 2vw, 32px);
}

#main.admin-main {
  --main-offset: 0px;
}

.muted {
  color: var(--muted);
  line-height: 1.65;
}

.section-gap {
  margin-top: 30px;
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.section-head.compact {
  align-items: center;
  margin-bottom: 14px;
}

.section-head h3 {
  margin: 0;
}

.split {
  justify-content: space-between;
}

.hero-panel,
.model-filter-panel,
.panel,
.model-card,
.prompt-card,
.plan,
.stat,
.quick-card {
  border: 1px solid color-mix(in srgb, var(--line) 86%, transparent);
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  box-shadow: var(--shadow);
}

.hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(300px, .92fr);
  gap: 20px;
  max-width: 1680px;
  margin: 0 auto 24px;
  padding: 28px;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(15, 23, 42, .98), rgba(37, 99, 235, .9) 58%, rgba(20, 184, 166, .86)),
    var(--surface-strong);
  color: #fff;
  box-shadow: var(--shadow-deep);
}

.eyebrow {
  display: inline-flex;
  margin-bottom: 14px;
  padding: 7px 11px;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 999px;
  color: #dbeafe;
  background: rgba(255,255,255,.08);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
}

.eyebrow.dark {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 24%, transparent);
  background: color-mix(in srgb, var(--accent) 9%, transparent);
}

.hero-copy h1 {
  max-width: 680px;
  margin-bottom: 14px;
  font-size: clamp(32px, 3.6vw, 48px);
  line-height: 1.1;
  letter-spacing: 0;
}

.hero-copy p {
  max-width: 680px;
  margin-bottom: 22px;
  color: #dbeafe;
  font-size: 15px;
  line-height: 1.72;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-board {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  align-content: end;
}

.metric-card {
  min-height: 108px;
  padding: 16px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 14px;
  background: rgba(255,255,255,.11);
  backdrop-filter: blur(12px);
}

.metric-card span {
  display: block;
  margin-bottom: 10px;
  color: #bfdbfe;
}

.metric-card b {
  font-size: 25px;
}

.metric-card.wide {
  grid-column: 1 / -1;
}

.metric-card.wide b {
  font-size: 18px;
  line-height: 1.5;
}

.home-shell,
.scenario-grid,
.home-section {
  max-width: 1680px;
  margin-left: auto;
  margin-right: auto;
}

.home-shell {
  display: grid;
  gap: 22px;
  margin-bottom: 28px;
}

.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  min-height: clamp(340px, 27vw, 430px);
  padding: clamp(30px, 3.4vw, 52px);
  border: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  border-radius: var(--radius-lg);
  color: #fff;
  background: var(--hero-image, none) center / cover no-repeat #0f172a;
  box-shadow: var(--shadow-deep);
}

.home-hero .hero-copy h1 {
  max-width: 880px;
  margin-bottom: 16px;
  font-size: clamp(34px, 3.25vw, 50px);
  line-height: 1.12;
  text-shadow: 0 3px 18px rgba(15, 23, 42, .28);
  white-space: pre-line;
}

.home-hero .hero-copy p {
  max-width: 820px;
  margin-bottom: 26px;
  color: #dbeafe;
  font-size: 16px;
  line-height: 1.78;
  text-shadow: 0 2px 14px rgba(15, 23, 42, .25);
}

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

.home-metrics div {
  min-height: 92px;
  padding: 16px;
  border: 1px solid color-mix(in srgb, var(--line) 86%, transparent);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  box-shadow: var(--shadow);
}

.home-metrics span,
.home-metrics small {
  display: block;
  color: var(--muted);
}

.home-metrics b {
  display: block;
  margin: 8px 0 5px;
  font-size: 26px;
}

.scenario-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 28px;
}

.scenario-card {
  position: relative;
  overflow: hidden;
  min-height: 132px;
  padding: 16px 16px 15px;
  border: 1px solid color-mix(in srgb, var(--line) 86%, transparent);
  border-radius: 14px;
  color: var(--text);
  background:
    radial-gradient(circle at 92% 10%, color-mix(in srgb, var(--module-color, var(--accent)) 14%, transparent), transparent 38%),
    linear-gradient(180deg, color-mix(in srgb, #fff 72%, transparent), color-mix(in srgb, var(--surface) 96%, transparent));
  box-shadow: var(--shadow);
  text-align: left;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.scenario-card::after {
  content: "";
  position: absolute;
  inset: auto -18px -42px auto;
  width: 96px;
  height: 96px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--module-color, var(--accent)) 10%, transparent);
  pointer-events: none;
}

.scenario-card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--module-color, var(--accent)) 36%, var(--line));
  box-shadow: var(--shadow-deep);
}

.scenario-card > span {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  margin-bottom: 15px;
  border-radius: 12px;
  color: #fff;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--module-color, var(--accent)) 92%, #fff), var(--module-color-2, var(--accent-2)));
  box-shadow: 0 12px 24px color-mix(in srgb, var(--module-color, var(--accent)) 24%, transparent);
}

.scenario-card svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.scenario-card b,
.scenario-card small {
  position: relative;
  z-index: 1;
  display: block;
}

.scenario-card b {
  margin-bottom: 8px;
  font-size: 16px;
}

.scenario-card small {
  color: var(--muted);
  line-height: 1.5;
}

.scenario-card i {
  position: absolute;
  right: 14px;
  bottom: 13px;
  z-index: 1;
  color: color-mix(in srgb, var(--module-color, var(--accent)) 86%, var(--text));
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity .18s ease, transform .18s ease;
}

.scenario-card:hover i {
  opacity: 1;
  transform: translateX(0);
}

.scenario-image { --module-color: #2563eb; --module-color-2: #14b8a6; }
.scenario-tryon { --module-color: #7c3aed; --module-color-2: #ec4899; }
.scenario-retouch { --module-color: #0891b2; --module-color-2: #22c55e; }
.scenario-prompt { --module-color: #f59e0b; --module-color-2: #ef4444; }
.scenario-digital { --module-color: #0ea5e9; --module-color-2: #6366f1; }
.scenario-recharge { --module-color: #16a34a; --module-color-2: #14b8a6; }

.home-section {
  margin-top: 28px;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(230px, 1fr));
  gap: 14px;
}

.tool-card {
  display: grid;
  gap: 12px;
  min-height: 206px;
  padding: 16px;
  border: 1px solid color-mix(in srgb, var(--line) 86%, transparent);
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  box-shadow: var(--shadow);
}

.tool-card > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.tool-card h3 {
  margin: 0;
  font-size: 18px;
}

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

.prompt-strip {
  padding-bottom: 32px;
}

.prompt-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
}

.prompt-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(220px, 1fr));
  gap: 14px;
}

.prompt-row .prompt-card {
  display: block;
  margin: 0;
}

.prompt-row .thumb {
  min-height: var(--thumb-height, 260px);
}

.quick-grid,
.admin-page,
.content-page {
  max-width: 1680px;
  margin-left: auto;
  margin-right: auto;
}

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

.quick-card {
  min-height: 104px;
  padding: 16px;
  text-align: left;
  color: var(--text);
}

.quick-card:hover,
.model-card:hover,
.plan:hover,
.prompt-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent) 25%, var(--line));
  box-shadow: var(--shadow-deep);
}

.quick-card b {
  display: block;
  margin-bottom: 10px;
  font-size: 18px;
}

.quick-card span {
  color: var(--muted);
  line-height: 1.5;
}

.admin-page > .section-head h2 {
  font-size: 32px;
}

.model-filter-panel {
  margin-bottom: 18px;
  padding: 20px;
}

.model-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(240px, 1fr));
  gap: 14px;
}

.panel {
  padding: 20px;
}

.panel-title {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}

.inline-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  margin-left: auto;
}

.inline-actions .inline {
  width: auto;
}

.panel-title h2 {
  font-size: 24px;
}

.badge {
  display: inline-flex;
  align-items: center;
  width: max-content;
  max-width: 100%;
  padding: 5px 10px;
  border-radius: 999px;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.model-card {
  display: flex;
  min-height: 220px;
  flex-direction: column;
  padding: 18px;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.model-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.model-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  font-weight: 900;
}

.model-card h3 {
  margin-bottom: 8px;
  font-size: 18px;
}

.model-card p {
  flex: 1;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.62;
}

.model-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin: 12px 0 14px;
  color: var(--muted);
  font-size: 13px;
}

.model-meta b {
  color: var(--text);
}

.primary,
.secondary,
.ghost,
.link-btn {
  border: 0;
  border-radius: var(--radius-md);
  font-weight: 900;
}

.primary {
  width: 100%;
  min-height: 46px;
  padding: 0 18px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 14px 30px color-mix(in srgb, var(--accent) 24%, transparent);
}

.creator-panel > .primary {
  min-height: 50px;
  border-radius: 12px;
}

.secondary {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  color: var(--text);
  background: var(--surface-soft);
}

.ghost {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid rgba(255,255,255,.28);
  color: #fff;
  background: rgba(255,255,255,.1);
}

.inline {
  width: auto;
}

.link-btn {
  padding: 0;
  color: var(--accent);
  background: transparent;
}

.chips,
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.chips {
  margin-bottom: 20px;
}

.chip,
.tab,
.record-tabs button {
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  background: var(--surface);
}

.chip.active,
.tab.active,
.record-tabs button.active {
  border-color: var(--accent);
  color: #fff;
  background: var(--accent);
}

.chip:hover {
  border-color: var(--accent);
}

.search,
.text-input,
textarea,
select {
  width: 100%;
  border: 1px solid color-mix(in srgb, var(--line) 92%, var(--accent));
  border-radius: var(--radius-md);
  outline: none;
  color: var(--text);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
}

.search {
  max-width: 320px;
  height: 42px;
  padding: 0 16px;
}

.wide-search {
  max-width: 460px;
}

.text-input,
select {
  min-height: 44px;
  padding: 0 13px;
}

textarea {
  min-height: 112px;
  padding: 13px;
  resize: vertical;
  line-height: 1.7;
}

.search:focus,
.text-input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 14%, transparent);
}

.field {
  margin-top: 14px;
}

.field label {
  display: block;
  margin-bottom: 9px;
  font-weight: 900;
  color: color-mix(in srgb, var(--text) 88%, var(--muted));
}

.field-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 9px;
}

.field-row label {
  margin-bottom: 0;
}

.soft-label,
.hint,
.counter {
  color: var(--muted);
  font-size: 12px;
}

.hint {
  margin: 8px 0 0;
  font-size: 13px;
}

.counter {
  margin-top: 6px;
  text-align: right;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(640px, 860px) minmax(360px, 1fr);
  gap: 16px;
  max-width: 1680px;
  margin: 0 auto;
  align-items: start;
}

.clean-form {
  padding: 18px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--accent) 6%, transparent), transparent 190px),
    color-mix(in srgb, var(--surface) 94%, transparent);
  box-shadow: var(--shadow-deep);
}

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

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

.form-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: end;
}

.clean-form > .form-grid.three {
  margin-bottom: 16px;
}

.clean-form > .primary {
  margin-top: 4px;
}

.video-options {
  display: grid;
  gap: 16px;
  margin-bottom: 16px;
}

.ratio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(74px, 1fr));
  gap: 8px;
}

.option-tile {
  min-height: 62px;
  padding: 8px;
  display: grid;
  place-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: var(--surface);
  cursor: pointer;
}

.option-tile.active {
  color: var(--text);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent);
}

.option-tile b {
  font-size: 12px;
}

.ratio-icon {
  width: 18px;
  height: 12px;
  border: 1.5px solid currentColor;
  border-radius: 2px;
}

.ratio-1-1 {
  width: 14px;
  height: 14px;
}

.ratio-9-16,
.ratio-3-4,
.ratio-2-3 {
  width: 10px;
  height: 18px;
}

.ratio-21-9,
.ratio-16-9,
.ratio-3-2 {
  width: 22px;
  height: 12px;
}

.video-settings-grid {
  align-items: end;
}

.image-settings-grid {
  grid-template-columns: 1fr 2fr 2fr;
  align-items: start;
}

.image-settings-grid .count-grid,
.image-settings-grid .resolution-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.image-settings-grid .field {
  align-self: start;
}

.image-settings-grid .control-select {
  min-height: 42px;
}

.tool-settings-grid {
  grid-template-columns: minmax(220px, 1fr) minmax(260px, 1fr);
  align-items: start;
}

.tool-settings-grid .count-grid {
  grid-template-columns: repeat(auto-fit, minmax(54px, 1fr));
}

.tool-settings-grid .control-select {
  min-height: 42px;
}

.range-value {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.range-input {
  width: 100%;
  accent-color: var(--accent);
}

.segmented-control {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(88px, 1fr));
  gap: 8px;
}

.segment-btn {
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: var(--surface);
  font-weight: 800;
  cursor: pointer;
}

.segment-btn.active {
  color: var(--text);
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent-soft) 42%, var(--surface));
}

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

.count-tile {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: var(--surface);
  font-weight: 900;
  cursor: pointer;
}

.count-tile.active {
  color: var(--text);
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent-soft) 42%, var(--surface));
}

.control-select {
  appearance: none;
  min-height: 48px;
  padding-right: 40px;
  background:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%) right 18px center / 7px 7px no-repeat,
    linear-gradient(135deg, var(--surface), color-mix(in srgb, var(--surface-soft) 40%, var(--surface)));
  font-weight: 800;
}

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

.compact-upload,
.upload {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 96px;
  padding: 14px;
  border: 1px dashed color-mix(in srgb, var(--muted) 42%, transparent);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface-soft) 64%, transparent);
  color: var(--muted);
  text-align: center;
  cursor: pointer;
  transition: border-color .2s ease, background .2s ease, color .2s ease, transform .2s ease;
}

.upload strong {
  position: relative;
  z-index: 1;
  display: block;
  margin-bottom: 6px;
  color: var(--text);
}

.upload span {
  position: relative;
  z-index: 1;
  pointer-events: none;
}

.upload:hover {
  border-color: color-mix(in srgb, var(--accent) 72%, transparent);
  background: color-mix(in srgb, var(--accent-soft) 36%, var(--surface));
  transform: translateY(-1px);
}

.upload.drag-over {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent-soft) 58%, var(--surface));
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 14%, transparent);
  transform: translateY(-1px);
}

.upload.has-file {
  border-color: color-mix(in srgb, var(--accent) 76%, transparent);
  background: color-mix(in srgb, var(--accent-soft) 45%, var(--surface));
  color: var(--text);
}

.upload.has-file strong {
  margin-bottom: 8px;
}

.upload.has-file .upload-preview {
  margin-bottom: 0;
}

.upload-preview {
  position: relative;
  z-index: 1;
  width: 100%;
  margin: 2px auto 8px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
  gap: 8px;
  pointer-events: auto;
}

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

.upload-thumb {
  position: relative;
  min-width: 0;
  margin: 0;
  display: grid;
  gap: 5px;
}

.upload-thumb img {
  width: 100%;
  max-height: 150px;
  object-fit: contain;
  object-position: center;
  display: block;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.upload-thumb figcaption {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
  max-height: 2.5em;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.upload-remove {
  position: absolute;
  top: 5px;
  right: 5px;
  z-index: 4;
  width: 24px;
  height: 24px;
  border: 1px solid color-mix(in srgb, #fff 76%, transparent);
  border-radius: 999px;
  color: #fff;
  background: color-mix(in srgb, #111827 78%, transparent);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.upload-add {
  min-height: 92px;
  border: 1px dashed color-mix(in srgb, var(--accent) 64%, transparent);
  border-radius: 8px;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent-soft) 32%, var(--surface));
  font-size: 30px;
  font-weight: 800;
  cursor: pointer;
}

.upload-add:hover,
.upload-remove:hover {
  filter: brightness(.95);
}

.file-thumb {
  min-height: 82px;
  place-items: center;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 8px;
}

.upload-file-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 32px;
  border-radius: 8px;
  color: var(--text);
  background: color-mix(in srgb, var(--accent-soft) 65%, var(--surface));
  font-size: 12px;
  font-weight: 900;
}

.upload [data-upload-status] {
  max-width: 100%;
  overflow-wrap: anywhere;
  line-height: 1.35;
}

.upload [data-upload-status]:empty {
  display: none;
}

.upload-input {
  position: absolute;
  inset: -1px;
  z-index: 2;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.upload.has-file .upload-input {
  pointer-events: none;
}

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

.mini-btn {
  min-height: 30px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: var(--surface);
  font-size: 12px;
  font-weight: 900;
}

.mini-btn.active {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 34%, var(--line));
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
}

.record-panel {
  position: sticky;
  top: 88px;
  padding: 18px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--accent-2) 8%, transparent), transparent 220px),
    color-mix(in srgb, var(--surface) 94%, transparent);
  box-shadow: var(--shadow-deep);
}

.record-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 14px 0 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.record {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
}

.record-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.record span,
.record small {
  color: var(--muted);
}

.record-results {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
  gap: 8px;
  margin: 4px 0;
}

.record-results img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.record-error {
  color: #b91c1c;
}

.asset-grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.asset-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 18px;
  flex-wrap: wrap;
}

.asset-toolbar .chips {
  margin: 0;
}

.asset-date-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}

.asset-date-filter .text-input {
  width: 156px;
  height: 38px;
  padding: 0 10px;
}

.asset-day {
  margin-top: 20px;
}

.asset-day h3 {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 900;
}

.asset-day .asset-grid {
  margin-top: 0;
}

.asset-thumb {
  min-width: 0;
  display: block;
  color: var(--text);
  text-decoration: none;
}

.asset-thumb img,
.asset-thumb video {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.status {
  display: inline-flex;
  width: max-content;
  padding: 3px 8px;
  border-radius: 999px;
  color: #166534;
  background: #dcfce7;
  font-size: 12px;
  font-weight: 900;
}

.status.failed {
  color: #991b1b;
  background: #fee2e2;
}

.empty-state {
  min-height: 180px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 12px;
  color: var(--muted);
  text-align: center;
  padding: 22px;
  font-size: 14px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 5%, transparent), color-mix(in srgb, var(--accent-2) 5%, transparent));
}

.rich-empty {
  align-content: center;
  gap: 8px;
  min-height: 260px;
}

.rich-empty::before {
  content: "";
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 12px 28px color-mix(in srgb, var(--accent) 22%, transparent);
}

.rich-empty b {
  color: var(--text);
  font-size: 16px;
}

.rich-empty span {
  max-width: 260px;
  line-height: 1.7;
}

.masonry {
  columns: 4 190px;
  column-gap: 16px;
}

.prompt-card {
  display: inline-block;
  width: 100%;
  margin: 0 0 16px;
  overflow: hidden;
  break-inside: avoid;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.thumb {
  position: relative;
  min-height: var(--thumb-height, 260px);
  display: flex;
  align-items: flex-end;
  padding: 14px;
  overflow: hidden;
}

.thumb::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--thumb) center / cover no-repeat;
}

.tag {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1;
  padding: 3px 9px;
  border-radius: 999px;
  color: #fff;
  background: var(--accent);
  font-size: 12px;
  font-weight: 900;
}

.detail-btn {
  position: relative;
  z-index: 1;
  transform: translateY(10px);
  opacity: 0;
  border: 0;
  border-radius: 999px;
  padding: 8px 14px;
  color: #111827;
  background: #fff;
  transition: .18s ease;
}

.prompt-card:hover .detail-btn {
  transform: translateY(0);
  opacity: 1;
}

.prompt-card h4 {
  margin: 0;
  padding: 14px;
  font-size: 16px;
}

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

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

.stat {
  padding: 18px;
}

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

.stat b {
  display: block;
  margin-top: 8px;
  font-size: 30px;
}

.stat small {
  display: block;
  margin-top: 8px;
  color: var(--success);
  font-weight: 900;
}

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

.payment-panel {
  margin-bottom: 18px;
}

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

.payment-methods.single {
  grid-template-columns: minmax(260px, 520px);
}

.payment-method {
  display: block;
  width: 100%;
  text-align: left;
  min-height: 86px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--text);
  cursor: pointer;
}

.payment-method.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 12%, transparent);
}

.payment-method b,
.payment-method span,
.payment-method small {
  display: block;
}

.payment-method span {
  margin-top: 8px;
  color: var(--text);
  font-size: 13px;
}

.payment-method small,
.empty-line {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.5;
}

.contact-body {
  text-align: center;
}

.contact-qr,
.contact-qr-placeholder {
  width: 220px;
  height: 220px;
  margin: 0 auto 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
}

.contact-qr {
  display: block;
  object-fit: contain;
}

.contact-qr-placeholder {
  display: none;
  place-items: center;
  padding: 18px;
  color: var(--muted);
  line-height: 1.7;
}

.plan {
  padding: 20px;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.plan h3 {
  margin: 18px 0 8px;
  font-size: 20px;
}

.plan strong {
  display: block;
  margin-bottom: 12px;
  font-size: 34px;
}

.plan p {
  min-height: 52px;
  color: var(--muted);
  line-height: 1.6;
}

.redeem-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
}

.login-page {
  min-height: calc(100vh - 150px);
  display: grid;
  place-items: center;
  padding-block: clamp(22px, 4vh, 44px);
}

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

.admin-login-page {
  padding-top: clamp(22px, 6vh, 56px);
}

.admin-login-page .auth-card {
  width: min(420px, 100%);
  padding: 22px;
}

.admin-login-page .eyebrow {
  margin-bottom: 12px;
  padding: 6px 10px;
}

.admin-login-page h2 {
  font-size: 24px;
  line-height: 1.2;
}

.admin-login-page .muted {
  margin-bottom: 18px;
  line-height: 1.55;
}

.admin-login-page .field {
  margin-top: 12px;
}

.admin-login-page .text-input {
  min-height: 42px;
}

.admin-login-page .primary {
  min-height: 44px;
  margin-top: 14px;
}

.login-auth-card {
  width: min(920px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(340px, .85fr);
  align-items: center;
  column-gap: 28px;
  row-gap: 0;
  padding: 26px;
  overflow: hidden;
}

.login-auth-card::before {
  content: "";
  grid-column: 1;
  grid-row: 1 / span 8;
  align-self: stretch;
  min-height: 360px;
  border-radius: 14px;
  background:
    #050505 url("./assets/login-visual.png") center / contain no-repeat;
  box-shadow: 0 20px 46px rgba(37, 99, 235, .16);
}

.login-auth-card > * {
  grid-column: 2;
}

.auth-code {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.auth-code .tab {
  min-height: 44px;
  white-space: nowrap;
}

.auth-card .auth-code + .primary {
  margin-top: 14px;
}

.login-auth-card .primary {
  margin-top: 14px;
}

.auth-switch {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 14px;
  color: var(--muted);
}

.admin-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.admin-console {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 18px;
  max-width: 1760px;
  margin: 0 auto;
  align-items: start;
}

.admin-menu {
  position: sticky;
  top: 82px;
  display: grid;
  gap: 8px;
  min-height: calc(100vh - 116px);
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  box-shadow: var(--shadow);
}

.admin-menu-head {
  padding: 10px 10px 14px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 4px;
}

.admin-menu-head b,
.admin-menu-head span {
  display: block;
}

.admin-menu-head span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.admin-menu button {
  min-height: 40px;
  border: 0;
  border-radius: 10px;
  padding: 0 12px;
  color: var(--text);
  background: transparent;
  text-align: left;
  font-weight: 800;
}

.admin-menu button.active,
.admin-menu button:hover {
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

.admin-menu .admin-logout {
  margin-top: auto;
  color: var(--danger);
  background: color-mix(in srgb, var(--danger) 8%, transparent);
}

.admin-menu .admin-logout:hover {
  color: #fff;
  background: var(--danger);
}

.admin-workspace {
  min-width: 0;
}

.admin-workspace-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
}

.admin-grid.wide .admin-wide {
  grid-column: 1 / -1;
}

.admin-wide {
  overflow: visible;
}

.table-scroll {
  width: 100%;
  overflow: auto;
  border-radius: 10px;
  scrollbar-gutter: stable both-edges;
}

.model-table-scroll {
  max-height: calc(100vh - 310px);
  min-height: 280px;
  border: 1px solid color-mix(in srgb, var(--line) 76%, transparent);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
}

.model-admin-table {
  min-width: 1540px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.data-table th,
.data-table td {
  padding: 12px 10px;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 78%, transparent);
  text-align: left;
  vertical-align: middle;
}

.data-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  color: var(--muted);
  background: color-mix(in srgb, var(--surface-soft) 68%, transparent);
  font-size: 12px;
  font-weight: 900;
}

.table-sub {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.table-input {
  width: 92px;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 0 10px;
  background: var(--surface);
  color: var(--text);
}

.table-input.api-input {
  width: 130px;
}

.table-input.api-key-input {
  width: 150px;
}

.table-input.path-input {
  width: 260px;
}

.size-map-input {
  width: 340px;
  min-height: 84px;
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 12px;
  line-height: 1.45;
  white-space: pre;
  overflow: auto;
}

.payment-admin-table {
  min-width: 1180px;
}

.payment-admin-table th,
.payment-admin-table td {
  padding: 16px 14px;
  vertical-align: top;
}

.payment-admin-table th:nth-child(1),
.payment-admin-table td:nth-child(1) {
  width: 180px;
}

.payment-admin-table th:nth-child(2),
.payment-admin-table td:nth-child(2) {
  width: 260px;
}

.payment-admin-table th:nth-child(3),
.payment-admin-table td:nth-child(3) {
  width: 180px;
}

.payment-admin-table th:nth-child(4),
.payment-admin-table td:nth-child(4) {
  width: 300px;
}

.payment-admin-table th:nth-child(5),
.payment-admin-table td:nth-child(5) {
  width: 120px;
}

.payment-admin-table .table-input {
  width: 100%;
  min-width: 132px;
}

.payment-admin-table select.table-input {
  min-width: 150px;
  padding-right: 28px;
}

.payment-admin-table [data-payment-note] {
  margin-top: 10px;
}

.payment-admin-table [data-payment-qr] {
  min-width: 280px;
}

.billing-rule-grid h3 {
  margin: 12px 0 0;
  padding-top: 14px;
  border-top: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
  font-size: 15px;
}

.billing-rule-grid h3:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.template-admin-table {
  min-width: 980px;
}

.category-admin-table {
  min-width: 640px;
}

.module-admin-table {
  min-width: 920px;
}

.template-name-input {
  width: 180px;
}

.category-name-input,
.category-select-input {
  width: 140px;
}

.card-height-input {
  width: 96px;
}

.image-upload-field {
  display: grid;
  grid-template-columns: 152px minmax(0, 1fr);
  column-gap: 12px;
  align-items: start;
  margin: 0;
}

.image-upload-field > span {
  padding-top: 10px;
}

.image-upload-hint {
  display: block;
  margin: 2px 0 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.admin-image-upload {
  display: grid;
  grid-template-columns: minmax(180px, 320px) minmax(120px, 160px);
  align-items: start;
  gap: 10px;
}

.admin-image-upload .upload-input {
  display: none;
}

.admin-image-preview {
  display: grid;
  place-items: center;
  min-height: 74px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--muted);
  background: var(--preview, color-mix(in srgb, var(--surface-soft) 70%, var(--surface))) center / cover no-repeat;
  font-size: 12px;
  font-weight: 700;
}

.module-title-input {
  width: 180px;
}

.module-desc-input {
  width: 360px;
}

.admin-filter-row {
  display: grid;
  grid-template-columns: 96px minmax(220px, 360px);
  align-items: center;
  gap: 12px;
  margin: 0 0 16px;
}

.admin-filter-row label {
  color: var(--muted);
  font-weight: 900;
}

.table-textarea {
  width: 100%;
  min-height: 76px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--text);
  background: var(--surface);
  resize: vertical;
  line-height: 1.55;
}

.danger-link {
  margin-left: 12px;
  color: var(--danger);
}

.setting-list {
  display: grid;
  gap: 14px;
}

.setting-list label {
  display: grid;
  grid-template-columns: 140px 1fr;
  align-items: center;
  gap: 12px;
}

.setting-list span {
  color: var(--muted);
}

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

.modal {
  width: min(860px, 100%);
  max-height: 90vh;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}

.small-modal {
  width: min(440px, 100%);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px;
  border-bottom: 1px solid var(--line);
}

.modal-body {
  padding: 20px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}

.admin-user-modal {
  width: min(380px, calc(100vw - 32px));
  overflow: hidden;
  border-color: rgba(148, 163, 184, .28);
  border-radius: 18px;
  box-shadow: 0 28px 70px rgba(15, 23, 42, .28);
}

.admin-user-modal-head {
  align-items: flex-start;
  padding: 20px 22px 14px;
  border-bottom: 0;
}

.admin-user-modal-head h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
}

.admin-user-modal-head p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.admin-user-modal .modal-close {
  width: 32px;
  height: 32px;
  border-radius: 9px;
}

.admin-user-form {
  display: grid;
  gap: 14px;
  padding: 8px 22px 18px;
}

.admin-user-form label {
  display: grid;
  gap: 7px;
}

.admin-user-form span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.admin-user-form .text-input {
  min-height: 44px;
}

.admin-user-actions {
  margin-top: 0;
  padding: 0 22px 22px;
}

.admin-user-actions .inline {
  min-width: 96px;
  min-height: 42px;
}

.modal-close {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 10px;
  color: var(--text);
  background: var(--surface-soft);
}

.preview-large {
  min-height: 310px;
  margin-bottom: 16px;
  border-radius: 14px;
  background: var(--thumb) center / cover no-repeat;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 90;
  transform: translateY(14px);
  opacity: 0;
  padding: 12px 16px;
  border-radius: 12px;
  background: #111827;
  color: #fff;
  transition: .18s ease;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

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

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

  .workspace-grid {
    grid-template-columns: minmax(620px, 760px) minmax(340px, 1fr);
  }

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

  .admin-console {
    grid-template-columns: 210px minmax(0, 1fr);
  }
}

@media (max-width: 1120px) {
  .hero-panel,
  .home-hero {
    grid-template-columns: 1fr;
  }

  .home-metrics,
  .prompt-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 980px) {
  .topbar {
    padding: 0 14px;
  }

  .brand small {
    display: none;
  }

  .sidebar {
    width: 260px;
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main,
  .sidebar.collapsed + .main {
    margin-left: 0;
    padding: 82px 16px 32px;
  }

  .login-page {
    padding-block: 24px;
  }

  .login-auth-card {
    grid-template-columns: 1fr;
    row-gap: 20px;
    width: min(560px, 100%);
  }

  .login-auth-card::before {
    grid-column: 1;
    grid-row: auto;
    min-height: 260px;
  }

  .login-auth-card > * {
    grid-column: 1;
  }

  .hero-panel {
    padding: 24px;
  }

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

  .hero-board,
  .quick-grid,
  .scenario-grid,
  .workspace-grid,
  .admin-grid,
  .model-grid,
  .plans,
  .payment-methods,
  .stats,
  .admin-stats,
  .form-grid.two,
  .form-grid.three,
  .upload-stack {
    grid-template-columns: 1fr;
  }

  .record-panel {
    position: static;
    min-height: auto;
  }

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

  .admin-console {
    grid-template-columns: 1fr;
  }

  .admin-menu {
    position: static;
    min-height: 0;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-menu-head,
  .admin-menu .admin-logout {
    grid-column: 1 / -1;
  }

  .admin-workspace-head {
    flex-direction: column;
  }

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

  .metric-card {
    min-height: 96px;
    padding: 14px;
  }

  .home-hero {
    min-height: 320px;
    padding: 28px;
  }

  .home-metrics,
  .tool-grid,
  .prompt-row {
    grid-template-columns: 1fr;
  }

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

  .section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .section-head.compact {
    align-items: stretch;
  }

  .search {
    max-width: none;
  }

  .redeem-row,
  .auth-code,
  .setting-list label {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .topbar {
    height: 60px;
    padding: 0 10px;
  }

  .brand {
    min-width: 44px;
    gap: 0;
  }

  .brand-copy {
    display: none;
  }

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

  .top-actions {
    gap: 6px;
    min-width: 0;
  }

  .icon-btn {
    width: 34px;
    height: 34px;
  }

  .credit-pill {
    height: 34px;
    max-width: 86px;
    padding: 0 10px;
    overflow: hidden;
    white-space: nowrap;
  }

  .login-btn {
    height: 34px;
    min-width: 58px;
    padding: 0 12px;
  }

  .sidebar {
    top: 60px;
  }

  .main,
  .sidebar.collapsed + .main {
    padding-top: 78px;
  }

  .panel,
  .clean-form,
  .hero-panel {
    padding: 16px;
  }

  .home-hero {
    min-height: 300px;
    padding: 22px 18px;
  }

  .login-auth-card {
    row-gap: 16px;
  }

  .login-auth-card::before {
    min-height: 190px;
    border-radius: 12px;
  }

  .hero-actions .inline,
  .section-head .inline {
    width: 100%;
  }

  .hero-copy h1 {
    font-size: 30px;
    line-height: 1.14;
  }

  .hero-copy p {
    font-size: 14px;
    line-height: 1.62;
  }

  .metric-card {
    min-height: 86px;
    padding: 12px;
  }

  .metric-card span {
    margin-bottom: 7px;
    font-size: 12px;
  }

  .metric-card b {
    font-size: 21px;
  }

  .metric-card.wide b {
    font-size: 14px;
  }

  .home-hero .hero-copy h1 {
    font-size: 27px;
    line-height: 1.18;
  }

  .home-hero .hero-copy p {
    font-size: 14px;
    line-height: 1.62;
  }

  .home-metrics div,
  .scenario-card,
  .tool-card {
    padding: 14px;
  }

  .scenario-card {
    min-height: 126px;
  }

  .data-table {
    min-width: 620px;
  }

  .admin-grid .panel {
    overflow-x: auto;
  }

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

  .asset-date-filter,
  .asset-date-filter .text-input {
    width: 100%;
  }

  .asset-date-filter {
    align-items: stretch;
    flex-direction: column;
  }
}
