/* Newsroom window: a read-only pixel office floor */

:root {
  --bg: #0d1330;
  --dot: #232c58;
  --panel: #18203f;
  --panel-deep: #0c1128;
  --edge: #060a19;
  --line: #2b3769;
  --shadow: #03050d;
  --ink: #e8ecfa;
  --ink-dim: #9aa3c7;
  --ink-faint: #69729b;
  --yellow: #ffd23f;
  --yellow-dk: #a87f00;
  --yellow-ink: #1d1600;
  --presence: #3ddc84;
  --px: 4px;
  --font: ui-monospace, "SFMono-Regular", "SF Mono", Menlo, Monaco, Consolas,
    "Liberation Mono", "DejaVu Sans Mono", "Courier New", monospace;
}

/* Accent themes: room tint highlights */
body,
body[data-accent="green"] {
  --hi: #3ddc84;
  --hi-dk: #17784a;
  --floor-a: #15302a;
  --floor-b: #1a3b32;
  --grout: #0e231e;
  --wall: #10221d;
  --wall-line: #0a1814;
  --room-edge: #1f5a41;
}

body[data-accent="red"] {
  --hi: #ff4b4b;
  --hi-dk: #9c1f24;
  --floor-a: #341820;
  --floor-b: #3e1d27;
  --grout: #240f15;
  --wall: #261117;
  --wall-line: #1a0a0f;
  --room-edge: #6a1d25;
}

.theme-back {
  --hi: #9aa0b3;
  --hi-dk: #4a4f60;
  --floor-a: #252935;
  --floor-b: #2a2f3c;
  --grout: #1b1e27;
  --wall: #1c1f29;
  --wall-line: #14161e;
  --room-edge: #383d4c;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
}

body {
  min-height: 100vh;
  background-color: var(--bg);
  background-image: radial-gradient(var(--dot) 1.5px, transparent 1.7px);
  background-size: 20px 20px;
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: none;
  -moz-osx-font-smoothing: grayscale;
}

body.locked {
  overflow: hidden;
}

h1, h2, h3, p, dl, dd {
  margin: 0;
}

.caps {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
}

:focus-visible {
  outline: 3px dashed var(--yellow);
  outline-offset: 3px;
}

/* Pixel canvases: drawn at 1 unit per pixel, scaled up hard-edged */
canvas.px {
  display: block;
  width: calc(var(--w, 8) * var(--px));
  height: calc(var(--h, 8) * var(--px));
  image-rendering: crisp-edges;
  image-rendering: pixelated;
}

.noscript {
  margin: 24px;
  padding: 16px;
  background: var(--panel);
  border: 4px solid var(--edge);
  color: var(--yellow);
}

/* Page frame */
.page {
  max-width: 1160px;
  margin: 0 auto;
  padding: 20px 16px 40px;
  display: grid;
  gap: 18px;
}

.panel {
  background: var(--panel);
  border: 4px solid var(--edge);
  box-shadow: inset 0 0 0 2px var(--line), 6px 6px 0 var(--shadow);
}

/* Top bar */
.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
}

.logo {
  --px: 4px;
  flex: none;
  filter: drop-shadow(3px 3px 0 var(--shadow));
}

.ws {
  min-width: 0;
}

.ws-name {
  font-size: 17px;
  line-height: 1.2;
  color: var(--ink);
  text-shadow: 2px 2px 0 var(--shadow);
}

.brand-line {
  margin-top: 3px;
  font-size: 10px;
  color: var(--ink-dim);
  font-weight: 600;
}

.brand-line:empty {
  display: none;
}

.top-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  flex: none;
}

.presence {
  width: 12px;
  height: 12px;
  background: var(--presence);
  box-shadow: 0 0 0 3px var(--edge), 0 0 10px var(--presence);
  animation: blink 2.4s steps(1, end) infinite;
}

.live-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  font-size: 12px;
  color: #b9f5d0;
  background: #0a2a1b;
  border: 3px solid var(--edge);
  box-shadow: 3px 3px 0 var(--shadow);
  transition: opacity 0.2s steps(2);
}

.live-word {
  color: var(--presence);
}

.live-chip.stale {
  opacity: 0.4;
  filter: grayscale(1);
}

/* Command bar (a label shaped like a command bar) */
.cmdbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
}

.cmd-avatar {
  flex: none;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  background: var(--panel-deep);
  border: 3px solid var(--edge);
}

.cmd-avatar canvas {
  --px: 3px;
}

.cmd-text {
  flex: 1;
  min-width: 0;
  padding: 12px 14px;
  font-size: 13px;
  color: var(--ink-dim);
  background: var(--panel-deep);
  border: 3px solid var(--edge);
  box-shadow: inset 3px 3px 0 #05081a;
}

.cmd-text::before {
  content: "> ";
  color: var(--yellow);
}

.ro-chip {
  flex: none;
  padding: 12px 16px;
  font-size: 12px;
  color: var(--yellow-ink);
  background: var(--yellow);
  border: 3px solid var(--edge);
  box-shadow: 4px 4px 0 var(--yellow-dk);
  cursor: default;
  user-select: none;
}

/* Floor */
.floor {
  display: grid;
  gap: 30px;
}

.notice {
  padding: 28px 22px;
  text-align: center;
  color: var(--ink-dim);
}

.notice p + p {
  margin-top: 10px;
  font-size: 13px;
}

.tiles {
  background-color: var(--floor-a);
  background-image:
    linear-gradient(var(--grout) 2px, transparent 2px),
    linear-gradient(90deg, var(--grout) 2px, transparent 2px),
    conic-gradient(var(--floor-b) 0 25%, transparent 0 50%, var(--floor-b) 0 75%, transparent 0);
  background-size: 40px 40px, 40px 40px, 80px 80px;
}

.room {
  position: relative;
  padding: 0 18px 28px;
  border: 4px solid var(--edge);
  box-shadow: inset 0 0 0 3px var(--room-edge), 8px 8px 0 var(--shadow);
}

.room-plate {
  position: absolute;
  top: -4px;
  left: -4px;
  z-index: 3;
  padding: 7px 14px 7px 12px;
  font-size: 13px;
  color: var(--hi);
  background: var(--edge);
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.35);
}

.room-wall {
  height: 92px;
  margin: 0 -18px;
  background-color: var(--wall);
  background-image:
    linear-gradient(transparent 65%, rgba(0, 0, 0, 0.28)),
    repeating-linear-gradient(90deg, transparent 0 58px, var(--wall-line) 58px 62px);
  border-bottom: 8px solid var(--hi-dk);
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.3);
}

.theme-back {
  cursor: pointer;
}

.room.theme-back .furniture,
.room.theme-back .desks {
  filter: saturate(0.35) brightness(0.85);
}

.furniture {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-end;
  gap: 24px 44px;
  margin-top: -70px;
  padding: 0 8px;
}

/* Clickable furniture */
.obj {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 6px 6px 0;
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
  appearance: none;
}

.obj canvas {
  filter: drop-shadow(4px 4px 0 rgba(0, 0, 0, 0.45));
}

.obj:hover canvas,
.obj:focus-visible canvas {
  transform: translateY(-3px);
}

.obj-label {
  padding: 4px 9px;
  font-size: 11px;
  color: var(--ink);
  background: var(--edge);
  border: 2px solid var(--hi-dk);
}

.obj:hover .obj-label,
.obj:focus-visible .obj-label {
  color: var(--yellow);
  border-color: var(--yellow);
}

.obj-tag {
  margin-top: -4px;
  padding: 2px 8px;
  font-size: 10px;
  color: #b4b9c9;
  background: #2b2f3b;
  border: 2px dashed #5a6070;
}

.badge {
  position: absolute;
  top: -8px;
  right: -12px;
  z-index: 2;
  display: grid;
  place-items: center;
  min-width: 30px;
  height: 30px;
  padding: 0 6px;
  font-size: 13px;
  font-weight: 800;
  color: var(--yellow-ink);
  background: var(--yellow);
  border: 3px solid var(--edge);
  box-shadow: 3px 3px 0 var(--shadow);
}

.badge.bump {
  animation: bump 0.7s steps(4, end);
}

.obj.ping .obj-label {
  animation: ping 1s steps(2, end) 6;
}

/* Desks */
.desks {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 24px 36px;
  margin-top: 44px;
  padding-top: 22px;
  border-top: 4px dotted rgba(0, 0, 0, 0.28);
}

.desk {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 4px;
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  appearance: none;
}

button.desk {
  cursor: pointer;
}

.desk-unit {
  position: relative;
  display: block;
  width: calc(32 * var(--px));
  height: calc(17 * var(--px));
}

.desk-cv {
  position: absolute;
  left: 0;
  bottom: 0;
  z-index: 2;
  filter: drop-shadow(3px 3px 0 rgba(0, 0, 0, 0.4));
}

.bot-cv {
  position: absolute;
  left: calc(18 * var(--px));
  bottom: calc(3 * var(--px));
  z-index: 1;
  animation: bob 1.4s steps(1, end) infinite;
  animation-delay: calc(var(--i, 0) * -0.35s);
}

.desk.is-off .bot-cv {
  opacity: 0.45;
  animation: none;
}

.desk-dot {
  position: absolute;
  z-index: 3;
  top: 0;
  left: calc(29 * var(--px));
  width: calc(3 * var(--px));
  height: calc(3 * var(--px));
  border: 2px solid var(--edge);
}

.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 8px;
  border: 2px solid var(--edge);
  vertical-align: -1px;
}

.s-on { background: #3ddc84; }
.s-busy { background: #ffd23f; }
.s-off { background: #6b7290; }
.s-alert { background: #ff4d4d; }

.nameplate {
  padding: 2px 10px;
  font-size: 11px;
  color: #2a1d0a;
  background: #e6d6b4;
  border: 3px solid var(--edge);
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.4);
}

button.desk:hover .nameplate,
button.desk:focus-visible .nameplate {
  background: var(--yellow);
}

button.desk:hover .bot-cv {
  transform: translateY(calc(-1 * var(--px)));
  animation: none;
}

.foot {
  text-align: center;
  font-size: 10px;
  color: var(--ink-faint);
}

/* Overlay
   The overlay is pinned to the visible viewport (inset: 0) instead of using
   100vh, which on phones is taller than the visible area. Panels size against
   the overlay with max-height: 100%, and only the body inside a panel scrolls. */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow: hidden;
  overscroll-behavior: contain;
}

.overlay[hidden] {
  display: none;
}

.overlay-backdrop {
  position: absolute;
  inset: 0;
  background-color: rgba(4, 7, 18, 0.8);
  background-image: radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1.2px);
  background-size: 4px 4px;
}

.overlay-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(1120px, 100%);
  max-height: 100%;
  min-height: 0;
  border: 4px solid var(--edge);
  box-shadow: inset 0 0 0 3px var(--room-edge), 10px 10px 0 #000;
}

.overlay-panel.small {
  width: min(600px, 100%);
}

/* The board fills the available height so its columns can scroll inside it. */
.overlay-panel.tall {
  height: min(100%, 980px);
}

.overlay-head {
  flex: none;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--wall);
  border-bottom: 6px solid var(--hi-dk);
}

.overlay-plate {
  flex: none;
  padding: 5px 10px;
  font-size: 12px;
  color: var(--hi);
  background: var(--edge);
}

.overlay-plate[hidden] {
  display: none;
}

.overlay-title {
  flex: 1;
  min-width: 0;
  font-size: 15px;
  text-shadow: 2px 2px 0 var(--shadow);
}

.x-chip {
  flex: none;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  font: inherit;
  font-size: 16px;
  font-weight: 800;
  color: var(--yellow-ink);
  background: var(--yellow);
  border: 3px solid var(--edge);
  box-shadow: 3px 3px 0 var(--shadow);
  cursor: pointer;
  appearance: none;
}

.x-chip:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--shadow);
}

.overlay-tools {
  flex: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.38);
  border-bottom: 3px solid var(--edge);
}

.overlay-tools[hidden] {
  display: none;
}

.tool-note {
  font-size: 11px;
  color: var(--ink-dim);
}

.tool-hint {
  margin-left: auto;
  font-size: 10px;
  color: var(--yellow);
}

.tool-hint[hidden] {
  display: none;
}

.overlay-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 16px 16px 0;
}

/* A real block at the end of every scrolling body, so the last line always
   clears the bottom edge. Padding alone is dropped by some scroll containers. */
.overlay-body::after {
  content: "";
  display: block;
  height: 28px;
}

.overlay-panel.small .overlay-body::after {
  height: 16px;
}

/* Themed scrollbars: chunky yellow thumb on a dark track */
.scroll-themed::-webkit-scrollbar {
  width: 14px;
  height: 14px;
}

.scroll-themed::-webkit-scrollbar-track {
  background: var(--panel-deep);
  border: 3px solid var(--edge);
}

.scroll-themed::-webkit-scrollbar-thumb {
  background: var(--yellow);
  border: 3px solid var(--edge);
}

.scroll-themed::-webkit-scrollbar-thumb:hover {
  background: #ffe27a;
}

.scroll-themed::-webkit-scrollbar-corner {
  background: var(--edge);
}

@supports not selector(::-webkit-scrollbar) {
  .scroll-themed {
    scrollbar-color: var(--yellow) var(--panel-deep);
  }
}

.field {
  padding: 8px 10px;
  font: inherit;
  font-size: 13px;
  color: var(--ink);
  background: var(--panel-deep);
  border: 3px solid var(--edge);
  border-radius: 0;
  box-shadow: inset 2px 2px 0 #05081a;
}

.field::placeholder {
  color: var(--ink-faint);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

input.field {
  flex: 1 1 220px;
  min-width: 0;
}

select.field {
  flex: 0 1 200px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.log-count {
  margin-left: auto;
  font-size: 11px;
  color: var(--ink-dim);
}

.empty {
  padding: 10px 4px;
  font-size: 11px;
  color: var(--ink-faint);
}

/* Board columns
   The body stops scrolling for the board; instead the strip scrolls sideways
   and each column's card list scrolls up and down on its own. */
.overlay-body.board-body {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
}

.overlay-body.board-body::after {
  display: none;
}

.board-cols {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: stretch;
  gap: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  padding: 14px 14px 12px;
  scroll-snap-type: x proximity;
  scroll-padding-inline: 14px;
}

/* Keeps the right-hand padding when the strip scrolls */
.board-cols::after {
  content: "";
  flex: 0 0 2px;
}

.col-0 { --col: #9aa6c8; }
.col-1 { --col: #5ec8ff; }
.col-2 { --col: #b78cff; }
.col-3 { --col: #ffd23f; }
.col-4 { --col: #7be38a; }

.col {
  flex: 1 0 240px;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  scroll-snap-align: start;
  background: rgba(7, 11, 25, 0.78);
  border: 3px solid var(--edge);
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.35);
}

.col-head {
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  font-size: 11px;
  border-bottom: 3px solid var(--edge);
  background: rgba(255, 255, 255, 0.04);
}

.col-head::before {
  content: "";
  width: 10px;
  height: 10px;
  background: var(--col);
  border: 2px solid var(--edge);
}

.col-count {
  margin-left: auto;
  padding: 0 6px;
  color: var(--yellow-ink);
  background: var(--col);
  border: 2px solid var(--edge);
}

.col-list {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-x: hidden;
  overflow-y: auto;
  /* Contain vertical scrolling only, so a sideways swipe or wheel that
     starts over a column still moves the strip. */
  overscroll-behavior-x: auto;
  overscroll-behavior-y: contain;
  padding: 10px 10px 0;
}

/* Bottom clearance inside each column list */
.col-list::after {
  content: "";
  flex: 0 0 8px;
}

.col-list.scroll-themed::-webkit-scrollbar {
  width: 10px;
}

.col-list.scroll-themed::-webkit-scrollbar-thumb {
  background: var(--col);
}

@supports not selector(::-webkit-scrollbar) {
  .col-list.scroll-themed {
    scrollbar-width: thin;
    scrollbar-color: var(--col) var(--panel-deep);
  }
}

.card {
  flex: none;
  padding: 8px 10px 9px;
  color: #1d1a12;
  background: #f1ede1;
  border: 3px solid var(--edge);
  border-top: 7px solid var(--col);
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.5);
}

.card[role="button"] {
  cursor: pointer;
}

.card[role="button"]:hover,
.card[role="button"]:focus-visible {
  background: #fffbea;
}

.card-title {
  margin-bottom: 6px;
  font-size: 13px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  color: #5a5446;
}

.card-owner {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.swatch {
  flex: none;
  display: inline-block;
  width: 9px;
  height: 9px;
  background: var(--agent, #9aa6c8);
  border: 2px solid var(--edge);
}

/* Preview only: the full summary lives in the task popup */
.card-summary {
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.45;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow-wrap: anywhere;
}

.card-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.card-open {
  margin-left: auto;
  font-size: 10px;
  color: #7a6200;
}

.card-open::after {
  content: " +";
}

/* Comment count badge with a small pixel speech bubble */
.card-comments {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 1px 6px;
  font-size: 10px;
  font-weight: 800;
  color: var(--yellow-ink);
  background: var(--yellow);
  border: 2px solid var(--edge);
}

.card-comments::before {
  content: "";
  width: 9px;
  height: 10px;
  background:
    linear-gradient(var(--edge), var(--edge)) 0 0 / 9px 7px no-repeat,
    linear-gradient(var(--edge), var(--edge)) 1px 7px / 3px 3px no-repeat;
}

/* Task popup: sits above the board inside the same overlay */
.task-layer {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.task-layer[hidden] {
  display: none;
}

.task-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 7, 18, 0.72);
}

.overlay-panel.task-panel {
  width: min(780px, 100%);
}

.task-sheet {
  padding: 18px 18px 20px;
  background: rgba(7, 11, 25, 0.86);
  border: 3px solid var(--edge);
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.35);
}

.col-chip {
  display: inline-block;
  padding: 2px 8px;
  font-size: 11px;
  color: var(--yellow-ink);
  background: var(--col);
  border: 2px solid var(--edge);
}

.task-title {
  margin: 12px 0 14px;
  font-size: 19px;
  line-height: 1.3;
  overflow-wrap: anywhere;
  text-shadow: 2px 2px 0 var(--shadow);
}

.task-facts {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 14px;
  padding: 10px 12px;
  font-size: 13px;
  background: var(--panel-deep);
  border: 3px solid var(--edge);
}

.task-facts dt {
  padding-top: 2px;
  font-size: 10px;
  color: var(--ink-faint);
}

.task-facts dd {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.task-section {
  margin-top: 18px;
}

.task-label {
  margin: 0 0 8px;
  font-size: 11px;
  color: var(--hi);
}

.task-summary {
  font-size: 14px;
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.quiet {
  font-size: 12px;
  color: var(--ink-faint);
}

.comment-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.comment {
  padding: 8px 12px 10px;
  background: var(--panel-deep);
  border: 3px solid var(--edge);
  border-left: 7px solid var(--agent, #9aa6c8);
}

.comment-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 4px;
}

.comment-agent {
  font-size: 12px;
  color: var(--agent, #9aa6c8);
}

.comment-time {
  font-size: 11px;
  color: var(--ink-faint);
}

.comment-text {
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* Log stream */
.log-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.log-row {
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: center;
  gap: 4px 10px;
  padding: 8px 12px;
  background: rgba(7, 11, 25, 0.84);
  border: 3px solid var(--edge);
  border-left: 7px solid var(--agent, #9aa6c8);
}

.log-row.fresh {
  animation: fresh 5s steps(10, end) both;
}

.log-agent {
  font-size: 12px;
  color: var(--agent, #9aa6c8);
}

.log-time {
  font-size: 11px;
  color: var(--ink-faint);
}

.kind {
  justify-self: start;
  padding: 1px 6px;
  font-size: 10px;
  border: 2px solid var(--edge);
}

.kind-message { background: #3a4470; color: #dfe5ff; }
.kind-intake { background: #1f6f8b; color: #e0f7ff; }
.kind-board { background: var(--yellow); color: var(--yellow-ink); }
.kind-system { background: #6a3fa0; color: #f1e6ff; }

.log-text {
  grid-column: 1 / -1;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.5;
}

/* Pinboard */
.cork {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 28px 22px;
  min-height: 260px;
  padding: 28px 24px;
  background-color: #b9803f;
  background-image:
    radial-gradient(#a06a30 1.5px, transparent 1.7px),
    radial-gradient(#cf9757 1px, transparent 1.2px);
  background-size: 14px 14px, 9px 9px;
  background-position: 0 0, 4px 6px;
  border: 8px solid #6b3f1a;
  box-shadow: inset 0 0 0 3px #4a2a10, 6px 6px 0 rgba(0, 0, 0, 0.4);
}

.cork > .empty {
  grid-column: 1 / -1;
  align-self: center;
  text-align: center;
  color: #4a2a10;
}

.note {
  position: relative;
  align-self: start;
  padding: 20px 14px 12px;
  color: #2a2416;
  background: var(--note, #fff3a0);
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.35);
  transform: rotate(var(--tilt, 0deg));
}

.note:nth-child(4n + 1) { --note: #fff3a0; --tilt: -1.5deg; }
.note:nth-child(4n + 2) { --note: #ffd6e4; --tilt: 1deg; }
.note:nth-child(4n + 3) { --note: #cdf0ff; --tilt: -0.6deg; }
.note:nth-child(4n + 4) { --note: #dbffcf; --tilt: 1.6deg; }

.note::before {
  content: "";
  position: absolute;
  top: 5px;
  left: calc(50% - 6px);
  width: 12px;
  height: 12px;
  background: #e23b3b;
  border: 2px solid #5a0f0f;
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.4);
}

.note h3 {
  font-size: 13px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.note .card-meta {
  margin-top: 6px;
}

.note p {
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

/* Side room panel */
.side-line {
  padding: 10px 6px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink);
  text-shadow: 2px 2px 0 var(--shadow);
}

/* Agent card */
.agent-card {
  position: fixed;
  z-index: 40;
  width: 280px;
  padding: 14px;
  background: var(--panel);
  border: 4px solid var(--edge);
  box-shadow: inset 0 0 0 2px var(--line), 6px 6px 0 #000;
}

.agent-card[hidden] {
  display: none;
}

.x-small {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  font-size: 13px;
}

.agent-top {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-right: 30px;
}

.agent-portrait {
  flex: none;
  display: grid;
  place-items: center;
  padding: 6px;
  background: var(--panel-deep);
  border: 3px solid var(--edge);
}

.agent-portrait canvas {
  --px: 4px;
}

.agent-id {
  min-width: 0;
}

.agent-name {
  font-size: 15px;
  color: var(--agent, var(--ink));
  overflow-wrap: anywhere;
}

.agent-role {
  margin-top: 2px;
  font-size: 11px;
  color: var(--ink-dim);
}

.agent-facts {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 12px;
  margin: 14px 0 12px;
  font-size: 12px;
}

.agent-facts dt {
  font-size: 10px;
  color: var(--ink-faint);
  padding-top: 2px;
}

.agent-facts dd {
  overflow-wrap: anywhere;
}

.agent-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px 8px;
  background: var(--panel-deep);
  border: 3px solid var(--edge);
}

.stat b {
  font-size: 20px;
  line-height: 1.1;
  color: var(--yellow);
}

.stat span {
  font-size: 9px;
  color: var(--ink-dim);
}

/* Animations */
@keyframes blink {
  0%, 100% { opacity: 1; }
  85% { opacity: 0.35; }
}

@keyframes bob {
  0% { transform: translateY(0); }
  50% { transform: translateY(calc(-1 * var(--px))); }
}

@keyframes bump {
  0% { transform: translateY(0) scale(1); }
  25% { transform: translateY(-6px) scale(1.2); }
  50% { transform: translateY(-2px) scale(1.1); }
  100% { transform: translateY(0) scale(1); }
}

@keyframes ping {
  0% { border-color: var(--yellow); color: var(--yellow); }
  50% { border-color: var(--hi-dk); color: var(--ink); }
}

@keyframes fresh {
  0% {
    background: rgba(255, 210, 63, 0.32);
    box-shadow: 0 0 0 3px var(--yellow);
  }
  100% {
    background: rgba(7, 11, 25, 0.84);
    box-shadow: 0 0 0 0 transparent;
  }
}

/* Small screens */
@media (max-width: 720px) {
  :root {
    --px: 3px;
  }

  .page {
    padding: 12px 10px 32px;
    gap: 14px;
  }

  .topbar {
    flex-wrap: wrap;
  }

  .top-right {
    margin-left: 0;
    width: 100%;
    justify-content: flex-end;
  }

  .cmdbar {
    flex-wrap: wrap;
  }

  .cmd-text {
    flex-basis: calc(100% - 70px);
    font-size: 12px;
  }

  .ro-chip {
    margin-left: auto;
  }

  .room {
    padding: 0 10px 22px;
  }

  .room-wall {
    margin: 0 -10px;
    height: 80px;
  }

  .furniture {
    margin-top: -48px;
    gap: 18px 26px;
  }

  .overlay,
  .task-layer {
    padding: 8px;
  }

  .overlay-panel.tall {
    height: 100%;
  }

  .overlay-body {
    padding: 10px 10px 0;
  }

  .board-cols {
    gap: 10px;
    padding: 10px 10px 10px;
    scroll-padding-inline: 10px;
    scroll-snap-type: x mandatory;
  }

  .col {
    flex: 0 0 min(80vw, 290px);
  }

  .task-sheet {
    padding: 14px 12px 16px;
  }

  .task-title {
    font-size: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
