/* Reactor Core (gallery M1): a 212px sidebar, a status strip above every
   page, the spinning disk reactor between the battery and uptime gauges,
   and the cleanup grid with the protected workflow below.
   Ported from #m01 with every color taken from theme.js. No scanlines. */

html[data-design="emberRings"] #app {
  background: radial-gradient(900px 500px at 62% 34%, var(--ground-glow) 0%, color-mix(in srgb, var(--ground-glow) 35%, var(--ground-deep)) 60%, var(--ground-deep) 100%);
}
html[data-design="emberRings"] { --side-w: 212px; }
html[data-design="emberRings"] .brand .logo { width: 52px; height: 52px; }
html[data-design="emberRings"] .wm { font-size: 26px; letter-spacing: .035em; }
html[data-design="emberRings"] .tab.on::before {
  content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0;
  background: var(--ember); box-shadow: 0 0 10px var(--ember), 0 0 22px color-mix(in srgb, var(--blaze) calc(80% * var(--glow)), transparent);
  animation: m01-ind 2.6s ease-in-out infinite;
}
/* The bar sits on the window edge, outside the item's clip. */
html[data-design="emberRings"] .tab.on { overflow: visible; }
html[data-design="emberRings"] .tab.on::before { left: calc(-1 * var(--side-pad)); }
html[data-design="emberRings"] .tab { clip-path: none; border-radius: 4px 12px 4px 12px; }
html[data-design="emberRings"] .sfoot { border-top: 1px solid color-mix(in srgb, var(--line) calc(10% * var(--line-k)), transparent); }

/* The status strip above every page. */
html[data-design="emberRings"] .dchrome { display: block; position: absolute; left: calc(var(--side-w) + 22px); right: 22px; top: 18px; z-index: 20; }
html[data-design="emberRings"] .page { top: 70px; padding: 14px 22px 18px; }
html[data-design="emberRings"] .sweep { left: var(--side-w); }

.m1-panel {
  background: linear-gradient(180deg, var(--panel-top), var(--panel-bottom));
  border: 1px solid color-mix(in srgb, var(--line) calc(16% * var(--line-k)), transparent);
  border-radius: 4px 16px 4px 16px; animation: rise .6s cubic-bezier(.2,.7,.2,1) both;
}
.m1-strip { height: 52px; display: flex; align-items: center; gap: 14px; padding: 0 10px 0 16px; }
.m1-pill {
  display: flex; align-items: center; gap: 8px; font: 700 11px/1 Oxanium, sans-serif; letter-spacing: .14em; color: var(--ok);
  padding: 7px 11px; border-radius: 3px 9px 3px 9px; flex: none;
  background: color-mix(in srgb, var(--ok) 8%, transparent); border: 1px solid color-mix(in srgb, var(--ok) 28%, transparent);
}
.m1-pill i { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); animation: ping-ok 2s infinite; }
.m1-pill.busy { color: var(--accent); background: color-mix(in srgb, var(--ember) 8%, transparent); border-color: color-mix(in srgb, var(--ember) 30%, transparent); }
.m1-pill.busy i { background: var(--ember); animation-name: ping; }
.m1-pill.warn { color: var(--warn); background: color-mix(in srgb, var(--warn) 8%, transparent); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }
.m1-pill.warn i { background: var(--warn); animation: none; }
.m1-stx { font: 500 12.5px Manrope, sans-serif; color: var(--text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.m1-stx b { color: var(--text); font-weight: 700; }
.m1-stx .d { color: var(--dim); margin: 0 7px; }
.m1-btn {
  position: relative; overflow: hidden; margin-left: auto; display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 18px; flex: none;
  border-radius: 4px 12px 4px 12px; background: linear-gradient(135deg, var(--flare), var(--ember) 55%, var(--blaze));
  color: var(--on-fill); font: 700 13px "Chakra Petch", sans-serif; letter-spacing: .04em;
  box-shadow: 0 0 22px color-mix(in srgb, var(--blaze) calc(45% * var(--glow)), transparent), inset 0 1px 0 rgba(255,255,255,.35);
}
.m1-btn::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgba(255,255,255,.55) 50%, transparent 70%); animation: sheen 3.4s ease-in-out infinite; }
.m1-btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.m1-btn.stop { background: linear-gradient(135deg, color-mix(in srgb, var(--danger) 80%, white), var(--danger)); }
.m1-btn:disabled { opacity: .45; cursor: default; }

.m1 { display: flex; flex-direction: column; gap: 14px; }
.m1-gauges { height: 262px; flex: none; display: grid; grid-template-columns: 1fr 290px 1fr; gap: 14px; }
.m1-gs { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 14px; animation-delay: .08s; cursor: pointer; }
.m1-gs.m1-up { animation-delay: .16s; cursor: default; }
.m1-ring { position: relative; width: 138px; height: 138px; }
.m1-ring > svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.m1-spin { animation: m1-spin 5s linear infinite; transform-origin: 70px 70px; }
.m1-ctr { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.m1-num { font: 800 30px/1 Oxanium, sans-serif; font-variant-numeric: tabular-nums; color: var(--text); }
.m1-num small { font-size: 14px; color: var(--text2); font-weight: 600; margin-left: 1px; }
.m1-meta { font: 500 11px "JetBrains Mono", monospace; color: var(--dim); margin-top: -4px; text-align: center; }
.m1-meta b { color: var(--text2); font-weight: 600; }
.m1-lbl { font: 700 10px/1 Oxanium, sans-serif; letter-spacing: .2em; color: var(--text2); text-transform: uppercase; }
.m1-sub { font: 500 11.5px Manrope, sans-serif; color: var(--text2); display: flex; align-items: center; gap: 6px; margin-top: 5px; }
.m1-bolt { width: 12px; height: 12px; fill: var(--flare); filter: drop-shadow(0 0 4px var(--ember)); animation: m01-bolt 1.6s ease-in-out infinite; }
.m1-core { position: relative; display: flex; align-items: center; justify-content: center; animation-delay: .04s; overflow: hidden; }
.m1-core::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 50% 50%, color-mix(in srgb, var(--ember) calc(18% * var(--glow)), transparent), transparent 62%); }
.m1-reactor { position: relative; width: 226px; height: 226px; }
.m1-reactor svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.m1-arc { transform-origin: 113px 113px; animation: m1-spin 3.2s linear infinite; }
.m1-dash { transform-origin: 113px 113px; animation: m1-spin 22s linear infinite reverse; }
.m1-wave { position: absolute; inset: 44px; border-radius: 50%; border: 1px solid color-mix(in srgb, var(--line) calc(45% * var(--line-k)), transparent); animation: m1-radiate 3.6s ease-out infinite; }
.m1-wave + .m1-wave { animation-delay: 1.8s; }
.m1-hub {
  position: absolute; inset: 50px; border-radius: 50%;
  background: radial-gradient(circle at 50% 40%, var(--hub), var(--coal-deep) 70%);
  box-shadow: inset 0 0 30px color-mix(in srgb, var(--ember) calc(22% * var(--glow)), transparent), 0 0 40px color-mix(in srgb, var(--blaze) calc(20% * var(--glow)), transparent);
  animation: m1-core 3s ease-in-out infinite; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
}
.m1-big { font: 800 46px/1 Oxanium, sans-serif; color: var(--tip); text-shadow: 0 0 18px color-mix(in srgb, var(--ember) calc(70% * var(--glow)), transparent); font-variant-numeric: tabular-nums; }
.m1-big small { font-size: 20px; color: var(--accent); }
.m1-cap { font: 600 10.5px/1.3 "JetBrains Mono", monospace; color: var(--text2); text-align: center; }
.m1-tag { position: absolute; top: 12px; left: 16px; right: 16px; display: flex; justify-content: space-between; font: 700 10px/1 Oxanium, sans-serif; letter-spacing: .18em; color: var(--text2); text-transform: uppercase; }
.m1-tag b { color: var(--accent); font-weight: 700; }
.m1-ft { position: absolute; bottom: 12px; left: 16px; right: 16px; display: flex; justify-content: space-between; font: 500 10.5px "JetBrains Mono", monospace; color: var(--dim); font-variant-numeric: tabular-nums; }
.m1-ft b { color: var(--text); font-weight: 600; }

.m1-lower { flex: 1; min-height: 300px; display: grid; grid-template-columns: 1fr 252px; gap: 14px; }
.m1-hd { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.m1-hd h3 { margin: 0; font: 700 14px/1 "Chakra Petch", sans-serif; letter-spacing: .06em; color: var(--text); text-transform: uppercase; }
.m1-hd span { font: 600 11px "JetBrains Mono", monospace; color: var(--accent); }
.m1-hd span.off { color: var(--dim); }
.m1-cats { padding: 14px 16px 16px; animation-delay: .22s; display: flex; flex-direction: column; }
.m1-grid { flex: 1; display: grid; grid-template-columns: repeat(3, 1fr); grid-auto-rows: 1fr; gap: 10px; }
.m1-ct {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 8px; min-height: 112px;
  padding: 12px 14px 14px; border-radius: 4px 12px 4px 12px; background: var(--well);
  border: 1px solid color-mix(in srgb, var(--line) calc(12% * var(--line-k)), transparent); overflow: hidden; text-align: left;
}
.m1-ct:hover { border-color: color-mix(in srgb, var(--line) calc(30% * var(--line-k)), transparent); }
.m1-ic {
  width: 32px; height: 32px; flex: none; border-radius: 4px 10px 4px 10px; display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--ember) 12%, transparent); border: 1px solid color-mix(in srgb, var(--line) calc(25% * var(--line-k)), transparent); color: var(--flare);
}
html[data-mode="light"] .m1-ic { color: var(--ember); }
.m1-ic svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.m1-t { min-width: 0; width: 100%; }
.m1-n { font: 600 12.5px/1.2 Manrope, sans-serif; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m1-pc { font: 500 10.5px "JetBrains Mono", monospace; color: var(--dim); position: absolute; top: 13px; right: 14px; }
.m1-s { font: 700 21px/1.25 Oxanium, sans-serif; color: var(--accent); font-variant-numeric: tabular-nums; }
.m1-s.none { color: var(--dim); }
.m1-bar { position: absolute; left: 0; bottom: 0; height: 2px; background: linear-gradient(90deg, var(--flare), var(--blaze)); box-shadow: 0 0 8px var(--ember); transform-origin: left; animation: m01-bar 2.8s ease-in-out infinite; transition: width .6s; }
.m1-ct:nth-child(2) .m1-bar { animation-delay: .3s; } .m1-ct:nth-child(3) .m1-bar { animation-delay: .6s; } .m1-ct:nth-child(4) .m1-bar { animation-delay: .9s; }
.m1-ct:nth-child(5) .m1-bar { animation-delay: 1.2s; } .m1-ct:nth-child(6) .m1-bar { animation-delay: 1.5s; }
.m1-flow { padding: 14px 16px 14px; animation-delay: .3s; display: flex; flex-direction: column; }
.m1-steps { position: relative; display: flex; flex-direction: column; justify-content: space-between; flex: 1; padding: 2px 0; min-height: 200px; }
.m1-steps svg.m1-ln { position: absolute; left: 13px; top: 14px; width: 2px; height: calc(100% - 28px); overflow: visible; }
.m1-steps svg.m1-ln line { stroke: var(--ember); stroke-opacity: .55; animation: m1-flow 1s linear infinite; }
.m1-st { position: relative; display: flex; align-items: center; gap: 11px; font: 600 12.5px Manrope, sans-serif; color: var(--text2); }
.m1-st i {
  width: 28px; height: 28px; flex: none; border-radius: 4px 10px 4px 10px; display: flex; align-items: center; justify-content: center;
  font: 800 12px Oxanium, sans-serif; font-style: normal; color: var(--text2); background: var(--chrome-bottom);
  border: 1px solid color-mix(in srgb, var(--line) calc(22% * var(--line-k)), transparent);
}
.m1-st.on { color: var(--text); }
.m1-st.on i { color: var(--on-fill); background: linear-gradient(135deg, var(--flare), var(--ember) 55%, var(--blaze)); border-color: transparent; animation: breathe 2.6s ease-in-out infinite; }
.m1-st em { margin-left: auto; font: 500 10px "JetBrains Mono", monospace; font-style: normal; color: var(--dim); }
.m1-note { margin-top: 8px; font: 500 11px/1.4 Manrope, sans-serif; color: var(--dim); display: flex; gap: 7px; align-items: flex-start; }
.m1-note svg { width: 13px; height: 13px; flex: none; margin-top: 1px; fill: none; stroke: var(--ok); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.m1-note.busy svg { stroke: var(--warn); }
.m1-note u { color: var(--accent); cursor: pointer; text-decoration: none; }

@keyframes m1-spin { to { transform: rotate(360deg); } }
@keyframes m1-flow { to { stroke-dashoffset: -18; } }
@keyframes m1-radiate { 0% { transform: scale(.6); opacity: .8; } 100% { transform: scale(1.8); opacity: 0; } }
@keyframes m1-core { 50% { box-shadow: inset 0 0 55px color-mix(in srgb, var(--ember) calc(40% * var(--glow)), transparent), 0 0 90px color-mix(in srgb, var(--blaze) calc(40% * var(--glow)), transparent); } }
@keyframes m01-ind { 50% { box-shadow: 0 0 16px var(--ember), 0 0 34px color-mix(in srgb, var(--blaze) calc(95% * var(--glow)), transparent); } }
@keyframes m01-bolt { 50% { opacity: .45; } }
@keyframes m01-bar { 0%,100% { opacity: .55; } 50% { opacity: 1; } }
html.calm .m1 *, html.calm .m1-strip *, html.calm[data-design="emberRings"] .tab.on::before { animation: none !important; }
