/* Zycord IDE. Uses the tokens lab.css defines. */

/* lab.css spaces consecutive sections on content pages; the IDE is a grid. */
.ide section + section { margin-top: 0; }

main.ide-main { flex: 1; width: 100%; max-width: 1600px; margin: 0 auto; padding: 1rem 16px 2rem; }

.hidden { display: none !important; }
.muted { color: var(--ink-faint); }
.small { font-size: 0.82rem; }

.ide-bar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.ide-title h1 { font-size: 1.5rem; margin: 0; }
.ide-sub { color: var(--ink-faint); font-size: 0.85rem; }
.ide-wallet { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; font-size: 0.9rem; color: var(--ink-dim); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ink-faint); display: inline-block; }
.dot.on { background: #4ade80; box-shadow: 0 0 8px rgba(74, 222, 128, 0.6); }
.dot.wait { background: #facc15; }

.ide-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  grid-template-areas: "editor side" "console side";
  grid-template-rows: minmax(420px, 62vh) minmax(180px, 1fr);
  gap: 0.9rem;
}
.ide-editor { grid-area: editor; }
.ide-side { grid-area: side; display: flex; flex-direction: column; gap: 0.9rem; min-width: 0; }
.ide-console { grid-area: console; }
@media (max-width: 960px) {
  .ide-grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: "editor" "side" "console"; grid-template-rows: 60vh auto 280px; }
}

.pane { background: var(--glass-bg); border: 1px solid var(--glass-border); border-radius: 12px; display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; }
.pane-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--glass-border); min-height: 44px; flex-wrap: wrap; }
.pane-head h2 { font-size: 0.95rem; margin: 0; }
.pane-body { padding: 0.75rem; display: flex; flex-direction: column; gap: 0.45rem; }
.pane-actions, .row { display: flex; gap: 0.4rem; flex-wrap: wrap; }

.files { display: flex; gap: 0.25rem; flex-wrap: wrap; }
.files button { background: transparent; color: var(--ink-dim); border: 1px solid transparent; border-radius: 7px; padding: 0.25rem 0.6rem; font: inherit; font-size: 0.85rem; cursor: pointer; }
.files button[aria-selected="true"] { color: var(--ink); border-color: var(--glass-border-hover); background: var(--bg-2); }

.editor { flex: 1; display: flex; min-height: 0; background: var(--bg-2); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13.5px; line-height: 1.55; }
.gutter { margin: 0; padding: 0.75rem 0.5rem 0.75rem 0.75rem; text-align: right; color: var(--ink-faint); user-select: none; overflow: hidden; min-width: 3.2em; font: inherit; }
.editor textarea { flex: 1; resize: none; border: 0; outline: none; background: transparent; color: var(--ink); padding: 0.75rem; font: inherit; white-space: pre; overflow: auto; tab-size: 4; min-width: 0; }

label { font-size: 0.82rem; color: var(--ink-dim); margin-top: 0.2rem; }
input[type="text"], select { width: 100%; background: var(--bg-2); color: var(--ink); border: 1px solid var(--glass-border); border-radius: 8px; padding: 0.45rem 0.6rem; font: inherit; font-size: 0.88rem; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
input[type="text"]:focus, select:focus { border-color: var(--violet); outline: none; }
.check { display: flex; align-items: center; gap: 0.45rem; color: var(--ink-dim); }

.btn { background: var(--bg-2); color: var(--ink); border: 1px solid var(--glass-border-hover); border-radius: 8px; padding: 0.45rem 0.85rem; font: inherit; font-size: 0.88rem; cursor: pointer; }
.btn:hover:not(:disabled) { border-color: var(--cyan); }
.btn:disabled { opacity: 0.45; cursor: default; }
.btn.primary { background: linear-gradient(100deg, rgba(110, 231, 255, 0.18), rgba(139, 92, 246, 0.28)); border-color: rgba(139, 92, 246, 0.6); }
.btn.ghost { background: transparent; }
.btn.small { padding: 0.25rem 0.55rem; font-size: 0.8rem; }
.btn.wide { width: 100%; }

.notes { list-style: none; margin: 0.25rem 0; padding: 0; display: flex; flex-direction: column; gap: 0.35rem; }
.notes li { font-size: 0.82rem; border-left: 3px solid var(--ink-faint); padding: 0.3rem 0.5rem; background: var(--bg-2); border-radius: 0 6px 6px 0; color: var(--ink-dim); }
.notes li.error { border-color: #f87171; color: #fecaca; }
.notes li.warn { border-color: #facc15; }
.notes li.ok { border-color: #4ade80; }

details.at summary { cursor: pointer; font-size: 0.85rem; color: var(--ink-dim); margin-top: 0.3rem; }
details.at[open] { display: flex; flex-direction: column; gap: 0.4rem; }

.instance { border: 1px solid var(--glass-border); border-radius: 10px; padding: 0.6rem; display: flex; flex-direction: column; gap: 0.45rem; }
.instance-head { display: flex; justify-content: space-between; gap: 0.5rem; align-items: baseline; }
.instance-head strong { font-size: 0.92rem; }
.addr { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.75rem; color: var(--ink-faint); word-break: break-all; }
.fn { display: flex; flex-direction: column; gap: 0.3rem; padding-top: 0.45rem; border-top: 1px dashed var(--glass-border); }
.fn-name { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.82rem; }
.fn-name .tag { font-family: var(--font-body); font-size: 0.7rem; color: var(--ink-faint); margin-left: 0.35rem; }
.state { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.78rem; display: grid; grid-template-columns: auto 1fr; gap: 0.15rem 0.6rem; }
.state .k { color: var(--ink-dim); }
.state .v { color: var(--ink); word-break: break-all; }

.console { flex: 1; overflow: auto; padding: 0.6rem 0.75rem; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.8rem; line-height: 1.5; }
.console .line { white-space: pre-wrap; word-break: break-word; }
.console .t { color: var(--ink-faint); margin-right: 0.5rem; }
.console .error { color: #fca5a5; }
.console .ok { color: #86efac; }
.console .warn { color: #fde68a; }
.console .info { color: var(--ink-dim); }
