/* OFFYCE office floor — DEX widget (ported from munder-difflin docs) */
@font-face { font-family: "VT323"; src: url("fonts/VT323-Regular.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Press Start 2P"; src: url("fonts/PressStart2P-Regular.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Pixelify Sans"; src: url("fonts/PixelifySans[wght].ttf") format("truetype"); font-display: swap; }

  .dex {
    position: relative;
    width: 100%; max-width: 880px; margin-inline: auto;
    background: linear-gradient(160deg, #FFE08A 0%, #FFCA54 45%, #E8A72E 100%);
    border: 3px solid #1A1320;
    border-radius: 14px;
    box-shadow: 0 28px 70px rgba(0,0,0,0.5), inset 0 3px 0 rgba(255,255,255,0.28), inset 0 -4px 0 rgba(0,0,0,0.18);
    padding: 6px 8px 8px;
  }
  html[data-theme="light"] .dex { box-shadow: 0 24px 56px rgba(19,23,34,0.28), inset 0 3px 0 rgba(255,255,255,0.28), inset 0 -4px 0 rgba(0,0,0,0.18); }
  .dex .screw {
    position: absolute; width: 11px; height: 11px; border-radius: 50%;
    background: #B07C1C; border: 2px solid #1A1320;
    box-shadow: inset -1px -1px 0 rgba(0,0,0,0.4);
  }
  .dex .screw::after {
    content: ""; position: absolute; left: 1px; right: 1px; top: 50%;
    border-top: 2px solid rgba(26,19,32,0.75); transform: rotate(45deg);
  }
  .dex .screw.tl { top: 7px; left: 8px; } .dex .screw.tr { top: 7px; right: 8px; }
  .dex .screw.bl { bottom: 7px; left: 8px; } .dex .screw.br { bottom: 7px; right: 8px; }
  .dex-top { display: flex; align-items: center; gap: 9px; padding: 3px 8px 7px; }
  .dex-lens {
    width: 32px; height: 32px; border-radius: 50%; flex: none;
    border: 3px solid #1A1320;
    background: radial-gradient(circle at 32% 28%, #eafaff 0%, #a5e3ff 24%, #38b6e8 52%, #1279b8 80%, #0b5c92 100%);
    box-shadow: 0 0 0 3px #B5851F, 3px 3px 0 rgba(26,19,32,0.9), inset -4px -5px 0 rgba(0,0,0,0.22);
    animation: lensPulse 3.6s ease-in-out infinite;
  }
  @keyframes lensPulse { 50% { filter: brightness(1.18); } }
  .dex-led { width: 12px; height: 12px; border: 2px solid #1A1320; border-radius: 50%; flex: none; box-shadow: inset -1px -2px 0 rgba(0,0,0,0.3); }
  .dex-led.coral { background: #ff6b6b; }
  .dex-led.lemon { background: #4ECDC4; }
  .dex-led.mint  { background: #6BCF7F; animation: blink 1.5s steps(2) infinite; }
  .dex-title {
    flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    font-family: "Press Start 2P", monospace; font-size: clamp(0.42rem, 1.3vw, 0.56rem);
    letter-spacing: 0.08em; color: #FFF8E7; text-shadow: 2px 2px 0 rgba(26,19,32,0.5);
  }
  .dex-enc { flex: none; font-family: "VT323", monospace; font-size: 1.05rem; color: #FFF8E7; text-shadow: 1px 1px 0 rgba(26,19,32,0.6); }
  .dex-body {
    display: grid; grid-template-columns: minmax(0, 1fr) 11px 280px;
    border: 3px solid #1A1320; border-radius: 9px; overflow: hidden;
    background: #241c2c;
  }
  .dex-sim { position: relative; min-width: 0; background: #241c2c; display: flex; flex-direction: column; justify-content: center; }
  .dex-sim canvas { display: block; width: 100%; height: auto; image-rendering: pixelated; cursor: pointer; }
  .dex-sim::before {
    content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 2;
    background:
      linear-gradient(115deg, rgba(255,255,255,0.10) 0%, rgba(255,255,255,0.10) 9%, transparent 9.5%),
      radial-gradient(130% 100% at 50% 42%, transparent 66%, rgba(8,4,16,0.30) 100%);
  }
  .dex-sim::after {
    content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 1;
    background: repeating-linear-gradient(0deg, rgba(0,0,0,0.07) 0 1px, transparent 1px 3px);
  }
  .dex-hint {
    position: absolute; left: 10px; bottom: 8px; pointer-events: none; z-index: 3;
    font-family: "Press Start 2P", monospace; font-size: 0.42rem; letter-spacing: 0.1em;
    color: #FFF8E7; opacity: 0.6; text-shadow: 1px 1px 0 #1A1320;
  }
  .dex-hinge {
    background: linear-gradient(90deg, #B07C1C, #D19A2E 50%, #9A6A12);
    border-left: 2px solid rgba(26,19,32,0.55); border-right: 2px solid rgba(26,19,32,0.55);
    display: flex; flex-direction: column; align-items: center; justify-content: space-evenly;
  }
  .dex-hinge i { width: 5px; height: 5px; border-radius: 50%; background: #6E4B0C; box-shadow: inset -1px -1px 0 rgba(0,0,0,0.5); }
  .dex-ctrl { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 9px 8px 1px; }
  .dpad { position: relative; width: 30px; height: 30px; flex: none; }
  .dpad::before, .dpad::after {
    content: ""; position: absolute; background: #1A1320; border-radius: 3px;
    box-shadow: inset 0 -2px 0 rgba(0,0,0,0.55), inset 0 2px 0 rgba(255,255,255,0.12);
  }
  .dpad::before { left: 10px; top: 0; width: 10px; height: 30px; }
  .dpad::after  { left: 0; top: 10px; width: 30px; height: 10px; }
  .st-btns { display: flex; gap: 8px; flex-wrap: wrap; }
  .st-btn {
    font-family: "Press Start 2P", monospace; font-size: 0.46rem; letter-spacing: 0.06em;
    padding: 9px 11px; cursor: pointer; color: #1A1320;
    background: #FFF8E7; border: 3px solid #1A1320; border-radius: 8px;
    box-shadow: 0 4px 0 rgba(26,19,32,0.9);
  }
  .st-btn:hover { filter: brightness(1.05); }
  .st-btn.on { background: #FF6B6B; transform: translateY(3px); box-shadow: 0 1px 0 rgba(26,19,32,0.9); }
  .dex-read {
    margin-left: auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    font-family: "VT323", monospace; font-size: 1.02rem; color: #B9FFC9;
    background: #1A1320; border: 2px solid rgba(0,0,0,0.6); border-radius: 5px;
    padding: 3px 12px; box-shadow: inset 0 2px 0 rgba(0,0,0,0.5);
  }
  .dex-spk { display: flex; gap: 4px; flex: none; }
  .dex-spk i { width: 4px; height: 22px; background: rgba(26,19,32,0.55); border-radius: 2px; box-shadow: inset 0 2px 0 rgba(0,0,0,0.4); }
  /* employee ID card — cream pixel card inside the device */
  .dex-card { padding: 11px; display: flex; background: #F0EAD2; border-left: 3px solid #1A1320; }
  .idc {
    flex: 1; display: flex; flex-direction: column; gap: 7px;
    background: #FFFDF5; border: 3px solid #1A1320;
    box-shadow: 3px 3px 0 rgba(26,19,32,0.9); padding-bottom: 8px; min-width: 0;
    color: #1A1320;
  }
  .idc-head {
    background: #FFCA54; color: #1A1320;
    border-bottom: 3px solid #1A1320;
    font-family: "Press Start 2P", monospace; font-size: 0.48rem; letter-spacing: 0.08em;
    padding: 7px 10px; display: flex; justify-content: space-between; gap: 8px;
  }
  .idc-photo {
    align-self: center; margin-top: 4px; padding: 4px;
    border: 3px solid #1A1320; box-shadow: 3px 3px 0 rgba(26,19,32,0.9);
    background:
      conic-gradient(#F4E9C7 25%, #FFF8E7 0 50%, #F4E9C7 0 75%, #FFF8E7 0);
    background-size: 16px 16px;
  }
  .idc-photo canvas { display: block; image-rendering: pixelated; width: 72px; height: 112px; }
  .idc-name { font-family: "Pixelify Sans", sans-serif; font-weight: 700; font-size: 1.4rem; line-height: 1; text-align: center; }
  .idc-role { text-align: center; font-family: var(--font-body); font-size: 0.85rem; font-weight: 600; color: #3D2E4A; margin-top: -5px; }
  .idc-rows { padding: 0 12px; display: grid; gap: 4px; }
  .idc-rows .r {
    display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
    border-bottom: 2px dashed #D5C9AE; padding-bottom: 4px;
  }
  .idc-rows dt { font-family: "Press Start 2P", monospace; font-size: 0.42rem; letter-spacing: 0.06em; color: #6B5878; flex: none; }
  .idc-rows dd { font-family: var(--font-body); font-size: 0.85rem; font-weight: 600; text-align: right; min-height: 1.3em; color: #1A1320; }
  .idc-rows dd.on { color: #2F9E6E; }
  .idc-bar {
    height: 12px; margin: 0 12px;
    background: repeating-linear-gradient(90deg,
      #1A1320 0 2px, transparent 2px 5px, #1A1320 5px 6px,
      transparent 6px 11px, #1A1320 11px 14px, transparent 14px 17px);
    opacity: 0.75;
  }
  .idc-tabs { display: flex; gap: 6px; padding: 0 12px; }
  .idc-tabs button {
    flex: 1; min-width: 0; cursor: pointer;
    font-family: "Pixelify Sans", sans-serif; font-weight: 700; font-size: 0.82rem;
    padding: 5px 2px; border: 2px solid #1A1320; color: #1A1320;
    background: #F0EAD2; box-shadow: 2px 2px 0 rgba(26,19,32,0.9);
  }
  .idc-tabs button:hover { transform: translate(-1px,-1px); box-shadow: 3px 3px 0 rgba(26,19,32,0.9); }
  .idc-tabs button.on { background: #FF6B6B; color: #1A1320; }
  @media (max-width: 940px) {
    .dex { padding: 5px 7px 7px; }
    .dex-body { grid-template-columns: minmax(0, 1fr); }
    .dex-hinge { display: none; }
    .dex-card { border-left: 0; border-top: 3px solid #1A1320; }
    .dex-read { flex-basis: 100%; margin-left: 0; text-align: center; }
    .dex-spk { display: none; }
  }

/* OFFYCE additions: clone status row + open terminal */
.idc-open {
  display: block; margin: 4px 12px 0; padding: 7px 0;
  font-family: "Press Start 2P", monospace; font-size: 0.5rem; letter-spacing: 0.06em;
  text-align: center; cursor: pointer; color: #FFF8E7;
  background: #1A1320; border: 3px solid #1A1320; border-radius: 6px;
  box-shadow: 0 3px 0 rgba(26,19,32,0.9);
}
.idc-open:hover { background: #3D2E4A; }
.floor-wrap { position: relative; padding: 10px 6px 6px; background: #241c2c; }
.floor-loading {
  position: absolute; inset: 0; z-index: 5; display: flex; align-items: center; justify-content: center;
  font-family: "VT323", monospace; font-size: 1.4rem; color: #B9FFC9; background: rgba(36,28,44,0.9);
}
.dex .dex-title { font-size: clamp(0.36rem, 1.2vw, 0.5rem); }
.dex { max-width: 1040px; }
.dex-body { grid-template-columns: minmax(0, 1fr) 11px 300px; }
@media (max-width: 940px) {
  .dex-body { grid-template-columns: minmax(0, 1fr); }
  .dex-hinge { display: none; }
  .dex-card { border-left: 0; border-top: 3px solid #1A1320; }
  .dex-read { flex-basis: 100%; margin-left: 0; text-align: center; }
  .dex-spk { display: none; }
}
