:root {
  --bg-app: #0b0e14;
  --bg-panel: #131822;
  --bg-input: #0d1119;
  --border-color: #263044;
  --accent: #3b82f6;
  --accent-soft: #3b82f622;
  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --sidebar-w: 310px;
  --toolbar-w: 66px;
  --header-h: 54px;
  --status-h: 32px;
  --cmd-h: 91px;
  --font-mono: ui-monospace, Consolas, monospace;
}
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg-app);
  color: var(--text-primary);
  font:
    13px/1.45 system-ui,
    -apple-system,
    Segoe UI,
    sans-serif;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
}
button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid #60a5fa;
  outline-offset: 2px;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1px solid var(--border-color);
  background: #1a2130;
  border-radius: 5px;
  padding: 6px 10px;
  white-space: nowrap;
  font-size: 12px;
}
.btn:hover {
  background: #263247;
  border-color: #4b628a;
}
.btn-primary,
.btn.active {
  border-color: #3b82f6;
  background: var(--accent-soft);
  color: #93c5fd;
}
.mini {
  font-size: 11px;
  padding: 3px 7px;
}
input,
select,
textarea {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  min-width: 0;
  padding: 5px 7px;
}
input[type='color'] {
  padding: 1px;
  width: 25px;
  min-width: 25px;
  height: 24px;
}
input[type='checkbox'] {
  accent-color: #3b82f6;
}
input[type='number'] {
  width: 100%;
}
.muted {
  color: var(--text-secondary);
  font-size: 12px;
}
small {
  color: #64748b;
  font-weight: 400;
}
.protocol-banner {
  display: none;
  background: #7c2d12;
  padding: 6px 12px;
  font-size: 12px;
}
.protocol-banner.visible {
  display: block;
  position: fixed;
  top: 54px;
  width: 100%;
  z-index: 99;
}
.form-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin: 5px 0;
  font-size: 12px;
}
.form-row > * {
  max-width: 68%;
}
.inline-actions {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}
[hidden] {
  display: none !important;
}
dialog {
  margin: auto;
  padding: 22px;
  border: 1px solid #334155;
  border-radius: 12px;
  background: #131822;
  color: #e2e8f0;
  width: min(460px, 92vw);
  max-height: 88vh;
  overflow: auto;
}
dialog::backdrop {
  background: #0009;
}
dialog h2 {
  font-size: 17px;
  margin-bottom: 16px;
}
dialog label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin: 10px 0;
}
dialog textarea {
  width: 100%;
  height: 110px;
  resize: vertical;
}
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
}
.snap-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  padding: 10px 0;
}
.snap-options label {
  display: flex;
  gap: 7px;
  font-size: 11px;
}
::-webkit-scrollbar {
  width: 7px;
  height: 5px;
}
::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 4px;
}
