@font-face { font-family: "Heyou Noto Sans SC"; src: url("/static/noto-sans-sc-400.woff2") format("woff2"); font-style: normal; font-weight: 100 900; font-display: swap; }
:root {
  color-scheme: light;
  --ink: #160b2b;
  --ink-2: #41384f;
  --muted: #786f86;
  --purple: #7428ee;
  --purple-dark: #4b149c;
  --purple-soft: #f4efff;
  --purple-faint: #fbf9ff;
  --line: #e8e2f1;
  --surface: rgba(255, 255, 255, .94);
  --page: #f5f4fa;
  --green: #087a59;
  --green-soft: #e9f8f2;
  --amber: #875800;
  --red: #c52b43;
  --shadow: 0 20px 55px rgba(31, 12, 57, .08), 0 2px 8px rgba(31, 12, 57, .035);
  --shadow-hover: 0 24px 64px rgba(45, 18, 81, .12), 0 4px 12px rgba(31, 12, 57, .045);
  font-family: "Heyou Noto Sans SC", Inter, "SF Pro Display", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-width: 320px; background: var(--page); scroll-behavior: smooth; }
body { min-height: 100vh; margin: 0; color: var(--ink); background:
  radial-gradient(circle at 9% 7%, rgba(124, 48, 236, .105), transparent 29rem),
  radial-gradient(circle at 94% 21%, rgba(59, 188, 151, .09), transparent 31rem),
  var(--page); }
button, input, select { font: inherit; }
button, a, input, select, summary { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button, select { min-height: 44px; }
button { transition: background-color .18s ease, border-color .18s ease, color .18s ease, box-shadow .18s ease, transform .18s ease; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible,
summary:focus-visible { outline: 3px solid rgba(116, 40, 238, .28); outline-offset: 3px; }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
.skip-link { position: fixed; z-index: 100; left: 16px; top: -80px; padding: 11px 15px; border-radius: 10px; background: #fff; color: var(--purple-dark); box-shadow: var(--shadow); font-size: 13px; font-weight: 850; text-decoration: none; }
.skip-link:focus { top: 12px; }

.topbar {
  position: sticky; z-index: 20; top: 0; min-height: 76px;
  padding: 0 clamp(18px, 4vw, 58px); color: #fff;
  background: rgba(24, 8, 48, .95); border-bottom: 1px solid rgba(255, 255, 255, .08);
  box-shadow: 0 8px 26px rgba(18, 4, 38, .12); backdrop-filter: blur(18px);
}
.topbar-inner { width: min(1320px, 100%); min-height: 76px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.brand-mark { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 14px; background: linear-gradient(145deg, #a064ff, #6919da); box-shadow: inset 0 1px rgba(255,255,255,.25), 0 8px 22px rgba(118, 43, 229, .35); font-size: 21px; font-weight: 900; }
.brand b, .brand small { display: block; }
.brand small { margin-top: 3px; color: #cfc1e6; font-size: 9px; letter-spacing: .13em; }
.top-actions { display: flex; align-items: center; gap: 9px; }
.login-user { max-width: 210px; overflow: hidden; color: #d8ccef; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.network-pill { min-height: 34px; display: inline-flex; align-items: center; gap: 7px; padding: 7px 11px; border: 1px solid rgba(134, 235, 195, .18); border-radius: 999px; background: rgba(34, 163, 115, .13); color: #aaf0d3; font-size: 12px; font-weight: 800; }
.network-pill i { width: 7px; height: 7px; border-radius: 50%; background: #45daa4; box-shadow: 0 0 0 4px rgba(69, 218, 164, .12); }
.network-pill.offline { border-color: rgba(255, 155, 166, .2); background: rgba(203, 42, 64, .13); color: #ffc1c9; }
.network-pill.offline i { background: #ef7182; box-shadow: none; }
.link-button { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; padding: 9px 14px; border: 1px solid rgba(255,255,255,.15); border-radius: 11px; color: #fff; text-decoration: none; font-size: 13px; transition: .2s ease; }
.link-button:hover { border-color: rgba(255,255,255,.28); background: rgba(255,255,255,.07); }

.page-shell { width: min(1240px, calc(100% - 34px)); margin: 38px auto max(72px, env(safe-area-inset-bottom)); }
.page-shell:focus { outline: none; }
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 390px); align-items: end; gap: clamp(28px, 5vw, 72px); padding: 22px 4px 30px; }
.kicker { display: block; color: var(--purple); font-size: 11px; font-weight: 900; letter-spacing: .17em; }
h1 { max-width: 780px; margin: 10px 0 15px; font-size: clamp(34px, 5vw, 58px); line-height: 1.07; letter-spacing: -.035em; }
h1 em { color: var(--purple); font-style: normal; }
.hero-copy > p { max-width: 780px; margin: 0; color: var(--muted); font-size: 16px; line-height: 1.78; }
.hero-badges { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.hero-badges span { min-height: 34px; display: inline-flex; align-items: center; padding: 7px 11px; border: 1px solid #dfd3ef; border-radius: 999px; background: rgba(255,255,255,.78); color: #655a74; font-size: 12px; font-weight: 750; }
.overview-panel { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; overflow: hidden; border: 1px solid #e5ddef; border-radius: 22px; background: #e8e0f1; box-shadow: var(--shadow); }
.overview-panel > div { min-height: 116px; padding: 23px; background: rgba(255,255,255,.96); }
.overview-panel > div > b { display: block; font-size: 34px; line-height: 1; }
.overview-panel > div > span { display: block; margin-top: 9px; color: var(--muted); font-size: 12px; font-weight: 800; }
.overview-panel .wide { grid-column: 1 / -1; min-height: 84px; display: flex; align-items: center; gap: 14px; }
.overview-panel .wide p, .overview-panel .wide b, .overview-panel .wide small { display: block; margin: 0; }
.overview-panel .wide b { font-size: 14px; }
.overview-panel .wide small { margin-top: 5px; color: var(--muted); font-size: 12px; }
.mode-orb { flex: 0 0 auto; width: 36px; height: 36px; border-radius: 12px; background: linear-gradient(145deg, #7c35ef, #5011ac); box-shadow: 0 8px 18px rgba(105, 29, 217, .28); }

.card { border: 1px solid rgba(226, 219, 236, .95); border-radius: 22px; background: var(--surface); box-shadow: var(--shadow); backdrop-filter: blur(12px); }
.pairing-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(280px, .8fr); gap: 18px; }
.pairing-card, .pairing-guide, .devices-card, .output-card { padding: clamp(19px, 3vw, 30px); }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 21px; }
.section-heading h2 { margin: 5px 0 0; font-size: 21px; letter-spacing: -.02em; }
.section-heading p { max-width: 620px; margin: 7px 0 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
label { display: block; margin-bottom: 9px; color: #40354f; font-size: 13px; font-weight: 850; }
.code-row { display: flex; gap: 10px; }
input, select { color: var(--ink); outline: none; }
.code-row input { flex: 1; min-width: 0; height: 52px; padding: 0 17px; border: 1px solid #d8cde7; border-radius: 12px; background: #fff; text-transform: uppercase; letter-spacing: .12em; }
input:focus, select:focus { border-color: var(--purple); box-shadow: 0 0 0 4px rgba(111, 36, 232, .09); }
.primary-button, .ghost-button, .command-group button, .config-sync-banner button { border: 0; cursor: pointer; }
.primary-button { min-width: 176px; min-height: 52px; padding: 0 21px; border-radius: 12px; color: #fff; background: linear-gradient(110deg, #8438f5, #5b14c7); box-shadow: 0 9px 20px rgba(103, 28, 212, .2); font-weight: 850; }
.primary-button:hover:not(:disabled), .configure-button:hover:not(:disabled), .settings-actions button:hover:not(:disabled) { box-shadow: 0 12px 24px rgba(103, 28, 212, .26); transform: translateY(-1px); }
.primary-button:disabled, button:disabled { cursor: not-allowed; opacity: .45; box-shadow: none; }
.field-help { margin: 10px 0 0; color: var(--muted); font-size: 12px; line-height: 1.65; }
.notice { margin-top: 15px; padding: 13px 15px; border: 1px solid #c9ebdd; border-radius: 11px; background: #effaf6; color: #087b57; font-size: 13px; line-height: 1.6; }
.notice.error { border-color: #f0c4ca; background: #fff1f3; color: #ad2237; }
.pairing-code-panel { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 16px; padding: 18px 20px; border: 1px solid #d9c6f8; border-radius: 16px; background: linear-gradient(135deg, #f7f2ff, #fcfbff); }
.pairing-code-panel span, .pairing-code-panel strong { display: block; }
.pairing-code-panel > div:first-child > span { color: var(--muted); font-size: 12px; font-weight: 850; letter-spacing: .05em; }
.pairing-code-panel strong { margin-top: 6px; color: var(--purple-dark); font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: clamp(24px, 4vw, 34px); letter-spacing: .16em; }
.pairing-countdown { flex: 0 0 auto; min-width: 62px; text-align: center; }
.pairing-countdown span { color: var(--purple); font-size: 24px; font-weight: 900; }
.pairing-countdown small { color: var(--muted); font-size: 11px; }
.pairing-countdown.expired span { color: var(--red); }
.pairing-guide { background: linear-gradient(145deg, #210b42, #140721); color: #fff; }
.pairing-guide .kicker { color: #b88bf8; }
.pairing-guide h2 { margin: 7px 0 18px; font-size: 20px; }
.pairing-guide ol { display: grid; gap: 13px; margin: 0; padding: 0; list-style: none; }
.pairing-guide li { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid rgba(255,255,255,.08); border-radius: 13px; background: rgba(255,255,255,.045); }
.pairing-guide li i { color: #bc8dff; font-size: 11px; font-style: normal; font-weight: 900; }
.pairing-guide li b, .pairing-guide li small { display: block; }
.pairing-guide li b { font-size: 13px; }
.pairing-guide li small { margin-top: 4px; color: #cbbedd; font-size: 12px; line-height: 1.5; }
.ghost-button { min-height: 44px; padding: 9px 14px; border: 1px solid #d8c7f2; border-radius: 10px; background: #fff; color: var(--purple-dark); font-size: 13px; font-weight: 800; }
.ghost-button:hover:not(:disabled) { border-color: #b994ed; background: #faf7ff; }

.devices-card { margin-top: 18px; }
.device-list { display: grid; gap: 14px; }
.device-item { position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: #fff; transition: border-color .2s, box-shadow .2s, transform .2s; }
.device-item:hover { border-color: #d3baf3; box-shadow: var(--shadow-hover); }
.device-accent { position: absolute; inset: 0 auto 0 0; width: 3px; background: linear-gradient(#8a43f4, #6020d4); }
.device-summary { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 20px; }
.device-main { flex: 1; min-width: 0; display: flex; align-items: flex-start; gap: 15px; }
.device-icon { position: relative; flex: 0 0 auto; width: 50px; height: 50px; display: grid; place-items: center; border-radius: 15px; background: var(--purple-soft); color: var(--purple); font-size: 11px; }
.device-icon i { position: absolute; top: 7px; right: 7px; width: 7px; height: 7px; border: 2px solid #fff; border-radius: 50%; background: #8d8499; }
.device-icon.online i { background: #19b783; box-shadow: 0 0 0 3px rgba(25,183,131,.12); }
.device-copy { min-width: 0; }
.device-title { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.device-title strong { font-size: 15px; }
.device-copy p { margin: 5px 0; color: #4f465a; font-size: 13px; line-height: 1.55; overflow-wrap: anywhere; }
.device-copy .device-owner { color: var(--purple-dark); font-weight: 750; }
.device-copy .device-capabilities { margin-top: 10px; padding: 8px 10px; border: 1px solid #eee8f5; border-radius: 9px; background: #faf9fc; color: #675e72; font-size: 12px; }
.device-status-line { display: flex; flex-wrap: wrap; gap: 6px 12px; margin: 8px 0; }
.device-status-line span { position: relative; color: var(--muted); font-size: 12px; }
.device-status-line span + span::before { content: ""; position: absolute; left: -7px; top: 5px; width: 2px; height: 2px; border-radius: 50%; background: #aa9eb7; }
.agent-priority { min-height: 27px; display: inline-flex; align-items: center; padding: 4px 8px; border-radius: 999px; background: #f1ecf8; color: #62566e; font-size: 11px; font-weight: 850; }
.agent-priority.active { background: var(--green-soft); color: var(--green); }
.agent-priority.paused { background: #fff4dd; color: var(--amber); }
.upgrade-hint { margin-top: 9px; padding: 9px 11px; border-radius: 9px; background: #fff6e2; color: #875800; font-size: 11px; line-height: 1.55; }
.upgrade-hint.required { background: #fff0f2; color: #ad2236; }
.device-error { display: grid; gap: 5px; margin-top: 10px; padding: 10px 12px; border: 1px solid #ffbdc5; border-radius: 10px; background: #fff0f2; color: #a91f34; }
.device-error.recovered { border-color: #b9e8d7; background: #edf9f4; color: #087b57; }
.device-error span { font-size: 12px; }
.device-error small { line-height: 1.5; }
.device-primary-actions { flex: 0 0 auto; display: flex; gap: 8px; }
.device-primary-actions button { min-width: 84px; min-height: 44px; padding: 10px 15px; border: 0; border-radius: 10px; cursor: pointer; font-size: 13px; font-weight: 850; }
.configure-button { color: #fff; background: linear-gradient(110deg, #8236f5, #5d15cc); box-shadow: 0 7px 16px rgba(102, 27, 210, .15); }
.delete-button { color: var(--red); background: #fff0f2; }
.delete-button:hover:not(:disabled) { background: #ffe4e8; }
.status-chip { min-height: 27px; display: inline-flex; align-items: center; padding: 5px 9px; border-radius: 999px; background: #f0f1f5; color: #615a6d; font-size: 11px; font-weight: 850; }
.status-chip.online { background: var(--green-soft); color: var(--green); }
.status-chip.offline { background: #f3f1f5; color: #746d7e; }
.status-chip.neutral { background: var(--purple-soft); color: var(--purple); }

.device-config { padding: 0 20px 20px; border-top: 1px solid #f0ecf5; }
.config-sync-banner { display: flex; align-items: center; gap: 12px; margin-top: 18px; padding: 13px 15px; border: 1px solid #d9eae4; border-radius: 12px; background: #f1faf7; }
.config-sync-banner.warning { border-color: #efdcae; background: #fff8e8; }
.config-sync-banner.error { border-color: #f0c1c7; background: #fff1f3; }
.sync-icon { flex: 0 0 auto; width: 10px; height: 10px; border-radius: 50%; background: #19b783; box-shadow: 0 0 0 5px rgba(25,183,131,.1); }
.config-sync-banner.warning .sync-icon { background: #d99415; box-shadow: 0 0 0 5px rgba(217,148,21,.1); }
.config-sync-banner.error .sync-icon { background: var(--red); box-shadow: 0 0 0 5px rgba(197,43,67,.09); }
.config-sync-banner p { flex: 1; margin: 0; }
.config-sync-banner b, .config-sync-banner small { display: block; }
.config-sync-banner b { font-size: 13px; }
.config-sync-banner small { margin-top: 3px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.config-sync-banner button { min-height: 44px; padding: 8px 12px; border-radius: 8px; background: #e5f5ef; color: #087b57; font-size: 12px; font-weight: 850; }
.config-tabs { position: sticky; z-index: 5; top: 88px; display: flex; gap: 6px; margin: 14px 0; padding: 6px; border: 1px solid #ebe5f2; border-radius: 13px; background: rgba(243,240,247,.96); backdrop-filter: blur(12px); }
.config-tabs button { flex: 1; min-height: 44px; padding: 9px 12px; border: 0; border-radius: 9px; background: transparent; color: #6e647a; cursor: pointer; font-size: 12px; font-weight: 850; }
.config-tabs button[aria-selected="true"] { background: #fff; color: var(--purple-dark); box-shadow: 0 4px 14px rgba(41,20,69,.08); }
.config-panel { padding: clamp(15px, 2vw, 20px); border: 1px solid #e7e0ef; border-radius: 14px; background: var(--purple-faint); }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.panel-heading > div { display: flex; align-items: center; gap: 9px; }
.panel-heading h3, .panel-heading p { margin: 0; }
.panel-heading h3 { font-size: 16px; }
.panel-heading p { max-width: 430px; color: var(--muted); font-size: 12px; line-height: 1.6; text-align: right; }
.panel-number { color: var(--purple); font-size: 11px; font-weight: 900; }
.setting-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.option-card { display: flex; align-items: flex-start; gap: 10px; min-height: 76px; margin: 0; padding: 13px; border: 1px solid #e1d7ed; border-radius: 12px; background: #fff; cursor: pointer; }
.option-card:hover { border-color: #cdb5ed; }
.option-card input, .result-fields input, .bind-setting input { flex: 0 0 auto; width: 17px; height: 17px; margin: 1px 0 0; accent-color: var(--purple); }
.option-card b, .option-card small { display: block; }
.option-card b { font-size: 13px; }
.option-card small { margin-top: 5px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.option-card.unsupported { opacity: .5; cursor: not-allowed; }
.runtime-card { margin-top: 10px; padding: 12px 13px; border: 1px solid #e1d8ed; border-radius: 11px; background: #fff; }
.runtime-card > span { color: var(--muted); font-size: 11px; font-weight: 850; }
.windows-runtime { margin: 5px 0 0; color: #087b57; font-size: 12px; line-height: 1.6; }
.windows-runtime.warning { color: var(--amber); }
.windows-runtime.error { color: var(--red); }
.settings-actions { display: flex; align-items: center; justify-content: space-between; gap: 13px; margin-top: 13px; }
.settings-actions button { min-height: 44px; padding: 10px 15px; border: 0; border-radius: 9px; background: linear-gradient(110deg, #8032f1, #5c17c6); color: #fff; cursor: pointer; font-size: 13px; font-weight: 850; }
.settings-actions span { color: var(--muted); font-size: 11px; line-height: 1.55; text-align: right; }
.hotkey-master { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 14px; border: 1px solid #e2d7f0; border-radius: 12px; background: #fff; }
.hotkey-master b, .hotkey-master small { display: block; }
.hotkey-master b { font-size: 13px; }
.hotkey-master small { margin-top: 4px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.hotkey-master .hotkey-runtime { color: var(--red); font-weight: 750; }
.hotkey-master .hotkey-runtime.ready { color: var(--green); }
.toggle { margin: 0; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle { min-width: 52px; min-height: 44px; display: inline-grid; place-items: center; cursor: pointer; }
.toggle span:not(.sr-only) { position: relative; display: block; width: 46px; height: 26px; border-radius: 999px; background: #c9c4d0; cursor: pointer; transition: .2s; }
.toggle span:not(.sr-only)::after { content: ""; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(31,12,49,.18); transition: .2s; }
.toggle input:checked + span { background: var(--purple); }
.toggle input:checked + span::after { transform: translateX(20px); }
.toggle input:focus-visible + span { outline: 3px solid rgba(116, 40, 238, .28); outline-offset: 3px; }
.action-hotkey-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-top: 10px; }
.hotkey-card { display: grid; grid-template-columns: minmax(0, 1fr) 126px; align-items: center; gap: 10px; min-height: 74px; margin: 0; padding: 12px; border: 1px solid #e2d9ed; border-radius: 12px; background: #fff; }
.hotkey-card b, .hotkey-card small { display: block; }
.hotkey-card b { font-size: 13px; }
.hotkey-card small { margin-top: 4px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.hotkey-card input, .processing-grid select { width: 100%; min-height: 44px; padding: 0 10px; border: 1px solid #d8cee7; border-radius: 9px; background: #fff; font-size: 12px; }
.hotkey-card input { color: #46138d; font-weight: 800; text-align: center; cursor: pointer; caret-color: transparent; }
.hotkey-card input:focus { outline: 3px solid rgba(116, 40, 238, .18); border-color: #8742ee; }
.hotkey-card input.capturing { background: #f5efff; }
.hotkey-card.unsupported { opacity: .45; }
.processing-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; margin-top: 10px; }
.processing-grid label { margin: 0; }
.processing-grid select { margin-top: 5px; }
.legacy-hotkey { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; pointer-events: none; }
.result-fields { display: flex; flex-wrap: wrap; gap: 6px 9px; margin: 12px 0 0; padding: 12px; border: 1px solid #dfd3f0; border-radius: 10px; background: #fff; }
.result-fields legend { padding: 0 6px; color: #554b62; font-size: 12px; font-weight: 850; }
.result-fields label { min-height: 44px; display: inline-flex; align-items: center; gap: 7px; margin: 0; padding: 6px 9px; border-radius: 8px; background: #faf8fd; font-size: 12px; cursor: pointer; }
.bind-setting { display: flex; align-items: flex-start; gap: 9px; margin: 10px 0 0; padding: 12px; border: 1px solid #ddd1eb; border-radius: 10px; background: #fff; }
.bind-setting b, .bind-setting small { display: block; }
.bind-setting b { font-size: 13px; }
.bind-setting small { margin-top: 4px; color: var(--muted); font-size: 11px; line-height: 1.55; }
.tool-section + .tool-section { margin-top: 14px; padding-top: 13px; border-top: 1px solid #e7e0ef; }
.tool-section > b { font-size: 13px; }
.command-group { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 9px; }
.command-group button { min-height: 44px; padding: 10px 13px; border: 1px solid transparent; border-radius: 9px; background: #efe8fa; color: #4f179c; font-size: 12px; font-weight: 850; }
.command-group button:hover:not(:disabled) { background: #e6d9f8; transform: translateY(-1px); }
.command-group button:disabled { border-color: #ece8f1; background: #f5f3f7; color: #8d8695; }
.capture-results { margin-top: 14px; padding: 14px; border: 1px solid #ded1f2; border-radius: 12px; background: #fff; }
.capture-results > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.capture-results button { min-height: 44px; padding: 8px 11px; border: 0; border-radius: 8px; background: #eee6fa; color: #5520a0; cursor: pointer; font-size: 12px; font-weight: 850; }
.capture-results pre { max-height: 420px; margin: 10px 0 0; padding: 13px; overflow: auto; border-radius: 9px; background: #160b29; color: #eee5ff; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.6; }
.empty-state { min-height: 150px; display: grid; place-content: center; justify-items: center; color: var(--muted); text-align: center; }
.empty-state b { color: var(--ink-2); }
.empty-state p { max-width: 430px; font-size: 13px; line-height: 1.65; }
.loading-dot { width: 10px; height: 10px; margin-bottom: 10px; border-radius: 50%; background: var(--purple); box-shadow: 18px 0 0 #c7a8f4, -18px 0 0 #c7a8f4; }

.output-card { margin-top: 18px; }
.output-card summary { min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 16px; cursor: pointer; list-style: none; }
.output-card summary::-webkit-details-marker { display: none; }
.output-card summary b { display: block; margin-top: 5px; font-size: 14px; }
.summary-hint { color: var(--muted); font-size: 12px; }
.output-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 16px 0 9px; }
.output-heading p { margin: 0; color: var(--muted); font-size: 12px; }
.output-card pre { min-height: 88px; max-height: 330px; margin: 0; padding: 16px; overflow: auto; border-radius: 13px; background: #160b29; color: #eee5ff; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.65; }

@media (max-width: 900px) {
  .hero, .pairing-grid { grid-template-columns: 1fr; }
  .overview-panel { max-width: 520px; }
  .pairing-guide ol { grid-template-columns: repeat(3, 1fr); }
  .pairing-guide li { align-items: flex-start; }
  .action-hotkey-grid { grid-template-columns: 1fr; }
  .config-tabs { top: 84px; }
}

@media (max-width: 720px) {
  .topbar { position: static; padding: 12px 16px; }
  .topbar-inner { min-height: auto; align-items: flex-start; }
  .top-actions { flex-wrap: wrap; justify-content: flex-end; }
  .network-pill, .login-user { display: none; }
  .page-shell { width: min(100% - 22px, 1240px); margin-top: 20px; }
  .hero { padding-top: 8px; }
  h1 { font-size: clamp(31px, 10vw, 44px); }
  .pairing-guide ol { grid-template-columns: 1fr; }
  .code-row { display: grid; }
  .primary-button { min-height: 48px; }
  .device-summary { flex-direction: column; }
  .device-primary-actions { width: 100%; }
  .device-primary-actions button { flex: 1; }
  .device-main { width: 100%; }
  .setting-cards, .processing-grid { grid-template-columns: 1fr; }
  .panel-heading { display: block; }
  .panel-heading p { margin-top: 7px; text-align: left; }
  .settings-actions { align-items: flex-start; flex-direction: column; }
  .settings-actions span { text-align: left; }
  .hotkey-card { grid-template-columns: minmax(0, 1fr) 115px; }
  .config-tabs { position: static; }
}

@media (max-width: 480px) {
  .topbar { padding: 11px max(12px, env(safe-area-inset-right)) 12px max(12px, env(safe-area-inset-left)); }
  .topbar-inner { display: grid; grid-template-columns: 1fr; gap: 10px; }
  .brand { min-width: 0; }
  .brand small { display: none; }
  .brand-mark { width: 40px; height: 40px; border-radius: 12px; }
  .top-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .link-button { width: 100%; min-height: 44px; padding: 8px; font-size: 12px; }
  .card { border-radius: 17px; }
  .pairing-card, .pairing-guide, .devices-card, .output-card { padding: 17px; }
  .section-heading { align-items: flex-start; gap: 10px; }
  .section-heading h2 { font-size: 19px; }
  #connectionSummary { flex: 0 0 auto; }
  .pairing-code-panel { align-items: flex-start; padding: 14px; }
  .pairing-code-panel strong { font-size: 21px; letter-spacing: .1em; }
  .pairing-countdown { min-width: 50px; }
  .overview-panel > div { min-height: 98px; padding: 19px; }
  .overview-panel > div > b { font-size: 29px; }
  .overview-panel .wide { min-height: 78px; }
  .device-summary { padding: 16px; }
  .device-main { align-items: flex-start; }
  .device-icon { width: 42px; height: 42px; }
  .device-copy { width: calc(100% - 56px); }
  .device-title { gap: 6px; }
  .device-title strong { flex: 1 0 100%; }
  .device-status-line { display: grid; gap: 5px; }
  .device-status-line span + span::before { display: none; }
  .device-config { padding: 0 12px 14px; }
  .config-tabs { display: grid; grid-template-columns: 1fr; gap: 5px; }
  .config-tabs button { width: 100%; min-height: 44px; padding: 9px 8px; font-size: 12px; text-align: left; }
  .config-sync-banner { align-items: flex-start; flex-wrap: wrap; }
  .config-sync-banner button { width: 100%; }
  .config-panel { padding: 14px; }
  .hotkey-master { align-items: flex-start; }
  .hotkey-card { grid-template-columns: 1fr; }
  .result-fields { display: grid; grid-template-columns: 1fr 1fr; }
  .result-fields label { min-width: 0; }
  .command-group { display: grid; grid-template-columns: 1fr 1fr; }
  .command-group button { width: 100%; }
  .capture-results { padding: 12px; }
  .capture-results > div { align-items: flex-start; }
  .output-card summary { align-items: flex-start; }
  .output-heading { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 390px) {
  .page-shell { width: calc(100% - 16px); margin-top: 14px; }
  .hero { gap: 20px; padding-bottom: 22px; }
  h1 { margin-top: 8px; font-size: 30px; }
  .hero-copy > p { font-size: 14px; line-height: 1.7; }
  .pairing-card, .pairing-guide, .devices-card, .output-card { padding: 14px; }
  .section-heading { flex-wrap: wrap; }
  .code-row input { padding: 0 13px; font-size: 13px; letter-spacing: .08em; }
  .device-summary { padding: 14px; }
  .device-main { gap: 10px; }
  .device-copy { width: calc(100% - 52px); }
  .device-primary-actions { gap: 7px; }
  .device-primary-actions button { min-width: 0; }
  .panel-heading h3 { font-size: 15px; }
  .setting-cards { gap: 7px; }
  .option-card { min-height: 70px; padding: 11px; }
  .result-fields, .command-group { grid-template-columns: 1fr; }
  .settings-actions button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition: none !important; }
}

@media (forced-colors: active) {
  .card, .device-item, .config-panel, .option-card, .hotkey-card, .runtime-card,
  .result-fields, .bind-setting { border: 1px solid CanvasText; }
  .primary-button, .configure-button, .settings-actions button { border: 1px solid ButtonText; }
  .status-chip, .agent-priority, .hero-badges span { border: 1px solid CanvasText; }
}
