:root {
  --bg: #0f172a;
  --bg-paper: #1e293b;
  --surface: rgba(255, 255, 255, 0.04);
  --text: #e2e8f0;
  --text-dim: #94a3b8;
  --accent: #22c55e;
  --accent-text: #06210f;
  --danger: #ef4444;
  --line: rgba(148, 163, 184, 0.22);
  --radius: 10px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 13px;
  padding: 12px 12px 22px;
  overflow-y: auto;
  min-height: 100vh;
}

header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.logo {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  flex: 0 0 auto;
}

.titles {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

h1 {
  font-size: 14px;
  margin: 0;
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.status {
  color: var(--text-dim);
  font-size: 11px;
}

.dot {
  margin-left: auto;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: 0 0 auto;
}

.dot.off {
  background: #64748b;
}

.dot.on {
  background: var(--accent);
  box-shadow: 0 0 8px color-mix(in srgb, var(--accent) 80%, transparent);
}

.card {
  background: var(--bg-paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
  margin-bottom: 8px;
}

h2 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  margin: 0 0 8px;
  font-weight: 600;
}

.row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.row.wrap {
  flex-wrap: wrap;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 8px;
  padding: 7px 10px;
  transition: filter 0.12s ease, background 0.12s ease;
}

button:hover:not(:disabled) {
  filter: brightness(1.15);
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

button.primary {
  background: var(--accent);
  color: var(--accent-text);
  border-color: transparent;
  font-weight: 650;
}

button.ghost {
  background: transparent;
}

button.small {
  padding: 5px 8px;
  font-size: 12px;
}

button.icon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  padding: 0;
  font-size: 16px;
  line-height: 1;
}

.token-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.token-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.token-name {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.token-meta {
  color: var(--text-dim);
  font-size: 11px;
}

.degree-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.degree-input {
  width: 66px;
  padding: 6px 8px;
  text-align: center;
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.degree-input::-webkit-outer-spin-button,
.degree-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.degree-input[type="number"] {
  appearance: textfield;
}

.unit {
  color: var(--text-dim);
  font-size: 11px;
  margin-left: auto;
}

.presets {
  margin-top: 8px;
}

.presets button {
  padding: 4px 9px;
  font-size: 11px;
  border-radius: 999px;
}

.presets button.active {
  border-color: var(--accent);
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
}

.keys {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 8px;
}

.key-row {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-dim);
}

kbd {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 12px;
  font-weight: 650;
}

.hint {
  color: var(--text-dim);
  font-size: 11px;
  line-height: 1.45;
  margin: 8px 0 0;
}

.hintbox {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
  margin-top: 8px;
  padding: 8px;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 9%, transparent);
  color: var(--text);
  font-size: 11px;
  line-height: 1.4;
}

.check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 8px;
  color: var(--text-dim);
  font-size: 11px;
  line-height: 1.4;
  cursor: pointer;
}

.check input {
  margin: 1px 0 0;
  accent-color: var(--accent);
}

.hidden {
  display: none !important;
}

.toasts {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  pointer-events: none;
}

.toast {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg-paper) 92%, black);
  color: var(--text);
  font-size: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  animation: toast-in 0.18s ease;
}

.toast.success {
  border-color: color-mix(in srgb, var(--accent) 60%, transparent);
}

.toast.warn {
  border-color: #f59e0b;
}

.toast.error {
  border-color: var(--danger);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
