/* Админка Tourna. По DESIGN.md сайта: Montserrat, синий #0F4C81, один тёплый акцент #DD4124, белый фон, линии вместо карточек. */
:root {
  --ink: #0e2238;
  --muted: #5b6470;
  --line: #e2e7ed;
  --soft: #f4f6f9;
  --tint: #ebf2f9;
  --blue: #0f4c81;
  --blue-d: #0b3b66;
  --sun: #c7361a;
  --ok: #17703f;
  --bad: #b3261e;
  --edge: #c9d2dc;
}
* { box-sizing: border-box; }
html { font-family: Montserrat, system-ui, sans-serif; color: var(--ink); background: #fff; -webkit-text-size-adjust: 100%; }
body { margin: 0; font-size: 16px; line-height: 1.5; }
a { color: var(--blue); text-underline-offset: 3px; }
h1, h2 { letter-spacing: -0.02em; line-height: 1.15; margin: 0; }
h1 { font-size: 32px; font-weight: 700; }
h2 { font-size: 20px; font-weight: 700; margin: 44px 0 16px; }
h2.first { margin-top: 8px; }
h2.hot { color: var(--sun); }
.subhead { margin: 8px 0 0; color: var(--muted); font-size: 18px; }
.subhead span + span { margin-left: 16px; color: var(--ink); font-weight: 600; }
.sub.inl { display: inline; }
.ok { color: var(--ok); }
.warn { color: var(--sun); }
section > h2:first-child { margin-top: 0; }
code { font: inherit; font-weight: 600; background: var(--soft); padding: 2px 8px; border-radius: 6px; word-break: break-all; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.sr, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.skip:focus { position: fixed; top: 8px; left: 8px; z-index: 9; background: #fff; padding: 8px 12px; }
.sub { display: block; font-size: 14px; color: var(--muted); font-weight: 400; }
.nowrap { white-space: nowrap; }
.count { color: var(--muted); font-weight: 600; font-size: 0.7em; margin-left: 6px; }
.lead { max-width: 760px; margin: 0 0 24px; }
.hint { font-size: 14px; color: var(--muted); margin: 12px 0 0; max-width: 760px; }
.empty { padding: 28px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--muted); max-width: 760px; }
.err { color: var(--bad); background: #fdf1ef; padding: 12px 16px; border-radius: 8px; margin: 0 0 20px; font-weight: 600; }
.note { background: var(--tint); padding: 16px 20px; border-radius: 8px; margin: 0 0 24px; }
.note p { margin: 8px 0 0; }
.crumb { margin: 0 0 12px; font-size: 14px; color: var(--muted); }
.crumb a { margin-right: 8px; }

body { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100dvh; }
.side { position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; border-right: 1px solid var(--line); background: #fff; overflow-y: auto; }
.side .logo { display: flex; padding: 28px 28px 24px; flex: none; }
.side nav { display: grid; gap: 2px; padding: 0 12px; }
.side nav a { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 8px; font-weight: 600; color: var(--ink); text-decoration: none; transition: background-color .15s, color .15s; }
.side nav a:hover { background: var(--soft); }
.side nav a[aria-current] { background: var(--tint); color: var(--blue); box-shadow: inset 3px 0 var(--blue); }
.side nav a.sep { margin-top: 16px; }
.side nav a.sep::before { content: ""; position: absolute; left: 16px; right: 16px; top: -8px; border-top: 1px solid var(--line); }
.who { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 16px 24px 28px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); line-height: 1.3; }
.who b { display: block; color: var(--ink); font-size: 16px; }
main { width: 100%; max-width: 1320px; padding: 40px 48px 96px; }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 20px; border: 1px solid var(--edge); border-radius: 8px; background: #fff; color: var(--ink); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap; transition: background-color .15s, border-color .15s; }
.btn:hover { border-color: var(--blue); color: var(--blue); }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.primary:hover { background: var(--blue-d); color: #fff; }
.btn.quiet { border-color: transparent; padding: 0 12px; min-height: 36px; color: var(--blue); }
.btn.quiet:hover { background: var(--soft); }
.btn.danger { color: var(--bad); }
.btn.danger:hover { border-color: var(--bad); color: var(--bad); }
summary.btn { list-style: none; }
summary.btn::-webkit-details-marker { display: none; }

.head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 28px; }
.actions { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: flex-end; gap: 12px; }
.head:has(details[open]) .actions { flex-basis: 100%; }
details.add[open] { flex-basis: 100%; order: 2; }
details.add[open] summary { margin-bottom: 16px; }
details.add form { padding: 20px 0 4px; border-top: 1px solid var(--line); }
form.inline { display: inline-flex; gap: 8px; }
.rowbtns { display: flex; flex-wrap: wrap; gap: 2px; margin: 4px 0 0 -12px; }

label { display: grid; gap: 6px; font-size: 14px; font-weight: 600; }
input, select, textarea { width: 100%; min-height: 44px; padding: 8px 12px; border: 1px solid var(--edge); border-radius: 8px; background: #fff; color: var(--ink); font: inherit; font-size: 16px; font-weight: 400; }
textarea { resize: vertical; }
input:disabled, select:disabled, textarea:disabled { background: var(--soft); color: var(--ink); opacity: 1; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: end; }
.grid .wide { grid-column: 1 / -1; }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.three .wide2 { grid-column: span 2; }
.grid.narrow { max-width: 760px; }
.grid > .btn { justify-self: start; }
.filters { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; margin-bottom: 20px; }
.filters label { min-width: 150px; flex: 1 1 150px; }
.filters .grow { flex: 1 1 260px; }
.filters.tight { margin: 0; }

.scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 14px; font-weight: 600; color: var(--muted); padding: 12px 16px 12px 0; border-bottom: 1px solid var(--ink); white-space: nowrap; }
td { padding: 12px 16px 12px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
tbody tr { transition: background-color .15s; }
tbody tr:hover { background: var(--soft); }
table.slim { max-width: 520px; }
table.links code { display: inline-block; margin-top: 8px; font-size: 14px; white-space: nowrap; word-break: normal; }
table.links .rowbtns { flex-wrap: nowrap; }
table.links td.num .sub { white-space: normal; }
table.links td:first-child { width: 38%; }
.wait { display: block; font-size: 14px; color: var(--muted); }
.wait.late { color: var(--sun); font-weight: 600; }
td a { text-decoration: none; }
td a:hover { text-decoration: underline; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
th.num, td.num { padding-right: 0; padding-left: 16px; }
td.num + td:last-child { padding-left: 28px; }
table.roles td:not(:first-child) { color: var(--muted); }

select.stage { min-height: 36px; width: auto; padding: 4px 32px 4px 12px; font-weight: 600; font-size: 14px; border-color: transparent; background-color: var(--tint); }
.stage { font-weight: 600; color: var(--blue); }
span.stage::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 2px; background: currentColor; margin-right: 8px; vertical-align: 1px; }
.stage.s-new { color: var(--sun); }
.stage.s-paid { color: var(--ok); }
.stage.s-lost { color: var(--muted); }
select.stage.s-new { background-color: #fdf0ec; }
select.stage.s-paid { background-color: #e9f5ee; }
select.stage.s-lost { background-color: var(--soft); }

.nums { list-style: none; margin: 0 0 12px; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0 24px; border-top: 2px solid var(--ink); }
.nums.onsky { border-top: 0; }
.nums.money { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.nums.money b { font-size: 32px; }
.steps.reasons { max-width: 820px; }
/* Небо с сайта Tourna: шапка экрана «Сегодня» и фон входа. */
.sky { margin: -40px calc(-48px - max(0px, 100vw - 1592px)) 0 -48px; padding: 48px 48px 168px; background: linear-gradient(to top, #fff 0, rgb(255 255 255 / 0) 34%), #2f86d8 url(/static/sky.jpg) center 62% / 100% auto no-repeat; color: #fff; }
.sky h1 { font-size: 40px; }
.sky .subhead { color: #fff; font-weight: 600; }
.nums li { padding: 20px 0; border-bottom: 1px solid var(--line); }
.nums a { display: block; color: inherit; text-decoration: none; }
.nums a:hover b { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; }
.nums b { display: block; font-size: 40px; line-height: 1.05; letter-spacing: -0.03em; color: var(--blue); font-variant-numeric: tabular-nums lining-nums; white-space: nowrap; }
.nums .hot b { color: var(--sun); }
.nums span { display: block; font-weight: 600; margin-top: 8px; }
.nums .sub { font-weight: 400; margin-top: 2px; }
.nums:has(li:nth-child(6)) b { font-size: 32px; }
.two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px; align-items: start; margin-top: 36px; }
.two.wide-left { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); margin-top: 0; }
.two > section > h2:first-child { margin-top: 0; }
.two p { margin: 20px 0 0; }

.rows, .history { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.rows li, .history li { padding: 12px 0; border-bottom: 1px solid var(--line); }
.rows a { text-decoration: none; color: var(--ink); }
.rows a span { color: var(--blue); margin-left: 6px; }
.facts { display: grid; grid-template-columns: 150px 1fr; gap: 8px 16px; margin: 0; padding-top: 16px; border-top: 1px solid var(--line); }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; }
.facts dd .sub { display: inline; }

.bars { list-style: none; margin: 0; padding: 0; display: flex; align-items: flex-end; gap: 4px; height: 200px; border-bottom: 1px solid var(--ink); margin-bottom: 28px; }
.bars li { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; position: relative; }
.bars .b { width: 100%; max-width: 44px; height: var(--h); min-height: 2px; background: var(--blue); border-radius: 3px 3px 0 0; }
.bars .v { font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; margin-bottom: 4px; }
.bars .d { position: absolute; top: 100%; margin-top: 4px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.bars.dense { gap: 1px; }

.steps { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--ink); }
.steps li { display: grid; grid-template-columns: 150px 1fr 56px 64px; align-items: center; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.steps li > span:nth-of-type(2) { order: -1; font-weight: 600; }
.steps .bar { height: 20px; width: var(--w); min-width: 2px; background: var(--blue); border-radius: 0 3px 3px 0; }
.steps b, .steps .sub { text-align: right; font-variant-numeric: tabular-nums; }
.steps .s-paid .bar { background: var(--ok); }

.board { display: grid; grid-template-columns: repeat(6, minmax(210px, 1fr)); gap: 0; margin-top: 28px; overflow-x: auto; border-top: 1px solid var(--ink); }
.col { padding: 16px 12px 24px; border-right: 1px solid var(--line); min-height: 320px; }
.col:first-child { padding-left: 0; }
.col:last-child { border-right: 0; }
.col h2 { font-size: 16px; margin: 0; letter-spacing: 0; }
.col.s-new h2 { color: var(--sun); }
.col.s-paid h2 { color: var(--ok); }
.col.over { background: var(--tint); }
.col ul { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.card { border: 1px solid var(--edge); border-radius: 8px; padding: 12px; background: #fff; display: grid; gap: 4px; }
.card[draggable] { cursor: grab; }
.card.drag { opacity: .45; }
.card a { text-decoration: none; color: var(--ink); }
.card .tour { font-size: 14px; }
.card .sum { font-size: 14px; font-weight: 600; color: var(--ok); }
.card select.stage { width: 100%; margin-top: 8px; font-size: 14px; }

.chat { display: grid; grid-template-columns: 340px minmax(0, 1fr); height: calc(100dvh - 170px); min-height: 440px; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--line); }
.chatlist { border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.tabs { display: flex; gap: 4px; padding: 12px 12px 12px 0; border-bottom: 1px solid var(--line); }
.tabs a { padding: 8px 12px; border-radius: 8px; text-decoration: none; font-weight: 600; color: var(--ink); }
.tabs a[aria-current] { background: var(--tint); color: var(--blue); }
.chatlist ul { list-style: none; margin: 0; padding: 0; overflow-y: auto; overflow-x: hidden; }
.chatlist li a { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; padding: 12px 16px 12px 0; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.chatlist li a[aria-current] { background: var(--soft); box-shadow: inset 3px 0 var(--blue); padding-left: 12px; }
.chatlist .line { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; min-width: 0; }
.chatlist .line b { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.chatlist .line .sub { flex: none; }
.chatlist .snip { flex: 1; min-width: 0; color: var(--muted); font-size: 14px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.chatlist li.empty { border: 0; padding: 20px 0; }
.badge { flex: none; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--sun); color: #fff; font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.chatmain { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.chatmain.placeholder { padding: 40px; justify-content: center; }
.chatmain header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0 12px 20px; border-bottom: 1px solid var(--line); }
.chatmain header h2 { margin: 0; font-size: 18px; }
.chatmain .back { display: none; }
.log { list-style: none; margin: 0; padding: 20px; flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; background: var(--soft); }
.log li { max-width: min(560px, 82%); }
.log li p { margin: 0; padding: 12px 16px; border-radius: 12px; background: #fff; overflow-wrap: anywhere; }
.log li.out { align-self: flex-end; text-align: right; }
.log li.out p { background: var(--blue); color: #fff; text-align: left; }
.log .sub { font-size: 12px; margin-top: 4px; }
.composer { display: grid; grid-template-columns: 1fr auto; gap: 12px; padding: 16px 0 16px 20px; align-items: end; }
.composer .hint, .composer .err { grid-column: 1 / -1; margin: 0; }

.settings section { padding: 28px 0; border-top: 1px solid var(--line); max-width: 900px; }
.howto { margin: 0 0 20px; padding-left: 24px; display: grid; gap: 8px; }
.state { font-size: 14px; font-weight: 600; margin-left: 8px; }
.state.on { color: var(--ok); }
.state.off { color: var(--muted); }
.state.bad { color: var(--bad); }

body.login { display: grid; grid-template-columns: 1fr; min-height: 100dvh; place-items: center; padding: 24px; background: #cfe3f5 url(/static/sky.jpg) center / cover no-repeat; }
.login-box { width: 100%; max-width: 420px; background: #fff; border-radius: 16px; padding: 40px 36px 32px; }
.login-box h1 { font-size: 24px; margin: 32px 0 24px; }
.login-box form { display: grid; gap: 16px; }
.login-box .btn { width: 100%; min-height: 48px; margin-top: 4px; }

/* Сделка */
.deal fieldset { border: 0; margin: 0; padding: 0 0 32px; min-width: 0; }
.deal fieldset + fieldset { padding-top: 28px; border-top: 1px solid var(--line); }
.deal legend { float: left; width: 100%; padding: 0; margin-bottom: 16px; font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }
.deal legend + * { clear: both; }
.calc { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; padding: 16px 20px; background: var(--tint); border-radius: 8px; }
.calc span { display: grid; gap: 2px; font-size: 14px; font-weight: 600; color: var(--muted); }
.calc b { font-size: 24px; letter-spacing: -0.02em; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.calc span:last-child b { color: var(--ok); }
.calc.over span:last-child b { color: var(--sun); }
.savebar { position: sticky; bottom: 0; padding: 16px 0; background: #fff; border-top: 1px solid var(--line); z-index: 2; }
.rail h2 { margin-top: 40px; }
.todo, .pays, .agenda { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.todo li, .pays li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.todo li > span { font-weight: 600; }
.todo li.late > span > .sub, .agenda li.late time { color: var(--sun); font-weight: 600; }
.todo li.done > span { font-weight: 400; color: var(--muted); text-decoration: line-through; }
.todo li.done .sub { text-decoration: none; }
.todo li.none { color: var(--muted); }
.pays li > span { flex: 1; font-weight: 600; }
.pays b { white-space: nowrap; font-variant-numeric: tabular-nums; }
.pays .plus { color: var(--ok); }
.sums { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 24px; margin: 0 0 16px; }
.sums dt { font-size: 14px; color: var(--muted); }
.sums dd { margin: 2px 0 0; font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.sums dd .sub { font-weight: 400; }
.mini { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; margin-top: 16px; }
.mini label { flex: 1 1 140px; }
.mini .grow { flex: 2 1 220px; }
.mini.top { margin: 0 0 8px; padding-bottom: 24px; border-bottom: 1px solid var(--line); max-width: 900px; }
.agenda li { display: grid; grid-template-columns: 92px minmax(0, 1fr) auto; align-items: center; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.agenda time { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.agenda a { text-decoration: none; }
.agenda a:hover { text-decoration: underline; }
.seg { display: flex; gap: 4px; }
.seg a { padding: 8px 16px; border-radius: 8px; text-decoration: none; font-weight: 600; color: var(--ink); }
.seg a[aria-current] { background: var(--tint); color: var(--blue); }
.spend { display: inline-flex; gap: 2px; justify-content: flex-end; }
.spend input { width: 116px; min-height: 36px; padding: 4px 12px; text-align: right; }
.steps.reasons li { grid-template-columns: 190px 1fr 40px 56px; }
.steps.reasons .bar { background: var(--muted); }
.badge[hidden] { display: none; }

@media (max-width: 1100px) {
  .two.wide-left { grid-template-columns: 1fr; gap: 36px; }
}
@media (max-width: 900px) {
  body { display: block; }
  .side { position: sticky; top: 0; z-index: 5; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; border-right: 0; border-bottom: 1px solid var(--line); overflow: visible; }
  .side .logo { padding: 12px 16px; }
  .who { margin: 0 0 0 auto; padding: 0 8px 0 0; border: 0; }
  .who span { display: none; }
  .side nav { order: 3; flex-basis: 100%; display: flex; gap: 2px; padding: 0 8px 8px; overflow-x: auto; scrollbar-width: none; }
  .side nav a { flex: none; min-height: 40px; padding: 0 12px; }
  .side nav a[aria-current] { box-shadow: none; }
  .side nav .pill { box-shadow: none; }
  .side nav a.sep { margin: 0; }
  .side nav a.sep::before { display: none; }
  main { padding: 24px 16px 72px; }
  .sky { margin: -24px -16px 0; padding: 28px 16px 120px; }
  .sky h1 { font-size: 28px; }
  h1 { font-size: 28px; }
  .two { grid-template-columns: 1fr; gap: 36px; }
  .scroll table:not(.roles):not(.slim) { min-width: 820px; }
  .nums { grid-template-columns: 1fr 1fr; gap: 0 16px; }
  .nums b, .nums:has(li:nth-child(6)) b { font-size: 28px; }
  .nums.money { grid-template-columns: 1fr 1fr; }
  .nums.money b { font-size: 24px; }
  .chatmain header { flex-wrap: wrap; gap: 8px 16px; }
  .chatmain header .back { flex-basis: 100%; }
  .grid, .grid.three { grid-template-columns: 1fr; }
  .grid.three .wide2 { grid-column: auto; }
  .calc { grid-template-columns: 1fr; gap: 12px; }
  .steps li, .steps.reasons li { grid-template-columns: 112px 1fr 36px 50px; gap: 8px; }
  .chat { grid-template-columns: 1fr; height: auto; min-height: 0; }
  .chat.open .chatlist, .chat:not(.open) .chatmain { display: none; }
  .chat.open { height: calc(100dvh - 230px); }
  .chatmain header, .composer { padding-left: 0; }
  .chatmain .back { display: inline; }
  .log { margin: 0 -16px; padding: 16px; }
  .facts { grid-template-columns: 120px 1fr; }
  .agenda li { grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; }
  .agenda time { grid-column: 1 / -1; font-size: 14px; }
  .login-box { padding: 32px 24px 24px; }
}
/* Движение. Образец: рилс docs/ref-reel (плашка меню тянется к новому разделу, страница собирается по частям, столбики вырастают). */
:root { --out: cubic-bezier(.22, 1, .36, 1); }
@view-transition { navigation: auto; }
.side { view-transition-name: side; }
::view-transition-old(root) { animation: page-out .15s ease-in both; }
::view-transition-new(root) { animation: page-in .24s .1s var(--out) both; }
::view-transition-group(side) { animation: none; }
::view-transition-old(side) { display: none; }
::view-transition-new(side) { animation: none; }
@keyframes page-out { to { opacity: 0; transform: translateY(8px); } }
@keyframes page-in { from { opacity: 0; } }

/* Плашка активного раздела: её ставит app.js, без него остаётся обычная подсветка. */
.side nav { position: relative; }
.side nav a { z-index: 1; transition: color .12s; }
.side nav a.lit { color: var(--blue); }
.side nav .pill { position: absolute; z-index: 0; border-radius: 8px; background: var(--tint); box-shadow: inset 3px 0 var(--blue); pointer-events: none; }
.side nav.haspill a[aria-current] { background: none; box-shadow: none; }

/* Страница собирается сверху вниз. */
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }
@keyframes fade { from { opacity: 0; } }
@keyframes title { from { clip-path: inset(0 0 100% 0); transform: translateY(70%); } to { clip-path: inset(-10% 0 -20% 0); } }
@keyframes cell { from { opacity: 0; transform: translateY(5px); } }
@keyframes row { from { opacity: 0; transform: translateY(6px); } }
@keyframes grow-y { from { transform: scaleY(0); } }
@keyframes grow-x { from { transform: scaleX(0); } }
@keyframes pop { from { opacity: 0; transform: scale(.6); } }
@keyframes drop { from { opacity: 0; transform: translateY(-8px); } }
main > * { animation: rise .5s var(--out) backwards; }
main > :nth-child(1) { animation-delay: .04s; }
main > :nth-child(2) { animation-delay: .09s; }
main > :nth-child(3) { animation-delay: .14s; }
main > :nth-child(4) { animation-delay: .19s; }
main > :nth-child(5) { animation-delay: .24s; }
main > :nth-child(6) { animation-delay: .29s; }
main > :nth-child(n+7) { animation-delay: .34s; }
main h1 { animation: title .55s var(--out) .14s backwards; }
main > .sky { animation: fade .5s ease-out backwards; }
.sky h1, .sky .subhead { animation: rise .6s var(--out) .08s backwards; }
.sky .subhead { animation-delay: .16s; }
.nums li { animation: rise .5s var(--out) backwards; animation-delay: calc(.16s + var(--i, 0) * .05s); }
/* Таблица заполняется волной из левого верхнего угла, как в образце. */
tbody td { animation: cell .34s var(--out) backwards; animation-delay: calc(.2s + (var(--i, 0) + var(--j, 0)) * .02s); }
tbody td:nth-child(2) { --j: 1; } tbody td:nth-child(3) { --j: 2; } tbody td:nth-child(4) { --j: 3; } tbody td:nth-child(5) { --j: 4; } tbody td:nth-child(6) { --j: 5; }
tbody td:nth-child(7) { --j: 6; } tbody td:nth-child(8) { --j: 7; } tbody td:nth-child(9) { --j: 8; } tbody td:nth-child(n+10) { --j: 9; }
.agenda li, .todo li, .pays li, .chatlist li { animation: row .36s var(--out) backwards; animation-delay: calc(.2s + var(--i, 0) * .03s); }
.col .card { animation: row .4s var(--out) backwards; animation-delay: calc(.26s + var(--i, 0) * .06s); }
.bars .b { transform-origin: bottom; animation: grow-y .7s var(--out) backwards; animation-delay: calc(.3s + var(--i, 0) * .014s); }
.bars .v { animation: fade .4s ease-out backwards; animation-delay: calc(.6s + var(--i, 0) * .014s); }
.steps .bar { transform-origin: left; animation: grow-x .7s var(--out) backwards; animation-delay: calc(.25s + var(--i, 0) * .06s); }
.flash, .ok, .err { animation: drop .4s var(--out) .15s backwards; }
.badge.pop { animation: pop .4s var(--out); }
#log li { animation: row .3s var(--out) backwards; }

/* Отклик на нажатие и наведение. */
.btn { transition: background-color .15s, border-color .15s, transform .12s var(--out); }
.btn:active { transform: scale(.97); }
.card { transition: border-color .15s, transform .18s var(--out); }
.card[draggable]:hover { transform: translateY(-2px); border-color: var(--blue); }
.col { transition: background-color .18s; }
input, select, textarea { transition: border-color .15s, box-shadow .15s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
  @view-transition { navigation: none; }
}

[hidden] { display: none !important; }
@media (max-width: 900px) { .side nav .pill { box-shadow: none; } }

/* Туроператоры */
.opst { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.opst::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.opst.on { color: var(--ok); }
.opst.on::before { background: var(--ok); }
.opst.off { color: var(--muted); }
tr.dim td { color: var(--muted); }
tr.dim td b, tr.dim td a { color: inherit; }
table.ops td:first-child { width: 30%; }
.opform { max-width: 980px; margin: 20px 0 8px; padding-bottom: 28px; border-bottom: 1px solid var(--line); }
.opform .row { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 16px; }
.opform .row label { flex: 1 1 150px; }
.opform .row .grow { flex: 2 1 280px; }
.opform .check { display: flex; flex-direction: row; align-items: center; gap: 8px; min-height: 44px; font-weight: 600; align-self: end; }
.opform .check input { width: 18px; height: 18px; min-height: 0; accent-color: var(--blue); }
.opform textarea { font-family: ui-monospace, Menlo, monospace; font-size: 14px; white-space: pre; overflow-x: auto; }
.crumbs { margin: 0 0 8px; }

/* Соцсети */
.soc { margin-top: 44px; }
.soc h3 { font-size: 18px; margin: 32px 0 16px; }
.soc .bars { height: 160px; margin-bottom: 36px; }
.soc { min-width: 0; }
table.posts td:first-child { min-width: 220px; max-width: 520px; }
table.posts td .sub em { font-style: normal; color: var(--sun); font-weight: 600; }
table.posts td.sub { display: table-cell; text-align: right; }
@media (max-width: 700px) {
  table.posts td:first-child { min-width: 190px; max-width: 190px; white-space: normal; }
}

/* Словарь */
table.words td { vertical-align: top; }
table.words td:first-child { white-space: nowrap; }
.faq { margin: 0; max-width: 820px; }
.faq dt { font-weight: 600; padding-top: 16px; border-top: 1px solid var(--line); }
.faq dd { margin: 6px 0 16px; }

/* Печать: один лист без меню, кнопок и фона. */
@media print {
  .side, .actions, .btn, .rowbtns, .filters, .crumb, form.inline, .note, .err, .pill { display: none !important; }
  body, main { display: block; background: #fff; margin: 0; padding: 0; }
  main > *, tbody td, .nums li, .bars .b, main h1 { animation: none !important; }
  input, select, textarea { border: 0; padding: 0; background: none; appearance: none; font-weight: 600; }
  .two { display: block; }
  a { color: inherit; text-decoration: none; }
  .scroll { overflow: visible; }
}

/* Иконки: один набор (Lucide), 18 px, линия 1.5, цвет подписи рядом. */
.ic { flex: none; width: 18px; height: 18px; }
.side nav a { justify-content: flex-start; gap: 12px; }
.side nav a > span:not(.badge) { flex: 1; min-width: 0; }
.side nav a .ic { color: var(--muted); transition: color .12s; }
.side nav a[aria-current] .ic, .side nav a.lit .ic { color: var(--blue); }
.btn { gap: 8px; }
.btn .ic { margin-left: -2px; }
@media (max-width: 900px) { .side nav a .ic { display: none; } }

/* Графики: тихие столбики, акцент только на сегодняшнем дне, сетка и подпись наибольшего значения. */
:root { --step: #c3d1e0; }
.nums b { color: var(--ink); }
.bars { position: relative; background: linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 100% 25%; }
.bars::before { content: attr(data-max); position: absolute; top: 4px; left: 0; padding-right: 8px; background: #fff; font-size: 12px; line-height: 16px; color: var(--muted); font-variant-numeric: tabular-nums; z-index: 1; }
.bars .b { background: var(--step); transition: background-color .15s; }
.bars li:last-child .b, .bars li:hover .b { background: var(--blue); }
.steps .bar { background: var(--step); }
.steps .s-paid .bar { background: var(--ok); }
.steps.reasons .bar { background: var(--step); }
.steps.reasons li:first-child .bar { background: var(--muted); }

/* Линия роста подписчиков. */
.trend { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: 1fr auto auto; gap: 0 12px; margin: 0 0 36px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.trend .ymax { grid-area: 1 / 1; align-self: start; }
.trend .ymin { grid-area: 2 / 1; align-self: end; }
.trend .plot { grid-area: 1 / 2 / 3 / 3; position: relative; height: 200px; border-bottom: 1px solid var(--ink); background: linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 100% 25%; }
.trend svg { display: block; width: 100%; height: 100%; overflow: visible; }
.trend polygon { fill: var(--tint); }
.trend polyline { fill: none; stroke: var(--blue); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.trend .now { position: absolute; right: 0; transform: translateY(calc(-100% + 4px)); display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-size: 14px; line-height: 20px; color: var(--blue); white-space: nowrap; }
.trend .now::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 3px #fff; margin-right: -4px; }
.trend .xs { grid-area: 3 / 2; list-style: none; margin: 4px 0 0; padding: 0; display: flex; justify-content: space-between; }
.trend .plot { animation: fade .5s var(--out) .2s backwards; }
/* Меню с иконками: шире на 24 px, подписи в одну строку. */
body { grid-template-columns: 272px minmax(0, 1fr); }
.side nav a { padding: 0 12px; white-space: nowrap; }
.side .logo { padding-left: 24px; }
.who { padding-left: 24px; }
@media (max-width: 900px) { .side .logo { padding-left: 16px; } .who { padding-left: 0; } }
