/* =====================================================================
   OH! My Bots — PIXEL OFFICE THEME
   Loaded AFTER style.css, so everything here wins.
   One look everywhere: dark office, pixel font for titles + buttons,
   notched "8-bit" borders, chunky buttons that press down.
   ===================================================================== */

/* ---------- fonts (files in public/fonts) ---------- */
@font-face {
  font-family: Pixel;
  font-display: swap;
  src: url(fonts/jersey-10-latin-400-normal.woff2) format("woff2");
} /* titles + buttons */
@font-face {
  font-family: Tiny;
  font-display: swap;
  src: url(fonts/silkscreen-latin-400-normal.woff2) format("woff2");
} /* small labels */
@font-face {
  font-family: Inter;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/inter-latin-400-normal.woff2) format("woff2");
}
@font-face {
  font-family: Inter;
  font-weight: 600;
  font-display: swap;
  src: url(fonts/inter-latin-600-normal.woff2) format("woff2");
}
@font-face {
  font-family: Inter;
  font-weight: 800;
  font-display: swap;
  src: url(fonts/inter-latin-800-normal.woff2) format("woff2");
}

/* ---------- colors + sizes ---------- */
:root {
  --bg: #0b0d14;
  --s1: #121522;
  --s2: #181c2c;
  --s3: #222840;
  --s4: #2c3352;
  --line: #2e3554;
  --ink: #eef1fa;
  --mut: #8e95b0;
  --dim: #5f6684;
  --or: #f5821f;
  --bl: #475ca7;
  --gr: #2fbf71;
  --rd: #e5484d;
  --yl: #ffc94a;
  --ig: #e1306c;
  --fb: #4c8df6;
  --px: 3px; /* size of one "pixel" in borders */
  --pixel: Pixel, Inter, sans-serif;
  --tiny: Tiny, Inter, sans-serif;
  --head: 56px; /* top bar height */
  --dock: 0px; /* bottom bar height (phones only) */
}
body {
  font-variant-ligatures: none;
  font-family:
    Inter,
    -apple-system,
    "Segoe UI",
    sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
::selection {
  background: var(--or);
  color: #fff;
}
* {
  scrollbar-width: thin;
  scrollbar-color: var(--s4) transparent;
}
*::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
*::-webkit-scrollbar-thumb {
  background: var(--s4);
}

/* ---------- the 8-bit border (corners are cut off, like old games) ---------- */
.appr,
.sched,
.job,
.card,
.dlg,
.cant,
.todo,
.selfbox,
.lockbox,
.phone .topic,
.stories .st,
.pick,
.testform select,
.testform textarea,
.abody textarea,
.capbox textarea,
.entry .dot,
.thumbs img,
.apic img,
.apic video,
.noimg,
.now {
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow:
    0 calc(var(--px) * -1) 0 0 var(--c, var(--line)),
    0 var(--px) 0 0 var(--c, var(--line)),
    calc(var(--px) * -1) 0 0 0 var(--c, var(--line)),
    var(--px) 0 0 0 var(--c, var(--line)) !important;
}

/* ---------- buttons: chunky, press down when tapped ---------- */
.acts button,
.btn,
.mini,
.dlg-acts button,
.run,
.ghost,
.tab,
#dock button,
.ptab,
.x,
.sheet-close {
  --c: #000;
  font-family: var(--pixel);
  font-weight: 400;
  font-size: 19px;
  line-height: 1.05;
  letter-spacing: 0.4px;
  border: 0 !important;
  border-radius: 0 !important;
  margin: var(--px);
  background: var(--b, var(--s3));
  color: var(--t, var(--ink));
  box-shadow:
    0 calc(var(--px) * -1) 0 0 var(--c, #000),
    0 var(--px) 0 0 var(--c, #000),
    calc(var(--px) * -1) 0 0 0 var(--c, #000),
    var(--px) 0 0 0 var(--c, #000),
    inset 0 -4px 0 0 rgba(0, 0, 0, 0.32),
    inset 0 3px 0 0 rgba(255, 255, 255, 0.12) !important;
  transition:
    transform 0.06s steps(2),
    filter 0.1s;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.acts button:hover,
.btn:hover,
.mini:hover,
.dlg-acts button:hover,
.run:hover,
.ghost:hover,
.tab:hover,
.ptab:hover {
  filter: brightness(1.15);
}
.acts button:active,
.btn:active,
.mini:active,
.dlg-acts button:active,
.run:active,
.ghost:active,
.tab:active,
#dock button:active,
.ptab:active {
  transform: translateY(2px);
  box-shadow:
    0 calc(var(--px) * -1) 0 0 var(--c, #000),
    0 var(--px) 0 0 var(--c, #000),
    calc(var(--px) * -1) 0 0 0 var(--c, #000),
    var(--px) 0 0 0 var(--c, #000),
    inset 0 -1px 0 0 rgba(0, 0, 0, 0.32) !important;
}
button:disabled,
.acts .post:disabled {
  --b: var(--s3) !important;
  --t: var(--dim) !important;
  cursor: not-allowed;
  filter: none !important;
  transform: none !important;
}
button:focus-visible {
  outline: 2px dashed var(--yl);
  outline-offset: 4px;
}
/* button colors */
.run,
.acts .post,
.dlg-acts .dlg-yes {
  --b: var(--gr);
  --t: #04140b;
}
.btn,
#schedRefresh,
#tpGo,
#pickBtn {
  --b: var(--or);
  --t: #fff;
}
.dlg-acts .dlg-yes.danger {
  --b: var(--rd);
  --t: #fff;
}
.ghost,
.tab {
  --b: var(--s2);
  --t: var(--ink);
  padding: 7px 12px;
  font-size: 19px;
}
.tab.on {
  --b: var(--s4);
  --c: var(--or);
}
#bellBtn.ring {
  --b: var(--or);
  --t: #fff;
  animation: ring 1.2s steps(4) infinite;
}
.mini {
  --b: var(--s3);
  font-size: 16px;
  padding: 6px 10px;
}

/* ---------- top bar ---------- */
header {
  height: var(--head);
  padding: 0 16px;
  background: var(--s1);
  border-bottom: var(--px) solid #000;
  box-shadow: 0 var(--px) 0 0 var(--line);
  position: relative;
  z-index: 25;
}
.brand b {
  font-family: var(--pixel);
  font-weight: 400;
  font-size: 28px;
  letter-spacing: 0.6px;
}
.brand small {
  color: var(--mut);
}
.logo-bot {
  border-radius: 0;
  width: 28px;
  height: 24px;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.3);
}
.logo-bot i {
  border-radius: 0;
  width: 5px;
  height: 8px;
  animation: blink 4s steps(1) infinite;
}
#clock {
  font-family: var(--pixel);
  font-size: 24px;
  color: var(--yl);
  font-weight: 400;
}
#dock {
  display: none;
}

/* ---------- office ---------- */
#office {
  background: radial-gradient(ellipse at 50% 45%, #1a1e30, var(--bg) 72%);
}
#stage {
  scrollbar-width: none;
}
#stage::-webkit-scrollbar {
  display: none;
}
.bubble,
.tag {
  font-family: var(--pixel);
  font-weight: 400;
  border-radius: 0 !important;
  letter-spacing: 0.2px;
}
.bubble {
  --c: #000;
  background: #fff;
  color: #10131f;
  font-size: 17px;
  padding: 4px 9px 5px;
  box-shadow:
    0 -2px 0 0 var(--c),
    0 2px 0 0 var(--c),
    -2px 0 0 0 var(--c),
    2px 0 0 0 var(--c),
    4px 4px 0 0 rgba(0, 0, 0, 0.35);
}
.bubble::after {
  border-width: 6px 6px 0;
  margin-left: -6px;
  bottom: -6px;
}
.bubble.work {
  background: #fff3d6;
}
.bubble.err {
  background: #ffd9db;
}
.tag {
  background: #000;
  color: var(--yl);
  font-size: 16px;
  padding: 3px 8px;
}
.pan-hint {
  display: none;
}

/* ---------- Automations board ---------- */
#flow {
  background-color: var(--bg);
  background-image:
    linear-gradient(var(--s1) 2px, transparent 2px),
    linear-gradient(90deg, var(--s1) 2px, transparent 2px);
  background-size: 24px 24px;
}
.card {
  --c: var(--line);
  background: var(--s2);
}
.card:hover {
  --c: var(--s4);
}
.card.working {
  --c: var(--gr);
}
.card.error {
  --c: var(--rd);
}
.card b {
  font-family: var(--pixel);
  font-size: 24px;
  font-weight: 400;
  letter-spacing: 0.4px;
  line-height: 1;
}
.card .line {
  border-radius: 0;
  background: var(--bg);
  color: #c9cee0;
}
.card .face,
.entry .dot,
.dlg .face,
.panel .ph .face {
  border-radius: 0 !important;
}
.card .face i,
.entry .dot i,
.dlg .face i,
.panel .ph .face i {
  border-radius: 0 !important;
}
.pill {
  font-family: var(--tiny);
  font-weight: 400;
  border-radius: 0;
  padding: 4px 8px;
  font-size: 10px;
  text-transform: uppercase;
}
.pill.working::before,
.panel .pill.working::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  background: currentColor;
  margin-right: 6px;
  vertical-align: 1px;
  animation: blink 1s steps(1) infinite;
}

/* ---------- bot log (right column) ---------- */
#logPanel {
  background: var(--s1);
  border-left: var(--px) solid #000;
}
#logPanel h3 {
  font-family: var(--pixel);
  font-size: 24px;
  font-weight: 400;
  letter-spacing: 0.5px;
}
.entry {
  border-bottom: 2px dotted var(--s3);
}
.entry b {
  font-family: var(--pixel);
  font-weight: 400;
  font-size: 18px;
  letter-spacing: 0.3px;
}
.entry .dot {
  --c: #000;
  margin: 3px;
}

/* ===================================================================
   THE BOT PANEL — a drawer on the right (computer) / a sheet from the
   bottom (phone). Header + tabs stay put, only the middle scrolls.
   =================================================================== */
.panel {
  position: fixed;
  top: var(--head);
  right: 0;
  bottom: 0;
  left: auto;
  width: 440px;
  max-width: 100vw;
  max-height: none;
  background: var(--s1);
  color: var(--ink);
  border-radius: 0;
  padding: 0;
  overflow: hidden;
  z-index: 22;
  display: flex;
  flex-direction: column;
  border-left: var(--px) solid #000;
  box-shadow: -10px 0 0 0 rgba(0, 0, 0, 0.35);
  transform: translateX(0);
  transition: transform 0.18s steps(6);
}
.panel.hidden {
  display: flex;
  transform: translateX(105%);
  pointer-events: none;
}
.sheet-grip {
  display: none;
}
#scrim {
  position: fixed;
  inset: 0;
  z-index: 21;
  background: rgba(5, 6, 12, 0.6);
  display: none;
}

/* header of the panel: the bot's big face, name, status */
.panel .ph {
  gap: 14px;
  padding: 16px 16px 12px;
  background:
    linear-gradient(var(--bc, var(--or)) 0 0) top / 100% 4px no-repeat,
    repeating-linear-gradient(
      90deg,
      transparent 0 6px,
      rgba(255, 255, 255, 0.025) 6px 12px
    ),
    var(--s2);
}
.panel .ph .face {
  width: 58px;
  height: 50px;
  gap: 10px;
  flex: none;
  box-shadow:
    inset 0 -5px 0 rgba(0, 0, 0, 0.3),
    0 0 0 var(--px) #000,
    5px 5px 0 0 rgba(0, 0, 0, 0.4);
}
.panel .ph .face i {
  width: 8px;
  height: 14px;
  animation: blink 5s steps(1) infinite;
}
.panel h2 {
  font-family: var(--pixel);
  font-weight: 400;
  font-size: 34px;
  letter-spacing: 0.6px;
  line-height: 1;
}
.panel .ph small {
  color: var(--mut);
  font-size: 13px;
}
.panel .ph .pill {
  margin-left: auto;
}
.panel .pill.idle,
.panel .pill.locked {
  background: var(--s3);
  color: var(--mut);
}
.panel .x {
  --b: var(--s3);
  margin-left: 6px;
  width: 38px;
  height: 38px;
  padding: 0;
  font-size: 22px;
  line-height: 1;
  color: var(--ink);
  flex: none;
}
.now {
  --c: var(--gr);
  margin: 10px 16px 2px;
  padding: 8px 10px;
  background: #0f2a1c;
  color: #7fe8b2;
  font-size: 13px;
}

/* tabs inside the panel */
.ptabs {
  display: flex;
  gap: 4px;
  padding: 10px 13px 0;
  background: var(--s1);
  border-bottom: var(--px) solid #000;
}
.ptab {
  --b: var(--s2);
  --t: var(--mut);
  flex: 1;
  padding: 8px 6px 7px;
  font-size: 21px;
  margin-bottom: 0;
  box-shadow:
    0 calc(var(--px) * -1) 0 0 #000,
    calc(var(--px) * -1) 0 0 0 #000,
    var(--px) 0 0 0 #000 !important;
}
.ptab.on {
  --b: var(--s3);
  --t: #fff;
  box-shadow:
    0 calc(var(--px) * -1) 0 0 var(--or),
    calc(var(--px) * -1) 0 0 0 var(--or),
    var(--px) 0 0 0 var(--or),
    inset 0 -3px 0 0 var(--or) !important;
}
.ptab:active {
  transform: none;
}
.ptab .n {
  display: inline-block;
  min-width: 20px;
  margin-left: 6px;
  padding: 2px 5px;
  background: var(--or);
  color: #fff;
  font-family: var(--tiny);
  font-size: 11px;
  vertical-align: 2px;
}

/* the part that scrolls */
.pbody {
  flex: 1;
  overflow-y: auto;
  padding: 6px 16px calc(24px + env(safe-area-inset-bottom));
  overscroll-behavior: contain;
}
.panel h4 {
  font-family: var(--tiny);
  font-weight: 400;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--yl);
  margin: 18px 0 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.panel h4::before {
  content: "";
  width: 8px;
  height: 8px;
  background: var(--yl);
  flex: none;
}
.panel h4 small {
  color: var(--mut);
  font-family: Inter, sans-serif;
  font-size: 12px;
  letter-spacing: 0;
}
.panel ul {
  color: #cdd2e4;
}
.duties {
  list-style: none;
  padding: 0 !important;
}
.duties li {
  position: relative;
  padding: 8px 0 8px 22px;
  border-bottom: 2px dotted var(--s3);
}
.duties li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 15px;
  width: 6px;
  height: 6px;
  background: var(--or);
}
.panel .act {
  border-left: var(--px) solid var(--s4);
  color: #c3c8da;
  padding: 6px 30px 6px 10px;
  margin: 6px 0;
  background: var(--s2);
}
.empty {
  color: var(--mut);
  font-size: 13px;
  padding: 14px;
  text-align: center;
  border: 2px dashed var(--s3);
  margin: 6px 0;
}
.panel .lockbox {
  --c: var(--bl);
  background: #18203d;
  color: #cfd8ff;
  margin: 16px 3px;
}
.panel .btn {
  margin-top: 12px;
  padding: 10px 14px;
}

/* ---------- approval cards (dark) ---------- */
.appr {
  --c: var(--line);
  background: var(--s2);
  margin: 3px 3px 14px;
  padding: 12px;
  gap: 12px;
}
.appr.waiting {
  --c: var(--or);
}
.appr.blocked {
  --c: var(--rd);
}
.appr.self {
  --c: var(--bl);
}
.appr.posted {
  opacity: 1;
  --c: #1f4d33;
}
.appr.skipped,
.appr.missed {
  opacity: 0.7;
}
.apic {
  width: 84px;
}
.apic img,
.apic video {
  --c: #000;
}
.noimg {
  background: var(--bg);
  color: var(--mut);
}
.abody {
  font-size: 13px;
  color: #d4d8e8;
}
.where {
  font-family: var(--pixel);
  font-weight: 400;
  font-size: 23px;
  letter-spacing: 0.5px;
  line-height: 1;
  padding-right: 26px;
}
.where span {
  font-family: Inter, sans-serif;
  color: var(--mut);
  font-size: 12px;
  font-weight: 600;
}
.where.instagram {
  color: #ff6fa3;
}
.where.facebook {
  color: #7fb0ff;
}
.where.threads {
  color: #fff;
}
.ast {
  font-family: var(--pixel);
  font-weight: 400;
  font-size: 19px;
  color: var(--yl);
  letter-spacing: 0.3px;
}
.appr.posted .ast {
  color: #7fe8b2;
}
.due {
  color: var(--mut);
}
.due b {
  color: var(--ink);
}
.abody > small {
  color: var(--dim);
  word-break: break-all;
}
.abody ul {
  margin: 8px 0;
}
.abody li {
  font-size: 12px;
  color: #b9bfd4;
}
.abody li.bad,
.abody .bad {
  color: #ff8b93;
}
.abody li.warn {
  color: #ffc46b;
}
.acts {
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.acts button {
  flex: 1 1 0;
  min-width: 0;
  padding: 9px 6px;
  font-size: 19px;
  white-space: normal;
}
.acts .post {
  flex: 1 1 100%;
  font-size: 23px;
  padding: 11px;
} /* the main action gets the whole row */
.abody textarea,
.testform textarea,
.testform select,
.capbox textarea {
  --c: var(--s4);
  background: var(--bg) !important;
  color: var(--ink) !important;
  margin: 6px 3px;
  width: calc(100% - 6px);
  padding: 8px;
}
.cant {
  --c: #5a2328;
  background: #2a1316;
  color: #ffb3b8;
  margin: 10px 3px;
}
.todo {
  --c: #2d3970;
  background: #161d3a;
  color: #c8d3ff;
  margin: 10px 3px;
}
.todo.yourturn {
  --c: var(--or);
  background: #2c1c0a;
  color: #ffd6a8;
}
.todo.alldone {
  --c: #1f4d33;
  background: #0f2a1c;
  color: #9af0c2;
}
.todo label input {
  accent-color: var(--or);
}
.selfbox {
  --c: var(--bl);
  background: #161d3a;
  color: #c8d3ff;
  margin: 10px 3px;
}
.selfbox .saves a.mini {
  color: var(--ink);
}
.del {
  filter: grayscale(1) brightness(1.6);
  opacity: 0.55;
}
.del:hover {
  filter: none;
  opacity: 1;
  background: rgba(229, 72, 77, 0.2);
  border-radius: 0;
}

/* ---------- other panel content (dark) ---------- */
.sched {
  --c: var(--line);
  background: var(--s2);
  margin: 3px 3px 12px;
  padding: 12px;
  color: #d4d8e8;
}
.sched.bad {
  --c: var(--rd);
}
.sched .st b {
  font-family: var(--pixel);
  font-weight: 400;
  font-size: 20px;
  color: var(--yl);
}
.chip {
  border-radius: 0;
  background: var(--s3);
  color: var(--mut);
  font-family: var(--tiny);
  font-size: 10px;
  text-transform: uppercase;
}
.chip.on {
  background: #3a2410;
  color: var(--or);
}
.brief {
  color: #c8d3ff;
}
.thumbs img {
  --c: #000;
}
.job {
  --c: var(--line);
  background: var(--s2);
  margin: 3px;
  color: #d4d8e8;
}
.job .pv {
  border-radius: 0;
}
.badge {
  border-radius: 0;
  font-family: var(--tiny);
  font-weight: 400;
  text-transform: uppercase;
}
.stories .st {
  --c: #000;
  margin: 3px;
  background: var(--s3);
}
.stories span {
  border-radius: 0;
  font-family: var(--tiny);
  font-weight: 400;
  font-size: 9px;
}
.testform label {
  color: var(--mut);
  font-family: var(--tiny);
  font-weight: 400;
  font-size: 11px;
  text-transform: uppercase;
  margin-top: 14px;
}
.testform .btn {
  width: calc(100% - 6px);
}
.pick {
  --c: var(--s4);
  background: var(--s2);
  margin: 3px;
}
.pick.on {
  --c: var(--or);
}
.pick span {
  color: var(--mut);
}
.pick b {
  border-radius: 0;
}
.phone ol {
  color: #cdd2e4;
}
.phone .topic {
  --c: #000;
  background: #000;
  margin: 6px 3px;
}

/* ---------- office pop-ups ---------- */
.dlg {
  --c: #000;
  background: var(--s2);
  color: var(--ink);
  padding: 18px;
  box-shadow:
    0 -3px 0 0 #000,
    0 3px 0 0 #000,
    -3px 0 0 0 #000,
    3px 0 0 0 #000,
    10px 10px 0 0 rgba(0, 0, 0, 0.5) !important;
}
.dlg-back {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  background: rgba(5, 6, 12, 0.7);
}
.dlg-top h3 {
  font-family: var(--pixel);
  font-weight: 400;
  font-size: 28px;
  letter-spacing: 0.5px;
}
.dlg-top small {
  color: var(--mut);
}
.dlg p {
  color: #cdd2e4;
}
.dlg-acts button {
  --b: var(--s3);
  --t: var(--ink);
  padding: 10px;
  font-size: 21px;
}
.dlg-acts .dlg-yes {
  --b: var(--gr);
  --t: #04140b;
}

/* ---------- little animations (in "steps", like old games) ---------- */
@keyframes blink {
  0%,
  92%,
  100% {
    transform: scaleY(1);
  }
  94%,
  98% {
    transform: scaleY(0.15);
  }
}
@keyframes ring {
  0%,
  100% {
    transform: rotate(0);
  }
  25% {
    transform: rotate(-10deg);
  }
  50% {
    transform: rotate(10deg);
  }
  75% {
    transform: rotate(0);
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before {
    animation: none !important;
    transition: none !important;
  }
}

/* =====================================================================
   TABLET + PHONE
   ===================================================================== */
@media (max-width: 1100px) {
  .panel {
    width: 400px;
  }
}

@media (max-width: 820px) {
  :root {
    --head: 52px;
    --dock: calc(64px + env(safe-area-inset-bottom));
  }
  body {
    padding-bottom: var(--dock);
  }

  /* top bar: just the brand, clock and Run */
  header {
    flex-wrap: nowrap;
    height: auto;
    min-height: var(--head);
    padding: 6px 10px;
    padding-top: max(6px, env(safe-area-inset-top));
  }
  header nav,
  #bellBtn,
  #logBtn {
    display: none !important;
  }
  .brand b {
    font-size: 25px;
  }
  .right {
    gap: 4px;
  }
  #clock {
    font-size: 21px;
  }
  .run {
    padding: 7px 10px;
    font-size: 19px;
  }

  /* bottom bar: big thumb-friendly buttons */
  #dock {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 26;
    height: var(--dock);
    padding: 6px 6px env(safe-area-inset-bottom);
    gap: 4px;
    background: var(--s1);
    border-top: var(--px) solid #000;
    box-shadow: 0 calc(var(--px) * -1) 0 0 var(--line);
  }
  #dock button {
    --b: var(--s1);
    --c: var(--s1);
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    font-size: 17px;
    color: var(--mut);
    padding: 4px 0;
    position: relative;
    box-shadow: none !important;
  }
  #dock button .i {
    font-size: 20px;
    line-height: 1;
    filter: grayscale(0.6);
  }
  #dock button.on {
    --b: var(--s3);
    color: #fff;
    box-shadow: inset 0 3px 0 0 var(--or) !important;
  }
  #dock button.on .i {
    filter: none;
  }
  #dock .n {
    position: absolute;
    top: 2px;
    left: 55%;
    min-width: 18px;
    padding: 2px 4px;
    background: var(--or);
    color: #fff;
    font-family: var(--tiny);
    font-size: 10px;
    display: none;
  }
  #dock .n.on {
    display: block;
    animation: ring 1.2s steps(4) infinite;
  }

  /* office: bigger, swipe left/right to look around */
  main {
    flex-direction: column;
  }
  #stage {
    overflow: auto;
    justify-content: flex-start;
    align-items: center;
    -webkit-overflow-scrolling: touch;
  }
  #world {
    width: auto !important;
    height: min(92%, 560px);
    max-width: none;
    margin: auto;
    flex: none;
  }
  .pan-hint {
    display: block;
    position: absolute;
    left: 50%;
    bottom: 14px;
    transform: translateX(-50%);
    z-index: 3;
    pointer-events: none;
    font-family: var(--pixel);
    font-size: 18px;
    background: #000;
    color: var(--yl);
    padding: 6px 12px;
    white-space: nowrap;
    transition: opacity 0.6s;
  }
  .pan-hint.gone {
    opacity: 0;
  }

  /* Automations: a simple list instead of the big wiring board */
  #flow {
    overflow-y: auto;
  }
  #wires {
    display: none;
  }
  #cards {
    width: auto !important;
    height: auto !important;
    padding: 14px 14px 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
  }
  .card {
    position: relative !important;
    left: auto !important;
    top: auto !important;
    width: auto !important;
    margin: 3px;
  }

  /* log: its own full screen, opened from the bottom bar */
  #logPanel {
    position: fixed;
    left: 0;
    right: 0;
    top: var(--head);
    bottom: var(--dock);
    width: auto;
    height: auto;
    z-index: 15;
    border-left: 0;
  }
  body.showlog #logPanel {
    display: flex;
  }

  /* bot panel: a sheet that slides up from the bottom */
  .panel {
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: min(88vh, calc(100vh - 40px));
    height: min(88dvh, calc(100dvh - 40px));
    border-left: 0;
    border-top: var(--px) solid #000;
    box-shadow: 0 -10px 0 0 rgba(0, 0, 0, 0.35);
    z-index: 30;
    transform: translateY(0);
    transition: transform 0.2s steps(6);
  }
  .panel.hidden {
    transform: translateY(105%);
  }
  .panel.dragging {
    transition: none;
  }
  .sheet-grip {
    display: block;
    height: 18px;
    flex: none;
    background: var(--s2);
    position: relative;
    touch-action: none;
  }
  .sheet-grip::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 7px;
    width: 44px;
    height: 5px;
    margin-left: -22px;
    background: var(--s4);
  }
  .panel .ph {
    padding-top: 6px;
    touch-action: none;
  }
  .panel .ph .face {
    width: 48px;
    height: 42px;
  }
  .panel h2 {
    font-size: 30px;
  }
  body.sheet-open #scrim {
    display: block;
    z-index: 29;
  }
  .ptab {
    font-size: 20px;
  }
  .acts button {
    padding: 12px 8px;
    font-size: 20px;
  } /* easier to tap */
  .stories {
    grid-template-columns: repeat(3, 1fr);
  }
  .dlg {
    max-width: none;
  }
}

/* ---------- 🟢 Office open / 💤 Off-shift sign (top bar) ---------- */
.shift {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 10px;
  margin-right: 4px;
  background: #000;
  font-family: var(--pixel);
  font-size: 18px;
  line-height: 1;
  white-space: nowrap;
  box-shadow:
    0 -2px 0 0 var(--line),
    0 2px 0 0 var(--line),
    -2px 0 0 0 var(--line),
    2px 0 0 0 var(--line);
}
.shift b {
  font-weight: 400;
}
.shift small {
  font-family: var(--tiny);
  font-size: 9px;
  color: var(--mut);
  text-transform: uppercase;
}
.shift.open b {
  color: #7cffb2;
}
.shift.open i {
  width: 8px;
  height: 8px;
  flex: none;
  background: #2fbf71;
  box-shadow: 0 0 0 2px #0f3b23;
  animation: pulse 1.4s steps(1) infinite;
}
@keyframes pulse {
  50% {
    opacity: 0.3;
  }
}
.shift.off b {
  color: var(--mut);
}
@media (max-width: 820px) {
  .shift small {
    display: none;
  }
  .shift {
    font-size: 16px;
    padding: 4px 7px;
  }
}
@media (max-width: 400px) {
  .shift b {
    display: none;
  }
} /* tiny phones: just the dot / 💤 */
header .right button,
#clock {
  white-space: nowrap;
}
@media (max-width: 1280px) {
  .brand small,
  .tz {
    display: none;
  }
}
.brand b,
.tab {
  white-space: nowrap;
}
@media (max-width: 1200px) and (min-width: 821px) {
  .shift small {
    display: none;
  }
}

/* ---------- Phase 6: 📊 Reports ---------- */
.rchips {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding: 4px 3px 8px;
  margin: 8px 0 4px;
}
.rchip {
  --c: #000;
  flex: none;
  font-family: var(--pixel);
  font-size: 17px;
  line-height: 1.05;
  padding: 6px 10px;
  margin: 3px;
  border: 0;
  color: var(--mut);
  background: var(--s2);
  cursor: pointer;
  box-shadow:
    0 -3px 0 0 var(--c),
    0 3px 0 0 var(--c),
    -3px 0 0 0 var(--c),
    3px 0 0 0 var(--c);
}
.rchip small {
  display: block;
  font-family: var(--tiny);
  font-size: 9px;
  margin-top: 3px;
}
.rchip.on {
  --c: var(--or);
  background: var(--s3);
  color: #fff;
}
.rhead {
  margin: 12px 0 4px;
  font-family: var(--pixel);
  font-size: 22px;
  color: var(--ink);
}
.rhead b {
  font-weight: 400;
  color: var(--yl);
}
.rhead small {
  display: block;
  font-family: Inter, sans-serif;
  font-size: 12px;
  color: var(--mut);
  margin-top: 2px;
}
.rtiles {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 12px 3px;
}
.rtile {
  --c: var(--line);
  background: var(--s2);
  text-align: center;
  padding: 8px 4px;
  box-shadow:
    0 -3px 0 0 var(--c),
    0 3px 0 0 var(--c),
    -3px 0 0 0 var(--c),
    3px 0 0 0 var(--c);
}
.rtile b {
  display: block;
  font-family: var(--pixel);
  font-weight: 400;
  font-size: 34px;
  line-height: 1;
  color: var(--mut);
}
.rtile span {
  font-family: var(--tiny);
  font-size: 9px;
  text-transform: uppercase;
  color: var(--mut);
}
.rtile.ok {
  --c: #1f4d33;
}
.rtile.ok b {
  color: #7fe8b2;
}
.rtile.mid b {
  color: var(--yl);
}
.rtile.bad {
  --c: var(--rd);
}
.rtile.bad b {
  color: #ff8b93;
}
.rrow {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 4px;
  border-bottom: 2px dotted var(--s3);
  font-size: 13px;
}
.rrow.warn {
  background: #2a1a0a;
}
.rrow .rmain {
  flex: 1;
  min-width: 0;
}
.rrow .rmain small {
  color: var(--mut);
  font-size: 12px;
}
.rrow a {
  font-family: var(--pixel);
  font-size: 20px;
  color: var(--or);
  text-decoration: none;
  padding: 0 4px;
}
.rplat,
.rmark,
.rtime {
  flex: none;
  font-family: var(--tiny);
  font-size: 9px;
  text-transform: uppercase;
  padding: 4px 6px;
  background: var(--s3);
  color: var(--ink);
  width: 96px;
  text-align: center;
  line-height: 1.3;
}
.rplat.instagram {
  background: #4a1530;
  color: #ff9cc2;
}
.rplat.facebook {
  background: #15284d;
  color: #a9c8ff;
}
.rplat.threads {
  background: #000;
  color: #fff;
}
.rmark {
  width: 34px;
  font-size: 14px;
  background: none;
}
.rtime {
  width: 70px;
  font-family: var(--pixel);
  font-size: 16px;
  background: none;
  color: var(--yl);
  text-transform: none;
}
.rtodo {
  margin: 0;
  padding-left: 18px;
  font-size: 13px;
  color: #ffd6a8;
}
.rtodo li {
  margin: 4px 0;
}
.rnote {
  color: var(--mut);
}
.rhealth {
  list-style: none;
  padding: 0 !important;
  margin: 0;
  font-size: 13px;
}
.rhealth li {
  padding: 5px 0;
}
.rhealth li.bad {
  color: #ffc46b;
}
@media (max-width: 820px) {
  .rplat {
    width: 78px;
  }
  .rtile b {
    font-size: 28px;
  }
}
.ptab {
  white-space: nowrap;
  padding-left: 2px !important;
  padding-right: 2px !important;
}
.ptab .n {
  margin-left: 4px;
}
.ptabs .ptab:nth-child(4):last-child,
.ptabs:has(.ptab:nth-child(4)) .ptab {
  font-size: 19px;
}
