/* ==========================================================================
   SecureShield — app.css  (v2)
   DESIGN ONLY. Every selector matches classes already emitted by the PHP:
   _layout.php · dashboard.php · domains.php · domain_edit.php · visits.php
   temp_visits.php · ip_rules.php · account.php · home.php · login.php
   register.php  —  no markup, class name, or behaviour is assumed changed.

   Brand accent: #2bff00 (logo, primary actions, focus, active tab)
   Layout: real desktop layout >=821px · compact mini-app shell <=820px
   ========================================================================== */

:root {
  /* surfaces */
  --bg:          #060b12;
  --bg-2:        #0a1119;
  --card:        #0f1720;
  --card-2:      #0c131b;
  --raised:      #16202b;
  --raised-h:    #1d2937;

  /* lines */
  --border:      rgba(148, 173, 160, .16);
  --border-2:    rgba(148, 173, 160, .08);

  /* text */
  --text:        #e8f1ea;
  --muted:       #93a6a0;
  --muted-2:     #6f827d;

  /* brand — _layout.php / home.php / login.php inline the logo as
     stroke="var(--accent)", so --accent IS the official brand green */
  --accent:      #2bff00;
  --accent-deep: #1fd000;
  --accent-ink:  #062100;          /* text on top of green fills */
  --accent-soft: rgba(43, 255, 0, .12);
  --accent-line: rgba(43, 255, 0, .34);

  /* status colours (kept distinct from the brand green) */
  --ok:          #2ee6a8;
  --ok-soft:     rgba(46, 230, 168, .13);
  --warn:        #ffb340;
  --warn-soft:   rgba(255, 179, 64, .13);
  --danger:      #ff6b6b;
  --danger-soft: rgba(255, 107, 107, .13);
  --violet:      #a78bfa;
  --violet-soft: rgba(167, 139, 250, .13);
  --cyan:        #38bdf8;
  --cyan-soft:   rgba(56, 189, 248, .13);

  /* type (--mono is referenced inline by domain_edit.php textarea) */
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;

  --r:   14px;   /* cards */
  --r-s: 10px;   /* controls */
  --shell: 1180px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background:
    radial-gradient(820px 420px at 10% -10%, rgba(43, 255, 0, .09),  transparent 62%),
    radial-gradient(720px 400px at 94% 0%,   rgba(56, 189, 248, .07), transparent 62%),
    var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 13.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

::selection { background: rgba(43, 255, 0, .22); }

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

* { scrollbar-width: thin; scrollbar-color: rgba(148, 173, 160, .3) transparent; }
*::-webkit-scrollbar { width: 7px; height: 7px; }
*::-webkit-scrollbar-thumb { background: rgba(148, 173, 160, .26); border-radius: 99px; }
*::-webkit-scrollbar-thumb:hover { background: rgba(148, 173, 160, .4); }
*::-webkit-scrollbar-track { background: transparent; }

/* ==========================================================================
   1. TOP BAR  (_layout.php)
   ========================================================================== */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 14px;
  height: 54px;
  padding: 0 max(16px, calc((100% - var(--shell)) / 2));
  background: rgba(6, 11, 18, .84);
  backdrop-filter: saturate(150%) blur(14px);
  -webkit-backdrop-filter: saturate(150%) blur(14px);
  border-bottom: 1px solid var(--border);
}

.brand { display: inline-flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.brand svg { width: 32px; height: 32px; flex: 0 0 auto; filter: drop-shadow(0 0 8px rgba(43, 255, 0, .35)); }
.brand-text { font-size: 14px; font-weight: 800; letter-spacing: -.015em; }

.nav { display: flex; align-items: center; gap: 3px; }
.nav a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 33px;
  padding: 0 11px;
  border-radius: var(--r-s);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  transition: background .15s, color .15s;
}
.nav a svg { width: 15px; height: 15px; opacity: .9; }
.nav a:hover { color: var(--text); background: rgba(255, 255, 255, .045); }

/* current section keeps its own colour */
.nav a.on                  { color: var(--accent); background: var(--accent-soft); }
.nav a[href*="domains"].on { color: var(--ok);     background: var(--ok-soft); }
.nav a[href*="account"].on { color: var(--violet); background: var(--violet-soft); }
.nav a[href*="/admin/"].on { color: var(--warn);   background: var(--warn-soft); }

.spacer { flex: 1 1 auto; }

.userchip { display: inline-flex; align-items: center; gap: 9px; min-width: 0; }
.userchip-email {
  max-width: 210px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
}

/* bottom tab bar exists in the markup but is a phone-only element */
.bottomnav { display: none; }

/* ==========================================================================
   2. PAGE SHELL + TYPOGRAPHY
   ========================================================================== */

.wrap {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 20px 16px 40px;
}

h1.page {
  margin: 0 0 4px;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -.025em;
}
.sub {
  margin: 0 0 16px;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--muted);
}
.dim  { color: var(--muted); }
.mono { font-family: var(--mono); font-size: 12px; }

/* flash ------------------------------------------------------------------- */
.flash {
  display: flex;
  gap: 8px;
  margin: 0 0 14px;
  padding: 11px 13px;
  border: 1px solid var(--ok-soft);
  border-left: 3px solid var(--ok);
  border-radius: var(--r-s);
  background: linear-gradient(90deg, var(--ok-soft), transparent 88%);
  font-size: 12.5px;
  line-height: 1.55;
}
.flash.err {
  border-color: var(--danger-soft);
  border-left-color: var(--danger);
  background: linear-gradient(90deg, var(--danger-soft), transparent 88%);
  color: #ffdcdc;
}
.flash.warn {
  border-color: var(--warn-soft);
  border-left-color: var(--warn);
  background: linear-gradient(90deg, var(--warn-soft), transparent 88%);
}
.flash.info {
  border-color: var(--accent-soft);
  border-left-color: var(--accent);
  background: linear-gradient(90deg, var(--accent-soft), transparent 88%);
}

/* ==========================================================================
   3. GRID + CARDS
   ========================================================================== */

.grid { display: grid; gap: 13px; }
.grid.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.card {
  margin-bottom: 13px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: linear-gradient(180deg, var(--card), var(--card-2));
  box-shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 10px 30px -22px #000;
  min-width: 0;
}
.grid .card { margin-bottom: 0; }

.card h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 13px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--muted);
}
.card h2::before {                     /* small brand tick before card titles */
  content: "";
  width: 3px;
  height: 13px;
  border-radius: 99px;
  background: var(--accent);
  box-shadow: 0 0 8px rgba(43, 255, 0, .5);
  flex: 0 0 auto;
}
.card > .sub { margin-top: -6px; }

form { margin: 0; }

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

.empty {
  padding: 26px 16px;
  border: 1px dashed var(--border);
  border-radius: var(--r-s);
  background: rgba(255, 255, 255, .015);
  text-align: center;
  font-size: 12.5px;
  color: var(--muted);
}
.empty p { margin: 0 0 12px; }

.hint {
  margin-top: 5px;
  font-size: 11px;
  line-height: 1.6;
  color: var(--muted-2);
}
.hint .mono, .sub .mono { font-size: 11px; color: var(--muted); }

/* ==========================================================================
   4. STAT TILES  (dashboard .grid.c4 > .stat)  — app-style KPI tiles
   ========================================================================== */

.stat {
  position: relative;
  overflow: hidden;
  padding: 14px 15px 15px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background:
    radial-gradient(150px 90px at 100% 0%, rgba(255, 255, 255, .05), transparent 70%),
    linear-gradient(180deg, var(--card), var(--card-2));
  transition: transform .16s, border-color .16s, box-shadow .16s;
}

/* icon badge, top-right — one glyph per metric, drawn in CSS only */
.stat::before {
  content: "";
  position: absolute;
  top: 13px;
  right: 13px;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background-color: rgba(255, 255, 255, .04);
  background-repeat: no-repeat;
  background-position: center;
  background-size: 16px 16px;
}

/* thin colour rail along the bottom edge */
.stat::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), transparent 78%);
  opacity: .75;
}

.stat .k {
  display: block;
  padding-right: 38px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}
.stat .v {
  display: block;
  margin-top: 6px;
  font-size: 27px;
  font-weight: 800;
  letter-spacing: -.035em;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}

/* Allowed */
.stat.allow          { border-color: rgba(46, 230, 168, .26); }
.stat.allow .v       { color: var(--ok); }
.stat.allow::after   { background: linear-gradient(90deg, var(--ok), transparent 78%); }
.stat.allow::before  {
  border-color: rgba(46, 230, 168, .3);
  background-color: var(--ok-soft);
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232ee6a8' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='m8.5 12.5 2.5 2.5 4.5-5'/%3E%3C/svg%3E");
}

/* Challenged */
.stat.chal           { border-color: rgba(255, 179, 64, .26); }
.stat.chal .v        { color: var(--warn); }
.stat.chal::after    { background: linear-gradient(90deg, var(--warn), transparent 78%); }
.stat.chal::before   {
  border-color: rgba(255, 179, 64, .3);
  background-color: var(--warn-soft);
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffb340' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3 5 5.5v5.6c0 4.4 3 7.4 7 9.4 4-2 7-5 7-9.4V5.5L12 3z'/%3E%3Cpath d='M12 9v3.5'/%3E%3Cpath d='M12 16h.01'/%3E%3C/svg%3E");
}

/* Blocked */
.stat.block          { border-color: rgba(255, 107, 107, .26); }
.stat.block .v       { color: var(--danger); }
.stat.block::after   { background: linear-gradient(90deg, var(--danger), transparent 78%); }
.stat.block::before  {
  border-color: rgba(255, 107, 107, .3);
  background-color: var(--danger-soft);
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ff6b6b' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='m6 6 12 12'/%3E%3C/svg%3E");
}

/* Domains (the plain .stat) — brand green + globe */
.stat:not(.allow):not(.chal):not(.block)         { border-color: var(--accent-line); }
.stat:not(.allow):not(.chal):not(.block) .v      { color: var(--accent); text-shadow: 0 0 18px rgba(43, 255, 0, .28); }
.stat:not(.allow):not(.chal):not(.block)::before {
  border-color: var(--accent-line);
  background-color: var(--accent-soft);
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232bff00' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M3 12h18'/%3E%3Cpath d='M12 3c2.5 2.5 4 5.7 4 9s-1.5 6.5-4 9c-2.5-2.5-4-5.7-4-9s1.5-6.5 4-9z'/%3E%3C/svg%3E");
}

/* ==========================================================================
   5. BUTTONS
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  padding: 0 13px;
  border: 1px solid var(--border);
  border-radius: var(--r-s);
  background: var(--raised);
  color: var(--text);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .06s, box-shadow .15s, color .15s;
}
.btn:hover  { background: var(--raised-h); border-color: rgba(148, 173, 160, .3); }
.btn:active { transform: translateY(1px); }

.btn.sm { height: 29px; padding: 0 10px; font-size: 11.5px; border-radius: 9px; }

.btn.primary {
  border-color: transparent;
  background: linear-gradient(180deg, #45ff1f, var(--accent-deep));
  color: var(--accent-ink);
  font-weight: 800;
  box-shadow: 0 6px 20px -8px rgba(43, 255, 0, .55);
}
.btn.primary:hover { background: linear-gradient(180deg, #5cff3d, #24e000); }

.btn.danger {
  border-color: rgba(255, 107, 107, .32);
  background: var(--danger-soft);
  color: #ff9a9a;
}
.btn.danger:hover { background: rgba(255, 107, 107, .2); color: #ffb3b3; }

.btn:disabled, .btn[disabled] {
  opacity: .42;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

/* row-action chips: colour-coded by destination so the dense
   Settings / Visitors / Events / IPs cluster reads at a glance.
   ("temp_visits.php" also contains "visits.php" — hence the :not() guard.) */
a.btn[href*="domain_edit"] { color: #b6ff9e; border-color: var(--accent-line);      background: var(--accent-soft); }
a.btn[href*="temp_visits"] { color: #cdbcff; border-color: rgba(167, 139, 250, .3); background: var(--violet-soft); }
a.btn[href*="visits.php"]:not([href*="temp_visits"]) { color: #ffd399; border-color: rgba(255, 179, 64, .3); background: var(--warn-soft); }
a.btn[href*="ip_rules"]    { color: #9adcff; border-color: rgba(56, 189, 248, .3);  background: var(--cyan-soft); }
a.btn[href*="domain_edit"]:hover { background: rgba(43, 255, 0, .2); }
a.btn[href*="temp_visits"]:hover { background: rgba(167, 139, 250, .22); }
a.btn[href*="visits.php"]:not([href*="temp_visits"]):hover { background: rgba(255, 179, 64, .22); }
a.btn[href*="ip_rules"]:hover    { background: rgba(56, 189, 248, .22); }

/* IP-rule actions, distinguished by their existing title attributes */
button.btn[title*="always allow"]  { color: #8ff0cd; border-color: rgba(46, 230, 168, .3); background: var(--ok-soft); }
button.btn[title="Remove the ban"] { color: #ffd399; border-color: rgba(255, 179, 64, .3); background: var(--warn-soft); }
button.btn[title="Delete"], button.btn[title="Remove"] { color: #ff9a9a; }
button.btn[title="Delete"]:hover, button.btn[title="Remove"]:hover { background: rgba(255, 107, 107, .18); }

/* neutralise the page-level `button.btn.primary { margin:30px 0 }` that
   domains.php prints inline — it breaks the compact add-domain row */
.card form button.btn.primary { margin: 0; }

/* ==========================================================================
   6. PILLS
   ========================================================================== */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 21px;
  padding: 0 9px;
  border: 1px solid var(--border);
  border-radius: 99px;
  background: rgba(255, 255, 255, .04);
  font-size: 10.5px;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
}
.pill::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 99px;
  background: currentColor;
  flex: 0 0 auto;
}
.pill.allow, .pill.pass, .pill.active {
  color: #7cf0d0; border-color: rgba(46, 230, 168, .32); background: var(--ok-soft);
}
.pill.challenge, .pill.paused, .pill.pending, .pill.not-payment {
  color: #ffcd85; border-color: rgba(255, 179, 64, .32); background: var(--warn-soft);
}
.pill.block, .pill.suspended, .pill.expired, .pill.banned, .pill.inactive, .pill.deactivated {
  color: #ff9a9a; border-color: rgba(255, 107, 107, .32); background: var(--danger-soft);
}

/* ==========================================================================
   7. FORM CONTROLS
   ========================================================================== */

.field { margin-bottom: 11px; }
.field:last-child { margin-bottom: 0; }

label.f, .f {
  display: block;
  margin-bottom: 6px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted);
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="email"],
input[type="search"],
select,
textarea {
  width: 100%;
  height: 37px;
  padding: 0 11px;
  border: 1px solid var(--border);
  border-radius: var(--r-s);
  background: var(--bg-2);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
textarea { height: auto; padding: 10px 11px; line-height: 1.55; resize: vertical; }
input::placeholder, textarea::placeholder { color: #5d6d68; }

input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  background: #0b1319;
}
input:disabled, select:disabled, textarea:disabled { opacity: .45; cursor: not-allowed; }

select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 30px;
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2393a6a0' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
  background-size: 14px 14px;
}
select option { background: #0c131b; color: var(--text); }

/* toggle rows (domain_edit.php sw() helper) */
.switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-2);
}
.switch:last-of-type { border-bottom: 0; }

.switch .lab { display: block; min-width: 0; font-size: 12.5px; font-weight: 600; }
.switch .lab small {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.55;
  color: var(--muted-2);
}

.toggle { position: relative; flex: 0 0 auto; display: inline-block; cursor: pointer; }
.toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle > span {
  display: block;
  width: 42px;
  height: 24px;
  border-radius: 99px;
  background: #1b2530;
  border: 1px solid var(--border);
  transition: background .18s, border-color .18s, box-shadow .18s;
}
.toggle > span::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 16px;
  height: 16px;
  border-radius: 99px;
  background: #87968f;
  transition: transform .18s, background .18s;
}
.toggle input:checked + span {
  background: linear-gradient(180deg, #45ff1f, var(--accent-deep));
  border-color: transparent;
  box-shadow: 0 0 14px -2px rgba(43, 255, 0, .45);
}
.toggle input:checked + span::after { transform: translateX(18px); background: #04240a; }
.toggle input:focus-visible + span { box-shadow: 0 0 0 3px var(--accent-soft); }

/* code block + copy button */
.codeblock {
  position: relative;
  overflow-x: auto;
  padding: 13px 82px 13px 13px;
  border: 1px solid var(--border);
  border-radius: var(--r-s);
  background: #060c12;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.6;
  white-space: pre;
}
.codeblock .copybtn { position: absolute; top: 8px; right: 8px; }

/* ==========================================================================
   8. TABLES
   ========================================================================== */

table { width: 100%; border-collapse: collapse; font-size: 12.5px; }

thead th {
  padding: 9px 11px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted-2);
}

td { padding: 9px 11px; border-bottom: 1px solid var(--border-2); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: rgba(255, 255, 255, .022); }

td.mono, td .mono { font-size: 11.5px; }
td form { display: inline-block; vertical-align: middle; }
td .btn + .btn, td form + form, td .btn + form, td form + .btn { margin-left: 4px; }

.flag { white-space: nowrap; }
.flag img {
  width: 16px;
  height: 12px;
  border-radius: 2px;
  object-fit: cover;
  vertical-align: -1px;
  margin-right: 4px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .09);
}

/* account.php label/value table (no thead) */
.card table td.dim:first-child { width: 0%; font-size: 11.5px; }

/* ==========================================================================
   9. AUTH PAGES  (login.php / register.php)
   ========================================================================== */

.authwrap {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  background: radial-gradient(600px 320px at 50% -6%, rgba(43, 255, 0, .1), transparent 65%);
}
.authcard { width: 100%; max-width: 400px; }
.authcard .card {
  margin: 0;
  padding: 26px 24px 22px;
  border-radius: 18px;
  box-shadow: 0 30px 70px -40px #000, 0 0 0 1px rgba(43, 255, 0, .06);
}
.authcard .brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -.02em;
}
.authcard .brand svg { width: 25px; height: 25px; }

.center-sub {
  margin: 6px 0 18px;
  text-align: center;
  font-size: 12.5px;
  color: var(--muted);
}
.authcard .field { margin-bottom: 12px; }
.authcard form .btn.primary { margin-top: 6px; height: 40px; font-size: 13.5px; }

.tiny {
  margin: 16px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--border-2);
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}
.tiny a { font-weight: 700; }
.tiny a:hover { text-decoration: underline; }

/* ==========================================================================
   10. LANDING PAGE  (home.php)
   ========================================================================== */

.landing-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 60px;
  padding: 0 max(18px, calc((100% - var(--shell)) / 2));
  background: rgba(6, 11, 18, .8);
  backdrop-filter: saturate(150%) blur(14px);
  -webkit-backdrop-filter: saturate(150%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.landing-nav .brand-text { font-size: 15px; }
.landing-nav .links { display: inline-flex; align-items: center; gap: 8px; }

/* hero -------------------------------------------------------------------- */
.hero {
  max-width: 900px;
  margin: 0 auto;
  padding: 72px 18px 56px;
  text-align: center;
}
.kicker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 27px;
  padding: 0 12px;
  border: 1px solid var(--accent-line);
  border-radius: 99px;
  background: var(--accent-soft);
  color: #b6ff9e;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.hero h1 {
  margin: 20px 0 0;
  font-size: clamp(30px, 5.4vw, 56px);
  font-weight: 800;
  line-height: 1.06;
  letter-spacing: -.035em;
}
.hero .accent { color: var(--accent); text-shadow: 0 0 34px rgba(43, 255, 0, .35); }
.lead {
  max-width: 640px;
  margin: 18px auto 0;
  font-size: 14.5px;
  line-height: 1.7;
  color: var(--muted);
}
.cta-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 26px;
}
.cta-row .btn { height: 44px; padding: 0 22px; font-size: 13.5px; border-radius: 12px; }

/* sections ---------------------------------------------------------------- */
.landing-section {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 52px 18px;
}
.landing-section .h {
  margin: 0;
  text-align: center;
  font-size: clamp(20px, 2.6vw, 28px);
  font-weight: 800;
  letter-spacing: -.03em;
}
.sec-sub {
  max-width: 560px;
  margin: 10px auto 30px;
  text-align: center;
  font-size: 13px;
  line-height: 1.65;
  color: var(--muted);
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.feature-card {
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: linear-gradient(180deg, var(--card), var(--card-2));
  transition: transform .16s, border-color .16s, box-shadow .16s;
}
.feature-card:hover {
  transform: translateY(-2px);
  border-color: rgba(148, 173, 160, .28);
  box-shadow: 0 20px 40px -30px #000;
}
.feature-card .fi {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin-bottom: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, .04);
  color: var(--accent);
}
.feature-card .fi svg { width: 20px; height: 20px; }
.feature-card h3 { margin: 0 0 7px; font-size: 14.5px; font-weight: 700; letter-spacing: -.01em; }
.feature-card p { margin: 0; font-size: 12.5px; line-height: 1.7; color: var(--muted); }

/* a different accent per capability, so the grid is not one flat colour */
.feature-card:nth-child(1) .fi { color: var(--accent); background: var(--accent-soft); border-color: var(--accent-line); }
.feature-card:nth-child(2) .fi { color: var(--cyan);   background: var(--cyan-soft);   border-color: rgba(56, 189, 248, .3); }
.feature-card:nth-child(3) .fi { color: var(--violet); background: var(--violet-soft); border-color: rgba(167, 139, 250, .3); }
.feature-card:nth-child(4) .fi { color: var(--ok);     background: var(--ok-soft);     border-color: rgba(46, 230, 168, .3); }
.feature-card:nth-child(5) .fi { color: var(--warn);   background: var(--warn-soft);   border-color: rgba(255, 179, 64, .3); }
.feature-card:nth-child(6) .fi { color: #f9a8d4;       background: rgba(249, 168, 212, .13); border-color: rgba(249, 168, 212, .3); }

/* three steps ------------------------------------------------------------- */
.step-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.step {
  position: relative;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: linear-gradient(180deg, var(--card), var(--card-2));
}
.step .num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  margin-bottom: 13px;
  border-radius: 99px;
  background: linear-gradient(180deg, #45ff1f, var(--accent-deep));
  color: var(--accent-ink);
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 0 0 4px rgba(43, 255, 0, .1);
}
.step h3 { margin: 0 0 7px; font-size: 14.5px; font-weight: 700; }
.step p { margin: 0; font-size: 12.5px; line-height: 1.7; color: var(--muted); }
.step:not(:last-child)::after {          /* dashed connector on wide screens */
  content: "";
  position: absolute;
  top: 34px;
  right: -14px;
  width: 14px;
  border-top: 1px dashed var(--accent-line);
}

/* closing CTA ------------------------------------------------------------- */
.cta-band {
  max-width: var(--shell);
  margin: 10px auto 60px;
  padding: 46px 24px;
  border: 1px solid var(--accent-line);
  border-radius: 20px;
  background:
    radial-gradient(520px 220px at 50% 0%, rgba(43, 255, 0, .14), transparent 70%),
    linear-gradient(180deg, var(--card), var(--card-2));
  text-align: center;
}
.cta-band h2 {
  margin: 0;
  font-size: clamp(20px, 2.6vw, 27px);
  font-weight: 800;
  letter-spacing: -.03em;
}
.cta-band p { margin: 10px 0 22px; font-size: 13px; color: var(--muted); }
.cta-band .btn.primary { height: 44px; padding: 0 26px; font-size: 13.5px; border-radius: 12px; }

.landing-footer {
  padding: 22px 18px calc(24px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--border-2);
  text-align: center;
  font-size: 11.5px;
  color: var(--muted-2);
}

/* ==========================================================================
   10b. PLANS / PAYMENT  (pricing.php · app/billing.php)
   ========================================================================== */

.plans {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 13px;
  margin-bottom: 13px;
}

.plan {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 20px 18px 18px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: linear-gradient(180deg, var(--card), var(--card-2));
  transition: transform .16s, border-color .16s, box-shadow .16s;
}
.plan:hover {
  transform: translateY(-2px);
  border-color: rgba(148, 173, 160, .3);
  box-shadow: 0 22px 44px -32px #000;
}

/* best-value plan */
.plan.featured {
  border-color: var(--accent-line);
  background:
    radial-gradient(220px 140px at 50% 0%, rgba(43, 255, 0, .1), transparent 72%),
    linear-gradient(180deg, var(--card), var(--card-2));
  box-shadow: 0 0 0 1px rgba(43, 255, 0, .1), 0 26px 52px -34px #000;
}
/* the plan the client is on right now */
.plan.current { border-color: rgba(46, 230, 168, .42); }

.plan .tag {
  position: absolute;
  top: -10px;
  left: 18px;
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 9px;
  border-radius: 99px;
  background: linear-gradient(180deg, #45ff1f, var(--accent-deep));
  color: var(--accent-ink);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.plan.current .tag {
  background: var(--ok-soft);
  border: 1px solid rgba(46, 230, 168, .4);
  color: #7cf0d0;
}

.plan .name {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--muted);
}
.plan .price {
  display: flex;
  align-items: baseline;
  gap: 3px;
  margin: 9px 0 3px;
  font-size: 33px;
  font-weight: 800;
  letter-spacing: -.04em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.plan .price .cur { font-size: 16px; font-weight: 700; color: var(--muted); }
.plan.featured .price { color: var(--accent); text-shadow: 0 0 26px rgba(43, 255, 0, .25); }
.plan .per { font-size: 11.5px; color: var(--muted-2); }

.plan .save {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 11px;
  height: 20px;
  padding: 0 9px;
  border: 1px solid rgba(46, 230, 168, .32);
  border-radius: 99px;
  background: var(--ok-soft);
  color: #7cf0d0;
  font-size: 10.5px;
  font-weight: 700;
}

.plan ul {
  display: grid;
  gap: 8px;
  margin: 15px 0 17px;
  padding: 0;
  list-style: none;
  font-size: 12px;
  line-height: 1.55;
  color: var(--muted);
}
.plan li { display: flex; gap: 8px; align-items: flex-start; }
.plan li::before {
  content: "";
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  margin-top: 1px;
  background: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232bff00' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 13 4.5 4.5L19 7'/%3E%3C/svg%3E") center / 14px 14px no-repeat;
}

.plan .btn { margin-top: auto; width: 100%; height: 38px; }

/* Telegram support button */
.btn.tg {
  border-color: transparent;
  background: #229ed9;
  color: #fff;
  font-weight: 700;
  box-shadow: 0 6px 20px -8px rgba(34, 158, 217, .65);
}
.btn.tg:hover { background: #2aa9e6; border-color: transparent; }
.btn.tg svg { width: 16px; height: 16px; flex: 0 0 auto; }

/* numbered "how to pay" list */
.pay-steps {
  display: grid;
  gap: 11px;
  margin: 0 0 15px;
  padding: 0;
  list-style: none;
  counter-reset: paystep;
}
.pay-steps li {
  display: flex;
  gap: 10px;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--muted);
}
.pay-steps li::before {
  counter-increment: paystep;
  content: counter(paystep);
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 21px;
  height: 21px;
  border: 1px solid var(--accent-line);
  border-radius: 99px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 10.5px;
  font-weight: 800;
}

.pay-total {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 25px;
  font-weight: 800;
  letter-spacing: -.035em;
}
.pay-total .cur { font-size: 15px; font-weight: 700; color: var(--muted); }
.pay-total small { font-size: 12px; font-weight: 600; color: var(--muted); }

.tg-row { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; }

/* ==========================================================================
   11. LARGE DESKTOP  (>=1280px) — more air, slightly larger type
   ========================================================================== */

@media (min-width: 1280px) {
  body { font-size: 14px; }
  .wrap { padding: 26px 24px 52px; }
  .grid { gap: 15px; }
  .card { padding: 18px; }
  h1.page { font-size: 23px; }
  .stat { padding: 16px 17px 17px; }
  .stat .v { font-size: 30px; }
  td, thead th { padding: 10px 13px; }
  .stat:hover { transform: translateY(-2px); box-shadow: 0 22px 44px -32px #000; }
  .feature-grid, .step-row { gap: 16px; }
  .landing-section { padding: 64px 18px; }
}

/* ==========================================================================
   12. TABLET  (821px – 1023px)
   ========================================================================== */

@media (min-width: 821px) and (max-width: 1023px) {
  .nav a { padding: 0 9px; font-size: 12px; }
  .userchip-email { max-width: 140px; }
  .grid.c4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .plans { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero { padding: 56px 18px 44px; }
}

/* ==========================================================================
   13. PHONE / SMALL TABLET  (<=820px) — mini-app shell
   ========================================================================== */

@media (max-width: 820px) {

  body { font-size: 13px; }

  /* top bar keeps brand + sign-out; navigation moves to the bottom tab bar */
  .topbar { height: 48px; padding: 0 11px; gap: 8px; }
  .topbar .nav { display: none; }
  .brand-text { font-size: 13px; }
  .userchip-email { max-width: 120px; font-size: 10.5px; }
  .userchip .btn.sm { height: 27px; padding: 0 9px; font-size: 11px; }

  .bottomnav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    gap: 2px;
    padding: 5px 6px calc(5px + env(safe-area-inset-bottom, 0px));
    background: rgba(7, 12, 19, .93);
    backdrop-filter: saturate(150%) blur(16px);
    -webkit-backdrop-filter: saturate(150%) blur(16px);
    border-top: 1px solid var(--border);
  }
  .bottomnav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-height: 46px;
    padding: 4px 2px;
    border-radius: var(--r-s);
    color: var(--muted-2);
    font-size: 9.5px;
    font-weight: 700;
    transition: color .15s, background .15s;
  }
  .bottomnav a svg { width: 19px; height: 19px; }
  .bottomnav a.on { background: color-mix(in srgb, currentColor 14%, transparent); }
  .bottomnav a[href*="dashboard"].on { color: var(--accent); }
  .bottomnav a[href*="domains"].on   { color: var(--ok); }
  .bottomnav a[href*="account"].on   { color: var(--violet); }
  .bottomnav a[href*="/admin/"].on   { color: var(--warn); }
  @supports not (background: color-mix(in srgb, red 10%, transparent)) {
    .bottomnav a.on { background: rgba(255, 255, 255, .07); }
  }

  .wrap { padding: 13px 11px calc(80px + env(safe-area-inset-bottom, 0px)); }

  h1.page { font-size: 17px; }
  .sub { font-size: 12px; margin-bottom: 12px; }

  .grid { gap: 10px; }
  .grid.c2 { grid-template-columns: minmax(0, 1fr); }
  .grid.c4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .card { padding: 13px; margin-bottom: 10px; }
  .card h2 { font-size: 11px; margin-bottom: 11px; }

  .stat { padding: 11px 12px 12px; border-radius: 13px; }
  .stat::before { top: 10px; right: 10px; width: 26px; height: 26px; border-radius: 9px; background-size: 14px 14px; }
  .stat .k { font-size: 9.5px; padding-right: 32px; letter-spacing: .08em; }
  .stat .v { font-size: 21px; margin-top: 5px; }

  /* form rows become single-column with full-width controls */
  .row { flex-direction: column; gap: 9px; }
  .row > div { width: 100%; flex: 1 1 auto !important; }
  .row > form { width: 100%; }
  .card .row > div > .btn { width: 100%; }

  .between { gap: 8px; }

  /* tables scroll sideways instead of squeezing */
  table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
    font-size: 11.5px;
  }
  thead th { padding: 7px 9px; font-size: 9.5px; }
  td { padding: 7px 9px; }
  td.mono, td .mono { font-size: 11px; }
  .card table td.dim:first-child { width: auto; }

  .btn { height: 32px; font-size: 12px; }
  .btn.sm { height: 27px; padding: 0 8px; font-size: 11px; }

  .switch { padding: 10px 0; }
  .switch .lab { font-size: 12px; }
  .switch .lab small { font-size: 10.5px; }

  .codeblock { font-size: 11.5px; padding: 12px 74px 12px 12px; }
  .flash { font-size: 12px; padding: 10px 11px; }
  .empty { padding: 20px 12px; font-size: 12px; }

  /* 16px keeps iOS Safari from zooming on focus; heights stay compact */
  input[type="text"],
  input[type="password"],
  input[type="number"],
  input[type="email"],
  select,
  textarea { height: 39px; font-size: 16px; }
  textarea { height: auto; }

  /* plans on phones */
  .plans { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .plan { padding: 17px 13px 13px; }
  .plan .name { font-size: 10.5px; }
  .plan .price { font-size: 25px; margin: 7px 0 2px; }
  .plan .price .cur { font-size: 13px; }
  .plan .per, .plan .save { font-size: 10.5px; }
  .plan ul { margin: 12px 0 14px; gap: 7px; font-size: 11.5px; }
  .plan .btn { height: 36px; }
  .plan .tag { left: 13px; font-size: 9px; height: 19px; padding: 0 8px; }
  .pay-steps li { font-size: 12px; }
  .pay-total { font-size: 22px; }
  .tg-row .btn { width: 100%; }

  /* landing + auth on phones */
  .landing-nav { height: 52px; padding: 0 12px; }
  .landing-nav .brand-text { font-size: 13.5px; }
  .landing-nav .links .btn { height: 28px; padding: 0 10px; font-size: 11.5px; }
  .hero { padding: 40px 15px 34px; }
  .hero h1 { margin-top: 16px; }
  .lead { font-size: 13.5px; margin-top: 14px; }
  .cta-row { margin-top: 20px; }
  .cta-row .btn { width: 100%; height: 42px; }
  .landing-section { padding: 34px 14px; }
  .sec-sub { margin-bottom: 20px; font-size: 12.5px; }
  .feature-grid, .step-row { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .feature-card, .step { padding: 16px; }
  .feature-card .fi { width: 36px; height: 36px; margin-bottom: 11px; }
  .step:not(:last-child)::after { display: none; }
  .cta-band { margin: 6px 14px 34px; padding: 32px 18px; border-radius: 16px; }
  .cta-band .btn.primary { width: 100%; }
  .authcard .card { padding: 22px 18px 18px; border-radius: 16px; }
}

/* ==========================================================================
   14. SMALL PHONE  (<=420px)
   ========================================================================== */

@media (max-width: 420px) {
  .wrap { padding: 11px 9px calc(78px + env(safe-area-inset-bottom, 0px)); }
  .card { padding: 12px; }
  h1.page { font-size: 16px; }
  .stat .v { font-size: 19px; }
  .stat .k { font-size: 9px; }
  .userchip-email { display: none; }
  .bottomnav a { font-size: 9px; }
  .bottomnav a svg { width: 18px; height: 18px; }
  td .btn.sm, td form .btn.sm { height: 26px; padding: 0 7px; font-size: 10.5px; }
  .codeblock { font-size: 11px; }
  .hero h1 { font-size: 27px; }
  .plans { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 340px) {
  .brand-text { display: none; }
  .grid.c4 { grid-template-columns: minmax(0, 1fr); }
}

/* ==========================================================================
   15. ACCESSIBILITY / PRINT
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  .feature-card:hover, .stat:hover { transform: none; }
}

@media print {
  .topbar, .bottomnav, .landing-nav, .btn, .flash, .cta-band, .landing-footer { display: none !important; }
  body { background: #fff; color: #000; }
  .card, .stat, .feature-card, .step { border-color: #ccc; background: #fff; box-shadow: none; }
}
