/* Тёмный техно-минимализм: глубокий фон, один акцент, много воздуха. */

:root {
  --bg: #0a0a0b;
  --bg-soft: #101012;
  --line: #1e1e22;
  --line-bright: #2a2a30;
  --text: #f2f2f3;
  --muted: #71717a;
  --accent: #d7ff3e;
  --accent-dim: #a8c72f;
  --err: #ff5f56;
  --radius: 14px;
  --font: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Inter', system-ui, sans-serif;
  --mono: 'SF Mono', ui-monospace, 'JetBrains Mono', monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* hidden должен побеждать любой display в правилах ниже:
   .gate и .view задают display, и без этого экран входа
   остаётся на месте даже после успешной авторизации. */
[hidden] { display: none !important; }

/* Волна под всеми экранами: одна и та же, меняется только громкость.
   Кликам не мешает, поэтому лежит фоном на всю высоту окна. */
.wave-bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  transition: opacity .7s ease;
}

/* Контент всегда поверх волны. */
.gate, #app, .reader { position: relative; z-index: 1; }

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

body {
  /* Едва заметное свечение сверху — чтобы чёрный не выглядел плоским. */
  background-image: radial-gradient(900px 420px at 50% -160px, rgba(215,255,62,.07), transparent 70%);
}

button, input { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }

/* ── Вход ─────────────────────────────────────────── */

.gate {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.gate-inner {
  width: 100%;
  max-width: 320px;
  text-align: center;
  animation: rise .6s cubic-bezier(.2,.8,.2,1);
}

.mark {
  width: 46px; height: 46px;
  margin: 0 auto 26px;
  border: 1px solid var(--line-bright);
  border-radius: 50%;
  display: grid;
  place-items: center;
}

.dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 14px rgba(215,255,62,.55);
}

.gate-title {
  font-size: 27px;
  font-weight: 600;
  letter-spacing: -.02em;
}

.gate-sub {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
}

.gate-form {
  margin-top: 32px;
  display: grid;
  gap: 10px;
}

.gate-form input {
  height: 46px;
  padding: 0 16px;
  background: rgba(16,16,18,.72);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  border-radius: 11px;
  outline: none;
  transition: border-color .18s, background .18s;
}

.gate-form input:focus {
  border-color: var(--line-bright);
  background: #131316;
}

.gate-form button {
  height: 46px;
  border-radius: 11px;
  background: var(--accent);
  color: #0a0a0b;
  font-weight: 600;
  transition: transform .12s, filter .18s;
}

.gate-form button:hover { filter: brightness(1.06); }
.gate-form button:active { transform: scale(.985); }

.err {
  margin-top: 14px;
  color: var(--err);
  font-size: 13px;
  min-height: 18px;
}

/* ── Каркас ───────────────────────────────────────── */

.top {
  height: 62px;
  padding: 0 26px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Логотип и блок пользователя одной ширины — тогда вкладки стоят по центру */
.top > .brand, .top > .whoami { flex: 1 0 0; }
.top > .whoami { justify-content: flex-end; }

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  letter-spacing: -.01em;
}

.tabs { display: flex; gap: 4px; }

.tab {
  padding: 7px 14px;
  border-radius: 9px;
  color: var(--muted);
  font-size: 14px;
  transition: color .18s, background .18s;
}

.tab:hover { color: var(--text); }

.tab.is-active {
  color: var(--text);
  background: rgba(16,16,18,.75);
}

.top {
  background: rgba(10,10,11,.72);
  backdrop-filter: blur(14px);
}

.stage {
  max-width: 720px;
  margin: 0 auto;
  padding: 64px 26px 80px;
}

/* Форма запуска встречи — это пара полей, ей широкая колонка не нужна:
   растянутое поле ввода выглядит нелепо. Списки же выигрывают от ширины. */
#view-new .stage,
#view-upload .stage { max-width: 560px; }

.panel { animation: rise .45s cubic-bezier(.2,.8,.2,1); }

/* ── Форма ────────────────────────────────────────── */

.label {
  display: block;
  margin-bottom: 9px;
  font-size: 13px;
  color: var(--muted);
  letter-spacing: .01em;
}

.label:not(:first-child) { margin-top: 22px; }

.muted { color: #4a4a52; }

.field {
  width: 100%;
  height: 50px;
  padding: 0 16px;
  background: rgba(16,16,18,.72);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
  /* Цвет обязателен: без него браузер красит содержимое select и input[time]
     системным тусклым, и выбранное значение читается как подсказка. */
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  transition: border-color .18s, background .18s;
}

.field::placeholder { color: #3f3f47; }

.field:focus {
  border-color: var(--line-bright);
  background: #131316;
}

.cta {
  margin-top: 26px;
  width: 100%;
  height: 50px;
  border-radius: 12px;
  background: var(--accent);
  color: #0a0a0b;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  transition: transform .12s, filter .18s;
}

.cta:hover { filter: brightness(1.06); }
.cta:active { transform: scale(.99); }
.cta:disabled { opacity: .5; cursor: default; transform: none; filter: none; }

.cta-stop {
  background: transparent;
  border: 1px solid var(--line-bright);
  color: var(--text);
}

.cta-stop:hover { border-color: #3d3d45; filter: none; }

.ghost {
  height: 50px;
  padding: 0 22px;
  border-radius: 12px;
  border: 1px solid var(--line);
  color: var(--muted);
  transition: color .18s, border-color .18s;
}

.ghost:hover { color: var(--text); border-color: var(--line-bright); }

.row { margin-top: 26px; display: flex; gap: 10px; }
.row .cta { margin-top: 0; flex: 1; }

.hint {
  margin-top: 22px;
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  color: var(--muted);
}

.hint-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--accent-dim);
  flex: none;
}

/* ── Живая встреча ────────────────────────────────── */

.panel-live {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  background: rgba(14,14,16,.78);
  backdrop-filter: blur(14px);
}

.live-head {
  display: flex;
  align-items: center;
  gap: 14px;
}

.pulse {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  flex: none;
}

.pulse span {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--accent);
  animation: beat 1.7s ease-in-out infinite;
}

.live-title {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -.01em;
}

.live-status {
  margin-top: 3px;
  font-size: 13px;
  color: var(--muted);
}

.timer {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 20px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
}

.steps {
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 1px;
  background: var(--line);
  border-radius: 10px;
  overflow: hidden;
}

.steps li {
  background: rgba(16,16,18,.8);
  padding: 12px 15px;
  font-size: 13.5px;
  color: #3f3f47;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: color .3s, background .3s;
}

.steps li::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #26262c;
  flex: none;
  transition: background .3s, box-shadow .3s;
}

.steps li.is-done { color: var(--muted); }
.steps li.is-done::before { background: var(--accent-dim); }

.steps li.is-now {
  color: var(--text);
  background: #131316;
}

.steps li.is-now::before {
  background: var(--accent);
  box-shadow: 0 0 10px rgba(215,255,62,.6);
  animation: beat 1.7s ease-in-out infinite;
}

.log {
  margin-top: 16px;
  padding: 12px 14px;
  background: #08080a;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.65;
  color: var(--muted);
  max-height: 108px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.log:empty { display: none; }

.done-head {
  display: flex;
  align-items: center;
  gap: 14px;
}

.check {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--accent);
  color: #0a0a0b;
  display: grid;
  place-items: center;
  font-weight: 700;
  flex: none;
}

/* ── Архив ────────────────────────────────────────── */

.archive { display: grid; gap: 8px; }

.card {
  padding: 17px 19px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(16,16,18,.68);
  backdrop-filter: blur(10px);
  cursor: pointer;
  text-align: left;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: border-color .18s, background .18s, transform .12s;
}

.card:hover {
  border-color: var(--line-bright);
  background: rgba(19,19,22,.84);
  transform: translateY(-2px);
}

.card:active { transform: scale(.995); }

.card-title {
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -.01em;
}

.card-meta {
  margin-top: 4px;
  font-size: 12.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.card-arrow { margin-left: auto; color: #33333a; flex: none; }
.card:hover .card-arrow { color: var(--muted); }

.empty {
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  padding: 60px 0;
}

/* ── Чтение ───────────────────────────────────────── */

.reader {
  position: fixed;
  inset: 0;
  background: rgba(10,10,11,.94);
  backdrop-filter: blur(20px);
  z-index: 10;
  overflow-y: auto;
  animation: fade .3s ease;
}

.reader-top {
  position: sticky;
  top: 0;
  background: rgba(10,10,11,.86);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  padding: 13px 26px;
  display: flex;
  align-items: center;
  gap: 16px;
  z-index: 1;
}

.reader-top .ghost { height: 38px; padding: 0 15px; font-size: 14px; }

.reader-tabs { display: flex; gap: 3px; margin-left: auto; }

.rtab {
  padding: 7px 13px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 13.5px;
  transition: color .18s, background .18s;
}

.rtab:hover { color: var(--text); }
.rtab.is-active { color: var(--text); background: var(--bg-soft); }

.reader-body {
  /* Шире, чем было: в конспектах встречаются таблицы на четыре колонки,
     в 660px они сжимались до нечитаемого. */
  max-width: 820px;
  margin: 0 auto;
  padding: 44px 26px 100px;
  font-size: 15.5px;
  line-height: 1.72;
  color: #d6d6d9;
}

.reader-body h1 {
  font-size: 25px;
  letter-spacing: -.02em;
  margin: 0 0 26px;
  color: var(--text);
}

.reader-body h2 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--accent-dim);
  margin: 38px 0 14px;
  font-weight: 600;
}

.reader-body h3 {
  font-size: 16.5px;
  margin: 26px 0 10px;
  color: var(--text);
  letter-spacing: -.01em;
}

.reader-body p { margin: 0 0 15px; }
.reader-body ul { margin: 0 0 15px; padding-left: 20px; }
.reader-body li { margin-bottom: 7px; }
.reader-body strong { color: var(--text); font-weight: 600; }

.reader-body hr {
  border: none;
  border-top: 1px solid var(--line);
  margin: 34px 0;
}

.reader-body .line {
  padding: 11px 0;
  border-bottom: 1px solid #141417;
}

.reader-body .who {
  color: var(--accent-dim);
  font-size: 12.5px;
  letter-spacing: .02em;
  margin-bottom: 3px;
}

/* ── Анимации ─────────────────────────────────────── */

@keyframes rise {
  from { opacity: 0; transform: translateY(9px); }
  to   { opacity: 1; transform: none; }
}

@keyframes fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes beat {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: .45; transform: scale(.82); }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

@media (max-width: 560px) {
  .stage { padding: 40px 18px 60px; }
  .top { padding: 0 18px; }
  .reader-body { padding: 30px 18px 80px; }
  .row { flex-direction: column; }
}

/* ── Лендинг ──────────────────────────────────────── */

.landing {
  position: relative;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

.landing > * { position: relative; z-index: 1; }

.lp-top {
  height: 68px;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.lp-nav {
  padding: 9px 17px;
  border-radius: 10px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 7px;
  transition: color .2s, border-color .2s;
}

.lp-nav:hover { color: var(--text); border-color: var(--line-bright); }
.lp-nav .arr { transition: transform .2s; }
.lp-nav:hover .arr { transform: translateX(3px); }

.lp-hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 80px 32px 60px;
  max-width: 760px;
  margin: 0 auto;
}

.lp-badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 7px 15px;
  border: 1px solid var(--line);
  border-radius: 100px;
  font-size: 12.5px;
  color: var(--muted);
  background: rgba(16,16,18,.7);
  backdrop-filter: blur(8px);
  animation: rise .7s cubic-bezier(.2,.8,.2,1);
}

.rec {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px rgba(215,255,62,.7);
  animation: beat 1.9s ease-in-out infinite;
}

.lp-title {
  margin-top: 30px;
  font-size: clamp(38px, 6.5vw, 68px);
  line-height: 1.06;
  font-weight: 600;
  letter-spacing: -.035em;
  animation: rise .7s .06s backwards cubic-bezier(.2,.8,.2,1);
}

.grad {
  background: linear-gradient(96deg, var(--accent) 10%, #7de8c3 55%, #6fb3ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.lp-lead {
  margin-top: 24px;
  max-width: 520px;
  font-size: 16.5px;
  line-height: 1.62;
  color: var(--muted);
  animation: rise .7s .12s backwards cubic-bezier(.2,.8,.2,1);
}

.lp-cta {
  margin-top: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  animation: rise .7s .18s backwards cubic-bezier(.2,.8,.2,1);
}

.lp-btn {
  margin-top: 0;
  width: auto;
  padding: 0 30px;
  height: 52px;
  box-shadow: 0 0 0 0 rgba(215,255,62,.35);
  animation: halo 3.4s ease-in-out infinite;
}

.lp-cta-note { font-size: 13px; color: #4a4a52; }

/* ── Шаги ─────────────────────────────────────────── */

.lp-flow {
  max-width: 940px;
  margin: 0 auto;
  padding: 10px 32px 80px;
  display: flex;
  align-items: flex-start;
  gap: 4px;
  width: 100%;
}

.flow-item { flex: 1; min-width: 0; }

.flow-n {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent-dim);
  letter-spacing: .08em;
}

.flow-t {
  margin-top: 9px;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -.01em;
}

.flow-d {
  margin-top: 5px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

.flow-line {
  flex: none;
  width: 34px;
  height: 1px;
  margin-top: 6px;
  background: linear-gradient(90deg, var(--line-bright), transparent);
}

/* ── Карточки ─────────────────────────────────────── */

.lp-cards {
  max-width: 940px;
  margin: 0 auto;
  padding: 0 32px 90px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  width: 100%;
}

.lp-card {
  padding: 26px 24px 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(16,16,18,.62);
  backdrop-filter: blur(10px);
  transition: border-color .25s, transform .25s, background .25s;
}

.lp-card:hover {
  border-color: var(--line-bright);
  background: rgba(19,19,22,.8);
  transform: translateY(-2px);
}

.card-ico {
  width: 38px; height: 38px;
  border-radius: 10px;
  border: 1px solid var(--line-bright);
  display: grid;
  place-items: center;
  color: var(--accent);
  margin-bottom: 18px;
}

.lp-card h3 {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -.01em;
  margin-bottom: 8px;
}

.lp-card p {
  font-size: 14px;
  line-height: 1.6;
  color: var(--muted);
}

.lp-foot {
  padding: 26px 32px 34px;
  border-top: 1px solid var(--line);
  text-align: center;
  font-size: 12.5px;
  color: #3f3f47;
}

@keyframes halo {
  0%, 100% { box-shadow: 0 0 0 0 rgba(215,255,62,.30); }
  50%      { box-shadow: 0 0 0 13px rgba(215,255,62,0); }
}

@media (max-width: 860px) {
  .lp-cards { grid-template-columns: 1fr; }
  .lp-flow { flex-direction: column; gap: 22px; padding-bottom: 60px; }
  .flow-line { width: 1px; height: 20px; margin-left: 4px; background: linear-gradient(180deg, var(--line-bright), transparent); }
}

@media (max-width: 560px) {
  .lp-top { padding: 0 18px; }
  .lp-hero { padding: 50px 20px 40px; }
  .lp-flow, .lp-cards { padding-left: 20px; padding-right: 20px; }
}

/* ── Живая расшифровка ────────────────────────────── */

.feed {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(8,8,10,.72);
  overflow: hidden;
}

.feed-head {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: .01em;
}

/* «Ухо» — три полоски, пульсирующие вразнобой: слушает. */
.feed-ear {
  width: 13px; height: 12px;
  flex: none;
  background:
    linear-gradient(var(--accent), var(--accent)) 0 50% / 3px 40% no-repeat,
    linear-gradient(var(--accent), var(--accent)) 5px 50% / 3px 100% no-repeat,
    linear-gradient(var(--accent), var(--accent)) 10px 50% / 3px 62% no-repeat;
  animation: ear 1.1s ease-in-out infinite;
}

@keyframes ear {
  0%, 100% { background-size: 3px 40%, 3px 100%, 3px 62%; }
  33%      { background-size: 3px 90%, 3px 45%, 3px 100%; }
  66%      { background-size: 3px 62%, 3px 80%, 3px 35%; }
}

.feed-lines {
  max-height: 190px;
  overflow-y: auto;
  padding: 6px 0;
  scrollbar-width: thin;
  scrollbar-color: var(--line-bright) transparent;
}

.feed-lines::-webkit-scrollbar { width: 6px; }
.feed-lines::-webkit-scrollbar-thumb { background: var(--line-bright); border-radius: 3px; }

.feed-line {
  padding: 7px 14px;
  animation: feedIn .4s cubic-bezier(.2,.8,.2,1);
}

.feed-who {
  font-size: 11.5px;
  color: var(--accent-dim);
  letter-spacing: .02em;
  margin-bottom: 2px;
}

.feed-text {
  font-size: 13.5px;
  line-height: 1.5;
  color: #c8c8cc;
}

/* Последняя реплика ярче — взгляд сам идёт к свежему. */
.feed-line:last-child .feed-text { color: var(--text); }

@keyframes feedIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

/* ── Пустой архив ─────────────────────────────────── */

.empty {
  text-align: center;
  padding: 74px 20px;
  animation: rise .5s cubic-bezier(.2,.8,.2,1);
}

/* Застывшая волна из полосок — намёк на будущие записи. */
.empty-art {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 44px;
  margin-bottom: 26px;
}

.empty-art span {
  width: 3px;
  border-radius: 2px;
  background: var(--line-bright);
  animation: idleBar 2.6s ease-in-out infinite;
}

.empty-art span:nth-child(1) { height: 30%; animation-delay: 0s; }
.empty-art span:nth-child(2) { height: 62%; animation-delay: .18s; }
.empty-art span:nth-child(3) { height: 100%; animation-delay: .36s; }
.empty-art span:nth-child(4) { height: 52%; animation-delay: .54s; }
.empty-art span:nth-child(5) { height: 24%; animation-delay: .72s; }

@keyframes idleBar {
  0%, 100% { opacity: .35; transform: scaleY(1); }
  50%      { opacity: .85; transform: scaleY(1.28); }
}

.empty h3 {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -.01em;
  margin-bottom: 8px;
}

.empty p {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 24px;
}

.empty .ghost { height: 44px; }

/* ── Скелетоны ────────────────────────────────────── */

.skel {
  height: 68px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background:
    linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,.035) 50%, rgba(255,255,255,0) 100%),
    rgba(16,16,18,.6);
  background-size: 220% 100%, auto;
  animation: shimmer 1.5s linear infinite;
}

@keyframes shimmer {
  from { background-position: 120% 0, 0 0; }
  to   { background-position: -120% 0, 0 0; }
}

/* ── Тосты ────────────────────────────────────────── */

.toasts {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}

.toast {
  padding: 12px 18px;
  border-radius: 11px;
  border: 1px solid var(--line-bright);
  background: rgba(19,19,22,.94);
  backdrop-filter: blur(14px);
  font-size: 13.5px;
  box-shadow: 0 8px 28px rgba(0,0,0,.5);
  animation: toastIn .34s cubic-bezier(.2,.8,.2,1);
  max-width: min(440px, 90vw);
}

.toast.is-err { border-color: rgba(255,95,86,.45); color: #ffb3ae; }
.toast.is-ok { border-color: rgba(215,255,62,.4); }
.toast.is-out { animation: toastOut .3s ease forwards; }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(12px) scale(.96); }
  to   { opacity: 1; transform: none; }
}

@keyframes toastOut {
  to { opacity: 0; transform: translateY(8px) scale(.97); }
}

/* ── Читалка: детали ──────────────────────────────── */

.icon-btn {
  width: 36px; height: 36px;
  border-radius: 9px;
  border: 1px solid var(--line);
  color: var(--muted);
  display: grid;
  place-items: center;
  transition: color .18s, border-color .18s, background .18s;
}

.icon-btn:hover { color: var(--text); border-color: var(--line-bright); }
.icon-btn.is-ok { color: var(--accent); border-color: rgba(215,255,62,.4); }

/* Ключевые блоки саммари — карточками, чтобы решения и задачи не терялись. */
.reader-body .block {
  margin: 16px 0 22px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-left: 2px solid var(--accent-dim);
  border-radius: 10px;
  background: rgba(16,16,18,.5);
}

.reader-body .block ul { margin-bottom: 0; }
.reader-body .block > *:last-child { margin-bottom: 0; }

.reader-body .who {
  color: var(--accent-dim);
  font-size: 12.5px;
  letter-spacing: .02em;
  margin-bottom: 3px;
}

.reader-body .line:last-child { border-bottom: none; }

/* ── Загрузка записи ──────────────────────────────── */

.drop {
  border: 1px dashed var(--line-bright);
  border-radius: var(--radius);
  background: rgba(16,16,18,.5);
  backdrop-filter: blur(10px);
  padding: 44px 24px 40px;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s, background .2s, transform .15s;
}

.drop:hover { border-color: #3d3d45; background: rgba(19,19,22,.66); }

.drop.is-over {
  border-color: var(--accent);
  background: rgba(215,255,62,.05);
  transform: scale(1.005);
}

.drop.is-ready {
  border-style: solid;
  border-color: rgba(215,255,62,.45);
  background: rgba(215,255,62,.04);
}

/* Полоски-эквалайзер: намёк, что сюда кладут звук. */
.drop-art {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 38px;
  margin-bottom: 20px;
}

.drop-art span {
  width: 3px;
  border-radius: 2px;
  background: var(--line-bright);
  transition: background .25s;
  animation: idleBar 2.4s ease-in-out infinite;
}

.drop-art span:nth-child(1) { height: 26%; animation-delay: 0s; }
.drop-art span:nth-child(2) { height: 54%; animation-delay: .14s; }
.drop-art span:nth-child(3) { height: 82%; animation-delay: .28s; }
.drop-art span:nth-child(4) { height: 100%; animation-delay: .42s; }
.drop-art span:nth-child(5) { height: 74%; animation-delay: .56s; }
.drop-art span:nth-child(6) { height: 46%; animation-delay: .7s; }
.drop-art span:nth-child(7) { height: 22%; animation-delay: .84s; }

.drop.is-over .drop-art span,
.drop.is-ready .drop-art span { background: var(--accent-dim); }

.drop-title {
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -.01em;
}

.drop-sub {
  margin-top: 7px;
  font-size: 13.5px;
  color: var(--muted);
}

.link {
  color: var(--accent-dim);
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 0;
}

.link:hover { color: var(--accent); }

/* Разделитель «или» */
.or {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 26px 0 22px;
  color: #3f3f47;
  font-size: 12.5px;
}

.or::before, .or::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* ── Диктофон ─────────────────────────────────────── */

.mic-btn { margin-top: 0; }

.mic-ico {
  width: 11px; height: 11px;
  border-radius: 50%;
  background: var(--err);
  flex: none;
  transition: border-radius .2s, transform .2s;
}

.mic-btn.is-rec .mic-ico {
  border-radius: 2px;
  transform: scale(.85);
  animation: beat 1.4s ease-in-out infinite;
}

.mic-live {
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(8,8,10,.7);
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Живой уровень звука с микрофона. */
.mic-bars {
  flex: 1;
  height: 34px;
  display: flex;
  align-items: center;
  gap: 2px;
}

.mic-bars i {
  flex: 1;
  min-height: 2px;
  border-radius: 1px;
  background: var(--accent-dim);
  transition: height .08s ease, opacity .08s;
}

.mic-time {
  font-family: var(--mono);
  font-size: 17px;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

/* ── Полоса прогресса ─────────────────────────────── */

.bar {
  margin-top: 18px;
  height: 3px;
  border-radius: 2px;
  background: var(--line);
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  width: 0;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent-dim), var(--accent));
  transition: width .3s ease;
}

/* Неопределённый прогресс: обработка идёт, но её длину мы не знаем. */
.bar-fill.is-wait {
  width: 34% !important;
  animation: slide 1.5s ease-in-out infinite;
}

@keyframes slide {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(320%); }
}

/* ── Учётные записи ──────────────────────────────────────── */

.gate-form--stack {
  flex-direction: column;
  gap: 10px;
}

.gate-in {
  width: 100%;
}

.gate-switch {
  margin-top: 14px;
  font-size: 13px;
  color: var(--muted);
}

.linkbtn {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: var(--accent);
  cursor: pointer;
  text-decoration: none;
}

.linkbtn:hover { text-decoration: underline; }

/* Кто вошёл — справа в шапке, рядом с выходом */
.whoami {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.who-text {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.25;
}

.who-name { font-size: 13px; font-weight: 500; }
.who-role { font-size: 11px; color: var(--muted); }

.card-who { color: var(--muted); }

.reader-acts {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Кнопка Word шире прочих: рядом с иконкой стоит подпись */
#docxBtn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: auto;
  padding: 0 12px;
  text-decoration: none;
}

.btn-label { font-size: 13px; }

@media (max-width: 560px) {
  .who-text { display: none; }
  .btn-label { display: none; }
  #docxBtn { padding: 0; }
}

/* ── Задачи ──────────────────────────────────────────────── */

.tasks {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.task {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-soft);
}

.task-main { min-width: 0; }

.task-text {
  font-size: 14px;
  line-height: 1.45;
  margin-bottom: 6px;
}

.task-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}

/* Ссылка на встречу, откуда задача — не должна выглядеть кнопкой */
.task-src {
  font-size: 12px;
  max-width: 340px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}

.task-who {
  font-size: 12px;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--line-bright);
  white-space: nowrap;
}

.task-due {
  font-size: 11px;
  color: var(--accent-dim);
  white-space: nowrap;
}

/* ── Поиск ───────────────────────────────────────────────── */

.search { margin-bottom: 14px; }

.card-excerpt {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}

.search-none {
  padding: 28px 0;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

@media (max-width: 560px) {
  .task { flex-direction: column; gap: 10px; }
  .task-side { flex-direction: row; align-items: center; }
}

/* ── Расписание ──────────────────────────────────────────── */

.days {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.day {
  width: 44px;
  height: 36px;
  border-radius: 9px;
  border: 1px solid var(--line-bright);
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
}

.day:hover { color: var(--text); }

.day.is-on {
  background: var(--accent);
  border-color: var(--accent);
  color: #0a0a0b;
  font-weight: 500;
}

.time { width: 140px; }

.sch-list {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-soft);
}

/* Выключенное расписание видно, но приглушено — его не удалили, а поставили на паузу */
.sch.is-off { opacity: .5; }

.sch-title { font-size: 14px; margin-bottom: 3px; }
.sch-when { font-size: 12px; color: var(--muted); }

.sch-acts {
  display: flex;
  gap: 12px;
  flex-shrink: 0;
  font-size: 13px;
}

.sch-del { color: var(--muted); }
.sch-del:hover { color: var(--err); }

/* Напоминание впустить бота: поверх всего, потому что пропустить его нельзя */
.remind {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border-radius: 999px;
  border: 1px solid var(--accent-dim);
  background: rgba(10, 10, 11, .92);
  backdrop-filter: blur(12px);
  font-size: 13px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .5);
  animation: rise .4s cubic-bezier(.2, .8, .2, 1);
}

@media (max-width: 560px) {
  .remind { left: 14px; right: 14px; transform: none; border-radius: var(--radius); }
}

/* ── Таблицы в конспекте ─────────────────────────────────── */
/* Модель часто отдаёт задачи таблицей — она должна читаться, а не сыпаться палками */

.table-wrap {
  margin: 18px 0;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.reader-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.reader-body th {
  text-align: left;
  padding: 11px 14px;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--line-bright);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--accent-dim);
  white-space: nowrap;
}

.reader-body td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  line-height: 1.5;
}

.reader-body tbody tr:last-child td { border-bottom: 0; }
.reader-body tbody tr:hover { background: rgba(255, 255, 255, .02); }

/* Раскладка колонок: таблица должна влезать в ширину чтения целиком,
   иначе последняя колонка уезжает за край и её не видно. */
.reader-body table { table-layout: fixed; }

/* Переносим по словам, а не посреди слова: «четвергу» не должно стать
   «четверг / у». Рвём только то, что иначе распёрло бы колонку. */
.reader-body th,
.reader-body td {
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: none;
}

.reader-body th {
  white-space: normal;
  font-size: 11px;
  letter-spacing: .03em;
}

/* Кто и когда — колонки с короткими значениями, но им нужно место,
   чтобы «Сегодня–завтра» и имена не ломались в столбик. */
.reader-body td:nth-child(2),
.reader-body th:nth-child(2) { width: 19%; }

.reader-body td:nth-child(3),
.reader-body th:nth-child(3) { width: 19%; }

/* Внутри карточки-блока таблица идёт от края до края */
.block .table-wrap { margin: 4px 0; }

/* ── Окно выгрузки в таблицу ─────────────────────────────── */
/* Выше просмотрщика (z-index: 10) — открывается поверх конспекта */

.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, .6);
  backdrop-filter: blur(6px);
  animation: fade .2s ease;
}

.modal-card {
  width: 100%;
  max-width: 480px;
  padding: 28px;
  border: 1px solid var(--line-bright);
  border-radius: 18px;
  background: var(--bg-soft);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .6);
  animation: rise .3s cubic-bezier(.2, .8, .2, 1);
}

.modal-title {
  margin: 0 0 4px;
  font-size: 18px;
  font-weight: 500;
}

.modal-sub {
  margin: 0 0 22px;
  font-size: 13px;
  color: var(--muted);
}

.modal-close {
  display: block;
  margin: 16px auto 0;
  color: var(--muted);
  font-size: 13px;
}

.modal-close:hover { color: var(--text); }

/* Недавние таблицы: подставить ссылку одним кликом */
.recent {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.recent-item {
  max-width: 100%;
  padding: 5px 10px;
  border: 1px solid var(--line-bright);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-family: var(--mono);
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color .15s, border-color .15s;
}

.recent-item:hover { color: var(--text); border-color: var(--accent-dim); }

#sheetBtn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: auto;
  padding: 0 12px;
}

@media (max-width: 560px) {
  .modal-card { padding: 22px; }
  #sheetBtn .btn-label { display: none; }
  #sheetBtn { padding: 0; }
}

/* ── Проекты ─────────────────────────────────────────────── */

/* Выпадающий список в форме: делаем как обычное поле, только со стрелкой */
.select {
  appearance: none;
  cursor: pointer;
  /* Выбранное значение — обычный текст, а не подсказка */
  color: var(--text);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5L6 7.5L9 4.5' stroke='%2371717a' stroke-width='1.4' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px;
}

/* Выпадающий список рисует система: на тёмной теме он иначе белый */
.select option {
  background: var(--bg-soft);
  color: var(--text);
}

/* Поле времени: браузерная иконка часов тёмная на тёмном фоне — осветляем */
.time::-webkit-calendar-picker-indicator {
  filter: invert(1);
  opacity: .45;
  cursor: pointer;
  transition: opacity .15s;
}

.time::-webkit-calendar-picker-indicator:hover { opacity: .8; }

/* Фишки-фильтры над архивом и задачами */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.chip {
  padding: 6px 13px;
  border: 1px solid var(--line-bright);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 12.5px;
  cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
}

.chip:hover { color: var(--text); }

.chip.is-on {
  background: var(--accent);
  border-color: var(--accent);
  color: #0a0a0b;
  font-weight: 500;
}

/* Смена проекта прямо в карточке архива */
.card-proj { margin-top: 8px; }

.proj-pick {
  appearance: none;
  padding: 3px 22px 3px 9px;
  border: 1px solid var(--line-bright);
  border-radius: 999px;
  background: transparent;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5L6 7.5L9 4.5' stroke='%2371717a' stroke-width='1.4' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 7px center;
  color: var(--muted);
  font-size: 11.5px;
  font-family: var(--font);
  cursor: pointer;
}

.proj-pick:hover { color: var(--text); border-color: var(--accent-dim); }

/* Догадку модели помечаем цветом: её стоит проверить */
.proj-pick.is-guess {
  color: var(--accent-dim);
  border-color: var(--accent-dim);
  border-style: dashed;
}

/* Проект в списке задач */
.task-proj {
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--line-bright);
  font-size: 11px;
}

/* ── Словарь и сводка ────────────────────────────────────── */

.section-gap { margin-top: 34px; }

.sub-title {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 500;
}

.sub-note {
  margin: 0 0 20px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--muted);
}

.digest {
  padding: 22px 24px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-soft);
}

.digest-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 14px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--line);
}

.digest-when {
  font-size: 15px;
  font-weight: 500;
}

.digest-nums {
  font-size: 12px;
  color: var(--accent-dim);
  white-space: nowrap;
}

/* Внутри сводки тот же markdown, что и в конспекте, только компактнее */
.digest-body { font-size: 14px; line-height: 1.6; }
.digest-body h2 {
  margin: 20px 0 8px;
  font-size: 12px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--accent);
}
.digest-body h2:first-child { margin-top: 8px; }
.digest-body p { margin: 6px 0; }
.digest-body ul { margin: 6px 0; padding-left: 20px; }
.digest-body li { margin: 4px 0; }
