:root {
  --ink: #18221b;
  --muted: #657168;
  --paper: #f5f1e8;
  --card: #fffdf7;
  --green: #315c45;
  --green-soft: #dce9df;
  --gold: #c49b55;
  --line: #ddd7c9;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "PingFang SC", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--paper); }
.topbar { height: 68px; padding: 0 max(24px, calc((100vw - 1080px) / 2)); display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: rgba(245,241,232,.92); }
.brand { color: var(--ink); font-weight: 800; text-decoration: none; letter-spacing: -.02em; }
.tagline { color: var(--muted); font-size: 14px; }
.topnav { display: flex; align-items: center; gap: 16px; }
.topnav a { color: var(--muted); font-size: 14px; font-weight: 700; text-decoration: none; }
.topnav a:hover { color: var(--green); }
.topnav form { margin: 0; }
.topnav button { margin: 0; padding: 6px 9px; background: transparent; color: var(--muted); font-size: 13px; }
.page { width: min(1080px, calc(100% - 32px)); max-width: 100%; margin: 0 auto; padding: 56px 0 80px; }
.hero { max-width: 780px; }
.eyebrow { color: var(--green); font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
h1 { font-family: Georgia, "Songti SC", serif; font-size: clamp(38px, 6vw, 68px); line-height: 1.05; letter-spacing: -.045em; margin: 12px 0 20px; }
.lead, .summary { color: var(--muted); font-size: 19px; line-height: 1.75; }
.status-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 38px 0 20px; }
.mode-choice { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 34px 0 18px; }
.mode-card { display: flex; align-items: center; gap: 14px; padding: 18px; border: 1px solid var(--line); border-radius: 13px; background: var(--card); color: var(--ink); text-decoration: none; transition: transform .15s, border-color .15s; }
.mode-card:hover { transform: translateY(-2px); border-color: var(--green); }
.mode-card.selected { background: var(--green-soft); border-color: #b9cdbd; }
.mode-card span:last-child { display: grid; gap: 4px; }
.mode-card small { color: var(--muted); }
.mode-icon { display: inline-grid; place-items: center; width: 43px; height: 43px; border-radius: 50%; background: white; color: var(--green); font-size: 24px; }
.anchor-target { position: relative; top: -90px; }
.status-card { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,253,247,.68); }
.status-card small { display: block; color: var(--muted); margin-top: 3px; }
.status-dot { width: 11px; height: 11px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 5px #efe5d3; }
.status-dot.ok { background: #3c8a5c; box-shadow: 0 0 0 5px #dceadd; }
.status-dot.missing { background: #a2473e; box-shadow: 0 0 0 5px #f0dcda; }
.analysis-form { padding: 28px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); box-shadow: 0 18px 55px rgba(32, 45, 35, .06); }
.analysis-form > label, .form-row > label { display: block; font-weight: 750; margin-bottom: 10px; }
.form-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.form-row > label { margin: 0; }
.form-row select, .maia-control-actions select { padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; background: white; color: var(--ink); font: inherit; }
.color-choice { display: flex; gap: 18px; }
textarea { width: 100%; padding: 16px; resize: vertical; border: 1px solid var(--line); border-radius: 10px; background: #fff; font: 14px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--ink); }
textarea:focus { outline: 3px solid var(--green-soft); border-color: var(--green); }
.source-fieldset { margin: 0; padding: 0; border: 0; }
.source-fieldset legend { width: 100%; padding: 0 0 14px; font-weight: 800; }
.source-block > label { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; font-weight: 750; }
.source-number { display: inline-grid; place-items: center; flex: 0 0 24px; width: 24px; height: 24px; border-radius: 50%; background: var(--green-soft); color: var(--green); font-size: 12px; font-weight: 850; }
.or-divider { display: flex; align-items: center; gap: 12px; margin: 18px 0; color: var(--muted); font-size: 12px; }
.or-divider::before, .or-divider::after { content: ""; height: 1px; flex: 1; background: var(--line); }
.upload-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.upload-card { position: relative; display: grid; grid-template-columns: 28px 1fr; grid-template-rows: auto auto auto; column-gap: 8px; padding: 18px; border: 1px dashed #aca798; border-radius: 12px; background: #fff; cursor: pointer; transition: border-color .15s, background .15s; }
.upload-card:hover { border-color: var(--green); background: #fbfdf9; }
.upload-card .source-number { grid-row: 1 / span 2; }
.upload-card strong { align-self: center; }
.upload-card small { grid-column: 2; margin-top: 4px; color: var(--muted); }
.upload-card input { grid-column: 1 / -1; margin-top: 14px; width: 100%; color: var(--muted); }
.disabled-card { cursor: not-allowed; opacity: .58; }
.input-note { margin: 14px 0 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.client-error { margin: 14px 0 0; padding: 11px 13px; border-radius: 8px; background: #f0dcda; color: #7c2f28; font-size: 14px; }
button, .secondary-button { display: inline-block; margin-top: 16px; padding: 13px 20px; border: 0; border-radius: 9px; background: var(--green); color: white; font-weight: 750; text-decoration: none; cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .5; }
.loading-panel[hidden] { display: none; }
.loading-panel { position: fixed; z-index: 100; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(24, 34, 27, .68); backdrop-filter: blur(6px); }
.loading-card { width: min(520px, 100%); padding: 34px; border-radius: 18px; background: var(--card); box-shadow: 0 30px 90px rgba(10, 18, 12, .25); text-align: center; }
.loading-card h2 { margin: 8px 0 10px; font: 700 28px/1.25 Georgia, "Songti SC", serif; }
.loading-card > p:not(.eyebrow) { color: var(--muted); line-height: 1.65; }
.chess-loader { display: inline-grid; place-items: center; width: 58px; height: 58px; margin-bottom: 8px; border-radius: 50%; background: var(--green-soft); color: var(--green); font-size: 34px; animation: thinking 1.8s ease-in-out infinite; }
.loading-steps { display: grid; gap: 8px; margin: 24px 0 0; padding: 0; list-style: none; text-align: left; }
.loading-steps li { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 9px; color: #8a928c; transition: color .2s, background .2s; }
.loading-steps li span { display: inline-grid; place-items: center; width: 25px; height: 25px; border: 1px solid var(--line); border-radius: 50%; font-size: 12px; font-weight: 800; }
.loading-steps li.active { background: var(--green-soft); color: var(--green); font-weight: 750; }
.loading-steps li.active span { border-color: var(--green); }
.loading-steps li.done { color: var(--green); }
.loading-steps li.done span { border-color: var(--green); background: var(--green); color: transparent; }
.loading-steps li.done span::after { content: "✓"; color: white; position: absolute; }
@keyframes thinking { 0%, 100% { transform: rotate(-7deg) translateY(0); } 50% { transform: rotate(7deg) translateY(-4px); } }
@media (prefers-reduced-motion: reduce) { .chess-loader { animation: none; } }
.flash { margin-bottom: 20px; padding: 14px 16px; border-radius: 10px; background: #f0dcda; color: #7c2f28; }
.login-shell { min-height: calc(100vh - 210px); display: grid; place-items: center; }
.login-card { width: min(470px, 100%); padding: 30px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); box-shadow: 0 22px 60px rgba(32,45,35,.08); }
.login-card h1 { margin-bottom: 14px; font-size: clamp(36px, 6vw, 52px); }
.login-card > p:not(.eyebrow) { color: var(--muted); line-height: 1.7; }
.login-card label { display: block; margin: 22px 0 8px; font-weight: 800; }
.login-card input[type="password"] { width: 100%; padding: 13px 14px; border: 1px solid var(--line); border-radius: 9px; background: white; font: inherit; }
.history-head { max-width: 780px; }
.history-head h1 { font-size: clamp(38px, 6vw, 60px); }
.history-section { margin-top: 42px; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.section-title h2 { margin: 0; font: 700 28px/1.2 Georgia, "Songti SC", serif; }
.section-title span { color: var(--muted); font-size: 13px; }
.history-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.history-card { display: grid; gap: 9px; padding: 19px; border: 1px solid var(--line); border-radius: 13px; background: var(--card); color: var(--ink); text-decoration: none; transition: transform .15s, border-color .15s; }
.history-card:hover { transform: translateY(-2px); border-color: var(--green); }
.history-card small { color: var(--muted); }
.history-card strong { font: 700 20px/1.3 Georgia, "Songti SC", serif; }
.history-card p { margin: 0; color: var(--muted); line-height: 1.6; }
.history-card div { display: flex; flex-wrap: wrap; gap: 6px; }
.history-card div span { padding: 5px 8px; border-radius: 99px; background: var(--green-soft); color: var(--green); font-size: 11px; font-weight: 700; }
.history-card-with-actions { position: relative; padding: 0; overflow: hidden; }
.history-card-main { display: grid; gap: 9px; padding: 19px 19px 8px; color: var(--ink); text-decoration: none; }
.history-delete-form { display: flex; justify-content: flex-end; padding: 0 12px 12px; }
.history-delete-form button { margin: 0; padding: 7px 10px; border: 1px solid #b96458; background: transparent; color: #913e35; font-size: 12px; }
.empty-history { padding: 24px; border: 1px dashed var(--line); border-radius: 12px; color: var(--muted); }
.empty-history a { margin-left: 6px; color: var(--green); font-weight: 700; }
.report-head { max-width: 850px; }
.report-head h1 { font-size: clamp(34px, 5vw, 56px); }
.report-meta { display: flex; flex-wrap: wrap; gap: 8px; }
.report-meta span { padding: 7px 11px; border-radius: 99px; background: var(--green-soft); color: var(--green); font-size: 13px; font-weight: 700; }
.goal { margin: 34px 0; padding: 20px 24px; border-left: 4px solid var(--gold); background: #fff8e9; font-size: 18px; line-height: 1.6; }
.goal strong, .rule strong { display: block; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 5px; }
.positions { display: grid; gap: 24px; }
.position-card { display: grid; grid-template-columns: 390px 1fr; gap: 32px; padding: 24px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); }
.board svg { display: block; width: 100%; height: auto; border-radius: 7px; }
.lesson h2 { font: 700 30px/1.2 Georgia, "Songti SC", serif; margin: 8px 0 18px; }
.lesson h3 { font-size: 14px; margin: 22px 0 6px; }
.lesson p { color: #48534b; line-height: 1.7; }
.move-comparison { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.move-comparison div { padding: 12px; border: 1px solid var(--line); border-radius: 9px; }
.move-comparison small { display: block; color: var(--muted); margin-bottom: 5px; }
.move-comparison strong { font-size: 17px; }
.rule { margin-top: 22px; padding: 15px 17px; background: var(--green-soft); border-radius: 10px; line-height: 1.6; }
.maia-controls { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin: 28px 0 24px; padding: 18px 20px; border: 1px solid #b9cdbd; border-radius: 14px; background: linear-gradient(135deg, #f7fbf7, #eef5ef); }
.maia-controls > div:first-child { display: grid; gap: 4px; }
.maia-controls .eyebrow { margin: 0; }
.maia-controls small { color: var(--muted); line-height: 1.5; }
.maia-control-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.maia-control-actions label { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 13px; font-weight: 700; white-space: nowrap; }
.view-toggle { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: white; }
.maia-card { margin-top: 18px; padding: 16px; border: 1px solid #b9cdbd; border-radius: 11px; background: #f7fbf7; }
.maia-card[hidden] { display: none; }
.maia-card-head { display: flex; align-items: center; gap: 9px; }
.maia-card-head span { padding: 4px 7px; border-radius: 99px; background: var(--green-soft); color: var(--green); font-size: 11px; font-weight: 800; }
.maia-card p { margin: 10px 0 0; }
.maia-candidates { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-top: 12px; }
.maia-candidates > span { display: grid; gap: 3px; padding: 9px 10px; border: 1px solid #d7e3d9; border-radius: 8px; background: white; }
.maia-candidates small { color: var(--muted); font-size: 10px; }
.site-footer { width: min(1080px, calc(100% - 32px)); margin: 0 auto; padding: 24px 0 40px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.site-footer a, .legal-links a { color: var(--green); }
.legal-page { max-width: 760px; }
.legal-links { display: grid; gap: 10px; margin-top: 24px; }
details { margin-top: 16px; color: var(--muted); }
summary { cursor: pointer; font-weight: 700; }
.coach-chat { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.coach-chat-head { display: grid; gap: 4px; }
.coach-chat-head small { color: var(--muted); line-height: 1.5; }
.chat-messages { display: grid; gap: 9px; margin-top: 14px; }
.chat-sessions { display: grid; gap: 8px; margin-top: 14px; }
.chat-session { border: 1px solid var(--line); border-radius: 10px; background: #faf7f0; overflow: hidden; }
.chat-session.current { border-color: #b9d0c2; background: #f7fbf8; }
.chat-session summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; color: var(--green); cursor: pointer; font-size: 13px; font-weight: 750; }
.chat-session summary small { color: var(--muted); font-size: 10px; font-weight: 650; }
.chat-session .chat-messages { margin: 0; padding: 4px 10px 12px; }
.chat-message { max-width: 88%; padding: 11px 13px; border-radius: 10px; background: #f0ede5; }
.chat-message.user { justify-self: end; background: var(--green-soft); }
.chat-message.assistant { justify-self: start; }
.chat-message.error { background: #f0dcda; color: #7c2f28; }
.chat-message strong { display: block; margin-bottom: 3px; font-size: 12px; }
.chat-message p { margin: 0; white-space: pre-wrap; }
.coach-chat-form textarea { margin-top: 12px; min-height: 76px; font-family: inherit; }
.coach-chat-form button { margin-top: 8px; }
.move-ledger { margin-top: 30px; border: 1px solid var(--line); border-radius: 15px; background: var(--card); overflow: hidden; }
.move-ledger > summary { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 20px 24px; list-style: none; color: var(--ink); }
.move-ledger > summary::-webkit-details-marker { display: none; }
.move-ledger > summary span:first-child { display: grid; gap: 4px; }
.move-ledger > summary small { color: var(--muted); font-weight: 400; }
.ledger-action { color: var(--green); font-size: 13px; }
.move-ledger[open] .ledger-action { font-size: 0; }
.move-ledger[open] .ledger-action::after { content: "收起"; font-size: 13px; }
.ledger-table-wrap { overflow-x: auto; border-top: 1px solid var(--line); }
.ledger-table { width: 100%; border-collapse: collapse; min-width: 850px; }
.ledger-table th, .ledger-table td { padding: 12px 14px; border-bottom: 1px solid #eee9df; text-align: left; vertical-align: top; font-size: 13px; line-height: 1.5; }
.ledger-table th { color: var(--muted); background: #faf7f0; font-size: 12px; }
.ledger-table tr:last-child td { border-bottom: 0; }
.ledger-table .key-move { background: #fffbf1; }
.key-label { display: inline-block; margin-left: 6px; padding: 2px 5px; border-radius: 4px; background: #f1dfb6; color: #785c28; font-size: 10px; }
.grade { display: inline-block; min-width: 50px; padding: 3px 7px; border-radius: 99px; background: #e9ece9; text-align: center; font-size: 11px; font-weight: 800; }
.grade[data-grade="最佳"], .grade[data-grade="优秀"] { background: #dceadd; color: #267047; }
.grade[data-grade="良好"] { background: #e7eee1; color: #587143; }
.grade[data-grade="不准确"] { background: #f5ead0; color: #856423; }
.grade[data-grade="错误"], .grade[data-grade="严重失误"] { background: #f0dcda; color: #913e35; }
.secondary-button { margin-top: 28px; background: transparent; color: var(--green); border: 1px solid var(--green); }
.compact-hero h1 { font-size: clamp(38px, 5vw, 58px); }
.game-setup { margin-top: 34px; padding: 28px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); }
.game-setup fieldset { margin: 0 0 28px; padding: 0; border: 0; }
.game-setup legend { margin-bottom: 14px; font-weight: 800; }
.difficulty-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 9px; }
.difficulty-card { position: relative; padding: 15px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.difficulty-card input { position: absolute; opacity: 0; }
.difficulty-card:has(input:checked) { border-color: var(--green); background: var(--green-soft); }
.difficulty-card span { display: grid; gap: 4px; }
.difficulty-card small { color: var(--muted); }
.side-choice { display: flex; gap: 10px; }
.side-choice label { display: flex; align-items: center; gap: 8px; padding: 10px 15px; border: 1px solid var(--line); border-radius: 9px; cursor: pointer; }
.side-choice label:has(input:checked) { border-color: var(--green); background: var(--green-soft); }
.piece-token { font-size: 24px; line-height: 1; }
.text-link { margin-left: 14px; color: var(--green); font-weight: 700; text-decoration: none; }
.play-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.play-head h1 { margin-bottom: 0; font-size: clamp(36px, 5vw, 56px); }
.play-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.play-actions .secondary-button { margin: 0; }
.resign-form, .undo-form { margin: 0; }
.undo-button { margin: 0; border: 1px solid var(--green); background: var(--green-soft); color: var(--green); }
.danger-button { margin: 0; border: 1px solid #b96458; background: transparent; color: #913e35; }
.game-result-banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; padding: 13px 15px; border: 1px solid #b96458; border-radius: 11px; background: #fff0ed; color: #7d332b; }
.game-result-banner strong { font: 700 20px/1.2 Georgia, "Songti SC", serif; }
.game-result-banner span { font-weight: 750; }
.play-layout { display: grid; grid-template-columns: minmax(420px, 620px) minmax(300px, 1fr); gap: 24px; align-items: start; min-width: 0; }
.game-area, .live-coach { min-width: 0; padding: 20px; border: 1px solid var(--line); border-radius: 15px; background: var(--card); }
.board-status { display: flex; justify-content: space-between; margin-bottom: 12px; font-size: 14px; font-weight: 750; }
.capture-tray { display: flex; align-items: center; gap: 9px; min-height: 35px; padding: 5px 2px; color: var(--muted); }
.opponent-captures { margin-bottom: 5px; }
.user-captures { margin-top: 5px; }
.capture-label { flex: 0 0 auto; font-size: 12px; font-weight: 750; }
.captured-pieces { display: flex; flex: 1; align-items: center; min-width: 0; min-height: 28px; }
.captured-pieces small { opacity: .7; font-size: 11px; }
.captured-piece { display: inline-grid; place-items: center; width: 25px; height: 28px; margin-left: -3px; font: 25px/1 "Arial Unicode MS", "Apple Symbols", sans-serif; }
.captured-piece.piece-white { color: #e8e3d7; text-shadow: -1px 0 #435047, 0 1px #435047, 1px 0 #435047, 0 -1px #435047; }
.captured-piece.piece-black { color: #172019; }
.captured-piece.latest { animation: captured-arrive .45s ease-out; }
.material-balance { flex: 0 0 auto; padding: 4px 7px; border-radius: 99px; background: #f0ede5; color: var(--muted); font-size: 11px; }
.material-balance.ahead { background: var(--green-soft); color: var(--green); }
.material-balance.behind { background: #fff0ed; color: #913e35; }
@keyframes captured-arrive { from { opacity: 0; transform: translateY(-8px) scale(.7); } to { opacity: 1; transform: none; } }
.board-coordinate-shell { display: grid; grid-template-columns: 22px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) 22px; width: 100%; max-width: 100%; min-width: 0; }
.interactive-board { grid-column: 2; grid-row: 1; display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); width: 100%; max-width: 100%; min-width: 0; aspect-ratio: 1; border-radius: 8px; overflow: hidden; box-shadow: 0 12px 35px rgba(28, 37, 30, .14); touch-action: none; -webkit-user-select: none; user-select: none; }
.rank-coordinates { grid-column: 1; grid-row: 1; display: grid; grid-template-rows: repeat(8, 1fr); color: var(--muted); font: 750 11px/1 ui-sans-serif, system-ui, sans-serif; }
.rank-coordinates span { display: grid; place-items: center; }
.file-coordinates { grid-column: 2; grid-row: 2; display: grid; grid-template-columns: repeat(8, 1fr); color: var(--muted); font: 750 11px/1 ui-sans-serif, system-ui, sans-serif; text-transform: lowercase; }
.file-coordinates span { display: grid; place-items: center; }
.chess-square { position: relative; display: grid; place-items: center; width: 100%; min-width: 0; aspect-ratio: 1; margin: 0; padding: 0; border: 0; border-radius: 0; color: #172019; font-family: "Arial Unicode MS", "Apple Symbols", sans-serif; font-size: clamp(38px, 5.9vw, 66px); line-height: 1; touch-action: none; -webkit-tap-highlight-color: transparent; -webkit-user-select: none; user-select: none; }
.chess-square.dragging { z-index: 20; transform: translate(var(--drag-x), var(--drag-y)) scale(1.08); border-radius: 8px; opacity: .92; filter: drop-shadow(0 8px 8px rgba(20, 28, 22, .34)); }
.interactive-board.is-dragging { cursor: grabbing; }
.chess-square.piece-white { color: #e8e3d7; text-shadow: -1px 0 #435047, 0 1px #435047, 1px 0 #435047, 0 -1px #435047, 0 2px 2px rgba(24,34,27,.38); }
.chess-square.piece-black { color: #172019; text-shadow: 0 1px 0 rgba(255,255,255,.18); }
.chess-square.light { background: #e9dfc8; }
.chess-square.dark { background: #789273; }
.chess-square:hover { outline: 3px solid rgba(244, 198, 92, .8); outline-offset: -3px; }
.chess-square.selected { box-shadow: inset 0 0 0 5px #e8b84e; }
.chess-square.target { box-shadow: inset 0 0 0 5px rgba(255,255,255,.38); }
.chess-square.last-user { box-shadow: inset 0 0 0 5px rgba(226, 169, 55, .96), inset 0 0 18px rgba(226, 169, 55, .34); }
.chess-square.last-ai { box-shadow: inset 0 0 0 5px rgba(55, 151, 146, .96), inset 0 0 18px rgba(55, 151, 146, .32); }
.chess-square:disabled { opacity: 1; cursor: wait; }
.move-feedback { min-height: 24px; margin: 13px 0 0; color: var(--muted); font-size: 14px; }
.move-feedback.error { color: #913e35; }
.move-history { padding-top: 5px; }
.save-pgn-note { margin: 10px 0 0; color: var(--muted); font-size: .86rem; }
.move-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.move-list span { padding: 4px 7px; border-radius: 5px; background: #f0ede5; font: 12px ui-monospace, monospace; }
.live-coach { position: sticky; top: 20px; }
.live-coach h2 { margin: 6px 0 8px; font: 700 28px/1.2 Georgia, "Songti SC", serif; }
.live-coach > p:not(.eyebrow) { color: var(--muted); line-height: 1.6; }
.quick-questions { display: flex; flex-wrap: wrap; gap: 7px; margin: 15px 0; }
.quick-questions button { margin: 0; padding: 7px 10px; border: 1px solid var(--line); background: transparent; color: var(--green); font-size: 12px; }
.candidate-panel { margin: 16px 0; padding: 14px; border: 1px solid var(--line); border-radius: 11px; background: #faf7f0; }
.candidate-panel-head { display: flex; align-items: start; justify-content: space-between; gap: 12px; }
.candidate-panel-head > div { display: grid; gap: 4px; }
.candidate-panel-head small { color: var(--muted); line-height: 1.45; }
.candidate-panel-head small.error { color: #913e35; }
.reveal-level { flex: 0 0 auto; padding: 4px 7px; border-radius: 99px; background: var(--green-soft); color: var(--green); font-size: 11px; font-weight: 800; }
.candidate-content { display: grid; gap: 7px; margin-top: 12px; }
.candidate-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; align-items: center; padding: 10px 11px; border: 1px solid #e5dfd1; border-radius: 9px; background: white; }
.candidate-card > div { display: flex; align-items: baseline; gap: 8px; }
.candidate-card small { color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.candidate-card strong { font: 700 19px/1.2 Georgia, "Songti SC", serif; }
.candidate-evaluation { color: var(--green); font: 750 12px ui-monospace, monospace; }
.candidate-card p { grid-column: 1 / -1; margin: 0; padding-top: 7px; border-top: 1px solid #eee9df; color: var(--muted); font: 12px/1.6 ui-monospace, monospace; }
.candidate-reveal { width: 100%; margin-top: 11px; padding: 9px 12px; border: 1px solid var(--green); background: transparent; color: var(--green); font-size: 12px; }
@media (max-width: 820px) {
  .position-card { grid-template-columns: 1fr; }
  .board { max-width: 460px; margin: auto; }
  .status-grid { grid-template-columns: 1fr; }
  .difficulty-grid { grid-template-columns: repeat(3, 1fr); }
  .play-layout { grid-template-columns: minmax(0, 1fr); }
  .live-coach { position: static; }
  .maia-controls { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 520px) {
  .tagline { display: none; }
  .topbar { height: auto; min-height: 68px; padding-top: 10px; padding-bottom: 10px; gap: 12px; }
  .topnav { gap: 10px; }
  .topnav a { font-size: 12px; }
  .topnav form { display: none; }
  .page { width: 100%; padding: 30px 10px 64px; }
  .analysis-form, .position-card { padding: 16px; }
  .move-comparison { grid-template-columns: 1fr; }
  .upload-grid { grid-template-columns: 1fr; }
  .mode-choice, .difficulty-grid { grid-template-columns: 1fr; }
  .history-grid { grid-template-columns: 1fr; }
  .side-choice { display: grid; }
  .maia-candidates { grid-template-columns: 1fr; }
  .play-head { align-items: start; flex-direction: column; }
  .game-area { padding: 10px; }
  .board-coordinate-shell { grid-template-columns: 16px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) 16px; }
  .chess-square { font-size: min(10.5vw, 48px); }
}
@media (hover: none), (pointer: coarse) {
  .chess-square:hover { outline: none; }
  .chess-square:active { box-shadow: inset 0 0 0 4px rgba(255,255,255,.38); }
  .chess-square.selected { box-shadow: inset 0 0 0 5px #e8b84e; }
  .chess-square.target { box-shadow: inset 0 0 0 5px rgba(255,255,255,.38); }
}
