/* ============================================================
   web.agrabah — design system
   premium minimal · near-black canvas · hairlines · mint accent
   ============================================================ */

:root {
  --bg:        #0a0b0d;
  --bg-soft:   #0d0f13;
  --surface:   #121520;
  --surface-2: #171a26;
  --line:      rgba(255, 255, 255, 0.07);
  --line-2:    rgba(255, 255, 255, 0.13);

  --text:   #e9eaee;
  --text-2: #989ca8;
  --text-3: #5e616d;

  --accent:      #5fe3ad;
  --accent-ink:  #04130d;
  --accent-soft: rgba(95, 227, 173, 0.10);
  --accent-line: rgba(95, 227, 173, 0.35);

  --danger:      #f0746e;
  --danger-soft: rgba(240, 116, 110, 0.10);

  --radius:    16px;
  --radius-sm: 11px;
  --radius-xs: 8px;

  --font-ui:      'Hanken Grotesk', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-display: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --font-mono:    ui-monospace, 'SF Mono', 'JetBrains Mono', Menlo, Consolas, monospace;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  letter-spacing: 0.1px;
}

/* atmospheric depth — faint mint pool top-left, cold void bottom-right */
body.bg-atmos {
  background:
    radial-gradient(900px 600px at 8% -10%, rgba(95, 227, 173, 0.06), transparent 60%),
    radial-gradient(700px 500px at 100% 110%, rgba(80, 120, 255, 0.05), transparent 55%),
    var(--bg);
  background-attachment: fixed;
}

::selection { background: var(--accent-soft); color: var(--text); }

:focus-visible {
  outline: 2px solid var(--accent-line);
  outline-offset: 2px;
}

/* thin, quiet scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 99px; border: 3px solid transparent; background-clip: content-box; }

a { color: inherit; text-decoration: none; }

/* ---------- typography helpers ---------- */
.display { font-family: var(--font-display); font-weight: 400; letter-spacing: -0.01em; }
.mono { font-family: var(--font-mono); font-feature-settings: 'ss01'; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.eyebrow {
  font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--text-3); font-weight: 600;
}

/* brand wordmark */
.brand { display: inline-flex; align-items: center; gap: 9px; user-select: none; }
.brand .seal {
  width: 9px; height: 9px; border-radius: 99px; background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft), 0 0 14px var(--accent);
}
.brand .name { font-family: var(--font-display); font-size: 18px; letter-spacing: -0.01em; }
.brand .name b { font-weight: 600; }
.brand .tld { color: var(--text-3); }

/* ---------- buttons ---------- */
.btn {
  --bh: 40px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: var(--bh); padding: 0 16px;
  font: inherit; font-weight: 550; font-size: 14px; letter-spacing: 0.2px;
  color: var(--text); background: var(--surface-2);
  border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  cursor: pointer; white-space: nowrap;
  transition: background .18s var(--ease), border-color .18s var(--ease), transform .08s var(--ease), color .18s var(--ease);
}
.btn:hover { border-color: rgba(255,255,255,0.22); background: #1d2130; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn svg { width: 17px; height: 17px; }

.btn.primary {
  background: var(--accent); color: var(--accent-ink); border-color: transparent;
  box-shadow: 0 6px 20px -8px rgba(95,227,173,0.6);
}
.btn.primary:hover { background: #74ecbb; }

.btn.ghost { background: transparent; border-color: var(--line); color: var(--text-2); }
.btn.ghost:hover { color: var(--text); border-color: var(--line-2); background: rgba(255,255,255,0.03); }

.btn.danger { background: transparent; border-color: rgba(240,116,110,0.3); color: var(--danger); }
.btn.danger:hover { background: var(--danger-soft); border-color: rgba(240,116,110,0.5); }

.btn.sm { --bh: 32px; padding: 0 12px; font-size: 13px; }

/* square icon button */
.iconbtn {
  display: inline-grid; place-items: center;
  width: 38px; height: 38px; flex: 0 0 auto;
  color: var(--text-2); background: transparent;
  border: 1px solid transparent; border-radius: var(--radius-xs);
  cursor: pointer; transition: background .16s var(--ease), color .16s var(--ease);
}
.iconbtn:hover { background: rgba(255,255,255,0.05); color: var(--text); }
.iconbtn:active { transform: translateY(1px); }
.iconbtn svg { width: 18px; height: 18px; }
.iconbtn.sm { width: 32px; height: 32px; }
.iconbtn.danger:hover { color: var(--danger); background: var(--danger-soft); }

/* ---------- form controls ---------- */
.field { display: flex; flex-direction: column; gap: 7px; }
.label { font-size: 12px; font-weight: 600; letter-spacing: 0.04em; color: var(--text-2); }
.input, select.input {
  height: 44px; width: 100%; padding: 0 14px;
  font: inherit; font-size: 14.5px; color: var(--text);
  background: var(--bg-soft); border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  transition: border-color .16s var(--ease), box-shadow .16s var(--ease), background .16s var(--ease);
}
.input::placeholder { color: var(--text-3); }
.input:focus, select.input:focus {
  outline: none; border-color: var(--accent-line);
  box-shadow: 0 0 0 4px var(--accent-soft);
  background: var(--surface);
}
select.input { appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23989ca8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px;
}

/* ---------- surfaces ---------- */
.card {
  background: linear-gradient(180deg, var(--surface), var(--bg-soft));
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 1px 0 rgba(255,255,255,0.03) inset, 0 24px 60px -30px rgba(0,0,0,0.8);
}
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }

/* ---------- badges / dots / chips ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  height: 24px; padding: 0 9px; border-radius: 999px;
  font-size: 12px; font-weight: 600; letter-spacing: .02em;
  border: 1px solid var(--line-2); color: var(--text-2); background: rgba(255,255,255,0.02);
}
.badge .dot { width: 6px; height: 6px; border-radius: 99px; background: currentColor; }
.badge.on { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }
.badge.off { color: var(--text-3); }

.chip {
  display: inline-flex; align-items: center; gap: 8px;
  height: 30px; padding: 0 6px 0 12px; border-radius: 999px;
  background: var(--bg-soft); border: 1px solid var(--line-2);
  font-family: var(--font-mono); font-size: 12.5px; color: var(--text);
}

/* ---------- tables ---------- */
.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left; padding: 11px 14px; font-size: 11px; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-3);
  border-bottom: 1px solid var(--line);
}
.table td { padding: 13px 14px; border-bottom: 1px solid var(--line); font-size: 14px; vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .14s var(--ease); }
.table tbody tr:hover { background: rgba(255,255,255,0.02); }
.table .num { font-family: var(--font-mono); font-size: 13px; color: var(--text-2); }

/* ---------- top navigation ---------- */
.topnav {
  display: flex; align-items: center; gap: 18px;
  height: 64px; padding: 0 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(10,11,13,0.7); backdrop-filter: blur(14px);
  position: sticky; top: 0; z-index: 20;
}
.topnav .spacer { flex: 1; }
.navlink {
  display: inline-flex; align-items: center; gap: 7px;
  height: 34px; padding: 0 12px; border-radius: 999px;
  color: var(--text-2); font-size: 13.5px; font-weight: 550;
  border: 1px solid transparent; transition: all .16s var(--ease);
}
.navlink svg { width: 16px; height: 16px; }
.navlink:hover { color: var(--text); background: rgba(255,255,255,0.04); }
.navlink.active { color: var(--text); border-color: var(--line-2); background: var(--surface-2); }

/* ---------- proxy toolbar ---------- */
.toolbar {
  display: flex; align-items: center; gap: 6px;
  height: 56px; padding: 0 12px;
  border-bottom: 1px solid var(--line);
  background: rgba(10,11,13,0.82); backdrop-filter: blur(14px);
}
.toolbar .brand { margin: 0 8px 0 4px; }
.addrwrap {
  flex: 1; display: flex; align-items: center; gap: 9px;
  height: 40px; padding: 0 12px;
  background: var(--bg-soft); border: 1px solid var(--line-2); border-radius: 999px;
  transition: border-color .16s var(--ease), box-shadow .16s var(--ease);
  min-width: 0;
}
.addrwrap:focus-within { border-color: var(--accent-line); box-shadow: 0 0 0 4px var(--accent-soft); }
.addrwrap .lock { color: var(--accent); display: inline-grid; place-items: center; flex: 0 0 auto; }
.addrwrap .lock svg { width: 14px; height: 14px; }
.addrwrap input {
  flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; outline: none;
  color: var(--text); font-family: var(--font-mono); font-size: 13.5px; letter-spacing: 0;
}
.addrwrap input::placeholder { color: var(--text-3); font-family: var(--font-ui); }

/* ---------- layout helpers ---------- */
.wrap { max-width: 1080px; margin: 0 auto; padding: 34px 22px 80px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap-wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.section-title { display: flex; align-items: baseline; gap: 12px; margin: 38px 2px 14px; }
.section-title h2 { font-family: var(--font-display); font-weight: 500; font-size: 21px; margin: 0; letter-spacing: -0.01em; }
.section-title .count { font-family: var(--font-mono); font-size: 12px; color: var(--text-3); }

/* ---------- error / toast banner ---------- */
.banner {
  display: none; align-items: flex-start; gap: 10px;
  padding: 12px 14px; border-radius: var(--radius-sm);
  border: 1px solid rgba(240,116,110,0.35); background: var(--danger-soft);
  color: #ffd7d4; font-size: 13.5px; line-height: 1.45;
}
.banner.show { display: flex; }
.banner svg { width: 17px; height: 17px; flex: 0 0 auto; margin-top: 1px; color: var(--danger); }
.banner .mono { color: #ffb7b2; word-break: break-word; }

/* ---------- entrance animation ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.rise { animation: rise .55s var(--ease) both; }
@media (prefers-reduced-motion: reduce) { .rise { animation: none; } }
