:root {
  color-scheme: dark;
  --void: #010503;
  --black: #030a06;
  --panel: rgba(2, 14, 8, 0.88);
  --phosphor: #00ff66;
  --phosphor-bright: #b9ffd0;
  --phosphor-dim: #2fa75e;
  --text: #d6ffe2;
  --muted: #72a783;
  --line: rgba(0, 255, 102, 0.24);
  --line-hot: rgba(0, 255, 102, 0.68);
  --warning: #ffb000;
  --danger: #ff365d;
  --shadow: 0 0 0 1px rgba(0, 255, 102, 0.05), 0 24px 80px rgba(0, 0, 0, 0.58);
  --mono: "SFMono-Regular", "Cascadia Code", "Roboto Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
.filter-nav a { display: block; padding: .75rem; color: var(--text); text-decoration: none; border: 1px solid transparent; }
.filter-nav a[aria-current="page"], .filter-nav a:hover { border-color: var(--phosphor); background: #092416; }
.help-links { display: flex; gap: 1.5rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.help-links a { color: var(--phosphor-bright); text-underline-offset: .25em; }
.help-development-note { padding: .75rem 1rem; border-left: 2px solid var(--warning); background: rgba(255, 176, 0, .04); color: var(--text); }
.help-search { display: block; max-width: 36rem; margin-bottom: 1.5rem; }
.help-search input { width: 100%; margin-top: .5rem; }
.help-article { max-width: 75ch; }
.help-mode .app-content { min-width: 0; }
.help-mode .guide-library-panel { overflow-wrap: anywhere; }
.guide-library-panel { scroll-margin-top: 2rem; }
.guide-library-panel p, .guide-library-panel li { font-size: 1rem; line-height: 1.7; }
.guide-library-panel .guide-steps p { font-size: 1rem; line-height: 1.7; }
.guide-library-panel .panel-heading p, .guide-library-panel .help-search, .guide-library-panel button, .guide-library-panel input, .guide-library-panel .guide-open-button { font-size: .875rem; }
.guide-library-panel .guide-meta { font-size: .875rem; }
.guide-library-panel .guide-summary { color: var(--text); }
.guide-library-panel h3 { margin-top: 1.25rem; }
.guide-library-panel a:focus-visible, .guide-library-panel button:focus-visible, .filter-nav a:focus-visible { outline: 2px solid var(--phosphor-bright); outline-offset: 4px; }
@media (max-width: 700px) {
  .help-mode .project-sidebar { display: none; }
  .help-mode .guide-library-panel { margin-top: 0; }
  .guide-library-panel .panel-heading { flex-wrap: wrap; }
  .guide-library-panel .panel-heading > div { min-width: 0; flex: 1 1 12rem; }
  .guide-library-panel { padding: 1.25rem; }
}
html { background: var(--void); }
body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 52% -10%, rgba(0, 255, 102, 0.11), transparent 40%),
    linear-gradient(180deg, rgba(0, 13, 6, 0.94), rgba(0, 3, 2, 0.99));
  color: var(--text);
  font-family: var(--mono);
  text-shadow: 0 0 12px rgba(0, 255, 102, 0.08);
}
body::after {
  position: fixed;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  content: "";
  opacity: 0.2;
  background: repeating-linear-gradient(0deg, transparent 0, transparent 3px, rgba(0, 0, 0, 0.22) 4px);
}
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
.session-controls { min-width: 0; flex-wrap: wrap; }
#user-email { min-width: 0; overflow-wrap: anywhere; white-space: normal; }

.matrix-background { position: fixed; inset: 0; z-index: 0; overflow: hidden; background: var(--void); }
#matrix-rain { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0.7; filter: blur(0.15px); }
.matrix-grid {
  position: absolute;
  inset: 0;
  opacity: 0.13;
  background-image:
    linear-gradient(rgba(0, 255, 102, 0.16) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 255, 102, 0.16) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: linear-gradient(to bottom, black, transparent 80%);
  transform: perspective(500px) rotateX(62deg) scale(1.8) translateY(18%);
  transform-origin: center bottom;
}
.scanline {
  position: absolute;
  left: 0;
  right: 0;
  height: 18vh;
  opacity: 0.12;
  background: linear-gradient(transparent, rgba(0, 255, 102, 0.18), transparent);
  animation: scan 10s linear infinite;
}

.topbar {
  position: relative;
  z-index: 10;
  min-height: 78px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  padding: 12px clamp(18px, 4vw, 64px);
  border-bottom: 1px solid var(--line-hot);
  background: rgba(1, 8, 4, 0.92);
  box-shadow: 0 0 30px rgba(0, 255, 102, 0.08);
  backdrop-filter: blur(16px);
}
.topbar::after {
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 28%;
  height: 2px;
  content: "";
  background: linear-gradient(90deg, transparent, var(--phosphor), transparent);
  animation: dataSweep 7s linear infinite;
}
.brand { display: flex; align-items: center; gap: 13px; color: inherit; text-decoration: none; justify-self: start; }
.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--phosphor);
  color: var(--phosphor);
  background: rgba(0, 255, 102, 0.05);
  box-shadow: inset 0 0 16px rgba(0, 255, 102, 0.09), 0 0 14px rgba(0, 255, 102, 0.12);
  font-weight: 900;
  clip-path: polygon(0 0, calc(100% - 9px) 0, 100% 9px, 100% 100%, 9px 100%, 0 calc(100% - 9px));
}
.brand strong, .brand small { display: block; }
.brand strong { color: var(--phosphor-bright); letter-spacing: 0.2em; font-size: 0.86rem; }
.brand small { margin-top: 4px; color: var(--muted); font-size: 0.64rem; letter-spacing: 0.06em; text-transform: uppercase; }
.system-readout { display: flex; align-items: center; gap: 24px; color: var(--phosphor-dim); font-size: 0.6rem; letter-spacing: 0.12em; }
.system-readout > span::before { content: "● "; color: var(--phosphor); animation: pulse 2.4s ease-in-out infinite; }
.system-status { display: grid; gap: 2px; min-width: 150px; border: 1px solid var(--danger); padding: 7px 10px; color: #ff9aad; background: rgba(255,54,93,.07); text-align: left; letter-spacing: .08em; }
.system-status::before { content: "●"; grid-row: 1 / span 2; align-self: center; margin-right: 8px; color: var(--danger); animation: pulse 1.4s ease-in-out infinite; }
.system-status span, .system-status small { grid-column: 2; }
.system-status span { font-size: .61rem; font-weight: 900; }
.system-status small { color: #b96b7b; font-size: .48rem; }
.system-status.is-online { border-color: var(--line-hot); color: var(--phosphor-bright); background: rgba(0,255,102,.05); }
.system-status.is-online::before { color: var(--phosphor); }
.system-status.is-online small { color: var(--phosphor-dim); }
.system-status[hidden] { display: none; }
.session-controls { justify-self: end; align-items: center; gap: 16px; color: var(--phosphor-dim); font-size: 0.72rem; }
#user-email::before { content: "OPERATOR // "; color: var(--muted); }

main { position: relative; z-index: 2; width: min(1780px, calc(100% - 40px)); margin: 0 auto; padding: clamp(34px, 4vw, 70px) 0; }
.login-panel { max-width: 900px; min-height: calc(100vh - 170px); display: flex; flex-direction: column; justify-content: center; padding: 4vh 0 12vh; }
.login-panel[hidden] { display: none; }
.login-panel h1, .hero h1 {
  margin: 12px 0 24px;
  color: var(--text);
  font-size: clamp(3rem, 7vw, 7rem);
  font-weight: 500;
  line-height: 0.94;
  letter-spacing: -0.075em;
  text-transform: uppercase;
}
.login-panel h1 span { color: transparent; -webkit-text-stroke: 1px var(--phosphor); text-shadow: 0 0 22px rgba(0, 255, 102, 0.28); }
.login-panel .lede { max-width: 710px; color: var(--muted); font-size: 0.95rem; line-height: 1.8; }
.eyebrow { margin: 0; color: var(--phosphor); font-size: 0.68rem; font-weight: 800; letter-spacing: 0.18em; text-transform: uppercase; }
.eyebrow::before { content: "> "; }
.fine-print { margin-top: 20px; color: var(--phosphor-dim); font-size: 0.67rem; letter-spacing: 0.06em; }

.button {
  min-height: 42px;
  border: 1px solid var(--line-hot);
  border-radius: 0;
  padding: 11px 20px;
  color: var(--phosphor);
  background: rgba(0, 255, 102, 0.04);
  font-size: 0.71rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  clip-path: polygon(0 0, calc(100% - 9px) 0, 100% 9px, 100% 100%, 9px 100%, 0 calc(100% - 9px));
  transition: color 150ms ease, background 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}
.button:hover:not(:disabled) { color: var(--black); background: var(--phosphor); box-shadow: 0 0 24px rgba(0, 255, 102, 0.35); transform: translateY(-1px); }
.button:focus-visible { outline: 1px solid var(--phosphor-bright); outline-offset: 4px; }
.button:disabled { opacity: 0.3; filter: saturate(0.2); }
.button-primary { color: var(--black); background: var(--phosphor); box-shadow: 0 0 24px rgba(0, 255, 102, 0.16); }
.button-secondary { color: var(--phosphor); background: transparent; }
.login-panel .button { align-self: flex-start; margin-top: 28px; min-height: 50px; padding-inline: 27px; }

.hero { display: flex; justify-content: space-between; align-items: end; gap: 30px; margin-bottom: 38px; }
.hero h1 { max-width: 970px; margin-bottom: 10px; font-size: clamp(3rem, 5.8vw, 6rem); }
.hero > div > p:last-child { margin: 0; color: var(--muted); font-size: 0.8rem; }
.terminal-cursor { color: var(--phosphor); animation: blink 1s steps(1) infinite; }
.safety-note {
  position: relative;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 260px;
  padding: 16px 19px;
  border: 1px solid rgba(255, 176, 0, 0.45);
  background: rgba(20, 14, 0, 0.72);
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 0 100%);
}
.safety-note strong, .safety-note small { display: block; }
.safety-note strong { color: #ffca52; font-size: 0.76rem; letter-spacing: 0.05em; text-transform: uppercase; }
.safety-note small { margin-top: 5px; color: #b98a35; font-size: 0.64rem; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--warning); box-shadow: 0 0 0 5px rgba(255,176,0,.1), 0 0 16px rgba(255,176,0,.5); animation: pulse 2s ease-in-out infinite; }

.app-shell { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px; align-items: start; }
.app-content { min-width: 0; }
.project-sidebar { position: sticky; top: 24px; display: grid; gap: 13px; padding: 18px 12px; border: 1px solid var(--line); background: rgba(1, 9, 4, .9); box-shadow: var(--shadow); }
.sidebar-label { margin: 10px 8px 2px; color: var(--muted); font-size: .57rem; letter-spacing: .13em; }
.filter-nav { display: grid; gap: 4px; }
.filter-nav button { display: flex; justify-content: space-between; gap: 8px; width: 100%; border: 0; border-left: 2px solid transparent; padding: 10px 9px; color: var(--muted); background: transparent; text-align: left; font-size: .66rem; text-transform: uppercase; }
.filter-nav button:hover, .filter-nav button.active { border-color: var(--phosphor); color: var(--phosphor-bright); background: rgba(0,255,102,.07); }
.filter-nav button span { color: var(--phosphor-dim); }
.workspace-grid { display: grid; grid-template-columns: minmax(390px, 0.9fr) minmax(500px, 1.1fr); gap: 20px; align-items: start; }
.panel {
  position: relative;
  overflow: hidden;
  padding: clamp(24px, 3vw, 40px);
  border: 1px solid var(--line);
  border-radius: 0;
  background: linear-gradient(145deg, rgba(4, 20, 10, 0.94), rgba(1, 8, 4, 0.9));
  box-shadow: var(--shadow), inset 0 0 70px rgba(0, 255, 102, 0.018);
  clip-path: polygon(0 0, calc(100% - 17px) 0, 100% 17px, 100% 100%, 17px 100%, 0 calc(100% - 17px));
  backdrop-filter: blur(15px);
}
.panel::before { position: absolute; top: 0; left: 0; width: 32%; height: 2px; content: ""; background: linear-gradient(90deg, var(--phosphor), transparent); box-shadow: 0 0 14px var(--phosphor); }
.panel::after { position: absolute; right: 18px; bottom: 12px; content: attr(data-panel); color: rgba(0, 255, 102, 0.25); font-size: 0.54rem; letter-spacing: 0.16em; }
.panel-heading { display: flex; align-items: flex-start; gap: 15px; margin-bottom: 28px; }
.panel-heading h2 { margin: 0 0 6px; color: var(--phosphor-bright); font-size: 1.05rem; font-weight: 650; letter-spacing: 0.04em; text-transform: uppercase; }
.panel-heading p { margin: 0; color: var(--muted); font-size: 0.7rem; }
.step { padding-top: 2px; color: var(--phosphor); font-size: 0.68rem; font-weight: 750; white-space: nowrap; }
.queue-heading .icon-button { margin-left: auto; }
.icon-button { width: 38px; height: 38px; border: 1px solid var(--line-hot); border-radius: 0; color: var(--phosphor); background: rgba(0, 255, 102, 0.03); font-size: 1.2rem; transition: background 150ms ease, box-shadow 150ms ease; }
.icon-button:hover { background: rgba(0, 255, 102, 0.15); box-shadow: 0 0 17px rgba(0, 255, 102, 0.2); }
.icon-button:focus-visible { outline: 1px solid var(--phosphor-bright); outline-offset: 3px; }

form { display: grid; gap: 19px; }
label { position: relative; display: grid; gap: 8px; color: var(--phosphor-dim); font-size: 0.67rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }
label::before { position: absolute; content: ">"; transform: translateX(-13px); color: rgba(0, 255, 102, 0.38); }
label span { color: #4d7559; font-weight: 500; }
input, textarea, select {
  width: 100%;
  border: 1px solid rgba(0, 255, 102, 0.23);
  border-radius: 0;
  outline: none;
  padding: 13px 14px;
  color: var(--text);
  background: rgba(0, 3, 1, 0.82);
  box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.45);
  font-size: 0.78rem;
  letter-spacing: 0;
  text-transform: none;
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}
input::placeholder, textarea::placeholder { color: #3e6b4c; opacity: 0.72; }
input:focus, textarea:focus, select:focus { border-color: var(--phosphor); background: rgba(0, 13, 5, 0.95); box-shadow: 0 0 0 1px rgba(0, 255, 102, 0.14), 0 0 22px rgba(0, 255, 102, 0.08), inset 0 0 22px rgba(0, 255, 102, 0.025); }
input:disabled, textarea:disabled, select:disabled { color: #42604b; border-color: rgba(83, 122, 94, 0.18); opacity: 0.72; }
textarea { min-height: 110px; resize: vertical; line-height: 1.55; }
.split-fields { display: grid; grid-template-columns: 0.58fr 1.42fr; gap: 14px; }
.submit-button { justify-self: start; margin-top: 5px; }
.evidence-field small { color: #527960; font-size: .58rem; font-weight: 500; line-height: 1.5; text-transform: none; }
.evidence-field input[type="file"] { padding: 9px; color: var(--muted); }
.evidence-field input[type="file"]::file-selector-button { margin-right: 12px; border: 1px solid var(--line-hot); padding: 8px 11px; color: var(--phosphor); background: rgba(0,255,102,.05); font: inherit; font-size: .62rem; font-weight: 800; text-transform: uppercase; cursor: pointer; }
.evidence-preview { display: flex; flex-wrap: wrap; gap: 7px; margin-top: -9px; }
.evidence-chip { border: 1px solid var(--line); padding: 6px 8px; color: #8bc69d; background: rgba(0,255,102,.035); font-size: .61rem; overflow-wrap: anywhere; }

.message { border-left: 2px solid var(--phosphor); padding: 12px 14px; color: var(--phosphor-dim); background: rgba(0, 255, 102, 0.045); font-size: 0.72rem; line-height: 1.55; }
.message::before { content: "SYSTEM // "; color: var(--phosphor); font-weight: 800; }
.message.error { border-color: var(--danger); color: #ff8aa0; background: rgba(255, 54, 93, 0.06); }
.message.error::before { content: "ERROR // "; color: var(--danger); }
.project-warning { border: 1px solid rgba(255,176,0,.5); border-left-width: 3px; padding: 12px 14px; color: #e3bd67; background: rgba(255,176,0,.07); font-size: .69rem; line-height: 1.55; }
.project-warning strong { color: #ffca52; }
.project-warning button { display: block; margin-top: 10px; border: 1px solid var(--warning); padding: 7px 10px; color: #160f00; background: var(--warning); font-size: .61rem; font-weight: 850; text-transform: uppercase; }
.request-list { display: grid; gap: 13px; }
.request-card { position: relative; border: 1px solid var(--line); padding: 18px; background: rgba(0, 5, 2, 0.62); }
.request-card::before { position: absolute; top: -1px; left: -1px; width: 6px; height: 6px; border-top: 1px solid var(--phosphor); border-left: 1px solid var(--phosphor); content: ""; }
.request-card-header { display: flex; justify-content: space-between; gap: 16px; }
.request-card h3 { margin: 0; color: var(--phosphor-bright); font-size: 0.9rem; }
.request-meta { margin: 6px 0 0; color: var(--muted); font-size: 0.65rem; }
.request-description { margin: 16px 0; color: #9acbaa; font-size: 0.76rem; line-height: 1.6; white-space: pre-wrap; }
.status-badge { align-self: start; border: 1px solid var(--line); padding: 6px 9px; color: var(--phosphor-dim); background: rgba(0, 255, 102, 0.04); font-size: 0.57rem; font-weight: 850; letter-spacing: 0.08em; text-transform: uppercase; white-space: nowrap; }
.status-badge.approved { border-color: var(--phosphor); color: var(--phosphor); }
.status-badge.needs_clarification { border-color: var(--warning); color: #ffca52; }
.status-badge.completed, .status-badge.recovery_completed { border-color: var(--phosphor-bright); color: var(--phosphor-bright); }
.status-badge.recovery_queued, .status-badge.recovery_dispatching, .status-badge.recovery_dispatched, .status-badge.recovery_pending_verification, .status-badge.recovery_partial { border-color: var(--warning); color: #ffca52; }
.status-badge.cancelled, .status-badge.failed, .status-badge.recovery_failed { border-color: rgba(255, 54, 93, 0.3); color: #ff8aa0; }
.request-actions { display: flex; align-items: center; gap: 9px; }
.request-actions a { color: var(--phosphor); font-size: 0.68rem; text-underline-offset: 4px; }
.request-actions button { border: 1px solid var(--line); border-radius: 0; padding: 7px 11px; color: var(--phosphor-dim); background: transparent; font-size: 0.63rem; font-weight: 750; text-transform: uppercase; }
.request-actions .approve { border-color: var(--phosphor); color: var(--black); background: var(--phosphor); }
.request-actions .rollback { border-color: var(--warning); color: #ffca52; background: rgba(255,176,0,.06); }
.clarification-notice { margin: 12px 0; border-left: 2px solid var(--warning); padding: 10px 13px; color: #d6ad51; background: rgba(255,176,0,.06); font-size: .67rem; line-height: 1.55; }
.clarification-notice strong { color: #ffca52; text-transform: uppercase; }
.clarification-notice ul { margin: 7px 0 0; padding-left: 18px; }
.request-detail, .completion-controls { margin: 12px 0; border-top: 1px solid var(--line); padding-top: 10px; color: var(--muted); font-size: .66rem; }
.request-detail summary, .completion-controls summary { color: var(--phosphor-dim); cursor: pointer; text-transform: uppercase; }
.request-detail dl { display: grid; grid-template-columns: 1fr; gap: 8px; margin: 12px 0; }
.detail-row { display: grid; grid-template-columns: 110px 1fr; gap: 8px; }
.detail-row dt { color: var(--muted); text-transform: uppercase; }
.detail-row dd { margin: 0; color: #9acbaa; overflow-wrap: anywhere; white-space: pre-wrap; }
.audit-timeline { margin: 12px 0 4px; padding-left: 20px; color: #679678; line-height: 1.55; }
.stored-evidence, .recovery-plan { display: grid; gap: 8px; margin: 12px 0; border-left: 2px solid var(--line-hot); padding: 10px 12px; background: rgba(0,255,102,.035); }
.stored-evidence strong, .recovery-plan strong { color: var(--phosphor-bright); text-transform: uppercase; }
.stored-evidence .retention-note { margin: 0; color: var(--amber); font-size: .6rem; line-height: 1.55; }
.stored-evidence > div { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: #8bc69d; overflow-wrap: anywhere; }
.stored-evidence button { border: 1px solid var(--line); padding: 5px 8px; color: var(--phosphor); background: transparent; font-size: .58rem; text-transform: uppercase; }
.recovery-plan { border-color: var(--warning); background: rgba(255,176,0,.04); }
.recovery-plan strong { color: #ffca52; }
.recovery-plan p, .recovery-plan ul { margin: 0; color: #c6a45b; line-height: 1.5; }
.recovery-plan ul { padding-left: 18px; }
.completion-form { margin-top: 14px; padding: 14px; border: 1px solid rgba(255,176,0,.35); background: rgba(20,14,0,.35); }
.completion-form textarea { min-height: 78px; }
.danger-copy { margin: 0; color: #ffca52; font-size: .66rem; line-height: 1.5; }
.project-admin-panel { margin-top: 24px; }
.admin-project-list { display: grid; gap: 12px; margin-top: 18px; }
.admin-project-card { border: 1px solid var(--line); padding: 16px; background: rgba(0, 255, 102, .025); }
.admin-project-card.state-retirement_pending { border-color: rgba(255,176,0,.55); background: rgba(255,176,0,.035); }
.admin-project-card.state-retired { opacity: .78; border-style: dashed; }
.admin-project-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.admin-project-header strong, .admin-project-header code { display: block; }
.admin-project-header strong { color: var(--phosphor-bright); text-transform: uppercase; }
.admin-project-header code { margin-top: 5px; color: var(--muted); font-size: .62rem; }
.project-state { border: 1px solid var(--line); padding: 5px 8px; color: var(--phosphor); font-size: .58rem; text-transform: uppercase; }
.state-retirement_pending .project-state { border-color: var(--warning); color: #ffca52; }
.admin-project-details, .admin-project-blockers, .admin-project-archive-note { margin: 12px 0 0; color: #79a989; font-size: .64rem; line-height: 1.55; overflow-wrap: anywhere; }
.admin-project-blockers { color: #ffca52; }
.project-retirement-form { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(220px, 1fr) auto; gap: 10px; margin-top: 14px; }
.project-retirement-form input { min-width: 0; }
.retire-project-button { border-color: var(--danger); color: #ff8399; background: rgba(255,54,93,.05); }
.retire-project-button:hover { background: rgba(255,54,93,.12); }
.guide-library-panel { margin-top: 24px; }
.guide-library-list { display: grid; gap: 14px; }
.guide-card { border: 1px solid var(--line); padding: 18px; background: rgba(0,255,102,.025); }
.guide-card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.guide-card h3 { margin: 0; color: var(--phosphor-bright); font-size: .9rem; text-transform: uppercase; }
.guide-meta, .guide-summary, .guide-audience { color: var(--muted); font-size: .64rem; line-height: 1.55; }
.guide-meta { margin: 6px 0 0; }
.guide-summary { margin: 14px 0 8px; color: #9acbaa; }
.guide-audience { margin: 0 0 14px; color: var(--phosphor-dim); text-transform: uppercase; }
.guide-screenshot-status { flex: 0 0 auto; border: 1px solid var(--line); padding: 5px 8px; color: var(--phosphor); font-size: .55rem; text-transform: uppercase; }
.guide-screenshot-status.capture_pending { border-color: rgba(255,176,0,.45); color: #ffca52; }
.guide-open-button { min-height: 36px; padding: 8px 13px; }
.guide-detail { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 16px; }
.guide-detail[hidden] { display: none; }
.guide-screenshot-note { margin: 0 0 16px; border-left: 2px solid var(--warning); padding: 9px 12px; color: #d6ad51; background: rgba(255,176,0,.05); font-size: .61rem; line-height: 1.5; }
.guide-screenshot-note.current { border-left-color: var(--phosphor); color: #9acbaa; background: rgba(0,255,102,.04); }
.guide-screenshot-gallery { display: grid; gap: 14px; margin: 0 0 20px; }
.guide-screenshot { margin: 0; border: 1px solid var(--line); background: #010804; }
.guide-screenshot img { display: block; width: 100%; height: auto; aspect-ratio: 1325 / 768; object-fit: contain; }
.guide-screenshot figcaption { border-top: 1px solid var(--line); padding: 10px 12px; color: #8fbda0; font-size: .61rem; line-height: 1.55; }
.guide-steps { display: grid; gap: 14px; margin: 0; padding-left: 28px; color: var(--phosphor); }
.guide-steps li { padding-left: 5px; }
.guide-steps h4 { margin: 0 0 6px; color: var(--phosphor-bright); font-size: .74rem; text-transform: uppercase; }
.guide-steps p, .guide-outcome p, .guide-failures { margin: 0; color: #8fbda0; font-size: .67rem; line-height: 1.65; }
.guide-outcome { display: grid; gap: 7px; margin-top: 18px; border: 1px solid var(--line); padding: 14px; background: rgba(0,0,0,.2); }
.guide-outcome strong { margin-top: 5px; color: var(--phosphor); font-size: .62rem; text-transform: uppercase; }
.guide-failures { display: grid; gap: 5px; padding-left: 20px; }
.guide-drill { display: grid; gap: 7px; margin-top: 9px; border-left: 2px solid var(--phosphor); padding: 12px; background: rgba(0,255,102,.04); }
.support-panel { max-width: 900px; margin-top: 24px; }
.support-panel form { max-width: 720px; }
.support-panel .button { justify-self: start; }
.health-dialog {
  width: min(820px, calc(100vw - 30px));
  max-height: min(820px, calc(100vh - 30px));
  overflow: auto;
  border: 1px solid var(--line-hot);
  border-radius: 0;
  padding: 28px;
  color: var(--text);
  background: linear-gradient(145deg, rgba(4,20,10,.99), rgba(1,8,4,.99));
  box-shadow: 0 30px 100px rgba(0,0,0,.9), inset 0 0 70px rgba(0,255,102,.025);
  font-family: var(--mono);
}
.health-dialog::backdrop { background: rgba(0,3,2,.84); backdrop-filter: blur(8px); }
.health-dialog.is-issue { border-color: rgba(255,54,93,.65); }
.dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); padding-bottom: 20px; }
.dialog-heading h2 { margin: 9px 0 0; color: var(--phosphor-bright); font-size: 1.35rem; text-transform: uppercase; }
.health-dialog-summary { display: grid; grid-template-columns: 1fr auto; gap: 7px 20px; padding: 20px 0; }
.health-dialog-summary strong { color: #ff8aa0; font-size: .9rem; letter-spacing: .08em; }
.health-dialog.is-online .health-dialog-summary strong { color: var(--phosphor); }
.health-dialog-summary span { color: var(--muted); font-size: .64rem; }
.health-dialog-summary p { grid-column: 1 / -1; margin: 0; color: #9acbaa; font-size: .71rem; line-height: 1.55; }
.health-component-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.health-component { display: grid; grid-template-columns: 1fr auto; gap: 5px 12px; border: 1px solid var(--line); padding: 12px; background: rgba(0,255,102,.025); }
.health-component strong { color: var(--phosphor-bright); font-size: .66rem; text-transform: uppercase; }
.health-component-state { color: var(--phosphor); font-size: .59rem; font-weight: 800; text-transform: uppercase; }
.health-component small,.health-component time { color: var(--muted); font-size: .56rem; text-transform: uppercase; }
.health-component time { text-align: right; }
.health-component.is-unhealthy,.health-component.is-unknown { border-color: rgba(255,54,93,.4); background: rgba(255,54,93,.04); }
.health-component.is-unhealthy .health-component-state,.health-component.is-unknown .health-component-state { color: #ff8aa0; }
.health-reason-codes { margin-top: 15px; border-left: 2px solid var(--danger); padding: 10px 12px; color: #ff8aa0; background: rgba(255,54,93,.05); font-size: .6rem; line-height: 1.55; text-transform: uppercase; }
.assistant-dock { position: fixed; right: 18px; bottom: 16px; z-index: 30; display: flex; align-items: end; gap: 10px; filter: drop-shadow(0 18px 30px rgba(0,0,0,.75)); }
.assistant-dock[hidden] { display: none; }
.assistant-toggle { position: relative; width: 116px; height: 138px; overflow: hidden; border: 1px solid var(--line-hot); padding: 0; color: var(--phosphor-bright); background: radial-gradient(circle at 50% 35%, rgba(0,255,102,.13), rgba(1,8,4,.96) 65%); clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 0 100%); }
.assistant-toggle canvas { display: block; width: 116px; height: 112px; }
.assistant-toggle span { position: absolute; inset: auto 0 8px; font-size: .57rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.assistant-panel { position: relative; width: min(290px, calc(100vw - 160px)); margin-bottom: 12px; border: 1px solid var(--line-hot); padding: 15px 34px 15px 16px; color: #9acbaa; background: rgba(1,10,5,.97); font-size: .67rem; line-height: 1.55; }
.assistant-panel strong { color: var(--phosphor-bright); text-transform: uppercase; }
.assistant-panel p { margin: 7px 0 0; }
.assistant-close { position: absolute; top: 5px; right: 6px; border: 0; color: var(--phosphor); background: transparent; font-size: 1rem; }
.assistant-dock.collapsed .assistant-panel { display: none; }
.empty-state { padding: 92px 20px; color: var(--muted); text-align: center; }
.empty-state > span { display: grid; place-items: center; width: 54px; height: 54px; margin: 0 auto 18px; border: 1px solid var(--line); color: var(--phosphor); background: rgba(0, 255, 102, 0.035); box-shadow: 0 0 25px rgba(0, 255, 102, 0.06); font-size: 0.92rem; }
.empty-state h3 { margin: 0 0 8px; color: var(--phosphor-bright); font-size: 0.9rem; font-weight: 600; text-transform: uppercase; }
.empty-state p { margin: 0; font-size: 0.7rem; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #010503; }
::-webkit-scrollbar-thumb { border: 2px solid #010503; background: #155c30; }
::selection { color: var(--black); background: var(--phosphor); }

@keyframes blink { 0%, 46% { opacity: 1; } 47%, 100% { opacity: 0; } }
@keyframes pulse { 0%, 100% { opacity: 0.4; } 50% { opacity: 1; } }
@keyframes scan { from { transform: translateY(-25vh); } to { transform: translateY(125vh); } }
@keyframes dataSweep { from { transform: translateX(-120%); } to { transform: translateX(460%); } }

@media (max-width: 1050px) {
  .topbar { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .system-readout { display: none; }
  .workspace-grid { grid-template-columns: 1fr; }
  .app-shell { grid-template-columns: 1fr; }
  .project-sidebar { position: static; grid-template-columns: 1fr 1fr; }
  .project-sidebar .sidebar-label { display: none; }
  .hero { align-items: flex-start; flex-direction: column; }
  .project-retirement-form { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  main { width: min(100% - 24px, 1500px); padding-top: 38px; }
  .topbar { padding: 12px 14px; }
  #user-email { display: none; }
  .brand small { display: none; }
  .split-fields { grid-template-columns: 1fr; }
  .panel { padding: 24px 19px; }
  .hero h1 { font-size: clamp(2.7rem, 16vw, 4.2rem); }
  .safety-note { min-width: 100%; }
  .project-sidebar { grid-template-columns: 1fr; }
  .health-dialog { padding: 20px 16px; }
  .health-dialog-summary { grid-template-columns: 1fr; }
  .health-dialog-summary p { grid-column: 1; }
  .health-component-list { grid-template-columns: 1fr; }
  .assistant-panel { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
  #matrix-rain { opacity: 0.3; }
}
