/* css/components.css — panels shared across tabs */
.history-list { list-style: none; padding: 0; margin: 8px 0; max-height: 320px; overflow: auto;
  border: 1px solid var(--border); border-radius: 8px; background: var(--card); }
.history-list li { display: flex; align-items: center; gap: 10px; padding: 6px 12px; border-bottom: 1px solid var(--border); font-size: 14px; }
.history-list li:last-child { border-bottom: none; }
.history-list .hk { font-weight: 600; min-width: 70px; }
.history-list .hd { color: var(--muted); min-width: 70px; }
.flag { font-size: 11px; padding: 1px 6px; border-radius: 10px; }
.flag.repeat { background: rgba(245, 158, 11, .18); color: #d97706; }
.flag.stuck { background: rgba(239, 68, 68, .18); color: var(--error); }
button { font-family: inherit; }

/* rollover */
.ro-counters { display: flex; gap: 24px; flex-wrap: wrap; margin-bottom: 16px; }
.ro-counter { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 16px 24px; text-align: center; }
.ro-counter .num { font-size: 40px; font-weight: 700; color: var(--accent); }
.ro-counter .lbl { color: var(--muted); font-size: 13px; }

/* typing */
.tp-sample { font-size: 20px; line-height: 1.8; background: var(--card); border: 1px solid var(--border);
  border-radius: 10px; padding: 20px; margin: 12px 0; }
.tp-sample .ch.correct { color: var(--key-tested); }
.tp-sample .ch.wrong { color: var(--error); background: rgba(239,68,68,.12); }
.tp-sample .ch.pending { color: var(--muted); }
.tp-sample .ch.cur { border-bottom: 2px solid var(--accent); }
.tp-stats { display: flex; gap: 24px; flex-wrap: wrap; margin: 12px 0; }
.tp-stat { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 12px 18px; }
.tp-stat .v { font-size: 26px; font-weight: 700; }
.tp-stat .k { color: var(--muted); font-size: 12px; }
.tp-result { font-size: 18px; font-weight: 600; margin: 12px 0; }

/* topbar brand + nav link */
.topbar .brand { display: flex; align-items: center; gap: 14px; margin-right: auto; }
.topbar .brand .title { margin-right: 0; }
.nav-link {
  color: var(--accent);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: 6px 8px;
  border-radius: 8px;
}
.nav-link:hover { background: var(--card); }

/* Key Test: keyboard left, history right — the whole block centered */
.kt-split { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; justify-content: center; width: fit-content; max-width: 100%; margin: 0 auto; }
.kt-split > #kt-keyboard { flex: 0 0 auto; }
.kt-split > #kt-history-wrap { flex: 1 1 300px; min-width: 240px; max-width: 380px; }
#kt-history-wrap h3 { margin: 0 0 8px; font-size: 15px; }
.history-empty { color: var(--muted); font-size: 13px; margin: 4px 0 0; }
@media (max-width: 900px) {
  .kt-split > #kt-history-wrap { flex-basis: 100%; max-width: none; }
}

/* FAQ */
.faq { max-width: 820px; margin: 36px auto 8px; padding: 0 16px; }
.faq h2 { font-size: 20px; margin: 0 0 14px; }
.faq details { border: 1px solid var(--border); border-radius: 10px; padding: 0 16px; margin-bottom: 10px; background: var(--card); }
.faq summary { cursor: pointer; padding: 14px 0; font-weight: 600; list-style: none; display: flex; gap: 8px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before { content: "▸"; color: var(--accent); }
.faq details[open] summary::before { content: "▾"; }
.faq details p { margin: 0 0 14px; line-height: 1.65; }

/* footer */
.site-footer { text-align: center; color: var(--muted); font-size: 13px; padding: 24px 16px; border-top: 1px solid var(--border); margin-top: 16px; }
.site-footer a { color: var(--accent); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }

/* Landing: hero + entry cards */
.hero { text-align: center; padding: 30px 16px 6px; }
.hero h1 { font-size: 26px; margin: 0 0 6px; }
.hero p { color: var(--muted); margin: 0; }
.entries { display: flex; gap: 18px; flex-wrap: wrap; justify-content: center; padding: 22px 16px 8px; }
.entry-card {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  width: 230px; padding: 28px 20px; cursor: pointer; text-align: center;
  background: var(--card); color: var(--fg);
  border: 1px solid var(--border); border-radius: 16px;
  font-family: inherit;
  transition: transform 120ms ease, border-color 120ms, box-shadow 120ms;
}
.entry-card:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: 0 8px 20px rgba(0,0,0,.10); }
.entry-icon { font-size: 40px; line-height: 1; }
.entry-title { font-size: 18px; font-weight: 700; }
.entry-desc { font-size: 13px; color: var(--muted); line-height: 1.5; }

/* back button (inside a tool) */
.back-btn {
  background: var(--card); color: var(--accent);
  border: 1px solid var(--border); border-radius: 8px;
  padding: 6px 12px; font-size: 14px; cursor: pointer; margin-bottom: 14px; font-family: inherit;
}
.back-btn:hover { border-color: var(--accent); }

/* center rollover & typing tool content (consistent with key test) */
.panel-note { text-align: center; }
#ro-area, #tp-area { text-align: center; }
#panel-rollover .ro-counters, #panel-typing .tp-stats { justify-content: center; }
#panel-rollover .keyboard { margin-left: auto; margin-right: auto; }
#tp-area .tp-sample { max-width: 760px; margin-left: auto; margin-right: auto; text-align: left; }
