/* Cosmax Agent Firewall console (rendered by assets/js/firewall.js into #firewall-console)
   Builds on the cw- components in wallet.css (state views, chips, rows, mini buttons) and
   adds fw- pieces: account header, ETH fields, agent list, add-agent form and the
   transaction status line. Uses the shared tokens from style.css. */

.fw-console{gap:0}

/* Two-column desktop console: the panel body has a fixed ceiling and scrolls inside it, so the
   page stays the same height however many agents, messages or open forms there are (the card
   is at most ~710px tall, which also fits a 900px-high window). The padding and negative margin
   leave room for focus rings at the scroll edges. On one-column layouts the page scrolls. */
@media (min-width:861px){
  .fw-console>.cw-body{max-height:540px;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:rgba(255,255,255,.2) transparent;
    margin:-4px -8px -4px -4px;padding:4px 8px 4px 4px}
}
/* narrow two-column layouts: the rest of the page wraps taller, so the panel gets less */
@media (min-width:861px) and (max-width:1099px){.fw-console>.cw-body{max-height:480px}}

/* account header */
.fw-head{display:flex;flex-wrap:wrap;align-items:center;gap:10px 14px;margin-bottom:14px}
.fw-head .cw-tile{width:44px;height:44px;border-radius:14px}
.fw-head .cw-tile-in{border-radius:12px}
.fw-head .cw-tile .cw-ico{width:20px;height:20px}
.fw-head-id{display:grid;gap:2px;min-width:0;margin-right:auto}
.fw-kicker{font-size:12px;font-weight:500;letter-spacing:.08em;text-transform:uppercase;color:var(--cw-muted)}
.fw-head .cw-link-mono{font-size:14px}

.fw-kill{color:#ffd2a1;background:rgba(255,181,71,.10)}
.fw-kill:hover{background:rgba(255,181,71,.18)}
.fw-kill.is-resume{color:#bff3da;background:rgba(61,220,151,.12)}
.fw-kill.is-resume:hover{background:rgba(61,220,151,.2)}
.fw-read-note{margin-top:12px;max-width:none}
.fw-rows-compact{width:100%;margin-top:4px}

/* disabled-looking write controls while a transaction is in flight (focus stays put) */
.fw-console [aria-disabled="true"]{opacity:.55;cursor:not-allowed}
.fw-console .btn[aria-disabled="true"]:hover{transform:none}

/* blocks */
.fw-block{margin-top:18px;padding-top:16px;border-top:1px solid var(--cw-line)}
.cw-rows+.fw-block,.fw-read-note+.fw-block{border-top:0;padding-top:4px}
.fw-block-hd{display:flex;align-items:center;gap:10px;margin-bottom:12px}
.fw-block-title{margin:0;font-size:15px;font-weight:600;letter-spacing:-.01em}
.fw-block-hd .cw-mini{margin-left:auto}

/* fields */
.fw-field{display:grid;align-content:start;gap:6px;min-width:0}
.fw-label{font-size:12.5px;line-height:1.3;color:var(--cw-muted)}
.fw-input{display:flex;align-items:center;min-width:0;min-height:42px;border-radius:12px;background:rgba(255,255,255,.03);box-shadow:inset 0 0 0 1px var(--cw-line-2);transition:box-shadow .15s}
.fw-input:focus-within{box-shadow:inset 0 0 0 1px var(--cw-blue-2),0 0 0 3px rgba(90,168,255,.18)}
.fw-input:has([aria-invalid="true"]){box-shadow:inset 0 0 0 1px rgba(255,107,107,.7)}
.fw-input input,.fw-input select{flex:1 1 auto;width:100%;min-width:0;min-height:40px;margin:0;padding:9px 12px;border:0;border-radius:12px;background:transparent;color:#fff;font-family:var(--cw-mono);font-size:14px;line-height:1.3;outline:none}
.fw-input select{font-family:var(--cw-font);cursor:pointer;-webkit-appearance:none;appearance:none;padding-right:34px;
  background-image:linear-gradient(45deg,transparent 50%,var(--cw-muted) 50%),linear-gradient(135deg,var(--cw-muted) 50%,transparent 50%);
  background-position:calc(100% - 18px) 50%,calc(100% - 13px) 50%;background-size:5px 5px,5px 5px;background-repeat:no-repeat}
.fw-input select option{background:#0b0d12;color:#fff}
.fw-unit{flex:none;padding-right:12px;font-family:var(--cw-mono);font-size:12px;color:var(--cw-muted)}
.fw-hint{margin:0;font-size:12px;line-height:1.45;color:var(--cw-muted)}
.fw-err{margin:0;font-size:12.5px;line-height:1.4;color:#ffb9b9}
.fw-textbtn{display:inline-flex;align-items:center;gap:6px;min-height:36px;padding:6px 10px;border:0;border-radius:10px;background:none;color:var(--cw-tag);font-family:var(--cw-font);font-size:13px;font-weight:500;cursor:pointer}
.fw-textbtn:hover{background:rgba(255,255,255,.05);color:#fff}
.fw-textbtn .cw-ico{width:14px;height:14px}
.fw-textbtn[aria-busy="true"]{cursor:progress;opacity:.7}

/* deposit / withdraw */
.fw-funds-row{display:flex;flex-wrap:wrap;align-items:flex-start;gap:10px 12px}
.fw-funds-row>.fw-field{flex:1 1 200px}
.fw-funds-actions{display:flex;flex-wrap:wrap;align-items:center;gap:8px;padding-top:24px}
.fw-risk{margin-top:10px}

/* transaction status line */
.fw-tx{display:flex;flex-wrap:wrap;align-items:center;gap:6px 10px;margin-top:12px;padding:10px 12px;border-radius:12px;background:rgba(90,168,255,.07);box-shadow:inset 0 0 0 1px rgba(90,168,255,.25);color:var(--cw-tag);font-size:13.5px;line-height:1.45}
.fw-tx[hidden]{display:none}
.fw-tx>.cw-ico{width:15px;height:15px}
.fw-tx-text{flex:1 1 180px;min-width:0;overflow-wrap:anywhere}
.fw-tx[data-tone="ok"]{background:rgba(61,220,151,.07);box-shadow:inset 0 0 0 1px rgba(61,220,151,.3);color:#c9f5df}
.fw-tx[data-tone="error"]{background:rgba(255,107,107,.07);box-shadow:inset 0 0 0 1px rgba(255,107,107,.32);color:#ffd2d2}
.fw-tx[data-tone="info"]{background:rgba(255,181,71,.06);box-shadow:inset 0 0 0 1px rgba(255,181,71,.28);color:#ffdcaa}
.fw-tx .cw-link-mono{font-size:12.5px}
.cw-state .fw-tx{max-width:52ch}

/* agents */
.fw-agents{display:grid;gap:10px;margin:0;padding:0;list-style:none}
.fw-agent{min-width:0;padding:12px 14px;border-radius:14px;background:rgba(255,255,255,.025);box-shadow:inset 0 0 0 1px var(--cw-line)}
.fw-agent-top{display:flex;flex-wrap:wrap;align-items:center;gap:8px 10px}
.fw-agent-id{display:inline-flex;align-items:center;gap:8px;min-width:0;color:var(--cw-gold)}
.fw-agent-id .cw-ico{width:15px;height:15px}
.fw-agent-top .fw-revoke{margin-left:auto;color:#ffb9b9}
.fw-agent-kv{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px 14px;margin:10px 0 0}
.fw-agent-kv dt{font-size:11.5px;line-height:1.3;color:var(--cw-muted)}
.fw-agent-kv dd{margin:2px 0 0;font-family:var(--cw-mono);font-size:12.5px;line-height:1.4;color:#fff;overflow-wrap:anywhere}
.fw-empty{margin:0;font-size:14px;line-height:1.5;color:var(--cw-muted)}
.fw-agents-wrap{display:grid;gap:8px}

/* add-agent form */
.fw-add{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px 14px;margin:0 0 14px;padding:14px;border-radius:14px;background:rgba(255,255,255,.02);box-shadow:inset 0 0 0 1px var(--cw-line-2)}
.fw-add .fw-wide,.fw-add>.fw-tx{grid-column:1 / -1}
.fw-add>.fw-tx{margin-top:0}
.fw-form-actions{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:10px}

.fw-foot{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:10px 18px;margin-top:18px;padding-top:14px;border-top:1px solid var(--cw-line)}
.fw-foot>:last-child{margin-left:auto} /* Refresh stays right when there is no faucet link */

@media (max-width:640px){
  .fw-agent-kv{grid-template-columns:repeat(2,minmax(0,1fr))}
  .fw-add{grid-template-columns:minmax(0,1fr)}
}
@media (max-width:480px){
  .fw-funds-actions{width:100%;padding-top:0}
  .fw-funds-actions .btn{flex:1 1 auto}
  .fw-form-actions .btn{flex:1 1 auto}
  .fw-add{padding:12px}
}
