/* Mobile-first corrections for the existing FishHID design, not a new skin. */
:root { --focus-ring: #276ff0; --control-size: 44px; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 4px; }
button:disabled { cursor: wait; opacity: .6; transform: none; }
button, a, input, textarea, select { -webkit-tap-highlight-color: transparent; }
button, a { touch-action: manipulation; }
input, textarea, select { font-size: 16px !important; }
body { overflow-wrap: break-word; }
/* Ambient art is decorative and must never extend the document scroll area. */
.ambient { max-width: 100%; right: 0; left: auto; }
.ambient-b { left: 0; right: auto; }
.hero-visual { overflow: clip; isolation: isolate; }
.hero-copy, .hero-visual, .device-meta, .quick-card > div,
.script-item > div, .release-item > div, .key-item > div, .user-item > div { min-width: 0; }
.hero h1, .section-heading h2 { letter-spacing: -.045em; }
.nav .brand, .dash-nav .brand { flex-shrink: 0; white-space: nowrap; }
.nav-actions { flex-shrink: 0; }
.device-meta strong, .device-meta span, .user-item strong, .script-item strong,
.release-item strong, .key-item strong, .script-item small, .release-item small,
.key-item small { overflow-wrap: anywhere; }
.dash-nav { gap: 12px; }
.dash-nav-right { min-width: 0; gap: 10px; }
.user-chip { min-width: 0; max-width: 240px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12px; }
.icon-button { min-width: var(--control-size); min-height: var(--control-size); font-size: 12px; flex-shrink: 0; }
.dashboard-shell { padding-top: 36px; }
.dash-welcome h1 { font-size: 34px; line-height: 1.25; letter-spacing: -.035em; }
.dash-welcome p { font-size: 14px; line-height: 1.75; }
.welcome-context { color: var(--muted); margin-top: 8px; font-size: 12px; }
.welcome-context span { overflow-wrap: anywhere; }
.welcome-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.tabs { margin-top: 30px; }
.tab { min-height: 48px; padding: 12px 5px; font-size: 13px; }
.panel h2 { line-height: 1.35; letter-spacing: -.025em; }
.panel-subtitle, .info-callout p { font-size: 13px; line-height: 1.75; }
.panel-head { align-items: center; }
.panel-full { min-height: 280px; }
.empty-state { padding: 30px 12px; font-size: 14px; line-height: 1.85; color: #73849d; }
.empty-state strong { display: block; margin-bottom: 8px; color: #253d60; font-size: 16px; }
.dash-device .device-meta strong { font-size: 14px; }
.dash-device .device-meta span { font-size: 12px; line-height: 1.65; }
.dash-device-actions .mini-button { display: inline-flex; }
.mini-button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; font-size: 12px; padding: 8px 12px; white-space: nowrap; }
.round-button { width: 44px; height: 44px; flex-shrink: 0; }
.quick-icon, .script-symbol, .release-symbol { flex-shrink: 0; }
.quick-card strong { font-size: 14px; }
.quick-card p { font-size: 12px; line-height: 1.75; }
.quick-card code { display: inline-block; max-width: 100%; overflow-wrap: anywhere; color: #2464bd; font-size: 11px; }
.quick-card { align-items: flex-start; }
.script-item strong, .release-item strong, .key-item strong, .user-item strong { font-size: 14px; line-height: 1.55; }
.script-item small, .release-item small, .key-item small, .user-item small { font-size: 12px; line-height: 1.65; }
.list-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.danger-button { color: #b43e57; border-color: #f0c9d1; }
.inline-error { padding: 16px; margin-top: 20px; border: 1px solid #efc7d1; border-radius: 12px; background: #fff5f7; color: #a63e55; line-height: 1.7; }
.inline-error button { margin-top: 10px; }
.workbench-footer { margin-top: 28px; color: var(--muted); font-size: 12px; line-height: 1.8; }
.workbench-footer a { color: var(--blue); }
.panel-stack { display: grid; gap: 20px; }
.modal-backdrop { overflow-y: auto; overscroll-behavior: contain; padding: 20px; }
.modal { max-height: calc(100dvh - 40px); overflow-y: auto; overscroll-behavior: contain; }
.modal h2 { line-height: 1.4; letter-spacing: -.025em; padding-right: 10px; }
.modal > p, .modal-hint { font-size: 13px; line-height: 1.85; }
.modal-form label { font-size: 13px; line-height: 1.7; }
.modal-form input, .modal-form textarea, .modal-form select { min-height: 48px; }
.modal-form input[type=file] { height: auto; padding: 10px; }
.modal-actions { align-items: center; flex-wrap: wrap; }
.modal-actions .button { min-height: 44px; }
.modal-error { color: #aa3f57; background: #fff1f4; padding: 12px; border-radius: 10px; font-size: 13px; margin-top: 14px; }
.pair-code { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.pair-code.code-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); max-width: 250px; margin-inline: auto; }
.pair-code span { width: 100%; height: 54px; font-size: 27px; }
.pair-tools { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 20px; }
.pair-expiry { color: #667e9e; font-size: 12px; }
.pair-steps { padding-left: 22px; margin: 14px 0; color: #667e9e; font-size: 13px; line-height: 1.95; }
.server-address { display: block; padding: 12px; margin: 12px 0; border: 1px solid var(--line); border-radius: 10px; background: var(--soft); overflow-wrap: anywhere; font: 12px/1.8 ui-monospace, monospace; }
.secret-box { font-size: 13px; white-space: pre-wrap; }
.observation-preview { font-size: 12px; line-height: 1.8; overflow-wrap: anywhere; }
.primary-control { color: #fff; background: var(--blue); border-color: var(--blue); }
.control-modal { width: min(820px, 100%); }
.control-device-status, .control-media, .control-text-panel { min-width: 0; border: 1px solid var(--line); border-radius: 12px; background: #f8fbff; padding: 12px; }
.control-device-status { margin: 12px 0; }
.control-device-status h3, .control-media h3, .control-text-panel h3 { margin: 0 0 8px; font-size: 13px; line-height: 1.4; color: #203b61; }
.control-device-meta { display: flex; flex-wrap: wrap; gap: 6px 12px; color: #536b88; font: 12px/1.6 ui-monospace, monospace; overflow-wrap: anywhere; }
.control-device-field { max-width: 100%; }
.control-preview-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(220px, .85fr); gap: 12px; align-items: start; }
.control-media, .control-text-panel { background: #fff; }
.control-screen { display: block; width: 100%; max-height: 52dvh; min-height: 96px; object-fit: contain; margin: 0 auto; border: 1px solid var(--line); border-radius: 8px; background: #101a2a; }
.control-screen[hidden], .control-empty[hidden] { display: none; }
.control-empty { min-height: 96px; display: grid; place-items: center; margin: 0; padding: 18px 12px; text-align: center; color: #48627f; line-height: 1.8; background: #edf5fc; border-radius: 8px; }
.control-text-panel { max-height: 52dvh; overflow: auto; }
.control-text-meta, .control-observed-at, .control-frame-info { margin: 0 0 8px; color: #48627f; font-size: 12px; line-height: 1.7; }
.control-frame-info { color: #647c98; font-variant-numeric: tabular-nums; }
.control-text-list { margin: 0; padding: 0 0 0 25px; color: #172f50; }
.control-text-list li { padding: 6px 4px; border-bottom: 1px solid #e4edf6; line-height: 1.65; overflow-wrap: anywhere; }
.control-text-list li:last-child { border-bottom: 0; }
.control-text-line { display: block; white-space: pre-wrap; }
.control-text-confidence { display: block; margin-top: 2px; color: #7186a0; font-size: 11px; }
.observation-preview { min-width: 0; }
.observation-detail { max-height: 34dvh; overflow: auto; }
.control-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }
.control-actions > button { min-height: 44px; }
.control-actions > [hidden] { display: none; }
.control-transport { color: var(--muted); font: 11px/1.7 ui-monospace, monospace; overflow-wrap: anywhere; }
.control-modal summary { font-size: 12px; color: var(--muted); cursor: pointer; padding: 10px 0; }
.control-detail { max-width: 100%; max-height: 36dvh; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; font: 12px/1.7 ui-monospace, monospace; padding: 12px; background: var(--soft); border-radius: 10px; }
.control-modal > p { max-width: 100%; }
.toast { max-width: min(520px, calc(100vw - 24px)); font-size: 13px; line-height: 1.7; z-index: 50; }
.auth-page { min-height: 100dvh; overflow-x: clip; overflow-y: auto; }
.auth-card label { font-size: 13px; }
.auth-card > p, .auth-switch, .auth-note { font-size: 12px; line-height: 1.8; }
.auth-switch button { min-height: 40px; }
.docs-content p { font-size: 14px; }
.docs-content code, .code-card { overflow-wrap: anywhere; }
.code-card { white-space: pre-wrap; }
@media (max-width: 980px) {
  .hero { gap: 0; }
  .hero-visual { margin-top: 32px; }
  .overview-grid { grid-template-columns: minmax(0, 1fr); }
  .feature-wide .feature-art { flex-basis: auto; }
  .section-heading h2 { line-height: 1.2; }
}
@media (max-width: 600px) {
  .shell, .section-flow > .shell, .dashboard-shell, .docs-shell { width: calc(100% - 32px); }
  .nav { height: 68px; gap: 10px; }
  .nav .brand { font-size: 15px; gap: 8px; }
  .brand-mark { width: 30px; height: 30px; flex-shrink: 0; }
  .nav-actions .button { padding: 0 12px; min-height: 44px; gap: 7px; }
  .hero { padding: 30px 0 60px; }
  .hero-copy { padding-top: 8px; }
  .hero h1 { margin-top: 22px; font-size: clamp(36px, 10.8vw, 46px); line-height: 1.16; letter-spacing: -.045em; }
  .hero-lead { font-size: 14px; line-height: 1.9; }
  .hero-actions { flex-wrap: wrap; margin-top: 24px; gap: 10px; }
  .hero-actions .button { padding-inline: 14px; gap: 10px; }
  .hero-proof { margin-top: 30px; gap: 10px; }
  .proof-item { min-width: 0; flex: 1; padding-right: 7px; }
  .proof-item strong { font-size: 17px; }
  .proof-item span { font-size: 10px; line-height: 1.7; }
  .hero-visual { margin-top: 24px; min-height: 350px; }
  .float-script { left: 0; bottom: 10px; }
  .float-ai { right: 0; top: 8px; }
  .console-card { max-width: 100%; }
  .section { padding: 64px 0; }
  .section-heading { margin-bottom: 28px; }
  .section-heading h2 { font-size: 34px; line-height: 1.25; }
  .section-heading p { margin-top: 18px; font-size: 14px; }
  .feature-card { padding: 24px; min-height: 0; }
  .feature-card h3 { font-size: 20px; line-height: 1.45; }
  .feature-card p, .feature-card a { font-size: 13px; }
  .feature-number { right: 24px; top: 24px; }
  .feature-art { max-width: 100%; }
  .control-node.n3 { left: auto; right: 0; }
  .security-panel { padding: 26px 22px; }
  .security-panel h2 { font-size: 30px; line-height: 1.25; }
  .security-points { gap: 18px; }
  .security-points strong { font-size: 13px; }
  .security-points small { font-size: 12px; }
  .flow-step h3 { margin-top: 20px; }
  .flow-step p { max-width: none; font-size: 13px; }
  .dash-nav { height: 64px; padding: 0 16px; gap: 8px; }
  .dash-nav .brand { font-size: 15px; gap: 8px; }
  .dash-nav .brand b { display: none; }
  .user-chip { max-width: clamp(90px, 30vw, 160px); padding: 8px; font-size: 11px; }
  .dash-nav-right { gap: 6px; }
  .dashboard-shell { padding-top: 24px; padding-bottom: calc(32px + env(safe-area-inset-bottom)); }
  .dash-welcome { display: block; }
  .dash-welcome h1 { font-size: 28px; margin-top: 10px; }
  .dash-welcome .button { margin-top: 0; }
  .welcome-actions { margin-top: 20px; }
  .welcome-actions .button:first-child { flex: 1; }
  .welcome-actions .button { min-height: 48px; padding-inline: 16px; gap: 10px; }
  .tabs { position: sticky; top: 0; z-index: 5; gap: 0; overflow: visible; background: #f4f8fc; padding-top: 4px; }
  .tab { min-width: 0; flex: 1; padding: 13px 2px; white-space: nowrap; font-size: 12px; }
  .tab.active::after { left: 6px; right: 6px; }
  .tab-panel { padding-top: 20px; }
  .panel { border-radius: 17px; padding: 20px; }
  .panel-head { gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
  .panel-head .button { min-height: 44px; padding-inline: 14px; font-size: 12px; }
  .panel h2 { font-size: 21px; }
  .dash-device { flex-wrap: wrap; gap: 10px; }
  .dash-device .device-meta { flex-basis: calc(100% - 64px); }
  .dash-device-actions { margin-left: 56px; width: calc(100% - 56px); display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; }
  .dash-device-actions .mini-button { display: inline-flex; flex: 1 1 calc(50% - 8px); }
  .control-actions > button { flex: 1 1 calc(50% - 8px); }
  .control-modal { padding: 18px; }
  .control-preview-grid { grid-template-columns: minmax(0, 1fr); }
  .control-screen { width: 100%; min-height: 160px; max-height: 48dvh; }
  .control-text-panel { max-height: 36dvh; }
  .script-item, .release-item, .key-item, .user-item { padding: 14px 12px; gap: 10px; flex-wrap: wrap; }
  .script-item > div:nth-child(2), .release-item > div:nth-child(2), .key-item > div:nth-child(2), .user-item > div:nth-child(2) { flex-basis: calc(100% - 56px); }
  .list-actions { margin-left: 46px; }
  .modal-backdrop { padding: 12px; padding-bottom: max(12px, env(safe-area-inset-bottom)); }
  .modal { width: 100%; padding: 22px; max-height: calc(100dvh - 24px); border-radius: 18px; }
  .modal h2 { font-size: 22px; }
  .modal-actions { gap: 10px; }
  .modal-actions .button { flex: 1; padding-inline: 14px; }
  .pair-code { gap: 5px; margin: 20px 0; }
  .pair-code span { height: 50px; border-radius: 9px; font-size: 25px; }
  .auth-shell { padding: 24px 0; }
  .auth-brand { margin-bottom: 24px; }
  .auth-card { padding: 26px 22px; }
  .auth-card h1 { font-size: 28px; line-height: 1.3; }
  .docs-shell { padding-top: 36px; }
  .docs-shell h1 { font-size: 39px; line-height: 1.2; }
  .docs-lead { font-size: 14px; margin-bottom: 36px; }
  .docs-content h2 { font-size: 25px; line-height: 1.4; }
  .quick-card p, .dash-device .device-meta span { font-size: 13px; color: #5b708f; }
  .toast { position: relative; max-width: none; left: auto; right: auto; bottom: auto; margin: 14px 0 0; box-shadow: none; }
}
/* Simple v196 controls share the existing surface and keep each row shrinkable. */
.device-selection-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 10px; margin-bottom: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--soft); min-width: 0; }
.selected-device-count { flex: 1 1 92px; font-size: 12px; font-weight: 750; color: #2c486c; }
.selection-divider { width: 1px; align-self: stretch; background: var(--line); }
.device-selection-toolbar .mini-button { min-height: 38px; padding: 6px 9px; }
.device-select { display: inline-flex; flex: 0 0 32px; flex-direction: column; align-items: center; gap: 3px; font-size: 10px; color: var(--muted); cursor: pointer; }
.device-select input[type=checkbox] { width: 20px; height: 20px; min-height: 20px; margin: 0; accent-color: var(--blue); }
.dash-device { min-width: 0; }
.dash-device-actions { flex-wrap: wrap; gap: 6px; min-width: 0; }
.device-capability { flex-basis: 100%; font-size: 11px; line-height: 1.6; color: #8e5b18; }
.simple-invoke-modal { width: min(820px, 100%); }
.invoke-state { color: #244a79; font-size: 14px; line-height: 1.8; }
.invoke-caveat, .group-result-note { color: var(--muted); font-size: 12px; line-height: 1.75; }
.invoke-preview, .invoke-results, .script-editor-modal { min-width: 0; max-width: 100%; }
.invoke-detail { max-width: 100%; max-height: 32dvh; overflow: auto; padding: 10px; border-radius: 10px; background: var(--soft); white-space: pre-wrap; overflow-wrap: anywhere; font: 12px/1.7 ui-monospace, monospace; }
.invoke-results { list-style: none; margin: 0; padding: 0; }
.invoke-results li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.invoke-results strong, .invoke-results span { display: block; font-size: 12px; line-height: 1.7; overflow-wrap: anywhere; }
.invoke-results span { color: var(--muted); }
.invoke-error { color: #a33d52; background: #fff2f4; border: 1px solid #f0cbd2; border-radius: 8px; padding: 9px 11px; font-size: 12px; line-height: 1.65; overflow-wrap: anywhere; }
.script-template-actions { display: flex; flex-wrap: wrap; gap: 7px; margin: 10px 0 4px; }
.script-template-actions .mini-button { min-height: 40px; }
.script-template-note { margin: 4px 0 10px; color: var(--muted); font-size: 12px; line-height: 1.7; overflow-wrap: anywhere; }
.script-json-editor { width: 100%; min-width: 0; max-width: 100%; min-height: 210px; resize: vertical; overflow-wrap: anywhere; font-family: ui-monospace, monospace; line-height: 1.65; }
@media (max-width: 600px) {
  .panel-devices { padding: 16px; }
  .dash-device .device-icon { display: none; }
  .dash-device .device-meta { flex: 1 1 calc(100% - 42px); }
  .dash-device-actions { margin-left: 0; width: 100%; }
  .dash-device-actions .status-pill { flex-basis: auto; }
  .dash-device-actions .mini-button { flex: 1 1 calc(50% - 6px); min-width: 0; max-width: 100%; white-space: normal; }
  .selection-divider { display: none; }
  .selected-device-count { flex-basis: 100%; }
  .device-selection-toolbar .mini-button { flex: 1 1 calc(50% - 6px); }
  .simple-invoke-modal { padding: 16px; }
  .simple-invoke-modal .control-preview-grid { grid-template-columns: minmax(0, 1fr); }
  .script-item .list-actions { margin-left: 0; width: 100%; }
  .script-item .list-actions .mini-button { flex: 1; min-width: 0; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
