html.dark {
  color-scheme: dark;
}

.ae-body {
  margin: 0;
  min-height: 100vh;
  background: #0f1419;
  color: #e2e8f0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

#root {
  min-height: 100vh;
}

textarea.code-input {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  line-height: 1.45;
}

.konvajs-content {
  border-radius: 8px;
}

.ae-root {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.ae-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #2d3a4d;
  background: rgba(26, 35, 50, 0.85);
}

.ae-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: #cbd5e1;
  margin-right: 1rem;
}

.ae-btn {
  padding: 0.375rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #fff;
  border: none;
  cursor: pointer;
}

.ae-btn-sky {
  background: #0284c7;
}
.ae-btn-sky:hover {
  background: #0ea5e9;
}

.ae-btn-slate {
  background: #475569;
}
.ae-btn-slate:hover {
  background: #64748b;
}

.ae-btn-rose {
  background: rgba(190, 18, 60, 0.85);
}
.ae-btn-rose:hover {
  background: #e11d48;
}

.ae-btn-emerald {
  background: rgba(4, 120, 87, 0.85);
}
.ae-btn-emerald:hover {
  background: #059669;
}

.ae-btn-emerald.ae-ml {
  margin-left: 0.5rem;
}

.ae-btn-slate-dark {
  background: #334155;
}
.ae-btn-slate-dark:hover {
  background: #475569;
}

.ae-btn-parse {
  background: #4f46e5;
}
.ae-btn-parse:hover {
  background: #6366f1;
}

.ae-btn-block {
  width: 100%;
  padding: 0.625rem;
}

.ae-btn-del {
  width: 100%;
  padding: 0.5rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  background: rgba(127, 29, 29, 0.65);
  color: #fecaca;
  border: none;
  cursor: pointer;
}
.ae-btn-del:hover {
  background: #9f1239;
}

.ae-status {
  font-size: 0.75rem;
  color: #94a3b8;
  margin-left: 0.5rem;
}

.ae-row {
  display: flex;
  flex: 1;
  min-height: 0;
}

.ae-aside {
  width: min(100%, 380px);
  flex-shrink: 0;
  border-right: 1px solid #2d3a4d;
  background: #1a2332;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  overflow-y: auto;
}

.ae-lbl {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
}

.ae-lbl.mb {
  margin-bottom: 0.5rem;
}

.ae-textarea {
  flex: 1;
  min-height: 200px;
  width: 100%;
  border-radius: 0.5rem;
  background: #0f1419;
  border: 1px solid #2d3a4d;
  padding: 0.5rem 0.75rem;
  color: #e2e8f0;
  box-sizing: border-box;
}
.ae-textarea::placeholder {
  color: #475569;
}
.ae-textarea:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.35);
}

.ae-err {
  font-size: 0.75rem;
  color: #f87171;
  word-break: break-word;
}

.ae-section {
  border-top: 1px solid #2d3a4d;
  padding-top: 0.75rem;
  margin-top: 0.5rem;
}

.ae-file {
  font-size: 0.75rem;
  color: #94a3b8;
}

.ae-sel-wrap {
  border-top: 1px solid #2d3a4d;
  padding-top: 0.75rem;
}
.ae-sel-wrap .ae-lbl:not(.mb) {
  margin-bottom: 0.5rem;
}

.ae-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  font-size: 0.75rem;
}

.ae-span2 {
  grid-column: span 2;
}

.ae-inp {
  border-radius: 0.25rem;
  background: #0f1419;
  border: 1px solid #2d3a4d;
  padding: 0.25rem 0.5rem;
  color: #e2e8f0;
  box-sizing: border-box;
}

.ae-color {
  height: 2.25rem;
  width: 100%;
  border-radius: 0.25rem;
  cursor: pointer;
  border: 1px solid #2d3a4d;
  padding: 0;
  background: transparent;
}

.ae-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: #0b0f14;
  overflow: auto;
}

.ae-canvas-wrap {
  border-radius: 0.75rem;
  border: 1px solid #2d3a4d;
  overflow: hidden;
  background: #0f172a;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.45);
}
