:root {
  --brand: #00aeef;
  --brand-hover: #1294c4;
  --text: #0f172a;
  --muted: #5b6472;
  --card-bg: #ffffff;
  --page-bg: #f4f8fb;
  --border: #dbe5ee;
  --shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  font-family: Google Sans, Noto, Roboto, Helvetica Neue, Arial, sans-serif;
  background: var(--page-bg);
  color: var(--text);
}

.page {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 16px 16px 40px;
}

.topbar {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  margin-bottom: 16px;
}

.card,
.return-panel,
.troubleshooting {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card-copy {
  padding: 24px 24px 8px;
  text-align: center;
}

.card-copy h1 {
  margin: 0 0 8px;
  font-size: 32px;
  line-height: 1.15;
  color: var(--text);
}

.subtitle {
  margin: 0;
  font-size: 16px;
  line-height: 1.5;
  color: var(--muted);
}

.viewer-wrap {
  padding: 8px 16px 0;
}

model-viewer {
  display: block;
  width: 100%;
  height: 58vh;
  min-height: 360px;
  max-height: 620px;
  background: #ffffff;
  border-radius: 16px;
  --poster-color: transparent;
}

.actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 20px 24px 24px;
}

.primary-button {
  appearance: none;
  border: none;
  border-radius: 999px;
  background: var(--brand);
  color: #ffffff;
  font: inherit;
  font-size: 18px;
  font-weight: 600;
  line-height: 1;
  padding: 16px 28px;
  cursor: pointer;
  min-width: 220px;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.primary-button:hover {
  background: var(--brand-hover);
}

.primary-button:active {
  transform: translateY(1px);
}

.text-link-button {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--brand);
  padding: 0;
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
}

.text-link-button:hover {
  text-decoration: underline;
}

.secondary-link {
  color: var(--brand);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
}

.secondary-link:hover {
  text-decoration: underline;
}

.primary-button:focus-visible,
.text-link-button:focus-visible,
.secondary-link:focus-visible,
.troubleshooting a:focus-visible {
  outline: 3px solid rgba(0, 174, 239, 0.3);
  outline-offset: 3px;
}

.helper-copy {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
  text-align: center;
  max-width: 420px;
}

.return-panel {
  margin-top: 0;
  padding: 32px 24px;
  text-align: center;
}

.return-panel h2 {
  margin: 0 0 12px;
  font-size: 28px;
  line-height: 1.2;
  color: var(--text);
}

.return-panel p {
  margin: 0 0 18px;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
}

.small-note {
  margin-top: 14px;
  font-size: 14px !important;
  color: var(--muted) !important;
}

.troubleshooting {
  margin-top: 18px;
  padding: 20px;
}

.troubleshooting h2 {
  margin: 0 0 12px;
  font-size: 22px;
  line-height: 1.2;
  color: var(--text);
  text-align: center;
}

.troubleshooting p {
  margin: 0 0 12px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  text-align: center;
}

.troubleshooting p:last-child {
  margin-bottom: 0;
}

.troubleshooting a {
  color: var(--brand);
  text-decoration: underline;
}

.progress-bar {
  display: block;
  width: 40%;
  max-width: 220px;
  height: 10px;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate3d(-50%, -50%, 0);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.9);
  background-color: rgba(15, 23, 42, 0.18);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.15);
}

.progress-bar.hide {
  visibility: hidden;
}

.update-bar {
  width: 0%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.95);
  transition: width 0.3s;
}

.hidden {
  display: none !important;
}

@media (max-width: 640px) {
  .page {
    padding: 12px 12px 32px;
  }

  .card-copy {
    padding: 20px 18px 8px;
  }

  .card-copy h1 {
    font-size: 28px;
  }

  .subtitle {
    font-size: 15px;
  }

  .viewer-wrap {
    padding: 8px 12px 0;
  }

  model-viewer {
    height: 50vh;
    min-height: 300px;
  }

  .actions {
    padding: 18px 16px 20px;
  }

  .primary-button {
    width: 100%;
    max-width: 320px;
  }

  .progress-bar {
    width: 55%;
  }

  .return-panel {
    padding: 28px 18px;
  }

  .return-panel h2 {
    font-size: 24px;
  }
}