:root {
  color-scheme: light;
  --page: #f4f8fb;
  --page-soft: #edf4f8;
  --panel: rgba(255, 255, 255, .96);
  --panel-raised: #f8fbfd;
  --panel-deep: #edf4f8;
  --line: #d7e3ec;
  --line-strong: #b9cddd;
  --ink: #17283c;
  --text: #30465a;
  --muted: #63788d;
  --blue: #2d76bd;
  --cyan: #008d8a;
  --violet: #7756bd;
  --amber: #a96518;
  --red: #bf3d57;
  --green: #16845d;
  --shadow: 0 18px 70px rgba(38, 78, 108, .11);
}

body {
  color: var(--text);
  background:
    radial-gradient(circle at 8% 3%, rgba(104, 184, 205, .19), transparent 31rem),
    radial-gradient(circle at 91% 17%, rgba(161, 132, 220, .16), transparent 28rem),
    var(--page);
}
body::before {
  opacity: .3;
  background-image: linear-gradient(rgba(48, 103, 136, .075) 1px, transparent 1px), linear-gradient(90deg, rgba(48, 103, 136, .075) 1px, transparent 1px);
}
.skip-link { color: #fff; background: var(--cyan); }

.tool-header {
  border-bottom-color: rgba(157, 181, 199, .55);
  background: rgba(255, 255, 255, .86);
}
.brand { color: var(--ink); }
.brand strong { color: var(--cyan); }
.brand-mark { border-color: #b7d0de; background: #e5f0f5; }
.platform-badge { color: var(--muted); }
.back-link { color: var(--blue); }
.back-link:hover { color: var(--cyan); }

.tool-hero {
  display: block;
  grid-template-columns: none;
  min-height: 0;
  max-width: 790px;
  padding: 58px 0 39px;
}
.hero-visual { display: none; }
.eyebrow { color: var(--cyan); }
.eyebrow span { background: var(--cyan); box-shadow: 0 0 0 5px rgba(0, 141, 138, .14); }
h1, h2, h3 { color: var(--ink); }
h1 em { color: var(--cyan); }
.hero-description { color: var(--muted); }
.hero-tags span {
  border-color: #b8d8df;
  color: #356579;
  background: #e8f5f5;
}

.panel {
  border-color: var(--line);
  background: var(--panel);
  box-shadow: 0 10px 36px rgba(38, 78, 108, .08);
}
.panel-kicker { color: #4d7c96; }
.panel-icon { border-color: #acd0d3; color: var(--cyan); background: #e7f5f5; }
.field-label { color: #40586d; }
.field-label b { color: var(--cyan); }
.field-label i { color: var(--muted); }
input, textarea {
  border-color: #bdcfdd;
  color: var(--ink);
  background: #fff;
}
input::placeholder, textarea::placeholder { color: #91a5b6; }
input:focus, textarea:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(0, 141, 138, .12);
  background: #fff;
}
.field-hint { color: #6c8295; }
.number-field span { color: var(--muted); }

.button-primary {
  color: #fff;
  background: linear-gradient(120deg, #008d8a, #3f8fda);
  box-shadow: 0 7px 16px rgba(0, 141, 138, .18);
}
.button-primary:hover:not(:disabled) { box-shadow: 0 9px 20px rgba(0, 141, 138, .28); }
.button-secondary {
  border-color: #c0d1de;
  color: #486278;
  background: #f1f6f9;
}
.button-secondary:hover:not(:disabled) {
  border-color: #86aabd;
  color: var(--ink);
  background: #e8f1f5;
}
.button-spinner { border-color: rgba(255, 255, 255, .42); border-top-color: #fff; }

.connection-status { color: var(--muted); }
.connection-status[data-state="connected"] { color: var(--green); }
.connection-status[data-state="connected"] .status-dot { background: var(--green); box-shadow: 0 0 0 4px rgba(22, 132, 93, .12), 0 0 12px rgba(22, 132, 93, .28); }
.connection-status[data-state="pending"] { color: var(--amber); }
.connection-status[data-state="pending"] .status-dot { background: var(--amber); box-shadow: 0 0 0 4px rgba(169, 101, 24, .12); }
.connection-status[data-state="error"] { color: var(--red); }
.connection-status[data-state="error"] .status-dot { background: var(--red); box-shadow: 0 0 0 4px rgba(191, 61, 87, .12); }

.inline-note {
  border-color: #cbdde7;
  color: #60788c;
  background: #f0f7fa;
}
.note-mark { border-color: #9dc7d1; color: var(--cyan); }

.connection-pill, .live-indicator {
  border-color: #c9d9e4;
  color: var(--muted);
  background: #f3f7fa;
}
.connection-pill[data-state="connected"], .live-indicator[data-state="connected"] {
  border-color: rgba(22, 132, 93, .35);
  color: var(--green);
}
.device-details div { border-top-color: #e2eaf0; }
.device-details dt { color: #71869a; }
.device-details dd { color: #3b5368; }
.quick-steps li > span { border-color: #afd0d8; color: var(--cyan); background: #e7f4f5; }
.quick-steps p { color: #5f768b; }

.text-button { color: #648096; }
.text-button:hover:not(:disabled) { color: var(--cyan); background: #e8f4f5; }
.live-indicator { color: #6d8397; }
.live-indicator[data-state="connected"] { border-color: rgba(22, 132, 93, .35); color: var(--green); }
.live-indicator[data-state="connected"] .status-dot { background: var(--green); box-shadow: 0 0 8px rgba(22, 132, 93, .35); }
.log-toolbar { border-bottom-color: #e0e9ef; }
.toolbar-label { color: #6f8598; }
.segmented-control {
  border-color: #c5d7e2;
  background: #f2f7fa;
}
.segmented-control button { color: #6b8296; }
.segmented-control button[aria-pressed="true"] {
  color: var(--cyan);
  background: #e0f1f1;
  box-shadow: 0 2px 7px rgba(38, 78, 108, .12);
}
.log-panel { scrollbar-color: #adc7d6 transparent; }
.log-empty { color: #70879a; }
.empty-symbol { color: #6ea8b0; }
.log-empty strong { color: #3c586c; }
.log-empty p { color: #72899b; }
.log-entry { border-bottom-color: #e3ebf0; }
.log-entry:hover { background: #f2f8fa; }
.log-direction.rx { color: var(--green); background: #e3f4ed; }
.log-direction.tx { color: var(--blue); background: #e7f0fa; }
.log-time { color: #73899c; }
.log-value-label { color: #71879a; }
.log-value code { color: #38546a; }
.log-value.ascii code { color: #177765; }
.send-divider { color: #7190a2; }
.send-divider span { background: #e0e9ef; }
.send-heading span { color: #70879a; }
.mode-tabs {
  border-color: #c5d7e2;
  background: #f2f7fa;
}
.mode-tab { color: #6b8296; }
.mode-tab.active { color: var(--cyan); background: #e0f1f1; }
.byte-count { color: #6d8497; }
.console-footnote { color: #6c8498; }
.console-footnote > span { color: var(--cyan); }

.protocol-note {
  border-color: #c7dce5;
  background: #edf7f8;
}
.protocol-icon { border-color: #9dc8d0; color: var(--cyan); }
.protocol-note strong { color: #35586c; }
.protocol-note p { color: #668094; }
.tool-footer {
  border-top-color: #d8e4eb;
  background: rgba(255, 255, 255, .72);
}
.footer-inner { color: #6b8295; }

body { font-size: 16px; }
.tool-hero {
  max-width: none;
  padding: 30px 0 24px;
}
.tool-hero .hero-copy { max-width: none; }
.eyebrow { margin-bottom: 12px; }
h1 {
  max-width: none;
  font-size: clamp(36px, 5.8vw, 64px);
  white-space: nowrap;
}
.workspace { gap: 14px; }
.connection-panel, .device-panel, .guide-panel { padding: 18px; }
.console-panel { padding: 14px; }
.panel-heading { margin-bottom: 18px; }
.compact-heading { margin-bottom: 14px; }
.panel-heading h2 { font-size: 20px; }
.field { gap: 5px; margin-bottom: 12px; }
.field-label { font-size: 13px; }
.field-hint { font-size: 11px; }
input { min-height: 39px; padding: 7px 10px; }
textarea { min-height: 96px; padding: 11px 13px; }
.quick-steps p { font-size: 12px; }
.console-header { align-items: center; flex-wrap: wrap; gap: 8px; }
.console-header .panel-heading { flex-wrap: wrap; gap: 10px; }
.console-panel .text-button { min-height: 32px; font-size: 12px; }
.console-panel .log-toolbar {
  align-items: center;
  flex-direction: row;
  gap: 8px;
  margin-top: 8px;
  padding-bottom: 8px;
}
.console-panel .toolbar-label { font-size: 12px; }
.console-panel .segmented-control button { min-height: 30px; font-size: 12px; }
.log-panel {
  height: clamp(180px, 28vh, 260px);
  min-height: 0;
  max-height: none;
  padding: 6px 0;
}
.log-empty {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  min-height: 100%;
  padding: 16px 10px;
}
.empty-symbol { width: 36px; height: 36px; margin-bottom: 0; }
.log-entry { grid-template-columns: 94px minmax(0, 1fr); gap: 8px; padding: 6px 4px; }
.log-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.log-time { font-size: 10px; }
.log-values { padding-top: 0; }
.log-value { gap: 6px; }
.log-value code { font-size: 13px; }
.send-divider { margin: 8px 0 10px; }
.console-panel .send-heading { align-items: center; flex-direction: row; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.console-panel .mode-tab { min-height: 30px; font-size: 12px; }
.console-panel .send-form textarea { height: 84px; min-height: 76px; font-size: 14px; }
.console-panel .send-footer { align-items: center; flex-direction: row; gap: 8px; margin-top: 8px; }
.console-panel .send-actions { width: auto; gap: 6px; }
.console-panel .send-actions .button { flex: none; min-width: 64px; min-height: 36px; padding: 7px 12px; font-size: 13px; }

@media (max-width: 590px) {
  .tool-hero { padding: 29px 0 24px; }
  h1 { font-size: clamp(31px, 10vw, 48px); }
}
