:root {
  --brand: #2563eb;
  --text: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --bg-soft: #f7f7f8;
}

body {
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI',
    Roboto, Oxygen, Ubuntu, Cantarell, 'Helvetica Neue',
    Arial, sans-serif;
  color: var(--text);
  background: #fff;
}

html,
body {
  overflow-x: clip;
}

@supports not (overflow-x: clip) {

  html,
  body {
    overflow-x: hidden;
  }
}

/* Hero */
.hero {
  padding: 72px 0 32px;
}

.hero h1 {
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
  font-size: clamp(2.2rem, 4vw, 3.4rem);
  margin-bottom: 10px;
}

.hero p.lead {
  color: var(--muted);
  max-width: 720px;
  margin: 0 auto 26px;
  font-size: 1.1rem;
}

@media (max-width: 576px) {
  .hero {
    padding: 28px 0 18px;
  }

  .hero p.lead {
    margin: 0 auto 18px;
    font-size: 1.02rem;
  }
}

/* ===== Page head (reusable) ===== */
.page-head {
  padding: 18px 0 12px;
}

.page-head .container {
  max-width: 1200px;
}

.page-head__title {
  font-size: 26px;
  font-weight: 600;
  margin: 0 0 4px;
  line-height: 1.2;
  letter-spacing: -0.3px;
}

.page-head__subtitle {
  margin: 0;
  font-size: 14px;
  font-weight: 400;
  color: #6b7280;
}

/* Prompt box */
.prompt-wrap {
  max-width: 820px;
  margin: 0 auto;
}

.prompt-suggest {
  text-align: center;
  color: var(--muted);
  margin-top: 12px;
  font-weight: 600;
  font-size: .95rem;
}

.prompt-suggest a {
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px dotted rgba(107, 114, 128, .5);
}

.prompt-suggest a:hover {
  color: var(--text);
  border-bottom-color: rgba(17, 24, 39, .6);
}

/* ===== Card base ===== */
.thumb {
  position: relative;
  display: inline-block;
  width: 100%;
  aspect-ratio: var(--ar, 1 / 1);
  overflow: hidden;
  break-inside: avoid;
  margin: 0 0 16px;
}

@media (max-width: 576px) {
  .thumb {
    margin: 0 0 12px;
  }
}

.thumb-media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.thumb-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  object-position: center;
}

/* === FIX: spinner centering inside flex wrapper === */
.thumb-media-center {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.thumb-media-center .thumb-spinner {
  position: static !important;
  left: auto !important;
  top: auto !important;
}

/* Empty / Pending state: spinner centered, no overlay bar */
.thumb.is-empty .thumb-meta--overlay {
  display: none !important;
}

.thumb-spinner {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: 28px;
  line-height: 1;
  color: rgba(17, 24, 39, .55);
  pointer-events: none;
}

/* ===== Bottom black bar ===== */
.thumb-meta--overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;

  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;

  /* black translucent bar */
  background: linear-gradient(to top,
      rgba(0, 0, 0, 0.85) 0%,
      rgba(0, 0, 0, 0.70) 40%,
      rgba(0, 0, 0, 0.40) 65%,
      rgba(0, 0, 0, 0.00) 100%);

  /* text */
  color: #ffffff;
  font-family: 'Manrope', Inter, system-ui, -apple-system, Segoe UI, Arial, sans-serif;
  font-weight: 600;

  pointer-events: none;
}

/* ===== Text lines ===== */
.thumb-line {
  font-size: 13px;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===== Stats ===== */
.thumb-stats {
  display: flex;
  gap: 12px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

/* ===== Icons ===== */
.thumb-stats i {
  margin-left: 4px;
}

/* Examples grid */
.section {
  padding: 36px 0;
}

.grid {
  column-count: 4;
  column-gap: 16px;
}

@media (max-width: 992px) {
  .grid {
    column-count: 3;
    column-gap: 12px;
  }
}

@media (max-width: 576px) {
  .grid {
    column-count: 2;
    column-gap: 12px;
  }
}

.thumb {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
  transition: transform .25s ease, box-shadow .25s ease;
}

.thumb:hover {
  transform: scale(1.04);
  z-index: 1;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .15);
}

/* === Thumb hover disable on touch START === */
@media (hover: none) and (pointer: coarse) {
  .thumb:hover {
    transform: none;
    z-index: 1;
    box-shadow: none;
  }
}
/* === Thumb hover disable on touch END === */

/* thumb-media must ALWAYS fill the card */
.thumb-media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #e5e7eb, #f3f4f6);
  /* default bg for empty/pending */
}

.thumb-meta {
  padding: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.thumb-lines {
  display: grid;
  gap: 4px;
  /* было 6px -> компактнее */
  width: 100%;
}

/* Text rows inside .thumb-lines */
.thumb-lines .thumb-line {
  font-size: 12px;
  /* мелко */
  line-height: 1.15;
  /* плотнее */
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.thumb-stats {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;

  font-size: 12px;
  line-height: 1;
}

.thumb-stats div {
  display: flex;
  align-items: center;
  gap: 6px;
  color: inherit;
}

.thumb-stats i {
  font-size: 12px;
  color: inherit;
}

/* On very small screens */
@media (max-width: 576px) {
  .thumb-lines .thumb-line {
    font-size: 11.5px;
  }
}

.line {
  height: 10px;
  background: #eef2f7;
  border-radius: 999px;
}

/* Skeleton lines — больше воздуха между ними */
.thumb-lines .line {
  margin-bottom: 4px;
  /* добавляет вертикальный интервал */
}

/* убираем лишний отступ у последней линии */
.thumb-lines .line:last-child {
  margin-bottom: 0;
}

.line.w60 {
  width: 60%;
}

.line.w80 {
  width: 80%;
}

.line.w45 {
  width: 45%;
}

/* ===== Skeleton shimmer ===== */
.thumb.is-pending .line {
  position: relative;
  overflow: hidden;

  background: #eef2f7;
}

/* бегущий блик */
.thumb.is-pending .line::after {
  content: '';
  position: absolute;
  inset: 0;

  background: linear-gradient(90deg,
      transparent,
      rgba(255, 255, 255, 0.65),
      transparent);

  transform: translateX(-100%);
  animation: shimmer-move 1.3s ease-in-out infinite;
}

/* движение блика */
@keyframes shimmer-move {
  0% {
    transform: translateX(-100%);
  }

  100% {
    transform: translateX(100%);
  }
}

.btn-remix {
  text-transform: none;
  font-weight: 700;
  border-radius: 10px;
  box-shadow: none !important;
  padding: 8px 12px;
  color: #374151;
  border: 1px solid var(--line);
  background: #fff;
}

.btn-remix:hover {
  background: #f9fafb;
}

/* Features row */
.features {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  align-items: center;
  justify-items: center;
  text-align: center;
  color: #374151;
  font-weight: 700;
}

@media (max-width: 992px) {
  .features {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.feat i {
  color: var(--muted);
  margin-right: 8px;
}

/* CTA */
.cta {
  background: var(--bg-soft);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 54px 0;
  margin-top: 10px;
}

.cta h2 {
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.cta p {
  color: var(--muted);
  margin-bottom: 18px;
  font-weight: 600;
}

.btn-try {
  background: var(--brand) !important;
  text-transform: none;
  font-weight: 800;
  border-radius: 12px;
  box-shadow: none !important;
  padding: 12px 20px;
  min-width: 170px;
}

/* Footer */
footer {
  padding: 22px 0;
  color: var(--muted);
  font-weight: 600;
}

footer a {
  color: var(--muted);
  text-decoration: none;
  margin-left: 16px;
}

footer a:hover {
  color: var(--text);
}

/* Promptbar (like screenshot) */
.promptbar {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  padding: 14px;
  box-shadow: 0 1px 0 rgba(17, 24, 39, 0.02);
}

.promptbar-input {
  width: 100%;
  border: 0 !important;
  outline: none !important;
  box-shadow: none !important;

  resize: none;
  overflow-y: auto;

  /* text */
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 400;
  line-height: 1.5;

  /* layout */
  padding: 12px;
  /* проще: один padding вместо 8/8/12 */
  white-space: pre-wrap;
  overflow-wrap: break-word;

  /* show 4 lines on desktop, then scroll */
  --prompt-lines: 4;
  height: calc(1.5em * var(--prompt-lines) + 24px);
  max-height: calc(1.5em * var(--prompt-lines) + 24px);
}

@media (max-width: 768px) {
  .promptbar-input {
    --prompt-lines: 2;
  }
}

.promptbar-input::placeholder {
  color: #9ca3af;
  font-weight: 600;
}

.promptbar-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-top: 8px;
}

.tools-left,
.tools-right {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex-wrap: wrap;
}

/* Left round chips */
.toolchip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;

  height: 44px;
  min-width: 44px;
  padding: 0 14px;

  border-radius: 999px;
  border: 1px solid transparent;
  background: #f3f4f6;

  color: #111827;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
  transition: background .15s ease, border-color .15s ease, transform .05s ease;
}

.toolchip i {
  font-size: 1rem;
  opacity: .9;
}

.toolchip:hover {
  background: #eef2f7;
}

.toolchip:active {
  transform: translateY(1px);
}

.toolchip--label {
  padding-left: 14px;
  padding-right: 14px;
}

/* Ratio icon box: frame only (size comes from .ratio-icon.square|portrait|landscape) */
.ratio-box {
  border-radius: 4px;
  border: 2px solid #111827;
  display: inline-block;
}

/* Right side: Auto + globe + send */
.autochip {
  display: inline-flex;
  align-items: center;
  gap: 10px;

  height: 44px;
  padding: 0 14px;

  border-radius: 999px;
  border: 1px solid transparent;
  background: #f3f4f6;

  color: #111827;
  font-weight: 500;
  cursor: pointer;
}

.autochip i {
  opacity: .9;
}

.toolicon {
  height: 44px;
  width: 44px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.toolicon:hover,
.autochip:hover {
  background: #eef2f7;
}

.sendbtn {
  height: 52px;
  width: 52px;
  border-radius: 999px;
  border: 0;
  background: #111;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: none;
  transition: transform .05s ease, background .15s ease;
}

.sendbtn:hover {
  background: #0b0b0b;
}

.sendbtn:active {
  transform: translateY(1px);
}

/* Mobile wrap */
@media (max-width: 768px) {
  .promptbar-tools {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
  }

  /* убираем разделение на две строки */
  .tools-left,
  .tools-right {
    display: contents;
  }

  .toolchip,
  .autochip,
  .toolicon,
  .sendbtn {
    flex: 0 0 auto;
  }
}

/* 3) СТИЛИ МОДАЛКИ */
.xmodal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(17, 24, 39, .55);
  z-index: 9999;
}

.xmodal.is-open {
  display: flex;
}

.xmodal__dialog {
  width: 100%;
  max-width: 420px;
  /* единый размер для всех модалок */
  background: #fff;
  border: 1px solid var(--line, #e5e7eb);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .18);
}

.xmodal__body {
  padding: 16px;
}

/* Общий header для всех модалок */
.xmodal .ratio-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 10px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--line, #e5e7eb);
}

.xmodal .ratio-modal-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text, #111827);
}

.xmodal .ratio-modal-close {
  border: 0;
  background: transparent;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted, #6b7280);
  cursor: pointer;
}

.xmodal .ratio-modal-close:hover {
  background: rgba(17, 24, 39, .06);
  color: var(--text, #111827);
}

/* ===== Ratio modal FULL ===== */

/* header */
#modalRatio .ratio-head--3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  margin-bottom: 10px;
}

#modalRatio .ratio-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

#modalRatio .ratio-coltitle {
  font-size: 13px;
  font-weight: 700;
  color: #6b7280;
}

/* icons (shared: works in modal AND in the button) */
.ratio-icon {
  border: 2px solid #111827;
  border-radius: 4px;
}

.ratio-icon.square {
  width: 16px;
  height: 16px;
}

.ratio-icon.portrait {
  width: 14px;
  height: 20px;
}

.ratio-icon.landscape {
  width: 20px;
  height: 14px;
}

.xmodal .ratio-3col>span {
  display: block;
}

/* grid (shared for Ratio + Model) */
.xmodal .ratio-3col {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px 12px;
}

.xmodal .ratio-pill {
  border: 0;
  background: transparent;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 400;
  cursor: pointer;
  width: 100%;
  text-align: center;
}

.xmodal .ratio-pill:hover {
  background: rgba(17, 24, 39, .06);
}

.xmodal .ratio-pill.is-active {
  background: rgba(17, 24, 39, .12);
}

/* ===== Count modal UI ===== */
#modalImages .count-wrap {
  padding-top: 6px;
}

#modalImages .seg {
  display: flex;
  gap: 6px;
  padding: 6px;
  border-radius: 16px;
  background: rgba(17, 24, 39, .06);
}

#modalImages .seg--tight {
  gap: 8px;
}

#modalImages .seg-btn {
  flex: 1;
  border: 0;
  background: transparent;
  border-radius: 14px;
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 500;
  /* НЕ жирно */
  color: var(--text, #111827);
  cursor: pointer;
}

#modalImages .seg-btn:hover {
  background: rgba(17, 24, 39, .06);
}

#modalImages .seg-btn.is-active {
  background: #fff;
  box-shadow: 0 1px 0 rgba(0, 0, 0, .06);
}

#modalImages .count-section-title {
  margin-top: 14px;
  margin-bottom: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted, #6b7280);
}

#modalImages .count-hints {
  margin-top: 10px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

#modalImages .hint-top {
  font-size: 13px;
  font-weight: 600;
  color: var(--text, #111827);
}

#modalImages .hint-sub {
  font-size: 13px;
  color: var(--muted, #6b7280);
}

#modalImages .hint-right {
  text-align: right;
}

/* Contact */
.contact-box {
  border: 1px solid rgba(0, 0, 0, .08);
  border-radius: 16px;
}

.contact-left {
  background: linear-gradient(135deg, rgba(13, 110, 253, .08), rgba(0, 0, 0, 0));
}

.contact-muted {
  color: rgba(0, 0, 0, .65);
}

.contact-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(13, 110, 253, .10);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.contact-input {
  background: #f8f9fb;
}

/* Contact */


.rounded-6 {
  border-radius: 18px;
}

/* Buttons style */
/* ===== Universal UI Button (clean + soft) ===== */
.ui-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  height:44px;
  padding:0 22px;
  border-radius:14px; /* чуть больше MDB, но не pill */
  border:1px solid rgba(17,24,39,.12);
  font-weight:800;
  letter-spacing:-0.01em;
  font-size:15px;
  cursor:pointer;
  user-select:none;
  transition:
    background .18s ease,
    border-color .18s ease,
    box-shadow .18s ease,
    transform .18s ease;
}

/* ===== Primary ===== */

.ui-btn--primary{
  background: rgba(37,99,235,.18); /* темнее чем было */
  color:#111827;
}

.ui-btn--primary:hover{
  background: rgba(37,99,235,.28);
  border-color: rgba(37,99,235,.30);
  box-shadow: 0 12px 26px rgba(17,24,39,.14);
  transform: translateY(-1px);
}

.ui-btn--primary:active{
  transform: translateY(0);
  box-shadow:none;
}

.ui-btn--primary:focus-visible{
  outline:none;
  box-shadow:
    0 0 0 4px rgba(37,99,235,.25),
    0 12px 26px rgba(17,24,39,.14);
}

/* ===== Danger (Delete) ===== */

.ui-btn--danger{
  background: rgba(220,38,38,.18); /* мягкий красный */
  color:#111827;
}

.ui-btn--danger:hover{
  background: rgba(220,38,38,.28);
  border-color: rgba(220,38,38,.30);
  box-shadow: 0 12px 26px rgba(17,24,39,.14);
  transform: translateY(-1px);
}

.ui-btn--danger:active{
  transform: translateY(0);
  box-shadow:none;
}

.ui-btn--danger:focus-visible{
  outline:none;
  box-shadow:
    0 0 0 4px rgba(220,38,38,.25),
    0 12px 26px rgba(17,24,39,.14);
}

/* ===== Disabled ===== */

.ui-btn:disabled{
  opacity:.55;
  cursor:not-allowed;
  box-shadow:none;
  transform:none;
}
/* Buttons style */

body.modal-open {
    padding-right: 0 !important;
}

/* === Energy Trust Section UPDATED START === */
.energy-trust {
  margin-top: 70px;
  padding: 60px 0;
  background: #F3F4F6; /* мягкий серый */
  border-top: 1px solid rgba(17,24,39,.06);
}

/* === Energy Trust Section UPDATED END === */

.trust-grid {
  display: grid;
  gap: 28px;
}

@media (min-width: 768px) {
  .trust-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1100px) {
  .trust-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.trust-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.trust-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: rgba(37,99,235,.08);
  color: #2563EB;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 44px;
  font-size: 18px;
}

.trust-title {
  font-weight: 900;
  color: #111827;
  margin-bottom: 4px;
}

.trust-text {
  color: rgba(17,24,39,.60);
  font-weight: 700;
  font-size: 14px;
}
/* === Energy Trust Section END === */