:root {
  --bg-0: #050505;
  --bg-1: #0c0c0c;
  --ink: #f3f3f0;
  --muted: #8e8e88;
  --line: rgba(255, 255, 255, .08);
  --accent: #c6f54a;
  --accent-2: #d4ff6e;
  --radiant: #c6f54a;
  --dire: #ff5a47;
  --glass: rgba(12, 12, 12, .82);
  --glass-2: rgba(17, 17, 17, .88);
}

body {
  min-height: 100vh;
  color: var(--ink);
  background: var(--bg-0);
  font-family: "Instrument Sans", Manrope, system-ui, sans-serif;
}

/* ==========================================================================
   Фон кабинета: чёрное поле и белая клетка, как на лендинге
   ========================================================================== */
.app-atmosphere {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background: #050505;
}
.app-atmosphere-base {
  position: absolute;
  inset: 0;
  background: #050505;
}
.app-atmosphere-orb,
.app-atmosphere-beam,
.app-atmosphere-noise { display: none; }
.app-atmosphere-grid {
  position: absolute;
  inset: 0;
  opacity: 1;
  background-image:
    linear-gradient(rgba(255,255,255,.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.07) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(120% 90% at 50% 0%, #000 18%, transparent 78%);
}

.app-sidebar {
  border-right: 1px solid rgba(255,255,255,.08);
  background: #080808;
}
.app-sidebar::before { display: none; }
.app-main {
  position: relative;
  min-height: 100vh;
}
.content-pane {
  animation: contentIn .45s cubic-bezier(.22,1,.36,1);
}
@keyframes contentIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #2a2a2a; border-radius: 999px; }

.card {
  border-radius: 1.1rem;
  border: 1px solid rgba(255,255,255,.08);
  background: #0c0c0c;
  box-shadow: none;
  transition: border-color .2s;
}
.card:hover {
  border-color: rgba(255,255,255,.16);
  box-shadow: none;
}

.btn-primary {
  display: inline-flex; align-items: center; gap: .5rem;
  border-radius: 999px;
  background: #f3f3f0;
  color: #0a0a0a;
  padding: .625rem 1rem; font-size: .875rem; font-weight: 700;
  transition: filter .2s, transform .15s;
  box-shadow: none;
}
.btn-primary:hover { filter: brightness(1.06); transform: translateY(-1px); }
.btn-ghost {
  display: inline-flex; align-items: center; gap: .5rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.14);
  background: transparent;
  padding: .625rem 1rem; font-size: .875rem;
  transition: all .2s;
}
.btn-ghost:hover {
  border-color: rgba(255,255,255,.28);
  background: rgba(255,255,255,.04);
}
.badge { display: inline-flex; align-items: center; border-radius: 999px; padding: .125rem .625rem; font-size: .75rem; font-weight: 500; }
.nav-active {
  background: rgba(255,255,255,.06);
  color: #c6f54a;
  box-shadow: inset 2px 0 0 #c6f54a;
}
.panel-enter { animation: slideIn .25s ease-out; }
@keyframes slideIn { from { transform: translateX(100%); } to { transform: translateX(0); } }
table { border-collapse: collapse; }
tr.clickable { cursor: pointer; }
.lab-tab-active { background: rgba(198,245,74,.12); color: #c6f54a; }
.combo-wrap { position: relative; }
.combo-input { width: 100%; margin-top: .25rem; border-radius: .75rem; border: 1px solid #2a2a2a; background: #0c0c0c; padding: .625rem 1rem; font-size: .875rem; outline: none; }
.combo-input:focus { border-color: #c6f54a; box-shadow: 0 0 0 3px rgba(198,245,74,.15); }
.combo-list { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 40; max-height: 14rem; overflow-y: auto; border-radius: .75rem; border: 1px solid #2a2a2a; background: #111; box-shadow: 0 8px 32px rgba(0,0,0,.5); }
.combo-list.open { display: block; }
.combo-list:not(.open) { display: none; }
.combo-item { display: block; width: 100%; text-align: left; padding: .5rem 1rem; font-size: .875rem; cursor: pointer; border: none; background: transparent; color: #fff; }
.combo-item:hover, .combo-item.active { background: rgba(198,245,74,.12); }
.combo-item-sub { display: block; font-size: .7rem; color: #8e8e88; font-family: 'JetBrains Mono', monospace; }
input[type="number"] { -moz-appearance: textfield; }
input::-webkit-outer-spin-button, input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* ==========================================================================
   Общие элементы новых страниц
   ========================================================================== */
button:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary:disabled:hover { background: #c6f54a; }
.nav-divider { height: 1px; margin: .75rem .5rem; background: linear-gradient(90deg, transparent, #2a2a2a, transparent); }

.eyebrow { font-size: .7rem; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: #c6f54a; text-shadow: 0 1px 12px rgba(0,0,0,.35); }
.page-title {
  margin-top: .35rem; font-family: Syne, "Instrument Sans", sans-serif;
  font-size: 2.25rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.05;
  color: #f3f3f0;
}
.section-label { font-size: .7rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: #8b95a8; }

.page-hero { position: relative; overflow: hidden; border-radius: 1.25rem; border: 1px solid rgba(255,255,255,.08);
  background: #0c0c0c; padding: 2rem; }
.page-hero-bg { position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(700px 260px at 12% -10%, rgba(198,245,74,.32), transparent 70%),
    radial-gradient(520px 220px at 92% 120%, rgba(198,245,74,.16), transparent 70%); }
.page-hero-bg::after { content: ''; position: absolute; inset: 0; opacity: .35;
  background-image: linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 44px 44px; mask-image: radial-gradient(600px 300px at 70% 0%, #000, transparent 75%); }
.page-hero-bg-draft { background:
    radial-gradient(620px 260px at 8% -20%, rgba(198,245,74,.24), transparent 70%),
    radial-gradient(620px 260px at 95% 120%, rgba(230,57,70,.24), transparent 70%),
    radial-gradient(500px 200px at 50% 50%, rgba(198,245,74,.12), transparent 70%); }

.metric-chip { display: flex; align-items: baseline; gap: .4rem; border-radius: .9rem; border: 1px solid #2a2a2a;
  background: #111; padding: .5rem .9rem; }
.metric-chip b { font-family: 'JetBrains Mono', monospace; font-size: 1.35rem; font-weight: 700; }
.metric-chip span { font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; color: #8b95a8; }
.metric-chip-warn { border-color: rgba(230,57,70,.4); background: rgba(230,57,70,.1); }
.metric-chip-warn b { color: #e63946; }

.search-wrap { position: relative; }
.search-icon { position: absolute; left: .85rem; top: 50%; transform: translateY(-50%); height: 1rem; width: 1rem; color: #8b95a8; }
.search-input { width: 100%; border-radius: .9rem; border: 1px solid #2a2a2a; background: rgba(15,17,23,.8);
  padding: .7rem 1rem .7rem 2.5rem; font-size: .9rem; color: #fff; outline: none; transition: border-color .2s, box-shadow .2s; }
.search-input:focus { border-color: #c6f54a; box-shadow: 0 0 0 3px rgba(198,245,74,.15); }

.input-flat { border-radius: .7rem; border: 1px solid #2a2a2a; background: #111; padding: .55rem .8rem;
  font-size: .85rem; color: #fff; outline: none; transition: border-color .2s; }
.input-flat:focus { border-color: #c6f54a; }
.field { display: block; }
.field > span { display: block; font-size: .7rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: #8b95a8; }
.field > input { margin-top: .35rem; width: 100%; border-radius: .7rem; border: 1px solid #2a2a2a; background: #111;
  padding: .65rem .85rem; font-size: .9rem; color: #fff; outline: none; transition: border-color .2s; }
.field > input:focus { border-color: #c6f54a; }
.field > input:disabled { color: #8b95a8; background: #0c0c0c; }

.btn-icon { display: inline-flex; align-items: center; justify-content: center; height: 2rem; min-width: 2rem;
  border-radius: .6rem; border: 1px solid #2a2a2a; background: #161616; font-size: .8rem; color: #c7cede; transition: all .15s; }
.btn-icon:hover:not(:disabled) { border-color: rgba(198,245,74,.5); color: #fff; }
.btn-icon-danger { display: inline-flex; align-items: center; justify-content: center; height: 2rem; min-width: 2.4rem;
  border-radius: .6rem; border: 1px solid rgba(230,57,70,.3); background: rgba(230,57,70,.08); font-size: .8rem; color: #e63946; transition: all .15s; }
.btn-icon-danger:hover { background: rgba(230,57,70,.2); border-color: #e63946; }
.btn-danger { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; border-radius: .75rem;
  border: 1px solid rgba(230,57,70,.45); background: rgba(230,57,70,.14); padding: .625rem 1rem;
  font-size: .875rem; font-weight: 600; color: #ff6b74; transition: all .2s; }
.btn-danger:hover { background: rgba(230,57,70,.26); }

.chip { display: inline-flex; align-items: center; gap: .35rem; border-radius: 999px; border: 1px solid #2a2a2a;
  background: rgba(255,255,255,.04); padding: .2rem .65rem; font-size: .72rem; color: #c7cede; }
.chip-main { border-color: rgba(198,245,74,.45); background: rgba(198,245,74,.12); color: #c6f54a; font-weight: 600; }
.chip-editable button { margin-left: .1rem; color: #8b95a8; font-size: .65rem; }
.chip-editable button:hover { color: #e63946; }

.crest { display: inline-flex; align-items: center; justify-content: center; flex: none; border-radius: .8rem;
  object-fit: contain; background: #111; border: 1px solid #2a2a2a; padding: 2px; }
.crest-fallback { font-weight: 800; font-size: .95rem; letter-spacing: -.02em; color: #fff;
  background: linear-gradient(140deg, hsl(var(--crest-hue, 20) 55% 32%), hsl(var(--crest-hue, 20) 45% 16%)); }
.crest-empty { border-style: dashed; color: #8b95a8; font-weight: 700; }

.pos-dot { display: inline-flex; height: 1.4rem; width: 1.4rem; flex: none; align-items: center; justify-content: center;
  border-radius: .45rem; background: rgba(18,22,32,.85); border: 1px solid rgba(255,200,87,.35);
  font-family: 'JetBrains Mono', monospace;
  font-size: .7rem; font-weight: 700; color: #c6f54a; }

/* ==========================================================================
   Страница «Команды»
   ========================================================================== */
.team-grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.team-card { position: relative; display: flex; flex-direction: column; overflow: hidden; border-radius: 1.15rem;
  border: 1px solid rgba(255,255,255,.08); background: #0c0c0c;
  padding: 1.25rem; transition: border-color .25s; }
.team-card:hover { border-color: rgba(255,255,255,.18); }
.team-card-sheen { position: absolute; inset: -40% 40% auto -10%; height: 60%; pointer-events: none; opacity: 0;
  background: radial-gradient(closest-side, rgba(198,245,74,.35), transparent); transition: opacity .35s; }
.team-card:hover .team-card-sheen { opacity: 1; }
.team-card > * { position: relative; }

.rating-badge { flex: none; text-align: right; }
.rating-badge b { display: block; font-family: 'JetBrains Mono', monospace; font-size: 1.15rem; color: #c6f54a; }
.rating-badge span { font-size: .6rem; text-transform: uppercase; letter-spacing: .12em; color: #8b95a8; }

.wr-track { height: 5px; overflow: hidden; border-radius: 999px; background: #111; }
.wr-fill { height: 100%; border-radius: 999px; background: #c6f54a; }

.roster-row { display: flex; align-items: center; gap: .6rem; border-radius: .6rem; padding: .35rem .5rem;
  font-size: .85rem; transition: background .15s; }
.roster-row:hover { background: rgba(255,255,255,.04); }

.player-edit { display: flex; align-items: center; gap: .4rem; border-radius: .8rem; border: 1px solid #2a2a2a;
  background: rgba(255,255,255,.03); padding: .45rem .5rem; }
.player-edit input { min-width: 0; }

/* ==========================================================================
   Слои: шторка и модалки
   ========================================================================== */
.layer { position: fixed; inset: 0; z-index: 60; }
.layer-backdrop { position: absolute; inset: 0; background: rgba(6,8,12,.72); backdrop-filter: blur(6px); }
.drawer { position: absolute; right: 0; top: 0; bottom: 0; display: flex; width: 100%; max-width: 34rem;
  flex-direction: column; border-left: 1px solid #2a2a2a; background: #0c0c0c; box-shadow: -20px 0 60px rgba(0,0,0,.6); }
.drawer-enter { animation: slideIn .22s cubic-bezier(.22,1,.36,1); }
.drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem;
  border-bottom: 1px solid #2a2a2a; padding: 1.25rem 1.5rem; }
.drawer-body { flex: 1; overflow-y: auto; padding: 1.25rem 1.5rem; }
.drawer-foot { display: flex; gap: .75rem; border-top: 1px solid #2a2a2a; background: #0c0c0c; padding: 1rem 1.5rem; }
.ed-block { border-bottom: 1px dashed #2a2a2a; padding-bottom: 1.25rem; margin-bottom: 1.25rem; }
.ed-block:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }

.modal { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: calc(100% - 2rem);
  max-width: 34rem; max-height: calc(100vh - 4rem); overflow: hidden; display: flex; flex-direction: column;
  border-radius: 1.25rem; border: 1px solid #2a2a2a; background: #111; padding: 1.5rem; box-shadow: 0 24px 70px rgba(0,0,0,.7); }
.modal-sm { max-width: 24rem; }
.modal-wide { max-width: 62rem; }
.pop-enter { animation: popIn .18s cubic-bezier(.22,1,.36,1); }
@keyframes popIn { from { opacity: 0; transform: translate(-50%, -48%) scale(.96); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }

.picker-scroll { overflow-y: auto; max-height: 60vh; }
.found-list { display: flex; flex-direction: column; gap: .25rem; }
.found-row { display: flex; width: 100%; align-items: center; gap: .75rem; border-radius: .8rem;
  border: 1px solid transparent; background: #111; padding: .5rem .7rem; text-align: left; transition: all .15s; }
.found-row:hover:not(:disabled) { border-color: rgba(198,245,74,.45); background: rgba(198,245,74,.08); }

/* ==========================================================================
   Страница «Разбор драфта»
   ========================================================================== */
.board { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 1rem; }
.board-vs { display: flex; height: 3rem; width: 3rem; align-items: center; justify-content: center; border-radius: 999px;
  border: 1px solid #2a2a2a; background: #111; font-weight: 800; font-size: .8rem; letter-spacing: .05em; color: #8b95a8; }

.side-head { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  overflow: hidden; border-radius: 1.25rem; border: 1px solid #2a2a2a; padding: 1rem 1.25rem; transition: all .2s; }
.side-head-radiant { background: linear-gradient(100deg, rgba(198,245,74,.16), #0c0c0c 65%); border-color: rgba(198,245,74,.3); }
.side-head-dire { background: linear-gradient(260deg, rgba(230,57,70,.16), #0c0c0c 65%); border-color: rgba(230,57,70,.3); }
.side-head:hover { transform: translateY(-2px); box-shadow: 0 12px 34px rgba(0,0,0,.5); }
.side-head-radiant:hover { border-color: #c6f54a; }
.side-head-dire:hover { border-color: #e63946; }
.side-tag { position: absolute; top: .5rem; left: 1.25rem; font-size: .6rem; font-weight: 700;
  letter-spacing: .22em; text-transform: uppercase; opacity: .6; }
.side-head-radiant .side-tag { color: #c6f54a; }
.side-head-dire { flex-direction: row-reverse; }
.side-head-dire .side-tag { left: auto; right: 1.25rem; color: #e63946; }
.side-head-dire .side-body { flex-direction: row-reverse; }
.side-head-dire .side-body .text-left { text-align: right; }
.side-body { display: flex; min-width: 0; align-items: center; gap: .75rem; margin-top: .6rem; }
.side-head-hint { flex: none; font-size: .65rem; text-transform: uppercase; letter-spacing: .12em; color: #8b95a8; opacity: 0; transition: opacity .2s; }
.side-head:hover .side-head-hint { opacity: 1; }

.board-grid { display: grid; grid-template-columns: 1fr minmax(230px, 300px) 1fr; gap: 1rem; align-items: start; }
.slot-col { display: flex; flex-direction: column; gap: .6rem; }

.slot { display: flex; gap: .85rem; overflow: hidden; border-radius: 1rem; border: 1px solid #2a2a2a;
  background: #0c0c0c; padding: .6rem; transition: border-color .2s, background .2s; }
.slot-radiant.slot-filled { border-color: rgba(198,245,74,.3); background: linear-gradient(100deg, rgba(198,245,74,.08), #0c0c0c 70%); }
/* Dire отражается, чтобы стороны смотрели друг на друга как в самой игре. */
.slot-dire { flex-direction: row-reverse; }
.slot-dire .slot-body { text-align: right; }
.slot-dire .slot-select { text-align: right; direction: rtl; }
.slot-dire .slot-pos { left: auto; right: .3rem; }
.slot-dire .slot-clear { right: auto; left: .25rem; }
.slot-dire.slot-filled { border-color: rgba(230,57,70,.3); background: linear-gradient(260deg, rgba(230,57,70,.08), #0c0c0c 70%); }
.slot-dire .slot-head { flex-direction: row-reverse; }
.slot-portrait { position: relative; flex: none; height: 4rem; width: 7.1rem; overflow: hidden; border-radius: .7rem;
  border: 1px solid #2a2a2a; background: #0c0c0c; display: flex; align-items: center; justify-content: center; transition: all .2s; }
.slot-portrait img { height: 100%; width: 100%; object-fit: cover; filter: saturate(.85); transition: filter .25s, transform .25s; }
.slot-portrait:hover img { filter: saturate(1.15) brightness(1.08); transform: scale(1.06); }
.slot-portrait:hover { border-color: #c6f54a; }
.slot-plus { font-size: 1.6rem; font-weight: 300; color: #4a5468; transition: color .2s; }
.slot-portrait:hover .slot-plus { color: #c6f54a; }
.slot-pos { position: absolute; bottom: .2rem; left: .3rem; border-radius: .35rem; background: rgba(6,8,12,.8);
  padding: 0 .3rem; font-family: 'JetBrains Mono', monospace; font-size: .65rem; font-weight: 700; color: #c6f54a; }
.meta-tag { position: absolute; top: .2rem; left: .25rem; border-radius: .3rem; background: rgba(198,245,74,.92);
  padding: 0 .28rem; font-size: .55rem; font-weight: 800; letter-spacing: .06em; color: #fff; line-height: 1.4; }
.slot-meta { border-color: rgba(198,245,74,.45); }
.slot-radiant.slot-meta { box-shadow: inset 0 0 0 1px rgba(198,245,74,.25); }
.slot-dire.slot-meta { box-shadow: inset 0 0 0 1px rgba(198,245,74,.25); }
.slot-dire .meta-tag { left: auto; right: .25rem; }
.slot-clear { position: absolute; top: .2rem; right: .25rem; display: flex; height: 1.15rem; width: 1.15rem;
  align-items: center; justify-content: center; border-radius: .35rem; background: rgba(6,8,12,.75);
  font-size: .6rem; color: #c7cede; opacity: 0; transition: opacity .15s, background .15s; }
.slot:hover .slot-clear { opacity: 1; }
.slot-clear:hover { background: #e63946; color: #fff; }
.slot-body { min-width: 0; flex: 1; padding: .1rem .1rem 0 0; }
.slot-select { width: 100%; border-radius: .55rem; border: 1px solid #2a2a2a; background: #111;
  padding: .3rem .5rem; font-size: .78rem; color: #c7cede; outline: none; }
.slot-select:focus { border-color: #c6f54a; }

.mid-card { position: relative; overflow: hidden; border-radius: 1.25rem; border: 1px solid rgba(255,255,255,.08);
  background: #0c0c0c; padding: 1.5rem;
  display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 15rem; }
.mid-card::before { content: ''; position: absolute; inset: -50% 0 auto 0; height: 100%;
  background: radial-gradient(closest-side, rgba(198,245,74,.16), transparent); pointer-events: none; }
.mid-card > * { position: relative; width: 100%; }
.mid-emblem { display: flex; height: 4.5rem; width: 4.5rem; margin: 0 auto; align-items: center; justify-content: center;
  border-radius: 999px; border: 1px solid rgba(198,245,74,.4); background: rgba(198,245,74,.1);
  font-size: 1.75rem; color: #c6f54a; box-shadow: 0 0 40px rgba(198,245,74,.25) inset; }

.prob-duel { display: flex; align-items: baseline; justify-content: space-between; }
.prob-track { display: flex; height: .55rem; overflow: hidden; border-radius: 999px; background: #0c0c0c; }
.prob-fill-radiant { background: #c6f54a; transition: width .6s cubic-bezier(.22,1,.36,1); }
.prob-fill-dire { background: #ff5a47; transition: width .6s cubic-bezier(.22,1,.36,1); }

.pulse-ring { height: 3.5rem; width: 3.5rem; margin: 0 auto; border-radius: 999px;
  border: 3px solid rgba(198,245,74,.25); border-top-color: #c6f54a; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.tempo-tile { border-radius: .9rem; border: 1px solid #2a2a2a; background: rgba(15,17,23,.7); padding: .9rem 1rem; }
.tempo-pick { display: flex; align-items: center; gap: .6rem; border-radius: .7rem; background: #111;
  padding: .5rem .7rem; font-size: .85rem; }

.hero-grid { display: grid; gap: .5rem; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  overflow-y: auto; max-height: 60vh; padding-right: .25rem; }
.hero-tile { overflow: hidden; border-radius: .6rem; border: 1px solid #2a2a2a; background: #0c0c0c; transition: all .15s; }
.hero-tile img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; filter: saturate(.7) brightness(.85); transition: filter .2s; }
.hero-tile span { display: block; padding: .25rem .3rem; font-size: .62rem; line-height: 1.2; color: #c7cede;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hero-tile:hover:not(:disabled) { border-color: #c6f54a; transform: translateY(-2px); }
.hero-tile:hover:not(:disabled) img { filter: saturate(1.1) brightness(1.05); }
.hero-tile-active { border-color: #c6f54a; box-shadow: 0 0 0 2px rgba(244,140,6,.3); }
.hero-tile-busy { opacity: .3; }

/* ==========================================================================
   Уведомления
   ========================================================================== */
#toasts { position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 90; display: flex; flex-direction: column; gap: .5rem; }
.toast { max-width: 24rem; border-radius: .8rem; border: 1px solid #2a2a2a; background: #111;
  padding: .7rem 1rem; font-size: .85rem; color: #fff; box-shadow: 0 12px 34px rgba(0,0,0,.6);
  animation: toastIn .2s cubic-bezier(.22,1,.36,1); }
.toast-ok { border-color: rgba(198,245,74,.5); }
.toast-err { border-color: rgba(230,57,70,.6); }
.toast-warn { border-color: rgba(198,245,74,.6); }
.toast-out { opacity: 0; transform: translateX(12px); transition: opacity .35s, transform .35s; }
@keyframes toastIn { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: translateX(0); } }

/* ==========================================================================
   Логин — вход в сервис
   ========================================================================== */
#app.login-mode { display: block; }
#app.login-mode #sidebar { display: none; }
#app.login-mode main { margin-left: 0; min-height: 100vh; }
#app.login-mode #content { max-width: none; padding: 0; }
body:has(#app.login-mode) .app-atmosphere { opacity: 1; }

.font-display { font-family: Syne, Manrope, sans-serif; }

.login-shell {
  position: relative; isolation: isolate; overflow: hidden;
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: clamp(1.5rem, 4vw, 3rem);
  background: transparent;
}
.login-aura { display: none; }
.login-grid {
  position: absolute; inset: 0; z-index: 0; opacity: .55; pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.07) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(80% 70% at 50% 40%, #000 15%, transparent 88%);
}
@keyframes loginAura {
  from { transform: scale(1) translate(0,0); }
  to { transform: scale(1.06) translate(1.5%, -1%); }
}

.login-layout {
  position: relative; z-index: 1; width: min(1080px, 100%);
  display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}
.login-brand { animation: loginRise .7s cubic-bezier(.22,1,.36,1) both; }
.login-brand-mark {
  font-family: Syne, Manrope, sans-serif; font-weight: 800; font-size: .95rem;
  letter-spacing: .22em; text-transform: uppercase; color: #c6f54a; margin-bottom: 1.25rem;
}
.login-headline {
  font-family: Syne, Manrope, sans-serif; font-weight: 800; letter-spacing: -.04em;
  line-height: .98; font-size: clamp(2.4rem, 5.2vw, 4.1rem); color: #f4f6fb;
}
.login-headline span {
  color: #c6f54a;
}
.login-lead {
  margin-top: 1.25rem; max-width: 34rem; font-size: 1.05rem; line-height: 1.55; color: #9aa3b5;
}
.login-points {
  margin-top: 1.75rem; display: grid; gap: .65rem; padding: 0; list-style: none;
}
.login-points li {
  position: relative; padding-left: 1.15rem; color: #c5ccd8; font-size: .92rem;
}
.login-points li::before {
  content: ''; position: absolute; left: 0; top: .55rem; width: .45rem; height: .45rem;
  border-radius: 999px; background: #c6f54a; box-shadow: 0 0 12px rgba(198,245,74,.55);
}

.login-card {
  border-radius: 1.25rem; border: 1px solid rgba(255,255,255,.08);
  background: #0b0b0b;
  padding: clamp(1.5rem, 3vw, 2rem);
  box-shadow: none;
  animation: loginRise .75s .08s cubic-bezier(.22,1,.36,1) both;
}
.login-card-kicker {
  font-size: .7rem; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: #c6f54a;
}
.login-card-title {
  margin-top: .45rem; font-family: Syne, Manrope, sans-serif; font-size: 1.65rem; font-weight: 750; letter-spacing: -.02em;
}
.login-card-sub { margin-top: .4rem; margin-bottom: 1.4rem; font-size: .9rem; color: #8b95a8; line-height: 1.45; }
.login-label { display: block; margin-bottom: .35rem; font-size: .8rem; font-weight: 600; color: #9aa3b5; }
.login-label[for="login-pass"] { margin-top: 1rem; }
.login-input {
  width: 100%; border-radius: .9rem; border: 1px solid #2a2a2a; background: #111;
  padding: .85rem 1rem; color: #fff; font-size: .95rem; outline: none; transition: border-color .2s, box-shadow .2s;
}
.login-input:focus {
  border-color: rgba(198,245,74,.7); box-shadow: 0 0 0 3px rgba(198,245,74,.18);
}
.login-error { margin-top: .85rem; font-size: .85rem; color: #e63946; }
.login-submit {
  margin-top: 1.35rem; width: 100%; border: 0; border-radius: 999px;
  background: #f3f3f0; color: #0a0a0a;
  font-family: Syne, "Instrument Sans", sans-serif; font-weight: 700; font-size: .98rem;
  padding: .95rem 1rem; cursor: pointer; transition: transform .15s, filter .15s, opacity .15s;
}
.login-submit:hover { filter: brightness(1.06); transform: translateY(-1px); }
.login-submit:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.login-footnote { margin-top: 1rem; text-align: center; font-size: .72rem; color: #6d7689; letter-spacing: .02em; }

@keyframes loginRise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 900px) {
  .login-layout { grid-template-columns: 1fr; gap: 2rem; }
  .login-brand { text-align: left; }
  .login-headline { font-size: clamp(2.1rem, 9vw, 3rem); }
}

@media (max-width: 1100px) {
  .board, .board-grid { grid-template-columns: 1fr; }
  .board-vs { margin: 0 auto; }
  .board-mid { order: -1; }
}


/* Контраст и доводка кабинета */
.text-muted { color: #8e8e88 !important; }
.chip, .badge { backdrop-filter: none; }
.chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: .45rem .9rem;
  font-size: .875rem;
  font-weight: 500;
  background: #111;
  color: #c8c8c2;
  border: 1px solid rgba(255,255,255,.08);
  transition: color .2s, background .2s, border-color .2s;
}
.chip:hover { color: #fff; border-color: rgba(255,255,255,.16); }
.chip-active {
  background: rgba(198,245,74,.1) !important;
  color: #c6f54a !important;
  border-color: rgba(198,245,74,.4) !important;
  box-shadow: none;
}
.chip-main { background: rgba(198,245,74,.14); color: #c6f54a; border: 1px solid rgba(198,245,74,.35); }
.login-brand-logo { filter: none; }

/* Экран загрузки после логина / проверки сессии */
#app.app-booting { display: block; }
#app.app-booting #sidebar { display: none; }
#app.app-booting main { margin-left: 0; min-height: 100vh; }
#app.app-booting #content {
  max-width: none; padding: 0; min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
}
.app-boot {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1.25rem; padding: 2rem; text-align: center;
  animation: bootFadeIn .4s cubic-bezier(.22,1,.36,1) both;
}
.app-boot-logo {
  width: 56px; height: 56px; border-radius: 14px;
  filter: none;
  animation: bootLogoPulse 2.2s ease-in-out infinite;
}
.app-boot-spinner {
  width: 2rem; height: 2rem; border-radius: 9999px;
  border: 2px solid rgba(142, 154, 175, .25);
  border-top-color: #c6f54a;
  animation: bootSpin .75s linear infinite;
}
.app-boot-text {
  margin: 0; font-size: .95rem; font-weight: 500; color: #9aa3b5; letter-spacing: .01em;
}
@keyframes bootFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes bootSpin { to { transform: rotate(360deg); } }
@keyframes bootLogoPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}
.section-label { color: #c6f54a; text-shadow: none; }
.rating-badge {
  background: #111;
  border: 1px solid rgba(255,255,255,.1);
  padding: .35rem .55rem;
  border-radius: .65rem;
}
.rating-badge b { color: #fff; }
.rating-badge span { color: #8e8e88; }
.btn-ghost { color: #f3f3f0; background: transparent; }
.btn-ghost:hover { color: #fff; }
.btn-primary { color: #0a0a0a; text-shadow: none; background: #f3f3f0; }
.nav-active { color: #c6f54a; }
.nav-btn.text-muted { color: #8e8e88; }
.login-lead, .login-card-sub, .login-footnote { color: #8e8e88; }
.lab-tab-active { color: #c6f54a !important; background: rgba(198,245,74,.1) !important; }
.metric-chip { background: #111; border: 1px solid rgba(255,255,255,.08); }
.metric-chip b { color: #fff; }
.metric-chip span { color: #8e8e88; }
.eyebrow { color: #c6f54a; }
.page-title {
  color: #f3f3f0;
  background: none;
  -webkit-background-clip: unset;
  background-clip: unset;
}

/* Markdown-вердикты ИИ */
.md-body { font-size: 0.925rem; line-height: 1.65; color: rgba(255,255,255,.9); }
.md-body > *:first-child { margin-top: 0; }
.md-body > *:last-child { margin-bottom: 0; }
.md-body h1, .md-body h2, .md-body h3, .md-body h4 {
  font-family: Syne, Manrope, sans-serif;
  font-weight: 700;
  color: #fff;
  margin: 1.1em 0 .45em;
  line-height: 1.25;
}
.md-body h1 { font-size: 1.35rem; }
.md-body h2 { font-size: 1.15rem; }
.md-body h3 { font-size: 1.05rem; color: #c6f54a; }
.md-body h4 { font-size: .95rem; color: #aeb6c6; }
.md-body p { margin: .55em 0; }
.md-body ul, .md-body ol { margin: .55em 0 .55em 1.2em; padding: 0; }
.md-body li { margin: .25em 0; }
.md-body strong { color: #fff; font-weight: 700; }
.md-body em { color: #d7dce8; }
.md-body code {
  font-family: "JetBrains Mono", monospace;
  font-size: .85em;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 6px;
  padding: .1em .35em;
}
.md-body hr {
  border: 0;
  border-top: 1px solid rgba(255,255,255,.1);
  margin: 1em 0;
}
.md-body .md-table {
  width: 100%;
  border-collapse: collapse;
  margin: .75em 0;
  font-size: .85rem;
  font-family: "JetBrains Mono", monospace;
}
.md-body .md-table th,
.md-body .md-table td {
  border: 1px solid rgba(255,255,255,.1);
  padding: .45em .65em;
  text-align: left;
}
.md-body .md-table th {
  background: rgba(255,255,255,.04);
  color: #aeb6c6;
  font-weight: 600;
  text-transform: uppercase;
  font-size: .7rem;
  letter-spacing: .04em;
}
.md-body .md-table tr:nth-child(even) td { background: rgba(255,255,255,.02); }

/* ==========================================================================
   Мобильный кабинет: шапка и выезжающее меню
   ========================================================================== */
.app-topbar,
.nav-scrim { display: none; }
.nav-toggle {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 2.4rem;
  height: 2.4rem;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  width: 1.15rem;
  height: 1.5px;
  background: #f3f3f0;
  border-radius: 99px;
}
.app-topbar-name {
  font-family: Syne, "Instrument Sans", sans-serif;
  font-weight: 700;
  letter-spacing: -.03em;
}

@media (max-width: 900px) {
  #app:not(.landing-mode):not(.login-mode):not(.app-booting) .app-topbar {
    display: flex;
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 32;
    align-items: center;
    gap: .7rem;
    height: calc(3.15rem + env(safe-area-inset-top));
    padding: env(safe-area-inset-top) 1rem 0;
    background: #080808;
    border-bottom: 1px solid rgba(255,255,255,.08);
  }
  #app:not(.landing-mode):not(.login-mode):not(.app-booting) main.app-main {
    margin-left: 0;
    padding-top: calc(3.15rem + env(safe-area-inset-top));
  }
  #app:not(.landing-mode):not(.login-mode):not(.app-booting) #content {
    max-width: none;
    padding: 1rem 1rem calc(1.5rem + env(safe-area-inset-bottom)) !important;
  }
  .app-sidebar {
    transform: translateX(-110%);
    transition: transform .22s cubic-bezier(.22,1,.36,1);
    width: min(18rem, 86vw);
    z-index: 40;
  }
  body.nav-open .app-sidebar,
  .app-sidebar.is-open { transform: none; }
  body.nav-open { overflow: hidden; }
  body.nav-open .nav-scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 35;
    background: rgba(0,0,0,.55);
  }
  .page-title { font-size: clamp(1.55rem, 7.5vw, 2rem); }
  .page-hero { padding: 1.15rem; }
  .team-grid { grid-template-columns: 1fr; }
  .content-pane { overflow-x: auto; }
  .drawer { max-width: 100%; }
  .modal { width: calc(100% - 1.25rem); padding: 1.15rem; }
  .login-shell { padding: 1.25rem 1rem; }
  .login-layout { gap: 1.5rem; }
}

@media (max-width: 480px) {
  .metric-chip { padding: .4rem .65rem; }
  .metric-chip b { font-size: 1.1rem; }
  .side-head { padding: .85rem 1rem; }
}
