/* Arthion Agent Studio: app shell (left sidebar, wordmark) and the refreshed look on top of studio.css.
   Layout in the spirit of today's agent builders: a quiet sidebar with grouped menus, wide content, soft cards. */
:root {
  /* Arthion brand (arthion.ai): Arthion blue, with its cyan and teal for Neurion's spark */
  --accent: #0846aa; --accent-soft: #e8f0fd; --accent-2: #1095c1; --accent-3: #063a8f;
  --bg: #f6f7f9; --side: #f1f2f4; --side-w: 260px;
  --brand-grad: linear-gradient(100deg, #063a8f 0%, #0846aa 55%, #0b58cc 100%);  /* white text above 4.5:1 */
  --spark: linear-gradient(135deg, #1095c1, #14b8a4);  /* Neurion's dot: Arthion's cyan and teal */
  --text-grad: linear-gradient(100deg, #063a8f 0%, #0846aa 100%);  /* wordmark and big numbers */
  --radius: 12px;
}
@media (prefers-color-scheme: dark) {
  :root { --accent: #3c83f6; --accent-soft: #17284a; --accent-2: #5cc5e8; --bg: #0b1120; --side: #111b31;
          --brand-grad: linear-gradient(100deg, #063a8f 0%, #0846aa 55%, #0b58cc 100%);
          --spark: linear-gradient(135deg, #5cc5e8, #4fe3cf);
          --text-grad: linear-gradient(100deg, #3c83f6 0%, #6aa6ff 100%); }
}
body.with-side { padding-left: var(--side-w); }
body { background: radial-gradient(1200px 400px at 70% -120px, color-mix(in srgb, var(--accent) 7%, transparent), transparent), var(--bg); background-attachment: fixed; }

/* ---- sidebar ---- */
.side { position: fixed; inset: 0 auto 0 0; width: var(--side-w); z-index: 20; display: flex; flex-direction: column;
        background: var(--side); border-right: 1px solid var(--line); }
.side-head { display: flex; align-items: center; justify-content: space-between; padding: 22px 20px 14px; }
.side-body { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 6px; padding: 4px 14px 14px; overflow-y: auto; }
.wordmark { display: flex; align-items: center; gap: 12px; color: var(--fg); }
.wordmark:hover { text-decoration: none; }
.mark { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--brand-grad);
        box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 35%, transparent); }
.mark span { color: #fff; font: 800 22px/1 var(--display); letter-spacing: -.04em; }
.wm-text { display: grid; line-height: 1.05; }
.wm-1 { font: 800 30px/1.05 var(--display); letter-spacing: -.035em; background: var(--text-grad);
        -webkit-background-clip: text; background-clip: text; color: transparent; }
.wm-2 { font: 600 12px/1.4 var(--font); letter-spacing: .22em; text-transform: uppercase; color: var(--muted); margin-top: 3px; }
.new-agent { justify-content: center; margin: 4px 0 10px; padding: 10px 16px; border-radius: 12px; font-weight: 600;
             background: var(--brand-grad); border: 0; color: #fff; box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 30%, transparent); }
.new-agent:hover { filter: brightness(1.06); background: var(--brand-grad); }
.new-agent .ni { width: 18px; height: 18px; }
.nav-group { margin: 14px 10px 4px; font-size: 11.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 8px 12px; margin: 1px 0; border-radius: 10px;
            color: var(--fg-2); font-weight: 500; font-size: 15px; position: relative; }
.nav-item:hover { background: color-mix(in srgb, var(--fg) 5%, transparent); text-decoration: none; }
.nav-item.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav-item.on::before { content: ""; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.nav-item .count { margin-left: auto; min-width: 22px; padding: 0 7px; border-radius: 999px; font-size: 12px; font-weight: 700;
                   text-align: center; background: var(--accent); color: var(--accent-fg); }
.ni { width: 20px; height: 20px; flex: none; }
.side .who { margin-top: auto; padding: 12px 8px 4px; border-top: 1px solid var(--line); display: flex; gap: 10px; align-items: center; }
.side .who-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.side .who button { padding: 5px 10px; font-size: 13px; }
.nav-burger { display: none; cursor: pointer; padding: 6px; border-radius: 8px; color: var(--fg-2); }
.top { position: static; background: transparent; border: 0; padding: 22px 24px 0; backdrop-filter: none; }

/* ---- content ---- */
main { max-width: 1360px; padding: 32px 40px 72px; }
h1 { font-size: 32px; font-weight: 750; letter-spacing: -.025em; }
.page-head { margin-bottom: 26px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.page-head p { color: var(--muted); font-size: 15.5px; }
.card { border-radius: var(--radius); border-color: color-mix(in srgb, var(--line) 85%, transparent);
        box-shadow: 0 1px 2px rgb(16 16 40 / .04), 0 2px 8px rgb(16 16 40 / .04); }
.card h2.h, .card > h2 { margin-top: 0; font-size: 17px; }
.stat { border-radius: var(--radius); }
.stat-value { background: var(--text-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
button.primary, .primary { box-shadow: 0 2px 8px color-mix(in srgb, var(--accent) 25%, transparent); }
.icon { background: var(--brand-grad); }
.agent-grid .agent-card:hover, .agent-card:hover { border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
        box-shadow: 0 8px 28px color-mix(in srgb, var(--accent) 12%, transparent); transform: translateY(-1px); }
.agent-card { transition: border-color .15s, box-shadow .15s, transform .15s; }
th { background: color-mix(in srgb, var(--accent) 4%, var(--surface)); }
td input.compact { min-width: 90px; padding: 6px 8px; }
.helper-fab, .fab { background: var(--brand-grad) !important; border: 0 !important; color: #fff !important; }

/* ---- tablets and phones: the sidebar folds into a top bar with a menu ---- */
@media (max-width: 960px) {
  body.with-side { padding-left: 0; }
  .side { position: sticky; top: 0; width: auto; inset: auto; border-right: 0; border-bottom: 1px solid var(--line);
          background: color-mix(in srgb, var(--side) 94%, transparent); backdrop-filter: blur(10px); }
  .side-head { padding: 10px 16px; }
  .mark { width: 34px; height: 34px; border-radius: 10px; } .mark span { font-size: 18px; }
  .wm-1 { font-size: 21px; } .wm-2 { font-size: 10px; letter-spacing: .18em; }
  .nav-burger { display: inline-grid; }
  .side-body { display: none; max-height: calc(100vh - 60px); padding: 0 16px 14px; }
  #nav-toggle:checked ~ .side .side-body { display: flex; }
  #nav-toggle:focus-visible ~ .side .nav-burger { outline: 2px solid var(--accent); }
  .nav-item.on::before { display: none; }
  main { padding: 20px 16px 72px; }
  h1 { font-size: 26px; }
}
.when-val { max-width: 160px; }
.confirm-dlg { width: min(460px, calc(100vw - 32px)); } .confirm-text { font-size: 16px; margin: 4px 0 0; }
.chat-form { align-content: end; } .chat-actions { align-items: center; }
.terminal { background: #0f1117; color: #d7dae0; border: 1px solid #23262f; border-radius: 10px; padding: 14px 16px;
            font: 13px/1.6 var(--mono); max-height: 460px; overflow: auto; white-space: pre-wrap; margin: 6px 0 0; }
.bad { color: var(--bad); }
.log-table td { font-size: 14px; }
.team-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) auto; gap: 6px 8px; align-items: center; }
.team-grid .tm-off { text-decoration: line-through; color: var(--muted); }
.team-grid select, .team-grid input { width: 100%; min-width: 0; }
.wide-sec > .p-sec { border-top: 0; padding: 0; }
@media (max-width: 640px) { .team-grid { grid-template-columns: 1fr; } }
.tpl-group { margin: 22px 0 10px; font-size: 13px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); gap: 14px; }
.tpl-card { display: flex; gap: 14px; align-items: flex-start; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius);
            background: var(--surface); color: var(--fg); box-shadow: 0 1px 2px rgb(16 16 40 / .04); transition: border-color .15s, box-shadow .15s, transform .15s; }
.tpl-card:hover { text-decoration: none; border-color: color-mix(in srgb, var(--accent) 40%, var(--line));
                  box-shadow: 0 8px 24px color-mix(in srgb, var(--accent) 12%, transparent); transform: translateY(-1px); }
.tpl-icon { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; flex: none; font-size: 18px;
            background: var(--accent-soft); color: var(--accent); }
.tpl-text { display: grid; gap: 4px; min-width: 0; }
.tpl-text strong { font-size: 15.5px; }
.import-card { display: grid; gap: 10px; max-width: 760px; }
.kids-fold summary { cursor: pointer; color: var(--accent); font-weight: 500; }
.kids-list { display: grid; gap: 2px; margin-top: 6px; max-height: 260px; overflow: auto; }
.api-op { border-top: 1px solid var(--line); padding: 10px 0; }
.api-op:first-of-type { border-top: 0; }
.api-line { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.api-method { font: 700 11.5px/1 var(--mono); padding: 5px 8px; border-radius: 6px; color: #fff; background: #6b7280; }
.api-get { background: #2563eb; } .api-post { background: #059669; } .api-delete { background: #dc2626; } .api-put, .api-patch { background: #d97706; }
