/* Signum: кабинет. Тот же язык, что у лендинга: Golos, черный и белый, тонкие линии, акцент площадки. */
:root {
  --bg: #F3F4F6; --card: #FFFFFF; --text: #15161A; --muted: #5D6069; --line: #E1E3E8; --soft-bg: #F7F8FA;
  --a: #005BFF; --onA: #FFFFFF; --soft: #E9F0FF; --ink: #0050E0;
  --ok: #0E8A5B; --ok-bg: #E7F6EE; --warn: #9A6200; --warn-bg: #FFF4DC; --err: #9B1C1C; --err-bg: #FDECEC;
  --side: #000000; --ease: cubic-bezier(.2,.7,.2,1);
}
body.dark { --bg: #0C0D10; --card: #15161A; --text: #F2F3F5; --muted: #9EA1A9; --line: #262830; --soft-bg: #1B1D22;
  --ok: #5BD69B; --ok-bg: #12291F; --warn: #FFC24B; --warn-bg: #2E2410; --err: #F3B4B4; --err-bg: #3A1B1B; }
body[data-mp="wb"] { --a: #7B2FF7; --soft: #F2EAFF; --ink: #6A1FE0; }
body[data-mp="market"] { --a: #FFCC00; --onA: #141414; --soft: #FFF5CC; --ink: #7A5C00; }
body.dark { --soft: #1A2A52; --ink: #8DB4FF; }
body.dark[data-mp="wb"] { --soft: #2B1A4D; --ink: #B592FF; }
body.dark[data-mp="market"] { --soft: #3A3210; --ink: #FFD633; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 400 15px/1.5 'Golos Text', system-ui, sans-serif; background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }
a { color: var(--ink); }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--a); outline-offset: 2px; border-radius: 6px; }
img, svg { display: block; }
.hidden { display: none !important; }

/* ---------- Каркас ---------- */
.shell { min-height: 100vh; }
.side { display: none; }
.main { max-width: 880px; margin: 0 auto; padding: max(18px, env(safe-area-inset-top)) 18px calc(96px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 18px; }
.mtop { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.logo { display: flex; align-items: center; gap: 9px; font-size: 20px; font-weight: 700; letter-spacing: -0.02em; text-decoration: none; color: inherit; }
.logo img { width: 24px; height: 24px; }
body.dark .logo img { filter: invert(1); }
.icon-btn { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; border: 1px solid var(--line); background: var(--card); cursor: pointer; color: var(--text); }
.icon-btn svg { width: 18px; height: 18px; }

/* Нижнее меню на телефоне */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: grid; grid-template-columns: repeat(5, 1fr); align-items: end;
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--card) 88%, transparent);
  backdrop-filter: saturate(1.6) blur(18px); -webkit-backdrop-filter: saturate(1.6) blur(18px); border-top: 1px solid var(--line); }
.tabbar a { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0; font-size: 11px; font-weight: 500; color: var(--muted); text-decoration: none; }
.tabbar a svg { width: 22px; height: 22px; }
.tabbar a[aria-current="page"] { color: var(--text); }
.tabbar a.plus span.dot { width: 48px; height: 48px; margin-top: -18px; border-radius: 16px; display: grid; place-items: center; background: var(--text); color: var(--bg); box-shadow: 0 10px 24px -10px rgba(0,0,0,.5); }
.tabbar a.plus svg { width: 22px; height: 22px; }

/* Боковое меню на компе */
@media (min-width: 960px) {
  .shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); }
  .side { display: flex; flex-direction: column; gap: 6px; position: sticky; top: 0; height: 100vh; padding: 22px 14px; background: var(--side); color: #F2F3F5; }
  .side .logo { padding: 4px 10px 22px; color: #fff; }
  .side .logo img { filter: invert(1); }
  .side nav { display: flex; flex-direction: column; gap: 2px; }
  .side nav a { display: flex; align-items: center; gap: 12px; height: 42px; padding: 0 12px; border-radius: 10px; color: rgba(242,243,245,.62); text-decoration: none; font-weight: 500; transition: background .2s var(--ease), color .2s; }
  .side nav a svg { width: 18px; height: 18px; flex: none; }
  .side nav a:hover { color: #fff; background: rgba(255,255,255,.06); }
  .side nav a[aria-current="page"] { color: #fff; background: rgba(255,255,255,.1); }
  .side .new { margin: 4px 0 14px; height: 44px; display: flex; align-items: center; justify-content: center; gap: 8px; border-radius: 12px; background: #fff; color: #000; font-weight: 600; text-decoration: none; }
  .side .new svg { width: 16px; height: 16px; }
  .side .foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; padding: 14px 10px 0; border-top: 1px solid rgba(255,255,255,.1); font-size: 13px; color: rgba(242,243,245,.55); }
  .side .foot .row-f { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
  .side .foot button { background: none; border: 0; color: rgba(242,243,245,.75); cursor: pointer; padding: 0; font-size: 13px; }
  .side .foot button:hover { color: #fff; }
  .main { width: 100%; max-width: 1240px; padding: 40px 48px 72px; gap: 24px; }
  h1 { font-size: 32px; }
  .mtop, .tabbar { display: none; }
}

/* ---------- Типографика ---------- */
h1 { margin: 0; font-size: 28px; line-height: 1.15; font-weight: 600; letter-spacing: -0.025em; }
h2 { margin: 0; font-size: 18px; font-weight: 600; letter-spacing: -0.01em; }
h3 { margin: 0; font-size: 15px; font-weight: 600; }
.lead { margin: 6px 0 0; color: var(--muted); font-size: 15px; }
.muted { margin: 0; color: var(--muted); }
.sub { font-size: 13px; color: var(--muted); }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* ---------- Карточки и поля ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
label.f { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 500; color: var(--muted); }
input, textarea, select { font: inherit; font-size: 16px; color: var(--text); background: var(--soft-bg); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; width: 100%; transition: border-color .2s, box-shadow .2s; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--a); box-shadow: 0 0 0 4px color-mix(in srgb, var(--a) 16%, transparent); }
input::placeholder, textarea::placeholder { color: color-mix(in srgb, var(--muted) 70%, transparent); }
textarea { min-height: 90px; resize: vertical; }
select { appearance: none; -webkit-appearance: none; padding-right: 40px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%238A8D96' stroke-width='1.6'%3E%3Cpath d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 600px) { .grid2 { grid-template-columns: minmax(0, 1fr); } }
.hint { font-size: 13px; color: var(--muted); font-weight: 400; }

/* ---------- Кнопки ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 48px; padding: 0 20px; border: 0; border-radius: 12px; background: var(--text); color: var(--bg); font-weight: 600; font-size: 15px; cursor: pointer; text-decoration: none; transition: transform .15s var(--ease), opacity .2s; white-space: nowrap; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.accent { background: var(--a); color: var(--onA); }
.btn.line { background: transparent; color: var(--text); box-shadow: 0 0 0 1px var(--line) inset; }
.btn.line:hover { box-shadow: 0 0 0 1px var(--text) inset; }
.btn.sm { height: 38px; padding: 0 14px; font-size: 14px; border-radius: 10px; }
.btn.wide { width: 100%; }
.btn svg { width: 16px; height: 16px; }
.link { border: 0; background: none; color: var(--ink); font-size: 14px; font-weight: 600; cursor: pointer; padding: 0; text-decoration: none; }
.link.danger { color: #C0392B; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* Переключатели */
.seg { display: flex; padding: 4px; gap: 4px; border-radius: 14px; background: var(--soft-bg); border: 1px solid var(--line); }
.seg button { flex: 1 1 0; height: 40px; border: 0; border-radius: 10px; font-size: 14px; font-weight: 600; cursor: pointer; background: transparent; color: var(--muted); transition: background .2s, color .2s; }
.seg button[aria-pressed="true"] { background: var(--card); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 0 0 1px var(--line); }
.seg.mp button[aria-pressed="true"]::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--a); margin-right: 8px; vertical-align: 1px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-check { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); cursor: pointer; font-size: 14px; font-weight: 500; user-select: none; }
.chip-check input { width: 16px; height: 16px; accent-color: var(--a); margin: 0; }
.chip-check:has(input:checked) { border-color: var(--a); background: var(--soft); }
.check { display: flex; align-items: center; gap: 10px; font-size: 15px; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--a); margin: 0; flex: none; }

/* Сообщения */
.msg { border-radius: 12px; padding: 12px 14px; font-size: 14px; line-height: 1.45; }
.msg.err { background: var(--err-bg); color: var(--err); }
.msg.ok { background: var(--ok-bg); color: var(--ok); }
.msg.info { background: var(--soft); color: var(--text); }
.msg.wait { display: flex; align-items: center; gap: 10px; background: var(--soft-bg); color: var(--muted); }
.spin { width: 16px; height: 16px; flex: none; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--a); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Главная ---------- */
.hello h1 { font-size: 30px; }
.onb { gap: 16px; }
.progress { height: 6px; border-radius: 3px; background: var(--soft-bg); overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--a); border-radius: 3px; transition: width .6s var(--ease); }
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.steps li a { display: flex; align-items: center; gap: 14px; padding: 13px 0; border-top: 1px solid var(--line); color: inherit; text-decoration: none; }
.steps li:first-child a { border-top: 0; }
.steps .n { width: 28px; height: 28px; flex: none; display: grid; place-items: center; border-radius: 50%; border: 1.5px solid var(--line); font-size: 13px; font-weight: 600; color: var(--muted); }
.steps .done .n { border-color: var(--ok); background: var(--ok); color: #fff; }
.steps .t { flex: 1; min-width: 0; }
.steps .t b { display: block; font-weight: 600; }
.steps .done .t b { color: var(--muted); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--muted) 50%, transparent); }
.steps .t span { font-size: 13px; color: var(--muted); }
.steps .go { color: var(--muted); }
.steps .go svg { width: 16px; height: 16px; }
.steps li.next .n { border-color: var(--a); color: var(--a); }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 16px; }
.stat b { display: block; font-size: 30px; font-weight: 500; letter-spacing: -0.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat span { font-size: 13px; color: var(--muted); }
.quick { background: var(--side); color: #F2F3F5; border: 0; }
.quick h2 { color: #fff; }
.quick .muted { color: rgba(242,243,245,.6); }
.quick form { display: flex; gap: 8px; padding: 6px; border-radius: 16px; background: rgba(255,255,255,.07); box-shadow: 0 0 0 1px rgba(255,255,255,.14) inset; }
.quick input { background: transparent; border: 0; color: #fff; padding: 10px 10px; box-shadow: none; }
.quick input:focus { box-shadow: none; }
.quick input::placeholder { color: rgba(255,255,255,.42); }
.quick .btn { background: #fff; color: #000; }
@media (max-width: 600px) { .quick form { flex-direction: column; } .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; } .stat { padding: 12px; border-radius: 14px; } .stat b { font-size: 24px; } }

/* ---------- Мастер жалобы ---------- */
.wiz-steps { display: flex; gap: 6px; }
.wiz-steps span { flex: 1; display: flex; flex-direction: column; gap: 8px; font-size: 12px; font-weight: 600; color: var(--muted); }
.wiz-steps span::before { content: ''; height: 4px; border-radius: 2px; background: var(--line); transition: background .3s; }
.wiz-steps span.on { color: var(--text); }
.wiz-steps span.on::before, .wiz-steps span.done::before { background: var(--a); }
.wiz-nav { display: flex; gap: 10px; justify-content: space-between; }
.wiz-nav .btn.accent, .wiz-nav .btn:last-child { flex: 1; max-width: 320px; margin-left: auto; }
.card-read { display: flex; gap: 8px; }
@media (max-width: 600px) { .card-read { flex-direction: column; } }
.found { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: 14px; }
.found span { color: var(--muted); }
.summary { display: grid; grid-template-columns: minmax(120px, auto) 1fr; gap: 10px 18px; font-size: 14px; margin: 0; }
.summary dt { color: var(--muted); }
.summary dd { margin: 0; word-break: break-word; }
.preview-wrap { position: relative; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: #E9EBEF; }
.preview-wrap iframe { display: block; width: 794px; height: 1123px; border: 0; background: #fff; transform-origin: 0 0; }
.preview-tools { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.done-card { align-items: flex-start; }
.done-card .big-ok { width: 52px; height: 52px; border-radius: 50%; background: var(--ok-bg); color: var(--ok); display: grid; place-items: center; }
.done-card .big-ok svg { width: 26px; height: 26px; }

/* ---------- Дела ---------- */
.filters { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.filters button { height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); font-size: 14px; font-weight: 500; cursor: pointer; white-space: nowrap; color: var(--muted); }
.filters button[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.case { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 16px; align-items: center; }
.case .meta { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; font-size: 13px; color: var(--muted); }
.case .no { font-weight: 600; font-size: 15px; font-variant-numeric: tabular-nums; }
.case .who { font-size: 14px; margin-top: 2px; }
.mpdot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.case .side-c { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
@media (max-width: 600px) { .case { grid-template-columns: 1fr; } .case .side-c { flex-direction: row; align-items: center; justify-content: space-between; } }
select.status { width: auto; height: 34px; padding: 0 34px 0 12px; font-size: 13px; font-weight: 600; border-radius: 999px; background-position: right 12px center; }
select.status.st-draft { color: var(--muted); }
select.status.st-sent { color: #1F5FD6; background-color: color-mix(in srgb, #1F5FD6 8%, var(--card)); }
select.status.st-review { color: var(--warn); background-color: var(--warn-bg); }
select.status.st-removed { color: var(--ok); background-color: var(--ok-bg); }
select.status.st-rejected { color: var(--err); background-color: var(--err-bg); }
.empty { text-align: center; align-items: center; padding: 36px 20px; }
.empty .muted { max-width: 32em; }

/* ---------- Знаки и права ---------- */
.holder { gap: 12px; }
.holder-name { font-size: 17px; font-weight: 600; }
.doc-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; padding: 12px 14px; border-radius: 14px; background: var(--soft-bg); }
.doc-row > div:first-child { flex: 1 1 180px; min-width: 0; }
.doc-row b { font-weight: 600; }
.file-ok { display: inline-flex; align-items: center; gap: 12px; color: var(--ok); font-weight: 600; font-size: 14px; }
.file-btn input[type=file], .file-ok input[type=file], label.link input[type=file] { display: none; }
.file-btn { cursor: pointer; }
details.add { border-top: 1px dashed var(--line); padding-top: 12px; }
details.add summary { list-style: none; cursor: pointer; font-weight: 600; color: var(--ink); font-size: 14px; }
details.add summary::-webkit-details-marker { display: none; }
details.add[open] summary { margin-bottom: 12px; }
.badge { display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }

/* ---------- Компания ---------- */
.img-preview { display: flex; align-items: center; justify-content: center; padding: 14px; border-radius: 14px; border: 1px dashed var(--line); background: #fff; min-height: 90px; }
.img-preview img { max-width: 100%; max-height: 90px; object-fit: contain; }
.img-preview.letterhead img { max-height: 140px; }

/* ---------- Тариф ---------- */
.plan-now { background: var(--side); color: #F2F3F5; border: 0; }
.plan-now .muted { color: rgba(242,243,245,.6); }
.plan-now b.big { font-size: 26px; font-weight: 500; letter-spacing: -0.02em; }
.tariffs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.tariff { border: 1px solid var(--line); border-radius: 16px; padding: 16px; }
.tariff b { display: block; font-size: 15px; }
.tariff .p { font-size: 22px; font-weight: 500; letter-spacing: -0.02em; margin: 6px 0 2px; }
@media (max-width: 600px) { .tariffs { grid-template-columns: 1fr 1fr; } .tariff { padding: 12px; } }

/* ---------- Вход ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: max(24px, env(safe-area-inset-top)) 20px max(24px, env(safe-area-inset-bottom)); }
.auth-box { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 18px; }
.auth-top { display: flex; align-items: center; justify-content: space-between; }
.code-input { font-size: 28px; letter-spacing: 12px; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; }
.auth-foot { font-size: 12px; color: var(--muted); line-height: 1.5; }
.auth-foot a { color: inherit; }
#promo::placeholder, #promo2::placeholder { text-transform: none; }
.loading { min-height: 60vh; display: grid; place-items: center; color: var(--muted); }

/* Появление экранов */
.view { animation: viewIn .35s var(--ease); display: flex; flex-direction: column; gap: 18px; }
@keyframes viewIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .view { animation: none; } .progress i { transition: none; } }

/* ---------- Компоновка на компе ---------- */
.cols, .col-main, .col-side { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.holders-grid { display: flex; flex-direction: column; gap: 18px; }
.plan-mini { text-decoration: none; color: inherit; gap: 4px; }
.plan-mini b { font-size: 20px; font-weight: 600; letter-spacing: -0.01em; }
.card.tip h3 { font-size: 15px; }
.card.tip p { font-size: 14px; }
@media (min-width: 1100px) {
  .cols { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
  .cols.wide-side { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); }
  .col-side .sticky, .cols.wide-side .col-side { position: sticky; top: 24px; }
  .holders-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
  .stats { grid-template-columns: 1fr 1fr 1fr; }
  .col-side .stats { grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
  .col-side .stat { padding: 14px; }
  .col-side .stat b { font-size: 26px; }
  .card { padding: 24px; }
  .wiz-steps { max-width: 640px; }
}
@media (min-width: 960px) and (max-width: 1099px) { .card.tip { display: none; } }
@media (max-width: 1099px) { .card.tip { display: none; } }
