:root {
  --bg: #0b1220;
  --card: #121a2a;
  --text: #e6edf3;
  --muted: #97a3b6;
  --border: #263042;
  --accent: #4c8dff;
  --accent-2: #2b5fd9;
  --ok: #22c55e;
  --bad: #f97373;
  --blue: #38bdf8;
}

* {
  box-sizing: border-box;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

.wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px;
}

html.fulltab,
html.fulltab body {
  width: 100vw;
  height: 100vh;
  overflow: auto;
}

html.fulltab .wrap {
  max-width: none;
  width: 100%;
  height: 100%;
  padding: 16px;
}

.tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}

.tab {
  padding: 9px 14px;
  border-radius: 10px 10px 0 0;
  text-decoration: none;
  color: var(--text);
  background: transparent;
  border: 1px solid transparent;
  border-bottom: none;
  cursor: pointer;
  user-select: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
}

.tab small {
  color: var(--muted);
  font-weight: 600;
}

.tab.active {
  background: var(--card);
  border-color: var(--border);
  border-bottom-color: var(--card);
  font-weight: 700;
}

.tab[aria-disabled="true"] {
  opacity: 0.4;
  cursor: not-allowed;
}

.hidden {
  display: none !important;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .28);
}

.card-title {
  font-weight: 800;
  margin-bottom: 8px;
  color: var(--text);
}

.card-title.blue {
  color: var(--blue);
}

.pane-title {
  font-size: 18px;
  font-weight: 900;
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

label {
  display: block;
  margin: 8px 0 4px;
  color: var(--muted);
  font-size: 13px;
}

input[type="text"],
input[type="password"],
input[type="number"] {
  width: 100%;
  background: #0e1728;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  outline: none;
  font-size: 13px;
}

input:focus {
  border-color: #39527a;
}

.btn {
  border: 1px solid var(--border);
  background: #182235;
  color: var(--text);
  padding: 9px 12px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 700;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn.primary {
  background: var(--accent);
  border-color: var(--accent-2);
  color: #ffffff;
}

.btn.ghost {
  background: #0e1728;
  color: var(--muted);
}

.btn.danger {
  background: #2a1114;
  border-color: #5b1f26;
  color: #ff8a8a;
}

.btn.small {
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 700;
}

button:disabled,
.btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}

.row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 12px;
  flex-wrap: wrap;
}

.inline-field {
  display: flex;
  align-items: center;
  gap: 8px;
}

.inline-field input[type="number"] {
  width: 90px;
}

.notice {
  margin-top: 8px;
  min-height: 18px;
  font-size: 13px;
}

.notice.success {
  color: var(--ok);
}

.notice.error {
  color: var(--bad);
}

.bm-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: flex-start;
}

.bm-grid > div {
  display: flex;
  flex-direction: column;
}

.field-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.field-meta {
  display: flex;
  gap: 10px;
  color: var(--muted);
  font-size: 11px;
}

.field-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.bm-field__hint {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.area {
  width: 100%;
  background: #0e1728;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  min-height: 160px;
  resize: vertical;
  outline: none;
  font-size: 13px;
  line-height: 1.45;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.switch input {
  display: none;
}

.switch .slider {
  position: relative;
  width: 46px;
  height: 24px;
  flex: 0 0 46px;
  background: #182235;
  border-radius: 999px;
  border: 1px solid var(--border);
  transition: background .2s, border-color .2s;
}

.switch .slider::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #7c889d;
  transition: transform .2s, background .2s;
}

.switch input:checked + .slider {
  background: var(--accent);
  border-color: var(--accent-2);
}

.switch input:checked + .slider::after {
  transform: translateX(20px);
  background: #ffffff;
}

.switch .switch-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.log {
  background: #0e1728;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  height: 220px;
  overflow-y: auto;
  font-size: 12px;
  white-space: pre-wrap;
}

html.fulltab .log {
  max-height: calc(100vh - 420px);
}

.muted {
  color: var(--muted);
  font-size: 12px;
}
