/* Automation page: the day/night operations console and its spotlight scenes. */
.ops {
  --night: 0; grid-area: mvp; position: relative; overflow: hidden;
  background: color-mix(in srgb, #fff calc((1 - var(--night)) * 100%), var(--ink));
  color: color-mix(in srgb, var(--ink) calc((1 - var(--night)) * 100%), var(--paper));
  border: var(--line); border-radius: 22px; box-shadow: 10px 10px 0 color-mix(in srgb, var(--ink) calc((1 - var(--night)) * 100%), var(--yellow));
}
.ops-top { position: relative; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .8rem 1.1rem; background: var(--ink); color: var(--paper); border-bottom: var(--line); }
.ops-t { font-weight: 800; letter-spacing: -.02em; }
.ops-t b { color: var(--mint); font-weight: 700; }
.ops-clock { display: inline-flex; align-items: center; gap: .55rem; font-family: var(--f-mono); font-size: .72rem; }
.ops-clock b { font-size: .9rem; color: var(--yellow); font-variant-numeric: tabular-nums; }
.ops-who { color: rgba(255, 253, 247, .6); text-transform: uppercase; letter-spacing: .08em; font-size: .6rem; }
.ops-sun { width: 14px; height: 14px; border-radius: 50%; background: var(--yellow); box-shadow: 0 0 0 2px var(--ink), 0 0 0 3.5px var(--yellow); transition: background-color .4s, box-shadow .4s; }
.ops.is-night .ops-sun { background: transparent; box-shadow: inset -4px -2px 0 0 var(--paper); }
.ops-sky { position: absolute; inset: 44px 0 0; pointer-events: none; opacity: var(--night); }
.ops-sky i { position: absolute; left: var(--x); top: var(--y); width: 3px; height: 3px; border-radius: 50%; background: var(--paper); animation: tw 2.4s ease-in-out infinite alternate; }
.ops-sky i:nth-child(2n) { animation-delay: -1.2s; }
@keyframes tw { from { opacity: .2; } to { opacity: 1; } }
.ops-grid { position: relative; display: grid; grid-template-columns: 1fr 1fr; grid-template-areas: "k k" "a f"; gap: .9rem; padding: 1rem 1.1rem 1.1rem; }
.ops-kpis { grid-area: k; display: grid; grid-template-columns: repeat(4, 1fr); gap: .55rem; }
.ok { border: var(--line); border-color: currentColor; border-radius: 12px; padding: .6rem .7rem; background: color-mix(in srgb, #fff calc((1 - var(--night)) * 100%), #1b2433); }
.ok span { display: block; font-size: .66rem; font-family: var(--f-mono); text-transform: uppercase; letter-spacing: .06em; opacity: .7; }
.ok b { display: block; margin-top: .2rem; font-size: clamp(1.15rem, .9rem + .9vw, 1.6rem); letter-spacing: -.04em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.ok b em { font-style: normal; }
.ok-y { background: color-mix(in srgb, #fff7d6 calc((1 - var(--night)) * 100%), #3a3316); }
.ok-m b { color: var(--mint-d); }
.ops.is-night .ok-m b { color: var(--mint); }
.ok-n b { color: var(--purple); }
.ops.is-night .ok-n { box-shadow: 0 0 0 3px var(--purple); }
.ops.is-night .ok-n b { color: #b8afff; }
.ops-l { font-family: var(--f-mono); font-size: .62rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; opacity: .65; margin-bottom: .5rem; }
.ops-agents { grid-area: a; }
.ops-ag { display: grid; gap: .35rem; }
.ops-ag li { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: .6rem; padding: .45rem .6rem; border: 1.5px solid currentColor; border-radius: 10px; font-size: .82rem; font-weight: 700; }
.ops-ag li em { font-style: normal; font-family: var(--f-mono); font-size: .66rem; padding: .12rem .45rem; border-radius: 6px; background: rgba(13, 20, 33, .08); }
.ops.is-night .ops-ag li em { background: rgba(255, 253, 247, .1); }
.ops-ag li.run em { background: var(--yellow); color: var(--ink); animation: blink 1s steps(2, jump-none) infinite; }
.ops-ag li.idle { opacity: .55; }
.ops-feed { grid-area: f; overflow: hidden; }
.ops-act { display: grid; gap: .35rem; height: 196px; overflow: hidden; }
.ops-act li { display: flex; justify-content: space-between; gap: .6rem; padding: .45rem .6rem; border-radius: 10px; background: rgba(13, 20, 33, .05); font-size: .8rem; animation: feedIn 520ms var(--spring) both; }
.ops.is-night .ops-act li { background: rgba(255, 253, 247, .07); }
.ops-act li span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ops-act li time { flex: none; font-family: var(--f-mono); font-size: .68rem; opacity: .6; }
.ops-act li.ov time { color: var(--purple); opacity: 1; }
@keyframes feedIn { from { transform: translateY(-110%) scale(.96); opacity: 0; } }
.ops-daybar { position: relative; display: flex; justify-content: space-between; padding: .55rem 1.1rem .65rem; border-top: var(--line); border-color: currentColor; font-family: var(--f-mono); font-size: .6rem; opacity: .9; background: linear-gradient(90deg, rgba(108, 92, 231, .22) 0 25%, rgba(255, 217, 61, .3) 25% 83%, rgba(108, 92, 231, .22) 83%); }
.ops-dayk { position: absolute; top: 3px; bottom: 3px; left: calc(1.1rem + var(--day, .4) * (100% - 2.2rem)); width: 3px; margin-left: -1.5px; background: currentColor; border-radius: 2px; }

/* spotlight scenes */
.kb { display: grid; grid-template-columns: repeat(4, 1fr); gap: .6rem; align-content: start; position: relative; }
.kb-col { display: grid; gap: .45rem; align-content: start; padding: .55rem; border: 1.5px dashed rgba(13, 20, 33, .25); border-radius: 12px; min-height: 230px; background: rgba(255, 255, 255, .6); }
.kb-col p { font-family: var(--f-mono); font-size: .62rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.kc { display: block; padding: .5rem .55rem; border: var(--line); border-radius: 9px; background: #fff; font-weight: 700; font-size: .82rem; box-shadow: 2px 2px 0 var(--ink); }
.kc small { display: block; font-family: var(--f-mono); font-size: .58rem; font-weight: 700; color: var(--ink-2); }
.kc-y { background: var(--yellow); } .kc-m { background: var(--mint); }
.kc-move { animation: kcMove 4.5s var(--ease-out) infinite; }
@keyframes kcMove { 0%, 20% { transform: none; } 45%, 70% { transform: translate(calc(100% + 1.7rem), 3.4rem) rotate(3deg); } 90%, 100% { transform: none; opacity: 1; } }
.kb-agent { grid-column: 1 / -1; display: flex; align-items: center; gap: .6rem; margin-top: .4rem; padding: .7rem .9rem; border: var(--line); border-radius: 14px; background: var(--ink); color: var(--paper); font-size: .86rem; }
.kb-agent img { width: 22px; height: 22px; border-radius: 50%; }
.kb-agent span { font-family: var(--f-mono); font-size: .62rem; padding: .15rem .45rem; border-radius: 6px; background: var(--yellow); color: var(--ink); font-weight: 700; }
.dots { display: inline-flex; gap: 3px; margin-left: auto; }
.dots em { width: 6px; height: 6px; border-radius: 50%; background: var(--paper); animation: dot 1.1s ease-in-out infinite; }
.dots em:nth-child(2) { animation-delay: .15s; } .dots em:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 0%, 100% { transform: translateY(0); opacity: .4; } 40% { transform: translateY(-4px); opacity: 1; } }
.chain { position: relative; }
.ch-line { position: absolute; inset: 1.1rem; width: calc(100% - 2.2rem); height: calc(100% - 2.2rem); }
.ch-line path { fill: none; stroke: var(--ink); stroke-width: 3; stroke-dasharray: 8 7; vector-effect: non-scaling-stroke; animation: dash 1.4s linear infinite; }
@keyframes dash { to { stroke-dashoffset: -30; } }
.ch-n { position: absolute; left: calc(1.1rem + (100% - 2.2rem) * var(--x) / 100); top: calc(1.1rem + (100% - 2.2rem) * var(--y) / 100); transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: .3rem; font-size: .72rem; font-weight: 700; }
.ch-n img { width: 54px; height: 54px; padding: 8px; border: var(--line); border-radius: 14px; background: #fff; box-shadow: 3px 3px 0 var(--ink); object-fit: contain; }
.ch-pk { position: absolute; width: 16px; height: 16px; margin: -8px 0 0 -8px; border: var(--line); border-radius: 50%; background: var(--yellow); animation: pk 5s linear infinite; }
.ch-pk2 { background: var(--mint); animation-delay: -2.5s; }
@keyframes pk {
  0% { left: calc(1.1rem + (100% - 2.2rem) * .1); top: calc(1.1rem + (100% - 2.2rem) * .23); } 20% { left: calc(1.1rem + (100% - 2.2rem) * .5); top: calc(1.1rem + (100% - 2.2rem) * .23); } 40% { left: calc(1.1rem + (100% - 2.2rem) * .9); top: calc(1.1rem + (100% - 2.2rem) * .23); }
  50% { left: calc(1.1rem + (100% - 2.2rem) * .9); top: calc(1.1rem + (100% - 2.2rem) * .77); } 70% { left: calc(1.1rem + (100% - 2.2rem) * .5); top: calc(1.1rem + (100% - 2.2rem) * .77); } 90%, 100% { left: calc(1.1rem + (100% - 2.2rem) * .1); top: calc(1.1rem + (100% - 2.2rem) * .77); }
}
}
.cw-tabs { display: flex; gap: .3rem; }
.cw-tabs span { font-size: .75rem; font-weight: 700; padding: .3rem .7rem; border: 1.5px solid var(--ink); border-radius: 8px; background: #fff; }
.cw-tabs .on { background: var(--ink); color: var(--paper); }
.cw-t { margin-top: 1rem; font-weight: 800; font-size: 1.05rem; letter-spacing: -.02em; }
.cw-list { margin-top: .8rem; display: grid; gap: .45rem; counter-reset: cw; }
.cw-list li { display: flex; align-items: center; gap: .6rem; padding: .55rem .7rem; border: 1.5px solid var(--ink); border-radius: 10px; background: #fff; font-size: .86rem; font-weight: 600; }
.cw-list li::before { content: ""; flex: none; width: 18px; height: 18px; border: 2px solid var(--ink); border-radius: 50%; animation: cwTick 7s steps(1) infinite; }
.cw-list li:nth-child(1)::before { animation-delay: 0s; } .cw-list li:nth-child(2)::before { animation-delay: .9s; } .cw-list li:nth-child(3)::before { animation-delay: 1.8s; } .cw-list li:nth-child(4)::before { animation-delay: 2.7s; } .cw-list li:nth-child(5)::before { animation-delay: 3.6s; }
@keyframes cwTick { 0% { background: #fff; } 1% { background: var(--mint); box-shadow: inset 0 0 0 3px #fff; } 85% { background: var(--mint); } 86%, 100% { background: #fff; box-shadow: none; } }
.cw-by { display: flex; align-items: center; gap: .5rem; margin-top: 1rem; font-family: var(--f-mono); font-size: .66rem; color: var(--muted); }
.cw-by img { width: 18px; height: 18px; border-radius: 50%; }
.sop h4 { font-size: 1.3rem; font-weight: 800; letter-spacing: -.03em; }
.sop > p:not(.sop-flow) { margin-top: .5rem; font-size: .9rem; color: var(--ink-2); }
.sop ol { margin-top: .9rem; display: grid; gap: .45rem; }
.sop ol li { display: flex; gap: .6rem; align-items: center; padding: .5rem .6rem; background: #fff; border: 1.5px solid var(--ink); border-radius: 10px; font-size: .88rem; font-weight: 600; }
.sop ol b { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; background: var(--yellow); font-family: var(--f-mono); font-size: .7rem; }
.sop-flow { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: 1rem; }
.sop-flow span { position: relative; font-family: var(--f-mono); font-size: .66rem; font-weight: 700; padding: .35rem .6rem; border: 1.5px solid var(--ink); border-radius: 999px; background: #fff; animation: flowOn 5s steps(1) infinite; }
.sop-flow span:nth-child(2) { animation-delay: 1s; } .sop-flow span:nth-child(3) { animation-delay: 2s; } .sop-flow span:nth-child(4) { animation-delay: 3s; } .sop-flow span:nth-child(5) { animation-delay: 4s; }
@keyframes flowOn { 0% { background: var(--yellow); } 20%, 100% { background: #fff; } }

@media (max-width: 600px) {
  .ops-grid { grid-template-columns: 1fr; grid-template-areas: "k" "a" "f"; }
  .ops-kpis { grid-template-columns: 1fr 1fr; }
  .ops-act { height: 160px; }
  .ops-who { display: none; }
  .kb { grid-template-columns: 1fr 1fr; }
  .kb-col { min-height: 0; }
  .kb-col:nth-child(n+3) { display: none; }
  @keyframes kcMove { 0%, 100% { transform: none; } }
  .ch-n img { width: 40px; height: 40px; }
}
