/* Right plugin panel: ABI viewer, Deployed contracts list, Site preview iframe.
 * Context-aware — content swaps based on which activity is live. */

.plugin {
  grid-area: plugin;
  background: var(--bg-elevated);
  border-left: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: width 180ms cubic-bezier(0.4, 0, 0.2, 1);
}

.plugin-header {
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  font-size: var(--fs-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-subtle);
}
.plugin-header-actions {
  display: inline-flex;
  gap: 4px;
}
.plugin-header-actions button {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
}
.plugin-header-actions button:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.plugin-body {
  flex: 1;
  overflow: auto;
  padding: 12px 14px;
}

.plugin-section {
  margin-bottom: 20px;
}
.plugin-section h4 {
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}

/* ───────────── ABI viewer ───────────── */

.abi-block {
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  background: var(--bg-popover);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  margin-bottom: 8px;
}
.abi-entry {
  margin-bottom: 6px;
  line-height: 1.5;
}
.abi-entry:last-child { margin-bottom: 0; }
.abi-keyword { color: var(--syn-keyword); }
.abi-type    { color: var(--syn-type); }
.abi-fn      { color: var(--syn-fn); }
.abi-string  { color: var(--syn-string); }
.abi-number  { color: var(--syn-number); }
.abi-comment { color: var(--syn-comment); font-style: italic; }
.abi-attr    { color: var(--syn-attr); }
.abi-param-list {
  padding-left: 12px;
  display: block;
  color: var(--text-secondary);
}
.abi-param-name { color: var(--text-primary); }

/* Bytecode + codeHash row */
.bytecode-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
}
.bytecode-row .label {
  font-size: var(--fs-xs);
  text-transform: uppercase;
  color: var(--text-secondary);
  letter-spacing: 0.04em;
  font-weight: 600;
}
.bytecode-row .value {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--text-primary);
  background: var(--bg-popover);
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  word-break: break-all;
  border: 1px solid var(--border-subtle);
}

/* ───────────── Deployed contracts list ───────────── */

.deployed-row {
  background: var(--bg-popover);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  margin-bottom: 8px;
  font-size: var(--fs-sm);
  cursor: pointer;
  transition: border-color 120ms ease-out, background 120ms ease-out, transform 120ms ease-out;
  animation: fadeInUp 220ms ease-out;
}
.deployed-row:hover {
  border-color: var(--accent);
  background: var(--bg-hover);
  transform: translateY(-1px);
}
.deployed-row.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-soft);
}
.deployed-row .name {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.deployed-row .meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--text-secondary);
}
.deployed-row .meta a {
  color: var(--accent);
}
.deployed-row .meta a:hover { color: var(--accent-hover); text-decoration: underline; }

.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text-secondary);
  font-size: var(--fs-xs);
  padding: 2px 4px;
  border-radius: 3px;
  cursor: pointer;
  transition: color 120ms ease-out, background 120ms ease-out;
}
.copy-btn:hover { color: var(--text-primary); background: var(--bg-hover); }
.copy-btn svg { width: 12px; height: 12px; }

/* Per-entrypoint Call form, opens when a deployed row is active */
.call-form {
  margin-top: 10px;
  padding: 12px;
  background: var(--bg-base);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  display: none;
}
.deployed-row.active .call-form { display: block; }
.call-form .entry-name {
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  color: var(--syn-fn);
  margin-bottom: 8px;
}
.call-form .form-row {
  margin-bottom: 8px;
}
.call-form .form-row label {
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--text-secondary);
}
.call-form .form-row input {
  font-size: var(--fs-xs);
  padding: 4px 8px;
}
.call-form .actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}
.call-form .actions button {
  font-size: var(--fs-xs);
  padding: 4px 10px;
}

.entry-list { margin-top: 10px; }
.entry-tab {
  display: inline-block;
  padding: 4px 10px;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  background: var(--bg-popover);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  margin-right: 4px;
  margin-bottom: 4px;
  transition: color 120ms, border-color 120ms, background 120ms;
}
.entry-tab:hover { color: var(--text-primary); border-color: var(--accent); }
.entry-tab.active { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.entry-tab.batch::before { content: '@batch '; color: var(--syn-attr); }
.entry-tab.direct::before { content: '@direct '; color: var(--syn-attr); }

/* ───────────── State viewer ───────────── */

.state-viewer {
  background: var(--bg-popover);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  margin-top: 8px;
}
.state-row {
  display: flex;
  justify-content: space-between;
  padding: 3px 0;
  border-bottom: 1px solid var(--border-subtle);
}
.state-row:last-child { border-bottom: none; }
.state-row .key { color: var(--text-secondary); }
.state-row .val { color: var(--text-primary); text-align: right; }
.state-row.private .key::after {
  content: '🔒';
  margin-left: 6px;
  filter: grayscale(0.4);
}
.state-row.private .val { color: var(--syn-comment); font-style: italic; }

/* ───────────── Site preview iframe ───────────── */

.site-preview {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}
.site-preview-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--bg-popover);
  border-bottom: 1px solid var(--border-subtle);
  font-size: var(--fs-xs);
}
.site-preview-controls .url-pill {
  flex: 1;
  font-family: var(--font-mono);
  color: var(--text-secondary);
  background: var(--bg-base);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.site-preview iframe {
  flex: 1;
  width: 100%;
  border: none;
  background: white;
}

.site-bundle-stats {
  display: flex;
  gap: 16px;
  padding: 10px 12px;
  background: var(--bg-popover);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  margin-bottom: 12px;
  font-size: var(--fs-xs);
}
.site-bundle-stats .stat {
  display: flex;
  flex-direction: column;
}
.site-bundle-stats .label {
  text-transform: uppercase;
  color: var(--text-secondary);
  letter-spacing: 0.04em;
  font-weight: 600;
  margin-bottom: 2px;
}
.site-bundle-stats .value {
  font-family: var(--font-mono);
  color: var(--text-primary);
  font-size: var(--fs-sm);
}

/* Reserve-impact callout (used in publish review) */
.reserve-callout {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: linear-gradient(135deg, var(--accent-soft) 0%, transparent 100%);
  border: 1px solid var(--accent);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin: 12px 0;
}
.reserve-callout svg {
  width: 18px;
  height: 18px;
  color: var(--accent);
  flex-shrink: 0;
  margin-top: 1px;
}
.reserve-callout .text {
  font-size: var(--fs-sm);
  color: var(--text-primary);
  line-height: 1.4;
}
.reserve-callout .text strong { color: var(--accent); }
