:root {
  color-scheme: light dark;
  --app-max: 520px;
  --gutter: clamp(10px, 3.2vw, 16px);
  --bottom-tabs-height: 72px;
  --sticky-score-height: 76px;
  --bg: #f4f6f1;
  --panel: #fffdf7;
  --ink: #172033;
  --muted: #667085;
  --line: #d8ded2;
  --own: #2563eb;
  --opp: #dc2626;
  --own-soft: #eff6ff;
  --opp-soft: #fff1f2;
  --accent: #0f766e;
  --soft: #eef4e7;
  --paper-line: rgba(37, 99, 235, 0.08);
  --paper: #fffdf7;
  --paper-strong: #fff8e8;
  --shadow-soft: 0 10px 26px rgba(23, 32, 51, 0.08);
  --shadow-card: 0 5px 16px rgba(23, 32, 51, 0.06);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Noto Sans JP", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  background:
    linear-gradient(transparent 31px, var(--paper-line) 32px),
    var(--bg);
  background-size: 100% 32px;
  color: var(--ink);
  scroll-padding-top: calc(var(--sticky-score-height) + 10px);
  -webkit-text-size-adjust: 100%;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
  touch-action: manipulation;
}

[hidden] {
  display: none !important;
}

.app-shell {
  width: min(100%, var(--app-max));
  margin: 0 auto;
  padding-top: max(var(--gutter), env(safe-area-inset-top));
  padding-right: max(var(--gutter), env(safe-area-inset-right));
  padding-bottom: calc(var(--bottom-tabs-height) + 16px + env(safe-area-inset-bottom));
  padding-left: max(var(--gutter), env(safe-area-inset-left));
}

.app-shell::before {
  content: "";
  display: block;
  height: 4px;
  margin: 0 2px 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--own), var(--accent), var(--opp));
  opacity: 0.82;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
  border: 1px solid rgba(23, 32, 51, 0.08);
  border-radius: 16px;
  padding: 12px;
  background: rgba(255, 253, 247, 0.9);
  box-shadow: var(--shadow-card);
}

.eyebrow {
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 1.28rem;
  line-height: 1.25;
}

h2 {
  font-size: 1rem;
}

.icon-button {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--ink);
  color: white;
  font-size: 1.65rem;
  line-height: 1;
  box-shadow: 0 8px 18px rgba(23, 32, 51, 0.14);
}

.start-guide {
  display: grid;
  gap: 4px;
  margin-bottom: 12px;
  border: 1px solid #bfd0f8;
  border-left: 5px solid var(--own);
  border-radius: 10px;
  padding: 10px 12px;
  background: #eef4ff;
}

.start-guide strong {
  font-size: 0.92rem;
}

.start-guide span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.side-legend {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: -2px 0 12px;
}

.side-legend span {
  border-radius: 10px;
  padding: 7px 9px;
  color: white;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 900;
  line-height: 1.2;
}

.side-legend .own {
  background: var(--own);
}

.side-legend .opp {
  background: var(--opp);
}

.trial-guide {
  margin: 0;
  border: 1px solid #bbf7d0;
  border-radius: 10px;
  background: #f0fdf4;
}

.trial-guide-title {
  margin: 0;
  padding: 10px 12px 0;
  color: #166534;
  font-size: 0.84rem;
  font-weight: 900;
}

.trial-guide div {
  display: grid;
  gap: 8px;
  padding: 8px 12px 12px;
}

.trial-guide p,
.trial-guide ol {
  margin: 0;
  color: #14532d;
  font-size: 0.76rem;
  font-weight: 800;
  line-height: 1.55;
}

.trial-guide ol {
  padding-left: 20px;
}

.menu-practice {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  padding: 10px;
  background: #f8fbff;
}

.menu-practice div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.menu-practice strong {
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 950;
  line-height: 1.35;
}

.menu-practice span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  line-height: 1.45;
}

.menu-practice .action-button {
  min-height: 42px;
  white-space: nowrap;
}

.match-info {
  margin: -2px 0 12px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  line-height: 1.45;
}

.live-scorebar {
  position: sticky;
  top: 0;
  z-index: 15;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 4px;
  align-items: stretch;
  margin: 0 -2px 10px;
  padding: 4px 2px;
  background: rgba(244, 246, 241, 0.94);
  backdrop-filter: blur(12px);
}

body.match-point .live-scorebar {
  border-radius: 10px;
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.18);
}

.match-alert {
  display: grid;
  gap: 3px;
  margin: -2px 0 10px;
  border: 2px solid #dc2626;
  border-radius: 10px;
  padding: 10px 12px;
  background: #fff1f2;
  color: #7f1d1d;
  box-shadow: 0 8px 20px rgba(220, 38, 38, 0.12);
}

.match-alert strong {
  font-size: 0.98rem;
  font-weight: 900;
  line-height: 1.25;
}

.match-alert span {
  color: #991b1b;
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1.45;
}

.live-meta,
.live-score-table {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.live-meta {
  display: grid;
  align-items: center;
  align-content: center;
  gap: 2px;
  min-width: 0;
  padding: 5px 4px;
  text-align: center;
}

.live-meta strong {
  font-size: 0.82rem;
  font-weight: 900;
  line-height: 1.15;
}

.live-meta span {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-score-table {
  display: grid;
  grid-template-columns: 28px minmax(50px, 0.85fr) minmax(68px, 1.15fr);
  overflow: hidden;
}

.live-score-table > * {
  min-width: 0;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.live-score-table > *:nth-child(-n + 3) {
  border-top: 0;
}

.live-score-table > *:nth-child(3n + 1) {
  border-left: 0;
}

.score-corner {
  background: #f8fafc;
}

.score-head {
  display: grid;
  place-items: center;
  min-height: 18px;
  background: #f1f5f9;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 900;
}

.point-head {
  color: var(--ink);
}

.score-label {
  display: grid;
  place-items: center;
  color: white;
  font-size: 0.86rem;
  font-weight: 900;
}

.score-label.own {
  background: var(--own);
}

.score-label.opp {
  background: var(--opp);
}

.score-cell {
  display: grid;
  place-items: center;
  min-height: 32px;
  font-size: clamp(1.32rem, 5.7vw, 1.7rem);
  font-weight: 900;
  line-height: 1;
}

.score-cell.games {
  background: #f8fafc;
}

.score-cell.points {
  background: #fff;
}

.score-cell.own {
  color: #1d4ed8;
  background: var(--own-soft);
}

.score-cell.opp {
  color: #b91c1c;
  background: var(--opp-soft);
}

.score-label.finished-winner,
.score-cell.finished-winner {
  box-shadow: inset 0 0 0 2px currentColor;
}

.score-label.finished-loser,
.score-cell.finished-loser {
  opacity: 0.72;
}

.scoreboard {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 8px;
  align-items: stretch;
  margin-bottom: 12px;
}

body:has(.tab[data-tab="analysis"].active) .scoreboard,
body:has(.tab[data-tab="history"].active) .scoreboard {
  display: none;
}

#analysisPanel .opponent-view > strong,
#analysisPanel .action-plan > strong,
#analysisPanel .score-quality > strong,
#analysisPanel .chart-block > h2,
#analysisPanel .analysis-save > .action-button {
  font-size: 0.94rem;
  line-height: 1.35;
}

#analysisPanel .chart-block > h2 {
  margin: 0 0 7px;
  font-weight: 950;
}

body:has(.tab[data-tab="analysis"].active) .team input,
body:has(.tab[data-tab="history"].active) .team input {
  pointer-events: none;
}

.team,
.match-state,
.court-card,
.panel,
.chart-block {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 14px;
  box-shadow: var(--shadow-card);
}

.team {
  min-width: 0;
  padding: 10px;
}

.team-a {
  border-color: #bfdbfe;
  border-left: 5px solid var(--own);
  background: var(--own-soft);
}

.team-b {
  border-color: #fecaca;
  border-left: 5px solid var(--opp);
  background: var(--opp-soft);
}

.team.finished-winner {
  position: relative;
  border-width: 2px;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.12);
}

.team.finished-winner::after {
  content: "勝ち";
  position: absolute;
  top: 8px;
  right: 8px;
  border-radius: 999px;
  padding: 3px 9px;
  background: var(--ink);
  color: white;
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1.15;
}

.team.finished-loser {
  opacity: 0.72;
}

.team label {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.team input {
  width: 100%;
  border: 0;
  border-bottom: 1px solid transparent;
  padding: 4px 0;
  background: transparent;
  color: var(--ink);
  font-weight: 800;
}

.team input:focus {
  outline: 0;
  border-color: var(--line);
}

.team strong {
  display: inline-block;
  min-width: 28px;
  margin-top: 4px;
  font-size: 2rem;
}

.team-a strong,
.team-a input {
  color: #1d4ed8;
}

.team-b strong,
.team-b input {
  color: #b91c1c;
}

.team span {
  float: right;
  min-width: 36px;
  margin-top: 13px;
  border-radius: 8px;
  padding: 5px 8px;
  background: var(--soft);
  text-align: center;
  font-weight: 800;
}

.team-b span {
  background: #fee2e2;
}

#recordStart:focus {
  outline: 3px solid rgba(37, 99, 235, 0.28);
  outline-offset: 3px;
}

.segmented button[data-server="A"].active,
#playerControl button[data-player^="A"].active,
#playerControl button[data-player="A選手"].active {
  background: var(--own);
  color: white;
}

.segmented button[data-server="B"].active,
#playerControl button[data-player^="B"].active,
#playerControl button[data-player="B選手"].active {
  background: var(--opp);
  color: white;
}

.match-state {
  width: 74px;
  display: grid;
  place-items: center;
  padding: 8px;
  text-align: center;
}

.match-state span {
  font-size: 1.02rem;
  font-weight: 950;
  line-height: 1.1;
  word-break: keep-all;
  white-space: normal;
}

.match-state .finish-label {
  display: block;
}

.match-state .finish-label {
  font-size: 0.86rem;
  letter-spacing: 0;
}

.match-state small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1.15;
  word-break: keep-all;
  white-space: nowrap;
}

.court-card {
  padding: 10px;
  margin-bottom: 12px;
}

.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.section-title strong {
  font-size: 0.9rem;
}

.section-title span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
}

.half-court {
  position: relative;
  display: grid;
  grid-template-columns: 46px 1fr 46px;
  grid-template-rows: 34px auto 36px;
  gap: 4px;
}

.court {
  --play-x: 0%;
  --play-w: 100%;
  --service-side-x: 12.5%;
  --service-side-w: 75%;
  --service-y: 46.15%;
  position: relative;
  grid-column: 2;
  grid-row: 2;
  aspect-ratio: 10.97 / 11.885;
  min-height: 0;
  padding: 10px;
  overflow: hidden;
  border: 4px solid #f8fafc;
  background:
    radial-gradient(circle at 50% 65%, rgba(255,255,255,.08), transparent 34%),
    #2f8b78;
  border-radius: 8px;
}

.court.singles-court {
  --play-x: 12.5%;
  --play-w: 75%;
}

.court-lines,
.court-zones {
  position: absolute;
  inset: 10px;
}

.court-lines {
  z-index: 1;
  pointer-events: none;
}

.court.singles-court::before,
.court.singles-court::after {
  content: "";
  position: absolute;
  top: 10px;
  bottom: 10px;
  width: calc(12.5% - 10px);
  background: rgba(18, 59, 53, 0.18);
  z-index: 1;
  pointer-events: none;
}

.court.singles-court::before {
  left: 10px;
}

.court.singles-court::after {
  right: 10px;
}

.court-line {
  position: absolute;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 0 0 1px rgba(18, 59, 53, 0.18);
}

.baseline {
  left: var(--play-x);
  top: 0;
  width: var(--play-w);
  height: 3px;
}

.doubles-left-line,
.doubles-right-line {
  top: 0;
  width: 3px;
  height: 100%;
}

.doubles-left-line {
  left: 0;
}

.doubles-right-line {
  right: 0;
}

.court.doubles-court .doubles-left-line,
.court.doubles-court .doubles-right-line {
  display: none;
}

.court.singles-court .doubles-left-line,
.court.singles-court .doubles-right-line {
  opacity: 0.42;
}

.left-line {
  left: var(--play-x);
  top: 0;
  width: 3px;
  height: 100%;
}

.right-line {
  left: calc(var(--play-x) + var(--play-w));
  top: 0;
  width: 3px;
  height: 100%;
  transform: translateX(-3px);
}

.service-line {
  left: var(--service-side-x);
  top: var(--service-y);
  width: var(--service-side-w);
  height: 3px;
}

.service-left-line,
.service-right-line {
  top: 0;
  width: 3px;
  height: 100%;
  opacity: 0.72;
}

.service-left-line {
  left: var(--service-side-x);
}

.service-right-line {
  left: calc(var(--service-side-x) + var(--service-side-w));
  transform: translateX(-3px);
}

.center-service-line {
  left: 50%;
  top: var(--service-y);
  width: 3px;
  height: calc(100% - var(--service-y));
  transform: translateX(-1.5px);
}

.net-line {
  left: var(--play-x);
  bottom: 0;
  width: var(--play-w);
  height: 4px;
  background: rgba(241, 245, 249, 0.96);
}

.court-zones {
  left: calc(10px + var(--play-x));
  right: calc(10px + (100% - var(--play-x) - var(--play-w)));
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: 46.15fr 21.925fr 31.925fr;
  gap: 6px;
  z-index: 2;
}

.court-zones button,
.out-zone {
  min-height: 56px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  background: rgba(255, 255, 255, 0.84);
  color: #123b35;
  font-size: 0.8rem;
  font-weight: 800;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.45);
}

.out-zone {
  min-height: 38px;
  border-color: #fed7aa;
  background: #fff7ed;
  color: #7c2d12;
}

.out-back {
  grid-column: 2;
  grid-row: 1;
}

.out-left {
  grid-column: 1;
  grid-row: 2;
  writing-mode: vertical-rl;
}

.out-right {
  grid-column: 3;
  grid-row: 2;
  writing-mode: vertical-rl;
}

.out-net {
  grid-column: 2;
  grid-row: 3;
  background: #eef2f7;
  color: #334155;
}

.half-court button.active {
  border-color: #eab308;
  background: rgba(250, 204, 21, 0.9);
  color: #332600;
  box-shadow: inset 0 0 0 2px rgba(51, 38, 0, 0.18);
}

.tabs {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  width: min(100%, var(--app-max));
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  background: rgba(244, 246, 241, 0.96);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(12px);
  box-shadow: 0 -10px 24px rgba(23, 32, 51, 0.08);
}

.tab {
  min-height: 48px;
  border-radius: 14px;
  background: #edf1e9;
  color: var(--muted);
  font-weight: 800;
}

.tab.active {
  background: linear-gradient(135deg, var(--ink), #26364f);
  color: white;
  box-shadow: 0 8px 18px rgba(23, 32, 51, 0.16);
}

.panel {
  display: none;
  padding: 12px;
  scroll-margin-top: calc(var(--sticky-score-height) + 10px);
}

.panel.active {
  display: block;
}

.winner-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(8px, 2.5vw, 10px);
  margin-bottom: 14px;
}

.point-button {
  min-height: clamp(84px, 21vw, 100px);
  border-radius: 10px;
  color: white;
  font-size: clamp(1.06rem, 4.5vw, 1.24rem);
  font-weight: 900;
  line-height: 1.35;
  overflow-wrap: anywhere;
  padding: 8px;
}

.point-button.own {
  background: var(--own);
}

.point-button.opp {
  background: var(--opp);
}

.control-group {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.howto-card {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fbfcff;
}

.howto-card strong {
  font-size: 0.86rem;
}

.howto-card ol {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.55;
}

.howto-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.55;
}


.record-mode-switch {
  display: grid;
  gap: 7px;
  margin-bottom: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px;
  background: #fff;
}

.record-mode-switch > span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.simple-record-mode .advanced-record {
  display: none;
}

.detail-record-mode .simple-record-group {
  display: none;
}

.simple-outcome-control {
  display: grid;
  gap: 10px;
}

.simple-outcome-section {
  display: grid;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: #ffffff;
}

.simple-outcome-section strong {
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 950;
}

.simple-outcome-section div {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.simple-outcome-control button {
  position: relative;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 2px;
  min-height: 58px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 6px 4px;
  color: var(--ink);
  font-weight: 900;
  line-height: 1.12;
  word-break: keep-all;
  line-break: strict;
  white-space: normal;
}

.simple-outcome-control button::before {
  position: absolute;
  top: 5px;
  left: 5px;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.82);
  color: currentColor;
  font-size: 0.78rem;
  font-weight: 950;
  line-height: 1;
}

.simple-outcome-control .outcome-score::before {
  content: "+";
}

.simple-outcome-control .outcome-miss::before {
  content: "-";
}

.simple-outcome-control button span {
  font-size: clamp(0.88rem, 3.8vw, 1rem);
}

.simple-outcome-control button small {
  color: currentColor;
  font-size: clamp(0.66rem, 3vw, 0.76rem);
  font-weight: 850;
  opacity: 0.82;
}

.simple-outcome-control .outcome-score {
  background: #eff6ff;
  border-color: #bfdbfe;
}

.simple-outcome-control .outcome-miss {
  background: #fff1f2;
  border-color: #fecdd3;
}

.simple-outcome-control .outcome-score.active {
  background: var(--own);
  border-color: var(--own);
  color: #ffffff;
}

.simple-outcome-control .outcome-miss.active {
  background: var(--opp);
  border-color: var(--opp);
  color: #ffffff;
}

.record-top-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.25fr);
  gap: 8px;
  align-items: start;
  border: 1px solid #dbeafe;
  border-left: 4px solid rgba(37, 99, 235, 0.42);
  border-radius: 10px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.78);
}

.record-top-grid .control-group {
  min-width: 0;
}

.player-record-group,
.simple-record-group {
  border: 1px solid #dbeafe;
  border-left: 4px solid rgba(37, 99, 235, 0.42);
  border-radius: 10px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.78);
}

.record-top-grid,
.player-record-group,
.simple-record-group,
.rally-record-group {
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.03);
}

.record-flow {
  display: grid;
  gap: clamp(9px, 2.6vw, 12px);
  border: 1px solid #bfdbfe;
  border-top: 5px solid var(--own);
  border-radius: 8px;
  padding: clamp(9px, 2.8vw, 12px);
  scroll-margin-top: calc(var(--sticky-score-height) + 14px);
  background: #f8fbff;
}

.record-flow .control-group,
.record-flow .save-point-section {
  margin-bottom: 0;
}

.record-extra {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  overflow: hidden;
}

.record-extra summary {
  cursor: pointer;
  padding: 10px 12px;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 900;
  line-height: 1.35;
}

.record-extra[open] summary {
  border-bottom: 1px solid var(--line);
}

.record-extra-body {
  display: grid;
  gap: 8px;
  padding: 10px;
}

.record-auto-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
  line-height: 1.45;
}

.winner-note {
  margin: 4px 0 10px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
  line-height: 1.45;
}

.save-point-section {
  position: sticky;
  bottom: calc(var(--bottom-tabs-height) + env(safe-area-inset-bottom) + 8px);
  z-index: 12;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  padding: 10px;
  background: rgba(248, 251, 255, 0.97);
  box-shadow: 0 -8px 18px rgba(15, 23, 42, 0.08);
}

.record-support-note {
  margin: 10px 2px 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.55;
}

.rally-note,
.rally-auto-preview {
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  line-height: 1.45;
}

.rally-record-group {
  border: 1px solid #dbeafe;
  border-left: 4px solid rgba(37, 99, 235, 0.42);
  border-radius: 10px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.78);
}

.rally-length-control button {
  min-height: 54px;
}


.detail-panel {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fbfcff;
}

.detail-panel summary {
  cursor: pointer;
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 900;
}

.detail-panel[open] summary {
  margin-bottom: 12px;
}

.analysis-details {
  margin-bottom: 12px;
}

.analysis-details .chart-block {
  margin-top: 10px;
}

.control-group > span,
.memo-label,
.control-grid label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.segmented,
.chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.segmented button,
.chips.compact button {
  flex: 1 1 0;
}

.chip-section {
  display: grid;
  gap: 6px;
  width: 100%;
}

.chip-section + .chip-section {
  margin-top: 6px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
}

.chip-section strong,
.save-point-section > strong {
  color: var(--ink);
  font-size: 0.82rem;
}

.chip-section div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chips.compact button {
  min-width: min(64px, 100%);
}

.segmented button,
.chips button,
.secondary,
#startMatchButton {
  min-height: 44px;
  border-radius: 12px;
  padding: 0 clamp(9px, 2.8vw, 12px);
  background: #edf0ec;
  color: var(--ink);
  font-weight: 800;
  line-height: 1.2;
  word-break: keep-all;
  line-break: strict;
  overflow-wrap: anywhere;
  white-space: normal;
}

.action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  border-radius: 12px;
  padding: 0 clamp(9px, 2.8vw, 12px);
  font-weight: 900;
  line-height: 1.2;
  text-align: center;
  word-break: keep-all;
  line-break: strict;
  white-space: normal;
}

.action-button::before {
  display: inline-grid;
  place-items: center;
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.22);
  color: currentColor;
  font-size: 0.78rem;
  font-weight: 950;
  line-height: 1;
}

.action-new::before {
  content: "+";
}

.action-preview::before {
  content: "見";
}

.action-share::before {
  content: "↗";
}

.action-archive::before {
  content: "保";
}

.action-history::before {
  content: "試";
}

.action-reset::before {
  content: "↺";
}

.action-edit::before {
  content: "✎";
}

.action-export::before {
  content: "CSV";
  font-size: 0.58rem;
}

.action-backup::before {
  content: "渡";
}

.action-restore::before {
  content: "読";
}

.action-save::before {
  content: "保";
}

.action-undo::before {
  content: "↩";
}

.action-delete::before {
  content: "消";
}

.action-close::before {
  content: "×";
}

.action-start::before {
  content: "始";
}

.action-practice::before {
  content: "試";
}

.action-save,
.action-preview,
.action-share,
.action-archive,
.action-history,
.action-edit {
  background: var(--accent);
  color: white;
}

.action-export {
  background: #374151;
  color: white;
}

.action-backup,
.action-restore {
  background: #0f766e;
  color: white;
}

.action-new,
.action-practice,
.action-start,
#startMatchButton.action-start {
  background: var(--own);
  color: white;
}

.secondary.action-button {
  background: #edf0ec;
  color: var(--ink);
}

.secondary.action-button::before {
  background: rgba(31, 41, 55, 0.08);
}

.segmented button.active,
.chips button.active {
  background: linear-gradient(135deg, var(--accent), #0b625c);
  color: white;
  box-shadow: 0 6px 14px rgba(15, 118, 110, 0.16);
}

#playerControl button {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 1px;
  min-width: 0;
  overflow-wrap: normal;
  word-break: keep-all;
  line-break: strict;
}

#playerControl {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
}

#playerControl button {
  grid-column: span 1;
  min-height: 56px;
  padding-inline: 4px;
  font-size: clamp(0.68rem, 3vw, 0.84rem);
  font-weight: 900;
}

#playerControl .player-unknown {
  grid-column: 1 / -1;
  min-height: 42px;
  padding-inline: 10px;
  color: var(--muted);
  font-size: 0.84rem;
}

#playerControl .player-unknown.active {
  color: white;
}

#playerControl .player-word {
  display: block;
  white-space: nowrap;
}

.player-save-preview {
  margin: 6px 0 0;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-size: clamp(0.72rem, 3vw, 0.84rem);
  font-weight: 800;
  line-height: 1.55;
}

.player-save-preview.manual {
  border-color: #bfdbfe;
  background: var(--own-soft);
  color: var(--ink);
}

.player-save-preview.auto {
  border-color: #99f6e4;
  background: #ecfdf5;
  color: #115e59;
}

.player-save-preview b {
  white-space: nowrap;
}

.service-player-group {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.62);
}

.player-mini-control {
  display: grid;
  grid-template-columns: minmax(58px, 0.8fr) repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.player-mini-control button {
  min-width: 0;
  min-height: 42px;
  padding-inline: 6px;
  font-size: clamp(0.72rem, 3.2vw, 0.84rem);
}

.player-mini-control .player-word {
  display: inline-block;
  white-space: nowrap;
}

.serve-receive-cards {
  display: grid;
  gap: 9px;
  margin-top: 10px;
}

.sr-side-group {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px;
  background: #ffffff;
}

.sr-side-group.own-side {
  border-color: #bfdbfe;
  background: #eff6ff;
}

.sr-side-group.opp-side {
  border-color: #fecaca;
  background: #fff1f2;
}

.sr-side-group h3 {
  margin: 0;
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 950;
}

.sr-card-grid {
  display: grid;
  gap: 8px;
}

.pm-side-group {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px;
  background: #ffffff;
}

.pm-side-group.own-side {
  border-color: #bfdbfe;
  background: #eff6ff;
}

.pm-side-group.opp-side {
  border-color: #fecaca;
  background: #fff1f2;
}

.pm-side-group h3 {
  margin: 0;
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 950;
}

.pm-card-grid {
  display: grid;
  gap: 8px;
}

.pm-detail-grid {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.pm-detail-grid small {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
}

.sr-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
}

.sr-card.own {
  border-color: #bfdbfe;
  background: var(--own-soft);
}

.sr-card.opp {
  border-color: #fecaca;
  background: var(--opp-soft);
}

.sr-card-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
  font-size: 0.82rem;
  font-weight: 900;
}

.sr-card-head strong,
.sr-card-head span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.sr-card-score {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  color: var(--ink);
  white-space: nowrap;
}

.sr-card-score .plus {
  color: var(--own);
}

.sr-card-score .minus {
  color: var(--opp);
}

.sr-total-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 92px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.8);
  background: var(--ink);
  color: #fff;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.1);
  line-height: 1;
  text-align: center;
  white-space: nowrap;
}

.sr-card.own .sr-card-head {
  color: var(--own);
}

.sr-card.opp .sr-card-head {
  color: var(--opp);
}

.sr-card.own .sr-total-badge {
  background: var(--own);
  color: #fff;
}

.sr-card.opp .sr-total-badge {
  background: var(--opp);
  color: #fff;
}

.sr-metrics {
  display: grid;
  gap: 7px;
}

.sr-metric-row {
  display: grid;
  grid-template-columns: 62px repeat(3, minmax(0, 1fr));
  gap: 6px;
  align-items: stretch;
}

.sr-metric-row > strong {
  display: grid;
  place-items: center;
  min-width: 0;
  border-radius: 8px;
  padding: 6px 4px;
  background: rgba(15, 23, 42, 0.06);
  color: var(--ink);
  font-size: 0.74rem;
  font-weight: 950;
  line-height: 1.2;
  text-align: center;
  word-break: keep-all;
  line-break: strict;
}

.sr-metric {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 3px;
  min-width: 0;
  min-height: 54px;
  border-radius: 8px;
  padding: 7px 5px;
  background: rgba(255, 255, 255, 0.82);
  text-align: center;
}

.sr-metric b {
  font-size: clamp(0.82rem, 3.4vw, 0.96rem);
  line-height: 1;
  white-space: nowrap;
}

.sr-metric small {
  color: var(--muted);
  font-size: clamp(0.56rem, 2.6vw, 0.66rem);
  font-weight: 900;
  line-height: 1.2;
  word-break: keep-all;
  line-break: strict;
}

.control-grid {
  display: grid;
  grid-template-columns: 1fr 92px;
  gap: 10px;
  margin-bottom: 12px;
}

.control-grid label,
.memo-label,
.dialog-content label {
  display: grid;
  gap: 6px;
}

.toggle {
  grid-column: 1 / -1;
  display: flex !important;
  align-items: center;
  gap: 8px;
}

select,
input,
textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: var(--panel);
  color: var(--ink);
}

textarea {
  resize: vertical;
}

.rule-note {
  min-height: 44px;
  margin-top: 10px;
  border-radius: 8px;
  padding: 9px 10px;
  background: #fff7ed;
  color: #7c2d12;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.45;
}

.rule-note:empty {
  display: none;
}

.save-point-section {
  display: grid;
  gap: 8px;
  border: 2px solid #bfd0f8;
  border-radius: 14px;
  padding: 10px;
  background: #f8fbff;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}

.action-row .action-button {
  min-width: min(100%, 112px);
}

.environment-badge {
  display: grid;
  place-items: center;
  margin: -4px 0 10px;
  border: 2px solid #f97316;
  border-radius: 8px;
  padding: 8px 10px;
  background: #fff7ed;
  color: #9a3412;
  font-size: 0.88rem;
  font-weight: 950;
  letter-spacing: 0;
}

.practice-badge {
  position: sticky;
  top: 4px;
  z-index: 16;
  display: inline-grid;
  place-items: center;
  width: fit-content;
  margin: 0 0 10px;
  border: 1px solid #bfdbfe;
  border-left: 5px solid var(--own);
  border-radius: 999px;
  padding: 6px 12px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 0.78rem;
  font-weight: 950;
  line-height: 1.2;
}

body.practice-match {
  --sticky-score-height: 112px;
}

body.practice-match .live-scorebar {
  top: 40px;
}

.undo-note {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.4;
  text-align: right;
}

#startMatchButton {
  background: var(--own);
  color: white;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.analysis-summary {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}

.analysis-summary article {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--panel);
}

.analysis-summary span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
}

.analysis-summary strong {
  display: block;
  margin-top: 6px;
  color: var(--ink);
  font-size: 1.28rem;
}

.analysis-summary .metric-neutral {
  border-color: var(--line);
  background: var(--panel);
}

.analysis-summary .metric-own {
  border-color: #bfdbfe;
  background: var(--own-soft);
}

.analysis-summary .metric-own span {
  color: var(--own);
}

.analysis-summary .metric-opp {
  border-color: #fecaca;
  background: var(--opp-soft);
}

.analysis-summary .metric-opp span {
  color: var(--opp);
}


.analysis-view-switch {
  margin-bottom: 8px;
}

.analysis-view-note {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  line-height: 1.5;
}

.analysis-section {
  display: none;
  gap: 10px;
}

body.analysis-overall-mode #analysisPanel .analysis-overall-section,
body.analysis-player-mode #analysisPanel .analysis-player-section {
  display: grid;
}


.action-plan {
  margin-bottom: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--panel);
}

.action-plan strong {
  display: block;
  color: var(--ink);
  font-size: 0.94rem;
}

.action-plan p {
  margin: 5px 0 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.5;
}

.action-plan-list {
  display: grid;
  gap: 7px;
}

.action-plan-list article {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  border-radius: 8px;
  padding: 8px;
  background: var(--panel);
}

.action-plan-list article > span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #e2e8f0;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 1000;
}

.action-plan-list article.own > span {
  background: var(--own);
  color: white;
}

.action-plan-list article.opp > span {
  background: var(--opp);
  color: white;
}

.action-plan-list b,
.action-plan-list small {
  display: block;
  line-height: 1.45;
}

.action-plan-list b {
  color: var(--ink);
  font-size: 0.82rem;
}

.action-plan-list small {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.score-quality {
  margin-bottom: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--panel);
}

.score-quality strong {
  display: block;
  color: var(--ink);
  font-size: 0.94rem;
}

.score-quality p {
  margin: 5px 0 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.5;
}

.quality-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.quality-grid span {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: #fbfcfa;
  color: var(--ink);
  text-align: center;
  font-size: 0.76rem;
  font-weight: 900;
}

.opponent-view {
  margin-bottom: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--panel);
}

.opponent-view strong {
  display: block;
  color: var(--ink);
  font-size: 0.94rem;
}

.opponent-view p,
.opponent-view ul {
  margin: 5px 0 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.5;
}

.opponent-view ul {
  display: grid;
  gap: 7px;
  padding-left: 18px;
}

.insight-side-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}

.insight-side-grid article {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px;
  background: var(--panel);
}

.insight-side-grid article.own-side {
  border-color: #bfdbfe;
  background: var(--own-soft);
}

.insight-side-grid article.opp-side {
  border-color: #fecaca;
  background: var(--opp-soft);
}

.insight-side-grid b {
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 950;
}

.insight-side-grid ul {
  margin: 0;
  padding-left: 17px;
  color: var(--ink);
  font-size: 0.74rem;
  line-height: 1.48;
}

.trend-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.trend-grid span {
  border-radius: 8px;
  padding: 8px 6px;
  background: var(--panel);
  color: #7f1d1d;
  text-align: center;
  font-size: 0.68rem;
  font-weight: 900;
}

.trend-grid b {
  display: block;
  margin-bottom: 3px;
  font-size: 0.95rem;
}

.analysis-save {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}

.analysis-save .action-button {
  justify-self: start;
}

.analysis-save-note {
  margin: -2px 0 0;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  line-height: 1.5;
}

.analysis-memo-list {
  display: grid;
  gap: 8px;
}

.analysis-memo-list p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.analysis-memo-list article {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px;
  background: var(--panel);
}

.analysis-memo-list strong {
  display: block;
  margin-bottom: 5px;
  font-size: 0.76rem;
}

.analysis-memo-list ul,
.analysis-memo-list ol {
  display: grid;
  gap: 4px;
  margin: 4px 0 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  line-height: 1.45;
}

.stat {
  min-height: 76px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fbfcfa;
}

.stat span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.stat strong {
  display: block;
  margin-top: 7px;
  font-size: 1.45rem;
}

.stat small {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.45;
}

.stat-guide-block .stats-grid {
  margin-top: 10px;
  margin-bottom: 0;
}

.momentum-list {
  display: grid;
  gap: 10px;
}

.momentum-card {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-left: 5px solid #cbd5e1;
  border-radius: 8px;
  padding: 11px 12px;
  background: var(--panel);
}

.momentum-card.own {
  border-left-color: var(--own);
}

.momentum-card.opp {
  border-left-color: var(--opp);
}

.momentum-card span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 900;
  line-height: 1.35;
}

.momentum-card strong {
  color: var(--ink);
  font-size: 1.12rem;
  font-weight: 950;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.momentum-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  line-height: 1.5;
}

.momentum-card small {
  display: block;
  border-top: 1px dashed var(--line);
  padding-top: 6px;
  color: var(--ink);
  font-size: 0.74rem;
  font-weight: 900;
  line-height: 1.45;
  overflow-wrap: anywhere;
}


.chart-block {
  padding: 12px;
  margin-top: 10px;
}

.chart-block.emphasis {
  border-color: var(--line);
  background: var(--panel);
}

.chart-block.detail-analysis {
  background: #fbfcfa;
}

.bars {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(108px, 1.1fr) 1fr 32px;
  gap: 8px;
  align-items: center;
  font-size: 0.78rem;
  font-weight: 800;
}

.bar-row span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.bar-track {
  height: 11px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7ebe6;
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--own);
}

.bar-row.opp .bar-fill {
  background: var(--opp);
}

.bar-row.own b,
.bar-row.own span {
  color: #1d4ed8;
}

.bar-row.opp b,
.bar-row.opp span {
  color: #b91c1c;
}

.pm-card {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--panel);
  font-size: 0.82rem;
  font-weight: 900;
}

.pm-card.own {
  border-color: #bfdbfe;
  background: var(--own-soft);
}

.pm-card.opp {
  border-color: #fecaca;
  background: var(--opp-soft);
}

.pm-card-head,
.pm-score-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.pm-card-head strong,
.pm-card-head span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.pm-card-head span,
.pm-score-row b {
  border-radius: 7px;
  padding: 6px 8px;
  line-height: 1;
  text-align: center;
}

.pm-total-badge {
  min-width: 92px;
  border: 2px solid rgba(255, 255, 255, 0.8);
  background: var(--ink);
  color: #fff;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.1);
  font-size: 0.9rem;
  font-weight: 1000;
  white-space: nowrap;
}

.pm-card-head span {
  background: var(--ink);
  color: #fff;
}

.pm-card.own .pm-card-head span {
  background: var(--own);
  color: white;
}

.pm-card.opp .pm-card-head span {
  background: var(--opp);
  color: white;
}

.pm-score-row {
  justify-content: flex-start;
}

.pm-score-row .plus {
  background: #dbeafe;
  color: var(--own);
}

.pm-score-row .minus {
  background: #fee2e2;
  color: var(--opp);
}

.pm-outcomes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pm-outcomes span {
  min-width: 0;
  border-radius: 999px;
  padding: 6px 8px;
  background: rgba(255, 255, 255, 0.8);
  color: var(--ink);
  overflow-wrap: anywhere;
  line-height: 1.2;
}

.pm-outcomes b {
  color: inherit;
}

.pm-outcomes .muted-chip {
  color: var(--muted);
}

.pm-review {
  border-top: 1px dashed rgba(15, 23, 42, 0.16);
  padding-top: 8px;
}

.pm-review small {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 0.72rem;
}

.pm-review ul {
  display: grid;
  gap: 5px;
  margin: 0;
  padding-left: 18px;
  color: var(--ink);
  font-size: 0.76rem;
  line-height: 1.48;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.history-filter {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: var(--panel);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.history-filter span {
  grid-column: 1 / -1;
  color: var(--ink);
  font-size: 0.76rem;
  line-height: 1.35;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.history-filter select {
  min-height: 38px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: var(--panel);
  color: var(--ink);
  font-weight: 900;
}

.point-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.history-game {
  list-style: none;
}

.history-game details {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  overflow: hidden;
}

.history-game summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 44px;
  padding: 10px;
  cursor: pointer;
  color: var(--ink);
  font-weight: 900;
}

.history-game summary strong {
  color: var(--ink);
  font-size: 0.98rem;
}

.history-game summary span {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.history-game-list {
  display: grid;
  gap: 8px;
  margin: 0;
  border-top: 1px solid var(--line);
  padding: 8px;
  list-style: none;
}

.history-item {
  display: grid;
  gap: 7px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--own);
  border-radius: 8px;
  padding: 10px;
  background: var(--panel);
}

.history-item.own {
  border-left-color: var(--own);
  background: #f8fbff;
}

.history-item.opp {
  border-left-color: var(--opp);
  background: #fff8f8;
}

.history-empty {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 14px 10px;
  background: var(--panel);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 900;
  text-align: center;
}

.history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.history-body {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.history-number {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 4px 8px;
  background: var(--own);
  color: white;
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1.1;
}

.history-item.opp .history-number {
  background: var(--opp);
}

.history-head strong,
.history-main,
.history-player {
  min-width: 0;
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 900;
  line-height: 1.35;
  word-break: keep-all;
  line-break: strict;
  overflow-wrap: anywhere;
  white-space: normal;
}

.history-main {
  font-size: 0.92rem;
}

.history-item.own .history-main,
.history-item.own .history-player,
.history-item.own .history-head strong {
  color: #1d4ed8;
}

.history-item.opp .history-main,
.history-item.opp .history-player,
.history-item.opp .history-head strong {
  color: #b91c1c;
}

.history-player {
  font-size: 0.8rem;
}

.history-score {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1.35;
}

.history-item small {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  line-height: 1.45;
}

dialog {
  width: min(92vw, 420px);
  max-height: min(86vh, 760px);
  border: 0;
  border-radius: 8px;
  padding: 0;
}

dialog::backdrop {
  background: rgba(10, 16, 14, 0.48);
}

.dialog-content {
  display: grid;
  gap: 12px;
  padding: clamp(12px, 3.6vw, 16px);
  max-height: min(86vh, 760px);
  max-height: min(86svh, 760px);
  overflow: auto;
  overscroll-behavior: contain;
  scroll-padding-bottom: calc(88px + env(safe-area-inset-bottom));
  padding-bottom: calc(14px + env(safe-area-inset-bottom));
}


.match-dialog-section {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fbfcff;
}

.match-dialog-section h3 {
  margin: 0;
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 900;
}

.match-dialog-optional {
  background: #fcfdfa;
}

.match-dialog-optional summary {
  cursor: pointer;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 900;
  min-height: 38px;
  display: flex;
  align-items: center;
}

.match-dialog-extra-fields {
  display: grid;
  gap: 10px;
  padding-top: 8px;
}

.dialog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 8px;
}

.dialog-sticky-actions {
  position: sticky;
  bottom: 0;
  z-index: 3;
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr) minmax(0, 0.9fr);
  margin: 4px calc(clamp(12px, 3.6vw, 16px) * -1) calc(clamp(12px, 3.6vw, 16px) * -1);
  padding: 8px clamp(12px, 3.6vw, 16px) calc(10px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
}

.dialog-sticky-actions .action-button {
  min-width: 0;
  min-height: 42px;
  padding-inline: 8px;
  font-size: clamp(0.78rem, 3.4vw, 0.9rem);
  opacity: 0.96;
  white-space: nowrap;
}

.dialog-sticky-actions .action-button::before {
  display: none;
}

.menu-dialog {
  gap: 10px;
}

.menu-dialog h2 {
  margin-bottom: 2px;
}

.menu-dialog button {
  min-height: 50px;
  border-radius: 8px;
  padding: 0 14px;
  font-weight: 900;
  text-align: left;
}

.menu-dialog .action-button {
  justify-content: flex-start;
}

.menu-dialog .action-new {
  background: var(--own);
  color: white;
}

.admin-help {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.55;
}

.menu-note {
  margin: -4px 0 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
  line-height: 1.45;
}

.menu-help {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--soft);
}

.menu-help summary {
  cursor: pointer;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 900;
}

.menu-help-body {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.menu-dialog .action-history,
.menu-dialog .action-preview,
.menu-dialog .action-edit {
  background: #0f766e;
  color: white;
}

.menu-dialog .action-menu-main {
  background: var(--accent);
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.18);
}

.menu-dialog .action-export {
  background: #374151;
  color: white;
}

.menu-dialog .action-backup,
.menu-dialog .action-restore {
  background: #0f766e;
  color: white;
}

.admin-menu {
  display: grid;
  gap: 8px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 8px;
  background: #f8fafc;
}

.admin-menu summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
}

.admin-menu .action-button {
  margin-top: 8px;
}

.menu-dialog .secondary {
  background: #edf0ec;
  color: var(--ink);
}

#summaryImageDialog {
  width: min(96vw, 720px);
  max-width: 100vw;
  height: min(96dvh, 920px);
  height: min(96svh, 920px);
  max-height: min(96dvh, 920px);
  max-height: min(96svh, 920px);
  overflow: hidden;
}

.summary-dialog {
  grid-template-rows: auto auto auto auto auto minmax(0, 1fr) auto;
  gap: 10px;
  height: 100%;
  min-height: 0;
  max-height: none;
  overflow: hidden;
}

.summary-dialog p {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.5;
}

.summary-mode {
  grid-template-columns: 1fr 1fr;
}

.summary-name-mode {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.summary-name-mode button {
  min-height: 44px;
  padding-inline: 8px;
  font-size: clamp(0.76rem, 3.1vw, 0.9rem);
}

.summary-name-note[hidden],
.summary-name-mode[hidden] {
  display: none;
}

.summary-preview-frame {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7f8fb;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y pinch-zoom;
}

.summary-preview-frame img {
  display: block;
  flex: 0 0 auto;
  width: 100%;
  min-width: 100%;
  height: auto;
  max-width: none;
  max-height: none;
  object-fit: initial;
}

.summary-dialog .dialog-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 8px 0 calc(10px + env(safe-area-inset-bottom));
}

.summary-dialog .dialog-actions button {
  min-width: 0;
  min-height: 52px;
  padding-inline: 10px;
  font-size: clamp(0.9rem, 3.8vw, 1rem);
  white-space: nowrap;
}

.summary-dialog .dialog-actions .action-close {
  grid-column: 1 / -1;
  min-height: 46px;
}

@media (max-width: 640px) {
  #summaryImageDialog {
    inset: 0;
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;
    height: 100svh;
    max-height: 100dvh;
    max-height: 100svh;
    margin: 0;
    border-radius: 0;
  }

  .summary-dialog {
    gap: 6px;
    padding: calc(10px + env(safe-area-inset-top)) 10px calc(10px + env(safe-area-inset-bottom));
  }

  .summary-dialog h2 {
    margin: 0;
    font-size: 1.05rem;
    line-height: 1.25;
  }

  .summary-dialog > p {
    display: none;
  }

  .summary-mode button,
  .summary-name-mode button {
    min-height: 34px;
    padding-inline: 6px;
    font-size: 0.76rem;
  }

  .summary-preview-frame {
    width: calc(100% + 20px);
    margin-inline: -10px;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
  }

  .summary-dialog .dialog-actions {
    gap: 6px;
  }

  .summary-dialog .dialog-actions button {
    min-height: 44px;
    font-size: 0.9rem;
  }

  .summary-dialog .dialog-actions .action-close {
    min-height: 38px;
  }
}

.archive-dialog p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.5;
}

.archive-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(88px, 0.42fr) minmax(88px, 0.42fr);
  gap: 8px;
  align-items: end;
}

.archive-toolbar label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
}

.archive-toolbar input,
.archive-toolbar select {
  min-width: 0;
}

.archive-toolbar span {
  grid-column: 1 / -1;
  min-width: 48px;
  border-radius: 8px;
  padding: 10px 8px;
  background: var(--soft);
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 950;
  text-align: center;
}

.archive-storage {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.archive-list {
  display: grid;
  gap: 10px;
  max-height: min(54vh, 520px);
  overflow: auto;
}

.archive-list > p {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--soft);
}

.archive-item {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--panel);
}

.archive-item strong {
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 900;
  line-height: 1.35;
}

.archive-item span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  line-height: 1.35;
}

.archive-item div {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.9fr) minmax(0, 0.9fr);
  gap: 8px;
}

.archive-item .action-button {
  min-width: 0;
  min-height: 42px;
  padding: 8px 6px;
  font-size: 0.78rem;
  white-space: nowrap;
}

.archive-item .action-button::before {
  width: 24px;
  height: 24px;
  font-size: 0.7rem;
}

.app-footer {
  display: grid;
  gap: 3px;
  margin: 14px 0 0;
  color: var(--muted);
  text-align: center;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1.4;
}

.app-version {
  color: var(--ink);
  font-weight: 900;
}

.version-menu,
.transfer-menu,
.admin-menu {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--soft);
}

.version-menu summary,
.transfer-menu summary,
.admin-menu summary {
  cursor: pointer;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 900;
}

.version-menu dl {
  display: grid;
  gap: 8px;
  margin: 10px 0 0;
}

.version-menu div {
  display: grid;
  gap: 2px;
}

.version-menu dt {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
}

.version-menu dd {
  margin: 0;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.45;
}

.dialog-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
  gap: 8px;
  position: sticky;
  bottom: 0;
  z-index: 2;
  margin: 0 calc(clamp(12px, 3.6vw, 16px) * -1) calc(clamp(12px, 3.6vw, 16px) * -1);
  padding: 8px clamp(12px, 3.6vw, 16px) calc(10px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
}

.dialog-actions button {
  min-height: 48px;
  border-radius: 8px;
  padding: 0 12px;
  font-weight: 900;
}

.dialog-actions .secondary {
  background: #edf0ec;
  color: var(--ink);
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #0b1120;
    --panel: #111827;
    --ink: #e5e7eb;
    --muted: #a6b0c3;
    --line: #334155;
    --own-soft: #172554;
    --opp-soft: #43171c;
    --soft: #1e293b;
    --accent: #0f766e;
  }

  .icon-button {
    background: #e5e7eb;
    color: #0b1120;
  }

  .start-guide,
  .howto-card,
  .detail-panel,
  .menu-practice,
  .record-flow,
  .save-point-section,
  .chart-block.detail-analysis,
  .stat {
    background: #0f172a;
  }

  .start-guide {
    border-color: #1d4ed8;
  }

  .environment-badge {
    border-color: #fb923c;
    background: #431407;
    color: #fed7aa;
  }

  .practice-badge {
    border-color: #1d4ed8;
    background: #172554;
    color: #bfdbfe;
  }

  .trial-guide {
    border-color: #166534;
    background: #102016;
  }

  .trial-guide-title {
    color: #bbf7d0;
  }

  .trial-guide p,
  .trial-guide ol {
    color: #dcfce7;
  }

  .live-scorebar {
    background: rgba(11, 17, 32, 0.96);
  }

  .live-meta,
  .live-score-table,
  .quality-grid span,
  .archive-item,
  .history-filter,
  .history-game details,
  .analysis-memo-list article,
  .history-item {
    background: var(--panel);
  }

  .score-corner,
  .score-head,
  .score-cell.games,
  .score-cell.points {
    background: #0f172a;
  }

  .score-cell.own,
  .team-a,
  .history-item.own,
  .analysis-summary .metric-own,
  .chart-block.emphasis,
  .insight-side-grid article.own-side {
    border-color: #1d4ed8;
    background: var(--own-soft);
  }

  .score-cell.opp,
  .team-b,
  .history-item.opp,
  .analysis-summary .metric-opp,
  .opponent-view,
  .insight-side-grid article.opp-side {
    border-color: #991b1b;
    background: var(--opp-soft);
  }

  .score-cell.own,
  .team-a strong,
  .team-a input,
  .history-item.own .history-main,
  .history-item.own .history-player,
  .history-item.own .history-head strong,
  .analysis-summary .metric-own span,
  .bar-row.own b,
  .bar-row.own span,
  .pm-score-row .plus {
    color: #bfdbfe;
  }

  .score-cell.opp,
  .team-b strong,
  .team-b input,
  .history-item.opp .history-main,
  .history-item.opp .history-player,
  .history-item.opp .history-head strong,
  .analysis-summary .metric-opp span,
  .opponent-view strong,
  .opponent-view p,
  .opponent-view ul,
  .bar-row.opp b,
  .bar-row.opp span,
  .pm-score-row .minus {
    color: #fecaca;
  }

  .team-b span {
    background: #5f1f25;
  }

  .match-alert {
    border-color: #ef4444;
    background: #451a1a;
    color: #fee2e2;
  }

  .match-alert span {
    color: #fecaca;
  }

  .court-card {
    background: #0f172a;
  }

  .segmented button,
  .chips button,
  .secondary,
  #startMatchButton,
  .menu-dialog button,
  .dialog-actions button {
    background: #1f2937;
    color: var(--ink);
  }

  .action-save,
  .action-preview,
  .action-history,
  .action-edit,
  .menu-dialog .action-edit,
  .menu-dialog .action-preview {
    background: var(--accent);
    color: white;
  }

  .action-new,
  .action-start,
  #startMatchButton.action-start,
  .menu-dialog .action-new {
    background: var(--own);
    color: white;
  }

  .action-export,
  .menu-dialog .action-export {
    background: #374151;
    color: white;
  }

  .admin-menu {
    background: #111827;
  }

  .dialog-actions button {
    background: var(--own);
    color: white;
  }

  .dialog-actions .action-save {
    background: var(--accent);
    color: white;
  }

  .dialog-actions .secondary {
    background: #1f2937;
    color: var(--ink);
  }

  .secondary.action-button {
    background: #1f2937;
    color: var(--ink);
  }

  .secondary.action-button::before {
    background: rgba(255, 255, 255, 0.08);
  }

  .summary-dialog img {
    background: #f7f8fb;
  }

  .app-footer {
    color: var(--muted);
  }

  select,
  input,
  textarea {
    background: #0f172a;
    color: var(--ink);
  }

  .rule-note,
  .score-quality {
    border-color: #92400e;
    background: #2d1b08;
  }

  .rule-note,
  .score-quality strong,
  .score-quality p,
  .quality-grid span {
    color: #fde68a;
  }

  .bar-track {
    background: #293548;
  }

  .history-filter select {
    background: #0f172a;
    color: var(--ink);
  }
}

@media (max-width: 380px) {
  :root {
    --gutter: 10px;
  }

  .app-shell {
    padding-left: max(10px, env(safe-area-inset-left));
    padding-right: max(10px, env(safe-area-inset-right));
  }

  .sr-metric-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .sr-metric-row > strong {
    grid-column: 1 / -1;
    min-height: 30px;
  }

  .sr-metric {
    min-height: 50px;
    padding-inline: 4px;
  }

  .sr-metric b {
    white-space: normal;
  }
}

@media (max-width: 360px) {
  .record-flow,
  .panel,
  .detail-panel,
  .chart-block {
    padding: 8px;
  }

  .chip-section div {
    gap: 5px;
  }

  .chips button {
    min-height: 42px;
    padding-inline: 9px;
    font-size: 0.78rem;
  }


  .winner-grid {
    gap: 8px;
  }

  .point-button {
    min-height: 70px;
    padding: 7px;
  }

  .side-legend {
    grid-template-columns: 1fr;
  }

  .menu-practice {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 430px) {
  :root {
    --sticky-score-height: 66px;
  }

  h1 {
    font-size: 1.12rem;
  }

  .topbar {
    margin-bottom: 10px;
  }

  .scoreboard {
    gap: 6px;
  }

  .live-scorebar {
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 4px;
  }

  .live-meta {
    padding: 4px 3px;
  }

  .live-meta strong {
    font-size: 0.78rem;
  }

  .live-meta span {
    font-size: 0.58rem;
  }

  .live-score-table {
    grid-template-columns: 24px minmax(44px, 0.82fr) minmax(58px, 1.18fr);
  }

  .score-head {
    min-height: 18px;
    font-size: 0.6rem;
  }

  .score-cell {
    min-height: 30px;
    font-size: 1.32rem;
  }

  .team {
    padding: 8px;
  }

  .team strong {
    font-size: 1.7rem;
  }

  .match-state {
    width: 64px;
    padding: 6px;
  }

  .half-court {
    grid-template-columns: 34px 1fr 34px;
    grid-template-rows: 32px auto 34px;
  }

  .court {
    min-height: 0;
    padding: 8px;
  }

  .court-lines,
  .court-zones {
    inset: 8px;
  }

  .court.singles-court::before,
  .court.singles-court::after {
    top: 8px;
    bottom: 8px;
    width: calc(12.5% - 8px);
  }

  .court.singles-court::before {
    left: 8px;
  }

  .court.singles-court::after {
    right: 8px;
  }

  .court-zones {
    left: calc(8px + var(--play-x));
    right: calc(8px + (100% - var(--play-x) - var(--play-w)));
    gap: 5px;
  }

  .court-zones button,
  .out-zone {
    min-height: 58px;
    font-size: 0.72rem;
  }

  .out-zone {
    min-height: 34px;
  }

  .point-button {
    min-height: 74px;
    font-size: 1rem;
  }

  .analysis-summary,
  .stats-grid,
  .quality-grid {
    grid-template-columns: 1fr 1fr;
  }

  .bar-row {
    grid-template-columns: minmax(92px, 1fr) 1fr 28px;
  }

  .archive-toolbar {
    grid-template-columns: 1fr 1fr;
  }

  .archive-toolbar label:first-child,
  .archive-toolbar span {
    grid-column: 1 / -1;
  }

  .archive-item div {
    grid-template-columns: 1fr 1fr;
  }

  .archive-item .action-preview {
    grid-column: 1 / -1;
  }
}

@media (min-width: 431px) {
  .record-flow,
  .panel {
    padding: 12px;
  }

  .chips button {
    min-width: 76px;
  }

  .chips.compact button {
    max-width: 150px;
  }
}

@media (max-width: 340px) {
  .scoreboard {
    grid-template-columns: 1fr 1fr;
  }

  .match-state {
    grid-column: 1 / -1;
    width: auto;
    min-height: 44px;
    grid-template-columns: 1fr 1fr;
  }

  .analysis-summary,
  .stats-grid,
  .quality-grid,
  .winner-grid,
  .dialog-grid,
  .dialog-actions {
    grid-template-columns: 1fr;
  }
}

.history-edit-button {
  justify-self: start;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: #eef2f7;
  color: var(--ink);
  font-size: 0.76rem;
  font-weight: 900;
}

.history-edit-button:active {
  transform: translateY(1px);
}

.point-detail-dialog .dialog-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.trial-guide,
.menu-practice,
.record-flow,
.record-flow .control-group,
.record-flow .save-point-section,
.opponent-view,
.action-plan,
.score-quality,
.analysis-save,
.history-filter,
.history-game details,
.archive-item,
.archive-storage,
.dialog-content,
.summary-dialog {
  background: rgba(255, 253, 247, 0.94);
  box-shadow: var(--shadow-card);
}

.record-flow,
.record-flow .control-group,
.record-flow .save-point-section,
.opponent-view,
.action-plan,
.score-quality,
.analysis-save,
.history-filter,
.history-game details,
.archive-item,
.archive-storage {
  border-radius: 14px;
}

.record-flow .control-group,
.record-flow .save-point-section,
.history-filter,
.history-game details,
.archive-item {
  border-color: rgba(23, 32, 51, 0.1);
}

.record-flow {
  border: 1px solid rgba(23, 32, 51, 0.08);
  background:
    linear-gradient(90deg, rgba(37, 99, 235, 0.05), transparent 42%),
    rgba(255, 253, 247, 0.9);
}

.history-item,
.sr-card,
.pm-card,
.quality-grid span {
  border-radius: 12px;
}

.menu-dialog button,
.dialog-actions button,
.archive-item .action-button,
.history-edit-button {
  border-radius: 12px;
}

.summary-preview-frame {
  background:
    linear-gradient(transparent 27px, rgba(37, 99, 235, 0.08) 28px),
    #f8fafc;
  background-size: 100% 28px;
}
