/**
 * キーボード診断カルテ — ダッシュボード UI /kcc/
 */

:root {
  --kcc-bg: #0b1120;
  --kcc-surface: #111827;
  --kcc-surface-2: #1e293b;
  --kcc-surface-3: #273449;
  --kcc-border: #334155;
  --kcc-border-soft: #1f2937;
  --kcc-text: #f8fafc;
  --kcc-text-muted: #94a3b8;
  --kcc-accent: #6366f1;
  --kcc-accent-dark: #4f46e5;
  --kcc-accent-glow: rgba(99, 102, 241, 0.35);
  --kcc-ok: #22c55e;
  --kcc-warn: #f59e0b;
  --kcc-bad: #ef4444;
  --kcc-radius: 14px;
  --kcc-radius-sm: 10px;
  --kcc-sidebar-w: 280px;
}

*, *::before, *::after { box-sizing: border-box; }

body.kcc-page-body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Noto Sans JP', system-ui, sans-serif;
  line-height: 1.5;
  font-size: 14px;
  color: #0f172a;
  background: #f1f5f9;
}

body.kcc-hold-scroll-lock {
  overflow: hidden;
  overscroll-behavior: none;
}

#pctrouble-site { min-height: 100vh; display: flex; flex-direction: column; }

#pctrouble-header-menu {
  flex-shrink: 0;
  color: #111827;
  background-color: #fff;
}

#pctrouble-header-menu header {
  background-color: rgb(255 255 255 / 0.95) !important;
}

#tool-footer-container { flex-shrink: 0; }
#tool-footer-container footer { background: #0f172a; color: #fff; }

.kcc-page-main {
  flex: 1 0 auto;
  background: var(--kcc-bg);
  color: var(--kcc-text);
}

.kcc-page-body { margin: 0; overflow-x: clip; }

.kcc-page {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0.75rem;
}

/* ----- Dashboard shell ----- */
.kcc-dashboard {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  min-height: calc(100vh - 8rem);
  border-radius: calc(var(--kcc-radius) + 4px);
  overflow: hidden;
  border: 1px solid var(--kcc-border);
  background: var(--kcc-surface);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
}

@media (min-width: 960px) {
  .kcc-dashboard {
    grid-template-columns: var(--kcc-sidebar-w) minmax(0, 1fr);
    min-height: calc(100vh - 6rem);
  }
}

/* ----- Sidebar ----- */
.kcc-sidebar {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem;
  background: linear-gradient(180deg, #0f172a 0%, #111827 100%);
  border-bottom: 1px solid var(--kcc-border);
}

@media (min-width: 960px) {
  .kcc-sidebar {
    border-bottom: 0;
    border-right: 1px solid var(--kcc-border);
    min-height: 100%;
  }
}

.kcc-sidebar__eyebrow {
  margin: 0;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--kcc-text-muted);
}

.kcc-sidebar__title {
  margin: 0.15rem 0 0;
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.35;
}

.kcc-sidebar__version {
  display: inline-block;
  margin-top: 0.25rem;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: var(--kcc-surface-3);
  color: var(--kcc-text-muted);
  font-size: 0.68rem;
  font-weight: 700;
}

.kcc-sidebar__checklist {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
  overflow-y: auto;
  max-height: 42vh;
}

@media (min-width: 960px) {
  .kcc-sidebar__checklist { max-height: none; }
}

.kcc-sidebar__item {
  display: grid;
  grid-template-columns: 1.6rem minmax(0, 1fr) auto;
  gap: 0.5rem;
  align-items: center;
  padding: 0.45rem 0.55rem;
  border-radius: var(--kcc-radius-sm);
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid transparent;
  font-size: 0.78rem;
  color: var(--kcc-text-muted);
}

.kcc-sidebar__item.is-done {
  color: #bbf7d0;
  border-color: rgba(34, 197, 94, 0.25);
  background: rgba(22, 101, 52, 0.15);
}

.kcc-sidebar__item.is-active {
  color: var(--kcc-text);
  border-color: rgba(99, 102, 241, 0.45);
  background: rgba(99, 102, 241, 0.12);
}

.kcc-sidebar__num {
  display: grid;
  place-items: center;
  width: 1.45rem;
  height: 1.45rem;
  border-radius: 999px;
  background: var(--kcc-surface-3);
  font-size: 0.68rem;
  font-weight: 800;
}

.kcc-sidebar__item.is-done .kcc-sidebar__num {
  background: var(--kcc-ok);
  color: #052e16;
}

.kcc-sidebar__item-label { line-height: 1.35; }
.kcc-sidebar__item-count { font-size: 0.68rem; color: var(--kcc-text-muted); }
.kcc-sidebar__item.is-done .kcc-sidebar__item-count { color: #86efac; }

.kcc-sidebar__summary {
  text-align: center;
  padding: 0.65rem;
  border-radius: var(--kcc-radius-sm);
  background: var(--kcc-surface-2);
  border: 1px solid var(--kcc-border);
}

.kcc-sidebar__summary-ring {
  --ring-pct: 0%;
  width: 4.5rem;
  height: 4.5rem;
  margin: 0 auto 0.35rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: conic-gradient(var(--kcc-accent) var(--ring-pct), var(--kcc-surface-3) 0);
  position: relative;
}

.kcc-sidebar__summary-ring::after {
  content: '';
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  background: var(--kcc-surface-2);
}

.kcc-sidebar__summary-ring span {
  position: relative;
  z-index: 1;
  font-weight: 800;
  font-size: 0.85rem;
}

.kcc-sidebar__summary-label {
  margin: 0;
  font-size: 0.72rem;
  color: var(--kcc-text-muted);
}

.kcc-sidebar__landing {
  margin: 0;
  font-size: 0.78rem;
}

.kcc-sidebar__landing a {
  color: #a5b4fc;
  text-decoration: none;
  font-weight: 600;
}

.kcc-sidebar__landing a:hover { text-decoration: underline; }

/* ----- Main body ----- */
.kcc-dashboard__body {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: linear-gradient(180deg, #0f172a 0%, #111827 40%, #0b1120 100%);
}

.kcc-dash-header {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: space-between;
  align-items: flex-start;
  padding: 1rem 1rem 0.65rem;
  border-bottom: 1px solid var(--kcc-border-soft);
}

.kcc-dash-header__step {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #a5b4fc;
  font-weight: 700;
}

.kcc-dash-header__title {
  margin: 0.2rem 0 0;
  font-size: clamp(1.1rem, 2vw, 1.45rem);
  font-weight: 800;
}

.kcc-dash-header__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}

.kcc-dash-header__pill {
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  background: var(--kcc-surface-2);
  border: 1px solid var(--kcc-border);
  font-size: 0.72rem;
}

.kcc-dash-header__pill span {
  display: block;
  color: var(--kcc-text-muted);
  font-size: 0.62rem;
}

.kcc-dash-header__pill strong { font-size: 0.82rem; }

.kcc-verdict--ok { color: var(--kcc-ok) !important; }
.kcc-verdict--warn { color: var(--kcc-warn) !important; }
.kcc-verdict--bad { color: var(--kcc-bad) !important; }
.kcc-verdict--pending { color: var(--kcc-text-muted) !important; }

/* ----- Step views ----- */
.kcc-step-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  min-height: 0;
  overflow-y: auto;
}

.kcc-card {
  padding: 0.85rem 1rem;
  border-radius: var(--kcc-radius);
  background: var(--kcc-surface-2);
  border: 1px solid var(--kcc-border);
}

.kcc-card h3 {
  margin: 0 0 0.5rem;
  font-size: 0.92rem;
  font-weight: 800;
  color: #e2e8f0;
}

.kcc-step-view__lead {
  margin: 0 0 0.85rem;
  color: var(--kcc-text-muted);
  line-height: 1.65;
}

.kcc-step-view__settings {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  align-items: flex-end;
  margin-bottom: 1rem;
}

.kcc-step-view__actions { margin-bottom: 0.5rem; }

.kcc-step-view__note {
  margin: 0;
  font-size: 0.75rem;
  color: var(--kcc-text-muted);
}

.kcc-control {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.72rem;
  color: var(--kcc-text-muted);
}

.kcc-control select {
  padding: 0.35rem 0.55rem;
  border-radius: 8px;
  border: 1px solid var(--kcc-border);
  background: var(--kcc-surface-3);
  color: var(--kcc-text);
  font-family: inherit;
  font-size: 0.8rem;
}

.kcc-control--check {
  flex-direction: row;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  color: var(--kcc-text);
}

.kcc-btn {
  padding: 0.5rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--kcc-accent);
  background: var(--kcc-accent);
  color: #fff;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}

.kcc-btn:hover {
  background: var(--kcc-accent-dark);
  border-color: var(--kcc-accent-dark);
}

.kcc-btn--secondary {
  background: transparent;
  color: #c7d2fe;
  border-color: #4f46e5;
}

.kcc-btn--secondary:hover {
  background: rgba(99, 102, 241, 0.15);
}

.kcc-btn--ghost {
  background: transparent;
  color: var(--kcc-text-muted);
  border-color: var(--kcc-border);
}

.kcc-btn--ghost:hover { background: var(--kcc-surface-3); color: var(--kcc-text); }
.kcc-btn--large { padding: 0.65rem 1.35rem; font-size: 0.92rem; }
.kcc-btn--small { padding: 0.35rem 0.7rem; font-size: 0.75rem; }

.kcc-btn--cta-ready {
  background: var(--kcc-ok);
  border-color: #16a34a;
  color: #052e16;
  font-weight: 800;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.22);
  animation: kcc-cta-glow 1.6s ease-in-out infinite;
}

.kcc-btn--cta-ready:hover {
  background: #4ade80;
  border-color: #22c55e;
  color: #052e16;
}

@keyframes kcc-cta-glow {
  0%, 100% { box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.18); }
  50% { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0.32); }
}

.kcc-layout-toggle,
.kcc-size-toggle {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  padding: 0.2rem;
  border-radius: 999px;
  background: var(--kcc-surface-3);
}

.kcc-layout-toggle__button,
.kcc-size-toggle__button {
  border: 0;
  border-radius: 999px;
  padding: 0.38rem 0.75rem;
  background: transparent;
  color: var(--kcc-text-muted);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 800;
  cursor: pointer;
}

.kcc-layout-toggle__button.is-active,
.kcc-size-toggle__button.is-active {
  background: var(--kcc-accent);
  color: #fff;
  box-shadow: 0 4px 14px var(--kcc-accent-glow);
}

/* ----- Step 2: test area ----- */
.kcc-test-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
}

.kcc-test-toolbar__status {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 700;
  color: var(--kcc-ok);
}

.kcc-status-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--kcc-text-muted);
}

.kcc-status-dot.is-live {
  background: var(--kcc-ok);
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.25);
  animation: kcc-pulse 1.4s ease-in-out infinite;
}

@keyframes kcc-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

.kcc-test-toolbar__hint {
  flex: 1 1 100%;
  margin: 0;
  font-size: 0.8rem;
  color: var(--kcc-text-muted);
}

@media (min-width: 720px) {
  .kcc-test-toolbar__hint { flex: 1 1 auto; margin: 0; }
}

.kcc-capture {
  position: relative;
  padding: 0.75rem;
  border-radius: var(--kcc-radius);
  border: 2px dashed var(--kcc-border);
  background: #0f172a;
  outline: none;
  min-width: 0;
}

.kcc-capture--dark {
  border-color: #1e3a5f;
  background: linear-gradient(180deg, #0c1222 0%, #111827 100%);
}

.kcc-capture:focus-visible {
  border-color: var(--kcc-accent);
  box-shadow: 0 0 0 4px var(--kcc-accent-glow);
}

.kcc-capture.is-monitoring {
  border-style: solid;
  border-color: #4f46e5;
  box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.2);
}

.kcc-capture.is-hold-busy { border-color: var(--kcc-warn); }

.kcc-key-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  margin-bottom: 0.55rem;
  font-size: 0.72rem;
  color: var(--kcc-text-muted);
}

.kcc-key-legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.kcc-legend-swatch {
  display: inline-block;
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.kcc-legend-swatch--idle { background: #374151; }
.kcc-legend-swatch--ok { background: #166534; }
.kcc-legend-swatch--warn { background: #b45309; }
.kcc-legend-swatch--bad { background: #991b1b; }

.kcc-keyboard-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  padding-bottom: 0.35rem;
  scrollbar-color: #475569 transparent;
}

.kcc-keyboard-scroll__hint {
  margin: 0 0 0.35rem;
  font-size: 0.68rem;
  color: var(--kcc-text-muted);
  text-align: center;
}

@media (min-width: 1200px) {
  .kcc-keyboard-scroll__hint { display: none; }
}

.kcc-keyboard { display: grid; gap: 0.24rem; padding-bottom: 0.1rem; }
.kcc-keyboard[hidden] { display: none; }

.kcc-keyboard--full .kcc-keyboard__body {
  display: flex;
  gap: 0.45rem;
  align-items: flex-start;
  min-width: 1080px;
}

.kcc-keyboard__main,
.kcc-keyboard__aside,
.kcc-keyboard__numpad {
  display: grid;
  gap: 0.24rem;
}

.kcc-keyboard__main { flex: 1 1 auto; min-width: 0; }
.kcc-keyboard__aside { flex: 0 0 auto; }
.kcc-keyboard__nav,
.kcc-keyboard__arrows { display: grid; gap: 0.24rem; }
.kcc-keyboard__numpad { flex: 0 0 auto; }

.kcc-keyboard--tkl .kcc-keyboard__numpad { display: none; }
.kcc-keyboard--tkl .kcc-keyboard__body { min-width: 880px; }

.kcc-keyboard__numpad-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(26px, 1fr));
  grid-template-rows: repeat(5, 32px);
  gap: 0.22rem;
  min-width: 118px;
}

.kcc-keyboard__numpad-grid .kcc-key {
  min-width: 0;
  min-height: 0;
  height: 100%;
}

.kcc-keyboard__row { display: flex; gap: 0.22rem; min-width: 0; }
.kcc-keyboard__main > .kcc-keyboard__row { min-width: 720px; }

.kcc-key, .kcc-key-spacer {
  flex: 1 1 0;
  min-width: 28px;
  min-height: 32px;
}

.kcc-key {
  border: 1px solid #4b5563;
  border-radius: 7px;
  background: #374151;
  color: #e5e7eb;
  font: inherit;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1.15;
  white-space: pre-line;
  text-align: center;
  box-shadow: 0 2px 0 #1f2937;
  transition: background 0.08s, color 0.08s, transform 0.08s, border-color 0.08s;
}

.kcc-key-spacer { visibility: hidden; pointer-events: none; }
.kcc-key--sm { flex-grow: 0.85; min-width: 24px; }
.kcc-key--md { flex-grow: 1.15; }
.kcc-key--lg { flex-grow: 1.45; }
.kcc-key--xl { flex-grow: 1.85; }
.kcc-key--enter {
  position: relative;
  z-index: 1;
  flex-grow: 1.85;
  min-height: calc(64px + 0.24rem);
  margin-top: calc(-32px - 0.24rem);
}
.kcc-key-spacer--enter { flex-grow: 1.85; }
.kcc-key--space { flex-grow: 4.2; }
.kcc-key-spacer--arrow-gap { flex-grow: 1; min-width: 28px; }
.kcc-key--numpad-zero { flex-grow: 2.1; }

.kcc-key.is-seen {
  background: #14532d;
  border-color: #22c55e;
  color: #dcfce7;
}

.kcc-key.is-active {
  transform: translateY(2px);
  background: var(--kcc-ok);
  border-color: #4ade80;
  color: #052e16;
  box-shadow: 0 1px 0 #166534;
}

.kcc-key.is-warn {
  background: #78350f;
  border-color: #f59e0b;
  color: #fef3c7;
}

.kcc-key.is-bad,
.kcc-key.is-stuck {
  background: #7f1d1d;
  border-color: #ef4444;
  color: #fee2e2;
}

.kcc-key.is-os-reserved {
  background: #1f2937;
  border-color: #475569;
  border-style: dashed;
  color: #64748b;
  box-shadow: none;
  cursor: not-allowed;
}

.kcc-key.is-heat-1:not(.is-active):not(.is-warn):not(.is-bad) {
  background: #713f12;
  border-color: #eab308;
  color: #fef9c3;
}

.kcc-key.is-heat-2:not(.is-active):not(.is-warn):not(.is-bad) {
  background: #92400e;
  border-color: #f59e0b;
  color: #ffedd5;
}

.kcc-key.is-heat-3:not(.is-active):not(.is-warn):not(.is-bad) {
  background: #9a3412;
  border-color: #f97316;
  color: #ffedd5;
}

.kcc-stats-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.5rem;
  margin-top: 0.65rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--kcc-border);
}

.kcc-stats-bar__item {
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid var(--kcc-border-soft);
}

.kcc-stats-bar__item span {
  display: block;
  font-size: 0.65rem;
  color: var(--kcc-text-muted);
}

.kcc-stats-bar__item strong {
  font-size: 0.88rem;
  font-variant-numeric: tabular-nums;
}

.kcc-step2-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: 1fr;
}

@media (min-width: 900px) {
  .kcc-step2-grid { grid-template-columns: 1fr 1fr; }
}

.kcc-hold__intro {
  margin: 0 0 0.5rem;
  font-size: 0.75rem;
  color: var(--kcc-text-muted);
  line-height: 1.55;
}

.kcc-hold__results {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
}

.kcc-hold-result {
  padding: 0.3rem 0.55rem;
  border-radius: 8px;
  background: var(--kcc-surface-3);
  font-size: 0.75rem;
  border: 1px solid var(--kcc-border);
}

.kcc-hold-result--ok { border-color: rgba(34, 197, 94, 0.45); color: #86efac; }
.kcc-hold-result--warn { border-color: rgba(245, 158, 11, 0.45); color: #fcd34d; }

.kcc-hold__actions { display: flex; flex-wrap: wrap; gap: 0.4rem; }

.kcc-log {
  margin: 0;
  padding: 0;
  list-style: none;
  max-height: 160px;
  overflow-y: auto;
}

.kcc-log__item {
  padding: 0.28rem 0;
  border-bottom: 1px solid var(--kcc-border-soft);
  font-size: 0.72rem;
  color: var(--kcc-text-muted);
}

.kcc-log__item--warn { color: #fcd34d; }

/* ----- Hold overlay ----- */
.kcc-hold-overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.88);
  border-radius: calc(var(--kcc-radius) - 2px);
}

.kcc-hold-overlay[hidden] { display: none; }

.kcc-hold-overlay__inner { text-align: center; color: #fff; padding: 1rem; }
.kcc-hold-overlay__countdown { display: block; font-size: 3rem; font-weight: 800; line-height: 1; }
.kcc-hold-overlay__title { margin: 0.5rem 0 0; font-size: 1.1rem; font-weight: 800; }
.kcc-hold-overlay__hint { margin: 0.35rem 0 0; font-size: 0.85rem; opacity: 0.9; }

.kcc-hold-overlay__progress-wrap {
  margin-top: 0.75rem;
  height: 8px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  overflow: hidden;
}

.kcc-hold-overlay__progress {
  height: 100%;
  background: var(--kcc-warn);
  width: 0;
  transition: width 0.2s linear;
}

/* ----- Step 3: report ----- */
.kcc-report-hero {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: auto 1fr;
  align-items: start;
}

@media (min-width: 768px) {
  .kcc-report-hero {
    grid-template-columns: auto 1fr auto;
  }
}

.kcc-report-hero__icon {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1.75rem;
  font-weight: 800;
  background: rgba(34, 197, 94, 0.15);
  color: var(--kcc-ok);
  border: 2px solid rgba(34, 197, 94, 0.35);
}

.kcc-report-hero__icon--warn {
  background: rgba(245, 158, 11, 0.15);
  color: var(--kcc-warn);
  border-color: rgba(245, 158, 11, 0.35);
}

.kcc-report-hero__icon--bad {
  background: rgba(239, 68, 68, 0.15);
  color: var(--kcc-bad);
  border-color: rgba(239, 68, 68, 0.35);
}

.kcc-report-hero__icon--pending {
  background: rgba(148, 163, 184, 0.15);
  color: var(--kcc-text-muted);
  border-color: rgba(148, 163, 184, 0.35);
}

.kcc-report-hero__eyebrow {
  margin: 0;
  font-size: 0.72rem;
  color: var(--kcc-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.kcc-report-hero__verdict {
  margin: 0.15rem 0 0.35rem;
  font-size: clamp(1.15rem, 2.2vw, 1.55rem);
  font-weight: 800;
}

.kcc-report-hero__advice {
  margin: 0;
  font-size: 0.82rem;
  color: var(--kcc-text-muted);
  line-height: 1.6;
}

.kcc-report-hero__meta {
  margin: 0;
  display: grid;
  gap: 0.35rem;
  font-size: 0.75rem;
  grid-column: 1 / -1;
}

@media (min-width: 768px) {
  .kcc-report-hero__meta {
    grid-column: auto;
    min-width: 220px;
  }
}

.kcc-report-hero__meta div {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.25rem 0;
  border-bottom: 1px solid var(--kcc-border-soft);
}

.kcc-report-hero__meta dt {
  margin: 0;
  color: var(--kcc-text-muted);
}

.kcc-report-hero__meta dd {
  margin: 0;
  font-weight: 700;
  text-align: right;
}

.kcc-report-export h3 { margin-bottom: 0.65rem; }

.kcc-report__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.kcc-report-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: 1fr;
}

@media (min-width: 900px) {
  .kcc-report-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.kcc-donut-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  align-items: center;
}

.kcc-donut {
  --donut-pct: 0%;
  width: 6.5rem;
  height: 6.5rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: conic-gradient(var(--kcc-ok) var(--donut-pct), var(--kcc-surface-3) 0);
  position: relative;
  flex-shrink: 0;
}

.kcc-donut::after {
  content: '';
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  background: var(--kcc-surface-2);
}

.kcc-donut__label {
  position: relative;
  z-index: 1;
  font-weight: 800;
  font-size: 0.95rem;
}

.kcc-donut-legend {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.75rem;
  color: var(--kcc-text-muted);
}

.kcc-donut-legend li {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.25rem;
}

.kcc-donut-legend i {
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 3px;
  display: inline-block;
}

.kcc-summary-rate {
  margin: 0.65rem 0 0;
  font-size: 0.82rem;
  font-weight: 700;
  color: #bbf7d0;
}

.kcc-hold-report {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.kcc-hold-report__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
  background: var(--kcc-surface-3);
  border: 1px solid var(--kcc-border);
  font-size: 0.78rem;
}

.kcc-hold-report__row strong { font-size: 0.82rem; }
.kcc-hold-report__row.is-ok { border-color: rgba(34, 197, 94, 0.35); }
.kcc-hold-report__row.is-warn { border-color: rgba(245, 158, 11, 0.35); }

.kcc-env-list {
  margin: 0 0 0.65rem;
  display: grid;
  gap: 0.3rem;
  font-size: 0.75rem;
}

.kcc-env-list div {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.2rem 0;
  border-bottom: 1px solid var(--kcc-border-soft);
}

.kcc-env-list dt { margin: 0; color: var(--kcc-text-muted); }
.kcc-env-list dd { margin: 0; font-weight: 600; text-align: right; max-width: 58%; }

.kcc-status-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.kcc-status-grid__empty {
  margin: 0;
  font-size: 0.78rem;
  color: var(--kcc-text-muted);
}

.kcc-key-chip {
  padding: 0.4rem 0.6rem;
  border-radius: 8px;
  font-size: 0.72rem;
  border: 1px solid var(--kcc-border);
  background: var(--kcc-surface-3);
}

.kcc-key-chip strong { display: block; margin-bottom: 0.1rem; }
.kcc-key-chip--warn { border-color: rgba(245, 158, 11, 0.45); background: rgba(120, 53, 15, 0.25); }
.kcc-key-chip--bad { border-color: rgba(239, 68, 68, 0.45); background: rgba(127, 29, 29, 0.25); }

/* ----- Footer nav ----- */
.kcc-dash-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  padding: 0.75rem 1rem 1rem;
  border-top: 1px solid var(--kcc-border-soft);
  background: rgba(15, 23, 42, 0.65);
}

.kcc-dash-footer__spacer { flex: 1; }

@media (max-width: 767px) {
  .kcc-dash-header__meta { width: 100%; }
  .kcc-sidebar__checklist { max-height: 28vh; }
}
