:root {
  --bg: #0b0c0e;
  --panel: rgba(17, 19, 23, .78);
  --panel-solid: #15171b;
  --line: rgba(255, 255, 255, .09);
  --line-2: rgba(255, 255, 255, .16);
  --text: #eceef0;
  --muted: #9aa1a9;
  --faint: #6b727a;
  --accent: #e0483a;
  --accent-2: #f05a4b;
  --ok: #3ccf7a;
  --warn: #f2b134;
  --r: 14px;
  --gap: 16px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 14px/1.4 system-ui, -apple-system, "Segoe UI", sans-serif; overflow: hidden; -webkit-font-smoothing: antialiased; }
canvas#c { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
button { font: inherit; color: inherit; background: rgba(255,255,255,.06); border: 1px solid var(--line); border-radius: 9px; padding: 7px 10px; cursor: pointer; transition: background .15s, border-color .15s, color .15s; }
button:hover { background: rgba(255,255,255,.12); }
button:focus-visible { outline: 2px solid #7fb2ff; outline-offset: 2px; }
button.primary { background: var(--accent); border-color: transparent; color: #fff; font-weight: 600; }
button.primary:hover { background: var(--accent-2); }
button.icon { width: 32px; height: 32px; padding: 0; display: grid; place-items: center; background: transparent; border-color: transparent; }
button.icon:hover { background: rgba(255,255,255,.1); }
button.icon svg { width: 18px; height: 18px; fill: currentColor; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
button.icon[aria-pressed="false"] { color: var(--faint); }
button.icon[aria-pressed="false"] .on { display: none; }
button.link { background: none; border: 0; padding: 2px 0; color: var(--muted); font-size: 12px; justify-self: center; }
button.link:hover { color: var(--text); }
kbd { font: 10.5px/1 ui-monospace, SFMono-Regular, monospace; padding: 2px 5px; border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 4px; color: var(--muted); background: rgba(255,255,255,.04); }
button.primary kbd { color: #fff; border-color: rgba(255,255,255,.4); background: transparent; }

.panel { position: fixed; z-index: 2; background: var(--panel); backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2); border: 1px solid var(--line); border-radius: var(--r); box-shadow: 0 8px 32px rgba(0,0,0,.35); }

/* marca */
.brand { top: var(--gap); left: var(--gap); display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 10px; }
.logo { width: 30px; height: 30px; border-radius: 8px; border: 2px solid var(--accent); display: grid; place-items: center; font-weight: 800; font-size: 15px; }
.title h1 { margin: 0; font-size: 14.5px; font-weight: 650; letter-spacing: .01em; }
.title p { margin: 0; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.icons { display: flex; gap: 2px; margin-left: 6px; padding-left: 6px; border-left: 1px solid var(--line); }

/* cronòmetre */
.timer { top: var(--gap); left: 50%; transform: translateX(-50%); padding: 8px 18px 9px; text-align: center; min-width: 220px; }
.t-row { display: flex; align-items: center; justify-content: center; gap: 8px; }
.t-row b { font: 600 24px/1.1 ui-monospace, SFMono-Regular, monospace; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.timer.running .dot { background: var(--accent); animation: pulse 1s infinite; }
.timer.done .dot { background: var(--ok); }
.timer.done b { color: var(--ok); }
@keyframes pulse { 50% { opacity: .3; } }
.t-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.t-meta .rec { color: var(--warn); }
.t-status { font-size: 12px; color: var(--ok); margin-top: 4px; display: none; max-width: 420px; }
.t-status.on { display: block; }

/* accions */
.actions { top: var(--gap); right: var(--gap); width: 312px; padding: 14px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.actions .field > *, .actions .seg button, .row > button { min-width: 0; }
.field.off { opacity: .4; pointer-events: none; }
.field { display: grid; gap: 6px; }
.label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); font-weight: 600; }
.seg { display: flex; padding: 3px; gap: 3px; background: rgba(0,0,0,.28); border: 1px solid var(--line); border-radius: 10px; }
.seg button { flex: 1; border: 0; border-radius: 7px; background: transparent; padding: 6px 4px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.seg button:hover { color: var(--text); background: rgba(255,255,255,.05); }
.seg button.on { background: rgba(255,255,255,.14); color: var(--text); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.3); }
.seg.small button { padding: 3px 9px; font-size: 12px; }
.row { display: flex; gap: 6px; }
.row > button { flex: 1; display: flex; align-items: center; justify-content: center; gap: 5px; font-size: 13px; padding: 7px 6px; }
#park { padding: 11px; font-size: 14.5px; display: flex; align-items: center; justify-content: center; gap: 8px; }
.plan { margin: -4px 0 0; font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.plan:empty { display: none; }
.plan b { color: var(--text); font-weight: 600; }
hr { border: 0; border-top: 1px solid var(--line); margin: 0; width: 100%; }
.toggle i { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: none; }
.toggle.open i { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.toggle.moving i { background: var(--warn); }
.actions .more { display: none; }
.actions.expanded .more { display: grid; }
@media (min-width: 761px) and (pointer: fine) {
  .actions .more { display: grid; }
  #btnMore { display: none; }
}
.mobile-only { display: none !important; }


/* càmeres */
.cams { left: var(--gap); bottom: var(--gap); padding: 6px; display: grid; gap: 4px; }
.cams .seg { background: transparent; border: 0; padding: 0; }
.cams .seg button { font-size: 12.5px; padding: 6px 9px; }
.hint { font-size: 11px; color: var(--faint); text-align: center; }

/* quadre */
.dash { position: fixed; left: 50%; bottom: var(--gap); transform: translateX(-50%); display: flex; gap: 8px; align-items: stretch; z-index: 2; pointer-events: none; }
.dash > div { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: 0 8px 32px rgba(0,0,0,.35); }
.gauge { padding: 8px 16px; display: grid; grid-template-columns: auto 1fr; gap: 4px 16px; align-items: center; min-width: 170px; }
.gear { font: 700 24px/1 ui-monospace, monospace; color: var(--ok); }
.gear.r { color: var(--warn); }
.spd { text-align: right; }
.spd b { font-size: 24px; font-weight: 600; font-variant-numeric: tabular-nums; }
.spd small { color: var(--muted); margin-left: 3px; font-size: 11px; }
.steer { grid-column: 1 / -1; height: 3px; background: rgba(255,255,255,.12); border-radius: 2px; position: relative; }
/* punt vermell fix: marca on les rodes van rectes */
.steer::after { content: ""; position: absolute; left: calc(50% - 2px); top: -1px; width: 5px; height: 5px; border-radius: 50%; background: #e5372b; z-index: 1; }
.steer i { position: absolute; top: -3px; width: 9px; height: 9px; border-radius: 50%; background: var(--text); left: calc(50% - 4px); }
.pdc { padding: 8px 12px; width: 96px; display: grid; gap: 3px; align-content: center; }
.pdc span { font-size: 10.5px; color: var(--faint); text-transform: uppercase; letter-spacing: .07em; font-weight: 600; }
.pdc b { font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }
.pdc i { height: 3px; border-radius: 2px; background: var(--ok); width: 0; transition: width .1s; }
.pdc.warn b { color: var(--warn); } .pdc.warn i { background: var(--warn); }
.pdc.stop b { color: var(--accent); } .pdc.stop i { background: var(--accent); }

.rearcam { position: fixed; z-index: 1; border: 1px solid var(--line-2); border-radius: 12px; pointer-events: none; display: none; box-shadow: 0 8px 32px rgba(0,0,0,.5); }
.rearcam.on { display: block; }
.rearcam span { position: absolute; left: 8px; top: 7px; font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em; font-weight: 600; background: rgba(0,0,0,.55); padding: 3px 7px; border-radius: 5px; color: #ddd; }
.toast { position: fixed; left: 50%; top: 42%; transform: translate(-50%, -50%) scale(.96); z-index: 3; font-size: 26px; font-weight: 750; color: #fff; text-shadow: 0 2px 24px rgba(0,0,0,.8); opacity: 0; transition: opacity .2s, transform .2s; pointer-events: none; text-align: center; }
.toast.on { opacity: 1; transform: translate(-50%, -50%) scale(1); }

/* diàlegs */
dialog { background: var(--panel-solid); color: var(--text); border: 1px solid var(--line-2); border-radius: 16px; padding: 0; max-width: min(720px, calc(100vw - 32px)); box-shadow: 0 24px 80px rgba(0,0,0,.6); }
dialog::backdrop { background: rgba(0,0,0,.5); backdrop-filter: blur(2px); }
.dlg { padding: 18px 20px 20px; display: grid; gap: 14px; }
.dlg header { display: flex; justify-content: space-between; align-items: center; }
.dlg h2 { margin: 0; font-size: 16px; }
.dlg h3 { margin: 0 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.dlg h3 small { text-transform: none; letter-spacing: 0; color: var(--faint); font-weight: 500; margin-left: 6px; }
.dlg h3 small.ok { color: var(--ok); }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 7px 12px; font-size: 13px; }
dt { color: var(--text); white-space: nowrap; }
dd { margin: 0; color: var(--muted); }
.note { margin: 0; font-size: 12px; color: var(--faint); }
.dlg .note { margin-top: 10px; }
.grid { display: grid; gap: 8px; }
.grid label { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 13px; }
.grid small { color: var(--faint); margin-left: 4px; }
.grid input[type=number], .grid input[readonly] { width: 84px; font: inherit; color: var(--text); background: rgba(0,0,0,.35); border: 1px solid var(--line-2); border-radius: 7px; padding: 5px 8px; text-align: right; font-variant-numeric: tabular-nums; }
.grid .check { justify-content: flex-start; }
.dlg footer { display: flex; justify-content: flex-end; gap: 8px; }

.touch { display: none; }
@media (pointer: coarse) {
  .touch { display: grid; grid-template-columns: 64px 64px 1fr 64px 64px; gap: 10px; position: fixed; left: var(--gap); right: var(--gap); bottom: 96px; z-index: 2; pointer-events: none; }
  .touch button { height: 64px; font-size: 22px; background: var(--panel); border-color: var(--line-2); touch-action: none; pointer-events: auto; border-radius: 16px; }
  .cams .hint { display: none; }
}
@media (max-width: 1100px) {
  .actions { width: 290px; }
  .row kbd { display: none; }
  .cams .seg button { padding: 6px 7px; }
}
@media (max-width: 760px) {
  :root { --gap: 10px; }
  .brand { right: auto; padding: 6px; }
  .title p { display: none; }
  .timer { top: auto; bottom: 178px; min-width: 0; padding: 5px 14px; }
  .t-row b { font-size: 18px; }
  .t-meta { font-size: 11px; }
  .actions { top: 62px; left: var(--gap); right: var(--gap); width: auto; padding: 10px; gap: 8px; }
  .actions hr { display: none; }
  .plan { font-size: 12px; }
  .cams { left: var(--gap); right: var(--gap); bottom: auto; top: 62px; display: none; }
  .actions kbd, .cams .hint { display: none; }
  .mobile-only { display: grid !important; }
  .dash { bottom: var(--gap); gap: 6px; }
  .pdc { width: 78px; padding: 6px 9px; }
  .pdc b { font-size: 14px; }
  .gauge { min-width: 130px; padding: 6px 12px; }
  .gear, .spd b { font-size: 19px; }
  .cols { grid-template-columns: 1fr; }
}
.grid input[readonly] { color: var(--faint); }

/* configuració */
dialog:has(.cfg) { width: min(760px, calc(100vw - 32px)); }
.cfg header { align-items: flex-start; }
.cfg header .note { margin-top: 4px; }
.cfg-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cfg fieldset { margin: 0; border: 1px solid var(--line); border-radius: 12px; padding: 4px 12px 6px; display: grid; background: rgba(255,255,255,.02); }
.cfg legend { padding: 0 6px; margin-left: -6px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.cfg label { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 46px; padding: 6px 0; font-size: 13px; border-top: 1px solid var(--line); cursor: pointer; }
.cfg legend + label { border-top: 0; }
.cfg label > span:first-child { display: grid; gap: 1px; }
.cfg label small { color: var(--faint); font-size: 11.5px; }
.cfg .in { display: inline-flex; align-items: center; background: rgba(0,0,0,.35); border: 1px solid var(--line-2); border-radius: 8px; padding-right: 8px; transition: border-color .15s; }
.cfg .in:focus-within { border-color: #7fb2ff; }
.cfg .in em { font-style: normal; color: var(--faint); font-size: 12px; width: 10px; }
.cfg input[type=number], .cfg output { width: 64px; font: inherit; color: var(--text); background: none; border: 0; outline: 0; padding: 6px 6px 6px 8px; text-align: right; font-variant-numeric: tabular-nums; -moz-appearance: textfield; }
.cfg input::-webkit-inner-spin-button { display: none; }
.cfg .calc { cursor: default; }
.cfg .calc .in { background: none; border-style: dashed; }
.cfg .calc output { color: var(--muted); }
.cfg input[type=checkbox] { appearance: none; width: 36px; height: 20px; border-radius: 10px; background: rgba(255,255,255,.14); position: relative; flex: none; cursor: pointer; transition: background .15s; margin: 0; }
.cfg input[type=checkbox]::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; }
.cfg input[type=checkbox]:checked { background: var(--ok); }
.cfg input[type=checkbox]:checked::after { transform: translateX(16px); }
.cfg input[type=checkbox]:focus-visible { outline: 2px solid #7fb2ff; outline-offset: 2px; }
.cfg footer { align-items: center; }
.cfg .grow { flex: 1; }
button.ghost { background: none; border-color: transparent; color: var(--muted); }
button.ghost:hover { color: var(--text); }
@media (max-width: 760px) { .cfg-cols { grid-template-columns: 1fr; } }

/* Refined instrument panel: quiet surfaces, consistent controls, clear hierarchy. */
:root { --panel: rgba(26,29,30,.97); --panel-solid:#1a1d1e; --text:#f0f0e9; --muted:#b9bebc; --faint:#a0a8a5; --line:#383d3d; --line-2:#555e5a; --accent:#d9e5bb; --accent-2:#e6efcf; --ok:#a8cfaf; --r:12px; --gap:20px; }
html,body { font-family:"Avenir Next",Avenir,"Segoe UI",sans-serif; }
button { min-height:38px; border-radius:7px; font-weight:500; }
button:focus-visible { outline:2px solid var(--accent); outline-offset:3px; }
button:active { transform:translateY(1px); }
button.primary,button.primary kbd { color:#202b1d; }
button.primary kbd { border-color:#7b8c68; }
.panel { backdrop-filter:none; -webkit-backdrop-filter:none; box-shadow:0 4px 20px #0002; }
.brand { gap:12px; padding:10px 12px; }
.logo { border:1px solid #64745a; border-radius:6px; color:var(--accent); width:32px; height:36px; font-weight:600; }
.title h1 { font-size:15px; letter-spacing:-.025em; }
.title p { font-size:11px; margin-top:2px; }
button.icon { width:38px; height:38px; }
.icons { gap:0; }
.actions { width:304px; padding:20px; gap:18px; max-height:calc(100dvh - 130px); overflow-y:auto; scrollbar-width:thin; scrollbar-color:#59605b transparent; }
.actions-heading { display:flex; justify-content:space-between; align-items:center; gap:12px; padding-bottom:16px; border-bottom:1px solid var(--line); }
.actions-heading h2 { font-size:18px; letter-spacing:-.04em; font-weight:600; margin:5px 0 0; line-height:1.2; }
.eyebrow { font-size:9px; font-weight:600; letter-spacing:.12em; color:var(--muted); }
#btnPanel { background:transparent; border:0; width:38px; font-size:22px; color:var(--muted); }
.actions.folded > :not(.actions-heading) { display:none!important; }
.actions.folded .actions-heading { border:0; padding:0; }
.label { text-transform:none; letter-spacing:0; font-size:12px; font-weight:500; color:var(--muted); }
.field { gap:8px; }
.seg { border:0; border-radius:7px; background:#111516; padding:3px; gap:2px; }
.seg button { font-size:12px; min-height:34px; font-weight:500; padding:6px; border-radius:5px; }
.seg button.on { background:#414947; color:#f3f5ee; box-shadow:none; }
.actions [aria-label="Destí"] { display:grid; grid-template-columns:1fr 1fr; gap:3px; }
.actions [aria-label="Destí"] button { min-height:36px; }
.row > button { font-size:12px; padding:8px 5px; gap:5px; }
#park { min-height:46px; font-size:13px; letter-spacing:-.01em; justify-content:space-between; padding:12px 14px; }
.plan { font-size:12px; line-height:1.65; padding:10px 0 0; margin:0; border-top:1px solid var(--line); text-wrap:pretty; }
.toggle.open i { box-shadow:none; }
.actions .more { display:none; }
.actions.expanded .more { display:grid; }
#btnMore { display:block; justify-self:stretch; text-align:left; font-size:12px; min-height:38px; border-top:1px solid var(--line); border-radius:0; padding-top:10px; }
#btnMore::after { content:'+'; float:right; }
#btnMore[aria-expanded="true"]::after { content:'−'; }
.timer { padding:12px 16px; min-width:210px; top:20px; }
.t-row b { font-family:inherit; font-size:25px; font-weight:500; letter-spacing:-.04em; }
.t-meta { margin-top:5px; font-size:10px; }
.t-status { font-size:11px; }
.cams { padding:8px; gap:6px; }
.cams .seg button { min-height:34px; padding:6px 10px; font-size:12px; }
.hint { font-size:10px; }
.dash { gap:0; background:var(--panel); border:1px solid var(--line); border-radius:12px; padding:5px 0; }
.dash > div { background:transparent; border:0; border-radius:0; box-shadow:none; backdrop-filter:none; -webkit-backdrop-filter:none; }
.dash .gauge { border-inline:1px solid var(--line); min-width:140px; padding:7px 16px; }
.pdc { width:85px; padding:8px 14px; }
.pdc span { text-transform:none; letter-spacing:0; font-size:10px; }
.pdc b { font-size:16px; }
.gear { font-family:inherit; font-size:24px; font-weight:500; }
.steer::after { background:#bdc5ba; }
.toast { font-size:20px; background:#1a1d1ef2; border:1px solid var(--line); border-radius:10px; padding:12px 20px; max-width:calc(100vw - 40px); text-shadow:none; font-weight:500; }
.dlg { padding:24px; gap:20px; }
.dlg h2 { font-size:20px; font-weight:600; letter-spacing:-.03em; }
.dlg h3 { text-transform:none; letter-spacing:0; font-size:13px; }
.dlg a { color:var(--accent); text-underline-offset:3px; }
.dlg .note { line-height:1.65; text-wrap:pretty; }
dialog { max-height:calc(100dvh - 32px); }
.cfg fieldset { background:none; border-radius:8px; }
.cfg legend { text-transform:none; letter-spacing:0; font-size:12px; }
.cfg label { min-height:58px; }
.cfg label small { line-height:1.4; }
@media(min-width:761px) and (max-width:1200px) {
 .timer { top:100px; left:20px; transform:none; min-width:195px; }
 .dash { left:auto; right:20px; transform:none; }
}
@media(max-width:760px) {
 :root { --gap:12px; }
 .brand { left:12px; right:12px; top:max(12px,env(safe-area-inset-top)); padding:6px 8px; }
 .brand .icons { margin-left:auto; }
 .title p { display:block; font-size:10px; }
 .actions { top:82px; left:12px; right:12px; width:auto; padding:14px; gap:12px; max-height:calc(100dvh - 310px); }
 .actions-heading { padding-bottom:10px; }
 .actions-heading h2 { font-size:16px; margin-top:0; }
 .eyebrow { display:none; }
 .actions [aria-label="Destí"] { grid-template-columns:repeat(4,1fr); }
 .seg button { font-size:11px; min-height:38px; }
 .actions hr { display:none; }
 .timer { top:auto; bottom:174px; left:50%; transform:translateX(-50%); padding:8px 12px; min-width:190px; }
 .t-row b { font-size:19px; }
 .t-meta { font-size:10px; margin-top:2px; }
 .dash { bottom:max(12px,env(safe-area-inset-bottom)); }
 .dash .gauge { min-width:125px; }
 .pdc { width:77px; }
 .touch { bottom:92px; grid-template-columns:56px 56px 1fr 56px 56px; gap:8px; }
 .touch button { height:58px; border-radius:10px; }
 .dlg { padding:18px; }
 .cfg footer { flex-wrap:wrap; }
}
@media(max-height:600px) and (min-width:761px) {
 .actions { max-height:calc(100dvh - 110px); }
 .brand { padding:5px 8px; }
 .timer { top:85px; left:20px; transform:none; }
}
@media(prefers-reduced-motion:reduce) { *,*::before,*::after { animation:none!important; transition:none!important; } }

/* Text and form sizing: labels wrap; values and actions keep their space. */
.dlg, .dlg header > div, .cfg-cols, .cfg fieldset, .cols > section,
.field, .title, .actions-heading > div { min-width:0; }
.dlg header { gap:16px; }
.dlg header .icon, .brand .logo, .brand .icons, #btnPanel { flex-shrink:0; }
.dlg h2, .dlg h3, .actions-heading h2 { text-wrap:balance; }
.dlg .note, .cfg label > span:first-child, dd, .plan { overflow-wrap:anywhere; text-wrap:pretty; }
.cfg-cols { grid-template-columns:repeat(2,minmax(0,1fr)); align-items:start; gap:20px; }
.cfg fieldset { padding:8px 14px 10px; }
.cfg label { display:grid; grid-template-columns:minmax(0,1fr) 88px; gap:16px; align-items:center; padding:12px 0; line-height:1.4; }
.cfg label > span:first-child { min-width:0; gap:4px; }
.cfg label small { display:block; font-size:11px; line-height:1.45; }
.cfg .in { width:88px; min-width:88px; justify-self:end; }
.cfg .in input, .cfg .in output { min-width:0; width:100%; padding-block:9px; }
.cfg .in em { flex:0 0 12px; }
.cfg label.sw { grid-template-columns:minmax(0,1fr) 36px; }
.cfg label.sw input { justify-self:end; }
.cfg footer { display:grid; grid-template-columns:minmax(0,1fr) auto auto; gap:8px; border-top:1px solid var(--line); padding-top:16px; }
.cfg footer .grow { display:none; }
.cfg footer button { white-space:normal; text-wrap:balance; min-height:42px; }
#cfgReset { justify-self:start; text-align:left; padding-left:0; }
.cols { grid-template-columns:repeat(2,minmax(0,1fr)); }
dl { grid-template-columns:minmax(0,auto) minmax(0,1fr); line-height:1.55; gap:10px 14px; }
dt { white-space:normal; }
dd { min-width:0; }
.dlg a { overflow-wrap:anywhere; }
.actions .seg button { white-space:normal; line-height:1.35; text-wrap:balance; }
.actions .seg { min-width:0; }
.actions .more .seg { width:100%; }
.actions .more .seg button { min-width:0; white-space:nowrap; text-wrap:nowrap; overflow-wrap:normal; }
.actions .row button { flex-wrap:wrap; line-height:1.4; }
.t-meta, .t-status { text-wrap:pretty; overflow-wrap:anywhere; max-width:250px; }
@media(max-width:760px) {
 .cfg-cols,.cols { grid-template-columns:minmax(0,1fr); gap:20px; }
 .cfg label { gap:12px; }
 .dlg header .note { max-width:32ch; }
 .cfg footer { grid-template-columns:1fr 1fr; }
 #cfgReset { grid-column:1/-1; }
 .actions [aria-label="Destí"] { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media(max-width:374px) {
 .brand { gap:8px; }
 .brand .logo { display:none; }
 .brand .icons { padding-left:4px; margin-left:auto; }
 .brand button.icon { width:34px; }
 .title h1 { font-size:14px; }
 .title p { font-size:9px; }
 .dlg { padding:16px; }
 .cfg fieldset { padding-inline:10px; }
 .cfg label { grid-template-columns:minmax(0,1fr) 80px; gap:10px; }
 .cfg .in { width:80px; min-width:80px; }
 .touch { grid-template-columns:52px 52px 1fr 52px 52px; gap:6px; }
}
.auto-controls { display:grid; gap:8px; }
.auto-controls[hidden] { display:none!important; }
button:disabled { cursor:default; opacity:.45; transform:none; }
button:disabled:hover { background:rgba(255,255,255,.06); }
.cfg fieldset > .note { margin:4px 0 8px; font-size:11px; }

/* Panell de maniobra: accions curtes, files estables i text dins del contenidor. */
.actions { overflow-x:hidden; }
.actions .row { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); }
.actions .auto-controls .row { grid-template-columns:repeat(3,minmax(0,1fr)); }
.actions .row > button, .actions .seg button, #park, #btnUndo, #autoStatus, #plan {
  min-width:0; max-width:100%; overflow-wrap:anywhere; white-space:normal;
}
.actions .row > button { justify-content:center; text-align:center; }
#park { justify-content:center; text-align:center; }
#park kbd { flex:none; }
.park-controls { gap:8px; }
.park-controls label { margin-top:2px; }
#parkMode { width:100%; min-height:38px; padding:8px 12px; font:inherit; color:var(--text); background:var(--panel-solid); border:1px solid var(--line-2); border-radius:8px; cursor:pointer; }
#parkMode:focus-visible { outline:2px solid #7fb2ff; outline-offset:2px; }
#parkMode:disabled { opacity:.45; cursor:default; }
.actions .plan { line-height:1.45; }
@media(max-width:760px) {
  .actions { width:auto; }
  .actions .auto-controls .row > button { font-size:11px; padding-inline:3px; }
}
