@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap; src: url(/static/fonts/inter-cyrillic-wght-normal.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap; src: url(/static/fonts/inter-latin-wght-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --bg: #f6f7f9;
  --card: #ffffff;
  --text: #101828;
  --text-2: #344054;
  --muted: #667085;
  --faint: #98a2b3;
  --border: #e9ebf0;
  --border-2: #d0d5dd;
  --accent: #5b5bf0;
  --accent-600: #4a4ad6;
  --accent-50: #eff0ff;
  --accent-100: #e0e2fe;
  --ok-bg: #ecfdf3; --ok: #067647; --ok-dot: #17b26a;
  --warn-bg: #fffaeb; --warn: #b54708; --warn-dot: #f79009;
  --gray-bg: #f2f4f7; --gray: #475467; --gray-dot: #98a2b3;
  --bad-bg: #fef3f2; --bad: #b42318; --bad-dot: #f04438;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .05);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, .14), 0 2px 6px rgba(16, 24, 40, .06);
  --r: 16px;
  --r-sm: 12px;
  --tabbar: 64px;
  --safe: env(safe-area-inset-bottom, 0px);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.45 var(--font); font-feature-settings: "cv11", "ss01"; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 26px; line-height: 1.2; font-weight: 700; letter-spacing: -.02em; }
h2 { font-size: 18px; font-weight: 650; letter-spacing: -.01em; }
h3 { font-size: 15px; font-weight: 600; }
a { color: var(--accent); text-decoration: none; }
button { font: inherit; color: inherit; }
.num, .tnum { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
[hidden] { display: none !important; }

.ic { width: 20px; height: 20px; flex: none; display: inline-block; vertical-align: middle; }
.ic.sm { width: 16px; height: 16px; }
.ic.lg { width: 24px; height: 24px; }

/* Каркас */
.app { min-height: 100vh; padding-bottom: calc(var(--tabbar) + var(--safe) + 24px); }
.page { max-width: 1100px; margin: 0 auto; padding: 16px 16px 24px; }
.page-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 8px 0 16px; }
.page-title .sub { color: var(--muted); font-size: 14px; margin-top: 2px; }

.topbar { display: none; }
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: rgba(255, 255, 255, .94); backdrop-filter: saturate(180%) blur(16px); -webkit-backdrop-filter: saturate(180%) blur(16px); border-top: 1px solid var(--border); padding-bottom: var(--safe); display: grid; grid-template-columns: repeat(3, 1fr); }
.tabbar a { height: var(--tabbar); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted); font-size: 11px; font-weight: 500; }
.tabbar a .ic { width: 24px; height: 24px; }
.tabbar a.on { color: var(--accent); }

.back { display: inline-flex; align-items: center; gap: 2px; color: var(--accent); font-weight: 500; min-height: 44px; margin: -6px 0 0 -6px; padding: 0 6px; }

/* Карточки и блоки */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow); }
.card + .card, .section { margin-top: 16px; }
.card-pad { padding: 16px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 24px 4px 10px; }
.section-head h2 { font-size: 17px; }

/* Кнопки */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: var(--r-sm); border: 1px solid transparent; font-weight: 600; font-size: 15px; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, box-shadow .15s; text-decoration: none; }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 1px 2px rgba(16, 24, 40, .08); }
.btn-primary:hover { background: var(--accent-600); }
.btn-soft { background: var(--accent-50); color: var(--accent-600); }
.btn-soft:hover { background: var(--accent-100); }
.btn-ghost { background: var(--card); border-color: var(--border-2); color: var(--text-2); }
.btn-ghost:hover { background: #f9fafb; }
.btn-danger { background: var(--bad-dot); color: #fff; }
.btn-danger:hover { background: #d92d20; }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 14px; border-radius: 10px; }
.btn-block { width: 100%; }
.btn.done { background: var(--ok-bg); color: var(--ok); }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 12px; border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.icon-btn:hover { background: var(--gray-bg); color: var(--text); }
.link-btn { background: none; border: 0; padding: 0; color: var(--accent); font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; }

.fab { position: fixed; right: 16px; bottom: calc(var(--tabbar) + var(--safe) + 16px); z-index: 25; display: inline-flex; align-items: center; gap: 8px; height: 52px; padding: 0 20px 0 16px; border-radius: 26px; border: 0; background: var(--accent); color: #fff; font-weight: 600; font-size: 15px; box-shadow: 0 8px 20px rgba(91, 91, 240, .35), 0 2px 4px rgba(16, 24, 40, .1); cursor: pointer; }
.desk-only { display: none !important; }

/* Сегмент-контрол */
.seg { display: inline-flex; background: #eceef2; border-radius: 12px; padding: 3px; gap: 2px; max-width: 100%; }
.seg a, .seg button, .seg label { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; padding: 0 12px; border-radius: 9px; border: 0; background: transparent; color: var(--text-2); font-size: 14px; font-weight: 500; white-space: nowrap; cursor: pointer; }
.seg .on, .seg input:checked + span { background: #fff; color: var(--text); font-weight: 600; box-shadow: 0 1px 2px rgba(16, 24, 40, .08), 0 1px 3px rgba(16, 24, 40, .06); }
.seg label { padding: 0; position: relative; }
.seg label input { position: absolute; opacity: 0; pointer-events: none; }
.seg label span { flex: 1; display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 0 8px; border-radius: 9px; }
.seg.full { display: flex; width: 100%; }

.period { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.period .seg { flex: 1; }
.period-more { position: relative; }
.period-more > summary { list-style: none; display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; border-radius: 12px; background: #eceef2; color: var(--text-2); cursor: pointer; }
.period-more > summary::-webkit-details-marker { display: none; }
.period-more.on > summary { background: var(--accent-50); color: var(--accent); }
.period-more .pop { position: absolute; right: 0; top: 48px; z-index: 20; width: 280px; background: #fff; border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 14px; }
.period-more .pop .field + .field { margin-top: 10px; }
.period-more .pop .btn { margin-top: 12px; }
.period-note { color: var(--muted); font-size: 13px; margin: -8px 4px 12px; }

/* Ключевые цифры */
.kpis { display: grid; grid-template-columns: 1fr 1fr; }
.kpi { padding: 14px 16px; min-width: 0; }
.kpi:nth-child(odd) { border-right: 1px solid var(--border); }
.kpi:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
.kpi .label { color: var(--muted); font-size: 13px; font-weight: 500; display: flex; align-items: center; gap: 4px; min-height: 22px; }
.kpi .value { font-size: 24px; font-weight: 700; letter-spacing: -.02em; margin-top: 4px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .value .cur { font-size: 17px; font-weight: 600; color: var(--muted); margin-left: 2px; }
.kpi.accent .value { color: var(--accent); }
.kpi-foot { border-top: 1px solid var(--border); padding: 10px 16px; display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 13px; color: var(--muted); }
.kpi-foot b { color: var(--text-2); font-weight: 600; font-variant-numeric: tabular-nums; }
.details > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-top: 1px solid var(--border); color: var(--accent); font-weight: 600; font-size: 14px; }
.details > summary::-webkit-details-marker { display: none; }
.details[open] > summary .ic { transform: rotate(180deg); }
.details .ic { transition: transform .2s; }
.facts { margin: 0; padding: 0 16px 8px; }
.facts > div { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); }
.facts > div:first-child { border-top: 0; }
.facts dt { color: var(--text-2); display: flex; align-items: center; gap: 4px; }
.facts dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }

.i { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; border: 0; background: transparent; color: var(--faint); cursor: pointer; padding: 0; position: relative; }
.i::before { content: ""; position: absolute; inset: -10px; }
.i svg { width: 15px; height: 15px; }
.tipbox { position: fixed; z-index: 60; max-width: 260px; background: #101828; color: #fff; font-size: 13px; line-height: 1.4; padding: 9px 12px; border-radius: 10px; box-shadow: var(--shadow-lg); }

/* Бейджи и аватары */
.badge { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 999px; font-size: 12.5px; font-weight: 600; white-space: nowrap; background: var(--gray-bg); color: var(--gray); }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--gray-dot); }
.badge.nodot::before { display: none; }
.badge.active, .badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.active::before, .badge.ok::before { background: var(--ok-dot); }
.badge.test, .badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.test::before, .badge.warn::before { background: var(--warn-dot); }
.badge.disabled, .badge.bad { background: var(--bad-bg); color: var(--bad); }
.badge.disabled::before, .badge.bad::before { background: var(--bad-dot); }
.badge.demo { background: var(--accent-50); color: var(--accent-600); }
.badge.demo::before { display: none; }
.tag { display: inline-block; font-size: 12.5px; font-weight: 500; color: var(--text-2); background: var(--gray-bg); border-radius: 6px; padding: 1px 6px; font-variant-numeric: tabular-nums; }

.avatar { width: 44px; height: 44px; border-radius: 50%; flex: none; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 17px; }
.avatar.lg { width: 64px; height: 64px; font-size: 26px; }
.av0 { background: #eff0ff; color: #4a4ad6; }
.av1 { background: #ecfdf3; color: #067647; }
.av2 { background: #fff4ed; color: #c4320a; }
.av3 { background: #f0f9ff; color: #026aa2; }
.av4 { background: #fdf2fa; color: #c11574; }
.av5 { background: #fefbe8; color: #a15c07; }

/* Список трафферов */
.list { display: flex; flex-direction: column; gap: 10px; }
.tcard { display: block; padding: 0; color: inherit; transition: border-color .15s; }
.tcard:hover { border-color: var(--border-2); }
.tcard:active { background: #fafafb; }
.tc-top { display: flex; align-items: flex-start; gap: 12px; padding: 14px 12px 12px 14px; }
.tcard .main { flex: 1; min-width: 0; }
.tcard .name { font-weight: 650; font-size: 16px; line-height: 1.3; overflow-wrap: anywhere; }
.tcard .meta { color: var(--muted); font-size: 13.5px; margin-top: 2px; }
.tcard .badges { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.tcard .chev { color: var(--faint); margin-top: 10px; }
.tc-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding: 11px 14px 13px; border-top: 1px solid var(--border); }
.tc-stats { color: var(--muted); font-size: 13px; line-height: 1.5; font-variant-numeric: tabular-nums; }
.tc-due { text-align: right; }
.tc-due span { display: block; color: var(--muted); font-size: 12px; }
.tc-due b { font-size: 20px; font-weight: 700; letter-spacing: -.01em; font-variant-numeric: tabular-nums; white-space: nowrap; }

.empty { text-align: center; padding: 40px 24px; }
.empty .ill { width: 64px; height: 64px; border-radius: 20px; background: var(--accent-50); color: var(--accent); display: inline-flex; align-items: center; justify-content: center; margin-bottom: 14px; }
.empty h3 { font-size: 17px; }
.empty p { color: var(--muted); margin: 6px auto 18px; max-width: 320px; }

/* Таблица для десктопа */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12.5px; padding: 12px 10px; border-bottom: 1px solid var(--border); background: #fafbfc; white-space: nowrap; }
table.t td { padding: 12px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; font-variant-numeric: tabular-nums; }
table.t tbody tr:hover td { background: #fafbff; }
table.t tbody tr { cursor: pointer; }
table.t tfoot td { font-weight: 650; background: #fafbfc; border-bottom: 0; }
table.t .n { text-align: right; white-space: nowrap; }
table.t th[data-sort] { cursor: pointer; user-select: none; }
table.t th[data-sort]:hover { color: var(--text); }
table.t .arrow { display: inline-block; width: 12px; }

/* Профиль */
.profile-head { padding: 18px 16px 14px; }
.ph-top { display: flex; align-items: center; gap: 14px; }
.ph-top .who { min-width: 0; }
.ph-top h1 { font-size: 22px; overflow-wrap: anywhere; }
.ph-top .meta { color: var(--muted); font-size: 14px; margin-top: 2px; }
.ph-badges { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.actions4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 16px; }
.actions4 button, .actions4 a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 64px; border-radius: 14px; border: 0; background: var(--accent-50); color: var(--accent-600); font-size: 12.5px; font-weight: 600; cursor: pointer; }
.actions4 button:hover { background: var(--accent-100); }
.notes { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); font-size: 14px; color: var(--text-2); white-space: pre-line; }
.notes .k { color: var(--muted); font-size: 12.5px; display: block; }
.notes + .notes { border-top: 0; padding-top: 0; margin-top: 8px; }

/* График */
.chart { padding: 14px 16px 12px; position: relative; }
.chart-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.chart-head .total { color: var(--muted); font-size: 13px; margin-top: 2px; font-variant-numeric: tabular-nums; }
.chart .seg button { min-height: 32px; font-size: 13px; padding: 0 10px; }
.plot { position: relative; height: 170px; margin: 8px 0 0 28px; }
.gridl { position: absolute; left: 0; right: 0; border-top: 1px dashed #e4e7ec; height: 0; }
.gridl span { position: absolute; left: -30px; top: -8px; width: 24px; text-align: right; font-size: 11px; color: var(--faint); font-variant-numeric: tabular-nums; }
.base { position: absolute; left: 0; right: 0; bottom: 0; border-top: 1px solid #d0d5dd; }
.cols { position: absolute; inset: 0; display: flex; align-items: flex-end; }
.col { flex: 1; height: 100%; display: flex; align-items: flex-end; justify-content: center; border: 0; background: transparent; padding: 0; cursor: pointer; position: relative; }
.col .bar { width: 64%; max-width: 26px; min-height: 0; border-radius: 4px 4px 0 0; background: var(--accent); opacity: .9; transition: opacity .15s; }
.col .bar.m { background: #12b76a; }
.chart[data-show="starts"] .bar.m, .chart[data-show="money"] .bar.s { display: none; }
.chart[data-show="starts"] .g-m, .chart[data-show="money"] .g-s { display: none; }
.col.sel .bar { opacity: 1; filter: brightness(.85); }
.cols:hover .col:not(.sel) .bar { opacity: .7; }
.xl { position: relative; height: 18px; margin: 6px 0 0 28px; }
.xl span { position: absolute; transform: translateX(-50%); font-size: 11px; color: var(--faint); white-space: nowrap; font-variant-numeric: tabular-nums; }
.bubble { position: absolute; z-index: 5; background: #101828; color: #fff; border-radius: 10px; padding: 8px 10px; font-size: 12.5px; pointer-events: none; min-width: 132px; box-shadow: var(--shadow-lg); }
.bubble b { display: block; margin-bottom: 3px; font-weight: 600; }
.bubble div { display: flex; justify-content: space-between; gap: 14px; font-variant-numeric: tabular-nums; color: #d0d5dd; }
.bubble div span:last-child { color: #fff; font-weight: 600; }

/* Ссылки */
.links { display: flex; flex-direction: column; gap: 10px; }
.lcard { padding: 14px 16px; }
.lcard .lt { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.lcard .lt h3 { font-size: 15.5px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lcard .url { margin-top: 6px; font-size: 14px; color: var(--text-2); overflow-wrap: anywhere; }
.lcard .lbtns { display: flex; gap: 8px; margin-top: 12px; }
.lcard .lbtns .btn { flex: 1; }
.lcard .lstats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.lcard .lstats div { min-width: 0; }
.lcard .lstats b { display: block; font-size: 15px; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.lcard .lstats span { font-size: 12px; color: var(--muted); }

/* Вкладки и журнал */
.tabs { margin: 24px 0 10px; }
.rows { list-style: none; margin: 0; padding: 4px 0; }
.row { display: flex; align-items: center; gap: 12px; padding: 11px 16px; border-top: 1px solid var(--border); }
.row:first-child { border-top: 0; }
.row .ri { width: 34px; height: 34px; border-radius: 10px; flex: none; display: inline-flex; align-items: center; justify-content: center; background: var(--gray-bg); color: var(--gray); }
.row .ri.start { background: var(--accent-50); color: var(--accent); }
.row .ri.payment { background: var(--ok-bg); color: var(--ok); }
.row .ri.refund { background: var(--bad-bg); color: var(--bad); }
.row .rm { flex: 1; min-width: 0; }
.row .rt { font-weight: 600; font-size: 14.5px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.row .rs { color: var(--muted); font-size: 12.5px; margin-top: 1px; font-variant-numeric: tabular-nums; }
.row .rr { text-align: right; flex: none; display: flex; align-items: center; gap: 4px; }
.row .amt { font-weight: 650; font-variant-numeric: tabular-nums; }
.row .amt.minus { color: var(--bad); }
.row form { display: inline; }
.more-link { display: flex; width: 100%; justify-content: center; text-align: center; padding: 12px; border-top: 1px solid var(--border); border-radius: 0 0 var(--r) var(--r); font-weight: 600; font-size: 14px; }

/* Шторка */
.sheet { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.sheet-bg { position: absolute; inset: 0; background: rgba(16, 24, 40, .45); animation: fade .2s ease; }
.sheet-body { position: relative; width: 100%; max-height: 92vh; overflow-y: auto; -webkit-overflow-scrolling: touch; background: #fff; border-radius: 20px 20px 0 0; padding: 8px 16px calc(20px + var(--safe)); box-shadow: var(--shadow-lg); animation: up .24s cubic-bezier(.2, .8, .2, 1); }
.sheet-grip { width: 40px; height: 5px; border-radius: 3px; background: #d0d5dd; margin: 0 auto 10px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.sheet-head h2 { font-size: 19px; }
.sheet-foot { margin-top: 20px; display: flex; flex-direction: column; gap: 8px; }
.sheet .lead { color: var(--muted); font-size: 14px; margin: -6px 0 14px; }
body.locked { overflow: hidden; }
@keyframes up { from { transform: translateY(40px); opacity: .4; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* Формы */
.field { display: block; }
.field + .field, .field + .row2, .row2 + .field, .row2 + .row2, .seg-field + .field, .field + .seg-field, .row2 + .seg-field, .seg-field + .row2 { margin-top: 14px; }
.field > label, .seg-field > .lbl { display: flex; align-items: center; gap: 4px; font-size: 13.5px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.field .hint { font-size: 12.5px; color: var(--muted); margin-top: 5px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row2 .field + .field { margin-top: 0; }
input[type="text"], input[type="password"], input[type="number"], input[type="date"], select, textarea {
  width: 100%; min-height: 48px; padding: 0 14px; border: 1px solid var(--border-2); border-radius: 12px; background: #fff; color: var(--text); font: inherit; font-size: 16px; outline: none; transition: border-color .15s, box-shadow .15s; -webkit-appearance: none; appearance: none;
}
textarea { padding: 12px 14px; min-height: 84px; resize: vertical; }
input[type="date"] { line-height: 46px; }
select { padding-right: 38px; 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='%23667085' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(91, 91, 240, .14); }
input::placeholder, textarea::placeholder { color: var(--faint); }
.input-suffix { position: relative; }
.input-suffix input { padding-right: 70px; }
.input-suffix span { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 14px; pointer-events: none; }
.more-fields > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; color: var(--accent); font-weight: 600; margin-top: 16px; min-height: 40px; }
.more-fields > summary::-webkit-details-marker { display: none; }
.more-fields[open] > summary .ic { transform: rotate(180deg); }
.more-fields > div { margin-top: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips label { position: relative; }
.chips input { position: absolute; opacity: 0; }
.chips span { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border-radius: 20px; border: 1px solid var(--border-2); font-weight: 500; cursor: pointer; }
.chips input:checked + span { border-color: var(--bad-dot); background: var(--bad-bg); color: var(--bad); }
.form-error { background: var(--bad-bg); color: var(--bad); border-radius: 12px; padding: 10px 14px; font-size: 14px; margin-bottom: 14px; }
.file-drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 22px 16px; border: 1.5px dashed var(--border-2); border-radius: 14px; text-align: center; color: var(--muted); cursor: pointer; }
.file-drop input { width: 100%; max-width: 260px; font-size: 14px; }
.file-drop .ic { color: var(--accent); width: 28px; height: 28px; }

.toast { position: fixed; left: 50%; top: 14px; transform: translateX(-50%); z-index: 70; display: flex; align-items: center; gap: 8px; background: #101828; color: #fff; padding: 11px 16px; border-radius: 14px; font-size: 14px; box-shadow: var(--shadow-lg); max-width: calc(100% - 32px); animation: drop .25s ease; }
.toast .ic { color: #6ce9a6; }
@keyframes drop { from { transform: translate(-50%, -16px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }

.qr-box { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 8px 0 4px; }
.qr-box svg { width: 220px; height: 220px; border-radius: 12px; border: 1px solid var(--border); }
.qr-box .url { font-size: 14px; color: var(--text-2); text-align: center; overflow-wrap: anywhere; }

.menu { overflow: hidden; }
.menu a, .menu button { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 54px; padding: 0 16px; border: 0; border-top: 1px solid var(--border); background: transparent; color: var(--text); font-size: 15px; text-align: left; cursor: pointer; }
.menu > :first-child { border-top: 0; }
.menu .ic { color: var(--muted); }
.menu .grow { flex: 1; }
.menu .danger { color: var(--bad); }
.menu .danger .ic { color: var(--bad); }
.kv { margin: 0; }
.kv > div { display: flex; justify-content: space-between; gap: 12px; padding: 13px 16px; border-top: 1px solid var(--border); }
.kv > div:first-child { border-top: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; text-align: right; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.code { font: 12.5px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: #f9fafb; border: 1px solid var(--border); border-radius: 12px; padding: 12px; overflow-x: auto; white-space: pre; margin-top: 10px; }
.prose { font-size: 14px; color: var(--text-2); }
.prose p + p { margin-top: 8px; }

/* Вход и публичные страницы */
.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.auth .card { width: 100%; max-width: 400px; padding: 28px 22px 24px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; letter-spacing: -.01em; color: var(--text); }
.brand .logo { width: 34px; height: 34px; border-radius: 10px; background: var(--accent); color: #fff; display: inline-flex; align-items: center; justify-content: center; }
.brand .logo .ic { width: 19px; height: 19px; }
.brand small { color: var(--muted); font-weight: 500; font-size: 14px; }
.auth h1 { font-size: 22px; margin: 22px 0 4px; }
.auth .lead { color: var(--muted); margin-bottom: 20px; }
.auth .btn { margin-top: 20px; width: 100%; height: 50px; }

.cab-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 0 0; }
.cab-hello { margin: 18px 0 16px; }
.cab-hello h1 { font-size: 24px; }
.cab-hello p { color: var(--muted); margin-top: 4px; }
.rules { display: flex; gap: 10px; padding: 14px 16px; font-size: 13.5px; color: var(--text-2); }
.rules .ic { color: var(--accent); margin-top: 1px; }

@media (min-width: 900px) {
  .app { padding-bottom: 40px; }
  .tabbar, .fab, .mob-only { display: none !important; }
  .desk-only { display: revert !important; }
  .topbar { display: block; background: #fff; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 30; }
  .topbar-in { max-width: 1100px; margin: 0 auto; height: 60px; padding: 0 24px; display: flex; align-items: center; gap: 28px; }
  .topnav { display: flex; gap: 4px; flex: 1; }
  .topnav a { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px; border-radius: 10px; color: var(--text-2); font-weight: 500; }
  .topnav a:hover { background: var(--gray-bg); }
  .topnav a.on { background: var(--accent-50); color: var(--accent-600); }
  .page { padding: 28px 24px 40px; }
  h1 { font-size: 28px; }
  .kpis { grid-template-columns: repeat(4, 1fr); }
  .kpi { padding: 18px 20px; border-bottom: 0 !important; border-right: 1px solid var(--border); }
  .kpi:last-child { border-right: 0; }
  .kpi .value { font-size: 28px; }
  .period .seg { flex: none; }
  .page-tools { display: flex; align-items: center; gap: 10px; }
  .sheet { align-items: center; padding: 24px; }
  .sheet-body { max-width: 560px; border-radius: 20px; padding: 22px 24px 24px; max-height: 88vh; animation: pop .18s ease; }
  .sheet-grip { display: none; }
  .sheet-foot { flex-direction: row-reverse; justify-content: flex-start; }
  .sheet-foot .btn-block { width: auto; }
  @keyframes pop { from { transform: scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }
  .list { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  .links { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  .profile-grid { display: grid; grid-template-columns: 340px 1fr; gap: 16px; align-items: start; }
  .profile-grid > .card + .card, .profile-grid .section { margin-top: 0; }
  .profile-side { position: sticky; top: 76px; }
  .actions4 { grid-template-columns: 1fr 1fr; }
  .actions4 button, .actions4 a { flex-direction: row; min-height: 44px; font-size: 14px; }
  .plot { height: 220px; }
  .xl span.minor { display: inline; }
  .toast { top: 76px; }
}

@media (max-width: 899px) {
  .xl span.minor { display: none; }
  .page-title h1 { font-size: 28px; }
}

@media (max-width: 360px) {
  .kpi .value { font-size: 21px; }
  .seg a, .seg button { padding: 0 8px; font-size: 13px; }
}
.nowrap { white-space: nowrap; }
table.t td:first-child, table.t th:first-child { padding-left: 16px; }
table.t td:last-child, table.t th:last-child { padding-right: 16px; }
table.t td:first-child .badge { margin-left: 4px; vertical-align: 1px; }
.lcard .lt { align-items: flex-start; }
.lcard .lmenu { margin: -8px -10px -6px 0; flex: none; }
.lsub { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.lsub .badge { height: 22px; font-size: 12px; }
.hint-center { color: var(--muted); font-size: 13px; text-align: center; margin-top: 2px; }
.sheet form + form.sheet-foot { margin-top: 8px; }
.archive > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 14px 16px; color: var(--text-2); font-weight: 600; }
.archive > summary::-webkit-details-marker { display: none; }
.archive > summary .grow { flex: 1; }
.archive[open] > summary { border-bottom: 1px solid var(--border); }
.archive[open] > summary .ic:last-child { transform: rotate(180deg); }
.links-count { color: var(--muted); font-size: 13px; font-weight: 500; margin-left: 6px; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; }
.switch-row .t { font-weight: 600; }
.switch-row .d { color: var(--muted); font-size: 13px; margin-top: 2px; }
.action-row .ri { background: var(--gray-bg); }
.toggle { flex: none; width: 52px; height: 32px; border-radius: 16px; border: 0; padding: 3px; background: #d0d5dd; cursor: pointer; transition: background .2s; }
.toggle span { display: block; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(16, 24, 40, .2); transition: transform .2s; }
.toggle.on { background: var(--accent); }
.toggle.on span { transform: translateX(20px); }
.toast.bad { background: var(--bad); }
.cab .app, .app.cab { padding-bottom: 32px; }
