/* Karen's office on My day (office.js, office-plan.js): the flat floor plan on the left, the feed of what Karen did today
   on the right. Same card look as the rest of the page. */
/* The feed sits beside the scene at the scene's height, however long the day gets (it scrolls) */
.office { --offeed-w: clamp(300px, 24%, 400px); position: relative; padding-right: var(--offeed-w); margin: 0 0 20px; overflow: hidden; }
.ofpic { position: relative; background: #eef2ef; }
.ofscene { display: block; }

/* The picture (office-plan.js): the rendered office with live status placed on each robot. A phone gets the flat plan below instead. */
.ofx { position: relative; }
.opp { position: relative; container-type: inline-size; background: #f3efe8; }
.opp-img { display: block; width: 100%; height: auto; }
.opp > :not(.opp-img) { position: absolute; }
.opp-night { inset: 0; background: rgba(12, 26, 66, 0.5); mix-blend-mode: multiply; opacity: 0; transition: opacity 0.6s; pointer-events: none; }
.opp-dim { background: rgba(30, 40, 38, 0.28); -webkit-backdrop-filter: grayscale(1) brightness(0.85); backdrop-filter: grayscale(1) brightness(0.85); opacity: 0; transition: opacity 0.3s; pointer-events: none; }
.opp-glow { width: 15%; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%; background: radial-gradient(circle, rgba(220, 40, 30, 0.5), rgba(220, 40, 30, 0) 68%); opacity: 0; pointer-events: none; animation: opp-pulse 1.6s ease-in-out infinite; }
@keyframes opp-pulse { 50% { transform: translate(-50%, -50%) scale(1.15); } }
.opp-ring { width: 7%; height: 2.8%; transform: translate(-50%, -50%); border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.95); box-shadow: 0 0 10px rgba(47, 107, 85, 0.8); opacity: 0; pointer-events: none; animation: opp-ring 1.8s ease-out infinite; }
@keyframes opp-ring { 0% { transform: translate(-50%, -50%) scale(0.7); } 100% { transform: translate(-50%, -50%) scale(1.3); } }
.opp-hot { width: 7%; height: 14%; transform: translate(-50%, -50%); background: transparent; border: 0; border-radius: 14px; padding: 0; cursor: pointer; }
.opp-hot:hover, .opp-hot.lit { box-shadow: 0 0 0 3px rgba(47, 107, 85, 0.8), 0 0 18px rgba(255, 255, 255, 0.8); }
.opp-hot:focus-visible { outline: 3px solid var(--green-900); outline-offset: 2px; }
.opp-tag { z-index: 4; transform: translate(-50%, 0); display: inline-flex; align-items: center; gap: 0.45em; padding: 0.28em 0.75em; border-radius: 999px; background: #fff; color: var(--ink); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25); font-size: clamp(10px, 1.05cqw, 13px); font-weight: 700; line-height: 1.2; white-space: nowrap; pointer-events: none; transition: transform 0.2s; }
.opp-tag.lit { transform: translate(-50%, 0) scale(1.08); }
.opp-dot { width: 0.7em; height: 0.7em; border-radius: 50%; background: #9aa8a0; flex: none; }
.opp-tag.is-running .opp-dot { background: var(--green-700); }
.opp-tag.is-stuck { background: var(--red); color: #fff; }
.opp-tag.is-stuck .opp-dot { background: #fff; }
.opp-tag.is-off { opacity: 0.8; color: var(--muted); }
.opp-tag.is-off .opp-dot { background: #c9d3cc; }
.opp-flag { z-index: 2; display: none; width: clamp(16px, 1.7cqw, 22px); height: clamp(16px, 1.7cqw, 22px); transform: translate(-50%, -50%); border-radius: 50%; background: var(--red); color: #fff; font-size: clamp(10px, 1.1cqw, 14px); font-weight: 800; line-height: 1; place-items: center; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3); pointer-events: none; }
.opp-say { z-index: 3; transform: translate(-50%, -100%); width: max-content; max-width: 22cqw; padding: 0.45em 0.7em; border-radius: 0.8em; background: #fff; color: var(--ink); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25); font-size: clamp(10.5px, 1.1cqw, 13.5px); font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; pointer-events: none; }
.opp-say[hidden] { display: none; }
.opp-say::after { content: ""; position: absolute; left: 50%; bottom: -5px; width: 10px; height: 10px; background: inherit; transform: translateX(-50%) rotate(45deg); }
.opp-say.asked { background: var(--amber-bg); }
.opp-say.stuck { background: var(--red-bg); color: var(--red); }
.opp-say.now { box-shadow: 0 0 0 2px var(--green-700), 0 2px 6px rgba(0, 0, 0, 0.25); }
.opp-travel { z-index: 4; width: clamp(9px, 1cqw, 14px); aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%; background: var(--green-700); border: 2px solid #fff; box-shadow: 0 1px 5px rgba(0, 0, 0, 0.4); pointer-events: none; }
.opp-travel[hidden] { display: none; }
.opp-runners { inset: 0; pointer-events: none; }
.opp-runner { position: absolute; display: block; z-index: 2; width: 5.6%; transform: translate(-50%, -92%); opacity: 0; transition: opacity 0.25s; pointer-events: none; }
.opp-runner.on { opacity: 1; }
.opp-runner::after { content: ""; position: absolute; left: 14%; right: 14%; bottom: -3%; height: 9%; border-radius: 50%; background: rgba(0, 0, 0, 0.28); filter: blur(2px); z-index: -1; }
.opp-run-flip { display: block; }
.opp-runner img { display: block; width: 100%; height: auto; animation: opp-step 0.38s ease-in-out infinite; transform-origin: 50% 100%; }
@keyframes opp-step { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-5%) rotate(2deg); } }
@media (prefers-reduced-motion: reduce) { .opp-runner img { animation: none !important; } }
.opl { display: none; }
/* Too narrow for the picture's tags to sit clear of each other: the flat plan takes over */
@media (max-width: 899px) { .opp { display: none; } .opl { display: block; } }
@media (prefers-reduced-motion: reduce) { .opp-glow, .opp-ring { animation: none !important; } .opp-travel { transition: none !important; } }

/* The floor plan (office-plan.js): a tinted room per part of the business, one robot per station */
.opl { position: relative; padding: 14px 16px; }
.opl-defs { position: absolute; }
.opl-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 10px; }
.opl-sec { grid-column: 1 / -1; font-size: 12.5px; font-weight: 700; text-transform: none; color: var(--muted); margin-top: 4px; }
.opl-sec:first-child { margin-top: 0; }
.opl-room { grid-column: span 3; position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; min-height: 128px; padding: 10px 10px 10px; border-radius: 16px; background: color-mix(in srgb, var(--c) 16%, #fff); border: 2px solid color-mix(in srgb, var(--c) 55%, #fff); cursor: pointer; transition: box-shadow 0.2s, transform 0.2s; }
.opl-room[data-span="2"] { grid-column: span 2; }
.opl-room[data-span="4"] { grid-column: span 4; }
.opl-room:hover, .opl-room.lit { box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 45%, #fff); }
.opl-room:focus-visible { outline: 3px solid var(--green-900); outline-offset: 2px; }
.opl-room.hop { animation: opl-hop 0.5s ease-out; }
@keyframes opl-hop { 40% { transform: translateY(-4px); } }
.opl-bots { display: flex; gap: 14px; justify-content: center; }
.opl-bot { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; --c: #6b7280; }
.opl-botsvg { width: 50px; height: 56px; overflow: visible; }
.opl-bot::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 56px; margin: auto; width: 56px; border-radius: 50%; border: 2px solid var(--c); opacity: 0; pointer-events: none; }
.opl-bot.is-running::after { animation: opl-ring 1.8s ease-out infinite; }
.opl-bot.is-running .opl-botsvg { animation: opl-bob 1.4s ease-in-out infinite; }
@keyframes opl-bob { 50% { transform: translateY(-2px); } }
@keyframes opl-ring { 0% { opacity: 0.5; transform: scale(0.85); } 100% { opacity: 0; transform: scale(1.25); } }
.opl-shell { fill: var(--c); }
.opl-shade { fill: rgba(0, 0, 0, 0.14); }
.opl-visor { fill: #17202b; }
.opl-ball { fill: var(--c); }
.opl-eye { fill: var(--eye, #8ff6ff); transform-box: fill-box; transform-origin: center; animation: opl-blink 5s infinite; }
.opl-bot.is-off { --eye: #6b7580; }
.opl-bot.is-off .opl-botsvg { filter: grayscale(1); opacity: 0.45; }
.opl-bot.is-stuck { --eye: #ff9a8a; }
.opl-bot.is-asleep .opl-eye { animation: none; transform: scaleY(0.12); }
@keyframes opl-blink { 0%, 94%, 100% { transform: scaleY(1); } 97% { transform: scaleY(0.1); } }
.opl-flag { display: none; position: absolute; right: -10px; top: -8px; width: 20px; height: 20px; border-radius: 50%; background: var(--red); color: #fff; font-size: 12px; font-weight: 800; place-items: center; }
.opl-bot.is-stuck .opl-flag { display: grid; }
.opl-sub { font-size: 12px; font-weight: 600; color: var(--muted); }
.opl-name { font-size: 14px; font-weight: 800; }
.opl-say { position: relative; max-width: 100%; padding: 6px 9px; border-radius: 10px; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.14); font-size: 12.5px; line-height: 1.35; overflow-wrap: anywhere; }
.opl-say::before { content: ""; position: absolute; left: 50%; top: -5px; width: 10px; height: 10px; background: #fff; transform: translateX(-50%) rotate(45deg); }
.opl-say[hidden], .opl-state[hidden] { display: none; }
.opl-say.asked { background: var(--amber-bg); } .opl-say.asked::before { background: var(--amber-bg); }
.opl-say.stuck { background: var(--red-bg); color: var(--red); font-weight: 600; } .opl-say.stuck::before { background: var(--red-bg); }
.opl-say.now { box-shadow: 0 0 0 2px var(--green-700), 0 1px 3px rgba(0, 0, 0, 0.14); }
.opl-state { font-size: 13px; font-weight: 600; color: var(--muted); }
.opl-room.is-stuck { background: var(--red-bg); border: 2px dashed var(--red); }
.opl-room.is-off { background: #f3f5f4; border-color: #d8dfda; }
.opl-room.is-asleep { filter: saturate(0.8) brightness(0.97); }
.opl-cap { position: absolute; left: 18px; bottom: 6px; padding: 4px 12px; border-radius: 999px; background: var(--green-900); color: #fff; font-size: 12.5px; font-weight: 600; }
.opl-cap[hidden] { display: none; }
@media (prefers-reduced-motion: reduce) { .opl-bot::after, .opl-botsvg, .opl-eye, .opl-room.hop { animation: none !important; } }

/* My day: the numbers, what was handed to you, then the office, then the rest */
#v-day .view-in { display: flex; flex-direction: column; gap: 16px; max-width: 1800px; }
#v-day .view-in > * { min-width: 0; }
#v-day .view-in > .db { display: contents; }
#v-day .db-tiles { order: 1; }
#v-day .db-handed { order: 2; }
#v-day .office { order: 3; margin: 0; }
#v-day .db-grid, #v-day .db-wait { order: 4; }
/* On a phone the four numbers sit two by two, so the office is not pushed off the screen */
@media (max-width: 700px) {
  #v-day .db-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  #v-day .db-tiles > :last-child:nth-child(odd) { grid-column: 1 / -1; }
  #v-day .db-tile { padding: 11px 12px; }
  #v-day .db-v { font-size: 24px; }
  #v-day .db-l { font-size: 12px; }
  #v-day .db-s { font-size: 11.5px; }
}

/* The feed */
.offeed { position: absolute; top: 0; right: 0; bottom: 0; width: var(--offeed-w); border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.ofhead { display: flex; align-items: center; gap: 10px; padding: 14px 18px 10px; border-bottom: 1px solid var(--line); }
.ofhead h2 { flex: 1; margin: 0; font-size: 13px; text-transform: none; color: var(--muted); }
.ofplay { font: inherit; font-size: 12.5px; font-weight: 600; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--green-700); cursor: pointer; white-space: nowrap; }
.ofplay:hover, .ofplay:focus-visible { border-color: var(--green-700); outline: none; }
.ofplay.on { background: var(--green-700); border-color: var(--green-700); color: #fff; }
.ofstat { font-size: 13px; font-weight: 600; color: var(--green-700); display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.ofstat .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green-700); }
.ofstat .dot.bad { background: var(--red); }
.oflist { overflow-y: auto; flex: 1; min-height: 0; font-size: 13.5px; }
.ofrow { display: grid; grid-template-columns: 10px 68px minmax(0, 1fr); gap: 10px; align-items: start; padding: 9px 18px; border-bottom: 1px solid var(--divider); }
.ofrow:last-child { border-bottom: 0; }
.ofrow time { color: var(--muted); font-size: 12.5px; white-space: nowrap; padding-top: 1px; }
.ofrow > div { min-width: 0; overflow-wrap: break-word; }
.ofrow a { color: inherit; }
.ofdot { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex: none; }
.ofrow.asked { background: var(--amber-bg); }
.ofrow.warn { background: var(--amber-bg); color: var(--amber); }
.ofrow.warn a { color: var(--amber); font-weight: 600; }
.ofrow.stuck { background: var(--red-bg); color: var(--red); }
.ofrow.flash { background: var(--green-100); transition: background 0.3s; }
.oflist .msg { padding: 14px 18px; }

/* After hours the office dims a little, so an idle station at 9pm doesn't look like a problem */

@media (max-width: 1100px) {
  .office { padding-right: 0; }
  .offeed { position: static; width: auto; border-left: 0; border-top: 1px solid var(--line); }
  .oflist { max-height: 300px; }
}
@media (max-width: 700px) {
  /* On a phone the rooms shrink to a robot and a name, four across: the feed carries the words, only a stopped one speaks */
  .opl { padding: 10px; }
  .opl-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  .opl-room, .opl-room[data-span] { grid-column: auto; min-height: 0; padding: 8px 4px; gap: 2px; border-radius: 12px; }
  .opl-room[data-k="accounts"] { grid-column: span 2; }
  .opl-botsvg { width: 38px; height: 42px; }
  .opl-bot::after { height: 42px; width: 42px; }
  .opl-name { font-size: 12px; line-height: 1.2; }
  .opl-sub, .opl-state { display: none; }
  .opl-say:not(.stuck) { display: none; }
  .opl-say { font-size: 11px; padding: 4px 6px; }
  .opl-cap { position: static; display: inline-block; margin-top: 10px; }
  .ofrow { grid-template-columns: 10px 56px minmax(0, 1fr); padding: 8px 14px; }
}
