/* Группы Telegram «На максимум». Палитра и шрифты — те же, что в академии. */
@import url("fonts.css");

:root {
  --board: #F3F5F0; --dot: #CDD4CA; --paper: #FFFFFF; --paper-2: #F8FAF6;
  --ink: #15191B; --ink-2: #4F5957; --ink-3: #727C79; --line: #D5DBD2;
  --marker: #169B50; --marker-ink: #0B7A3B; --marker-soft: #DCF1E3;
  --sticky: #FFE27A; --sticky-soft: #FFF4C7; --sticky-ink: #2A2410;
  --red: #C73A22; --red-soft: #FBE7E2; --blue: #2F5FD0; --blue-soft: #E3E9FA;
  --call: #1B1E21;
  --display: "Geologica", "Helvetica Neue", Arial, sans-serif;
  --hand: "Caveat", "Segoe Print", "Bradley Hand", cursive;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --r: 16px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; color: var(--ink); background: var(--board);
  background-image: radial-gradient(var(--dot) 1px, transparent 1.2px); background-size: 22px 22px;
  font: 400 16px/1.5 var(--display); -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(26px, 4vw, 36px); line-height: 1.1; font-weight: 700; letter-spacing: -0.02em; text-wrap: balance; }
h2 { font-size: 21px; line-height: 1.2; font-weight: 650; letter-spacing: -0.01em; }
h3 { font-size: 17px; line-height: 1.3; font-weight: 600; }
a { color: var(--marker-ink); text-decoration-thickness: 1px; text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }

.eyebrow { font: 500 12px/1.3 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--marker-ink); }
.lead { font-size: 18px; line-height: 1.5; color: var(--ink-2); max-width: 62ch; text-wrap: pretty; }
.muted { color: var(--ink-3); }
.small { font-size: 14px; }
.mono { font-family: var(--mono); font-size: 13px; }
.stack > * + * { margin-top: var(--gap, 16px); }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.grow { flex: 1 1 auto; min-width: 0; }
.ic { width: 19px; height: 19px; flex: 0 0 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* ── кирпичики ── */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; }
.card.soft { background: var(--paper-2); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer;
  border: 1px solid var(--line); background: var(--paper); color: var(--ink); text-decoration: none;
  padding: 10px 16px; border-radius: 12px; font-weight: 600; font-size: 15px; line-height: 1.2; min-height: 42px;
}
.btn:hover { border-color: var(--ink-3); }
.btn.pri { background: var(--marker); border-color: var(--marker); color: #fff; }
.btn.pri:hover { background: var(--marker-ink); border-color: var(--marker-ink); }
.btn.danger { color: var(--red); }
.btn.sm { padding: 6px 11px; min-height: 32px; font-size: 13.5px; border-radius: 9px; }
.btn[disabled] { opacity: .5; cursor: default; }
.btn.icon { padding: 0; width: 40px; min-height: 40px; }
.tag { display: inline-flex; align-items: center; gap: 6px; font: 500 12px/1 var(--mono); padding: 6px 9px; border-radius: 99px; background: var(--paper-2); color: var(--ink-2); border: 1px solid var(--line); white-space: nowrap; }
.tag.ok { background: var(--marker-soft); color: var(--marker-ink); border-color: transparent; }
.tag.wait { background: var(--sticky-soft); color: var(--sticky-ink); border-color: transparent; }
.tag.no { background: var(--red-soft); color: var(--red); border-color: transparent; }
.field { display: block; }
.field > span { display: block; font: 500 12px/1.2 var(--mono); letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 6px; }
.inp { width: 100%; border: 1px solid var(--line); border-radius: 11px; background: var(--paper); padding: 10px 12px; min-height: 42px; }
.inp:focus { outline: 2px solid var(--marker); outline-offset: 0; border-color: var(--marker); }
.note { background: var(--sticky-soft); border-radius: 12px; padding: 12px 14px; color: var(--sticky-ink); font-size: 15px; }
.note.red { background: var(--red-soft); color: #7c2414; }
.note.green { background: var(--marker-soft); color: var(--marker-ink); }
.note code, .steps code { font: 500 13px/1 var(--mono); background: rgba(21, 25, 27, .07); padding: 2px 6px; border-radius: 6px; white-space: nowrap; }
.empty { text-align: center; padding: 34px 20px; color: var(--ink-3); }

.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: rgba(21, 25, 27, .45); padding: 16px; }
.modal .box { width: min(520px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--paper); border-radius: 20px; padding: 24px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 200; background: var(--call); color: #fff; padding: 12px 18px; border-radius: 12px; font-size: 15px; max-width: min(92vw, 520px); box-shadow: 0 10px 30px rgba(21, 25, 27, .3); }
.toast.err { background: var(--red); }

/* ── вход ── */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login .card { width: min(400px, 100%); padding: 28px; }
.brand { display: block; text-decoration: none; color: var(--ink); }
.brand b { display: block; font-size: 21px; font-weight: 750; letter-spacing: -0.02em; line-height: 1.1; }
.brand span { display: inline-block; font: 600 22px/1 var(--hand); color: var(--marker); transform: rotate(-2deg); margin-top: 2px; }

/* ── переключатель ── */
.sw { position: relative; flex: 0 0 46px; width: 46px; height: 28px; padding: 0; border: 0; border-radius: 99px; background: #BFC7BD; cursor: pointer; transition: background .15s; }
.sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(21, 25, 27, .3); transition: transform .15s; }
.sw[aria-checked="true"] { background: var(--marker); }
.sw[aria-checked="true"]::after { transform: translateX(18px); }
.sw[disabled] { opacity: .4; cursor: default; }
@media (prefers-reduced-motion: reduce) { .sw, .sw::after { transition: none; } }

/* ── каркас: слева группы, справа лента ── */
.shell { display: grid; grid-template-columns: 372px minmax(0, 1fr); height: 100vh; height: 100dvh; }
.side { display: flex; flex-direction: column; min-height: 0; background: var(--paper); border-right: 1px solid var(--line); }
.side .top { padding: 20px 18px 14px; display: grid; gap: 14px; }
.side .scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 0 10px 12px; }
.me { border-top: 1px solid var(--line); padding: 12px 18px; display: flex; align-items: center; gap: 8px; }
.me b { font-weight: 600; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.page { flex: 1 1 auto; overflow-y: auto; padding: 34px clamp(16px, 4vw, 52px) 80px; }
.page > .view { max-width: 820px; margin: 0 auto; }
.backm { display: none; }

.bot { display: flex; align-items: flex-start; gap: 10px; font-size: 14.5px; line-height: 1.4; }
.bot .dot { flex: 0 0 10px; width: 10px; height: 10px; border-radius: 50%; margin-top: 5px; background: var(--ink-3); }
.bot.ok .dot { background: var(--marker); box-shadow: 0 0 0 4px var(--marker-soft); }
.bot.bad .dot { background: var(--red); box-shadow: 0 0 0 4px var(--red-soft); }
.bot.wait .dot { background: #D9A400; box-shadow: 0 0 0 4px var(--sticky-soft); }
.bot b { font-weight: 600; }
.bot .sub { color: var(--ink-3); font-size: 13.5px; }

.find { display: grid; gap: 6px; }
.find .scope { display: flex; align-items: center; gap: 7px; font-size: 13.5px; color: var(--ink-2); }

.sec { font: 500 11px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); padding: 16px 10px 8px; }
.g { display: flex; align-items: center; gap: 10px; padding: 4px 10px 4px 4px; border-radius: 13px; }
.g:hover { background: var(--paper-2); }
.g.cur { background: var(--marker-soft); }
.g > a { display: block; flex: 1 1 auto; min-width: 0; padding: 7px 8px; border-radius: 10px; text-decoration: none; color: var(--ink); }
.g b { display: block; font-weight: 600; font-size: 15.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g .sub { font-size: 13px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g.off b { color: var(--ink-2); font-weight: 500; }
.g.gone b { color: var(--ink-3); font-weight: 500; }

/* ── шапка группы ── */
.chead { display: flex; align-items: center; gap: 12px; padding: 12px clamp(14px, 3vw, 28px); background: var(--paper); border-bottom: 1px solid var(--line); }
.chead h2 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chead .sub { font-size: 13.5px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chead .btn { white-space: nowrap; }
.chead .swl { display: flex; align-items: center; gap: 9px; font-weight: 600; font-size: 14.5px; white-space: nowrap; }
.cnotes { padding: 0 clamp(14px, 3vw, 28px); }
.cnotes .note { margin-top: 12px; }

/* ── лента ── */
.feed { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 14px clamp(14px, 3vw, 28px) 28px; }
.feed .inner { max-width: 820px; margin: 0 auto; display: flex; flex-direction: column; }
.feed .more { align-self: center; margin: 6px 0 14px; }
.day { align-self: center; margin: 16px 0 10px; font: 500 12px/1 var(--mono); letter-spacing: .04em; color: var(--ink-2); background: var(--paper); border: 1px solid var(--line); padding: 6px 11px; border-radius: 99px; }
.srv { align-self: center; margin: 8px 0; font-size: 13.5px; color: var(--ink-3); text-align: center; max-width: 60ch; }
.msg { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 10px; margin-top: 12px; scroll-margin: 90px; }
.msg.cont { margin-top: 3px; }
.msg .av { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font: 600 13px/1 var(--display); color: #fff; }
.msg.cont .av { visibility: hidden; height: 0; }
.bub { justify-self: start; max-width: min(640px, 100%); min-width: 0; background: var(--paper); border: 1px solid var(--line); border-radius: 4px 16px 16px 16px; padding: 9px 13px 8px; }
.msg.cont .bub { border-radius: 16px; }
.msg.hit .bub { border-color: var(--marker); box-shadow: 0 0 0 3px var(--marker-soft); }
.bub .who { display: flex; gap: 8px; align-items: baseline; font-size: 14px; margin-bottom: 2px; }
.bub .who b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bub .who span, .bub .who .when { color: var(--ink-3); font-size: 13px; white-space: nowrap; }
.bub a.when { text-decoration: none; }
.bub a.when:hover { color: var(--ink); text-decoration: underline; }
.bub .txt { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 15.5px; line-height: 1.45; }
.bub .txt mark, .res .txt mark { background: var(--sticky); color: var(--sticky-ink); border-radius: 3px; padding: 0 1px; }
.bub .fwd { font-size: 13.5px; color: var(--blue); margin-bottom: 3px; }
.bub .rep { display: block; width: 100%; text-align: left; border: 0; cursor: pointer; background: var(--paper-2); border-left: 3px solid var(--marker); border-radius: 6px; padding: 5px 9px; margin: 2px 0 6px; font-size: 13.5px; color: var(--ink-2); }
.bub .rep b { display: block; font-weight: 600; color: var(--marker-ink); }
.bub .rep span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bub .foot { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; margin-top: 4px; font: 500 12px/1.3 var(--mono); color: var(--ink-3); }
.bub .foot a, .bub .foot button { color: var(--ink-3); }
.bub .foot button { border: 0; background: none; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; font: inherit; }
.bub .foot a:hover, .bub .foot button:hover { color: var(--ink); }
.att { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin: 3px 0 5px; font-size: 14.5px; color: var(--ink-2); }
.att > span:not(.ico):not(.muted) { flex: 1 1 140px; min-width: 0; overflow-wrap: anywhere; }
.att .muted { flex: 1 1 100%; }
.att .ico { flex: 0 0 34px; width: 34px; height: 34px; border-radius: 10px; background: var(--blue-soft); color: var(--blue); display: grid; place-items: center; }
.att img { display: block; max-width: 100%; height: auto; border-radius: 10px; background: var(--paper-2); border: 1px solid var(--line); }
.att audio { width: 300px; max-width: 100%; height: 40px; }
.att video { max-width: min(380px, 100%); max-height: 420px; border-radius: 10px; background: #000; }
.opts { margin: 4px 0 0; padding-left: 20px; color: var(--ink-2); font-size: 15px; }
.jump { align-self: center; margin-top: 16px; }

/* ── поиск ── */
.res { display: block; }
.res + .res { margin-top: 10px; }
.res .hd { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; font-size: 14px; margin-bottom: 4px; }
.res .hd b { font-weight: 600; }
.res .hd span { color: var(--ink-3); font-size: 13px; }
.res .txt { white-space: pre-wrap; overflow-wrap: anywhere; }
.res .row { margin-top: 8px; }

/* ── справка ── */
.steps { counter-reset: s; display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 12px; align-items: start; }
.steps li::before { content: counter(s); width: 34px; height: 34px; border-radius: 10px; background: var(--ink); color: #fff; display: grid; place-items: center; font: 600 14px/1 var(--mono); }
.steps b { font-weight: 600; }
.stat { display: flex; gap: 26px; flex-wrap: wrap; }
.stat div b { display: block; font-size: 32px; line-height: 1; font-weight: 700; letter-spacing: -0.02em; }
.stat div span { font: 500 11px/1.2 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
ul.plain { margin: 0; padding-left: 20px; color: var(--ink-2); }
ul.plain li + li { margin-top: 5px; }

/* на телефоне: сначала список групп, лента открывается поверх */
@media (max-width: 880px) {
  .shell { display: block; height: auto; }
  .side { min-height: 100vh; min-height: 100dvh; border-right: 0; }
  .main { display: none; }
  .shell.open .side { display: none; }
  .shell.open .main { display: flex; height: 100vh; height: 100dvh; }
  .backm { display: inline-flex; }
  .page { padding: 22px 16px 64px; }
  .chead { flex-wrap: wrap; gap: 8px 12px; }
  .chead .grow { flex: 1 1 calc(100% - 60px); }
  .chead .swl { margin-right: auto; }
}
