@font-face {
  font-family: "Inter";
  src: url("InterVariable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
:root {
  --bg: #eef0ef;
  --card: #ffffff;
  --line: #dde3e0;
  --line-strong: #c9d2ce;
  --field: #f3f5f4;
  --ink: #17211c;
  --muted: #6b7370;
  --accent: #2f5d46;
  --accent-ink: #ffffff;
  --accent-soft: #e3ece7;
  --danger: #b42318;
  --danger-soft: #fdecea;
  --warn-soft: #fff6e0;
  --radius: 16px;
  --radius-sm: 12px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.5 "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }
.wrap { max-width: 1120px; margin: 0 auto; padding: 28px 28px 64px; }
.wrap.narrow { max-width: 520px; padding: 20px 16px 48px; }

/* шапка */
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.brand { display: flex; align-items: center; gap: 12px; font-weight: 600; font-size: 18px; color: var(--ink); text-decoration: none; }
.brand-mark { width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--accent); display: grid; place-items: center; color: var(--accent); flex: none; }
.brand-mark svg { width: 18px; height: 18px; }
.top-right { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 14px; }
.top-right form { margin: 0; }
.nav { display: flex; gap: 4px; background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 4px; }
.nav a { padding: 8px 16px; border-radius: 999px; color: var(--muted); text-decoration: none; font-size: 15px; font-weight: 500; }
.nav a.on { background: var(--field); color: var(--ink); box-shadow: 0 1px 2px rgba(23, 33, 28, .08); }
.linkbtn { background: none; border: 0; color: var(--muted); font: inherit; font-size: 14px; cursor: pointer; padding: 8px 10px; border-radius: 8px; }
.linkbtn:hover { color: var(--ink); background: rgba(23, 33, 28, .05); }

/* карточка */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 32px 36px; }
.card + .card { margin-top: 20px; }
h1 { font-size: 32px; line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 8px; font-weight: 700; }
h2 { font-size: 20px; line-height: 1.25; margin: 0 0 16px; font-weight: 650; letter-spacing: -0.01em; }
.lead { color: var(--muted); font-size: 17px; margin: 0 0 28px; max-width: 62ch; }
.muted { color: var(--muted); }
.small { font-size: 14px; }

/* поля */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 20px; }
.field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.field > label, .label { font-size: 15px; font-weight: 600; }
.hint { font-size: 14px; color: var(--muted); margin-top: -2px; }
input[type=text], input[type=email], input[type=tel], input[type=date], textarea, select {
  width: 100%;
  font: inherit;
  font-size: 18px;
  color: var(--ink);
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  outline: none;
  transition: border-color .15s, background .15s, box-shadow .15s;
  -webkit-appearance: none;
  appearance: none;
}
textarea { resize: vertical; min-height: 96px; line-height: 1.4; }
input:focus, textarea:focus, select:focus { border-color: var(--accent); background: #fff; box-shadow: 0 0 0 3px var(--accent-soft); }
input.bad, textarea.bad { border-color: var(--danger); background: #fff; }
.err { color: var(--danger); font-size: 14px; min-height: 0; }
.err:empty { display: none; }

/* фишки юрлиц и галочки */
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  border: 1px solid var(--line); background: var(--field); color: var(--ink);
  border-radius: 999px; padding: 11px 20px; font: inherit; font-size: 17px; font-weight: 500; cursor: pointer;
  transition: background .15s, border-color .15s;
}
.chip:hover { border-color: var(--line-strong); }
.chip[aria-pressed=true] { background: var(--accent-soft); border-color: var(--accent); }
.chip small { display: block; font-size: 12px; color: var(--muted); font-weight: 400; }
.checks { border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.check { display: flex; align-items: center; gap: 14px; padding: 16px 18px; cursor: pointer; }
.check + .check { border-top: 1px solid var(--line); }
.check input { width: 22px; height: 22px; accent-color: var(--accent); flex: none; margin: 0; }
.check b { font-weight: 600; }

/* кнопки */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--accent); color: var(--accent-ink); border: 0; border-radius: var(--radius-sm);
  font: inherit; font-size: 17px; font-weight: 600; padding: 15px 24px; cursor: pointer; text-decoration: none;
  transition: background .15s, opacity .15s, transform .05s;
}
.btn:hover { background: #264c39; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .35; cursor: default; transform: none; background: var(--accent); }
.btn.ghost { background: var(--field); color: var(--ink); border: 1px solid var(--line); }
.btn.ghost:hover { background: #e9edeb; }
.btn.block { width: 100%; }
.btn.sm { font-size: 15px; padding: 9px 14px; border-radius: 10px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

/* итог создания ссылки */
.result { margin-top: 24px; border: 1px solid var(--accent); background: var(--accent-soft); border-radius: var(--radius-sm); padding: 20px; }
.result .url { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 15px; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; word-break: break-all; margin: 10px 0 14px; }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; font-size: 15px; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 10; }
.toast.on { opacity: 1; }

/* таблица ссылок */
table.list { width: 100%; border-collapse: collapse; font-size: 15px; }
table.list th { text-align: left; font-size: 13px; font-weight: 600; color: var(--muted); padding: 0 12px 10px 0; border-bottom: 1px solid var(--line); }
table.list td { padding: 14px 12px 14px 0; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.list tr:last-child td { border-bottom: 0; }
table.list td.acts { text-align: right; white-space: nowrap; }
.status { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; background: var(--field); color: var(--muted); }
.status.sent { background: var(--accent-soft); color: var(--accent); }
.status.failed { background: var(--danger-soft); color: var(--danger); }
.status.filling, .status.opened, .status.submitted { background: var(--warn-soft); color: #8a5a00; }
.empty { color: var(--muted); padding: 8px 0; }
details.more { margin: 4px 0 20px; }
details.more summary { cursor: pointer; color: var(--muted); font-size: 15px; list-style: none; }
details.more summary::-webkit-details-marker { display: none; }
details.more summary::before { content: "+ "; }
details.more[open] summary::before { content: "− "; }
details.more .field { margin-top: 12px; max-width: 280px; }
.flash { border-radius: var(--radius-sm); padding: 14px 16px; margin-bottom: 20px; font-size: 15px; }
.flash.ok { background: var(--accent-soft); color: var(--accent); }
.flash.bad { background: var(--danger-soft); color: var(--danger); }

/* ---- страница контрагента (телефон) ---- */
.flow .top { margin-bottom: 18px; }
.flow .brand { font-size: 16px; }
.flow .brand-mark { width: 34px; height: 34px; }
.lang { font-size: 14px; color: var(--muted); text-decoration: none; padding: 6px 10px; border-radius: 8px; }
.progress { height: 4px; background: var(--line); border-radius: 4px; overflow: hidden; margin: 0 0 18px; }
.progress i { display: block; height: 100%; background: var(--accent); width: 0; transition: width .3s ease; }
.stepno { font-size: 13px; color: var(--muted); margin: 0 0 6px; font-weight: 500; }
.flow .card { padding: 24px 20px; }
.flow h1 { font-size: 26px; }
.flow h2 { font-size: 22px; margin-bottom: 6px; }
.flow .hint { margin: 0 0 16px; font-size: 15px; }
.step { display: none; }
.step.on { display: block; animation: rise .25s ease; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.flow .actions { display: flex; gap: 10px; margin-top: 20px; }
.flow .actions .btn { flex: 1; }
.flow .actions .btn.ghost { flex: 0 0 auto; }
.doclist { margin: 0 0 18px; padding: 14px 16px; background: var(--field); border-radius: var(--radius-sm); font-size: 15px; }
.doclist div + div { margin-top: 4px; }
.consent { display: flex; gap: 12px; align-items: flex-start; font-size: 15px; line-height: 1.45; cursor: pointer; margin: 4px 0 6px; }
.consent input { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--accent); flex: none; }
.fine { font-size: 13px; color: var(--muted); margin: 8px 0 0 34px; }
.shot { border: 1.5px dashed var(--line-strong); border-radius: var(--radius-sm); background: var(--field); min-height: 180px; display: grid; place-items: center; overflow: hidden; margin-bottom: 14px; position: relative; }
.shot img { width: 100%; display: block; }
.shot svg { width: 92%; max-width: 360px; opacity: .9; }
.shot .busy { position: absolute; inset: 0; background: rgba(255, 255, 255, .82); display: grid; place-items: center; font-weight: 600; color: var(--accent); }
.shot .busy[hidden] { display: none; }
.note { border-radius: var(--radius-sm); padding: 12px 14px; font-size: 15px; margin: 0 0 14px; line-height: 1.45; }
.note.bad { background: var(--danger-soft); color: var(--danger); }
.note.warn { background: var(--warn-soft); color: #7a4f00; }
.note[hidden] { display: none; }
.fix { margin-top: 8px; background: none; border: 0; padding: 0; color: var(--accent); font: inherit; font-size: 14px; font-weight: 600; text-decoration: underline; cursor: pointer; }
.pad { position: relative; border: 1.5px solid var(--line-strong); border-radius: var(--radius-sm); background: #fff; touch-action: none; height: 220px; margin-bottom: 10px; }
.pad canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; }
.pad .base { position: absolute; left: 18px; right: 18px; bottom: 54px; border-bottom: 1px solid var(--line-strong); pointer-events: none; }
.pad .x { position: absolute; left: 18px; bottom: 58px; color: var(--muted); font-size: 18px; pointer-events: none; }
.sigprev { max-height: 90px; max-width: 100%; }
.review { border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; margin-bottom: 16px; }
.review .r { display: flex; justify-content: space-between; gap: 12px; padding: 12px 14px; font-size: 15px; }
.review .r + .r { border-top: 1px solid var(--line); }
.review .k { color: var(--muted); flex: none; }
.review .v { text-align: right; word-break: break-word; font-weight: 500; }
.review .r button { background: none; border: 0; color: var(--accent); font: inherit; font-size: 14px; padding: 0 0 0 8px; cursor: pointer; }
.docbtn { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius-sm); text-decoration: none; color: var(--ink); font-weight: 600; margin-bottom: 10px; background: var(--field); }
.docbtn span { color: var(--accent); font-size: 14px; }
.done { text-align: center; padding: 20px 4px 8px; }
.done .big { width: 64px; height: 64px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; margin: 0 auto 16px; }
.done .big svg { width: 30px; height: 30px; }
.hello { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; margin: 0 0 10px; }
input.file { display: none; }

@media (max-width: 860px) {
  .wrap { padding: 18px 16px 48px; }
  .grid2 { grid-template-columns: 1fr; gap: 0; }
  .card { padding: 24px 20px; }
  h1 { font-size: 26px; }
  table.list thead { display: none; }
  table.list tr { display: block; border-bottom: 1px solid var(--line); padding: 10px 0; }
  table.list td { display: block; border: 0; padding: 2px 0; }
  table.list td.acts { text-align: left; padding-top: 8px; }
}

/* правки после просмотра на телефоне 23.11 */
.chip[aria-pressed=true] { background: #dbe8e0; border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); font-weight: 600; }
.flow .hello { font-size: 24px; margin-bottom: 8px; }
.flow .hint.intro { font-size: 16px; color: var(--ink); margin-bottom: 14px; }
.flow .doclist { padding: 10px 14px; margin-bottom: 16px; }
.flow .consent { font-size: 14px; }
.flow .fine { font-size: 12.5px; margin: 6px 0 0 34px; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.subnav { margin-top: 12px; }
.linkbtn.acc { color: var(--accent); font-weight: 500; }
.padbar { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 4px; }
.padbar .linkbtn { font-size: 14px; padding: 6px 4px; }
.flow .shot { min-height: 150px; margin-bottom: 12px; }
.flow .shot svg { max-width: 300px; }
.review .r { align-items: center; }
.review .kv { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.review .k { font-size: 13px; }
.review .v { text-align: left; font-weight: 500; }
.review .edit { flex: none; background: none; border: 0; color: var(--accent); font: inherit; font-size: 14px; font-weight: 500; padding: 6px 0 6px 10px; cursor: pointer; }
.sigprev { max-height: 64px; }

[hidden] { display: none !important; }

/* вход: Google и разделитель */
.gbtn { display: flex; align-items: center; justify-content: center; gap: 12px; background: #fff; color: var(--ink); border: 1px solid var(--line); text-decoration: none; }
.gbtn:hover { background: var(--field); }
.gbtn svg { width: 20px; height: 20px; flex: 0 0 auto; }
.or { display: flex; align-items: center; gap: 14px; margin: 22px 0 18px; color: var(--muted); font-size: 14px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* «Шаблоны»: кнопки строки — в ряд с зазором (23.11: «кнопки слиплись»), имя файла переносится по «_» */
.acts-row { display: flex; gap: 8px; justify-content: flex-end; align-items: center; }
.acts-row form { margin: 0; display: flex; }
table.list td.fname { max-width: 230px; }
@media (max-width: 860px) {
  .acts-row { justify-content: flex-start; }
  table.list td.fname { max-width: none; }
}

.acts-row .btn:not(.ghost) { border: 1px solid transparent; } /* та же высота, что у «Скачать» с рамкой */

/* шапка кабинета на телефоне: название и «Выйти» в первой строке, вкладки — второй строкой на всю ширину */
@media (max-width: 860px) {
  .top { flex-wrap: wrap; row-gap: 14px; }
  .top .nav { order: 3; flex: 1 1 100%; }
  .top .nav a { flex: 1; text-align: center; }
}
@media (max-width: 520px) {
  .top-right > span { display: none; }
}

/* данные на любом языке: как будет в договоре (23.11, п. 3) */
.enbox { margin-top: 10px; padding: 12px 14px; background: var(--accent-soft); border-radius: var(--radius-sm); }
.enbox label { display: block; font-size: 13px; font-weight: 600; color: var(--accent); margin-bottom: 6px; }
.enbox .en { background: #fff; }
.enbox textarea.en { min-height: 0; resize: vertical; }
.enbox .fine { margin: 6px 0 0; }
.review .o { display: block; font-size: 13px; color: var(--muted); margin-top: 2px; }
.photo2 { margin: 6px 0 14px; padding: 14px; border: 1px dashed var(--line); border-radius: var(--radius-sm); }
.photo2 .hint { margin: 0 0 10px; }
.p2ok { margin: 10px 0 0; color: var(--accent); font-weight: 600; font-size: 15px; }
