:root {
  --accent:  #00d4ff;
  --accent2: #7b2ff7;
  --bg:      #0a0e1a;
  --surface: rgba(255,255,255,0.04);
  --border:  rgba(255,255,255,0.08);
  --text:    #e8eaf0;
  --muted:   #7a8499;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
}

#bg-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/* ── MAIN NAV ── */
nav.main-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 2.5rem;
  backdrop-filter: blur(20px);
  background: rgba(10,14,26,0.75);
  border-bottom: 1px solid var(--border);
}
.nav-logo {
  display: flex;
  align-items: baseline;
  text-decoration: none;
  line-height: 1;
}
.logo-tar {
  font-size: 1.55rem;
  font-weight: 900;
  color: var(--text);
  letter-spacing: -.03em;
}
.logo-off {
  font-size: 1.55rem;
  font-weight: 900;
  letter-spacing: -.03em;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  position: relative;
}
.logo-off::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: 2px;
  opacity: .6;
}
.logo-dot {
  font-size: .7rem;
  color: var(--muted);
  letter-spacing: .06em;
  margin-left: .5rem;
  align-self: center;
  font-weight: 400;
}
.nav-right { display: flex; align-items: center; gap: 1.5rem; }
.nav-links { display: flex; gap: 2rem; list-style: none; }
.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: .85rem;
  letter-spacing: .05em;
  text-transform: uppercase;
  transition: color .2s;
}
.nav-links a:hover { color: var(--accent); }

/* ── TOOLS TAB BAR ── */
.tools-tabbar {
  position: sticky;
  top: 61px;
  z-index: 90;
  background: rgba(10,14,26,0.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.tools-tabbar-inner {
  max-width: 940px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.tools-tabbar-inner::-webkit-scrollbar { display: none; }

.tab-btn {
  flex-shrink: 0;
  padding: .75rem 1.05rem;
  border: none;
  background: none;
  color: var(--muted);
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color .2s, border-color .2s;
  white-space: nowrap;
  letter-spacing: .02em;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ── MAIN ── */
main {
  position: relative;
  z-index: 1;
  padding-top: 2.5rem;
  padding-bottom: 4rem;
  max-width: 940px;
  margin: 0 auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

/* ── TOOL CARD ── */
.tool-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem;
  backdrop-filter: blur(8px);
}
.tool-card h2 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 1.4rem;
  display: flex;
  align-items: center;
  gap: .7rem;
}
.tool-card h2 .icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

/* ── MODE TOGGLE ── */
.mode-toggle {
  display: inline-flex;
  background: rgba(255,255,255,.05);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: .2rem .25rem;
  gap: .2rem;
  margin-bottom: 1.2rem;
}
.mode-btn {
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .04em;
  padding: .3rem .9rem;
  border-radius: 7px;
  border: none;
  background: none;
  color: var(--muted);
  cursor: pointer;
  transition: background .2s, color .2s;
}
.mode-btn.active {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
}
.mode-btn:not(.active):hover { color: var(--text); }

/* ── DNS PROVIDER TOGGLE ── */
.provider-toggle {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: rgba(255,255,255,.05);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: .3rem .5rem;
  margin-bottom: 1.2rem;
}
.provider-toggle span {
  font-size: .75rem;
  color: var(--muted);
  letter-spacing: .04em;
  padding: 0 .3rem;
}
.provider-btn {
  font-size: .8rem;
  font-weight: 700;
  padding: .28rem .85rem;
  border-radius: 7px;
  border: none;
  background: none;
  color: var(--muted);
  cursor: pointer;
  transition: background .2s, color .2s;
}
.provider-btn.active {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
}
.provider-btn:not(.active):hover { color: var(--text); }

/* ── FORM ELEMENTS ── */
label {
  display: block;
  font-size: .82rem;
  color: var(--muted);
  margin-bottom: .4rem;
  letter-spacing: .03em;
}
input[type="text"],
input[type="number"],
textarea {
  width: 100%;
  background: rgba(255,255,255,.06);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-family: inherit;
  font-size: .92rem;
  padding: .65rem 1rem;
  outline: none;
  transition: border-color .2s;
  resize: vertical;
}
input[type="text"]:focus,
input[type="number"]:focus,
textarea:focus { border-color: var(--accent); }
textarea { min-height: 90px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .6rem 1.4rem;
  border: none;
  border-radius: 10px;
  font-size: .88rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .2s, transform .1s;
  background: var(--accent);
  color: #0a0e1a;
}
.btn:hover { opacity: .82; }
.btn:active { transform: scale(.97); }
.btn-outline {
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
}
.btn-outline:hover { opacity: .75; }
.btn-sm { padding: .4rem 1rem; font-size: .8rem; }
.btn-row {
  display: flex;
  gap: .7rem;
  margin-top: .9rem;
  flex-wrap: wrap;
  align-items: center;
}

/* ── RESULT BOX ── */
.result-box {
  margin-top: 1.2rem;
  background: rgba(0,0,0,.25);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1.2rem;
  font-size: .88rem;
  display: none;
}
.result-box.show    { display: block; }
.result-box.error   { border-color: rgba(255,80,80,.4); color: #ff6b6b; }
.result-box.success { border-color: rgba(0,212,255,.25); }
.result-mono {
  font-family: 'Courier New', monospace;
  font-size: .9rem;
  word-break: break-all;
  color: #4ade80;
}

/* ── IP CALC ── */
.ip-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .5rem .8rem;
  margin-bottom: .8rem;
}
.ip-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .35rem .6rem;
  background: rgba(255,255,255,.03);
  border-radius: 7px;
  font-size: .85rem;
}
.ip-row .lbl { color: var(--muted); }
.ip-row .val { font-family: 'Courier New', monospace; color: #4ade80; font-size: .88rem; }
.ip-section-title {
  font-size: .78rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 1rem 0 .5rem;
  padding-left: .2rem;
}
.subnet-table { width: 100%; border-collapse: collapse; font-size: .82rem; }
.subnet-table th {
  text-align: left;
  color: var(--muted);
  font-weight: 600;
  padding: .35rem .5rem;
  border-bottom: 1px solid var(--border);
  font-size: .78rem;
  letter-spacing: .04em;
}
.subnet-table td {
  padding: .3rem .5rem;
  font-family: 'Courier New', monospace;
  font-size: .82rem;
  border-bottom: 1px solid rgba(255,255,255,.04);
}
.subnet-table tr.highlight td { color: #4ade80; }
.subnet-table tr:hover td { background: rgba(255,255,255,.03); }
.vlsm-input-row { display: flex; gap: .6rem; align-items: flex-end; flex-wrap: wrap; }
.vlsm-input-row > div { flex: 1; min-width: 120px; }

/* ── JWT ── */
.jwt-part {
  border-radius: 8px;
  padding: .6rem .9rem;
  margin-bottom: .5rem;
  font-family: 'Courier New', monospace;
  font-size: .82rem;
  word-break: break-all;
}
.jwt-header  { background: rgba(0,212,255,.08);  border: 1px solid rgba(0,212,255,.2); }
.jwt-payload { background: rgba(123,47,247,.08); border: 1px solid rgba(123,47,247,.2); }
.jwt-sig     { background: rgba(255,159,67,.08); border: 1px solid rgba(255,159,67,.2); }
.jwt-label   { font-family: inherit; font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: .3rem; }
.jwt-json    { color: var(--text); white-space: pre-wrap; }

/* ── JSON ── */
.json-output {
  font-family: 'Courier New', monospace;
  font-size: .82rem;
  white-space: pre-wrap;
  word-break: break-all;
  line-height: 1.5;
  max-height: 400px;
  overflow-y: auto;
}
.json-key  { color: #79c0ff; }
.json-str  { color: #a5d6a7; }
.json-num  { color: #ffb74d; }
.json-bool { color: #f48fb1; }
.json-null { color: var(--muted); }

/* ── HASH ── */
.hash-alg-row { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.alg-chip {
  padding: .25rem .7rem;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: none;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
}
.alg-chip.active {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(0,212,255,.08);
}
.hash-item { display: flex; flex-direction: column; gap: .2rem; margin-bottom: .7rem; }
.hash-item-label { font-size: .72rem; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; }
.hash-value {
  font-family: 'Courier New', monospace;
  font-size: .85rem;
  color: #4ade80;
  word-break: break-all;
  cursor: pointer;
  transition: color .15s;
}
.hash-value:hover { color: var(--accent); }
.hash-value:hover::after { content: ' ⎘'; font-size: .75rem; }

/* ── URL ── */
.url-stats { font-size: .78rem; color: var(--muted); margin-top: .4rem; }

/* ── CRON ── */
.cron-description { font-size: .95rem; line-height: 1.5; margin-bottom: .8rem; }
.cron-runs { display: flex; flex-direction: column; gap: .3rem; }
.cron-run {
  display: flex;
  align-items: center;
  gap: .8rem;
  padding: .3rem .6rem;
  background: rgba(255,255,255,.03);
  border-radius: 7px;
  font-family: 'Courier New', monospace;
  font-size: .83rem;
}
.cron-run .run-num { color: var(--muted); min-width: 1.2rem; }
.cron-run .run-dt  { color: #4ade80; }
.cron-run .run-rel { color: var(--muted); font-size: .75rem; }
.cron-field-table { width: 100%; border-collapse: collapse; margin-bottom: .8rem; font-size: .82rem; }
.cron-field-table th {
  color: var(--muted);
  font-size: .72rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  font-weight: 600;
  padding: .3rem .5rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
}
.cron-field-table td {
  padding: .3rem .5rem;
  border-bottom: 1px solid rgba(255,255,255,.03);
  font-family: 'Courier New', monospace;
}
.cron-field-table td:first-child  { color: var(--accent); }
.cron-field-table td:nth-child(2) { color: var(--text); }
.cron-field-table td:nth-child(3) { color: var(--muted); font-family: inherit; font-size: .8rem; }

/* ── EMAIL HEADERS ── */
.hdr-section { margin-bottom: 1.2rem; }
.hdr-section-title {
  font-size: .72rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: .5rem;
  padding-left: .2rem;
}
.hdr-row {
  display: flex;
  gap: .6rem;
  padding: .3rem .6rem;
  background: rgba(255,255,255,.03);
  border-radius: 7px;
  margin-bottom: .3rem;
  font-size: .83rem;
  flex-wrap: wrap;
}
.hdr-row .hk { color: var(--muted); min-width: 130px; flex-shrink: 0; }
.hdr-row .hv { color: var(--text); word-break: break-all; font-family: 'Courier New', monospace; font-size: .8rem; }
.auth-pass { color: #4ade80; font-weight: 700; }
.auth-fail { color: #ff6b6b; font-weight: 700; }
.auth-none { color: #ffb74d; font-weight: 700; }
.hop-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: .4rem .8rem;
  padding: .35rem .6rem;
  background: rgba(255,255,255,.03);
  border-radius: 7px;
  margin-bottom: .3rem;
  font-size: .8rem;
  align-items: center;
}
.hop-num   { color: var(--muted); }
.hop-from  { font-family: 'Courier New', monospace; color: var(--text); word-break: break-all; }
.hop-delay { color: #ffb74d; text-align: right; white-space: nowrap; font-size: .75rem; }

/* ── DNS ── */
.dns-record {
  display: flex;
  gap: .6rem;
  padding: .3rem .6rem;
  background: rgba(255,255,255,.03);
  border-radius: 7px;
  margin-bottom: .3rem;
  font-size: .83rem;
  flex-wrap: wrap;
  align-items: flex-start;
}
.dns-prio { color: var(--accent); min-width: 35px; font-family: 'Courier New', monospace; }
.dns-val  { color: var(--text); font-family: 'Courier New', monospace; word-break: break-all; flex: 1; }
.dns-ttl  { color: var(--muted); font-size: .75rem; white-space: nowrap; }
.spf-mech {
  display: inline-block;
  padding: .1rem .5rem;
  border-radius: 4px;
  font-size: .75rem;
  font-family: 'Courier New', monospace;
  margin: .1rem .2rem .1rem 0;
}
.spf-pass     { background: rgba(74,222,128,.12);  color: #4ade80; border: 1px solid rgba(74,222,128,.25); }
.spf-softfail { background: rgba(255,183,67,.12);  color: #ffb74d; border: 1px solid rgba(255,183,67,.25); }
.spf-fail     { background: rgba(255,107,107,.12); color: #ff6b6b; border: 1px solid rgba(255,107,107,.25); }
.spf-neutral  { background: rgba(122,132,153,.12); color: var(--muted); border: 1px solid var(--border); }
.dns-loading  { color: var(--muted); font-style: italic; }

/* ── MISC ── */
.rate-notice { font-size: .78rem; color: #ff9f43; margin-top: .5rem; display: none; }
.hp-field    { opacity: 0; position: absolute; left: -9999px; height: 0; overflow: hidden; }

/* ── FOOTER ── */
footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 2rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: .82rem;
}
footer .footer-logo { display: inline-flex; align-items: baseline; margin-bottom: .5rem; }
footer .logo-tar { font-size: 1rem; font-weight: 900; color: rgba(255,255,255,.5); }
footer .logo-off {
  font-size: 1rem; font-weight: 900;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
footer .logo-off::after { display: none; }
footer a { color: var(--muted); text-decoration: none; }
footer a:hover { color: var(--accent); }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  nav.main-nav { padding: 1rem 1.5rem; }
  .nav-links { display: none; }
  .ip-grid { grid-template-columns: 1fr; }
  .hop-row { grid-template-columns: auto 1fr; }
  .hop-delay { grid-column: 2; }
}
@media (max-width: 480px) {
  .tool-card { padding: 1.3rem; }
  .btn-row { gap: .5rem; }
}
