:root {
  --board: min(calc(92vw - 26px), 82vh, 640px);
  --sq: calc(var(--board) / 8);
  --light: #f0d9b5;
  --dark: #b58863;
  --bg: #262421;
  --panel: #312e2b;
  --text: #e8e6e3;
  --muted: #9e9a95;
  --accent: #81b64c;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.app {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  justify-content: center;
  align-items: flex-start;
  padding: 24px 16px;
}

/* ---------- Режимы ---------- */

body[data-mode="play"] .analysis-only,
body[data-mode="online"] .analysis-only,
body[data-mode="online"] .play-only,
body[data-mode="analysis"] .play-only,
body[data-mode="analysis"] .game-only { display: none !important; }

/* ---------- Доска ---------- */

.board-area { display: flex; gap: 8px; }
.board-wrap { position: relative; }

.arrows {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 3;
  pointer-events: none;
}
.arrows line { stroke-width: .17; }
.arrows .best line { stroke: #15781b; }
.arrows .best polygon { fill: #15781b; }
.arrows .best { opacity: .8; }
.arrows .alt line { stroke: #003088; }
.arrows .alt polygon { fill: #003088; }
.arrows .alt { opacity: .4; }

.eval-bar {
  position: relative;
  width: 18px;
  height: var(--board);
  border-radius: 3px;
  overflow: hidden;
  background: #403d39;
}
.eval-fill {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--white, 50%);
  background: #f2f2f2;
  transition: height .4s ease;
}
.eval-bar.flipped .eval-fill { top: 0; bottom: auto; }
.eval-bar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  border-top: 1px solid rgba(220, 60, 60, .7);
}

.board {
  display: grid;
  grid-template-columns: repeat(8, var(--sq));
  grid-template-rows: repeat(8, var(--sq));
  width: var(--board);
  height: var(--board);
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .45);
  touch-action: none;
  user-select: none;
}

.sq {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sq.light { background: var(--light); }
.sq.dark { background: var(--dark); }

.sq.last::before,
.sq.selected::before,
.sq.check::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.sq.last::before { background: rgba(255, 235, 59, .38); }
.sq.selected::before { background: rgba(20, 110, 40, .45); }
.sq.check::before { background: radial-gradient(circle, rgba(255, 0, 0, .9) 0%, rgba(230, 0, 0, .5) 45%, transparent 75%); }

.sq.target::after {
  content: "";
  position: absolute;
  width: 30%;
  height: 30%;
  border-radius: 50%;
  background: rgba(20, 85, 30, .45);
  pointer-events: none;
}
.sq.target.capture::after {
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, transparent 62%, rgba(20, 85, 30, .45) 64%);
}
.sq.target:hover { outline: 3px solid rgba(20, 85, 30, .6); outline-offset: -3px; }

.piece {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
  user-select: none;
}
.sq.movable { cursor: grab; }
.sq.dragging .piece { opacity: .25; }

.ghost {
  position: fixed;
  z-index: 100;
  width: var(--sq);
  height: var(--sq);
  pointer-events: none;
  transform: translate(-50%, -50%) scale(1.1);
  cursor: grabbing;
}

.coord {
  position: absolute;
  z-index: 2;
  font-size: calc(var(--sq) * .18);
  font-weight: 700;
  pointer-events: none;
}
.coord.rank { top: 3px; left: 4px; }
.coord.file { bottom: 2px; right: 4px; }
.sq.light .coord { color: var(--dark); }
.sq.dark .coord { color: var(--light); }

/* ---------- Превращение пешки ---------- */

.promo {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, .55);
  border-radius: 4px;
}
.promo[hidden] { display: none; }
.promo-box {
  background: var(--panel);
  padding: 16px 20px;
  border-radius: 8px;
  text-align: center;
}
.promo-box p { margin: 0 0 10px; }
.promo-choices { display: flex; gap: 8px; }
.promo-choices button {
  width: var(--sq);
  height: var(--sq);
  padding: 0;
  background: var(--light);
  border: 0;
  border-radius: 6px;
  cursor: pointer;
}
.promo-choices button:hover { background: #fff3c4; }

/* ---------- Панель ---------- */

.panel {
  width: min(92vw, 320px);
  background: var(--panel);
  border-radius: 8px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
h1 { margin: 0; font-size: 22px; }

.controls { display: flex; flex-direction: column; gap: 10px; }
.controls label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
select, button {
  font: inherit;
  color: var(--text);
  background: #45423e;
  border: 1px solid #55524d;
  border-radius: 6px;
  padding: 6px 10px;
}
select { min-width: 150px; }
button { cursor: pointer; }
button:hover:not(:disabled) { background: #55524d; }
button:disabled { opacity: .5; cursor: default; }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
button.primary:hover { background: #95c95e; }
.buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.buttons button { flex: 1 1 auto; }

.status {
  font-size: 15px;
  font-weight: 600;
  text-align: center;
  padding: 8px 10px;
  border-bottom: 1px solid #3d3a36;
}
.status.over { background: #4a3a22; }
.status.thinking::after {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-left: 8px;
  border: 2px solid var(--muted);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.info { color: var(--muted); font-size: 13px; min-height: 1.4em; }

/* ---------- Колонка с часами и записью (как на lichess) ---------- */

.table {
  display: flex;
  flex-direction: column;
  width: 270px;
  height: var(--board);
  margin-left: -16px; /* вплотную к доске, как на lichess */
}

.rclock { display: flex; flex-direction: column; align-items: flex-start; }
.rclock[hidden] { display: none; }
.rclock .time {
  padding: 0 14px;
  font: 400 44px/1.25 Roboto, "Noto Sans", system-ui, sans-serif;
  letter-spacing: 4px;
  font-variant-numeric: tabular-nums;
  color: #bababa;
  background: var(--panel);
}
.rclock-top .time { border-radius: 4px 4px 0 0; }
.rclock-bottom .time { border-radius: 0 0 4px 4px; }
.rclock .sep { opacity: .5; padding: 0 1px; }
.rclock .tenths { font-size: 70%; }
.rclock .bar {
  width: 100%;
  height: 4px;
  background: #629924;
  transform-origin: left;
  transform: scaleX(var(--left, 1));
}
.rclock.running .time { background: #3d5a1c; color: #fff; }
.rclock.low .time { color: #ff9b8f; }
.rclock.running.low .time { background: #7a2a24; color: #fff; }
.rclock.flagged .time { background: #7a2a24; color: #fff; }
.rclock.low .bar { background: #c33; }

.table-mid {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--panel);
}
.rclock-top + .table-mid { border-top-right-radius: 4px; }
.table-mid:last-child, .table-mid:first-child { border-radius: 4px; }

.ruser {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  font-size: 16px;
}
.ruser .dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 1.5px solid #bababa;
  flex: none;
}
.ruser .dot.w { background: #fff; }
.ruser .dot.b { background: #111; }
.ruser .note { color: var(--muted); font-size: 13px; }
.ruser .material { margin-left: auto; display: flex; align-items: center; color: var(--muted); font-size: 13px; }
.ruser .material img { width: 22px; height: 22px; margin-right: -8px; }
.ruser .material .group { display: flex; margin-right: 10px; }
.ruser .material b { font-weight: 400; margin-left: 4px; }

@media (max-width: 1100px) {
  .table { width: var(--board); height: auto; margin-left: 0; }
  .table .moves { max-height: 200px; }
}

/* ---------- Вкладки и анализ ---------- */

.tabs { display: flex; background: #2a2724; border-radius: 6px; padding: 3px; }
.tabs button { flex: 1; background: none; border: 0; color: var(--muted); }
.tabs button.active { background: #45423e; color: var(--text); font-weight: 600; }

.analysis { display: flex; flex-direction: column; gap: 10px; }
.engine-head { display: flex; align-items: baseline; gap: 12px; }
.switch { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.switch input { accent-color: var(--accent); width: 16px; height: 16px; }
.eval-text { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.depth { color: var(--muted); font-size: 13px; margin-left: auto; }

.pv {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 13px;
  background: #2a2724;
  border-radius: 6px;
}
.pv:empty { display: none; }
.pv li {
  display: flex;
  gap: 8px;
  padding: 4px 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pv li + li { border-top: 1px solid #36332f; }
.pv b { min-width: 42px; font-variant-numeric: tabular-nums; }
.pv span { overflow: hidden; text-overflow: ellipsis; color: #cfcbc6; }
.error { color: #e6a23c; }

.ideas-head { font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.ideas { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 3px; }
.ideas li {
  padding: 5px 8px;
  font-size: 13px;
  line-height: 1.35;
  background: #2a2724;
  border-left: 3px solid #6b6762;
  border-radius: 0 4px 4px 0;
  cursor: default;
}
.ideas li.good { border-left-color: #629924; }
.ideas li.bad { border-left-color: #c9483f; }
.ideas li:hover { background: #36332f; }
.ideas:empty::after { content: "Нет заметных идей"; color: var(--muted); font-size: 13px; }
.sq.idea { box-shadow: inset 0 0 0 4px rgba(255, 170, 0, .9); }

.review-summary p { margin: 2px 0; font-size: 13px; }
.review-summary:empty { display: none; }

.graph {
  width: 100%;
  height: 90px;
  background: #3a3733;
  border-radius: 6px;
  cursor: pointer;
}
.graph.empty { display: none; }
.graph .area { fill: #f2f2f2; opacity: .9; }
.graph line { vector-effect: non-scaling-stroke; stroke-width: 1px; }
.graph .mid { stroke: rgba(220, 60, 60, .6); }
.graph .cursor { stroke: var(--accent); stroke-width: 2px; }
.graph .inaccuracy { stroke: #56b4e9; }
.graph .mistake { stroke: #e69f00; }
.graph .blunder { stroke: #df5353; }

.inaccuracy { --mark: #56b4e9; }
.mistake { --mark: #e69f00; }
.blunder { --mark: #df5353; }
.review-summary span { color: var(--mark); }

.nav {
  display: flex;
  gap: 4px;
  align-items: center;
  border-top: 1px solid #3d3a36;
  border-bottom: 1px solid #3d3a36;
}
.nav-btn {
  flex: 1 1 0;
  height: 34px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 0;
  color: #f2f2f2;
}
.nav-btn:hover:not(:disabled) { background: rgba(255, 255, 255, .08); }
.nav-btn:disabled { opacity: .3; }
.nav-btn svg { width: 20px; height: 20px; fill: currentColor; }
.nav-btn .chevron {
  fill: none;
  stroke: currentColor;
  stroke-width: 3.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
body[data-mode="play"] .nav #flip { flex: 0 0 44px; margin-left: auto; }
body[data-mode="play"] .nav #resign,
body[data-mode="online"] .nav #resign { flex: 0 0 44px; }
body[data-mode="online"] .nav #flip { flex: 0 0 44px; margin-left: auto; }
.resign-confirm { display: flex; align-items: center; gap: 6px; padding-left: 10px; font-size: 14px; }
.resign-confirm[hidden],
.nav-btn[hidden] { display: none; }
.resign-confirm button { padding: 3px 10px; }
.resign-confirm .yes { background: #a33a32; border-color: #a33a32; color: #fff; }
.resign-confirm .yes:hover { background: #c0443a; }

.moves {
  margin: 0;
  padding: 0;
  list-style: none;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  font-variant-numeric: tabular-nums;
}
.moves li {
  display: grid;
  grid-template-columns: 36px 1fr 1fr;
  padding: 3px 8px;
}
.moves li:nth-child(odd) { background: #2f2c29; }
.moves .num { color: var(--muted); }
.moves .move { padding: 0 4px; border-radius: 3px; }
body[data-mode="analysis"] .moves .move { cursor: pointer; }
body[data-mode="analysis"] .moves .move:hover { background: #45423e; }
.moves .current { color: var(--accent); font-weight: 700; }
body[data-mode="analysis"] .moves .current { background: #2f5d8a; color: #fff; }
.moves .mark { color: var(--mark); font-weight: 700; margin-left: 1px; }
.moves small { float: right; color: var(--muted); font-size: 11px; font-weight: 400; margin-top: 2px; }

/* ---------- Вкладка «Партии», аккаунт ---------- */

body[data-view="games"] .panel .play-only,
body[data-view="games"] .panel .analysis-only,
body[data-view="online"] .panel .play-only,
body[data-view="online"] .panel .analysis-only,
body:not([data-view="online"]) .online-only,
body:not([data-view="admin"]) .admin-only,
body[data-view="admin"] .panel .play-only,
body[data-view="admin"] .panel .analysis-only,
body:not([data-view="games"]) .games-only { display: none !important; }
body[data-view="games"] .panel .info { display: none; }

.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.account { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.account .login { font-weight: 600; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.muted { color: var(--muted); }

button.link {
  padding: 0;
  background: none;
  border: 0;
  color: #8fc3ff;
  text-decoration: underline;
  text-underline-offset: 2px;
}
button.link:hover:not(:disabled) { background: none; color: #b5d8ff; }
button.danger { background: #a33a32; border-color: #a33a32; color: #fff; }
button.danger:hover:not(:disabled) { background: #c0443a; }

input {
  font: inherit;
  color: var(--text);
  background: #2a2724;
  border: 1px solid #55524d;
  border-radius: 6px;
  padding: 7px 10px;
  min-width: 0;
}
input:focus-visible, select:focus-visible, button:focus-visible { outline: 2px solid #8fc3ff; outline-offset: 1px; }

.stack { display: flex; flex-direction: column; gap: 8px; }
.stack input[hidden] { display: none; }

.games { display: flex; flex-direction: column; gap: 10px; }
.games-guest p { margin: 0 0 10px; color: var(--muted); font-size: 14px; }
.games-msg { margin: 0; font-size: 13px; color: #e6c07b; }
.filter { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 14px; }

.stats p { margin: 0 0 4px; font-size: 13px; }
.stats table { width: 100%; font-size: 12px; color: var(--muted); border-collapse: collapse; }
.stats td { padding: 1px 0; }
.stats td + td { text-align: right; white-space: nowrap; }
.stats .win, .game-item.win .badge { color: #8bc34a; }
.stats .loss, .game-item.loss .badge { color: #ef7b70; }
.stats .draw, .game-item.draw .badge { color: #c8c3bd; }

.games-list {
  margin: 0;
  padding: 0;
  list-style: none;
  max-height: 46vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.games-list .empty { color: var(--muted); font-size: 13px; padding: 6px 0; }
.game-item {
  padding: 7px 9px;
  background: #2a2724;
  border-left: 3px solid #6b6762;
  border-radius: 0 4px 4px 0;
}
.game-item.win { border-left-color: #629924; }
.game-item.loss { border-left-color: #c9483f; }
.gi-main { display: flex; gap: 8px; align-items: baseline; font-size: 14px; }
.gi-main .badge { font-weight: 700; flex: none; }
.gi-main .opp { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gi-meta { font-size: 12px; color: var(--muted); margin: 2px 0 6px; }
.gi-actions { display: flex; gap: 6px; }
.gi-actions button { padding: 2px 9px; font-size: 13px; }
.gi-actions .del { margin-left: auto; }
.gi-actions .del.confirm { background: #a33a32; border-color: #a33a32; color: #fff; }

.account-settings summary { cursor: pointer; font-size: 13px; color: var(--muted); }
.account-settings form { margin-top: 8px; }

.auth-dialog {
  width: min(92vw, 340px);
  padding: 20px;
  color: var(--text);
  background: var(--panel);
  border: 1px solid #45423e;
  border-radius: 10px;
}
.auth-dialog::backdrop { background: rgba(0, 0, 0, .6); }
.auth-dialog h2 { margin: 0 0 4px; font-size: 20px; }
.auth-dialog .error { margin: 0; font-size: 13px; }

.invites { display: flex; flex-direction: column; gap: 8px; padding-top: 6px; border-top: 1px solid #3d3a36; }
.invites h3 { margin: 0; font-size: 15px; }
.hint { margin: 0; font-size: 12px; color: var(--muted); }
.invite-fresh { display: flex; flex-direction: column; gap: 6px; padding: 8px; background: #2a2724; border-radius: 6px; }
.invite-fresh code { font-size: 18px; letter-spacing: 2px; color: #fff; text-align: center; }
.invite-fresh input { font-size: 12px; }
.invites-list { margin: 0; padding: 0; list-style: none; font-size: 12px; display: flex; flex-direction: column; gap: 2px; }
.invites-list li { display: flex; gap: 8px; align-items: center; color: var(--muted); }
.invites-list .hint-code { font-family: ui-monospace, monospace; color: var(--text); }
.invites-list li.used .status { color: #8bc34a; }
.invites-list button { margin-left: auto; font-size: 12px; }

/* ---------- Онлайн: лобби, партия с человеком, настройки ---------- */

.head-tools { display: flex; align-items: center; gap: 8px; }
.icon-btn { padding: 4px; background: none; border: 0; color: var(--muted); display: flex; }
.icon-btn:hover:not(:disabled) { background: none; color: var(--text); }
.icon-btn svg { width: 20px; height: 20px; fill: currentColor; }

.tabs button { position: relative; }
.badge-dot { position: absolute; top: 4px; right: 6px; width: 8px; height: 8px; border-radius: 50%; background: #e0533f; }
.badge-dot[hidden] { display: none; }

.online-panel { display: flex; flex-direction: column; gap: 10px; }
.lobby { display: flex; flex-direction: column; gap: 8px; }
.lobby h3 { margin: 6px 0 0; font-size: 14px; color: var(--muted); }
.lobby label { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 14px; }
.lobby label.check, .stack label.check { justify-content: flex-start; }
.check input { accent-color: var(--accent); width: 16px; height: 16px; }
.challenge-to { display: flex; gap: 6px; }
.challenge-to input { flex: 1; }
.my-ratings { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; text-align: center; font-size: 12px; }
.my-ratings div { background: #2a2724; border-radius: 4px; padding: 4px 2px; }
.my-ratings b { display: block; font-size: 15px; color: var(--text); }
.my-ratings span { color: var(--muted); }

.lobby-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 3px; font-size: 13px; }
.lobby-list:empty::after { content: "—"; color: var(--muted); }
.lobby-list li { display: flex; align-items: center; gap: 6px; padding: 4px 8px; background: #2a2724; border-radius: 4px; }
.lobby-list .who { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lobby-list .meta { color: var(--muted); white-space: nowrap; }
.lobby-list button { padding: 2px 8px; font-size: 12px; }
.lobby-list .online-dot { width: 8px; height: 8px; border-radius: 50%; background: #629924; flex: none; }
.lobby-list .offline-dot { width: 8px; height: 8px; border-radius: 50%; background: #6b6762; flex: none; }

.online-game { display: flex; flex-direction: column; gap: 8px; padding: 10px; background: #2a2724; border-radius: 6px; }
.online-game-info { margin: 0; font-size: 14px; }
.draw-offer { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 14px; color: #e6c07b; }
.draw-offer[hidden], .online-game[hidden], .lobby[hidden] { display: none; }

.sq.premove::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(20, 30, 85, .45);
  pointer-events: none;
}

.email-box p { margin: 0; font-size: 13px; }
.email-box details { font-size: 13px; }
.email-box summary { cursor: pointer; color: var(--muted); }
.email-box .stack { margin-top: 6px; }
.ok { color: #8bc34a; }
.warn { color: #e6a23c; }

.toast {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: min(92vw, 520px);
  padding: 10px 14px;
  background: #3d5a1c;
  color: #fff;
  border-radius: 8px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .5);
  font-size: 14px;
}
.toast[hidden] { display: none; }
.toast button { padding: 3px 10px; }
.buttons[hidden] { display: none; }

/* ---------- Кнопка «Сдаться» и админка ---------- */

.tabs button[hidden] { display: none; }
.resign-btn { border-color: #7a3b35; }
.resign-btn:hover:not(:disabled) { background: #5a2f2a; }
.resign-btn.confirm { background: #a33a32; border-color: #a33a32; color: #fff; }

.admin-panel { display: flex; flex-direction: column; gap: 8px; }
.admin-panel h3 { margin: 4px 0 0; font-size: 14px; color: var(--muted); }
.admin-panel select { min-width: 0; flex: 1; }
.admin-users { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; max-height: 55vh; overflow-y: auto; }
.admin-users li { padding: 7px 9px; background: #2a2724; border-radius: 4px; font-size: 13px; }
.admin-users li.blocked { opacity: .6; }
.au-main { display: flex; align-items: center; gap: 6px; font-size: 14px; }
.au-main b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.au-tag { font-size: 11px; padding: 1px 5px; border-radius: 3px; background: #45423e; color: var(--muted); }
.au-tag.admin { background: #3d5a1c; color: #fff; }
.au-tag.blocked { background: #7a2a24; color: #fff; }
.au-meta { color: var(--muted); font-size: 12px; margin: 3px 0 6px; line-height: 1.4; }
.au-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.au-actions button { padding: 2px 9px; font-size: 12px; }

/* Пять вкладок помещаются в ширину панели. */
.tabs { gap: 2px; }
.tabs button { flex: 1 1 0; min-width: 0; padding: 6px 2px; font-size: 14px; }
