﻿/* AI analysis page layout and board refinements. */
/* AI analysis page reference layout */
body:not(:has(#authOverlay:not(.hidden))) .app-shell {
  background: #f7f4ed;
}

.workspace {
  max-width: none !important;
  display: grid;
  grid-template-areas:
    "nav nav nav"
    "left board analysis";
  align-items: start;
  gap: 22px 28px;
  padding: 0 28px 32px;
}

.topbar {
  grid-area: nav;
  min-height: 86px !important;
  display: grid !important;
  align-items: center !important;
  gap: 28px;
  margin: 0 -28px 4px !important;
  padding: 0 28px !important;
  border: 0 !important;
  border-bottom: 1px solid rgba(68, 88, 100, 0.18) !important;
  border-radius: 0 !important;
  background: rgba(255, 253, 248, 0.94) !important;
  box-shadow: none !important;
}

.analysis-brand {
  margin: 0 !important;
}

.analysis-brand img {
  width: 208px;
  max-height: 66px;
  display: block;
  object-fit: contain;
  object-position: left center;
}

.topbar > div:first-child p {
  display: none;
}

.topbar-actions {
  display: contents !important;
}

.topbar-primary-nav {
  justify-self: center;
  display: flex !important;
  gap: 38px !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
}

.topbar-primary-nav button,
.topbar-actions .topbar-primary-nav button,
.topbar-actions .topbar-primary-nav button:nth-of-type(1),
.topbar-actions .topbar-primary-nav button:nth-of-type(2) {
  min-height: 86px !important;
  padding: 0 2px !important;
  border: 0 !important;
  border-bottom: 4px solid transparent !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: #17231d !important;
  font-size: 18px !important;
  font-weight: 800 !important;
}

.topbar-primary-nav button.active,
.topbar-actions .topbar-primary-nav button.active,
.topbar-actions .topbar-primary-nav button.active:nth-of-type(1) {
  color: var(--brand-green) !important;
  border-bottom-color: var(--brand-green) !important;
  background: transparent !important;
  box-shadow: none !important;
}

.topbar-utility-actions {
  display: none !important;
}

.account-menu {
  justify-self: end;
}

.account-menu-button {
  min-height: 50px !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: #17231d !important;
  font-size: 15px !important;
  font-weight: 900 !important;
}
#editorModeBtn {
  display: none !important;
}

.main-grid {
  display: contents !important;
}

.side-panel {
  grid-area: analysis;
  display: flex !important;
  flex-direction: column;
  align-self: start;
  min-width: 0;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

#analysisRightStack {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* board-panel: カードボックスを除去（DOM順=header→seekbar→board→tree を維持） */
.board-panel {
  grid-area: board;
  align-self: start;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

/* board-header: 幅制限・中央配置 */
.board-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: min(100%, 646px) !important;
  margin: 0 auto 10px !important;
}

.board-status-row,
.board-actions,
.board-hint,
#queueStatus {
  display: none !important;
}

.board-move-status {
  display: none !important;
}
.study-panel,
.editor-panel {
  grid-area: analysis;
}


.tab-guide {
  display: none !important;
}

.analysis-result-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 8px !important;
  color: #17231d;
  font-size: 22px !important;
  font-weight: 600 !important;
}

.analysis-result-title::before {
  content: "AI";
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 2px solid #2f86d5;
  border-radius: 7px;
  color: #2f86d5;
  font-family: var(--body-font);
  font-size: 14px;
  font-weight: 900;
}

.position-summary {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 0 !important;
  padding: 16px !important;
  border: 1px solid rgba(68, 88, 100, 0.16) !important;
  border-radius: 7px !important;
  background: #fff !important;
}

.position-summary div {
  border-right: 1px solid rgba(68, 88, 100, 0.12);
  text-align: center;
}
.position-summary div:last-child { border-right: 0; }
.position-summary dt { color: #53616b; font-size: 13px; }
.position-summary dd { color: #111814; font-size: 28px; font-weight: 600; }

.candidate-section {
  padding: 0 !important;
  border: 1px solid rgba(68, 88, 100, 0.16) !important;
  border-radius: 7px !important;
  background: #fff !important;
  overflow-x: hidden;
  overflow-y: visible;
}

.candidate-section h3 {
  margin: 0 !important;
  padding: 8px 28px 8px 10px !important;
  border-bottom: 1px solid rgba(68, 88, 100, 0.12);
  color: #17231d;
  font-size: 15px !important;
  font-weight: 700 !important;
}

.candidate-table-head {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 58px 54px 54px;
  min-width: 0;
  align-items: center;
  gap: 6px;
}

.candidate-table-head span:not(:first-child) {
  color: #53616b;
  font-size: 12px;
  font-weight: 500;
  text-align: right;
}

.candidate-list {
  display: block !important;
  min-width: 0;
  max-height: 230px;
  overflow-x: hidden;
  overflow-y: auto;
  gap: 0 !important;
}

.candidate-list-shell {
  display: grid;
  min-width: 0;
}

.candidate-list-top {
  max-height: none !important;
  overflow: visible !important;
}

.candidate-list-scroll {
  max-height: clamp(92px, 13vh, 110px);
  overflow-x: hidden;
  overflow-y: auto;
}

.candidate-list-scroll:empty {
  display: none !important;
}

#candidateTopList,
#candidateList {
  display: block !important;
  grid-template-columns: none !important;
  margin: 0 !important;
  padding-left: 0 !important;
  list-style: none !important;
}

.candidate-list li {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 58px 54px 54px;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 5px 10px !important;
  border-bottom: 1px solid rgba(68, 88, 100, 0.1) !important;
  border-radius: 0 !important;
  background: #fff !important;
}

.candidate-list li:last-child {
  border-bottom: 0 !important;
}


.candidate-list strong {
  display: grid !important;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 8px !important;
  row-gap: 2px;
  align-items: center;
  min-width: 0;
  color: #17231d;
  font-size: 14px;
  font-weight: 500 !important;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.candidate-move-text {
  color: inherit !important;
  font-size: inherit !important;
  margin: 0 !important;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.candidate-best-label {
  grid-column: 2;
  grid-row: 2;
  justify-self: start;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--brand-green);
  font-size: 10px;
  font-style: normal;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.candidate-metrics-row {
  display: contents !important;
  min-width: 0;
}

.candidate-rate,
.candidate-lead,
.candidate-complexity {
  color: #17231d !important;
  font-size: 13px !important;
  font-weight: 400 !important;
  line-height: 1.2;
  margin: 0 !important;
  min-width: 0;
  overflow-wrap: anywhere;
  text-align: right;
  white-space: normal;
}



.game-review-panel.hidden {
  display: none !important;
}

.score-graph {
  min-height: 180px !important;
  grid-column: 1;
  padding: 14px !important;
  border: 1px solid rgba(68, 88, 100, 0.16);
  border-radius: 7px;
  background: #fff !important;
}

@media (max-width: 1180px) {
  .workspace {
    grid-template-columns: 1fr !important;
    grid-template-areas:
      "nav"
      "left"
      "board"
      "analysis";
  }

  .topbar {
    grid-template-columns: 1fr !important;
    height: auto;
    padding-top: 12px !important;
    padding-bottom: 12px !important;
  }

  .topbar-primary-nav {
    justify-self: start;
    flex-wrap: wrap;
  }
}

/* Keep displayed Go stones exactly on line intersections. */
.point > .stone,
.qa-stone,
.point > .last-move-ring,
.point > .candidate,
.point.star::after,
.qa-point.star::after {
  left: 50% !important;
  top: 50% !important;
  transform: translate(-50%, -50%) !important;
}

.auth-mini-board .stone,
.auth-mini-board .candidate-dot,
.auth-mini-board .star-point {
  left: calc(((var(--x) + 0.5) * 100%) / 19) !important;
  top: calc(((var(--y) + 0.5) * 100%) / 19) !important;
  transform: translate(-50%, -50%) !important;
}

/* Main AI board overlays are positioned against board intersections. */
.goban > .stone,
.goban > .last-move-ring,
.goban > .candidate {
  pointer-events: none;
  transform: translate(-50%, -50%) !important;
}

.goban > .stone {
  width: calc(97% / var(--board-size)) !important;
  height: calc(97% / var(--board-size)) !important;
  max-width: 44px;
  max-height: 44px;
}

.goban > .last-move-ring {
  width: calc(45% / var(--board-size)) !important;
  height: calc(45% / var(--board-size)) !important;
}

.goban > .candidate {
  width: calc(90% / var(--board-size)) !important;
  height: calc(90% / var(--board-size)) !important;
}

/* Keep the first-click confirmation stone above AI candidate evaluation labels. */
.goban > .stone.move-confirmation-stone {
  z-index: 7 !important;
}



.position-summary dd {
  font-size: 30px !important;
}

.candidate-list li {
  min-height: 32px !important;
}

/* この局面を質問するボタン */
.analysis-qa-section {
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 0;
}

#askQaWithPositionBtn.analysis-qa-action {
  display: block !important;
  width: 100% !important;
  min-height: 64px !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 8px !important;
  background: #0f6842 !important;
  color: #fff !important;
  font-size: 20px !important;
  font-weight: 400 !important;
  box-shadow: 0 4px 0 rgba(22, 34, 42, 0.16), 0 8px 16px rgba(15, 104, 66, 0.20) !important;
  cursor: pointer !important;
}

#askQaWithPositionBtn.analysis-qa-action:hover {
  background: #0d5c3a !important;
}

#leftNav .analysis-left-qa-section {
  margin: 10px 0 2px;
}

#leftNav #askQaWithPositionBtn.analysis-qa-action {
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 38px !important;
  padding: 7px 10px !important;
  border-radius: 7px !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  line-height: 1.4;
  box-shadow: 0 2px 0 rgba(22, 34, 42, 0.14), 0 5px 12px rgba(15, 104, 66, 0.16) !important;
}

#leftNav #askQaWithPositionBtn.analysis-qa-action svg {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
}

.analysis-header-search {
  justify-self: end;
  width: 320px;
  min-height: 38px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border: 1px solid rgba(68, 88, 100, 0.22);
  border-radius: 8px;
  background: #fffdfa;
  color: #17231d;
}

.analysis-header-search input {
  min-width: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: #17231d;
  font: inherit;
  font-size: 14px;
  outline: none;
}

.analysis-header-search span {
  font-size: 24px;
  line-height: 1;
}

@media (max-width: 1180px) {
  .analysis-header-search {
    justify-self: start;
    width: min(100%, 360px);
  }
}

/* Keep header search compact so the user menu does not wrap. */
.analysis-header-search {
  width: clamp(210px, 19vw, 270px) !important;
  min-height: 40px !important;
  padding: 0 12px !important;
}

.analysis-header-search input {
  font-size: 13px !important;
}

.analysis-header-search span {
  font-size: 21px !important;
}

.account-menu,
.account-menu-button,
#accountMenuUser {
  white-space: nowrap !important;
}

.account-menu-button {
  min-width: max-content !important;
}

/* Left menu structure: AI analysis, SGF tools, editor entry. */
#editorModeBtn {
  display: flex !important;
  margin-top: 10px !important;
  border-top: 1px solid rgba(68, 88, 100, 0.14) !important;
  background: #fffdfa !important;
  color: #17231d !important;
}

#editorModeBtn.editor-menu-action {
  min-height: 56px !important;
}

#editorModeBtn.editor-menu-action::before {
  content: "";
}

/* Use stable inline SVG icons for move navigation. */
#firstMoveBtn::before,
#firstMoveBtn::after,
#prevMoveBtn::before,
#prevMoveBtn::after,
#nextMoveBtn::before,
#nextMoveBtn::after,
#lastMoveBtn::before,
#lastMoveBtn::after {
  content: none !important;
  display: none !important;
}

/* Keep the header search from pushing the user menu onto two lines. */
.topbar {
  grid-template-columns: 250px minmax(430px, 1fr) clamp(190px, 16vw, 235px) 44px max-content !important;
  gap: 18px !important;
}

.topbar-primary-nav {
  justify-self: center !important;
  gap: clamp(22px, 3vw, 38px) !important;
}

.analysis-header-search {
  justify-self: start !important;
  width: 100% !important;
  max-width: 235px !important;
  min-width: 190px !important;
}

.account-menu {
  justify-self: end !important;
  min-width: max-content !important;
}

.account-menu-button {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  white-space: nowrap !important;
  min-width: max-content !important;
  max-width: none !important;
}

#accountMenuUser {
  display: inline-block !important;
  max-width: 8.5em;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
  white-space: nowrap !important;
}
.candidate-section .candidate-table-head-main {
  grid-template-columns: minmax(0, 1fr) 58px 54px 54px;
  min-width: 0;
}

.candidate-section .candidate-list {
  min-width: 0;
}

.candidate-section .candidate-list li {
  grid-template-columns: minmax(0, 1fr) 58px 54px 54px;
}

.candidate-reload-btn {
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid rgba(15, 104, 66, 0.38);
  border-radius: 999px;
  background: #fff;
  color: #0f6842;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
}

.candidate-reload-btn:hover {
  background: rgba(15, 104, 66, 0.08);
  border-color: #0f6842;
}
.candidate-head-main-label {
  display: inline-flex !important;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  min-width: 0;
}

/* ─── 横向き棋譜ツリー（シークバー下） ─── */
.game-tree-panel {
  display: block !important;
  width: min(100%, 646px);
  margin: 10px auto 0;
}

.board-panel .game-tree {
  max-height: 160px;
  overflow-x: auto;
  overflow-y: auto;
  overscroll-behavior-x: contain;
  overscroll-behavior-y: contain;
  touch-action: auto;
}

/* ─── 棋譜解析パネル (kap-panel) ─────────────────────────── */

body:not([data-mode="analysis"]) .result-panel.kap-panel {
  display: none;
}

/* 右バーUIとして再構成: .analysis-review-card スコープで上書きなし設計 */

.analysis-review-card.result-panel.kap-panel {
  display: block;
  padding: 0;
  gap: 0;
  overflow: visible;
  border: 1px solid rgba(68, 88, 100, 0.18);
  border-radius: 10px;
  background: #fffdfa;
  box-shadow: 0 2px 0 rgba(22, 34, 42, 0.08), 0 4px 12px rgba(31, 45, 55, 0.06);
}

/* ヘッダー */
.analysis-review-card .kap-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px 12px;
  border-bottom: 1px solid rgba(68, 88, 100, 0.10);
}

.analysis-review-card .kap-header-icon {
  flex-shrink: 0;
  line-height: 0;
}

.analysis-review-card .kap-header-icon svg {
  width: 32px;
  height: 32px;
  display: block;
}

.analysis-review-card .kap-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: #17231d;
}

/* 説明文 */
.analysis-review-card .kap-desc {
  margin: 0;
  padding: 12px 18px 14px;
  color: #53616b;
  font-size: 13px;
  line-height: 1.65;
}

/* グループ区切り線 */
.analysis-review-card .kap-divider {
  height: 1px;
  background: rgba(68, 88, 100, 0.09);
  margin: 0;
}

.analysis-review-card .kap-divider.kap-hidden {
  display: none;
}

/* グループ */
.analysis-review-card .kap-group {
  padding: 14px 18px;
}

.analysis-review-card .kap-group.kap-hidden {
  display: none;
}

.analysis-review-card .kap-group-label {
  display: block;
  margin-bottom: 10px;
  color: #17231d;
  font-size: 14px;
  font-weight: 700;
}

/* 総解析ボタン */
.analysis-review-card .kap-analyze-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
}

.analysis-review-card .kap-analyze-btn {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 9px !important;
  width: 100% !important;
  height: 48px !important;
  min-height: 48px !important;
  padding: 0 !important;
  border: none !important;
  border-radius: 10px !important;
  background: #0f6842 !important;
  color: #fff !important;
  font-size: 16px !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  box-shadow: 0 2px 0 rgba(15, 104, 66, 0.18), 0 4px 10px rgba(15, 104, 66, 0.18) !important;
  transition: background 0.15s !important;
}

.analysis-review-card .kap-analyze-btn:hover:not(:disabled) {
  background: #0d5c3a !important;
}

.analysis-review-card .kap-analyze-btn:disabled {
  background: rgba(68, 88, 100, 0.25) !important;
  box-shadow: none !important;
  cursor: not-allowed !important;
}

.analysis-review-card .kap-analyze-btn svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.analysis-review-card .kap-cancel-btn {
  align-self: center;
  height: 30px !important;
  min-height: 30px !important;
  padding: 0 12px !important;
  border: 1px solid rgba(68, 88, 100, 0.22) !important;
  border-radius: 8px !important;
  background: #fff !important;
  color: #53616b !important;
  font-size: 12.5px !important;
  font-weight: 500 !important;
  cursor: pointer !important;
  box-shadow: none !important;
}

/* 解析対象カード */
.analysis-review-card .kap-target-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(15, 104, 66, 0.18);
  border-radius: 8px;
  background: rgba(15, 104, 66, 0.04);
  color: #233039;
  font-size: 13.5px;
  font-weight: 500;
}

.analysis-review-card .kap-target-card svg {
  flex-shrink: 0;
  width: 17px;
  height: 17px;
  color: #0f6842;
}

/* 区切りボタン */
.analysis-review-card .kap-range-btns {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

.analysis-review-card .kap-range-btn {
  height: 34px !important;
  min-height: 34px !important;
  padding: 0 12px !important;
  border: 1px solid rgba(68, 88, 100, 0.22) !important;
  border-radius: 8px !important;
  background: #fff !important;
  box-shadow: none !important;
  color: #34444e !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  transition: border-color 0.12s, color 0.12s, background 0.12s !important;
}

.analysis-review-card .kap-range-btn.active {
  border-color: #0f6842 !important;
  background: rgba(15, 104, 66, 0.08) !important;
  color: #0f6842 !important;
}

.analysis-review-card .kap-range-btn:hover:not(.active) {
  border-color: #0f6842 !important;
  color: #0f6842 !important;
}

/* 解析で表示するもの */
.analysis-review-card .kap-display-list {
  border: 1px solid rgba(68, 88, 100, 0.12);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.analysis-review-card .kap-display-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-bottom: 1px solid rgba(68, 88, 100, 0.08);
  cursor: pointer;
  transition: background 0.1s;
}

.analysis-review-card .kap-display-item:last-child {
  border-bottom: none;
}

.analysis-review-card .kap-display-item:hover {
  background: rgba(15, 104, 66, 0.04);
}

.analysis-review-card .kap-display-item svg {
  flex-shrink: 0;
  width: 17px;
  height: 17px;
  color: #5a6471;
}

.analysis-review-card .kap-display-item span {
  flex: 1;
  color: #233039;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
}

.analysis-review-card .kap-display-item input[type="checkbox"] {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  margin: 0;
  cursor: pointer;
  accent-color: #0f6842;
}

/* 未実行プレースホルダー */
.analysis-review-card .kap-empty {
  margin: 0;
  padding: 24px 18px 22px;
  text-align: center;
}

.analysis-review-card .kap-empty-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(15, 104, 66, 0.09);
  margin-bottom: 10px;
}

.analysis-review-card .kap-empty-icon svg {
  width: 22px;
  height: 22px;
  color: #0f6842;
}

.analysis-review-card .kap-empty-title {
  margin: 0 0 5px;
  color: #17231d;
  font-size: 13.5px;
  font-weight: 700;
}

.analysis-review-card .kap-empty-body {
  margin: 0;
  color: #53616b;
  font-size: 12.5px;
  line-height: 1.55;
}

/* ─── kap 解析後 (kap-post-section) ────────────────────── */

.analysis-review-card .kap-post-section {
  display: block;
}

.analysis-review-card .kap-result-badge-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  border-bottom: 1px solid rgba(68, 88, 100, 0.09);
}

.analysis-review-card .kap-result-badge {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 10px;
  border: 1.5px solid #0f6842;
  border-radius: 6px;
  color: #0f6842;
  font-size: 12px;
  font-weight: 600;
}

.analysis-review-card .kap-reanalyze-btn {
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  margin-left: auto !important;
  height: 30px !important;
  padding: 0 11px !important;
  border: 1.5px solid rgba(15, 104, 66, 0.35) !important;
  border-radius: 7px !important;
  background: #fff !important;
  color: #0f6842 !important;
  font-size: 12.5px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  box-shadow: none !important;
  transition: border-color 0.12s, background 0.12s !important;
}

.analysis-review-card .kap-reanalyze-btn:hover {
  border-color: #0f6842 !important;
  background: rgba(15, 104, 66, 0.05) !important;
}

.analysis-review-card .kap-reanalyze-btn svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

/* 解析範囲ボタン */
.analysis-review-card .kap-result-range-btns {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.analysis-review-card .kap-result-range-btn {
  height: 32px !important;
  padding: 0 10px !important;
  border: 1px solid rgba(68, 88, 100, 0.20) !important;
  border-radius: 7px !important;
  background: #fff !important;
  box-shadow: none !important;
  color: #34444e !important;
  font-size: 12.5px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  transition: border-color 0.12s, background 0.12s, color 0.12s !important;
}

.analysis-review-card .kap-result-range-btn.active {
  border-color: transparent !important;
  background: #0f6842 !important;
  color: #fff !important;
}

.analysis-review-card .kap-result-range-btn:hover:not(.active) {
  border-color: #0f6842 !important;
  color: #0f6842 !important;
}

/* 形勢推移 */
.analysis-review-card .kap-result-th-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.analysis-review-card .kap-winrate-summary {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
}

.analysis-review-card .kap-wr-bar-wrap {
  width: 64px;
  height: 7px;
  background: #e0e3e8;
  border-radius: 4px;
  overflow: hidden;
}

.analysis-review-card .kap-wr-bar-black {
  height: 100%;
  background: #1a1a1a;
  border-radius: 4px;
}

.analysis-review-card .kap-wr-black { color: #1a1a1a; font-weight: 600; }
.analysis-review-card .kap-wr-white { color: #6a7480; font-weight: 500; }

.analysis-review-card .kap-score-graph-wrap {
  margin-top: 6px;
  overflow: hidden;
  border-radius: 6px;
}

.analysis-review-card .kap-score-graph {
  width: 100%;
  height: auto;
  display: block;
  cursor: crosshair;
  touch-action: manipulation;
}

.analysis-review-card .kap-score-graph:focus-visible {
  outline: 2px solid #1d6fd0;
  outline-offset: -2px;
}

.analysis-review-card .kap-score-graph-hint {
  margin: 5px 0 0;
  color: #738079;
  font-size: 11px;
  line-height: 1.4;
  text-align: center;
}

/* スコアグラフ SVG クラス */
.analysis-review-card .kap-graph-bg { fill: #f8fafc; }
.analysis-review-card .kap-graph-grid { stroke: #dde1e8; stroke-width: 0.5; }
.analysis-review-card .kap-graph-zero { stroke: #888e96; stroke-width: 1; }
.analysis-review-card .kap-graph-area-black { fill: rgba(29, 111, 208, 0.12); }
.analysis-review-card .kap-graph-area-white { fill: rgba(30, 180, 100, 0.12); }
.analysis-review-card .kap-graph-line { stroke: #1d6fd0; stroke-width: 1.6; fill: none; stroke-linejoin: round; stroke-linecap: round; }
.analysis-review-card .kap-graph-current-marker { pointer-events: none; }
.analysis-review-card .kap-graph-current-marker[hidden] { display: none; }
.analysis-review-card .kap-graph-current-line {
  stroke: #d97706;
  stroke-width: 1.5;
  stroke-dasharray: 4 3;
  vector-effect: non-scaling-stroke;
}
.analysis-review-card .kap-graph-current-dot {
  fill: #d97706;
  stroke: #fff;
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
}
.analysis-review-card .kap-graph-y-label { font-size: 9.5px; fill: #8a9299; text-anchor: end; }
.analysis-review-card .kap-graph-x-label { font-size: 9.5px; fill: #8a9299; text-anchor: middle; }
.analysis-review-card .kap-graph-side-label { font-size: 9.5px; font-weight: 600; }
.analysis-review-card .kap-black-label { fill: #1d6fd0; }
.analysis-review-card .kap-white-label { fill: #1eb86a; }
.analysis-review-card .kap-graph-empty { color: #8a9299; font-size: 13px; text-align: center; padding: 18px; margin: 0; }

/* 評価変動ランキング */
.analysis-review-card .kap-rank-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(68, 88, 100, 0.16);
  margin-bottom: 8px;
}

.analysis-review-card .kap-rank-tab {
  height: 38px !important;
  border: none !important;
  background: rgba(68, 88, 100, 0.06) !important;
  color: #34444e !important;
  font-size: 13.5px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  transition: background 0.12s, color 0.12s !important;
}

.analysis-review-card .kap-rank-tab.active {
  background: #0f6842 !important;
  color: #fff !important;
}

.analysis-review-card .kap-rank-tab:hover:not(.active) {
  background: rgba(15, 104, 66, 0.08) !important;
  color: #0f6842 !important;
}

.analysis-review-card .kap-rank-list {
  border: 1px solid rgba(68, 88, 100, 0.12);
  border-radius: 8px;
  overflow: hidden;
}

.analysis-review-card .kap-rank-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(68, 88, 100, 0.07);
}

.analysis-review-card .kap-rank-row:last-child { border-bottom: none; }

.analysis-review-card .kap-rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  color: #fff;
  font-size: 11.5px;
  font-weight: 700;
  flex-shrink: 0;
}

.analysis-review-card .kap-rank-gold { background: #c9960d; }
.analysis-review-card .kap-rank-silver { background: #7e8c98; }
.analysis-review-card .kap-rank-bronze { background: #a96c2b; }

.analysis-review-card .kap-rank-move {
  flex: 1;
  color: #233039;
  font-size: 13px;
  font-weight: 500;
}

.analysis-review-card .kap-rank-diff {
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}

.analysis-review-card .kap-diff-bad { color: #d32f2f; }
.analysis-review-card .kap-diff-good { color: #0f6842; }

.analysis-review-card .kap-open-move-btn {
  height: 28px !important;
  min-height: 28px !important;
  padding: 0 9px !important;
  border: 1px solid rgba(15, 104, 66, 0.30) !important;
  border-radius: 6px !important;
  background: #fff !important;
  color: #0f6842 !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  white-space: nowrap !important;
  flex-shrink: 0;
  box-shadow: none !important;
}

.analysis-review-card .kap-open-move-btn:hover {
  background: rgba(15, 104, 66, 0.06) !important;
  border-color: #0f6842 !important;
}

.analysis-review-card .kap-rank-empty {
  padding: 14px;
  text-align: center;
  color: #8a9299;
  font-size: 13px;
  margin: 0;
}

/* AI一致度 評価内訳テーブル */
.analysis-review-card .kap-mq-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.analysis-review-card .kap-mq-title-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.analysis-review-card .kap-mq-subtitle {
  color: #6a7480;
  font-size: 12px;
}

.analysis-review-card .kap-mq-table-outer {
  border: 1px solid rgba(68, 88, 100, 0.12);
  border-radius: 8px;
  overflow: hidden;
}

.analysis-review-card .kap-mq-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 12px;
}

.analysis-review-card .kap-mq-th {
  padding: 7px 6px;
  background: rgba(68, 88, 100, 0.05);
  color: #34444e;
  font-weight: 600;
  font-size: 11.5px;
  border-bottom: 1px solid rgba(68, 88, 100, 0.10);
  white-space: nowrap;
}

.analysis-review-card .kap-mq-th-grade {
  width: 58px;
  text-align: left;
  padding-left: 10px;
}

.analysis-review-card .kap-mq-th-count {
  width: 44px;
  text-align: right;
  padding-right: 4px;
}

.analysis-review-card .kap-mq-th-ratio {
  text-align: left;
  padding-left: 4px;
}

.analysis-review-card .kap-mq-stone {
  width: 11px;
  height: 11px;
  vertical-align: middle;
  margin-right: 3px;
  flex-shrink: 0;
}

.analysis-review-card .kap-mq-row {
  border-bottom: 1px solid rgba(68, 88, 100, 0.07);
}

.analysis-review-card .kap-mq-row:last-child {
  border-bottom: none;
}

.analysis-review-card .kap-mq-td {
  padding: 6px 6px;
  vertical-align: middle;
  color: #233039;
}

.analysis-review-card .kap-mq-td-grade {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 500;
  padding-left: 8px;
  white-space: nowrap;
}

.analysis-review-card .kap-mq-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}

.analysis-review-card .kap-mq-td-count {
  text-align: right;
  font-size: 12.5px;
  font-weight: 700;
  padding-right: 4px;
  white-space: nowrap;
}

.analysis-review-card .kap-mq-td-ratio {
  padding-left: 4px;
}

.analysis-review-card .kap-mq-pct {
  display: block;
  font-size: 11px;
  color: #5a6471;
  white-space: nowrap;
  line-height: 1.2;
}

.analysis-review-card .kap-mq-bar-wrap {
  display: block;
  width: 100%;
  height: 5px;
  background: #e0e3e8;
  border-radius: 3px;
  overflow: hidden;
  margin-top: 2px;
}

.analysis-review-card .kap-mq-bar {
  display: block;
  height: 100%;
  border-radius: 3px;
  min-width: 0;
  max-width: 100%;
}

.analysis-review-card .kap-group-last {
  padding-bottom: 20px;
}

/* 総解析 v2: 形勢・候補比較・局所継続・6軸・終盤予算 */
.analysis-review-card .kap-display-item {
  cursor: default;
}

.analysis-review-card .kap-display-item small {
  flex-shrink: 0;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(15, 104, 66, 0.09);
  color: #0f6842;
  font-size: 10px;
  font-weight: 700;
}

.analysis-review-card .kap-analysis-warning {
  display: grid;
  gap: 3px;
  margin: 12px 18px 0;
  padding: 10px 12px;
  border: 1px solid rgba(194, 120, 3, 0.28);
  border-radius: 8px;
  background: #fff8e8;
  color: #6f4807;
  font-size: 12px;
  line-height: 1.5;
}

.analysis-review-card .kap-metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.analysis-review-card .kap-metric-card {
  display: grid;
  gap: 3px;
  padding: 10px 11px;
  border: 1px solid rgba(68, 88, 100, 0.12);
  border-radius: 8px;
  background: #fff;
}

.analysis-review-card .kap-metric-card strong {
  color: #17231d;
  font-size: 19px;
}

.analysis-review-card .kap-metric-card small,
.analysis-review-card .kap-metric-label {
  color: #66727b;
  font-size: 11px;
}

.analysis-review-card .kap-band-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-top: 9px;
}

.analysis-review-card .kap-band-item {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 8px;
  border-radius: 7px;
  background: #f5f6f7;
  color: #52606a;
  font-size: 10.5px;
}

.analysis-review-card .kap-band-item strong {
  color: #25313a;
  white-space: nowrap;
}

.analysis-review-card .kap-section-note,
.analysis-review-card .kap-section-empty {
  margin: 0 0 9px;
  color: #69747d;
  font-size: 11px;
  line-height: 1.55;
}

.analysis-review-card .kap-section-empty {
  padding: 10px;
  border-radius: 7px;
  background: #f5f6f7;
}

.analysis-review-card .kap-detail-scroll {
  display: grid;
  gap: 7px;
  max-height: 430px;
  overflow-y: auto;
  padding-right: 3px;
  overscroll-behavior: contain;
}

.analysis-review-card .kap-comparison-row {
  padding: 9px;
  border: 1px solid rgba(68, 88, 100, 0.12);
  border-radius: 8px;
  background: #fff;
}

.analysis-review-card .kap-comparison-head {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 7px;
  color: #243139;
  font-size: 11.5px;
}

.analysis-review-card .kap-comparison-head .kap-open-move-btn {
  margin-left: auto;
}

.analysis-review-card .kap-loss-pill {
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(204, 62, 62, 0.09);
  color: #a62e2e;
  font-size: 10px;
  font-weight: 700;
}

.analysis-review-card .kap-comparison-cells {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
}

.analysis-review-card .kap-comparison-cells > div {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 7px;
  border-radius: 6px;
  background: #f6f7f7;
}

.analysis-review-card .kap-comparison-cells span,
.analysis-review-card .kap-comparison-cells small {
  overflow: hidden;
  color: #6a757d;
  font-size: 9.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analysis-review-card .kap-comparison-cells strong {
  color: #17231d;
  font-size: 14px;
}

.analysis-review-card .kap-mini-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.analysis-review-card .kap-mini-summary > span {
  padding: 5px 8px;
  border-radius: 999px;
  background: #eef1f1;
  color: #52606a;
  font-size: 10.5px;
}

.analysis-review-card .kap-continuation-row {
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: center;
  gap: 5px 7px;
  padding: 8px 9px;
  border: 1px solid rgba(68, 88, 100, 0.12);
  border-radius: 8px;
  background: #fff;
  color: #53616a;
  font-size: 10.5px;
}

.analysis-review-card .kap-continuation-row .kap-open-move-btn {
  justify-self: end;
}

.analysis-review-card .kap-move-index {
  color: #243139;
  font-weight: 700;
}

.analysis-review-card .kap-judgment-badge {
  padding: 2px 6px;
  border-radius: 999px;
  font-size: 9.5px;
  font-weight: 700;
  white-space: nowrap;
}

.analysis-review-card .kap-judgment-continue {
  background: rgba(37, 99, 235, 0.1);
  color: #2454b8;
}

.analysis-review-card .kap-judgment-tenuki {
  background: rgba(22, 163, 74, 0.1);
  color: #16763a;
}

.analysis-review-card .kap-judgment-uncertain {
  background: rgba(100, 116, 139, 0.11);
  color: #566372;
}

.analysis-review-card .kap-warning-text {
  grid-column: 1 / -1;
  color: #a15a08;
  font-size: 10px;
}

.analysis-review-card .kap-style-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.analysis-review-card .kap-style-card {
  min-width: 0;
  padding: 9px;
  border: 1px solid rgba(68, 88, 100, 0.12);
  border-radius: 8px;
  background: #fff;
}

.analysis-review-card .kap-style-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 5px;
  margin-bottom: 8px;
}

.analysis-review-card .kap-style-title h4,
.analysis-review-card .kap-style-card h4 {
  margin: 0;
  color: #1f2c33;
  font-size: 12px;
}

.analysis-review-card .kap-style-title small {
  color: #707b82;
  font-size: 8.5px;
}

.analysis-review-card .kap-axis-row {
  margin-top: 7px;
}

.analysis-review-card .kap-axis-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px;
  color: #5e6971;
  font-size: 9px;
}

.analysis-review-card .kap-axis-heading > span {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  color: #26343b;
  font-weight: 700;
}

.analysis-review-card .kap-axis-heading > span small {
  color: #7a858c;
  font-size: 8px;
  font-weight: 500;
}

.analysis-review-card .kap-axis-heading strong {
  font-size: 9px;
}

.analysis-review-card .kap-axis-heading strong.positive {
  color: #177247;
}

.analysis-review-card .kap-axis-heading strong.negative {
  color: #b6533d;
}

.analysis-review-card .kap-axis-heading strong.neutral {
  color: #66737b;
}

.analysis-review-card .kap-tendency-meta {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  margin-top: 2px;
  color: #738087;
  font-size: 7.5px;
  line-height: 1.35;
}

.analysis-review-card .kap-tendency-meta span:last-child {
  text-align: right;
}

.analysis-review-card .kap-style-radar {
  margin: 2px 0 9px;
  padding: 5px 4px 6px;
  border: 1px solid rgba(68, 88, 100, 0.10);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(247, 250, 249, 0.82), #fff);
}

.analysis-review-card .kap-style-radar svg {
  display: block;
  width: 100%;
  height: auto;
  max-height: 250px;
  overflow: visible;
}

.analysis-review-card .kap-radar-grid polygon {
  fill: none;
  stroke: rgba(74, 91, 101, 0.16);
  stroke-width: 1;
}

.analysis-review-card .kap-radar-grid line {
  stroke: rgba(74, 91, 101, 0.13);
  stroke-width: 1;
}

.analysis-review-card .kap-radar-grid .kap-radar-human {
  fill: rgba(76, 102, 116, 0.035);
  stroke: #667983;
  stroke-width: 1.8;
  stroke-dasharray: 4 3;
}

.analysis-review-card .kap-radar-player {
  fill: rgba(28, 128, 87, 0.18);
  stroke: #1c8057;
  stroke-width: 2.2;
  stroke-linejoin: round;
}

.analysis-review-card .kap-style-radar-white .kap-radar-player {
  fill: rgba(45, 111, 191, 0.16);
  stroke: #2d6fbf;
}

.analysis-review-card .kap-radar-markers circle {
  fill: #fff;
  stroke: #1c8057;
  stroke-width: 1.8;
}

.analysis-review-card .kap-style-radar-white .kap-radar-markers circle {
  stroke: #2d6fbf;
}

.analysis-review-card .kap-radar-labels text {
  fill: #405058;
  font-size: 9px;
  font-weight: 650;
}

.analysis-review-card .kap-radar-scale text {
  fill: #859098;
  font-size: 7px;
}

.analysis-review-card .kap-radar-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 5px 10px;
  color: #66737b;
  font-size: 8px;
}

.analysis-review-card .kap-radar-legend span::before {
  display: inline-block;
  width: 12px;
  height: 3px;
  margin-right: 4px;
  border-radius: 2px;
  content: "";
  vertical-align: middle;
}

.analysis-review-card .kap-radar-legend .human::before {
  border-top: 2px dashed #667983;
}

.analysis-review-card .kap-radar-legend .player::before {
  background: #1c8057;
}

.analysis-review-card .kap-style-radar-white .kap-radar-legend .player::before {
  background: #2d6fbf;
}

.analysis-review-card .kap-radar-legend small {
  flex-basis: 100%;
  text-align: center;
  font-size: 7.5px;
}

.analysis-review-card .kap-radar-empty {
  margin: 4px 0 8px;
  padding: 12px;
  border-radius: 7px;
  background: rgba(100, 116, 139, 0.06);
  color: #6f7b82;
  font-size: 9px;
  text-align: center;
}

.analysis-review-card .kap-style-radar-compact {
  margin: 7px 0 6px;
  padding: 3px 2px 5px;
  background: #fbfcfc;
}

.analysis-review-card .kap-style-radar-compact svg {
  max-height: 205px;
}

.analysis-review-card .kap-style-radar-compact .kap-radar-labels text {
  font-size: 8.2px;
}

.analysis-review-card .kap-style-radar-compact .kap-radar-legend {
  gap: 4px 8px;
  font-size: 7.5px;
}

.analysis-review-card .kap-style-radar-compact .kap-radar-legend small {
  font-size: 7px;
}

.analysis-review-card .kap-style-diagnosis {
  margin: 0 0 9px;
  padding: 8px 9px;
  border-radius: 7px;
  background: rgba(26, 111, 77, 0.06);
  color: #40524a;
  font-size: 9px;
  line-height: 1.55;
}

.analysis-review-card .kap-style-diagnosis-muted {
  background: rgba(100, 116, 139, 0.07);
  color: #657179;
}

.analysis-review-card .kap-style-phase-details {
  margin-top: 10px;
  border: 1px solid rgba(68, 88, 100, 0.13);
  border-radius: 8px;
  background: #fff;
}

.analysis-review-card .kap-style-phase-details > summary {
  cursor: pointer;
  padding: 9px 11px;
  color: #2d4940;
  font-size: 10px;
  font-weight: 800;
}

.analysis-review-card .kap-style-phase-details[open] > summary {
  border-bottom: 1px solid rgba(68, 88, 100, 0.1);
}

.analysis-review-card .kap-style-phase-details > .kap-section-note {
  margin: 8px 10px;
}

.analysis-review-card .kap-style-phase-range-overview {
  margin: 8px 9px;
  padding: 8px;
  border: 1px solid rgba(44, 104, 78, 0.14);
  border-radius: 7px;
  background: rgba(28, 128, 87, 0.045);
}

.analysis-review-card .kap-style-phase-range-overview > h4 {
  margin: 0 0 6px;
  color: #29463a;
  font-size: 9px;
}

.analysis-review-card .kap-style-phase-range-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 5px;
}

.analysis-review-card .kap-style-phase-range-grid > div {
  min-width: 0;
  padding: 6px 4px;
  border-radius: 6px;
  background: #fff;
  text-align: center;
}

.analysis-review-card .kap-style-phase-range-grid span,
.analysis-review-card .kap-style-phase-range-grid strong {
  display: block;
}

.analysis-review-card .kap-style-phase-range-grid span {
  color: #68766f;
  font-size: 8px;
}

.analysis-review-card .kap-style-phase-range-grid strong {
  margin-top: 2px;
  color: #1f5e43;
  font-size: 9px;
}

.analysis-review-card .kap-style-phase-heatmaps {
  margin: 8px 9px;
  padding: 9px;
  border: 1px solid rgba(68, 88, 100, 0.13);
  border-radius: 8px;
  background: #f8faf9;
}

.analysis-review-card .kap-style-heatmap-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.analysis-review-card .kap-style-heatmap-heading > h4,
.analysis-review-card .kap-style-heatmap-panel > h4 {
  margin: 0;
  color: #29463a;
  font-size: 9px;
}

.analysis-review-card .kap-style-heatmap-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 3px 8px;
  color: #66737b;
  font-size: 7.5px;
}

.analysis-review-card .kap-style-heatmap-legend span::before {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 3px;
  border-radius: 2px;
  content: "";
  vertical-align: -1px;
}

.analysis-review-card .kap-style-heatmap-legend .negative::before {
  background: rgba(180, 80, 57, 0.58);
}

.analysis-review-card .kap-style-heatmap-legend .neutral::before {
  border: 1px solid rgba(100, 116, 139, 0.2);
  background: rgba(100, 116, 139, 0.08);
}

.analysis-review-card .kap-style-heatmap-legend .positive::before {
  background: rgba(27, 125, 83, 0.58);
}

.analysis-review-card .kap-style-heatmap-legend small {
  flex-basis: 100%;
  text-align: right;
  font-size: 7px;
}

.analysis-review-card .kap-style-heatmap-panels {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.analysis-review-card .kap-style-heatmap-panel {
  min-width: 0;
  padding: 8px;
  border: 1px solid rgba(68, 88, 100, 0.1);
  border-radius: 7px;
  background: #fff;
}

.analysis-review-card .kap-style-heatmap-scroll {
  margin-top: 6px;
  overflow-x: auto;
}

.analysis-review-card .kap-style-heatmap-grid {
  display: grid;
  grid-template-columns: minmax(58px, 0.9fr) repeat(6, minmax(43px, 1fr));
  gap: 3px;
  min-width: 365px;
}

.analysis-review-card .kap-style-heatmap-row {
  display: contents;
}

.analysis-review-card .kap-style-heatmap-corner,
.analysis-review-card .kap-style-heatmap-axis {
  display: flex;
  min-height: 25px;
  align-items: center;
  justify-content: center;
  padding: 3px;
  color: #62716a;
  font-size: 7px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
}

.analysis-review-card .kap-style-heatmap-phase {
  display: flex;
  min-height: 34px;
  flex-direction: column;
  justify-content: center;
  padding: 4px 5px;
  border-radius: 5px;
  background: #f3f6f4;
}

.analysis-review-card .kap-style-heatmap-phase strong {
  color: #31483e;
  font-size: 8px;
}

.analysis-review-card .kap-style-heatmap-phase small {
  margin-top: 1px;
  color: #7a8580;
  font-size: 6.5px;
}

.analysis-review-card .kap-style-heatmap-cell {
  display: flex;
  min-height: 34px;
  align-items: baseline;
  justify-content: center;
  padding: 7px 2px 5px;
  border: 1px solid rgba(71, 91, 101, 0.08);
  border-radius: 5px;
  color: #4b585f;
  background: rgba(100, 116, 139, 0.08);
  font-variant-numeric: tabular-nums;
}

.analysis-review-card .kap-style-heatmap-cell strong {
  font-size: 9px;
}

.analysis-review-card .kap-style-heatmap-cell small {
  margin-left: 1px;
  font-size: 6px;
}

.analysis-review-card .kap-style-heatmap-cell.positive {
  color: #0d4e34;
  background: rgb(27 125 83 / var(--kap-heat-alpha));
}

.analysis-review-card .kap-style-heatmap-cell.negative {
  color: #743523;
  background: rgb(180 80 57 / var(--kap-heat-alpha));
}

.analysis-review-card .kap-style-heatmap-cell.unavailable {
  color: #9aa3a0;
  background: repeating-linear-gradient(
    135deg,
    rgba(100, 116, 139, 0.035),
    rgba(100, 116, 139, 0.035) 4px,
    rgba(100, 116, 139, 0.085) 4px,
    rgba(100, 116, 139, 0.085) 5px
  );
}

.analysis-review-card .kap-style-phase-numeric-details {
  margin: 0 9px 9px;
  border-top: 1px solid rgba(68, 88, 100, 0.1);
}

.analysis-review-card .kap-style-phase-numeric-details > summary {
  cursor: pointer;
  padding: 8px 1px;
  color: #53635c;
  font-size: 8px;
  font-weight: 700;
}

.analysis-review-card .kap-style-phase-list {
  display: grid;
  gap: 8px;
  padding: 0 0 1px;
}

.analysis-review-card .kap-style-phase-card {
  min-width: 0;
  padding: 8px;
  border-radius: 7px;
  background: #f7f9f8;
}

.analysis-review-card .kap-style-phase-card > h4,
.analysis-review-card .kap-style-phase-color > h5 {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
  margin: 0;
  color: #293c35;
  font-size: 10px;
}

.analysis-review-card .kap-style-phase-card > h4 small,
.analysis-review-card .kap-style-phase-color > h5 small {
  color: #77817d;
  font-size: 8px;
  font-weight: 500;
}

.analysis-review-card .kap-style-phase-colors {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 7px;
}

.analysis-review-card .kap-style-phase-color {
  min-width: 0;
  padding: 7px;
  border: 1px solid rgba(68, 88, 100, 0.1);
  border-radius: 6px;
  background: #fff;
}

.analysis-review-card .kap-style-phase-axis {
  display: grid;
  grid-template-columns: minmax(105px, 1fr) repeat(3, minmax(48px, auto));
  gap: 5px;
  align-items: baseline;
  margin-top: 5px;
  color: #68736e;
  font-size: 8px;
}

.analysis-review-card .kap-style-phase-axis > span {
  color: #405048;
}

.analysis-review-card .kap-style-phase-axis > strong {
  color: #236c4b;
}

@media (max-width: 720px) {
  .analysis-review-card .kap-style-grid,
  .analysis-review-card .kap-style-phase-colors,
  .analysis-review-card .kap-style-heatmap-panels {
    grid-template-columns: 1fr;
  }

  .analysis-review-card .kap-style-heatmap-heading {
    display: block;
  }

  .analysis-review-card .kap-style-heatmap-legend {
    justify-content: flex-start;
    margin-top: 5px;
  }

  .analysis-review-card .kap-style-heatmap-legend small {
    text-align: left;
  }

  .analysis-review-card .kap-style-phase-axis {
    grid-template-columns: minmax(90px, 1fr) repeat(3, minmax(44px, auto));
  }

  .analysis-review-card .kap-style-phase-range-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.analysis-review-card .kap-endgame-card {
  display: grid;
  gap: 5px;
  padding: 10px 11px;
  border: 1px solid rgba(15, 104, 66, 0.17);
  border-radius: 8px;
  background: rgba(15, 104, 66, 0.045);
}

.analysis-review-card .kap-endgame-card .kap-group-label {
  margin: 0;
  font-size: 11px;
}

.analysis-review-card .kap-endgame-card strong {
  color: #20342a;
  font-size: 12px;
}

.analysis-review-card .kap-endgame-card small {
  color: #607068;
  font-size: 10px;
  line-height: 1.45;
}

.analysis-review-card .kap-budget-table {
  margin-top: 8px;
  overflow: hidden;
  border: 1px solid rgba(68, 88, 100, 0.12);
  border-radius: 8px;
}

.analysis-review-card .kap-budget-phase-row {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 7px;
  padding: 7px 9px;
  border-bottom: 1px solid rgba(68, 88, 100, 0.08);
  color: #58646c;
  font-size: 10px;
}

.analysis-review-card .kap-budget-phase-row:last-child {
  border-bottom: none;
}

.analysis-review-card .kap-budget-phase-row strong {
  color: #253239;
  text-align: right;
}

@media (max-width: 760px) {
  .analysis-review-card .kap-style-grid,
  .analysis-review-card .kap-metric-grid {
    grid-template-columns: 1fr;
  }

  .analysis-review-card .kap-comparison-cells {
    grid-template-columns: 1fr;
  }
}
