    :root {
      color-scheme: light dark;
      --bg: #08130b;
      --bg-alt: #132015;
      --card: rgba(19, 32, 21, 0.78);
      --border: rgba(251, 191, 36, 0.22);
      --accent: #f97316;
      --accent-dark: #ea580c;
      --accent-secondary: #facc15;
      --highlight: #22c55e;
      --muted: rgba(248, 239, 186, 0.76);
      --text: #fefce8;
      --surface: rgba(14, 26, 18, 0.55);
      --shadow: 0 24px 48px rgba(8, 15, 10, 0.42);
      --track-h: 200px;
      --track-w: 14px;
      --track-area-w: 140px;
      --track-x: 50%;
      --track-y-offset: 0px;
      --labels-gap: 16px;
      --marker-dot-size: 10px;
      --marker-dot-border: 2px;
      --side-labels-w: 140px;
      --label-arrow-head: 6px;
      --label-arrow-line: 18px;
    }

    @media (prefers-color-scheme: light) {
      :root {
        --bg: #fff7ed;
        --bg-alt: #fef3c7;
        --card: rgba(255, 255, 255, 0.94);
        --border: rgba(249, 115, 22, 0.22);
        --accent: #ea580c;
        --accent-dark: #c2410c;
        --accent-secondary: #f59e0b;
        --highlight: #16a34a;
        --muted: rgba(100, 73, 27, 0.62);
        --text: #1c1b17;
        --surface: rgba(255, 244, 222, 0.72);
        --shadow: 0 18px 38px rgba(215, 119, 6, 0.22);
      }
    }

    * {
      box-sizing: border-box;
    }

    body {
      margin: 0;
      font: 15px/1.6 "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
      min-height: 100vh;
      color: var(--text);
      background:
        radial-gradient(circle at 15% 25%, rgba(250, 204, 21, 0.2), transparent 55%),
        radial-gradient(circle at 80% 85%, rgba(34, 197, 94, 0.2), transparent 60%),
        linear-gradient(160deg, var(--bg), #05070c 70%);
      display: flex;
      flex-direction: column;
      padding: 24px 16px 32px;
    }

    .view {
      flex: 1;
      display: none;
      align-items: center;
      justify-content: center;
    }

    .view.active {
      display: flex;
    }

    .hidden {
      display: none !important;
    }

    .sr-only {
      position: absolute;
      width: 1px;
      height: 1px;
      padding: 0;
      margin: -1px;
      overflow: hidden;
      clip: rect(0, 0, 0, 0);
      white-space: nowrap;
      border: 0;
    }

    .login-view {
      background: transparent;
    }

    .login-card {
      width: min(420px, 100%);
      background: var(--card);
      border-radius: 28px;
      border: 1px solid var(--border);
      box-shadow: var(--shadow);
      padding: 36px 32px;
      display: grid;
      gap: 20px;
      text-align: center;
      backdrop-filter: blur(18px);
      position: relative;
    }

    .env-switch-trigger {
      position: absolute;
      top: 12px;
      right: 12px;
      width: 28px;
      height: 28px;
      border-radius: 8px;
      border: 1px solid rgba(250, 204, 21, 0.35);
      background: rgba(15, 24, 16, 0.65);
      color: rgba(250, 204, 21, 0.95);
      display: inline-flex;
      align-items: center;
      justify-content: center;
      padding: 0;
      cursor: pointer;
    }

    .env-switch-trigger svg {
      width: 15px;
      height: 15px;
      fill: currentColor;
      display: block;
    }

    .env-switch-trigger:hover {
      background: rgba(249, 115, 22, 0.18);
      border-color: rgba(249, 115, 22, 0.7);
    }

    .env-switch-trigger:focus-visible {
      outline: 2px solid rgba(249, 115, 22, 0.75);
      outline-offset: 2px;
    }

    .login-logo {
      width: 96px;
      height: 96px;
      border-radius: 30px;
      margin: 0 auto 6px;
      display: grid;
      place-items: center;
      background: rgba(249, 115, 22, 0.12);
      border: 2px dashed rgba(250, 204, 21, 0.55);
      overflow: hidden;
    }

    .logo-image {
      width: 100%;
      height: 100%;
      object-fit: contain;
      padding: 12px;
    }

    .login-card h1 {
      margin: 0;
      font-size: 28px;
      letter-spacing: -0.02em;
    }

    .login-card p {
      margin: 0;
      color: var(--muted);
      font-size: 14px;
    }

    .login-form {
      display: grid;
      gap: 14px;
      text-align: left;
    }

    .login-form label {
      font-weight: 600;
      font-size: 13px;
      color: var(--muted);
    }

    .login-form input {
      width: 100%;
      padding: 11px 14px;
      border-radius: 14px;
      border: 1px solid rgba(250, 204, 21, 0.24);
      background: rgba(19, 32, 21, 0.6);
      color: inherit;
      font: inherit;
      outline: none;
      transition: border-color 0.18s ease, box-shadow 0.18s ease;
    }

    .login-form input:focus {
      border-color: var(--accent);
      box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.18);
    }

    .login-form button {
      width: 100%;
      margin-top: 6px;
    }

    .env-switch-row {
      display: none;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      margin-top: -2px;
      padding: 8px 10px;
      border-radius: 12px;
      border: 1px dashed rgba(250, 204, 21, 0.3);
      background: rgba(15, 24, 16, 0.35);
    }

    .env-switch-row.is-visible {
      display: flex;
    }

    .env-switch-label {
      font-size: 12px;
      color: var(--muted);
      font-weight: 600;
      letter-spacing: 0.03em;
      text-transform: uppercase;
    }

    .env-switch {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      font-size: 12px;
      color: var(--muted);
      user-select: none;
    }

    .env-switch input {
      position: absolute;
      opacity: 0;
      width: 1px;
      height: 1px;
      pointer-events: none;
    }

    .env-switch-slider {
      width: 40px;
      height: 20px;
      border-radius: 999px;
      border: 1px solid rgba(250, 204, 21, 0.45);
      background: rgba(250, 204, 21, 0.2);
      position: relative;
      transition: all 0.2s ease;
    }

    .env-switch-slider::after {
      content: "";
      position: absolute;
      top: 2px;
      left: 2px;
      width: 14px;
      height: 14px;
      border-radius: 50%;
      background: var(--accent);
      transition: transform 0.2s ease;
    }

    .env-switch input:checked + .env-switch-slider {
      border-color: rgba(34, 197, 94, 0.55);
      background: rgba(34, 197, 94, 0.25);
    }

    .env-switch input:checked + .env-switch-slider::after {
      transform: translateX(20px);
      background: var(--highlight);
    }

    .login-message {
      min-height: 20px;
      font-size: 13px;
      color: #f97316;
      text-align: center;
      font-weight: 600;
    }

    .app-shell {
      width: min(1320px, 100%);
      display: grid;
      gap: 18px;
      margin: 0 auto;
    }

    .app-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 20px;
      flex-wrap: wrap;
    }

    .header-left {
      display: flex;
      align-items: center;
      gap: 10px;
      flex: 1 1 auto;
      min-width: 320px;
      align-self: flex-start;
      margin-top: -12px;
    }

    .header-patient-stack {
      display: flex;
      flex-direction: row;
      align-items: center;
      flex-wrap: wrap;
      gap: 10px;
    }

    .brand-heading {
      font-size: 15px;
      font-weight: 800;
      letter-spacing: 0.07em;
      text-transform: uppercase;
      color: rgba(255, 255, 255, 0.92);
      margin: 0;
      text-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
    }

    .header-meta {
      display: none;
    }

    .ghost-button {
      background: transparent;
      color: rgba(255, 255, 255, 0.85);
      border: 1px solid rgba(255, 255, 255, 0.4);
      box-shadow: none;
      padding: 10px 16px;
      transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
    }

    .ghost-button.reconnect-window-icon {
      width: 46px;
      height: 46px;
      padding: 0;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      border-radius: 12px;
    }

    .ghost-button.reconnect-window-icon .reconnect-icon-image {
      width: 27px;
      height: 27px;
      object-fit: contain;
      display: block;
    }

    .ghost-button:disabled {
      opacity: 0.4;
      cursor: not-allowed;
      border-color: rgba(255, 255, 255, 0.25);
    }

    .ghost-button.is-armed {
      background: var(--accent);
      color: #000;
      border-color: var(--accent-dark);
      opacity: 1;
      cursor: pointer;
    }

    @media (prefers-color-scheme: light) {
      .ghost-button {
        color: #1f2937;
        border-color: rgba(31, 41, 55, 0.35);
      }
      .ghost-button:disabled {
        border-color: rgba(31, 41, 55, 0.2);
      }
      .ghost-button.is-armed {
        color: #fff;
      }
    }

    .reconnect-banner {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 16px;
      padding: 14px 18px;
      border-radius: 18px;
      border: 1px solid rgba(248, 113, 113, 0.4);
      background: rgba(120, 0, 0, 0.2);
      color: #fee2e2;
      box-shadow: 0 12px 32px rgba(120, 0, 0, 0.25);
      font-size: 14px;
    }

    .reconnect-text {
      display: flex;
      flex-direction: column;
      gap: 2px;
    }

    .reconnect-button {
      border: none;
      border-radius: 999px;
      padding: 10px 18px;
      font: 600 13px/1 "Inter", sans-serif;
      letter-spacing: 0.05em;
      text-transform: uppercase;
      background: #f97316;
      color: #1c0f05;
      cursor: pointer;
      box-shadow: 0 10px 24px rgba(249, 115, 22, 0.35);
      transition: transform 0.18s ease, box-shadow 0.18s ease;
    }

    .reconnect-button:hover {
      transform: translateY(-1px);
      box-shadow: 0 14px 30px rgba(249, 115, 22, 0.45);
    }

    .logo-slot {
      width: 44px;
      height: 44px;
      border-radius: 12px;
      border: 1px solid rgba(250, 204, 21, 0.4);
      background: radial-gradient(circle at 35% 30%, rgba(250, 204, 21, 0.45), rgba(18, 26, 19, 0.9));
      display: grid;
      place-content: center;
      overflow: hidden;
      box-shadow: 0 8px 22px rgba(0, 0, 0, 0.4);
    }

    .logo-slot .logo-image {
      padding: 3px;
      transform: scale(1.16);
    }

    .title-block h1 {
      margin: 0 0 4px;
      font-size: 22px;
      letter-spacing: -0.03em;
    }

    .patient-heading-block {
      margin: 0;
    }

    .patient-header-line {
      margin: 0;
      font-size: 13px;
      font-weight: 500;
      color: rgba(255, 255, 255, 0.9);
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      align-items: center;
      text-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
      min-width: 260px;
    }

    .patient-header-label {
      font-weight: 700;
      text-transform: uppercase;
      font-size: 10px;
      color: rgba(255, 255, 255, 0.85);
      opacity: 0.85;
      letter-spacing: 0.08em;
    }

    #patientNameValue,
    #patientPhoneValue {
      color: rgba(255, 255, 255, 0.98);
      font-weight: 600;
      text-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
      font-size: 14px;
    }

    .patient-header-separator {
      margin-left: 12px;
    }

    #patientNameValue,
    #patientPhoneValue {
      font-weight: 600;
      color: rgba(255, 255, 255, 0.98);
    }

    .subtitle {
      margin: 0;
      color: var(--muted);
      font-size: 12px;
    }

    .warning {
      border-radius: 16px;
      padding: 18px 20px;
      background: rgba(251, 191, 36, 0.16);
      border: 1px solid rgba(251, 191, 36, 0.45);
      color: var(--accent-secondary);
    }

    .card-grid {
      display: grid;
      gap: 22px;
      grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }

    .card {
      background: var(--card);
      border-radius: 20px;
      padding: 18px 20px;
      border: 1px solid var(--border);
      box-shadow: var(--shadow);
      backdrop-filter: blur(16px);
      position: relative;
    }

    .card h2 {
      margin: 0 0 8px;
      font-size: 20px;
      letter-spacing: -0.015em;
    }

    .card p {
      margin: 0 0 16px;
      color: var(--muted);
      font-size: 14px;
    }

    .port-card {
      display: grid;
      gap: 16px;
    }

    .status-chip {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      padding: 6px 12px;
      border-radius: 999px;
      font-size: 13px;
      font-weight: 600;
      background: rgba(249, 115, 22, 0.16);
      color: rgba(249, 115, 22, 0.92);
    }

    .status-chip::before {
      content: "";
      width: 8px;
      height: 8px;
      border-radius: 50%;
      background: currentColor;
      opacity: 0.85;
    }

    .port-card.is-connected .status-chip {
      background: rgba(34, 197, 94, 0.18);
      color: rgba(34, 197, 94, 0.95);
    }

    label {
      font-weight: 600;
      font-size: 13px;
      display: block;
      margin-bottom: 6px;
    }

    select,
    input[type="number"],
    input[type="text"] {
      width: 100%;
      padding: 10px 12px;
      border-radius: 12px;
      border: 1px solid rgba(250, 204, 21, 0.26);
      background: rgba(19, 32, 21, 0.55);
      color: inherit;
      font: inherit;
      outline: none;
      transition: border-color 0.18s ease, box-shadow 0.18s ease;
    }

    select:focus,
    input:focus {
      border-color: var(--accent);
      box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.18);
    }

    button {
      appearance: none;
      border: none;
      border-radius: 12px;
      padding: 11px 18px;
      font: 600 14px/1 "Inter", sans-serif;
      background: var(--accent);
      color: #1a1207;
      cursor: pointer;
      transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
      box-shadow: 0 10px 24px rgba(249, 115, 22, 0.28);
    }

    button:hover {
      transform: translateY(-1px);
      box-shadow: 0 16px 32px rgba(249, 115, 22, 0.32);
      background: var(--accent-dark);
    }

    button:disabled {
      cursor: not-allowed;
      opacity: 0.55;
      transform: none;
      box-shadow: none;
    }

    .button-row {
      display: flex;
      gap: 10px;
      flex-wrap: wrap;
    }

    .port-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 18px;
      gap: 16px;
    }

    .port-header h2 {
      margin: 0;
      font-size: 22px;
      letter-spacing: -0.015em;
    }

    .port-actions {
      display: flex;
      gap: 12px;
      flex-wrap: wrap;
      justify-content: flex-end;
    }

    .port-actions button {
      min-width: 180px;
      font-size: 15px;
    }

    .dashboard-grid {
      display: grid;
      gap: 18px;
      grid-template-columns: minmax(0, 0.4fr) minmax(0, 0.6fr);
      align-items: start;
    }

    .graphs-column {
      display: flex;
      flex-direction: column;
      gap: 6px;
      align-self: flex-start;
      margin-top: -78px;
      margin-left: 10px;
    }

    .slider-graphs {
      position: relative;
    }

    .graphs-pane {
      display: grid;
      grid-template-columns: minmax(0, 1fr);
      grid-template-rows: auto repeat(3, minmax(0, 1fr)) auto;
      gap: 2px;
      padding-right: 16px;
    }

    .graphs-status-plane {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      justify-content: space-between;
      gap: 1px;
      padding: 2px 4px;
      margin-top: 8px;
      border-radius: 18px;
      border: 1px solid rgba(250, 204, 21, 0.28);
      background: linear-gradient(120deg, rgba(8, 12, 8, 0.98), rgba(20, 30, 18, 0.98));
      box-shadow: 0 18px 38px rgba(5, 10, 6, 0.45);
    }

    .graphs-status-channels {
      display: flex;
      flex-direction: column;
      gap: 2px;
      min-width: 200px;
      flex: 1;
    }

    .graphs-status-leds {
      display: flex;
      flex-wrap: wrap;
      gap: 2px;
      justify-content: flex-end;
      min-width: 240px;
      margin-top: 0;
      align-items: center;
    }

    .graph-card {
      border-radius: 18px;
      border: 1px solid var(--border);
      background: var(--card);
      box-shadow: var(--shadow);
      padding: 5px;
      display: grid;
      grid-template-rows: auto 1fr;
      gap: 2px;
      min-height: 0;
    }

    .graph-card-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      margin-bottom: 0;
    }

    .graph-title {
      margin: 0;
      font-size: 15px;
      font-weight: 700;
      letter-spacing: 0.05em;
      text-transform: uppercase;
    }

    .graph-value {
      font-size: 9px;
      font-weight: 600;
      padding: 1px 5px;
      border-radius: 999px;
      background: rgba(148, 163, 184, 0.25);
      color: var(--highlight);
      min-width: 34px;
      text-align: center;
      font-variant-numeric: tabular-nums;
    }

    .graph-card-body {
      display: flex;
      flex-direction: column;
      align-items: stretch;
      gap: 4px;
      min-height: 0;
    }

    .graph-card-body .graph-row--compact {
      gap: 1px;
      align-items: stretch;
      flex: 1 1 auto;
      min-height: 0;
    }

    .graph-card-body .graph-side--compact {
      width: 62px;
      min-height: 142px;
      gap: 0;
      align-items: flex-start;
      justify-content: space-between;
      padding: 2px 0;
    }

    .graph-card-body .graph-side--compact .axis-y-max,
    .graph-card-body .graph-side--compact .axis-y-mid,
    .graph-card-body .graph-side--compact .axis-y-min {
      font-size: 10px;
      line-height: 1.15;
      width: 100%;
    }

    .graph-card-body .graph-side--compact .axis-y-max span,
    .graph-card-body .graph-side--compact .axis-y-mid span,
    .graph-card-body .graph-side--compact .axis-y-min span {
      font-size: 10px;
      white-space: normal;
      overflow-wrap: anywhere;
    }

    .graph-card-body .graph-main--compact {
      gap: 4px;
      min-width: 0;
      flex: 1 1 auto;
      min-height: 0;
    }

    .graph-card-body .graph-canvas {
      border-radius: 14px;
      background: rgba(0, 0, 0, 0.6);
      width: 100%;
      height: 142px;
      min-height: 142px;
      flex: 1 1 auto;
      display: block;
    }

    .graph-card--long {
      display: none;
    }

    .camera-preview-card {
      min-height: 220px;
    }

    .camera-preview-frame {
      width: 100%;
      min-height: 220px;
      margin: 0;
      border-radius: 14px;
      border: 1px solid rgba(250, 204, 21, 0.24);
      background: rgba(0, 0, 0, 0.45);
      display: grid;
      place-items: center;
      overflow: hidden;
    }

    .camera-preview-video {
      width: 100%;
      max-height: 360px;
      object-fit: cover;
      display: block;
    }

    .camera-preview-status {
      margin: 0;
      padding: 10px 12px;
      font-size: 12px;
      color: var(--muted);
      text-align: center;
      line-height: 1.4;
    }

    .slider-command-panel {
      background: var(--card);
      border: 1px solid var(--border);
      border-radius: 24px;
      padding: 18px;
      box-shadow: var(--shadow);
      display: flex;
      flex-direction: column;
      gap: 18px;
    }

    .slider-layout {
      display: flex;
      flex-direction: column;
      gap: 18px;
    }

    .sliders-area {
      display: grid;
      grid-template-columns: 40px minmax(0, 1fr);
      gap: 4px;
      align-items: flex-start;
    }

    .common-scale-wrap {
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      font-size: 11px;
      font-weight: 600;
      color: rgba(226, 232, 240, 0.75);
      height: var(--track-h);
      padding: 0;
      align-items: flex-start;
      width: 44px;
      margin-top: 18px;
    }

    .sliders-grid {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 14px;
      padding-left: 0;
    }

    .vslider {
      padding: 16px 12px 14px 10px;
      border-radius: 20px;
      background: rgba(10, 18, 14, 0.82);
      border: 1px solid var(--border);
      display: grid;
      grid-template-columns: minmax(0, var(--track-area-w)) minmax(0, 1fr);
      grid-template-rows: auto auto;
      column-gap: 12px;
      row-gap: 8px;
      align-items: start;
      min-height: 0;
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
    }

    .vslider.active,
    .vslider.is-selected {
      border-color: var(--accent);
      box-shadow: 0 16px 28px rgba(0, 0, 0, 0.35);
    }

    .trackWrap {
      height: var(--track-h);
      width: var(--track-area-w);
      display: grid;
      place-items: center;
      position: relative;
      grid-column: 1;
      grid-row: 1 / span 2;
      justify-self: flex-start;
      margin-left: -24px;
      margin-top: 10px;
    }

    .trackLine {
      position: absolute;
      left: var(--track-x);
      top: var(--track-y-offset);
      height: calc(100% - var(--track-y-offset));
      width: var(--track-w);
      transform: translateX(-50%);
      border-radius: 999px;
      background: linear-gradient(180deg, #dcfce7, #86efac);
      border: 1px solid rgba(34, 197, 94, 0.3);
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
    }

    .positionArrow {
      position: absolute;
      left: calc(var(--track-x) - var(--track-w)/2 - 28px);
      width: 24px;
      height: 3px;
      background: rgba(226, 232, 240, 0.85);
      border-radius: 999px;
      transform: translateY(-50%);
      z-index: 2;
      pointer-events: none;
    }

    .positionArrow::after {
      content: "";
      position: absolute;
      right: -7px;
      top: 50%;
      transform: translateY(-50%);
      border-top: 5px solid transparent;
      border-bottom: 5px solid transparent;
      border-left: 7px solid rgba(226, 232, 240, 0.85);
    }

    .positionValue {
      position: absolute;
      left: 50%;
      bottom: calc(100% + 6px);
      transform: translateX(-50%);
      font-size: 11px;
      font-weight: 800;
      color: #f8fafc;
      padding: 0;
      line-height: 1.2;
      white-space: nowrap;
      pointer-events: none;
      text-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
    }

    .markers {
      position: absolute;
      inset: 0;
      pointer-events: none;
    }

    .markerDot {
      position: absolute;
      left: var(--track-x);
      transform: translate(-50%, -50%);
    }

    .markerDot .dot {
      width: var(--marker-dot-size);
      height: var(--marker-dot-size);
      border-radius: 50%;
      background: var(--accent);
      border: var(--marker-dot-border) solid #000;
      box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
    }

    .sideLabels {
      position: absolute;
      top: 0;
      left: calc(var(--track-x) + var(--track-w)/2 + var(--labels-gap));
      width: var(--side-labels-w);
      height: 100%;
      pointer-events: none;
    }

    .sideLabel {
      position: absolute;
      left: 0;
      transform: translateY(-50%);
      background: var(--card);
      border-radius: 999px;
      padding: 4px 10px;
      font-size: 12px;
      color: var(--text);
      box-shadow: 0 8px 16px rgba(0, 0, 0, 0.35);
      pointer-events: auto;
    }

    .pin-clickable {
      cursor: pointer;
      pointer-events: auto;
    }

    .sideLabel::before {
      content: "";
      position: absolute;
      top: 50%;
      right: 100%;
      width: calc(var(--labels-gap) - var(--label-arrow-head));
      height: 2px;
      transform: translateY(-50%);
      background: rgba(226, 232, 240, 0.8);
      border-radius: 999px;
      pointer-events: none;
    }

    .sideLabel::after {
      content: "";
      position: absolute;
      top: 50%;
      right: calc(100% + (var(--labels-gap) - var(--label-arrow-head)));
      transform: translateY(-50%);
      border-top: var(--label-arrow-head) solid transparent;
      border-bottom: var(--label-arrow-head) solid transparent;
      border-right: var(--label-arrow-head) solid rgba(226, 232, 240, 0.8);
      pointer-events: none;
    }

    .selectRow {
      grid-column: 2;
      grid-row: 3;
      justify-self: flex-end;
      align-self: end;
      text-align: left;
      font-weight: 700;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      color: rgba(226, 232, 240, 0.78);
      font-size: 12px;
    }

    .latchedList {
      display: none;
      list-style: none;
      margin: 0;
      padding: 0;
      font-size: 12px;
      color: rgba(226, 232, 240, 0.7);
      grid-column: 2;
      grid-row: 2;
      align-self: start;
    }

    input[type="range"] {
      opacity: 0;
      width: 0;
      height: 0;
      position: absolute;
      pointer-events: none;
    }

    @media (max-width: 1100px) {
      .sliders-area {
        grid-template-columns: minmax(0, 1fr);
      }

      .sliders-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
      }
    }

    .slider-control-panel {
      display: grid;
      gap: 14px;
    }

    .slider-command-buttons {
      display: flex;
      flex-direction: column;
      gap: 10px;
      width: 100%;
    }

    .slider-top-buttons,
    .slider-icon-row {
      justify-content: flex-start;
    }

    .slider-top-buttons {
      flex-wrap: nowrap;
      gap: 6px;
      align-items: center;
    }

    .slider-top-buttons .slider-icon {
      width: 40px;
      height: 40px;
      border-radius: 12px;
    }

    .slider-top-buttons .slider-step-toggle {
      width: 40px;
      height: 40px;
      min-width: 40px;
      padding: 0;
      border-radius: 12px;
      font-size: 16px;
    }

    .slider-top-buttons .reconnect-pressure-icon .reconnect-icon-image {
      width: 30px;
      height: 30px;
      object-fit: contain;
      display: block;
      margin: 0 auto;
    }

    .slider-icon-row .btn.symbol,
    .slider-top-buttons .btn.symbol {
      width: 46px;
      height: 46px;
      border-radius: 16px;
      padding: 0;
      background: rgba(9, 13, 9, 0.65);
      border: 1px solid rgba(250, 204, 21, 0.25);
    }

    .slider-top-buttons .btn.symbol {
      width: 40px;
      height: 40px;
      border-radius: 12px;
    }

    .slider-icon-row .btn.symbol svg,
    .slider-top-buttons .btn.symbol svg {
      width: 18px;
      height: 18px;
      fill: currentColor;
    }

    .slider-touch-button img {
      width: 20px;
      height: 20px;
      object-fit: contain;
      filter: brightness(1.2);
    }

    .skin-touch-warning-box {
      position: fixed;
      transform: translate(-50%, -100%);
      background: rgba(8, 15, 8, 0.95);
      border: 1px solid rgba(250, 204, 21, 0.6);
      border-radius: 8px;
      color: #fef3c7;
      font-size: 12px;
      font-weight: 700;
      padding: 6px 10px;
      white-space: nowrap;
      z-index: 3000;
      box-shadow: 0 10px 20px rgba(0, 0, 0, 0.35);
      pointer-events: none;
      opacity: 0;
      transition: opacity 0.15s ease;
    }

    .skin-touch-warning-box.is-visible {
      opacity: 1;
    }

    .slider-step-toggle {
      min-width: 52px;
      text-align: center;
    }

    .slider-top-buttons .slider-step-toggle {
      min-width: 40px;
      width: 40px;
      height: 40px;
      padding: 0;
      line-height: 40px;
      text-align: center;
    }

    .slider-step-toggle.is-selected {
      background: var(--accent);
      color: #1a1207;
      border-color: var(--accent);
      box-shadow: 0 10px 18px rgba(249, 115, 22, 0.35);
    }

    .smoothing-input-wrap {
      position: relative;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      flex: 0 0 auto;
      width: 64px;
      height: 40px;
      margin: 0;
      padding: 0;
      align-self: center;
      vertical-align: middle;
      top: 2px;
    }

    .smoothing-input-wrap .smoothing-step-btn {
      position: absolute;
      right: 4px;
      width: 16px;
      min-width: 16px;
      height: 14px;
      padding: 0;
      border: none;
      background: transparent;
      box-shadow: none;
      color: #ffffff;
      font-size: 14px;
      font-weight: 700;
      line-height: 1;
      text-align: center;
      cursor: pointer;
      z-index: 2;
    }

    .smoothing-input-wrap .smoothing-step-btn:hover,
    .smoothing-input-wrap .smoothing-step-btn:focus {
      background: transparent;
      box-shadow: none;
      transform: none;
    }

    #pressureSmoothingInc {
      top: 6px;
    }

    #pressureSmoothingDec {
      bottom: 6px;
    }

    .smoothing-input {
      width: 64px;
      min-width: 64px;
      max-width: 64px;
      height: 36px;
      border-radius: 12px;
      border: 1px solid rgba(203, 213, 225, 0.9);
      background: #e5e7eb;
      color: #0f172a;
      font-weight: 700;
      text-align: center;
      font-size: 11px;
      line-height: 1;
      padding: 0 2px;
      outline: none;
      appearance: textfield;
      -moz-appearance: textfield;
      margin: 0;
      box-sizing: border-box;
      display: block;
    }

    .smoothing-input::-webkit-outer-spin-button,
    .smoothing-input::-webkit-inner-spin-button {
      -webkit-appearance: none;
      margin: 0;
    }

    .smoothing-input:focus {
      border-color: rgba(148, 163, 184, 1);
      box-shadow: 0 0 0 2px rgba(148, 163, 184, 0.35);
    }

    .slider-icon-row .btn.symbol:disabled,
    .slider-top-buttons .btn.symbol:disabled {
      opacity: 0.5;
    }

    .cluster-row {
      display: flex;
      flex-wrap: wrap;
      gap: 10px;
      align-items: center;
      justify-content: center;
    }

    .cluster-row.slider-top-buttons {
      flex-wrap: nowrap;
      justify-content: center;
      gap: 6px;
    }

    .btn {
      height: 40px;
      min-width: 44px;
      padding: 0 16px;
      border-radius: 14px;
      border: 1px solid rgba(250, 204, 21, 0.24);
      background: rgba(24, 24, 15, 0.65);
      color: var(--text);
      display: inline-flex;
      align-items: center;
      justify-content: center;
      font-weight: 700;
      cursor: pointer;
      transition: transform 0.18s ease, filter 0.18s ease;
    }

    .btn:hover {
      transform: translateY(-1px);
      filter: brightness(1.05);
    }

    .btn:disabled {
      opacity: 0.5;
      cursor: not-allowed;
      transform: none;
    }

    .btn.symbol {
      min-width: 44px;
      padding: 0;
      font-size: 18px;
    }

    .btn.primary {
      background: var(--accent);
      color: #1a1207;
    }

    .btn.ghost {
      background: transparent;
      border-color: rgba(255, 255, 255, 0.2);
    }

    .slider-label-input {
      flex: 1;
      min-width: 220px;
    }

    .textInput {
      width: 100%;
      height: 40px;
      border-radius: 14px;
      border: 1px solid rgba(250, 204, 21, 0.25);
      background: rgba(0, 0, 0, 0.35);
      color: var(--text);
      padding: 0 14px;
      font-size: 14px;
    }

    .slider-custom-command {
      justify-content: flex-start;
    }

    .slider-custom-command .textInput {
      flex: 0 0 400px;
      width: 400px;
      min-width: 400px;
    }

    .command-column {
      display: flex;
      flex-direction: column;
      gap: 18px;
    }

    .command-panel {
      background: var(--card);
      border: 1px solid var(--border);
      border-radius: 18px;
      padding: 18px 20px;
      box-shadow: var(--shadow);
      backdrop-filter: blur(16px);
    }

    .debug-toggle {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 6px;
    }

    .debug-block {
      display: grid;
      gap: 8px;
      margin-bottom: 16px;
    }

    .debug-area {
      width: 100%;
      min-height: 120px;
      max-height: 160px;
      padding: 10px 12px;
      border-radius: 12px;
      border: 1px solid rgba(250, 204, 21, 0.24);
      background: rgba(15, 23, 42, 0.65);
      color: inherit;
      font: 12px/1.4 "JetBrains Mono", "Fira Code", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
      resize: vertical;
    }

    .debug-area:focus {
      outline: none;
      border-color: var(--accent);
      box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.18);
    }

    .ghost-btn {
      padding: 6px 12px;
      border-radius: 999px;
      border: 1px solid rgba(148, 163, 184, 0.4);
      background: transparent;
      color: var(--muted);
      font: 12px/1 "Inter", sans-serif;
      cursor: pointer;
      transition: border-color 0.2s ease, color 0.2s ease;
    }

    .ghost-btn:hover {
      border-color: var(--accent);
      color: var(--accent);
    }

    .graphs-grid {
      display: flex;
      flex-direction: column;
      gap: 16px;
      margin-left: 0;
      padding-left: 0;
    }

    .graphs-grid-row {
      display: flex;
      gap: 12px;
    }

    .graph-shell {
      border-radius: 20px;
      border: 1px solid rgba(250, 204, 21, 0.18);
      box-shadow: var(--shadow);
      background: rgba(6, 15, 10, 0.55);
      transition: border-color 0.2s ease, box-shadow 0.2s ease;
      width: 100%;
    }

    .graph-shell--mini {
      flex: 1 1 0%;
    }

    .graph-shell--long .graph-canvas {
      height: 260px;
    }

    .graph-shell--mini .graph-canvas {
      height: 140px;
    }

    .graph-shell--long .graph-placeholder {
      padding-bottom: 24px;
    }

    .graph-shell--selectable {
      cursor: pointer;
    }

    .graph-shell--selectable:focus-visible {
      outline: none;
      box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.45);
    }

    .graph-shell--selectable.is-active {
      border-color: var(--accent);
      box-shadow: 0 0 0 1px rgba(249, 115, 22, 0.4), 0 18px 32px rgba(249, 115, 22, 0.18);
    }

    .graph-shell--selectable[aria-pressed="true"] .graph-status {
      color: var(--accent-secondary);
    }

    .graph-status {
      font-size: 12px;
      color: rgba(226, 232, 240, 0.85);
      letter-spacing: 0.05em;
      text-transform: uppercase;
      font-weight: 600;
    }

    .graph-status--long {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 12px;
      font-size: 13px;
      letter-spacing: 0.08em;
    }

    .graph-section-label {
      font-size: 14px;
      font-weight: 700;
      color: hsl(32, 90%, 80%);
      letter-spacing: 0.1em;
      text-transform: uppercase;
    }

    .graph-window-long {
      position: relative;
    }

    .graph-section-tag {
      display: none;
    }

    .graph-section-text {
      color: rgba(248, 232, 200, 0.92);
      font-size: 18px;
      font-weight: 700;
      letter-spacing: 0.2em;
      text-transform: uppercase;
    }

    .graph-canvas--long {
      height: 260px;
    }

    .graph-shell--long .graph-main {
      gap: 10px;
    }

    .long-window-toolbar {
      position: relative;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 16px;
      padding-bottom: 8px;
    }

    .long-window-title {
      flex: 1;
      display: flex;
      justify-content: center;
      pointer-events: none;
    }

    .toolbar-label {
      font-size: 12px;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 0.08em;
      color: rgba(226, 232, 240, 0.75);
    }

    .channel-toggle-group {
      display: inline-flex;
      align-items: center;
      gap: 2px;
      padding: 0;
      border: none;
      background: transparent;
      box-shadow: none;
    }

    .channel-toggle {
      appearance: none;
      border: 1px solid rgba(250, 204, 21, 0.35);
      background: rgba(8, 16, 12, 0.45);
      color: rgba(226, 232, 240, 0.82);
      font: 700 10px/1 "Inter", sans-serif;
      padding: 3px 8px;
      border-radius: 8px;
      cursor: pointer;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      transition: transform 0.18s ease, filter 0.18s ease;
    }

    .channel-toggle:hover {
      transform: translateY(-1px);
      filter: brightness(1.05);
    }

    .channel-toggle.is-active,
    .channel-toggle[aria-pressed="true"] {
      background: var(--accent);
      color: #1a1207;
      border-color: var(--accent);
      box-shadow: 0 6px 18px rgba(249, 115, 22, 0.35);
    }

    .channel-led-panel {
      display: inline-flex;
      align-items: center;
      gap: 12px;
      padding: 8px 14px;
      border-radius: 20px;
      background: rgba(10, 18, 14, 0.68);
      border: 1px solid rgba(250, 204, 21, 0.28);
      box-shadow: 0 10px 20px rgba(0, 0, 0, 0.35);
    }

    .channel-led-button {
      display: inline-flex;
      align-items: center;
      gap: 3px;
      border: 1px solid rgba(250, 204, 21, 0.18);
      border-radius: 12px;
      padding: 3px 8px;
      background: rgba(15, 23, 42, 0.45);
      color: rgba(226, 232, 240, 0.88);
      font: 600 10px/1 "Inter", sans-serif;
      text-transform: uppercase;
      letter-spacing: 0.08em;
      cursor: pointer;
      transition: transform 0.18s ease, filter 0.18s ease;
    }

    .channel-led-button:hover {
      transform: translateY(-1px);
      filter: brightness(1.05);
    }

    .channel-led-button:focus-visible {
      outline: none;
      box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.4);
    }

    .channel-led {
      width: 10px;
      height: 10px;
      border-radius: 50%;
      border: 2px solid rgba(0, 0, 0, 0.45);
      box-shadow:
        inset 0 0 6px rgba(0, 0, 0, 0.45),
        0 0 6px rgba(34, 197, 94, 0.45);
      background: #22c55e;
    }

    .channel-led.is-red {
      background: #ef4444;
      box-shadow:
        inset 0 0 6px rgba(0, 0, 0, 0.45),
        0 0 6px rgba(239, 68, 68, 0.45);
    }

    @media (max-width: 1080px) {
      .dashboard-grid {
        grid-template-columns: 1fr;
      }

      .graphs-grid-row {
        flex-direction: column;
      }

      .graphs-column,
      .command-column {
        gap: 16px;
      }

      .graphs-column {
        margin-top: 0;
        align-self: stretch;
      }

      .header-meta {
        justify-content: flex-start;
      }
    }

    .graph-placeholder {
      display: flex;
      flex-direction: column;
      gap: 12px;
      padding: 16px 18px 20px;
      color: rgba(250, 204, 21, 0.7);
    }

    .graph-row {
      display: flex;
      gap: 16px;
      align-items: flex-start;
    }

    .graph-side {
      width: 70px;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: flex-start;
      gap: 8px;
      min-height: 80px;
    }

    .graph-shell--long .graph-side {
      width: 110px;
    }

    .modal-backdrop {
      position: fixed;
      inset: 0;
      background: rgba(5, 9, 7, 0.82);
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 24px;
      z-index: 999;
    }

    .modal-card {
      width: min(420px, 100%);
      background: rgba(12, 20, 15, 0.95);
      border-radius: 20px;
      border: 1px solid rgba(250, 204, 21, 0.28);
      padding: 24px 26px;
      display: grid;
      gap: 14px;
      box-shadow: 0 30px 60px rgba(0, 0, 0, 0.45);
      position: relative;
      overflow: visible;
    }

    .modal-card h2 {
      margin: 0;
      font-size: 22px;
      color: #fff;
    }

    .modal-card p {
      margin: 0;
      color: rgba(226, 232, 240, 0.7);
      font-size: 14px;
    }

    .patient-form {
      display: grid;
      gap: 12px;
    }

    .patient-form label {
      display: grid;
      gap: 6px;
      font-size: 13px;
      font-weight: 600;
      color: #fff;
    }

    .patient-form input {
      width: 100%;
      padding: 10px 12px;
      border-radius: 12px;
      border: 1px solid rgba(250, 204, 21, 0.24);
      background: rgba(10, 16, 12, 0.8);
      color: #fff;
      font: inherit;
    }

    .patient-form input[readonly] {
      opacity: 0.8;
    }

    .patient-search-field {
      display: grid;
      gap: 10px;
      margin-bottom: 20px;
    }

    .command-palette {
        position: absolute;
        top: 100%;
        left: 0;
        width: min(520px, calc(100vw - 48px));
        z-index: 20;
        display: none;
        padding: 0;
        pointer-events: none;
      }
  
    .command-palette.is-visible {
        display: block;
      }

    .command-palette__card {
        width: 100%;
        border-radius: 18px;
        border: 1px solid rgba(250, 204, 21, 0.22);
        background: rgba(8, 11, 19, 0.97);
        box-shadow: 0 28px 45px rgba(2, 6, 12, 0.4);
        pointer-events: auto;
        max-height: min(420px, calc(60vh));
        padding: 10px 12px;
        overflow: visible;
      }

    .command-palette__card header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      color: rgba(241, 245, 249, 0.9);
    }

    .command-palette__card h3 {
      margin: 0;
      font-size: 16px;
      font-weight: 600;
    }

    .command-palette__close {
      background: transparent;
      border: none;
      color: rgba(248, 250, 252, 0.6);
      font-size: 22px;
      cursor: pointer;
      transition: color 0.2s ease;
    }

    .command-palette__close:hover {
      color: var(--accent);
    }

    .command-palette__body {
      max-height: none;
      overflow: visible;
      padding: 0;
    }

    .patient-modal-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 12px;
      flex-wrap: wrap;
    }
    .modal-close-btn {
      border: none;
      background: rgba(15, 23, 42, 0.65);
      color: rgba(248, 250, 252, 0.8);
      width: 32px;
      height: 32px;
      border-radius: 50%;
      font-size: 20px;
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      transition: background 0.2s ease, color 0.2s ease;
    }
    .modal-close-btn:hover {
      background: rgba(248, 113, 113, 0.25);
      color: #fff;
    }

    .modal-actions {
      display: flex;
      justify-content: flex-end;
    }

    .device-info-modal-card {
      width: min(410px, 100%);
      background: #f3f4f6;
      border-color: rgba(148, 163, 184, 0.5);
      color: #0f172a;
      padding: 10px 10px 7px;
      gap: 7px;
    }

    .device-info-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      border-bottom: 1px solid #d1d5db;
      padding: 0 2px 8px;
      margin-bottom: 2px;
    }

    .device-info-header h2 {
      margin: 0;
      font-size: 17px;
      font-weight: 700;
      color: #0f172a;
    }

    .device-info-close-btn {
      border: 1px solid #d1d5db;
      background: #f8fafc;
      color: #111827;
      border-radius: 10px;
      width: 26px;
      height: 26px;
      font-size: 16px;
      line-height: 1;
    }

    .device-info-close-btn:hover {
      background: #e5e7eb;
      color: #111827;
    }

    .device-info-grid {
      display: grid;
      gap: 4px;
    }

    .device-info-row {
      display: grid;
      grid-template-columns: minmax(118px, 42%) minmax(0, 1fr);
      align-items: center;
      gap: 6px;
    }

    .device-info-label {
      font-size: 12px;
      font-weight: 700;
      color: #334155;
      line-height: 1.2;
    }

    .device-info-value {
      min-height: 26px;
      border-radius: 8px;
      border: 1px solid #d1d5db;
      background: #e5e7eb;
      color: #1f2937;
      padding: 4px 7px;
      display: inline-flex;
      align-items: center;
      justify-content: flex-end;
      font-size: 11px;
      font-weight: 500;
      line-height: 1.2;
    }

    .search-results {
      border: 1px solid rgba(250, 204, 21, 0.12);
      border-radius: 18px;
      padding: 8px 0;
      background: rgba(8, 11, 19, 0.95);
      max-height: 260px;
      height: min(220px, 35vh);
      overflow-y: auto;
      position: relative;
      font-size: 13px;
      color: rgba(226, 232, 240, 0.95);
      box-shadow: 0 25px 60px rgba(3, 7, 18, 0.7);
    }

    .search-results-message {
      padding: 10px 16px;
      margin: 0;
      color: rgba(226, 232, 240, 0.85);
    }

    .search-result-item {
      border: none;
      border-bottom: 1px solid rgba(255, 255, 255, 0.08);
      padding: 10px 16px;
      cursor: pointer;
      transition: background 0.18s ease, color 0.18s ease;
      display: flex;
      flex-direction: column;
      justify-content: center;
      gap: 4px;
      background: transparent;
      text-align: left;
      pointer-events: auto;
      min-height: 56px;
    }

    .search-result-item strong {
      font-size: 15px;
      font-weight: 600;
      color: rgba(248, 250, 252, 0.96);
    }

    .search-result-item span {
      display: block;
      font-size: 12px;
      color: rgba(203, 213, 225, 0.85);
    }

    .search-result-item:hover,
    .search-result-item.is-selected {
      background: rgba(249, 115, 22, 0.12);
      color: var(--accent);
    }

    .search-virtual-spacer {
      width: 1px;
      height: 0;
      opacity: 0;
      pointer-events: none;
    }

    .search-virtual-content {
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
    }

    .location-status {
      font-size: 13px;
      color: rgba(226, 232, 240, 0.78);
      padding: 8px 12px;
      border-radius: 10px;
      background: rgba(15, 23, 42, 0.4);
    }

    .graph-title {
      font-weight: 700;
      font-size: 16px;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      display: inline-flex;
      align-items: center;
      transform: none;
    }

    .graph-title.graph-color-1 { color: hsl(24, 90%, 70%); }
    .graph-title.graph-color-2 { color: hsl(42, 90%, 70%); }
    .graph-title.graph-color-3 { color: hsl(140, 70%, 55%); }
    .graph-title.graph-color-long {
      color: hsl(32, 90%, 80%);
    }

    .axis-y-min,
    .axis-y-max,
    .axis-y-mid {
      font-weight: 600;
      font-size: 13px;
      color: rgba(226, 232, 240, 0.9);
      display: block;
    }

    .axis-y-min span,
    .axis-y-max span,
    .axis-y-mid span {
      display: block;
      font-size: 11px;
      line-height: 1.2;
      white-space: nowrap;
    }

    .graph-main {
      flex: 1 1 auto;
      display: flex;
      flex-direction: column;
      gap: 8px;
    }

    .graph-canvas {
      width: 100%;
      height: 160px;
      border-radius: 14px;
      background: rgba(6, 12, 18, 0.92);
      display: block;
    }

    .graph-label {
      display: inline-flex;
      text-transform: uppercase;
      letter-spacing: 0.08em;
      font-weight: 700;
      font-size: 12px;
      color: rgba(250, 204, 21, 0.85);
      margin: 0;
      align-items: center;
    }

    .graph-label--vaata { color: hsl(24, 90%, 70%); }
    .graph-label--pitta { color: hsl(42, 90%, 70%); }
    .graph-label--kapha { color: hsl(140, 70%, 55%); }

    .axis-x {
      position: relative;
      min-height: 12px;
      font-size: 10px;
      letter-spacing: 0.04em;
      color: rgba(148, 163, 184, 0.75);
    }

    .axis-x span {
      position: absolute;
      bottom: 0;
      transform: translateX(-50%);
      white-space: nowrap;
    }

    .app-footer {
      position: fixed;
      left: 18px;
      bottom: 14px;
      font-size: 12px;
      letter-spacing: 0.04em;
      text-transform: uppercase;
      color: rgba(148, 163, 184, 0.75);
      pointer-events: none;
      z-index: 1000;
    }

    .sensor-preview {
      font-family: "JetBrains Mono", "Fira Code", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
      background: rgba(19, 32, 21, 0.55);
      border-radius: 12px;
      padding: 10px 12px;
      font-size: 12px;
      line-height: 1.4;
      max-height: 60px;
      overflow: auto;
      border: 1px solid rgba(250, 204, 21, 0.22);
    }

    .command-grid {
      display: grid;
      gap: 14px;
    }

    .visually-hidden {
      position: absolute;
      width: 1px;
      height: 1px;
      padding: 0;
      margin: -1px;
      overflow: hidden;
      clip: rect(0, 0, 0, 0);
      border: 0;
      white-space: nowrap;
    }

    .command-block {
      border: 1px solid rgba(148, 163, 184, 0.28);
      background: rgba(15, 23, 42, 0.55);
      border-radius: 18px;
      padding: 14px 16px;
      display: grid;
      gap: 10px;
    }

    .command-block-title {
      font-size: 11px;
      letter-spacing: 0.16em;
      text-transform: uppercase;
      color: rgba(250, 204, 21, 0.7);
    }

    .command-block-row {
      display: grid;
      grid-template-columns: minmax(70px, 1fr) max-content max-content max-content;
      align-items: center;
      gap: 4px;
    }


    .device-pill {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      padding: 6px 10px;
      border-radius: 999px;
      background: rgba(15, 23, 42, 0.6);
      border: 1px solid rgba(148, 163, 184, 0.28);
      font-size: 12px;
    }

    .device-pill span {
      font-weight: 600;
      color: var(--accent-secondary);
    }

    .sim-label {
      font-size: 11px;
      letter-spacing: 0.12em;
      text-transform: uppercase;
      color: rgba(250, 204, 21, 0.65);
    }

    .switch {
      position: relative;
      display: inline-block;
      width: 46px;
      height: 24px;
    }

    .switch input {
      opacity: 0;
      width: 0;
      height: 0;
    }

    .slider {
      position: absolute;
      cursor: pointer;
      inset: 0;
      background: rgba(148, 163, 184, 0.35);
      border-radius: 999px;
      transition: background 0.2s ease;
    }

    .slider::before {
      content: '';
      position: absolute;
      height: 20px;
      width: 20px;
      left: 2px;
      top: 2px;
      border-radius: 50%;
      background: rgba(15, 23, 42, 0.85);
      transition: transform 0.2s ease, background 0.2s ease;
    }

    .switch input:checked + .slider {
      background: var(--accent);
    }

    .switch input:checked + .slider::before {
      transform: translateX(22px);
      background: #0b1120;
    }

    .switch input:focus-visible + .slider {
      box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.35);
    }

    .command-buttons {
      display: flex;
      gap: 20px;
      flex-wrap: nowrap;
      align-items: center;
    }

    .command-buttons button {
      padding-inline: 16px;
      height: 44px;
    }

    .command-buttons .quick-home-button {
      width: 44px;
      height: 44px;
      padding: 0;
      flex-shrink: 0;
    }

    .command-buttons .icon-text-button {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      white-space: nowrap;
    }

    .command-buttons .capture-icon {
      width: 40px;
      height: 40px;
    }

    .command-buttons .done-button {
      width: 44px;
      height: 44px;
      padding: 0;
      display: inline-flex;
      align-items: center;
      justify-content: center;
    }

    .command-buttons .done-icon {
      width: 28px;
      height: 28px;
    }

    .command-buttons .icon-button {
      width: 44px;
      height: 44px;
      padding: 0;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      border: 1px solid rgba(249, 115, 22, 0.45);
      background: var(--accent);
      box-shadow: 0 10px 24px rgba(249, 115, 22, 0.28);
      color: #050505;
    }

    .command-buttons .icon-glyph {
      display: flex;
      width: 100%;
      height: 100%;
      align-items: center;
      justify-content: center;
      line-height: 1;
      color: currentColor;
    }

    .command-buttons .icon-play .icon-glyph {
      font-size: 20px;
      transform: translateX(2px);
    }

    .command-buttons .icon-home .icon-glyph {
      font-size: 24px;
    }

    .command-buttons .icon-stop .icon-glyph {
      font-size: 34px;
      line-height: 1;
      transform: translateY(-4px);
    }

    .command-buttons .icon-button:not(:disabled):hover {
      background: var(--accent-dark);
      border-color: rgba(249, 115, 22, 0.6);
      color: #050505;
      box-shadow: 0 16px 32px rgba(234, 88, 12, 0.32);
    }

    .command-buttons .icon-button:focus-visible {
      outline: none;
      box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.32), 0 12px 28px rgba(249, 115, 22, 0.25);
    }

    .command-buttons .icon-button:disabled {
      background: rgba(148, 163, 184, 0.18);
      border-color: rgba(148, 163, 184, 0.35);
      color: rgba(148, 163, 184, 0.55);
      box-shadow: none;
      opacity: 1;
    }

    .sim-toggle-pill {
      gap: 12px;
      padding-right: 14px;
    }

    .sim-toggle-pill .switch {
      transform: scale(0.9);
      transform-origin: left center;
    }

    .humour-quick-block {
      margin-top: 16px;
      display: grid;
      gap: 10px;
      justify-items: center;
    }

    .movement-subtitle {
      font-size: 12px;
      letter-spacing: 0.14em;
      text-transform: uppercase;
      color: rgba(250, 204, 21, 0.7);
    }

    .vaata-grid,
    .pitta-grid,
    .kapha-grid {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 10px 12px;
      align-items: center;
      justify-items: center;
    }

    .vaata-pill,
    .pitta-grid .vaata-pill,
    .kapha-grid .vaata-pill {
      border-radius: 16px;
      border: 1px solid rgba(249, 115, 22, 0.45);
      background: var(--accent);
      color: #050505;
      font-weight: 600;
      letter-spacing: 0.05em;
      text-transform: uppercase;
      width: 50px;
      height: 50px;
      padding: 0;
      margin: 0 auto;
      display: flex;
      align-items: center;
      justify-content: center;
      box-shadow: 0 12px 26px rgba(249, 115, 22, 0.26);
      transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease, border-color 0.16s ease;
    }

    .vaata-pill:hover:not(:disabled) {
      transform: translateY(-1px);
      background: var(--accent-dark);
      border-color: rgba(249, 115, 22, 0.65);
      box-shadow: 0 18px 34px rgba(234, 88, 12, 0.32);
    }

    .vaata-pill:disabled {
      cursor: not-allowed;
      opacity: 0.55;
      box-shadow: none;
      transform: none;
      background: rgba(148, 163, 184, 0.18);
      border-color: rgba(148, 163, 184, 0.4);
      color: rgba(148, 163, 184, 0.6);
    }

    .vaata-pill--go {
      letter-spacing: 0.12em;
    }


    .vaata-pill span {
      display: inline-block;
      font-size: 22px;
      line-height: 1;
    }

    .vaata-pill--touch img {
      width: 32px;
      height: 32px;
      object-fit: contain;
      filter: drop-shadow(0 8px 16px rgba(5, 5, 5, 0.35));
    }

    .vaata-input-cell {
      display: flex;
      align-items: center;
      justify-content: center;
      width: 86px;
    }

    .vaata-input,
    .pitta-grid .vaata-input,
    .kapha-grid .vaata-input {
      width: 86px;
      height: 50px;
      padding: 0;
      border-radius: 16px;
      border: 1px solid rgba(250, 204, 21, 0.26);
      background: rgba(19, 32, 21, 0.55);
      color: rgba(255, 255, 255, 0.98);
      caret-color: rgba(255, 255, 255, 0.98);
      -webkit-text-fill-color: rgba(255, 255, 255, 0.98);
      font: 600 15px/1.1 "Inter", sans-serif;
      text-align: center;
      transition: border-color 0.18s ease, box-shadow 0.18s ease;
    }

    .vaata-input::placeholder {
      color: rgba(248, 239, 186, 0.46);
      letter-spacing: 0.08em;
      text-transform: uppercase;
    }

    .vaata-position-box,
    .pitta-grid .vaata-position-box,
    .kapha-grid .vaata-position-box {
      border-radius: 14px;
      border: 1px solid rgba(148, 163, 184, 0.3);
      background: rgba(14, 26, 18, 0.55);
      width: 56px;
      height: 50px;
      display: flex;
      align-items: center;
      justify-content: center;
      font-weight: 600;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      color: var(--accent-secondary);
      box-shadow: inset 0 8px 18px rgba(8, 15, 10, 0.32);
      margin: 0 auto;
    }

    @media (max-width: 1024px) {
      .vaata-grid,
      .pitta-grid,
      .kapha-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
      }
    }

    @media (max-width: 640px) {
      .vaata-grid,
      .pitta-grid,
      .kapha-grid {
        grid-template-columns: 1fr;
        gap: 12px;
      }
    }

    .command-values {
      display: grid;
      gap: 12px;
      grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }

    .value-card {
      padding: 12px 14px;
      border-radius: 14px;
      background: rgba(19, 32, 21, 0.55);
      border: 1px solid rgba(34, 197, 94, 0.25);
    }

    .value-card span {
      display: block;
    }

    .value-card span.label {
      font-size: 12px;
      text-transform: uppercase;
      color: rgba(250, 204, 21, 0.72);
      letter-spacing: 0.16em;
      margin-bottom: 6px;
    }

    .value-card span.value {
      font-size: 18px;
      font-weight: 600;
      color: var(--highlight);
    }

    .command-input {
      display: flex;
      flex-wrap: wrap;
      gap: 12px;
    }

    .command-input input {
      flex: 1 1 220px;
    }

    .log-panels-row {
      justify-content: stretch;
      align-items: stretch;
      gap: 16px;
      width: 100%;
    }

    .log-panel-block {
      flex: 1 1 280px;
      display: flex;
      flex-direction: column;
      gap: 6px;
      min-width: 0;
    }

    .log-panel-title {
      font-size: 13px;
      text-transform: uppercase;
      letter-spacing: 0.08em;
      color: rgba(255, 255, 255, 0.82);
    }

    .session-log-hint {
      margin: 0;
      font-size: 12px;
      color: rgba(255, 255, 255, 0.7);
    }

    .log-panel {
      font-family: "JetBrains Mono", "Fira Code", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
      background: rgba(17, 26, 19, 0.7);
      border-radius: 18px;
      padding: 16px;
      border: 1px solid rgba(250, 204, 21, 0.25);
      min-height: 160px;
      max-height: 280px;
      overflow: auto;
      font-size: 13px;
      white-space: pre-wrap;
    }

    .log-panel strong {
      color: var(--accent-secondary);
    }

    .footer-note {
      text-align: right;
      color: rgba(250, 204, 21, 0.66);
      font-size: 12px;
      margin-right: 6px;
    }

    @media (max-width: 720px) {
      .logo-slot {
        width: 48px;
        height: 48px;
        border-radius: 14px;
      }

      .title-block h1 {
        font-size: 20px;
      }

      .subtitle {
        font-size: 11px;
      }

      .header-left {
        flex-direction: row;
        gap: 12px;
        margin-top: 0;
      }

      .header-patient-stack {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
      }

      .header-meta {
        width: 100%;
        justify-content: flex-start;
      }

      .port-header {
        flex-direction: column;
        align-items: stretch;
      }

      .port-actions {
        width: 100%;
        justify-content: stretch;
      }

      .port-actions button {
        flex: 1 1 auto;
        min-width: 0;
      }

      .graphs-grid {
        grid-template-columns: 1fr;
      }
    }
    @media (prefers-color-scheme: light) {
      .brand-heading {
        color: #12263d;
        text-shadow: none;
      }

      .patient-header-line {
        color: #1f2937;
        text-shadow: none;
      }

      .patient-header-label {
        color: rgba(31, 41, 55, 0.85);
      }

      #patientNameValue,
      #patientPhoneValue {
        color: #111827;
        text-shadow: none;
      }
    }
