/* Author: Daniel Hallman | Publisher: Moosh Works */
/* Magazine visual system isolated under body.mag-page and .mag-* selectors */

body.mag-page {
  --mag-canvas: #FAF6EE;
  --mag-surface: #FFFFFF;
  --mag-tint: #FFF1EC;
  --mag-ink: #141210;
  --mag-mute: #574C43;
  --mag-rule: #D6CEC2;
  --mag-accent: #C2381A;
  --mag-accent-hover: #9E2B12;
  --mag-accent-ink: #FFFFFF;
  --mag-border: #141210;
  --mag-shadow: rgba(20, 18, 16, 0.12);

  --sheet: var(--mag-canvas);
  --fill: var(--mag-surface);
  --ink: var(--mag-ink);
  --mute: var(--mag-mute);
  --rule: var(--mag-rule);
  --stamp: var(--mag-accent);
  --stamp-hover: var(--mag-accent-hover);

  margin: 0;
  padding: 0;
  background-color: var(--mag-canvas);
  background-image: none;
  color: var(--mag-ink);
  font-family: "Source Serif 4", Georgia, serif;
  line-height: 1.65;
  overflow-x: clip;
}

/* 6 Distinct Magazine Themes */
body.mag-page.theme-editorial-coral,
.theme-editorial-coral {
  --mag-canvas: #FAF6EE;
  --mag-surface: #FFFFFF;
  --mag-tint: #FFF1EC;
  --mag-ink: #141210;
  --mag-mute: #574C43;
  --mag-rule: #DFD5C8;
  --mag-accent: #C2381A;
  --mag-accent-hover: #9E2B12;
  --mag-accent-ink: #FFFFFF;
  --mag-border: #141210;
}

body.mag-page.theme-cobalt-tech,
.theme-cobalt-tech {
  --mag-canvas: #EEF4FF;
  --mag-surface: #FFFFFF;
  --mag-tint: #DBEAFE;
  --mag-ink: #0B1426;
  --mag-mute: #3B4D6B;
  --mag-rule: #BFDBFE;
  --mag-accent: #155EEF;
  --mag-accent-hover: #004EEB;
  --mag-accent-ink: #FFFFFF;
  --mag-border: #0B1426;
}

body.mag-page.theme-emerald-playbook,
.theme-emerald-playbook {
  --mag-canvas: #ECFDF5;
  --mag-surface: #FFFFFF;
  --mag-tint: #D1FAE5;
  --mag-ink: #06281E;
  --mag-mute: #2D594B;
  --mag-rule: #A7F3D0;
  --mag-accent: #047857;
  --mag-accent-hover: #065F46;
  --mag-accent-ink: #FFFFFF;
  --mag-border: #06281E;
}

body.mag-page.theme-amber-dossier,
.theme-amber-dossier {
  --mag-canvas: #FEF7E6;
  --mag-surface: #FFFDF9;
  --mag-tint: #FDE68A;
  --mag-ink: #1F160A;
  --mag-mute: #634B2E;
  --mag-rule: #F3D999;
  --mag-accent: #B45309;
  --mag-accent-hover: #92400E;
  --mag-accent-ink: #FFFFFF;
  --mag-border: #1F160A;
}

body.mag-page.theme-plum-compare,
.theme-plum-compare {
  --mag-canvas: #F7F2FA;
  --mag-surface: #FFFFFF;
  --mag-tint: #F3E8FF;
  --mag-ink: #1E1028;
  --mag-mute: #5B456B;
  --mag-rule: #E2D4F0;
  --mag-accent: #7E22CE;
  --mag-accent-hover: #6B21A8;
  --mag-accent-ink: #FFFFFF;
  --mag-border: #1E1028;
}

body.mag-page.theme-ink-faq,
.theme-ink-faq {
  --mag-canvas: #F8FAFC;
  --mag-surface: #FFFFFF;
  --mag-tint: #E0F2FE;
  --mag-ink: #0F172A;
  --mag-mute: #475569;
  --mag-rule: #CBD5E1;
  --mag-accent: #0369A1;
  --mag-accent-hover: #075985;
  --mag-accent-ink: #FFFFFF;
  --mag-border: #0F172A;
}

/* Global Resets Inside Magazine Pages (neutralizing sheet.css & ghl-theme.css leaks) */
body.mag-page :focus-visible {
  outline: 3px solid var(--mag-accent);
  outline-offset: 2px;
}

body.mag-page h1,
body.mag-page h2,
body.mag-page h3,
body.mag-page h4 {
  font-family: "Fraunces", "Source Serif 4", Georgia, serif;
  color: inherit;
  margin-top: 0;
  text-wrap: balance;
}

body.mag-page h1 {
  font-size: clamp(2rem, 4.6vw, 3.5rem);
  line-height: 1.08;
  letter-spacing: -0.025em;
  margin-bottom: 16px;
}

body.mag-page h2 {
  font-size: clamp(1.55rem, 3vw, 2.25rem);
  line-height: 1.15;
  margin-top: 0;
  margin-bottom: 14px;
  border-bottom: none;
  padding-bottom: 0;
}

body.mag-page h3 {
  font-size: 1.3rem;
  line-height: 1.25;
  margin-bottom: 10px;
}

body.mag-page p,
body.mag-page li {
  font-size: 1.05rem;
  line-height: 1.6;
  margin-bottom: 12px;
}

body.mag-page a:where(:not(.mag-btn):not(.mag-nav-link):not(.mag-tag):not(.mag-wordmark):not(.mag-breadcrumbs-link)) {
  color: var(--mag-accent);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}

body.mag-page code {
  font-family: "Spline Sans Mono", ui-monospace, monospace;
  font-size: 0.88em;
  background: rgba(15, 23, 42, 0.06);
  padding: 2px 6px;
  border-radius: 4px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

body.mag-page pre {
  overflow-x: auto;
  max-width: 100%;
}

body.mag-page form.mag-form-reset {
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
  box-shadow: none;
}

body.mag-page img {
  max-width: 100%;
}

/* Skip Link */
.mag-skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  z-index: 1000;
  padding: 10px 16px;
  background: var(--mag-ink);
  color: #FFFFFF;
  font-family: "Plus Jakarta Sans", -apple-system, sans-serif;
  font-weight: 700;
  border-radius: 8px;
}

.mag-skip-link:focus {
  left: 12px;
}

/* Wrapper */
.mag-wrap {
  width: 100%;
  max-width: 1220px;
  margin: 0 auto;
  padding: 0 28px;
}

/* Masthead & Primary Navigation */
.mag-masthead {
  background: var(--mag-surface);
  color: var(--mag-ink);
  border-bottom: 3px solid var(--mag-border);
  position: relative;
  z-index: 20;
}

.mag-masthead-accent {
  height: 7px;
  width: 100%;
  background: linear-gradient(90deg, #D94626 0%, #B45309 22%, #059669 48%, #155EEF 74%, #7E22CE 100%);
}

.mag-masthead-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 16px 0 12px;
  border-bottom: 1px dashed var(--mag-rule);
}

.mag-brand-group {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 12px;
}

body.mag-page .mag-wordmark {
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--mag-ink);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  touch-action: manipulation;
}

body.mag-page .mag-wordmark:hover {
  color: var(--mag-accent);
  text-decoration: none;
}

.mag-edition-pill {
  font-family: "Spline Sans Mono", ui-monospace, monospace;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--mag-tint);
  color: var(--mag-ink);
  border: 1.5px solid var(--mag-border);
}

.mag-masthead-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  font-family: "Spline Sans Mono", ui-monospace, monospace;
  font-size: 0.75rem;
  color: var(--mag-mute);
  text-transform: uppercase;
}

.mag-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px 0 12px;
}

body.mag-page .mag-nav-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 13px;
  border-radius: 9px;
  font-family: "Plus Jakarta Sans", -apple-system, sans-serif;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--mag-ink);
  text-decoration: none;
  border: 1.5px solid transparent;
  touch-action: manipulation;
  transition: background-color 0.16s ease, color 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}

body.mag-page .mag-nav-link:hover {
  background: var(--mag-tint);
  border-color: var(--mag-border);
  text-decoration: none;
}

body.mag-page .mag-nav-link[aria-current="page"] {
  background: var(--mag-ink);
  color: #FFFFFF;
  border-color: var(--mag-ink);
}

body.mag-page .mag-nav-link--cta {
  margin-left: auto;
  background: var(--mag-accent);
  color: var(--mag-accent-ink);
  border-color: var(--mag-border);
  box-shadow: 2px 2px 0 var(--mag-border);
}

body.mag-page .mag-nav-link--cta:hover {
  background: var(--mag-accent-hover);
  color: var(--mag-accent-ink);
  transform: translate(-1px, -1px);
}

/* Contrasting Alternating Bands */
.mag-strip {
  padding: 48px 0;
  border-bottom: 2px solid var(--mag-border);
  position: relative;
}

.mag-strip--compact {
  padding: 28px 0;
}

.mag-strip--paper {
  background-color: #FAF6EE;
  color: #141210;
  --mag-canvas: #FAF6EE;
  --mag-surface: #FFFFFF;
  --mag-tint: #FFF1EC;
  --mag-ink: #141210;
  --mag-mute: #574C43;
  --mag-rule: #DFD5C8;
  --mag-border: #141210;
}

.mag-strip--white {
  background-color: #FFFFFF;
  color: #0B1426;
  --mag-canvas: #FFFFFF;
  --mag-surface: #F8FAFC;
  --mag-tint: #EFF6FF;
  --mag-ink: #0B1426;
  --mag-mute: #475569;
  --mag-rule: #CBD5E1;
  --mag-border: #0B1426;
}

.mag-strip--ink {
  background-color: #111827;
  color: #F9FAFB;
  --mag-canvas: #1E293B;
  --mag-surface: #0F172A;
  --mag-tint: #1E293B;
  --mag-ink: #F9FAFB;
  --mag-mute: #CBD5E1;
  --mag-rule: #374151;
  --mag-accent: #38BDF8;
  --mag-accent-hover: #7DD3FC;
  --mag-accent-ink: #0B1426;
  --mag-border: #334155;
}

.mag-strip--ink a:not(.mag-btn):not(.mag-tag) {
  color: #7DD3FC;
}

.mag-strip--ink .mag-badge {
  background: #1E293B;
  color: #F9FAFB;
  border-color: #475569;
}

body.mag-page .mag-strip--ink code {
  background: rgba(255, 255, 255, 0.12);
  color: #E0F2FE;
}

.mag-strip--cobalt {
  background-color: #EEF4FF;
  color: #0B1426;
  --mag-canvas: #EEF4FF;
  --mag-surface: #FFFFFF;
  --mag-tint: #DBEAFE;
  --mag-ink: #0B1426;
  --mag-mute: #3B4D6B;
  --mag-rule: #BFDBFE;
  --mag-accent: #155EEF;
  --mag-accent-hover: #004EEB;
  --mag-accent-ink: #FFFFFF;
  --mag-border: #0B1426;
}

.mag-strip--emerald {
  background-color: #ECFDF5;
  color: #06281E;
  --mag-canvas: #ECFDF5;
  --mag-surface: #FFFFFF;
  --mag-tint: #D1FAE5;
  --mag-ink: #06281E;
  --mag-mute: #2D594B;
  --mag-rule: #A7F3D0;
  --mag-accent: #047857;
  --mag-accent-hover: #065F46;
  --mag-accent-ink: #FFFFFF;
  --mag-border: #06281E;
}

.mag-strip--amber {
  background-color: #FEF7E6;
  color: #1F160A;
  --mag-canvas: #FEF7E6;
  --mag-surface: #FFFDF9;
  --mag-tint: #FDE68A;
  --mag-ink: #1F160A;
  --mag-mute: #634B2E;
  --mag-rule: #F3D999;
  --mag-accent: #B45309;
  --mag-accent-hover: #92400E;
  --mag-accent-ink: #FFFFFF;
  --mag-border: #1F160A;
}

.mag-strip--plum {
  background-color: #F7F2FA;
  color: #1E1028;
  --mag-canvas: #F7F2FA;
  --mag-surface: #FFFFFF;
  --mag-tint: #F3E8FF;
  --mag-ink: #1E1028;
  --mag-mute: #5B456B;
  --mag-rule: #E2D4F0;
  --mag-accent: #7E22CE;
  --mag-accent-hover: #6B21A8;
  --mag-accent-ink: #FFFFFF;
  --mag-border: #1E1028;
}

/* Section Headers, Kickers & Ledger */
.mag-section-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 26px;
}

.mag-section-head > * {
  min-width: 0;
  max-width: 100%;
}

.mag-kicker {
  display: inline-block;
  font-family: "Spline Sans Mono", ui-monospace, monospace;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--mag-tint);
  color: var(--mag-ink);
  border: 1.5px solid var(--mag-border);
  margin-bottom: 10px;
}

.mag-strip--ink .mag-kicker {
  background: #1E293B;
  color: #38BDF8;
  border-color: #38BDF8;
}

.mag-deck {
  font-size: 1.18rem;
  line-height: 1.55;
  color: var(--mag-mute);
  max-width: 66ch;
  margin-bottom: 20px;
}

.mag-ledger {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  background: var(--mag-surface);
  border: 2px solid var(--mag-border);
  border-radius: 10px;
  box-shadow: 4px 4px 0 var(--mag-accent);
  font-family: "Spline Sans Mono", ui-monospace, monospace;
  font-size: 1rem;
  font-weight: 700;
  color: var(--mag-ink);
  margin: 12px 0 22px;
}

/* Grids & Editorial Layouts */
.mag-cover-split {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 32px;
  align-items: center;
}

.mag-bento-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 20px;
}

.mag-bento-span-8 { grid-column: span 8; }
.mag-bento-span-6 { grid-column: span 6; }
.mag-bento-span-4 { grid-column: span 4; }

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

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

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

.mag-release-rail {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 16px;
}

.mag-cover-split > *,
.mag-bento-grid > *,
.mag-grid-2 > *,
.mag-grid-3 > *,
.mag-grid-4 > *,
.mag-release-rail > *,
.mag-article-layout > * {
  min-width: 0;
}

/* Cards & Color Accents */
.mag-card {
  background: var(--mag-surface);
  color: var(--mag-ink);
  border: 2px solid var(--mag-border);
  border-radius: 14px;
  padding: 22px;
  box-shadow: 4px 4px 0 var(--mag-border);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  min-width: 0;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.mag-card:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--mag-accent);
}

.mag-card p {
  font-size: 0.98rem;
  line-height: 1.55;
  margin-bottom: 10px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.mag-card ul,
.mag-card ol {
  margin: 0 0 12px;
  padding-left: 20px;
}

.mag-card li {
  font-size: 0.95rem;
  margin-bottom: 6px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.mag-card--accent-coral { border-top: 6px solid #C2381A; }
.mag-card--accent-cobalt { border-top: 6px solid #155EEF; }
.mag-card--accent-emerald { border-top: 6px solid #047857; }
.mag-card--accent-amber { border-top: 6px solid #B45309; }
.mag-card--accent-plum { border-top: 6px solid #7E22CE; }
.mag-card--accent-ink { border-top: 6px solid #0F172A; }

body.mag-page .kit-cover {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 10px;
  border: 1.5px solid var(--mag-border);
  margin-bottom: 14px;
  object-fit: cover;
}

.mag-card--dark {
  background: #1E293B;
  color: #F8FAFC;
  border: 1.5px solid #334155;
  box-shadow: 4px 4px 0 #020617;
  --mag-mute: #CBD5E1;
  --mag-rule: #334155;
  --mag-accent: #38BDF8;
  --mag-accent-hover: #7DD3FC;
  --mag-accent-ink: #0B1426;
}

.mag-card--dark:hover {
  border-color: #38BDF8;
  box-shadow: 6px 6px 0 #38BDF8;
}

.mag-card--dark a:not(.mag-btn):not(.mag-tag) {
  color: #7DD3FC;
}

.mag-card--dark .mag-card-meta {
  color: #CBD5E1;
}

body.mag-page .mag-card--dark code {
  background: rgba(255, 255, 255, 0.12);
  color: #E0F2FE;
}

.mag-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-family: "Spline Sans Mono", ui-monospace, monospace;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--mag-mute);
  padding-bottom: 8px;
  border-bottom: 1px dashed var(--mag-rule);
}

.mag-media-frame {
  border: 2px solid var(--mag-border);
  border-radius: 14px;
  overflow: hidden;
  background: var(--mag-surface);
  box-shadow: 6px 6px 0 var(--mag-border);
}

.mag-media-frame img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
}

.mag-media-frame figcaption {
  padding: 10px 14px;
  font-family: "Spline Sans Mono", ui-monospace, monospace;
  font-size: 0.75rem;
  color: var(--mag-mute);
  border-top: 1px solid var(--mag-rule);
  background: var(--mag-canvas);
}

/* Buttons */
.mag-btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

body.mag-page .mag-btn,
body.mag-page button[type="submit"].mag-btn,
body.mag-page .mag-support-details button[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-height: 44px;
  padding: 11px 20px;
  border-radius: 10px;
  border: 2px solid var(--mag-border);
  background: var(--mag-accent);
  color: var(--mag-accent-ink);
  font-family: "Plus Jakarta Sans", -apple-system, sans-serif;
  font-size: 0.92rem;
  font-weight: 700;
  text-transform: none;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 3px 3px 0 var(--mag-border);
  touch-action: manipulation;
  transition: background-color 0.16s ease, color 0.16s ease, border-color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

body.mag-page .mag-btn:hover,
body.mag-page button[type="submit"].mag-btn:hover,
body.mag-page .mag-support-details button[type="submit"]:hover {
  background: var(--mag-accent-hover);
  color: var(--mag-accent-ink);
  border-color: var(--mag-border);
  text-decoration: none;
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 var(--mag-border);
}

body.mag-page .mag-btn--outline,
body.mag-page button[type="submit"].mag-btn--outline {
  background: var(--mag-surface);
  color: var(--mag-ink);
}

body.mag-page .mag-btn--outline:hover,
body.mag-page button[type="submit"].mag-btn--outline:hover {
  background: var(--mag-tint);
  color: var(--mag-ink);
}

body.mag-page .mag-btn--dark,
body.mag-page button[type="submit"].mag-btn--dark {
  background: #111827;
  color: #FFFFFF;
}

body.mag-page .mag-btn--dark:hover,
body.mag-page button[type="submit"].mag-btn--dark:hover {
  background: #1F2937;
  color: #FFFFFF;
}

body.mag-page .mag-strip--ink .mag-btn {
  background: var(--mag-accent);
  color: var(--mag-accent-ink);
  border-color: var(--mag-border);
}

body.mag-page .mag-strip--ink .mag-btn:hover {
  background: var(--mag-accent-hover);
  color: var(--mag-accent-ink);
  border-color: var(--mag-accent-hover);
}

body.mag-page .mag-strip--ink .mag-btn--outline {
  background: #0F172A;
  color: #F8FAFC;
  border-color: #475569;
  box-shadow: 3px 3px 0 #020617;
}

body.mag-page .mag-strip--ink .mag-btn--outline:hover {
  background: #1E293B;
  color: #F8FAFC;
  border-color: #38BDF8;
}

/* Breadcrumbs */
.mag-breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-family: "Spline Sans Mono", ui-monospace, monospace;
  font-size: 0.78rem;
  color: var(--mag-mute);
  margin-bottom: 14px;
}

body.mag-page .mag-breadcrumbs a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  color: var(--mag-ink);
  font-weight: 600;
  text-decoration: none;
  padding: 4px 10px;
}

body.mag-page .mag-breadcrumbs a:hover {
  color: var(--mag-accent);
  text-decoration: underline;
}

/* Article Layout & Prose (for M2/M3/M4 content pages) */
.mag-article-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 36px;
  align-items: start;
}

.mag-sidebar-rail {
  position: sticky;
  top: 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.mag-prose {
  background: var(--mag-surface);
  border: 2px solid var(--mag-border);
  border-radius: 14px;
  padding: 32px;
  box-shadow: 5px 5px 0 var(--mag-border);
}

.mag-prose p,
.mag-prose li {
  font-size: 1.08rem;
  line-height: 1.72;
  max-width: 68ch;
}

.mag-prose h2 {
  margin-top: 34px;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--mag-rule);
}

.mag-prose h2:first-child {
  margin-top: 0;
}

/* Tables & Code Blocks */
.mag-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 2px solid var(--mag-border);
  border-radius: 12px;
  background: var(--mag-surface);
  box-shadow: 4px 4px 0 var(--mag-border);
  margin: 18px 0;
}

.mag-table {
  width: 100%;
  border-collapse: collapse;
  font-family: "Plus Jakarta Sans", -apple-system, sans-serif;
  font-size: 0.92rem;
}

.mag-table th,
.mag-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--mag-rule);
  border-right: 1px solid var(--mag-rule);
  text-align: left;
  vertical-align: top;
}

.mag-table th {
  background: var(--mag-tint);
  font-family: "Spline Sans Mono", ui-monospace, monospace;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 2px solid var(--mag-border);
}

.mag-code-block {
  background: #0D1A28;
  color: #E4ECF3;
  border: 2px solid var(--mag-border);
  border-radius: 12px;
  padding: 18px 20px;
  font-family: "Spline Sans Mono", ui-monospace, monospace;
  font-size: 0.84rem;
  line-height: 1.6;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
  box-shadow: 4px 4px 0 var(--mag-border);
  margin: 16px 0;
}

/* Callouts & Affiliate Disclosure */
.mag-callout {
  background: var(--mag-tint);
  border: 2px solid var(--mag-border);
  border-radius: 12px;
  padding: 20px 22px;
  box-shadow: 4px 4px 0 var(--mag-border);
  margin: 20px 0;
}

.mag-disclosure {
  background: var(--mag-surface);
  border: 1.5px solid var(--mag-rule);
  border-left: 5px solid var(--mag-accent);
  border-radius: 10px;
  padding: 14px 18px;
  font-family: "Spline Sans Mono", ui-monospace, monospace;
  font-size: 0.8rem;
  line-height: 1.55;
  color: var(--mag-ink);
  margin: 18px 0;
}

body.mag-page .mag-disclosure a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  min-width: 44px;
  padding: 6px 4px;
}

body.mag-page .mag-card-action,
body.mag-page #official-mcp-setup .mag-card a:not(.mag-btn),
body.mag-page #downloadable-skills .mag-card a:not(.mag-btn) {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  min-width: 44px;
  padding: 8px 4px;
  font-weight: 700;
  touch-action: manipulation;
}

/* Contextual Opt-In Card */
.mag-optin-card {
  background: var(--mag-surface);
  color: var(--mag-ink);
  border: 2.5px solid var(--mag-border);
  border-radius: 16px;
  padding: 28px;
  box-shadow: 6px 6px 0 var(--mag-accent);
}

.mag-optin-card form {
  background: transparent;
  border: none;
  padding: 0;
  margin: 16px 0 0;
  box-shadow: none;
}

.mag-optin-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr) auto;
  gap: 12px;
  align-items: end;
}

.mag-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mag-field label {
  font-family: "Spline Sans Mono", ui-monospace, monospace;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--mag-ink);
  margin: 0;
}

.mag-field input,
.mag-field select,
.mag-field textarea {
  width: 100%;
  min-height: 46px;
  padding: 11px 14px;
  border: 2px solid var(--mag-border);
  border-radius: 9px;
  background: #FFFFFF;
  color: #0F172A;
  font-family: "Plus Jakarta Sans", -apple-system, sans-serif;
  font-size: 0.96rem;
  margin: 0;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.mag-field input:focus,
.mag-field select:focus,
.mag-field textarea:focus {
  outline: none;
  border-color: var(--mag-accent);
  box-shadow: 0 0 0 3px rgba(21, 94, 239, 0.16);
}

body.mag-page .mag-optin-card button[type="submit"] {
  width: auto;
  min-height: 46px;
  padding: 11px 22px;
  border-radius: 9px;
  border: 2px solid var(--mag-border);
  background: var(--mag-accent);
  color: var(--mag-accent-ink);
  font-family: "Plus Jakarta Sans", -apple-system, sans-serif;
  font-size: 0.92rem;
  font-weight: 700;
  text-transform: none;
  box-shadow: 3px 3px 0 var(--mag-border);
  touch-action: manipulation;
  transition: background-color 0.16s ease, color 0.16s ease, border-color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

body.mag-page .mag-optin-card button[type="submit"]:hover {
  background: var(--mag-accent-hover);
  color: var(--mag-accent-ink);
  border-color: var(--mag-border);
  transform: translate(-1px, -1px);
}

.mag-optin-note {
  font-family: "Spline Sans Mono", ui-monospace, monospace;
  font-size: 0.76rem;
  color: var(--mag-mute);
  margin-top: 12px;
  margin-bottom: 0;
}

/* Badges & Tags */
.mag-tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mag-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  border-radius: 6px;
  border: 1px solid var(--mag-rule);
  background: var(--mag-canvas);
  font-family: "Spline Sans Mono", ui-monospace, monospace;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--mag-ink);
}

body.mag-page .mag-tag {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1.5px solid var(--mag-border);
  background: var(--mag-surface);
  font-family: "Spline Sans Mono", ui-monospace, monospace;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--mag-ink);
  text-decoration: none;
  touch-action: manipulation;
  transition: background-color 0.15s ease, color 0.15s ease;
}

body.mag-page .mag-tag:hover {
  background: var(--mag-tint);
  color: var(--mag-ink);
  text-decoration: none;
}

/* FAQ Accordion */
.mag-faq-list {
  display: grid;
  gap: 12px;
}

.mag-faq-item {
  background: var(--mag-surface);
  border: 2px solid var(--mag-border);
  border-radius: 12px;
  padding: 16px 20px;
  box-shadow: 3px 3px 0 var(--mag-border);
}

.mag-faq-item summary {
  cursor: pointer;
  font-family: "Plus Jakarta Sans", -apple-system, sans-serif;
  font-weight: 700;
  font-size: 1.02rem;
  list-style-position: inside;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  touch-action: manipulation;
}

.mag-faq-item p {
  margin-top: 10px;
  margin-bottom: 0;
  color: var(--mag-mute);
}

/* Support Details Box */
.mag-support-details {
  margin-top: 24px;
  border: 2px solid var(--mag-border);
  border-radius: 12px;
  padding: 16px 20px;
  background: var(--mag-surface);
}

.mag-support-details summary {
  cursor: pointer;
  font-family: "Plus Jakarta Sans", -apple-system, sans-serif;
  font-weight: 700;
  font-size: 0.94rem;
  color: var(--mag-ink);
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  touch-action: manipulation;
}

.mag-support-details form {
  background: transparent;
  border: none;
  padding: 0;
  margin: 14px 0 0;
  box-shadow: none;
}

/* Footer Shell */
.mag-footer-shell {
  background: var(--mag-surface);
  color: var(--mag-ink);
  padding: 28px 0 42px;
}

.mag-footer-shell .site-footer {
  margin-top: 0;
  border-top: none;
  padding-top: 0;
}

body.mag-page .mag-footer-shell .site-footer a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0 10px;
  color: var(--mag-mute);
}

body.mag-page .mag-footer-shell .site-footer a:hover {
  color: var(--mag-accent);
}

body.mag-page .mag-footer-shell .site-footer .sep {
  color: var(--mag-mute);
}

/* Responsive Breakpoints (1280px, 768px, 390px) */
@media (max-width: 980px) {
  .mag-cover-split,
  .mag-article-layout {
    grid-template-columns: 1fr;
  }

  .mag-sidebar-rail {
    position: static;
  }

  .mag-bento-span-8,
  .mag-bento-span-6,
  .mag-bento-span-4 {
    grid-column: span 6;
  }

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

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

@media (max-width: 768px) {
  .mag-wrap {
    padding: 0 16px;
  }

  .mag-strip {
    padding: 34px 0;
  }

  .mag-nav-link--cta {
    margin-left: 0;
  }

  .mag-grid-2,
  .mag-grid-3,
  .mag-grid-4,
  .mag-optin-row {
    grid-template-columns: 1fr;
  }

  body.mag-page .mag-optin-card button[type="submit"] {
    width: 100%;
  }

  .mag-prose {
    padding: 22px 18px;
  }
}

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

  .mag-bento-span-8,
  .mag-bento-span-6,
  .mag-bento-span-4 {
    grid-column: span 1;
  }

  .mag-card {
    padding: 18px;
  }

  .mag-optin-card {
    padding: 20px 16px;
  }
}

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

  .mag-card:hover,
  .mag-btn:hover,
  .mag-nav-link--cta:hover {
    transform: none !important;
  }
}
