/* Локальные шрифты. */
@font-face {
  font-family: Inter;
  src: url("fonts/Inter-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: Inter;
  src: url("fonts/Inter-Medium.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: Inter;
  src: url("fonts/Inter-SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: Inter;
  src: url("fonts/Inter-Bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}
/* Основа страницы и форма. */
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--apt-bg);
  color: var(--apt-text);
  font:
    15px/1.6 Inter,
    sans-serif;
}
button,
input,
textarea {
  font: inherit;
}
button,
a,
input,
summary,
textarea {
  -webkit-tap-highlight-color: transparent;
}
button,
a,
summary {
  touch-action: manipulation;
}
a {
  color: var(--apt-primary-dark);
  text-underline-offset: 4px;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: default;
  opacity: 0.65;
}
:focus-visible {
  outline: 3px solid var(--apt-focus);
  outline-offset: 4px;
}
[hidden] {
  display: none !important;
}
.header,
main,
footer {
  max-width: 1280px;
  margin: auto;
}
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 25px 36px;
  border-bottom: 1px solid var(--apt-border);
}
.header > a:last-child {
  font-size: 13px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--apt-text);
  font-size: 21px;
  font-weight: 700;
}
.brand-icon {
  background: var(--apt-primary);
  color: var(--apt-surface);
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: var(--r-sm);
  font-size: 24px;
}
main {
  padding: 42px 36px 48px;
}
.intro {
  display: flex;
  align-items: center;
  gap: 70px;
  margin-bottom: 34px;
}
.intro h1 {
  font-size: 38px;
  line-height: 1.16;
  letter-spacing: -1.5px;
  margin: 0;
  font-weight: 600;
  flex: 0 0 380px;
}
.intro p {
  max-width: 540px;
  color: var(--apt-text-muted);
  margin: 0;
  font-size: 16px;
}
.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
  align-items: start;
  gap: 24px;
}
.editor {
  background: var(--apt-surface);
  border: 1px solid var(--apt-border);
  border-radius: var(--r-lg);
  padding: 26px;
  box-shadow: var(--sh-sm);
}
.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  gap: 12px;
}
h2 {
  font-size: 21px;
  line-height: 1.35;
  margin: 0;
  font-weight: 600;
  letter-spacing: -0.4px;
}
h3 {
  font-size: 15px;
  font-weight: 600;
  margin: 0;
}
.muted,
.help,
.input-meta,
.shortcut,
.privacy {
  color: var(--apt-text-muted);
  font-size: 12px;
}
textarea {
  width: 100%;
  min-height: 280px;
  resize: vertical;
  padding: 16px;
  border: 1px solid var(--apt-border-strong);
  border-radius: var(--r-sm);
  background: var(--apt-bg);
  color: var(--apt-text);
  line-height: 1.65;
}
textarea::placeholder {
  color: var(--apt-text-muted);
}
textarea[aria-invalid="true"] {
  border-color: var(--apt-danger);
}
.input-meta {
  display: flex;
  justify-content: space-between;
  margin: 5px 0 24px;
}
.over-limit {
  color: var(--apt-danger);
}
fieldset {
  border: 0;
  padding: 0;
  margin: 0 0 22px;
  min-width: 0;
}
legend {
  font-size: 13px;
  font-weight: 600;
  padding: 0;
  margin-bottom: 10px;
}
.targets,
.modes {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}
.targets label,
.modes label {
  position: relative;
  flex: 1;
  cursor: pointer;
}
.targets input,
.modes input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.targets span,
.modes span {
  display: block;
  text-align: center;
  border: 1px solid var(--apt-border);
  border-radius: var(--r-sm);
  padding: 10px 5px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}
.targets input:checked + span {
  border-color: var(--apt-primary);
  background: var(--apt-surface-tint);
  color: var(--apt-primary-dark);
}
input:focus-visible + span {
  outline: 3px solid var(--apt-focus);
  outline-offset: 3px;
}
.modes {
  background: var(--apt-bg-soft);
  padding: 4px;
  border-radius: var(--r-sm);
}
.modes span {
  border-color: transparent;
  padding: 7px;
}
.modes input:checked + span {
  background: var(--apt-surface);
  box-shadow: var(--sh-sm);
}
.help {
  margin: 9px 0 0;
}
.submit-row {
  display: flex;
  align-items: center;
  gap: 18px;
}
.primary {
  border: 0;
  border-radius: var(--r-sm);
  background: var(--apt-primary-dark);
  color: var(--apt-surface);
  padding: 13px 20px;
  min-width: 180px;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  gap: 30px;
}
.primary:hover {
  background: var(--apt-brand-800);
}
.privacy {
  margin: 12px 0 0;
}
.examples {
  border-top: 1px solid var(--apt-border);
  margin-top: 24px;
  padding-top: 20px;
}
.examples h3 {
  margin-bottom: 7px;
  font-size: 12px;
  color: var(--apt-text-muted);
  font-weight: 400;
}
.examples button {
  display: flex;
  justify-content: space-between;
  width: 100%;
  background: none;
  border: 0;
  border-radius: 4px;
  padding: 9px 0;
  color: var(--apt-primary-dark);
  font-size: 13px;
  text-align: left;
}
.examples button:hover {
  text-decoration: underline;
}
.output {
  min-width: 0;
}
.empty {
  min-height: 260px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 34px 20px;
}
.empty-symbol {
  color: var(--apt-primary-dark);
  background: var(--apt-surface-tint);
  padding: 8px 15px;
  font-size: 20px;
  margin-bottom: 26px;
  border-radius: var(--r-sm);
}
.empty p {
  color: var(--apt-text-muted);
  font-size: 14px;
  max-width: 360px;
}
.empty-note {
  display: flex;
  align-items: center;
  gap: 16px;
  border-top: 1px solid var(--apt-border);
  margin-top: 28px;
  padding-top: 18px;
  text-align: left;
}
.empty-note > span {
  color: var(--apt-warning);
  font-size: 22px;
}
.empty-note p {
  font-size: 12px;
}
.notice {
  border: 1px solid var(--apt-border-strong);
  border-radius: var(--r-md);
  padding: 16px 18px;
  background: var(--apt-bg-soft);
  margin-bottom: 16px;
  font-size: 13px;
}
.notice.warning {
  background: var(--apt-warning-bg);
  border-color: var(--apt-warning);
  color: var(--apt-text);
}
.notice.error {
  border-color: var(--apt-danger);
}
.notice h2 {
  font-size: 18px;
  margin-bottom: 6px;
}
.notice p {
  margin: 0;
}
/* Готовый текст и пояснения. */
.result-card {
  background: var(--apt-surface);
  border: 1px solid var(--apt-border);
  border-top: 3px solid var(--apt-primary);
  border-radius: var(--r-md);
  padding: 24px;
}
.result-card .section-heading {
  align-items: flex-start;
}
.result-meta {
  color: var(--apt-text-muted);
  font-size: 12px;
  margin: 5px 0 0;
}
.copy {
  border: 1px solid var(--apt-border-strong);
  background: var(--apt-surface);
  border-radius: var(--r-sm);
  padding: 8px 12px;
  color: var(--apt-primary-dark);
  font-size: 12px;
  min-height: 40px;
}
.prompt-result {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 14px;
  line-height: 1.85;
  margin: 18px 0 0;
}
.prompt-result mark {
  background: var(--apt-warning-bg);
  color: var(--apt-warning);
  border-bottom: 1px dashed var(--apt-warning);
  border-radius: 3px;
}
.placeholders {
  border-top: 1px solid var(--apt-border);
  margin-top: 22px;
  padding-top: 18px;
  font-size: 13px;
}
.placeholders h3 {
  font-size: 13px;
}
.placeholders ul {
  padding-left: 19px;
  margin: 8px 0 0;
  color: var(--apt-text-muted);
}
.changes-title {
  margin: 28px 0 15px;
  font-size: 19px;
}
.change {
  border: 1px solid var(--apt-border);
  border-radius: var(--r-md);
  padding: 16px;
  background: var(--apt-surface);
  margin-bottom: 10px;
}
.kind {
  font-size: 11px;
  color: var(--apt-primary-dark);
  font-weight: 600;
  margin-bottom: 8px;
}
.kind.warn {
  color: var(--apt-warning);
}
.change p {
  font-size: 13px;
  color: var(--apt-text-muted);
  margin: 10px 0;
}
.change details {
  font-size: 12px;
  margin: 14px 0;
}
.change summary {
  cursor: pointer;
  color: var(--apt-text);
}
.source {
  font-size: 12px;
  overflow-wrap: anywhere;
}
.no-changes {
  padding: 20px;
  border: 1px dashed var(--apt-border-strong);
  border-radius: var(--r-md);
  font-size: 13px;
  color: var(--apt-text-muted);
}
footer {
  border-top: 1px solid var(--apt-border);
  padding: 22px 36px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  font-size: 11px;
  color: var(--apt-text-muted);
}
footer p {
  margin: 0;
}
#version {
  display: block;
  margin-top: 3px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.loading-line {
  height: 6px;
  width: 100%;
  background: var(--apt-brand-100);
  margin-top: 20px;
  border-radius: var(--r-pill);
  overflow: hidden;
}
.loading-line:after {
  content: "";
  display: block;
  width: 35%;
  height: 100%;
  background: var(--apt-primary);
  animation: loading 1.2s infinite alternate;
}
@keyframes loading {
  to {
    transform: translateX(185%);
  }
}
@media (prefers-reduced-motion: reduce) {
  .loading-line:after {
    animation: none;
  }
} /* Колонки и выбор модели */
.main-column {
  min-width: 0;
  display: grid;
  gap: 24px;
}
.changes-panel {
  position: sticky;
  top: 24px;
  max-height: calc(100dvh - 48px);
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.changes-panel h2 {
  font-size: 19px;
  margin: 0 0 16px;
}
#changes {
  overflow-y: auto;
  min-height: 0;
  padding: 4px;
  margin: -4px;
  scrollbar-gutter: stable;
}
.change h3 {
  font-size: 14px;
  line-height: 1.45;
}
.kind {
  margin: 6px 0;
}
.change-why {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}
.change-why.expanded {
  display: block;
}
.more {
  background: none;
  border: 0;
  color: var(--apt-primary-dark);
  padding: 4px 0;
  font-size: 12px;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.model-label {
  display: block;
  margin: 16px 0 8px;
  font-size: 13px;
  font-weight: 500;
}
select {
  width: 100%;
  min-height: 44px;
  font: inherit;
  background: var(--apt-surface);
  color: var(--apt-text);
  border: 1px solid var(--apt-border-strong);
  border-radius: var(--r-sm);
  padding: 8px 12px;
}
#catalog-status {
  margin-bottom: 16px;
}
textarea {
  overflow-y: hidden;
}
.examples {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
}
.examples h3 {
  width: 100%;
}
.examples button {
  width: auto;
  gap: 12px;
}
@media (max-width: 1099px) {
  .workspace {
    grid-template-columns: 1fr;
  }
  .changes-panel {
    position: static;
    max-height: none;
  }
  #changes {
    overflow: visible;
  }
}
/* Телефон. */
@media (max-width: 680px) {
  .shortcut {
    display: none;
  }
  .header {
    padding: 18px 20px;
  }
  .brand {
    font-size: 18px;
    gap: 9px;
  }
  .brand-icon {
    width: 32px;
    height: 32px;
    font-size: 21px;
  }
  .header > a:last-child {
    font-size: 11px;
  }
  main {
    padding: 30px 16px;
  }
  .intro {
    display: block;
    margin: 0 4px 26px;
  }
  .intro h1 {
    font-size: 34px;
    letter-spacing: -1px;
  }
  .intro p {
    font-size: 14px;
    margin-top: 16px;
  }
  .workspace {
    grid-template-columns: 1fr;
  }
  .editor {
    padding: 20px;
  }
  .targets {
    flex-wrap: wrap;
    gap: 6px;
  }
  .targets label,
  .targets label:last-child {
    flex-basis: 40%;
  }
  .targets span {
    font-size: 11px;
    padding: 11px 5px;
  }
  .section-heading > .muted {
    font-size: 11px;
  }
  textarea {
    min-height: 240px;
    font-size: 16px;
  }
  .primary {
    width: 100%;
    min-height: 48px;
  }
  .submit-row {
    display: block;
  }
  .privacy {
    text-align: center;
  }
  .empty {
    min-height: 340px;
    padding: 25px 12px;
  }
  .result-card {
    padding: 20px;
  }
  .result-card h2 {
    font-size: 19px;
  }
  .copy {
    padding: 8px;
  }
  .change {
    padding: 18px;
  }
  .prompt-result {
    font-size: 14px;
  }
  footer {
    padding: 22px 20px;
    display: block;
  }
  footer p + p {
    margin-top: 12px;
  }
}
