/**
 * マウス診断カルテ — ツール本体 /mcc/
 */

:root {
  --mcc-accent: #0d9488;
  --mcc-accent-dark: #0f766e;
  --mcc-accent-light: #ccfbf1;
  --mcc-warn: #d97706;
  --mcc-bad: #dc2626;
  --mcc-ok: #16a34a;
  --mcc-bg: #f0fdfa;
  --mcc-panel: #ffffff;
  --mcc-text: #134e4a;
  --mcc-muted: #5f6b6a;
  --mcc-border: #99f6e4;
  --mcc-radius: 14px;
  --mcc-max: 1100px;
}

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

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Noto Sans JP', system-ui, sans-serif;
  color: var(--mcc-text);
  background: linear-gradient(160deg, #ecfdf5 0%, #f8fafc 45%, #f0fdfa 100%);
  line-height: 1.5;
  font-size: 14px;
}

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

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

#pctrouble-header-menu {
  flex-shrink: 0;
}

#tool-footer-container {
  flex-shrink: 0;
}

#tool-footer-container footer {
  background: #1f2937;
  color: #ffffff;
}

.mcc-page-main {
  flex: 1 0 auto;
}

.mcc-page {
  max-width: var(--mcc-max);
  margin: 0 auto;
  padding: 0.75rem 0.75rem 1.5rem;
}

.mcc-page__header--compact {
  text-align: center;
  margin-bottom: 0.75rem;
}

.mcc-page__landing-link {
  margin: 0 0 0.35rem;
  font-size: 0.8rem;
}

.mcc-page__landing-link a {
  color: var(--mcc-accent-dark);
}

.mcc-page__header h1 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 800;
}

.mcc-app {
  padding: 0.85rem;
  border: 2px solid var(--mcc-border);
  border-radius: var(--mcc-radius);
  background: var(--mcc-panel);
  box-shadow: 0 12px 32px rgba(15, 118, 110, 0.1);
}

.mcc-app__top {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 0.65rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--mcc-border);
}

.mcc-app__toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  flex: 1;
  min-width: 200px;
}

.mcc-app__status-item {
  flex: 1;
  min-width: 5.5rem;
  padding: 0.45rem 0.6rem;
  border-radius: 8px;
  background: var(--mcc-bg);
  text-align: center;
  border: 1px solid var(--mcc-border);
}

.mcc-app__status-item span {
  display: block;
  font-size: 0.7rem;
  color: var(--mcc-muted);
}

.mcc-app__status-item strong {
  display: block;
  font-size: 0.95rem;
  color: var(--mcc-accent-dark);
}

.mcc-verdict--ok { color: var(--mcc-ok) !important; }
.mcc-verdict--warn { color: var(--mcc-warn) !important; }
.mcc-verdict--bad { color: var(--mcc-bad) !important; }
.mcc-verdict--pending { color: var(--mcc-muted) !important; }
.mcc-verdict--paused { color: #6366f1 !important; }

.mcc-app__controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  align-items: flex-end;
}

.mcc-control {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  font-size: 0.7rem;
  color: var(--mcc-muted);
}

.mcc-control select {
  padding: 0.3rem 0.45rem;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  font-family: inherit;
  font-size: 0.8rem;
}

.mcc-control--check {
  flex-direction: row;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
}

.mcc-main {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 0.65rem;
  align-items: start;
}

@media (max-width: 820px) {
  .mcc-main {
    grid-template-columns: 1fr;
  }
}

.mcc-main__left {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.mcc-capture {
  padding: 0.65rem;
  border: 2px dashed var(--mcc-border);
  border-radius: 10px;
  background: var(--mcc-bg);
  text-align: center;
  outline: none;
  cursor: crosshair;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.mcc-capture.is-active {
  border-style: solid;
  border-color: var(--mcc-accent);
  background: #ecfdf5;
}

.mcc-capture.is-paused {
  border-color: #a5b4fc;
  background: #eef2ff;
  cursor: default;
}

.mcc-capture.is-hold-countdown {
  border-color: #f59e0b;
  border-style: solid;
  background: #fffbeb;
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.25);
  animation: mcc-hold-pulse 1s ease-in-out infinite;
}

.mcc-capture.is-hold-arming {
  border-color: #ea580c;
  border-style: solid;
  background: #ffedd5;
  box-shadow: 0 0 0 4px rgba(234, 88, 12, 0.3);
  animation: mcc-hold-pulse 0.8s ease-in-out infinite;
}

.mcc-capture.is-hold-holding {
  border-color: #0d9488;
  border-style: solid;
  background: #ccfbf1;
  box-shadow: 0 0 0 4px rgba(13, 148, 136, 0.35);
}

@keyframes mcc-hold-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.2);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(245, 158, 11, 0.35);
  }
}

.mcc-capture {
  position: relative;
}

.mcc-hold-overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(15, 118, 110, 0.88);
  color: #fff;
  text-align: center;
  padding: 0.5rem;
}

.mcc-hold-overlay[hidden] {
  display: none !important;
}

.mcc-hold-overlay__inner {
  width: 100%;
}

.mcc-hold-overlay__countdown {
  display: block;
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 0.35rem;
}

.mcc-hold-overlay__countdown:empty {
  display: none;
}

.mcc-hold-overlay__title {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1.4;
}

.mcc-hold-overlay__hint {
  margin: 0.35rem 0 0;
  font-size: 0.72rem;
  opacity: 0.92;
  line-height: 1.45;
}

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

.mcc-hold-overlay__progress {
  height: 100%;
  width: 0;
  background: #fff;
  border-radius: 999px;
  transition: width 0.1s linear;
}

.mcc-capture:focus-visible {
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.25);
}

.mcc-capture__message {
  margin: 0 0 0.5rem;
  font-size: 0.78rem;
  color: var(--mcc-muted);
}

.mcc-capture__wheel {
  display: flex;
  justify-content: center;
  gap: 1.25rem;
  margin-top: 0.5rem;
  font-size: 0.78rem;
  color: var(--mcc-muted);
}

.mcc-capture__wheel strong {
  color: var(--mcc-accent-dark);
  font-size: 0.95rem;
}

.mcc-mouse {
  display: flex;
  justify-content: center;
}

.mcc-mouse__body {
  position: relative;
  width: 100px;
  height: 140px;
  border-radius: 50px 50px 28px 28px;
  background: linear-gradient(145deg, #e2e8f0, #f8fafc);
  border: 2px solid #94a3b8;
}

.mcc-mouse__wheel {
  position: absolute;
  top: 28%;
  left: 50%;
  transform: translateX(-50%);
  width: 6px;
  height: 28px;
  border-radius: 3px;
  background: #64748b;
}

.mcc-mouse__btn {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #94a3b8;
  border-radius: 6px;
  background: #fff;
  font-size: 0.58rem;
  font-weight: 700;
  color: var(--mcc-muted);
  transition: background 0.12s, border-color 0.12s, color 0.12s, box-shadow 0.12s;
}

.mcc-mouse__btn--left {
  top: 10%;
  left: 7%;
  width: 42%;
  height: 36%;
  border-radius: 40px 8px 8px 8px;
}

.mcc-mouse__btn--right {
  top: 10%;
  right: 7%;
  width: 42%;
  height: 36%;
  border-radius: 8px 40px 8px 8px;
}

.mcc-mouse__btn--middle {
  top: 22%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
  padding: 0 0.25rem;
}

.mcc-mouse__side {
  position: absolute;
  left: -2.4rem;
  top: 32%;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.mcc-mouse__btn--back,
.mcc-mouse__btn--forward {
  position: static;
  padding: 0.15rem 0.3rem;
}

.mcc-mouse__btn.is-hold-target {
  border-color: #ea580c;
  background: #ffedd5;
  color: #c2410c;
  box-shadow: 0 0 0 3px rgba(234, 88, 12, 0.45);
  animation: mcc-hold-pulse 0.8s ease-in-out infinite;
}

.mcc-mouse__btn.is-active,
.mcc-ext-btn.is-active {
  background: var(--mcc-accent);
  border-color: var(--mcc-accent-dark);
  color: #fff;
  box-shadow: 0 0 0 2px rgba(13, 148, 136, 0.3);
}

.mcc-mouse__btn.is-ok,
.mcc-ext-btn.is-ok { border-color: var(--mcc-ok); background: #f0fdf4; }

.mcc-mouse__btn.is-warn,
.mcc-ext-btn.is-warn { border-color: var(--mcc-warn); background: #fffbeb; }

.mcc-mouse__btn.is-bad,
.mcc-ext-btn.is-bad { border-color: var(--mcc-bad); background: #fef2f2; }

.mcc-mouse__btn.is-untested,
.mcc-ext-btn.is-untested { opacity: 0.55; }

.mcc-ext-btn.is-discovered {
  border-color: var(--mcc-accent);
  color: var(--mcc-accent-dark);
  opacity: 1;
}

.mcc-ext-section {
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
  background: var(--mcc-bg);
  border: 1px solid var(--mcc-border);
}

.mcc-ext-section__label {
  margin: 0 0 0.35rem;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--mcc-muted);
}

.mcc-ext-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 0.25rem;
}

@media (max-width: 520px) {
  .mcc-ext-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

.mcc-ext-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 1.5rem;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  background: #fff;
  font-weight: 700;
  font-size: 0.65rem;
  color: var(--mcc-muted);
}

.mcc-hold {
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
  background: var(--mcc-bg);
  border: 1px solid var(--mcc-border);
}

.mcc-hold__title {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  font-weight: 600;
}

.mcc-hold__bar-wrap {
  height: 6px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

.mcc-hold__bar {
  height: 100%;
  width: 0;
  background: var(--mcc-accent);
  transition: width 0.1s linear;
}

.mcc-hold__bar.is-unstable { background: var(--mcc-bad); }

.mcc-hold__label {
  margin: 0.3rem 0;
  font-size: 0.7rem;
  color: var(--mcc-muted);
}

.mcc-hold__results {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.35rem;
  font-size: 0.7rem;
}

.mcc-hold__result {
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  background: #fff;
  border: 1px solid #e2e8f0;
}

.mcc-hold__result.is-stable { border-color: var(--mcc-ok); color: var(--mcc-ok); }
.mcc-hold__result.is-unstable { border-color: var(--mcc-bad); color: var(--mcc-bad); }
.mcc-hold__result.is-pending { color: var(--mcc-muted); }

.mcc-hold__actions {
  display: flex;
  gap: 0.35rem;
}

.mcc-main__right {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.mcc-panel {
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  background: var(--mcc-bg);
  border: 1px solid var(--mcc-border);
}

.mcc-panel h2 {
  margin: 0 0 0.4rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--mcc-accent-dark);
}

.mcc-checklist {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.72rem;
}

.mcc-checklist li {
  display: flex;
  align-items: flex-start;
  gap: 0.35rem;
  padding: 0.2rem 0;
  color: var(--mcc-muted);
  border-bottom: 1px solid rgba(153, 246, 228, 0.5);
}

.mcc-checklist li:last-child { border-bottom: none; }

.mcc-checklist__mark {
  flex-shrink: 0;
  width: 1rem;
  text-align: center;
  font-weight: 700;
}

.mcc-checklist li.is-done { color: var(--mcc-ok); }
.mcc-checklist li.is-done .mcc-checklist__mark { color: var(--mcc-ok); }

.mcc-checklist li.is-active {
  color: var(--mcc-accent-dark);
  font-weight: 600;
  background: rgba(13, 148, 136, 0.08);
  margin: 0 -0.35rem;
  padding-left: 0.35rem;
  padding-right: 0.35rem;
  border-radius: 4px;
}

.mcc-status-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.3rem;
  margin-bottom: 0.45rem;
}

.mcc-status-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem;
  padding: 0.25rem 0.4rem;
  border-radius: 5px;
  background: #fff;
  border: 1px solid #e2e8f0;
  font-size: 0.68rem;
}

.mcc-status-chip__label {
  color: var(--mcc-text);
  font-weight: 600;
}

.mcc-status-chip__badge {
  font-size: 0.62rem;
  font-weight: 700;
  padding: 0.1rem 0.3rem;
  border-radius: 3px;
  white-space: nowrap;
}

.mcc-status-chip--idle .mcc-status-chip__badge { background: #f1f5f9; color: #64748b; }
.mcc-status-chip--ok .mcc-status-chip__badge { background: #dcfce7; color: var(--mcc-ok); }
.mcc-status-chip--warn .mcc-status-chip__badge { background: #fef3c7; color: var(--mcc-warn); }
.mcc-status-chip--bad .mcc-status-chip__badge { background: #fee2e2; color: var(--mcc-bad); }
.mcc-status-chip--active .mcc-status-chip__badge { background: #ccfbf1; color: var(--mcc-accent-dark); }

.mcc-advice {
  margin: 0 0 0.45rem;
  padding: 0.4rem 0.5rem;
  border-radius: 6px;
  background: #fff;
  border-left: 3px solid var(--mcc-accent);
  font-size: 0.72rem;
}

.mcc-report__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.mcc-btn {
  padding: 0.35rem 0.7rem;
  border: none;
  border-radius: 6px;
  background: var(--mcc-accent);
  color: #fff;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.75rem;
  cursor: pointer;
}

.mcc-btn:hover { background: var(--mcc-accent-dark); }
.mcc-btn--small { padding: 0.28rem 0.55rem; font-size: 0.7rem; }
.mcc-btn--secondary { background: #64748b; }
.mcc-btn--secondary:hover { background: #475569; }

.mcc-btn--ghost {
  background: transparent;
  color: var(--mcc-muted);
  border: 1px solid #cbd5e1;
}

.mcc-btn--ghost:hover {
  background: #f1f5f9;
  color: var(--mcc-text);
}

.mcc-panel--log {
  margin-top: 0.5rem;
}

.mcc-panel--log h2 {
  margin: 0 0 0.3rem;
  font-size: 0.75rem;
}

.mcc-log {
  margin: 0;
  padding-left: 1rem;
  max-height: 72px;
  overflow-y: auto;
  font-size: 0.68rem;
  font-family: ui-monospace, monospace;
}

.mcc-log li { margin-bottom: 0.15rem; }
.mcc-log li.is-warn { color: var(--mcc-warn); }
.mcc-log li.is-bad { color: var(--mcc-bad); }

.mcc-ad-section {
  max-width: 72rem;
  margin: 0 auto;
  padding: 1rem clamp(1rem, 2vw, 1.5rem) 1.25rem;
}

.mcc-ad-section__inner {
  display: flex;
  justify-content: center;
  text-align: center;
}

.mcc-ad-section__inner [id^='msmaflink-'] {
  display: flex;
  justify-content: center;
  width: 100%;
}

.mcc-ad-section__inner [id^='msmaflink-'] > * {
  margin-right: auto !important;
  margin-left: auto !important;
}
