/*
SPDX-FileCopyrightText: 2026 晨钟酱Official
SPDX-License-Identifier: GPL-3.0-only
See LICENSE for the full license text.
*/

/* Visual tokens and shared controls. Device behavior lives in the base styles. */
:root {
  --bg: #f6f7fb;
  --ink: #242b42;
  --muted: #747d92;
  --line: #e7eaf2;
  --shadow: 0 4px 20px #24324a04;
  --radius: 16px;
  font: 14px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  scroll-padding-top: calc(var(--header-height, 80px) + 20px);
}
html { scrollbar-width: auto; }
html::-webkit-scrollbar { display: block; width: 8px; }
html::-webkit-scrollbar-thumb { background: #cfd5e2; border-radius: 8px; }
button, a, input, textarea, select, summary { -webkit-tap-highlight-color: transparent; outline-offset: 4px; }
:focus-visible { outline: 3px solid var(--brand); }
button, a, input, select, textarea { transition: background-color .16s, border-color .16s, box-shadow .16s, color .16s; }
svg { width: 20px; height: 20px; flex: none; stroke-width: 1.7; }
h2 { font-size: 26px; letter-spacing: -.6px; }
h3 { font-size: 16px; font-weight: 650; margin-bottom: 18px; }
h4 { margin: 0; }
a:hover { text-underline-offset: 4px; }
.btn { font-weight: 550; min-height: 39px; padding: 8px 16px; border-radius: 9px; gap: 8px; box-shadow: none; }
.btn svg { width: 17px; height: 17px; }
.btn:hover:not(:disabled) { box-shadow: 0 3px 9px #24324a12; }
.btn.secondary { color: var(--ink); border-color: #dfe3ee; }
.btn.secondary:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); }
.btn.danger { background: #ce514f; }
.btn.small { min-height: 33px; padding: 5px 12px; }
.icon-button { padding: 7px; border-radius: 7px; }
.field { gap: 7px; }
input:not([type=checkbox]):not([type=range]), select, textarea { border-color: #e0e4ed; border-radius: 8px; background: #fafbfe; min-height: 42px; }
input:focus, textarea:focus, select:focus { background: #fff; }
input::placeholder, textarea::placeholder { color: #929bad; }
.field-row .btn { min-height: 42px; }
.switch input { height: 20px; background: #c7ccda; transition: background .15s; }
.switch input::before { width: 14px; height: 14px; left: 3px; top: 3px; box-shadow: 0 1px 3px #0002; }
.switch input:checked { background: var(--brand); }
.switch input:checked::before { transform: translateX(14px); background: #fff; }
.checks { gap: 15px 9px; }
.mono, code, .script, .text-output, .stats-output { font-family: "Cascadia Code", Consolas, monospace; }

/* Application frame */
.topbar { min-height: 80px; padding: 14px 32px; background: #ffffffed; color: var(--ink); border-bottom: 1px solid var(--line); box-shadow: none; backdrop-filter: blur(16px); }
.brand { flex: initial; }
.brand-mark { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: var(--brand); color: #fff; box-shadow: 0 4px 10px #4657be20; }
.brand-mark svg { width: 25px; height: 25px; }
.brand h1 { font-size: 19px; line-height: 1.35; font-weight: 700; white-space: nowrap; }
.brand-edition { display: inline-block; color: var(--brand); font-size: 10px; font-weight: 650; padding: 2px 7px; border: 1px solid var(--brand-soft); background: #f8f9fe; border-radius: 5px; margin-left: 5px; vertical-align: middle; letter-spacing: 0; }
.brand-copy p { font-size: 10px; color: var(--muted); margin: 4px 0 0; letter-spacing: .7px; }
.welcome-links { display: flex; align-items: center; gap: 22px; }
.welcome-links a { color: #626b80; font-size: 12px; display: flex; align-items: center; gap: 8px; }
.welcome-links svg { width: 15px; height: 15px; }
.topbar .btn { color: var(--ink); background: #fff; border-color: #dfe3ee; min-height: 36px; border-radius: 8px; }
.topbar .btn:hover { color: var(--brand); background: var(--brand-soft); }
.connection-chip { gap: 8px; max-width: 230px; background: var(--bg); padding: 7px 12px; border: 1px solid var(--line); border-radius: 30px; }
.connection-chip b { font-weight: 500; }
.dot { background: #b3bdcf; }
.dot.ok { background: #2eaa7b; box-shadow: 0 0 0 3px #2eaa7b13; }
.dot.pending { background: #d89c35; }
.dot.error { background: #d45f60; }
.shell { grid-template-columns: 214px minmax(0,1fr); }
.sidebar { padding: 16px 14px; background: var(--surface); z-index: 14; scrollbar-width: thin; scrollbar-color: #d5dbe7 transparent; }
.nav { gap: 3px; }
.nav-caption { color: #949bae; font-size: 10px; font-weight: 600; letter-spacing: 1px; padding: 12px 14px 7px; }
.nav-divider { height: 1px; margin: 13px 12px 8px; background: var(--line); }
.nav button { font-size: 13px; gap: 12px; padding: 11px 14px; border-radius: 9px; color: #616a7f; min-height: 44px; }
.nav button svg { width: 19px; height: 19px; }
.nav button:hover { background: var(--bg); color: var(--brand); }
.nav button.active { color: var(--brand-dark); font-weight: 650; }
.nav button.active::before { display: none; }
.nav button.active::after { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--brand); margin-left: auto; }
.sidebar-foot { font-size: 11px; text-align: left; padding: 18px 14px 6px; color: var(--muted); }
.sidebar-foot a { color: #667087; }
.sidebar-version { display: flex; justify-content: space-between; margin-top: 5px; font-size: 10px; color: #949bae; }
.sidebar-backdrop { display: none; }
.workspace { padding: 30px 34px 44px; max-width: 1500px; }
.page-title { margin-bottom: 25px; }
.page-description { color: var(--muted); font-size: 12px; margin: 5px 0 0; }
.card { padding: 24px; }
.card-heading { display: flex; align-items: center; gap: 10px; padding-bottom: 20px; margin-bottom: 22px; border-bottom: 1px solid var(--line); }
.card-heading h3 { margin: 0; }
.card-heading .badge { margin-left: auto; }
.card-icon { color: var(--brand); }
.grid, .stack { gap: 20px; }
.two { grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
.three { grid-template-columns: minmax(0,1.2fr) minmax(0,.9fr) minmax(0,1fr); }
.info-grid { gap: 26px; }
.info-pairs { gap: 15px; margin: 0; }
.info-pairs div { grid-template-columns: 70px minmax(0,1fr); gap: 8px; }
.info-pairs dd { font-weight: 500; }
.cpu-grid { font-size: 12px; gap: 9px 12px; align-content: start; background: #f8f9fe; padding: 16px; border-radius: 10px; }
.info-wide { border-color: var(--line); margin-top: 22px; padding-top: 16px; gap: 8px; }
.info-wide b { font-weight: 400; min-width: 78px; }
.board-id-toggle { font-size: 11px; }
.focus-box { background: #f8f9fd; border-color: var(--line); border-radius: 9px; padding: 13px 15px; }
.badge { padding: 4px 9px; border-radius: 6px; }
.battery-summary { font-size: 13px; margin-bottom: 16px; background: #f8f9fe; border-radius: 8px; padding: 9px; }
.stats-output { background: #f7f8fc; border: 1px solid var(--line); border-radius: 8px; padding: 12px; }
.script-layout { grid-template-columns: minmax(0,1fr) 192px 210px; gap: 18px; }
.script-editor { line-height: 1.8; border-radius: 8px !important; }
.script-list { background: #f8f9fc; border-radius: 8px; padding: 6px; }
.script-list button { border-radius: 6px; padding: 8px; }
.terminal-card { padding: 16px; }
.terminal-session-bar { font-size: 11px; margin: 0 3px 14px; }
.terminal-surface { border-radius: 10px; }
.terminal-surface .xterm { padding: 14px; }
.links-grid { gap: 12px; font-size: 13px; }
.developer-website { font-size: 13px; }
.about-attribution { font-size: 12px; line-height: 1.9; color: var(--muted); }
.download-item { padding: 12px; background: var(--bg); border-radius: 8px; }
.toast { border-radius: 10px; padding: 13px 20px; background: #29324a; box-shadow: 0 6px 24px #18213a25; }
.toast.error { background: #a43d3d; }
dialog { border-radius: 18px; box-shadow: 0 24px 90px #18213a30; }
dialog::backdrop { background: #17233b66; backdrop-filter: blur(4px); }
.modal-footer { background: #fafbfe; }
.tab-pills button { border-radius: 7px; padding: 7px 12px; }
.inline-note { border-radius: 0 8px 8px 0; background: #f6f7fd; color: #69738a; }

/* Welcome screen */
body[data-connected="false"] .workspace { max-width: 1232px; padding: 0 40px; }
body[data-connected="true"] .welcome-links { display: none; }
.connection-entry { display: block; padding: 0; animation: enter .35s ease; }
.welcome-hero { display: grid; grid-template-columns: 1.1fr 1fr; align-items: center; gap: 20px; min-height: 440px; padding: 34px 4px 30px; }
.eyebrow { font-size: 10px; font-weight: 650; letter-spacing: 2px; color: #8a92a7; display: flex; align-items: center; gap: 9px; margin-bottom: 18px; }
.eyebrow > span:first-child { width: 6px; height: 6px; background: var(--brand); border-radius: 50%; }
.welcome-copy h2 { font-size: clamp(34px,3.3vw,48px); line-height: 1.4; font-weight: 750; letter-spacing: -1.5px; margin: 0 0 17px; }
.welcome-copy h2 em { color: var(--brand); font-style: normal; }
.welcome-description { font-size: 14px; color: #737e94; line-height: 1.95; margin-bottom: 25px; }
.welcome-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; }
.connection-entry .connect-button { min-width: 169px; min-height: 47px; padding: 11px 18px; border-radius: 10px; box-shadow: 0 5px 15px #4657be22; font-size: 14px; gap: 10px; }
.connect-button > svg:last-child { width: 15px; margin-left: 7px; }
.connect-button[aria-busy="true"] > svg:first-child { animation: pulse 1s ease-in-out infinite; }
.guide-link { font-size: 11px; color: #7b8498; display: inline-flex; align-items: center; gap: 5px; }
.guide-link svg { width: 13px; height: 13px; }
.entry-status { font-size: 11px; color: var(--muted); margin: 11px 0 0; min-height: 19px; max-width: 450px; overflow-wrap: anywhere; }
.entry-status.error { color: #bb4545; }
.entry-status.pending { color: #9a7025; }
.welcome-benefits { display: flex; align-items: center; flex-wrap: wrap; gap: 20px; color: #8992a5; margin-top: 20px; }
.welcome-benefits span { display: flex; align-items: center; gap: 5px; font-size: 10px; }
.welcome-benefits svg { width: 13px; height: 13px; }
.device-art { position: relative; height: 350px; display: grid; place-items: center; isolation: isolate; }
.device-art::before { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at center,#dce3ff85,transparent 68%); z-index: -2; }
.orbit { position: absolute; border: 1px solid #dfe4f3; border-radius: 50%; z-index: -1; }
.orbit-outer { width: 342px; height: 342px; }
.orbit-inner { width: 266px; height: 266px; border-style: dashed; border-color: #dce2f0; }
.orbit-point { position: absolute; width: 7px; height: 7px; border: 2px solid var(--bg); background: #adb9e7; border-radius: 50%; }
.point-one { top: 26px; left: 29%; }
.point-two { bottom: 57px; right: 24%; width: 10px; height: 10px; }
.phone { position: relative; width: 166px; height: 295px; border: 5px solid #35415e; border-radius: 28px; background: linear-gradient(160deg,#f8f9ff,#e7ecfc); box-shadow: 7px 10px 0 #303b5510, 10px 24px 36px #3b4c8320; transform: rotate(8deg) translate(12px,-7px); text-align: center; }
.phone-camera { width: 47px; height: 11px; border-radius: 0 0 8px 8px; background: #35415e; margin: -1px auto 0; }
.phone-status { display: flex; align-items: center; justify-content: space-between; padding: 12px 13px; color: #7f8aaa; font-size: 6px; letter-spacing: 1px; }
.phone-status svg { width: 11px; height: 11px; transform: rotate(90deg); }
.phone-emblem { display: grid; place-items: center; width: 62px; height: 62px; border-radius: 18px; background: var(--brand); color: #fff; box-shadow: 0 7px 13px #4657be25; margin: 23px auto 16px; }
.phone-emblem svg { width: 36px; height: 36px; }
.phone-heading { font-size: 11px; font-weight: 650; color: #46527c; }
.phone-subtitle { font-size: 7px; color: #9099b1; margin-top: 7px; }
.phone-tools { display: flex; justify-content: center; gap: 10px; margin: 24px 0 0; }
.phone-tools span { display: grid; place-items: center; border: 1px solid #fff; border-radius: 9px; width: 30px; height: 30px; background: #ffffff95; color: #7d8abc; }
.phone-tools svg { width: 14px; height: 14px; }
.phone-home { position: absolute; bottom: 8px; width: 43px; height: 3px; border-radius: 3px; background: #a7b0c9; left: 50%; transform: translateX(-50%); }
.floating-tag { position: absolute; display: flex; align-items: center; gap: 9px; background: #ffffffed; border: 1px solid #e8ecf6; border-radius: 10px; box-shadow: 0 6px 22px #3346780b; color: #6c7896; font-size: 10px; padding: 11px 15px; }
.floating-tag svg { color: var(--brand); width: 16px; height: 16px; }
.tag-usb { top: 52px; left: 12%; transform: rotate(-6deg); z-index: 2; }
.code-card { position: absolute; width: 233px; bottom: 22px; left: 6%; padding: 13px 16px; border: 1px solid #ffffff22; border-radius: 12px; background: #283149; box-shadow: 0 12px 25px #27385922; transform: rotate(-4deg); color: #d7dff5; font-family: "Cascadia Code", Consolas, monospace; }
.code-card-heading { display: flex; align-items: center; justify-content: space-between; color: #929dbb; font-size: 8px; padding-bottom: 12px; }
.code-card-heading > svg { width: 12px; height: 12px; }
.code-lights { display: flex; gap: 4px; }
.code-lights i { width: 5px; height: 5px; border-radius: 50%; background: #c67b80; }
.code-lights i:nth-child(2) { background: #c8ae7b; }
.code-lights i:nth-child(3) { background: #7bb19b; }
.code-line { font-size: 11px; }
.code-line > span { color: #a5b4fc; margin-right: 6px; }
.code-comment { font-size: 8px; color: #94a1be; margin-top: 8px; }
.code-cursor { width: 5px; height: 10px; background: #96a8e8; margin-top: 9px; }
.art-caption { position: absolute; right: 9%; bottom: 12px; color: #9aa3b7; font-size: 9px; letter-spacing: 1px; display: flex; align-items: center; gap: 6px; }
.art-caption > span { width: 4px; height: 4px; border-radius: 50%; background: #7baa9b; }
.connection-guide { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 23px 26px 0; box-shadow: var(--shadow); }
.guide-heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 21px; }
.section-kicker { font-size: 8px; font-weight: 650; letter-spacing: 1.8px; color: #9aa2b3; }
.guide-heading h3 { font-size: 17px; letter-spacing: -.3px; margin: 3px 0 0; }
.browser-note { font-size: 10px; color: #8992a4; background: #f7f8fb; border: 1px solid #eef0f5; padding: 4px 9px; border-radius: 6px; }
.connection-steps { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 25px; list-style: none; margin: 0 0 24px; padding: 0; }
.connection-steps li { display: flex; align-items: flex-start; gap: 12px; min-width: 0; }
.connection-steps li + li { border-left: 1px solid var(--line); padding-left: 25px; }
.step-number { font-size: 11px; font-weight: 650; color: var(--brand); background: #f0f2fc; border-radius: 8px; width: 31px; height: 31px; display: grid; place-items: center; flex: none; }
.connection-steps h4 { font-size: 13px; font-weight: 650; margin: 1px 0 6px; }
.connection-steps p { font-size: 12px; color: #8992a5; line-height: 1.8; margin: 0; }
.connection-steps li > svg { display: none; }
.connection-help { border-top: 1px solid var(--line); color: #737d92; font-size: 11px; }
.connection-help summary { cursor: pointer; display: flex; align-items: center; gap: 7px; list-style: none; padding: 13px 0; }
.connection-help summary::-webkit-details-marker { display: none; }
.connection-help summary > svg { width: 13px; height: 13px; }
.connection-help summary > span { margin-left: auto; color: #7984a1; }
.connection-help summary > span::after { content: "+"; margin-left: 7px; }
.connection-help[open] summary > span::after { content: "−"; }
.connection-help p { line-height: 1.9; margin: 0 0 16px 20px; color: #737e94; }
.feature-overview { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 24px; padding: 30px 12px; }
.feature-item { display: flex; align-items: center; gap: 13px; }
.feature-icon { width: 36px; height: 36px; border-radius: 11px; background: #eceff8; color: #7785af; display: grid; place-items: center; flex: none; }
.feature-icon svg { width: 18px; height: 18px; }
.feature-item h3 { margin: 0 0 3px; font-size: 12px; font-weight: 600; color: #59647e; }
.feature-item p { margin: 0; font-size: 11px; color: #778198; }
.welcome-footer { display: flex; justify-content: space-between; flex-wrap: wrap; align-items: center; gap: 12px; padding: 18px 0 22px; border-top: 1px solid var(--line); color: #949caf; font-size: 10px; }
.welcome-footer a { color: #6f7b98; }
.footer-dot { display: inline-block; padding: 0 9px; color: #c2c7d3; }

/* Responsive layouts */
@keyframes pulse { 50% { opacity: .45; } }
@media (min-width: 1600px) { .workspace { padding: 36px 46px; } .welcome-hero { min-height: 470px; } }
@media (max-width: 1200px) {
  .workspace { padding: 26px 24px; }
  .shell { grid-template-columns: 192px minmax(0,1fr); }
  .three { grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
  .three > :last-child { grid-column: 1/-1; }
  .info-grid { grid-template-columns: 1fr 1fr; }
  .info-grid > .cpu-grid { grid-column: 1/-1; grid-template-columns: repeat(4,1fr); }
  .script-layout { grid-template-columns: minmax(0,1fr) 190px; }
  .script-layout > .card:last-child { grid-column: 1/-1; }
  .script-list { min-height: 80px; display: grid; grid-template-columns: repeat(3,1fr); align-content: start; }
  .button-grid.four { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .checks { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .connection-steps { gap: 16px; }
  .connection-steps li + li { padding-left: 16px; }
  .welcome-actions { gap: 14px; }
}
@media (max-width: 980px) {
  .welcome-hero { grid-template-columns: 1.1fr .9fr; min-height: 420px; gap: 0; }
  .device-art { transform: scale(.88); transform-origin: center; }
  .feature-overview { gap: 14px; padding-inline: 0; }
  .feature-item { gap: 9px; }
  .feature-item p { max-width: 120px; }
  .connection-steps li { gap: 9px; }
  .two, .settings-grid { grid-template-columns: 1fr; }
}
@media (max-width: 780px) {
  .topbar { min-height: 70px; padding: 12px 18px; gap: 12px; }
  .brand { gap: 9px; }
  .brand-mark { width: 36px; height: 36px; border-radius: 10px; }
  .brand h1 { font-size: 17px; }
  .brand-copy p { font-size: 9px; letter-spacing: .4px; }
  .welcome-links { gap: 15px; }
  .welcome-links a { font-size: 11px; }
  .welcome-links svg { display: none; }
  .top-actions .btn { font-size: 11px; padding: 6px 10px; min-height: 34px; }
  .sidebar-toggle { color: var(--ink); padding: 5px; border-radius: 6px; }
  body[data-connected="true"] .brand-mark { display: none; }
  .shell { grid-template-columns: 1fr; }
  .sidebar { width: 222px; visibility: hidden; transition: transform .2s, visibility .2s; box-shadow: 10px 0 30px #18213a12; }
  .sidebar.open { visibility: visible; }
  .sidebar-backdrop { display: block; position: fixed; inset: var(--header-height,70px) 0 0; background: #17233b55; border: 0; z-index: 13; backdrop-filter: blur(2px); }
  .workspace { padding: 22px 18px 32px; }
  .page-title { gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
  .page-title h2 { font-size: 23px; }
  .page-description { font-size: 11px; }
  .two, .three, .settings-grid { grid-template-columns: minmax(0,1fr); }
  .three > :last-child { grid-column: auto; }
  .card { padding: 20px; border-radius: 13px; }
  .info-grid { gap: 20px; }
  .checks { grid-template-columns: repeat(4,minmax(0,1fr)); }
  .script-layout { grid-template-columns: minmax(0,1fr); }
  .script-layout > .card:last-child { grid-column: auto; }
  body[data-connected="false"] .workspace { padding: 0 24px; }
  .welcome-hero { grid-template-columns: 1fr .8fr; min-height: 405px; padding-block: 30px; }
  .welcome-copy h2 { font-size: 35px; }
  .welcome-description { font-size: 12px; }
  .welcome-actions { align-items: flex-start; flex-direction: column; gap: 14px; }
  .device-art { transform: scale(.78); margin-inline: -25px; }
  .welcome-benefits { gap: 12px; margin-top: 16px; }
  .connection-guide { padding: 20px 20px 0; }
  .connection-steps { grid-template-columns: 1fr; gap: 20px; }
  .connection-steps li + li { padding-left: 0; border-left: 0; }
  .connection-steps li { align-items: center; gap: 13px; }
  .connection-steps li > svg { display: block; margin-left: auto; color: #b0b8ce; width: 19px; height: 19px; }
  .connection-steps h4 { margin-bottom: 3px; }
  .connection-steps p { font-size: 11px; }
  .step-number { width: 36px; height: 36px; }
  .feature-overview { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 24px; padding: 26px 5px; }
  .feature-item p { max-width: none; }
  .welcome-footer { padding-bottom: 24px; }
}
@media (max-width: 540px) {
  .welcome-hero { grid-template-columns: 1fr; padding: 36px 0 22px; min-height: auto; }
  .eyebrow { font-size: 9px; margin-bottom: 16px; }
  .welcome-copy h2 { font-size: 37px; line-height: 1.35; }
  .welcome-description { font-size: 12px; margin-bottom: 22px; }
  .welcome-actions { flex-direction: row; align-items: center; gap: 12px; }
  .connection-entry .connect-button { min-width: 150px; }
  .guide-link { font-size: 10px; }
  .device-art { height: 288px; transform: scale(.85); margin: 4px 0 -16px; }
  .tag-usb { left: 12%; top: 22px; }
  .code-card { left: 6%; bottom: -7px; }
  .art-caption { display: none; }
  .guide-heading { align-items: flex-start; gap: 10px; }
  .guide-heading h3 { font-size: 16px; }
  .browser-note { font-size: 9px; padding: 4px 6px; max-width: 110px; text-align: center; margin-top: 5px; }
  .connection-help summary { font-size: 10px; flex-wrap: wrap; }
  .connection-help summary > span { display: none; }
  .connection-help summary::after { content: "+"; margin-left: auto; }
  .connection-help[open] summary::after { content: "−"; }
  .welcome-footer { font-size: 9px; justify-content: center; text-align: center; }
  .feature-item { gap: 9px; }
  .feature-item h3 { font-size: 11px; }
  .feature-item p { font-size: 10px; }
  .feature-icon { width: 32px; height: 32px; border-radius: 9px; }
  .feature-overview { gap: 22px 10px; }
  .info-grid { grid-template-columns: 1fr; }
  .info-grid > .cpu-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .info-pairs { gap: 12px; }
  .checks { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .button-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .field-row { flex-wrap: wrap; }
  .field-row > .field { flex-basis: 35%; }
  .slider-row { grid-template-columns: 45px minmax(60px,1fr) 65px; gap: 8px; font-size: 12px; }
  .script-list { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .links-grid { grid-template-columns: 1fr; }
  .top-actions .btn svg { display: none; }
}
@media (max-width: 370px) {
  .brand-copy p { display: none; }
  .brand h1 { font-size: 16px; }
  .welcome-links { gap: 10px; }
  .welcome-links a { font-size: 10px; }
  body[data-connected="false"] .workspace { padding-inline: 18px; }
  .connection-guide { padding-inline: 16px; }
  .welcome-copy h2 { font-size: 34px; }
  .topbar { padding-inline: 12px; gap: 8px; }
  .top-actions .btn { padding-inline: 7px; }
  .top-actions { gap: 4px; }
  .workspace { padding-inline: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
