:root {
  --red: #E0232A;
  --red-dark: #B91A20;
  --black: #141414;
  --white: #ffffff;
  --bg: #F3F1EC;
  --card: #ffffff;
  --border: #141414;
  --gray: #5C5C5C;
  --gray-light: #9A9A9A;
  --shadow: 6px 6px 0 rgba(20, 20, 20, 0.12);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--black);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* ── Типографика-акценты (Anton, uppercase) ── */
h1, .brand-name, .go-btn, .copy-btn,
.field-label, .result-title, .sponsor-after-label, .guide-toggle,
.seg button, .chip, .footer-brand {
  font-family: "Anton", Impact, sans-serif;
  font-weight: 400;
  letter-spacing: 0.02em;
}

/* ── Шапка ── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  background: var(--white);
  border-bottom: 3px solid var(--black);
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 34px; height: 34px;
  background: var(--red);
  color: var(--white);
  display: grid; place-items: center;
  font-family: "Anton", sans-serif;
  font-size: 19px;
}
.brand-name { font-size: 22px; color: var(--black); }
.brand-name .accent { color: var(--red); }
.header-badge {
  font-family: "Anton", sans-serif;
  font-size: 12px;
  color: var(--white);
  background: var(--black);
  padding: 6px 12px;
  white-space: nowrap;
  letter-spacing: 0.04em;
}
.sponsor-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  background: var(--red);
  color: var(--white);
  padding: 10px 16px;
  text-align: center;
  border-bottom: 3px solid var(--black);
}
.sponsor-bar-label {
  font-family: "Inter", sans-serif;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.85);
}
.sponsor-bar-brand {
  font-family: "Anton", sans-serif;
  font-size: 16px;
  letter-spacing: 0.03em;
}
.sponsor-bar-note {
  font-family: "Inter", sans-serif;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.92);
}

/* ── Контейнер ── */
.wrap { max-width: 660px; margin: 0 auto; padding: 28px 16px 40px; }

/* ── Hero ── */
.hero { margin-bottom: 26px; }
.hero-title {
  font-size: clamp(40px, 11vw, 68px);
  line-height: 0.95;
  text-transform: uppercase;
  color: var(--black);
}
.hero-title .accent { color: var(--red); }
.sq {
  display: inline-block;
  width: 0.55em; height: 0.55em;
  background: var(--red);
  margin-left: 0.12em;
  vertical-align: baseline;
}
.hero .sub {
  margin-top: 16px;
  color: var(--gray);
  font-size: 15px;
  max-width: 460px;
}

/* ── Карточки ── */
.card {
  background: var(--card);
  border: 3px solid var(--black);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 20px;
}
.field-label {
  display: block;
  font-size: 13px;
  margin-bottom: 8px;
  color: var(--black);
  text-transform: uppercase;
}
.field-label .opt {
  font-family: "Inter", sans-serif;
  text-transform: none;
  color: var(--gray-light);
  letter-spacing: 0;
}

.input-box { position: relative; }
textarea {
  width: 100%;
  border: 2px solid var(--black);
  background: var(--white);
  padding: 14px 56px 14px 14px;
  font-size: 16px;
  font-family: "Inter", sans-serif;
  resize: vertical;
  min-height: 110px;
  line-height: 1.5;
}
textarea:focus, .link-input:focus {
  outline: 3px solid rgba(224, 35, 42, 0.35);
}
.mic-btn {
  position: absolute;
  right: 10px; bottom: 10px;
  width: 46px; height: 46px;
  border: none;
  background: var(--red);
  color: var(--white);
  display: grid; place-items: center;
  cursor: pointer;
  transition: background .15s, transform .1s;
}
.mic-btn:hover { background: var(--red-dark); }
.mic-btn:active { transform: scale(0.94); }
.mic-btn.recording { background: var(--black); animation: pulse 1.2s infinite; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(224, 35, 42, 0.55); }
  70% { box-shadow: 0 0 0 18px rgba(224, 35, 42, 0); }
  100% { box-shadow: 0 0 0 0 rgba(224, 35, 42, 0); }
}

/* ── Полоски записи (как в Telegram) ── */
.rec-status {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}
.rec-bars {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 20px;
}
.rec-bars span {
  width: 3px;
  height: 100%;
  background: var(--red);
  border-radius: 2px;
  animation: eq 1s ease-in-out infinite;
}
.rec-bars span:nth-child(1) { animation-delay: 0s; }
.rec-bars span:nth-child(2) { animation-delay: 0.12s; }
.rec-bars span:nth-child(3) { animation-delay: 0.24s; }
.rec-bars span:nth-child(4) { animation-delay: 0.36s; }
.rec-bars span:nth-child(5) { animation-delay: 0.48s; }
@keyframes eq {
  0%, 100% { transform: scaleY(0.3); }
  50% { transform: scaleY(1); }
}
.rec-label {
  font-size: 13px;
  color: var(--gray);
}

.link-input {
  width: 100%;
  border: 2px solid var(--black);
  padding: 12px 14px;
  font-size: 15px;
  font-family: "Inter", sans-serif;
  margin-bottom: 4px;
}

/* ── Прикрепить фото ── */
.attach-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.attach-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
  background: transparent;
  color: var(--black);
  font-family: "Inter", sans-serif;
  font-size: 13px;
  font-weight: 600;
  padding: 4px 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color .15s;
}
.attach-btn:hover { color: var(--red); }
.attach-note {
  font-size: 12px;
  color: var(--gray-light);
}
.preview {
  position: relative;
  width: 64px; height: 64px;
  border: 2px solid var(--black);
  overflow: hidden;
  flex-shrink: 0;
  margin-top: 8px;
}
.preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.remove-btn {
  position: absolute;
  top: -2px; right: -2px;
  width: 22px; height: 22px;
  border: 2px solid var(--black);
  background: var(--red);
  color: var(--white);
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
}

/* ── Подсказки ── */
.hints { margin-top: 16px; }
.hints-title {
  display: block;
  font-family: "Anton", sans-serif;
  font-size: 12px;
  letter-spacing: 0.03em;
  color: var(--gray);
  margin-bottom: 9px;
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 2px solid var(--black);
  background: var(--white);
  color: var(--black);
  padding: 8px 13px;
  font-size: 12px;
  cursor: pointer;
  transition: all .12s;
}
.chip:hover { background: var(--red); border-color: var(--red); color: var(--white); }
.chip.picked { background: var(--black); border-color: var(--black); color: var(--white); }

/* ── Длина ── */
.length-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  flex-wrap: wrap;
}
.length-row .field-label { margin-bottom: 0; }
.seg {
  display: flex;
  border: 2px solid var(--black);
  gap: 0;
}
.seg button {
  border: none;
  background: var(--white);
  padding: 8px 12px;
  font-size: 12px;
  cursor: pointer;
  color: var(--gray);
  transition: all .12s;
}
.seg button + button { border-left: 2px solid var(--black); }
.seg button.active { background: var(--black); color: var(--white); }

/* ── Кнопка генерации ── */
.go-btn {
  width: 100%;
  margin-top: 18px;
  border: none;
  background: var(--red);
  color: var(--white);
  font-size: 19px;
  padding: 16px;
  cursor: pointer;
  transition: background .15s, transform .1s;
  text-transform: uppercase;
}
.go-btn:hover { background: var(--red-dark); }
.go-btn:active { transform: translateY(1px); }
.go-btn:disabled { background: #D89A9C; cursor: not-allowed; }

.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 14px;
  color: var(--gray);
  font-family: "Anton", sans-serif;
  font-size: 13px;
  letter-spacing: 0.03em;
}
.spinner {
  width: 18px; height: 18px;
  border: 3px solid var(--black);
  border-top-color: var(--red);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.error {
  margin-top: 12px;
  color: var(--red);
  font-size: 14px;
  text-align: center;
  font-weight: 600;
}

/* ── Результат ── */
.result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.result-title { font-size: 16px; color: var(--black); }
.copy-btn {
  border: 2px solid var(--red);
  background: transparent;
  color: var(--red);
  font-size: 13px;
  padding: 9px 14px;
  cursor: pointer;
  transition: all .15s;
}
.copy-btn:hover { background: var(--red); color: var(--white); }
.copy-btn.done { background: #1F9D55; border-color: #1F9D55; color: white; }
.result-text {
  white-space: pre-wrap;
  font-size: 16px;
  line-height: 1.6;
  background: #FAFAF7;
  border: 2px solid var(--black);
  padding: 14px 16px;
}
.stars-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding: 10px 14px;
  border: 2px solid var(--black);
  background: #FFF3C9;
}
.stars { color: #F5A623; font-size: 18px; letter-spacing: 2px; }
.stars-note { font-size: 13px; color: #6B5620; }
.sponsor-after {
  margin-top: 14px;
  padding: 12px 14px;
  background: var(--black);
  color: var(--white);
}
.sponsor-after-label {
  font-size: 11px;
  color: #C9C9C9;
  letter-spacing: 0.08em;
}
.sponsor-after-brand { font-family: "Inter", sans-serif; font-size: 13px; color: var(--white); margin-top: 3px; display: block; }
.sponsor-after-brand b { font-family: "Anton", sans-serif; letter-spacing: 0.03em; }

/* ── Гайд ── */
.guide-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: transparent;
  border: none;
  font-size: 15px;
  cursor: pointer;
  color: var(--black);
  padding: 2px 0;
}
.chev { transition: transform .2s; color: var(--red); font-family: "Inter", sans-serif; }
.guide.open .chev { transform: rotate(180deg); }
.guide-body { margin-top: 14px; }
.scale { list-style: none; }
.scale li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 0;
  font-size: 14px;
  color: #333;
  border-bottom: 1px solid #E2E2E2;
}
.scale li:last-child { border-bottom: none; }
.scale b { color: var(--black); }
.sq-mark {
  flex-shrink: 0;
  width: 10px; height: 10px;
  margin-top: 5px;
  display: inline-block;
}
.sq-mark.red { background: var(--red); }
.sq-mark.black { background: var(--black); }

/* ── Футер ── */
.footer {
  text-align: center;
  color: var(--gray-light);
  font-size: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 16px 32px;
}
.footer-brand {
  color: var(--black);
  font-size: 16px;
  margin-bottom: 4px;
}

@media (max-width: 480px) {
  .topbar { padding: 12px 14px; }
  .sponsor-bar { padding: 9px 12px; }
}
