html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #181818;
  color: #fff;
  min-height: 100vh;
  min-height: 100dvh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
}
.viewer-title {
  text-align: center;
  margin: 0.22rem 0 0.06rem 0;
  font-size: 1.45rem;
  line-height: 1.15;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #fff;
}
.viewer-subtitle {
  margin: 0 auto 0.12rem auto;
  width: min(1000px, 92vw);
  text-align: center;
  color: #cfd8e3;
  font-size: 0.76rem;
  line-height: 1.35;
}
.viewer-subtitle a {
  color: #8ab4f8;
}
.status {
  margin: 0 auto 0.08rem auto;
  width: min(1000px, 92vw);
  color: #f3dba2;
  text-align: center;
  min-height: 0.65rem;
  font-size: 0.68rem;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.status.visible {
  opacity: 1;
}
#openseadragon1 {
  margin: 0 auto;
  width: 100%;
  height: 100%;
  background: #181818;
  border: 1px solid #333;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}
.viewer-shell {
  position: relative;
  width: 100%;
  flex: 1;
  min-height: 0;
}
.openseadragon-container {
  background: #181818 !important;
}
.viewer-controls {
  position: absolute;
  top: max(8px, calc(env(safe-area-inset-top) + 8px));
  left: 8px;
  z-index: 40;
  display: grid;
  grid-auto-flow: row;
  gap: 8px;
  padding: 6px;
  border-radius: 10px;
  border: 1px solid #2f3a4d;
  background: rgba(18, 22, 30, 0.9);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}
.viewer-btn {
  width: 26px;
  height: 26px;
  border-radius: 4px;
  border: 1px solid #43516a;
  background: linear-gradient(180deg, #35507b 0%, #24354f 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 0.12s ease, filter 0.12s ease, box-shadow 0.12s ease;
}
.viewer-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.12);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}
.viewer-btn:active {
  transform: translateY(0);
  filter: brightness(0.95);
}
.viewer-btn svg {
  width: 20px;
  height: 20px;
}
.viewer-btn svg path,
.viewer-btn svg circle {
  stroke: #f6fbff;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}
#control-home svg path:first-of-type {
  fill: #f6fbff;
  stroke: none;
}
#control-home svg rect {
  fill: #24354f;
}

@media (max-width: 768px) {
  .viewer-title {
    font-size: 1.2rem;
    margin-top: 0.16rem;
    margin-bottom: 0.02rem;
  }
  .viewer-subtitle {
    font-size: 0.7rem;
    margin-bottom: 0.08rem;
  }
  .status {
    margin-bottom: 0.06rem;
    font-size: 0.64rem;
  }
  .viewer-controls {
    top: max(10px, calc(env(safe-area-inset-top) + 10px));
  }
  .viewer-btn {
    width: 28px !important;
    height: 28px !important;
  }
}

.viewer-footer {
  text-align: center;
  padding: 0.3rem 0 0.4rem 0;
  font-size: 0.72rem;
  color: #888;
  flex-shrink: 0;
}
.viewer-footer a {
  color: #8ab4f8;
  text-decoration: none;
  margin: 0 0.5rem;
}
.viewer-footer a:hover {
  text-decoration: underline;
}
