:root {
  color-scheme: dark;
  --bg: #0b0d12;
  --surface: #121722;
  --surface-2: #191f2b;
  --line: rgba(255, 255, 255, 0.11);
  --text: #f4f7fb;
  --muted: #9aa7b8;
  --soft: #d6dde8;
  --accent: #2fd39f;
  --accent-2: #56a8ff;
  --accent-3: #ffcc66;
  --danger: #ff6b7a;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.36);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Microsoft YaHei", sans-serif;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-2: #edf2f8;
  --line: rgba(17, 24, 39, 0.11);
  --text: #151a23;
  --muted: #637083;
  --soft: #2b3544;
  --shadow: 0 24px 70px rgba(49, 70, 103, 0.18);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  background:
    radial-gradient(circle at 20% 10%, rgba(47, 211, 159, 0.16), transparent 28rem),
    radial-gradient(circle at 82% 0%, rgba(86, 168, 255, 0.18), transparent 30rem),
    var(--bg);
  color: var(--text);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

.app-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  height: 100vh;
  flex-direction: column;
  gap: 24px;
  padding: 22px;
  border-right: 1px solid var(--line);
  background: rgba(9, 12, 18, 0.78);
  backdrop-filter: blur(18px);
}

:root[data-theme="light"] .sidebar {
  background: rgba(255, 255, 255, 0.78);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #061016;
  font-weight: 900;
  letter-spacing: 0;
}

.brand strong,
.brand small {
  display: block;
}

.brand small,
.mini-label,
.metric-grid small,
.sidebar-card small {
  color: var(--muted);
  font-size: 12px;
}

.nav-group {
  display: grid;
  gap: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 10px;
  border-radius: 8px;
  color: var(--soft);
}

.nav-item:hover,
.nav-item.active {
  background: var(--surface-2);
  color: var(--text);
}

.nav-icon {
  display: grid;
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
}

.sidebar-card {
  margin-top: auto;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.sidebar-card strong {
  display: block;
  margin-top: 8px;
  font-size: 28px;
}

.quota-bar {
  height: 8px;
  margin-top: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-2);
}

.quota-bar span {
  display: block;
  width: 68%;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

main {
  min-width: 0;
}

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 72px;
  padding: 14px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(11, 13, 18, 0.72);
  backdrop-filter: blur(18px);
}

:root[data-theme="light"] .topbar {
  background: rgba(245, 247, 251, 0.78);
}

.menu-toggle {
  display: none;
}

.search-box {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 10px;
  max-width: 520px;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
}

.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.primary-button,
.secondary-button,
.ghost-button,
.icon-button {
  min-height: 40px;
  border: 0;
  border-radius: 8px;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.primary-button {
  padding: 0 18px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #051119;
  font-weight: 800;
}

.secondary-button,
.ghost-button,
.icon-button {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
}

.secondary-button,
.ghost-button {
  padding: 0 16px;
}

.icon-button {
  width: 42px;
  font-size: 18px;
}

.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover,
.icon-button:hover {
  transform: translateY(-1px);
}

button:disabled {
  cursor: wait;
  opacity: 0.62;
  transform: none;
}

.large {
  min-height: 48px;
  padding: 0 22px;
}

.full {
  width: 100%;
}

.hero,
.gallery-hero {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(320px, 1.1fr);
  align-items: center;
  gap: 26px;
  min-height: calc(100vh - 72px);
  padding: 36px 28px 24px;
}

.gallery-hero {
  display: block;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 42%),
    linear-gradient(135deg, rgba(47, 211, 159, 0.08), transparent 36%),
    linear-gradient(315deg, rgba(86, 168, 255, 0.1), transparent 34%);
}

.gallery-hero::before {
  content: "";
  position: absolute;
  inset: 22px;
  pointer-events: none;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

:root[data-theme="light"] .gallery-hero::before {
  border-color: rgba(17, 24, 39, 0.08);
}

.gallery-ornament {
  position: relative;
  z-index: 1;
  color: var(--accent-3);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-align: center;
}

.gallery-hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(280px, 0.92fr) minmax(320px, 1.08fr);
  align-items: center;
  gap: 30px;
  min-height: calc(100vh - 132px);
}

.hero-copy,
.gallery-copy {
  max-width: 690px;
}

.eyebrow {
  color: var(--accent);
  font-size: 13px;
  font-weight: 900;
}

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

h1 {
  max-width: 720px;
  margin-bottom: 18px;
  font-size: clamp(44px, 6vw, 82px);
  line-height: 1;
  letter-spacing: 0;
}

.hero p,
.gallery-copy p {
  max-width: 620px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.75;
}

.gallery-copy h1 span {
  color: var(--accent);
}

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

.gallery-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  max-width: 520px;
  margin-top: 34px;
}

.gallery-stats div {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(18, 23, 34, 0.72);
}

:root[data-theme="light"] .gallery-stats div {
  background: rgba(255, 255, 255, 0.72);
}

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

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

.gallery-stats span {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.hero-visual {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  background: var(--surface);
}

.hero-visual img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.gallery-stage {
  display: grid;
  gap: 16px;
}

.featured-frame {
  position: relative;
  overflow: hidden;
  min-height: 460px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #080b10;
  box-shadow: var(--shadow);
}

.featured-frame img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 460px;
  object-fit: cover;
  opacity: 0.82;
}

.featured-frame div {
  position: absolute;
  right: 18px;
  bottom: 18px;
  left: 18px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(8, 11, 16, 0.72);
  backdrop-filter: blur(14px);
}

.featured-frame span {
  color: var(--accent-3);
  font-size: 12px;
  font-weight: 900;
}

.featured-frame strong {
  display: block;
  font-size: 20px;
}

.model-ribbon {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.model-ribbon span {
  flex: 0 0 auto;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--soft);
  font-size: 13px;
}

.gallery-section {
  padding: 42px 28px 24px;
}

.section-heading {
  max-width: 720px;
  margin: 0 auto 22px;
  text-align: center;
}

.section-heading span {
  color: var(--accent-3);
  font-size: 13px;
  font-weight: 900;
}

.section-heading h2 {
  margin: 8px 0 10px;
  font-size: 34px;
}

.section-heading p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.7;
}

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

.model-gallery article {
  min-height: 220px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent),
    var(--surface);
}

.model-gallery article::before {
  content: "❦";
  display: block;
  color: var(--accent);
  font-size: 28px;
  line-height: 1;
}

.model-no {
  display: block;
  margin-top: 42px;
  color: var(--muted);
  font-size: 12px;
}

.model-gallery strong {
  display: block;
  margin-top: 8px;
  font-size: 20px;
}

.model-gallery p {
  margin: 10px 0 18px;
  color: var(--muted);
  line-height: 1.6;
}

.model-gallery small {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--accent);
}

.salon-section {
  padding-top: 30px;
}

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

.salon-grid article {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.salon-art {
  min-height: 190px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(47, 211, 159, 0.65), transparent),
    linear-gradient(315deg, rgba(86, 168, 255, 0.55), transparent),
    #151923;
}

.art-two {
  background:
    linear-gradient(135deg, rgba(255, 204, 102, 0.62), transparent),
    linear-gradient(315deg, rgba(47, 211, 159, 0.42), transparent),
    #171923;
}

.art-three {
  background:
    linear-gradient(135deg, rgba(86, 168, 255, 0.7), transparent),
    linear-gradient(315deg, rgba(255, 107, 122, 0.38), transparent),
    #111723;
}

.art-four {
  background:
    linear-gradient(135deg, rgba(214, 221, 232, 0.48), transparent),
    linear-gradient(315deg, rgba(47, 211, 159, 0.5), transparent),
    #10151b;
}

.salon-grid strong,
.salon-grid span {
  display: block;
  padding: 0 14px;
}

.salon-grid strong {
  margin-top: 14px;
}

.salon-grid span {
  margin: 8px 0 16px;
  color: var(--muted);
  font-size: 12px;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(240px, 0.45fr) minmax(0, 1fr) minmax(280px, 0.42fr);
  gap: 20px;
  padding: 0 28px 28px;
}

.model-browser,
.workspace-panel,
.insight-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(18, 23, 34, 0.86);
  box-shadow: var(--shadow);
}

:root[data-theme="light"] .model-browser,
:root[data-theme="light"] .workspace-panel,
:root[data-theme="light"] .insight-panel {
  background: rgba(255, 255, 255, 0.88);
}

.model-browser,
.workspace-panel {
  padding: 18px;
}

.insight-panel {
  padding: 18px;
}

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

.panel-head h2 {
  margin-bottom: 0;
  font-size: 24px;
}

.compact h2 {
  font-size: 20px;
}

.workbench-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 12px;
}

.workbench-tabs button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--muted);
  font-weight: 800;
}

.workbench-tabs button.selected {
  border-color: rgba(47, 211, 159, 0.42);
  background: rgba(47, 211, 159, 0.12);
  color: var(--text);
}

.model-search {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  margin-bottom: 12px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--muted);
}

.model-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.model-list {
  display: grid;
  gap: 10px;
  max-height: 620px;
  overflow: auto;
  padding-right: 2px;
}

.model-card {
  position: relative;
  display: grid;
  gap: 8px;
  min-height: 142px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent),
    var(--bg);
  cursor: pointer;
}

.model-card:hover,
.model-card.selected {
  border-color: rgba(47, 211, 159, 0.45);
  background:
    linear-gradient(180deg, rgba(47, 211, 159, 0.11), transparent),
    var(--bg);
}

.pin-button {
  position: absolute;
  top: 10px;
  right: 10px;
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--muted);
}

.pin-button.pinned {
  border-color: rgba(255, 204, 102, 0.5);
  color: var(--accent-3);
}

.model-type {
  width: max-content;
  min-height: 24px;
  padding: 3px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
}

.model-card strong {
  padding-right: 34px;
  font-size: 18px;
}

.model-card p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.55;
}

.model-card small {
  color: var(--accent-3);
}

.segmented {
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.segmented button {
  min-width: 72px;
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
}

.segmented .selected {
  background: var(--surface-2);
  color: var(--text);
}

.chat-window {
  display: grid;
  min-height: 340px;
  align-content: start;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(86, 168, 255, 0.06), transparent 44%),
    var(--bg);
}

.message {
  max-width: 78%;
  padding: 14px;
  border-radius: 8px;
  background: var(--surface);
}

.message strong {
  display: block;
  margin-bottom: 6px;
  color: var(--accent);
}

.message p {
  margin-bottom: 0;
  color: var(--soft);
  line-height: 1.65;
}

.result-list {
  display: grid;
  gap: 8px;
  margin: 12px 0 0;
  padding-left: 18px;
  color: var(--soft);
  line-height: 1.6;
}

.result-block,
.doc-preview,
.storyboard > div,
.code-preview {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
}

.result-block small,
.storyboard small,
.result-note {
  color: var(--muted);
}

.swatches {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.swatches span {
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 999px;
}

.storyboard {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.storyboard strong,
.doc-preview strong {
  display: block;
  margin-bottom: 6px;
}

.doc-preview h4 {
  margin: 0 0 12px;
}

.doc-preview section + section {
  margin-top: 12px;
}

.code-preview {
  overflow: auto;
  color: var(--accent);
  font-size: 12px;
  line-height: 1.6;
}

.source-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  margin-bottom: 10px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(47, 211, 159, 0.12);
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
}

.result-media {
  display: block;
  width: 100%;
  max-height: 360px;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  object-fit: contain;
}

.message.user {
  justify-self: end;
  background: rgba(47, 211, 159, 0.14);
}

.composer {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.composer input,
.provider-select {
  flex: 1;
  min-width: 0;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: 0;
  background: var(--surface);
  color: var(--text);
}

.provider-select {
  max-width: 220px;
}

.status-dot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent);
  font-size: 13px;
}

.status-dot::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--accent);
}

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

.metric-grid div {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.metric-grid strong {
  display: block;
  margin-top: 6px;
  font-size: 22px;
}

.chart-card {
  display: flex;
  align-items: end;
  gap: 10px;
  height: 160px;
  margin-top: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.chart-card span {
  flex: 1;
  min-width: 12px;
  border-radius: 8px 8px 3px 3px;
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
}

.task-list {
  display: grid;
  gap: 12px;
  margin: 16px 0 0;
  padding: 0;
  color: var(--soft);
  list-style: none;
}

.task-list li {
  display: flex;
  align-items: center;
  gap: 10px;
}

.task-list span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent-3);
}

.feature-band {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  padding: 0 28px 42px;
}

.feature-band article {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.feature-band span {
  color: var(--accent);
  font-weight: 900;
}

.feature-band h3 {
  margin: 14px 0 10px;
}

.feature-band p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.65;
}

.modal {
  width: min(420px, calc(100% - 32px));
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
}

.wide-modal {
  width: min(920px, calc(100% - 32px));
}

.admin-modal {
  width: min(1080px, calc(100% - 32px));
}

.modal::backdrop {
  background: rgba(0, 0, 0, 0.58);
  backdrop-filter: blur(8px);
}

.modal-card {
  position: relative;
  display: grid;
  gap: 12px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.modal-card input {
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: 0;
  background: var(--bg);
  color: var(--text);
}

.auth-modal {
  width: min(480px, calc(100% - 28px));
}

.auth-card {
  gap: 14px;
  padding: 28px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent 42%),
    var(--surface);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-right: 34px;
}

.auth-brand h2 {
  margin: 2px 0 0;
  font-size: 28px;
}

.auth-subtitle {
  margin: -4px 0 4px;
}

.auth-methods {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
}

.auth-methods button {
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.auth-methods button.selected {
  background: var(--surface-2);
  color: var(--text);
}

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

.auth-field label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.inline-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.inline-field .secondary-button {
  white-space: nowrap;
}

.agreement-line {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 13px;
}

.agreement-line input {
  width: 16px;
  min-height: 16px;
  accent-color: var(--accent);
}

.social-login {
  display: grid;
  gap: 10px;
  padding-top: 4px;
  text-align: center;
}

.social-login > span {
  color: var(--muted);
  font-size: 12px;
}

.social-login > div {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.social-login button,
.link-button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--soft);
}

.social-login button:hover,
.link-button:hover {
  border-color: rgba(47, 211, 159, 0.38);
  color: var(--text);
}

.link-button {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}

.modal-card p {
  color: var(--muted);
  line-height: 1.7;
}

.form-tip {
  margin-bottom: 0;
  font-size: 13px;
}

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

.key-item {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
}

.key-item code {
  overflow: auto;
  color: var(--accent);
  font-size: 12px;
  white-space: nowrap;
}

.provider-editor {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  max-height: 70vh;
  overflow: auto;
}

.provider-form {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
}

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

.provider-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.provider-form input {
  width: 100%;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: 0;
  background: var(--surface);
  color: var(--text);
}

.provider-form input[type="checkbox"] {
  width: auto;
  min-height: auto;
}

.provider-form p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

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

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

.billing-panel p {
  margin-bottom: 0;
  color: var(--muted);
}

.billing-history {
  grid-column: 1 / -1;
}

.admin-tabs {
  display: flex;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
}

.admin-tabs button {
  min-height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
}

.admin-tabs .selected {
  background: var(--surface-2);
  color: var(--text);
}

.admin-panel {
  max-height: 70vh;
  overflow: auto;
}

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

.admin-user-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 140px auto;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
}

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

.admin-user-row input {
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: 0;
  background: var(--surface);
  color: var(--text);
}

.admin-user-row select,
.plan-row input {
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: 0;
  background: var(--surface);
  color: var(--text);
}

.plan-row {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) 130px 130px 90px auto;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
}

.plan-row label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
}

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

.site-settings-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.site-settings-form textarea {
  min-height: 42px;
  resize: vertical;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: 0;
  background: var(--surface);
  color: var(--text);
}

.site-settings-form .check-line {
  display: flex;
  align-items: center;
  gap: 8px;
}

.site-settings-form button {
  justify-self: start;
}

.agent-create {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
  gap: 10px;
  margin-bottom: 12px;
}

.agent-create input {
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: 0;
  background: var(--surface);
  color: var(--text);
}

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

.agent-row {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(4, minmax(90px, 0.35fr));
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
}

.agent-row p,
.agent-row small,
.empty-admin {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.agent-row strong {
  display: block;
}

.agent-center {
  display: grid;
  gap: 12px;
}

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

.agent-summary div,
.agent-invite,
.agent-withdraw,
.agent-table {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
}

.agent-summary small,
.agent-table p {
  color: var(--muted);
}

.agent-summary strong {
  display: block;
  margin-top: 6px;
  font-size: 24px;
}

.agent-invite {
  display: grid;
  gap: 8px;
}

.agent-invite code {
  overflow: auto;
  color: var(--accent);
  white-space: nowrap;
}

.agent-withdraw {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr) auto;
  gap: 10px;
}

.agent-withdraw input {
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: 0;
  background: var(--surface);
  color: var(--text);
}

.agent-table {
  display: grid;
  gap: 8px;
}

.agent-table p {
  margin: 0;
}

.close-button {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text);
}

@media (max-width: 1080px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    z-index: 30;
    width: 260px;
    transform: translateX(-105%);
    transition: transform 0.22s ease;
  }

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

  .menu-toggle {
    display: inline-grid;
    place-items: center;
  }

  .hero,
  .gallery-hero-grid,
  .workspace-grid {
    grid-template-columns: 1fr;
  }

  .model-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: none;
  }

  .hero,
  .gallery-hero {
    min-height: auto;
    padding-top: 28px;
  }

  .gallery-hero-grid {
    min-height: auto;
    padding-top: 26px;
  }

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

@media (max-width: 720px) {
  .topbar {
    flex-wrap: wrap;
    padding: 12px;
  }

  .search-box {
    order: 3;
    width: 100%;
    max-width: none;
    flex-basis: 100%;
  }

  .top-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
    max-width: calc(100% - 58px);
  }

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

  .hero,
  .gallery-hero,
  .gallery-section,
  .workspace-grid,
  .feature-band {
    padding-right: 14px;
    padding-left: 14px;
  }

  .gallery-hero::before {
    inset: 12px;
  }

  .gallery-stats,
  .model-gallery,
  .salon-grid {
    grid-template-columns: 1fr;
  }

  .featured-frame,
  .featured-frame img {
    min-height: 300px;
  }

  .featured-frame div {
    align-items: start;
    flex-direction: column;
  }

  .auth-card {
    padding: 22px;
  }

  .auth-methods,
  .model-list,
  .social-login > div {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 42px;
  }

  .panel-head,
  .composer {
    align-items: stretch;
    flex-direction: column;
  }

  .provider-select {
    max-width: none;
  }

  .segmented {
    overflow-x: auto;
  }

  .message {
    max-width: 100%;
  }

  .feature-band {
    grid-template-columns: 1fr;
  }

  .provider-editor {
    grid-template-columns: 1fr;
  }

  .billing-grid {
    grid-template-columns: 1fr;
  }

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

  .agent-create,
  .agent-row,
  .agent-summary,
  .agent-withdraw,
  .plan-row,
  .site-settings-form {
    grid-template-columns: 1fr;
  }
}
