:root {
  /* Magikal org colours: dark space, burnt orange, gold, and deep teal. */
  --magikal-bg: #111820;
  --magikal-panel: #18212c;
  --magikal-panel-soft: #202b38;
  --magikal-orange: #d46a1f;
  --magikal-gold: #d9a441;
  --magikal-teal: #123944;
  --magikal-text: #d7d7d7;

  --md-primary-fg-color: #111820;
  --md-primary-fg-color--light: #18212c;
  --md-primary-fg-color--dark: #0a0f14;
  --md-accent-fg-color: #d46a1f;
}

/* Header uses the Magikal dark/orange identity instead of the default purple. */
.md-header {
  background: linear-gradient(90deg, #0a0f14 0%, #111820 38%, #44200f 72%, #8f3d12 100%);
  box-shadow: 0 2px 18px rgba(212, 106, 31, 0.24);
}

/* Tabs/top nav, where present. */
.md-tabs {
  background: #111820;
}

/* Links and active navigation states. */
.md-typeset a,
.md-nav__link--active,
.md-nav__link:focus,
.md-nav__link:hover {
  color: #d9a441;
}

/* Search focus and highlight accents. */
.md-search__input {
  background-color: rgba(255, 255, 255, 0.10);
}

.md-search__input:focus {
  background-color: rgba(255, 255, 255, 0.16);
}

/* Headings. */
.md-typeset h1 {
  font-weight: 800;
  color: #d9a441;
}

.md-typeset h2 {
  font-weight: 700;
  color: #d46a1f;
}

/* Admonitions / note boxes. */
.md-typeset .admonition,
.md-typeset details {
  border-radius: 0.65rem;
}

.md-typeset .admonition.note {
  border-color: #d46a1f;
}

.md-typeset .note > .admonition-title,
.md-typeset .note > summary {
  background-color: rgba(212, 106, 31, 0.14);
}

.md-typeset .note > .admonition-title::before,
.md-typeset .note > summary::before {
  background-color: #d46a1f;
}

/* Homepage cards. */
.md-typeset .grid.cards > ul > li {
  border-radius: 0.85rem;
  border-color: rgba(217, 164, 65, 0.25);
  background: linear-gradient(180deg, rgba(24, 33, 44, 0.72), rgba(17, 24, 32, 0.72));
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
}

.md-typeset .grid.cards > ul > li:hover {
  transform: translateY(-2px);
  border-color: rgba(212, 106, 31, 0.55);
  box-shadow: 0 10px 28px rgba(212, 106, 31, 0.14);
}

/* Use more of the screen on desktop/wide monitors. */
.md-grid {
  max-width: min(96vw, 1700px);
}

/* Give the main reading area room without breaking mobile. */
.md-content {
  min-width: 0;
}

/* Keep tables and code blocks usable instead of forcing the whole page narrow. */
.md-typeset table:not([class]) {
  display: table;
  width: 100%;
}

/* Extra Magikal visual polish: more colour, still readable. */

/* Slight space-industrial page background. */
[data-md-color-scheme="slate"] {
  --md-default-bg-color: #0d131a;
  --md-default-fg-color: #e7e2da;
  --md-typeset-color: #e7e2da;
  --md-code-bg-color: #18212c;
}

[data-md-color-scheme="default"] {
  --md-default-bg-color: #f7f3ed;
  --md-default-fg-color: #1a1f26;
}

/* Main content panel gets a subtle lift. */
.md-main__inner {
  margin-top: 1.2rem;
}

.md-content__inner {
  padding-bottom: 3rem;
}

/* More colourful active navigation. */
.md-nav__link--active {
  font-weight: 700;
  color: #d46a1f;
}

.md-nav__link:hover {
  color: #d9a441;
}

/* Better section labels in the left nav. */
.md-nav__title {
  color: #d9a441;
  font-weight: 800;
}

/* Headings get a subtle Magikal underline. */
.md-typeset h1 {
  border-bottom: 2px solid rgba(212, 106, 31, 0.45);
  padding-bottom: 0.35rem;
}

.md-typeset h2 {
  border-left: 4px solid #d46a1f;
  padding-left: 0.55rem;
}

/* Tables feel less plain. */
.md-typeset table:not([class]) th {
  background: linear-gradient(90deg, rgba(212, 106, 31, 0.22), rgba(217, 164, 65, 0.15));
  color: #f5d08a;
}

.md-typeset table:not([class]) tr:nth-child(even) {
  background-color: rgba(217, 164, 65, 0.045);
}

/* Code blocks get a warmer edge. */
.md-typeset pre {
  border-left: 4px solid #d46a1f;
  border-radius: 0.75rem;
}

.md-typeset code {
  border-radius: 0.35rem;
}

/* Colourful admonitions. */
.md-typeset .admonition.note,
.md-typeset details.note {
  border-color: #d46a1f;
}

.md-typeset .admonition.tip,
.md-typeset details.tip {
  border-color: #1fa78a;
}

.md-typeset .admonition.warning,
.md-typeset details.warning {
  border-color: #d9a441;
}

.md-typeset .admonition.danger,
.md-typeset details.danger {
  border-color: #c2410c;
}

/* Make homepage cards more distinct. */
.md-typeset .grid.cards > ul > li:nth-child(1) {
  border-color: rgba(212, 106, 31, 0.55);
}

.md-typeset .grid.cards > ul > li:nth-child(2) {
  border-color: rgba(217, 164, 65, 0.55);
}

.md-typeset .grid.cards > ul > li:nth-child(3) {
  border-color: rgba(31, 167, 138, 0.50);
}

.md-typeset .grid.cards > ul > li:nth-child(4) {
  border-color: rgba(94, 164, 255, 0.45);
}

/* Small reusable badge/chip classes for docs pages. */
.magikal-chip {
  display: inline-block;
  padding: 0.18rem 0.55rem;
  margin: 0.12rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  border: 1px solid rgba(217, 164, 65, 0.45);
  background: rgba(212, 106, 31, 0.14);
  color: #f3c46d;
}

.magikal-chip.green {
  border-color: rgba(31, 167, 138, 0.55);
  background: rgba(31, 167, 138, 0.14);
  color: #79e0c7;
}

.magikal-chip.blue {
  border-color: rgba(94, 164, 255, 0.55);
  background: rgba(94, 164, 255, 0.14);
  color: #9fc8ff;
}

.magikal-chip.red {
  border-color: rgba(194, 65, 12, 0.55);
  background: rgba(194, 65, 12, 0.14);
  color: #ffad7a;
}

/* Important text highlighting
   Keeps key rules, warnings, and safety notes visible while staying on-brand. */

/* Make bold text stand out as a warm highlight, not just heavier text. */
.md-typeset strong {
  color: #f2bd63;
  font-weight: 800;
}

/* Inline mark/highlight support using ==text== if enabled later,
   and normal <mark> HTML if used in docs. */
.md-typeset mark {
  background: linear-gradient(90deg, rgba(212, 106, 31, 0.35), rgba(217, 164, 65, 0.32));
  color: inherit;
  padding: 0.08rem 0.25rem;
  border-radius: 0.25rem;
}

/* Reusable important callout block:
   Use in markdown with:
   <div class="magikal-important" markdown>
   **Important:** text here
   </div>
*/
.magikal-important {
  margin: 1rem 0;
  padding: 0.85rem 1rem;
  border-left: 5px solid #d46a1f;
  border-radius: 0.7rem;
  background: linear-gradient(90deg, rgba(212, 106, 31, 0.18), rgba(217, 164, 65, 0.08));
}

/* Critical/danger callout for "stop before continuing" instructions. */
.magikal-critical {
  margin: 1rem 0;
  padding: 0.85rem 1rem;
  border-left: 5px solid #c2410c;
  border-radius: 0.7rem;
  background: linear-gradient(90deg, rgba(194, 65, 12, 0.22), rgba(127, 29, 29, 0.10));
}

/* Safe/success callout for good output examples and confirmed-good states. */
.magikal-good {
  margin: 1rem 0;
  padding: 0.85rem 1rem;
  border-left: 5px solid #1fa78a;
  border-radius: 0.7rem;
  background: linear-gradient(90deg, rgba(31, 167, 138, 0.18), rgba(20, 83, 73, 0.08));
}

/* Make warning and danger admonitions visually stronger. */
.md-typeset .admonition.warning,
.md-typeset details.warning {
  box-shadow: 0 0 0 1px rgba(217, 164, 65, 0.25), 0 10px 26px rgba(217, 164, 65, 0.08);
}

.md-typeset .admonition.danger,
.md-typeset details.danger {
  box-shadow: 0 0 0 1px rgba(194, 65, 12, 0.32), 0 10px 26px rgba(194, 65, 12, 0.10);
}

/* Important inline command/file paths. */
.md-typeset code {
  color: #f3c46d;
}

/* Make blockquote-style notes more visible if we use them. */
.md-typeset blockquote {
  border-left: 4px solid #d46a1f;
  background: rgba(212, 106, 31, 0.08);
  border-radius: 0.45rem;
  padding: 0.6rem 0.9rem;
}

/* Rednarok feedback pass:
   Important text must stand out from the normal Magikal orange/gold scheme. */

:root {
  --magikal-important-blue: #38bdf8;
  --magikal-important-cyan: #5eead4;
  --magikal-warning-amber: #f59e0b;
  --magikal-danger-red: #ef4444;
  --magikal-safe-green: #22c55e;
}

/* Bold text now means "important", so it uses cyan/blue instead of Magikal gold. */
.md-typeset strong {
  color: var(--magikal-important-cyan);
  font-weight: 850;
}

/* Highlighted/marked text stands out with a cool blue glow instead of orange. */
.md-typeset mark {
  background: linear-gradient(90deg, rgba(56, 189, 248, 0.30), rgba(94, 234, 212, 0.22));
  color: #eaffff;
  padding: 0.08rem 0.28rem;
  border-radius: 0.28rem;
  box-shadow: 0 0 0 1px rgba(94, 234, 212, 0.24);
}

/* Important callout = blue/cyan, separate from Magikal orange branding. */
.magikal-important {
  border-left-color: var(--magikal-important-blue);
  background: linear-gradient(90deg, rgba(56, 189, 248, 0.18), rgba(94, 234, 212, 0.08));
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.22);
}

.magikal-important strong {
  color: var(--magikal-important-cyan);
}

/* Critical callout = red. */
.magikal-critical {
  border-left-color: var(--magikal-danger-red);
  background: linear-gradient(90deg, rgba(239, 68, 68, 0.20), rgba(127, 29, 29, 0.10));
  box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.25);
}

.magikal-critical strong {
  color: #fecaca;
}

/* Good/safe callout = green. */
.magikal-good {
  border-left-color: var(--magikal-safe-green);
  background: linear-gradient(90deg, rgba(34, 197, 94, 0.16), rgba(20, 83, 45, 0.08));
  box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.22);
}

.magikal-good strong {
  color: #86efac;
}

/* Make admonition titles carry meaning clearly. */
.md-typeset .admonition.note > .admonition-title,
.md-typeset details.note > summary {
  background-color: rgba(56, 189, 248, 0.16);
}

.md-typeset .admonition.warning > .admonition-title,
.md-typeset details.warning > summary {
  background-color: rgba(245, 158, 11, 0.20);
}

.md-typeset .admonition.danger > .admonition-title,
.md-typeset details.danger > summary {
  background-color: rgba(239, 68, 68, 0.20);
}

.md-typeset .admonition.tip > .admonition-title,
.md-typeset details.tip > summary {
  background-color: rgba(34, 197, 94, 0.16);
}

/* Keep ordinary inline code readable, but stop it looking like the only highlight style. */
.md-typeset code {
  color: #93c5fd;
}

/* But code inside danger/warning boxes should inherit the box meaning better. */
.md-typeset .admonition.warning code {
  color: #fbbf24;
}

.md-typeset .admonition.danger code {
  color: #fca5a5;
}

.md-typeset .admonition.tip code {
  color: #86efac;
}

/* Rednarok feedback refinement:
   Do not recolour every bold word globally.
   Only deliberate inline highlights should stand out. */

/* Normal bold text should stay readable but not turn into a highlight everywhere. */
.md-typeset strong {
  color: inherit;
  font-weight: 800;
}

/* Use this class when an inline phrase genuinely needs to stand out. */
.magikal-inline-important {
  color: #5eead4;
  font-weight: 850;
}

/* Keep explicit mark highlights bright and obvious. */
.md-typeset mark {
  background: linear-gradient(90deg, rgba(56, 189, 248, 0.30), rgba(94, 234, 212, 0.22));
  color: #eaffff;
  padding: 0.08rem 0.28rem;
  border-radius: 0.28rem;
  box-shadow: 0 0 0 1px rgba(94, 234, 212, 0.24);
}

/* Keep strong text inside custom callout boxes meaningful. */
.magikal-important strong {
  color: #5eead4;
}

.magikal-critical strong {
  color: #fecaca;
}

.magikal-good strong {
  color: #86efac;
}

/* Final highlight refinement:
   Normal bold text stays in the Magikal colour scheme.
   Only deliberate inline highlights use the separate cyan/blue highlight colour. */

/* Normal bold = Magikal gold, not cyan and not plain grey. */
.md-typeset strong {
  color: #d9a441;
  font-weight: 800;
}

/* Deliberate inline important text = cyan/blue highlight. */
.magikal-inline-important {
  color: #5eead4;
  font-weight: 850;
}

/* Explicit marked text also counts as deliberate inline highlight. */
.md-typeset mark {
  background: linear-gradient(90deg, rgba(56, 189, 248, 0.30), rgba(94, 234, 212, 0.22));
  color: #eaffff;
  padding: 0.08rem 0.28rem;
  border-radius: 0.28rem;
  box-shadow: 0 0 0 1px rgba(94, 234, 212, 0.24);
}

/* Callout boxes keep their own meaning colours. */
.magikal-important strong {
  color: #5eead4;
}

.magikal-critical strong {
  color: #fecaca;
}

.magikal-good strong {
  color: #86efac;
}

/* Command docs layout:
   Make each command feature area look like a separate section, not one long wall. */

.md-typeset h2.magikal-command-heading {
  margin-top: 3.25rem;
  margin-bottom: 1rem;
  padding: 0.9rem 1rem;
  border-left: 6px solid #d46a1f;
  border-bottom: 0;
  border-radius: 0.85rem;
  background: linear-gradient(90deg, rgba(212, 106, 31, 0.24), rgba(17, 24, 32, 0.18));
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.16);
}

.magikal-command-section {
  margin: 0.8rem 0 3.5rem 0;
  padding: 1.15rem;
  border: 1px solid rgba(217, 164, 65, 0.22);
  border-radius: 1rem;
  background: linear-gradient(180deg, rgba(24, 33, 44, 0.72), rgba(13, 19, 26, 0.52));
}

.magikal-command-summary {
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 0.85rem;
  background: rgba(0, 0, 0, 0.16);
  border: 1px solid rgba(94, 234, 212, 0.12);
}

.magikal-command-groups {
  margin: 0.75rem 0 1.15rem 0;
  line-height: 2.1;
}

.magikal-command-section details {
  margin: 0.75rem 0;
}

.magikal-command-section details.abstract {
  border-color: rgba(56, 189, 248, 0.55);
  background: rgba(0, 153, 224, 0.055);
}

.magikal-command-section details.abstract > summary {
  font-weight: 800;
}

.magikal-section-divider {
  height: 1px;
  margin: 3rem 0 1rem;
  background: linear-gradient(90deg, transparent, rgba(212, 106, 31, 0.55), rgba(217, 164, 65, 0.35), transparent);
}

/* Command docs refinement:
   Clickable command group chips + stronger section dividers. */

.magikal-command-groups a.magikal-chip {
  text-decoration: none;
  cursor: pointer;
}

.magikal-command-groups a.magikal-chip:hover {
  border-color: rgba(94, 234, 212, 0.85);
  background: rgba(56, 189, 248, 0.20);
  color: #eaffff;
  box-shadow: 0 0 0 1px rgba(94, 234, 212, 0.20), 0 8px 22px rgba(56, 189, 248, 0.12);
}

/* Thicker, clearer feature breaks between command sections. */
.magikal-section-divider {
  height: 4px;
  margin: 4rem 0 1.35rem;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(56, 189, 248, 0.30),
    rgba(212, 106, 31, 0.85),
    rgba(217, 164, 65, 0.65),
    rgba(56, 189, 248, 0.30),
    transparent
  );
}

/* Anchor targets should not hide under sticky headers. */
.magikal-command-anchor {
  display: block;
  position: relative;
  top: -5rem;
  visibility: hidden;
}

/* Brief highlight when a command chip opens a collapsed command group. */
.magikal-command-section details.magikal-details-opened {
  border-color: rgba(94, 234, 212, 0.95);
  box-shadow:
    0 0 0 2px rgba(94, 234, 212, 0.25),
    0 12px 28px rgba(56, 189, 248, 0.16);
}
