:root {
  color-scheme: dark;
  --panel: rgba(20, 23, 25, 0.82);
  --panel-border: rgba(255, 255, 255, 0.14);
  --text: #f4f2ed;
  --muted: #bab5a9;
  --accent: #e3b86d;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #141719;
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

.viewer-shell {
  position: fixed;
  inset: 0;
  background: #141719;
}

#viewer {
  display: block;
  width: 100%;
  height: 100%;
  background:
    linear-gradient(180deg, rgba(133, 149, 156, 0.42), rgba(30, 33, 34, 0.92)),
    #22282a;
}

.toolbar {
  position: fixed;
  left: 18px;
  right: 18px;
  bottom: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.toolbar-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  background: var(--panel);
  backdrop-filter: blur(12px);
  pointer-events: auto;
}

button {
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}

button:hover,
button:focus-visible {
  border-color: rgba(227, 184, 109, 0.72);
  outline: none;
}

button.is-active {
  background: rgba(227, 184, 109, 0.22);
  border-color: rgba(227, 184, 109, 0.9);
}

.status {
  position: fixed;
  left: 18px;
  top: 18px;
  max-width: min(520px, calc(100vw - 36px));
  padding: 10px 12px;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  backdrop-filter: blur(12px);
}

@media (max-width: 720px) {
  #viewer {
    height: 80dvh;
  }

  .toolbar {
    left: 12px;
    right: 12px;
    bottom: max(6px, env(safe-area-inset-bottom));
    gap: 5px;
    justify-content: stretch;
  }

  .toolbar-group {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
    padding: 4px;
  }

  button {
    width: 100%;
    min-height: 26px;
    padding: 0 8px;
    font-size: 10.5px;
  }

  .status {
    left: 12px;
    right: 12px;
    top: 12px;
    max-width: none;
    font-size: 12px;
  }
}
