:root {
  --bg: #0b0f1a;
  --panel: #121826;
  --ink: #e8eefc;
  --muted: #8b9bb8;
  --line: #243044;
  --accent: #5b8cff;
  --ok: #3dd68c;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: "DM Sans", "Segoe UI", sans-serif;
  background:
    radial-gradient(900px 420px at 10% -10%, rgba(91,140,255,.18), transparent 55%),
    radial-gradient(700px 380px at 90% 0%, rgba(255,107,107,.08), transparent 50%),
    var(--bg);
  color: var(--ink);
  display: flex;
  flex-direction: column;
}
header {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  align-items: center;
  padding: .85rem 1.1rem;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(20,27,44,.95), rgba(11,15,26,.9));
  backdrop-filter: blur(8px);
}
header h1 { margin: 0; font-size: 1.25rem; letter-spacing: -.02em; }
header p { margin: .2rem 0 0; color: var(--muted); font-size: .85rem; }
.actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.actions label { font-size: .8rem; color: var(--muted); display: flex; gap: .35rem; align-items: center; }
.actions input:not([type=file]):not([type=checkbox]),
textarea {
  background: #0a0e16; border: 1px solid var(--line); color: var(--ink);
  border-radius: 8px; padding: .35rem .5rem; font: inherit;
}
.actions label.file input { max-width: 9rem; font-size: .7rem; color: var(--muted); }
button, .link {
  background: var(--accent); color: #fff; border: 0; border-radius: 8px;
  padding: .45rem .75rem; cursor: pointer; font-weight: 600; text-decoration: none;
  font-size: .85rem;
}
button.ghost { background: transparent; border: 1px solid var(--line); color: var(--accent); }
.link { background: transparent; border: 1px solid var(--line); color: var(--accent); }
main { flex: 1; display: grid; grid-template-columns: 1.45fr 1fr; min-height: 0; }
#blocklyDiv { min-height: 0; height: 100%; }
aside {
  border-left: 1px solid var(--line);
  background: rgba(18,24,38,.92);
  display: flex; flex-direction: column; min-height: 0;
}
.tabs { display: flex; gap: .4rem; padding: .6rem; border-bottom: 1px solid var(--line); }
.tab {
  background: transparent; color: var(--muted); border: 1px solid var(--line);
}
.tab.active { color: #fff; border-color: var(--accent); background: rgba(91,140,255,.15); }
#preview {
  margin: 0; padding: .9rem; flex: 1; overflow: auto;
  font-family: "JetBrains Mono", ui-monospace, monospace; font-size: .76rem;
  white-space: pre-wrap; color: #c7dbff;
}
.hint { padding: 1rem; color: var(--muted); line-height: 1.55; overflow: auto; flex: 1; }
.hint label { display: block; margin: .7rem 0; color: var(--ink); font-size: .9rem; }
.hint textarea { width: 100%; margin-top: .35rem; }
.hint.hidden, #preview.hidden, #meta.hidden { display: none; }
.check { display: flex !important; align-items: center; gap: .5rem; }
.icon-preview {
  display: flex; align-items: center; gap: .6rem; margin: .8rem 0;
  padding: .6rem; border: 1px dashed var(--line); border-radius: 10px;
}
.icon-preview img {
  width: 40px; height: 40px; object-fit: cover; border-radius: 10px; background: #0a0e16;
}
.icon-preview.muted { color: var(--muted); }
.status { padding: .5rem .9rem; color: var(--muted); font-size: .8rem; border-top: 1px solid var(--line); }
.status.ok { color: var(--ok); }
@media (max-width: 900px) {
  main { grid-template-columns: 1fr; grid-template-rows: 52vh 1fr; }
  aside { border-left: 0; border-top: 1px solid var(--line); }
}
