:root {
  --bg: #000000;
  --bg2: #0a0a0a;
  --bg3: #111111;
  --bg4: #161616;
  --line: #222222;
  --text: #ffffff;
  --muted: #888888;
  --muted2: #666666;
  --accent: #3b82f6;
  --accent2: #60a5fa;
  --ok: #22c55e;
  --warn: #ef4444;
  --gold: #f59e0b;
  --radius: 10px;
  --font: "Inter", "Segoe UI", system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  min-height: 100vh;
}

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

a:hover {
  text-decoration: underline;
}

.site-header {
  border-bottom: 1px solid var(--line);
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 50;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
  text-decoration: none;
}

.brand:hover {
  text-decoration: none;
}

.brand span {
  color: var(--muted);
  font-weight: 500;
  font-size: 0.85rem;
}

.layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: calc(100vh - 56px);
  max-width: 1280px;
  margin: 0 auto;
}

.sidebar {
  border-right: 1px solid var(--line);
  padding: 1rem 0.75rem;
  background: var(--bg);
}

.sidebar h2 {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 0 0 0.75rem 0.5rem;
  font-weight: 600;
}

.nav-btn {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  color: var(--muted);
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  font-size: 0.88rem;
  cursor: pointer;
  margin-bottom: 0.15rem;
  font-family: inherit;
}

.nav-btn:hover,
.nav-btn.active {
  background: var(--bg3);
  color: var(--text);
}

.main {
  padding: 2rem 1.5rem 3rem;
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
  justify-self: center;
}

.tool-panel {
  display: none;
}

.tool-panel.active {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.tool-panel > .tool-hero,
.tool-panel > form,
.tool-panel > .results,
.tool-panel > .temp-toolbar,
.tool-panel > .temp-split,
.tool-panel > .hub-grid,
.tool-panel > p.meta {
  width: 100%;
  max-width: 720px;
}

.tool-panel > .temp-split {
  max-width: 900px;
}

.tool-panel > .hub-grid {
  max-width: 900px;
}

.tool-hero {
  text-align: center;
  margin-bottom: 2rem;
}

.tool-hero h1 {
  font-size: clamp(1.75rem, 4vw, 2.35rem);
  font-weight: 700;
  margin: 0 0 0.5rem;
  letter-spacing: -0.02em;
}

.tool-hero p {
  color: var(--muted);
  margin: 0;
  font-size: 0.95rem;
  max-width: 520px;
  margin-inline: auto;
}

.search-row {
  display: flex;
  gap: 0.65rem;
  max-width: 720px;
  width: 100%;
  margin: 0 auto 2rem;
  justify-content: center;
  align-items: flex-end;
}

.search-row label {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
  margin-bottom: 0.35rem;
}

.search-field {
  flex: 1;
}

.search-input {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  font-size: 0.95rem;
  outline: none;
}

.search-input:focus {
  border-color: #444;
}

.btn-primary {
  background: #ffffff;
  color: #000000;
  border: none;
  padding: 0.85rem 1.35rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  white-space: nowrap;
  align-self: flex-end;
  font-family: inherit;
}

.btn-primary:hover {
  background: #e8e8e8;
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: wait;
}

.btn-ghost {
  background: var(--bg3);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 0.5rem 0.85rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  font-family: inherit;
}

.btn-ghost:hover {
  background: var(--bg4);
}

.results {
  display: none;
  width: 100%;
  max-width: 900px;
}

.results.visible {
  display: block;
}

.card {
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.card h3 {
  margin: 0 0 1rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 600;
}

.kv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem 1.5rem;
}

.kv .k {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

.kv .v {
  font-size: 0.95rem;
  font-weight: 600;
  word-break: break-word;
}

.kv .v.hl {
  color: var(--accent2);
}

.kv .v.gold {
  color: var(--gold);
}

.kv .v.ok {
  color: var(--ok);
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
  }
  .sidebar {
    border-right: none;
    border-bottom: 1px solid var(--line);
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    padding: 0.75rem;
  }
  .sidebar h2 {
    width: 100%;
  }
  .nav-btn {
    width: auto;
  }
  .two-col {
    grid-template-columns: 1fr;
  }
}

.ip-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

#ip-map {
  height: 280px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg3);
}

.discord-profile {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1.25rem;
}

.discord-banner {
  width: 100%;
  height: 100px;
  background: var(--bg4);
  border-radius: 10px;
  margin-bottom: -36px;
}

.discord-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 4px solid var(--bg2);
  background: var(--bg4);
  object-fit: cover;
  position: relative;
  z-index: 1;
}

.tg-bio {
  background: var(--bg3);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.85rem;
  font-style: italic;
  color: #ccc;
  white-space: pre-wrap;
}

.badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(59, 130, 246, 0.2);
  color: var(--accent2);
}

.badge.ok {
  background: rgba(34, 197, 94, 0.15);
  color: var(--ok);
}

.table-wrap {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.data-table th,
.data-table td {
  text-align: left;
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--line);
}

.data-table th {
  color: var(--muted);
  font-weight: 500;
  font-size: 0.78rem;
}

.status-active {
  color: var(--ok);
}

.alert-warn {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fca5a5;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.88rem;
}

.temp-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.temp-email {
  font-family: ui-monospace, monospace;
  font-size: 1rem;
  color: var(--text);
}

.temp-split {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 1rem;
  min-height: 320px;
}

.inbox-list {
  background: var(--bg3);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}

.inbox-list .head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.85rem;
}

.inbox-item {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  padding: 0.75rem 1rem;
  cursor: pointer;
  font-family: inherit;
}

.inbox-item:hover,
.inbox-item.active {
  background: var(--bg4);
}

.mail-preview {
  background: var(--bg4);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.25rem;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 280px;
}

.mail-preview.has-content {
  align-items: stretch;
  justify-content: flex-start;
  color: var(--text);
}

.mac-result {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.mac-icon {
  width: 48px;
  height: 48px;
  background: var(--bg3);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}

.username-list {
  max-height: 400px;
  overflow-y: auto;
}

.username-item {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.88rem;
}

.username-item a {
  color: var(--accent2);
}

.hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.hub-card {
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem;
  cursor: pointer;
  transition: border-color 0.15s;
  text-align: left;
  color: inherit;
  font-family: inherit;
}

.hub-card:hover {
  border-color: #444;
}

.hub-card h3 {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
  color: var(--text);
}

.hub-card p {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.loading,
.error-msg {
  text-align: center;
  color: var(--muted);
  padding: 1.5rem;
}

.error-msg {
  color: #f87171;
}

.site-footer {
  text-align: center;
  padding: 2rem;
  color: var(--muted2);
  font-size: 0.8rem;
  border-top: 1px solid var(--line);
}

.mail-codes-wrap {
  width: 100%;
  max-width: 900px;
  margin: 0 auto 0.75rem;
}

.mail-codes {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.mail-codes-label {
  color: var(--muted);
  font-size: 0.85rem;
}

.code-chip {
  background: #fff;
  color: #000;
  border: none;
  padding: 0.45rem 0.85rem;
  border-radius: 8px;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  font-family: ui-monospace, monospace;
}

.code-chip:hover {
  background: #e0e0e0;
}

.mail-body-text {
  margin-top: 1rem;
  white-space: pre-wrap;
  text-align: left;
  font-size: 0.9rem;
  line-height: 1.5;
}

@media (max-width: 768px) {
  .temp-split {
    grid-template-columns: 1fr;
  }
  .ip-layout {
    grid-template-columns: 1fr;
  }
}
