:root {
  --bg: #0b1020;
  --bg-soft: #121a2d;
  --panel: rgba(19, 28, 46, 0.9);
  --panel-alt: rgba(18, 22, 35, 0.9);
  --border: rgba(148, 163, 184, 0.18);
  --text: #e5ecff;
  --muted: #a6b0c7;
  --gold: #f4b942;
  --gold-soft: rgba(244, 185, 66, 0.22);
  --cyan: #60a5fa;
  --violet: #8b5cf6;
  --green: #4ade80;
  --error-text: #fca5a5;
  --document-line: rgba(148, 163, 184, 0.24);
  --page-radius: 26px;
  --guide-rail-width: 220px;
  --reading-width: 68ch;
  --shadow: 0 20px 45px rgba(2, 6, 23, 0.5);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  min-height: 100%;
  font-family: "Inter", sans-serif;
  background:
    radial-gradient(circle at top, rgba(96, 165, 250, 0.22), transparent 30%),
    linear-gradient(180deg, #080d18 0%, #0b1020 100%);
  color: var(--text);
}

body {
  display: flex;
  justify-content: center;
  padding: 32px 18px;
}

button {
  font: inherit;
}

.page-shell {
  width: min(1200px, 100%);
  background: rgba(8, 12, 22, 0.8);
  border: 1px solid var(--border);
  border-radius: 26px;
  box-shadow: var(--shadow);
  overflow: hidden;
  backdrop-filter: blur(8px);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  background: rgba(10, 14, 25, 0.7);
  border-bottom: 1px solid var(--border);
  padding: 18px 24px;
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: block;
  border-radius: 14px;
  object-fit: cover;
  background: var(--bg-soft);
}

.eyebrow {
  margin: 0 0 4px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.68rem;
  color: var(--muted);
}

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

h1 {
  margin: 0;
  font-size: 1.1rem;
}

.main-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tab,
.subtab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 999px;
  padding: 10px 16px;
  cursor: pointer;
  text-decoration: none;
  transition: 0.2s ease;
}

.tab:hover,
.subtab:hover,
.tab.active,
.subtab.active {
  color: var(--text);
  border-color: rgba(244, 185, 66, 0.5);
  background: rgba(244, 185, 66, 0.08);
  box-shadow: 0 0 0 1px rgba(244, 185, 66, 0.2) inset;
}

.tab:focus-visible,
.subtab:focus-visible,
.primary:focus-visible,
.secondary:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

.content {
  padding: 26px 24px 32px;
}

/* Recrutement : actions contextuelles */
.role-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--document-line);
}

.role-actions .secondary {
  padding-right: 0;
  padding-left: 0;
  color: var(--text);
  border: 0;
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* Pages documentaires */
.document-page {
  max-width: 1180px;
  margin: 0 auto;
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
  color: var(--muted);
  font-size: 0.85rem;
}

.breadcrumbs a {
  color: var(--muted);
  text-decoration: none;
}

.breadcrumbs a:hover,
.breadcrumbs a:focus-visible {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.breadcrumbs [aria-current="location"] {
  color: var(--text);
}

.document-header {
  max-width: var(--reading-width);
  margin-bottom: 38px;
}

.document-header h2 {
  margin: 0 0 14px;
  font-size: clamp(2rem, 3.5vw, 3rem);
  line-height: 1.08;
}

.document-intro {
  max-width: 65ch;
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.65;
}

.application-subtitle {
  margin: -2px 0 12px;
  color: var(--text);
  font-weight: 700;
  line-height: 1.5;
}

.application-instruction {
  margin: 20px 0 0;
  padding: 13px 15px;
  color: var(--text);
  background: rgba(96, 165, 250, 0.08);
  border-radius: 12px;
  line-height: 1.6;
}

.guide-mobile-control {
  display: none;
}

.guide-layout {
  display: grid;
  grid-template-columns: var(--guide-rail-width) minmax(0, 1fr);
  gap: 48px;
  align-items: start;
}

.chapter-rail {
  position: sticky;
  top: 24px;
  display: grid;
  gap: 6px;
  padding-left: 12px;
  border-left: 1px solid var(--document-line);
}

.chapter-link {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 10px 12px;
  color: var(--muted);
  text-decoration: none;
  border-radius: 0 12px 12px 0;
}

.chapter-link:hover,
.chapter-link:focus-visible {
  color: var(--text);
  background: rgba(244, 185, 66, 0.06);
}

.chapter-link.is-active {
  color: var(--text);
  background: var(--gold-soft);
  clip-path: polygon(0 0, 100% 0, 96% 52%, 100% 100%, 0 100%);
}

.chapter-number {
  color: var(--gold);
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.08em;
}

.guide-document {
  max-width: var(--reading-width);
}

.guide-welcome {
  padding: 0 0 32px;
  border-bottom: 1px solid var(--document-line);
}

.guide-welcome h3,
.guide-section h3 {
  margin: 0 0 16px;
  color: var(--text);
  font-size: clamp(1.45rem, 2.4vw, 1.75rem);
  line-height: 1.2;
}

.guide-welcome p,
.guide-section p {
  margin: 0 0 16px;
  color: var(--text);
  line-height: 1.75;
}

.guide-section {
  scroll-margin-top: 24px;
  padding: 42px 0;
  border-bottom: 1px solid var(--document-line);
}

.guide-section > :last-child,
.guide-subsection > :last-child,
.guide-phase > :last-child {
  margin-bottom: 0;
}

.guide-list {
  display: grid;
  gap: 12px;
  margin: 18px 0 0;
  padding-left: 22px;
  color: var(--text);
  line-height: 1.7;
}

.guide-list li::marker {
  color: var(--gold);
}

.guide-list-numbered {
  gap: 10px;
}

.guide-subsection {
  padding: 20px 0;
  border-top: 1px solid rgba(148, 163, 184, 0.14);
}

.guide-subsection h4 {
  margin: 0 0 10px;
  color: var(--text);
  font-size: 1.15rem;
}

.guide-phase {
  padding: 16px 0;
  border-top: 1px solid rgba(148, 163, 184, 0.14);
}

.guide-phase h5 {
  margin: 0 0 8px;
  color: var(--gold);
  font-size: 1rem;
}

.guide-endcap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  padding-top: 32px;
}

.guide-endcap p {
  margin: 0;
  color: var(--text);
  font-weight: 700;
}

.document-back-link {
  display: inline-flex;
  width: fit-content;
  margin-top: 24px;
  color: var(--muted);
  text-underline-offset: 4px;
}

.document-back-link:hover,
.document-back-link:focus-visible {
  color: var(--text);
}

/* Candidature testeur */
.application-page .document-header {
  max-width: 72ch;
}

.application-surface {
  display: grid;
  grid-template-columns: minmax(0, 1.38fr) minmax(280px, 1fr);
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 22px;
}

.application-single-surface {
  display: block;
  max-width: 760px;
}

.application-single-surface .application-form {
  max-width: 680px;
}

.admin-applications {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--document-line);
}

.admin-applications .admin-topbar {
  margin-bottom: 16px;
}

.applications-list {
  display: grid;
  gap: 14px;
}

.archived-title {
  margin: 28px 0 14px;
  color: var(--muted);
}

.application-admin-card {
  padding: 18px;
  background: rgba(10, 14, 25, 0.72);
  border: 1px solid var(--border);
  border-radius: 14px;
}

.application-admin-card p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.application-admin-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: baseline;
}

.application-admin-heading h4 {
  margin: 0;
  color: var(--gold);
  text-transform: capitalize;
}

.application-admin-heading time {
  color: var(--muted);
  font-size: 0.8rem;
}

.archive-application {
  margin-top: 16px;
  padding: 8px 12px;
  color: var(--text);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
}

.archive-application:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.archive-meta {
  color: var(--gold) !important;
  font-size: 0.85rem;
}

.application-form,
.message-preview {
  min-width: 0;
  padding: 28px;
}

.message-preview {
  margin: 0;
  background: var(--bg-soft);
  border-left: 1px solid var(--document-line);
}

.message-preview summary {
  list-style: none;
  cursor: pointer;
}

.message-preview summary::-webkit-details-marker {
  display: none;
}

.preview-header .eyebrow {
  margin-bottom: 6px;
}

.preview-header h3 {
  margin: 0;
  color: var(--text);
  font-size: 1.35rem;
}

.preview-text {
  min-height: 360px;
  margin: 22px 0 16px;
  padding: 18px;
  overflow: auto;
  color: var(--text);
  background: rgba(10, 14, 25, 0.7);
  border: 1px solid var(--border);
  border-radius: 12px;
  font: inherit;
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  user-select: text;
}

.preview-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.6;
}

.required-note {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.5;
}

.form-field {
  margin-bottom: 24px;
}

.form-field label {
  display: block;
  margin-bottom: 8px;
  color: var(--text);
  font-weight: 600;
  line-height: 1.45;
}

.field-help {
  margin: -2px 0 8px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.5;
}

.application-form input,
.application-form textarea {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 12px 14px;
  color: var(--text);
  background: rgba(15, 21, 36, 0.96);
  border: 1px solid var(--border);
  border-radius: 12px;
  font: inherit;
  line-height: 1.5;
  resize: vertical;
}

.application-form input:focus-visible,
.application-form textarea:focus-visible {
  border-color: rgba(244, 185, 66, 0.7);
  box-shadow: 0 0 0 3px rgba(244, 185, 66, 0.12);
}

.application-form input[aria-invalid="true"],
.application-form textarea[aria-invalid="true"] {
  border-color: var(--error-text);
}

.field-error {
  min-height: 20px;
  margin: 6px 0 0;
  color: var(--error-text);
  font-size: 0.82rem;
  line-height: 1.45;
}

.field-error:empty {
  display: none;
}

.application-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-top: 30px;
}

.application-actions .document-back-link {
  margin: 0;
}

.application-actions button:disabled {
  cursor: wait;
  opacity: 0.7;
}

.copy-status {
  min-height: 22px;
  margin: 14px 0 0;
  color: var(--gold);
  font-size: 0.9rem;
  line-height: 1.5;
}

.copy-status:not(:empty) {
  padding: 10px 12px;
  background: rgba(74, 222, 128, 0.08);
  border-radius: 10px;
}

.application-thanks {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

.noscript-note {
  margin-top: 28px;
  padding: 20px;
  background: var(--panel-alt);
  border: 1px solid var(--border);
  border-radius: 16px;
}

.noscript-note h3 {
  margin: 0 0 10px;
  font-size: 1.1rem;
}

.noscript-note p {
  color: var(--muted);
  line-height: 1.6;
}

.noscript-note textarea {
  width: 100%;
  padding: 12px;
  color: var(--text);
  background: rgba(15, 21, 36, 0.96);
  border: 1px solid var(--border);
  border-radius: 12px;
  font: inherit;
  line-height: 1.5;
}

.clipboard-fallback {
  position: fixed;
  width: 1px;
  height: 1px;
  padding: 0;
  opacity: 0;
  pointer-events: none;
}

@media (max-width: 840px) {
  .guide-layout {
    display: block;
  }

  .chapter-rail {
    display: none;
  }

  .guide-mobile-control {
    display: grid;
    gap: 8px;
    margin-bottom: 24px;
  }

  .guide-mobile-control label {
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 600;
  }

  .guide-mobile-control select {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    color: var(--text);
    background: rgba(15, 21, 36, 0.96);
    border: 1px solid var(--border);
    border-radius: 12px;
    font: inherit;
  }

  .application-surface {
    grid-template-columns: 1fr;
  }

  .message-preview {
    border-top: 1px solid var(--document-line);
    border-left: 0;
  }
}

@media (max-width: 520px) {
  .role-actions,
  .application-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .role-actions .primary,
  .role-actions .secondary,
  .application-actions .primary {
    width: 100%;
  }

  .guide-section {
    padding: 34px 0;
  }

  .application-form,
  .message-preview {
    padding: 22px 18px;
  }

  .preview-text {
    min-height: 300px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .panel,
  .chapter-link,
  button,
  a {
    animation: none;
    transition: none;
  }
}

.panel {
  display: none;
  animation: fadeIn 0.25s ease;
}

.panel.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  align-items: center;
  gap: 30px;
  padding: 18px 10px 8px;
}

.pill {
  display: inline-block;
  background: var(--gold-soft);
  color: var(--gold);
  border: 1px solid rgba(244, 185, 66, 0.3);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 18px;
}

.hero-copy h2 {
  font-size: clamp(2.2rem, 4vw, 4rem);
  line-height: 1.08;
  margin-bottom: 14px;
}

.hero-copy p {
  max-width: 620px;
  color: var(--muted);
  font-size: 1.04rem;
  line-height: 1.7;
}

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

.primary,
.secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 12px;
  padding: 12px 20px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}

.primary {
  background: linear-gradient(135deg, var(--gold), #ff8f45);
  color: #1b1203;
}

.secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.hero-visual {
  position: relative;
  min-height: 360px;
  border-radius: 26px;
  background:
    linear-gradient(135deg, rgba(96, 165, 250, 0.11), rgba(139, 92, 246, 0.18)),
    rgba(15, 21, 36, 0.92);
  border: 1px solid var(--border);
  overflow: hidden;
}

.map-glow {
  position: absolute;
  inset: 18% 18%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(96, 165, 250, 0.35), rgba(96, 165, 250, 0.04) 60%, transparent 72%);
  filter: blur(22px);
}

.mini-card {
  position: absolute;
  right: 26px;
  bottom: 24px;
  display: grid;
  gap: 6px;
  background: rgba(10, 14, 25, 0.8);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px 20px;
  width: 200px;
}

.mini-card span,
.mini-card small {
  color: var(--muted);
}

.mini-card strong {
  font-size: 2rem;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
}

.section-header h2,
.section-header h3 {
  font-size: clamp(1.7rem, 3vw, 2.5rem);
  margin: 0;
}

.map-panel,
.job-card,
.info-card,
.nation-card {
  background: linear-gradient(180deg, rgba(17, 24, 39, 0.95), rgba(11, 16, 28, 0.9));
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.map-panel {
  min-height: 480px;
  padding: 22px;
}

.live-map-panel {
  padding: 16px;
}

.live-map-frame {
  width: 100%;
  min-height: clamp(420px, 70vh, 720px);
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 16px;
  background: #0a0f19;
}

.live-map {
  display: block;
  width: 100%;
  height: clamp(420px, 70vh, 720px);
  border: 0;
  background: #0a0f19;
}

.map-fallback {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 14px;
  color: var(--muted);
}

.map-fallback p {
  margin: 0;
}

.world-map {
  position: relative;
  width: 100%;
  height: 430px;
  border-radius: 20px;
  background:
    radial-gradient(circle at center, rgba(96, 165, 250, 0.15), transparent 40%),
    linear-gradient(160deg, rgba(10, 15, 25, 0.9), rgba(19, 31, 52, 0.8));
  border: 1px solid rgba(148, 163, 184, 0.18);
  overflow: hidden;
}

.world-map::before {
  content: "";
  position: absolute;
  inset: 18% 12%;
  background: rgba(255,255,255,0.02);
  border-radius: 46% 54% 55% 45% / 48% 42% 58% 52%;
  border: 1px solid rgba(148, 163, 184, 0.16);
  transform: rotate(-12deg);
}

.node {
  position: absolute;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  font-weight: 700;
  background: linear-gradient(135deg, rgba(96, 165, 250, 0.4), rgba(17, 24, 39, 0.8));
  border: 1px solid rgba(96, 165, 250, 0.7);
  box-shadow: 0 0 14px rgba(96, 165, 250, 0.3);
}

.n1 { top: 18%; left: 18%; }
.n2 { top: 30%; left: 48%; }
.n3 { top: 22%; right: 22%; }
.n4 { top: 50%; left: 26%; }
.n5 { top: 55%; right: 33%; }
.n6 { bottom: 16%; left: 42%; }
.n7 { bottom: 12%; right: 18%; }

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

.info-card,
.nation-card {
  padding: 22px 22px 18px;
}

.info-card h3,
.info-card h4,
.nation-card h3,
.nation-card h4,
.job-card h3,
.job-card h4 {
  font-size: 1.2rem;
  margin-bottom: 10px;
}

.info-card p,
.job-card p,
.nation-card p {
  color: var(--muted);
  line-height: 1.7;
  margin: 0;
}

.subtabs {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
}

.subtab-panel {
  display: none;
}

.subtab-panel.active {
  display: block;
}

.job-card {
  padding: 24px;
}

.job-card ul {
  margin: 16px 0 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.8;
}

.tag {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 16px;
  border: 1px solid;
}

.tag.ember {
  color: #f9c66b;
  background: rgba(244, 185, 66, 0.08);
  border-color: rgba(244, 185, 66, 0.25);
}

.tag.cyan {
  color: #88d6ff;
  background: rgba(96, 165, 250, 0.08);
  border-color: rgba(96, 165, 250, 0.25);
}

.tag.violet {
  color: #c9a8ff;
  background: rgba(139, 92, 246, 0.08);
  border-color: rgba(139, 92, 246, 0.25);
}

.console-trigger {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 20;
  border: 1px solid rgba(244, 185, 66, 0.35);
  background: linear-gradient(135deg, rgba(244, 185, 66, 0.2), rgba(96, 165, 250, 0.12));
  color: var(--text);
  padding: 12px 18px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 700;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.28);
}

.admin-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 8, 18, 0.75);
  backdrop-filter: blur(4px);
  display: grid;
  place-items: center;
  z-index: 40;
}

.admin-overlay.hidden,
.admin-panel.hidden,
.admin-login-box.hidden {
  display: none;
}

.admin-login-box,
.admin-panel {
  width: min(520px, calc(100% - 24px));
  background: rgba(11, 16, 28, 0.96);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.admin-login-box {
  padding: 24px;
}

.admin-login-box h3,
.admin-topbar h3 {
  margin: 0 0 18px;
  font-size: 1.5rem;
}

#adminLoginForm {
  display: grid;
  gap: 16px;
}

#adminLoginForm label,
.admin-form-grid label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.9rem;
}

#adminLoginForm input,
#adminLoginForm button,
.admin-form-grid input,
.admin-form-grid textarea,
.admin-actions button {
  font: inherit;
}

#adminLoginForm input,
.admin-form-grid input,
.admin-form-grid textarea {
  width: 100%;
  background: rgba(15, 21, 36, 0.96);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  color: var(--text);
}

#adminLoginForm button,
.admin-actions button,
.close-btn {
  border: none;
  border-radius: 12px;
  padding: 12px 16px;
  font-weight: 700;
  cursor: pointer;
}

#adminLoginForm button,
.primary-action {
  background: linear-gradient(135deg, var(--gold), #ff8f45);
  color: #1d1205;
}

.secondary-action {
  background: rgba(96, 165, 250, 0.12);
  color: var(--text);
  border: 1px solid rgba(96, 165, 250, 0.3);
}

.ghost-action {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.console-hint {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.admin-panel {
  position: fixed;
  right: 20px;
  top: 20px;
  z-index: 50;
  padding: 18px;
}

.admin-page {
  max-width: 720px;
  margin: 0 auto;
}

.admin-page-panel {
  position: static;
  width: 100%;
  padding: 24px;
}

.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.close-btn {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border: 1px solid var(--border);
}

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

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

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.console-status {
  margin-top: 18px;
  color: var(--gold);
  min-height: 20px;
  font-size: 0.9rem;
}

@media (max-width: 840px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero,
  .info-grid,
  .nation-grid {
    grid-template-columns: 1fr;
  }

  .hero-visual {
    min-height: 260px;
  }
}

@media (max-width: 640px) {
  .admin-form-grid {
    grid-template-columns: 1fr;
  }

  .map-fallback {
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-panel {
    left: 12px;
    right: 12px;
    top: 12px;
    width: auto;
  }
}

@media (max-width: 520px) {
  .content {
    padding: 18px 16px 22px;
  }

  .topbar {
    padding: 16px 18px;
  }

  .main-tabs,
  .subtabs {
    width: 100%;
  }

  .tab,
  .subtab {
    flex: 1 1 40%;
    text-align: center;
  }
}
