.occurrence-modal, #noc, .noc-topbar {
  --ops-ink: #25372e;
  --ops-green: #23805b;
  --ops-muted: #687a70;
  --ops-line: #dce5df;
  --ops-soft: #f5f7f6;
  color: var(--ops-ink);
  font: 15px Inter, 'Segoe UI', system-ui, sans-serif;
}
.ops-row { display: flex; align-items: center; gap: 12px; }
.ops-stack { display: grid; gap: 5px; min-width: 0; }
.ops-mark { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 10px; background: #e5f0e9; color: var(--ops-green); }
.ops-mark svg, .ops-symbol { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ops-ghost { border: 1px solid transparent; border-radius: 8px; background: transparent; color: #62766a; padding: 9px 13px; font-weight: 600; }
.ops-ghost:hover { background: #edf5ef; }
.occurrence-modal :is(h2,h3,h4,p), #noc :is(h1,h2,h3,p) { margin: 0; }
.occurrence-modal :is(.primary,.secondary), #noc .secondary { font-size: 15px; font-weight: 600; border-radius: 8px; padding: 9px 13px; }
.occurrence-modal .primary { border-color: var(--ops-green); background: var(--ops-green); }
.occurrence-modal .primary:hover { background: #1b694a; }
.occurrence-modal .secondary, #noc .secondary { border-color: #cad9d0; color: #344c3e; }
.occurrence-modal small, .modal-foot > span, .modal-heading p, .occurrence-heading p, #noc :is(p,small), #noc-freshness, #noc-health, #noc-queue-count { color: var(--ops-muted); font-size: 13px; }

.occurrence-modal { width: min(920px, calc(100% - 32px)); height: auto; max-height: calc(100dvh - 40px); border: 1px solid #cad9d0; border-radius: 16px; box-shadow: 0 18px 70px #18372a40; }
.occurrence-modal[open] { grid-template-rows: auto minmax(0, 1fr) auto; }
.occurrence-modal::backdrop { background: #17352970; }
.occurrence-modal.expanded { width: calc(100% - 24px); height: calc(100dvh - 24px); max-height: none; }
.modal-head, .modal-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 24px; background: #fff; }
.modal-head { border-bottom-color: var(--ops-line); }
.modal-foot { border-top: 1px solid var(--ops-line); }
.modal-actions { gap: 5px; }
.occurrence-modal .ops-icon { min-width: 37px; padding: 7px 10px; font-size: 20px; line-height: 1; }
.modal-head h2 { font-size: 16px; letter-spacing: 0; }
.modal-heading p { margin-top: 5px; }
.modal-content { display: grid; gap: 19px; align-content: start; min-height: 0; padding: 24px; }
.occurrence-heading { margin: 0; align-items: start; }
.occurrence-heading h3, .diagnosis-copy h3 { font-size: 21px; letter-spacing: -.025em; }
.occurrence-heading p { margin-top: 5px; }
.occurrence-heading .ops-chip { border-radius: 6px; font-size: 12px; padding: 5px 10px; }
.attendance-box { display: grid; gap: 13px; padding: 16px; border-radius: 12px; background: var(--ops-soft); }
.attendance-box .attendance-head, .impact-row { justify-content: space-between; flex-wrap: wrap; }
.attendance-icon { font-size: 18px; line-height: 1; color: var(--ops-green); }
.attendance-icon.waiting { color: #8c690e; }
.attendance-owner { font-size: 14px; }
.attendance-owner .ops-stack { gap: 1px; }
.attendance-owner .avatar { display: grid; flex: none; width: 32px; height: 32px; background: #dcebe1; color: #23724f; font-size: 12px; }
.attendance-menu { display: grid; gap: 4px; background: #fff; border: 1px solid var(--ops-line); border-radius: 9px; padding: 6px; }
.attendance-menu button { justify-content: start; border-color: transparent !important; }
.ops-confirm { display: grid; gap: 10px; border: 1px solid #e3cc9b; border-radius: 10px; padding: 14px; background: #fff9eb; }
.ops-confirm p { font-size: 14px; }
.ops-confirm .ops-row { flex-wrap: wrap; }
.impact-row strong { font-size: 14px; }
.impact-row select { width: auto; min-width: min(222px,100%); max-width: 100%; padding: 9px 13px; font-weight: 600; font-size: 15px; border-radius: 8px; border-color: #cad9d0; background-color: #fff; color: #344c3e; }
.occurrence-modal .occurrence-tabs { gap: 22px; margin: 0; border-bottom-color: var(--ops-line); }
.occurrence-modal .occurrence-tabs button { border: 0; background: transparent; border-bottom: 3px solid transparent; border-radius: 0; padding: 10px 5px; color: #65766c; font: inherit; }
.occurrence-modal .occurrence-tabs button[aria-selected='true'] { color: var(--ops-green); border-bottom-color: var(--ops-green); }
.occurrence-modal .occurrence-section { margin: 0; display: grid; gap: 17px; border: 0; border-radius: 0; padding: 0; }
.diagnosis-copy { display: flex; align-items: start; gap: 12px; }
.diagnosis-copy > span { color: var(--ops-green); font-size: 21px; line-height: 1; }
.diagnosis-copy small { font-weight: 700; color: var(--ops-green); }
.diagnosis-copy p { font-size: 15px; }
.diagnosis-main { display: grid; gap: 17px; }
.ops-divider { width: 100%; margin: 0; border: 0; border-top: 1px solid var(--ops-line); }
.case-subjects { display: grid; gap: 8px; }
.case-subjects ul { display: grid; gap: 5px; margin: 0; padding: 0; list-style: none; }
.case-subjects li { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; font-size: 14px; }
.case-subjects li strong { font-weight: 650; }
.case-subjects li span { color: #476456; }
.modal-content .investigation-actions { margin: 0; }
.modal-content .investigation-actions button { width: 100%; }
.modal-content .correction-note { padding: 16px; background: var(--ops-soft); border-radius: 12px; }
.modal-content .occurrence-facts { margin: 0; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.modal-content .occurrence-facts div { padding: 12px 14px; border: 0; border-radius: 8px; background: var(--ops-soft); }
.modal-content .occurrence-facts dd { overflow-wrap: anywhere; }
.modal-content .timeline { border-left: 2px solid #c9dfd0; padding: 0 0 0 17px; margin: 0 0 0 8px; }
.modal-content .attendance-error { margin: 0; }
#settings .ops-confirm { margin-top: 10px; }
.event-directory { display: contents; }
#events .filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(132px, 100%), 1fr)); align-items: end; }
#events .filters label:first-child { grid-column: span 2; }
.event-candidates { padding: 13px 18px; color: var(--subtle); background: #f5f7f6; border-top: 1px solid var(--line); font-size: 14px; }
.event-candidates ul { margin: 6px 0 0; padding-left: 20px; }
.event-subjects { color: #2b674f; overflow-wrap: anywhere; }

.in-noc { display: block; min-height: 100dvh; background: #eff4f0; }
.in-noc .content { max-width: none; padding: 0; }
.in-noc .content > :is(.critical-alert,.connection-error) { margin: 14px clamp(16px, 2.2vw, 36px) 0; }
.noc-topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; background: #173c31; padding: 15px 26px; }
.noc-topbar .secondary { color: #fff; background: #244f40; border-color: #537565; }
.noc-brand { display: flex; align-items: center; gap: 10px; color: #fff; }
.noc-brand strong { font-size: 23px; letter-spacing: 1px; }
.noc-brand small { display: block; color: #b6d1c0; font-size: 13px; }
.noc-brand .ops-mark { background: #285343; color: #a5e7bf; }
#noc { width: 100%; padding: clamp(16px, 2.2vw, 36px); display: grid; align-content: start; gap: clamp(16px, 1.8vw, 28px); }
#noc h1 { font-size: clamp(25px, 2.4vw, 38px); letter-spacing: -.035em; }
#noc .noc-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin: 0; }
#noc .noc-controls { display: flex; align-items: center; gap: 12px; }
.noc-live { display: flex; align-items: center; gap: 8px; color: var(--ops-green); font-size: 14px; font-weight: 650; }
.noc-live::before { content: ''; width: 9px; height: 9px; background: currentColor; border-radius: 50%; }
.noc-live.unknown { color: #87670e; }
.noc-live.unknown::before { border: 1px solid currentColor; background: transparent; }
.noc-environment { background: #edf5ef; border: 1px solid #d6e5d9; border-radius: 15px; padding: clamp(18px, 2vw, 30px); display: grid; gap: 20px; }
.noc-environment h2 { font-size: clamp(22px, 2.3vw, 36px); letter-spacing: -.025em; }
.noc-environment .ops-mark { width: 48px; height: 48px; }
.noc-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(14px, 3vw, 52px); }
.noc-metric { display: grid; gap: 7px; }
.noc-metric span { font-size: clamp(13px, 1.2vw, 18px); color: #5d7566; }
.noc-metric strong { font-size: clamp(32px, 3.9vw, 68px); line-height: 1.08; color: var(--ops-green); letter-spacing: -.045em; font-variant-numeric: tabular-nums; }
.noc-metric progress { appearance: none; width: 100%; height: 8px; border: 0; border-radius: 20px; overflow: hidden; background: #d5e3d9; }
.noc-metric progress::-webkit-progress-bar { background: #d5e3d9; }
.noc-metric progress::-webkit-progress-value { background: #579878; border-radius: 20px; }
.noc-metric progress::-moz-progress-bar { background: #579878; border-radius: 20px; }
.noc-metric progress.unknown { opacity: .55; }
#noc .noc-counts { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 12px; margin: 0; }
.noc-attendance { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
#noc .priority-critical, .occurrence-heading .priority-critical { --noc-bg: #fbe9e9; --noc-ink: #b12630; --noc-border: #eccdcd; }
#noc .priority-high, .occurrence-heading .priority-high { --noc-bg: #fff0df; --noc-ink: #ae5c16; --noc-border: #eed8bf; }
#noc .priority-warning, .occurrence-heading .priority-warning { --noc-bg: #faf5e0; --noc-ink: #87670e; --noc-border: #e8dfbd; }
#noc .priority-low, .occurrence-heading .priority-low { --noc-bg: #eaf1f7; --noc-ink: #466a8c; --noc-border: #d7e2ed; }
#noc .priority-info, .occurrence-heading .priority-info { --noc-bg: #edf2ee; --noc-ink: #4c6d59; --noc-border: #d7e2da; }
.occurrence-heading .ops-chip { background: var(--noc-bg); color: var(--noc-ink); }
#noc .noc-counter { min-width: 0; padding: clamp(13px, 1.5vw, 24px); border-radius: 8px; gap: 8px; background: var(--noc-bg, #fff); color: var(--noc-ink, var(--ops-ink)); border-color: var(--noc-border, #cad9d0); }
#noc .noc-counter span { font-size: clamp(12px, 1.15vw, 18px); }
#noc .noc-counter strong { font-size: clamp(30px, 3.7vw, 64px); letter-spacing: -.05em; line-height: 1; font-variant-numeric: tabular-nums; }
#noc .noc-counter[aria-pressed='true'] { outline: 2px solid #397a57; outline-offset: 2px; }
#noc .noc-counter:hover, #noc .noc-row:hover { filter: brightness(.98); }
#noc .noc-attendance .noc-counter { padding: 16px 22px; gap: 4px; }
#noc .noc-attendance .noc-counter strong { font-size: clamp(27px, 2.5vw, 44px); }
#noc .noc-queue-head { margin-bottom: 14px; }
.noc-queue-head h2 { font-size: 21px; letter-spacing: -.025em; }
#noc .noc-queue { display: grid; gap: 10px; overflow: visible; }
#noc .noc-row { width: 100%; border: 1px solid var(--noc-border); border-radius: 11px; display: grid; grid-template-columns: minmax(0,1fr) minmax(150px,.4fr) minmax(110px,.28fr) auto; gap: 16px; align-items: center; padding: 18px 22px; text-align: left; background: var(--noc-bg); color: #26392e; }
#noc .noc-row h3 { font-size: clamp(17px, 1.55vw, 25px); margin-bottom: 5px; }
#noc .noc-row small { margin: 0; font-size: clamp(12px, 1.05vw, 16px); }
#noc .noc-row .level { color: var(--noc-ink); font-weight: 650; }
/* The simulation's footer becomes expandable live service details. */
.noc-services-detail { border-top: 1px solid var(--ops-line); padding-top: 12px; color: var(--ops-muted); }
.noc-services-detail summary { width: fit-content; cursor: pointer; }
.noc-services-detail .noc-services { margin-top: 12px; }
#noc .noc-queue .placeholder { border: 1px solid var(--ops-line); border-radius: 12px; background: #fff; text-align: center; padding: 22px; }
.noc-focus .noc-topbar, .noc-focus .noc-services-detail { display: none; }
.noc-focus #noc { min-height: 100dvh; }
.noc-focus .noc-environment { padding: clamp(22px, 2.7vw, 48px); }
.noc-focus #noc .noc-row { min-height: 92px; }

@media (max-width: 800px) {
  #noc .noc-counts { grid-template-columns: repeat(3,minmax(0,1fr)); }
  #noc .noc-row { grid-template-columns: minmax(0,1fr) auto; gap: 9px; padding: 14px; }
  #noc .noc-row > div { grid-column: 1; }
  #noc .noc-row .noc-time { grid-column: 2; grid-row: 2; }
  #noc .noc-row .noc-chevron { display: none; }
  .noc-metrics { gap: 15px; }
}
@media (max-width: 600px) {
  .occurrence-modal { width: calc(100% - 12px); max-height: calc(100dvh - 12px); }
  .modal-head, .modal-foot { padding: 12px 15px; }
  .modal-content { padding: 16px; gap: 15px; }
  .occurrence-modal .occurrence-tabs { gap: 15px; }
  .modal-content .occurrence-facts { grid-template-columns: 1fr; }
  .modal-foot > span { max-width: 65%; }
  #events .filters label:first-child { grid-column: 1 / -1; }
}
@media (max-width: 440px) {
  #noc { padding: 13px; }
  .noc-topbar { padding: 12px 15px; }
  .noc-environment { padding: 15px; }
  #noc .noc-counts { grid-template-columns: repeat(2,minmax(0,1fr)); }
  #noc .noc-attendance .noc-counter { padding: 12px; }
  #noc .noc-row h3 { font-size: 16px; }
  .noc-metric strong { font-size: 28px; }
}
@media (min-width: 801px) and (max-height: 900px) {
  .noc-focus #noc { gap: 15px; padding: 18px 26px; }
  .noc-focus .noc-environment { padding: 20px 24px; gap: 12px; }
  .noc-focus .noc-environment h2 { font-size: 28px; }
  .noc-focus .noc-metric strong { font-size: clamp(35px,3.5vw,54px); }
  .noc-focus #noc .noc-counter { padding: 13px 20px; gap: 5px; }
  .noc-focus #noc .noc-counter strong { font-size: 46px; }
  .noc-focus #noc .noc-attendance .noc-counter { padding: 11px 20px; }
  .noc-focus #noc .noc-attendance .noc-counter strong { font-size: 32px; }
  .noc-focus #noc .noc-row { min-height: 65px; padding: 12px 20px; }
  .noc-focus #noc .noc-row h3 { font-size: 20px; }
  .noc-focus #noc h1 { font-size: 30px; }
}
@media (min-width: 801px) and (max-height: 740px) {
  .noc-focus #noc { gap: 10px; padding: 12px 22px; }
  .noc-focus .noc-environment { padding: 15px 20px; gap: 8px; }
  .noc-focus .noc-metric strong { font-size: 39px; }
  .noc-focus #noc .noc-counter { padding: 10px 16px; }
  .noc-focus #noc .noc-counter strong { font-size: 36px; }
  .noc-focus #noc .noc-attendance .noc-counter { padding: 8px 16px; }
  .noc-focus #noc .noc-row { min-height: 58px; padding: 9px 16px; }
  .noc-focus #noc .noc-row h3 { font-size: 18px; }
  .noc-focus #noc h1 { font-size: 25px; }
}
