/* FAO — Futarchy Autonomous Optimizer */

:root {
  --bg: #0d0f14;
  --bg-alt: #111520;
  --card: #141720;
  --card-hover: #1a1e2a;
  --border: #1e2230;
  --accent: #3effb0;
  --accent-dim: rgba(62, 255, 176, 0.15);
  --accent-glow: rgba(62, 255, 176, 0.25);
  --text: #e0e4ec;
  --text-muted: #8892a4;
  --text-dim: #5a6478;
  --danger: #ff5c5c;
  --warn: #ffb347;
  --mono: 'SF Mono', 'Fira Code', 'Cascadia Code', 'JetBrains Mono', ui-monospace, monospace;
  --sans: 'Inter', system-ui, -apple-system, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 72px;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Nav ── */

.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(13, 15, 20, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 32px;
  height: 56px;
}

.nav-logo {
  font-weight: 700;
  font-size: 18px;
  color: var(--accent);
  letter-spacing: 1px;
  white-space: nowrap;
}

.nav-links {
  display: flex;
  gap: 24px;
  list-style: none;
  overflow-x: auto;
}

.nav-links a {
  color: var(--text-muted);
  font-size: 13px;
  letter-spacing: 0.3px;
  white-space: nowrap;
  transition: color 0.2s;
}

.nav-links a:hover { color: var(--accent); text-decoration: none; }

.nav-hamburger {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: 22px;
  cursor: pointer;
  margin-left: auto;
}

/* ── Sections ── */

.section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 80px 24px;
}

.section-title {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text);
}

.section-subtitle {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 40px;
  max-width: 640px;
}

/* ── Hero ── */

.hero {
  text-align: center;
  padding: 120px 24px 80px;
}

.hero-title {
  font-size: clamp(36px, 6vw, 56px);
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.15;
}

.hero-title .accent { color: var(--accent); }

.hero-tagline {
  color: var(--text-muted);
  font-size: 17px;
  margin-top: 16px;
  max-width: 540px;
  margin-left: auto;
  margin-right: auto;
}

.hero-ctas {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 36px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 12px 24px;
  border-radius: 8px;
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 600;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary {
  background: var(--accent);
  color: #0d0f14;
  border-color: var(--accent);
}

.btn-primary:hover {
  background: #2de8a0;
  text-decoration: none;
}

.btn-secondary {
  background: transparent;
  color: var(--text);
}

.btn-secondary:hover {
  background: var(--card);
  text-decoration: none;
}

/* ── Step Cards ── */

.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.step-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  transition: border-color 0.2s, background 0.2s;
}

.step-card:hover {
  border-color: var(--accent-dim);
  background: var(--card-hover);
}

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--accent-dim);
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 12px;
}

.step-card h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
}

.step-card p {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.55;
}

/* ── Dashboard Panels ── */

.dash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}

.dash-panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
}

.dash-panel-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.dash-panel-title {
  font-size: 15px;
  font-weight: 600;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent-glow);
  animation: pulse-dot 2s ease-in-out infinite;
}

.live-dot.stale {
  background: var(--warn);
  box-shadow: 0 0 6px rgba(255, 179, 71, 0.3);
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.dash-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.dash-row:last-child { border-bottom: none; }

.dash-label { color: var(--text-muted); }

.dash-value {
  font-weight: 600;
  text-align: right;
  word-break: break-all;
}

.dash-value.loading {
  color: var(--text-dim);
  animation: pulse-text 1.5s ease-in-out infinite;
}

@keyframes pulse-text {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.dash-value.error { color: var(--danger); }

/* ── Mint Distribution Bar ── */

.dist-bar-wrap {
  margin: 24px 0 32px;
}

.dist-bar {
  display: flex;
  height: 36px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.dist-seg {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  color: #0d0f14;
  white-space: nowrap;
  transition: flex 0.3s;
}

.dist-seg.buyer    { background: var(--accent); flex: 1.0; }
.dist-seg.treasury { background: #5b8def; flex: 0.5; }
.dist-seg.incentive { background: #c084fc; flex: 0.2; }
.dist-seg.insider  { background: #f59e0b; flex: 0.3; }

.dist-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 12px;
  font-size: 12px;
  color: var(--text-muted);
}

.dist-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.dist-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

/* ── Contracts Table ── */

.contracts-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.contracts-table th {
  text-align: left;
  color: var(--text-muted);
  font-weight: 500;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

.contracts-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

.contracts-table tr:last-child td { border-bottom: none; }

.contracts-table .addr {
  font-family: var(--mono);
  font-size: 12px;
  word-break: break-all;
}

/* ── Resources Grid ── */

.resources-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.resource-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  transition: border-color 0.2s;
}

.resource-card:hover {
  border-color: var(--accent-dim);
  text-decoration: none;
}

.resource-card .icon {
  font-size: 20px;
  width: 36px;
  text-align: center;
}

.resource-card .label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.resource-card .desc {
  font-size: 11px;
  color: var(--text-muted);
}

/* ── Footer ── */

.footer {
  text-align: center;
  padding: 40px 24px;
  color: var(--text-dim);
  font-size: 12px;
  border-top: 1px solid var(--border);
}

/* ── Info Blocks ── */

.info-block {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 16px;
}

.info-block h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
}

.info-block p, .info-block li {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.6;
}

.info-block ul {
  padding-left: 20px;
  margin-top: 8px;
}

.info-block code {
  background: rgba(62, 255, 176, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
  color: var(--accent);
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ── Responsive ── */

@media (max-width: 720px) {
  .nav-links { display: none; }
  .nav-hamburger { display: block; }
  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    background: rgba(13, 15, 20, 0.97);
    padding: 16px 24px;
    gap: 12px;
    border-bottom: 1px solid var(--border);
  }

  .hero { padding: 80px 16px 60px; }
  .section { padding: 60px 16px; }
  .steps-grid { grid-template-columns: 1fr; }
  .dash-grid { grid-template-columns: 1fr; }
  .two-col { grid-template-columns: 1fr; }

  .dist-seg { font-size: 9px; }

  .contracts-table { font-size: 11px; }
  .contracts-table .addr { font-size: 10px; }
}

/* ─── Sepolia v0 dashboard ─── */
.sep-h3 { margin-top: 40px; font-size: 18px; color: var(--text); }
.sep-cards { display: grid; gap: 16px; margin-top: 16px; }
@media (min-width: 720px) { .sep-cards { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .sep-cards { grid-template-columns: repeat(3, 1fr); } }
.sep-empty { color: var(--muted); font-style: italic; }
.sep-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sep-card-head { display: flex; justify-content: space-between; align-items: center; }
.sep-card-idx { color: var(--muted); font-family: monospace; font-size: 11px; }
.sep-card-status {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.sep-status-live  { background: rgba(50, 200, 100, 0.15); color: #6fe9a8; }
.sep-status-ready { background: rgba(255, 200, 50, 0.18); color: #ffd76a; }
.sep-status-done  { background: rgba(120, 140, 255, 0.18); color: #9bb0ff; }
.sep-card-title { margin: 0; font-size: 15px; }
.sep-card-title a { color: var(--text); text-decoration: none; }
.sep-card-title a:hover { color: var(--accent); }
.sep-card-desc {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}
.sep-card-grid {
  display: grid;
  gap: 4px 12px;
  margin-top: 4px;
  font-size: 11px;
  color: var(--muted);
}
.sep-card-grid > div { display: flex; justify-content: space-between; gap: 12px; }
.sep-card-grid > div > span:first-child,
.sep-card-grid > div > a:first-child { color: var(--muted); }
.sep-card-grid > div > :nth-child(2) { color: var(--text); text-align: right; }
.sep-card-grid a { color: var(--accent); text-decoration: none; }
.sep-card-grid a:hover { text-decoration: underline; }
.sep-mono { font-family: monospace; font-size: 10px; }
.sep-note {
  margin-top: 20px;
  font-size: 11px;
  color: var(--muted);
}
.sep-note a { color: var(--accent); }

/* ─── Standalone testnet additions ─── */
.env-badge {
  display: inline-block;
  padding: 2px 8px;
  margin-left: 8px;
  border-radius: 4px;
  font-size: 10px;
  background: rgba(255, 200, 50, 0.18);
  color: #ffd76a;
  vertical-align: middle;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.addr-divider {
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  padding-top: 12px;
  font-style: italic;
}
.docs-list {
  list-style: none;
  padding: 0;
  margin: 16px 0 0 0;
}
.docs-list li {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.docs-list a { color: var(--accent); text-decoration: none; }
.docs-list a:hover { text-decoration: underline; }
.footer {
  padding: 32px 24px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  border-top: 1px solid var(--border);
}
.footer a { color: var(--accent); }

/* ─── Create proposal box ─── */
.create-box {
  margin-top: 24px;
  padding: 20px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.create-title { margin: 0 0 8px 0; font-size: 16px; }
.create-note { margin: 0 0 16px 0; font-size: 12px; color: var(--muted); }
.create-form { display: flex; flex-direction: column; gap: 10px; }
.create-form input,
.create-form textarea {
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  padding: 10px 12px;
  font-size: 13px;
  font-family: inherit;
}
.create-form textarea { resize: vertical; min-height: 60px; }
.create-form input:focus,
.create-form textarea:focus { outline: 1px solid var(--accent); }
.create-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.create-actions .btn { min-width: 160px; }
.create-status { margin: 8px 0 0 0; font-size: 12px; }
.create-status-info    { color: var(--muted); }
.create-status-ok      { color: #6fe9a8; }
.create-status-error   { color: #ff6b6b; }
.create-status-pending { color: #ffd76a; }
.create-status a       { color: var(--accent); }

/* ─── Proposal card actions (Resolve button) ─── */
.sep-card-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
/* Base style for in-card action buttons. Inherits look from .btn-primary so
 * resolve-btn matches the rest of the dashboard. If bonds.js later defines
 * .bond-action-btn with its own look, the more specific selector there wins. */
.bond-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--border);
  cursor: pointer;
  background: transparent;
  color: var(--text);
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.bond-action-btn:hover:not(:disabled) {
  background: var(--card-hover);
  border-color: var(--accent-dim);
}
.bond-action-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.bond-action-btn.resolve-btn {
  background: var(--accent);
  color: #0d0f14;
  border-color: var(--accent);
}
.bond-action-btn.resolve-btn:hover:not(:disabled) {
  background: #2de8a0;
  border-color: #2de8a0;
}
.sep-card-action-status { font-size: 11px; flex: 1; min-width: 0; }
.sep-card-action-status-info    { color: var(--text-muted); }
.sep-card-action-status-ok      { color: #6fe9a8; }
.sep-card-action-status-error   { color: #ff6b6b; word-break: break-word; }
.sep-card-action-status-pending { color: #ffd76a; }
.sep-card-action-status a       { color: var(--accent); }

/* ─── Bond escalation panel (bonds.js) ─── */

.bond-withdraw-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin: 16px 0;
  padding: 12px 16px;
  background: rgba(62, 255, 176, 0.08);
  border: 1px solid var(--accent-dim);
  border-radius: 10px;
  font-size: 13px;
  color: var(--text);
}
.bond-withdraw-banner strong { color: var(--accent); }

.bond-panel {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.bond-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}
.bond-panel-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 600;
}

.bond-state {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.bond-state-inactive   { background: rgba(140, 150, 170, 0.18); color: #a8b2c5; }
.bond-state-yes        { background: rgba(50, 200, 100, 0.20); color: #6fe9a8; }
.bond-state-no         { background: rgba(255, 92, 92, 0.18);  color: #ff8a8a; }
.bond-state-queued     { background: rgba(255, 200, 50, 0.20); color: #ffd76a; }
.bond-state-evaluating { background: rgba(120, 140, 255, 0.20); color: #9bb0ff; }
.bond-state-settled    { background: rgba(192, 132, 252, 0.20); color: #d6b9ff; }

.bond-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  font-size: 12px;
}
.bond-label { color: var(--text-muted); }
.bond-value { color: var(--text); text-align: right; }
.bond-value strong { color: var(--accent); font-weight: 700; }
.bond-value a { color: var(--text); text-decoration: none; }
.bond-value a:hover { color: var(--accent); text-decoration: underline; }

.bond-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 6px;
}
/* Tints layered on top of the existing .bond-action-btn base (defined above). */
.bond-action-btn.bond-action-yes {
  border-color: rgba(50, 200, 100, 0.4);
  color: #6fe9a8;
}
.bond-action-btn.bond-action-no {
  border-color: rgba(255, 92, 92, 0.4);
  color: #ff8a8a;
}
.bond-action-btn.bond-action-grad {
  border-color: var(--accent);
  color: var(--accent);
}

.bond-note {
  margin: 4px 0 0;
  font-size: 11px;
  color: var(--text-muted);
  font-style: italic;
}
.bond-safety {
  margin: 4px 0 0;
  padding: 4px 8px;
  font-size: 11px;
  color: #ffd76a;
  background: rgba(255, 200, 50, 0.08);
  border-radius: 4px;
}
.bond-status {
  margin: 6px 0 0;
  font-size: 11px;
  min-height: 14px;
}
.bond-status-info    { color: var(--text-muted); }
.bond-status-ok      { color: #6fe9a8; }
.bond-status-error   { color: #ff6b6b; word-break: break-word; }
.bond-status-pending { color: #ffd76a; }
.bond-status a       { color: var(--accent); }

/* Modal scaffolding (reserved — bonds.js currently uses window.prompt; classes are
   in place so a styled modal can be wired without CSS churn). */
.bond-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
}
.bond-modal {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  min-width: 320px;
  max-width: 480px;
}
.bond-modal h3 { margin-bottom: 8px; font-size: 16px; }
.bond-modal .bond-modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 16px;
}

/* ─── Futarchy instance picker (registry.js) ─── */

.instances-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.instance-active-header {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 13px;
  color: var(--text);
}
.instance-active-label {
  color: var(--text-muted);
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.08em;
}
.instance-active-symbol { color: var(--accent); font-weight: 600; }
.instance-active-sep { color: var(--text-dim); }
.instance-active-factory { color: var(--text-muted); font-size: 12px; }
.instance-active-loading { color: var(--text-dim); font-style: italic; }

.instances-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.instance-chip {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 14px 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
  font-family: var(--mono);
  color: var(--text);
  transition: border-color 0.2s, background 0.2s, transform 0.1s;
}
.instance-chip:hover {
  background: var(--card-hover);
  border-color: var(--accent-dim);
}
.instance-chip:active { transform: translateY(1px); }
.instance-chip-active {
  border-color: var(--accent);
  background: rgba(62, 255, 176, 0.06);
  box-shadow: 0 0 0 1px var(--accent-dim) inset;
}
.instance-chip-head {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  justify-content: space-between;
}
.instance-chip-symbol {
  font-weight: 700;
  color: var(--accent);
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.instance-chip-badge {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(255, 200, 50, 0.18);
  color: #ffd76a;
}
.instance-chip-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  word-break: break-word;
}
.instance-chip-sub {
  font-size: 11px;
  color: var(--text-muted);
}

/* ─── Create Futarchy modal ─── */

.modal-backdrop {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  z-index: 300;
  padding: 24px;
}
.modal-backdrop.open { display: flex; }

.modal-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
  max-width: 560px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.5);
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}
.modal-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}
.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
}
.modal-close:hover { color: var(--accent); background: var(--card-hover); }

.modal-subtitle {
  color: var(--text-muted);
  font-size: 12px;
  margin-bottom: 16px;
  line-height: 1.5;
}
.modal-subtitle code {
  background: rgba(62, 255, 176, 0.08);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 11px;
  color: var(--accent);
}

.modal-registry-note {
  margin: 0 0 16px;
  padding: 10px 12px;
  font-size: 12px;
  color: #ffd76a;
  background: rgba(255, 200, 50, 0.08);
  border: 1px solid rgba(255, 200, 50, 0.25);
  border-radius: 8px;
  line-height: 1.5;
}
.modal-registry-note code {
  background: rgba(255, 200, 50, 0.12);
  padding: 1px 5px;
  border-radius: 3px;
  color: #ffd76a;
}

.create-instance-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.form-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-weight: 600;
}

.form-label input,
.form-label textarea {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  padding: 10px 12px;
  font-size: 13px;
  font-family: inherit;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
}
.form-label textarea { resize: vertical; min-height: 56px; }
.form-label input:focus,
.form-label textarea:focus { outline: 1px solid var(--accent); border-color: var(--accent); }

.form-hint {
  font-size: 10px;
  color: var(--text-dim);
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 6px;
}

.create-instance-status {
  margin: 4px 0 0;
  font-size: 12px;
  min-height: 14px;
}
.create-instance-status-info    { color: var(--text-muted); }
.create-instance-status-ok      { color: #6fe9a8; }
.create-instance-status-error   { color: #ff6b6b; word-break: break-word; }
.create-instance-status-pending { color: #ffd76a; }
.create-instance-status a       { color: var(--accent); }
.create-instance-status code    {
  background: rgba(62, 255, 176, 0.08);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 11px;
  color: var(--accent);
}

@media (max-width: 720px) {
  .instances-toolbar { flex-direction: column; align-items: stretch; }
  .instances-toolbar .btn { width: 100%; justify-content: center; }
  .form-row { grid-template-columns: 1fr; }
}
.sale-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  display: grid;
  gap: 24px;
}
.sale-grid {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sale-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  gap: 12px;
}
.sale-row:last-child { border-bottom: none; }
.sale-label { color: var(--text-muted); }
.sale-value {
  font-weight: 600;
  text-align: right;
  word-break: break-all;
  color: var(--text);
}
.sale-value a { color: var(--accent); }
.sale-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.sale-input-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.sale-input-label {
  font-size: 12px;
  color: var(--text-muted);
}
.sale-form input {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font-family: var(--mono);
  font-size: 14px;
}
.sale-form input:focus {
  outline: none;
  border-color: var(--accent);
}
.sale-cost-line {
  font-size: 13px;
  color: var(--text-muted);
}
.sale-cost-line #sale-cost {
  color: var(--text);
  font-weight: 600;
  margin-left: 4px;
}
.sale-empty {
  font-size: 14px;
  color: var(--text-muted);
}
.sale-note {
  margin-top: 12px;
  font-size: 12px;
  color: var(--text-muted);
}
.sale-mono { font-family: var(--mono); font-size: 11px; color: var(--text-dim); }
