:root {
  --primary: #f97316;
  --primary-dark: #ea580c;
  --accent: #14b8a6;
  --bg: #fff7ed;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --border: #fed7aa;
  --success: #10b981;
  --error: #ef4444;
  --radius: 16px;
  --font: "Segoe UI", system-ui, sans-serif;
}

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

html {
  width: 100%;
  height: 100%;
  background: linear-gradient(160deg, var(--bg) 0%, #fff 45%, #f0fdfa 100%);
}

body {
  width: 100%;
  min-height: 100%;
  font-family: var(--font);
  color: var(--text);
  background: linear-gradient(160deg, var(--bg) 0%, #fff 45%, #f0fdfa 100%);
  line-height: 1.5;
}

html,
html.page-install-root {
  width: 100%;
  height: auto;
  margin: 0;
  background: #fff;
}

body.page-install {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: auto;
  margin: 0;
  padding: 15px;
  overflow-x: hidden;
  background: #fff;
  box-sizing: border-box;
  font-family: var(--font);
  color: var(--text);
  line-height: 1.5;
}

.install-frame {
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

.install-frame__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.install-frame__head .brand-row {
  margin-bottom: 0;
  align-items: flex-start;
}
.install-frame__head .brand-logo {
  width: 36px;
  height: 36px;
  font-size: 1rem;
  border-radius: 10px;
  flex-shrink: 0;
}
.install-frame__title {
  margin: 2px 0 0;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--text);
}
.install-frame__version {
  flex-shrink: 0;
  font-size: 0.75rem;
  color: var(--muted);
  padding: 4px 8px;
  border-radius: 999px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.install-frame__lead {
  margin: 0 0 14px;
  font-size: 0.92rem;
  color: var(--muted);
  line-height: 1.5;
}

.btn-primary--install,
.btn-secondary--install {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 11px 16px;
  font-size: 0.92rem;
  box-sizing: border-box;
}

.install-frame__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 14px;
}
body.page-install .install-frame__actions {
  grid-template-columns: 1fr 1fr;
}

.install-frame__feedback {
  margin: 16px auto 0;
  padding: 16px 18px;
  max-width: 480px;
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff7ed;
  box-sizing: border-box;
}
.install-frame__feedback[hidden] { display: none !important; }
.install-frame__feedback-title {
  margin: 0 0 6px;
  font-size: 1rem;
  color: var(--primary-dark);
}
.install-frame__feedback-hint {
  margin: 0 0 12px;
  font-size: 0.85rem;
  color: var(--muted);
}

.feedback-form--compact {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}
.feedback-form--compact label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.85rem;
  width: 100%;
}
.feedback-form--compact input,
.feedback-form--compact select,
.feedback-form--compact textarea {
  padding: 8px 10px;
  font-size: 0.9rem;
}

body.page-install .status-block {
  margin-top: 12px;
}
body.page-install .btn-primary {
  min-width: 0;
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
}

.app-card {
  position: relative;
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 32px clamp(24px, 5vw, 64px) 40px;
}
.app-card--install {
  width: 100%;
  min-width: 100%;
  max-width: none;
  padding: 32px clamp(32px, 6vw, 72px) 36px;
}
.app-card.wide { max-width: 100%; }

.brand-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.brand-logo {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}
.brand-name {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary-dark);
}

.app-title {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 10px;
}
.app-desc {
  color: var(--muted);
  margin-bottom: 20px;
}

.meta-list { margin-bottom: 20px; }
.meta-list div {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}
.meta-list dt { color: var(--muted); }
.meta-list code {
  font-size: 0.78rem;
  word-break: break-all;
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 6px;
}
.meta-list code.small { font-size: 0.72rem; }

.feature-list {
  margin: 0 0 24px 1.2rem;
  color: var(--muted);
}
.feature-list li { margin-bottom: 6px; }

.btn-row { display: flex; gap: 12px; flex-wrap: wrap; }

.btn-primary, .btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  border-radius: 12px;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  font-size: 0.95rem;
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  box-shadow: 0 8px 24px rgba(249, 115, 22, 0.25);
  min-width: 280px;
}
.btn-primary:disabled,
.btn-primary.is-done {
  background: #e2e8f0;
  color: #64748b;
  box-shadow: none;
  opacity: 1;
  cursor: default;
  pointer-events: none;
}
.btn-secondary {
  background: #fff;
  color: var(--primary-dark);
  border: 1px solid var(--border);
}

.status-block {
  display: none;
  margin-top: 20px;
  padding: 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.status-block.visible { display: block; }
.status-block.success { background: #ecfdf5; border-color: #a7f3d0; }
.status-block.error { background: #fef2f2; border-color: #fecaca; }
.status-title { font-weight: 700; margin-bottom: 6px; }
.status-msg { color: var(--muted); font-size: 0.9rem; }

.doc-section { margin-bottom: 28px; }
.doc-section h2 {
  font-size: 1.1rem;
  margin-bottom: 10px;
  color: var(--primary-dark);
}
.doc-section ol { margin-left: 1.2rem; color: var(--muted); }
.doc-section p { color: var(--muted); margin-bottom: 10px; }

.doc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin-bottom: 12px;
}
.doc-table th,
.doc-table td {
  border: 1px solid var(--border);
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
}
.doc-table th {
  background: #fff7ed;
  color: var(--primary-dark);
  font-weight: 600;
}
.doc-table code {
  font-size: 0.85em;
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 6px;
}

.doc-gallery {
  display: grid;
  gap: 24px;
  margin-top: 16px;
}
.doc-gallery__item {
  margin: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
}
.doc-gallery__item img {
  display: block;
  width: 100%;
  height: auto;
  background: #f8fafc;
}
.doc-gallery__item figcaption {
  padding: 12px 16px;
  font-size: 0.9rem;
  color: var(--muted);
  display: grid;
  gap: 4px;
}
.doc-gallery__item figcaption strong {
  color: var(--primary-dark);
}

.feedback-form {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}
.feedback-form label {
  display: grid;
  gap: 6px;
  font-size: 0.9rem;
  font-weight: 500;
}
.feedback-form input,
.feedback-form select,
.feedback-form textarea {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font: inherit;
}
.feedback-form .checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 400;
}

.app-footer {
  margin-top: 28px;
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
}
.app-footer a { color: var(--primary-dark); }

/* ——— Общий layout сайта ——— */
body.page-site,
body.page-docs {
  min-height: 100vh;
  padding: 0;
}

body.page-install.page-site {
  min-height: auto;
  overflow-x: hidden;
}

.site-shell,
.docs-shell {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 clamp(12px, 2vw, 32px);
}

.site-card,
.docs-card {
  background: var(--card);
  border-radius: 16px;
  border: 1px solid var(--border);
  box-shadow: 0 8px 32px rgba(15, 23, 42, 0.06);
  padding: 0 clamp(20px, 3vw, 40px);
  overflow: hidden;
}

.site-header,
.docs-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  text-align: left;
  margin: 0 calc(-1 * clamp(20px, 3vw, 40px)) 0;
  padding: 14px clamp(20px, 3vw, 40px);
  min-height: 0;
  background: linear-gradient(135deg, #fff7ed 0%, #ffffff 60%, #f0fdfa 100%);
  border-bottom: 1px solid var(--border);
}

.site-header__brand,
.docs-header .brand-row {
  justify-content: flex-start;
  margin-bottom: 0;
  flex-shrink: 0;
  text-decoration: none;
  color: inherit;
}
.site-header__brand:hover .brand-name {
  color: var(--primary);
}

.site-header .brand-logo,
.docs-header .brand-logo {
  width: 32px;
  height: 32px;
  font-size: 1rem;
  border-radius: 8px;
}
.site-header .brand-name,
.docs-header .brand-name {
  font-size: 0.72rem;
}

.site-header__title,
.docs-header .app-title {
  margin: 0;
  font-size: clamp(1.1rem, 2vw, 1.4rem);
  font-weight: 700;
  flex: 1 1 12rem;
  min-width: 0;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}
.site-nav a {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--muted);
  border: 1px solid transparent;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.site-nav a:hover {
  color: var(--primary-dark);
  background: #fff;
  border-color: var(--border);
}
.site-nav a.is-active {
  color: var(--primary-dark);
  background: #fff;
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(249, 115, 22, 0.12);
}

.site-body {
  padding: 20px 0 4px;
}

.site-lead {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.7;
}
.site-aside-links {
  margin: 16px 0 0;
  font-size: 0.9rem;
  color: var(--muted);
}
.site-aside-links a { color: var(--primary-dark); }

.site-body .btn-primary {
  max-width: 100%;
}

.docs-breadcrumb {
  margin: 0 0 16px;
  font-size: 0.9rem;
}
.docs-breadcrumb a {
  color: var(--primary-dark);
  text-decoration: none;
  font-weight: 600;
}
.docs-breadcrumb a:hover { text-decoration: underline; }

.apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 8px;
}

.apps-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #fff;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.apps-card:hover {
  border-color: var(--primary);
  box-shadow: 0 8px 24px rgba(249, 115, 22, 0.1);
}

.apps-card__head {
  display: flex;
  align-items: center;
  gap: 14px;
}
.apps-card__icon {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--border);
}
.apps-card__icon--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  font-weight: 800;
  font-size: 1.4rem;
}
.apps-card__meta { min-width: 0; }
.apps-card__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}
.apps-card__version {
  font-size: 0.78rem;
  color: var(--muted);
}
.apps-card__summary {
  margin: 0;
  font-size: 0.92rem;
  color: var(--muted);
  line-height: 1.55;
  flex: 1;
}
.apps-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.apps-card__tags li {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary-dark);
  background: #fff7ed;
  border: 1px solid var(--border);
}
.apps-card__link {
  align-self: flex-start;
  margin-top: auto;
}

.docs-lead {
  margin: 0;
  text-align: left;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.7;
  max-width: none;
}

.doc-section {
  margin-bottom: 36px;
  padding: clamp(20px, 3vw, 28px) clamp(18px, 3vw, 32px);
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}
.doc-section--intro {
  background: transparent;
  border: none;
  padding: 0 0 12px;
  margin-bottom: 28px;
}
.doc-section h2 {
  text-align: left;
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  margin-bottom: 18px;
  padding-left: 14px;
  border-left: 4px solid var(--primary);
  color: var(--primary-dark);
}

.docs-steps {
  margin: 0;
  padding-left: 1.5rem;
  color: var(--text);
  font-size: 1rem;
  line-height: 1.6;
  columns: 1;
}
@media (min-width: 900px) {
  .docs-steps {
    columns: 2;
    column-gap: 48px;
  }
  .docs-steps li {
    break-inside: avoid;
  }
}
.docs-steps li {
  margin-bottom: 10px;
  padding-left: 4px;
}
.docs-steps li::marker {
  color: var(--primary);
  font-weight: 700;
}

.docs-note {
  margin: 14px 0 0;
  padding: 12px 14px;
  font-size: 0.9rem;
  color: var(--text);
  background: #fff7ed;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.doc-section .doc-table {
  font-size: 0.9rem;
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
}

/* Слайдер */
.doc-slider {
  margin: 0;
  max-width: 100%;
}

.doc-slider__viewport {
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #f8fafc;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.06);
}

.doc-slider__track {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
}

.doc-slider__slide {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
  display: flex;
  flex-direction: column;
}
.doc-slider__slide.is-active {
  opacity: 1;
  pointer-events: auto;
}

.doc-slider__slide img {
  width: 100%;
  height: 100%;
  flex: 1;
  object-fit: contain;
  background: #0f172a;
  min-height: 240px;
}

.doc-slider__slide figcaption {
  padding: 10px 14px;
  font-size: 0.82rem;
  color: var(--muted);
  text-align: center;
  background: #fff;
  border-top: 1px solid var(--border);
}
.doc-slider__slide figcaption strong {
  display: block;
  color: var(--primary-dark);
  margin-bottom: 2px;
}

.doc-slider__controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 12px;
}

.doc-slider__btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--primary-dark);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, border-color 0.2s;
}
.doc-slider__btn:hover {
  background: #fff7ed;
  border-color: var(--primary);
}

.doc-slider__dots {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  min-width: 80px;
  max-width: 280px;
}

.doc-slider__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: none;
  padding: 0;
  background: #e2e8f0;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}
.doc-slider__dot.is-active {
  background: var(--primary);
  transform: scale(1.15);
}

/* Форма заявки */
.doc-form-panel {
  margin-top: 8px;
  margin-left: auto;
  margin-right: auto;
  max-width: 720px;
  padding: clamp(24px, 4vw, 32px) clamp(20px, 4vw, 36px);
  border-radius: 16px;
  background: linear-gradient(180deg, #fff7ed 0%, #ffffff 100%);
  border: 2px solid var(--primary);
  box-shadow: 0 8px 28px rgba(249, 115, 22, 0.12);
}

.doc-form-panel h2 {
  color: var(--primary-dark);
}

.docs-form-intro {
  text-align: center;
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 16px;
}

.doc-form-panel .feedback-form {
  margin-top: 0;
}

.btn-primary--block {
  width: 100%;
  min-width: 0;
}

.site-footer,
.docs-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 8px calc(-1 * clamp(20px, 3vw, 40px)) 0;
  padding: 20px clamp(20px, 3vw, 40px) 16px;
  border-top: 1px solid var(--border);
}
.site-footer { margin-top: 16px; }

@media (max-width: 768px) {
  .site-header,
  .docs-header {
    margin-left: calc(-1 * clamp(20px, 3vw, 40px));
    margin-right: calc(-1 * clamp(20px, 3vw, 40px));
    padding: 12px clamp(20px, 3vw, 40px);
    gap: 8px;
  }
  .site-header__title,
  .docs-header .app-title {
    flex: 1 1 100%;
    order: 2;
  }
  .site-nav {
    order: 3;
    margin-left: 0;
    width: 100%;
    justify-content: flex-start;
  }
  .docs-steps { columns: 1; }
}

@media (max-width: 600px) {
  .doc-section { padding: 16px 14px; }
  .doc-form-panel { max-width: 100%; }
}
