:root {
  --bg: #f3f3ee;
  --paper: #fff;
  --ink: #202c2e;
  --muted: #6d7674;
  --line: #dce1d9;
  --red: #d84c3e;
  --green: #3f705f;
  --soft: #e9eee7;
  --sidebar: 236px;
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select {
  font: inherit;
}
button,
a,
input,
select,
summary {
  touch-action: manipulation;
}
button {
  border: 1px solid #cfd7ce;
  border-radius: 7px;
  padding: 11px 16px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition:
    background 0.15s,
    border-color 0.15s;
}
button:hover:not(:disabled) {
  background: #eff2ed;
  border-color: #829184;
}
button:disabled,
input:disabled,
select:disabled {
  opacity: 0.43;
  cursor: not-allowed;
}
button.primary {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}
button.primary:hover:not(:disabled) {
  background: #3d5150;
}
button:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 3px solid #d84c3e;
  outline-offset: 3px;
}
input,
select {
  border: 1px solid #ccd5cb;
  background: #fff;
  color: var(--ink);
  border-radius: 6px;
  padding: 10px 12px;
  min-width: 0;
}
input:focus,
select:focus {
  outline: 2px solid #6f9884;
  outline-offset: 1px;
}
a {
  color: inherit;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  font-size: clamp(32px, 3.8vw, 57px);
  line-height: 1.08;
  letter-spacing: -2.5px;
  font-weight: 580;
  margin: 13px 0 20px;
}
h1 span {
  color: #879887;
}
h2 {
  font-weight: 600;
  font-size: 22px;
  letter-spacing: -0.6px;
  margin: 10px 0 13px;
}
h3 {
  font-size: 16px;
  margin: 0 0 8px;
}
p {
  font-size: 14px;
  line-height: 1.7;
  color: var(--muted);
  margin-bottom: 17px;
}
.small {
  font-size: 12px;
  line-height: 1.65;
}
.eyebrow,
.section-label {
  font-size: 10px;
  letter-spacing: 1.8px;
  font-weight: 700;
}
.section-label {
  color: var(--green);
}
.eyebrow {
  color: var(--muted);
}
.eyebrow span {
  margin: 0 8px;
}
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar);
  padding: 38px 25px 25px;
  border-right: 1px solid var(--line);
  background: #eeeee8;
  display: flex;
  flex-direction: column;
  z-index: 2;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font-size: 19px;
  font-weight: 750;
  letter-spacing: 1.4px;
}
.brand-icon {
  display: block;
  background: var(--ink);
  color: #fff;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  letter-spacing: -5px;
  font-size: 35px;
  line-height: 40px;
  padding-left: 8px;
}
.brand-icon span {
  color: #f37b66;
}
.brand-sub {
  display: block;
  font-size: 8px;
  letter-spacing: 1.9px;
  margin-top: 4px;
}
.board-name {
  font-size: 30px;
  letter-spacing: -1px;
  margin: 54px 11px 30px;
}
.board-name span {
  display: block;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0;
  margin-top: 7px;
}
nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
nav a {
  text-decoration: none;
  font-size: 13px;
  padding: 13px 10px;
  border-radius: 6px;
  color: #6b7570;
  font-weight: 550;
}
nav a span {
  font-size: 10px;
  margin-right: 13px;
  color: #8a948a;
}
nav a.active {
  background: #dfe7dc;
  color: #254936;
}
nav a:hover {
  background: #e5e9df;
}
.sidebar-foot {
  margin-top: auto;
  padding: 35px 10px 0;
  font-size: 11px;
  line-height: 1.7;
}
.sidebar-foot p {
  font-size: 11px;
  margin: 10px 0 25px;
}
.version {
  font-size: 9px;
  letter-spacing: 1px;
  color: #8b938a;
}
.tiny-dot,
.red-dot,
.yellow-dot,
.green-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #a1aaa0;
  margin-right: 7px;
  vertical-align: middle;
}
.red-dot {
  background: var(--red);
}
.yellow-dot {
  background: #d8aa40;
}
.green-dot,
.tiny-dot.connected {
  background: #529372;
}
main {
  margin-left: var(--sidebar);
  max-width: 1700px;
  padding: 0 5%;
}
header {
  height: 93px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  gap: 16px;
}
.connection {
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.connection .text-btn {
  padding: 5px;
  margin-left: 8px;
}
.text-btn {
  border: 0;
  background: transparent;
  font-size: 11px;
  color: var(--muted);
}
.page {
  display: none;
}
.page.active {
  display: block;
}
.page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 49px 0 30px;
}
.page-heading.compact {
  padding: 43px 0 28px;
}
.page-heading.compact h1 {
  font-size: 38px;
  letter-spacing: -1.6px;
}
.page-heading p {
  margin-bottom: 0;
}
.hero-mark {
  font-size: 115px;
  letter-spacing: -12px;
  font-weight: 250;
  position: relative;
  padding-right: 35px;
  color: #d5ded1;
  white-space: nowrap;
}
.hero-mark span {
  font-weight: 600;
  color: #a4b69f;
}
.hero-mark i {
  display: block;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--red);
  position: absolute;
  right: 28px;
  top: 20px;
  box-shadow: inset 0 0 0 6px #ffffff20;
}
.connect-panel {
  border: 1px solid var(--line);
  padding: 25px 28px;
  background: #e8eee4;
  border-radius: 10px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.connect-panel h2 {
  font-size: 18px;
  margin: 0 0 6px;
}
.connect-panel p {
  font-size: 12px;
  margin: 0;
}
.actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.full {
  width: 100%;
}
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 28px 0;
  gap: 18px;
}
.stat {
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 9px;
  padding: 24px;
}
.stat-value {
  font-size: 34px;
  letter-spacing: -1.2px;
  margin: 17px 0 7px;
  font-weight: 550;
}
.stat p {
  font-size: 11px;
  margin: 0;
}
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}
.card {
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--paper);
  padding: 28px;
  margin-bottom: 24px;
}
.card > p:last-child {
  margin-bottom: 0;
}
.route-buttons {
  display: flex;
  gap: 10px;
  margin: 20px 0;
}
.route-buttons button {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 9px;
}
.route-buttons .selected {
  border-color: var(--green);
  background: #edf3e9;
}
kbd {
  font-family: inherit;
  font-size: 10px;
  opacity: 0.6;
}
label {
  display: flex;
  flex-direction: column;
  gap: 9px;
  font-size: 12px;
  font-weight: 600;
  margin: 18px 0;
}
.inline-label {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.check {
  flex-direction: row;
  align-items: center;
  line-height: 1.5;
}
.check input {
  accent-color: var(--green);
  width: 16px;
  height: 16px;
}
.check .small {
  font-weight: 400;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 28px;
}
.tp-intro {
  display: flex;
  gap: 28px;
  align-items: center;
  margin-bottom: 16px;
}
.trackpoint-art {
  flex-shrink: 0;
  width: 77px;
  height: 77px;
  border-radius: 50%;
  background: radial-gradient(circle at 36% 32%, #ed7765, #c64032 70%);
  box-shadow:
    inset 0 0 0 7px #fff3,
    0 6px 14px #d84c3e26;
}
.tp-intro p {
  max-width: 550px;
}
.battery-legend {
  display: flex;
  gap: 18px;
  font-size: 11px;
  margin-top: 24px;
}
details {
  border-top: 1px solid var(--line);
  padding-top: 17px;
  margin: 20px 0;
}
summary {
  font-size: 12px;
  cursor: pointer;
  color: var(--muted);
}
.firmware-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 20px;
}
.mono,
pre {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}
.badge {
  font-size: 10px;
  background: var(--soft);
  padding: 8px 10px;
  border-radius: 4px;
}
.steps {
  list-style: none;
  padding: 0;
}
.steps li {
  display: flex;
  gap: 24px;
  margin: 30px 0;
}
.steps li > span {
  font-size: 12px;
  color: var(--green);
  border: 1px solid var(--line);
  border-radius: 50%;
  height: 34px;
  width: 34px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.steps p {
  max-width: 750px;
}
.notice {
  background: #e3eddf;
  border: 1px solid #bdcfb7;
  border-radius: 8px;
  padding: 13px 18px;
  margin-top: 20px;
  line-height: 1.6;
  font-size: 13px;
  overflow-wrap: anywhere;
}
.notice.error {
  background: #fff0eb;
  border-color: #ecc6bc;
  color: #9b382c;
}
.notice.warn {
  background: #fbf4df;
  border-color: #e7d9a5;
}
.keyboard-card {
  padding: 23px;
  background: #e8ebe5;
}
.keyboard-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  font-size: 9px;
  letter-spacing: 1.2px;
  color: #788273;
}
.keyboard {
  display: flex;
  flex-direction: column;
  gap: 7px;
  overflow-x: auto;
  padding: 2px 2px 12px;
}
.key-row {
  display: flex;
  gap: 5px;
  min-width: 660px;
}
.key {
  flex: 1;
  min-width: 0;
  height: 51px;
  padding: 5px 3px;
  background: #fafbf7;
  border-color: #d0d5cb;
  border-bottom: 3px solid #c7cec1;
  font-size: 10px;
  font-weight: 600;
  position: relative;
  overflow: hidden;
}
.key:hover {
  background: #fff;
}
.key.wide {
  flex: 1.65;
}
.key.space {
  flex: 5.4;
}
.key.short {
  height: 35px;
}
.key.selected {
  background: #243d32 !important;
  border-color: #243d32;
  color: #fff;
}
.key.has-override::after {
  content: "";
  position: absolute;
  right: 5px;
  top: 5px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--red);
}
.key.reserved {
  border-style: dashed;
}
.key .assigned {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 8px;
  color: #7e8b79;
  margin-top: 5px;
  font-weight: 400;
}
.key.selected .assigned {
  color: #c8dac3;
}
.extra-keys {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin-top: 15px;
}
.extra-keys .key {
  flex: none;
  min-width: 65px;
}
.editor {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 35px;
}
.editor form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 20px;
}
.editor .actions,
.editor .small,
.editor .check {
  grid-column: 1/-1;
}
.editor h2 {
  font-size: 35px;
}
.editor form label {
  margin-top: 0;
}
pre {
  background: #f3f5f0;
  padding: 20px;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.7;
  max-height: 600px;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
progress {
  width: 100%;
  height: 5px;
  accent-color: var(--green);
  margin-top: 20px;
}
footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid var(--line);
  padding: 23px 0 30px;
  margin-top: 38px;
  font-size: 10px;
  color: #879180;
}
footer .red-dot {
  width: 5px;
  height: 5px;
  margin: 0 6px;
}
dialog {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 30px;
  max-width: 520px;
  color: var(--ink);
  box-shadow: 0 20px 80px #14251f33;
}
dialog::backdrop {
  background: #17291f66;
}
dialog p {
  white-space: pre-line;
}
dialog .actions {
  justify-content: flex-end;
}
[hidden] {
  display: none !important;
}
@media (min-width: 1600px) {
  main {
    padding: 0 70px;
  }
}
@media (max-width: 1100px) {
  :root {
    --sidebar: 196px;
  }
  .sidebar {
    padding: 30px 18px;
  }
  main {
    padding: 0 30px;
  }
  .hero-mark {
    font-size: 86px;
  }
  .hero-mark i {
    width: 18px;
    height: 18px;
  }
  .two-col {
    gap: 15px;
  }
  .card {
    padding: 22px;
  }
  .connect-panel {
    padding: 22px;
  }
  .stats {
    gap: 12px;
  }
  .stat {
    padding: 20px;
  }
  .inline-label {
    flex-direction: column;
    align-items: stretch;
  }
}
@media (max-width: 820px) {
  :root {
    --sidebar: 0px;
  }
  .sidebar {
    position: static;
    width: 100%;
    padding: 18px 22px 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    display: block;
  }
  .brand {
    font-size: 15px;
  }
  .brand-icon {
    width: 32px;
    height: 32px;
    line-height: 32px;
    font-size: 28px;
  }
  .board-name,
  .sidebar-foot {
    display: none;
  }
  nav {
    flex-direction: row;
    overflow-x: auto;
    margin-top: 17px;
    gap: 0;
  }
  nav a {
    white-space: nowrap;
    font-size: 11px;
    padding: 12px 13px;
  }
  nav a span {
    display: none;
  }
  main {
    margin: 0;
    padding: 0 22px;
  }
  header {
    height: 65px;
  }
  .page-heading {
    padding-top: 35px;
  }
  .hero-mark {
    font-size: 90px;
  }
  .two-col {
    grid-template-columns: 1fr;
  }
  .editor {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .editor form {
    grid-template-columns: 1fr 1fr;
  }
  .page-heading.compact h1 {
    font-size: 32px;
  }
  .page-heading.compact {
    align-items: flex-start;
  }
  .stats {
    margin: 20px 0;
  }
  .stat {
    padding: 17px;
  }
  .stat-value {
    font-size: 28px;
  }
  .stat .eyebrow {
    font-size: 8px;
  }
  .firmware-heading {
    align-items: flex-start;
    flex-direction: column;
  }
}
@media (max-width: 520px) {
  main {
    padding: 0 16px;
  }
  .sidebar {
    padding: 16px 16px 0;
  }
  h1 {
    font-size: 39px;
    letter-spacing: -1.7px;
  }
  .hero-mark {
    display: none;
  }
  .stats {
    grid-template-columns: 1fr;
    gap: 9px;
  }
  .stat {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    padding: 15px 18px;
  }
  .stat-value {
    margin: 0;
    text-align: right;
    font-size: 25px;
  }
  .stat p {
    grid-column: 1/-1;
    margin-top: 7px;
  }
  .card {
    padding: 21px;
  }
  .connect-panel {
    padding: 22px;
  }
  .connect-panel .actions {
    width: 100%;
  }
  .connect-panel .actions button {
    flex: 1;
    font-size: 12px;
    padding: 12px;
  }
  .page-heading.compact {
    flex-wrap: wrap;
  }
  .page-heading.compact h1 {
    font-size: 30px;
  }
  .form-grid,
  .editor form {
    grid-template-columns: 1fr;
  }
  .editor .actions,
  .editor .small,
  .editor .check {
    grid-column: 1;
  }
  .tp-intro {
    gap: 18px;
    align-items: flex-start;
  }
  .trackpoint-art {
    width: 48px;
    height: 48px;
  }
  .battery-legend {
    gap: 12px;
  }
  .eyebrow {
    font-size: 9px;
  }
  .connection {
    font-size: 10px;
  }
  header > .eyebrow {
    letter-spacing: 1px;
  }
  .steps li {
    gap: 14px;
  }
  footer {
    font-size: 9px;
  }
}
/* Keep the native file picker within narrow firmware-step columns. */
.steps li > div {
  min-width: 0;
  flex: 1;
}
input[type="file"] {
  width: 100%;
  max-width: 100%;
}
.card {
  min-width: 0;
}
