:root {
  color-scheme: dark;
  --ui-font: "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --ui-text: #111827;
  --ui-muted: #667085;
  --ui-faint: #8a94a6;
  --ui-bg: #f7f8fb;
  --ui-surface: #ffffff;
  --ui-surface-soft: #f2f4f7;
  --ui-line: rgba(17, 24, 39, .14);
  --ui-line-strong: rgba(17, 24, 39, .28);
  --ui-accent: #2563eb;
  --ui-accent-soft: #eff6ff;
  --ui-radius: 8px;
  --ui-card-radius: 12px;
  --ui-container-radius: 16px;
  --ui-pill-radius: 999px;
  font-family: var(--ui-font);
  font-size: 13px;
  color: #f8fafc;
  background: #080c14;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: #080c14;
  line-height: 1.55;
  font-weight: 400;
}

button, input, select, textarea { font: inherit; }
button { border: 0; cursor: pointer; }
img, svg { display: block; }
img { max-width: 100%; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

.app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  background:
    radial-gradient(circle at 78% 22%, rgba(103, 58, 238, .22), transparent 24rem),
    linear-gradient(180deg, #0a0f18 0%, #0a101a 52%, #080c14 100%);
}

.app--light {
  color: #111827;
  background: #f8fafc;
  grid-template-columns: 246px minmax(0, 1fr);
}

.app--sidebar-collapsed,
.app--light.app--sidebar-collapsed {
  grid-template-columns: 76px minmax(0, 1fr);
}

.mobile-placeholder {
  display: none;
}

.sidebar {
  height: 100vh;
  padding: 22px 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: linear-gradient(180deg, rgba(16, 23, 37, .98), rgba(10, 15, 24, .98));
  border-right: 1px solid rgba(148, 163, 184, .12);
  position: sticky;
  top: 0;
  color: #f8fafc;
  overflow: auto;
}

.brand, .create-button, .nav-item, .top-tabs button, .top-tabs a, .round-button, .recent-item,
.type-card, .template-card, .secondary-action, .action-row, .setup-card button,
.generated-grid button, .selected-file button, .prompt-ideas button, .tool-button {
  color: inherit;
  background: transparent;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.sidebar .brand {
  min-height: 48px;
  padding: 6px 10px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid rgba(255, 255, 255, .72);
}

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

.sidebar-toggle {
  width: 34px;
  height: 34px;
  margin-left: auto;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #cbd5e1;
  background: rgba(30, 41, 59, .76);
}

.brand__mark {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #5b6cff, #a63df5);
  box-shadow: 0 10px 26px rgba(37, 99, 235, .22);
}

.brand-logo {
  display: block;
  width: auto;
  object-fit: contain;
}

.brand-logo--app {
  height: 40px;
  max-width: 142px;
  filter: contrast(1.18) brightness(1.08);
}

.brand-logo--landing {
  height: 42px;
  max-width: 160px;
}

.create-button, .generate-button, .big-generate, .open-editor {
  min-height: 46px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #fff;
  font-weight: 600;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  box-shadow: 0 18px 34px rgba(37, 99, 235, .20);
}

.create-button {
  width: 100%;
  justify-content: center;
  padding: 0 18px;
  font-size: 15px;
}

.create-button span { white-space: nowrap; }

.app--sidebar-collapsed .sidebar {
  padding: 22px 10px;
  align-items: center;
  overflow: visible;
}

.app--sidebar-collapsed .sidebar-head,
.app--sidebar-collapsed .main-nav {
  width: 100%;
}

.app--sidebar-collapsed .sidebar-head {
  flex-direction: column;
}

.app--sidebar-collapsed .brand {
  padding: 0;
  justify-content: center;
  align-items: center;
  min-height: 44px;
  width: 44px;
}

.app--sidebar-collapsed .brand strong,
.app--sidebar-collapsed .create-button span,
.app--sidebar-collapsed .nav-item span,
.app--sidebar-collapsed .nav-title,
.app--sidebar-collapsed .history-block,
.app--sidebar-collapsed .pro-card,
.app--sidebar-collapsed .user-card span,
.app--sidebar-collapsed .user-card b {
  display: none;
}

.app--sidebar-collapsed .brand-logo--app {
  width: 34px;
  height: 34px;
  object-fit: cover;
  object-position: center;
}

.app--sidebar-collapsed .sidebar-toggle {
  margin-left: 0;
}

.app--sidebar-collapsed .sidebar-toggle svg {
  transform: rotate(180deg);
}

.app--sidebar-collapsed .create-button,
.app--sidebar-collapsed .nav-item {
  width: 44px;
  min-height: 44px;
  padding: 0;
  justify-content: center;
  margin: 0 auto;
}

.app--sidebar-collapsed .user-card {
  display: block;
  padding: 0;
}

.main-nav { display: grid; gap: 5px; }

.nav-title {
  color: #8c97ab;
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 600;
  margin: 4px 8px -6px;
}

.history-block {
  display: grid;
  gap: 10px;
}

.history-search {
  height: 36px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border-radius: 7px;
  color: #8c97ab;
  background: rgba(30, 41, 59, .72);
  border: 1px solid rgba(148, 163, 184, .12);
}

.history-search input {
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  color: #dbe4f2;
  background: transparent;
}

.history-list {
  max-height: 360px;
  display: grid;
  gap: 7px;
  overflow: auto;
  padding-right: 2px;
}

.history-item {
  min-width: 0;
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px;
  gap: 6px;
  align-items: center;
  padding: 7px;
  border-radius: 7px;
  color: #dbe4f2;
  background: transparent;
  text-align: left;
}

.history-item:hover,
.history-item.active {
  background: rgba(51, 65, 85, .74);
}

.history-item__open {
  min-width: 0;
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  color: inherit;
  background: transparent;
  text-align: left;
}

.history-item img {
  width: 56px;
  height: 44px;
  object-fit: cover;
  border-radius: 5px;
}

.history-item strong,
.history-item small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-item strong {
  font-size: 12px;
}

.history-item small {
  margin-top: 4px;
  color: #9aa5b8;
  font-size: 11px;
}

.history-actions {
  position: relative;
  opacity: 0;
  pointer-events: none;
}

.history-item:hover .history-actions,
.history-actions[open] {
  opacity: 1;
  pointer-events: auto;
}

.history-actions summary {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  color: #cbd5e1;
  list-style: none;
  cursor: pointer;
}

.history-actions summary::-webkit-details-marker { display: none; }

.history-actions summary:hover {
  background: rgba(148, 163, 184, .16);
}

.history-actions div {
  position: absolute;
  right: 0;
  top: 30px;
  min-width: 116px;
  padding: 6px;
  border: 1px solid rgba(148, 163, 184, .18);
  border-radius: 8px;
  background: #111827;
  box-shadow: 0 18px 36px rgba(0, 0, 0, .28);
  z-index: 8;
}

.history-actions button {
  width: 100%;
  min-height: 32px;
  padding: 0 10px;
  border-radius: 6px;
  color: #fecaca;
  background: transparent;
  text-align: left;
}

.history-actions button:hover {
  background: rgba(239, 68, 68, .16);
}

.history-empty {
  padding: 8px 10px;
  color: #8c97ab;
  font-size: 13px;
}

.history-all-button {
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 7px;
  color: #dbe4f2;
  background: rgba(30, 41, 59, .72);
  border: 1px solid rgba(148, 163, 184, .14);
}

.history-all-button:hover {
  background: rgba(51, 65, 85, .86);
}

.empty-chat-hint {
  max-width: 560px;
  margin: auto;
  display: grid;
  justify-items: center;
  gap: 10px;
  color: #667085;
  text-align: center;
}

.empty-chat-hint span {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #2563eb;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
}

.empty-chat-hint h2 {
  margin: 0;
  color: #111827;
  font-size: 22px;
}

.empty-chat-hint p {
  margin: 0;
  line-height: 1.45;
}

.nav-item {
  width: 100%;
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 12px;
  border-radius: 7px;
  color: #bdc6d5;
  text-align: left;
}

.nav-item:hover, .nav-item.active {
  background: rgba(116, 88, 255, .94);
  color: #fff;
}

.sidebar-spacer { flex: 1; }

.pro-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: 8px;
  background: rgba(30, 41, 59, .86);
  border: 1px solid rgba(148, 163, 184, .16);
}

.pro-card span {
  color: #aab5c8;
  font-size: 13px;
  line-height: 1.35;
}

.pro-card button {
  min-height: 38px;
  border-radius: 7px;
  color: #fff;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
}

.user-card {
  min-height: 44px;
  width: 100%;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  padding: 8px 2px;
  color: #dbe4f2;
  text-align: left;
  border-radius: 8px;
  background: transparent;
}

.user-card:hover,
.user-card.active {
  background: rgba(255, 255, 255, .07);
}

.user-card .avatar {
  width: 34px;
  height: 34px;
}

.user-card strong,
.user-card small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-card small {
  color: #9aa5b8;
  font-size: 11px;
}

.main-shell {
  min-width: 0;
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 244px;
  grid-template-rows: 64px 1fr;
}

.topbar {
  grid-column: 1 / -1;
  height: 64px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid rgba(148, 163, 184, .14);
  background: rgba(8, 13, 22, .72);
  backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.app--light .topbar {
  background: rgba(255, 255, 255, .86);
  border-bottom-color: #e5e7eb;
}

.app--light .main-shell {
  grid-template-columns: minmax(0, 1fr);
}

.app--light .recent-panel {
  display: none;
}

.top-tabs, .top-tools {
  display: flex;
  align-items: center;
  gap: 10px;
}

.top-tabs button,
.top-tabs a {
  height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 13px;
  border-radius: 8px;
  color: #cbd5e1;
  font-weight: 600;
  text-decoration: none;
}

.app:not(.app--light) .top-tabs { visibility: hidden; }

.app--light .top-tabs button,
.app--light .top-tabs a { color: #202839; }
.top-tabs button.active { color: #fff; background: linear-gradient(135deg, #2563eb, #2563eb); }

.credits {
  height: 40px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border-radius: 8px;
  background: rgba(15, 23, 42, .66);
  color: #dbe4f2;
  border: 1px solid rgba(148, 163, 184, .15);
}

.app--light .credits {
  background: #fff;
  color: #111827;
  border-color: #e5e7eb;
}

.credits button,
.credits span {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: #2563eb;
}

.credits svg { width: 13px; height: 13px; }

.round-button {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(148, 163, 184, .18);
}

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 68% 24%, rgba(255, 255, 255, .58) 0 8%, transparent 9%),
    linear-gradient(135deg, #2563eb 0%, #2563eb 52%, #0f6fdc 100%);
  border: 2px solid rgba(255, 255, 255, .42);
  box-shadow: 0 10px 24px rgba(37, 99, 235, .18);
}

.avatar::before {
  content: attr(data-initials);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
}

.avatar-button {
  padding: 0;
  flex: 0 0 auto;
}

.account-menu-wrap {
  position: relative;
}

.avatar-button.active,
.avatar-button:hover {
  border-color: rgba(37, 99, 235, .38);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, .12), 0 10px 24px rgba(37, 99, 235, .18);
}

.account-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  width: 292px;
  padding: 10px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 60px rgba(15, 23, 42, .16);
  z-index: 60;
}

.account-menu-head {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 8px;
  border-bottom: 1px solid #eef2f6;
}

.account-menu-head strong,
.account-menu-head small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-menu-head strong {
  color: #111827;
  font-size: 14px;
}

.account-menu-profile-link {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.account-menu-profile-link:hover strong {
  color: #2563eb;
}

.account-menu-head small {
  color: #667085;
  font-size: 12px;
}

.account-menu-list {
  padding: 8px 0;
  display: grid;
  gap: 2px;
}

.account-menu-list button,
.account-menu-logout {
  width: 100%;
  min-height: 38px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  gap: 9px;
  border-radius: 7px;
  color: #344054;
  background: transparent;
  text-align: left;
  font-weight: 600;
}

.account-menu-list button:hover,
.account-menu-logout:hover {
  background: #eff6ff;
  color: #1d4ed8;
}

.account-menu-logout {
  border-top: 1px solid #eef2f6;
  color: #b42318;
}

.landing-page,
.auth-page {
  min-height: 100vh;
  color: #0f172a;
  background: #f7f9fc;
}

.landing-nav {
  height: 72px;
  padding: 0 clamp(20px, 5vw, 72px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.landing-nav > div,
.landing-nav__main,
.landing-nav__auth {
  display: flex;
  align-items: center;
  gap: 10px;
}

.landing-nav__main {
  min-width: 0;
  flex: 1 1 auto;
  justify-content: flex-start;
  gap: 18px;
}

.landing-nav__auth {
  flex: 0 0 auto;
  justify-content: flex-end;
}

.landing-brand {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 0;
  color: #101828;
  background: transparent;
  font-size: 22px;
  font-weight: 700;
}

.landing-link,
.auth-switch {
  min-height: 42px;
  padding: 0 14px;
  border-radius: 8px;
  color: #4f46e5;
  background: transparent;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.landing-nav-links {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.landing-nav-item,
.landing-gallery-button {
  min-height: 38px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 0;
  border-radius: 999px;
  color: #344054 !important;
  background: #f2f4f7;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
}

.landing-nav-item.is-active {
  color: #111827 !important;
  background: #fff;
  box-shadow: inset 0 0 0 1px #dbe3ef;
}

.landing-nav-item span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.landing-nav-item svg,
.landing-gallery-button svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.landing-button {
  min-height: 42px;
  padding: 0 16px;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(135deg, #2563eb, #2563eb);
  box-shadow: 0 16px 32px rgba(37, 99, 235, .18);
  font-weight: 600;
}

.landing-button--large,
.landing-link--large {
  min-height: 50px;
  padding: 0 20px;
  font-size: 15px;
}

.landing-hero {
  min-height: calc(100vh - 72px);
  padding: 24px clamp(20px, 5vw, 72px) 56px;
  display: grid;
  grid-template-columns: minmax(420px, .78fr) minmax(480px, 1fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: center;
}

.landing-footer {
  margin: 28px clamp(20px, 5vw, 72px) 72px;
  padding: 18px 0 0;
  border-top: 1px solid #e5e7eb;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  color: #667085;
  font-size: 13px;
  line-height: 1.45;
}

.landing-footer > div {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.landing-footer strong {
  color: #101828;
  font-weight: 500;
}

.landing-footer nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px 14px;
}

.landing-footer a {
  color: #2563eb;
  text-decoration: none;
}

.landing-copy {
  max-width: 680px;
}

.landing-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  padding: 0 11px;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  color: #1d4ed8;
  background: #eff6ff;
  font-size: 13px;
  font-weight: 600;
}

.landing-kicker svg {
  width: 15px;
  height: 15px;
}

.landing-copy h1 {
  max-width: 680px;
  margin: 22px 0 18px;
  color: #0b1220;
  font-size: clamp(32px, 3.5vw, 48px);
  line-height: 1.08;
  letter-spacing: -0.02em;
  font-weight: 600;
}

.landing-copy p {
  max-width: 600px;
  margin: 0;
  color: #526070;
  font-size: 18px;
  line-height: 1.55;
}

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

.landing-visual {
  margin: 0;
  min-height: 0;
}

.landing-visual img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 26px 70px rgba(15, 23, 42, .18);
}

.auth-page {
  display: grid;
  place-items: center;
  padding: 28px;
}

.auth-brand {
  position: fixed;
  top: 24px;
  left: 28px;
}

.auth-card {
  width: min(100%, 460px);
  padding: 30px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 60px rgba(15, 23, 42, .12);
}

.auth-card h1 {
  margin: 18px 0 8px;
  font-size: 28px;
  line-height: 1.12;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.auth-card p {
  margin: 0 0 22px;
  color: #667085;
  line-height: 1.5;
}

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

.auth-social-actions {
  display: grid;
  gap: 8px;
  margin: 14px 0 0;
}

.auth-social-button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 8px;
  border: 1px solid #111827;
  background: #111827;
  color: #fff;
  text-decoration: none;
  font-weight: 500;
}

.auth-social-button--yandex:hover {
  background: #000;
  color: #fff;
}

.yandex-mark {
  display: inline-grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 50%;
  background: #fc3f1d;
  color: #fff;
  font-weight: 500;
  line-height: 1;
}

.auth-last-provider {
  padding: 9px 11px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  color: #344054;
  background: #f8fafc;
  font-size: 13px;
}

.auth-social-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #98a2b3;
  font-size: 13px;
}

.auth-social-divider::before,
.auth-social-divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: #e5e7eb;
}

.auth-card label {
  display: grid;
  gap: 7px;
  color: #344054;
  font-size: 13px;
  font-weight: 600;
}

.auth-card input {
  height: 46px;
  padding: 0 12px;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  color: #111827;
  background: #fff;
  font: inherit;
}

.auth-error {
  padding: 10px 12px;
  border: 1px solid #fecaca;
  border-radius: 8px;
  color: #991b1b;
  background: #fef2f2;
  font-size: 13px;
  font-weight: 600;
}

.auth-success {
  padding: 10px 12px;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  color: #027a48;
  background: #ecfdf3;
  font-size: 13px;
  font-weight: 500;
}

.auth-legal {
  margin: 10px 0 0;
  font-size: 12px;
  line-height: 1.45;
}

.auth-legal a {
  color: #2563eb;
}

.auth-consents {
  display: grid;
  gap: 8px;
  padding: 10px 0 2px;
}

.auth-card .auth-consents label {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  color: #475467;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.4;
}

.auth-card .auth-consents input {
  width: 16px;
  height: 16px;
  margin: 1px 0 0;
  padding: 0;
}

.auth-consents a {
  color: #2563eb;
  text-decoration: none;
}

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

.billing-package,
.billing-ledger article {
  display: grid;
  gap: 8px;
  padding: 16px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
}

.billing-package strong,
.billing-ledger strong {
  font-size: 18px;
  font-weight: 500;
}

.billing-package p,
.billing-ledger p,
.billing-ledger small,
.billing-ledger span {
  margin: 0;
  color: #667085;
}

.billing-ledger {
  display: grid;
  gap: 10px;
}

.pricing-page {
  width: 100%;
  min-height: 100vh;
  padding: 24px;
  display: grid;
  gap: 28px;
  align-content: start;
  background: #f8fafc;
}

.pricing-hero,
.pricing-card,
.pricing-notes article,
.pricing-bottom-cta,
.profile-balance-card {
  min-width: 0;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
}

.pricing-hero {
  padding: 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
}

.pricing-hero h1 {
  max-width: 720px;
  margin: 0 0 10px;
  color: #111827;
  font-size: 34px;
  line-height: 1.12;
  font-weight: 500;
  letter-spacing: 0;
}

.pricing-hero p,
.pricing-hero-panel p,
.pricing-hero-panel span,
.pricing-notes p,
.pricing-bottom-cta p,
.profile-balance-card p {
  margin: 0;
  color: #667085;
  line-height: 1.55;
}

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

.pricing-hero-panel {
  padding: 20px;
  display: grid;
  gap: 10px;
  align-content: start;
  border-radius: 12px;
  border: 1px solid #dbe3ef;
  background: #f8fafc;
}

.pricing-hero-panel strong {
  color: #111827;
  font-size: 18px;
  font-weight: 500;
}

.earning-landing {
  background: #f7f9fc;
}

.earning-hero,
.earning-flow,
.earning-opportunities,
.earning-dashboard-preview {
  margin: 0 clamp(20px, 5vw, 72px);
}

.earning-hero {
  min-height: calc(100vh - 72px);
  padding: 34px 0 56px;
  display: grid;
  grid-template-columns: minmax(360px, .95fr) minmax(360px, .82fr);
  gap: clamp(24px, 5vw, 64px);
  align-items: center;
}

.earning-hero__copy {
  min-width: 0;
}

.earning-hero__copy h1 {
  max-width: 780px;
  margin: 14px 0 14px;
  color: #111827;
  font-size: clamp(38px, 5vw, 68px);
  line-height: .98;
  font-weight: 500;
  letter-spacing: 0;
}

.earning-hero__copy p {
  max-width: 660px;
  margin: 0;
  color: #475467;
  font-size: 18px;
  line-height: 1.58;
}

.earning-hero__visual {
  min-width: 0;
  margin: 0;
  display: grid;
  gap: 12px;
}

.earning-hero__visual img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  background: #fff;
}

.earning-hero__visual figcaption {
  padding: 14px 16px;
  display: grid;
  gap: 4px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
}

.earning-hero__visual strong,
.earning-hero__visual span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.earning-hero__visual strong {
  color: #111827;
  font-weight: 500;
}

.earning-hero__visual span {
  color: #667085;
  line-height: 1.45;
}

.earning-flow,
.earning-opportunities {
  padding: 52px 0 0;
  display: grid;
  gap: 18px;
}

.earning-flow__layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, .95fr);
  gap: 14px;
}

.earning-flow__layout article,
.earning-opportunity,
.earning-dashboard-preview {
  min-width: 0;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
}

.earning-flow__layout article {
  padding: 24px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.earning-flow__layout article:not(.earning-flow__main) {
  min-height: 168px;
}

.earning-flow__main {
  grid-row: span 2;
  min-height: 350px;
  align-content: end;
}

.earning-flow__layout article > span,
.earning-opportunity > span {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  color: #2563eb;
  background: #eff6ff;
  font-weight: 500;
}

.earning-flow__main > span {
  width: 58px;
  height: 58px;
  font-size: 22px;
}

.earning-flow__layout article div,
.earning-opportunity div {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.earning-flow__layout strong,
.earning-opportunity strong,
.earning-dashboard-preview h2 {
  color: #111827;
  font-weight: 500;
}

.earning-flow__layout strong {
  font-size: 24px;
  line-height: 1.16;
}

.earning-flow__main strong {
  max-width: 560px;
  font-size: clamp(30px, 3vw, 44px);
  line-height: 1.05;
}

.earning-flow__layout p,
.earning-opportunity p,
.earning-dashboard-preview p {
  margin: 0;
  color: #667085;
  line-height: 1.55;
}

.earning-flow__main p {
  max-width: 620px;
  font-size: 18px;
}

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

.earning-opportunity {
  padding: 24px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.earning-opportunity--wide {
  grid-column: 1 / -1;
  padding: 30px;
}

.earning-opportunity--wide strong {
  font-size: 30px;
  line-height: 1.12;
}

.earning-opportunity svg {
  width: 18px;
  height: 18px;
}

.earning-dashboard-preview {
  margin-top: 18px;
  margin-bottom: 36px;
  padding: 24px;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(280px, .95fr);
  gap: 22px;
  align-items: center;
}

.earning-dashboard-preview h2 {
  margin: 12px 0 10px;
  font-size: 32px;
  line-height: 1.12;
  letter-spacing: 0;
}

.earning-dashboard-preview .secondary-action {
  margin-top: 16px;
}

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

.earning-stats-mock article {
  min-width: 0;
  padding: 16px;
  display: grid;
  gap: 6px;
  border: 1px solid #dbe3ef;
  border-radius: 12px;
  background: #f8fafc;
}

.earning-stats-mock span,
.earning-stats-mock small {
  color: #667085;
  overflow-wrap: anywhere;
}

.earning-stats-mock strong {
  color: #111827;
  font-size: 30px;
  font-weight: 500;
}

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

.pricing-grid--compact {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.pricing-card {
  padding: 18px;
  display: grid;
  grid-template-rows: auto auto auto auto 1fr auto auto;
  gap: 14px;
  align-content: stretch;
}

.pricing-card--featured {
  border-color: #2563eb;
  background: #f8fbff;
}

.pricing-card-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  min-height: 24px;
}

.pricing-card-head span,
.pricing-card-head b {
  color: #667085;
  font-size: 12px;
  font-weight: 500;
}

.pricing-card-head b {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  color: #2563eb;
  white-space: nowrap;
}

.pricing-card-head b svg {
  width: 14px;
  height: 14px;
}

.pricing-card h2,
.profile-balance-card h2 {
  margin: 0;
  color: #111827;
  font-size: 20px;
  font-weight: 500;
  letter-spacing: 0;
}

.pricing-price {
  margin: 0;
  color: #111827;
  font-size: 32px;
  line-height: 1;
  font-weight: 500;
}

.pricing-price span {
  color: #667085;
  font-size: 13px;
  font-weight: 400;
}

.pricing-main-count {
  padding: 12px;
  display: grid;
  gap: 2px;
  border-radius: 8px;
  background: #f2f4f7;
}

.pricing-main-count strong {
  color: #111827;
  font-size: 24px;
  line-height: 1;
  font-weight: 500;
}

.pricing-main-count span {
  color: #667085;
  font-size: 13px;
}

.pricing-card ul {
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
  list-style: none;
}

.pricing-card li {
  color: #344054;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.pricing-card .generate-button {
  width: 100%;
  margin-top: auto;
  justify-content: center;
}

.pricing-per-image {
  margin: -4px 0 0;
  color: #667085;
  font-size: 13px;
  text-align: center;
}

.pricing-notes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.pricing-notes article {
  padding: 16px;
  display: grid;
  gap: 8px;
}

.pricing-notes strong {
  color: #111827;
  font-size: 16px;
  font-weight: 500;
}

.pricing-bottom-cta {
  padding: 32px 24px;
  display: grid;
  justify-items: center;
  gap: 18px;
  text-align: center;
}

.pricing-bottom-cta .generate-button {
  justify-self: center;
  margin-left: 0;
}

.pricing-bottom-cta strong {
  display: block;
  margin-bottom: 6px;
  color: #111827;
  font-size: 24px;
  line-height: 1.2;
  font-weight: 500;
}

.pricing-bottom-cta p {
  max-width: 560px;
}

.billing-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
}

.billing-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  color: #344054;
}

.billing-table th,
.billing-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #eef2f6;
  text-align: left;
  vertical-align: top;
}

.billing-table th {
  color: #667085;
  background: #f8fafc;
  font-size: 12px;
  font-weight: 500;
}

.billing-table td strong,
.billing-table td small {
  display: block;
}

.billing-table td strong {
  color: #111827;
  font-weight: 500;
}

.billing-table td small {
  margin-top: 2px;
  color: #667085;
  font-size: 12px;
}

.billing-table a {
  color: #2563eb;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.billing-amount {
  display: inline-flex;
  min-width: 64px;
  justify-content: flex-end;
  font-weight: 500;
}

.billing-amount.positive {
  color: #047857;
}

.billing-amount.negative {
  color: #b42318;
}

.legal-content {
  display: grid;
  gap: 12px;
  max-width: 980px;
  padding: 24px;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  background: #fff;
  color: #1f2937;
}

.legal-page {
  justify-items: center;
}

.legal-hero {
  width: min(100%, 980px);
  min-width: 0;
  padding: 24px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: start;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
}

.legal-hero h1 {
  margin: 12px 0 8px;
  color: #111827;
  font-size: clamp(28px, 4vw, 38px);
  line-height: 1.1;
  font-weight: 500;
  letter-spacing: 0;
}

.legal-hero p {
  max-width: 720px;
  margin: 0;
  color: #667085;
  line-height: 1.5;
}

.legal-hero .secondary-action {
  align-self: start;
  white-space: nowrap;
}

.legal-content h2 {
  margin: 12px 0 0;
  font-size: 18px;
  font-weight: 500;
  color: #111827;
}

.legal-content p {
  margin: 0;
  color: #1f2937;
  line-height: 1.6;
}

.legal-content strong {
  color: #111827;
  font-weight: 500;
}

.legal-content em {
  display: block;
  margin-top: 8px;
  padding-top: 14px;
  border-top: 1px solid #e5e7eb;
  color: #344054;
  font-style: normal;
}

.legal-page .landing-footer {
  width: min(100%, 980px);
  margin: 0;
  padding: 18px 24px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  color: #475467;
}

.auth-switch {
  width: 100%;
  margin-top: 14px;
}

@media (max-width: 980px) {
  .landing-nav {
    height: auto;
    min-height: 64px;
    padding: 10px 18px;
    gap: 10px;
    overflow: hidden;
  }

  .landing-brand {
    min-width: 0;
    flex: 0 1 auto;
    font-size: 20px;
  }

  .landing-brand strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .landing-nav > div,
  .landing-nav__main,
  .landing-nav__auth {
    min-width: 0;
    flex: 0 0 auto;
    gap: 6px;
  }

  .landing-nav__main {
    flex: 1 1 auto;
  }

  .landing-nav-links {
    flex: 1 1 auto;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .landing-nav-links::-webkit-scrollbar {
    display: none;
  }

  .landing-nav .landing-link {
    min-height: 40px;
    padding: 0 8px;
  }

  .landing-nav .landing-button {
    min-height: 40px;
    padding: 0 12px;
    font-size: 14px;
  }

  .landing-hero {
    min-height: auto;
    grid-template-columns: 1fr;
    padding: 18px 18px 40px;
  }

  .earning-hero,
  .earning-flow,
  .earning-opportunities,
  .earning-dashboard-preview {
    margin-left: 18px;
    margin-right: 18px;
  }

  .earning-hero,
  .earning-flow__layout,
  .earning-opportunities__layout,
  .earning-dashboard-preview {
    min-height: auto;
    grid-template-columns: 1fr;
  }

  .earning-hero {
    padding: 18px 0 34px;
  }

  .earning-stats-mock {
    grid-template-columns: 1fr;
  }

  .earning-flow__main {
    grid-row: auto;
    min-height: 0;
  }

  .earning-opportunity--wide {
    grid-column: auto;
  }

  .landing-footer {
    margin: 24px 18px 60px;
    display: grid;
    gap: 12px;
  }

  .landing-footer nav {
    justify-content: flex-start;
  }

  .legal-hero {
    grid-template-columns: 1fr;
    padding: 18px;
  }

  .legal-hero .secondary-action {
    width: 100%;
    justify-content: center;
  }

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

  .landing-visual img {
    aspect-ratio: 16 / 11;
  }
}

.home-page {
  grid-column: 1;
  grid-row: 2;
  padding: 28px;
  display: grid;
  gap: 22px;
  align-content: start;
}

.app--light .home-page {
  color: #111827;
  background: #f8fafc;
}

.home-start {
  padding: 24px;
  display: grid;
  gap: 22px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 48px rgba(15, 23, 42, .06);
}

.home-start__head {
  display: grid;
  gap: 10px;
}

.home-start__head h1 {
  max-width: 760px;
  margin: 0;
  color: #111827;
  font-size: 34px;
  line-height: 1.08;
}

.home-start__head p {
  max-width: 720px;
  margin: 0;
  color: #566070;
  line-height: 1.55;
}

.home-start__body {
  display: grid;
  grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
  gap: 18px;
  align-items: stretch;
}

.home-scenarios {
  display: grid;
  gap: 10px;
}

.home-scenario {
  min-width: 0;
  padding: 10px;
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #f8fafc;
  color: #111827;
  text-align: left;
}

.home-scenario.active {
  border-color: #8b5cf6;
  background: #eff6ff;
  box-shadow: 0 12px 28px rgba(37, 99, 235, .12);
}

.home-scenario__image {
  width: 76px;
  height: 58px;
  overflow: hidden;
  display: block;
  border-radius: 7px;
  background: #eef2f6;
}

.home-scenario__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.home-scenario strong,
.home-scenario small {
  display: block;
}

.home-scenario strong {
  font-size: 15px;
  line-height: 1.2;
}

.home-scenario small {
  margin-top: 3px;
  color: #667085;
  font-size: 12px;
  line-height: 1.35;
}

.home-create-panel {
  min-width: 0;
  padding: 18px;
  display: grid;
  gap: 14px;
  align-content: start;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fbfcff;
}

.home-create-panel__title {
  display: grid;
  gap: 5px;
}

.home-create-panel__title span {
  color: #2563eb;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.home-create-panel__title h2 {
  margin: 0;
  color: #111827;
}

.home-create-panel__title p {
  margin: 0;
  color: #667085;
}

.home-start .prompt-bar {
  border-color: #d0d5dd;
  background: #fff;
  box-shadow: none;
}

.home-start .prompt-bar textarea {
  min-height: 118px;
  color: #111827;
}

.home-start .prompt-bar textarea::placeholder {
  color: #98a2b3;
}

.home-start .prompt-bar > div {
  border-top-color: #eef2f6;
}

.home-start .tool-button {
  color: #344054;
  background: #f2f4f7;
}

.marketplace-hero {
  padding: 24px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 22px;
  align-items: stretch;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 48px rgba(15, 23, 42, .06);
}

.generation-hero {
  padding: 50px 0;
  display: grid;
  justify-items: center;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.generation-hero__focus {
  width: 100%;
  max-width: 720px;
  display: grid;
  gap: 22px;
}

.generation-hero__intro {
  text-align: center;
  display: grid;
  gap: 12px;
  justify-items: center;
}

.generation-hero__intro .home-kicker {
  margin: 0;
}

.generation-hero__lead {
  margin: 0;
  max-width: 48rem;
  color: #475467;
  font-size: 16px;
  line-height: 1.55;
}

.generation-panel__head {
  display: grid;
  gap: 8px;
}

.generation-panel__head h2 {
  margin: 0;
  color: #101828;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.25;
}

.generation-panel__hint {
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
  color: #667085;
}

.generation-panel__mode {
  color: #344054;
  font-weight: 600;
}

.generation-panel {
  min-width: 0;
  padding: 18px;
  display: grid;
  gap: 14px;
  align-content: start;
  border: 1px solid #d7dce5;
  border-radius: 8px;
  background: #fbfcff;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, .015);
}

.generation-panel .prompt-bar textarea {
  min-height: 190px;
}

.generation-panel .prompt-bar {
  border-color: #d0d5dd;
  background: #fff;
  box-shadow: none;
}

.generation-panel .prompt-bar textarea {
  color: #111827;
}

.generation-panel .prompt-bar textarea::placeholder {
  color: #98a2b3;
}

.generation-panel .prompt-bar > div {
  border-top-color: #eef2f6;
}

.generation-panel .tool-button {
  color: #344054;
  background: #f2f4f7;
}

.home-prompt-bar {
  display: flex;
  flex-direction: column;
}

.home-prompt-bar.home-dropzone--drag {
  background: #eff6ff;
  box-shadow: inset 0 0 0 2px rgba(37, 99, 235, 0.28);
}

.home-prompt-bar > .home-file-chips {
  padding: 12px 14px;
  border-top: 1px solid #eef2f6;
}

.home-compose-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.home-compose-actions .tool-button {
  flex: 0 1 auto;
}

.home-compose-actions .generate-button {
  flex: 0 0 auto;
  margin-left: auto;
}

.home-compose-actions .prompt-polish-button {
  flex: 0 1 auto;
  white-space: nowrap;
}

.home-size-select {
  min-height: 42px;
  width: 84px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  border: 1px solid transparent;
  border-radius: 8px;
  background: #f2f4f7;
  color: #344054;
}

.home-size-select select {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #344054;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

.generation-composer {
  display: flex;
  flex-direction: column;
}

.generation-composer__actions {
  min-width: 0;
}

.generation-composer__select {
  width: 86px;
  min-width: 72px;
  padding: 0 8px;
}

.chat-composer .generation-start-form,
.editor-chat-panel .generation-start-form {
  border-color: #d0d5dd;
  background: #fff;
  box-shadow: none;
}

.chat-composer .generation-start-form textarea,
.editor-chat-panel .generation-start-form textarea {
  min-height: 150px;
  padding: 16px 18px;
  color: #111827;
  background: transparent;
}

.chat-composer .generation-start-form textarea::placeholder,
.editor-chat-panel .generation-start-form textarea::placeholder {
  color: #98a2b3;
}

.chat-composer .generation-start-form > div,
.editor-chat-panel .generation-start-form > div {
  border-top-color: #eef2f6;
}

.chat-composer .generation-start-form .tool-button,
.editor-chat-panel .generation-start-form .tool-button {
  color: #344054;
  background: #f2f4f7;
}

.editor-chat-panel .generation-start-form {
  width: 100%;
}

.editor-chat-panel .generation-start-form textarea {
  min-height: 116px;
}

.home-prompt-bar > .home-dropzone {
  border-top: 1px solid #eef2f6;
  border-bottom: 1px solid #eef2f6;
  margin: 0 -1px;
}

.home-dropzone {
  padding: 12px 14px;
  min-height: 72px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #f8fafc;
  cursor: default;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

.home-dropzone--drag {
  background: #eff6ff;
  box-shadow: inset 0 0 0 2px rgba(37, 99, 235, 0.28);
}

.home-dropzone--has-files .home-dropzone__hint {
  padding: 8px 10px;
  border-radius: 8px;
  background: #fff;
  border: 1px dashed #d0d5dd;
}

.home-dropzone__hint {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  cursor: pointer;
  color: #475467;
  user-select: none;
}

.home-dropzone__hint svg {
  width: 36px;
  height: 36px;
  padding: 8px;
  flex-shrink: 0;
  border-radius: 8px;
  background: #dbeafe;
  color: #1d4ed8;
}

.home-dropzone__hint strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #111827;
}

.home-dropzone__hint small {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  font-weight: 500;
  color: #667085;
}

.home-file-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.home-file-chip {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 28px;
  align-items: center;
  gap: 8px;
  max-width: 280px;
  padding: 6px 8px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.home-file-chip__thumb {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  overflow: hidden;
  background: #f3f4f6;
}

.home-file-chip__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.home-file-chip__meta {
  min-width: 0;
}

.home-file-chip__meta strong {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #111827;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-file-chip__meta small {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  color: #667085;
}

.home-file-chip-remove {
  width: 28px;
  height: 28px;
  padding: 0;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 6px;
  background: #f2f4f7;
  color: #64748b;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.home-file-chip-remove:hover {
  background: #fee2e2;
  color: #b91c1c;
}

.quick-create-section {
  display: grid;
  gap: 12px;
}

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

.section-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: flex-end;
}

.marketplace-hero__copy {
  display: grid;
  gap: 16px;
  align-content: start;
}

.marketplace-hero h1 {
  max-width: 820px;
  margin: 0;
  color: #111827;
  font-size: 36px;
  line-height: 1.08;
}

.marketplace-hero p {
  max-width: 760px;
  margin: 0;
  color: #566070;
  line-height: 1.55;
}

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

.home-path-card {
  min-width: 0;
  min-height: 142px;
  padding: 16px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  color: #111827;
  background: #f8fafc;
  text-align: left;
}

.home-path-card--primary {
  border-color: #bfdbfe;
  background: #eff6ff;
}

.home-path-card > svg {
  width: 44px;
  height: 44px;
  padding: 10px;
  border-radius: 8px;
  color: #2563eb;
  background: #fff;
}

.home-path-card strong,
.home-path-card small {
  display: block;
}

.home-path-card strong {
  color: #111827;
  font-size: 17px;
  line-height: 1.25;
}

.home-path-card small {
  margin-top: 7px;
  color: #667085;
  line-height: 1.4;
}

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

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

.marketplace-stats article,
.marketplace-summary article {
  min-width: 0;
  padding: 14px;
  border: 1px solid #eef2f6;
  border-radius: 8px;
  background: #fbfcff;
}

.marketplace-stats span,
.marketplace-stats small,
.marketplace-summary span,
.marketplace-summary small {
  display: block;
  color: #667085;
  font-size: 12px;
  font-weight: 600;
}

.marketplace-stats strong,
.marketplace-summary strong {
  display: block;
  margin: 4px 0;
  color: #111827;
  font-size: 26px;
  line-height: 1;
}

.creator-flow,
.bonus-explainer {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.creator-flow article,
.bonus-explainer article {
  padding: 16px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, .035);
}

.creator-flow strong,
.bonus-explainer strong {
  display: block;
  color: #111827;
  font-size: 16px;
}

.creator-flow span,
.bonus-explainer p {
  display: block;
  margin: 8px 0 0;
  color: #667085;
  line-height: 1.45;
}

.app--light .home-kicker {
  color: #2563eb;
  background: #eff6ff;
}

.hero-panel {
  min-height: 0;
  padding: 30px;
  border: 1px solid rgba(148, 163, 184, .2);
  border-radius: 8px;
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .08), rgba(37, 99, 235, .14)),
    #121a2a;
}

.hero-glow {
  position: absolute;
  inset: -25% -10% auto auto;
  height: 360px;
  width: 520px;
  background: radial-gradient(circle, rgba(94, 92, 255, .55), transparent 62%);
  transform: rotate(-18deg);
}

.hero-panel h1, .hero-panel p, .hero-panel .prompt-bar, .home-kicker { position: relative; }

.home-kicker {
  display: inline-flex;
  width: fit-content;
  margin-bottom: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  color: #d8ccff;
  background: rgba(37, 99, 235, .12);
  font-size: 13px;
  font-weight: 600;
}

.hero-panel h1 {
  margin: 0;
  max-width: 620px;
  font-size: 32px;
  line-height: 1.12;
  letter-spacing: -0.02em;
  font-weight: 600;
}

.hero-panel p {
  max-width: 650px;
  margin: 12px 0 22px;
  color: #c5ccda;
  line-height: 1.55;
}

.prompt-bar {
  max-width: none;
  margin: 0;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, .2);
  background: rgba(8, 12, 20, .74);
  box-shadow: 0 18px 52px rgba(15, 23, 42, .22);
}

.prompt-bar textarea {
  width: 100%;
  min-height: 62px;
  resize: vertical;
  border: 0;
  outline: 0;
  padding: 18px 20px;
  color: #f8fafc;
  background: transparent;
}

.prompt-bar > div {
  min-height: 60px;
  padding: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-top: 1px solid rgba(148, 163, 184, .14);
}

.tool-button {
  min-height: 42px;
  padding: 0 14px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(43, 53, 76, .86);
  color: #e2e8f0;
}

.generate-button { margin-left: auto; padding: 0 24px; }

h2 {
  margin: 0 0 14px;
  font-size: 20px;
  letter-spacing: 0;
}

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

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

.type-grid--secondary {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.type-card, .template-card {
  min-width: 0;
  border: 1px solid rgba(148, 163, 184, .16);
  border-radius: 8px;
  padding: 0;
  overflow: hidden;
  text-align: left;
  background: rgba(20, 29, 46, .76);
  transition: transform .16s ease, border-color .16s ease;
}

.type-card--featured {
  background: rgba(20, 29, 46, .92);
}

.app--light .type-card,
.app--light .template-card {
  border-color: #e5e7eb;
  background: #fff;
}

.app--light .type-card strong {
  color: #111827;
}

.app--light .type-card small,
.app--light .template-card span {
  color: #667085;
}

.type-card:hover, .template-card:hover {
  transform: translateY(-2px);
  border-color: rgba(125, 90, 255, .72);
}

.type-card__image {
  height: 168px;
  margin-bottom: 0;
  border-radius: 0;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #1d2840, #2f1c57);
}

.type-grid--secondary .type-card__image {
  height: 118px;
}

.type-card__image img, .template-card img, .shot, .template-shot, .recent-shot {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.shot, .template-shot, .recent-shot {
  display: block;
  background-size: 1536px 1024px;
  background-position: calc(0px - var(--x)) calc(0px - var(--y));
  background-repeat: no-repeat;
}

.template-shot {
  height: 124px;
  border-radius: 7px;
  margin-bottom: 10px;
}

.type-card__image em {
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #a78bfa;
  border: 2px solid currentColor;
}

.type-card__body {
  display: grid;
  gap: 5px;
  padding: 13px 14px 14px;
}

.type-card strong, .type-card small, .template-card strong, .template-card span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

.type-card strong {
  color: #f8fafc;
  font-size: 17px;
  line-height: 1.2;
  white-space: normal;
}

.type-card small, .template-card span {
  color: #a7b1c4;
  font-size: 13px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

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

.text-action {
  color: #a78bfa;
  background: transparent;
  font-weight: 600;
}

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

.template-card img { height: 124px; border-radius: 7px; margin-bottom: 10px; }

.recent-panel {
  grid-column: 2;
  grid-row: 2;
  margin: 28px 22px 28px 0;
  padding: 18px;
  border: 1px solid rgba(148, 163, 184, .14);
  border-radius: 8px;
  align-self: start;
  background: rgba(15, 23, 42, .78);
}

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

.panel-head button {
  color: #b9a8ff;
  background: transparent;
}

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

.recent-item {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  text-align: left;
}

.recent-item img, .recent-shot {
  width: 76px;
  height: 76px;
  border-radius: 7px;
  object-fit: contain;
  background: rgba(255, 255, 255, .06);
}

.recent-item strong, .recent-item small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-item small {
  margin-top: 8px;
  color: #9aa5b8;
}

.recent-empty {
  padding: 14px;
  border: 1px dashed rgba(148, 163, 184, .28);
  border-radius: 8px;
  color: #9aa5b8;
  font-size: 13px;
}

.workspace-page {
  padding: 22px 28px 34px;
  display: grid;
  grid-template-columns: 306px minmax(520px, 1fr) 230px;
  gap: 18px;
  background: #f8fafc;
}

.chat-workspace {
  padding: 22px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 18px;
  background: #f8fafc;
  min-height: calc(100vh - 64px);
  align-items: stretch;
  position: relative;
}

.chat-types, .chat-panel, .chat-side .side-card {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 14px 42px rgba(15, 23, 42, .045);
}

.chat-types {
  padding: 14px;
  align-self: start;
}

.chat-types h2 {
  color: #0f172a;
  font-size: 17px;
  margin: 0 0 12px;
}

.chat-types > div {
  display: grid;
  gap: 8px;
}

.chat-types button {
  min-width: 0;
  min-height: 70px;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 8px;
  border: 1px solid #e5e7eb;
  border-radius: 7px;
  color: #111827;
  background: #fff;
  text-align: left;
}

.chat-types button.active {
  border-color: #2563eb;
  box-shadow: inset 0 0 0 1px #2563eb;
}

.chat-types img, .chat-types em {
  width: 58px;
  height: 52px;
  border-radius: 6px;
  object-fit: cover;
  background: #eff6ff;
}

.chat-types em {
  display: grid;
  place-items: center;
  color: #2563eb;
}

.chat-types strong, .chat-types small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-types small {
  margin-top: 4px;
  color: #667085;
  font-size: 12px;
}

.chat-panel {
  min-height: calc(100vh - 108px);
  display: grid;
  grid-template-rows: auto minmax(320px, 1fr);
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
}

.chat-head {
  grid-row: 1;
  min-height: 68px;
  padding: 15px 18px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid #e5e7eb;
}

.chat-head h1 {
  margin: 6px 0 0;
  font-size: 21px;
  color: #0f172a;
}

.chat-head p {
  margin: 5px 0 0;
  color: #667085;
  font-size: 14px;
  line-height: 1.4;
}

.context-pill {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  border-radius: 999px;
  color: #2563eb;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  font-size: 13px;
  font-weight: 600;
}

.context-pill svg {
  width: 15px;
  height: 15px;
}

.chat-messages {
  grid-row: 2;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #fbfcff;
}

.chat-messages--empty {
  align-items: stretch;
  justify-content: flex-start;
  padding-top: 16px;
  padding-bottom: 16px;
  background: #fbfcff;
}

.chat-message {
  max-width: min(760px, 100%);
  display: grid;
  gap: 5px;
}

.chat-message span {
  color: #667085;
  font-size: 12px;
  font-weight: 600;
}

.chat-message p {
  margin: 0;
  padding: 13px 15px;
  border-radius: 8px;
  color: #111827;
  background: #fff;
  border: 1px solid #e5e7eb;
  line-height: 1.45;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  box-shadow: 0 10px 26px rgba(15, 23, 42, .035);
}

.chat-message--user {
  align-self: flex-end;
  justify-items: end;
}

.chat-message--user p {
  color: #172033;
  background: #eff6ff;
  border-color: #bfdbfe;
}

.chat-reference-strip {
  max-width: min(420px, 100%);
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.chat-reference-strip button {
  width: 116px;
  min-width: 0;
  padding: 6px;
  display: grid;
  gap: 5px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  color: #175cd3;
  background: #fff;
  text-align: left;
}

.chat-reference-strip img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  object-position: center center;
  border-radius: 6px;
  background: #f8fafc;
}

.chat-reference-strip span {
  min-width: 0;
  overflow: hidden;
  color: #475467;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 500;
}

.chat-copy-prompt {
  min-height: 28px;
  padding: 0 8px;
  border: 1px solid #bfdbfe;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #175cd3;
  background: #fff;
  font-size: 12px;
  font-weight: 500;
}

.chat-copy-prompt svg {
  width: 14px;
  height: 14px;
}

.chat-copy-prompt.is-copied {
  color: #047857;
  border-color: #bbf7d0;
  background: #ecfdf3;
}

.chat-message--assistant {
  align-self: flex-start;
}

.project-reference-gallery {
  max-width: min(780px, 100%);
  padding: 14px;
  display: grid;
  gap: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 26px rgba(15, 23, 42, .035);
}

.project-reference-gallery__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.project-reference-gallery__head strong {
  color: #111827;
  font-size: 15px;
}

.project-reference-gallery__head span {
  color: #667085;
  font-size: 12px;
  font-weight: 600;
}

.project-reference-section {
  display: grid;
  gap: 10px;
}

.project-reference-section > div:first-child {
  display: grid;
  gap: 3px;
}

.project-reference-section > div:first-child strong,
.project-reference-empty strong {
  color: #1d2939;
  font-size: 13px;
}

.project-reference-section > div:first-child small,
.project-reference-empty span {
  color: #667085;
  font-size: 12px;
  line-height: 1.35;
}

.project-reference-section--primary {
  padding: 10px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #f8fbff;
}

.project-reference-empty {
  padding: 12px;
  display: grid;
  gap: 5px;
  border: 1px dashed #d0d5dd;
  border-radius: 8px;
  background: #fcfcfd;
}

.project-reference-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}

.project-reference-grid--primary {
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}

.project-reference-grid--references {
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
}

.project-reference-grid button {
  min-width: 0;
  padding: 8px;
  display: grid;
  gap: 7px;
  border: 1px solid #eef2f6;
  border-radius: 8px;
  background: #fbfcff;
  color: #111827;
  text-align: left;
}

.project-reference-grid--primary button {
  border-color: #bfdbfe;
  background: #fff;
}

.project-reference-grid--references button {
  background: #f8fafc;
}

.project-reference-grid img {
  width: 100%;
  height: 150px;
  object-fit: contain;
  border-radius: 7px;
  background: #f8fafc;
}

.project-reference-grid--primary img {
  height: 180px;
}

.project-reference-grid--references img {
  height: 108px;
}

.project-reference-grid span,
.project-reference-grid strong,
.project-reference-grid small {
  min-width: 0;
  display: block;
}

.project-reference-grid strong {
  color: #344054;
  font-size: 12px;
}

.project-reference-grid small {
  color: #667085;
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.template-project-guide {
  max-width: min(780px, 100%);
  padding: 14px;
  display: grid;
  gap: 12px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 26px rgba(15, 23, 42, .035);
}

.chat-messages--empty .template-project-guide {
  width: min(920px, 100%);
  max-width: 100%;
  margin: 0 auto;
  padding: 12px 14px;
  border-color: #e4ddff;
  border-radius: 12px;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 14px 36px rgba(15, 23, 42, .055);
}

.template-project-guide > div {
  display: grid;
  gap: 7px;
}

.chat-messages--empty .template-project-guide > div {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px 12px;
}

.template-project-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.template-open-link {
  min-height: 32px;
  padding: 6px 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #bfdbfe;
  border-radius: 7px;
  color: #2563eb;
  background: #eff6ff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.template-open-link svg {
  width: 14px;
  height: 14px;
}

.template-project-guide span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #2563eb;
  font-size: 12px;
  font-weight: 600;
}

.chat-messages--empty .template-project-guide span {
  grid-column: 1 / -1;
}

.template-project-guide strong {
  color: #111827;
  font-size: 16px;
}

.template-project-guide p {
  margin: 0;
  color: #475467;
  font-size: 13px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.chat-messages--empty .template-project-guide p {
  display: none;
}

.template-project-guide em {
  width: fit-content;
  padding: 5px 9px;
  border-radius: 999px;
  color: #166534;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  font-size: 12px;
  font-style: normal;
  font-weight: 600;
}

.chat-messages--empty .template-project-guide em {
  justify-self: end;
  white-space: nowrap;
}

.template-project-guide ol {
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
  list-style: none;
}

.template-project-guide li {
  padding: 10px;
  display: grid;
  gap: 5px;
  border-radius: 7px;
  background: #f8fafc;
  border: 1px solid #eef2f6;
}

.template-project-guide li span {
  display: block;
  color: #667085;
  font-weight: 500;
  line-height: 1.4;
}

.chat-composer {
  width: 100%;
  margin: auto 0 0;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
  z-index: 2;
}

.chat-composer--empty {
  width: 100%;
  margin: 0;
  padding: 16px 18px 18px;
  border-radius: 12px;
  border-color: #e5e7eb;
}

.composer-upload-callout {
  min-height: 78px;
  margin-bottom: 0;
  padding: 12px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px 12px;
  align-items: center;
  border: 1px dashed #b8a6ff;
  border-radius: 10px;
  color: #344054;
  background: linear-gradient(180deg, #fdfbff 0%, #f9f7ff 100%);
  cursor: pointer;
}

.composer-upload-callout > span {
  grid-row: 1 / span 2;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #2563eb;
  background: #eff6ff;
}

.composer-upload-callout strong,
.composer-upload-callout small {
  min-width: 0;
  display: block;
}

.composer-upload-callout strong {
  color: #111827;
  font-size: 15px;
}

.composer-upload-callout small {
  color: #667085;
  font-size: 13px;
  line-height: 1.35;
}

.composer-settings-bar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.composer-lead {
  margin: 0;
  padding: 0;
  color: #111827;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.composer-settings-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px 12px;
  min-width: 0;
}

.chat-composer textarea {
  width: 100%;
  min-height: 54px;
  padding: 10px 6px;
  border: 0;
  border-radius: 0;
  color: #111827;
  background: #fff;
  line-height: 1.35;
  overflow: hidden;
  resize: none;
  outline: none;
}

.chat-composer--empty textarea {
  min-height: 88px;
  padding: 12px 8px;
  font-size: 15px;
  line-height: 1.5;
  overflow: auto;
}

.chat-composer--empty .generation-start-form {
  border-color: #d0d5dd;
  background: #fff;
  box-shadow: none;
}

.chat-composer--empty .generation-start-form textarea {
  min-height: 190px;
  padding: 18px 20px;
}

.chat-composer--empty .generation-start-form .generate-button {
  margin-left: auto;
}

.composer-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px;
  flex: 1 1 240px;
  min-width: 0;
}

.chat-composer--empty .composer-controls {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.composer-controls label {
  flex: 0 1 132px;
  min-width: 148px;
  max-width: 168px;
  display: grid;
  gap: 4px;
  color: #667085;
  font-size: 11px;
  font-weight: 600;
}

.composer-controls select {
  width: 100%;
  height: 32px;
  padding: 0 28px 0 9px;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  color: #111827;
  background: #fff;
  font-size: 12px;
  font-weight: 600;
  outline: none;
}

.composer-controls select:disabled {
  color: #667085;
  background: #f8fafc;
}

.improve-button,
.rewrite-button {
  max-width: 100%;
  flex-shrink: 0;
  white-space: nowrap;
  min-height: 38px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  background: #fff !important;
  color: #475467 !important;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.improve-button:hover,
.rewrite-button:hover {
  border-color: #c4b5fd;
  background: #faf5ff !important;
  color: #1d4ed8 !important;
}

.composer-prompt-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-shrink: 0;
}

.composer-prompt-tools svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.composer-attachments {
  margin: 0 0 14px;
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.composer-attachment {
  min-width: 240px;
  max-width: 360px;
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr) 32px;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fff;
}

.composer-attachment.is-edit {
  border-color: #8b5cf6;
  background: #f5f0ff;
}

.composer-attachment img {
  width: 112px;
  height: 84px;
  object-fit: contain;
  border-radius: 8px;
  background: #f8fafc;
}

.composer-attachment strong,
.composer-attachment small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.composer-attachment strong {
  color: #344054;
  font-size: 13px;
}

.composer-attachment small {
  margin-top: 3px;
  color: #667085;
  font-size: 12px;
}

.attachment-remove {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #667085;
  background: #f2f4f7;
  font-weight: 600;
}

.composer-line {
  min-height: 50px;
  display: grid !important;
  grid-template-columns: 34px minmax(0, 1fr) 42px;
  align-items: stretch;
  gap: 8px;
  padding: 6px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fff;
}

.composer-add-photo {
  width: 34px;
  min-width: 34px;
  height: 34px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: 8px;
  cursor: pointer;
  color: #475467;
  background: transparent;
  border: 0;
  align-self: center;
}

.composer-add-photo svg {
  width: 19px;
  height: 19px;
}

.composer-add-photo input {
  display: none;
}

.chat-composer--empty .composer-line {
  min-height: 112px;
  grid-template-columns: 34px minmax(0, 1fr) 44px;
  gap: 8px;
  padding: 8px;
  border-radius: 10px;
  border-color: #e5e7eb;
  background: #fff;
}

.chat-composer--empty .composer-add-photo {
  width: 34px;
  min-width: 34px;
  height: 34px;
  padding: 0;
}

.chat-composer--empty .composer-add-photo svg {
  width: 22px;
  height: 22px;
}

.chat-composer .composer-line textarea {
  min-height: 48px;
  align-self: stretch;
  padding: 10px 4px;
  background: transparent;
}

.icon-button,
.send-button {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  cursor: pointer;
  align-self: center;
}

.icon-button {
  color: #475467;
  background: #fff;
  border: 1px solid #e5e7eb;
  flex-shrink: 0;
}

.send-button {
  color: #fff;
  background: #2563eb;
  border: none;
}

.chat-composer--empty .icon-button {
  width: 44px;
  height: 44px;
  align-self: center;
}

.chat-composer--empty .send-button {
  width: 44px;
  height: 44px;
  align-self: center;
}

.send-button svg {
  width: 17px;
  height: 17px;
}

.chat-composer .generate-button {
  margin-left: auto;
  padding: 0 18px;
}

.chat-context {
  grid-row: 2;
  padding: 10px 18px;
  display: flex;
  gap: 10px;
  overflow-x: auto;
  border-bottom: 1px solid #e5e7eb;
  background: #fff;
}

.chat-context__item {
  min-width: 190px;
  max-width: 240px;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  padding: 7px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  color: #111827;
  text-align: left;
}

.chat-context__item.is-edit {
  border-color: #8b5cf6;
  background: #f5f0ff;
}

.chat-context__item img {
  width: 54px;
  height: 44px;
  object-fit: contain;
  border-radius: 6px;
  background: #f8fafc;
}

.chat-context__item strong,
.chat-context__item small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-context__item small {
  margin-top: 3px;
  color: #667085;
  font-size: 12px;
}

.chat-result-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  text-align: left;
}

.chat-result-card__figure {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #e5e7eb;
  background: #eef2f6;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.chat-result-card__figure:hover,
.chat-result-card__figure:focus-within {
  border-color: #a78bfa;
  box-shadow: 0 6px 20px rgba(109, 66, 232, 0.12);
}

.chat-result-card__thumb {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 6px;
  border: none;
  background: transparent;
  cursor: pointer;
  line-height: 0;
  box-sizing: border-box;
}

.chat-result-card__thumb:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

.chat-result-card__thumb img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
  border-radius: 0;
  background: transparent;
  display: block;
}

.chat-result-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  width: 100%;
  max-width: min(720px, 100%);
  align-items: start;
}

.chat-result-grid--single {
  grid-template-columns: minmax(0, 520px);
  max-width: min(520px, 100%);
}

.chat-message--result {
  max-width: min(720px, 100%);
}

.chat-side {
  display: grid;
  gap: 14px;
  align-content: start;
  padding-right: 2px;
}

.chat-side .side-card {
  padding: 14px;
}

.side-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.side-card-head h2 {
  margin: 0;
}

.template-picker-card p,
.selected-template-card p {
  margin: 0 0 12px;
  color: #667085;
  font-size: 13px;
  line-height: 1.45;
}

.template-picker-card--compact p {
  margin-bottom: 10px;
}

.template-picker-actions {
  display: grid;
  gap: 8px;
}

.template-picker-actions .secondary-action {
  width: 100%;
  justify-content: center;
}

.template-picker-list {
  display: grid;
  gap: 8px;
}

.template-picker-list button {
  min-width: 0;
  padding: 8px;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  color: #111827;
  background: #fff;
  text-align: left;
}

.template-picker-list button:hover {
  border-color: #8b5cf6;
  background: #fbfaff;
}

.template-picker-list img {
  width: 58px;
  height: 48px;
  object-fit: cover;
  border-radius: 7px;
  background: #eef2f6;
}

.template-picker-list strong,
.template-picker-list small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.template-picker-list strong {
  color: #111827;
  font-size: 13px;
}

.template-picker-list small {
  margin-top: 3px;
  color: #667085;
  font-size: 12px;
}

.selected-template-card {
  display: grid;
  gap: 10px;
}

.selected-template-card > img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 8px;
  background: #eef2f6;
}

.selected-template-card > strong {
  color: #111827;
  font-size: 16px;
}

.selected-template-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.selected-template-facts span {
  min-height: 26px;
  padding: 4px 8px;
  display: inline-flex;
  align-items: center;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  color: #1d4ed8;
  background: #eff6ff;
  font-size: 12px;
  font-weight: 600;
}

.selected-template-card ol {
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
  list-style: none;
}

.selected-template-card li {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  color: #475467;
  font-size: 13px;
}

.selected-template-card li b {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #2563eb;
  background: #eff6ff;
  font-size: 12px;
}

.selected-template-card li span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-reference-note {
  min-width: 0;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) 28px;
  gap: 10px;
  align-items: start;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  color: #1d4ed8;
  background: #eff6ff;
}

.home-reference-note__thumb {
  width: 54px;
  height: 54px;
  overflow: hidden;
  display: block;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #fff;
}

.home-reference-note__thumb img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.home-reference-note strong,
.home-reference-note small,
.home-reference-note em {
  min-width: 0;
  display: block;
  overflow-wrap: anywhere;
}

.home-reference-note strong {
  color: #111827;
  font-weight: 500;
}

.home-reference-note small {
  margin-top: 2px;
  color: #475467;
}

.home-reference-note em {
  margin-top: 4px;
  color: #1d4ed8;
  font-size: 12px;
  font-style: normal;
}

.home-reference-note__remove {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #fff;
  color: #1d4ed8;
  cursor: pointer;
  font: inherit;
  line-height: 1;
}

.home-reference-note__remove:hover {
  border-color: #2563eb;
  color: #1e40af;
}

.detail-toggle {
  min-height: 38px;
  margin: 12px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #344054;
  font-weight: 700;
}

.detail-toggle input {
  width: 42px;
  height: 24px;
  appearance: none;
  border-radius: 999px;
  background: #2563eb;
  position: relative;
}

.detail-toggle input::after {
  content: "";
  position: absolute;
  right: 3px;
  top: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
}

.mode-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 3px;
  border-radius: 8px;
  background: #f2f4f7;
}

.mode-switch button {
  min-height: 36px;
  border-radius: 7px;
  color: #667085;
  background: transparent;
}

.mode-switch button.active {
  color: #344054;
  background: #fff;
  box-shadow: 0 1px 4px rgba(15, 23, 42, .08);
}

.chat-side .generated-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-items: stretch;
}

/* Одинаковые квадратные плитки: картинка целиком (contain), поля по краям */
.chat-side .generated-grid button {
  aspect-ratio: 1 / 1;
  width: 100%;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  border-width: 2px;
  background: #eef2f6;
  border-radius: 8px;
  overflow: hidden;
}

.chat-side .generated-grid button img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
}

.chat-side .empty-results,
.chat-side .progress-view {
  min-height: 190px;
}

.chat-side .selected-card {
  margin-top: 10px;
  padding: 0;
  border: 0;
  box-shadow: none;
  grid-template-columns: 1fr;
}

.chat-side .selected-file {
  grid-template-columns: 64px minmax(0, 1fr) repeat(2, 34px);
  gap: 7px;
}

.chat-side .selected-file img {
  width: 64px;
  height: 54px;
}

.chat-side .selected-file a,
.chat-side .selected-file button {
  height: 34px;
}

.chat-side .open-editor {
  min-height: 40px;
}

.setup-panel { display: grid; gap: 12px; align-content: start; }

.setup-card, .side-card, .selected-card, .ideas-card {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 14px 42px rgba(15, 23, 42, .045);
}

.setup-card { padding: 14px; }
.setup-card h2, .side-card h2, .selected-card h2, .prompt-ideas h2 { color: #0f172a; font-size: 17px; margin: 0 0 8px; }
.setup-card p, .side-card p, .selected-card p { margin: 0 0 12px; color: #667085; font-size: 13px; }

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

.mini-type-grid button {
  min-height: 76px;
  padding: 6px;
  border: 1px solid #e5e7eb;
  border-radius: 7px;
  color: #111827;
  background: #fff;
}

.mini-type-grid button.active {
  border-color: #2563eb;
  box-shadow: inset 0 0 0 1px #2563eb;
}

.mini-type-grid img, .mini-type-grid em, .mini-type-grid .shot {
  width: 100%;
  height: 38px;
  border-radius: 5px;
  margin-bottom: 5px;
}

.mini-type-grid em {
  display: grid;
  place-items: center;
  color: #2563eb;
  background: #eff6ff;
}

.mini-type-grid span {
  display: block;
  color: #111827;
  font-size: 11px;
  line-height: 1.2;
}

.field-label {
  display: grid;
  gap: 8px;
  color: #344054;
  font-size: 13px;
  font-weight: 600;
}

.field-label textarea, .field-label select {
  width: 100%;
  border: 1px solid #d0d5dd;
  border-radius: 7px;
  color: #111827;
  background: #fff;
  font-weight: 500;
  outline: none;
}

.field-label textarea {
  max-width: 100%;
  min-height: 112px;
  padding: 11px;
  resize: vertical;
  line-height: 1.45;
}

.field-label select {
  height: 40px;
  padding: 0 10px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0;
}

.chips button {
  min-height: 30px;
  padding: 0 9px;
  border-radius: 6px;
  color: #344054;
  background: #f3f4f8;
}

.upload-line {
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #2563eb;
  font-weight: 500;
  cursor: pointer;
}

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

.source-strip button {
  min-width: 0;
  border-radius: 7px;
  overflow: hidden;
  background: #f2f4f7;
  color: #344054;
}

.source-strip img { width: 100%; height: 44px; object-fit: contain; background: #f8fafc; }
.source-strip span { display: block; padding: 4px; font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.segmented {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(64px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.segmented button {
  min-height: 36px;
  border: 1px solid #e5e7eb;
  border-radius: 7px;
  color: #344054;
  background: #fff;
}

.segmented button.active {
  color: #fff;
  background: #2563eb;
  border-color: #2563eb;
}

.big-generate {
  width: 100%;
  margin-top: 10px;
  min-height: 58px;
  font-size: 17px;
}

.results-panel {
  min-width: 0;
  display: grid;
  gap: 18px;
  align-content: start;
}

.results-head {
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.results-head h1 { margin: 0; font-size: 20px; letter-spacing: 0; }
.results-head p { margin: 8px 0 0; color: #667085; }

.secondary-action {
  height: 42px;
  padding: 0 14px;
  border: 1px solid #bfdbfe;
  border-radius: 7px;
  color: #2563eb;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  white-space: nowrap;
}

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

.result-grid-card {
  position: relative;
  min-width: 0;
}

.result-grid-card__image {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 3px solid transparent;
  border-radius: 8px;
  background: #111827;
}

.result-grid-card.active .result-grid-card__image { border-color: #2563eb; }
.generated-grid img { width: 100%; height: 100%; object-fit: cover; }

.empty-results, .progress-view {
  min-height: 430px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  padding: 24px;
  border: 1px dashed #cfd4dc;
  border-radius: 8px;
  background: #fff;
  color: #667085;
  text-align: center;
  cursor: pointer;
}

.empty-results strong,
.progress-view strong,
.empty-results span,
.progress-view span {
  max-width: min(100%, 420px);
  justify-self: center;
  text-align: center;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.empty-results strong, .progress-view strong {
  color: #111827;
  line-height: 1.25;
}

.empty-results span, .progress-view span {
  line-height: 1.45;
}

.spinner {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  color: #2563eb;
  animation: spin 1s linear infinite;
}

.selected-card {
  padding: 18px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 14px;
  align-items: end;
}

.selected-file {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) repeat(4, 42px);
  gap: 10px;
  align-items: center;
}

.selected-file img {
  width: 92px;
  height: 72px;
  object-fit: cover;
  border-radius: 7px;
}

.selected-file strong, .selected-file small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.selected-file small { margin-top: 7px; color: #667085; }

.selected-file a, .selected-file button {
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid #e5e7eb;
  border-radius: 7px;
  color: #344054;
  background: #fff;
  text-decoration: none;
}

.open-editor { min-height: 44px; }

.prompt-ideas {
  display: grid;
  gap: 10px;
}

.prompt-ideas > div {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.prompt-ideas button {
  min-height: 64px;
  padding: 10px 14px;
  border: 1px solid #e5e7eb;
  border-radius: 7px;
  color: #344054;
  background: #fff;
  text-align: left;
  line-height: 1.35;
}

.tools-panel {
  display: grid;
  gap: 18px;
  align-content: start;
}

.side-card {
  padding: 16px;
}

.action-row {
  width: 100%;
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  margin-bottom: 8px;
  border: 1px solid #e5e7eb;
  border-radius: 7px;
  color: #344054;
  background: #fff;
  text-align: left;
}

.ideas-card {
  padding: 18px;
  display: grid;
  gap: 10px;
  background: #f5f0ff;
  border-color: #bfdbfe;
}

.ideas-card span {
  color: #5f5a78;
  font-size: 13px;
  line-height: 1.4;
}

.ideas-card button {
  min-height: 38px;
  border-radius: 7px;
  color: #2563eb;
  background: #fff;
  border: 1px solid #bfdbfe;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(17, 24, 39, .46);
  backdrop-filter: blur(4px);
}

.modal--confirm {
  z-index: 90;
  background: rgba(17, 24, 39, .58);
}

.modal section {
  width: min(420px, 100%);
  padding: 22px;
  border-radius: 8px;
  background: #fff;
  color: #111827;
  position: relative;
}

.modal section > div {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.modal button {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 7px;
  background: #f2f4f7;
  color: #111827;
}

.modal button.danger, .danger {
  background: #dc2626;
  color: #fff;
}

.modal--image section { width: min(780px, 100%); }
.modal--image img { width: 100%; max-height: 72vh; object-fit: contain; border-radius: 7px; background: #0f172a; }
.modal-close { position: absolute; right: 12px; top: 12px; }

.modal--editor-debug section {
  width: min(1040px, 100%);
  max-height: 90vh;
  overflow: auto;
}

.modal--editor-debug p {
  margin: 6px 0 16px;
  color: #667085;
  line-height: 1.45;
}

.editor-debug-grid {
  display: grid !important;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, .9fr);
  gap: 14px !important;
  justify-content: stretch !important;
  margin-bottom: 14px;
}

.editor-debug-grid figure,
.editor-debug-grid article {
  margin: 0;
  padding: 12px;
  display: grid;
  gap: 10px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #f8fafc;
}

.editor-debug-grid figcaption,
.editor-debug-grid article strong,
.editor-debug-prompt span {
  color: #344054;
  font-size: 13px;
  font-weight: 600;
}

.editor-debug-grid img {
  width: 100%;
  max-height: 50vh;
  object-fit: contain;
  border-radius: 7px;
  background: #0f172a;
}

.editor-debug-grid ul {
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
  list-style: none;
}

.editor-debug-grid li {
  display: grid;
  gap: 3px;
  color: #475467;
  font-size: 13px;
}

.editor-debug-prompt {
  display: grid;
  gap: 8px;
}

.editor-debug-prompt textarea {
  width: 100%;
  min-height: 220px;
  padding: 12px;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  resize: vertical;
  color: #111827;
  background: #fff;
  line-height: 1.45;
}

.modal-nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 58px;
  height: 58px;
  min-height: 58px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .18);
  background: rgba(17, 24, 39, .82);
  color: #fff;
  font-size: 42px;
  font-weight: 400;
  line-height: 1;
  box-shadow: 0 16px 34px rgba(15, 23, 42, .24);
  transform: translateY(-50%);
}

.modal-nav:hover {
  background: rgba(17, 24, 39, .94);
}

.modal-nav:disabled {
  display: none;
}

.modal-nav--prev {
  left: 26px;
}

.modal-nav--next {
  right: 286px;
}

.modal--result section {
  width: min(1440px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  padding: 8px;
  overflow: hidden;
}

.modal--result .result-preview {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 8px;
  align-items: stretch;
  justify-content: stretch;
}

.modal--result .result-preview figure {
  min-width: 0;
  height: min(calc(100dvh - 40px), 900px);
  margin: 0;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #f3f4f6;
  overflow: hidden;
}

.modal--result .result-preview img {
  max-width: 100%;
  max-height: min(calc(100dvh - 56px), 884px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 6px;
  background: #f3f4f6;
}

.modal--feed-preview {
  cursor: zoom-out;
}

.modal--feed-preview section {
  width: min(1220px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  padding: 10px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 400px);
  gap: 10px;
  overflow: auto;
  cursor: default;
}

.modal--feed-preview figure {
  position: relative;
  min-width: 0;
  height: min(calc(100vh - 56px), 820px);
  margin: 0;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #f3f4f6;
  overflow: hidden;
}

.feed-preview-nav {
  position: absolute;
  top: 50%;
  z-index: 3;
  width: 44px;
  height: 44px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 1px solid rgba(15, 23, 42, .12);
  border-radius: 999px;
  color: #111827;
  background: rgba(255, 255, 255, .88);
  transform: translateY(-50%);
}

.feed-preview-nav:hover {
  background: #fff;
}

.feed-preview-nav--prev {
  left: 12px;
}

.feed-preview-nav--next {
  right: 12px;
}

.feed-preview-nav svg {
  width: 22px;
  height: 22px;
}

.modal--feed-preview img {
  max-width: 100%;
  max-height: min(calc(100vh - 72px), 800px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 6px;
}

.modal--feed-preview aside {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 10px;
  border-left: 1px solid #e5e7eb;
}

.modal--feed-preview aside h2,
.modal--feed-preview aside p {
  margin: 0;
}

.modal--feed-preview .feed-preview-public-caption {
  margin: 0;
  padding: 8px 10px;
  border-radius: 8px;
  background: #f1f5f9;
  color: #334155;
  font-size: 13px;
  line-height: 1.45;
}

.feed-preview-author {
  color: #2563eb;
  font-weight: 500;
  text-decoration: none;
}

.feed-preview-author:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.modal--feed-preview .post-share-actions {
  padding: 0;
  border-top: 0;
  background: transparent;
}

.feed-preview-comments {
  display: grid;
  gap: 10px;
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px solid #e5e7eb;
}

.feed-preview-comments-title {
  margin: 0;
  font-size: 13px;
  font-weight: 750;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 8px;
}

.feed-preview-comments-count {
  font-weight: 600;
  color: #64748b;
  font-variant-numeric: tabular-nums;
}

.feed-preview-comments-body {
  max-height: 220px;
  overflow: auto;
  padding-right: 4px;
}

.feed-preview-comments-status {
  margin: 0;
  font-size: 13px;
  color: #475569;
}

.feed-preview-comments-status--muted {
  color: #94a3b8;
}

.feed-preview-comments-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.feed-preview-thread-item {
  padding: 8px 10px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.feed-preview-thread-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 4px;
  font-size: 12px;
}

.feed-preview-thread-head strong {
  font-size: 13px;
  color: #0f172a;
}

.feed-preview-thread-head span {
  color: #94a3b8;
  white-space: nowrap;
}

.feed-preview-thread-body {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: #334155;
  white-space: pre-wrap;
}

.feed-preview-comment-form textarea {
  min-height: 72px;
  resize: vertical;
}

@media (max-width: 900px) {
  .modal--feed-preview section {
    grid-template-columns: 1fr;
    max-height: none;
  }

  .modal--feed-preview aside {
    border-left: 0;
    border-top: 1px solid #e5e7eb;
    max-height: none;
  }

  .modal--feed-preview figure {
    height: auto;
    min-height: 200px;
  }

  .feed-preview-nav {
    width: 40px;
    height: 40px;
  }
}

.result-preview aside {
  display: grid;
  align-content: stretch;
  gap: 10px;
  padding: 10px;
  border-left: 1px solid #e5e7eb;
}

.result-preview aside > span {
  color: #667085;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.result-preview aside > small {
  color: #667085;
  font-size: 12px;
  font-weight: 700;
}

.result-preview h2,
.result-preview p {
  margin: 0;
}

.result-preview h2 {
  font-size: 16px;
  line-height: 1.3;
}

.result-preview p {
  color: #667085;
}

.result-preview-description {
  font-size: 13px;
  line-height: 1.45;
}

.result-preview-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
}

.result-preview-actions a,
.result-preview-actions button {
  min-height: 34px;
  padding: 0 9px;
  border: 0;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: #344054;
  background: #f2f4f7;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}

.result-preview-actions [data-publish-result] {
  color: #175cd3;
  background: #eff8ff;
}

.result-preview-actions .is-published {
  color: #047857;
  background: #ecfdf3;
}

.result-preview-actions .is-liked {
  color: #be123c;
  background: #fff1f2;
}

.result-preview-actions .is-liked svg,
.secondary-action.is-liked svg,
.feed-card__image-action.is-liked svg {
  fill: currentColor;
}

.result-preview-actions .result-share-button {
  color: #175cd3;
  background: #eff8ff;
}

.result-preview-actions .result-share-button.is-copied {
  color: #047857;
  background: #ecfdf3;
}

.result-preview-actions .result-download-link {
  color: #344054 !important;
  background: #f2f4f7;
}

.result-public-links {
  min-width: 0;
  padding: 8px 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #f8fafc;
}

.result-public-links span {
  padding-left: 10px;
  color: #175cd3;
  font-size: 12px;
  font-weight: 500;
}

.result-public-links a {
  min-height: 32px;
  padding: 0 9px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #1d4ed8;
  background: transparent;
  font-size: 13px;
  text-decoration: none;
}

.result-public-links a:hover {
  background: #eff6ff;
}

.post-share-menu {
  position: relative;
}

.post-share-menu summary {
  min-height: 40px;
  padding: 0 12px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #175cd3;
  background: #eff8ff;
  cursor: pointer;
  list-style: none;
}

.post-share-menu summary::-webkit-details-marker {
  display: none;
}

.post-share-menu div {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 8;
  width: min(260px, calc(100vw - 48px));
  min-width: 210px;
  padding: 8px;
  display: grid;
  gap: 4px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
}

.post-share-menu div button,
.post-share-menu div a {
  min-height: 34px;
  padding: 8px 9px;
  border: 0;
  border-radius: 7px;
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-start;
  color: #111827 !important;
  background: #fff;
  text-decoration: none;
}

.post-share-menu div button {
  width: 100%;
  font: inherit;
  cursor: pointer;
}

.post-share-menu div button:hover,
.post-share-menu div a:hover {
  background: #f2f4f7;
}

.share-copy-note {
  padding: 6px 8px;
  border-radius: 7px;
  color: #047857;
  background: #ecfdf3;
  font-size: 12px;
  font-weight: 650;
  text-align: center;
}

.result-preview-actions .danger {
  color: #b42318;
  background: #fef3f2;
}

.result-preview-danger {
  align-self: end;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid #e5e7eb;
}

.result-preview-danger .danger {
  width: 100%;
  min-height: 38px;
  border-radius: 7px;
  color: #b42318;
  background: transparent;
  border: 1px solid #fee4e2;
}

@media (max-width: 900px) {
  .modal--result {
    padding: 8px;
    place-items: stretch;
  }

  .modal--result section {
    width: 100%;
    max-height: calc(100dvh - 16px);
    overflow: auto;
    padding: 8px;
  }

  .modal--result .result-preview {
    grid-template-columns: 1fr;
  }

  .modal--result .result-preview figure {
    height: min(72dvh, 620px);
    min-height: 320px;
  }

  .modal--result .result-preview img {
    max-height: calc(72dvh - 16px);
  }

  .result-preview aside {
    border-left: 0;
    border-top: 1px solid #e5e7eb;
    padding: 8px 0 0;
  }

  .result-preview aside > span,
  .result-preview aside > small {
    display: none;
  }

  .result-preview-actions {
    display: flex;
    flex-wrap: wrap;
  }

  .post-share-menu div {
    position: static;
    margin-top: 6px;
  }

  .result-preview-actions a,
  .result-preview-actions button {
    min-width: 0;
    padding: 0 8px;
    font-size: 13px;
  }

  .modal-nav {
    top: min(36dvh, 320px);
    width: 44px;
    height: 44px;
    min-height: 44px;
    font-size: 32px;
  }

  .modal-nav--prev {
    left: 16px;
  }

  .modal-nav--next {
    right: 16px;
  }
}

.fatal, .empty-state {
  min-height: 100vh;
  display: grid;
  place-items: center;
  color: #111827;
  background: #fff;
}

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

.section-head h2 {
  margin: 0;
}

.template-builder-page {
  padding: 24px;
  display: grid;
  gap: 18px;
  background: #f8fafc;
}

/* Страница шаблонов не растягивается на всю высоту окна — убирает «пустоту» под контентом */
.app--light .main-shell > main.templates-page {
  align-self: start;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.templates-page {
  padding: 12px 18px 20px;
  display: grid;
  gap: 10px;
  background: #f8fafc;
}

.templates-page--streamlined {
  gap: 8px;
}

.templates-page__top {
  padding: 10px 14px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px 14px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 4px 16px rgba(15, 23, 42, .04);
}

.templates-page__top > div:first-child {
  min-width: 0;
}

.templates-page__top h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #111827;
  line-height: 1.25;
}

.templates-page__lead {
  margin: 4px 0 0;
  max-width: 36rem;
  color: #667085;
  font-size: 12px;
  line-height: 1.35;
}

.templates-page__top .generate-button {
  flex-shrink: 0;
}

.template-catalog--compact {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: min(1280px, 100%);
  margin: 0 auto;
}

.template-catalog--compact .template-search--hero {
  flex: none;
  width: 100%;
  max-width: none;
}

.template-search--hero {
  min-height: 42px;
}

.templates-list,
.templates-list--market {
  display: grid;
  gap: 14px;
  width: 100%;
  grid-template-columns: 1fr;
  align-items: start;
}

@media (min-width: 720px) {
  .templates-list,
  .templates-list--market {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

@media (max-width: 719px) {
  .template-manage-card {
    grid-template-columns: 1fr;
    grid-template-areas:
      "visual"
      "info"
      "actions";
    width: 100%;
    max-width: none;
  }

  .template-manage-visual {
    min-height: 0;
    max-height: min(220px, 58vw);
    aspect-ratio: 4 / 3;
  }

  .template-manage-cover,
  .template-manage-cover img,
  .template-carousel-viewport,
  .template-carousel-slide,
  .template-carousel-slide img {
    min-height: 0;
  }

  .template-manage-actions {
    align-self: stretch;
  }
}

.template-builder-head,
.templates-head,
.template-form {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 14px 42px rgba(15, 23, 42, .045);
}

.template-builder-head,
.templates-head {
  padding: 24px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
}

.template-builder-head h1,
.templates-head h1 {
  margin: 12px 0 8px;
  color: #111827;
  font-size: 28px;
}

.template-builder-head p,
.templates-head p {
  max-width: 760px;
  margin: 0;
  color: #667085;
  line-height: 1.5;
}

.templates-head-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.template-catalog-tools {
  margin-bottom: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.template-search {
  min-width: min(420px, 100%);
  flex: 1;
  min-height: 42px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  color: #667085;
}

.template-search svg {
  width: 18px;
  height: 18px;
}

.template-search input {
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  color: #111827;
  background: transparent;
  font: inherit;
}

.template-catalog-tools .secondary-action.active {
  color: #1d4ed8;
  border-color: #c4b5fd;
  background: #eff6ff;
}

.template-section-block {
  display: grid;
  gap: 12px;
}

.template-section-block .section-head {
  margin-bottom: 0;
}

.template-section-block .section-head > div {
  display: grid;
  gap: 4px;
}

.template-section-block .section-head h2 {
  color: #111827;
  font-size: 20px;
}

.template-section-block .section-head span {
  color: #667085;
  font-size: 13px;
}

.template-section-block .section-actions {
  gap: 10px;
  padding: 0;
  border: 0;
  background: transparent;
}

.template-section-block .section-actions .text-action {
  min-height: 38px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-weight: 600;
  background: #fff;
}

.template-section-block .section-actions .text-action:hover {
  background: rgba(105, 65, 198, .08);
  color: #1d4ed8;
}

.template-section-block .templates-list--market {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
}

.template-section-block .template-manage-card {
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    "visual"
    "info"
    "actions";
  gap: 12px;
  min-width: 0;
  padding: 12px;
}

.template-section-block .template-manage-visual {
  max-height: none;
}

.template-section-block .template-manage-info,
.template-section-block .template-manage-actions {
  min-width: 0;
  width: 100%;
}

.template-section-block .template-manage-title,
.template-section-block .template-manage-subtitle,
.template-section-block .template-manage-summary {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.template-section-block .template-action-primary {
  width: 100%;
  min-width: 0;
}

.template-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(15, 23, 42, .04);
}

.template-filter-bar button {
  min-height: 34px;
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  background: #f8fafc;
  color: #344054;
  cursor: pointer;
  white-space: nowrap;
  font: inherit;
}

.template-filter-bar button.active {
  border-color: #2563eb;
  background: #eff6ff;
  color: #1d4ed8;
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.16);
}

.template-filter-bar strong {
  font-size: 12px;
  font-weight: 600;
}

.template-filter-bar span {
  min-width: 20px;
  min-height: 20px;
  display: inline-grid;
  place-items: center;
  padding: 0 5px;
  border-radius: 999px;
  background: #fff;
  color: #667085;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
}

.template-manage-card {
  position: relative;
  box-sizing: border-box;
  width: 100%;
  max-width: none;
  justify-self: stretch;
  display: grid;
  grid-template-columns: minmax(168px, 228px) minmax(0, 1fr);
  grid-template-areas:
    "visual info"
    "visual actions";
  grid-template-rows: auto auto;
  gap: 12px 18px;
  align-items: start;
  align-content: start;
  padding: 14px 16px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 6px 22px rgba(15, 23, 42, 0.06);
}

.template-catalog--compact .template-manage-card {
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    "visual"
    "info"
    "actions";
  gap: 12px;
  padding: 12px;
}

.template-catalog--compact .template-manage-visual {
  max-height: none;
}

.template-manage-visual {
  grid-area: visual;
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  background: #eef2f6;
  align-self: start;
  justify-self: stretch;
  width: 100%;
  max-height: 220px;
  min-height: 0;
  aspect-ratio: 4 / 3;
}

.template-carousel {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
}

.template-carousel-viewport {
  overflow: hidden;
  width: 100%;
  height: 100%;
  min-height: 0;
}

.template-carousel-track {
  display: flex;
  height: 100%;
  transition: transform 240ms ease-out;
}

.template-carousel-slide {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  min-height: 0;
}

.template-carousel-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.5);
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.template-carousel-nav svg {
  width: 18px;
  height: 18px;
}

.template-carousel-nav:hover {
  background: rgba(15, 23, 42, 0.68);
}

.template-carousel-nav--prev {
  left: 6px;
}

.template-carousel-nav--next {
  right: 6px;
}

.template-carousel-counter {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  padding: 2px 9px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.52);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.35;
  pointer-events: none;
}

.template-manage-cover {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.template-manage-cover img {
  width: 100%;
  height: 100%;
  min-height: 0;
  max-height: none;
  object-fit: cover;
  object-position: center;
  display: block;
}

.template-favorite {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.62);
  color: #fff;
  cursor: pointer;
}

.template-favorite.active {
  background: #2563eb;
  color: #fff;
}

.template-favorite svg {
  width: 17px;
  height: 17px;
}

.template-like {
  position: absolute;
  top: 44px;
  right: 8px;
  z-index: 2;
  min-width: 40px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0 8px;
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.95);
  color: #475467;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.12);
}

.template-like.active,
.secondary-action.is-liked {
  color: #be123c;
  border-color: #fecdd3;
  background: #fff1f2;
}

.template-like svg {
  width: 14px;
  height: 14px;
}

.template-manage-cover:hover img {
  filter: brightness(1.03);
}

.template-manage-info {
  grid-area: info;
  min-width: 0;
  max-width: 100%;
  display: grid;
  gap: 6px;
  align-self: start;
}

.template-manage-subtitle {
  display: block;
  max-width: 100%;
  overflow-wrap: anywhere;
  color: #667085;
  font-size: 12px;
  line-height: 1.4;
}

.template-manage-summary {
  margin: 0;
  padding: 0;
  font-size: 13px;
  line-height: 1.45;
  color: #64748b;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.template-manage-title {
  width: 100%;
  max-width: 100%;
  padding: 0;
  border: 0;
  color: #111827;
  background: transparent;
  font-size: 16px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  white-space: normal;
  overflow-wrap: anywhere;
}

.template-manage-title:hover {
  color: #2563eb;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.template-manage-card small {
  color: #667085;
  font-size: 12px;
  line-height: 1.4;
}

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

.template-meta-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  background: #f8fafc;
  color: #344054;
  font-size: 12px;
  line-height: 1.2;
}

.template-meta-badge.is-private {
  border-color: #d0d5dd;
  background: #f2f4f7;
  color: #344054;
}

.template-meta-badge.is-public {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}

.template-meta-badge.is-usage {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 600;
}

.template-meta-badge.is-earned {
  border-color: #fde68a;
  background: #fffbeb;
  color: #92400e;
  font-weight: 700;
}

.template-manage-actions {
  grid-area: actions;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 0;
  width: 100%;
  min-width: 0;
  align-self: end;
}

.template-catalog--compact .template-manage-actions {
  align-self: stretch;
}

.template-manage-actions-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  width: 100%;
  min-width: 0;
}

.template-manage-owner-tools {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-left: auto;
}

.template-manage-card button {
  justify-self: start;
}

.template-action-primary,
.template-action-secondary,
.template-action-icon {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
}

.template-action-primary {
  width: auto;
  align-self: flex-start;
  min-width: min(200px, 100%);
  padding: 0 20px;
  white-space: nowrap;
  border: 0;
  color: #fff;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  box-shadow: 0 12px 28px rgba(37, 99, 235, .18);
}

.template-catalog--compact .template-action-primary {
  width: 100%;
  min-width: 0;
}

.template-action-primary:hover {
  filter: brightness(1.04);
  box-shadow: 0 14px 32px rgba(37, 99, 235, .20);
}

.template-action-secondary {
  flex: 1 1 auto;
  min-width: min(160px, 100%);
  padding: 0 12px;
  color: #344054;
  border: 1px solid #e5e7eb;
  background: #fff;
  white-space: nowrap;
}

.template-action-secondary:hover {
  border-color: #c4b5fd;
  background: #faf5ff;
  color: #1d4ed8;
}

.template-action-secondary.is-saved {
  color: #1d4ed8;
  border-color: #bfdbfe;
  background: #eff6ff;
}

.template-action-detail svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.template-action-icon {
  width: 40px;
  min-height: 40px;
  padding: 0;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  color: #475467;
  background: #f8fafc;
}

.template-action-icon:hover {
  border-color: #c4b5fd;
  color: #1d4ed8;
  background: #fff;
}

.template-action-primary svg,
.template-action-icon svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.danger-lite {
  color: #b42318;
  border-color: #fecaca;
  background: #fff;
}

.template-action-icon.danger-lite:hover {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #991b1b;
}

.chat-result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.secondary-action.is-published {
  color: #047857;
  border-color: #a7f3d0;
  background: #ecfdf3;
}

.feed-page {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 30px clamp(16px, 3vw, 28px) 60px;
  box-sizing: border-box;
}

.feed-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.feed-head > div:first-child {
  flex: 1 1 320px;
  min-width: 0;
}

.feed-head h1 {
  margin: 10px 0 8px;
  color: #111827;
  font-size: clamp(26px, 2.4vw, 32px);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.feed-head p {
  max-width: 660px;
  margin: 0;
  color: #667085;
  line-height: 1.5;
}

.feed-list {
  display: grid;
  grid-template-columns: minmax(0, 640px);
  justify-content: center;
  width: 100%;
  gap: 22px;
}

.feed-card,
.feed-list > .template-empty,
.feed-load-more {
  width: 100%;
  max-width: 640px;
}

.feed-load-more {
  min-height: 44px;
  display: grid;
  place-items: center;
  color: #667085;
  font-size: 13px;
}

.feed-card {
  overflow: hidden;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
}

.feed-card__top,
.feed-card__body,
.feed-card__actions {
  padding: 12px 14px;
}

.feed-card__top {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.feed-card__top .avatar {
  width: 36px;
  height: 36px;
}

.feed-card__top strong,
.feed-card__top small,
.feed-card__body strong {
  display: block;
}

.feed-card__top small {
  margin-top: 2px;
  color: #667085;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feed-card__top strong {
  color: #111827;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feed-card__media {
  position: relative;
  margin: 0;
  display: grid;
  place-items: center;
  width: 100%;
  padding: 0;
  background: #f8fafc;
  border-top: 1px solid #f1f5f9;
  overflow: hidden;
}

.feed-card__media-open {
  display: grid;
  place-items: center;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  text-decoration: none;
  color: inherit;
  cursor: zoom-in;
}

.feed-card__media-open:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

.feed-card__media-open:hover img {
  opacity: 0.94;
}

.feed-card__media img {
  display: block;
  width: 100%;
  max-width: 100%;
  max-height: min(620px, 68vh);
  height: auto;
  object-fit: contain;
}

.feed-card__image-actions {
  position: absolute;
  right: 20px;
  bottom: 18px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.feed-card__image-action {
  min-height: 36px;
  padding: 0 11px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: .5px solid rgba(255, 255, 255, .38);
  border-radius: 999px;
  color: #fff;
  background: rgba(15, 23, 42, .64);
  backdrop-filter: blur(14px);
  font-size: 12px;
  line-height: 1;
  pointer-events: auto;
}

.feed-card__image-action:hover,
.feed-card__image-action.is-liked,
.feed-card__image-action.is-copied {
  color: #fff;
  background: rgba(15, 23, 42, .82);
}

.feed-card__image-action.is-liked {
  background: rgba(190, 18, 60, .92);
}

.feed-card__image-action svg {
  width: 16px;
  height: 16px;
}

.feed-card__image-action--icon {
  width: 36px;
  padding: 0;
  justify-content: center;
}

.feed-card__image-action--readonly {
  cursor: default;
}

.post-share-actions {
  padding: 10px 14px 12px;
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  border-top: 1px solid #f1f5f9;
  background: #fff;
}

.post-share-actions > span {
  margin-right: 2px;
  color: #667085;
  font-size: 12px;
}

.post-share-actions a,
.post-share-actions button {
  min-height: 32px;
  padding: 0 9px 0 6px;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #344054;
  background: #fff;
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
}

.post-share-actions a:hover,
.post-share-actions button:hover,
.post-share-actions button.is-copied {
  border-color: #bfdbfe;
  background: #eff6ff;
}

.share-service-icon {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: #475467;
  font-size: 9px;
  font-weight: 500;
  line-height: 1;
}

.share-service-icon--tg { background: #229ed9; }
.share-service-icon--vk { background: #0077ff; }
.share-service-icon--wa { background: #25d366; }
.share-service-icon--max { background: #111827; }
.share-service-icon--copy { background: #64748b; }

.feed-card__body {
  border-top: 1px solid #f1f5f9;
}

.feed-card__body p {
  margin: 0;
  color: #475467;
  line-height: 1.55;
  font-size: 15px;
}

.feed-card__comments {
  padding: 0 18px 14px;
  display: grid;
  gap: 8px;
}

.feed-card__comment-count {
  justify-self: start;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #475467;
  background: #f8fafc;
  font-size: 12px;
  font-weight: 700;
}

.feed-card__comment-count svg {
  width: 14px;
  height: 14px;
}

.feed-card__comments ul {
  margin: 0;
  padding: 0;
  display: grid;
  gap: 5px;
  list-style: none;
}

.feed-card__comments li {
  min-width: 0;
  padding: 7px 9px;
  border-radius: 8px;
  background: #f8fafc;
  color: #475467;
  font-size: 12px;
  line-height: 1.35;
}

.feed-card__comments li strong {
  margin-right: 5px;
  color: #111827;
}

.feed-card__comments li span {
  overflow-wrap: anywhere;
}

.feed-card__comments > p {
  margin: 0;
  color: #98a2b3;
  font-size: 12px;
}

.profile-following-section {
  padding: 18px;
  display: grid;
  gap: 14px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
}

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

.profile-following-author {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  gap: 10px;
}

.profile-following-authors a,
.profile-following-author button {
  min-width: 0;
  min-height: 48px;
  padding: 10px 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  color: #111827;
  background: #f8fafc;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
}

.profile-following-authors a {
  width: 100%;
}

.profile-following-authors a > span:not(.avatar) {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.profile-following-authors strong,
.profile-following-authors small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.profile-following-authors small {
  color: #667085;
  font-size: 12px;
  font-weight: 400;
}

.profile-following-author button {
  color: #475467;
  cursor: pointer;
}

.profile-following-author button:hover {
  border-color: #fecaca;
  color: #b42318;
  background: #fff7f7;
}

.profile-following-author button svg {
  width: 16px;
  height: 16px;
}

.profile-following-authors .avatar {
  width: 28px;
  height: 28px;
}

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

.following-feed-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
}

.following-feed-card button {
  width: 100%;
  padding: 0;
  border: 0;
  background: #f3f6fb;
  cursor: zoom-in;
}

.following-feed-card img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.following-feed-card > div {
  padding: 11px;
  display: grid;
  gap: 6px;
}

.following-feed-card strong,
.following-feed-card span,
.following-feed-card p,
.following-feed-card a {
  min-width: 0;
  overflow-wrap: anywhere;
}

.following-feed-card strong {
  color: #111827;
  font-size: 13px;
  line-height: 1.25;
}

.following-feed-card span,
.following-feed-card p {
  margin: 0;
  color: #667085;
  font-size: 12px;
  line-height: 1.35;
}

.following-feed-card a {
  color: #2563eb;
  font-size: 12px;
  font-weight: 650;
  text-decoration: none;
}

.feed-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
  border-top: 1px solid #f1f5f9;
}

.feed-card__actions .secondary-action {
  min-width: 148px;
  justify-content: center;
}

.feed-card__avatar-link {
  display: block;
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
}

.feed-card__avatar-link:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

.feed-card__avatar-link--plain {
  display: block;
  cursor: default;
}

.feed-card__author {
  font-weight: 600;
  color: #2563eb;
  text-decoration: none;
}

.feed-card__author:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.feed-card__author--text {
  font-weight: 600;
  color: #344054;
}

.feed-card__actions--like-only {
  justify-content: center;
}

.feed-card__likes-readonly {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  background: #f8fafc;
  color: #667085;
  font-size: 13px;
  font-weight: 600;
}

.feed-card__likes-readonly svg {
  width: 14px;
  height: 14px;
  opacity: 0.85;
}

.app--public-guest {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: #f8fafc;
}

.app--public-guest .feed-page,
.app--public-guest .public-profile-page {
  flex: 1;
}

.public-guest-avatar {
  width: 34px;
  height: 34px;
  font-size: 10px;
}

.public-guest-actions {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.public-guest-create {
  min-height: 38px;
  padding: 0 14px;
  white-space: nowrap;
}

.public-guest-account {
  width: 42px;
  height: 42px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 1px solid #dbe2ea;
  border-radius: 999px;
  background: #fff;
}

.public-guest-account:hover {
  border-color: #b9c3d0;
  background: #f8fafc;
}

.public-guest-nav {
  flex-shrink: 0;
  border-bottom: 1px solid #e5e7eb;
  background: #fff;
}

.feed-profile-loading {
  margin: 0;
  color: #667085;
  text-align: center;
  padding: 12px;
}

.public-profile-page {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px;
  padding-bottom: 80px;
  display: grid;
  gap: 22px;
  align-content: start;
  position: relative;
}

.app--light:not(.app--public-guest) .main-shell > main.public-profile-page.public-profile-page--mock {
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 0 0 96px;
  background: #e4e9f3;
  gap: 0;
}

.app--public-guest .public-profile-page.public-profile-page--mock {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px;
  padding-bottom: 88px;
  background: #e4e9f3;
  gap: 22px;
}

.public-profile-page--mock .public-profile-hero--mock,
.public-profile-page--mock .public-profile-metrics--mock,
.public-profile-page--mock .public-profile-tabs--mock,
.public-profile-page--mock .public-profile-layout--mock {
  width: 100%;
  max-width: min(1320px, 100%);
  margin-left: auto;
  margin-right: auto;
  padding-left: 28px;
  padding-right: 28px;
  box-sizing: border-box;
}

.public-profile-page--mock .public-profile-hero--mock {
  margin-top: 20px;
  margin-bottom: 0;
}

.public-profile-page--mock .public-profile-panels {
  margin-top: 20px;
}

.public-profile-hero--mock {
  position: relative;
  overflow: hidden;
  border-radius: 22px;
  box-shadow: 0 28px 70px rgba(15, 23, 42, 0.2);
}

.public-profile-hero-backdrop {
  position: absolute;
  inset: 0;
  background: linear-gradient(132deg, #141026 0%, #221748 26%, #3730a3 58%, #1d4ed8 92%);
}

.public-profile-hero-backdrop::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 88% 85% at 10% 0%, rgba(255, 255, 255, 0.2), transparent 52%),
    radial-gradient(ellipse 55% 65% at 94% 12%, rgba(251, 191, 36, 0.14), transparent 48%),
    radial-gradient(ellipse 70% 55% at 50% 110%, rgba(0, 0, 0, 0.25), transparent 52%);
  pointer-events: none;
}

.public-profile-hero-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px 36px;
  padding: 36px 36px 40px;
  padding-top: 56px;
}

.public-profile-hero--mock .public-profile-main {
  flex: 1 1 400px;
  min-width: 0;
}

.public-profile-hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  flex: 0 1 340px;
  padding-bottom: 2px;
}

.public-profile-hero--mock .public-profile-avatar {
  margin-top: -72px;
  border-width: 4px;
  border-color: rgba(255, 255, 255, 0.92);
  box-shadow:
    0 10px 40px rgba(0, 0, 0, 0.38),
    0 0 0 1px rgba(255, 255, 255, 0.12);
}

/* Компактное превью: маленький аватар по центру, без вылезания над блоком */
.public-profile-hero--mock.public-profile-hero--compact {
  box-shadow: 0 16px 44px rgba(15, 23, 42, 0.14);
}

.public-profile-hero--mock.public-profile-hero--compact .public-profile-hero-content {
  flex-direction: column;
  align-items: stretch;
  padding: 22px 28px 24px;
  padding-top: 22px;
  gap: 16px;
}

.public-profile-hero--mock.public-profile-hero--compact .public-profile-main {
  display: grid;
  grid-template-columns: 1fr;
  justify-items: center;
  gap: 12px;
  flex: none;
  width: 100%;
}

.public-profile-hero--mock.public-profile-hero--compact .public-profile-avatar {
  margin-top: 0;
  width: 88px;
  height: 88px;
  border-radius: 18px;
}

.public-profile-hero--mock.public-profile-hero--compact .public-profile-avatar img,
.public-profile-hero--mock.public-profile-hero--compact .public-profile-avatar .avatar {
  border-radius: 14px;
}

.public-profile-hero--mock.public-profile-hero--compact .public-profile-avatar .avatar::before {
  font-size: 28px;
}

.public-profile-hero--mock.public-profile-hero--compact .public-profile-copy {
  padding-top: 0;
  text-align: center;
  justify-items: center;
}

.public-profile-hero--mock.public-profile-hero--compact .public-profile-topline,
.public-profile-hero--mock.public-profile-hero--compact .public-profile-title-row {
  justify-content: center;
}

.public-profile-hero--mock.public-profile-hero--compact .public-profile-meta {
  justify-content: center;
}

.public-profile-hero--mock.public-profile-hero--compact .public-profile-copy p {
  max-width: 52ch;
  margin-left: auto;
  margin-right: auto;
}

.public-profile-hero--mock.public-profile-hero--compact .public-profile-hero-actions {
  flex: none;
  width: 100%;
  justify-content: center;
  padding-bottom: 0;
}

.public-profile-hero--mock.public-profile-hero--compact .public-profile-title-row h1 {
  font-size: clamp(22px, 4vw, 30px);
}

.public-profile-hero--mock .public-profile-avatar .avatar::before {
  color: #e9d5ff;
}

.public-profile-hero--mock .public-profile-copy {
  padding-top: 6px;
}

.public-profile-hero--mock .public-profile-copy .public-profile-badge.context-pill {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.28);
  color: #e0e7ff;
}

.public-profile-hero--mock .public-profile-title-row h1 {
  color: #fff;
}

.public-profile-hero--mock .public-profile-copy h2 {
  color: rgba(191, 219, 254, 0.98);
}

.public-profile-hero--mock .public-profile-copy p {
  color: rgba(226, 232, 240, 0.9);
}

.public-profile-hero--mock .public-profile-copy .public-profile-meta {
  margin-top: 6px;
  padding-top: 0;
  border-top: none;
}

.public-profile-hero--mock .public-profile-link {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(15, 23, 42, 0.28);
  color: #f8fafc;
  backdrop-filter: blur(10px);
}

.public-profile-hero--mock .public-profile-link:hover {
  background: rgba(15, 23, 42, 0.42);
  border-color: rgba(255, 255, 255, 0.4);
}

.public-profile-hero--mock .public-profile-chip.public-profile-chip--location {
  color: rgba(241, 245, 249, 0.92);
  border-color: rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.08);
}

.public-profile-hero--mock .public-profile-action--primary:not(.is-following) {
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
}

.public-profile-hero--mock .public-profile-action:not(.public-profile-action--primary):not(.is-following) {
  background: rgba(15, 23, 42, 0.38);
  border-color: rgba(255, 255, 255, 0.28);
  color: #f8fafc;
  backdrop-filter: blur(10px);
}

.public-profile-hero--mock .public-profile-action:not(.public-profile-action--primary):not(.is-following):hover {
  background: rgba(15, 23, 42, 0.52);
  border-color: rgba(255, 255, 255, 0.4);
}

.public-profile-page--mock .public-profile-hero--mock {
  overflow: visible;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  background: #fff;
  box-shadow: none;
}

.public-profile-page--mock .public-profile-hero-backdrop {
  display: none;
}

.public-profile-page--mock .public-profile-hero-content,
.public-profile-hero--mock.public-profile-hero--compact .public-profile-hero-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 22px;
}

.public-profile-hero--mock.public-profile-hero--compact .public-profile-main,
.public-profile-page--mock .public-profile-main {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  align-items: center;
  justify-items: stretch;
  gap: 16px;
  width: 100%;
}

.public-profile-hero--mock.public-profile-hero--compact .public-profile-avatar,
.public-profile-page--mock .public-profile-avatar,
.public-profile-hero--mock .public-profile-avatar {
  width: 78px;
  height: 78px;
  margin-top: 0;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  box-shadow: none;
}

.public-profile-hero--mock.public-profile-hero--compact .public-profile-avatar img,
.public-profile-hero--mock.public-profile-hero--compact .public-profile-avatar .avatar,
.public-profile-page--mock .public-profile-avatar img,
.public-profile-page--mock .public-profile-avatar .avatar {
  border-radius: 14px;
}

.public-profile-hero--mock .public-profile-avatar .avatar::before {
  color: #1d4ed8;
}

.public-profile-hero--mock.public-profile-hero--compact .public-profile-copy,
.public-profile-page--mock .public-profile-copy {
  padding-top: 0;
  justify-items: start;
  text-align: left;
}

.public-profile-hero--mock.public-profile-hero--compact .public-profile-topline,
.public-profile-hero--mock.public-profile-hero--compact .public-profile-title-row,
.public-profile-page--mock .public-profile-topline,
.public-profile-page--mock .public-profile-title-row {
  justify-content: flex-start;
}

.public-profile-hero--mock .public-profile-copy .public-profile-badge.context-pill {
  border-color: rgba(37, 99, 235, .22);
  background: #eff6ff;
  color: #1d4ed8;
}

.public-profile-hero--mock .public-profile-title-row h1 {
  max-width: 100%;
  color: #111827;
  font-size: clamp(24px, 3vw, 32px);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.public-profile-hero--mock .public-profile-copy h2 {
  margin: 0;
  color: #1d4ed8;
  font-size: 15px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.public-profile-hero--mock .public-profile-copy p,
.public-profile-hero--mock.public-profile-hero--compact .public-profile-copy p {
  max-width: 68ch;
  margin: 0;
  color: #667085;
  font-size: 14px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.public-profile-page--mock .public-profile-hero-actions,
.public-profile-hero--mock.public-profile-hero--compact .public-profile-hero-actions {
  width: auto;
  min-width: 0;
  flex: 0 0 auto;
  justify-content: flex-end;
  padding-bottom: 0;
}

.public-profile-hero--mock .public-profile-action--primary:not(.is-following),
.public-profile-hero--mock .public-profile-action:not(.public-profile-action--primary):not(.is-following) {
  border-color: #dbe3ef;
  background: #fff;
  color: #1f2937;
  box-shadow: none;
  backdrop-filter: none;
}

.public-profile-hero--mock .public-profile-action--primary:not(.is-following) {
  border-color: #2563eb;
  background: #2563eb;
  color: #fff;
}

.public-profile-hero--mock .public-profile-action:not(.public-profile-action--primary):not(.is-following):hover {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.public-profile-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 24px;
  align-items: start;
}

.public-profile-primary {
  min-width: 0;
  display: grid;
  gap: 0;
  align-content: start;
}

.public-profile-main {
  padding: 0;
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 22px 26px;
  align-items: start;
}

.public-profile-avatar {
  width: 132px;
  height: 132px;
  margin-top: -56px;
  border: 4px solid #fff;
  border-radius: 22px;
  background: linear-gradient(145deg, #eef2ff, #e9d5ff);
  overflow: hidden;
  box-shadow:
    0 4px 6px rgba(37, 99, 235, 0.08),
    0 20px 40px rgba(15, 23, 42, 0.14);
  position: relative;
  z-index: 1;
}

.public-profile-avatar img,
.public-profile-avatar .avatar {
  width: 100%;
  height: 100%;
  border-radius: 18px;
}

.public-profile-avatar img {
  object-fit: cover;
}

.public-profile-avatar .avatar::before {
  font-size: 38px;
  font-weight: 650;
  color: #1d4ed8;
}

.public-profile-copy {
  min-width: 0;
  display: grid;
  gap: 10px;
  padding-top: 16px;
}

.public-profile-copy .public-profile-badge.context-pill {
  justify-self: start;
  border-color: rgba(37, 99, 235, 0.28);
  background: linear-gradient(180deg, #eff6ff, #dbeafe);
  color: #1d4ed8;
}

.public-profile-copy h2 {
  color: #2563eb;
  font-size: 17px;
  line-height: 1.4;
  font-weight: 650;
}

.public-profile-copy p {
  max-width: 640px;
  color: #64748b;
  font-size: 15px;
  line-height: 1.6;
}

.public-profile-topline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.public-profile-author-pill {
  font-size: 11px;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 5px 11px;
  border-radius: 999px;
  background: linear-gradient(125deg, #2563eb, #8b5cf6);
  color: #fff;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.20);
}

.public-profile-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.public-profile-title-row h1 {
  margin: 0;
  color: #0f172a;
  font-size: 32px;
  line-height: 1.15;
  font-weight: 780;
  letter-spacing: -0.02em;
}

.public-profile-verified {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #4f46e5);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  flex-shrink: 0;
}

.public-profile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
}

.public-profile-action {
  min-height: 42px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #334155;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    transform 0.15s ease;
}

.public-profile-action:hover {
  border-color: #c7d2fe;
  background: #f8fafc;
}

.public-profile-action svg {
  width: 18px;
  height: 18px;
}

.public-profile-action--primary {
  border: none;
  background: linear-gradient(135deg, #2563eb, #2563eb);
  color: #fff;
  box-shadow: 0 8px 22px rgba(37, 99, 235, 0.24);
}

.public-profile-action--primary:hover {
  background: linear-gradient(135deg, #4f46e5, #6d28d9);
  color: #fff;
}

.public-profile-action--primary.is-following {
  background: #ecfdf5;
  color: #047857;
  box-shadow: none;
  border: 1px solid #a7f3d0;
}

.public-profile-metrics {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid #eceef4;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.public-profile-metrics.public-profile-metrics--mock {
  margin-top: 24px;
  margin-bottom: 0;
  padding: 22px 24px;
  border: 1px solid #d8dee9;
  border-top: 1px solid #d8dee9;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 14px 44px rgba(15, 23, 42, 0.078);
  gap: 12px;
}

.public-profile-metric {
  min-width: 0;
  padding: 12px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 14px;
  border: 1px solid #e8e8f0;
  background: #fff;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.035);
}

.public-profile-metric__icon {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: linear-gradient(145deg, #eef2ff, #e0e7ff);
  color: #4f46e5;
}

.public-profile-metric__icon svg {
  width: 20px;
  height: 20px;
}

.public-profile-metric:nth-child(2) .public-profile-metric__icon {
  background: linear-gradient(145deg, #ecfdf5, #d1fae5);
  color: #059669;
}

.public-profile-metric:nth-child(3) .public-profile-metric__icon {
  background: linear-gradient(145deg, #eff6ff, #dbeafe);
  color: #2563eb;
}

.public-profile-metric:nth-child(4) .public-profile-metric__icon {
  background: linear-gradient(145deg, #fff7ed, #ffedd5);
  color: #ea580c;
}

.public-profile-metric:nth-child(5) .public-profile-metric__icon {
  background: linear-gradient(145deg, #fff1f2, #ffe4e6);
  color: #e11d48;
}

.public-profile-metric__body {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.public-profile-metric__body strong {
  color: #0f172a;
  font-size: 17px;
  line-height: 1.15;
  font-weight: 780;
  letter-spacing: -0.02em;
}

.public-profile-metric__body span {
  color: #64748b;
  font-size: 10px;
  font-weight: 650;
  line-height: 1.25;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.public-profile-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 22px;
  padding: 6px;
  border-radius: 14px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
}

.public-profile-tab {
  flex: 1 1 auto;
  min-width: 100px;
  padding: 11px 14px;
  border: none;
  border-radius: 10px;
  background: transparent;
  font-weight: 750;
  font-size: 14px;
  color: #64748b;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.public-profile-tab.is-active {
  background: #fff;
  color: #4f46e5;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.07);
}

.public-profile-tabs.public-profile-tabs--mock {
  margin-top: 22px;
  padding: 0;
  gap: 2px;
  background: transparent;
  border: none;
  border-bottom: 1px solid #c9d4e8;
  border-radius: 0;
}

.public-profile-tabs--mock .public-profile-tab {
  flex: 0 1 auto;
  min-width: auto;
  padding: 14px 18px;
  border-radius: 14px 14px 0 0;
  margin-bottom: -1px;
}

.public-profile-tabs--mock .public-profile-tab.is-active {
  background: transparent;
  color: #4f46e5;
  box-shadow: none;
  border-bottom: 3px solid #2563eb;
}

.public-profile-panels {
  margin-top: 18px;
}

.public-profile-panel {
  display: grid;
  gap: 14px;
}

.section-head--flush {
  margin-bottom: 0;
}

.public-profile-panel-empty {
  margin: 0;
  padding: 18px;
  border-radius: 12px;
  background: #f8fafc;
  color: #64748b;
  font-size: 14px;
  border: 1px dashed #e2e8f0;
}

.public-profile-reviews-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.public-profile-review-row {
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  background: #fff;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.04);
}

.public-profile-review-meta {
  display: grid;
  gap: 4px;
  margin-bottom: 8px;
}

.public-profile-review-meta strong {
  font-size: 14px;
  color: #0f172a;
}

.public-profile-review-meta span {
  font-size: 12px;
  color: #94a3b8;
}

.public-profile-review-row p {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: #334155;
  white-space: pre-wrap;
}

.public-profile-templates-toolbar {
  display: grid;
  gap: 14px;
}

.public-profile-template-search-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background: #fff;
  min-height: 46px;
}

.public-profile-template-search-wrap svg {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  color: #94a3b8;
}

.public-profile-template-search-wrap input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  font-size: 14px;
  outline: none;
}

.public-profile-templates-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.public-profile-template-search-wrap--wide {
  flex: 1 1 260px;
  min-width: 200px;
}

.public-profile-template-filters-mock {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.public-profile-filter-mock {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 15px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background: linear-gradient(180deg, #fff, #f8fafc);
  font-size: 13px;
  font-weight: 650;
  color: #64748b;
  white-space: nowrap;
}

.public-profile-filter-mock svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.72;
}

.public-profile-templates-list {
  margin-top: 4px;
}

.public-profile-about {
  padding: 20px 22px;
  border-radius: 14px;
  border: 1px solid #e8e8f0;
  background: #fff;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.04);
}

.public-profile-about h2 {
  margin: 0 0 12px;
  font-size: 20px;
  color: #0f172a;
}

.public-profile-about > p {
  margin: 0;
  color: #475569;
  line-height: 1.6;
  font-size: 15px;
}

.public-profile-about-links {
  margin-top: 20px;
}

.public-profile-about-links h3 {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 780;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
}

.public-profile-about-links .public-profile-meta {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.public-profile-about-location {
  margin: 16px 0 0;
  color: #475569;
  font-size: 14px;
}

.public-profile-empty-global {
  margin-top: 16px;
}

.public-profile-aside {
  display: grid;
  gap: 16px;
  position: sticky;
  top: 16px;
}

.public-profile-aside-card {
  padding: 16px 18px;
  border-radius: 14px;
  border: 1px solid #e8e8f0;
  background: #fff;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.05);
}

.public-profile-aside-card h3 {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 780;
  color: #0f172a;
}

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

.public-profile-aside-head h3 {
  margin: 0;
}

.public-profile-aside-seeall {
  border: none;
  padding: 4px 0;
  background: none;
  font-size: 13px;
  font-weight: 750;
  color: #2563eb;
  cursor: pointer;
}

.public-profile-aside-seeall:hover {
  text-decoration: underline;
}

.public-profile-aside-link.public-profile-aside-link--gallery {
  margin-top: 12px;
  padding: 12px 14px;
  font-weight: 750;
  background: #fff;
  border-color: #c7d2fe;
  color: #4338ca;
}

.public-profile-aside-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  min-height: 48px;
}

.public-profile-aside-thumb {
  padding: 0;
  border: none;
  border-radius: 8px;
  overflow: hidden;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  background: #f8fafc;
}

.public-profile-aside-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center center;
  display: block;
}

.public-profile-aside-empty {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 13px;
  color: #94a3b8;
}

.public-profile-aside-link {
  margin-top: 12px;
  width: 100%;
  padding: 10px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
  font-weight: 700;
  font-size: 13px;
  color: #4f46e5;
  cursor: pointer;
}

.public-profile-aside-cta p {
  margin: 0 0 14px;
  font-size: 14px;
  color: #64748b;
  line-height: 1.5;
}

.public-profile-aside-muted {
  margin: 0;
  font-size: 13px;
  color: #94a3b8;
}

.public-profile-cta-btn {
  width: 100%;
  justify-content: center;
}

.public-profile-aside-cta {
  background: linear-gradient(180deg, #eff6ff 0%, #fff 100%);
  border-color: #e9d5ff;
}

.public-profile-help-fab {
  position: fixed;
  right: max(24px, env(safe-area-inset-right, 0px));
  bottom: max(24px, env(safe-area-inset-bottom, 0px));
  z-index: 200;
  width: 56px;
  height: 56px;
  border: none;
  border-radius: 50%;
  background: linear-gradient(145deg, #2563eb, #2563eb);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 12px 36px rgba(37, 99, 235, 0.28);
  display: grid;
  place-items: center;
  transition: transform 0.15s ease;
}

.public-profile-help-fab:hover {
  transform: scale(1.06);
}

.public-profile-help-fab svg {
  width: 26px;
  height: 26px;
}

.public-profile-help-wrap {
  position: fixed;
  inset: 0;
  z-index: 300;
  pointer-events: none;
}

.public-profile-help-backdrop {
  pointer-events: auto;
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
}

.public-profile-help-dialog {
  pointer-events: auto;
  position: absolute;
  right: max(24px, env(safe-area-inset-right, 0px));
  bottom: 96px;
  width: min(420px, calc(100vw - 40px));
  max-height: min(480px, calc(100vh - 140px));
  overflow: auto;
  padding: 22px 22px 20px;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 28px 70px rgba(15, 23, 42, 0.22);
  border: 1px solid #e5e7eb;
}

.public-profile-help-dialog h2 {
  margin: 0 28px 14px 0;
  font-size: 19px;
  font-weight: 780;
  color: #0f172a;
}

.public-profile-help-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 10px;
  background: #f1f5f9;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  color: #64748b;
}

.public-profile-help-list {
  margin: 0;
  padding: 0 0 0 18px;
  color: #475569;
  font-size: 14px;
  line-height: 1.55;
  display: grid;
  gap: 10px;
}

.public-profile-help-list strong {
  color: #1e293b;
}

.public-profile-help-contact {
  margin: 16px 0 0;
  font-size: 14px;
}

.public-profile-help-contact a {
  color: #4f46e5;
  font-weight: 700;
}

.public-profile-help-note {
  margin: 16px 0 0;
  font-size: 13px;
  color: #64748b;
  line-height: 1.5;
}

.public-profile-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 10px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid #eceef4;
}

.public-profile-chip.public-profile-chip--location {
  min-height: 44px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #f8fafc;
  color: #475569;
  font-size: 13px;
  font-weight: 650;
}

.public-profile-chip.public-profile-chip--location svg {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  color: #64748b;
}

.public-profile-link {
  min-height: 44px;
  padding: 8px 14px 8px 12px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border-radius: 12px;
  border: 1px solid transparent;
  text-decoration: none;
  font-size: 13px;
  font-weight: 650;
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease,
    border-color 0.15s ease;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.public-profile-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
}

.public-profile-link svg {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  opacity: 0.9;
}

.public-profile-link__text {
  display: grid;
  gap: 2px;
  min-width: 0;
  text-align: left;
}

.public-profile-link__title {
  font-size: 12px;
  font-weight: 780;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  opacity: 0.92;
}

.public-profile-link__text small {
  font-size: 12px;
  font-weight: 600;
  opacity: 0.72;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.public-profile-link--site {
  border-color: rgba(37, 99, 235, 0.24);
  background: linear-gradient(180deg, #ffffff, #eff6ff);
  color: #4338ca;
}

.public-profile-link--telegram {
  border-color: rgba(14, 165, 233, 0.45);
  background: linear-gradient(180deg, #ffffff, #f0f9ff);
  color: #0369a1;
}

.public-profile-link--vk {
  border-color: rgba(37, 99, 235, 0.4);
  background: linear-gradient(180deg, #ffffff, #eff6ff);
  color: #1d4ed8;
}

.public-profile-link--instagram {
  border-color: rgba(219, 39, 119, 0.35);
  background: linear-gradient(180deg, #ffffff, #fdf2f8);
  color: #be185d;
}

.public-profile-link--other {
  border-color: rgba(100, 116, 139, 0.35);
  background: linear-gradient(180deg, #ffffff, #f8fafc);
  color: #475569;
}

.public-profile-section {
  display: grid;
  gap: 14px;
}

.public-photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
  background: transparent;
}

.public-photo-cell {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #e5e7eb;
  background: #fff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}

.public-photo-cell .public-photo-card {
  border-radius: 0;
}

.public-photo-media {
  position: relative;
  min-width: 0;
  background: #f8fafc;
}

.public-photo-actions {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  display: flex;
  gap: 7px;
  pointer-events: none;
}

.public-photo-action {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .38);
  border-radius: 999px;
  color: #fff;
  background: rgba(15, 23, 42, .62);
  text-decoration: none;
  pointer-events: auto;
}

.public-photo-action:hover,
.public-photo-action.is-copied {
  color: #fff;
  background: rgba(15, 23, 42, .82);
}

.public-photo-action svg {
  width: 17px;
  height: 17px;
}

.public-photo-comments-block {
  display: grid;
  gap: 8px;
  padding: 10px 12px 12px;
  background: linear-gradient(180deg, #fafbfc, #fff);
  border-top: 1px solid #eef2f7;
}

.public-photo-comments-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 6px;
  max-height: 140px;
  overflow: auto;
}

.public-photo-comment-item {
  font-size: 12px;
  line-height: 1.35;
  color: #334155;
}

.public-photo-comment-author {
  font-weight: 650;
  color: #0f172a;
  margin-right: 4px;
}

.public-photo-comment-body {
  color: #475569;
}

.public-photo-comment-empty {
  font-size: 12px;
  color: #94a3b8;
}

.public-photo-comment-form {
  display: grid;
  gap: 8px;
  align-items: start;
}

.public-photo-comment-form textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  font: inherit;
  font-size: 13px;
  resize: vertical;
  min-height: 56px;
  background: #fff;
}

.public-photo-comment-form textarea:focus {
  outline: none;
  border-color: #94a3b8;
  box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.25);
}

.public-photo-comment-form textarea:disabled {
  background: #f1f5f9;
  color: #94a3b8;
}

.public-photo-comment-submit {
  justify-self: start;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  background: linear-gradient(180deg, #fff, #f8fafc);
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  color: #0f172a;
  cursor: pointer;
}

.public-photo-comment-submit:hover:not(:disabled) {
  border-color: #94a3b8;
  background: #fff;
}

.public-photo-comment-submit:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.public-photo-comment-status {
  min-height: 16px;
  color: #667085;
  font-size: 12px;
  line-height: 1.35;
}

.public-post-comments .public-photo-comment-form,
.feed-preview-comments .public-photo-comment-form {
  padding: 10px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
}

.public-photo-card {
  position: relative;
  min-width: 0;
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  display: grid;
  place-items: center;
  background: #f8fafc;
  overflow: hidden;
}

.public-photo-cell--landscape-wide .public-photo-card {
  aspect-ratio: 16 / 9;
}

.public-photo-cell--landscape .public-photo-card {
  aspect-ratio: 4 / 3;
}

.public-photo-cell--portrait .public-photo-card {
  aspect-ratio: 3 / 4;
}

.public-photo-cell--portrait-wide .public-photo-card {
  aspect-ratio: 9 / 16;
}

.public-photo-cell--square .public-photo-card {
  aspect-ratio: 1;
}

.public-photo-card img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center center;
  display: block;
  transition: transform .2s ease, opacity .2s ease;
}

.public-photo-card:hover img {
  transform: scale(1.01);
  opacity: .9;
}

.public-photo-card span {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 34px 12px 12px;
  display: grid;
  gap: 3px;
  background: linear-gradient(180deg, transparent, rgba(17, 24, 39, .82));
  color: #fff;
  text-align: left;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .18s ease, transform .18s ease;
}

.public-photo-card:hover span,
.public-photo-card:focus-visible span {
  opacity: 1;
  transform: translateY(0);
}

.public-photo-card strong,
.public-photo-card small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.public-photo-card strong {
  font-size: 13px;
  font-weight: 750;
}

.public-photo-card small {
  color: rgba(255, 255, 255, .78);
  font-size: 12px;
}

.public-photo-card em {
  display: -webkit-box;
  max-height: 38px;
  margin-top: 4px;
  overflow: hidden;
  color: rgba(255, 255, 255, .9);
  font-size: 12px;
  font-style: normal;
  line-height: 1.35;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.public-profile-follow {
  min-height: 42px;
  padding: 0 16px;
  border-radius: 8px;
}

.public-post-page {
  min-height: 100vh;
  padding: 28px;
  display: grid;
  align-content: start;
  justify-items: center;
  background: #f8fafc;
}

.public-post-card {
  width: min(1120px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: 16px;
  padding: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 18px 46px rgba(15, 23, 42, .07);
}

.public-post-card figure {
  min-width: 0;
  margin: 0;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #f3f6fb;
  overflow: hidden;
}

.public-post-card figure img {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: min(76vh, 820px);
  height: auto;
  object-fit: contain;
}

.public-post-card aside {
  padding: 14px;
  display: grid;
  align-content: start;
  gap: 12px;
}

.public-post-card h1,
.public-post-card p {
  margin: 0;
}

.public-post-card h1 {
  color: #111827;
  font-size: 26px;
  line-height: 1.12;
}

.public-post-card p {
  color: #344054;
  font-size: 15px;
  line-height: 1.55;
}

.public-post-card small {
  color: #667085;
  font-size: 13px;
}

.public-post-comments {
  padding-top: 12px;
  display: grid;
  gap: 10px;
  border-top: 1px solid #e5e7eb;
}

.public-post-comments h3 {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #111827;
  font-size: 15px;
}

.public-post-comments h3 svg {
  width: 16px;
  height: 16px;
}

.public-post-comments h3 span {
  color: #667085;
  font-size: 13px;
  font-weight: 650;
}

.public-post-comments-list {
  margin: 0;
  padding: 0;
  display: grid;
  gap: 7px;
  list-style: none;
}

.public-post-comments-list li {
  padding: 9px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #f8fafc;
  color: #475467;
  font-size: 13px;
  line-height: 1.4;
}

.public-post-comments-list strong {
  display: block;
  margin-bottom: 2px;
  color: #111827;
  font-size: 12px;
}

.public-post-comments-list span {
  overflow-wrap: anywhere;
}

.public-post-comments-empty {
  margin: 0;
  color: #98a2b3;
  font-size: 13px;
}

.public-profile-templates {
  margin-bottom: 0;
}

.template-empty {
  grid-column: 1 / -1;
  display: grid;
  gap: 10px;
  align-content: start;
  justify-items: start;
  padding: 24px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
}

.template-empty--small {
  padding: 16px;
}

.template-empty h2 {
  margin: 0;
  color: #111827;
  font-size: 22px;
}

.template-empty p {
  max-width: 520px;
  margin: 0;
  color: #667085;
  line-height: 1.5;
}

.template-public-page {
  min-height: 100vh;
  padding: 24px;
  display: grid;
  gap: 18px;
  align-content: start;
  background: #f8fafc;
}

.template-public-hero,
.template-public-section {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
}

.template-public-hero {
  padding: 24px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  gap: 24px;
  align-items: start;
}

.template-public-hero--no-media {
  grid-template-columns: minmax(0, 1fr);
}

.template-public-hero--compact {
  padding: 18px;
  gap: 18px;
}

.template-public-hero > div {
  display: grid;
  gap: 14px;
  align-content: start;
}

.template-public-hero h1 {
  margin: 0;
  color: #111827;
  font-size: 32px;
  line-height: 1.1;
}

.template-public-hero--compact h1 {
  font-size: 26px;
}

.template-public-hero p {
  margin: 0;
  color: #475467;
  font-size: 15px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.template-public-hero--compact p {
  max-width: 720px;
  font-size: 14px;
}

.template-public-hero figure {
  margin: 0;
  overflow: hidden;
  border-radius: 8px;
  background: #eef2f6;
  aspect-ratio: 1;
}

.template-public-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.template-public-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.template-public-section {
  padding: 20px;
}

.template-public-section--intro p {
  max-width: 780px;
  margin: 0;
  color: #475467;
  font-size: 14px;
  line-height: 1.55;
}

.template-public-section .section-head span {
  color: #667085;
  font-size: 13px;
  font-weight: 400;
}

.template-public-cost {
  max-width: max-content;
  padding: 9px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  background: #f8fafc;
  color: #475467;
  font-size: 12px;
}

.template-public-fields {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px;
}

.template-public-fields article {
  padding: 14px;
  border: 1px solid #eef2f6;
  border-radius: 8px;
  background: #fbfcff;
}

.template-public-fields strong {
  display: block;
  color: #111827;
  font-size: 14px;
  font-weight: 500;
}

.template-public-fields span {
  display: block;
  margin-top: 4px;
  color: #2563eb;
  font-size: 12px;
  font-weight: 400;
}

.template-public-fields p {
  margin: 8px 0 0;
  color: #667085;
  font-size: 13px;
  line-height: 1.45;
}

.template-public-examples {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.template-public-examples figure {
  margin: 0;
  overflow: hidden;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
}

.template-public-examples img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
  background: #eef2f6;
}

.template-public-examples figcaption {
  padding: 10px 12px;
  color: #344054;
  font-size: 13px;
  font-weight: 400;
}

.template-public-bottom-action {
  margin-top: 16px;
  display: flex;
  justify-content: center;
}

.template-public-empty-examples p {
  margin: 0;
  color: #667085;
  font-size: 13px;
  line-height: 1.5;
}

.bonus-ledger {
  display: grid;
  gap: 10px;
}

.bonus-ledger article {
  min-width: 0;
  padding: 10px;
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
}

.bonus-ledger img {
  width: 74px;
  height: 58px;
  object-fit: cover;
  border-radius: 7px;
  background: #eef2f6;
}

.reference-ledger__placeholder {
  width: 74px;
  height: 58px;
  border-radius: 7px;
  border: 1px solid #e5e7eb;
  background: #f8fafc;
}

.bonus-ledger strong,
.bonus-ledger span {
  min-width: 0;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bonus-ledger strong {
  color: #111827;
}

.bonus-ledger span {
  margin-top: 4px;
  color: #667085;
  font-size: 13px;
}

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

.referral-link-card {
  min-width: 0;
  padding: 16px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
}

.referral-link-card strong,
.referral-reward-list strong {
  color: #111827;
  font-weight: 500;
}

.referral-link-card p {
  margin: 6px 0 10px;
  color: #667085;
  line-height: 1.45;
}

.referral-link-card code {
  display: block;
  min-width: 0;
  padding: 9px 10px;
  overflow-wrap: anywhere;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  color: #344054;
  background: #f8fafc;
  font-family: var(--ui-font);
  font-size: 12px;
}

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

.referral-reward-list article {
  min-width: 0;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
}

.referral-reward-list span {
  display: block;
  margin-top: 4px;
  color: #667085;
  font-size: 13px;
}

.referral-reward-list b {
  color: #027a48;
  font-size: 18px;
  font-weight: 500;
  white-space: nowrap;
}

.images-page {
  min-height: 100vh;
  padding: 24px;
  display: grid;
  gap: 18px;
  align-content: start;
  background: #f8fafc;
}

.images-head,
.images-album {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 14px 42px rgba(15, 23, 42, .045);
}

.images-head {
  padding: 24px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
}

.images-head h1 {
  margin: 12px 0 8px;
  color: #111827;
  font-size: 28px;
}

.images-head p {
  max-width: 720px;
  margin: 0;
  color: #667085;
  line-height: 1.5;
}

.images-album {
  padding: 16px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 12px;
}

.album-item {
  min-width: 0;
  padding: 8px;
  display: grid;
  gap: 8px;
  border: 1px solid #eef2f6;
  border-radius: 8px;
  background: #fbfcff;
  text-align: left;
  cursor: pointer;
}

.album-item > button:first-child {
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.album-item:hover {
  border-color: #c4b5fd;
  box-shadow: 0 12px 28px rgba(105, 65, 198, .12);
}

.album-item img {
  width: 100%;
  height: 190px;
  object-fit: contain;
  border-radius: 7px;
  background: #f8fafc;
}

.album-item span,
.album-item strong,
.album-item small {
  min-width: 0;
  display: block;
}

.album-item strong {
  color: #111827;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.album-item small {
  color: #667085;
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.editor-page {
  min-height: 100vh;
  padding: 24px;
  display: grid;
  gap: 18px;
  align-content: start;
  background: #f8fafc;
}

.editor-head,
.editor-workspace,
.editor-history {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 14px 42px rgba(15, 23, 42, .045);
}

.editor-head {
  padding: 24px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
}

.editor-head h1 {
  margin: 12px 0 8px;
  color: #111827;
  font-size: 28px;
}

.editor-head p {
  max-width: 760px;
  margin: 0;
  color: #667085;
  line-height: 1.5;
}

.editor-workspace {
  min-height: 620px;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) 300px;
  overflow: hidden;
}

.editor-tools,
.editor-settings {
  padding: 14px;
  display: grid;
  align-content: start;
  gap: 12px;
  background: #fbfcff;
}

.editor-tools { border-right: 1px solid #e5e7eb; }
.editor-settings { border-left: 1px solid #e5e7eb; }

.editor-tool-group,
.editor-settings-card {
  display: grid;
  gap: 8px;
}

.editor-tool-group span,
.editor-settings-card h2 {
  margin: 0;
  color: #667085;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.editor-tool-group button,
.editor-settings-card button:not(.editor-footer-button),
.editor-download:not(.editor-footer-button) {
  justify-content: flex-start;
}

.editor-tool-group button {
  min-height: 38px;
  padding: 9px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  color: #111827;
  font-weight: 600;
}

.editor-tool-group button.active,
.editor-tool-group button:hover {
  border-color: #c4b5fd;
  background: #eff6ff;
}

.editor-tool-group label {
  display: grid;
  gap: 6px;
  color: #667085;
  font-size: 12px;
}

.editor-stage {
  min-width: 0;
  min-height: 0;
  padding: 16px;
  display: grid;
  place-items: center;
  background: #eef2f6;
}

.editor-canvas-wrap {
  position: relative;
  max-width: 100%;
  max-height: 580px;
  display: grid;
  place-items: center;
}

.editor-canvas-wrap img {
  max-width: 100%;
  max-height: 580px;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 16px 44px rgba(15, 23, 42, .16);
  pointer-events: none;
  user-select: none;
}

.editor-brush-hint {
  position: absolute;
  box-sizing: border-box;
  border: 2px solid rgba(236, 72, 153, 0.92);
  border-radius: 50%;
  display: grid;
  place-items: center;
  pointer-events: none;
  z-index: 4;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.9) inset,
    0 2px 10px rgba(15, 23, 42, 0.12);
}

.editor-brush-hint--select,
.editor-brush-hint--arrow,
.editor-brush-hint--text {
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.18);
}

.editor-brush-hint--select {
  border-color: rgba(37, 99, 235, 0.72);
}

.editor-brush-hint--select span {
  width: 18px;
  height: 18px;
  border: 2px dashed #2563eb;
  border-radius: 5px;
  background: rgba(37, 99, 235, 0.08);
}

.editor-brush-hint--arrow {
  border-color: rgba(225, 29, 72, 0.9);
  color: #e11d48;
}

.editor-brush-hint--arrow svg {
  width: 19px;
  height: 19px;
  transform: rotate(-38deg);
}

.editor-brush-hint--text {
  border-color: rgba(192, 38, 211, 0.9);
  color: #a21caf;
  font-size: 20px;
  font-weight: 850;
  line-height: 1;
}

.editor-canvas-wrap:not(.is-compare) #editor-mask[data-tool="brush"] {
  cursor: none;
}

.editor-canvas-wrap canvas {
  position: absolute;
  inset: 0;
  margin: auto;
  touch-action: none;
  cursor: crosshair;
}

/* Курсоры по типу инструмента (SVG hotspot ≈ центр иконки) */
.editor-canvas-wrap canvas[data-tool="cursor"] {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 28 28'%3E%3Cpath fill='%23e9d5ff' stroke='%237c3aed' stroke-width='1.3' d='M8 4l14 10-6 2 3 8-4 1-3-8-4 4z'/%3E%3C/svg%3E") 4 4, default;
}
.editor-canvas-wrap canvas[data-tool="select"] {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='30' height='30' viewBox='0 0 30 30'%3E%3Crect x='5' y='5' width='14' height='14' rx='2' fill='none' stroke='%23c4b5fd' stroke-width='2' stroke-dasharray='4 3'/%3E%3Ccircle cx='22' cy='20' r='3' fill='%23a78bfa'/%3E%3C/svg%3E") 6 6, crosshair;
}
.editor-canvas-wrap canvas[data-tool="arrow"] {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 28 28'%3E%3Cpath fill='%23fb7185' d='M5 18L16 7h6v6L11 24l-3-3 7-7z'/%3E%3C/svg%3E") 10 16, crosshair;
}
.editor-canvas-wrap canvas[data-tool="text"] {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='%23f0abfc' stroke-width='2' stroke-linecap='round' d='M7 5h10M12 5v16M9 21h6'/%3E%3C/svg%3E") 12 12, text;
}

.editor-before {
  position: absolute;
  inset: 0;
  margin: auto;
  max-width: 100%;
  max-height: 580px;
  width: auto;
  height: auto;
  object-fit: contain;
  object-position: left;
  z-index: 2;
  clip-path: inset(0 calc(100% - var(--compare, 50%)) 0 0);
  pointer-events: none;
}

.editor-canvas-wrap.is-compare canvas {
  pointer-events: none;
}

.editor-compare-handle {
  position: absolute;
  top: 50%;
  left: var(--compare, 50%);
  z-index: 5;
  width: 42px;
  height: 42px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .76);
  border-radius: 999px;
  background: rgba(15, 23, 42, .82);
  color: #fff;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .32);
  transform: translate(-50%, -50%);
  cursor: ew-resize;
}

.editor-compare-handle::before {
  content: "";
  position: absolute;
  top: -260px;
  bottom: -260px;
  left: 50%;
  width: 2px;
  background: rgba(255, 255, 255, .88);
  transform: translateX(-50%);
}

.editor-compare-handle span {
  position: relative;
  z-index: 1;
  width: 18px;
  height: 18px;
  border-left: 2px solid currentColor;
  border-right: 2px solid currentColor;
}

.editor-compare-handle span::before,
.editor-compare-handle span::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 7px;
  height: 7px;
  border-top: 2px solid currentColor;
  transform: translateY(-50%) rotate(-45deg);
}

.editor-compare-handle span::before {
  left: -7px;
  border-left: 2px solid currentColor;
}

.editor-compare-handle span::after {
  right: -7px;
  border-right: 2px solid currentColor;
  transform: translateY(-50%) rotate(45deg);
}

#editor-mask { z-index: 3; }

#editor-text-overlays {
  position: absolute;
  inset: 0;
  margin: auto;
  z-index: 4;
  pointer-events: none;
  width: 0;
  height: 0;
  overflow: visible;
  border-radius: 8px;
}

.editor-text-overlay {
  position: absolute;
  box-sizing: border-box;
  margin: 0;
  padding: 9px 12px;
  resize: none;
  border: none;
  border-radius: 6px;
  background: rgba(255, 250, 235, 0.92);
  color: #c1123f;
  font-weight: 600;
  font-family: inherit;
  line-height: 1.35;
  pointer-events: auto;
  box-shadow: inset 0 0 0 1px rgba(251, 191, 36, 0.35);
  caret-color: #9f1239;
}

.editor-text-overlay::placeholder {
  color: rgba(193, 18, 63, 0.45);
  font-weight: 500;
}

.editor-text-overlay:focus {
  outline: none;
  box-shadow: inset 0 0 0 2px rgba(37, 99, 235, 0.72), 0 0 0 3px rgba(37, 99, 235, 0.18);
  background: rgba(255, 253, 248, 0.97);
}

.editor-canvas-wrap.is-compare .editor-text-overlays {
  pointer-events: none;
  opacity: 0.85;
}

.editor-empty {
  max-width: 420px;
  display: grid;
  justify-items: center;
  gap: 12px;
  text-align: center;
  color: #667085;
}

.editor-empty svg {
  width: 42px;
  height: 42px;
  color: #2563eb;
}

.editor-empty h2 {
  margin: 0;
  color: #111827;
}

.editor-empty p {
  margin: 0;
  line-height: 1.5;
}

.editor-settings-card {
  padding: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
}

.editor-settings-card textarea {
  min-height: 160px;
  padding: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  resize: vertical;
  color: #111827;
  font: inherit;
}

.editor-download {
  text-decoration: none;
}

.editor-history {
  padding: 16px;
}

.editor-version-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
}

.editor-version-strip button:not(.editor-version-delete) {
  width: 128px;
  flex: 0 0 auto;
  padding: 8px;
  display: grid;
  gap: 6px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fbfcff;
  color: #111827;
  text-align: left;
}

.editor-version-strip button.active:not(.editor-version-delete) {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, .12);
}

.editor-version-strip img {
  width: 100%;
  height: 82px;
  object-fit: cover;
  border-radius: 6px;
  background: #f3f4f6;
}

.editor-version-strip span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 600;
}

.app--editor .main-shell {
  grid-template-columns: minmax(0, 1fr);
  background:
    radial-gradient(circle at 74% 18%, rgba(37, 99, 235, .12), transparent 30rem),
    linear-gradient(180deg, #0b111b 0%, #0a0f18 100%);
}

.app--editor .topbar {
  background: rgba(9, 14, 23, .88);
  border-bottom-color: rgba(148, 163, 184, .12);
}

.editor-breadcrumb {
  height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border: 1px solid rgba(148, 163, 184, .16);
  border-radius: 10px;
  background: rgba(15, 23, 42, .78);
  color: #dbe4f2;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04);
}

.editor-breadcrumb button {
  padding: 0;
  color: #f8fafc;
  background: transparent;
  font-weight: 500;
}

.editor-breadcrumb span {
  color: #7c8799;
}

.editor-breadcrumb strong {
  max-width: 340px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}

.app--editor .editor-page {
  min-height: calc(100vh - 64px);
  padding: 16px clamp(14px, 4vw, 28px) 24px;
  display: grid;
  gap: 16px;
  align-content: stretch;
  justify-items: stretch;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  background: transparent;
  color: #f8fafc;
}

.app--editor .editor-page--empty {
  min-height: calc(100vh - 64px);
  padding: 32px clamp(14px, 4vw, 28px) 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.editor-start {
  width: min(1040px, 100%);
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  display: grid;
  justify-items: center;
  gap: 18px;
}

.editor-upload-hero {
  width: min(760px, 100%);
  min-height: 390px;
  padding: 42px;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 16px;
  border: 1px dashed rgba(37, 99, 235, .32);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(15, 23, 42, .78), rgba(13, 20, 32, .72)),
    radial-gradient(circle at 50% 0%, rgba(37, 99, 235, .16), transparent 22rem);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .28);
  text-align: center;
}

.editor-upload-hero h1 {
  margin: 0;
  font-size: 34px;
  letter-spacing: 0;
}

.editor-upload-hero p {
  max-width: 560px;
  margin: 0;
  color: #9aa7bb;
  line-height: 1.55;
}

.editor-recent {
  width: min(920px, 100%);
  display: grid;
  gap: 12px;
}

.editor-start-panels {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.editor-start-panels .editor-recent {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  padding: 14px;
  border: 1px solid rgba(148, 163, 184, .12);
  border-radius: 14px;
  background: rgba(15, 23, 42, .45);
}

/* Одна панель (только «Старые редакции» или только «Мои изображения») — на всю ширину, иначе сетка миниатюр сжимается в половину main и чаще ломается. */
.editor-start-panels .editor-recent:only-child {
  grid-column: 1 / -1;
}

.editor-recent .section-head {
  flex-wrap: wrap;
  row-gap: 8px;
}

.editor-recent .section-head h2 {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #f8fafc;
}

.editor-recent > div:last-child {
  width: 100%;
  min-width: 0;
  display: grid;
  /* Жёсткий потолок ширины трека: иначе при 1–2 элементах 1fr растягивает карточку на всю панель. */
  grid-template-columns: repeat(auto-fill, minmax(min(96px, 100%), 132px));
  justify-content: start;
  gap: 10px;
  align-items: start;
}

.editor-recent button {
  min-width: 0;
  width: 100%;
  max-width: 132px;
  padding: 8px;
  display: grid;
  gap: 7px;
  border: 1px solid rgba(148, 163, 184, .14);
  border-radius: 10px;
  background: rgba(15, 23, 42, .72);
  color: #dbe4f2;
  text-align: left;
  overflow: hidden;
}

.editor-recent img,
.editor-recent-thumb {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  aspect-ratio: 1;
  height: auto;
  display: block;
  object-fit: contain;
  border-radius: 7px;
  background: #111827;
}

.editor-recent-thumb {
  background-image: var(--thumb);
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  overflow: hidden;
}

.editor-recent span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 600;
}

.app--editor .editor-workspace {
  width: 100%;
  min-height: calc(100vh - 112px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 16px;
  align-items: stretch;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

.app--editor .editor-tools,
.app--editor .editor-settings {
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(148, 163, 184, .14);
  border-radius: 12px;
  background: rgba(15, 23, 42, .72);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .22);
}

.app--editor .editor-tools {
  align-self: start;
  gap: 12px;
}

.app--editor .editor-tool-group {
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(148, 163, 184, .12);
}

.app--editor .editor-tool-group:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.app--editor .editor-tool-group span,
.app--editor .editor-settings-card h2 {
  color: #8f9db2;
  letter-spacing: 0;
}

.app--editor .editor-tool-group button {
  min-height: 40px;
  padding: 8px 9px;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  border-color: transparent;
  background: transparent;
  color: #dbe4f2;
  font-size: 13px;
  font-weight: 500;
  text-align: left;
}

.app--editor .editor-tool-group button svg {
  color: #b8c4d8;
}

.app--editor .editor-tool-group button.active,
.app--editor .editor-tool-group button:hover {
  border-color: rgba(37, 99, 235, .58);
  background: rgba(37, 99, 235, .14);
  color: #fff;
}

.app--editor .editor-stage {
  min-width: 0;
  min-height: 100%;
  padding: 0;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 12px;
  background: transparent;
}

.editor-markup-bar {
  width: min(100%, 760px);
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  min-height: 52px;
  padding: 8px 10px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid rgba(148, 163, 184, .18);
  border-radius: 10px;
  background: rgba(15, 23, 42, .9);
  box-shadow: 0 18px 44px rgba(0, 0, 0, .24);
}

.editor-markup-bar > div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.editor-markup-bar button {
  min-height: 40px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(51, 65, 85, 0.55), rgba(30, 41, 59, 0.72));
  color: #e8edf7;
  font-size: 13px;
  font-weight: 600;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, transform 0.1s ease;
}

.editor-markup-bar button svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.95;
}

.editor-markup-bar button .editor-tool-kbd {
  margin-left: 2px;
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 600;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.04em;
  background: rgba(15, 23, 42, 0.58);
  border: 1px solid rgba(148, 163, 184, 0.22);
  color: #c7d2fe;
  line-height: 1.2;
}

.editor-markup-bar button.active .editor-tool-kbd {
  background: rgba(37, 99, 235, 0.28);
  border-color: rgba(147, 197, 253, 0.40);
  color: #eef2ff;
}

.editor-markup-bar button.active,
.editor-markup-bar button:hover {
  background: linear-gradient(180deg, rgba(37, 99, 235, 0.24), rgba(37, 99, 235, 0.20));
  border-color: rgba(37, 99, 235, 0.64);
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.20), 0 10px 26px rgba(37, 99, 235, 0.16);
  color: #f8fafc;
}

.editor-markup-bar button.active {
  box-shadow: 0 0 0 1px rgba(147, 197, 253, 0.46), 0 12px 28px rgba(37, 99, 235, 0.20);
}

@media (max-width: 720px) {
  .editor-markup-bar button .editor-tool-kbd {
    display: none;
  }
}

.editor-markup-bar label {
  flex: 1 1 160px;
  min-width: 0;
  max-width: 100%;
  display: grid;
  gap: 4px;
  color: #9aa7bb;
  font-size: 12px;
}

.editor-markup-bar label strong {
  color: #dbe4f2;
}

.editor-markup-bar input {
  accent-color: #8b5cf6;
}

.app--editor .editor-canvas-wrap {
  max-width: 100%;
  max-height: min(58vh, 560px);
}

.editor-processing-overlay {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  border-radius: 6px;
  background: rgba(2, 6, 23, .72);
  color: #f8fafc;
  text-align: center;
  backdrop-filter: blur(3px);
}

.editor-processing-overlay span {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  animation: spin 1s linear infinite;
}

.editor-processing-overlay strong {
  font-size: 15px;
}

.editor-processing-overlay small {
  max-width: 240px;
  color: #cbd5e1;
  font-size: 12px;
  line-height: 1.4;
}

.app--editor .editor-canvas-wrap img {
  max-width: 100%;
  max-height: min(58vh, 560px);
  border-radius: 6px;
  background: #111827;
  box-shadow: 0 26px 70px rgba(0, 0, 0, .38);
}

.app--editor .editor-canvas-controls {
  min-height: 52px;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  margin-top: -18px;
  padding: 8px 10px;
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  position: relative;
  z-index: 4;
  border: 1px solid rgba(148, 163, 184, .18);
  border-radius: 10px;
  background: rgba(15, 23, 42, .9);
  box-shadow: 0 18px 44px rgba(0, 0, 0, .32);
}

.editor-canvas-controls button,
.editor-canvas-controls span {
  height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border-radius: 8px;
  background: rgba(30, 41, 59, .72);
  color: #dbe4f2;
}

.editor-canvas-controls button:disabled {
  opacity: .48;
  cursor: default;
}

.editor-canvas-controls .editor-nav-button {
  width: 38px;
  justify-content: center;
  padding: 0;
}

.editor-canvas-controls span button {
  width: 24px;
  height: 24px;
  padding: 0;
  justify-content: center;
  background: transparent;
}

.editor-canvas-controls strong {
  min-width: 44px;
  text-align: center;
  font-size: 13px;
}

.app--editor .editor-settings {
  align-self: start;
  position: sticky;
  top: 82px;
  max-height: calc(100vh - 104px);
  overflow: auto;
  z-index: 5;
}

.app--editor .editor-settings-card {
  padding: 0;
  border: 0;
  background: transparent;
}

.app--editor .editor-settings-card h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #f8fafc;
  font-size: 16px;
  text-transform: none;
}

.editor-side-title {
  display: grid;
  gap: 5px;
}

.editor-side-title strong {
  color: #f8fafc;
  font-size: 17px;
}

.editor-side-title span {
  color: #94a3b8;
  font-size: 12px;
  line-height: 1.4;
}

.editor-flow-note {
  padding: 11px 12px;
  display: grid;
  gap: 5px;
  border: 1px solid rgba(37, 99, 235, .24);
  border-radius: 10px;
  background: rgba(37, 99, 235, .14);
}

.editor-flow-note strong {
  color: #f8fafc;
  font-size: 13px;
}

.editor-flow-note span {
  color: #c7d2fe;
  font-size: 12px;
  line-height: 1.4;
}

.app--editor .editor-settings-card p:not(.editor-reference-hint) {
  margin: 0;
  color: #99a6bb;
  font-size: 13px;
  line-height: 1.5;
}

.app--editor .editor-settings-card textarea {
  min-height: 132px;
  border-color: rgba(148, 163, 184, .18);
  background: rgba(2, 6, 23, .36);
  color: #f8fafc;
}

.editor-brush-settings {
  padding: 12px;
  display: grid;
  gap: 12px;
  border: 1px solid rgba(148, 163, 184, .14);
  border-radius: 10px;
  background: rgba(2, 6, 23, .22);
}

.editor-output-settings {
  padding: 12px;
  border: 1px solid rgba(148, 163, 184, .14);
  border-radius: 10px;
  background: rgba(2, 6, 23, .18);
}

.editor-chat-format {
  display: flex;
  align-items: center;
}

.editor-chat-format label {
  width: min(260px, 100%);
  display: grid;
  gap: 8px;
  color: #f8fafc;
  font-size: 13px;
  font-weight: 600;
}

.editor-output-settings label,
.editor-brush-settings label {
  display: grid;
  gap: 8px;
  color: #9aa7bb;
  font-size: 13px;
}

.editor-brush-settings > strong {
  color: #f8fafc;
  font-size: 13px;
}

.editor-brush-settings label strong {
  color: #dbe4f2;
  float: right;
}

.editor-output-settings select,
.editor-chat-format select,
.editor-brush-settings input[type="text"] {
  width: 100%;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid rgba(148, 163, 184, .18);
  border-radius: 8px;
  background: rgba(2, 6, 23, .38);
  color: #f8fafc;
  outline: 0;
}

.editor-brush-settings input[type="range"] {
  accent-color: #8b5cf6;
}

.editor-quick-prompts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.editor-brush-settings button,
.editor-quick-prompts button {
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid rgba(148, 163, 184, .14);
  border-radius: 8px;
  background: rgba(30, 41, 59, .62);
  color: #dbe4f2;
  font-size: 13px;
}

.editor-brush-settings button.active {
  background: rgba(37, 99, 235, .20);
  border-color: rgba(37, 99, 235, .58);
}

.editor-regions,
.editor-reference-files {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}

.editor-regions > strong,
.editor-reference-files > strong {
  color: #f8fafc;
  font-size: 13px;
}

.editor-regions p,
.editor-reference-files > p:not(.editor-reference-hint) {
  margin: 0;
  color: #8f9db2;
  font-size: 12px;
  line-height: 1.4;
}

.editor-reference-hint {
  margin: 0;
  padding: 10px 11px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, .14);
  background: rgba(15, 23, 42, .5);
  color: #94a3b8;
  font-size: 12px;
  line-height: 1.45;
}

.app--editor .editor-settings ::selection {
  background: rgba(37, 99, 235, .32);
  color: #f8fafc;
}

.editor-region-card {
  min-height: 36px;
  padding: 5px 7px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) 24px;
  gap: 7px;
  align-items: center;
  border: 1px solid rgba(148, 163, 184, .14);
  border-left: 3px solid rgba(239, 23, 77, .76);
  border-radius: 8px;
  background: rgba(30, 41, 59, .62);
  cursor: pointer;
}

.editor-region-card.active {
  border-color: rgba(251, 191, 36, .8);
  box-shadow: inset 0 0 0 1px rgba(251, 191, 36, .18);
}

.editor-region-badge {
  min-height: 24px;
  padding: 0 8px;
  border: 0;
  border-radius: 6px;
  background: rgba(251, 191, 36, .14);
  color: #fbbf24;
  font-size: 12px;
  font-weight: 600;
}

.editor-region-delete {
  width: 24px;
  min-height: 24px;
  padding: 0;
  border-radius: 6px;
  background: transparent;
  color: #fecdd3;
  font-size: 18px;
  line-height: 1;
}

.app--editor .editor-region-card textarea {
  width: 100%;
  min-height: 24px;
  max-height: 28px;
  padding: 3px 0;
  border: 0;
  border-radius: 0;
  resize: none;
  background: transparent;
  color: #dbe4f2;
  outline: 0;
  font: inherit;
  font-size: 12px;
  line-height: 1.35;
  overflow: hidden;
}

.app--editor .editor-region-card textarea:focus {
  min-height: 64px;
  max-height: 96px;
  overflow: auto;
}

.editor-reference-files > label {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px dashed rgba(148, 163, 184, .28);
  border-radius: 8px;
  color: #dbe4f2;
  background: rgba(30, 41, 59, .42);
  cursor: pointer;
}

.editor-reference-files > div {
  display: grid;
  gap: 7px;
}

.editor-reference-files span {
  min-width: 0;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 30px;
  gap: 7px;
  align-items: center;
}

.editor-reference-files img {
  width: 42px;
  height: 34px;
  object-fit: contain;
  border-radius: 6px;
  background: rgba(2, 6, 23, .36);
}

.editor-reference-files small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #cbd5e1;
}

.editor-reference-files span button {
  width: 30px;
  min-height: 30px;
  padding: 0;
  justify-content: center;
}

.editor-settings-footer {
  display: grid;
  gap: 10px;
  margin-top: 4px;
}

.editor-footer-button {
  box-sizing: border-box;
  width: 100%;
  min-height: 44px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  font-family: inherit;
}

.editor-footer-button svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.editor-footer-button--reset {
  border-color: rgba(248, 113, 113, .38);
  background: rgba(69, 10, 10, .35);
  color: #fecdd3;
}

.editor-footer-button--reset:hover {
  background: rgba(127, 29, 29, .35);
  border-color: rgba(252, 165, 165, .5);
}

.editor-footer-button--download {
  border-color: rgba(37, 99, 235, .34);
  background: linear-gradient(135deg, rgba(37, 99, 235, .32), rgba(37, 99, 235, .18));
  color: #f8fafc;
}

.editor-footer-button--download:hover {
  border-color: rgba(37, 99, 235, .48);
  background: linear-gradient(135deg, rgba(37, 99, 235, .38), rgba(37, 99, 235, .22));
}

.editor-settings-card .editor-settings-footer .editor-footer-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
}

.app--editor .editor-settings-card .editor-settings-footer .editor-footer-button {
  justify-content: center;
  align-items: center;
}

.editor-chat-panel {
  width: min(100%, 760px);
  max-width: 100%;
  min-width: 0;
  margin-top: 2px;
  padding: 14px;
  display: grid;
  gap: 12px;
  box-sizing: border-box;
  border: 1px solid rgba(148, 163, 184, .16);
  border-radius: 10px;
  background: rgba(15, 23, 42, .78);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .22);
}

.editor-chat-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-width: 0;
}

.editor-chat-head strong {
  min-width: 0;
  flex: 1 1 140px;
  color: #f8fafc;
  font-size: 14px;
}

.editor-chat-head label {
  flex: 1 1 168px;
  min-width: 0;
  max-width: 100%;
  display: grid;
  gap: 6px;
  color: #9aa7bb;
  font-size: 12px;
  font-weight: 600;
}

.editor-chat-head select {
  width: 100%;
  min-height: 34px;
  padding: 0 9px;
  border: 1px solid rgba(148, 163, 184, .18);
  border-radius: 8px;
  background: rgba(2, 6, 23, .38);
  color: #f8fafc;
  outline: 0;
}

.editor-composer-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 46px;
  gap: 10px;
  align-items: stretch;
}

.editor-chat-panel textarea {
  min-height: 92px;
  max-height: 170px;
  padding: 12px 14px;
  border: 1px solid rgba(148, 163, 184, .14);
  border-radius: 8px;
  outline: 0;
  resize: vertical;
  background: rgba(2, 6, 23, .38);
  color: #f8fafc;
  font: inherit;
  line-height: 1.35;
}

.editor-chat-panel textarea::placeholder {
  color: #77849a;
}

.editor-composer-box button {
  width: 46px;
  min-height: 92px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  box-shadow: 0 12px 26px rgba(37, 99, 235, .18);
}

.editor-debug-button {
  min-height: 34px;
  width: fit-content;
  padding: 0 11px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid rgba(148, 163, 184, .18);
  border-radius: 8px;
  background: rgba(30, 41, 59, .52);
  color: #dbe4f2;
  font-size: 12px;
  font-weight: 600;
}

.editor-debug-button svg {
  width: 14px;
  height: 14px;
}

.editor-chat-panel button:disabled {
  opacity: .5;
  cursor: default;
}

.editor-chat-suggestions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.editor-chat-suggestions.hidden {
  display: none;
}

.editor-chat-suggestions button {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid rgba(148, 163, 184, .15);
  border-radius: 999px;
  background: rgba(30, 41, 59, .62);
  color: #dbe4f2;
  font-size: 12px;
}

.editor-chat-suggestions button:hover {
  border-color: rgba(37, 99, 235, .50);
  background: rgba(37, 99, 235, .14);
}

.app--editor .editor-history {
  width: 100%;
  padding: 14px 0 0;
  border: 0;
  border-top: 1px solid rgba(148, 163, 184, .12);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.editor-lower-panels {
  display: grid;
  gap: 16px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  grid-template-columns: minmax(0, 1fr);
}

.app--editor .editor-history--versions {
  padding-top: 0;
  border-top: 0;
}

.app--editor .editor-history--previous,
.app--editor .editor-history--sessions {
  padding-top: 0;
}

.app--editor .editor-history--versions .section-head,
.app--editor .editor-history--sessions .section-head,
.app--editor .editor-history--previous .section-head {
  margin-bottom: 10px;
}

.app--editor .editor-history .section-head h2 {
  color: #f8fafc;
  font-size: 15px;
}

.app--editor .editor-version-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  padding-bottom: 4px;
  box-sizing: border-box;
}

.editor-version-card,
.app--editor .editor-version-strip button:not(.editor-version-delete),
.editor-session-card,
.editor-session-grid button,
.editor-previous-grid button {
  min-width: 0;
  border-color: rgba(148, 163, 184, .14);
  background: rgba(15, 23, 42, .72);
  color: #dbe4f2;
  text-align: left;
}

.editor-version-card {
  position: relative;
  flex: 0 1 160px;
  width: auto;
  min-width: 0;
  max-width: min(160px, 100%);
  padding: 0;
  border: 1px solid rgba(148, 163, 184, .14);
  border-radius: 10px;
  overflow: hidden;
}

.app--editor .editor-version-strip .editor-version-card > button:first-child {
  width: 100%;
  min-width: 0;
  display: grid;
  gap: 6px;
  border: 0;
  background: transparent;
}

.app--editor .editor-version-strip .editor-version-card > button:first-child span {
  min-width: 0;
}

.editor-version-delete {
  position: absolute;
  top: 5px;
  right: 5px;
  z-index: 2;
  width: 22px;
  height: 22px;
  min-height: 22px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 1px solid rgba(248, 113, 113, .32);
  border-radius: 999px;
  background: rgba(15, 23, 42, .86);
  color: #fecdd3;
  font-size: 15px;
  line-height: 1;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s ease, background .15s ease, transform .15s ease;
}

.editor-version-card:hover .editor-version-delete,
.editor-version-card:focus-within .editor-version-delete {
  opacity: 1;
  pointer-events: auto;
}

.editor-version-delete:hover {
  background: rgba(220, 38, 38, .92);
  color: #fff;
  transform: scale(1.04);
}

.editor-version-card.active,
.editor-session-card.active {
  border-color: #2563eb;
  background: linear-gradient(180deg, rgba(37, 99, 235, .28), rgba(15, 23, 42, .86));
}

.app--editor .editor-version-strip img {
  height: 92px;
  background: #111827;
}

/* Редактор в той же светлой теме, что и остальные страницы */
.app--light.app--editor .main-shell {
  background: #f8fafc;
}

.app--light.app--editor .topbar {
  background: rgba(255, 255, 255, 0.92);
  border-bottom-color: #e5e7eb;
}

.app--light.app--editor .editor-page {
  background: #f8fafc;
  color: #111827;
}

.app--light.app--editor .editor-breadcrumb {
  background: #fff;
  border-color: #e5e7eb;
  color: #111827;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.app--light.app--editor .editor-breadcrumb button {
  color: #475467;
}

.app--light.app--editor .editor-breadcrumb span {
  color: #98a2b3;
}

.app--light.app--editor .editor-breadcrumb strong {
  color: #111827;
}

.app--light.app--editor .editor-upload-hero {
  background: #fff;
  border: 1px dashed #d0d5dd;
  box-shadow: 0 14px 42px rgba(15, 23, 42, 0.08);
}

.app--light.app--editor .editor-upload-hero h1 {
  color: #111827;
}

.app--light.app--editor .editor-upload-hero p {
  color: #667085;
}

.app--light.app--editor .editor-start-panels .editor-recent {
  background: #fff;
  border-color: #e5e7eb;
}

.app--light.app--editor .editor-recent .section-head h2 {
  color: #111827;
}

.app--light.app--editor .editor-recent button {
  background: #f8fafc;
  border-color: #e5e7eb;
  color: #111827;
}

.app--light.app--editor .editor-recent-thumb {
  background-color: #f3f4f6;
}

.app--light.app--editor .editor-workspace {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 14px 42px rgba(15, 23, 42, 0.045);
}

.app--light.app--editor .editor-tools,
.app--light.app--editor .editor-settings {
  background: #fbfcff;
  border-color: #e5e7eb;
  box-shadow: none;
}

.app--light.app--editor .editor-tool-group span,
.app--light.app--editor .editor-settings-card h2 {
  color: #667085;
}

.app--light.app--editor .editor-tool-group button {
  border-color: #e5e7eb;
  background: #fff;
  color: #111827;
}

.app--light.app--editor .editor-tool-group button svg {
  color: #475467;
}

.app--light.app--editor .editor-tool-group button.active,
.app--light.app--editor .editor-tool-group button:hover {
  border-color: #c4b5fd;
  background: #eff6ff;
  color: #111827;
}

.app--light.app--editor .editor-stage {
  background: #eef2f6;
  padding: 16px;
  border-radius: 8px;
}

.app--light.app--editor .editor-markup-bar {
  background: #fff;
  border-color: #e5e7eb;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.app--light.app--editor .editor-markup-bar button {
  background: #fff;
  border-color: #e5e7eb;
  color: #202839;
}

.app--light.app--editor .editor-markup-bar button .editor-tool-kbd {
  background: #f3f4f6;
  border-color: #e5e7eb;
  color: #475467;
}

.app--light.app--editor .editor-markup-bar button.active .editor-tool-kbd {
  background: rgba(37, 99, 235, 0.12);
  border-color: rgba(37, 99, 235, 0.40);
  color: #1d4ed8;
}

.app--light.app--editor .editor-markup-bar button.active,
.app--light.app--editor .editor-markup-bar button:hover {
  background: #eff6ff;
  border-color: #c4b5fd;
  color: #111827;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.16);
}

.app--light.app--editor .editor-markup-bar label {
  color: #667085;
}

.app--light.app--editor .editor-markup-bar label strong {
  color: #111827;
}

.app--light.app--editor .editor-canvas-wrap img {
  background: #fff;
  box-shadow: 0 16px 44px rgba(15, 23, 42, 0.12);
}

.app--light.app--editor .editor-canvas-controls {
  background: #fff;
  border-color: #e5e7eb;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
}

.app--light.app--editor .editor-canvas-controls button,
.app--light.app--editor .editor-canvas-controls span {
  background: #f3f4f6;
  color: #111827;
}

.app--light.app--editor .editor-settings-card {
  background: transparent;
}

.app--light.app--editor .editor-settings-card h2 {
  color: #111827;
}

.app--light.app--editor .editor-settings-card p:not(.editor-reference-hint) {
  color: #667085;
}

.app--light.app--editor .editor-settings-card textarea {
  border-color: #d0d5dd;
  background: #fff;
  color: #111827;
}

.app--light.app--editor .editor-side-title strong {
  color: #111827;
}

.app--light.app--editor .editor-side-title span {
  color: #667085;
}

.app--light.app--editor .editor-flow-note {
  border-color: rgba(37, 99, 235, 0.26);
  background: #eff6ff;
}

.app--light.app--editor .editor-flow-note strong {
  color: #111827;
}

.app--light.app--editor .editor-flow-note span {
  color: #1d4ed8;
}

.app--light.app--editor .editor-brush-settings {
  border-color: #e5e7eb;
  background: #fff;
}

.app--light.app--editor .editor-output-settings {
  border-color: #e5e7eb;
  background: #fff;
}

.app--light.app--editor .editor-brush-settings > strong,
.app--light.app--editor .editor-regions > strong,
.app--light.app--editor .editor-reference-files > strong {
  color: #111827;
}

.app--light.app--editor .editor-chat-format label {
  color: #111827;
}

.app--light.app--editor .editor-output-settings label,
.app--light.app--editor .editor-brush-settings label {
  color: #667085;
}

.app--light.app--editor .editor-brush-settings label strong {
  color: #111827;
}

.app--light.app--editor .editor-output-settings select,
.app--light.app--editor .editor-chat-format select,
.app--light.app--editor .editor-brush-settings input[type="text"] {
  border-color: #d0d5dd;
  background: #fff;
  color: #111827;
}

.app--light.app--editor .editor-brush-settings button,
.app--light.app--editor .editor-quick-prompts button {
  border-color: #e5e7eb;
  background: #fff;
  color: #111827;
}

.app--light.app--editor .editor-brush-settings button.active {
  background: #eff6ff;
  border-color: #c4b5fd;
}

.app--light.app--editor .editor-regions p,
.app--light.app--editor .editor-reference-files > p:not(.editor-reference-hint) {
  color: #667085;
}

.app--light.app--editor .editor-reference-hint {
  background: #f8fafc;
  border-color: #e5e7eb;
  color: #475467;
}

.app--light.app--editor .editor-region-card {
  background: #fff;
  border-color: #e5e7eb;
}

.app--light.app--editor .editor-region-delete {
  color: #dc2626;
}

.app--light.app--editor .editor-region-card textarea {
  color: #111827;
}

.app--light.app--editor .editor-reference-files > label {
  border-color: #d0d5dd;
  background: #f8fafc;
  color: #475467;
}

.app--light.app--editor .editor-reference-files img {
  background: #f3f4f6;
}

.app--light.app--editor .editor-reference-files small {
  color: #475467;
}

.app--light.app--editor .editor-footer-button--reset {
  border-color: #fecaca;
  background: #fef2f2;
  color: #b91c1c;
}

.app--light.app--editor .editor-footer-button--reset:hover {
  background: #fee2e2;
  border-color: #fca5a5;
}

.app--light.app--editor .editor-footer-button--download {
  color: #fff;
}

.app--light.app--editor .editor-chat-panel {
  background: #fff;
  border-color: #e5e7eb;
  box-shadow: 0 14px 42px rgba(15, 23, 42, 0.06);
}

.app--light.app--editor .editor-chat-head strong {
  color: #111827;
}

.app--light.app--editor .editor-chat-head label {
  color: #667085;
}

.app--light.app--editor .editor-chat-head select {
  border-color: #d0d5dd;
  background: #fff;
  color: #111827;
}

.app--light.app--editor .editor-chat-panel textarea {
  border-color: #e5e7eb;
  background: #fff;
  color: #111827;
}

.app--light.app--editor .editor-chat-panel textarea::placeholder {
  color: #98a2b3;
}

.app--light.app--editor .editor-debug-button {
  background: #f3f4f6;
  border-color: #e5e7eb;
  color: #475467;
}

.app--light.app--editor .editor-chat-suggestions button {
  background: #fff;
  border-color: #e5e7eb;
  color: #111827;
}

.app--light.app--editor .editor-chat-suggestions button:hover {
  background: #eff6ff;
  border-color: #c4b5fd;
}

.app--light.app--editor .editor-history {
  border-top-color: #e5e7eb;
}

.app--light.app--editor .editor-history .section-head h2 {
  color: #111827;
}

.app--light.app--editor .editor-version-card,
.app--light.app--editor .editor-version-strip button:not(.editor-version-delete) {
  border-color: #e5e7eb;
  background: #fff;
  color: #111827;
}

.app--light.app--editor .editor-version-card.active,
.app--light.app--editor .editor-session-card.active {
  border-color: #2563eb;
  background: linear-gradient(180deg, #eff6ff, #fff);
}

.app--light.app--editor .editor-version-strip img {
  background: #f3f4f6;
}

.app--light.app--editor .editor-version-delete {
  background: #fff;
  border-color: #fecaca;
  color: #b91c1c;
}

.app--light.app--editor ::selection {
  background: rgba(37, 99, 235, 0.18);
  color: #111827;
}

.editor-session-grid,
.editor-previous-grid {
  display: grid;
  gap: 10px;
}

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

.editor-previous-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  grid-auto-rows: minmax(0, auto);
}

.editor-session-card,
.editor-previous-grid button {
  padding: 8px;
  display: grid;
  gap: 7px;
  border: 1px solid rgba(148, 163, 184, .14);
  border-radius: 10px;
}

.editor-session-card {
  position: relative;
}

.editor-session-grid button {
  min-width: 0;
  padding: 0;
  display: grid;
  gap: 7px;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

.editor-session-delete {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .3);
  border-radius: 7px;
  background: rgba(15, 23, 42, .78);
  color: #fecdd3;
  font-size: 18px;
  line-height: 1;
}

.editor-session-grid img,
.editor-previous-grid img {
  width: 100%;
  aspect-ratio: 1;
  height: auto;
  object-fit: contain;
  border-radius: 7px;
  background: #111827;
}

.editor-session-grid span,
.editor-previous-grid span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 600;
}

.projects-page {
  min-height: 100vh;
  padding: 24px;
  display: grid;
  gap: 18px;
  align-content: start;
  background: #f8fafc;
}

.projects-head,
.projects-workspace {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 14px 42px rgba(15, 23, 42, .045);
}

.projects-head {
  padding: 24px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.projects-head h1 {
  margin: 12px 0 8px;
  color: #111827;
  font-size: 28px;
}

.projects-head p {
  max-width: 760px;
  margin: 0;
  color: #667085;
  line-height: 1.5;
}

.projects-head-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.projects-workspace {
  min-height: 520px;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  overflow: hidden;
}

.project-folders {
  padding: 14px;
  display: grid;
  align-content: start;
  gap: 8px;
  border-right: 1px solid #e5e7eb;
  background: #fbfcff;
}

.project-folder-create {
  margin-bottom: 8px;
  padding: 10px;
  display: grid;
  gap: 8px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
}

.project-folder-create label {
  display: grid;
  gap: 6px;
  color: #667085;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.project-folder-create input {
  width: 100%;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fbfcff;
  color: #111827;
  font-size: 13px;
  font-weight: 600;
  text-transform: none;
}

.project-folder-create button {
  width: 100%;
  justify-content: center;
}

.project-folders p {
  margin: 4px 2px;
  color: #667085;
  font-size: 13px;
}

.project-folders__title {
  margin-top: 8px;
  color: #667085;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.project-folder-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px;
}

.project-folder-row > button:first-child {
  min-width: 0;
  padding: 10px;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #111827;
  text-align: left;
}

.project-folder-row.active > button:first-child,
.project-folder-row > button:first-child:hover {
  border-color: #bfdbfe;
  background: #eff6ff;
}

.project-folder-row.drag-over > button:first-child {
  border-color: #2563eb;
  background: #dbeafe;
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, .18);
}

.project-folder-row svg {
  width: 17px;
  height: 17px;
}

.project-folder-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-folder-row small {
  color: #667085;
  font-weight: 600;
}

.project-folder-remove {
  width: 36px;
  height: 36px;
  border: 1px solid #fee2e2;
  border-radius: 8px;
  background: #fff;
  color: #b42318;
}

.projects-list-panel {
  padding: 14px;
}

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

.project-list-card {
  min-width: 0;
  padding: 10px 12px 10px 10px;
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) minmax(128px, auto);
  gap: 12px;
  align-items: center;
  border: 1px solid #eef2f6;
  border-radius: 8px;
  background: #fff;
}

.project-list-card:hover {
  border-color: #c4b5fd;
  box-shadow: 0 12px 28px rgba(105, 65, 198, .10);
}

.project-list-card[draggable="true"] {
  cursor: grab;
}

.project-list-card.dragging {
  opacity: .58;
  border-color: #2563eb;
  cursor: grabbing;
}

.project-list-cover {
  width: 100%;
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  border-radius: 7px;
  overflow: hidden;
  background: #f3f4f6;
}

.project-list-cover img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.project-list-info {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.project-list-title {
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #111827;
  font-size: 15px;
  font-weight: 600;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-list-summary {
  margin: 0;
  color: #4b5563;
  font-size: 13px;
  line-height: 1.4;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.project-list-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.project-list-badges span,
.project-folder-link {
  min-height: 23px;
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  background: #f8fafc;
  color: #344054;
  font-size: 11px;
  font-weight: 600;
}

.project-folder-link {
  color: #2563eb;
  cursor: pointer;
}

.project-folder-link:hover {
  border-color: rgba(37, 99, 235, .32);
  background: #eff6ff;
}

.project-list-actions {
  display: flex;
  min-width: 0;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}

.project-list-actions .secondary-action {
  flex: 1;
  justify-content: center;
}

.profile-page {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 100vh;
  padding: 24px;
  display: grid;
  gap: 18px;
  align-content: start;
  background: #f8fafc;
}

.profile-hero,
.profile-metrics,
.profile-section-card {
  min-width: 0;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 14px 42px rgba(15, 23, 42, .045);
}

.profile-hero {
  padding: 24px;
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
}

.profile-avatar {
  width: 76px;
  height: 76px;
  border-color: rgba(37, 99, 235, .22);
}

.profile-avatar::before {
  font-size: 24px;
}

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

.profile-hero h1 {
  margin: 12px 0 8px;
  color: #111827;
  font-size: 30px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.profile-hero p {
  max-width: 760px;
  margin: 0;
  color: #667085;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.profile-public-link {
  margin-top: 10px !important;
}

.profile-public-link a {
  font-weight: 600;
  color: #2563eb;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.profile-public-link a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.profile-settings-form {
  padding: 18px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 14px 42px rgba(15, 23, 42, .045);
}

.profile-settings-form label {
  min-width: 0;
  display: grid;
  gap: 7px;
  color: #344054;
  font-size: 13px;
  font-weight: 700;
}

.profile-settings-form label:has(textarea),
.profile-settings-actions {
  grid-column: 1 / -1;
}

.profile-settings-form input,
.profile-settings-form textarea {
  width: 100%;
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  background: #fff;
  color: #111827;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
}

.profile-settings-form textarea {
  resize: vertical;
  line-height: 1.5;
}

.profile-slug-field {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  background: #f8fafc;
  overflow: hidden;
}

.profile-slug-field span {
  padding-left: 12px;
  color: #667085;
  font-size: 14px;
  font-weight: 600;
}

.profile-slug-field input {
  border: 0;
  border-radius: 0;
  background: #fff;
}

.profile-settings-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

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

.profile-metrics article {
  padding: 14px;
  display: grid;
  gap: 3px;
  border-radius: 8px;
  background: #f8fafc;
  min-width: 0;
}

.profile-metrics span,
.profile-metrics small {
  color: #667085;
  font-size: 12px;
  font-weight: 600;
}

.profile-metrics strong {
  color: #111827;
  font-size: 28px;
  line-height: 1.1;
}

.profile-metrics .profile-metric-email strong {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.profile-balance-card {
  padding: 18px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
}

.profile-balance-card h2 {
  margin-top: 10px;
  margin-bottom: 6px;
}

.profile-balance-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

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

.profile-section-card {
  padding: 18px;
  display: grid;
  gap: 12px;
  align-content: start;
}

.profile-section-card > div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.profile-section-card > div span {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #2563eb;
  background: #eff6ff;
}

.profile-section-card h2,
.profile-section-card p {
  margin: 0;
}

.profile-section-card h2 {
  color: #111827;
  font-size: 18px;
}

.profile-section-card p {
  color: #667085;
  line-height: 1.45;
}

.profile-section-card ul {
  margin: 0;
  padding: 0;
  display: grid;
  gap: 7px;
  list-style: none;
}

.profile-section-card li {
  padding: 8px 10px;
  border-radius: 7px;
  color: #344054;
  background: #f8fafc;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.profile-section-card .secondary-action {
  width: fit-content;
  margin-top: 2px;
}

.profile-detail-card {
  padding: 18px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
}

.profile-detail-card article {
  padding: 14px;
  display: grid;
  gap: 6px;
  border-radius: 8px;
  background: #f8fafc;
}

.profile-detail-card span {
  color: #667085;
  font-size: 12px;
  font-weight: 600;
}

.profile-detail-card strong {
  color: #111827;
  overflow-wrap: anywhere;
}

.template-form {
  padding: 18px;
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(320px, 1.05fr) 320px;
  gap: 18px;
}

.template-simple-form {
  padding: 18px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 14px 42px rgba(15, 23, 42, .045);
}

.template-column,
.template-preview-panel,
.template-steps {
  display: grid;
  gap: 14px;
  align-content: start;
}

.template-column,
.template-preview-panel {
  min-width: 0;
  padding: 14px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fbfcff;
}

.template-column h2,
.template-preview-panel h2 {
  margin: 0;
  color: #111827;
  font-size: 18px;
}

.template-basics-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid #dbe3ef;
  border-radius: 12px;
  background: #f7f8fb;
}

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

.template-basics-head > span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(37, 99, 235, .22);
  border-radius: 999px;
  color: var(--ui-accent);
  background: #eff6ff;
  font-size: 14px;
  font-weight: 500;
}

.template-basics-head h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
}

.template-basics-head p {
  margin: 5px 0 0;
  color: #667085;
  font-size: 13px;
  line-height: 1.45;
}

.field-label--primary input {
  min-height: 48px;
  font-size: 16px;
}

.template-settings-strip {
  display: grid;
  grid-template-columns: .78fr 1.15fr 1.15fr;
  gap: 10px;
}

.template-extra-settings {
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  background: #fff;
}

.template-extra-settings summary {
  min-height: 44px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #344054;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  list-style: none;
}

.template-extra-settings summary::-webkit-details-marker {
  display: none;
}

.template-extra-settings summary::after {
  content: "+";
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  color: var(--ui-accent);
  background: var(--ui-accent-soft);
  font-size: 16px;
  line-height: 1;
}

.template-extra-settings[open] summary::after {
  content: "-";
}

.template-extra-settings__body {
  display: grid;
  gap: 12px;
  padding: 0 12px 12px;
}

.template-head-actions,
.template-block-head,
.template-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.template-head-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.template-save-status {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  color: #667085;
  font-size: 12px;
}

.template-block-head h3,
.template-preview-panel h3,
.template-variable-panel strong {
  margin: 0;
  color: #111827;
  font-size: 14px;
}

.template-block-head p {
  margin: 4px 0 0;
  color: #667085;
  font-size: 12px;
  line-height: 1.4;
}

.field-label input {
  width: 100%;
  height: 40px;
  padding: 0 11px;
  border: 1px solid #d0d5dd;
  border-radius: 7px;
  color: #111827;
  background: #fff;
  font-weight: 500;
  outline: none;
}

.template-grid-2,
.template-grid-3,
.template-field-grid {
  display: grid;
  gap: 10px;
}

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

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

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

.template-actions {
  grid-column: 1 / -1;
}

.field-label .template-main-prompt {
  min-height: 210px;
  font-size: 15px;
}

.field-label .template-user-task {
  min-height: 96px;
}

.template-improve-button {
  justify-self: start;
}

.template-improve-button:disabled {
  opacity: .65;
  cursor: wait;
}

.template-workflow-mode {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
}

.template-workflow-mode p {
  margin: 0;
  color: #667085;
  font-size: 13px;
  line-height: 1.45;
}

.template-file-picker {
  position: relative;
  display: inline-block;
}

.template-file-picker input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.template-file-picker span {
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  border: 1px solid #bfdbfe;
  border-radius: 7px;
  color: #2563eb;
  background: #fff;
  font-weight: 600;
}

.template-file-picker svg {
  width: 17px;
  height: 17px;
}

.template-reference-preview {
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
}

.template-reference-preview img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 7px;
  background: #eef2f6;
}

.template-reference-preview p {
  margin: 0;
  color: #667085;
  font-size: 12px;
  line-height: 1.45;
}

.template-upload-zone {
  min-height: 168px;
  display: grid;
  place-items: center;
  gap: 8px;
  padding: 18px;
  border: 1px dashed #b8a6ff;
  border-radius: 8px;
  color: #2563eb;
  background: #fbfaff;
  text-align: center;
  cursor: pointer;
}

.template-upload-zone input {
  display: none;
}

.template-upload-zone svg {
  width: 28px;
  height: 28px;
}

.template-upload-zone strong {
  color: #111827;
}

.template-upload-zone span {
  max-width: 260px;
  color: #667085;
  font-size: 12px;
  line-height: 1.45;
}

.template-reference-list,
.template-step-example-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.template-reference-list p,
.template-step-example-list p {
  grid-column: 1 / -1;
  margin: 0;
  color: #667085;
  font-size: 12px;
}

.template-reference-list span,
.template-step-example-list span {
  position: relative;
  min-width: 0;
  display: grid;
  gap: 5px;
}

.template-reference-list .icon-button,
.template-step-example-list .icon-button {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 28px;
  height: 28px;
  background: rgba(255, 255, 255, .92);
}

.template-reference-list img,
.template-step-example-list img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 7px;
  background: #eef2f6;
}

.template-reference-list small,
.template-step-example-list small {
  overflow: hidden;
  color: #667085;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.template-step-examples {
  display: grid;
  gap: 8px;
}

.template-series {
  display: grid;
  gap: 12px;
}

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

.template-fields {
  display: grid;
  gap: 10px;
}

.template-fields .section-head {
  margin-bottom: 0;
}

.template-fields .section-head > div {
  display: grid;
  gap: 4px;
}

.template-fields .section-head span {
  color: #667085;
  font-size: 13px;
}

.template-field-row {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 34px;
  gap: 10px;
  align-items: start;
  padding: 10px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
}

.template-field-row > span,
.template-step-row > span {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #2563eb;
  background: #eff6ff;
  font-weight: 600;
}

.template-required {
  grid-column: 2;
  grid-row: 2;
  display: flex;
  align-items: center;
  gap: 7px;
  color: #475467;
  font-size: 12px;
  white-space: nowrap;
}

.template-field-row .icon-button {
  grid-column: 3;
  grid-row: 1;
}

.template-required input,
.template-step-row label input {
  width: auto;
  height: auto;
}

.icon-button {
  width: 34px;
  height: 34px;
  border: 1px solid #e5e7eb;
  border-radius: 7px;
  background: #fff;
  color: #475467;
  display: grid;
  place-items: center;
}

.icon-button svg { width: 16px; height: 16px; }

.template-step-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 10px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
}

.template-step-fields {
  display: grid;
  gap: 10px;
}

.template-step-actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.template-field-row input,
.template-field-row select,
.template-step-row input,
.template-step-row select,
.template-step-row textarea {
  width: 100%;
  border: 1px solid #d0d5dd;
  border-radius: 7px;
  color: #111827;
  background: #fff;
  outline: none;
}

.template-field-row input,
.template-field-row select,
.template-step-row input {
  height: 38px;
  padding: 0 10px;
}

.template-step-row select { height: 38px; padding: 0 8px; }

.template-step-row textarea {
  min-height: 70px;
  padding: 9px 10px;
  resize: vertical;
}

.template-step-row label {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  color: #475467;
  font-size: 12px;
}

.template-rewards-box {
  margin-top: 16px;
  padding: 14px;
  display: grid;
  gap: 12px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
}

.template-rewards-box h3 {
  margin: 0;
  color: #111827;
  font-size: 16px;
}

.template-rewards-box p {
  margin: 0;
  color: #667085;
  font-size: 13px;
  line-height: 1.45;
}

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

.template-mini-title {
  margin: 0 0 -6px;
  color: #475467;
  font-size: 13px;
  font-weight: 700;
}

.template-advanced {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  padding: 10px;
}

.template-advanced summary {
  cursor: pointer;
  color: #111827;
  font-weight: 600;
}

.template-advanced[open] {
  display: grid;
  gap: 12px;
}

.template-variable-panel,
.template-preview-form,
.template-prompt-preview,
.template-example-slots {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
}

#template-variable-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

#template-variable-chips span {
  padding: 5px 8px;
  border-radius: 999px;
  color: #175cd3;
  background: #eff8ff;
  font-size: 12px;
  font-weight: 600;
}

#template-variable-chips span.missing {
  color: #b42318;
  background: #fef3f2;
}

#template-variable-chips em {
  color: #667085;
  font-size: 12px;
  font-style: normal;
}

.template-preview-card {
  overflow: hidden;
  display: grid;
  gap: 8px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  padding: 10px;
}

.template-preview-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 7px;
  background: #eef2f6;
}

.template-preview-card strong {
  color: #111827;
  font-size: 15px;
}

.template-preview-card span,
.template-prompt-preview p {
  color: #667085;
  font-size: 12px;
  line-height: 1.45;
}

.template-preview-form label {
  display: grid;
  gap: 5px;
  color: #475467;
  font-size: 12px;
}

.template-preview-form input {
  width: 100%;
  height: 34px;
  border: 1px solid #d0d5dd;
  border-radius: 7px;
  background: #f9fafb;
  padding: 0 9px;
}

.template-example-slots > div {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.template-example-slots span {
  aspect-ratio: 1;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
}

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

@media (max-width: 1280px) {
  .app { grid-template-columns: 230px minmax(0, 1fr); }
  .main-shell { grid-template-columns: minmax(0, 1fr); }
  .recent-panel { display: none; }
  .type-grid, .template-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .type-grid--featured { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .workspace-page { grid-template-columns: 300px minmax(0, 1fr); }
  .chat-workspace { grid-template-columns: minmax(0, 1fr) 300px; }
  .chat-side { grid-column: auto; grid-template-columns: 1fr; }
  .tools-panel { grid-column: 1 / -1; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .template-form { grid-template-columns: minmax(0, 1fr) 300px; }
  .template-simple-form { grid-template-columns: minmax(0, 1fr) 300px; }
  .template-preview-panel { grid-column: 2; grid-row: 1 / span 2; }
  .template-actions { grid-column: 1 / -1; }
  .template-field-grid,
  .template-grid-3 { grid-template-columns: 1fr; }
  .template-step-row { grid-template-columns: 30px minmax(0, 1fr) 82px; }
  .template-step-row textarea,
  .template-step-row label {
    grid-column: 2 / -1;
  }
  .editor-session-grid,
  .editor-previous-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .editor-start-panels {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  .app,
  .app--light,
  .app--editor {
    display: block;
    min-height: 100vh;
    background: #f8fafc;
  }

  .mobile-placeholder { display: none; }
  .app, .app--light { display: block; }

  .pricing-hero,
  .profile-balance-card {
    grid-template-columns: 1fr;
  }

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

  .sidebar {
    position: fixed;
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    height: auto;
    min-height: 0;
    padding: 8px;
    display: block;
    border-right: 0;
    border-top: 1px solid rgba(148, 163, 184, .22);
    background: rgba(10, 15, 24, .96);
    overflow: hidden;
  }

  .sidebar-head,
  .create-button,
  .history-block,
  .sidebar-spacer,
  .pro-card,
  .user-card {
    display: none;
  }

  .main-nav {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(72px, 1fr);
    overflow-x: auto;
    gap: 4px;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
  }

  .nav-title { display: none; }

  .nav-item {
    min-height: 52px;
    padding: 6px 4px;
    display: grid;
    justify-items: center;
    gap: 4px;
    border-radius: 8px;
    font-size: 11px;
    line-height: 1.1;
    text-align: center;
  }

  .nav-item svg {
    width: 18px;
    height: 18px;
  }

  .main-shell {
    display: block;
    min-height: 100vh;
    padding-bottom: 96px;
    overflow-x: hidden;
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    height: auto;
    min-height: 58px;
    padding: 10px 12px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    flex-wrap: nowrap;
    background: rgba(255, 255, 255, .94);
    backdrop-filter: blur(14px);
    overflow: hidden;
  }

  .top-tabs {
    display: none;
  }

  .top-tools {
    width: auto;
    min-width: 0;
    justify-content: flex-end;
    gap: 8px;
  }

  .credits {
    min-height: 38px;
    max-width: 150px;
    padding: 0 10px;
    font-size: 14px;
    white-space: nowrap;
  }

  .account-menu-wrap,
  .avatar-button {
    flex: 0 0 auto;
  }

  .account-menu {
    position: fixed;
    top: 62px;
    right: 12px;
    width: min(292px, calc(100vw - 24px));
  }

  .editor-breadcrumb {
    min-width: 0;
    width: 100%;
    padding: 0 10px;
    gap: 7px;
  }

  .editor-breadcrumb button,
  .editor-breadcrumb strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .round-button {
    display: none;
  }

  .home-page, .workspace-page { padding: 14px 14px 104px; display: grid; grid-template-columns: 1fr; }
  .home-page {
    color: #111827;
    background: #f8fafc;
  }
  .marketplace-hero,
  .generation-hero,
  .home-paths,
  .marketplace-summary,
  .creator-flow,
  .bonus-explainer {
    grid-template-columns: 1fr;
  }
  .generation-hero {
    padding: 36px 0;
  }
  .marketplace-stats,
  .billing-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .home-scenarios--inline {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .home-start {
    padding: 18px;
  }
  .home-start__head h1 {
    font-size: 28px;
  }
  .home-start__body {
    grid-template-columns: 1fr;
  }
  .home-create-panel {
    order: -1;
  }
  .home-scenarios {
    grid-template-columns: 1fr 1fr;
  }
  .home-scenario {
    grid-template-columns: 1fr;
    align-content: start;
  }
  .home-scenario__image {
    width: 100%;
    height: 86px;
  }
  .chat-workspace { padding: 16px 16px 104px; display: grid; grid-template-columns: 1fr; }
  .chat-side {
    order: 1;
    grid-template-columns: 1fr;
  }
  .chat-panel {
    order: 2;
    min-height: auto;
    display: flex;
    flex-direction: column;
  }
  .chat-head {
    min-height: 0;
    padding: 12px 14px;
  }
  .chat-head h1 {
    margin-top: 4px;
    font-size: 20px;
    line-height: 1.2;
  }
  .chat-head p {
    display: none;
  }
  .chat-messages {
    padding: 10px;
    display: flex;
    gap: 10px;
  }
  .chat-composer {
    order: 20;
    margin-top: 4px;
    padding: 10px;
    gap: 8px;
    position: sticky;
    bottom: 72px;
  }
  .chat-composer--empty {
    padding: 10px;
  }
  .composer-line {
    order: 1;
  }
  .composer-attachments {
    order: 2;
    margin: 0;
  }
  .composer-settings-bar {
    order: 3;
    gap: 8px;
  }
  .composer-upload-callout {
    display: none;
  }
  .composer-lead {
    display: none;
  }
  .hero-panel {
    padding: 22px 16px;
    background: #fff;
    border-color: #e5e7eb;
    box-shadow: 0 12px 32px rgba(15, 23, 42, .06);
  }
  .hero-glow { display: none; }
  .home-kicker {
    color: #2563eb;
    background: #eff6ff;
  }
  .hero-panel h1 {
    color: #111827;
    font-size: 30px;
  }
  .hero-panel p {
    color: #475467;
  }
  .prompt-bar {
    border-color: #e5e7eb;
    background: #fff;
    box-shadow: none;
  }
  .prompt-bar textarea {
    color: #111827;
  }
  .prompt-bar textarea::placeholder {
    color: #98a2b3;
  }
  .prompt-bar > div {
    border-top-color: #eef2f6;
  }
  .tool-button {
    color: #344054;
    background: #f2f4f7;
  }
  .prompt-bar > div { align-items: stretch; }
  .prompt-bar .generate-button,
  .home-prompt-bar .generate-button {
    min-width: 0;
  }
  .type-grid,
  .type-grid--featured,
  .type-grid--secondary,
  .template-row,
  .generated-grid,
  .prompt-ideas > div { grid-template-columns: 1fr 1fr; }
  .type-card__image { height: 132px; }
  .type-grid--secondary .type-card__image { height: 112px; }
  .type-card__body { padding: 11px 12px 12px; }
  .type-card,
  .template-card {
    background: #fff;
    border-color: #e5e7eb;
  }
  .type-card strong {
    color: #111827;
  }
  .type-card small,
  .template-card span {
    color: #667085;
  }
  .selected-card { grid-template-columns: 1fr; }
  .selected-file { grid-template-columns: 72px minmax(0, 1fr) repeat(2, 38px); }
  .tools-panel { grid-template-columns: 1fr; }
  .template-builder-page { padding: 16px; }
  .template-builder-head,
  .templates-head,
  .projects-head,
  .editor-head { display: grid; }
  .template-head-actions {
    width: 100%;
    min-width: 0;
    justify-content: stretch;
  }
  .template-head-actions .secondary-action,
  .template-head-actions .generate-button {
    width: 100%;
    min-width: 0;
    justify-content: center;
    white-space: normal;
  }
  .projects-workspace { grid-template-columns: 1fr; }
  .app--editor .editor-workspace { grid-template-columns: minmax(0, 1fr) 300px; gap: 12px; }
  .editor-session-grid,
  .editor-previous-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .editor-tools,
  .editor-settings { border: 0; border-bottom: 1px solid #e5e7eb; }
  .editor-canvas-wrap,
  .editor-canvas-wrap img { max-height: 460px; }
  .project-folders { border-right: 0; border-bottom: 1px solid #e5e7eb; }
  .project-list-card { grid-template-columns: minmax(0, 1fr); }
  .project-list-actions { grid-column: auto; justify-content: space-between; }
  .template-form,
  .template-simple-form { grid-template-columns: 1fr; }
  .template-preview-panel { grid-column: auto; grid-row: auto; }
  .template-public-hero { grid-template-columns: 1fr; }
  .template-public-page,
  .templates-page,
  .projects-page,
  .profile-page,
  .feed-page,
  .images-page { padding: 14px 14px 104px; }
  .generation-panel {
    padding: 12px;
    gap: 10px;
  }
  .generation-panel__head {
    gap: 4px;
  }
  .generation-panel__head h2 {
    font-size: 16px;
  }
  .generation-panel__hint {
    font-size: 12px;
  }
  .generation-panel .prompt-bar textarea,
  .home-prompt-bar textarea {
    min-height: 210px;
    font-size: 16px;
  }
  .home-dropzone {
    min-height: 0;
    padding: 8px 10px;
  }
  .home-dropzone__hint {
    gap: 8px;
  }
  .home-dropzone__hint small {
    display: none;
  }
  .home-file-chips {
    grid-template-columns: 1fr;
  }
  .composer-settings-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .composer-controls {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    flex: none;
  }
  .composer-controls label {
    min-width: 0;
    max-width: none;
    gap: 4px;
    font-size: 11px;
  }
  .composer-controls select {
    height: 34px;
    min-width: 0;
    padding-right: 26px;
    font-size: 12px;
  }
  .composer-prompt-tools {
    width: 100%;
    justify-content: stretch;
    gap: 8px;
  }
  .composer-prompt-tools .tool-button {
    flex: 1 1 0;
    min-width: 0;
    justify-content: center;
    white-space: normal;
  }
  .chat-composer textarea {
    font-size: 16px;
  }
  .chat-composer--empty textarea {
    min-height: 132px;
  }
  .chat-composer--empty .generation-start-form textarea {
    min-height: 210px;
  }
  .chat-composer--empty .composer-line {
    min-height: 150px;
  }
  .editor-chat-panel {
    width: 100%;
    padding: 12px;
    gap: 10px;
  }
  .editor-chat-head {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .editor-chat-head strong {
    flex: none;
  }
  .editor-chat-head label {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    flex: none;
    font-size: 12px;
  }
  .editor-chat-head select {
    min-height: 34px;
  }
  .editor-composer-box {
    grid-template-columns: minmax(0, 1fr) 44px;
  }
  .editor-chat-panel textarea {
    min-height: 150px;
    max-height: 260px;
    font-size: 16px;
  }
  .editor-composer-box button {
    width: 44px;
    min-height: 150px;
  }
  .profile-hero {
    grid-template-columns: 58px minmax(0, 1fr);
  }
  .profile-hero .generate-button,
  .profile-hero > button,
  .profile-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .profile-actions .generate-button,
  .profile-actions .secondary-action {
    max-width: 100%;
    min-width: 0;
    white-space: normal;
  }
  .profile-metrics,
  .profile-sections,
  .profile-detail-card,
  .profile-following-authors,
  .profile-following-grid {
    grid-template-columns: 1fr;
  }
  .templates-page__top {
    display: grid;
    gap: 12px;
  }
  .templates-page__top .generate-button {
    width: 100%;
    justify-content: center;
  }
  .public-profile-page {
    padding: 14px;
    padding-bottom: 88px;
  }
  .app--light:not(.app--public-guest) .main-shell > main.public-profile-page.public-profile-page--mock {
    padding: 0 0 88px;
  }
  .public-post-page {
    padding: 14px;
    padding-bottom: 88px;
  }
  .public-post-card {
    grid-template-columns: 1fr;
  }
  .public-post-card figure img {
    max-height: 64vh;
  }
  .public-profile-layout {
    grid-template-columns: 1fr;
  }
  .public-profile-aside {
    position: static;
    order: 1;
  }
  .public-profile-primary {
    order: 0;
  }
  .public-profile-hero-content {
    padding: 22px 16px 24px;
    padding-top: 44px;
    flex-direction: column;
    align-items: stretch;
  }
  .public-profile-hero-actions {
    flex: 1 1 auto;
    width: 100%;
    justify-content: flex-start;
  }
  .public-profile-metrics.public-profile-metrics--mock {
    padding: 16px 14px;
    overflow-x: auto;
    grid-template-columns: repeat(5, minmax(112px, 1fr));
    -webkit-overflow-scrolling: touch;
  }
  .public-profile-filter-mock {
    font-size: 12px;
    padding: 9px 11px;
  }
  .public-profile-page--mock .public-profile-hero--mock,
  .public-profile-page--mock .public-profile-metrics--mock,
  .public-profile-page--mock .public-profile-tabs--mock,
  .public-profile-page--mock .public-profile-layout--mock {
    padding-left: 14px;
    padding-right: 14px;
  }
  .public-profile-main {
    grid-template-columns: 80px minmax(0, 1fr);
    gap: 14px 16px;
    padding: 0;
    align-items: start;
  }
  .public-profile-hero--mock.public-profile-hero--compact .public-profile-main {
    grid-template-columns: 1fr;
    justify-items: center;
  }
  .public-profile-avatar {
    width: 80px;
    height: 80px;
    margin-top: -36px;
    border-radius: 18px;
  }
  .public-profile-avatar img,
  .public-profile-avatar .avatar {
    border-radius: 14px;
  }
  .public-profile-avatar .avatar::before {
    font-size: 26px;
  }
  .public-profile-copy {
    padding-top: 10px;
  }
  .public-profile-title-row h1 {
    font-size: 22px;
  }
  .public-profile-copy h2 {
    font-size: 14px;
  }
  .public-profile-meta {
    margin-top: 14px;
    padding-top: 14px;
  }
  .public-profile-metrics {
    grid-template-columns: repeat(5, minmax(112px, 1fr));
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
  }
  .public-profile-metric {
    padding: 10px 10px;
  }
  .public-profile-metric__icon {
    width: 34px;
    height: 34px;
  }
  .public-profile-metric__body strong {
    font-size: 15px;
  }
  .public-profile-hero--mock.public-profile-hero--compact .public-profile-hero-content {
    padding: 18px 14px 20px;
    padding-top: 18px;
  }
  .public-profile-hero--mock .public-profile-avatar {
    margin-top: 0;
    width: 76px;
    height: 76px;
  }
  .template-step-row,
  .template-field-row,
  .template-field-grid,
  .template-settings-strip,
  .template-grid-2,
  .template-grid-3 { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .prompt-bar > div, .top-tabs, .top-tools { flex-wrap: wrap; }
  .generate-button { width: 100%; margin-left: 0; }
  .home-compose-actions .tool-button {
    flex: 0 1 auto;
  }
  .home-compose-actions .home-size-select {
    flex: 0 0 78px;
    width: 78px;
  }
  .home-compose-actions .generation-composer__select {
    flex: 1 1 150px;
    width: auto;
  }
  .home-compose-actions .prompt-polish-button {
    flex: 1 1 160px;
    justify-content: center;
  }
  .home-compose-actions .generate-button {
    width: 100%;
    flex: 1 1 100%;
    margin-left: 0;
  }
  .type-grid, .template-row, .mini-type-grid, .generated-grid, .prompt-ideas > div, .templates-list, .template-public-fields, .bonus-ledger article, .billing-grid, .pricing-grid, .pricing-grid--compact, .pricing-notes, .referral-links-grid, .referral-link-card { grid-template-columns: 1fr; }
  .pricing-page,
  .profile-page {
    padding-left: 12px;
    padding-right: 12px;
  }
  .earning-hero__copy h1 {
    font-size: 32px;
    line-height: 1.08;
  }
  .earning-hero__copy p {
    font-size: 15px;
  }
  .earning-opportunities {
    padding-top: 28px;
  }
  .earning-dashboard-preview {
    padding: 18px;
  }
  .earning-dashboard-preview h2 {
    font-size: 26px;
  }
  .pricing-hero {
    padding: 18px;
    align-items: flex-start;
    flex-direction: column;
  }
  .pricing-hero h1 {
    font-size: 26px;
  }
  .referral-link-card .secondary-action {
    width: 100%;
    justify-content: center;
  }
  .referral-reward-list article {
    align-items: flex-start;
    flex-direction: column;
  }
  .profile-balance-actions {
    justify-content: stretch;
  }
  .profile-balance-actions .secondary-action {
    width: 100%;
    justify-content: center;
  }
  .public-profile-hero {
    border-radius: 14px;
  }
  .public-profile-main {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }
  .public-profile-topline {
    justify-content: center;
  }
  .public-profile-title-row {
    justify-content: center;
  }
  .public-profile-actions {
    justify-content: center;
  }
  .public-profile-copy {
    padding-top: 0;
    justify-items: center;
  }
  .public-profile-copy .public-profile-badge.context-pill {
    justify-self: center;
  }
  .public-profile-copy p {
    max-width: none;
  }
  .public-profile-avatar {
    margin-top: -40px;
  }
  .public-profile-meta {
    justify-content: center;
  }
  .public-profile-metrics {
    grid-template-columns: 1fr 1fr;
    overflow-x: visible;
  }
  .public-profile-link__text small {
    max-width: min(260px, 72vw);
  }
  .public-photo-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .marketplace-stats,
  .home-scenarios--inline {
    grid-template-columns: 1fr;
  }
  .bonus-ledger img {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
  }
  .hero-panel { padding: 30px 18px; }
  .app--editor .editor-page,
  .app--editor .editor-page--empty {
    padding-left: 12px;
    padding-right: 12px;
  }
  .editor-upload-hero {
    min-height: 340px;
    padding: 28px 16px;
  }
  .editor-upload-hero h1 {
    max-width: 100%;
    font-size: 29px;
    line-height: 1.22;
    overflow-wrap: anywhere;
  }
  .editor-upload-hero p {
    font-size: 15px;
  }
  .app--editor .editor-workspace { grid-template-columns: 1fr; }
  .app--editor .editor-settings { position: static; max-height: none; }
  .editor-session-grid,
  .editor-previous-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .segmented { grid-template-columns: 1fr 1fr; }
  .composer-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .composer-controls label {
    min-width: 0;
    max-width: none;
  }
  .composer-settings-row {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
  }
  .composer-settings-row .composer-prompt-tools {
    width: 100%;
    justify-content: stretch;
    gap: 8px;
  }
  .composer-settings-row .composer-prompt-tools .tool-button {
    flex: 1 1 calc(50% - 4px);
    min-width: 0;
    justify-content: center;
  }
  .selected-file { grid-template-columns: 64px minmax(0, 1fr); }
  .chat-message { max-width: 100%; }
  .chat-composer .generate-button { width: 100%; margin-left: 0; }
  .composer-line {
    grid-template-columns: 36px minmax(0, 1fr) 44px;
    gap: 8px;
    padding: 8px;
  }
  .composer-line textarea,
  .chat-composer .composer-line textarea {
    order: 2;
    grid-column: 2;
    min-height: 54px;
    padding: 8px 4px;
  }
  .composer-add-photo {
    order: 1;
    grid-column: 1;
    width: 36px;
    min-width: 36px;
    height: 44px;
    min-height: 44px;
    padding: 0;
  }
  .composer-line .send-button {
    order: 3;
    grid-column: 3;
    align-self: stretch;
    width: 44px;
    height: auto;
  }
  .composer-add-photo span {
    display: none;
  }
  .composer-add-photo svg {
    width: 18px;
    height: 18px;
  }
  .chat-composer--empty .composer-line {
    grid-template-columns: 36px minmax(0, 1fr) 44px;
    min-height: 64px;
    gap: 8px;
  }
  .chat-composer--empty .composer-add-photo {
    width: 36px;
    min-width: 36px;
    padding: 0;
  }
  .chat-composer--empty textarea {
    min-height: 54px;
  }
  .profile-hero {
    grid-template-columns: 1fr;
  }
  .profile-avatar {
    width: 58px;
    height: 58px;
  }
  .profile-actions {
    align-items: stretch;
  }
  .profile-actions .generate-button,
  .profile-actions .secondary-action {
    width: 100%;
    justify-content: center;
  }
  .profile-metrics {
    padding: 12px;
  }
}

@media (max-width: 360px) {
  .landing-nav {
    padding-left: 14px;
    padding-right: 14px;
  }

  .landing-brand strong {
    display: none;
  }

  .landing-nav-item,
  .landing-gallery-button {
    min-height: 40px;
    padding-left: 11px;
    padding-right: 11px;
  }

  .landing-gallery-link {
    padding-left: 6px;
    padding-right: 6px;
  }

  .home-page {
    padding-left: 10px;
    padding-right: 10px;
  }

  .generation-panel {
    padding: 10px;
  }

  .generation-panel .prompt-bar textarea,
  .home-prompt-bar textarea {
    min-height: 166px;
  }

  .home-dropzone__hint strong {
    font-size: 13px;
  }

  .prompt-bar > div {
    gap: 8px;
    padding: 8px;
  }

  .home-prompt-bar .generate-button {
    min-height: 44px;
  }

  .landing-nav .landing-button {
    padding: 0 11px;
  }
}

/* Lavka-inspired product system: quiet type, outline icons, borders over shadows. */
body,
button,
input,
select,
textarea {
  font-family: var(--ui-font);
  font-weight: 400;
  letter-spacing: 0;
}

strong,
b,
h1,
h2,
h3,
h4,
h5,
h6,
button,
.brand,
.landing-brand,
.profile-hero h1,
.template-manage-title,
.feed-card__body strong,
.project-list-card strong {
  font-weight: 500 !important;
}

p,
small,
span,
label,
input,
select,
textarea,
li {
  font-weight: 400;
}

h1,
.hero-panel h1,
.landing-copy h1,
.home-start__head h1,
.generation-panel__head h2,
.templates-page__top h1,
.projects-head h1,
.profile-hero h1,
.feed-head h1,
.editor-upload-hero h1 {
  letter-spacing: 0;
}

.brand,
.landing-brand {
  font-size: 17px;
}

.template-manage-title,
.project-list-card strong,
.feed-card__body strong,
.home-scenario strong,
.type-card strong,
.template-card strong,
.recent-item strong,
.history-item strong {
  font-size: clamp(14px, 1rem, 16px);
}

p,
.landing-copy p,
.hero-panel p,
.generation-hero__lead,
.profile-hero p,
.feed-head p,
.projects-head p,
.template-manage-subtitle,
.type-card small,
.template-card span,
.project-list-badges span,
.public-profile-copy p {
  font-size: 13px;
  line-height: 1.55;
}

small,
.history-item small,
.recent-item small,
.feed-card__top small,
.user-card small,
.account-menu-head small {
  font-size: 11px;
  font-weight: 400;
}

.nav-title,
.context-pill,
.landing-kicker,
.home-kicker,
.template-meta-badge,
.project-folder-row small,
.public-profile-badge,
.public-profile-chip,
.feed-card__comment-count,
.editor-tool-kbd {
  font-size: 10px;
  font-weight: 500 !important;
  letter-spacing: 0;
  text-transform: none !important;
}

* {
  text-transform: none;
}

svg {
  stroke-width: 1.5;
}

.ti {
  display: inline-block;
  vertical-align: -0.125em;
  color: inherit;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-item svg,
.top-tabs svg,
.tool-button svg,
.secondary-action svg,
.template-action-primary svg,
.template-action-secondary svg,
.template-action-icon svg,
.feed-card__actions svg,
.project-folder-row svg,
.credits svg,
.landing-kicker svg {
  width: 16px;
  height: 16px;
}

.brand__mark svg,
.avatar-button svg,
.round-button svg,
.editor-tool-group button svg {
  width: 18px;
  height: 18px;
}

*,
*::before,
*::after {
  box-shadow: none !important;
}

.app,
.sidebar,
.app--editor .topbar,
.editor-upload-hero,
.editor-markup-bar button,
.editor-footer-button,
.public-profile-hero--mock,
.public-profile-avatar,
.public-profile-metric__icon,
.brand__mark,
.avatar,
.create-button,
.generate-button,
.big-generate,
.open-editor,
.landing-button,
.send-button,
.template-action-primary,
.public-profile-action--primary:not(.is-following),
.top-tabs button.active {
  background-image: none !important;
}

.app,
.app--light,
.home-page,
.workspace-page,
.chat-workspace,
.template-builder-page,
.templates-page,
.projects-page,
.profile-page,
.feed-page,
.images-page,
.auth-page,
.landing-page {
  background-color: var(--ui-bg);
}

.sidebar {
  background-color: #101411;
  border-right: .5px solid rgba(255, 255, 255, .14);
}

.topbar,
.app--editor .topbar,
.chat-types,
.chat-panel,
.chat-side .side-card,
.home-start,
.generation-panel,
.template-section-block,
.template-manage-card,
.feed-card,
.project-folders,
.projects-list-panel,
.projects-head,
.profile-hero,
.profile-metrics,
.profile-section-card,
.profile-settings-form,
.auth-card,
.landing-visual img,
.editor-upload-hero,
.editor-recent,
.editor-workspace,
.editor-tools,
.editor-settings,
.editor-chat-panel,
.modal section {
  border-width: .5px;
  border-color: var(--ui-line);
  background-color: var(--ui-surface);
}

.create-button,
.generate-button,
.big-generate,
.open-editor,
.landing-button,
.send-button,
.template-action-primary,
.public-profile-action--primary:not(.is-following),
.top-tabs button.active {
  color: #fff;
  background-color: var(--ui-accent);
}

.brand__mark,
.avatar {
  background-color: var(--ui-accent);
}

.credits span,
.account-menu-wrap .avatar,
.profile-avatar,
.public-profile-avatar .avatar {
  background-color: var(--ui-accent);
}

.credits button,
.credits span {
  background-color: var(--ui-accent);
}

.secondary-action,
.template-action-secondary,
.template-action-icon,
.tool-button,
.nav-item.active,
.context-pill,
.landing-kicker,
.home-kicker,
.template-meta-badge,
.template-meta-badge.is-usage,
.template-meta-badge.is-earned,
.template-meta-badge.is-public,
.template-meta-badge.is-private,
.project-folder-row.active,
.public-profile-chip,
.public-profile-badge {
  color: var(--ui-accent) !important;
  background-color: var(--ui-accent-soft) !important;
  border-color: rgba(37, 99, 235, .22) !important;
}

.type-card,
.template-card,
.home-scenario,
.home-path-card,
.recent-item,
.history-item,
.project-list-card,
.template-filter-bar button,
.template-manage-card,
.feed-card,
.profile-detail-card article,
.profile-metrics article,
.public-profile-metric,
.editor-version-card,
.editor-session-card,
.editor-previous-grid button,
.selected-file,
.home-file-chip {
  border-radius: var(--ui-card-radius);
}

.home-start,
.generation-panel,
.chat-panel,
.chat-types,
.projects-head,
.projects-workspace,
.profile-hero,
.profile-metrics,
.profile-section-card,
.template-section-block,
.template-catalog--compact,
.editor-upload-hero,
.auth-card {
  border-radius: var(--ui-container-radius);
}

button,
input,
select,
textarea,
.landing-button,
.generate-button,
.secondary-action,
.tool-button,
.template-action-primary,
.template-action-secondary,
.template-action-icon,
.create-button,
.open-editor,
.send-button,
.prompt-bar,
.template-search,
.history-search,
.context-pill,
.landing-kicker,
.home-kicker,
.template-meta-badge {
  border-radius: var(--ui-radius);
}

.avatar,
.brand__mark,
.credits span,
.round-button,
.public-profile-avatar,
.profile-avatar {
  border-radius: 50%;
}

.context-pill,
.landing-kicker,
.home-kicker,
.template-meta-badge,
.project-list-badges span,
.public-profile-chip,
.feed-card__comment-count {
  border-radius: var(--ui-pill-radius);
}

.app :where(article, section, aside, header, footer, div, button, input, select, textarea, label) {
  border-width: min(1px, .5px);
}

.nav-item.active,
.home-scenario.active,
.template-filter-bar button.active,
.project-folder-row.active,
.editor-tool-group button.active,
.editor-markup-bar button.active {
  border-width: 1.5px;
}

.template-filter-bar button.active,
.template-filter-bar button[aria-selected="true"],
.template-action-secondary.is-saved,
.template-favorite.active,
.template-like.active,
.nav-item.active,
.public-profile-action.is-following {
  color: var(--ui-accent) !important;
  border-color: rgba(37, 99, 235, .36) !important;
  background-color: var(--ui-accent-soft) !important;
}

a,
.landing-link,
.auth-switch,
.text-action,
.template-open-link,
.profile-public-link a,
.feed-card__author,
.public-profile-link,
.public-post-card a {
  color: var(--ui-accent) !important;
}

.home-dropzone__hint svg,
.home-file-chip-remove,
.composer-add-photo svg,
.template-file-picker svg,
.template-upload-zone svg,
.public-profile-metric__icon,
.editor-empty svg {
  color: var(--ui-accent) !important;
}

@media (max-width: 720px) {
  .public-profile-page--mock .public-profile-hero-content,
  .public-profile-hero--mock.public-profile-hero--compact .public-profile-hero-content {
    grid-template-columns: 1fr;
    padding: 16px;
    gap: 14px;
  }

  .public-profile-page--mock .public-profile-main,
  .public-profile-hero--mock.public-profile-hero--compact .public-profile-main {
    grid-template-columns: 64px minmax(0, 1fr);
    justify-items: stretch;
    text-align: left;
    gap: 12px;
  }

  .public-profile-page--mock .public-profile-avatar,
  .public-profile-hero--mock.public-profile-hero--compact .public-profile-avatar,
  .public-profile-hero--mock .public-profile-avatar {
    width: 64px;
    height: 64px;
    margin-top: 0;
    border-radius: 14px;
  }

  .public-profile-page--mock .public-profile-copy,
  .public-profile-hero--mock.public-profile-hero--compact .public-profile-copy {
    justify-items: start;
    text-align: left;
  }

  .public-profile-page--mock .public-profile-topline,
  .public-profile-page--mock .public-profile-title-row,
  .public-profile-hero--mock.public-profile-hero--compact .public-profile-topline,
  .public-profile-hero--mock.public-profile-hero--compact .public-profile-title-row {
    justify-content: flex-start;
  }

  .public-profile-hero--mock .public-profile-title-row h1 {
    font-size: 22px;
    line-height: 1.2;
  }

  .public-profile-page--mock .public-profile-hero-actions,
  .public-profile-hero--mock.public-profile-hero--compact .public-profile-hero-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .public-profile-page--mock .public-profile-action {
    flex: 1 1 150px;
    min-width: 0;
  }
}
