:root {
  --bg-primary: #0d0d0f;
  --bg-panel: #1a1a1f;
  --bg-card: #252530;
  --accent-blue: #3b82f6;
  --accent-green: #22c55e;
  --accent-amber: #f59e0b;
  --accent-red: #ef4444;
  --text-primary: #f1f5f9;
  --text-muted: #94a3b8;
  --border: #2d2d3a;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
  --radius: 14px;
  --radius-sm: 10px;
  --focus: 0 0 0 3px rgba(59, 130, 246, 0.35);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial,
    "Noto Sans", "Liberation Sans", sans-serif;
  color: var(--text-primary);
  background: radial-gradient(1200px 800px at 20% 0%, rgba(59, 130, 246, 0.16), transparent 60%),
    radial-gradient(900px 700px at 85% 15%, rgba(34, 197, 94, 0.12), transparent 55%),
    var(--bg-primary);
}

button,
input,
select {
  font: inherit;
}

.app {
  height: 100%;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.header {
  display: grid;
  grid-template-columns: 1fr minmax(220px, 360px) auto;
  gap: 16px;
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--border);
  background: rgba(13, 13, 15, 0.75);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.header__left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand {
  font-weight: 720;
  letter-spacing: 0.2px;
}

.subtitle {
  color: var(--text-muted);
  font-size: 12px;
}

.header__center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.header__right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.main {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 16px;
  padding: 16px;
  min-height: 0;
}

.panel {
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(26, 26, 31, 0.85);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 14px 12px;
  border-bottom: 1px solid rgba(45, 45, 58, 0.9);
}

.panel__title {
  font-weight: 650;
}

.panel__actions {
  display: flex;
  gap: 10px;
}

.panel__body {
  position: relative;
  padding: 14px;
  min-height: 0;
  overflow: hidden;
}

.btn {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(45, 45, 58, 1);
  background: linear-gradient(180deg, rgba(37, 37, 48, 1), rgba(24, 24, 30, 1));
  color: var(--text-primary);
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease,
    background 120ms ease;
}

.btn:hover {
  transform: translateY(-1px);
  border-color: rgba(59, 130, 246, 0.6);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.25);
}

.btn:active {
  transform: translateY(0);
}

.btn:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

.btn--ghost {
  background: transparent;
}

.btn--primary {
  border-color: rgba(59, 130, 246, 0.9);
  background: linear-gradient(180deg, rgba(59, 130, 246, 0.9), rgba(37, 99, 235, 0.75));
}

.btn--danger {
  border-color: rgba(239, 68, 68, 0.85);
  background: linear-gradient(180deg, rgba(239, 68, 68, 0.95), rgba(185, 28, 28, 0.7));
}

.btn--amber {
  border-color: rgba(245, 158, 11, 0.85);
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.9), rgba(161, 98, 7, 0.65));
}

.iconBtn {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(37, 37, 48, 0.6);
  color: var(--text-primary);
  cursor: pointer;
}

.iconBtn:hover {
  background: rgba(37, 37, 48, 0.9);
  border-color: rgba(59, 130, 246, 0.55);
}

.iconBtn:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

.field {
  display: grid;
  gap: 6px;
}

.field__label {
  font-size: 12px;
  color: var(--text-muted);
}

.field__input,
.field__select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(13, 13, 15, 0.4);
  color: var(--text-primary);
}

.field__input:focus,
.field__select:focus {
  outline: none;
  box-shadow: var(--focus);
  border-color: rgba(59, 130, 246, 0.7);
}

.field--inline {
  grid-auto-flow: column;
  align-items: center;
  justify-content: end;
  grid-template-columns: auto auto;
  gap: 10px;
}

.meter {
  display: flex;
  align-items: center;
  gap: 10px;
}

.meter__label {
  font-size: 12px;
  color: var(--text-muted);
}

.meter__bar {
  width: 120px;
  height: 10px;
  background: rgba(45, 45, 58, 0.7);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid rgba(45, 45, 58, 0.9);
}

.meter__fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, rgba(34, 197, 94, 0.95), rgba(59, 130, 246, 0.95));
  transform-origin: left;
  transform: scaleX(1);
}

.dropHint {
  position: absolute;
  inset: 14px;
  border-radius: 14px;
  border: 1px dashed rgba(148, 163, 184, 0.45);
  background: rgba(13, 13, 15, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: rgba(241, 245, 249, 0.85);
  font-size: 13px;
  padding: 12px;
  z-index: 4;
}

.dropHint.isActive {
  display: flex;
}

.toast {
  position: fixed;
  left: 16px;
  bottom: 92px;
  max-width: min(520px, calc(100vw - 32px));
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(45, 45, 58, 0.9);
  background: rgba(13, 13, 15, 0.82);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 140ms ease, transform 140ms ease;
  font-size: 13px;
  color: rgba(241, 245, 249, 0.92);
  z-index: 30;
}

.toast.isOpen {
  opacity: 1;
  transform: translateY(0);
}

.overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.68);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  z-index: 40;
}

.overlay.isHidden {
  display: none;
}

.overlay__card {
  width: min(520px, calc(100vw - 32px));
  border-radius: 18px;
  border: 1px solid rgba(45, 45, 58, 0.9);
  background: rgba(26, 26, 31, 0.95);
  box-shadow: var(--shadow);
  padding: 18px;
  display: grid;
  gap: 10px;
}

.overlay__title {
  font-weight: 720;
  font-size: 18px;
}

.overlay__text {
  color: rgba(241, 245, 249, 0.85);
  font-size: 13px;
  line-height: 1.5;
}

.overlay__hint {
  color: rgba(148, 163, 184, 0.95);
  font-size: 12px;
  line-height: 1.45;
}

.modal {
  width: min(560px, calc(100vw - 32px));
  border-radius: 16px;
  border: 1px solid rgba(45, 45, 58, 0.9);
  background: rgba(13, 13, 15, 0.95);
  color: var(--text-primary);
  padding: 0;
}

.modal::backdrop {
  background: rgba(0, 0, 0, 0.68);
}

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 14px 12px;
  border-bottom: 1px solid rgba(45, 45, 58, 0.9);
}

.modal__title {
  font-weight: 650;
}

.modal__body {
  padding: 14px;
  color: rgba(241, 245, 249, 0.9);
  font-size: 13px;
  line-height: 1.6;
}

.list {
  margin: 0;
  padding-left: 18px;
}

@media (max-width: 920px) {
  .header {
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
  }

  .header__center {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .main {
    grid-template-columns: 1fr;
  }
}

