/* Myrai Agent panel. Matches the Myrai navy, gold and teal brand. */
.ma-root {
  --ma-bg: #070b18;
  --ma-panel: #0e1530;
  --ma-panel-2: #141d3f;
  --ma-line: #26315c;
  --ma-text: #eef1fb;
  --ma-dim: #9aa5c9;
  --ma-gold: #d9b24c;
  --ma-teal: #22c6b6;
  --ma-red: #ff6b6b;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ma-text);
  background: var(--ma-bg);
  border: 1px solid var(--ma-line);
  border-radius: 16px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
  box-sizing: border-box;
  height: 100%;
  min-height: 520px;
}
.ma-root *, .ma-root *::before, .ma-root *::after { box-sizing: border-box; }

.ma-head { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; }
.ma-title { font-weight: 700; font-size: 16px; letter-spacing: .2px; }
.ma-title b { color: var(--ma-gold); }
.ma-state { font-size: 12px; padding: 3px 10px; border-radius: 999px; background: var(--ma-panel-2); color: var(--ma-dim); }
.ma-state[data-s="thinking"], .ma-state[data-s="acting"] { color: var(--ma-teal); }
.ma-state[data-s="waiting"] { color: var(--ma-gold); }
.ma-state[data-s="error"] { color: var(--ma-red); }
.ma-spacer { flex: 1; }
.ma-close { background: none; border: 0; color: var(--ma-dim); font-size: 22px; cursor: pointer; line-height: 1; padding: 4px 8px; }

.ma-screen { display: flex; flex-direction: column; min-height: 0; background: var(--ma-panel); border: 1px solid var(--ma-line); border-radius: 12px; overflow: hidden; }
.ma-urlbar { display: flex; gap: 8px; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--ma-line); font-size: 12px; color: var(--ma-dim); white-space: nowrap; overflow: hidden; }
.ma-urlbar .ma-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ma-dim); flex: none; }
.ma-urlbar .ma-dot.live { background: var(--ma-teal); box-shadow: 0 0 8px var(--ma-teal); }
.ma-urlbar span { overflow: hidden; text-overflow: ellipsis; }
.ma-view { flex: 1; display: flex; align-items: center; justify-content: center; min-height: 0; background: #050814; position: relative; }
.ma-view img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.ma-empty { color: var(--ma-dim); text-align: center; padding: 24px; font-size: 14px; max-width: 420px; line-height: 1.5; }
.ma-empty strong { color: var(--ma-gold); display: block; font-size: 18px; margin-bottom: 6px; }

.ma-side { display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.ma-log { flex: 1; overflow-y: auto; background: var(--ma-panel); border: 1px solid var(--ma-line); border-radius: 12px; padding: 10px; font-size: 13px; line-height: 1.45; }
.ma-log .ma-item { padding: 6px 4px; border-bottom: 1px dashed var(--ma-line); }
.ma-log .ma-item:last-child { border-bottom: 0; }
.ma-log .ma-step { color: var(--ma-dim); }
.ma-log .ma-step::before { content: "›"; color: var(--ma-teal); margin-right: 6px; }
.ma-log .ma-say { color: var(--ma-text); }
.ma-log .ma-you { color: var(--ma-gold); }
.ma-log .ma-done { color: var(--ma-text); background: var(--ma-panel-2); border-radius: 8px; padding: 10px; border: 1px solid var(--ma-teal); white-space: pre-wrap; }
.ma-log .ma-err { color: var(--ma-red); }

.ma-card { background: var(--ma-panel-2); border: 1px solid var(--ma-gold); border-radius: 12px; padding: 12px; font-size: 13px; }
.ma-card p { margin: 0 0 10px; line-height: 1.45; }
.ma-card .ma-row { display: flex; gap: 8px; }

.ma-input { width: 100%; resize: vertical; min-height: 44px; max-height: 160px; background: var(--ma-panel); color: var(--ma-text); border: 1px solid var(--ma-line); border-radius: 10px; padding: 10px; font: inherit; font-size: 14px; }
.ma-input:focus { outline: 2px solid var(--ma-teal); outline-offset: 1px; }
.ma-btn { border: 0; border-radius: 10px; padding: 10px 14px; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.ma-btn:focus-visible { outline: 2px solid var(--ma-teal); outline-offset: 2px; }
.ma-btn[disabled] { opacity: .5; cursor: not-allowed; }
.ma-go { background: var(--ma-gold); color: #1a1405; }
.ma-yes { background: var(--ma-teal); color: #04211e; flex: 1; }
.ma-no { background: transparent; color: var(--ma-text); border: 1px solid var(--ma-line); flex: 1; }
.ma-stop { background: transparent; color: var(--ma-red); border: 1px solid var(--ma-red); }
.ma-compose { display: flex; flex-direction: column; gap: 8px; }
.ma-compose .ma-row { display: flex; gap: 8px; }
.ma-compose .ma-row .ma-btn { flex: 1; }
.ma-note { font-size: 11px; color: var(--ma-dim); line-height: 1.4; }

.ma-overlay { position: fixed; inset: 0; z-index: 2147483000; background: rgba(3, 5, 12, .72); display: flex; padding: 16px; }
.ma-overlay .ma-root { width: 100%; max-width: 1400px; margin: auto; height: min(92vh, 900px); }

@media (max-width: 820px) {
  .ma-root { grid-template-columns: 1fr; grid-template-rows: auto minmax(220px, 40vh) auto; height: auto; }
  .ma-log { min-height: 160px; max-height: 40vh; }
  .ma-overlay { padding: 0; }
  .ma-overlay .ma-root { height: 100%; border-radius: 0; }
}
@media (prefers-reduced-motion: reduce) { .ma-urlbar .ma-dot.live { box-shadow: none; } }
.ma-log .ma-files { display: flex; flex-direction: column; gap: 6px; }
.ma-log .ma-file { text-align: left; font-size: 13px; padding: 7px 10px; }
.ma-recipes { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 6px 0; }
.ma-recipes small { width: 100%; opacity: .75; }
.ma-recipe { display: inline-flex; border: 1px solid var(--ma-line); border-radius: 999px; overflow: hidden; }
.ma-recipe button { background: none; border: 0; color: inherit; cursor: pointer; padding: 5px 10px; font: inherit; font-size: 12.5px; }
.ma-recipe .ma-recipe-del { padding: 5px 8px; opacity: .6; border-left: 1px solid var(--ma-line); }
.ma-recipe button:hover { background: rgba(255,255,255,.06); }
