/* ---------- главная: один экран ---------- */
.page-dark { background: var(--ink); }
.home {
  min-height: 100vh; min-height: 100svh;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding-top: calc(var(--header-h) + 48px);
}
.home__inner {
  width: 100%; max-width: calc(var(--container) + 2 * var(--gutter));
  margin: 0 auto; padding: 0 var(--gutter) clamp(40px, 6vw, 88px);
}
.home .display { max-width: 11em; }
.home__text { max-width: 36em; margin: 40px 0; color: var(--muted-dark); }

/* бегущая строка */
.ticker { position: relative; overflow: hidden; border-top: 1px solid var(--line-dark); }
.ticker__track { display: flex; width: max-content; animation: ticker 150s linear infinite; }
.ticker__track:hover, .ticker.is-paused .ticker__track { animation-play-state: paused; }
.ticker__list { display: flex; margin: 0; padding: 0; list-style: none; }
.ticker__item {
  display: flex; align-items: center; white-space: nowrap;
  padding: 22px 0; color: var(--muted-dark);
  font-family: var(--font-accent); font-style: italic; font-size: clamp(18px, 1.8vw, 24px); line-height: 1.2;
}
.ticker__item::after { content: ""; width: 5px; height: 5px; margin: 0 36px; border-radius: 50%; background: currentColor; opacity: .5; }
.ticker__toggle {
  position: absolute; right: 0; top: 0; bottom: 0; width: 64px;
  display: grid; place-items: center;
  background: var(--ink); color: var(--white); border: 0; border-left: 1px solid var(--line-dark); cursor: pointer;
}
.ticker__toggle:focus-visible { outline-offset: -4px; }
.ticker__toggle .i-play { display: none; }
.ticker.is-paused .i-play { display: inline; }
.ticker.is-paused .i-pause { display: none; }
@keyframes ticker { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) {
  .ticker { overflow-x: auto; }
  .ticker__toggle { display: none; }
}
.reveal { animation: curtain var(--dur-scene) var(--ease) both; }
.reveal-late { animation: fade 300ms var(--ease) var(--dur-scene) both; }
@keyframes curtain { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@media (max-width: 760px) {
  .home .btn { width: 100%; }
  .ticker__item { padding: 16px 0; }
  .ticker__item::after { margin: 0 24px; }
  .ticker__toggle { width: 52px; }
}

/* ---------- врезки ---------- */
.note { border-left: 2px solid var(--red); border-radius: 0; padding: 20px 24px; background: var(--white); }
.section--white .note { background: var(--paper); }
.section--dark .note { background: var(--graphite); }
.note__title { display: flex; align-items: center; gap: 10px; font-weight: 500; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 8px; }
.note p:last-child { margin-bottom: 0; }
.callout { display: flex; gap: 14px; padding: 16px 20px; border-left: 2px solid var(--fg); background: var(--white); font-size: 15px; line-height: 1.5; }
.callout .icon { margin-top: 2px; }
.lock { display: flex; gap: 16px; align-items: flex-start; padding: 24px; border: 1px solid var(--line); }

/* ---------- формы ---------- */
.field { display: grid; gap: 8px; align-content: start; }
.field > label, .field > .label, fieldset > legend {
  font-weight: 500; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; padding: 0;
}
.req { color: var(--red); margin-left: 2px; }
.hint { font-size: 13px; line-height: 1.5; color: var(--muted); margin: 0; }
.input, .select, .textarea {
  width: 100%; min-height: 54px; padding: 0;
  background: transparent; color: inherit;
  border: 0; border-bottom: 1px solid rgba(0, 0, 0, .38); border-radius: 0;
  font: 400 17px var(--font-sans);
  transition: border-color var(--dur-ui) var(--ease);
}
.section--dark .input, .section--dark .select { border-bottom-color: rgba(255, 255, 255, .4); }
.textarea { min-height: 120px; padding: 12px 0; resize: vertical; line-height: 1.5; }
.select {
  appearance: none; -webkit-appearance: none; padding-right: 32px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%230E0E0E' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 4px center;
}
.input:focus, .select:focus, .textarea:focus { outline: none; border-bottom: 2px solid var(--red); }
.input::placeholder, .textarea::placeholder { color: var(--muted); opacity: 1; }
.field--error .input, .field--error .select, .field--error .textarea { border-bottom: 2px solid var(--ink); }
.field--error .input:focus, .field--error .select:focus { border-bottom-color: var(--red); }
.error { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; line-height: 1.45; color: var(--red); font-weight: 500; }
.error .icon { width: 18px; height: 18px; margin-top: 1px; }
.suffix-wrap { position: relative; }
.suffix-wrap .input { padding-right: 56px; }
.suffix { position: absolute; right: 0; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 15px; pointer-events: none; }

fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
fieldset > legend { margin-bottom: 12px; }
.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.choice span {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 10px 16px;
  border: 1px solid rgba(0, 0, 0, .3); border-radius: var(--radius);
  font-size: 15px; line-height: 1.3; cursor: pointer; user-select: none;
  transition: background var(--dur-ui) var(--ease), color var(--dur-ui) var(--ease), border-color var(--dur-ui) var(--ease);
}
.choice span:hover { border-color: var(--ink); }
.choice input:checked + span { background: var(--ink); color: var(--white); border-color: var(--ink); }
.choice input:focus-visible + span { outline: 2px solid var(--red); outline-offset: 3px; }
.choice--check input:checked + span::before { content: ""; width: 12px; height: 7px; border-left: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg) translate(1px, -2px); }
.scale .choice span { min-width: 44px; justify-content: center; padding: 10px 0; font-family: var(--font-num); font-size: 17px; }
.field--error .choices .choice span { border-color: var(--ink); border-width: 1px; }
.field > label.checkline { font-weight: 400; font-size: 15px; letter-spacing: normal; text-transform: none; }
.checkline { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; font-size: 15px; line-height: 1.5; min-height: 44px; }
.checkline input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--ink); flex: none; cursor: pointer; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 40px; }
.form-grid .span-2 { grid-column: 1 / -1; }
@media (max-width: 760px) { .form-grid { grid-template-columns: minmax(0, 1fr); gap: 28px; } .form-grid .span-2 { grid-column: auto; } }

/* автокомплит */
.ac { position: relative; }
.ac__list {
  position: absolute; z-index: 20; left: 0; right: 0; top: 100%;
  margin: 0; padding: 0; list-style: none;
  background: var(--white); border: 1px solid var(--ink); border-top: 0;
  max-height: 320px; overflow-y: auto;
}
.ac__item { padding: 12px 16px; cursor: pointer; display: flex; justify-content: space-between; gap: 16px; border-top: 1px solid var(--line-light); }
.ac__item:first-child { border-top: 0; }
.ac__item[aria-selected="true"], .ac__item:hover { background: var(--paper); }
.ac__meta { font-size: 13px; color: var(--muted-light); text-align: right; }
.picked { display: flex; justify-content: space-between; gap: 16px; align-items: center; min-height: 54px; border-bottom: 1px solid rgba(0,0,0,.38); }
.picked__meta { font-size: 13px; color: var(--muted); }

/* ---------- анкета ---------- */
.survey { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: clamp(32px, 6vw, 96px); align-items: start; }
.steps { position: sticky; top: calc(var(--header-h) + 32px); list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.steps li { display: grid; grid-template-columns: 44px 1fr; gap: 8px; align-items: baseline; padding: 10px 0; color: var(--muted); font-size: 15px; border-top: 1px solid var(--line); }
.steps li .num { font-size: 15px; }
.steps li[aria-current="step"] { color: var(--ink); }
.steps li[aria-current="step"] .num { color: var(--red); }
.steps li.is-done { color: var(--ink); }
.step-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 8px; }
.step-counter { font-family: var(--font-num); font-size: 15px; color: var(--muted); }
.step-intro { color: var(--muted); margin-bottom: 40px; max-width: 60ch; }
.step-actions { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; margin-top: 56px; padding-top: 32px; border-top: 1px solid var(--line); }
.step-actions .right { display: flex; gap: 16px; flex-wrap: wrap; margin-left: auto; }
.helper { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; font-size: 14px; color: var(--muted); margin-top: 4px; }
.helper .input { width: 72px; min-height: 40px; font-size: 15px; }
.helper .link-btn { color: var(--ink); }
.preview { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 24px; padding: 20px 24px; background: var(--white); border-left: 2px solid var(--ink); }
.preview .num { font-size: 32px; line-height: 1; }
.form-alert { display: flex; gap: 12px; padding: 16px 20px; border: 2px solid var(--ink); background: var(--white); margin-bottom: 32px; font-size: 15px; }
.form-alert .icon { color: var(--red); margin-top: 2px; }
.add-place { display: grid; gap: 16px; justify-items: start; margin-top: 48px; padding-top: 32px; border-top: 1px solid var(--line); }
.honeypot { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.place-tag { display: inline-block; font-weight: 500; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }

@media (max-width: 960px) {
  .survey { grid-template-columns: minmax(0, 1fr); }
  .steps { position: static; display: flex; gap: 6px; }
  .steps li { display: block; flex: 1; padding: 0; border-top: 2px solid var(--line); font-size: 0; }
  .steps li .num { display: none; }
  .steps li[aria-current="step"], .steps li.is-done { border-top-color: var(--ink); }
}
@media (max-width: 760px) {
  .step-actions { position: sticky; bottom: 0; background: var(--paper); margin-left: -16px; margin-right: -16px; padding: 16px; z-index: 5; }
  .step-actions { flex-wrap: nowrap; gap: 12px; margin-top: 40px; }
  .step-actions .btn--ghost { padding: 0 18px; }
  .step-actions .right { flex: 1; margin-left: 0; }
  .step-actions .right .btn--primary { flex: 1; }
}

/* ---------- таблицы и графики ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table th { text-align: left; font-weight: 500; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding: 12px 12px 12px 0; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 14px 12px 14px 0; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table .r { text-align: right; }
.table td.num { font-size: 18px; white-space: nowrap; }
.table .bar-cell { width: 38%; min-width: 180px; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.range { position: relative; height: 28px; }
.range__axis { position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: var(--line); }
.range__iqr { position: absolute; top: 9px; height: 10px; background: var(--muted-dark); border-radius: 1px; }
.section--dark .range__iqr { background: #5A5A5A; }
.range__med { position: absolute; top: 3px; width: 2px; height: 22px; background: var(--fg); transform: translateX(-1px); }
.range__me { position: absolute; top: 5px; width: 12px; height: 12px; margin-top: 3px; background: var(--red); border: 2px solid var(--bg); border-radius: 50%; transform: translateX(-6px); }
.bar { height: 10px; background: var(--fg); border-radius: 1px; min-width: 2px; }
.scale-labels { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 4px; font-variant-numeric: tabular-nums; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 24px; font-size: 13px; color: var(--muted); margin: 16px 0 0; }
.legend i { display: inline-block; vertical-align: middle; margin-right: 8px; }
.legend .l-iqr { width: 24px; height: 10px; background: var(--muted-dark); }
.legend .l-med { width: 2px; height: 16px; background: var(--fg); }
.legend .l-me { width: 12px; height: 12px; border-radius: 50%; background: var(--red); }
.tooltip { position: fixed; z-index: 80; pointer-events: none; background: var(--ink); color: var(--white); padding: 10px 14px; font-size: 13px; line-height: 1.5; max-width: 280px; }
.tooltip b { font-weight: 500; }
.empty { padding: 32px 0; color: var(--muted); border-top: 1px solid var(--line); }

/* ---------- аналитика ---------- */
.filters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px 32px; padding: 24px 0 32px; border-bottom: 1px solid var(--line); margin-bottom: 32px; }
.filters--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.panel-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 16px; }
.total-line { font-size: 15px; color: var(--muted); }
@media (max-width: 960px) { .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .filters { grid-template-columns: minmax(0, 1fr); } }

/* ---------- отчёт ---------- */
.kpi { padding-top: 16px; border-top: 1px solid var(--line); }
.kpi__label { font-weight: 500; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.kpi__value { font-family: var(--font-num); font-weight: 500; font-size: clamp(32px, 3.4vw, 48px); line-height: 1; }
.kpi__sub { font-size: 14px; color: var(--muted); margin-top: 8px; }
.hero-num { font-family: var(--font-num); font-weight: 500; font-size: clamp(64px, 9vw, 128px); line-height: .9; letter-spacing: -.01em; }
.place-card { background: var(--white); padding: clamp(24px, 3vw, 40px); }
.place-card + .place-card { margin-top: 24px; }
.dl { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; margin: 24px 0; }
.dl dt { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
.dl dd { margin: 4px 0 0; font-family: var(--font-num); font-weight: 500; font-size: 24px; }
.code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 15px; background: var(--paper); padding: 12px 16px; word-break: break-all; border-left: 2px solid var(--ink); }
@media (max-width: 760px) { .dl { grid-template-columns: repeat(2, minmax(0, 1fr)); } }


/* ---------- модерация ---------- */
.admin-item { background: var(--white); padding: 20px 24px; display: grid; gap: 12px; }
.admin-item + .admin-item { margin-top: 12px; }
.admin-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.admin-actions .btn { min-height: 44px; }
.flag { display: inline-block; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; border: 1px solid var(--ink); padding: 2px 8px; margin-right: 6px; }

.caption .icon, .hint .icon { display: inline-block; vertical-align: -4px; width: 16px; height: 16px; }
.tab-label { font-weight: 500; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 16px 0 8px; }
.section--dark .callout { background: var(--graphite); }
