/* Emtera design quick-browser — dark, dense, fast. */
* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0; height: 100%;
  background: #0e1116; color: #dfe6ee;
  font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  overflow: hidden; overscroll-behavior: none;
  -webkit-text-size-adjust: 100%;
}

#hdr {
  position: fixed; top: 0; left: 0; right: 0; height: 44px; z-index: 30;
  display: flex; align-items: center; gap: 14px; padding: 0 12px;
  background: #151a21; border-bottom: 1px solid #232b36;
  padding-top: env(safe-area-inset-top);
  height: calc(44px + env(safe-area-inset-top));
}
#brand { font-weight: 700; letter-spacing: .06em; font-size: 15px; }
#brand span { color: #6aa1d8; font-weight: 400; }
#viewbar { display: flex; align-items: center; gap: 6px; }
#viewbar button {
  background: #1d2530; color: #cfd8e3; border: 1px solid #2c3644;
  border-radius: 6px; width: 34px; height: 30px; font-size: 17px;
  cursor: pointer; touch-action: manipulation;
}
#viewbar button:active { background: #2a3646; }
#vlabel { min-width: 84px; text-align: center; color: #9fb4ca;
  font-variant-numeric: tabular-nums; font-size: 13px; }
#sync { margin-left: auto; font-size: 12px; color: #7f8ea0;
  font-variant-numeric: tabular-nums; white-space: nowrap; }
#sync.ok { color: #74c48e; }
#sync.err { color: #e08a7a; }

#stage {
  position: fixed; left: 0; right: 0; bottom: 0;
  top: calc(44px + env(safe-area-inset-top));
  display: flex;
}
#canvaswrap { position: relative; flex: 1 1 auto; min-width: 0;
  background: #0e1116; }
#cv { position: absolute; inset: 0; width: 100%; height: 100%; }
#hud {
  position: absolute; left: 10px; top: 8px; z-index: 5;
  display: flex; gap: 10px; align-items: baseline;
  background: rgba(14, 17, 22, .72); border-radius: 6px; padding: 3px 10px;
  font-size: 12px; pointer-events: none; max-width: calc(100% - 20px);
}
#posnum { color: #9fd0ff; font-variant-numeric: tabular-nums; }
#posfolder { color: #b6c2d0; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; }

#info {
  flex: 0 0 330px; padding: 12px 14px; border-left: 1px solid #232b36;
  background: #12161d; overflow: hidden; user-select: none;
}
#ifolder { font-weight: 600; font-size: 14px; color: #e8eef5;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-bottom: 8px; }
.igrid { display: grid; grid-template-columns: 76px 1fr; gap: 2px 10px; }
.igrid .k { color: #6d7b8c; font-size: 12px; padding-top: 1px; }
.igrid .v { color: #cdd8e4; font-size: 13px; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
  font-variant-numeric: tabular-nums; }
#chips { margin-top: 10px; min-height: 24px; display: flex; flex-wrap: wrap;
  gap: 5px; }
.chip {
  font-size: 11px; padding: 2px 8px; border-radius: 10px;
  background: #1c2a3a; color: #8fc1ea; border: 1px solid #2b4258;
}
.chip.warn { background: #33241c; color: #e0a184; border-color: #4e352a; }
#sols { margin-top: 10px; display: flex; gap: 14px; }
.sol { font-size: 12px; color: #5b6878; display: flex; align-items: center;
  gap: 6px; }
.sol i { width: 10px; height: 10px; border-radius: 50%; background: #2a323d;
  border: 1px solid #3a4551; display: inline-block; }
.sol.on { color: #cde4d3; }
.sol.on i { background: #46b06a; border-color: #5ecc84;
  box-shadow: 0 0 6px #46b06a66; }
#hint { margin-top: 14px; font-size: 11px; color: #4d5a69; }

#scroller {
  position: absolute; inset: 0; z-index: 20; overflow-y: scroll;
  overflow-x: hidden; -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain; touch-action: pan-y;
  background: transparent; scrollbar-width: thin;
  scrollbar-color: #33404f transparent;
}
#scroller::-webkit-scrollbar { width: 9px; }
#scroller::-webkit-scrollbar-thumb { background: #33404f; border-radius: 5px; }
#scroller::-webkit-scrollbar-track { background: transparent; }
#spacer { width: 1px; }

#toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%);
  z-index: 40; background: #1d2b3d; color: #cfe2f4;
  border: 1px solid #335070; border-radius: 8px; padding: 9px 16px;
  font-size: 13px; cursor: pointer; box-shadow: 0 4px 18px #0009;
  max-width: 90vw;
}

@media (max-width: 880px) {
  #stage { flex-direction: column; }
  #canvaswrap { flex: 0 0 auto; height: min(75vw, 52vh); }
  #info { flex: 1 1 auto; border-left: none; border-top: 1px solid #232b36;
    padding: 10px 12px; }
  #ifolder { font-size: 13px; }
  .igrid { grid-template-columns: 70px 1fr; gap: 1px 8px; }
  .igrid .v { font-size: 12px; }
  #hint { display: none; }
  #brand { display: none; }
}
