/* ИКонтур демо. Мир: адресные таблички. Синяя эмаль с белой внутренней рамкой несёт адреса и имена,
   янтарь - только изменения, красный - только просрочка, зелёный - только подтверждённое. */
@font-face { font-family: "PT Sans Narrow"; src: url("fonts/PTSansNarrow-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }
@font-face { font-family: "PT Sans Narrow"; src: url("fonts/PTSansNarrow-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "PT Sans"; src: url("fonts/PTSans-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "PT Sans"; src: url("fonts/PTSans-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }

:root {
  --ground: #ECE8E1;
  --surface: #FFFFFF;
  --ink: #1E2430;
  --muted: #555C69;
  --line: #D8D2C7;
  --plate: #1C55B0;
  --plate-deep: #16365F;
  --plate-ink: #FFFFFF;
  --plate-soft: #E3EBF7;
  --amber: #E8A15A;
  --amber-soft: #FBE7CF;
  --amber-ink: #7A4310;
  --red: #B3261E;
  --red-soft: #F8E1DE;
  --green: #2B7A4B;
  --green-soft: #DDF0E3;
  --narrow: "PT Sans Narrow", "Arial Narrow", sans-serif;
  --sans: "PT Sans", "Segoe UI", Arial, sans-serif;
  --r: 8px;
  --ease: cubic-bezier(.16, 1, .3, 1);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--ground); color: var(--ink);
  font: 18px/1.45 var(--sans); font-variant-numeric: tabular-nums;
  display: grid; grid-template-rows: auto 1fr; min-height: 100vh;
}
::selection { background: var(--plate); color: var(--plate-ink); }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }
* { scrollbar-width: thin; scrollbar-color: #B9B2A6 transparent; }
h1, h2 { font-family: var(--narrow); font-weight: 700; line-height: 1.1; margin: 0 0 .5em; text-wrap: balance; }
h1 { font-size: 34px; }
h2 { font-size: 24px; }
p { margin: 0 0 .8em; }
[hidden] { display: none !important; }

/* Табличка: синяя эмаль, белая внутренняя рамка. */
.plate {
  background: var(--plate); color: var(--plate-ink); border-radius: var(--r);
  outline: 2px solid rgba(255, 255, 255, .92); outline-offset: -6px;
  padding: 12px 18px 11px; display: inline-flex; flex-direction: column; gap: 1px; max-width: 100%;
}
.plate-main { font: 700 30px/1.05 var(--narrow); letter-spacing: .005em; }
.plate-sub { font: 400 16px/1.25 var(--narrow); opacity: .92; }
.plate.small { padding: 5px 10px 4px; outline-width: 1.5px; outline-offset: -3.5px; }
.plate.small .plate-main { font-size: 18px; }

/* Кнопки */
.btn {
  font: 700 18px/1 var(--sans); border: 0; border-radius: var(--r); padding: 12px 18px; cursor: pointer;
  text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: background-color .15s, transform .1s;
}
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--plate); color: #fff; }
.btn.primary:hover { background: #164a9c; }
.btn.light { background: #fff; color: var(--plate-deep); }
.btn.light:hover { background: var(--plate-soft); }
.btn.ghost { background: transparent; color: #fff; box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.55); }
.btn.ghost:hover { background: rgba(255,255,255,.1); }
.btn.small { font-size: 15px; padding: 8px 12px; }
.btn.wide { width: 100%; }
.btn[disabled] { opacity: .5; cursor: default; }
.linkish { background: none; border: 0; color: var(--plate); font: 700 16px var(--sans); cursor: pointer; padding: 6px 0;
  text-decoration: underline; text-underline-offset: 3px; }

/* Полоса ведущего - длинная уличная табличка */
.presenter {
  background: var(--plate-deep); color: #fff; padding: 12px 28px 12px;
  display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: "brand track ctrl" "hint hint hint";
  gap: 10px 24px; align-items: center; position: relative;
}
.presenter::after { content: ""; position: absolute; left: 0; right: 0; bottom: 6px; height: 2px; background: rgba(255,255,255,.85); }
.brand { grid-area: brand; display: flex; align-items: center; gap: 10px; }
.login-box .brand { grid-area: auto; }
.mark { font: 700 18px/1 var(--narrow); background: #fff; color: var(--plate-deep); border-radius: 6px; padding: 6px 7px 5px; }
.word { font: 700 28px/1 var(--narrow); letter-spacing: .01em; }
.track { grid-area: track; display: flex; gap: 6px; min-width: 0; }
.seg {
  flex: 1 1 0; min-width: 0; display: flex; align-items: center; gap: 8px; color: rgba(255,255,255,.92); text-decoration: none;
  padding: 6px 10px; border-radius: 6px; font: 400 17px/1.15 var(--narrow); background: rgba(255,255,255,.08);
}
.seg .num { font-weight: 700; font-size: 18px; }
.seg .lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seg.done { color: #fff; }
.seg.now { background: #fff; color: var(--plate-deep); font-weight: 700; }
.ctrl { grid-area: ctrl; display: flex; gap: 8px; }
.hint { grid-area: hint; font-size: 18px; color: #fff; padding-bottom: 6px; }
.hint b { font-family: var(--narrow); font-size: 20px; margin-right: 4px; }

/* Сцена */
.stage { padding: 24px 32px; display: grid; gap: 32px; align-items: start; min-height: 0; overflow: auto; }
.stage-1 { grid-template-columns: 380px minmax(0, 1fr); }
.stage-2, .stage-4 { grid-template-columns: minmax(0, 1fr) 380px; }
.stage-3 { grid-template-columns: minmax(0, 960px); justify-content: center; }
.lead { color: var(--muted); font-size: 18px; max-width: 70ch; }
.note { color: var(--muted); font-size: 15px; }

/* Телефон риелтора */
.phone { height: min(620px, calc(100vh - 170px)); min-height: 480px; }
.phone-screen {
  height: 100%; background: var(--surface); border-radius: 34px; border: 10px solid #232A36;
  display: flex; flex-direction: column; overflow: hidden;
}
.app-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px 10px; border-bottom: 1px solid var(--line); }
.app-title { font: 700 24px/1 var(--narrow); }
.app-sub { color: var(--muted); font-size: 15px; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--plate); color: #fff; display: grid; place-items: center;
  font: 700 16px var(--narrow); }
.phone-body { flex: 1; overflow: auto; padding: 14px 18px; }
.list-title { font: 700 18px var(--narrow); color: var(--muted); margin-bottom: 6px; }
.tasks { list-style: none; margin: 0; padding: 0; }
.tasks li { padding: 9px 0; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; font-size: 16px; }
.tasks .t-meta { color: var(--muted); font-size: 15px; }
.tasks li.fresh { background: var(--amber-soft); margin: 0 -18px; padding: 9px 18px; animation: fresh 1.2s var(--ease); }
.tasks li.empty { color: var(--muted); }
.phone-foot { border-top: 1px solid var(--line); padding: 12px 18px 14px; }

/* Ввод голосом */
.ask-row { display: flex; align-items: center; gap: 14px; }
.mic {
  flex: none; width: 64px; height: 64px; border-radius: 50%; border: 0; background: var(--plate); cursor: pointer; position: relative;
  display: grid; place-items: center; box-shadow: 0 2px 6px rgba(0,0,0,.18);
}
.mic svg { width: 28px; height: 28px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; }
.mic .mic-lvl { position: absolute; inset: -6px; border-radius: 50%; border: 3px solid var(--red); opacity: 0; transform: scale(var(--lvl, 1)); }
.mic.rec { background: var(--red); }
.mic.rec .mic-lvl { opacity: .7; }
.mic.off { background: #9AA1AC; cursor: not-allowed; }
.mic-state { font-size: 16px; color: var(--muted); line-height: 1.3; }
.typed { margin-top: 8px; display: grid; gap: 8px; }
.typed textarea { width: 100%; font: 17px/1.4 var(--sans); padding: 10px 12px; border: 1.5px solid var(--line); border-radius: var(--r);
  resize: vertical; background: #fff; color: var(--ink); }
.typed textarea:focus { border-color: var(--plate); outline: none; }
.err-box { margin-top: 10px; background: var(--red-soft); color: var(--red); border-radius: var(--r); padding: 10px 12px; font-size: 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.err-box .retry { background: var(--red); color: #fff; }

/* Предложение изменений в телефоне */
.proposal { display: grid; gap: 10px; }
.prop-said { font-size: 15px; color: var(--muted); font-style: italic; }
.prop-row { font-size: 16px; display: grid; gap: 2px; }
.prop-row .k { font: 700 16px var(--narrow); color: var(--ink); }
.was { color: var(--muted); text-decoration: line-through; text-decoration-thickness: 1.5px; }
.will { background: var(--amber-soft); color: var(--amber-ink); border-radius: 4px; padding: 2px 6px; font-weight: 700; justify-self: start; }
.prop-actions { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: 4px; }
.cands { display: grid; gap: 8px; }
.cand { text-align: left; background: #fff; border: 1.5px solid var(--line); border-radius: var(--r); padding: 10px 12px; font: 16px var(--sans);
  cursor: pointer; color: var(--ink); }
.cand:hover { border-color: var(--plate); }
.cand b { display: block; }

/* Правая часть шага 1 */
.explain h1 { font-size: 38px; max-width: 18em; }
.flow { list-style: none; counter-reset: f; margin: 18px 0 24px; padding: 0; display: grid; gap: 12px; max-width: 46em; }
.flow li { counter-increment: f; display: grid; grid-template-columns: 40px 1fr; gap: 12px; color: var(--muted); font-size: 19px; transition: color .3s; }
.flow li::before { content: counter(f); font: 700 22px/38px var(--narrow); width: 38px; height: 38px; border-radius: 50%; text-align: center;
  background: var(--surface); color: var(--muted); box-shadow: inset 0 0 0 1.5px var(--line); }
.flow li.on { color: var(--ink); }
.flow li.on::before { background: var(--plate); color: #fff; box-shadow: none; }
.flow li.ok::before { background: var(--green); color: #fff; box-shadow: none; }
.flow em { font-style: normal; }
.explain.done h1 { font-size: 28px; margin-bottom: .3em; }
.explain.done .flow { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 8px 0 16px; font-size: 17px; }
.explain.done .flow .d { display: none; }
.explain.done .flow li { grid-template-columns: 34px auto; align-items: center; }
.explain.done .flow li::before { width: 32px; height: 32px; font-size: 18px; line-height: 32px; }
.card-big { background: var(--surface); border-radius: 12px; padding: 18px 20px; display: grid; gap: 12px; max-width: 760px; }
.card-big .plate-main { font-size: 34px; }
.fix { background: var(--amber-soft); border-radius: var(--r); padding: 10px 14px; color: var(--amber-ink); display: grid; gap: 4px;
  animation: fix .9s var(--ease) both; }
.fix h3 { font: 700 22px/1.1 var(--narrow); margin: 0; }
.card-meta { display: flex; flex-wrap: wrap; gap: 8px 24px; font-size: 16px; color: var(--muted); }
.card-meta b { color: var(--ink); }
@keyframes fix { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes fresh { from { background: var(--amber); } }

/* Пульт руководителя */
.figures { display: grid; grid-template-columns: repeat(4, 1fr); background: var(--surface); border-radius: 12px; margin-bottom: 20px; }
.fig { padding: 14px 18px; border-left: 1px solid var(--line); }
.fig:first-child { border-left: 0; }
.fig-n { font: 700 46px/1 var(--narrow); }
.fig-l { color: var(--muted); font-size: 16px; }
.fig-s { font: 700 18px var(--narrow); color: var(--plate-deep); margin-top: 2px; }
.fig.warn .fig-n { color: var(--red); }
.board-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 20px; }
.panel { background: var(--surface); border-radius: 12px; padding: 16px 18px; }
.funnel { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.funnel li { display: grid; grid-template-columns: 130px 1fr 34px; align-items: center; gap: 10px; font-size: 16px; }
.f-bar { height: 18px; background: var(--plate-soft); border-radius: 4px; overflow: hidden; }
.f-bar span { display: block; height: 100%; background: var(--plate); border-radius: 4px; }
.f-n { text-align: right; font-weight: 700; }
.tbl { width: 100%; border-collapse: collapse; font-size: 16px; }
.tbl th { text-align: left; font: 700 16px var(--narrow); color: var(--ink); padding: 6px 8px; border-bottom: 1.5px solid var(--line); }
.tbl td { padding: 7px 8px; border-bottom: 1px solid var(--line); }
.tbl td:first-child { white-space: nowrap; }
.side .tbl td:first-child { white-space: normal; }
.tbl td:not(:first-child), .tbl th:not(:first-child) { text-align: right; }
.tbl tr.hot td { background: var(--red-soft); }
.side { background: var(--surface); border-radius: 12px; padding: 18px; display: grid; gap: 12px; align-content: start; }
.answer { font-size: 18px; display: grid; gap: 12px; }

/* Регламент */
.reg .ask { background: var(--surface); border-radius: 12px; padding: 18px; margin-top: 16px; }
.reg.answered .lead { display: none; }
.reg.answered h1 { font-size: 28px; }
.reg-answer { background: var(--surface); border-radius: 12px; padding: 20px; font-size: 20px; }
.cite { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: start; padding-top: 12px; border-top: 1px solid var(--line); font-size: 17px; }
.miss { color: var(--muted); }

/* Объект и аналоги */
.obj-head { display: flex; justify-content: space-between; gap: 24px; align-items: flex-start; margin-bottom: 14px; }
.obj-head .plate-main { font-size: 40px; }
.obj-head .lead { margin-top: 10px; }
.asked { background: var(--surface); border-radius: 12px; padding: 12px 16px; text-align: right; flex: none; }
.asked-n { font: 700 30px/1.1 var(--narrow); }
.analogs { background: var(--surface); border-radius: 12px; overflow: hidden; }
.analogs td:first-child { font-family: var(--narrow); font-weight: 700; font-size: 18px; color: var(--plate-deep); }
.verdict { display: grid; grid-template-columns: 1.3fr 1fr 1fr; background: var(--surface); border-radius: 12px; margin-top: 12px; }
.verdict > div { padding: 12px 18px; border-left: 1px solid var(--line); }
.verdict > div:first-child { border-left: 0; }
.v-n { font: 700 28px/1.15 var(--narrow); }
.v-n.main { color: var(--plate); font-size: 36px; }
.v-n.gap { color: var(--amber-ink); }
.justify-text { font-size: 17px; white-space: pre-line; max-height: 34vh; overflow: hidden;
  mask-image: linear-gradient(#000 70%, transparent); }
.justify-wrap.open .justify-text { max-height: none; mask-image: none; }
.v-n { white-space: nowrap; }

/* Пилот */
.stage-5 { grid-template-columns: minmax(0, 1fr) 360px; align-items: center; }
.pilot { display: contents; }
.pilot h1 { font-size: 52px; max-width: 14em; }
.pilot-points { list-style: none; margin: 0 0 18px; padding: 0; display: grid; gap: 10px; font-size: 24px; }
.pilot-points li { padding-left: 26px; position: relative; }
.pilot-points li::before { content: ""; position: absolute; left: 0; top: .5em; width: 12px; height: 12px; border-radius: 3px; background: var(--plate); }
.pilot-tech { color: var(--muted); font-size: 18px; }
.pilot-qr { background: var(--surface); border-radius: 16px; padding: 22px; text-align: center; }
.qr svg { width: 100%; height: auto; display: block; }
.qr-l { font: 700 24px var(--narrow); margin-top: 8px; }
.qr-c { color: var(--muted); }

/* Занят */
.busy { position: fixed; inset: auto 0 24px 0; display: grid; place-items: center; pointer-events: none; }
.busy-box { background: var(--plate-deep); color: #fff; border-radius: 999px; padding: 12px 22px; font: 700 18px var(--sans);
  display: flex; align-items: center; gap: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.22); }
.spin { width: 18px; height: 18px; border-radius: 50%; border: 3px solid rgba(255,255,255,.35); border-top-color: #fff; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Вход */
body.login { display: grid; place-items: center; grid-template-rows: none; }
.login-box { background: var(--surface); border-radius: 16px; padding: 32px; width: min(420px, calc(100vw - 32px)); display: grid; gap: 10px; }
.login-box .brand.big .word { font-size: 40px; color: var(--plate-deep); }
.login-box .brand.big .mark { background: var(--plate); color: #fff; font-size: 22px; }
.login-box .sub { color: var(--muted); margin-bottom: 10px; }
.login-box label { font: 700 16px var(--narrow); color: var(--muted); }
.login-box input { font: 20px var(--sans); padding: 12px; border: 1.5px solid var(--line); border-radius: var(--r); }
.login-box input:focus { border-color: var(--plate); outline: none; }
.err { color: var(--red); margin: 0; }

/* Узкие экраны и проектор 1024 */
@media (max-width: 1180px) {
  .seg .lbl { display: none; }
  .seg { flex: 0 0 auto; justify-content: center; }
  .stage { padding: 18px 20px; gap: 20px; }
  .stage-1 { grid-template-columns: 340px minmax(0, 1fr); }
  .stage-2, .stage-4 { grid-template-columns: minmax(0, 1fr) 320px; }
  .explain h1 { font-size: 30px; }
  .board-cols { grid-template-columns: 1fr; }
  .v-n { font-size: 24px; } .v-n.main { font-size: 30px; }
}
@media (max-width: 760px) {
  .presenter { grid-template-columns: 1fr; grid-template-areas: "brand" "ctrl" "track" "hint"; padding: 10px 16px 12px; }
  .ctrl { flex-wrap: wrap; }
  .ctrl .btn { font-size: 15px; padding: 8px 12px; }
  .word { font-size: 24px; }
  .hint { font-size: 16px; }
  .stage > * { min-width: 0; }
  .tbl { display: block; overflow-x: auto; }
  .stage, .stage-1, .stage-2, .stage-4, .stage-5 { grid-template-columns: 1fr; padding: 16px; }
  .phone { height: 560px; }
  .figures, .verdict { grid-template-columns: 1fr 1fr; }
  .obj-head { flex-direction: column; }
  .pilot h1 { font-size: 36px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
