/* Agent storefront */
:root {
    --bg: #f3f6fb;
    --card: #ffffff;
    --ink: #0f172a;
    --ink-2: #475569;
    --ink-3: #94a3b8;
    --line: #e2e8f0;
    --blue: #2563eb;
    --blue-2: #1d4ed8;
    --blue-soft: #eff4ff;
    --blue-line: #bfd3fb;
    --ok: #15803d;
    --warn: #a16207;
    --bad: #b91c1c;
    --font: "Plus Jakarta Sans", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
    --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 4px 14px rgba(15, 23, 42, .04);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; background: linear-gradient(180deg, #f8faff 0%, var(--bg) 340px); color: var(--ink); font: 15px/1.5 var(--font); }
[hidden] { display: none !important; }
a { color: inherit; }
button, input { font: inherit; color: inherit; }
svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* Top bar */
.topbar { position: sticky; top: 0; z-index: 20; background: rgba(255, 255, 255, .92); backdrop-filter: saturate(1.4) blur(8px);
          border-bottom: 1px solid var(--line); }
.topbar-in { max-width: 1040px; margin: 0 auto; padding: 12px 20px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { font-weight: 700; color: var(--blue); font-size: 17px; letter-spacing: -.01em; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pill-btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--blue-line); background: #fff;
            color: var(--blue); font-weight: 500; font-size: 14px; cursor: pointer; text-decoration: none; white-space: nowrap; }
.pill-btn:hover { background: var(--blue-soft); }

.page { max-width: 840px; margin: 0 auto; padding: 32px 20px 60px; }

/* Hero */
.hero { text-align: center; margin-bottom: 24px; }
.hero h1 { margin: 0; font-size: clamp(30px, 6vw, 44px); line-height: 1.1; font-weight: 800; letter-spacing: -.03em; overflow-wrap: anywhere; }
.hero p { margin: 10px 0 0; color: var(--ink-2); font-size: 16px; }
.hero .chat { display: inline-flex; align-items: center; gap: 6px; margin-top: 12px; color: #15803d; font-weight: 600; font-size: 14px; text-decoration: none; }
.hero .chat:hover { text-decoration: underline; }

/* Agent card */
.agent { display: flex; align-items: center; justify-content: space-between; gap: 16px; background: var(--card); border: 1px solid var(--line);
         border-radius: 14px; padding: 16px 18px; box-shadow: var(--shadow); margin-bottom: 26px; }
.agent b { display: block; font-size: 16px; }
.agent span { color: var(--ink-2); font-size: 14px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 0; border-radius: 10px; background: var(--blue); color: #fff;
       padding: 11px 18px; font-weight: 600; font-size: 14.5px; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--blue-2); }
.btn:disabled { opacity: .6; cursor: progress; }
.btn.block { width: 100%; padding: 13px; font-size: 15.5px; }
.btn.ghost { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.btn.ghost:hover { background: #f8fafc; }

/* Section labels */
.label { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.label::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.count { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; background: var(--blue-soft); border: 1px solid var(--blue-line);
         color: var(--blue); font-size: 11.5px; letter-spacing: .03em; }

/* Networks */
.networks { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 28px; }
.net { position: relative; display: grid; justify-items: center; gap: 8px; padding: 16px 8px 14px; background: var(--card); border: 1px solid var(--line);
       border-radius: 14px; cursor: pointer; font-weight: 500; color: var(--ink-2); }
.net img { width: 40px; height: 40px; border-radius: 10px; object-fit: cover; box-shadow: 0 0 0 1px var(--line); }
.net:hover { border-color: var(--blue-line); }
.net[aria-selected="true"] { background: var(--blue-soft); border-color: var(--blue-line); color: var(--blue); font-weight: 600; }
.net[aria-selected="true"]::after { content: ""; position: absolute; left: 32%; right: 32%; bottom: -1px; height: 3px; border-radius: 3px; background: var(--blue); }
@media (max-width: 560px) { .networks { grid-template-columns: repeat(2, 1fr); } }

/* Bundles */
.bundles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.bundle { display: grid; justify-items: center; gap: 2px; padding: 22px 10px 20px; background: var(--card); border: 1px solid var(--line); border-radius: 14px;
          cursor: pointer; box-shadow: var(--shadow); transition: border-color .15s, transform .15s; }
.bundle:hover { border-color: var(--blue-line); transform: translateY(-1px); }
.bundle .size { font-size: 24px; font-weight: 800; letter-spacing: -.02em; color: var(--ink); }
.bundle .price { font-size: 19px; font-weight: 700; color: var(--blue); font-variant-numeric: tabular-nums; }
.empty { grid-column: 1 / -1; padding: 22px; text-align: center; color: var(--ink-2); background: var(--card); border: 1px solid var(--line); border-radius: 14px; }
.net:focus-visible, .bundle:focus-visible, .btn:focus-visible, .pill-btn:focus-visible { outline: 3px solid rgba(37, 99, 235, .3); outline-offset: 2px; }

.notice { margin: 0 0 20px; padding: 14px 16px; border-radius: 12px; background: #fff8e6; border: 1px solid #f5e1a4; color: #7a5200; text-align: center; }

/* Footer */
.foot { margin-top: 40px; padding: 22px 16px; border-top: 1px solid var(--line); text-align: center; color: var(--ink-3); font-size: 13px; }

/* Modal */
.modal-bg { position: fixed; inset: 0; background: rgba(15, 23, 42, .45); z-index: 40; display: grid; place-items: center; padding: 16px; }
.modal { width: 100%; max-width: 420px; background: #fff; border-radius: 18px; padding: 22px; box-shadow: 0 20px 50px rgba(15, 23, 42, .25); max-height: calc(100vh - 32px); overflow-y: auto; }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 16px; }
.modal-head h2 { margin: 0; font-size: 19px; font-weight: 700; letter-spacing: -.01em; }
.modal-head p { margin: 3px 0 0; color: var(--ink-2); font-size: 14px; }
.x { border: 0; background: #f1f5f9; width: 32px; height: 32px; border-radius: 50%; cursor: pointer; display: grid; place-items: center; flex: none; color: var(--ink-2); }
.x:hover { background: #e2e8f0; }
@media (max-width: 560px) {
    .modal-bg { place-items: end center; padding: 0; }
    .modal { max-width: none; border-radius: 18px 18px 0 0; padding-bottom: calc(22px + env(safe-area-inset-bottom)); }
}
.summary { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 12px; background: var(--blue-soft); margin-bottom: 16px; }
.summary img { width: 36px; height: 36px; border-radius: 9px; object-fit: cover; }
.summary div { flex: 1; }
.summary b { display: block; }
.summary small { color: var(--ink-2); }
.summary .amt { font-size: 18px; font-weight: 800; color: var(--blue); font-variant-numeric: tabular-nums; }
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field span { font-size: 13.5px; font-weight: 600; }
.field em { font-style: normal; font-weight: 400; color: var(--ink-3); }
.field input { width: 100%; padding: 12px 13px; border-radius: 10px; border: 1px solid #cbd5e1; background: #fff; font-size: 16px; }
.field input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37, 99, 235, .15); }
.field small { color: var(--ink-3); font-size: 12.5px; min-height: 1em; }
.field small.warn { color: var(--warn); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.error { padding: 10px 12px; border-radius: 10px; background: #fef2f2; color: var(--bad); font-size: 14px; margin-bottom: 12px; }
.success { padding: 12px 14px; border-radius: 10px; background: #f0fdf4; color: var(--ok); font-size: 14.5px; margin-bottom: 12px; }
.fine { margin: 12px 0 0; text-align: center; color: var(--ink-3); font-size: 12.5px; }

/* Domain home and not found */
.missing, .home { text-align: center; padding: 50px 0 10px; }
.missing h1, .home h1 { margin: 0 0 10px; font-size: 28px; font-weight: 800; letter-spacing: -.02em; }
.missing p, .home p { margin: 0 auto; color: var(--ink-2); max-width: 440px; }

/* Order status */
.checking { margin: 50px 0 0; text-align: center; color: var(--ink-2); }
.receipt { max-width: 480px; margin: 0 auto; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 22px; box-shadow: var(--shadow); }
.state { display: flex; align-items: center; gap: 9px; font-size: 20px; font-weight: 800; letter-spacing: -.01em; margin-bottom: 14px; }
.state::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--ink-3); flex: none; }
.state.completed::before { background: var(--ok); }
.state.paid::before, .state.processing::before, .state.pending::before { background: #d97706; }
.state.failed::before, .state.cancelled::before { background: var(--bad); }
.receipt dl { margin: 0; }
.receipt dl div { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); }
.receipt dt { color: var(--ink-2); }
.receipt dd { margin: 0; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.help { color: var(--ink-2); font-size: 14px; margin: 14px 0 16px; }
.receipt .actions { display: grid; gap: 8px; }
.track-form div { display: flex; gap: 8px; }
.track-form input { flex: 1; min-width: 0; padding: 11px 13px; border-radius: 10px; border: 1px solid #cbd5e1; text-transform: uppercase; font-size: 16px; }
.track-form input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37, 99, 235, .15); }
