:root {
  color-scheme: dark;
  --bg: #6b7280;
  --panel: #1f2937;
  --panel-soft: #111827cc;
  --border: #9ca3af66;
  --text: #f9fafb;
  --muted: #d1d5db;
  --muted-2: #9ca3af;
  --accent: #ffdd00;
  --accent-text: #111827;
  --error: #fecaca;
  --success-bg: #111827;
  --success-border: #e5e7eb66;
  --focus-ring: #bfdbfe;
}

* {
  box-sizing: border-box;
}

body {
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  margin: 0;
  background:
    radial-gradient(1200px 500px at 15% -10%, #ffffff22 0%, transparent 60%),
    var(--bg);
  color: var(--text);
  line-height: 1.4;
  letter-spacing: 0.01em;
}

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 24px 18px 32px;
}

.page-header {
  margin-bottom: 16px;
}

h1 {
  margin: 0;
  font-size: clamp(24px, 2.5vw, 32px);
  letter-spacing: -0.02em;
}

.subtitle {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.section {
  margin-bottom: 14px;
  padding: 14px;
  border-radius: 12px;
  background: linear-gradient(180deg, #1f2937 0%, #111827 100%);
  border: 1px solid var(--border);
  box-shadow: 0 8px 26px #00000038, 0 0 0 1px #ffffff12 inset;
  backdrop-filter: blur(1px);
}

.section-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  color: var(--muted);
  margin-bottom: 10px;
  font-weight: 700;
  border-left: 3px solid #ffdd00;
  padding-left: 8px;
}

label {
  display: block;
  margin: 8px 0 4px;
  font-size: 12px;
  color: var(--muted);
}

input,
textarea,
select,
button {
  width: 100%;
  border-radius: 8px;
  border: 1px solid #9ca3af66;
  background: #111827;
  color: var(--text);
  padding: 10px;
  font-size: 14px;
}

input:focus,
textarea:focus,
select:focus {
  outline: 3px solid #bfdbfe66;
  border-color: var(--focus-ring);
  box-shadow: 0 0 0 1px #ffffff26 inset;
}

textarea {
  resize: vertical;
  min-height: 110px;
}

button {
  border: none;
  cursor: pointer;
  background: var(--accent);
  color: var(--accent-text);
  font-weight: 700;
  transition: transform 0.06s ease, opacity 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

button:hover {
  box-shadow: 0 0 0 1px #c9b100 inset, 0 6px 16px #00000048;
}

button:active {
  transform: translateY(1px);
}

button.secondary {
  background: #374151;
  color: var(--text);
  border: 1px solid #ffdd0060;
}

button.secondary:hover {
  box-shadow: 0 0 0 1px #ffdd00aa inset, 0 4px 12px #00000044;
}

button:disabled {
  opacity: 0.55;
  cursor: default;
  box-shadow: none !important;
}

.button-row {
  margin-top: 8px;
}

.divider {
  margin: 12px 0;
  font-size: 11px;
  color: var(--muted-2);
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.editor-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.asset-list-panel {
  background: linear-gradient(180deg, #1f2937 0%, #111827 100%);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  position: sticky;
  top: 16px;
}

.asset-list-title {
  font-size: 11px;
  color: #a3b5ca;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}

.asset-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  max-height: 560px;
  overflow: auto;
  padding-right: 2px;
}

.asset-item {
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border-radius: 8px;
  background: #111827;
  color: #f3f4f6;
  border: 1px solid #9ca3af40;
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.asset-item:hover {
  border-color: #d1d5db;
  background: #1f2937;
}

.asset-item.active {
  border-color: #ffdd00;
  color: #111827;
  background: #ffdd00;
}

.editor-panel {
  background: linear-gradient(180deg, #1f2937 0%, #111827 100%);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
}

.actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.actions button {
  margin-top: 0;
}

#status {
  margin-top: 10px;
  min-height: 22px;
  font-size: 12px;
  border-radius: 8px;
  padding: 4px 8px;
  border: 1px solid transparent;
}

#status.error {
  color: var(--error);
  background: #7f1d1d33;
  border-color: #fca5a566;
}
#status.ok {
  color: #111827;
  background: #ffdd00;
  border-color: #cdb400;
}
#status.loading {
  color: #d1d5db;
  background: #1f293733;
  border-color: #9ca3af44;
}

.warning-tools {
  margin-top: 8px;
  display: flex;
  gap: 8px;
  align-items: center;
}

#toggleWarningsButton {
  width: auto;
  min-width: 140px;
}

.warnings {
  margin-top: 8px;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #f59e0b66;
  background: #78350f33;
  color: #fde68a;
  white-space: pre-wrap;
  font-size: 12px;
}

.hidden {
  display: none !important;
}

.hint {
  margin-top: 6px;
  font-size: 11px;
  color: var(--muted-2);
}

button:focus-visible,
.asset-item:focus-visible {
  outline: 3px solid #bfdbfe88;
  outline-offset: 2px;
}

@media (max-width: 900px) {
  .editor-layout {
    grid-template-columns: 1fr;
  }

  .asset-list-panel {
    position: static;
  }

  .asset-list {
    max-height: 220px;
  }
}

@media (max-width: 640px) {
  .container {
    padding: 16px 12px 24px;
  }

  .section {
    padding: 12px;
  }

  .grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .actions {
    flex-direction: column;
  }
}
