:root {
  color-scheme: light;
  --ink: #202c28;
  --muted: #64736d;
  --brand: #0f8067;
  --brand-strong: #0a5f51;
  --brand-soft: #dcefe8;
  --line: rgb(85 116 102 / .14);
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 13px;
  color: var(--ink);
  background: #f2f6f3;
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; background: radial-gradient(ellipse at 8% 5%, #dfeee6 0, transparent 48%), radial-gradient(ellipse at 94% 90%, #e5eae2 0, transparent 46%); background-attachment: fixed; }
button, input { font: inherit; }
button { cursor: pointer; color: inherit; border: 0; background: none; touch-action: manipulation; }
button:disabled { opacity: .38; cursor: not-allowed; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
h1, h2 { font-size: 15px; font-weight: 650; }
[hidden] { display: none !important; }
button, input { transition: background 150ms, color 150ms, border-color 150ms, box-shadow 150ms; }
button:focus-visible, a:focus-visible, input:focus-visible, summary:focus-visible, [tabindex]:focus-visible { outline: 3px solid #6ebfab; outline-offset: 3px; }
::selection { background: #cce9dc; }
.skip { position: fixed; top: -80px; left: 12px; background: white; padding: 10px; z-index: 100; }
.skip:focus { top: 10px; }
.topbar { height: 54px; display: flex; align-items: center; justify-content: space-between; padding: 0 28px; border-bottom: 1px solid rgb(255 255 255 / .7); background: rgb(255 255 255 / .5); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
.brand { display: flex; align-items: center; gap: 10px; }
.brand strong { font-size: 21px; letter-spacing: 2px; }
.brand-mark { display: grid; grid-template-columns: repeat(2, 6px); grid-template-rows: repeat(2, 6px); justify-content: center; align-content: center; gap: 3px; width: 29px; height: 29px; border-radius: 9px; background: var(--brand); box-shadow: 0 2px 8px #0f806718; }
.brand-mark i { background: white; border-radius: 2px; }
.brand-mark i:nth-child(2), .brand-mark i:nth-child(3) { opacity: .5; }
.brand-en { margin-left: 8px; padding-left: 16px; border-left: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.header-tools { display: flex; align-items: center; gap: 22px; }
.local-label { font-size: 11px; color: #84928b; display: flex; align-items: center; gap: 6px; }
.local-label i { width: 5px; height: 5px; background: #78a18c; border-radius: 50%; }
.nav-button { min-height: 34px; font-size: 12px; }
.nav-button:hover { color: var(--brand); }
#saved-count { font-size: 10px; background: rgb(15 128 103 / .08); padding: 2px 5px; border-radius: 4px; margin-left: 4px; }
main { max-width: 1800px; height: calc(100dvh - 54px); min-height: 530px; margin: auto; padding: 12px 24px 8px; display: grid; grid-template-rows: 46px minmax(0, 1fr) 16px; gap: 10px; }
.launch-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 4px; }
.recipe { display: flex; gap: 12px; align-items: baseline; }
.recipe strong { font-size: 17px; font-weight: 650; font-variant-numeric: tabular-nums; }
.recipe strong span { font-weight: 400; font-size: 12px; margin: 0 4px; color: var(--muted); }
.recipe > span { font-size: 11px; color: #7d8c84; }
.launch-actions { display: flex; align-items: center; gap: 18px; }
.stepper { display: flex; align-items: center; gap: 6px; }
.stepper > span { font-size: 11px; color: #7d8c84; margin-right: 4px; }
.stepper button { height: 30px; width: 30px; border: 1px solid var(--line); background: rgb(255 255 255 / .55); border-radius: 8px; font-size: 17px; }
.stepper button:hover { background: white; }
.stepper output { width: 22px; text-align: center; font-weight: 650; font-variant-numeric: tabular-nums; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 34px; padding: 0 14px; gap: 6px; border: 1px solid transparent; border-radius: 8px; font-size: 12px; font-weight: 550; white-space: nowrap; }
.button.primary { color: white; background: var(--brand); box-shadow: 0 3px 9px #0f806714; }
.button.primary:hover:not(:disabled) { background: var(--brand-strong); }
.button.secondary { background: rgb(255 255 255 / .55); color: #536b60; border-color: var(--line); }
.button.secondary:hover:not(:disabled) { background: #fff; border-color: #adc9bb; }
.button.small { min-height: 28px; font-size: 11px; padding: 0 10px; }
.text-button { padding: 5px 0; min-height: 28px; font-size: 11px; color: #7d8c84; white-space: nowrap; }
.text-button:hover { color: var(--brand); }
.workspace { display: grid; grid-template-columns: 1.04fr 1fr; gap: 14px; min-height: 0; }
.panel { min-width: 0; border: 1px solid rgb(255 255 255 / .85); border-radius: 16px; background: rgb(255 255 255 / .6); box-shadow: 0 8px 30px rgb(32 58 46 / .035), inset 0 1px 0 #ffffff90; backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); padding: 16px; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-shrink: 0; min-height: 28px; }
.section-title { display: flex; align-items: center; gap: 9px; }
.count-pill { background: rgb(15 128 103 / .065); color: #7b9488; font-size: 10px; padding: 3px 6px; border-radius: 5px; white-space: nowrap; }
.count-pill b { color: var(--brand); }
.numbers-panel { display: flex; flex-direction: column; min-height: 0; overflow: auto; scrollbar-width: thin; }
.mode-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 10px 0 12px; }
.mode-switch { display: flex; gap: 2px; background: rgb(81 112 95 / .06); padding: 3px; border-radius: 8px; }
.mode-switch button { min-height: 28px; padding: 0 14px; font-size: 11px; border-radius: 6px; color: #7b8b82; }
.mode-switch button[aria-pressed=true] { background: #ffffffbd; color: var(--brand-strong); box-shadow: 0 1px 4px #214a3210; font-weight: 650; }
.mode-help { font-size: 10px; color: #87988e; }
.number-grid { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); grid-template-rows: repeat(8, minmax(25px, 1fr)); gap: 6px; flex: 1; min-height: 242px; }
.number { min-width: 0; padding: 0; border: 1px solid rgb(100 137 118 / .12); border-radius: 9px; background: rgb(255 255 255 / .46); font-size: clamp(13px, 1.1vw, 17px); font-weight: 550; font-variant-numeric: tabular-nums; color: #607368; position: relative; }
.number:hover { background: #e2eee8; border-color: #accdbe; }
.number.selected { background: rgb(15 128 103 / .11); color: #0a735b; border-color: rgb(15 128 103 / .12); }
.number.pinned { background: var(--brand); color: white; border-color: var(--brand); }
.number.pinned:after { content: ""; width: 4px; height: 4px; border-radius: 50%; position: absolute; top: 4px; right: 4px; background: #ffffffc0; }
.number.excluded { color: #a3ada7; background: #e6eae680; border-style: dashed; text-decoration: line-through; }
.number.pinned:hover { background: var(--brand-strong); }
.grid-footer { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 0; flex-shrink: 0; }
.legend { display: flex; gap: 12px; font-size: 10px; color: #87958d; }
.legend > span { display: flex; align-items: center; gap: 4px; }
.legend i { width: 9px; height: 9px; display: grid; place-items: center; border-radius: 2px; font-style: normal; }
.legend-selected { background: #d4e8dc; border: 1px solid #aecfbd; }
.legend-pin { background: var(--brand); color: white; font-size: 7px; }
.legend-excluded { border: 1px dashed #a5b3aa; }
.pool-actions { display: flex; gap: 6px; }
.settings-details { border-top: 1px solid var(--line); flex-shrink: 0; }
.settings-details summary { cursor: pointer; padding: 8px 0; font-size: 10px; color: #73877b; }
.settings-details summary span { float: right; color: #8d9c93; }
.settings-summary { font-size: 10px; color: #7e8f84; line-height: 1.8; max-height: 76px; overflow: auto; padding-bottom: 6px; overflow-wrap: anywhere; }
.settings-summary b { font-weight: 500; color: #4e6c5b; }
.distribution-summary { display: flex; justify-content: space-between; align-items: center; width: 100%; gap: 10px; padding: 10px 11px; border-radius: 8px; background: rgb(15 128 103 / .055); color: #748d7e; font-size: 10px; flex-shrink: 0; text-align: left; }
.distribution-summary b { font-weight: 600; color: #3d6854; margin: 0 3px; }
.distribution-summary i { font-style: normal; margin: 0 4px; opacity: .4; }
.summary-link { color: var(--brand); }
.results-panel { display: flex; flex-direction: column; min-height: 0; }
.results-meta { font-size: 10px; color: #81968a; margin: 7px 0 10px; line-height: 1.6; flex-shrink: 0; }
.groups { display: flex; flex-direction: column; gap: 7px; overflow: auto; overscroll-behavior: contain; flex: 1; min-height: 0; scrollbar-width: thin; scrollbar-color: #bccfc2 transparent; padding: 1px 2px 2px; }
.groups:empty { display: none; }
.group-card { border: 1px solid rgb(100 137 118 / .12); border-radius: 10px; padding: 8px 10px; background: rgb(255 255 255 / .42); flex-shrink: 0; }
.group-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 5px; }
.group-title { font-size: 9px; color: #9aa89f; letter-spacing: 1px; }
.group-title b { margin-left: 6px; letter-spacing: 0; color: #657d6f; font-size: 11px; }
.group-actions { display: flex; gap: 14px; }
.group-actions button { padding: 0; min-height: 18px; font-size: 10px; color: #7c9285; }
.group-actions button:hover { color: var(--brand); }
.group-numbers { display: grid; grid-template-columns: repeat(11, minmax(0, 1fr)); gap: 5px; }
.ball { display: grid; place-items: center; min-width: 0; height: 26px; border-radius: 5px; background: rgb(15 128 103 / .055); color: #42735c; font-size: 12px; font-weight: 550; font-variant-numeric: tabular-nums; }
.ball.pinned { color: #0b7257; background: #d6eade; box-shadow: inset 0 -2px #7eaf97; }
.stale-note { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 7px 10px; margin-bottom: 8px; border-radius: 7px; background: #fff2d7ab; font-size: 10px; color: #987433; flex-shrink: 0; }
.stale-note .text-button { color: #99742f; padding: 0; min-height: 22px; font-size: 10px; }
.stale .group-numbers { opacity: .45; }
.empty-state { display: flex; align-items: center; justify-content: center; flex-direction: column; flex: 1; padding: 20px; text-align: center; }
.empty-symbol { font-size: 35px; line-height: 1; margin-bottom: 15px; color: #90b7a2; }
.empty-state h3 { font-size: 13px; color: #6a8776; font-weight: 550; }
.empty-state p { font-size: 11px; line-height: 1.8; margin-top: 8px; color: #93a399; }
.results-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); flex-shrink: 0; }
.results-footer > span { font-size: 10px; color: #849b8d; }
.results-footer > div { display: flex; gap: 7px; }
.footer { font-size: 10px; text-align: center; color: #9ba99f; line-height: 16px; }
.mobile-tabs { display: none; }
.toast { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); padding: 11px 20px; width: max-content; max-width: calc(100vw - 32px); background: rgb(255 255 255 / .96); color: #365e49; box-shadow: 0 8px 35px #254b3426; border: 1px solid #d9e7de; border-radius: 10px; font-size: 12px; line-height: 1.7; z-index: 1000; backdrop-filter: blur(16px); pointer-events: none; }
.toast.error { color: #9c6840; border-color: #ecdac7; }
dialog { border: 1px solid #ffffffc0; border-radius: 18px; padding: 24px; color: var(--ink); background: rgb(247 251 248 / .9); backdrop-filter: blur(28px); -webkit-backdrop-filter: blur(28px); max-height: calc(100dvh - 32px); max-width: calc(100vw - 28px); box-shadow: 0 24px 80px #203c3226; overflow: auto; }
dialog::backdrop { background: #1e362a3d; backdrop-filter: blur(4px); }
.drawer { height: 100dvh; max-height: 100dvh; width: 440px; margin: 0 0 0 auto; border-radius: 18px 0 0 18px; }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.dialog-heading h2 { font-size: 18px; }
.dialog-heading h2 span { font-size: 13px; color: #82998c; margin-left: 5px; }
.eyebrow { font-size: 9px; letter-spacing: 1.4px; color: #93a79b; margin-bottom: 8px; }
.icon-button { width: 32px; height: 32px; border-radius: 9px; font-size: 23px; color: #7b9385; background: #dfeae366; }
.icon-button:hover { background: #dfeae3; }
.dialog-description { font-size: 12px; line-height: 1.8; color: #7f9386; margin: 14px 0 18px; }
.saved-list { display: flex; flex-direction: column; gap: 12px; }
.saved-item { padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: #ffffff70; }
.saved-item h3 { font-size: 13px; font-weight: 550; overflow-wrap: anywhere; }
.saved-item p { margin: 6px 0 10px; font-size: 10px; color: #8ba193; }
.saved-preview { font-size: 11px; line-height: 1.8; color: #6a8777; overflow-wrap: anywhere; }
.saved-actions { display: flex; gap: 15px; align-items: center; margin-top: 8px; }
.saved-actions button { min-height: 30px; font-size: 11px; color: var(--brand); }
.saved-actions button:last-child { margin-left: auto; color: #92a298; }
.saved-empty { padding: 40px 15px; font-size: 12px; color: #8ea297; line-height: 2; text-align: center; }
.edit-dialog { width: 460px; }
.edit-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.edit-grid .number { height: 42px; font-size: 14px; }
.edit-count { margin-bottom: 12px; font-size: 12px; color: #799284; }
.edit-count b { color: var(--brand); }
.inline-error { min-height: 18px; font-size: 11px; color: #ae7347; margin-top: 12px; line-height: 1.7; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.compact-dialog { width: 400px; }
.field-label { display: block; margin: 20px 0 9px; font-size: 12px; color: #698777; }
input { width: 100%; border: 1px solid #bdd3c6; border-radius: 8px; background: #ffffff80; padding: 11px; color: var(--ink); }
.stats-dialog { width: 380px; }
.stat-label { display: flex; justify-content: space-between; font-size: 12px; color: #547360; font-weight: 550; }
.stat-label span { font-weight: 400; font-size: 10px; color: #92a69a; }
.distribution { display: flex; flex-direction: column; gap: 12px; margin-top: 17px; }
.bin-row { display: grid; grid-template-columns: 40px 1fr 15px; align-items: center; gap: 13px; font-size: 10px; color: #7c9888; font-variant-numeric: tabular-nums; }
.bin-row b { text-align: right; font-size: 11px; font-weight: 550; }
.bin-track { height: 6px; background: #dfeae480; border-radius: 4px; overflow: hidden; }
.bin-fill { height: 100%; border-radius: 4px; background: #80af97; transition: width 180ms; }
.stat-divider { height: 1px; background: var(--line); margin: 20px 0 16px; }
.parity-values { display: flex; justify-content: space-between; margin: 12px 0 9px; font-size: 11px; color: #8aa192; }
.parity-values b { color: #4d775f; margin-left: 5px; }
.parity-bar { display: flex; height: 6px; gap: 2px; border-radius: 4px; overflow: hidden; background: #e3ede6; }
.parity-bar span:first-child { background: #75a78b; }
.parity-bar span:last-child { background: #b4d1bf; }
.runs { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; color: #8aa192; font-size: 11px; }
.run { padding: 4px 8px; color: #61816d; background: #e1ede580; border-radius: 5px; }
.assist { display: none; }
.noscript { position: fixed; inset: auto 15px 15px; padding: 20px; background: #fff3d9; text-align: center; }
@media (min-width: 761px) and (max-height: 740px) {
  main { min-height: 520px; }
  .panel { padding: 12px 14px; }
  .mode-row { margin: 7px 0 9px; }
  .group-card { padding: 4px 9px; }
  .group-top { margin-bottom: 3px; }
  .ball { height: 23px; }
  .groups { gap: 5px; }
  .grid-footer { padding: 7px 0; }
  .distribution-summary { padding: 8px 10px; }
  .settings-details summary { padding: 6px 0; }
}
@media (min-width: 761px) and (max-width: 1100px) {
  main { padding-inline: 14px; }
  .workspace { gap: 10px; grid-template-columns: 1fr 1fr; }
  .panel { padding: 12px; }
  .mode-help { display: none; }
  .mode-switch { width: 100%; }
  .mode-switch button { flex: 1; }
  .group-numbers { gap: 3px; }
  .ball { font-size: 11px; }
  .results-footer > span { max-width: 94px; line-height: 1.6; }
  .results-footer .button { padding: 0 10px; }
}
@media (max-width: 760px) {
  .topbar { height: 48px; padding: 0 16px; }
  .brand { gap: 8px; }
  .brand strong { font-size: 19px; }
  .brand-mark { width: 27px; height: 27px; }
  .brand-en { padding-left: 10px; margin-left: 2px; font-size: 10px; }
  .header-tools { gap: 0; }
  .local-label { display: none; }
  .nav-button { font-size: 11px; }
  main { display: flex; flex-direction: column; height: auto; min-height: calc(100dvh - 48px); gap: 9px; padding: 8px 10px max(10px, env(safe-area-inset-bottom)); }
  .launch-bar { min-height: 42px; padding: 0 2px; }
  .recipe { display: block; }
  .recipe strong { font-size: 14px; }
  .recipe > span { display: block; font-size: 9px; margin-top: 3px; }
  .launch-actions { gap: 9px; }
  .stepper { gap: 3px; }
  .stepper > span { display: none; }
  .stepper button { width: 28px; height: 32px; }
  .stepper output { width: 20px; font-size: 12px; }
  .launch-actions .button { min-height: 36px; padding: 0 11px; font-size: 11px; }
  .mobile-tabs { display: flex; gap: 3px; padding: 3px; border-radius: 10px; background: rgb(91 123 104 / .08); }
  .mobile-tabs button { flex: 1; min-height: 32px; border-radius: 7px; font-size: 12px; color: #7c9183; }
  .mobile-tabs button[aria-pressed=true] { background: #ffffffab; box-shadow: 0 2px 5px #1e452b08; color: var(--brand-strong); font-weight: 600; }
  .mobile-tabs span { font-size: 9px; font-weight: 400; margin-left: 5px; opacity: .7; }
  .workspace { display: block; flex: 1; }
  body[data-mobile-view="numbers"] .results-panel, body[data-mobile-view="results"] .numbers-panel { display: none; }
  .panel { padding: 11px; border-radius: 13px; }
  .panel-heading { min-height: 26px; }
  h1, h2 { font-size: 13px; }
  .numbers-panel .panel-heading { display: none; }
  .mode-row { margin: 0 0 10px; }
  .mode-switch { width: 100%; }
  .mode-switch button { flex: 1; min-height: 30px; font-size: 11px; padding: 0 8px; }
  .mode-help { display: none; }
  .number-grid { grid-template-columns: repeat(8, minmax(0, 1fr)); grid-template-rows: repeat(10, minmax(32px, 1fr)); flex: none; min-height: 0; gap: 5px; }
  .number { height: clamp(32px, calc((100dvh - 415px) / 10), 43px); border-radius: 7px; font-size: 13px; }
  .grid-footer { padding: 8px 0; }
  .legend { gap: 9px; font-size: 9px; }
  .button.small { min-height: 30px; padding: 0 11px; font-size: 10px; }
  .settings-details summary { padding: 7px 0; font-size: 9px; }
  .distribution-summary { padding: 9px; gap: 7px; font-size: 9px; }
  .distribution-summary b { margin: 0 2px; }
  .distribution-summary i { margin: 0 2px; }
  .results-panel { min-height: calc(100dvh - 195px); }
  .results-meta { font-size: 9px; margin: 6px 0 10px; }
  .groups { overflow: visible; gap: 7px; padding: 0; flex: none; }
  .group-card { padding: 8px; }
  .group-top { margin-bottom: 5px; }
  .group-actions button { min-height: 26px; font-size: 10px; }
  .group-numbers { gap: 3px; }
  .ball { height: 27px; font-size: 11px; border-radius: 5px; }
  .results-footer { margin-top: 12px; padding-top: 10px; flex-wrap: wrap; gap: 9px; }
  .results-footer > span { font-size: 9px; }
  .results-footer > div { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }
  .results-footer .button { min-height: 38px; }
  .empty-state { min-height: 240px; }
  .footer { font-size: 9px; margin-top: 1px; }
  .drawer { max-width: 100vw; width: 100%; border-radius: 0; }
  dialog { padding: 20px; }
  .dialog-heading h2 { font-size: 17px; }
  .dialog-description { font-size: 11px; }
  .edit-grid .number { height: 42px; }
  .assist { display: block; position: fixed; left: 0; top: 0; z-index: 50; width: 48px; height: 48px; opacity: 0; --safe-top: env(safe-area-inset-top, 0px); --safe-bottom: env(safe-area-inset-bottom, 0px); --safe-left: env(safe-area-inset-left, 0px); --safe-right: env(safe-area-inset-right, 0px); }
  .assist[data-ready=true] { opacity: 1; }
  .assist[data-settling=true] { transition: transform 280ms cubic-bezier(.22,1,.36,1); }
  .assist-trigger { display: grid; place-items: center; width: 48px; height: 48px; padding: 0; border: 1px solid #ffffff40; border-radius: 16px; color: white; background: rgb(38 43 47 / .84); box-shadow: 0 4px 14px #00000025, inset 0 1px 0 #ffffff20; backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; opacity: .48; transition: opacity 180ms, transform 180ms; }
  .assist-trigger:focus-visible, .assist-trigger:hover, .assist[data-open=true] .assist-trigger, .assist[data-dragging=true] .assist-trigger { opacity: 1; }
  .assist[data-dragging=true] .assist-trigger { transform: scale(1.05); }
  .assist-orb { width: 34px; height: 34px; border: 2px solid #ffffff4d; background: #ffffff24; border-radius: 50%; display: grid; place-items: center; pointer-events: none; }
  .assist-orb > span { width: 23px; height: 23px; border-radius: 50%; background: linear-gradient(145deg,#fff,#dfe5e1); box-shadow: 0 1px 3px #0003,0 0 0 2px #ffffff20; }
  .assist-panel { position: absolute; display: grid; grid-template-columns: 1fr 1fr; gap: 3px; width: 210px; padding: 10px; border: 1px solid #ffffff29; border-radius: 22px; background: rgb(38 43 47 / .9); color: white; box-shadow: 0 12px 36px #0003; backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); overflow: auto; overscroll-behavior: contain; }
  .assist-panel button { min-height: 62px; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 5px; padding: 5px; color: white; border-radius: 12px; font-size: 11px; }
  .assist-panel button > span { font-size: 22px; line-height: 1; }
  .assist-panel button:hover, .assist-panel button:active { background: #ffffff1f; }
  .assist-panel button:focus-visible { outline-color: #9fe4d5; outline-offset: -2px; }
}
@media (prefers-reduced-motion: reduce) {
  *, .assist[data-settling=true] { transition: none !important; scroll-behavior: auto !important; }
}

/* Editing and comparison stay in dialogs to keep the workbench compact. */
.history-tools { display: flex; gap: 4px; }
.history-tools button { display: flex; align-items: center; gap: 4px; min-height: 32px; padding: 0 9px; border-radius: 7px; background: #ffffff70; color: var(--brand-strong); font-size: 11px; }
.history-tools button > span:first-child { font-size: 21px; line-height: 1; }
.result-tools { display: flex; gap: 6px; }
.edit-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; gap: 8px; }
.edit-toolbar .edit-count { margin: 0; }
.edit-toolbar > div:last-child { display: flex; gap: 14px; }
.number.swap-source { background: #f7e4c6; border: 2px solid #ab7431; color: #81541d; }
.number.added:not(.swap-source) { box-shadow: inset 0 -3px #0f8067; }
.edit-preview { margin-top: 12px; padding: 10px 12px; background: #e1eee67a; border-radius: 9px; font-size: 11px; line-height: 1.8; overflow-wrap: anywhere; color: #456e5a; }
#edit-stats { color: var(--muted); font-size: 10px; }
.compare-dialog { width: 620px; }
.compare-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.compare-card { border: 1px solid var(--line); background: #ffffff60; border-radius: 12px; padding: 12px; min-width: 0; }
.compare-card label { font-size: 11px; color: var(--muted); }
select { font: inherit; color: var(--ink); border: 1px solid #bdd3c6; border-radius: 7px; padding: 7px; background: #ffffffb0; }
select:focus-visible { outline: 3px solid #6ebfab; outline-offset: 2px; }
.compare-card select { display: block; width: 100%; margin: 6px 0 12px; }
.compare-balls { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 5px; }
.compare-balls .ball { height: 30px; }
.ball.common { background: #dcefe8; color: #136a54; }
.ball.unique-a { background: #f8e8ce; color: #825723; }
.ball.unique-b { background: #e5e4f5; color: #625198; }
.compare-card p { font-size: 11px; color: var(--muted); line-height: 1.8; margin-top: 10px; overflow-wrap: anywhere; }
.compare-card .unique-text-a { color: #825723; }
.compare-card .unique-text-b { color: #625198; }
.compare-common { margin-top: 14px; font-size: 11px; color: var(--brand-strong); line-height: 1.8; }
.compare-common b { display: block; font-weight: 500; }
.frequency-details { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; }
.frequency-details summary { cursor: pointer; font-size: 11px; color: var(--muted); }
.frequency-grid { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 6px; margin-top: 12px; }
.frequency-item { display: flex; flex-direction: column; gap: 4px; padding: 7px 2px; text-align: center; background: #ffffff70; border-radius: 6px; }
.frequency-item b { font-size: 12px; color: #42735c; }
.frequency-item span { font-size: 10px; color: var(--muted); }
.compare-note { font-size: 10px; margin-top: 14px; color: var(--muted); }
@media (max-width: 760px) {
  .header-tools { gap: 6px; }
  .history-tools button { min-width: 32px; padding: 0 6px; }
  .history-label { display: none; }
  .brand-en { display: none; }
  .group-actions { gap: 12px; }
  .result-tools { gap: 4px; }
  .result-tools .button { padding-inline: 8px; }
  .compare-dialog { padding: 16px; }
  .compare-columns { gap: 8px; }
  .compare-card { padding: 9px; }
  .compare-balls { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
  .compare-card p { font-size: 10px; }
  .frequency-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
