:root {
  color-scheme: light;
  --ink: #25292f;
  --muted: #737b85;
  --quiet: #9098a1;
  --paper: #e9ebee;
  --panel: #fff;
  --line: #dce0e5;
  --soft: #f4f5f7;
  --accent: #b52435;
  --accent-hover: #981c2b;
  --stage: #272b31;
  --glow: .5;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-size: 14px;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button, input, select { font: inherit; }
button, a, input, select, summary, [tabindex] { outline-offset: 3px; }
:focus-visible { outline: 2px solid var(--accent); }
button { min-height: 36px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid #d7dce2; border-radius: 5px; padding: 8px 12px; background: #fff; color: var(--ink); font-size: 13px; font-weight: 550; line-height: 1.45; cursor: pointer; transition: background-color .14s, border-color .14s, box-shadow .14s; }
button:hover:not(:disabled) { background: #f0f2f5; border-color: #b8c0ca; }
button:disabled { cursor: not-allowed; color: #a0a6ad; border-color: #e5e8ec; background: #f4f5f7; }
button.primary { color: white; background: var(--accent); border-color: var(--accent); }
button.primary:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); }
button.primary:disabled { background: #eddcdf; color: #ae858c; border-color: #eddcdf; }
button.text { min-height: 32px; border: 0; padding: 6px 0; background: transparent; color: var(--muted); font-size: 12px; }
button.text:hover:not(:disabled) { color: var(--ink); background: transparent; }
button.text:disabled { color: #a5abb3; background: transparent; }
button.compact { white-space: nowrap; }
button.full-width { width: 100%; }
button svg { width: 16px; height: 16px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
button.icon-button { width: 35px; min-width: 35px; padding: 8px; }
input:not([type=checkbox]):not([type=range]):not([type=file]), select { display: block; width: 100%; min-width: 0; min-height: 38px; border: 1px solid #d9dee4; border-radius: 5px; background: #fff; color: var(--ink); padding: 9px 10px; font-size: 13px; line-height: 1.4; }
input:disabled, select:disabled { color: #9aa1aa !important; background: #f4f5f7 !important; cursor: not-allowed; }
input::placeholder { color: #929aa4; }
input[type=checkbox] { width: 14px; height: 14px; margin: 3px 0 0; accent-color: var(--accent); flex-shrink: 0; }
input[type=range] { display: block; width: 100%; margin: 11px 0 0; accent-color: var(--accent); }
label { display: block; margin: 14px 0 7px; font-size: 12px; font-weight: 550; color: #505965; line-height: 1.5; }
h1, h2, h3, p { margin: 0; }
h2 { font-size: 15px; font-weight: 650; letter-spacing: -.15px; }
h3 { font-size: 13px; font-weight: 600; }
p { color: var(--muted); font-size: 13px; line-height: 1.7; overflow-wrap: anywhere; }
a { color: inherit; }
small, .small { display: block; font-size: 11px; line-height: 1.65; color: var(--muted); }
svg { flex-shrink: 0; }
.app-shell { min-height: 100dvh; display: flex; flex-direction: column; }
.topbar { height: 64px; min-height: 64px; display: flex; align-items: center; gap: 24px; padding: 0 24px; border-bottom: 1px solid var(--line); background: #fafbfc; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; padding-right: 24px; border-right: 1px solid var(--line); }
.brand-mark { font-size: 25px; line-height: 1; font-weight: 730; letter-spacing: -1.1px; }
.brand-mark > span { color: #7b838e; font-weight: 450; }
.brand-mark::after { content: ""; display: inline-block; width: 5px; height: 5px; margin-left: 5px; background: var(--accent); vertical-align: 3px; }
.brand-name { margin-top: 4px; color: #68717d; font-size: 10px; font-weight: 700; letter-spacing: 2px; }
.device-identity { min-width: 0; }
.device-heading { display: flex; align-items: center; gap: 12px; }
.device-heading h2 { font-size: 13px; font-weight: 620; }
#status { display: inline-flex; align-items: center; gap: 5px; font-size: 10px; color: #7d858f; white-space: nowrap; }
#status::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: #a4abb3; }
#status.connected { color: #497961; }
#status.connected::before { background: #5f9278; }
#deviceInfo { font-size: 10px; line-height: 1.45; margin-top: 4px; }
.connection-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.connection-actions > .text { margin-right: 8px; font-size: 11px; }
.initialization-bar { position: relative; min-height: 32px; display: flex; align-items: center; gap: 8px; padding: 5px 24px; background: #f1f3f5; border-bottom: 1px solid var(--line); color: #717a86; font-size: 11px; }
.connection-indicator { width: 5px; height: 5px; flex-shrink: 0; background: #a9b0b9; border-radius: 50%; }
#initStatus { line-height: 1.55; }
#initProgress { position: absolute; appearance: none; -webkit-appearance: none; border: 0; bottom: -1px; left: 0; width: 100%; height: 2px; background: #e7d5d8; z-index: 1; }
#initProgress::-webkit-progress-bar { background: #e7d5d8; }
#initProgress::-webkit-progress-value { background: var(--accent); }
#initProgress::-moz-progress-bar { background: var(--accent); }
#cancelInit { margin: -4px 0; min-height: 24px; padding: 2px 8px; color: var(--accent); font-size: 11px; }
.local-label { margin-left: auto; white-space: nowrap; font-size: 10px; letter-spacing: .15px; color: #8b939d; }
.local-label span { padding: 0 7px; color: #b7bdc6; }
#message:empty { display: none; }
#message { flex-shrink: 0; max-height: 76px; overflow: auto; padding: 9px 24px; background: #fbf4e9; border-bottom: 1px solid #e5d8c4; color: #806c4f; font-size: 12px; line-height: 1.65; overflow-wrap: anywhere; }
.workspace { display: grid; grid-template-columns: minmax(0, 1fr) 360px; align-items: start; min-width: 0; width: 100%; max-width: 1480px; margin: 0 auto; padding: 0 20px 24px; gap: 16px; }
.canvas-pane { min-width: 0; min-height: 0; display: flex; flex-direction: column; padding: 0; overflow: visible; }
.keyboard-stage { display: flex; flex-direction: column; min-width: 0; padding: 20px 18px 16px; border: 1px solid #20242a; border-radius: 8px; background: radial-gradient(ellipse at 50% 42%, #373d44 0%, #292e35 58%, #252a30 100%); box-shadow: 0 1px 2px #20262d10; }
.canvas-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; }
.eyebrow { font-size: 9px; letter-spacing: 2px; font-weight: 550; color: #969da7; }
.canvas-heading h2 { font-size: 19px; letter-spacing: .1px; font-weight: 580; color: #e2e5e9; margin-top: 7px; line-height: 1.3; }
.canvas-heading h2 > span { font-size: 9px; letter-spacing: .8px; font-weight: 500; color: #9ca3ad; border: 1px solid #535b66; border-radius: 3px; padding: 3px 5px; vertical-align: 3px; margin-left: 8px; }
.canvas-view { display: flex; flex-shrink: 0; padding: 3px; gap: 2px; background: #1f2329; border: 1px solid #404650; border-radius: 5px; }
button.view-button { min-height: 27px; padding: 4px 9px; font-size: 11px; border: 1px solid transparent; border-radius: 3px; color: #949da9; background: transparent; }
button.view-button[aria-pressed=true] { color: #e5e8ed; background: #414852; border-color: #505762; box-shadow: 0 1px 2px #0002; }
button.view-button:hover:not(:disabled) { background: #3c434d; border-color: #59616d; color: #fff; }
.keyboard-center { display: flex; flex-direction: column; justify-content: center; min-width: 0; padding: 22px 0 13px; }
.keyboard-scroll { width: 100%; flex-shrink: 0; overflow-x: auto; overflow-y: hidden; padding: 6px 5px 20px; scrollbar-width: thin; scrollbar-color: #626974 transparent; }
.keyboard-shell { width: 100%; min-width: 704px; max-width: 1120px; margin: auto; padding: 12px 14px 8px; border: 1px solid #e1e3e5; border-bottom: 7px solid #989da4; border-radius: 9px; background: linear-gradient(145deg, #d9dde1 0%, #eceef0 42%, #c8cdd2 100%); box-shadow: 0 2px 0 #6e747d, 0 22px 26px -12px #0007, inset 0 1px 1px #fff; }
.keyboard-top { display: flex; align-items: center; justify-content: space-between; padding: 0 4px 11px; color: #8a9098; font-size: 8px; letter-spacing: 1.6px; }
.keyboard-top b { font-size: 8px; color: #777e88; font-weight: 650; }
.keyboard-top > span { display: flex; align-items: center; gap: 7px; }
.keyboard-top i { width: 3px; height: 3px; background: #8d939b; border-radius: 50%; }
#keyboard { display: flex; flex-direction: column; gap: 5px; }
.key-row { display: flex; gap: 4px; }
.key-row:first-child { margin-bottom: 6px; }
.key { position: relative; flex: var(--w); display: grid; place-items: center; min-width: 0; min-height: 0; height: clamp(34px, 2.95vw, 43px); padding: 0 1px 3px; border: 1px solid #afb6bf; border-bottom: 4px solid #b5bbc3; border-radius: 4px; background: linear-gradient(160deg, #fcfdfe 12%, #e9ecf0 100%); color: #545d69; font-size: clamp(10px, .79vw, 11px); font-weight: 560; line-height: 1; box-shadow: 0 1px 1px #626b7550, inset 0 1px 0 #fff; user-select: none; }
.key:disabled { opacity: 1; border-color: #b5bcc4; border-bottom-color: #b5bbc3; background: linear-gradient(160deg, #f5f7f9 12%, #e3e7eb 100%); color: #737d89; }
.key-gap { flex: var(--w); min-width: 0; pointer-events: none; }
.key.editable { cursor: pointer; }
.key.editable:hover:not(:disabled) { background: #fff; border-color: #929aa6; border-bottom-color: #a0a8b2; color: #232b35; }
.key.led-on { color: #46505c; background: #fff; box-shadow: 0 1px 1px #626b7560, 0 0 calc(4px + var(--glow)*7px) #ffffffc2, inset 0 1px 0 #fff; }
.key.led-off { background: linear-gradient(#c8ced5, #b9c1ca); color: #65707d; border-color: #9aa4b0; border-bottom-color: #959faa; box-shadow: 0 1px 1px #626b7550; }
.key.selected { color: var(--accent); background: #fff8f8; border: 1px solid var(--accent); border-bottom: 4px solid #a02534; box-shadow: 0 0 0 1px #b524352a, inset 0 1px 0 #fff; }
.key.remapped::after { content: ""; position: absolute; top: 4px; right: 4px; width: 4px; height: 4px; border-radius: 50%; background: var(--accent); }
.keyboard-bottom { display: flex; align-items: center; justify-content: space-between; margin: 9px 3px 0; color: #939aa3; font-size: 6px; letter-spacing: 1.3px; }
.keyboard-bottom > span:first-child { color: #858d97; font-size: 8px; font-weight: 750; letter-spacing: 1.5px; }
.canvas-caption { display: flex; justify-content: space-between; gap: 12px; padding: 0 8px; color: #919aa5; font-size: 11px; line-height: 1.6; }
.canvas-caption-side { white-space: nowrap; color: #76818e; font-size: 10px; }
.canvas-bottom { display: flex; align-items: center; justify-content: space-between; gap: 15px; border-top: 1px solid #ffffff0e; padding-top: 12px; }
#workspaceHint { font-size: 11px; color: #a2aab5; }
.canvas-coordinate { white-space: nowrap; font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: 9px; letter-spacing: .8px; color: #646e7b; }
.canvas-context { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-shrink: 0; min-height: 61px; padding: 12px 3px; border-bottom: 1px solid #d4d9df; }
.selected-key { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; min-width: 0; font-size: 12px; }
.context-label { color: #8a929c; font-size: 10px; flex-shrink: 0; }
#selectedKeyLabel { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; color: #414b59; font-size: 12px; font-weight: 600; }
.mapping-arrow { color: #a5adb7; }
#selectedKeyTarget { color: #697583; font-size: 12px; }
.canvas-legend { display: flex; gap: 14px; white-space: nowrap; font-size: 10px; color: #8a929d; }
.canvas-legend > span { display: inline-flex; align-items: center; gap: 5px; }
.canvas-legend i { display: inline-block; width: 7px; height: 7px; border-radius: 2px; border: 1px solid #bbc2cb; background: #fff; }
.canvas-legend .legend-off { background: #aab3bf; border-color: #aab3bf; }
.canvas-legend .legend-draft { width: 5px; height: 5px; border-radius: 50%; border-color: var(--accent); background: var(--accent); }
.draft-overview { padding: 14px 3px 12px; border-bottom: 1px solid #d4d9df; flex-shrink: 0; }
.draft-overview h2 { font-size: 12px; }
.draft-lines { margin-top: 7px; max-height: 76px; overflow-y: auto; font-size: 12px; line-height: 1.8; color: #697380; }
.draft-lines > div { display: inline-block; font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: 10px; padding: 1px 7px; margin: 5px 6px 0 0; background: #f5f6f8; border: 1px solid #d8dde4; border-radius: 3px; }
.device-readback { display: flex; align-items: baseline; gap: 12px; padding: 12px 3px 0; flex-shrink: 0; }
#deviceSummary { font-size: 11px; line-height: 1.6; flex: 1; }
.readback-note { font-size: 9px; color: #959da8; max-width: 160px; line-height: 1.6; text-align: right; }
.inspector { display: flex; flex-direction: column; min-height: 0; min-width: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.workspace-tabs { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); width: min(100%, 620px); border: 1px solid var(--line); border-radius: 8px; padding: 4px; gap: 4px; background: #f7f8fa; }
.workspace-tabs > button { position: relative; min-width: 0; border: 0; border-radius: 5px; background: transparent; font-size: 13px; padding: 11px 7px; font-weight: 500; color: #9299a2; white-space: nowrap; }
.workspace-tabs > button:hover { background: #f5f6f8; color: #4d5664; }
.workspace-tabs > button[aria-selected=true] { color: var(--accent); font-weight: 650; background: #fff; box-shadow: 0 1px 4px #30384412; }
.inspector-body { min-width: 0; overflow: visible; }
.workspace-panel { outline-offset: -4px; }
.property-section { padding: 20px; border-bottom: 1px solid #e6e9ed; }
.property-section:last-child { border-bottom: 0; }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.section-intro { margin: 9px 0 15px; font-size: 12px; line-height: 1.75; }
.verified { display: inline-flex; align-items: center; gap: 5px; font-size: 10px; font-weight: 500; color: #648373; white-space: nowrap; }
.verified::before { content: ""; height: 4px; width: 4px; background: #779b88; border-radius: 50%; }
.subtle-tag { font-size: 10px; color: #9098a3; font-weight: 400; white-space: nowrap; }
.state-line { margin: 11px 0 16px; padding: 10px 11px; border: 1px solid #e5e8ed; border-radius: 4px; background: #f7f8fa; font-size: 11px; line-height: 1.75; }
.field-action { display: flex; align-items: stretch; gap: 8px; }
.field-action > select { flex: 1; }
.field-action > button { font-size: 12px; }
.result { margin-top: 9px; font-size: 11px; line-height: 1.7; }
.result:empty { display: none; }
.mode-editor { margin-top: 16px; border-top: 1px solid #e6e9ed; padding-top: 2px; }
.consent { display: flex; align-items: flex-start; gap: 8px; margin: 13px 0; color: #717b87; font-size: 12px; line-height: 1.7; font-weight: 400; }
.speed-consent { margin-bottom: 12px; }
.range-heading { display: flex; justify-content: space-between; align-items: center; }
.range-heading label { margin: 0; font-size: 11px; color: #87909c; }
.range-heading output { font-size: 11px; color: #65707f; padding: 2px 7px; border: 1px solid #e3e7ec; border-radius: 3px; min-width: 25px; text-align: center; }
.range-labels { display: flex; justify-content: space-between; padding: 0 2px; margin-top: 3px; font-family: ui-monospace, monospace; color: #a0a8b3; font-size: 10px; }
.mode-preview { display: flex; align-items: center; gap: 12px; margin: 13px 0; padding: 10px; background: #f4f5f7; border-radius: 4px; }
.mode-preview > span { opacity: var(--preview-light, .8); width: 28px; height: 28px; flex-shrink: 0; border: 1px solid #c8ced7; border-bottom: 3px solid #b7bec9; border-radius: 4px; background: #fff; box-shadow: 0 0 9px #fff; }
.mode-preview b { display: block; font-size: 11px; font-weight: 550; color: #65717f; }
.mode-preview small { font-size: 9px; color: #929ba7; margin-top: 3px; }
.mode-preview.breathing > span { animation: preview-breath var(--preview-period, 4s) ease-in-out infinite; }
@keyframes preview-breath { 50% { opacity: calc(var(--preview-light, .8) * .2); box-shadow: none; } }
.context-details { margin-top: 15px; padding-top: 12px; border-top: 1px solid #e6e9ed; }
summary { cursor: pointer; color: #687380; font-size: 11px; line-height: 1.8; }
summary::marker { color: #959faa; font-size: 10px; }
details p { margin: 10px 0; font-size: 11px; line-height: 1.85; }
.preset-grid, .file-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.preset-grid > button, .file-actions > button { padding: 8px 5px; font-size: 12px; }
.per-key-editor > .text { margin: 5px 0 9px; }
.inline-notice { margin: 12px 0; border-left: 2px solid #c0a06b; background: #faf7f1; color: #8a7757; padding: 10px 11px; font-size: 12px; line-height: 1.8; }
#startRemapPlan { margin-top: 8px; }
.remap-edit { border-top: 1px solid #e6e9ed; margin-top: 18px; padding-top: 2px; }
.field-connector { width: 24px; text-align: center; font-size: 15px; color: #a3adb9; margin: 6px auto -7px; }
#setRemap { margin-top: 13px; }
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.split-actions { justify-content: space-between; margin-top: 7px; }
.split-actions > .text { font-size: 10px; }
.modifier-test .small { margin-top: 10px; }
.effect-confirmation { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.effect-confirmation > button { min-width: 0; flex: 1 1 140px; }
.privacy-drawer { min-width: 0; }
.privacy-drawer > summary { padding: 8px 0; cursor: pointer; color: #566374; font-size: 11px; }
.privacy-drawer[open] { order: 4; flex-basis: 100%; }
.privacy-content { max-width: 800px; padding: 12px 0 20px; color: #475569; font-size: 12px; line-height: 1.7; overflow-wrap: anywhere; }
.privacy-content h2 { margin: 0 0 10px; font-size: 16px; }
.privacy-content p { margin: 10px 0; }
.privacy-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.privacy-actions > button { min-width: 0; max-width: 100%; }
#modifierTest { font-size: 11px; background: #fafbfc; }
#loadMacroEditor { margin-top: 8px; font-size: 12px; }
.event-composer { background: #f6f7f9; border: 1px solid #e4e8ed; border-radius: 5px; padding: 13px; margin-top: 20px; }
.event-fields { display: grid; grid-template-columns: 75px minmax(0, 1fr); gap: 8px; }
.label-note { float: right; color: #929ba7; font-size: 10px; font-weight: 400; }
#appendMacroEvent { margin-top: 12px; }
.event-heading { margin-top: 17px; }
#macroEvents { counter-reset: macro-event; list-style: none; padding: 0; margin: 6px 0 0; border: 1px solid #e1e6ec; border-radius: 4px; max-height: 230px; overflow: auto; background: #fcfcfd; }
#macroEvents:empty::before { content: "暂无事件 · 从上方添加"; display: block; padding: 24px 12px; text-align: center; color: #9ca5b0; font-size: 11px; }
#macroEvents > li { counter-increment: macro-event; padding: 9px 10px; font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: 10px; color: #65717f; border-bottom: 1px solid #edf0f3; line-height: 1.65; overflow-wrap: anywhere; }
#macroEvents > li:last-child { border-bottom: 0; }
#macroEvents > li::before { content: counter(macro-event, decimal-leading-zero); display: inline-block; width: 24px; font-size: 9px; color: #a7afb9; }
#removeMacroAssignment { margin-top: 5px; }
.file-actions { margin: 10px 0; }
#useRemapPlan, #useLightingPlan { font-size: 12px; }
.danger-details > summary { color: #956d73; }
.mapping-apply-bar { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; gap: 26px; padding: 20px; border: 1px solid #d1d7df; border-radius: 8px; background: #fafbfc; box-shadow: 0 -5px 16px #242b3405; }
.write-warning { border-right: 1px solid #e0e4e9; padding-right: 22px; }
.write-warning h2 { display: flex; align-items: center; gap: 7px; font-size: 13px; }
.warning-mark { display: inline-grid; place-items: center; width: 16px; height: 16px; border: 1px solid #c3ad89; border-radius: 50%; color: #aa8b57; font-size: 10px; }
.write-warning > p { color: #817968; margin-top: 8px; font-size: 12px; line-height: 1.75; }
.write-warning > p.macro-risk { color: #999082; }
.write-preparation .actions { flex-wrap: nowrap; }
.write-preparation .actions > button { flex: 1; font-size: 12px; padding: 8px 9px; white-space: nowrap; }
.step-number { display: inline-grid; place-items: center; width: 17px; height: 17px; border: 1px solid #d6dce3; border-radius: 50%; font-family: ui-monospace, monospace; font-size: 9px; color: #8b95a3; }
.write-preparation .result { font-size: 11px; margin-top: 9px; }
#remapGate { margin-top: 5px; font-size: 10px; color: #969fab; }
.write-confirmation > .consent { margin-top: 0; margin-bottom: 11px; font-size: 12px; line-height: 1.65; }
#applyRemap { justify-content: space-between; padding: 9px 13px; }
.write-confirmation > small { font-size: 9px; margin-top: 6px; color: #9ca4af; }
.statusbar { position: relative; display: flex; flex-wrap: wrap; align-items: center; min-height: 31px; padding: 0 22px; gap: 20px; background: #f3f4f6; border-top: 1px solid #d6dce3; font-size: 9px; color: #929aa5; }
.statusbar-note { margin-right: auto; }
.version { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: 9px; color: #8d97a3; white-space: nowrap; }
.version > span { margin: 0 6px; color: #b6bec8; }
.support-drawer > summary { display: flex; align-items: center; gap: 6px; min-height: 30px; list-style: none; color: #778290; font-size: 10px; }
.support-drawer > summary::-webkit-details-marker { display: none; }
.support-drawer > summary svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.2; }
.support-drawer[open] > summary svg { transform: rotate(180deg); }
.support-content { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; width: 100%; padding: 22px 0; color: var(--ink); }
.support-content h2 { font-size: 14px; }
.support-content .section-heading > a { font-size: 10px; color: #798696; text-decoration: none; }
.support-content details { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 14px; }
.support-content > .diagnostics { border: 0; margin: 0; padding: 0; }
#browserSupport { margin: 12px 0 16px; }
.diagnostics > summary { font-size: 13px; color: #424e5d; font-weight: 600; }
.diagnostics summary > span { font-size: 9px; color: #a0a8b3; font-weight: 400; margin-left: 7px; }
.diagnostics .actions > button { font-size: 11px; }
pre { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 260px; overflow: auto; border: 1px solid #e3e8ee; border-radius: 4px; background: #f5f7f9; padding: 12px; font: 10px/1.75 ui-monospace, "SFMono-Regular", Consolas, monospace; color: #798596; }
#keymapRows { max-height: 200px; overflow: auto; padding-top: 8px; font: 10px/1.8 ui-monospace, monospace; color: #7c8796; }

/* Every pane uses normal document flow. Only the physical keyboard scrolls
   sideways, so tabs and the keyboard never cover narrow-screen controls. */
.workflow-guide { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 22px; padding: 18px 20px 14px; width: 100%; max-width: 1480px; margin: 0 auto; }
.workflow-guide > span { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: #4e5866; }
.workflow-guide b { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 1px solid #d3dae3; color: var(--accent); font-size: 11px; }
#nextStep { flex-basis: 100%; font-size: 12px; }
.workspace > *, .workspace-panel, .property-section, .write-preparation, .write-confirmation { min-width: 0; }
.lighting-fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.lighting-fields label { margin-top: 0; }
.speed-editor { margin-top: 14px; }
.draft-notice { color: #76565c; background: #fcf5f6; padding: 10px 12px; border-radius: 5px; font-size: 12px; margin: 12px 0; }
#applyLightingChanges { min-height: 43px; }
#readLighting { margin-top: 8px; }
#prepareMacroPlan { margin-bottom: 12px; }
.canvas-heading { flex-wrap: wrap; }
.canvas-context { flex-wrap: wrap; }
.device-readback { flex-wrap: wrap; }
.mapping-apply-bar .write-warning { grid-column: 1 / -1; padding: 0 0 14px; border-right: 0; border-bottom: 1px solid var(--line); }
.write-preparation .actions { flex-wrap: wrap; }
.write-preparation .actions > button { white-space: normal; min-width: 0; }
button { overflow-wrap: anywhere; }
.statusbar { margin-top: auto; }
.support-drawer[open] { order: 3; flex-basis: 100%; }
.support-drawer[open] > summary { padding-top: 12px; }
@media (max-width: 1150px) {
 .workspace { grid-template-columns: minmax(0, 1fr) 330px; padding: 0 16px 20px; gap: 14px; }
 .topbar { gap: 16px; padding: 0 16px; }
 .brand { padding-right: 16px; }
 .keyboard-stage { padding: 18px 14px 14px; }
 .canvas-heading h2 { font-size: 17px; }
 .property-section { padding: 18px; }
 .readback-note { max-width: none; text-align: left; }
}
@media (max-width: 960px) {
 .workspace { grid-template-columns: minmax(0, 1fr); padding: 0 16px 22px; }
 .canvas-pane { position: static; overflow: visible; }
 .workspace-tabs { position: static; width: 100%; }
 .keyboard-stage { padding: 16px; }
 .keyboard-center { padding: 12px 0 0; }
 .keyboard-shell { max-width: 860px; }
 .key { height: 34px; }
 .canvas-bottom { display: none; }
 .canvas-context { min-height: 40px; padding: 9px 2px; }
 .device-readback { padding-top: 10px; }
 .local-label { display: none; }
 .workspace-panel { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
 #panelMacros { display: block; }
 .property-section { border-bottom: 0; }
 .property-section + .property-section { border-left: 1px solid var(--line); }
 .mapping-apply-bar { gap: 16px; }
}
@media (max-width: 640px) {
 .topbar { height: auto; min-height: 0; flex-wrap: wrap; gap: 12px; padding: 14px; }
 .brand { border-right: 0; padding-right: 0; }
 .brand-mark { font-size: 24px; }
 .device-identity { flex: 1; min-width: 155px; }
 .device-heading { flex-wrap: wrap; gap: 5px 8px; }
 .device-heading h2 { font-size: 12px; }
 .connection-actions { flex-basis: 100%; min-width: 0; margin-left: 0; flex-wrap: wrap; gap: 7px; }
 .connection-actions > .text { margin-right: auto; font-size: 11px; }
 .connection-actions > button { font-size: 12px; }
 .initialization-bar { padding: 8px 14px; flex-wrap: wrap; }
 #initStatus { min-width: 0; flex: 1; }
 #message { max-height: none; padding: 10px 14px; }
 .workflow-guide { padding: 15px 14px 12px; gap: 8px 14px; }
 .workflow-guide > span { font-size: 11px; gap: 5px; }
 .workflow-guide b { width: 18px; height: 18px; }
 .workspace { padding: 0 10px 20px; gap: 12px; }
 .workspace-tabs { gap: 1px; padding: 3px; }
 .workspace-tabs > button { padding: 11px 3px; font-size: 12px; white-space: normal; }
 .keyboard-stage { padding: 12px 10px 9px; }
 .canvas-heading h2 { font-size: 14px; }
 .eyebrow { font-size: 8px; letter-spacing: 1.2px; }
 .keyboard-scroll { padding: 4px 2px 14px; }
 .keyboard-shell { min-width: 682px; padding: 10px 12px 7px; }
 .key { height: 32px; }
 .canvas-caption { padding: 0 2px; font-size: 10px; }
 .canvas-caption-side { display: none; }
 .canvas-context { gap: 8px; }
 .selected-key { gap: 6px; }
 .selected-key .context-label { display: none; }
 .canvas-legend { flex-wrap: wrap; gap: 12px; }
 .device-readback { gap: 4px 10px; }
 .readback-note { flex-basis: 100%; font-size: 10px; }
 .draft-overview { padding: 12px 2px; }
 .draft-lines { max-height: none; }
 .workspace-panel { display: block; }
 .property-section { padding: 18px 16px; border-bottom: 1px solid var(--line); }
 .property-section + .property-section { border-left: 0; }
 .section-intro, .state-line, .result { font-size: 12px; }
 button { min-height: 42px; }
 input:not([type=checkbox]):not([type=range]):not([type=file]), select { min-height: 42px; font-size: 14px; }
 .mapping-apply-bar { grid-template-columns: minmax(0, 1fr); padding: 18px 16px; }
 .write-confirmation { border-top: 1px solid var(--line); padding-top: 16px; }
 .statusbar { padding: 9px 14px; gap: 10px; }
 .support-content { display: block; }
 .support-content > .diagnostics { border-top: 1px solid var(--line); margin-top: 20px; padding-top: 16px; }
}
@media (max-width: 360px) {
 .lighting-fields { grid-template-columns: minmax(0, 1fr); }
 .connection-actions > .text { flex-basis: 100%; justify-content: flex-start; }
 .workflow-guide { gap: 8px; }
 .workflow-guide > span { font-size: 10px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }

.workspace-navigation { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; min-width: 0; }
.workspace-navigation > .workspace-tabs { flex: 1 1 500px; }
.skip-settings { margin-left: auto; white-space: nowrap; }

.experience-bar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 14px; max-width: 1480px; width: 100%; margin: 0 auto; padding: 20px; }
.experience-bar h2 { font-size: 18px; margin-bottom: 6px; }
.experience-switch { display: flex; gap: 4px; padding: 4px; border: 1px solid #d4dae3; border-radius: 7px; background: #f7f8fa; }
.experience-switch > button { border: 0; background: transparent; color: #6a7583; }
.experience-switch > button[aria-pressed=true] { background: #fff; color: #9f2333; box-shadow: 0 1px 4px #28354715; }
.workspace-tabs { grid-template-columns: repeat(2,minmax(0,1fr)); }
.workspace-tabs.advanced-tabs { grid-template-columns: repeat(4,minmax(0,1fr)); }
.mac-key-pair { display: flex; justify-content: center; align-items: center; gap: 20px; margin: 24px 0; }
.mac-key-pair > span { display: block; width: 112px; border: 1px solid #d1d7df; border-bottom: 4px solid #bcc5d0; background: #f8fafc; padding: 15px 8px; text-align: center; border-radius: 7px; color: #667381; line-height: 1.8; font-size: 12px; }
.mac-key-pair b { color: #35404e; font-size: 13px; font-weight: 550; }
.mac-key-pair i { font-style: normal; color: #9f2333; }
#applyMacRestore { margin-top: 10px; }
#macPlanConflict > button { margin-top: 8px; }
#panelMac { display: block; }
.write-confirmation > p { font-size: 12px; margin-bottom: 10px; }
@media (max-width: 640px) { .experience-bar { padding: 16px 14px 12px; gap: 12px; } .experience-switch { width: 100%; } .experience-switch > button { flex: 1; } .experience-bar h2 { font-size: 16px; } }

/* Daily use starts with the controls, not the 87-key editor. */
.experience-switch { border: 2px solid #b9c2cd; padding: 5px; }
.experience-switch > button { min-width: 132px; font-size: 14px; font-weight: 650; min-height: 44px; }
.experience-switch > button[aria-pressed=true] { background: #912438; color: #fff; }
.simple-mode .canvas-pane, .simple-mode .skip-settings, .simple-mode #deviceInfo,
.simple-mode #refreshDevice, .simple-mode #reconnect, .simple-mode .initialization-bar .local-label,
.simple-mode .support-content .diagnostics { display: none; }
.simple-mode .workspace { display: block; max-width: 760px; margin: 0 auto; }
.simple-mode .workspace-navigation { margin-bottom: 16px; }
.simple-mode .workspace-tabs { flex-basis: 100%; }
.simple-mode .experience-bar { max-width: 760px; }
.simple-mode .inspector { width: 100%; }
.simple-mode #panelLights { display: block; }
.simple-mode .lighting-fields { grid-template-columns: repeat(2,minmax(0,1fr)); }
.simple-mode #lightingResult { font-size: 12px; }
.simple-mode .context-details { display: none; }
.layout-options { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; margin: 24px 0 16px; }
.layout-option { display: flex; flex-direction: column; gap: 8px; padding: 22px 8px; background: #fff; border: 1px solid #bac4d0; border-radius: 8px; color: #344151; }
.layout-option strong { font-size: 16px; }
.layout-option span { font-size: 11px; font-weight: 400; }
.layout-option:not(:disabled):hover { background: #fcf0f2; border-color: #912438; }
.layout-options #applyMacRestore { margin: 0; }
#macSimpleProtection > button { margin-top: 8px; }
@media (max-width: 360px) { .experience-switch > button { min-width: 0; } .simple-mode .lighting-fields { grid-template-columns: minmax(0,1fr); } .layout-option strong { font-size: 14px; } }

/* Language navigation is part of normal document flow at every viewport. */
.site-intro{position:relative;margin:16px 0;padding:0 20px;min-width:0}
.site-intro h1{font-size:clamp(18px,2.2vw,26px);line-height:1.35;margin:0 0 6px;overflow-wrap:anywhere}
.site-intro p{font-size:13px;color:var(--muted);margin:6px 0;overflow-wrap:anywhere}
.language-switch{display:flex;flex-wrap:wrap;gap:8px;margin:10px 0}
.language-switch a{padding:6px 12px;border:1px solid #c8cdd4;border-radius:8px;color:inherit;text-decoration:none}
.language-switch a[aria-current="true"]{background:#252b35;color:white}
.usage-guide li{margin:10px 0;line-height:1.6}
.faq h3{font-size:15px;margin:16px 0 6px}
.site-intro,.support-content,.privacy-content{overflow-wrap:anywhere}
@media(max-width:600px){.site-intro{padding:0 12px}.language-switch{gap:6px}.connection-actions button{white-space:normal}.experience-switch button{white-space:normal}}
