/* panels.css — notation tree, engine panel, board session, mode layouts */

/* ---- board session ---- */
.bs { display: flex; flex-direction: column; height: 100%; min-height: 0; padding: 8px 12px; gap: 2px; }
.bs-row { flex: 1; min-height: 0; display: flex; gap: 10px; align-items: stretch; justify-content: center; }
.bs-board { flex: 1; min-width: 0; min-height: 0; display: flex; align-items: center; justify-content: center; container-type: size; }
.bs-board .cb { width: min(calc(100cqw * var(--zoom, 1)), calc(100cqh * var(--zoom, 1))); }

/* ---- notation ---- */
.nt-body { padding: 8px 10px; font-size: var(--fs-13); line-height: 1.85; user-select: text; height: 100%; overflow-y: auto; }
.nt-flow { word-wrap: break-word; }
.nt-empty { color: var(--text-faint); padding: 8px 2px; font-size: var(--fs-12); }
.nt-move {
  display: inline-block; padding: 0 3px; margin: 0 -1px; border-radius: 3px;
  cursor: pointer; white-space: nowrap; font-weight: var(--fw-medium);
}
.nt-move:hover { background: var(--bg-hover); }
.nt-move.cur { background: var(--bg-selected); outline: 1px solid var(--accent); }
.nt-move.hit { outline: 1px dashed var(--warn); }
.nt-move.q-brilliant { color: #1bb7a6; font-weight: var(--fw-bold); }
.nt-move.q-best { color: #7dbb5b; }
.nt-move.q-excellent { color: #6aa8e8; }
.nt-move.q-good { color: var(--text-secondary); }
.nt-move.q-book { color: var(--text-faint); }
.nt-move.q-interesting { color: #b08fe0; }
.nt-move.q-dubious { color: var(--warn-text); }
.nt-move.q-inaccuracy { color: var(--warn-text); }
.nt-move.q-mistake { color: #e0925a; }
.nt-move.q-blunder { color: var(--err-text); font-weight: var(--fw-bold); }
.nt-eval { font-size: var(--fs-11); color: var(--text-faint); margin-left: 3px; font-family: var(--font-mono); }
.nt-comment { color: var(--ok-text); font-style: italic; cursor: pointer; }
.nt-comment.hit { outline: 1px dashed var(--warn); }
.nt-precomment { display: block; margin-bottom: 4px; }
.nt-var { font-size: var(--fs-12); color: var(--text-secondary); line-height: 1.7; margin: 1px 0; }
.nt-var .nt-move { font-weight: var(--fw-regular); }
.nt-var-toggle { cursor: pointer; display: inline-block; vertical-align: -2px; margin-right: 1px; color: var(--text-faint); }
.nt-var-toggle:hover { color: var(--text); }
.nt-result { margin-top: 8px; font-weight: var(--fw-bold); color: var(--text-secondary); }

/* ---- engine panel ---- */
.ep-body { display: flex; flex-direction: column; height: 100%; }
.ep-lines { flex: 1; overflow-y: auto; min-height: 0; }
.ep-line {
  display: flex; align-items: baseline; gap: 8px; padding: 4px 10px;
  border-bottom: 1px solid var(--border); cursor: pointer; font-size: var(--fs-12);
}
.ep-line:hover { background: var(--bg-hover); }
.ep-eval { font-family: var(--font-mono); font-weight: var(--fw-bold); min-width: 44px; text-align: right; flex: none; }
.ep-depth { color: var(--text-faint); font-size: var(--fs-11); flex: none; min-width: 26px; }
.ep-pv { color: var(--text-secondary); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; user-select: text; }
.ep-stats {
  flex: none; padding: 4px 10px; border-top: 1px solid var(--border);
  font-size: var(--fs-11); color: var(--text-faint); font-variant-numeric: tabular-nums;
}
.ep-offline { padding: 12px; color: var(--text-faint); font-size: var(--fs-12); }

/* ---- generic mode layout bits ---- */
.mode-toolbar-title { font-weight: var(--fw-semibold); font-size: var(--fs-12); color: var(--text-secondary); padding: 0 6px; white-space: nowrap; }
.form-grid { display: grid; grid-template-columns: auto 1fr; gap: 8px 12px; align-items: center; }
.form-grid > label { font-size: var(--fs-12); color: var(--text-secondary); white-space: nowrap; }
.side-by-side { display: flex; gap: 10px; }
.side-by-side > * { flex: 1; }

/* ---- explorer / stats bars ---- */
.xp-row { display: flex; align-items: center; gap: 8px; padding: 3px 10px; cursor: pointer; font-size: var(--fs-12); }
.xp-row:hover { background: var(--bg-hover); }
.xp-move { font-weight: var(--fw-semibold); min-width: 48px; }
.xp-count { color: var(--text-faint); min-width: 52px; text-align: right; font-variant-numeric: tabular-nums; }
.xp-bar { flex: 1; height: 14px; display: flex; border-radius: 2px; overflow: hidden; border: 1px solid var(--border); min-width: 60px; }
.xp-bar .w { background: var(--eval-white); }
.xp-bar .d { background: #8a8f9c; }
.xp-bar .b { background: var(--eval-black); }
.xp-bar span { display: flex; align-items: center; justify-content: center; font-size: 9.5px; color: #333; overflow: hidden; }
.xp-bar .b { color: #ccc; }
.xp-bar .d { color: #1d2026; }

/* ---- settings dialog ---- */
.settings-layout { display: flex; gap: 0; height: 60vh; min-width: 640px; }
.settings-nav { width: 170px; flex: none; border-right: 1px solid var(--border); overflow-y: auto; padding: 6px; }
.settings-nav .list-row { border-radius: var(--rad-1); height: 26px; }
.settings-content { flex: 1; overflow-y: auto; padding: 4px 16px 16px; }
.settings-group-title { font-size: var(--fs-12); font-weight: var(--fw-bold); text-transform: uppercase; letter-spacing: .05em; color: var(--text-secondary); margin: 16px 0 8px; }
.setting-row { display: flex; align-items: center; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--border); }
.setting-row .sr-label { flex: 1; font-size: var(--fs-13); }
.setting-row .sr-hint { font-size: var(--fs-11); color: var(--text-faint); margin-top: 1px; }
.setting-row .sr-ctl { flex: none; display: flex; align-items: center; gap: 8px; min-width: 140px; justify-content: flex-end; }

/* ---- shortcut editor ---- */
.kbd-capture { border: 1px dashed var(--accent) !important; }

/* ---- game list rows (database) ---- */
.gl-row { display: flex; align-items: center; gap: 10px; padding: 0 10px; font-size: var(--fs-12); cursor: pointer; border-bottom: 1px solid var(--border); overflow: hidden; }
.gl-row:hover { background: var(--bg-hover); }
.gl-row.sel { background: var(--bg-selected); }
.gl-players { flex: 2; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: var(--fw-medium); }
.gl-result { flex: none; width: 44px; font-family: var(--font-mono); color: var(--text-secondary); }
.gl-event { flex: 1.5; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-secondary); }
.gl-date { flex: none; width: 78px; color: var(--text-faint); font-variant-numeric: tabular-nums; }
.gl-eco { flex: none; width: 60px; color: var(--text-faint); }

/* ---- training / misc cards (structured, not rounded-card salad) ---- */
.stat-strip { display: flex; border: 1px solid var(--border); border-radius: var(--rad-1); overflow: hidden; }
.stat-cell { flex: 1; padding: 8px 12px; border-right: 1px solid var(--border); }
.stat-cell:last-child { border-right: none; }
.stat-cell .sc-label { font-size: var(--fs-11); color: var(--text-faint); text-transform: uppercase; letter-spacing: .04em; }
.stat-cell .sc-value { font-size: var(--fs-16); font-weight: var(--fw-bold); font-variant-numeric: tabular-nums; }

/* ---- broadcast grid ---- */
.bc-grid { display: grid; gap: 10px; padding: 10px; overflow-y: auto; height: 100%; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.bc-tile { border: 1px solid var(--border); background: var(--bg-panel); cursor: pointer; display: flex; flex-direction: column; }
.bc-tile:hover { border-color: var(--border-strong); }
.bc-tile.featured { border-color: var(--accent); }
.bc-tile-head { display: flex; align-items: center; gap: 6px; padding: 4px 8px; font-size: var(--fs-11); border-bottom: 1px solid var(--border); color: var(--text-secondary); }
.bc-tile-board { padding: 6px; }
