/* Account and Log pages: scrolling documents on the terminal's theme (style.css). */
body.page { overflow: auto; height: auto; min-height: 100%; }
.page-top {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 18px;
  padding: 0 16px; height: 48px; background: var(--panel); border-bottom: 1px solid var(--line);
}
.page-top .brand { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--text); text-decoration: none; }
.nav { display: flex; gap: 2px; }
.nav a {
  color: var(--muted); text-decoration: none; padding: 6px 12px; border-radius: 4px; font-weight: 500;
}
.nav a:hover { color: var(--text); background: var(--panel-2); }
.nav a.active { color: var(--text); background: var(--panel-2); box-shadow: inset 0 -2px 0 var(--accent); }
.page-top .spacer { flex: 1; }

.page-main { max-width: 1400px; margin: 0 auto; padding: 16px; display: flex; flex-direction: column; gap: 16px; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.toolbar h1 { font-size: 18px; font-weight: 600; margin-right: 8px; }
.toolbar .grow { flex: 1; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; }
.card > h2 {
  font-size: 13px; font-weight: 600; padding: 10px 14px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 8px;
}
.card > h2 .sub { color: var(--muted); font-weight: 400; font-size: 12px; }
.card-body { padding: 12px 14px; }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 1px; background: var(--line); border-radius: 6px; overflow: hidden; border: 1px solid var(--line); }
.tile { background: var(--panel); padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.tile .k { color: var(--muted); font-size: 11px; }
.tile .v { font: 600 18px var(--mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .s { color: var(--muted); font: 11px var(--mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 1000px) { .grid2, .grid3 { grid-template-columns: minmax(0, 1fr); } }

.chart-box { position: relative; height: 240px; }
.chart-box.tall { height: 300px; }
.chart-box.short { height: 120px; }
.chart-box canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.tip {
  position: absolute; pointer-events: none; z-index: 3; background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 4px; padding: 6px 8px; font: 11px var(--mono); white-space: nowrap; box-shadow: 0 4px 16px rgba(0,0,0,.4);
}
.tip .t-k { color: var(--muted); }
.empty { color: var(--muted); text-align: center; padding: 28px 12px; }

table.dt { width: 100%; border-collapse: collapse; font-size: 12px; }
table.dt th { color: var(--muted); font-weight: 400; text-align: left; padding: 6px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; position: sticky; top: 0; background: var(--panel); }
table.dt td { padding: 5px 10px; border-bottom: 1px solid rgba(43,49,57,.5); white-space: nowrap; }
table.dt td.num, table.dt th.num { text-align: right; font-family: var(--mono); }
table.dt tbody tr:hover { background: var(--panel-2); }
table.dt tr.sel { background: rgba(252, 213, 53, .08); }
table.dt tr.click { cursor: pointer; }
.scroll { max-height: 420px; overflow: auto; }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: 12px; }
.kv .k { color: var(--muted); }
.kv .v { font-family: var(--mono); text-align: right; }
.verdict { margin-top: 12px; padding: 10px 12px; border-radius: 4px; background: var(--panel-2); line-height: 1.5; }
.verdict b { font-weight: 600; }
.note { color: var(--muted); font-size: 11px; line-height: 1.5; }

.badge { display: inline-block; padding: 1px 6px; border-radius: 3px; font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.badge.info { background: rgba(110,168,254,.14); color: var(--entry); }
.badge.warn { background: rgba(240,185,11,.14); color: var(--yellow); }
.badge.error { background: var(--red-bg); color: var(--red); }
.badge.live { background: var(--green-bg); color: var(--green); }
.badge.replay { background: var(--panel-2); color: var(--muted); }
.badge.liquidated { background: var(--red-bg); color: var(--red); }

.green { color: var(--green); } .red { color: var(--red); } .muted { color: var(--muted); }


/* log */
.log-table td.msg { white-space: normal; word-break: break-word; min-width: 280px; }
.log-table tr.warn td { background: rgba(240,185,11,.04); }
.log-table tr.error td { background: rgba(246,70,93,.06); }
.log-table td.data { white-space: pre-wrap; font: 11px var(--mono); color: var(--muted); background: var(--bg); }
.log-wrap { max-height: calc(100vh - 170px); overflow: auto; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--dim); display: inline-block; }
.live-dot.on { background: var(--green); box-shadow: 0 0 0 3px var(--green-bg); }

@media (max-width: 640px) {
  .page-top { gap: 10px; padding: 0 12px; }
  .page-top .brand span { display: none; }
  .page-main { padding: 12px; }
}

/* login */
.login-page { display: flex; min-height: 100vh; }
.login-wrap { margin: auto; width: min(400px, calc(100vw - 32px)); padding: 32px 0; display: flex; flex-direction: column; gap: 18px; }
.login-brand { display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 20px; font-weight: 600; }
.login-card { padding: 24px; display: flex; flex-direction: column; gap: 14px; }
.login-card h1 { font-size: 20px; font-weight: 600; }
.login-card .fld { display: flex; flex-direction: column; gap: 6px; color: var(--muted); font-size: 12px; }
.login-card .fld .inp { font-size: 14px; padding: 9px 10px; }
.login-card code { font: 11px var(--mono); color: var(--text); }
.pw-row { display: flex; gap: 6px; }
.pw-row .inp { flex: 1; }
.pw-toggle { min-width: 58px; }
.check { display: flex; align-items: center; gap: 8px; color: var(--muted); cursor: pointer; }
.pw-rules { list-style: none; display: flex; flex-direction: column; gap: 3px; font-size: 11px; color: var(--muted); }
.pw-rules li::before { content: "○ "; }
.pw-rules li.ok { color: var(--green); }
.pw-rules li.ok::before { content: "● "; }
.login-err { background: var(--red-bg); color: var(--red); border-radius: 4px; padding: 8px 10px; }
.login-btn { padding: 10px; font-size: 14px; }
.login-foot { text-align: center; }

