[data-hawk-three-viewer] {
  position: relative;
  width: 100%;
  min-height: clamp(430px, 52vw, 700px);
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(circle at 72% 20%, rgba(0, 138, 174, 0.16), transparent 42%),
    linear-gradient(145deg, #f7fafb 0%, #e8eef1 100%);
  cursor: grab;
}

[data-hawk-three-viewer]:active { cursor: grabbing; }
[data-hawk-three-viewer] canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  outline: none;
}

[data-hawk-three-viewer] canvas:focus-visible {
  box-shadow: inset 0 0 0 3px #78be20;
}

.hawk-three-status {
  position: absolute;
  z-index: 3;
  inset: 50% auto auto 50%;
  display: grid;
  gap: 0.4rem;
  width: min(80%, 320px);
  color: #06364a;
  text-align: center;
  transform: translate(-50%, -50%);
  transition: opacity 300ms ease, transform 300ms ease;
}

.hawk-three-status strong { font-size: 16px; }
.hawk-three-status span { font-size: 14px; opacity: 0.72; }
.hawk-three-status.is-complete { opacity: 0; transform: translate(-50%, -46%); }
.hawk-three-status.has-error { color: #8a2630; }

.hawk-three-progress {
  position: absolute;
  z-index: 4;
  right: 12%;
  bottom: 42%;
  left: 12%;
  height: 2px;
  overflow: hidden;
  background: rgba(6, 54, 74, 0.12);
}

.hawk-three-progress::after {
  position: absolute;
  inset: 0;
  width: var(--progress);
  background: #78be20;
  content: '';
  transition: width 180ms ease;
}

.hawk-three-toolbar {
  position: absolute;
  z-index: 5;
  right: 18px;
  bottom: 18px;
  display: flex;
  gap: 8px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 240ms ease, transform 240ms ease;
}

.is-ready .hawk-three-toolbar { opacity: 1; transform: none; }
.hawk-three-key {
  position: absolute;
  z-index: 5;
  top: auto;
  bottom: 18px;
  left: 18px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 240ms ease, transform 240ms ease;
}

.is-ready .hawk-three-key { opacity: 1; transform: none; }
.hawk-three-key span {
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 2px;
  color: rgba(255, 255, 255, 0.82);
  background: rgba(6, 54, 74, 0.86);
  backdrop-filter: blur(10px);
  font-size: 12px;
  line-height: 1.2;
  white-space: nowrap;
}

.hawk-three-key b { color: #fff; font-weight: 700; }
.hawk-three-key-touch { display: none; }
.hawk-three-toolbar button {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 2px;
  color: #fff;
  background: rgba(6, 54, 74, 0.88);
  backdrop-filter: blur(10px);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 180ms ease, transform 180ms ease;
}

.hawk-three-toolbar button:hover { background: #087da0; transform: translateY(-1px); }
.hawk-three-toolbar button:focus-visible { outline: 3px solid #78be20; outline-offset: 2px; }

@media (max-width: 767px) {
  [data-hawk-three-viewer] { min-height: 440px; }
  .hawk-three-toolbar { right: 12px; bottom: 12px; left: 12px; justify-content: flex-end; }
  .hawk-three-toolbar button { padding-inline: 11px; }
  .hawk-three-key {
    top: 12px;
    right: 12px;
    bottom: auto;
    left: 12px;
    justify-content: center;
    align-items: center;
    flex-direction: row;
    flex-wrap: wrap;
  }
  .hawk-three-key-desktop { display: none; }
  .hawk-three-key-touch { display: inline-flex; }
}

@media (prefers-reduced-motion: reduce) {
  .hawk-three-status,
  .hawk-three-progress::after,
  .hawk-three-key,
  .hawk-three-toolbar,
  .hawk-three-toolbar button { transition: none; }
}
