:root {
  --bg: #14110e;
  --panel: #241c16;
  --line: #3a2e24;
  --ink: #f6efe6;
  --muted: #b5a89a;
  --amber: #e2a15a;
  --green: #8fbf8a;
  --red: #d46a5c;
  --blue: #7ea0c4;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.45 "Segoe UI", sans-serif;
}
button, input, select, textarea {
  font: inherit;
  color: inherit;
}
button {
  background: var(--amber);
  color: #2a1c10;
  border: 0;
  border-radius: 8px;
  padding: 10px 14px;
  cursor: pointer;
}
button.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
button.active { outline: 2px solid var(--amber); }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.error { color: var(--red); }
.eyebrow { letter-spacing: .14em; text-transform: uppercase; color: var(--amber); font-size: 12px; margin: 0; }
.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.login-card, .panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
}
.login-card { width: min(420px, 100%); }
.login-card h1 { margin: 8px 0 16px; }
label { display: block; margin: 10px 0; color: var(--muted); }
.voice-row { display: flex; gap: 10px; align-items: center; }
.voice-row input, .voice-row textarea { flex: 1 1 auto; width: 1%; min-width: 0; margin-top: 0; }
button.voice-btn {
  flex: 0 0 auto;
  width: 57.6px;
  height: 57.6px;
  min-width: 57.6px;
  min-height: 57.6px;
  margin: 0;
  padding: 0;
  border-radius: 50%;
  border: 2px solid var(--amber);
  background: #3a2a1c;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.05;
  text-align: center;
  touch-action: manipulation;
}
button.voice-btn.listening, .listen-btn.listening { background: #c6ff73; color: #143018; border-color: #c6ff73; }
.voice-note { margin: 2px 0 0; font-size: 12px; }
input, select, textarea {
  width: 100%;
  margin-top: 6px;
  background: #120e0b;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}
.top {
  display: flex;
  gap: 16px;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.top h1 { margin: 0; font-size: 28px; }
nav { display: flex; gap: 8px; flex-wrap: wrap; }
nav button { background: #2c241c; color: var(--ink); }
nav button.active { background: var(--amber); color: #2a1c10; }
.who { display: flex; gap: 8px; align-items: center; }
#mode-badge {
  border: 1px solid var(--amber);
  color: var(--amber);
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 12px;
}
.metrics { display: grid; grid-template-columns: repeat(8, minmax(90px, 1fr)); gap: 8px; padding: 12px 20px; }
.metric {
  background: #1d1814;
  color: var(--ink);
  border-radius: 10px;
  padding: 6px 8px;
  text-align: left;
  min-height: 0;
}
.metric b { display: block; font-size: 20px; }
.metric span { display: block; color: var(--muted); font-size: 12px; }
.live-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: stretch;
  padding: 0 20px 10px;
}
.live-strip .muted { margin: 0; }
.live-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  flex: 1 1 280px;
  background: #1d1814;
  color: var(--ink);
  border-radius: 10px;
  padding: 6px 10px;
  min-height: 0;
  white-space: normal;
  text-align: left;
  font-size: 13px;
  line-height: 1.25;
}
.live-row b { font-size: 13px; }
.live-row.status-WORKING { background: #c6ff73; color: #143018; }
.live-row span { color: inherit; opacity: .8; white-space: normal; }
.office-layout { display: grid; grid-template-columns: 1.6fr .8fr; gap: 12px; padding: 0 20px 20px; }
.map-wrap { overflow: visible; padding-bottom: 8px; }
.map {
  position: relative;
  width: 100%;
  min-width: 0;
  background: #c4b49a;
  border: 6px solid #4a3b2e;
  border-radius: 18px;
  padding: 0;
  overflow: hidden;
  box-shadow: inset 0 0 0 8px #d9c7ad, 0 16px 0 #2a2118;
}
.iso { display: block; width: 100%; height: auto; }
.building {
  display: flex;
  flex-direction: column;
  gap: 0;
  background: #3a2a22;
  padding: 8px 8px 0;
}
.story {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 300px;
  margin-bottom: 10px;
  border-radius: 12px 12px 4px 4px;
  box-shadow: 0 10px 0 #2a1d16;
}
.story-plate {
  position: absolute;
  inset: 0;
  background: #e7d3b4 url("/static/office/story.jpg?v=12") center / 100% 100% no-repeat;
}
.story-head, .iso-line, .story .iso-lobby { position: relative; z-index: 1; }
.story-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin: 0;
  padding: 10px 16px 0;
  color: #3a2c22;
  text-shadow: 0 1px 0 rgba(255, 248, 236, .65);
}
.story-head b { font-size: 16px; letter-spacing: .04em; }
.story-head span {
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.building-desk .story { min-height: 340px; }
.building-desk .iso-line { min-height: 250px; }
.story-lobby { min-height: 150px; }
.story-lobby .iso-lobby { background: transparent; padding-bottom: 22px; }
.iso-stage { background: #e4d0b2; }
.iso-wall {
  position: relative;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(#fbf6ee, #e7d7c0);
}
.iso-wall:before, .iso-wall:after {
  content: "";
  position: absolute;
  top: 20px;
  width: 72px;
  height: 28px;
  background: #b9dff0;
  border: 3px solid #6a503c;
  transform: skewX(-30deg);
}
.iso-wall:before { left: 16px; }
.iso-wall:after { right: 16px; }
.iso-wall span {
  position: relative;
  z-index: 1;
  background: #6a503c;
  color: #f6efe6;
  border-radius: 6px;
  padding: 6px 14px;
  font-weight: 700;
  letter-spacing: .08em;
}
.iso-floor {
  background-color: #e4d0b2;
  background-image:
    linear-gradient(30deg, rgba(196,174,140,.65) 12%, transparent 12.5%, transparent 87%, rgba(196,174,140,.65) 87.5%),
    linear-gradient(150deg, rgba(196,174,140,.65) 12%, transparent 12.5%, transparent 87%, rgba(196,174,140,.65) 87.5%),
    linear-gradient(30deg, rgba(196,174,140,.65) 12%, transparent 12.5%, transparent 87%, rgba(196,174,140,.65) 87.5%),
    linear-gradient(150deg, rgba(196,174,140,.65) 12%, transparent 12.5%, transparent 87%, rgba(196,174,140,.65) 87.5%);
  background-size: 58px 100px;
  background-position: 0 0, 0 0, 29px 50px, 29px 50px;
  padding: 4px 8px 12px;
}
.iso-row h3 {
  margin: 4px 0 0;
  text-align: center;
  color: #4a3828;
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.iso-line {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 0;
  margin-top: auto;
  padding: 8px 4px 0;
}
.seat {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1 1 0;
  max-width: 210px;
  margin-top: 0;
  padding: 0 1px;
  background: transparent;
  color: #2b2118;
  border: 0;
  text-align: center;
  min-height: 0;
}
.seat-figure {
  position: relative;
  width: 100%;
  aspect-ratio: 765 / 925;
}
.seat .asset {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  background: transparent;
  filter: drop-shadow(0 10px 5px rgba(48, 28, 12, .28));
}
.screen-glow {
  display: none;
  position: absolute;
  border-radius: 3px;
  background:
    repeating-linear-gradient(
      180deg,
      #f4ffd2 0 3px,
      #b6ff63 3px 7px,
      #1d3a16 7px 8px
    );
  box-shadow: 0 0 10px 4px #e8ff9a, 0 0 22px 10px rgba(160, 255, 70, .95);
  pointer-events: none;
  animation: screen-pulse 1.1s ease-in-out infinite;
}
.seat.status-WORKING .screen-glow { display: block; }
@keyframes screen-pulse {
  50% { filter: brightness(1.45); }
}
.seat-name {
  position: static;
  z-index: 2;
  display: inline-block;
  max-width: 100%;
  margin: 0 0 2px;
  padding: 1px 5px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 11px;
  line-height: 1.15;
  color: #2b2118;
  background: rgba(255, 248, 236, .72);
}
.seat.status-WORKING .seat-name {
  background: #c6ff73;
  color: #143018;
  box-shadow: 0 0 10px #b6f56a;
}
.seat.status-ERROR .seat-name { background: #ffb1a8; color: #4a1814; }
.seat.selected { outline: 3px solid #e2a15a; border-radius: 12px; }
.iso-lobby {
  display: flex;
  justify-content: space-around;
  align-items: end;
  gap: 8px;
  padding: 4px 10px 14px;
  background: #dcc6a4;
}
.lobby-piece { width: 30%; }
.lobby-piece svg { width: 100%; height: auto; display: block; }
.prop-label { font: 700 14px "Segoe UI", sans-serif; fill: #4a3828; }
.station, .station-label { cursor: pointer; }
.station.selected .hit, .station-label.selected .step { stroke: #e2a15a; stroke-width: 3; }
.wall-title { font: 700 16px "Segoe UI", sans-serif; fill: #f6efe6; letter-spacing: .08em; }
.row-label { font: 700 13px "Segoe UI", sans-serif; fill: #4a3828; letter-spacing: .08em; }
.desk-name { font: 700 13px "Segoe UI", sans-serif; fill: #2b2118; }
.desk-duty { font: 12px "Segoe UI", sans-serif; fill: #5c4636; }
.desk-state { font: 700 12px "Segoe UI", sans-serif; fill: #6a503c; }
.step { fill: #f6efe6; stroke: #6a503c; stroke-width: 2; }
.step-num { font: 700 12px "Segoe UI", sans-serif; fill: #2b2118; }
.zone-title, .prop-label { font: 700 13px "Segoe UI", sans-serif; fill: #4a3828; }
.status-WORKING .screen { animation: blink 0.8s steps(2) infinite; }
.status-WORKING .desk-state { fill: #1f6b3a; }
.status-ERROR .desk-state { fill: #a33b32; }
.status-WAITING .desk-state, .status-REVIEW .desk-state { fill: #8a5a16; }
.live-row.status-ERROR { background: #ffb1a8; color: #4a1814; }
.building {
  background: #efe4cf;
  border: 4px solid #5c4632;
  box-shadow: 0 8px 0 #3d2e22;
}
.roof {
  height: 28px;
  background:
    repeating-linear-gradient(90deg, #8d4b3a 0 16px, #a85b46 16px 18px, #7a3e30 18px 32px);
  border-bottom: 4px solid #5a3228;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #f8efe4;
  font: 700 13px "Courier New", monospace;
  letter-spacing: .18em;
}
.floor-row {
  display: flex;
  border-bottom: 4px solid #6a503c;
}
.floor-row:last-child { border-bottom: 0; }
.common {
  position: relative;
  height: 210px;
  background:
    linear-gradient(#e7d3b4, #e7d3b4) 0 0 / 100% 36px no-repeat,
    repeating-linear-gradient(90deg, #c9a57a 0 28px, #d2b088 28px 30px);
  border-bottom: 4px solid #6a503c;
  overflow: hidden;
}
.zone-label {
  position: absolute;
  top: 8px;
  left: 12px;
  z-index: 2;
  color: #4a3828;
  font: 700 13px "Courier New", monospace;
  letter-spacing: .12em;
}
.rug {
  position: absolute;
  left: 34%;
  top: 58px;
  width: 280px;
  height: 120px;
  background:
    repeating-linear-gradient(90deg, #8d4e46 0 14px, #c4a574 14px 22px, #6e7f62 22px 34px);
  border: 6px solid #6a3e36;
  box-shadow: 0 8px 0 rgba(60, 40, 24, .25);
}
.sofa {
  position: absolute;
  left: 38%;
  top: 78px;
  width: 168px;
  height: 62px;
  background: #6e8f78;
  border-radius: 16px 16px 8px 8px;
  box-shadow: inset 18px 0 0 #5d7b66, inset -18px 0 0 #5d7b66, inset 0 18px 0 #567564, 0 10px 0 #3c4e42;
}
.sofa:before, .sofa:after {
  content: "";
  position: absolute;
  top: 8px;
  width: 22px;
  height: 46px;
  background: #7ea08a;
  border-radius: 8px;
}
.sofa:before { left: 8px; }
.sofa:after { right: 8px; }
.coffee {
  position: absolute;
  left: calc(38% + 188px);
  top: 92px;
  width: 54px;
  height: 36px;
  background: #8d5a34;
  box-shadow: 0 8px 0 #5c3a22, inset 0 6px 0 #c9843a;
  border-radius: 4px;
}
.cooler {
  position: absolute;
  right: 168px;
  top: 62px;
  width: 48px;
  height: 112px;
  background: linear-gradient(#f8f6f1, #d5dbe2);
  border: 4px solid #7d8794;
  border-radius: 8px 8px 4px 4px;
  box-shadow: 0 8px 0 #3d342c;
}
.cooler .bottle {
  display: block;
  width: 22px;
  height: 40px;
  margin: 14px auto 0;
  background: linear-gradient(#b9e6f5, #4aa3c8);
  border-radius: 6px 6px 8px 8px;
  box-shadow: inset -6px 0 0 rgba(255,255,255,.45);
}
.cooler .tap {
  display: block;
  width: 16px;
  height: 8px;
  margin: 10px auto 0;
  background: #3d8eaf;
  border-radius: 0 0 4px 4px;
  box-shadow: 0 8px 0 #cfd6dc;
}
.printer {
  position: absolute;
  left: 28px;
  top: 78px;
  width: 92px;
  height: 58px;
  background: #f6f3ec;
  border: 4px solid #4e463e;
  border-radius: 4px;
  box-shadow: 0 10px 0 #3d342c;
}
.printer .paper {
  position: absolute;
  left: 14px;
  right: 14px;
  top: -12px;
  height: 16px;
  background: #fff;
  border: 2px solid #d9d3c8;
}
.printer .slot {
  display: block;
  height: 10px;
  margin: 18px 10px 0;
  background: #2a2724;
}
.printer .light {
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 8px;
  height: 8px;
  background: #7ddea0;
  border-radius: 50%;
}
.board {
  position: absolute;
  right: 24px;
  top: 58px;
  width: 110px;
  height: 78px;
  background: #f7f1e4;
  border: 4px solid #6a503c;
  box-shadow: inset 0 0 0 8px #efe4cf;
}
.board span {
  display: block;
  height: 4px;
  margin: 16px 10px 0;
  background: #c46b6b;
}
.board span:nth-child(2) { background: #7ea0c4; width: 70%; }
.plant.lobby {
  position: absolute;
  left: 140px;
  top: 70px;
  bottom: auto;
  width: 28px;
  height: 36px;
  background: #3f7d45;
  border-radius: 14px 14px 4px 4px;
  box-shadow: -16px 10px 0 #2f6a38, 16px 8px 0 #4e9460, 0 48px 0 #6a4124;
}
.room {
  position: relative;
  width: 186px;
  height: 228px;
  flex: 0 0 186px;
  border-right: 4px solid #6a503c;
  background-color: #d7b07a;
  background-image:
    linear-gradient(90deg, rgba(92, 58, 28, .28) 2px, transparent 2px),
    linear-gradient(rgba(255, 226, 180, .35) 2px, transparent 2px);
  background-size: 18px 100%, 100% 10px;
  overflow: hidden;
}
.room:last-child { border-right: 0; }
.wall {
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 46px;
  background: #f4ead8;
  box-shadow: inset 0 -4px 0 #c9b18a;
}
.sign {
  position: absolute;
  top: 4px;
  left: 6px;
  right: 6px;
  color: #4a3828;
  font: 700 11px "Courier New", monospace;
  letter-spacing: .04em;
  text-align: center;
}
.win {
  position: absolute;
  top: 18px;
  left: 58px;
  width: 40px;
  height: 22px;
  background: #9fd4ee;
  box-shadow:
    inset 0 0 0 3px #f7f1e6,
    inset 20px 0 0 #79b7d6,
    inset 0 11px 0 #79b7d6,
    0 0 0 2px #6a503c;
}
.table {
  position: absolute;
  left: 18px;
  bottom: 46px;
  width: 120px;
  height: 22px;
  background: #8d5a34;
  box-shadow: 0 6px 0 #5c3a22, inset 0 4px 0 #b47a45, inset 0 0 0 2px #6a4124;
}
.monitor {
  position: absolute;
  left: 62px;
  bottom: 68px;
  width: 34px;
  height: 26px;
  background: #2c333c;
  box-shadow: 0 4px 0 #1b2128, inset 0 0 0 3px #4d5662;
}
.monitor i {
  display: block;
  margin: 5px;
  height: 12px;
  background: #1d3d34;
}
.status-WORKING .monitor i { background: #7ddea0; animation: blink 0.7s steps(2) infinite; }
.status-ERROR .monitor i, .status-REVIEW .monitor i { background: #e07a6a; }
.status-WAITING .monitor i { background: #e2a15a; }
@keyframes blink { 50% { opacity: .45; } }
.chair {
  position: absolute;
  left: 78px;
  bottom: 28px;
  width: 36px;
  height: 16px;
  background: #5c4636;
  border-radius: 4px 4px 0 0;
  box-shadow: 0 8px 0 #3d2e22, -4px -10px 0 #6a5342;
}
.lamp {
  position: absolute;
  left: 22px;
  bottom: 78px;
  width: 8px;
  height: 28px;
  background: #c9b18a;
  box-shadow: 8px -8px 0 #f4e2a0, 0 8px 0 #8d5a34;
}
.shelf {
  position: absolute;
  right: 8px;
  top: 54px;
  width: 28px;
  height: 46px;
  background: #6a4124;
  box-shadow: inset 0 14px 0 #8d5a34, inset 0 16px 0 #c46b6b, inset 0 30px 0 #8d5a34, inset 0 32px 0 #7ea0c4;
}
.room-printer {
  position: absolute;
  right: 8px;
  bottom: 52px;
  width: 36px;
  height: 22px;
  background: #f4f1ea;
  border: 2px solid #4e463e;
  box-shadow: 0 4px 0 #3d342c;
}
.room-printer:before {
  content: "";
  position: absolute;
  left: 6px;
  right: 6px;
  top: -6px;
  height: 6px;
  background: #fff;
}
.plant {
  position: absolute;
  left: 8px;
  bottom: 70px;
  width: 16px;
  height: 22px;
  background: #3f7d45;
  border-radius: 8px 8px 2px 2px;
  box-shadow: -6px 6px 0 #2f6a38, 6px 4px 0 #2f6a38, 0 20px 0 #6a4124;
}
.worker {
  position: absolute;
  left: 58px;
  bottom: 22px;
  width: 72px;
  height: 92px;
  padding: 0;
  background: transparent;
  border: 0;
  cursor: pointer;
}
.worker.selected { outline: 3px solid #f4e2a8; outline-offset: 2px; }
.worker .px { pointer-events: none; }
.nameplate {
  position: absolute;
  left: 4px;
  right: 4px;
  bottom: 2px;
  text-align: center;
  color: #2b2118;
  font: 700 11px "Courier New", monospace;
  text-shadow: 1px 1px 0 #f6ead4;
}
.folder-btn {
  position: absolute;
  right: 6px;
  bottom: 72px;
  z-index: 2;
  width: auto;
  height: auto;
  padding: 3px 5px;
  font: 700 10px "Courier New", monospace;
  color: #2a1c10;
  background: #e2b15a;
  border: 0;
  box-shadow: inset 0 -3px 0 #a8742e, 0 3px 0 #5c3a22;
  cursor: pointer;
}
.folder-btn:hover { transform: translateY(-2px); }
.px {
  width: 1px;
  height: 1px;
  display: block;
  position: absolute;
  left: 8px;
  top: 0;
  transform: scale(4);
  transform-origin: top left;
  image-rendering: pixelated;
}
.agent-pop .material-open { display: inline-block; width: auto; margin-top: 8px; min-height: 28px; padding: 3px 8px; font-size: 12px; }
.agent-pop {
  position: fixed;
  z-index: 30;
  width: min(340px, calc(100vw - 16px));
  background: #2a211a;
  color: var(--ink);
  border: 4px solid #e2a15a;
  box-shadow: 8px 8px 0 rgba(0, 0, 0, .35);
  padding: 14px 14px 10px;
  font-size: 13px;
  line-height: 1.45;
}
.pop-x {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 32px;
  height: 32px;
  padding: 0;
  background: #3a2e24;
  color: var(--ink);
}
.modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(18, 12, 8, .62);
  display: grid;
  place-items: center;
  padding: 16px;
}
.modal-card {
  width: min(860px, 100%);
  max-height: min(82vh, 760px);
  overflow: auto;
  background: #241c16;
  border: 4px solid #e2a15a;
  padding: 16px;
  box-shadow: 10px 10px 0 rgba(0, 0, 0, .35);
  font-size: 13px;
  line-height: 1.45;
}
.kanban { display: grid; grid-template-columns: repeat(6, minmax(160px, 1fr)); gap: 8px; padding: 16px 20px; overflow: auto; }
.column { background: #1c1713; border-radius: 12px; padding: 8px; min-height: 240px; }
.card, .channel-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  margin: 8px 0;
  cursor: pointer;
}
.card.ready {
  background: #1c3a28;
  border-color: #6fbf8a;
}
.card.blocked { background: #3a221c; border-color: #d46a5c; }
.block-note { color: #f0c2b8; font-size: 13px; margin: 6px 0 0; }
.block-panel {
  border: 1px solid var(--red);
  border-radius: 12px;
  padding: 12px;
  margin: 10px 0;
  background: #3a221c;
}
.block-panel h3 { margin: 0 0 8px; }
.block-panel li { margin: 0 0 10px; }
.block-panel mark { background: #e2a15a; color: #2a1c10; padding: 0 2px; }
.block-panel button { margin-top: 8px; }
.card.ready b { color: #d7ffe4; }
.ready-mark {
  display: inline-block;
  margin-top: 6px;
  color: #143024;
  background: #8fbf8a;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 700;
}
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; padding: 16px 20px; }
.analytics-card { cursor: pointer; }
.dialog-head { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.dialog-head h2 { margin: 0; font-size: 13px; font-weight: 700; flex: 1; min-width: 0; line-height: 1.45; }
.dialog-tools, .tabs, .card-actions, .shelf-bar { display: flex; gap: 4px; align-items: center; }
.dialog-tools { flex: 0 0 auto; align-items: stretch; }
#material .dialog-tools button {
  height: 40px;
  min-height: 40px;
  padding: 0 10px;
  font-size: 13px;
  line-height: 1.1;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.tabs { margin: 0; }
.shelf-bar { justify-content: space-between; grid-column: 1 / -1; padding: 4px 2px; }
.shelf-bar h2 { margin: 0; font-size: 18px; }
.card-actions { flex-wrap: wrap; margin-top: 6px; }
.approval-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.approval-actions button { width: auto; min-height: 40px; margin: 0; }
.piece-actions { margin-top: 28px; gap: 10px; }
button#reject-btn,
button#rework-btn {
  min-height: 44px;
  padding: 10px 18px;
  font-size: 13px;
}
button.dzen-btn {
  display: block;
  width: 100%;
  margin: 8px 0 0;
  min-height: 44px;
}
.card-actions button, .dialog-tools button, .tabs button, .shelf-bar button {
  min-height: 28px;
  padding: 3px 8px;
  font-size: 12px;
  width: auto;
  margin: 0;
}
.return-note { margin: 8px 0 4px; }
.return-note textarea { min-height: 52px; }
#material-body { min-height: 120px; }
.article { line-height: 1.45; }
.article p { margin: 0 0 1em; }
.article h3 { margin: 1.15em 0 0.45em; font-size: 13px; line-height: 1.45; }
.article strong { font-weight: 700; }
button.cover-btn {
  display: block;
  width: 100%;
  margin-top: 8px;
  min-height: 44px;
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--amber);
}
.cover-note { margin: 8px 0 0; white-space: pre-wrap; }
#cover-prompt { z-index: 50; }
#trouble { z-index: 60; }
.trouble-card { width: min(520px, 100%); }
.trouble-card h2 { margin: 0 0 8px; font-size: 13px; font-weight: 700; line-height: 1.45; }
.trouble-card p { margin: 0 0 10px; }
#trouble-title { font-weight: 700; }
#trouble-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
#trouble-actions button { width: auto; min-height: 44px; margin: 0; }
.prompt-card { margin-top: 12px; }
.prompt-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.prompt-card-head b { font-size: 13px; }
.prompt-card-head span { display: flex; gap: 6px; flex: 0 0 auto; }
.prompt-card-head button {
  width: auto;
  min-height: 28px;
  margin: 0;
  padding: 2px 8px;
  font-size: 12px;
}
.prompt-label { margin: 12px 0 6px; color: var(--muted); }
.prompt-text {
  white-space: pre-wrap;
  background: #120e0b;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  line-height: 1.5;
  user-select: text;
}
.quality {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 10px 0;
}
.quality div {
  background: #1c1713;
  border-radius: 8px;
  padding: 8px;
}
.quality span { display: block; color: var(--muted); font-size: 12px; }
.quality b { display: block; font-size: 13px; margin-top: 2px; }
.zenguru {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  margin: 8px 0 14px;
}
.zenguru a { color: #e2a15a; }
.guru-links { margin-bottom: 0; }
button.copy-text {
  display: block;
  width: 100%;
  margin: 10px 0 0;
  min-height: 44px;
}
.badge { font-size: 12px; border: 1px solid var(--line); border-radius: 999px; padding: 2px 8px; }
table { width: 100%; border-collapse: collapse; }
td, th { border-bottom: 1px solid var(--line); text-align: left; padding: 8px; vertical-align: top; }
#research-box { margin-top: 8px; }
#research-text { min-height: 640px; }
#research-count { margin: 4px 0 8px; font-variant-numeric: tabular-nums; }
#research-count.full { color: #e2a15a; }
.pillar-mark { margin: 0 0 8px; }
.pillar-mark.over { color: #e2a15a; }
.pillar-mark.empty { color: #d7c4a3; }
.pillar-mark.ok { color: #6fbf8a; }
.pillar-mark.behind { color: #f4e2a8; }

@media (max-width: 900px) {
  body { padding-bottom: calc(140px + env(safe-area-inset-bottom)); font-size: 15px; }
  .top {
    position: sticky;
    top: 0;
    z-index: 15;
    background: var(--bg);
    align-items: center;
    padding: 10px 12px;
  }
  .top h1 { font-size: 18px; }
  .eyebrow { display: none; }
  #who { display: none; }
  .who { gap: 6px; }
  #logout { min-height: 40px; }
  nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 25;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    overflow: visible;
    background: #1b1612;
    border-top: 1px solid var(--line);
    padding: 4px 4px calc(4px + env(safe-area-inset-bottom));
  }
  nav button {
    min-height: 36px;
    border-radius: 8px;
    padding: 4px 2px;
    font-size: 12px;
    line-height: 1.15;
    white-space: normal;
  }
  .metrics {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    overflow: visible;
    gap: 6px;
    padding: 8px 12px;
  }
  .metric { padding: 4px 6px; }
  .metric span { font-size: 10px; }
  .metric b { font-size: 14px; }
  .office-layout, .kanban, .cards { grid-template-columns: 1fr; padding-left: 6px; padding-right: 6px; }
  .map { border-width: 4px; border-radius: 14px; }
  .map-wrap { margin: 0; }
  .modal { padding: 0; align-items: end; }
  .modal-card {
    width: 100%;
    max-height: calc(100% - 128px);
    height: auto;
    border-width: 0;
    border-top: 4px solid #e2a15a;
    border-radius: 16px 16px 0 0;
  }
  .dialog-head { flex-direction: column; align-items: stretch; gap: 6px; }
  .dialog-head h2 { font-size: 13px; }
  .dialog-tools { flex-wrap: nowrap; width: 100%; justify-content: flex-start; }
  .tabs button, #close-material { flex: 0 0 auto; min-height: 28px; }
  .modal-card { padding: 10px; }
  .quality { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
  .quality div { padding: 4px; }
  .quality span { font-size: 10px; }
  .quality b { font-size: 13px; }
  .agent-pop {
    left: 8px !important;
    right: 8px;
    top: auto !important;
    bottom: 136px;
    width: auto;
    max-height: 42vh;
    overflow: auto;
    font-size: 13px;
  }
  .card { min-height: 0; padding: 8px; }
  button { min-height: 30px; }
  .building { padding: 4px 4px 0; }
  .story { min-height: 0; margin-bottom: 6px; border-radius: 8px; }
  .story-head { padding: 4px 8px 0; }
  .story-head b { font-size: 12px; }
  .story-head span { font-size: 10px; }
  .building-phone .iso-line { min-height: 0; padding: 4px 1px 0; }
  .seat { min-height: 0; width: auto; max-width: none; padding-bottom: 0; }
  .seat-name { font-size: 10px; }
  .iso-lobby { display: none; }
  .iso-floor { padding: 0 2px 6px; }
  .agent-pop { bottom: 96px; font-size: 13px; max-height: 38vh; }
  #topic-form > button, .login-card > button { width: 100%; margin-top: 8px; }
  .live-strip { padding: 0 12px 8px; }
  .live-row { flex-basis: 100%; width: 100%; margin-top: 0; }
  .card-actions button, .dialog-tools button, .tabs button, .shelf-bar button, .metric, .live-row {
    min-height: 28px;
    margin-top: 0;
    padding: 2px 8px;
    font-size: 12px;
  }
  button.voice-btn { width: 60.8px; height: 60.8px; min-width: 60.8px; min-height: 60.8px; margin-top: 0; font-size: 13px; }
  .card-actions button, .dialog-tools button, .tabs button, .shelf-bar button, .metric {
    width: auto;
  }
  .live-row { padding: 6px 10px; font-size: 13px; }
  td button { width: auto; display: inline-block; margin: 2px 4px 0 0; min-height: 28px; padding: 2px 8px; font-size: 12px; }
  .modal-card,
  .modal-card h2,
  .modal-card h3,
  .modal-card p,
  .modal-card li,
  .modal-card button,
  .modal-card .quality span,
  .modal-card .quality b,
  .agent-pop,
  .agent-pop button {
    font-size: 13px;
  }
  table, thead, tbody, tr, td, th { display: block; }
  thead { display: none; }
  tr { padding: 8px 0; }
  td { border: 0; padding: 4px 0; }
}
