:root {
  color-scheme: dark;
  --bg: #020604;
  --bg-soft: #07110b;
  --panel: rgba(8, 18, 12, .92);
  --panel-strong: #0e1f14;
  --line: rgba(100, 214, 122, .28);
  --line-strong: rgba(100, 214, 122, .58);
  --text: #f2fff5;
  --muted: #aecab7;
  --muted-2: #7f9a89;
  --accent: #64d67a;
  --accent-strong: #00ff41;
  --danger: #ff8f8f;
  --shadow: 0 24px 80px rgba(0, 0, 0, .36);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(90deg, rgba(0, 255, 65, .07) 0, transparent 1px) 0 0 / 72px 72px,
    linear-gradient(180deg, rgba(0, 255, 65, .05) 0, transparent 1px) 0 0 / 72px 72px,
    radial-gradient(circle at 50% 0%, rgba(100, 214, 122, .16), transparent 36rem),
    var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: inherit;
}

.app {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 28px;
  padding: 24px;
  border-right: 1px solid var(--line);
  background: rgba(2, 6, 4, .86);
  backdrop-filter: blur(16px);
}

.brand {
  display: grid;
  grid-template-columns: 44px 1fr;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand__mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  color: var(--accent-strong);
  font-weight: 900;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  color: var(--muted-2);
}

.nav {
  display: grid;
  gap: 8px;
}

.nav a {
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--muted);
  text-decoration: none;
}

.nav a:hover {
  border-color: var(--line);
  color: var(--text);
  background: rgba(100, 214, 122, .08);
}

.sidebar__status {
  align-self: end;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--accent);
  background: var(--bg-soft);
}

.content {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 48px;
}

.hero,
.toolbar,
.grid,
.metrics,
.section-head {
  display: grid;
  gap: 18px;
}

.hero {
  grid-template-columns: minmax(0, 1fr) 150px 150px;
  align-items: end;
  margin-bottom: 22px;
  padding: 0 0 26px;
  border-bottom: 1px solid var(--line);
}

.hero__summary,
.panel,
.metrics article {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.hero__summary {
  min-height: 110px;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 16px;
  border-radius: 8px;
}

.hero__summary span,
.metrics span {
  color: var(--accent-strong);
  font-size: 2.2rem;
  font-weight: 900;
}

.hero__summary small {
  color: var(--muted);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
h4,
p {
  margin-top: 0;
}

h1 {
  max-width: 760px;
  margin-bottom: 10px;
  font-size: clamp(2.4rem, 7vw, 5.2rem);
  line-height: .94;
}

h2 {
  font-size: clamp(1.6rem, 3vw, 2.6rem);
}

h2,
h3,
h4 {
  margin-bottom: 12px;
}

p,
label,
td,
th,
li {
  color: var(--muted);
}

.login-shell {
  display: grid;
  place-items: start center;
  padding-top: 22px;
}

.login-panel {
  width: min(520px, 100%);
}

.panel {
  padding: 22px;
  margin-bottom: 18px;
  border-radius: 8px;
}

.toolbar {
  grid-template-columns: 1fr auto auto auto;
  align-items: center;
  margin-bottom: 18px;
}

.help-toggle {
  min-height: 44px;
  display: inline-grid;
  grid-template-columns: auto auto;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: rgba(100, 214, 122, .08);
  color: var(--accent);
}

.help-toggle input {
  width: 18px;
  min-height: 18px;
  accent-color: var(--accent);
}

.help-banner {
  margin-bottom: 18px;
  padding: 14px 16px;
  border: 1px solid rgba(100, 214, 122, .36);
  border-left: 4px solid var(--accent-strong);
  border-radius: 8px;
  background: rgba(0, 255, 65, .07);
  color: var(--muted);
}

.help-banner strong {
  color: var(--text);
}

.metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 18px;
}

.metric-wide span {
  font-size: 1.7rem;
}

.metrics article {
  padding: 18px;
  border-radius: 8px;
}

.metrics p {
  margin-bottom: 0;
}

.metrics small,
.help-tip,
.section-note {
  display: block;
  margin-top: 8px;
  color: var(--muted-2);
  font-size: .9rem;
  line-height: 1.45;
}

.help-tip {
  margin: -4px 0 0;
  padding: 10px 12px;
  border: 1px solid rgba(100, 214, 122, .18);
  border-radius: 6px;
  background: rgba(2, 6, 4, .36);
}

.grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.action-panel {
  align-content: start;
}

form {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 7px;
  font-size: .95rem;
}

input,
select,
button {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #030906;
  color: var(--text);
  font: inherit;
}

input,
select {
  width: 100%;
  padding: 9px 11px;
}

input:focus,
select:focus {
  outline: 2px solid rgba(0, 255, 65, .32);
  border-color: var(--accent);
}

button {
  cursor: pointer;
  padding: 9px 15px;
  background: var(--accent);
  border-color: var(--accent);
  color: #020604;
  font-weight: 900;
}

.button-secondary {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--accent);
}

.email-builder {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(120px, auto);
  align-items: center;
  gap: 8px;
}

.password-builder {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.email-builder strong {
  overflow-wrap: anywhere;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 14px;
}

.card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
  padding: 16px;
}

.card header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.card header span,
.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--accent);
  font-size: .82rem;
}

.dns {
  display: grid;
  gap: 10px;
}

.dns div {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 4px 10px;
  padding: 10px;
  border: 1px solid rgba(100, 214, 122, .16);
  border-radius: 6px;
  background: rgba(2, 6, 4, .42);
}

.dns strong {
  grid-row: span 2;
  color: var(--accent-strong);
}

code {
  overflow-wrap: anywhere;
  color: var(--text);
}

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

.mailbox-groups {
  display: grid;
  gap: 12px;
}

.mailbox-group {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
}

.mailbox-group__toggle {
  width: 100%;
  min-height: 54px;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.mailbox-group__toggle:hover {
  background: rgba(100, 214, 122, .08);
}

.mailbox-group__toggle strong {
  overflow-wrap: anywhere;
}

.mailbox-group__toggle span:last-child {
  color: var(--muted);
  font-weight: 700;
}

.mailbox-group__chevron {
  color: var(--accent);
  font-weight: 900;
}

.mailbox-group__content {
  border-top: 1px solid var(--line);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 12px 10px;
  text-align: left;
  white-space: nowrap;
}

td:first-child {
  color: var(--text);
  font-weight: 700;
}

.audit {
  display: grid;
  gap: 8px;
  padding-left: 20px;
}

.audit li {
  padding: 8px 0;
}

.audit li span {
  display: block;
  color: var(--muted-2);
  font-size: .9rem;
}

.message {
  min-height: 20px;
  margin-bottom: 0;
}

.message[data-type="error"] {
  color: var(--danger);
}

.message[data-type="success"] {
  color: var(--accent);
}

.empty {
  margin-bottom: 0;
}

[hidden] {
  display: none !important;
}

body.help-off [data-help] {
  display: none !important;
}

@media (max-width: 980px) {
  .app {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    grid-template-columns: 1fr;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .hero,
  .metrics,
  .toolbar,
  .grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .content {
    width: min(100% - 22px, 1180px);
    padding-top: 22px;
  }

  .nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  h1 {
    font-size: 2.7rem;
  }

  .email-builder {
    grid-template-columns: 1fr;
  }

  .password-builder {
    grid-template-columns: 1fr;
  }

  th,
  td {
    white-space: normal;
  }
}
