:root {
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
  color: #20252b;
  background: #f3f4f6;
  font-size: 16px;
  font-synthesis: none;
  --accent: #c65823;
  --tint: #fff1e8;
  --border: #e1e4e8;
  --muted: #68717e;
  --profile: #ff6400;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select {
  font: inherit;
}
button {
  cursor: pointer;
}
button,
a,
input,
select,
[role="button"] {
  -webkit-tap-highlight-color: transparent;
}
button {
  background: #fff;
  border: 1px solid #d9dfe5;
  border-radius: 8px;
  padding: 10px 15px;
  color: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  transition:
    background 0.15s,
    border-color 0.15s,
    box-shadow 0.15s;
}
button:hover:not(:disabled) {
  background: #f7f8fa;
  border-color: #a9b2bf;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}
button.primary {
  background: #252c35;
  color: #fff;
  border-color: #252c35;
}
button.primary:hover:not(:disabled) {
  background: #434c58;
}
button:focus-visible,
input:focus-visible,
select:focus-visible,
[role="button"]:focus-visible {
  outline: 3px solid #e99265;
  outline-offset: 3px;
}
input,
select {
  width: 100%;
  border: 1px solid #dce1e6;
  border-radius: 7px;
  background: #fff;
  color: #252c35;
  padding: 9px 10px;
  min-height: 38px;
  font-size: 0.875rem;
}
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='m1 1 5 5 5-5' fill='none' stroke='%2368717e' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 29px;
}
input[type="color"] {
  width: 45px;
  padding: 3px;
  height: 38px;
  cursor: pointer;
}
input[type="checkbox"] {
  width: 16px;
  min-height: auto;
  accent-color: var(--accent);
}
[hidden] {
  display: none !important;
}
.topbar {
  height: 86px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 max(28px, calc((100vw - 1440px) / 2));
  background: #fff;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: #242b35;
  font-size: 19px;
  font-weight: 750;
  letter-spacing: 0.09em;
}
.brand b {
  font-weight: 400;
}
.brand small {
  display: block;
  font-size: 9px;
  letter-spacing: 0.19em;
  margin-top: 5px;
  color: var(--muted);
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 43px;
  height: 43px;
  background: #262d37;
  color: white;
  border-radius: 13px;
  font-size: 32px;
  font-weight: 650;
  letter-spacing: -0.11em;
  padding-right: 3px;
  line-height: 1;
}
.connection {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.875rem;
}
.connection button {
  margin-left: 12px;
}
.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #9099a5;
}
.dot.connected {
  background: #249365;
}
.dot.problem {
  background: #d1882e;
}
main {
  max-width: 1440px;
  margin: auto;
  padding: 30px 28px 18px;
}
.workspace-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}
.eyebrow {
  font-size: 0.69rem;
  letter-spacing: 0.13em;
  font-weight: 750;
  color: #737d8b;
}
h1 {
  font-size: clamp(23px, 2.2vw, 32px);
  letter-spacing: -0.045em;
  font-weight: 650;
  margin: 7px 0;
}
h2 {
  font-size: 1.24rem;
  letter-spacing: -0.03em;
  font-weight: 650;
  margin: 8px 0 12px;
}
p {
  line-height: 1.55;
  margin: 5px 0;
  color: var(--muted);
}
.workspace-heading p {
  font-size: 0.875rem;
}
.toolbar {
  display: flex;
  gap: 8px;
}
.icon-button {
  padding: 8px 12px;
  font-size: 20px;
  font-weight: 400;
}
.notice {
  padding: 12px 16px;
  background: #e9edf2;
  color: #4e5c6f;
  border: 1px solid #dde3eb;
  border-radius: 9px;
  font-size: 0.875rem;
  line-height: 1.5;
  margin-bottom: 18px;
}
.notice.error {
  background: #fff0ed;
  color: #a43b2c;
  border-color: #f0c7be;
}
.notice.success {
  background: #edf5ef;
  color: #366f46;
  border-color: #d0e5d6;
}
.editor-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(360px, 1fr);
  gap: 20px;
  align-items: stretch;
}
.pane {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 13px;
  overflow: hidden;
  box-shadow: 0 3px 9px #25354d03;
}
.configuration {
  padding: 22px 24px 14px;
}
.section-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.muted {
  color: var(--muted);
  font-size: 0.78rem;
}
.profile-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin: 14px 0;
}
.profile-tab {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  text-align: left;
  font-size: 0.78rem;
  padding: 9px 10px;
  font-weight: 500;
  background: #f7f8fa;
  border-color: transparent;
  white-space: nowrap;
}
.profile-tab .swatch {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--swatch);
}
.profile-tab .profile-name {
  overflow: hidden;
  text-overflow: ellipsis;
}
.profile-tab[aria-selected="true"] {
  background: var(--tint);
  border-color: #edc7b3;
  color: #a6491d;
  font-weight: 650;
}
.profile-details {
  display: flex;
  gap: 10px;
  padding: 0 0 18px;
  border-bottom: 1px solid #edf0f3;
}
.profile-details label {
  font-size: 0.73rem;
  gap: 6px;
}
.grow {
  flex: 1;
  min-width: 0;
}
label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 0.82rem;
  color: #536071;
}
.layers-area {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 25px;
  padding: 18px 0;
  border-bottom: 1px solid #edf0f3;
}
.layer-navigation .muted {
  font-size: 0.69rem;
}
#layers {
  max-height: 166px;
  overflow-y: auto;
  scrollbar-width: thin;
  margin-top: 10px;
  padding-right: 3px;
}
.layer-tab {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  border: 0;
  background: transparent;
  border-radius: 6px;
  padding: 7px 10px;
  margin-bottom: 2px;
  text-align: left;
  font-size: 0.82rem;
  font-weight: 450;
}
.layer-tab .layer-num {
  font-size: 0.69rem;
  font-weight: 650;
  color: #86909e;
  font-variant-numeric: tabular-nums;
}
.layer-tab .layer-color {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--swatch);
  margin-left: auto;
}
.layer-tab[aria-selected="true"] {
  background: #edf0f4;
  font-weight: 650;
}
.layer-tab[aria-selected="true"] .layer-num {
  color: #3b4858;
}
.layer-description {
  align-self: center;
  padding: 6px 0;
}
.layer-badge {
  font-weight: 350;
  font-size: 2.4rem;
  line-height: 1;
  color: #c0c7d0;
  letter-spacing: -0.04em;
}
.layer-description h2 {
  margin: 5px 0;
}
.layer-description p {
  font-size: 0.8rem;
  max-width: 260px;
}
.legend {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.legend-chip {
  font-size: 0.63rem;
  border: 1px solid #e2e6eb;
  border-radius: 4px;
  color: #7d8794;
  padding: 3px 5px;
}
.layer-settings {
  padding: 16px 0;
  border-bottom: 1px solid #edf0f3;
}
.setting-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 12px 0 8px;
}
.text-button {
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 0.75rem;
  color: #6c798a;
  font-weight: 500;
}
.text-button:hover:not(:disabled) {
  background: transparent;
  color: #a64b26;
}
.field-note {
  font-size: 0.72rem;
  margin-top: 8px;
  line-height: 1.5;
}
.led-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 16px;
}
.led-label {
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
.led-dot {
  width: 8px;
  height: 8px;
  background: var(--profile);
  border-radius: 50%;
}
.led-row select {
  width: 140px;
}
.led-row .muted {
  font-size: 0.72rem;
}
.device-area {
  padding-top: 17px;
}
.device-area > .section-line .muted {
  font-size: 0.7rem;
}
.trackball {
  display: block;
  width: 100%;
  height: auto;
  margin: 7px 0 0;
  max-height: 240px;
}
.device-button {
  cursor: pointer;
  outline: none;
}
.device-button rect,
.device-button path,
.device-button circle {
  fill: #f5f6f7;
  stroke: #c6ccd4;
  stroke-width: 1.3;
  transition:
    fill 0.15s,
    stroke 0.15s;
}
.device-button text {
  font-size: 14px;
  text-anchor: middle;
  fill: #687482;
  font-family: inherit;
  pointer-events: none;
  font-weight: 550;
}
.device-button:hover rect,
.device-button:hover path,
.device-button:hover circle {
  fill: #fff0e7;
  stroke: #d5906e;
}
.device-button.selected rect,
.device-button.selected path,
.device-button.selected circle,
.device-button:focus-visible rect,
.device-button:focus-visible path,
.device-button:focus-visible circle {
  fill: #ffe4d3;
  stroke: #c66b3d;
  stroke-width: 2;
}
.device-button.selected text {
  fill: #99471e;
}
.device-wordmark {
  fill: #89929f;
  font-size: 12px;
  text-anchor: middle;
  letter-spacing: 0.07em;
}
.device-led {
  cursor: pointer;
}
#device-led {
  fill: var(--profile);
}
.button-chips {
  display: flex;
  gap: 5px;
  justify-content: center;
  margin-top: -5px;
}
.button-chips button {
  border: 0;
  font-size: 0.68rem;
  padding: 4px 8px;
  font-weight: 550;
  color: #657286;
}
.button-chips button.selected {
  background: var(--tint);
  color: #a74f27;
}
.mapping-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #f7f8fa;
  border: 1px solid #e7ebef;
  border-radius: 8px;
  padding: 11px 14px;
  margin-top: 14px;
}
.mapping-preview > span:first-child {
  background: #fff;
  border: 1px solid #d9e0e7;
  border-radius: 6px;
  padding: 8px;
  min-width: 40px;
  text-align: center;
  font-size: 0.8rem;
  font-weight: 650;
}
.mapping-preview strong {
  display: block;
  font-size: 0.82rem;
}
.mapping-preview small {
  display: block;
  font-size: 0.73rem;
  color: var(--muted);
  margin-top: 3px;
}
.preview-tag {
  font-size: 0.58rem;
  color: #7f8a98;
  margin-left: auto;
  letter-spacing: 0.1em;
}
.action-pane {
  padding: 22px;
  display: flex;
  flex-direction: column;
}
.action-pane h2 {
  margin-bottom: 0;
  font-size: 1.5rem;
}
.editing-pill {
  font-size: 0.72rem;
  border-radius: 15px;
  border: 1px solid #e7d0c4;
  color: #aa582d;
  background: #fff7f1;
  padding: 6px 10px;
  white-space: nowrap;
}
.search {
  position: relative;
  flex-direction: row;
  align-items: center;
  margin-top: 21px;
  background: #f6f7f9;
  border: 1px solid #e3e6eb;
  border-radius: 8px;
  gap: 0;
  padding-left: 13px;
}
.search > span {
  font-size: 24px;
  color: #6d7888;
  line-height: 1;
}
.search input {
  border: 0;
  background: transparent;
  padding: 12px;
  min-width: 0;
  outline-offset: 0;
}
.search kbd {
  font: inherit;
  color: #929baa;
  background: #fff;
  border: 1px solid #dfe4ea;
  border-radius: 4px;
  margin-right: 12px;
  padding: 1px 6px;
  font-size: 0.7rem;
}
.category-tabs {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  padding: 14px 0;
}
.category-tabs button {
  padding: 6px 10px;
  border: 0;
  font-size: 0.74rem;
  font-weight: 500;
  color: #778191;
}
.category-tabs button.selected {
  background: #28313e;
  color: #fff;
}
.action-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  align-content: start;
  max-height: 380px;
  overflow-y: auto;
  scrollbar-width: thin;
  padding: 2px 3px 8px 1px;
  min-height: 280px;
}
.action-card {
  position: relative;
  text-align: left;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 13px 13px 12px;
  min-height: 106px;
  border-color: #e1e6ec;
  box-shadow: 0 1px 2px #28344804;
  font-weight: 450;
  gap: 5px;
}
.action-card .action-icon {
  font-size: 16px;
  line-height: 1.1;
  color: #687789;
  margin-bottom: 4px;
}
.action-card strong {
  font-size: 0.81rem;
  font-weight: 600;
}
.action-card small {
  font-size: 0.69rem;
  line-height: 1.4;
  color: #7a8593;
}
.action-card.active {
  border-color: #d19270;
  background: #fff8f2;
  box-shadow: 0 0 0 1px #edd3c4;
}
.action-card.active .action-icon {
  color: #b75c2d;
}
.empty-search {
  grid-column: 1/-1;
  padding: 30px 10px;
  text-align: center;
  color: #758194;
  font-size: 0.875rem;
}
.action-inspector {
  border-top: 1px solid #e6eaf0;
  margin-top: 18px;
  padding-top: 20px;
  flex: 1;
}
.action-inspector h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 17px 0 6px;
  letter-spacing: -0.02em;
}
.action-inspector p {
  font-size: 0.81rem;
}
.inspector-fields {
  display: grid;
  gap: 12px;
  margin-top: 17px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.inspector-fields > .wide {
  grid-column: 1/-1;
}
.action-help {
  border-left: 2px solid #e6c3ab;
  padding: 8px 12px;
  background: #fcf9f6;
  border-radius: 0 5px 5px 0;
  margin-top: 16px !important;
  font-size: 0.75rem !important;
}
.modifier-row {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.modifier-row button {
  font-size: 0.72rem;
  padding: 5px 10px;
}
.future-note {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 16px;
  background: #f5f7fa;
  border: 1px dashed #dbe1e8;
  border-radius: 8px;
  margin-top: 22px;
}
.future-icon {
  font-size: 21px;
  color: #8f9aa9;
}
.future-note strong {
  font-size: 0.78rem;
  font-weight: 550;
  color: #586576;
}
.future-note p {
  font-size: 0.72rem;
  margin-top: 5px;
}
.small-tag {
  font-size: 0.55rem;
  letter-spacing: 0.08em;
  color: #8e99a8;
  border: 1px solid #dbe2ea;
  border-radius: 4px;
  padding: 3px 4px;
  margin-left: auto;
}
.savebar {
  position: sticky;
  bottom: 12px;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: #fffefaeb;
  backdrop-filter: blur(16px);
  border: 1px solid #d9dee5;
  border-radius: 10px;
  padding: 14px 20px;
  margin-top: 20px;
  box-shadow: 0 7px 24px #2634480b;
}
.savebar strong {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
}
.savebar span {
  display: block;
  font-size: 0.73rem;
  color: #77818f;
  margin-top: 3px;
}
.save-actions {
  display: flex;
  gap: 8px;
}
.savebar progress {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 3px;
  accent-color: var(--accent);
}
.page-footer {
  display: flex;
  justify-content: space-between;
  margin-top: 22px;
  color: #8992a0;
  font-size: 0.66rem;
  letter-spacing: 0.06em;
}
.page-footer .muted {
  font-size: inherit;
}
dialog {
  border: 1px solid #d8dfe7;
  border-radius: 16px;
  padding: 25px;
  width: min(620px, calc(100vw - 30px));
  max-height: 90vh;
  box-shadow: 0 25px 100px #1e293b40;
}
dialog::backdrop {
  background: #19233155;
  backdrop-filter: blur(3px);
}
.dialog-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.dialog-heading h2 {
  margin-bottom: 0;
}
.dialog-body {
  padding-top: 17px;
}
.dialog-body > .muted {
  font-size: 0.85rem;
}
.dialog-body .setting-grid {
  grid-template-columns: 1fr 1fr;
  margin-top: 20px;
}
fieldset {
  display: flex;
  gap: 15px;
  border: 1px solid #e1e5eb;
  border-radius: 8px;
  margin: 20px 0;
  padding: 15px;
}
legend {
  font-size: 0.8rem;
  color: #596879;
}
.check {
  flex-direction: row;
  align-items: center;
  font-size: 0.8rem;
  gap: 5px;
}
.setting-card {
  padding: 16px;
  border: 1px solid #e3e7ed;
  border-radius: 8px;
  margin-top: 15px;
}
.setting-card strong {
  font-size: 0.875rem;
}
.setting-card p {
  font-size: 0.8rem;
  margin: 8px 0 13px;
}
.setting-card small {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 10px;
}
.setting-card pre {
  white-space: pre-wrap;
  font-family: inherit;
  font-size: 0.8rem;
  line-height: 1.7;
  color: #687382;
}
.dialog-actions {
  display: flex;
  gap: 8px;
}
.loading .editor-grid {
  pointer-events: none;
  opacity: 0.75;
}
.loading .toolbar {
  pointer-events: none;
}
.loading .dialog-body {
  pointer-events: none;
}
@media (min-width: 1500px) {
  .action-list {
    max-height: 420px;
  }
}
@media (max-width: 1000px) {
  .editor-grid {
    grid-template-columns: 1fr 1fr;
    gap: 14px;
  }
  .configuration,
  .action-pane {
    padding: 18px;
  }
  .setting-grid {
    gap: 8px;
  }
  .profile-details {
    flex-wrap: wrap;
  }
  .profile-details .grow {
    flex-basis: 55%;
  }
  .layers-area {
    gap: 15px;
  }
  .profile-tab {
    padding: 9px 6px;
    font-size: 0.7rem;
  }
  .layer-description p {
    font-size: 0.73rem;
  }
  .device-area > .section-line {
    display: block;
  }
  .device-area > .section-line .muted {
    display: block;
    margin-top: 6px;
  }
  .led-row {
    flex-wrap: wrap;
  }
  .action-list {
    max-height: 440px;
  }
  .workspace-heading {
    align-items: flex-end;
  }
}
@media (max-width: 760px) {
  .topbar {
    padding: 0 18px;
    height: 75px;
  }
  .brand small {
    display: none;
  }
  .connection #connection-label,
  .connection .dot {
    display: none;
  }
  .connection button {
    padding: 10px;
  }
  .brand {
    font-size: 16px;
  }
  main {
    padding: 23px 16px;
  }
  .workspace-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 15px;
  }
  .toolbar {
    width: 100%;
  }
  .editor-grid {
    grid-template-columns: 1fr;
  }
  .profile-details {
    flex-wrap: nowrap;
  }
  .profile-details .grow {
    flex-basis: auto;
  }
  .profile-tab {
    font-size: 0.77rem;
  }
  .action-list {
    max-height: 330px;
  }
  .action-inspector {
    min-height: 250px;
  }
  .savebar {
    bottom: 6px;
    padding: 12px;
    gap: 10px;
  }
  .savebar > div:first-child {
    max-width: 38%;
  }
  .savebar span {
    font-size: 0.65rem;
  }
  .save-actions {
    gap: 5px;
  }
  .save-actions button {
    font-size: 0.72rem;
    padding: 10px;
  }
  .page-footer {
    gap: 20px;
    font-size: 0.57rem;
  }
  .page-footer > span:last-child {
    text-align: right;
  }
  .notice {
    font-size: 0.8rem;
  }
  .layers-area {
    grid-template-columns: 1fr 1fr;
  }
  .device-area > .section-line {
    display: flex;
  }
  .device-area > .section-line .muted {
    margin: 0;
  }
  .layer-description p {
    font-size: 0.8rem;
  }
}
/* Fixed application shell. Only the action pages change; no scrolling panels. */
html,
body {
  height: 100%;
  overflow: hidden;
}
body {
  display: grid;
  grid-template: 64px minmax(0, 1fr) / 84px minmax(0, 1fr);
}
.topbar {
  grid-column: 1/-1;
  height: auto;
  position: relative;
  padding: 0 20px;
  gap: 20px;
  justify-content: initial;
}
.brand {
  font-size: 17px;
  letter-spacing: -0.03em;
  white-space: nowrap;
}
.connection {
  white-space: nowrap;
}
.sync-status {
  margin-left: auto;
  min-width: 0;
}
.sync-status strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
}
.sync-status span {
  font-size: 11px;
  color: var(--muted);
}
.toolbar {
  gap: 6px;
}
.toolbar button {
  padding: 8px 11px;
  font-size: 13px;
}
.topbar progress {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3px;
  accent-color: var(--accent);
}
.sidebar {
  background: #e9edf1;
  border-right: 1px solid var(--border);
  padding: 14px 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sidebar button {
  border: 0;
  background: transparent;
  padding: 12px 4px;
  font-size: 12px;
  font-weight: 500;
}
.sidebar button span {
  display: block;
  font-size: 23px;
  margin-bottom: 5px;
}
.sidebar button.selected {
  background: #fff;
  color: #a6491d;
  box-shadow: 0 1px 4px #1c293511;
}
main {
  max-width: none;
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 12px 16px;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: hidden;
}
.notice {
  flex: none;
  margin: 0;
  padding: 7px 11px;
  font-size: 12px;
  line-height: 1.35;
  min-height: 31px;
}
.editor-grid {
  flex: 1;
  min-height: 0;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 14px;
}
.pane {
  border-radius: 9px;
  min-height: 0;
}
.configuration,
.action-pane {
  padding: 14px 16px;
  min-width: 0;
}
.configuration {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.eyebrow {
  font-size: 11px;
  letter-spacing: 0.08em;
}
.section-line {
  gap: 8px;
  flex: none;
}
.profile-tabs {
  margin: 0;
  gap: 4px;
}
.profile-tab {
  padding: 6px 9px;
  font-size: 12px;
  border-radius: 5px;
}
.profile-details {
  padding: 0 0 8px;
  gap: 8px;
  flex-wrap: nowrap;
}
.profile-details .grow {
  flex-basis: auto;
}
.profile-details label {
  gap: 3px;
  font-size: 11px;
}
.profile-details input,
.profile-details select {
  min-height: 30px;
  height: 30px;
  padding-top: 4px;
  padding-bottom: 4px;
}
.profile-details input[type="color"] {
  width: 36px;
}
.profile-details select {
  max-width: 175px;
}
.layers-area {
  display: block;
  padding: 0 0 8px;
}
.layer-navigation > .section-line {
  margin-bottom: 4px;
}
#layers {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  max-height: none;
  overflow: visible;
  padding: 0;
  margin: 0;
  gap: 3px;
}
.layer-tab {
  margin: 0;
  padding: 5px 7px;
  font-size: 12px;
  gap: 7px;
}
.layer-num {
  display: none;
}
.layer-settings {
  padding: 0 0 8px;
}
.setting-grid {
  gap: 8px;
  margin: 7px 0;
}
.setting-grid label {
  font-size: 12px;
  gap: 4px;
}
.setting-grid input,
.setting-grid select {
  min-height: 32px;
  height: 32px;
  padding-top: 5px;
  padding-bottom: 5px;
}
.setting-grid:has(#custom-dpi-label:not([hidden])) {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.led-row {
  margin-top: 7px;
  gap: 8px;
  flex-wrap: nowrap;
}
.led-row select,
.led-row input {
  min-height: 30px;
  height: 30px;
  padding-top: 3px;
  padding-bottom: 3px;
}
.led-row select {
  width: 125px;
}
.led-row .muted {
  white-space: nowrap;
  font-size: 11px;
}
.led-label {
  font-size: 12px;
}
.device-area {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  padding: 0;
}
.device-area > .section-line {
  display: flex;
}
.device-area > .section-line .muted {
  display: inline;
  margin: 0;
}
.trackball {
  flex: 1;
  min-height: 60px;
  max-height: none;
  height: 0;
  margin: 0;
  width: 100%;
}
.button-chips {
  margin: 0;
  flex: none;
}
.mapping-preview {
  padding: 6px 9px;
  margin-top: 6px;
  flex: none;
  gap: 9px;
}
.mapping-preview > span:first-child {
  padding: 5px;
}
.mapping-preview small {
  font-size: 11px;
}
.device-area > .field-note {
  font-size: 11px;
  margin-top: 4px;
}
.preview-tag {
  display: none;
}
.action-pane {
  gap: 8px;
}
.search {
  margin: 0;
}
.search input {
  padding: 8px 10px;
  min-height: 34px;
}
.category-tabs {
  padding: 0;
  gap: 4px;
  flex-wrap: nowrap;
}
.category-tabs button {
  padding: 5px 8px;
  font-size: 12px;
}
.action-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(3, minmax(0, 1fr));
  flex: 1;
  min-height: 150px;
  max-height: none;
  overflow: visible;
  gap: 6px;
  padding: 0;
}
.action-card {
  min-height: 0;
  padding: 8px 10px;
  gap: 2px;
  display: grid;
  grid-template-columns: 24px 1fr;
  align-content: center;
}
.action-icon {
  grid-row: 1/3;
  margin: 0 !important;
  align-self: center;
}
.action-card strong {
  font-size: 13px;
}
.action-card small {
  font-size: 11px;
  line-height: 1.25;
}
.action-pagination {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: none;
  font-size: 11px;
  color: var(--muted);
}
.action-pagination > span:first-child {
  margin-right: auto;
}
.action-pagination button {
  padding: 3px 9px;
  font-size: 14px;
}
.action-inspector {
  flex: none;
  min-height: 0;
  height: 240px;
  padding-top: 10px;
  margin-top: 0;
  overflow: hidden;
}
.action-inspector h3 {
  font-size: 15px;
  margin: 9px 0 4px;
}
.action-inspector p {
  font-size: 12px;
  line-height: 1.4;
}
.inspector-fields {
  margin-top: 9px;
  gap: 8px;
}
.inspector-fields label {
  font-size: 12px;
  gap: 4px;
}
.inspector-fields input,
.inspector-fields select {
  min-height: 32px;
  height: 32px;
  padding: 5px 8px;
}
.inspector-fields .field-note {
  font-size: 11px;
  margin: 0;
  line-height: 1.3;
}
.action-help {
  padding: 6px 9px;
  margin-top: 9px !important;
  font-size: 11px !important;
  line-height: 1.4;
}
.modifier-row {
  margin: 0;
}
.modifier-row button {
  padding: 4px 8px;
}
.device-view {
  flex: 1;
  padding: 20px 24px;
}
.device-view h1 {
  font-size: 22px;
  margin: 0 0 12px;
}
.dialog-body {
  padding: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px 24px;
  max-width: 1250px;
}
.dialog-body > .muted {
  grid-column: 1/-1;
}
.dialog-body .setting-grid {
  margin: 0;
}
.dialog-body fieldset {
  margin: 0;
  align-self: stretch;
  align-items: center;
  flex-wrap: wrap;
}
.setting-card {
  margin: 0;
  padding: 14px;
}
.dialog-body > .field-note {
  grid-column: 1/-1;
}
.loading .device-view {
  pointer-events: none;
  opacity: 0.75;
}
@media (min-height: 900px) {
  .configuration,
  .action-pane {
    padding: 20px;
  }
  .configuration {
    gap: 12px;
  }
  .profile-tab {
    padding: 9px;
  }
  .layers-area {
    padding-bottom: 12px;
  }
  .layer-tab {
    padding: 8px;
  }
  .layer-settings {
    padding-bottom: 12px;
  }
  .action-inspector {
    height: 280px;
  }
  .action-card {
    padding: 13px;
  }
  .action-card small {
    font-size: 12px;
  }
}
@media (max-height: 720px) {
  body {
    grid-template-rows: 54px minmax(0, 1fr);
  }
  main {
    padding: 8px 12px;
    gap: 6px;
  }
  .configuration,
  .action-pane {
    padding: 10px 12px;
  }
  .configuration {
    gap: 5px;
  }
  .profile-tabs {
    grid-template-columns: repeat(8, minmax(0, 1fr));
  }
  .profile-tab {
    padding: 5px;
    justify-content: center;
  }
  .profile-tab .profile-name {
    max-width: 45px;
  }
  .profile-tab .swatch {
    width: 5px;
    height: 5px;
  }
  .action-inspector {
    height: 220px;
  }
  .device-area > .field-note {
    display: none;
  }
  .led-row .muted {
    display: none;
  }
  .profile-details {
    padding-bottom: 5px;
  }
  .layer-tab {
    padding: 4px 6px;
  }
  .layers-area {
    padding-bottom: 5px;
  }
}
@media (max-width: 1100px) {
  .topbar {
    padding: 0 12px;
    gap: 12px;
  }
  .sync-status span {
    display: none;
  }
  .connection {
    font-size: 12px;
  }
  .toolbar button {
    padding: 7px 8px;
    font-size: 12px;
  }
  .brand {
    font-size: 15px;
  }
  .profile-details select {
    max-width: 130px;
  }
  .led-row .muted {
    display: none;
  }
  .device-area > .section-line .muted {
    display: none;
  }
  .category-tabs {
    gap: 1px;
  }
  .category-tabs button {
    padding: 5px 6px;
    font-size: 11px;
  }
  .configuration,
  .action-pane {
    padding: 10px;
  }
  .action-card {
    padding: 7px;
  }
  .action-inspector {
    height: 255px;
  }
}
@media (max-height: 720px) {
  .profile-tabs {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .profile-tab {
    justify-content: flex-start;
  }
  .profile-tab .profile-name {
    max-width: none;
  }
  .action-inspector {
    height: 250px;
  }
}
body {
  width: calc(100vw / var(--ui-scale, 1));
  height: calc(100dvh / var(--ui-scale, 1));
  zoom: var(--ui-scale, 1);
}
.action-inspector {
  height: 285px;
}

.layer-settings .setting-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.layer-settings .setting-grid:has(#custom-dpi-label:not([hidden])) {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

/* Device geometry is the target; only the small controls get external cards. */
.trackball {
  --map-outline: #abb5c0;
}
.map-outline {
  fill: none;
  stroke: var(--map-outline);
  stroke-width: 1;
}
.map-control {
  cursor: pointer;
  outline: none;
}
.control-surface {
  fill: #e8ecf0;
  stroke: none;
  stroke-width: 1.5;
  stroke-linejoin: round;
  transition:
    fill 120ms,
    stroke-width 120ms;
}
.map-control text {
  pointer-events: none;
  fill: #273341;
  font-family: "Segoe UI", sans-serif;
  text-anchor: start;
}
.map-control .control-name {
  font-size: 9px;
  font-weight: 500;
  fill: #586575;
}
.map-control .control-function {
  font-size: 11px;
  font-weight: 600;
}
.map-control.center-label text {
  text-anchor: middle;
}
.map-control:hover .control-surface {
  fill: #dce2e8;
}
.map-control.selected .control-surface {
  fill: #cbd8e3;
}
.map-control:focus-visible .control-surface {
  stroke: #20364b;
  stroke-width: 2;
  stroke-dasharray: 3 2;
}
.led-hit {
  fill: transparent;
  stroke: none;
}
.button-chips {
  display: none;
}

.trackball.vertical .control-card .control-name {
  font-size: 12px;
}
.trackball.vertical .control-card .control-function {
  font-size: 15px;
}

/* Flat controls; color is reserved for physical layer destinations. */
.map-control.layer-target .control-surface {
  stroke: var(--target-color);
}
.map-control:focus-visible .control-surface {
  stroke: #20364b;
}
button,
input,
select {
  border-color: transparent;
  box-shadow: none;
}
button {
  background-color: #edf0f3;
}
button:hover:not(:disabled) {
  background-color: #dfe5eb;
  border-color: transparent;
}
input,
select {
  background-color: #f0f2f5;
}
button.primary {
  background-color: #252c35;
}
.action-card {
  background: #f1f3f6;
  border-color: transparent;
  box-shadow: none;
}
.action-card.active {
  background: #e0e7ee;
  border-color: transparent;
  box-shadow: none;
}
.profile-tab,
.profile-tab.selected,
.layer-tab,
.layer-tab.selected,
.editing-pill,
.search,
.mapping-preview {
  border-color: transparent;
  box-shadow: none;
}
.pane {
  border-color: transparent;
  box-shadow: none;
}
/* Compact editor */
@font-face {
  font-family: Barlow;
  src: url("./fonts/Barlow-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: Barlow;
  src: url("./fonts/Barlow-Medium.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: Barlow;
  src: url("./fonts/Barlow-SemiBold.woff2") format("woff2");
  font-weight: 600 900;
  font-display: swap;
}
:root {
  font-family: Barlow, sans-serif;
}
button,
input,
select,
textarea {
  font-family: inherit;
}
.map-control text,
.device-button text {
  font-family: Barlow, sans-serif;
}
.configuration,
.configuration:has(.trackball.vertical) {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px;
  overflow: hidden;
}
.configuration > .section-line,
.layer-settings > .section-line,
.layer-navigation > .section-line,
.device-area > .section-line,
.action-pane > .section-line .eyebrow,
.action-inspector > .section-line .eyebrow {
  display: none;
}
.profile-tabs,
.configuration:has(.trackball.vertical) .profile-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: none;
}
.profile-item {
  display: flex;
  align-items: stretch;
  background: #f0f2f5;
  border-radius: 7px;
  min-width: 112px;
  max-width: calc(25% - 8px);
  flex: 1 1 112px;
}
.profile-tab {
  min-width: 0;
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  flex: 1;
  padding: 7px 4px 7px 9px;
  border: 0;
  background: transparent;
  border-radius: 7px 0 0 7px;
}
.profile-name {
  flex: 1;
  max-width: none;
  min-width: 0;
  font-size: 14px;
}
.profile-rate {
  font-size: 10px;
  color: #78818c;
  width: 100%;
  text-align: left;
  padding-left: 12px;
  line-height: 1;
  font-weight: 400;
}
.profile-more {
  padding: 3px 7px;
  font-size: 18px;
  background: transparent;
  border: 0;
  border-radius: 0 7px 7px 0;
}
.profile-item:has([aria-selected="true"]) {
  background: #e2e8ee;
}
.profile-tab[aria-selected="true"] {
  background: transparent;
  box-shadow: none;
}
.profile-tab .swatch {
  width: 6px;
  height: 6px;
}
.add-profile {
  min-width: 30px;
  padding: 4px;
  font-size: 22px;
  flex: 0 0 30px;
}
.drop-target {
  box-shadow: inset 3px 0 #3c6c93;
}
.layers-area {
  padding: 0;
  margin: 0;
  border: 0;
  flex: none;
}
#layers,
.configuration:has(.trackball.vertical) #layers {
  display: flex;
  flex-wrap: nowrap;
  gap: 4px;
  padding: 0;
}
.layer-tab {
  display: block;
  padding: 7px 0;
  min-width: 32px;
  width: 36px;
  height: 32px;
  border: 0;
  border-radius: 5px;
  font-size: 14px;
  text-align: center;
  background: #f0f2f5;
}
.layer-tab.colored {
  background: color-mix(in srgb, var(--layer-color) 15%, #f1f3f5);
  color: color-mix(in srgb, var(--layer-color) 55%, #1d2630);
}
.layer-tab[aria-selected="true"] {
  box-shadow: inset 0 -3px #45576b;
  font-weight: 600;
  background: #dce3eb;
}
.layer-tab.colored[aria-selected="true"] {
  background: color-mix(in srgb, var(--layer-color) 28%, #f1f3f5);
  box-shadow: inset 0 -3px var(--layer-color);
}
.layer-settings {
  display: grid;
  grid-template-columns: 110px 1fr;
  align-items: end;
  gap: 10px 14px;
  padding: 0;
  border: 0;
  flex: none;
}
.layer-settings .setting-grid,
.configuration:has(.trackball.vertical) .setting-grid {
  display: flex;
  gap: 6px;
}
.layer-settings label:has(#motion),
.layer-settings label:has(#scroll-counts),
.layer-settings label:has(#orientation) {
  display: none;
}
.layer-settings label:has(#dpi) {
  flex: 1;
}
.layer-settings label:has(#custom-dpi) {
  width: 96px;
}
.layer-settings:has(#custom-dpi-label:not([hidden])) {
  grid-template-columns: 200px 1fr;
}
.orientation-choices {
  display: flex;
  align-items: center;
  gap: 5px;
}
.orientation-option {
  padding: 2px;
  width: 40px;
  height: 40px;
  border: 0;
  background: #eef1f4;
  font-weight: 400;
}
.orientation-option:first-child:not(:has(svg)) {
  width: 52px;
  font-size: 11px;
}
.orientation-option svg {
  width: 34px;
  height: 34px;
  fill: #c8d0d8;
  stroke: #647385;
  stroke-width: 1.2;
}
.orientation-option circle {
  fill: #f3f5f7;
}
.orientation-option[aria-pressed="true"] {
  background: #cfdbe6;
  box-shadow: inset 0 -2px #4c6781;
}
.led-row {
  grid-column: 1/-1;
  gap: 8px;
  margin: 0;
  flex-wrap: nowrap !important;
}
.led-row select {
  width: 130px;
  min-height: 30px;
  padding: 4px 24px 4px 8px;
  font-size: 13px;
}
.led-row input {
  height: 28px;
  min-height: 28px;
}
.led-row .muted {
  display: none;
}
.device-area,
.configuration:has(.trackball.vertical) .device-area {
  flex: 1;
  width: 100%;
  height: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  overflow: visible;
}
.trackball {
  flex: none;
  width: 500px;
  height: 244px;
  min-height: 0;
  max-height: none;
  max-width: none;
  margin: 0;
}
.trackball.vertical {
  width: 430px;
  height: 500px;
}
.mapping-preview,
.device-area > .field-note {
  display: none;
}
.action-pane {
  padding: 16px 18px;
  gap: 9px;
}
.action-pane > .section-line {
  justify-content: flex-end;
  min-height: 20px;
}
.action-pane .search {
  height: 34px;
  min-height: 34px;
  padding: 0 9px;
}
.action-pane .search input {
  padding: 4px;
  min-height: 30px;
}
.action-list {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 5px;
  flex: none;
  min-height: 0;
}
.action-card {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  height: 30px;
  min-height: 0;
  padding: 5px 9px;
  border: 0;
  border-radius: 5px;
  flex: 0 0 auto;
}
.action-card strong {
  font-size: 12px;
  font-weight: 500;
}
.action-card small {
  display: none;
}
.action-card .action-icon {
  font-size: 12px;
  margin: 0;
}
.action-pagination {
  height: 22px;
  min-height: 22px;
  flex: none;
}
.action-pagination button {
  min-height: 22px;
  height: 22px;
  padding: 0 6px;
}
.action-inspector {
  flex: 1;
  min-height: 160px;
  height: auto;
  padding-top: 10px;
  overflow: hidden;
}
.action-inspector h3 {
  margin: 5px 0;
  font-size: 16px;
}
.action-inspector p {
  font-size: 12px;
  margin: 5px 0;
}
.action-inspector .inspector-fields {
  gap: 8px;
  margin-top: 8px;
}
.action-inspector input,
.action-inspector select {
  min-height: 30px;
  padding: 5px 8px;
  font-size: 13px;
}
.action-inspector .action-help {
  font-size: 11px;
}
.category-tabs {
  flex: none;
}
.category-tabs button {
  padding: 4px 8px;
  font-size: 12px;
}
#input-palette {
  flex: none;
}
#input-palette[hidden] {
  display: none;
}
.keyboard-map {
  width: 100%;
  max-width: 660px;
  margin: 0 auto;
}
.keyboard-map svg {
  display: block;
  width: 100%;
  max-height: 225px;
}
.keyboard-map rect {
  fill: #e9edf1;
}
.keyboard-map text {
  text-anchor: middle;
  font:
    500 12px Barlow,
    sans-serif;
  fill: #344254;
  pointer-events: none;
}
.keyboard-map [role="button"],
.mouse-palette [role="button"] {
  cursor: pointer;
  outline: none;
}
.keyboard-map [role="button"]:hover rect,
.keyboard-map [role="button"]:focus-visible rect {
  fill: #d1dce7;
}
.keyboard-map .selected rect {
  fill: #b6cbdc;
}
.mouse-palette {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 8px 0;
}
.mouse-palette svg {
  width: 92px;
  height: 84px;
  flex: none;
}
.mouse-palette .mouse-body {
  fill: none;
  stroke: #aab5c2;
  stroke-width: 1;
}
.mouse-palette g path,
.mouse-palette g rect {
  fill: #dce3e9;
}
.mouse-palette g:hover path,
.mouse-palette g:hover rect,
.mouse-palette g:focus-visible rect {
  fill: #bdcfde;
}
.mouse-palette text {
  text-anchor: middle;
  font:
    500 11px Barlow,
    sans-serif;
  fill: #44566b;
  pointer-events: none;
}
.mouse-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  max-width: 440px;
}
.mouse-actions button {
  padding: 5px 9px;
  height: 30px;
  min-height: 0;
  font-size: 12px;
  font-weight: 500;
}
.capture-row {
  display: flex;
  gap: 7px;
  align-items: stretch;
}
#capture-zone {
  flex: 1;
  background: #edf1f5;
  border-radius: 6px;
  padding: 8px 12px;
  cursor: crosshair;
  outline: none;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
#capture-zone span {
  font-size: 11px;
  color: #748193;
}
#capture-zone strong {
  font-size: 13px;
  font-weight: 500;
}
#capture-zone.listening {
  background: #dbe8f2;
  box-shadow: inset 0 0 0 1px #a9c2d5;
}
#use-capture {
  padding: 5px 10px;
  font-size: 12px;
}
.capture-note {
  display: block;
  font-size: 10px;
  color: #7a8592;
  padding: 4px 0;
}
#input-palette.unavailable {
  opacity: 0.45;
}
#profile-dialog {
  width: 420px;
  border: 0;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 12px 50px #15223730;
}
#profile-dialog::backdrop {
  background: #18283b25;
}
.dialog-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.dialog-heading button {
  padding: 3px 9px;
  font-size: 20px;
}
#profile-dialog .profile-details {
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: 12px;
}
#profile-dialog .grow {
  grid-column: 1/-1;
}
.profile-management {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.profile-management button {
  padding: 7px 10px;
  font-size: 12px;
}
.danger {
  color: #b03838;
}
.context-menu {
  position: fixed;
  inset: auto;
  margin: 0;
  border: 0;
  border-radius: 7px;
  padding: 5px;
  box-shadow: 0 6px 24px #1b2a3b22;
  background: #fff;
}
.context-menu button {
  display: block;
  width: 150px;
  background: transparent;
  padding: 8px 12px;
  text-align: left;
}

.profile-tabs,
.configuration:has(.trackball.vertical) .profile-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) 30px;
}
.profile-item {
  max-width: none;
  min-width: 0;
}
.add-profile {
  grid-column: 5;
  grid-row: 1 / 3;
  align-self: stretch;
}

/* Selection uses complete borders, without moving the contents. */
.profile-item,
.layer-tab,
.orientation-option,
.category-tabs button,
.behavior-options button,
.layer-target-options button {
  border: 2px solid transparent;
  box-shadow: none;
}
.profile-item:has([aria-selected="true"]),
.layer-tab[aria-selected="true"],
.orientation-option[aria-pressed="true"],
.category-tabs button.selected,
.behavior-options button.selected,
.layer-target-options button.selected {
  border-color: #64829a;
  box-shadow: none;
}
.layer-tab.colored[aria-selected="true"],
.layer-target-options button.selected {
  border-color: var(--layer-color, #64829a);
  box-shadow: none;
}
.profile-item.dragging {
  background: #dce7ef;
  border: 2px dashed #64829a;
  opacity: 0.4;
}
.profile-item.dragging .profile-more {
  visibility: hidden;
}
.binding-behavior {
  flex: none;
  padding-bottom: 12px;
  border-bottom: 1px solid #e6e9ee;
  margin-bottom: 12px;
}
.behavior-options {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.behavior-options button {
  font-size: 12px;
  padding: 5px 8px;
  background: #edf0f4;
  border-radius: 5px;
}
.behavior-options button.selected {
  background: #dce5ed;
}
.layer-target-options {
  display: flex;
  gap: 5px;
  margin-top: 8px;
}
.layer-target-options button {
  width: 30px;
  height: 28px;
  padding: 2px;
  border-radius: 4px;
  background: #eef1f5;
}
.behavior-note {
  display: block;
  font-size: 12px;
  color: #667180;
  margin-top: 6px;
}
.action-pagination[hidden] {
  display: none;
}
.map-control:not(.control-card).selected .control-surface {
  animation: selected-control-pulse 1.6s ease-in-out infinite;
}
.control-card.selected .control-surface {
  stroke: #64829a;
  stroke-width: 2;
}
@keyframes selected-control-pulse {
  0%,
  100% {
    fill: #d3e0ea;
  }
  50% {
    fill: #9bbdd5;
  }
}
@media (prefers-reduced-motion: reduce) {
  .map-control:not(.control-card).selected .control-surface {
    animation: none;
    fill: #a7c2d7;
  }
}

.fixed-wheel .search,
.fixed-wheel #categories {
  display: none;
}
#import-json-text {
  width: 100%;
  resize: vertical;
  font: 12px monospace;
}

.layer-tabs-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
#jump-current {
  font-size: 12px;
  white-space: nowrap;
  padding: 6px 9px;
  border: 0;
  border-radius: 5px;
  background: #edf1f4;
}
.profile-item.device-active .profile-name,
.profile-item.device-active strong {
  font-weight: 750;
}
.profile-item.device-active {
  background: #cfdfdf;
}
.layer-tab.device-active {
  font-weight: 800;
  background: color-mix(in srgb, var(--layer-color, #4c9292) 30%, #edf3f3);
}
#live-preview[aria-pressed="true"] {
  background: #d0e6dd;
  color: #245641;
}
/* Profile layout is independent of the device drawing's orientation. */
.profile-tabs,
.configuration:has(.trackball.vertical) .profile-tabs {
  grid-template-columns: repeat(4, minmax(0, 1fr)) 30px;
  width: 100%;
  max-width: none;
  align-self: stretch;
}
.map-control.selected .control-surface {
  animation: selected-control-pulse 1.6s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) {
  .map-control.selected .control-surface {
    animation: none;
    fill: #a7c2d7;
  }
}

.profile-tab {
  user-select: none;
  touch-action: none;
}

/* Device maintenance remains independent of the profile canvas. */
.device-view { overflow-y: auto; }
#device-tools { display: grid; gap: 12px; }
#device-tools label { display: block; margin: 12px 0; }
#device-tools input[type=file] { display: block; width: 100%; margin-top: 6px; }
#device-tools pre { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12px; }
#device-tools small { display: block; margin-top: 8px; }
.maintenance-actions { display: flex; flex-wrap: wrap; gap: 8px; }
#maintenance-result { white-space: pre-wrap; overflow-wrap: anywhere; padding: 8px; }
#device-tools, .project-description { grid-column: 1 / -1; } #device-tools { grid-template-columns: repeat(2,minmax(0,1fr)); } #device-tools output {grid-column:1/-1;} .project-description h2 {font-size:16px;margin:0;} @media(max-width:900px){#device-tools{grid-template-columns:1fr;}}
