/* Design tokens — generated from the MMPL Mining design system (tokens.json). */
:root, [data-theme="light"] {
  --surface: #f9f9ff;
  --surface-dim: #d4daea;
  --surface-bright: #f9f9ff;
  --surface-container-lowest: #ffffff;
  --surface-container-low: #f1f3ff;
  --surface-container: #e8eeff;
  --surface-container-high: #e3e8f9;
  --surface-container-highest: #dde2f3;
  --on-surface: #161c27;
  --on-surface-variant: #5c403c;
  --inverse-surface: #2a303d;
  --inverse-on-surface: #ecf0ff;
  --outline: #916f6b;
  --outline-variant: #e6bdb8;
  --surface-tint: #bf0715;
  --primary: #b70011;
  --on-primary: #ffffff;
  --primary-container: #dc2626;
  --on-primary-container: #fff6f5;
  --inverse-primary: #ffb4ab;
  --secondary: #5a5e68;
  --on-secondary: #ffffff;
  --secondary-container: #dee2ee;
  --on-secondary-container: #60646e;
  --tertiary: #894900;
  --on-tertiary: #ffffff;
  --tertiary-container: #ad5d00;
  --on-tertiary-container: #fff6f2;
  --error: #ba1a1a;
  --on-error: #ffffff;
  --error-container: #ffdad6;
  --on-error-container: #93000a;
  --primary-fixed: #ffdad6;
  --primary-fixed-dim: #ffb4ab;
  --on-primary-fixed: #410002;
  --on-primary-fixed-variant: #93000b;
  --secondary-fixed: #dee2ee;
  --secondary-fixed-dim: #c2c6d2;
  --on-secondary-fixed: #171c24;
  --on-secondary-fixed-variant: #424750;
  --tertiary-fixed: #ffdcc3;
  --tertiary-fixed-dim: #ffb77d;
  --on-tertiary-fixed: #2f1500;
  --on-tertiary-fixed-variant: #6e3900;
  --background: #f9f9ff;
  --on-background: #161c27;
  --surface-variant: #dde2f3;
  --logo-red: #DE1F26;
  --vermilion-vibrant: #E02424;
  --vermilion-deep: #991B1B;
  --slate-black: #0F141C;
  --slate-surface: #1A202C;
  --mineral-copper: #D97706;
  --mineral-bronze: #B45309;
  --stone-surface: #F8F9FA;
  --stone-subtle: #F1F5F9;
  --blueprint-border: #CBD5E1;
  --blueprint-border-light: #E2E8F0;
  --status-active: #059669;
  --status-caution: #D97706;
  --status-critical: #DC2626;
  --hairline-dark: rgba(255, 255, 255, 0.12);
  --command-border: rgba(255, 255, 255, 0.2);
  --glass: rgba(15, 20, 28, 0.85);
  --glass-border: rgba(255, 255, 255, 0.15);
  --shadow-hud: 0 8px 32px rgba(0, 0, 0, 0.28);
  --shadow-focus: 0 0 0 1px #DC2626;
}
:root {
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2.5rem;
  --space-2xl: 4rem;
  --space-3xl: 6rem;
  --gutter: 1.5rem;
  --gutter-mobile: 1rem;
  --margin: 3rem;
  --margin-mobile: 1.25rem;
  --radius-none: 0;
  --chamfer: 8px;
  --radius-full: 9999px;
  --blur-hud: 12px;
  --hairline: 1px;
  --datum: 2px;
  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-body: "IBM Plex Sans", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --font-icon: "Material Symbols Outlined";
}

/* Components — MMPL design system bundle.css */

/* MMPL Mining — component styles. Strictly sharp: radius-none everywhere, chamfers only where noted. */
.mm-root, .mm-root * { box-sizing: border-box; }

.mm-icon { font-family: var(--font-icon); font-weight: normal; font-style: normal; font-size: 18px; line-height: 1; letter-spacing: normal; text-transform: none; display: inline-block; white-space: nowrap; direction: ltr; -webkit-font-feature-settings: "liga"; font-feature-settings: "liga"; vertical-align: middle; }

.mm-focus:focus-visible, .mm-btn:focus-visible, .mm-stage:focus-visible { outline: var(--datum) solid var(--status-critical); outline-offset: 2px; }

/* ---------- Button ---------- */
.mm-btn { display: inline-flex; align-items: center; gap: var(--space-sm); border: var(--hairline) solid transparent; border-radius: var(--radius-none); cursor: pointer; text-decoration: none; padding: 12px var(--space-lg); transition: background-color .15s, color .15s, border-color .15s; white-space: nowrap; }
.mm-btn .mm-icon { font-size: 18px; transition: transform .15s; }
.mm-btn:disabled { opacity: .45; cursor: not-allowed; }
.mm-btn-primary { background: var(--primary); color: var(--on-primary); font-family: var(--font-display); font-weight: 700; font-size: 14px; line-height: 20px; letter-spacing: .05em; text-transform: uppercase; clip-path: polygon(0 0, calc(100% - var(--chamfer)) 0, 100% var(--chamfer), 100% 100%, 0 100%); }
.mm-btn-primary:hover:not(:disabled) { background: var(--vermilion-deep); }
.mm-btn-primary:hover:not(:disabled) .mm-arrow { transform: translateX(3px); }
.mm-btn-secondary { background: transparent; color: var(--slate-black); border-color: var(--slate-black); font-family: var(--font-mono); font-weight: 600; font-size: 13px; line-height: 20px; letter-spacing: .02em; }
.mm-btn-secondary:hover:not(:disabled) { background: var(--slate-black); color: var(--on-primary); }
.mm-btn-command { position: relative; background: var(--slate-black); color: var(--on-primary); border-color: var(--command-border); font-family: var(--font-mono); font-weight: 600; font-size: 12px; line-height: 16px; letter-spacing: .08em; text-transform: uppercase; }
.mm-btn-command::after { content: ""; position: absolute; top: -1px; right: -1px; width: 0; height: 0; border-top: var(--chamfer) solid var(--vermilion-vibrant); border-left: var(--chamfer) solid transparent; }
.mm-btn-command:hover:not(:disabled) { background: var(--slate-surface); border-color: var(--glass-border); }
.mm-btn-sm { padding: 8px var(--space-md); font-size: 12px; }
.mm-btn-block { width: 100%; justify-content: center; padding: var(--space-md) var(--space-xl); }

/* ---------- Tag ---------- */
.mm-tag { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: 11px; line-height: 14px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; padding: 4px 8px; border: var(--hairline) solid transparent; border-radius: var(--radius-none); }
.mm-tag-code { color: var(--secondary); border-color: var(--blueprint-border); background: var(--surface-container-lowest); }
.mm-tag-primary { color: var(--primary); background: var(--primary-fixed); }
.mm-tag-copper { color: var(--on-tertiary-fixed-variant); background: var(--tertiary-fixed); }
.mm-tag-solid { color: var(--on-primary-container); background: var(--primary-container); }
.mm-tag-dark { color: var(--on-primary); background: var(--slate-black); }
.mm-tag-bare { padding: 0; color: var(--primary); }

/* ---------- StatusLed ---------- */
.mm-led { display: inline-flex; align-items: center; gap: var(--space-sm); font-family: var(--font-mono); font-size: 11px; line-height: 14px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--on-surface); }
.mm-led-dot { width: 6px; height: 6px; border-radius: var(--radius-full); flex: none; }
.mm-led-active .mm-led-dot { background: var(--status-active); box-shadow: 0 0 6px rgba(5, 150, 105, .7); }
.mm-led-caution .mm-led-dot { background: var(--status-caution); box-shadow: 0 0 6px rgba(217, 119, 6, .7); }
.mm-led-critical .mm-led-dot { background: var(--status-critical); box-shadow: 0 0 6px rgba(220, 38, 38, .7); }
.mm-on-dark .mm-led { color: var(--on-primary); }

/* ---------- MetricBadge ---------- */
.mm-metric { display: flex; flex-direction: column; gap: var(--space-xs); padding: var(--space-lg); border: var(--hairline) solid var(--blueprint-border); background: var(--surface-container-lowest); min-width: 0; }
.mm-metric-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-md); }
.mm-metric-code { font-family: var(--font-mono); font-size: 11px; line-height: 14px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--secondary); }
.mm-metric-value { font-family: var(--font-mono); font-size: 36px; line-height: 40px; font-weight: 700; letter-spacing: -.02em; color: var(--on-surface); margin-top: var(--space-sm); }
.mm-metric-unit { font-size: 20px; font-weight: 600; color: var(--primary); margin-left: 4px; letter-spacing: 0; }
.mm-metric-label { font-family: var(--font-body); font-size: 13px; line-height: 20px; color: var(--on-surface-variant); }
.mm-metric-dark { background: var(--slate-black); border-color: var(--hairline-dark); }
.mm-metric-dark .mm-metric-code { color: var(--secondary-fixed-dim); }
.mm-metric-dark .mm-metric-value { color: var(--on-primary); }
.mm-metric-dark .mm-metric-unit { color: var(--tertiary-fixed-dim); }
.mm-metric-dark .mm-metric-label { color: var(--secondary-fixed-dim); }
.mm-metric-dark .mm-led { color: var(--on-primary); }

/* ---------- SectionHeader ---------- */
.mm-section-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--space-lg); padding-top: var(--space-md); border-top: var(--hairline) solid var(--blueprint-border); }
.mm-section-index { font-family: var(--font-mono); font-size: 11px; line-height: 14px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--primary); margin: 0 0 var(--space-sm); }
.mm-section-title { font-family: var(--font-display); font-size: 40px; line-height: 44px; font-weight: 700; letter-spacing: -.02em; color: var(--on-surface); margin: 0; }
.mm-section-lead { font-family: var(--font-body); font-size: 15px; line-height: 24px; color: var(--on-surface-variant); max-width: 420px; margin: 0; }
@media (max-width: 767px) { .mm-section-title { font-size: 28px; line-height: 32px; letter-spacing: -.01em; } }

/* ---------- ElementMarker ---------- */
.mm-element { display: inline-flex; flex-direction: column; align-items: center; gap: var(--space-sm); text-align: center; }
.mm-element-disc { width: 56px; height: 56px; border-radius: var(--radius-full); display: grid; place-items: center; border: var(--hairline) solid var(--blueprint-border); background: var(--surface-container-lowest); font-family: var(--font-display); font-size: 22px; font-weight: 700; color: var(--mineral-bronze); }
.mm-element-primary .mm-element-disc { color: var(--primary); }
.mm-element-dark .mm-element-disc { background: var(--slate-black); border-color: var(--slate-black); color: var(--tertiary-fixed-dim); }
.mm-element-name { font-family: var(--font-mono); font-size: 11px; line-height: 14px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--on-surface); }
.mm-element-note { font-family: var(--font-body); font-size: 12px; line-height: 16px; color: var(--secondary); max-width: 120px; }

/* ---------- ServiceCard ---------- */
.mm-card { display: flex; flex-direction: column; border: var(--hairline) solid var(--blueprint-border); background: var(--surface-container-lowest); clip-path: polygon(0 0, calc(100% - var(--chamfer) * 2) 0, 100% calc(var(--chamfer) * 2), 100% 100%, 0 100%); transition: box-shadow .15s, border-color .15s; }
.mm-card:hover, .mm-card:focus-within { border-color: var(--status-critical); box-shadow: var(--shadow-focus); }
.mm-card-media { position: relative; aspect-ratio: 16 / 10; background: var(--slate-black); overflow: hidden; }
.mm-card-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mm-card-media .mm-tag { position: absolute; top: var(--space-md); left: var(--space-md); }
.mm-card-body { display: flex; flex-direction: column; gap: var(--space-md); padding: var(--space-lg); flex: 1; }
.mm-card-title { font-family: var(--font-display); font-size: 18px; line-height: 24px; font-weight: 600; color: var(--on-surface); margin: 0; }
.mm-card-text { font-family: var(--font-body); font-size: 13px; line-height: 20px; color: var(--on-surface-variant); margin: 0; }
.mm-specs { display: grid; grid-template-columns: auto 1fr; margin: 0; border-top: var(--hairline) solid var(--blueprint-border-light); }
.mm-specs dt, .mm-specs dd { margin: 0; padding: 8px 0; border-bottom: var(--hairline) solid var(--blueprint-border-light); }
.mm-specs dt { font-family: var(--font-mono); font-size: 11px; line-height: 16px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--secondary); padding-right: var(--space-md); }
.mm-specs dd { font-family: var(--font-mono); font-size: 12px; line-height: 16px; font-weight: 600; color: var(--on-surface); text-align: right; }
.mm-card-link { margin-top: auto; display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--primary); text-decoration: none; }
.mm-card-link:hover { color: var(--vermilion-deep); }

/* ---------- Field ---------- */
.mm-field { position: relative; display: block; padding-top: 7px; }
.mm-field-label { position: absolute; top: 0; left: 12px; padding: 0 6px; background: var(--surface-container-lowest); font-family: var(--font-mono); font-size: 11px; line-height: 14px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--secondary); z-index: 1; }
.mm-field-label .mm-req { color: var(--primary); }
.mm-field-control { width: 100%; border: var(--hairline) solid var(--outline); border-radius: var(--radius-none); background: var(--surface-container-lowest); color: var(--on-surface); font-family: var(--font-mono); font-size: 14px; line-height: 20px; padding: 14px var(--space-md) 12px; appearance: none; -webkit-appearance: none; }
.mm-field-control::placeholder { color: var(--secondary); }
.mm-field-control:focus { outline: none; border-color: var(--status-critical); box-shadow: 0 0 0 1px var(--status-critical); }
select.mm-field-control { padding-right: 40px; background-image: linear-gradient(45deg, transparent 50%, #5a5e68 50%), linear-gradient(135deg, #5a5e68 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
textarea.mm-field-control { resize: vertical; min-height: 96px; }
.mm-field-hint { display: block; margin-top: 6px; font-family: var(--font-body); font-size: 12px; line-height: 16px; color: var(--secondary); }
.mm-field-invalid .mm-field-control { border-color: var(--error); }
.mm-field-invalid .mm-field-hint { color: var(--error); }

/* ---------- HudCard ---------- */
.mm-hud { background: var(--glass); -webkit-backdrop-filter: blur(var(--blur-hud)); backdrop-filter: blur(var(--blur-hud)); border: var(--hairline) solid var(--glass-border); box-shadow: var(--shadow-hud); color: var(--on-primary); padding: var(--space-md); min-width: 220px; }
.mm-hud-code { font-family: var(--font-mono); font-size: 11px; line-height: 14px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--tertiary-fixed-dim); }
.mm-hud-title { font-family: var(--font-display); font-size: 16px; line-height: 22px; font-weight: 600; margin: 4px 0 var(--space-sm); }
.mm-hud dl { display: grid; grid-template-columns: auto 1fr; margin: 0; }
.mm-hud dt, .mm-hud dd { margin: 0; padding: 6px 0; border-top: var(--hairline) solid var(--hairline-dark); font-family: var(--font-mono); font-size: 11px; line-height: 14px; }
.mm-hud dt { color: var(--secondary-fixed-dim); letter-spacing: .06em; text-transform: uppercase; padding-right: var(--space-md); }
.mm-hud dd { text-align: right; font-weight: 600; }

/* ---------- DepthChart ---------- */
.mm-depth { border: var(--hairline) solid var(--blueprint-border); background: var(--surface-container-lowest); padding: var(--space-lg); overflow-x: auto; }
.mm-depth-cols { min-width: max-content; }
.mm-depth-datum { display: flex; justify-content: space-between; gap: var(--space-md); padding-bottom: var(--space-md); border-bottom: var(--datum) solid var(--slate-black); font-family: var(--font-mono); font-size: 11px; line-height: 14px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--on-surface); }
.mm-depth-datum span + span { font-weight: 400; color: var(--secondary); }
.mm-depth-cols { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(84px, 1fr); gap: var(--space-md); padding-top: var(--space-lg); }
.mm-depth-col { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; outline: none; }
.mm-depth-val { font-family: var(--font-mono); font-size: 12px; line-height: 16px; font-weight: 700; color: var(--mineral-bronze); margin-bottom: var(--space-sm); }
.mm-depth-bar { width: 100%; max-width: 48px; background: var(--mineral-copper); transition: background-color .15s; }
.mm-depth-col.is-primary .mm-depth-val { color: var(--primary); }
.mm-depth-col.is-primary .mm-depth-bar { background: var(--primary-container); }
.mm-depth-col:hover .mm-depth-bar, .mm-depth-col:focus-visible .mm-depth-bar { background: var(--slate-black); }
.mm-depth-col:focus-visible { outline: var(--datum) solid var(--status-critical); outline-offset: 4px; }
.mm-depth-name { font-family: var(--font-display); font-size: 12px; line-height: 16px; font-weight: 700; color: var(--on-surface); margin-top: var(--space-sm); }
.mm-depth-sub { font-family: var(--font-mono); font-size: 10px; line-height: 14px; color: var(--secondary); }
.mm-depth-col .mm-hud { position: absolute; top: 24px; z-index: 2; text-align: left; pointer-events: none; }
.mm-depth-col .mm-hud-start { left: 0; }
.mm-depth-col .mm-hud-end { right: 0; }

/* ---------- LifecycleStages ---------- */
.mm-stages { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); border: var(--hairline) solid var(--blueprint-border); }
.mm-stage { position: relative; display: flex; flex-direction: column; gap: 2px; text-align: left; padding: 14px; background: var(--stone-surface); color: var(--on-surface); border: 0; border-right: var(--hairline) solid var(--blueprint-border); border-radius: var(--radius-none); cursor: pointer; font: inherit; transition: background-color .15s; }
.mm-stage:last-child { border-right: 0; }
.mm-stage:hover { background: var(--surface-container-lowest); }
.mm-stage-code { font-family: var(--font-mono); font-size: 11px; line-height: 14px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--secondary); }
.mm-stage-title { font-family: var(--font-display); font-size: 16px; line-height: 22px; font-weight: 700; }
.mm-stage-meta { font-family: var(--font-mono); font-size: 11px; line-height: 14px; color: var(--secondary); }
.mm-stage.is-active { background: var(--primary-container); color: var(--on-primary-container); }
.mm-stage.is-active .mm-stage-code, .mm-stage.is-active .mm-stage-meta { color: var(--on-primary-container); }
.mm-stage-arrow { position: absolute; right: 8px; top: 12px; font-size: 16px; opacity: .5; }
