:root {
  color-scheme: light;
  --paper: #f3f2e9;
  --surface: #fffef9;
  --ink: #203e36;
  --muted: #59695f;
  --line: #d4dbcc;
  --green: #2c5947;
  --green-soft: #e1ecdf;
  --orange: #ad451f;
  --orange-soft: #f8e4d5;
  --tie: #edece2;
  --blue: #355b75;
  --blue-soft: #e0eaf1;
  --focus: #9a3b12;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font-size: 14px; line-height: 1.55; }
button, select, input { font: inherit; color: inherit; }
button, select { cursor: pointer; }
button { -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: default; opacity: .48; }
button, select, input { min-height: 44px; }
button:focus-visible, select:focus-visible, input:focus-visible, a:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
button, input, select { max-width: 100%; }
.app-shell { width: min(1184px, 100%); margin: 0 auto; padding: 0 28px; }
.masthead { display: flex; justify-content: space-between; align-items: center; min-height: 78px; border-bottom: 1px solid var(--line); gap: 20px; }
.home-link { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; color: var(--ink); font-weight: 700; text-decoration: none; }
.home-link span { font-size: 22px; }
.edition { font-size: 12px; color: var(--muted); letter-spacing: .07em; }
.introduction { display: flex; align-items: center; justify-content: space-between; gap: 32px; padding: 38px 0 32px; }
.eyebrow { color: var(--muted); font-size: 12px; font-weight: 650; letter-spacing: .12em; }
h1 { font-size: clamp(38px, 5vw, 61px); line-height: 1.25; letter-spacing: -.06em; font-weight: 800; margin: 9px 0 12px; }
.title-dot { color: var(--orange); }
.lead { font-size: 16px; color: #40564b; }
.mobile-break { display: none; }
.model-note { display: flex; align-items: center; gap: 18px; padding: 18px 0 18px 24px; border-left: 1px solid #bfcbb9; }
.note-number { font-size: 52px; line-height: 1; letter-spacing: -.07em; font-weight: 750; color: var(--green); }
.model-note p { font-size: 13px; line-height: 1.8; }
.notice { background: #f6e8cb; border: 1px solid #c6a76e; border-radius: 9px; padding: 12px 16px; margin-bottom: 24px; }
.section-heading { display: flex; justify-content: space-between; gap: 16px; align-items: flex-end; margin-bottom: 15px; }
h2 { font-size: 23px; letter-spacing: -.035em; line-height: 1.4; margin-top: 3px; }
.section-note, .panel-kicker { color: var(--muted); font-size: 12px; }
.cycle-card { display: flex; align-items: center; gap: 16px; padding: 19px 22px; color: #f8f8e9; background: var(--green); border-radius: 13px; }
.cycle-mark { font-size: 38px; line-height: 1; color: #d4e3a6; }
.cycle-card h3 { font-size: 22px; font-weight: 700; letter-spacing: .02em; line-height: 1.4; }
.cycle-card p { margin-top: 3px; color: #dce8d8; font-size: 12px; }
.cycle-tag { margin-left: auto; border: 1px solid #a5b89b; border-radius: 30px; padding: 5px 11px; white-space: nowrap; font-size: 12px; }
.cycle-card.no-cycle { background: #45564b; }
.relationship-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 12px 0 28px; }
.relationship-card { border: 1px solid var(--line); border-radius: 11px; background: #f9f9f1; padding: 13px 17px; }
.relationship-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.relationship-card h3 { font-size: 15px; }
.relationship-direction { font-size: 12px; color: var(--green); font-weight: 700; }
.relationship-counts { display: flex; gap: 19px; margin-top: 8px; font-variant-numeric: tabular-nums; }
.relationship-counts span { display: flex; align-items: baseline; gap: 4px; color: var(--muted); font-size: 12px; }
.relationship-counts strong { color: var(--ink); font-size: 15px; font-weight: 650; }
.workspace { display: grid; grid-template-columns: minmax(0, .88fr) minmax(0, 1.35fr); align-items: start; gap: 20px; }
.panel { min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 21px; box-shadow: 0 5px 0 #203e3605; }
.compact { align-items: center; }
.compact h2 { font-size: 21px; }
.panel-kicker { white-space: nowrap; }
.die-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.die-card { border: 1px solid var(--line); border-radius: 10px; background: #f7f7ef; padding: 9px; text-align: left; }
.die-card[aria-pressed="true"] { border: 2px solid var(--green); padding: 8px; background: #edf2e6; }
.die-card-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 4px; margin-bottom: 7px; }
.die-letter { font-size: 19px; line-height: 1.2; font-weight: 750; }
.die-edit-label { font-size: 12px; color: var(--muted); }
.face-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3px; }
.face-value { text-align: center; background: var(--surface); border: 1px solid #d5ddcc; border-radius: 4px; font-size: 14px; line-height: 25px; font-weight: 650; font-variant-numeric: tabular-nums; }
.face-editor { margin: 18px 0 12px; }
.editor-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 10px; }
h3 { font-size: 14px; }
.editor-heading span { font-size: 12px; color: var(--muted); }
.face-controls { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px 10px; }
.face-field { min-width: 0; }
.face-field label { display: block; font-size: 12px; margin: 0 0 4px 1px; color: var(--muted); }
.face-field select { width: 100%; border: 1px solid #afbdab; border-radius: 7px; padding: 6px 10px; background: #fffef9; font-weight: 700; font-size: 16px; }
.editor-feedback { font-size: 12px; color: var(--green); margin-top: 10px; min-height: 38px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid transparent; border-radius: 8px; padding: 9px 13px; font-size: 13px; font-weight: 650; line-height: 1.5; }
.primary { background: var(--green); color: #fffdf0; }
.primary:hover { background: #244b3b; }
.secondary { border-color: #cbd5c5; background: #f4f5ec; color: var(--ink); }
.secondary:hover:enabled { background: #e8eddf; }
.full-width { width: 100%; }
.preset-section { border-top: 1px solid var(--line); margin-top: 20px; padding-top: 16px; }
.preset-section p, .share-section > p { font-size: 12px; color: var(--muted); margin-top: 5px; }
.preset-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 11px; }
.share-section { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.share-heading { display: flex; justify-content: space-between; }
.share-heading > span { font-size: 20px; line-height: 1; color: var(--orange); }
.share-section > .button { margin-top: 12px; }
.invitation { margin-top: 13px; }
.invitation label { display: block; color: var(--muted); font-size: 12px; }
.invitation input { display: block; width: 100%; min-width: 0; border: 1px solid #afbdab; border-radius: 7px; background: #fff; margin: 6px 0 7px; padding: 9px; font-size: 12px; }
.direction-controls { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pair-buttons { display: flex; gap: 5px; }
.pair-button { border-color: var(--line); background: #f4f5ed; min-width: 59px; padding-inline: 12px; }
.pair-button[aria-pressed="true"] { background: var(--ink); color: #fffef3; border-color: var(--ink); }
.direction-note { margin-top: 8px; font-size: 12px; color: var(--muted); }
.comparison-heading { display: flex; align-items: baseline; justify-content: space-between; margin-top: 22px; }
.comparison-heading h3 { font-size: 17px; }
.comparison-heading > span { color: var(--muted); font-size: 12px; }
.current-counts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 11px 0 16px; }
.current-stat { border-radius: 8px; padding: 8px 12px; background: var(--tie); }
.current-stat:first-child { background: var(--green-soft); }
.current-stat:last-child { background: var(--blue-soft); }
.current-stat span { display: block; font-size: 12px; color: #43594b; }
.current-stat strong { font-size: 22px; line-height: 1.45; letter-spacing: -.035em; font-variant-numeric: tabular-nums; }
.current-stat small { font-size: 12px; font-weight: 500; letter-spacing: 0; }
.observation-tools { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.seen-count { display: flex; align-items: baseline; gap: 5px; white-space: nowrap; }
.seen-count strong { font-size: 25px; line-height: 1; font-variant-numeric: tabular-nums; }
.seen-count span { font-size: 12px; color: var(--muted); }
.observation-actions { display: flex; gap: 6px; }
.selection-detail { border-left: 3px solid #a7bc99; background: #f1f4e9; border-radius: 0 7px 7px 0; padding: 9px 12px; margin: 12px 0 14px; min-height: 65px; }
.detail-label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.selection-detail p { font-size: 13px; font-weight: 600; }
.matrix-caption { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 8px; font-size: 12px; color: var(--muted); }
.matrix-caption > span:last-child { white-space: nowrap; }
.comparison-matrix { display: grid; grid-template-columns: repeat(6, minmax(44px, 1fr)); gap: 5px; }
.matrix-cell { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-height: 57px; min-width: 44px; border: 1px solid #b8c9ad; border-radius: 7px; background: var(--green-soft); padding: 6px 1px 4px; }
.matrix-cell[data-result="L"] { color: #244e69; border-color: #b7c9d5; background: var(--blue-soft); }
.matrix-cell[data-result="T"] { color: #5b5940; border-color: #cccbb7; background: var(--tie); }
.cell-comparison { font-size: 14px; font-weight: 750; line-height: 1.25; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cell-outcome { font-size: 12px; line-height: 1.25; }
.cell-seen { position: absolute; top: 1px; right: 4px; font-size: 12px; line-height: 1; visibility: hidden; }
.matrix-cell[data-seen="true"] .cell-seen { visibility: visible; }
.matrix-cell[aria-pressed="true"] { outline: 3px solid var(--orange); outline-offset: -3px; }
.matrix-cell:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; z-index: 1; }
.matrix-footnote { margin-top: 12px; font-size: 12px; color: var(--muted); }
.matrix-footnote span { margin-left: 5px; font-weight: 650; }
.legend-win { color: var(--green); }
.legend-tie { color: #696642; }
.legend-loss { color: var(--blue); }
.page-footer { display: flex; justify-content: space-between; gap: 22px; border-top: 1px solid var(--line); padding: 20px 0 25px; margin-top: 30px; color: var(--muted); font-size: 12px; }
.page-footer p:last-child { white-space: nowrap; }
@media (max-width: 1023px) {
  .app-shell { padding-inline: 20px; }
  .workspace { gap: 14px; grid-template-columns: minmax(0, .86fr) minmax(0, 1.2fr); }
  .panel { padding: 15px; }
  .model-note { max-width: 42%; gap: 12px; padding-left: 18px; }
  .note-number { font-size: 44px; }
  .relationship-counts { gap: 10px; }
  .relationship-card { padding-inline: 12px; }
  .relationship-top { flex-wrap: wrap; gap: 2px; }
  .panel-kicker { display: none; }
  .direction-controls { flex-wrap: wrap; gap: 7px; }
  .direction-controls > .button { flex: 1; }
  .pair-buttons { flex: 1; }
  .pair-button { min-width: 48px; flex: 1; padding-inline: 8px; }
  .comparison-matrix { gap: 3px; }
  .matrix-cell { min-height: 51px; }
  .cell-comparison { font-size: 12px; }
  .matrix-caption { flex-wrap: wrap; gap: 2px 8px; }
  .observation-tools { flex-wrap: wrap; }
  .observation-actions { flex: 1; justify-content: flex-end; }
}
@media (max-width: 759px) {
  .app-shell { max-width: 600px; padding-inline: 14px; }
  .masthead { min-height: 61px; gap: 10px; }
  .edition { font-size: 12px; letter-spacing: 0; }
  .introduction { display: block; padding: 25px 0 24px; }
  h1 { font-size: 44px; margin: 7px 0 8px; }
  .lead { font-size: 14px; }
  .model-note { max-width: none; border-left: 0; border-top: 1px solid var(--line); padding: 14px 0 0; margin-top: 18px; gap: 14px; }
  .model-note p { font-size: 12px; line-height: 1.7; }
  .note-number { font-size: 38px; }
  .section-heading { align-items: center; margin-bottom: 12px; }
  h2 { font-size: 21px; }
  .section-note { max-width: 145px; text-align: right; }
  .cycle-card { padding: 15px; gap: 12px; }
  .cycle-mark { font-size: 32px; }
  .cycle-card h3 { font-size: 18px; }
  .cycle-tag { display: none; }
  .cycle-card p { font-size: 12px; }
  .relationship-cards { gap: 6px; margin: 8px 0 20px; }
  .relationship-card { padding: 10px 8px; }
  .relationship-card h3 { font-size: 13px; }
  .relationship-direction { font-size: 12px; }
  .relationship-counts { gap: 2px; flex-direction: column; margin-top: 6px; }
  .relationship-counts span { justify-content: space-between; gap: 4px; }
  .relationship-counts strong { font-size: 14px; }
  .workspace { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .panel { padding: 15px; border-radius: 13px; }
  .compact h2 { font-size: 21px; }
  .panel-kicker { display: inline; }
  .die-card { padding: 9px 10px; }
  .die-card[aria-pressed="true"] { padding: 8px 9px; }
  .face-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .face-value { line-height: 24px; }
  .face-editor { margin-top: 16px; }
  .editor-feedback { min-height: 19px; }
  .preset-section, .share-section { margin-top: 16px; padding-top: 13px; }
  .direction-controls { flex-wrap: nowrap; }
  .pair-buttons { flex: 1; }
  .direction-controls > .button { flex: 0 0 auto; padding-inline: 11px; }
  .comparison-heading { margin-top: 18px; }
  .matrix-caption { font-size: 12px; flex-direction: column; gap: 1px; }
  .comparison-matrix { gap: 4px; }
  .matrix-cell { min-height: 49px; }
  .cell-comparison { font-size: 13px; }
  .observation-tools { flex-wrap: nowrap; gap: 7px; }
  .observation-actions .button { padding-inline: 11px; }
  .page-footer { display: block; margin-top: 24px; padding-block: 17px 23px; }
  .page-footer p + p { margin-top: 8px; }
}
@media (max-width: 379px) {
  .app-shell { padding-inline: 12px; }
  .panel { padding: 12px; }
  .edition { max-width: 150px; text-align: right; }
  .die-edit-label { font-size: 12px; }
  .die-card { padding-inline: 8px; }
  .die-card[aria-pressed="true"] { padding-inline: 7px; }
  .comparison-matrix { gap: 3px; }
  .cell-comparison { font-size: 12px; }
  .matrix-cell { min-height: 47px; }
  .observation-actions .button { padding-inline: 9px; }
  .direction-controls > .button { padding-inline: 9px; }
  .seen-count strong { font-size: 23px; }
}
