/* ===================== ROOT / RESET ===================== */
@import url('https://fonts.googleapis.com/css2?family=Hind+Siliguri:wght@400;500;600;700&family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --primary: #5b4fe0;
  --primary-dark: #4638c9;
  --primary-light: #eeecfd;
  --accent: #12b8a6;
  --success: #10b981;
  --danger: #ef4444;
  --danger-dark: #dc2626;
  --warning: #ea9a3e;
  --text: #1c1b2e;
  --text-muted: #6b6a85;
  --border: #e5e3f1;
  --bg: #f6f5fb;
  --card-bg: #ffffff;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(28,27,46,0.04), 0 8px 24px rgba(43,38,90,0.06);
  --shadow-lg: 0 20px 60px rgba(30,25,70,0.18);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Hind Siliguri', 'Inter', system-ui, -apple-system, Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d3d1e8; border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: #b9b6d9; }

h1, h2, h3 { margin: 0 0 8px; font-weight: 700; letter-spacing: -0.01em; }
h2 { font-size: 1.28rem; }
h3 { font-size: 1rem; color: var(--text); }
p { line-height: 1.65; }
.muted { color: var(--text-muted); }
.small { font-size: 0.85rem; }
.hidden { display: none !important; }

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }

/* ===================== TOPBAR ===================== */
.topbar {
  background: linear-gradient(120deg, #4d3fe6 0%, #6a4fe0 55%, #8b5cf6 100%);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 4px 20px rgba(77,63,230,0.28);
}
.topbar-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 15px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.brand { font-weight: 800; font-size: 1.12rem; letter-spacing: -0.01em; }
.nav-links { display: flex; gap: 6px; }
.nav-links a {
  color: rgba(255,255,255,0.82);
  padding: 8px 14px;
  border-radius: 9px;
  font-weight: 600;
  font-size: 0.92rem;
  transition: background 0.15s, color 0.15s;
}
.nav-links a.active, .nav-links a:hover { background: rgba(255,255,255,0.18); color: #fff; }

/* ===================== PUBLIC WORKSPACE / BILLING ===================== */
.public-topbar-meta {
  color: rgba(255,255,255,0.82);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 5px;
  border-radius: 50%;
  background: #7ff2c1;
  box-shadow: 0 0 0 4px rgba(127,242,193,.16);
}
.public-hero {
  max-width: 900px;
  margin: 22px auto 0;
  padding: 28px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: #fff;
  border-radius: 24px;
  background:
    radial-gradient(circle at 92% 12%, rgba(255,255,255,.25), transparent 30%),
    linear-gradient(135deg, #21195f 0%, #5545d8 54%, #a24edb 100%);
  box-shadow: 0 20px 46px rgba(58,44,167,.25);
}
.public-hero h1 { font-size: clamp(1.5rem, 3vw, 2.2rem); margin: 6px 0 4px; }
.public-hero p { margin: 0; color: rgba(255,255,255,.76); font-size: .94rem; }
.eyebrow {
  display: inline-block;
  color: #7467ef;
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .12em;
}
.public-hero .eyebrow { color: #b9b0ff; }
.balance-card {
  min-width: 168px;
  padding: 15px 16px;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 16px;
  background: rgba(255,255,255,.12);
  backdrop-filter: blur(12px);
}
.balance-label { display: block; color: rgba(255,255,255,.68); font-size: .66rem; font-weight: 800; letter-spacing: .1em; }
.balance-card strong { display: block; margin: 4px 0 2px; font-size: 1.55rem; }
.balance-card small { color: rgba(255,255,255,.7); }
.request-card { border-color: rgba(91,79,224,.22); }
.admin-billing-card { background: linear-gradient(145deg, #fff, #f8f7ff); }
.admin-chip {
  padding: 5px 9px;
  border-radius: 999px;
  color: #4d3fe6;
  background: #eeecfd;
  font-size: .66rem;
  font-weight: 800;
  letter-spacing: .08em;
}
.billing-grid { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr) auto; gap: 12px; align-items: end; }
.billing-action { display: flex; flex-direction: column; gap: 6px; }
.input-with-suffix { display: flex; align-items: center; gap: 8px; }
.input-with-suffix input { flex: 1; }
.input-with-suffix span { color: var(--text-muted); font-size: .82rem; font-weight: 700; }
.balance-divider { margin: 22px 0 18px; border-top: 1px solid var(--border); }
.local-balance-list { display: grid; gap: 7px; margin-top: 13px; }
.local-balance-list > div { display: flex; justify-content: space-between; padding: 9px 12px; border: 1px solid var(--border); border-radius: 10px; background: #fff; }

/* ===================== LAYOUT ===================== */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 22px 16px 60px;
}

.card {
  position: relative;
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  margin-bottom: 18px;
  border: 1px solid var(--border);
  overflow: hidden;
}
.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  opacity: 0.85;
}

.card-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}
.card-header-row h2 { margin: 0; }

/* ===================== FORM ELEMENTS ===================== */
label { display: block; font-weight: 600; font-size: 0.88rem; margin: 14px 0 6px; color: var(--text); }
label.inline-label { margin-top: 10px; }

input[type="text"], input[type="url"], input[type="password"],
input[type="number"], textarea, select {
  width: 100%;
  padding: 11px 13px;
  border: 1.5px solid var(--border);
  border-radius: 11px;
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--text);
  background: #fdfdff;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(91,79,224,0.14);
}
textarea { resize: vertical; min-height: 90px; }
code {
  background: #f1effa;
  color: #4638c9;
  padding: 2px 6px;
  border-radius: 5px;
  font-size: 0.85em;
}

/* ===================== BUTTONS ===================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 18px;
  border-radius: 11px;
  border: none;
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  transition: transform 0.08s, box-shadow 0.15s, background 0.15s, filter 0.15s;
  font-family: inherit;
}
.btn:active { transform: scale(0.97); }
.btn:focus-visible { outline: 2px solid var(--primary-dark); outline-offset: 2px; }
.btn-primary {
  background: linear-gradient(135deg, var(--primary), #7a5cf0);
  color: #fff;
  box-shadow: 0 6px 16px rgba(91,79,224,0.35);
}
.btn-primary:hover { filter: brightness(1.05); box-shadow: 0 8px 20px rgba(91,79,224,0.42); }
.btn-danger { background: #fef2f2; color: var(--danger-dark); border: 1.5px solid #fecaca; }
.btn-danger:hover { background: var(--danger-dark); color: #fff; }
.btn-ghost { background: transparent; color: var(--text-muted); border: 1.5px solid var(--border); }
.btn-ghost:hover { background: var(--bg); border-color: #cfccec; }
.btn-sm { padding: 7px 12px; font-size: 0.82rem; }
.btn-lg { padding: 15px; font-size: 1.02rem; }
.btn-block { width: 100%; }

/* ===================== AUTH PAGE ===================== */
.auth-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 20% 20%, #7a5cf0 0%, transparent 55%), linear-gradient(135deg, #4d3fe6 0%, #8b5cf6 100%);
  padding: 20px;
}
.auth-card {
  background: #fff;
  border-radius: 20px;
  padding: 38px 32px;
  width: 100%;
  max-width: 380px;
  text-align: center;
  box-shadow: var(--shadow-lg);
}
.auth-logo { font-size: 2.5rem; margin-bottom: 6px; }
.auth-form { text-align: left; margin-top: 16px; }
.alert { padding: 10px 14px; border-radius: 10px; font-size: 0.88rem; margin-top: 12px; text-align: left; }
.alert-error { background: #fef2f2; color: var(--danger-dark); border: 1px solid #fecaca; }

/* ===================== SITE CHECKLIST (index.php) ===================== */
.site-checklist { display: flex; flex-direction: column; gap: 8px; }
.site-check-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: 11px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.site-check-item:hover { border-color: var(--primary); background: var(--primary-light); }
.site-check-item input { width: auto; flex-shrink: 0; accent-color: var(--primary); }
.site-check-name { font-weight: 600; }
.site-check-url { color: var(--text-muted); font-size: 0.8rem; margin-left: auto; word-break: break-all; text-align: right; }

.empty-state { text-align: center; padding: 24px 10px; }
.empty-state p { margin-bottom: 14px; }

/* ===================== RESULTS ===================== */
.result-item {
  border: 1.5px solid var(--border);
  border-radius: 13px;
  padding: 14px 16px;
  margin-bottom: 10px;
}
.result-item.result-success { border-color: #a7f3d0; background: #f0fdf9; }
.result-item.result-fail { border-color: #fecaca; background: #fef7f7; }
.result-head { display: flex; align-items: center; gap: 10px; font-weight: 700; cursor: pointer; }
.result-badge { font-size: 1.1rem; }
.result-name { flex: 1; }
.result-time { color: var(--text-muted); font-weight: 500; font-size: 0.8rem; }
.result-detail { margin-top: 10px; font-size: 0.85rem; display: none; }
.result-detail.open { display: block; }
.result-step-row { padding: 5px 0; border-bottom: 1px dashed var(--border); display: flex; gap: 8px; }
.result-step-row:last-child { border-bottom: none; }
.result-error-msg { color: var(--danger-dark); margin-top: 6px; font-weight: 600; }

/* ===================== ADMIN: SITE MANAGE LIST ===================== */
.site-manage-list { display: flex; flex-direction: column; gap: 8px; }
.site-manage-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 13px 14px;
  border: 1.5px solid var(--border);
  border-radius: 11px;
  flex-wrap: wrap;
  transition: border-color 0.15s;
}
.site-manage-item:hover { border-color: #cfccec; }
.site-manage-actions { display: flex; gap: 6px; flex-shrink: 0; }

/* ===================== MODE TABS ===================== */
.mode-tabs { display: flex; gap: 8px; margin: 16px 0 10px; }
.mode-tab-btn {
  flex: 1;
  padding: 10px;
  border: 1.5px solid var(--border);
  background: #fff;
  border-radius: 11px;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  color: var(--text-muted);
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.mode-tab-btn.active { border-color: var(--primary); background: var(--primary-light); color: var(--primary-dark); }

/* ===================== LIVE RECORDER ===================== */
.recorder-stage { margin-top: 14px; }
.recorder-frame-wrap {
  position: relative;
  border: 2px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: #14122b;
  max-width: 100%;
}
.recorder-frame-wrap img {
  width: 100%;
  display: block;
  cursor: crosshair;
  user-select: none;
}
.recorder-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #cbd5e1;
  font-size: 0.9rem;
  background: rgba(20,18,43,0.45);
}
.recorder-loading.hidden-flag { display: none; }

/* ===================== রান-প্রোগ্রেস (ম্যানুয়াল/ম্যাচ রান লোডিং) ===================== */
.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 3px solid rgba(255,255,255,0.25);
  border-top-color: #fff;
  border-radius: 50%;
  animation: ac-spin 0.8s linear infinite;
  flex-shrink: 0;
}
@keyframes ac-spin {
  to { transform: rotate(360deg); }
}
.run-progress-box {
  padding: 14px 16px;
  border-radius: 10px;
  background: var(--primary-light);
  border: 1px solid var(--primary);
}
.run-progress-head {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  color: var(--primary-dark);
}
.run-progress-head .spinner {
  border-color: var(--primary-light);
  border-top-color: var(--primary);
}
.run-progress-list {
  margin: 10px 0 0;
  padding-left: 18px;
  font-size: 0.9rem;
  color: var(--text-muted);
}
.run-progress-list li { margin-bottom: 4px; }

/* ===================== DIAGNOSTICS BOX (এরর ডিটেইলস) ===================== */
.diag-box {
  margin-top: 10px;
  background: #14122b;
  color: #e2e0f5;
  border-radius: 11px;
  padding: 12px 14px;
  font-size: 0.78rem;
}
.diag-box pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: 'Courier New', monospace;
}

/* ===================== QUICK FIND ===================== */
.qf-box {
  margin-top: 18px;
  padding: 14px;
  border: 1.5px dashed #d3d1e8;
  border-radius: 13px;
  background: #faf9ff;
}
.qf-box h3 { margin-bottom: 4px; }

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.8rem;
  line-height: 1.35;
  padding: 8px 10px;
  background: #fff8ee;
  border: 1px solid #ffe1b8;
  border-radius: 9px;
  cursor: pointer;
  margin: 4px 0;
}
.checkbox-label input { width: 16px; height: 16px; flex-shrink: 0; margin-top: 2px; accent-color: var(--warning); }

/* ===================== SCHEDULE (index.php) ===================== */
.schedule-info-box {
  margin-top: 14px;
  padding: 13px 15px;
  background: #f8f7fd;
  border: 1px solid var(--border);
  border-radius: 11px;
  font-size: 0.85rem;
}
.schedule-info-box p { margin: 4px 0; }
.cron-warning {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
  padding: 8px 10px;
  border-radius: 9px;
  font-size: 0.82rem;
  font-weight: 600;
}

.cron-setup-details {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
}
.cron-setup-details summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--primary-dark);
}
.cron-cmd {
  background: #14122b;
  color: #7dd3fc;
  padding: 10px 12px;
  border-radius: 9px;
  font-size: 0.78rem;
  overflow-x: auto;
  margin: 8px 0;
}

.cron-url-box {
  display: flex;
  gap: 6px;
  margin: 8px 0;
}
.cron-url-box input {
  flex: 1;
  min-width: 0;
  background: #14122b;
  color: #7dd3fc;
  padding: 8px 10px;
  border-radius: 9px;
  border: none;
  font-size: 0.76rem;
}

.cron-log-list { margin-top: 8px; display: flex; flex-direction: column; gap: 4px; }
.cron-log-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  padding: 4px 0;
  border-bottom: 1px solid var(--border);
}

/* ===================== MULTI-SCHEDULE (index.php) ===================== */
.schedule-form-box {
  margin-top: 12px;
  padding: 14px;
  background: #f8f7fd;
  border: 1.5px solid var(--border);
  border-radius: 12px;
}
.schedule-form-actions { display: flex; gap: 8px; margin-top: 10px; }
.schedule-form-actions .btn-block { flex: 1; }

.schedule-list { display: flex; flex-direction: column; gap: 12px; margin-top: 10px; }
.schedule-item {
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  background: #fff;
}
.schedule-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}
.mini-toggle { display: flex; align-items: center; gap: 6px; font-size: 0.78rem; cursor: pointer; user-select: none; }
.mini-toggle input { width: 15px; height: 15px; accent-color: var(--success, #16a34a); cursor: pointer; }
.schedule-status-line { margin-top: 6px; font-size: 0.82rem; }
.schedule-item-actions { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }

.schedule-log-box {
  margin-top: 10px;
  padding: 10px 12px;
  background: #f8f7fd;
  border-radius: 9px;
  font-size: 0.78rem;
  max-height: 320px;
  overflow-y: auto;
}
.sched-log-entry { padding: 6px 0; border-bottom: 1px dashed var(--border); }
.sched-log-entry:last-child { border-bottom: none; }
.sched-log-head { margin-bottom: 3px; }
.sched-log-entry.fail .sched-log-head { color: var(--danger-dark); }
.sched-log-site { font-weight: 600; margin-top: 4px; }
.sched-log-step { color: #555; margin-top: 1px; }

/* ===================== LIVE RUN (index.php) ===================== */
.live-toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding: 11px 13px;
  border-radius: 11px;
  background: #fff4f4;
  border: 1px solid #ffd2d2;
  font-size: 0.88rem;
  cursor: pointer;
  transition: border-color 0.15s;
}
.live-toggle-row:hover { border-color: #ffb3b3; }
.live-toggle-row input { width: 18px; height: 18px; flex-shrink: 0; accent-color: var(--danger); }

.live-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin: 16px 0;
}
@media (min-width: 640px) {
  .live-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 980px) {
  .live-grid { grid-template-columns: repeat(3, 1fr); }
}

.live-card {
  background: var(--card-bg, #fff);
  border: 1.5px solid var(--border);
  border-radius: 15px;
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow .15s ease, transform .15s ease, border-color .15s ease;
}
.live-card:hover { box-shadow: 0 10px 26px rgba(43,38,90,0.14); transform: translateY(-2px); border-color: #cfccec; }

.live-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  font-size: 0.85rem;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
}
.live-card-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live-card-status { font-weight: 500; font-size: 0.78rem; white-space: nowrap; }

.live-card-frame-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1366 / 900;
  background: #14122b;
  overflow: hidden;
}
.live-card-frame-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.live-card-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #cbd5e1;
  font-size: 0.8rem;
  background: #14122b;
}

.live-card-steps {
  max-height: 110px;
  overflow-y: auto;
  padding: 8px 12px;
  font-size: 0.76rem;
  background: #faf9ff;
}
.live-step-row { display: flex; gap: 6px; align-items: flex-start; padding: 2px 0; }

.live-card-hint {
  text-align: center;
  font-size: 0.72rem;
  color: var(--text-muted);
  padding: 4px 0 8px;
}

/* enlarged full-view overlay */
.live-enlarge-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(12, 10, 26, 0.94);
  display: flex;
  flex-direction: column;
}
.live-enlarge-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
}
.live-enlarge-controls { display: flex; gap: 10px; }
.live-enlarge-controls button {
  background: rgba(255,255,255,0.12);
  border: none;
  color: #fff;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.15s;
}
.live-enlarge-controls button:hover { background: rgba(255,255,255,0.2); }
.live-enlarge-controls button:active { background: rgba(255,255,255,0.28); }

.live-enlarge-frame-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 0 8px 16px;
}
.live-enlarge-frame-wrap img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 9px;
}

/* ===================== MANUAL STEP FORM ===================== */
.manual-step-form { display: flex; flex-direction: column; }

/* ===================== STEPS LIST ===================== */
.steps-section { margin-top: 20px; }
.steps-list { display: flex; flex-direction: column; gap: 8px; }
.step-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: 11px;
  background: #faf9ff;
  transition: border-color 0.15s;
}
.step-row:hover { border-color: #cfccec; }
.step-index {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #7a5cf0);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.78rem; font-weight: 700;
  flex-shrink: 0;
}
.step-body { flex: 1; min-width: 0; }
.step-title { font-weight: 700; font-size: 0.88rem; }
.step-sub { color: var(--text-muted); font-size: 0.78rem; word-break: break-all; }
.step-actions { display: flex; gap: 4px; flex-shrink: 0; }
.step-actions button {
  background: transparent; border: none; cursor: pointer; font-size: 1rem; padding: 4px 6px; border-radius: 7px;
  transition: background 0.15s;
}
.step-actions button:hover { background: var(--bg); }

/* ===================== ELEMENT INFO / MODAL ===================== */
.element-info-box {
  background: #f1effa;
  border-radius: 11px;
  padding: 12px;
  font-size: 0.82rem;
  font-family: 'Courier New', monospace;
  word-break: break-all;
  margin-bottom: 10px;
}
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20,18,43,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 16px;
}
.modal-box {
  background: #fff;
  border-radius: 18px;
  padding: 24px;
  max-width: 420px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
.modal-actions { display: flex; gap: 10px; margin-top: 18px; }
.modal-actions .btn { flex: 1; }

/* ===================== RESPONSIVE ===================== */
@media (max-width: 640px) {
  .topbar-inner { padding: 12px 14px; }
  .nav-links a { padding: 7px 10px; font-size: 0.85rem; }
  .container { padding: 14px 10px 50px; }
  .card { padding: 17px; border-radius: 13px; }
  .site-check-url { display: none; }
  .mode-tab-btn { font-size: 0.78rem; padding: 9px 4px; }
  .public-hero { margin: 14px 10px 0; padding: 22px 18px; align-items: flex-start; flex-direction: column; }
  .balance-card { width: 100%; }
  .billing-grid { grid-template-columns: 1fr; }
}
