.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 31px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  transition:
    border-color 0.16s,
    background 0.16s,
    transform 0.16s;
}
.btn:hover {
  border-color: var(--accent);
  background: var(--surface-3);
}
.btn:active {
  transform: translateY(1px);
}
.btn-primary {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--bg);
  font-weight: 800;
}
.btn-primary:hover {
  filter: brightness(1.08);
  background: var(--accent);
  color: var(--bg);
}
.btn-quiet {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}
.btn-danger {
  color: var(--red);
}
.btn-small {
  min-height: 25px;
  padding: 0 7px;
  font-size: 10px;
}
.icon-btn {
  display: inline-grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}
.icon-btn:hover {
  border-color: var(--line);
  color: var(--text);
  background: var(--surface-2);
}
.field {
  display: grid;
  gap: 6px;
  min-width: 0;
}
.field label,
.field-label {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.input,
.select,
.textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 9px;
  background: var(--bg);
  color: var(--text);
}
.input::placeholder,
.textarea::placeholder {
  color: var(--muted);
  opacity: 0.7;
}
.textarea {
  min-height: 69px;
  resize: vertical;
}
.switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
}
.switch input {
  position: absolute;
  opacity: 0;
}
.switch-track {
  width: 30px;
  height: 16px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: var(--surface-3);
  transition: 0.2s;
}
.switch-track::after {
  display: block;
  width: 11px;
  height: 11px;
  margin: 2px;
  border-radius: 50%;
  background: var(--muted);
  content: "";
  transition: 0.2s;
}
.switch input:checked + .switch-track {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 22%, var(--surface));
}
.switch input:checked + .switch-track::after {
  transform: translateX(16px);
  background: var(--accent);
}
.switch input:focus-visible + .switch-track {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}
.switch-label {
  color: var(--muted);
  font-size: 10px;
}
.led {
  display: inline-block;
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  background: var(--muted);
  box-shadow: 0 0 9px currentColor;
}
.led.online {
  color: var(--accent);
  background: var(--accent);
}
.led.busy {
  color: var(--amber);
  background: var(--amber);
}
.led.offline {
  color: var(--red);
  background: var(--red);
}
.window-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.window-title {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 11px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.window-title::before {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow:
    12px 0 var(--amber),
    24px 0 var(--red);
  content: "";
  margin-right: 21px;
}
.window-body {
  padding: 13px;
}
.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 99px;
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}
.tag-success {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
}
.tag-warn {
  color: var(--amber);
  border-color: color-mix(in srgb, var(--amber) 35%, var(--line));
}
.tag-error {
  color: var(--red);
  border-color: color-mix(in srgb, var(--red) 35%, var(--line));
}
.block-bar {
  display: flex;
  gap: 2px;
  height: 8px;
}
.block-bar span {
  flex: 1;
  border-radius: 2px;
  background: var(--surface-3);
}
.block-bar span.on {
  background: var(--accent);
  box-shadow: 0 0 7px color-mix(in srgb, var(--accent) 45%, transparent);
}
.block-bar.warn span.on {
  background: var(--amber);
}
.block-bar.danger span.on {
  background: var(--red);
}
.notifications {
  position: fixed;
  z-index: 30;
  top: 18px;
  right: 18px;
  display: grid;
  gap: 7px;
  width: min(360px, calc(100vw - 36px));
}
.notice {
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 7px;
  background: var(--surface);
  box-shadow: var(--shadow);
  animation: notice-in 0.2s ease-out;
}
.notice.error {
  border-left-color: var(--red);
}
.notice.warn {
  border-left-color: var(--amber);
}
@keyframes notice-in {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.skeleton {
  border-radius: 4px;
  background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2));
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}
@keyframes shimmer {
  to {
    background-position: -200% 0;
  }
}
.action-loader {
  display: inline-block;
  width: 11px;
  height: 11px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.modal-backdrop {
  position: fixed;
  z-index: 20;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(5px);
}
.modal {
  width: min(540px, 100%);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.modal-head,
.modal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 15px;
  border-bottom: 1px solid var(--line);
}
.modal-foot {
  justify-content: flex-end;
  border-top: 1px solid var(--line);
  border-bottom: 0;
}
.modal-content {
  padding: 15px;
}
.fingerprint {
  margin: 11px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--bg);
  color: var(--accent);
  font-size: 12px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}
.field-error.valid {
  color: var(--accent);
}
.mono {
  font-family: inherit;
}
.muted {
  color: var(--muted);
}
.eyebrow {
  color: var(--accent);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.empty-state {
  padding: 29px 15px;
  text-align: center;
  color: var(--muted);
}
.empty-icon {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  margin: 0 auto 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--accent);
  font-size: 17px;
}
