/* ---- Studio: project home ------------------------------------------------------ */
.studio-home { overflow-y: auto; display: block; }
.studio-home-inner { max-width: 1040px; margin: 0 auto; padding: 28px 24px 60px; }
.studio-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin-top: 18px; }
.studio-card { display: flex; flex-direction: column; gap: 8px; text-align: left; padding: 16px; border-radius: 14px; border: 1px solid var(--glass-brd); background: var(--glass-2); backdrop-filter: blur(12px) saturate(140%); -webkit-backdrop-filter: blur(12px) saturate(140%); transition: transform .2s var(--ease), border-color .2s; min-height: 118px; }
.studio-card:hover { transform: translateY(-2px); border-color: var(--accent); }
.studio-card .q-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex-shrink: 0; }
.studio-card-desc { flex: 1; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.studio-steps { padding-left: 20px; margin: 0; display: flex; flex-direction: column; gap: 12px; line-height: 1.55; }
.studio-steps code, .studio-code code { font-family: var(--font-mono); font-size: 12.5px; }
.studio-code { display: flex; align-items: center; gap: 8px; margin-top: 6px; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); }
.studio-code code { flex: 1; min-width: 0; overflow-x: auto; white-space: nowrap; }

/* ---- Studio: the workspace (a dark IDE, like the ARIA editor) -------------------- */
.studio { flex: 1; min-height: 0; display: flex; flex-direction: column; background: #0d1017; color: #d5dae3; }
.studio .icon-btn { color: #9aa3b5; }
.studio .icon-btn:hover, .studio .icon-btn.active { color: #fff; background: rgba(255,255,255,.07); }
.studio .btn { background: #1a2030; border-color: #2a3145; color: #d5dae3; box-shadow: none; }
.studio .btn:hover { background: #222a3d; }
.studio .btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text, #fff); }
.studio .btn:disabled { opacity: .5; }
.studio-bar { display: flex; align-items: center; gap: 8px; height: 52px; padding: 0 10px; border-bottom: 1px solid #1d2230; background: #10141d; flex-shrink: 0; }
.studio-title { font-weight: 600; color: #fff; }
.studio-sub { color: #7d879b; }
.studio-body { flex: 1; min-height: 0; display: flex; }
.studio-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.studio-editor-row { flex: 1; min-height: 0; display: flex; }
.studio-editor { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.studio-editor-row .ide-preview { width: 44%; }
.studio-empty { flex: 1; color: #5d6679; text-align: center; font-size: 13px; }
.studio-md { flex: 1; overflow-y: auto; padding: 24px 32px 60px; background: #0d1017; color: #d5dae3; max-width: none; }
.studio-md h1, .studio-md h2, .studio-md h3 { color: #fff; }
.studio-md pre, .studio-md code { background: #151a24; }

/* Explorer, on the right */
.studio-explorer { width: 270px; flex-shrink: 0; border-left: 1px solid #1d2230; background: #0f131b; display: flex; flex-direction: column; min-height: 0; }
.studio-explorer .t-head { padding: 10px 8px 6px 14px; font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: #6d768a; display: flex; align-items: center; gap: 2px; }
.studio-filter { background: #151a24 !important; border-color: #232a3b !important; color: #d5dae3 !important; }
.studio-tree { flex: 1; overflow-y: auto; padding: 0 6px 20px; }
.studio-node-row { display: flex; align-items: center; position: relative; }
.studio-node-row .ide-node { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.studio-node-row .node-menu { position: absolute; right: 2px; opacity: 0; width: 24px; height: 24px; }
.studio-node-row:hover .node-menu, .studio-node-row .node-menu[aria-expanded="true"] { opacity: 1; }
@media (hover: none) { .studio-node-row .node-menu { opacity: .7; } }
.claude-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-left: 6px; flex-shrink: 0; }

/* Bottom panel */
.studio-panel { height: 240px; flex-shrink: 0; display: flex; flex-direction: column; border-top: 1px solid #1d2230; background: #0a0d13; }
.studio-panel.closed { height: auto; }
.studio-panel-tabs { display: flex; align-items: center; gap: 2px; height: 34px; padding: 0 6px; border-bottom: 1px solid #1d2230; flex-shrink: 0; overflow-x: auto; }
.studio-panel.closed .studio-panel-tabs { border-bottom: none; }
.sp-tab { border: none; background: none; color: #7d879b; font-size: 11.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; padding: 0 10px; height: 100%; white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.sp-tab.on { color: #fff; box-shadow: inset 0 -2px 0 var(--accent); }
.sp-count { background: #262e42; color: #d5dae3; border-radius: 99px; padding: 0 6px; font-size: 10.5px; }
.studio-panel-body { flex: 1; overflow-y: auto; padding: 6px 10px; font-size: 12.5px; }
.sp-log { font-family: var(--font-mono); font-size: 12px; white-space: pre-wrap; word-break: break-word; padding: 1px 0; color: #b7bfcd; }
.sp-log.error { color: #ff8a80; } .sp-log.warn { color: #f7b267; } .sp-log.info { color: #7d879b; margin-top: 6px; }
.sp-empty { color: #5d6679; padding: 10px 2px; }
.sp-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 6px; border: none; background: none; color: #d5dae3; text-align: left; border-radius: 6px; font-size: 12.5px; }
.sp-row:hover { background: rgba(255,255,255,.04); }
.sp-run-body { padding: 4px 8px 10px 30px; }
.sp-fail { margin-bottom: 8px; } .sp-fail b { color: #ff8a80; font-weight: 600; }
.sp-fail pre, .sp-out { margin: 4px 0 0; font-family: var(--font-mono); font-size: 11.5px; white-space: pre-wrap; word-break: break-word; color: #b7bfcd; background: #0f131b; padding: 8px 10px; border-radius: 8px; max-height: 260px; overflow: auto; }
.studio .role-tag { background: rgba(91,140,255,.18); color: #9db8ff; }
.studio .role-tag.muted-tag { background: #1a2030; color: #9aa3b5; }
.ask-claude { max-width: 860px; }
.ask-form { display: flex; gap: 8px; align-items: flex-end; }
.ask-form .textarea { flex: 1; min-height: 56px; background: #151a24; border-color: #232a3b; color: #d5dae3; }
.ask-row { padding: 10px 0; border-top: 1px solid #1d2230; }
.ask-text { margin-top: 6px; white-space: pre-wrap; }
.ask-reply { margin-top: 6px; padding: 8px 10px; border-radius: 8px; background: #121826; color: #c6cfdd; white-space: pre-wrap; }

@media (max-width: 900px) {
  .studio-explorer { position: absolute; right: 0; top: 52px; bottom: 26px; z-index: 6; box-shadow: var(--shadow-lg); width: min(300px, 86vw); }
  .studio-body { position: relative; }
  .studio-editor-row .ide-preview { position: absolute; inset: 52px 0 26px 0; width: auto; z-index: 5; }
  .studio-panel { height: 200px; }
}
