/* ==========================================================================
   ДЕЛО — мастерская локальных дел
   Светлая редакционная система: бумага, чернила, терракота и тёмный рельс.
   ========================================================================== */

:root {
  --paper: #f1ece2;
  --paper-2: #e7dfd2;
  --paper-3: #ddd3c4;
  --card: #fbf8f2;
  --card-2: #f6f1e7;
  --ink: #1b1e1a;
  --ink-2: #41443e;
  --muted: #66675e;
  --dim: #707168;
  --line: #d8cfc0;
  --line-strong: #b9ae9c;
  --accent: #b93a14;
  --accent-2: #a9330f;
  --accent-light: #e88463;
  --accent-soft: rgba(217, 72, 28, 0.09);
  --teal: #0b6b5b;
  --gold: #b8892e;
  --ok: #2f6b45;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 18px 48px -32px rgba(49, 38, 20, 0.5);
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --mono: "Cascadia Code", "SF Mono", ui-monospace, Consolas, "Liberation Mono", monospace;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-height: 100%;
  background: var(--paper);
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(90% 65% at 85% -10%, rgba(217, 72, 28, 0.07), transparent 55%),
    radial-gradient(60% 50% at 0% 100%, rgba(11, 107, 91, 0.05), transparent 60%),
    var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px 180px;
}

::selection {
  background: var(--accent);
  color: #fff8f2;
}

h1, h2, h3, p {
  margin: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

a {
  color: var(--accent);
  text-underline-offset: 3px;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 276px minmax(0, 1fr);
  min-height: 100vh;
}

/* --- Рельс --------------------------------------------------------------- */

.rail {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 36px;
  height: 100vh;
  padding: 30px 22px 24px;
  overflow-y: auto;
  background:
    radial-gradient(120% 80% at 100% 0%, rgba(228, 87, 46, 0.14), transparent 55%),
    #1b1e1a;
  color: #f4efe4;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 7px;
  width: fit-content;
  color: inherit;
  text-decoration: none;
}

.brand__mark {
  font-family: var(--serif);
  font-size: 32px;
  font-weight: 700;
  letter-spacing: 0.14em;
  line-height: 1;
}

.brand__mark span {
  color: var(--accent-light);
}

.brand__tag {
  max-width: 180px;
  color: rgba(244, 239, 228, 0.52);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.15em;
  line-height: 1.5;
  text-transform: uppercase;
}

.nav {
  display: grid;
  gap: 2px;
  margin-top: 42px;
}

.nav__item {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 10px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}

.nav__item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.nav__item.is-active {
  background: rgba(255, 255, 255, 0.09);
  box-shadow: inset 2px 0 0 var(--accent);
}

.nav__num {
  color: rgba(244, 239, 228, 0.34);
  font-family: var(--mono);
  font-size: 10px;
}

.nav__text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.nav__label {
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.nav__sub {
  overflow: hidden;
  color: rgba(244, 239, 228, 0.42);
  font-size: 10.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav__status {
  max-width: 64px;
  overflow: hidden;
  color: rgba(244, 239, 228, 0.38);
  font-family: var(--mono);
  font-size: 9.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav__item.is-done .nav__status {
  color: #8ed3b0;
}

.rail__foot {
  display: grid;
  gap: 16px;
}

.path {
  display: grid;
  gap: 7px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
}

.path__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  color: rgba(244, 239, 228, 0.55);
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.path__top b {
  color: #f4efe4;
  font-size: 11px;
}

.path__bar {
  height: 4px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.1);
}

.path__bar i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #f0a23a);
  transition: width 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.path__hint {
  color: rgba(244, 239, 228, 0.36);
  font-size: 10.5px;
  line-height: 1.45;
}

.rail__note {
  color: rgba(244, 239, 228, 0.34);
  font-size: 10.5px;
  line-height: 1.55;
}

.rail__reset {
  justify-self: start;
  padding: 0;
  border: 0;
  background: none;
  color: rgba(244, 239, 228, 0.42);
  font-size: 10.5px;
  text-decoration: underline;
  text-decoration-color: rgba(244, 239, 228, 0.2);
  text-underline-offset: 3px;
  cursor: pointer;
}

.rail__reset:hover {
  color: #f4efe4;
}

/* --- Основная область ---------------------------------------------------- */

.main {
  min-width: 0;
  padding: 44px clamp(22px, 4vw, 64px) 22px;
}

.view {
  max-width: 1180px;
  margin: 0 auto;
}

.view.is-active {
  animation: rise 0.4s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(9px);
  }
}

.view__head {
  display: grid;
  gap: 12px;
  margin-bottom: 30px;
}

.eyebrow {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.view__title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}

h1 {
  font-family: var(--serif);
  font-size: clamp(34px, 4.4vw, 52px);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.04;
}

.lead {
  max-width: 720px;
  color: var(--ink-2);
  font-size: 15.5px;
  line-height: 1.62;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 3px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.32);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.card {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
}

.card--flat {
  box-shadow: none;
}

.card__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.card__head h2 {
  font-family: var(--serif);
  font-size: 23px;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.card__head p {
  color: var(--muted);
  font-size: 12px;
}

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

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.main__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  max-width: 1180px;
  margin: 54px auto 0;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--dim);
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* --- Поля и кнопки ------------------------------------------------------- */

.field-grid {
  display: grid;
  gap: 14px;
}

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

.field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.field--wide {
  grid-column: 1 / -1;
}

.field > span {
  color: var(--ink-2);
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: 0.03em;
}

.field em {
  color: var(--dim);
  font-style: normal;
  font-weight: 400;
}

input[type="text"],
input[type="url"],
input[type="number"],
select,
textarea {
  width: 100%;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fffdf8;
  color: var(--ink);
  font-size: 14px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

textarea {
  min-height: 96px;
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: #aaa79c;
}

input[type="text"]:focus,
input[type="url"]:focus,
input[type="number"]:focus,
select:focus,
textarea:focus {
  border-color: rgba(217, 72, 28, 0.6);
  box-shadow: 0 0 0 3px rgba(217, 72, 28, 0.1);
  outline: 0;
}

input[type="color"] {
  width: 100%;
  height: 42px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fffdf8;
  cursor: pointer;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: var(--ink);
  color: #f7f2e8;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.btn:hover {
  transform: translateY(-1px);
  background: #2b2f29;
}

.btn--accent {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff8f2;
}

.btn--accent:hover {
  border-color: var(--accent-2);
  background: var(--accent-2);
}

.btn--ghost {
  border-color: var(--line-strong);
  background: transparent;
  color: var(--ink);
}

.btn--ghost:hover {
  background: rgba(27, 30, 26, 0.055);
}

.btn--wide {
  width: 100%;
}

.btn--small {
  padding: 7px 12px;
  font-size: 11.5px;
}

.btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  transform: none;
}

.iconbtn {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: transparent;
  color: var(--ink-2);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.iconbtn:hover {
  background: rgba(27, 30, 26, 0.06);
}

.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 15px;
}

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

.fine {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

/* --- Аудит --------------------------------------------------------------- */

.audit-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 342px;
  align-items: start;
  gap: 22px;
}

.audit-body {
  min-width: 0;
}

.audit-side {
  position: sticky;
  top: 24px;
}

.meter {
  display: grid;
  gap: 9px;
  margin-bottom: 15px;
  padding: 16px 20px;
}

.meter__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.meter__top b {
  color: var(--ink);
  font-size: 11px;
}

.bar {
  height: 5px;
  overflow: hidden;
  border-radius: 99px;
  background: var(--paper-2);
}

.bar i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #e9a23e);
  transition: width 0.35s ease;
}

.audit-section {
  margin-bottom: 14px;
}

.section-head {
  display: grid;
  gap: 3px;
  margin-bottom: 4px;
}

.section-head__row {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.section-head h2 {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 600;
}

.section-head__num {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 10px;
}

.section-head p {
  color: var(--muted);
  font-size: 12px;
}

.question {
  margin: 0;
  padding: 18px 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.question:first-of-type {
  border-top: 0;
  padding-top: 10px;
}

.question legend {
  padding: 0;
  color: var(--ink);
  font-size: 14.5px;
  font-weight: 650;
  line-height: 1.4;
}

.question__help {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.5;
}

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

.option {
  position: relative;
  display: grid;
  grid-template-columns: 17px minmax(0, 1fr);
  align-items: start;
  gap: 9px;
  min-height: 66px;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fffdf8;
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.option:hover {
  border-color: var(--line-strong);
  background: #fdfaf3;
}

.option:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.option.is-checked {
  border-color: rgba(217, 72, 28, 0.62);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px rgba(217, 72, 28, 0.16);
}

.option input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.option__mark {
  display: grid;
  place-items: center;
  width: 17px;
  height: 17px;
  margin-top: 1px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: #fffdf8;
}

.option__mark::after {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: transparent;
  transition: background 0.16s ease;
}

.option.is-checked .option__mark {
  border-color: var(--accent);
}

.option.is-checked .option__mark::after {
  background: var(--accent);
}

.option__label {
  display: block;
  color: var(--ink);
  font-size: 12.5px;
  line-height: 1.42;
}

.option__fix {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.4;
}

/* Результат аудита — тёмная карточка */

.result {
  display: grid;
  gap: 15px;
  border-color: #1b1e1a;
  background:
    radial-gradient(110% 70% at 100% 0%, rgba(228, 87, 46, 0.2), transparent 58%),
    #1b1e1a;
  color: #f4efe4;
}

.result__top {
  display: flex;
  align-items: center;
  gap: 16px;
}

.score-ring {
  position: relative;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 112px;
  height: 112px;
  border-radius: 50%;
  background: conic-gradient(var(--accent) calc(var(--score, 0) * 1%), rgba(255, 255, 255, 0.12) 0);
  transition: background 0.4s ease;
}

.score-ring::before {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  background: #1b1e1a;
}

.score-ring b {
  position: relative;
  font-family: var(--serif);
  font-size: 34px;
  font-weight: 600;
  line-height: 1;
}

.score-ring span {
  position: relative;
  align-self: end;
  margin-bottom: 26px;
  color: rgba(244, 239, 228, 0.45);
  font-family: var(--mono);
  font-size: 9px;
}

.result__level {
  display: grid;
  gap: 3px;
}

.result__level small {
  color: rgba(244, 239, 228, 0.42);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.result__level h2 {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 600;
  line-height: 1.1;
}

.result__copy {
  color: rgba(244, 239, 228, 0.66);
  font-size: 12.5px;
  line-height: 1.55;
}

.result__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.result__meta span {
  padding: 3px 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  color: rgba(244, 239, 228, 0.55);
  font-family: var(--mono);
  font-size: 9px;
}

.result__fixes {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 13px 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  list-style: none;
}

.result__fixes li {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 8px;
  color: rgba(244, 239, 228, 0.75);
  font-size: 11.5px;
  line-height: 1.5;
}

.result__fixes b {
  color: var(--accent-light);
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 500;
}

.result__actions {
  display: grid;
  gap: 7px;
}

.result .btn--ghost {
  border-color: rgba(255, 255, 255, 0.22);
  color: #f4efe4;
}

.result .btn--ghost:hover {
  background: rgba(255, 255, 255, 0.08);
}

.result__tariff {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.045);
}

.result__tariff span {
  color: rgba(244, 239, 228, 0.48);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.result__tariff b {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 600;
}

.result__empty {
  color: rgba(244, 239, 228, 0.55);
  font-size: 12px;
  line-height: 1.55;
}

/* --- Смета --------------------------------------------------------------- */

.estimate-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 356px;
  align-items: start;
  gap: 22px;
}

.estimate-side {
  position: sticky;
  top: 24px;
  display: grid;
  gap: 10px;
}

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

.tariff {
  position: relative;
  display: grid;
  gap: 6px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fffdf8;
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.tariff:hover {
  border-color: var(--line-strong);
}

.tariff:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.tariff.is-checked {
  border-color: rgba(217, 72, 28, 0.62);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px rgba(217, 72, 28, 0.14);
}

.tariff input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.tariff__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.tariff__name {
  font-size: 14px;
  font-weight: 700;
}

.tariff__price {
  color: var(--ink);
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
}

.tariff__desc {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.tariff__badge {
  justify-self: start;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(11, 107, 91, 0.1);
  color: var(--teal);
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.04em;
}

.tariff[data-tariff="dobro"].is-checked {
  border-color: rgba(11, 107, 91, 0.5);
  background: rgba(11, 107, 91, 0.07);
}

.addons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}

.addon {
  position: relative;
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr) auto;
  align-items: start;
  gap: 8px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fffdf8;
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease;
}

.addon:hover {
  border-color: var(--line-strong);
}

.addon:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.addon.is-checked {
  border-color: rgba(217, 72, 28, 0.55);
  background: var(--accent-soft);
}

.addon.is-included {
  border-color: var(--line);
  background: var(--card-2);
  cursor: default;
}

.addon.is-included .addon__box {
  border-color: var(--teal);
  background: var(--teal);
}

.addon.is-included .addon__price {
  color: var(--teal);
  font-family: var(--font);
  font-size: 9.5px;
  font-weight: 600;
}

.addon input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.addon__box {
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  margin-top: 1px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: #fffdf8;
}

.addon__box::after {
  content: "";
  width: 8px;
  height: 5px;
  border-left: 1.8px solid #fff;
  border-bottom: 1.8px solid #fff;
  opacity: 0;
  transform: translateY(-1px) rotate(-45deg);
}

.addon.is-checked .addon__box {
  border-color: var(--accent);
  background: var(--accent);
}

.addon.is-checked .addon__box::after {
  opacity: 1;
}

.addon__text {
  display: grid;
  gap: 1px;
}

.addon__name {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
}

.addon__desc {
  color: var(--muted);
  font-size: 9.5px;
  line-height: 1.35;
}

.addon__price {
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 10px;
  white-space: nowrap;
}

.switch {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card-2);
  cursor: pointer;
}

.switch:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.switch__box {
  position: relative;
  flex: 0 0 auto;
  width: 34px;
  height: 20px;
  margin-top: 1px;
  border-radius: 99px;
  background: var(--paper-3);
  transition: background 0.18s ease;
}

.switch__box::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fffdf8;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform 0.18s ease;
}

.switch input:checked + .switch__box {
  background: var(--accent);
}

.switch input:checked + .switch__box::after {
  transform: translateX(14px);
}

.switch__text {
  display: grid;
  gap: 2px;
}

.switch__text b {
  font-size: 12px;
}

.switch__text small {
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.4;
}

.receipt {
  display: grid;
  gap: 12px;
  padding: 22px;
  background: #fffdf8;
  box-shadow: 0 20px 44px -34px rgba(49, 38, 20, 0.55);
}

.receipt__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 11px;
  border-bottom: 1px dashed var(--line-strong);
}

.receipt__head span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.receipt__head b {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 600;
}

.receipt__lines {
  display: grid;
  gap: 7px;
}

.receipt__line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  color: var(--ink-2);
  font-size: 11.5px;
}

.receipt__line span:last-child {
  color: var(--ink);
  font-family: var(--mono);
  font-size: 10.5px;
  white-space: nowrap;
}

.receipt__line--muted {
  color: var(--dim);
}

.receipt__line--muted span:last-child {
  color: var(--dim);
}

.receipt__total {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  padding-top: 11px;
  border-top: 1px dashed var(--line-strong);
}

.receipt__total span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.receipt__total b {
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1;
}

.receipt__meta {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 10.5px;
}

.receipt__meta b {
  color: var(--ink-2);
  font-weight: 600;
}

.receipt__note {
  padding: 9px 10px;
  border-radius: 9px;
  background: var(--card-2);
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.side-actions {
  display: grid;
  gap: 7px;
  margin-top: 10px;
}

/* --- Диалог и бумага ----------------------------------------------------- */

.dialog {
  width: min(880px, calc(100vw - 28px));
  max-height: 92vh;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 18px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 40px 100px -30px rgba(10, 8, 4, 0.65);
}

.dialog::backdrop {
  background: rgba(18, 17, 13, 0.52);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}

.dialog__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--card);
}

.dialog__bar p {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dialog__bar b {
  color: var(--ink);
}

.dialog__tools {
  display: flex;
  align-items: center;
  gap: 7px;
}

.dialog__body {
  max-height: calc(92vh - 126px);
  padding: 20px;
  overflow: auto;
}

.dialog__foot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  background: var(--card);
}

.paper {
  max-width: 760px;
  margin: 0 auto;
  padding: 44px 48px;
  background: #fff;
  color: #191a17;
  font-size: 12.5px;
  line-height: 1.55;
  box-shadow: 0 18px 44px -30px rgba(0, 0, 0, 0.4);
}

.paper * {
  box-sizing: border-box;
}

.paper__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 16px;
  border-bottom: 2px solid #191a17;
}

.paper__brand {
  font-family: var(--serif);
  font-size: 25px;
  font-weight: 700;
  letter-spacing: 0.13em;
  line-height: 1;
}

.paper__brand span {
  color: var(--accent);
}

.paper__sub {
  margin-top: 4px;
  color: #777;
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.paper__doc {
  text-align: right;
}

.paper__doc b {
  display: block;
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 600;
}

.paper__doc span {
  display: block;
  margin-top: 3px;
  color: #777;
  font-family: var(--mono);
  font-size: 9px;
}

.paper h1 {
  margin-top: 22px;
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.paper h2 {
  margin: 20px 0 8px;
  padding-bottom: 5px;
  border-bottom: 1px solid #ddd;
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.paper p {
  margin: 5px 0;
}

.paper__meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 20px;
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 7px;
  background: #f6f4ef;
  font-size: 11px;
}

.paper__meta span {
  color: #777;
}

.paper__meta b {
  color: #191a17;
  font-weight: 600;
}

.paper ul,
.paper ol {
  margin: 6px 0;
  padding-left: 18px;
}

.paper li {
  margin: 3px 0;
}

.paper table {
  width: 100%;
  margin-top: 6px;
  border-collapse: collapse;
  font-size: 11.5px;
}

.paper th,
.paper td {
  padding: 6px 4px;
  border-bottom: 1px solid #e5e1d8;
  text-align: left;
  vertical-align: top;
}

.paper th {
  color: #777;
  font-family: var(--mono);
  font-size: 8.5px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.paper td:last-child,
.paper th:last-child {
  text-align: right;
  white-space: nowrap;
}

.paper__total td {
  border-bottom: 2px solid #191a17;
  font-size: 15px;
  font-weight: 700;
}

.paper__note {
  margin-top: 12px;
  color: #777;
  font-size: 10.5px;
}

.paper__foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-top: 28px;
  padding-top: 12px;
  border-top: 1px solid #ddd;
  color: #888;
  font-size: 9.5px;
}

.paper__sign {
  min-width: 150px;
  padding-top: 16px;
  border-top: 1px solid #bbb;
  color: #555;
  text-align: center;
}

/* --- Витрина ------------------------------------------------------------- */

.demo-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 414px;
  align-items: start;
  gap: 22px;
}

.demo-side {
  position: sticky;
  top: 22px;
  display: grid;
  gap: 10px;
  justify-items: center;
}

.phone {
  position: relative;
  width: 100%;
  max-width: 392px;
  aspect-ratio: 390 / 792;
  padding: 10px;
  border-radius: 42px;
  background: #191b17;
  box-shadow:
    0 34px 70px -30px rgba(20, 16, 10, 0.55),
    inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.phone__notch {
  position: absolute;
  top: 16px;
  left: 50%;
  z-index: 2;
  width: 86px;
  height: 22px;
  border-radius: 99px;
  background: #191b17;
  transform: translateX(-50%);
  pointer-events: none;
}

.phone iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 33px;
  background: #fff;
}

.products-editor {
  display: grid;
  gap: 9px;
  margin-bottom: 12px;
}

.product-row {
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr) 30px;
  align-items: start;
  gap: 9px;
  padding: 10px;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  background: #fffdf8;
}

.product-row__emoji {
  display: grid;
}

.product-row__emoji input {
  width: 50px;
  height: 50px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card-2);
  font-size: 23px;
  text-align: center;
}

.product-row__main {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.product-row__main input {
  padding: 7px 9px;
  border-radius: 8px;
  font-size: 12.5px;
}

.product-row__meta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 92px;
  gap: 6px;
}

.product-row__meta input {
  padding: 6px 8px;
}

.product-row__remove {
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
}

.product-row__remove:hover {
  border-color: #c95846;
  color: #b83a27;
}

.empty-note {
  padding: 18px;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

/* --- Добро --------------------------------------------------------------- */

.good-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 500px;
  align-items: start;
  gap: 22px;
}

.good-side {
  position: sticky;
  top: 22px;
  display: grid;
  gap: 10px;
}

.good-intro {
  background:
    radial-gradient(100% 90% at 100% 0%, rgba(11, 107, 91, 0.1), transparent 60%),
    var(--card);
}

.good-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.good-stats > div {
  display: grid;
  gap: 2px;
  padding-right: 12px;
  border-right: 1px solid var(--line);
}

.good-stats > div:last-child {
  border-right: 0;
}

.good-stats b {
  color: var(--teal);
  font-family: var(--serif);
  font-size: 27px;
  font-weight: 600;
  line-height: 1;
}

.good-stats span {
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.3;
}

.good-intro p {
  color: var(--ink-2);
  font-size: 12.5px;
  line-height: 1.6;
}

.needs-editor {
  display: grid;
  gap: 7px;
  margin-bottom: 12px;
}

.need-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 30px;
  gap: 7px;
}

.need-row input {
  padding: 8px 10px;
  border-radius: 9px;
  font-size: 12.5px;
}

.need-row button {
  width: 30px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 17px;
  cursor: pointer;
}

.need-row button:hover {
  border-color: #c95846;
  color: #b83a27;
}

.browser {
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 28px 60px -38px rgba(30, 24, 14, 0.55);
}

.browser__bar {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 34px;
  padding: 0 12px;
  border-bottom: 1px solid var(--line);
  background: var(--card-2);
}

.browser__bar i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--line-strong);
}

.browser__bar i:first-child {
  background: #d97a68;
}

.browser__bar span {
  margin-left: 8px;
  overflow: hidden;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.browser iframe {
  display: block;
  width: 100%;
  height: 660px;
  border: 0;
  background: #fff;
}

/* --- Тост, печать, служебное --------------------------------------------- */

.toast {
  position: fixed;
  bottom: 22px;
  left: 50%;
  z-index: 120;
  max-width: calc(100vw - 32px);
  padding: 10px 17px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  background: #1b1e1a;
  color: #f4efe4;
  font-size: 12px;
  box-shadow: 0 16px 40px -18px rgba(0, 0, 0, 0.6);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 10px);
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.noscript {
  position: fixed;
  inset: auto 16px 16px;
  z-index: 200;
  padding: 14px 18px;
  border-radius: 12px;
  background: #1b1e1a;
  color: #f4efe4;
  text-align: center;
}

.print-sheet {
  display: none;
}

/* --- Адаптив ------------------------------------------------------------- */

@media (max-width: 1180px) {
  .shell {
    grid-template-columns: 250px minmax(0, 1fr);
  }

  .audit-grid,
  .estimate-grid,
  .demo-grid,
  .good-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .audit-side,
  .estimate-side,
  .demo-side,
  .good-side {
    position: static;
  }

  .audit-side {
    order: -1;
    max-width: 100%;
  }

  .result {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
  }

  .result__top,
  .result__copy,
  .result__fixes,
  .result__actions,
  .result__meta,
  .result__tariff {
    grid-column: 1 / -1;
  }

  .result__top {
    align-items: center;
  }

  .demo-grid,
  .good-grid {
    gap: 18px;
  }

  .demo-side {
    max-width: 430px;
    width: 100%;
    margin: 0 auto;
  }

  .good-side {
    width: 100%;
  }

  .browser iframe {
    height: 560px;
  }
}

@media (max-width: 920px) {
  .shell {
    display: block;
  }

  .rail {
    position: sticky;
    top: 0;
    z-index: 60;
    display: block;
    height: auto;
    padding: 11px 16px;
    overflow: visible;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .rail__top {
    display: flex;
    align-items: center;
    gap: 16px;
  }

  .brand {
    flex: 0 0 auto;
    gap: 0;
  }

  .brand__mark {
    font-size: 22px;
  }

  .brand__tag {
    display: none;
  }

  .nav {
    display: flex;
    gap: 4px;
    min-width: 0;
    margin: 0 0 0 auto;
    overflow-x: auto;
    scrollbar-width: none;
  }

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

  .nav__item {
    grid-template-columns: auto;
    width: auto;
    flex: 0 0 auto;
    padding: 8px 11px;
    border-radius: 9px;
  }

  .nav__item.is-active {
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
  }

  .nav__num,
  .nav__sub,
  .nav__status {
    display: none;
  }

  .nav__label {
    font-size: 12.5px;
    white-space: nowrap;
  }

  .rail__foot {
    display: none;
  }

  .main {
    padding: 28px clamp(16px, 4vw, 32px) 20px;
  }

  .view.is-active {
    animation-duration: 0.3s;
  }

  .audit-side {
    order: 0;
  }

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

@media (max-width: 720px) {
  .view__head {
    gap: 10px;
    margin-bottom: 22px;
  }

  h1 {
    font-size: clamp(30px, 8.2vw, 40px);
  }

  .lead {
    font-size: 14px;
  }

  .card {
    padding: 18px;
    border-radius: 15px;
  }

  .card__head {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
    margin-bottom: 14px;
  }

  .field-grid--2 {
    grid-template-columns: 1fr;
  }

  .field--wide {
    grid-column: auto;
  }

  .tariffs,
  .addons {
    grid-template-columns: 1fr;
  }

  .options {
    grid-template-columns: 1fr;
  }

  .option {
    min-height: 0;
  }

  .result {
    padding: 20px;
  }

  .score-ring {
    width: 98px;
    height: 98px;
  }

  .score-ring span {
    margin-bottom: 21px;
  }

  .score-ring b {
    font-size: 29px;
  }

  .result__level h2 {
    font-size: 21px;
  }

  .paper {
    padding: 26px 22px;
  }

  .paper__head {
    flex-direction: column;
    gap: 12px;
  }

  .paper__doc {
    text-align: left;
  }

  .paper h1 {
    font-size: 23px;
  }

  .paper__meta {
    grid-template-columns: 1fr;
  }

  .dialog__body {
    padding: 12px;
  }

  .product-row {
    grid-template-columns: 42px minmax(0, 1fr) 28px;
    gap: 7px;
    padding: 8px;
  }

  .product-row__emoji input {
    width: 42px;
    height: 46px;
    font-size: 20px;
  }

  .product-row__meta {
    grid-template-columns: minmax(0, 1fr) 78px;
  }

  .good-stats {
    gap: 8px;
  }

  .good-stats > div {
    padding-right: 8px;
  }

  .good-stats b {
    font-size: 23px;
  }

  .browser iframe {
    height: 480px;
  }

  .main__foot {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
    margin-top: 36px;
  }

  .card--actions {
    align-items: stretch;
    flex-direction: column;
  }

  .card--actions .btn {
    width: 100%;
  }

  .dialog__foot {
    flex-direction: column;
  }

  .dialog__foot .btn {
    width: 100%;
  }
}

@media (max-width: 420px) {
  .rail {
    padding: 9px 12px;
  }

  .brand__mark {
    font-size: 19px;
  }

  .nav__item {
    padding: 7px 9px;
  }

  .nav__label {
    font-size: 11.5px;
  }

  .main {
    padding: 22px 12px 16px;
  }

  .card {
    padding: 15px;
  }

  .phone {
    border-radius: 34px;
    padding: 7px;
  }

  .phone iframe {
    border-radius: 28px;
  }

  .good-stats b {
    font-size: 20px;
  }

  .good-stats span {
    font-size: 9.5px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* --- Печать -------------------------------------------------------------- */

@page {
  size: A4;
  margin: 14mm;
}

@media print {
  html,
  body {
    background: #fff !important;
  }

  body.is-printing .shell,
  body.is-printing .toast,
  body.is-printing .dialog,
  body.is-printing .noscript {
    display: none !important;
  }

  body.is-printing .print-sheet {
    display: block !important;
  }

  .print-sheet .paper {
    max-width: none;
    padding: 0;
    box-shadow: none;
  }

  .print-sheet .paper__head {
    border-bottom-color: #000;
  }

  .print-sheet a {
    color: inherit;
    text-decoration: none;
  }
}
