@font-face {
  font-family: "Minecraft Elytria";
  src: url("/assets/minecraft-bold.otf") format("opentype");
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #0e1015;
  --bg-deep: #090b0f;
  --panel: #151820;
  --panel-2: #1b1f28;
  --panel-3: #222731;
  --line: #2c323d;
  --line-soft: #232831;
  --text: #f4f3ef;
  --muted: #8e96a5;
  --green: #75ea42;
  --green-bright: #9aff55;
  --green-dark: #2b7d22;
  --gold: #c7a354;
  --gold-soft: #7d6838;
  --danger: #ff655f;
  --warning: #f2bd4d;
  --discord: #5865f2;
  --pixel: "Minecraft Elytria", Impact, sans-serif;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-family: var(--sans);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  background: var(--bg);
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a,
select,
input[type="checkbox"],
input[type="color"] {
  cursor: pointer;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--green-bright);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: -60px;
  left: 16px;
  padding: 12px 18px;
  color: #081006;
  background: var(--green-bright);
  font-weight: 800;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 16px;
}

.ambient-grid {
  position: fixed;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  opacity: 0.22;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(to bottom, black, transparent 80%);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  font-family: var(--pixel);
  font-size: 17px;
  letter-spacing: 0.8px;
  text-decoration: none;
}

.brand img {
  width: 35px;
  height: 35px;
  object-fit: contain;
}

.brand span span,
.sidebar-brand strong span {
  color: var(--green);
}

.public-nav {
  position: relative;
  z-index: 10;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 70px;
  padding: 0 5vw;
  border-bottom: 1px solid rgba(199, 163, 84, 0.55);
  background: rgba(13, 15, 20, 0.94);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(18px);
}

.public-nav > :last-child {
  justify-self: end;
}

.public-status,
.connection-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #bac0c9;
  font-family: var(--pixel);
  font-size: 10px;
  letter-spacing: 0.7px;
}

.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--green);
  box-shadow: 0 0 12px rgba(117, 234, 66, 0.85);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  50% { opacity: 0.55; }
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  border: 1px solid transparent;
  color: white;
  font-family: var(--pixel);
  font-size: 11px;
  letter-spacing: 0.5px;
  text-decoration: none;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.35);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.07), 0 9px 25px rgba(0, 0, 0, 0.25);
  transition: transform 0.15s ease, filter 0.15s ease, border-color 0.15s ease;
}

.button:hover {
  transform: translateY(-2px);
  filter: brightness(1.12);
}

.button-small {
  min-height: 38px;
  padding: 0 16px;
  font-size: 9px;
}

.button-primary {
  color: #10220b;
  border-color: #9df270;
  background: linear-gradient(#81ef4f, #52b52b);
  text-shadow: none;
}

.button-primary span {
  margin-left: 14px;
  font-size: 20px;
}

.button-discord {
  border-color: #7d87ff;
  background: linear-gradient(180deg, #6875ff, #4b55ca);
}

.button-ghost {
  border-color: #555d6a;
  background: rgba(18, 21, 27, 0.72);
}

.button-danger {
  color: #ffb4b0;
  border-color: #7d3737;
  background: #3a2022;
}

.login-page {
  min-height: 100vh;
  background: #101219;
}

.login-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(320px, 0.7fr);
  align-items: center;
  gap: clamp(40px, 8vw, 130px);
  min-height: calc(100vh - 170px);
  padding: 72px 7vw 90px;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(9, 11, 15, 0.97) 0%, rgba(9, 11, 15, 0.88) 40%, rgba(9, 11, 15, 0.45) 100%),
    linear-gradient(0deg, #101219 0%, transparent 34%),
    url("/assets/hero.webp") center / cover;
}

.login-hero::after {
  position: absolute;
  right: -14vw;
  bottom: -36vw;
  width: 66vw;
  height: 66vw;
  border: 1px solid rgba(117, 234, 66, 0.12);
  border-radius: 50%;
  box-shadow: 0 0 160px rgba(117, 234, 66, 0.08);
  content: "";
}

.hero-dragon {
  position: absolute;
  z-index: 0;
  top: 3%;
  right: 4%;
  width: min(32vw, 520px);
  opacity: 0.32;
  filter: drop-shadow(0 20px 50px rgba(0, 0, 0, 0.55));
}

.hero-copy,
.portal-card {
  position: relative;
  z-index: 2;
}

.hero-logo {
  width: min(430px, 82vw);
  max-height: 160px;
  margin: 14px 0 4px;
  object-fit: contain;
  object-position: left center;
  filter: drop-shadow(0 10px 16px rgba(0, 0, 0, 0.55));
}

.eyebrow,
.section-kicker {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--gold);
  font-family: var(--pixel);
  font-size: 10px;
  letter-spacing: 1.2px;
}

.eyebrow span {
  width: 32px;
  height: 2px;
  background: var(--green);
  box-shadow: 0 0 8px rgba(117, 234, 66, 0.6);
}

.hero-copy h1 {
  max-width: 820px;
  margin: 18px 0;
  font-family: var(--pixel);
  font-size: clamp(35px, 5vw, 70px);
  line-height: 1.1;
  letter-spacing: -1px;
  text-shadow: 0 6px 0 rgba(0, 0, 0, 0.35);
}

.hero-copy h1 em {
  color: var(--green-bright);
  font-style: normal;
}

.hero-copy > p {
  max-width: 680px;
  margin: 0 0 28px;
  color: #b8bec8;
  font-size: 17px;
  line-height: 1.75;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  margin-top: 28px;
  color: #717987;
  font-family: var(--pixel);
  font-size: 8px;
  letter-spacing: 0.7px;
}

.portal-card {
  width: min(100%, 410px);
  justify-self: end;
  border: 1px solid var(--gold-soft);
  background: rgba(18, 21, 27, 0.93);
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.5), inset 0 0 0 4px rgba(255, 255, 255, 0.018);
  transform: rotate(1deg);
}

.portal-card-head,
.portal-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  color: #adb3bd;
  font-family: var(--pixel);
  font-size: 8px;
  letter-spacing: 0.8px;
}

.live-pill {
  padding: 4px 7px;
  color: var(--green-bright);
  border: 1px solid rgba(117, 234, 66, 0.4);
  background: rgba(117, 234, 66, 0.08);
}

.portal-preview {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 22px;
  padding: 18px;
  border: 1px solid #39404b;
  background: linear-gradient(135deg, #222731, #151820);
}

.portal-preview img {
  width: 45px;
  image-rendering: pixelated;
  filter: drop-shadow(0 0 16px rgba(117, 234, 66, 0.5));
}

.portal-preview strong,
.portal-preview small {
  display: block;
}

.portal-preview strong {
  font-family: var(--pixel);
  font-size: 11px;
}

.portal-preview small {
  margin-top: 6px;
  color: var(--muted);
}

.portal-card ul {
  padding: 0 22px 12px;
  list-style: none;
}

.portal-card li {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line-soft);
  color: #c9cdd3;
}

.portal-card li span {
  color: var(--gold);
  font-family: var(--pixel);
  font-size: 9px;
}

.portal-card-foot {
  justify-content: center;
  color: var(--green-bright);
  border-top: 1px solid var(--line);
  border-bottom: 0;
}

.feature-strip {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  max-width: 1280px;
  margin: -45px auto 0;
  border: 1px solid var(--line);
  background: #14171e;
  box-shadow: 0 20px 55px rgba(0, 0, 0, 0.3);
}

.feature-strip article {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 90px;
  padding: 18px 26px;
  border-right: 1px solid var(--line);
}

.feature-strip article:last-child {
  border-right: 0;
}

.feature-strip article > span {
  color: var(--green);
  font-family: var(--pixel);
  font-size: 16px;
}

.feature-strip strong,
.feature-strip small {
  display: block;
}

.feature-strip strong {
  font-family: var(--pixel);
  font-size: 9px;
}

.feature-strip small {
  margin-top: 6px;
  color: var(--muted);
}

.login-error {
  max-width: 700px;
  margin: 25px auto;
  padding: 16px;
  color: #ffc2bf;
  border: 1px solid #723638;
  background: #351d20;
  text-align: center;
}

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

.sidebar {
  position: fixed;
  z-index: 50;
  top: 0;
  bottom: 0;
  left: 0;
  display: flex;
  width: 268px;
  flex-direction: column;
  border-right: 1px solid #242a33;
  background: linear-gradient(180deg, #12151b 0%, #0d0f14 100%);
  box-shadow: 12px 0 40px rgba(0, 0, 0, 0.18);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 13px;
  height: 74px;
  padding: 0 20px;
  border-bottom: 1px solid var(--line-soft);
}

.sidebar-brand img {
  width: 39px;
  height: 39px;
  object-fit: contain;
}

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

.sidebar-brand strong {
  font-family: var(--pixel);
  font-size: 13px;
  letter-spacing: 0.5px;
}

.sidebar-brand small {
  margin-top: 4px;
  color: #777f8d;
  font-size: 11px;
}

.server-selector-wrap {
  margin: 16px 14px 6px;
  padding: 12px;
  border: 1px solid #303641;
  background: #181c23;
}

.server-selector-wrap label {
  display: block;
  margin-bottom: 8px;
  color: #6f7784;
  font-family: var(--pixel);
  font-size: 7px;
  letter-spacing: 0.8px;
}

.server-selector-wrap select {
  width: 100%;
  padding: 8px 26px 8px 8px;
  border: 0;
  color: #f5f5f0;
  background: transparent;
  font-weight: 700;
}

.side-nav {
  flex: 1;
  padding: 8px 10px 18px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #343a44 transparent;
}

.side-nav p {
  margin: 18px 13px 8px;
  color: #59616e;
  font-family: var(--pixel);
  font-size: 7px;
  letter-spacing: 1px;
}

.nav-item {
  position: relative;
  display: grid;
  grid-template-columns: 26px 1fr auto;
  align-items: center;
  width: 100%;
  min-height: 43px;
  padding: 0 12px;
  border: 1px solid transparent;
  color: #9aa1ac;
  background: transparent;
  text-align: left;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.nav-item > span {
  color: #6f7885;
  font-size: 17px;
  text-align: left;
}

.nav-item b {
  padding: 3px 6px;
  color: #94eb6d;
  border: 1px solid #3c6431;
  font-size: 9px;
}

.nav-item:hover {
  color: #dfe2e6;
  background: #181c23;
}

.nav-item.active {
  color: white;
  border-color: #34402f;
  background: linear-gradient(90deg, rgba(80, 154, 47, 0.18), rgba(31, 36, 44, 0.62));
}

.nav-item.active::before {
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: -1px;
  width: 3px;
  background: var(--green);
  box-shadow: 0 0 12px rgba(117, 234, 66, 0.55);
  content: "";
}

.nav-item.active > span {
  color: var(--green-bright);
}

.sidebar-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding: 12px 14px;
  border-top: 1px solid var(--line-soft);
  background: #101319;
}

.bot-health {
  display: flex;
  align-items: center;
  gap: 10px;
}

.bot-health strong,
.bot-health small {
  display: block;
}

.bot-health strong {
  font-family: var(--pixel);
  font-size: 8px;
}

.bot-health small {
  margin-top: 4px;
  color: #69717d;
  font-size: 10px;
}

.icon-button,
.notification-button,
.menu-toggle {
  display: grid;
  width: 36px;
  height: 36px;
  border: 1px solid #303640;
  color: #aeb4be;
  background: #191d24;
  place-items: center;
}

.dashboard-shell {
  grid-column: 2;
  min-width: 0;
}

.topbar {
  position: sticky;
  z-index: 40;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 74px;
  padding: 0 30px;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(14, 16, 21, 0.91);
  backdrop-filter: blur(18px);
}

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #626a77;
  font-family: var(--pixel);
  font-size: 8px;
  letter-spacing: 0.7px;
}

.breadcrumbs span {
  color: var(--green);
}

.breadcrumbs strong {
  color: #b9bec6;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.connection-pill {
  padding: 9px 12px;
  border: 1px solid #2d3f2a;
  background: rgba(49, 93, 37, 0.12);
}

.notification-button {
  position: relative;
  font-size: 19px;
}

.notification-button i {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--green);
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  padding-left: 5px;
}

.user-chip img,
.user-avatar-fallback {
  width: 36px;
  height: 36px;
  border: 1px solid #4a553f;
  background: #25331f;
  object-fit: cover;
}

.user-avatar-fallback {
  display: grid;
  color: var(--green);
  font-family: var(--pixel);
  font-size: 11px;
  place-items: center;
}

.user-chip strong,
.user-chip small {
  display: block;
}

.user-chip strong {
  max-width: 150px;
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-chip small {
  margin-top: 3px;
  color: #6d7581;
  font-size: 10px;
}

.menu-toggle {
  display: none;
}

.content {
  min-height: calc(100vh - 74px);
  padding: clamp(22px, 3vw, 42px);
  background:
    radial-gradient(circle at 85% 5%, rgba(80, 158, 48, 0.07), transparent 28%),
    var(--bg);
}

.loading-state,
.empty-state {
  display: grid;
  min-height: 60vh;
  align-content: center;
  justify-items: center;
  color: #747c88;
  font-family: var(--pixel);
  font-size: 9px;
}

.loading-state img {
  width: 56px;
  margin-bottom: 18px;
  image-rendering: pixelated;
  filter: drop-shadow(0 0 20px rgba(117, 234, 66, 0.5));
  animation: float 1.6s ease-in-out infinite;
}

@keyframes float {
  50% { transform: translateY(-8px); }
}

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.page-header h1 {
  margin: 7px 0 8px;
  font-family: var(--pixel);
  font-size: clamp(22px, 3vw, 36px);
  letter-spacing: -0.4px;
}

.page-header p {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.header-badge {
  flex: 0 0 auto;
  padding: 11px 14px;
  color: #b8ef9e;
  border: 1px solid #3e6534;
  background: #172417;
  font-family: var(--pixel);
  font-size: 8px;
}

.hero-dashboard {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(260px, 0.6fr);
  gap: 30px;
  min-height: 260px;
  margin-bottom: 24px;
  padding: clamp(25px, 4vw, 44px);
  overflow: hidden;
  border: 1px solid #3b4535;
  background:
    linear-gradient(90deg, rgba(18, 22, 27, 0.98), rgba(18, 22, 27, 0.68)),
    url("/assets/hero.webp") center 30% / cover;
  box-shadow: inset 0 0 0 4px rgba(255, 255, 255, 0.012), 0 20px 50px rgba(0, 0, 0, 0.2);
}

.hero-dashboard::before {
  position: absolute;
  inset: 0;
  border-top: 2px solid var(--gold-soft);
  content: "";
  pointer-events: none;
}

.hero-dashboard h2 {
  max-width: 700px;
  margin: 13px 0 12px;
  font-family: var(--pixel);
  font-size: clamp(23px, 3.4vw, 43px);
  line-height: 1.18;
}

.hero-dashboard h2 em {
  color: var(--green-bright);
  font-style: normal;
}

.hero-dashboard p {
  max-width: 650px;
  margin: 0 0 22px;
  color: #aab0b9;
  line-height: 1.7;
}

.progress-card {
  position: relative;
  z-index: 2;
  align-self: center;
  padding: 22px;
  border: 1px solid #394335;
  background: rgba(14, 17, 21, 0.85);
}

.progress-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 15px;
  font-family: var(--pixel);
  font-size: 9px;
}

.progress-card-head strong {
  color: var(--green-bright);
  font-size: 18px;
}

progress {
  width: 100%;
  height: 9px;
  border: 0;
  background: #272c33;
  accent-color: var(--green);
}

progress::-webkit-progress-bar { background: #272c33; }
progress::-webkit-progress-value { background: linear-gradient(90deg, #479e28, var(--green-bright)); }
progress::-moz-progress-bar { background: linear-gradient(90deg, #479e28, var(--green-bright)); }

.progress-card small {
  display: block;
  margin-top: 12px;
  color: #767e89;
  line-height: 1.45;
}

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

.metric-card {
  position: relative;
  min-height: 124px;
  padding: 20px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: linear-gradient(145deg, #191d24, #14171d);
}

.metric-card::after {
  position: absolute;
  right: -20px;
  bottom: -30px;
  width: 90px;
  height: 90px;
  border: 1px solid rgba(117, 234, 66, 0.08);
  transform: rotate(45deg);
  content: "";
}

.metric-card span {
  color: #777f8b;
  font-family: var(--pixel);
  font-size: 8px;
}

.metric-card strong {
  display: block;
  margin: 15px 0 4px;
  font-family: var(--pixel);
  font-size: 27px;
}

.metric-card small {
  color: #6f7782;
}

.metric-card small.good {
  color: #82d960;
}

.section-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.module-card,
.panel-card,
.form-card,
.audit-card {
  border: 1px solid var(--line);
  background: linear-gradient(145deg, #181c23, #13161c);
}

.module-card {
  position: relative;
  min-height: 175px;
  padding: 22px;
  overflow: hidden;
}

.module-card:hover {
  border-color: #46513f;
  transform: translateY(-2px);
}

.module-card,
.module-card:hover {
  transition: transform 0.16s ease, border-color 0.16s ease;
}

.module-icon {
  display: grid;
  width: 38px;
  height: 38px;
  margin-bottom: 17px;
  color: var(--green-bright);
  border: 1px solid #3b5833;
  background: rgba(83, 142, 53, 0.13);
  font-size: 19px;
  place-items: center;
}

.module-card h3 {
  margin: 0 0 8px;
  font-family: var(--pixel);
  font-size: 11px;
}

.module-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.module-card button {
  position: absolute;
  top: 18px;
  right: 18px;
  border: 0;
  color: #8ea184;
  background: transparent;
  font-size: 19px;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.65fr);
  gap: 18px;
}

.panel-card,
.form-card {
  padding: clamp(18px, 2.6vw, 28px);
}

.card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line-soft);
}

.card-heading h2,
.card-heading h3 {
  margin: 0 0 6px;
  font-family: var(--pixel);
  font-size: 14px;
}

.card-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.field-grid.one-column {
  grid-template-columns: 1fr;
}

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

.field.full {
  grid-column: 1 / -1;
}

.field > label,
.field > .field-label {
  color: #c5cad1;
  font-size: 12px;
  font-weight: 750;
}

.field small {
  color: #6f7784;
  line-height: 1.45;
}

.field input:not([type="checkbox"]):not([type="color"]),
.field select,
.field textarea {
  width: 100%;
  min-height: 45px;
  padding: 10px 13px;
  border: 1px solid #333a45;
  border-radius: 0;
  color: var(--text);
  background: #11141a;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field textarea {
  min-height: 95px;
  resize: vertical;
}

.field input:hover,
.field select:hover,
.field textarea:hover {
  border-color: #48515e;
}

.color-row {
  display: grid;
  grid-template-columns: 50px 1fr;
  gap: 10px;
}

.field input[type="color"] {
  width: 50px;
  height: 45px;
  padding: 4px;
  border: 1px solid #333a45;
  background: #11141a;
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 65px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line-soft);
}

.toggle-row:last-child {
  border-bottom: 0;
}

.toggle-copy strong,
.toggle-copy small {
  display: block;
}

.toggle-copy strong {
  font-size: 13px;
}

.toggle-copy small {
  margin-top: 5px;
  color: var(--muted);
  line-height: 1.4;
}

.switch {
  position: relative;
  flex: 0 0 auto;
  width: 46px;
  height: 25px;
}

.switch input {
  position: absolute;
  opacity: 0;
}

.switch span {
  position: absolute;
  inset: 0;
  border: 1px solid #454c57;
  background: #252a33;
  transition: 0.18s ease;
}

.switch span::before {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 15px;
  height: 15px;
  background: #727b88;
  content: "";
  transition: 0.18s ease;
}

.switch input:checked + span {
  border-color: #4e8f38;
  background: #244020;
}

.switch input:checked + span::before {
  background: var(--green-bright);
  box-shadow: 0 0 10px rgba(117, 234, 66, 0.45);
  transform: translateX(21px);
}

.form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line-soft);
}

.helper-panel {
  position: sticky;
  top: 96px;
  align-self: start;
  padding: 22px;
  border: 1px solid #394334;
  background: linear-gradient(145deg, #1a201a, #121712);
}

.helper-panel h3 {
  margin: 0 0 10px;
  color: #c8e6b9;
  font-family: var(--pixel);
  font-size: 11px;
}

.helper-panel p,
.helper-panel li {
  color: #8e9a8a;
  font-size: 13px;
  line-height: 1.6;
}

.helper-panel ol,
.helper-panel ul {
  padding-left: 20px;
}

.helper-panel .tip {
  margin-top: 18px;
  padding: 13px;
  color: #b7c7b0;
  border-left: 3px solid var(--green);
  background: rgba(117, 234, 66, 0.06);
  font-size: 12px;
  line-height: 1.55;
}

.preview-embed {
  padding: 16px;
  border-left: 4px solid var(--green);
  background: #22252b;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.preview-embed strong {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
}

.preview-embed p {
  margin: 0;
  color: #c0c4ca;
  font-size: 13px;
}

.readiness-list {
  display: grid;
  gap: 10px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.readiness-list li {
  display: grid;
  grid-template-columns: 25px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line-soft);
  background: #13161c;
}

.readiness-list li > span:first-child {
  color: var(--green);
}

.readiness-list li.missing > span:first-child {
  color: var(--warning);
}

.readiness-list li b {
  color: #7e8792;
  font-family: var(--pixel);
  font-size: 7px;
}

.readiness-list li.ready b { color: #78cc59; }
.readiness-list li.missing b { color: #d5a843; }

.category-list,
.rule-list,
.audit-list {
  display: grid;
  gap: 12px;
}

.category-card,
.rule-card {
  padding: 18px;
  border: 1px solid var(--line-soft);
  background: #12151b;
}

.category-head,
.rule-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 16px;
}

.category-head strong,
.rule-head strong {
  font-family: var(--pixel);
  font-size: 10px;
}

.category-fields,
.rule-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.category-fields .wide {
  grid-column: span 2;
}

.audit-card {
  display: grid;
  grid-template-columns: 45px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 16px;
}

.audit-icon {
  display: grid;
  width: 38px;
  height: 38px;
  color: var(--green);
  border: 1px solid #35452f;
  background: #182117;
  place-items: center;
}

.audit-card strong,
.audit-card small {
  display: block;
}

.audit-card strong {
  margin-bottom: 5px;
  font-size: 13px;
}

.audit-card small,
.audit-card time {
  color: #747c88;
  font-size: 11px;
}

.empty-inline {
  padding: 35px;
  border: 1px dashed #3a414b;
  color: #7b838e;
  text-align: center;
}

.toast-region {
  position: fixed;
  z-index: 200;
  right: 22px;
  bottom: 22px;
  display: grid;
  width: min(390px, calc(100vw - 44px));
  gap: 10px;
}

.toast {
  padding: 15px 17px;
  border: 1px solid #416435;
  color: #d7e9ce;
  background: #172217;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
  animation: toast-in 0.22s ease-out;
}

.toast.error {
  color: #ffd0cd;
  border-color: #743f41;
  background: #321d20;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(10px); }
}

@media (max-width: 1100px) {
  .login-hero { grid-template-columns: 1fr; }
  .portal-card { justify-self: start; }
  .metrics-grid { grid-template-columns: repeat(2, 1fr); }
  .section-grid { grid-template-columns: repeat(2, 1fr); }
  .content-grid { grid-template-columns: 1fr; }
  .helper-panel { position: static; }
}

@media (max-width: 860px) {
  .public-nav { grid-template-columns: 1fr auto; }
  .public-status { display: none; }
  .feature-strip { grid-template-columns: 1fr; margin: 0; }
  .feature-strip article { border-right: 0; border-bottom: 1px solid var(--line); }
  .dashboard { display: block; }
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.22s ease;
  }
  .dashboard.menu-open .sidebar { transform: translateX(0); }
  .dashboard-shell { margin-left: 0; }
  .menu-toggle { display: grid; }
  .breadcrumbs { display: none; }
  .topbar { padding: 0 16px; }
  .connection-pill { display: none; }
  .content { padding: 22px 16px; }
  .category-fields,
  .rule-fields { grid-template-columns: 1fr; }
  .category-fields .wide { grid-column: auto; }
}

@media (max-width: 620px) {
  .public-nav { padding: 0 18px; }
  .brand { font-size: 13px; }
  .public-nav .button { padding: 0 10px; font-size: 7px; }
  .login-hero { padding: 55px 20px 70px; }
  .hero-copy h1 { font-size: 34px; }
  .hero-copy > p { font-size: 15px; }
  .hero-actions .button { width: 100%; }
  .portal-card { transform: none; }
  .trust-row { display: grid; gap: 10px; }
  .metrics-grid,
  .section-grid,
  .field-grid { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
  .hero-dashboard { grid-template-columns: 1fr; }
  .page-header { align-items: flex-start; flex-direction: column; }
  .topbar-actions { gap: 7px; }
  .notification-button { display: none; }
  .user-chip strong { max-width: 90px; }
  .user-chip small { display: none; }
  .audit-card { grid-template-columns: 38px minmax(0, 1fr); }
  .audit-card time { grid-column: 2; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
