
@keyframes beat {
  0% { box-shadow: 0 0 0 0 rgb(15 118 110 / 0.45); }
  70% { box-shadow: 0 0 0 7px rgb(15 118 110 / 0); }
  100% { box-shadow: 0 0 0 0 rgb(15 118 110 / 0); }
}
@keyframes ring {
  0% { opacity: 0; transform: scale(0.86); }
  22% { opacity: 0.5; }
  100% { opacity: 0; transform: scale(1.2); }
}
@keyframes viewin {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.c-apphead {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: var(--space-md);
  padding: var(--space-3xs) 2px 0;
}

.c-apphead[hidden],
.c-bar[hidden] {
  display: none;
}

.c-bar {
  align-items: center;
  backdrop-filter: blur(var(--blur-glass));
  -webkit-backdrop-filter: blur(var(--blur-glass));
  background: var(--color-surface-glass);
  border-radius: var(--radius-md);
  display: flex;
  gap: var(--space-xs);
  justify-content: space-between;
  padding: 10px 12px;
}

.c-bar__id {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

.c-bar__name {
  font-size: var(--text-md);
  font-weight: 700;
  line-height: 1.2;
  max-width: 56vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.c-bar__exam {
  color: var(--color-ink-soft);
  font-size: var(--text-xs);
  margin-left: 1px;
  margin-top: var(--space-4xs);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.c-apphead__history {
  align-items: center;
  background: transparent;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-card);
  color: var(--color-primary-dark);
  cursor: pointer;
  display: none;
  flex: none;
  gap: 5px;
  margin-right: 8px;
  padding: 6px 12px;
}

.c-apphead__history.is-visible {
  display: inline-flex;
}

.c-apphead__history:active {
  transform: scale(0.94);
}

.c-apphead__history-label {
  font-size: var(--text-xs);
  font-weight: 700;
}

.c-status {
  align-items: center;
  background: var(--color-primary-soft);
  border-radius: var(--radius-pill);
  color: var(--color-primary-dark);
  display: inline-flex;
  flex: none;
  font-size: var(--text-xs);
  font-weight: 700;
  gap: 6px;
  padding: 6px 11px;
}

.c-status--ended {
  background: var(--color-neutral-soft);
  color: var(--color-ink-soft);
}

.c-status__dot {
  animation: beat 1.8s infinite;
  background: var(--color-primary);
  border-radius: var(--radius-pill);
  height: 7px;
  width: 7px;
}

.c-gate {
  gap: var(--space-sm);
  padding: var(--space-md);
  text-align: center;
}

.c-gate__logo {
  background: var(--color-pulse);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-soft);
  height: 62px;
  margin-bottom: var(--space-3xs);
  position: relative;
  width: 62px;
}

.c-gate__logo::after {
  animation: ring 2.2s infinite;
  border: 2px solid var(--color-pulse);
  border-radius: var(--radius-pill);
  content: '';
  inset: -8px;
  opacity: 0.4;
  position: absolute;
}

.c-gate__title {
  font-size: var(--text-2xl);
  letter-spacing: -0.02em;
  margin: 0;
}

.c-gate__text {
  color: var(--color-ink-soft);
  margin: 0;
  max-width: 300px;
}

.c-gate__code {
  border: 1.6px solid var(--color-line);
  border-radius: var(--radius-md);
  font-size: var(--text-display);
  font-weight: 700;
  letter-spacing: 0.3em;
  max-width: 280px;
  padding: var(--space-sm);
  text-align: center;
  text-indent: 0.3em;
  width: 100%;
}

.c-gate__code:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px var(--color-primary-soft);
  outline: none;
}

.c-gate__error {
  color: var(--color-pulse);
  font-size: var(--text-sm);
  font-weight: 600;
  min-height: 18px;
}

.c-blocked.is-active {
  background: var(--color-bg);
  display: block;
  inset: 0;
  overflow-y: auto;
  position: fixed;
}

.c-blocked__body {
  align-items: center;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  padding-top: var(--space-2xl);
  text-align: center;
}

.c-blocked__icon {
  align-items: center;
  background: var(--color-primary-soft);
  border-radius: var(--radius-pill);
  color: var(--color-primary-dark);
  display: flex;
  height: 64px;
  justify-content: center;
  margin-bottom: var(--space-2xs);
  width: 64px;
}

.c-blocked__title {
  font-size: var(--text-2xl);
  letter-spacing: -0.02em;
  margin: 0;
}

.c-blocked__text {
  color: var(--color-ink-soft);
  line-height: 1.5;
  margin: 0;
  max-width: 340px;
}

.c-blocked__link {
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-sm);
  color: var(--color-primary-dark);
  display: inline-block;
  font-size: var(--text-base);
  margin-top: var(--space-2xs);
  padding: 12px 18px;
  text-decoration: none;
}

.c-blocked__link:hover {
  border-color: var(--color-primary);
}

.c-blocked__copy {
  background: var(--color-primary);
  border: none;
  border-radius: var(--radius-sm);
  color: var(--color-on-accent);
  cursor: pointer;
  font-size: var(--text-base);
  font-weight: 600;
  padding: 12px 20px;
  transition: var(--ease-press);
}

.c-blocked__copy:active {
  transform: scale(0.97);
}

.c-hero__label {
  font-size: var(--text-lg);
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: var(--space-2xl);
  text-align: center;
}

.c-hero__ring {
  align-items: center;
  display: flex;
  justify-content: center;
  position: relative;
}

.c-hero__pulse {
  border: 2px solid var(--color-pulse);
  border-radius: var(--radius-pill);
  inset: -12px;
  opacity: 0;
  position: absolute;
}

.c-hero__pulse--a {
  animation: ring 2.4s infinite;
}

.c-hero__pulse--b {
  animation: ring 2.4s infinite 0.8s;
}

.c-hero__pulse--c {
  animation: ring 2.4s infinite 1.6s;
}

.c-hero__button {
  align-items: center;
  background:
    radial-gradient(ellipse at top, rgb(234 92 84) 0%, rgb(234 92 84 / 0) 58%),
    radial-gradient(ellipse at bottom, rgb(204 62 53) 0%, var(--color-pulse) 82%);
  border: none;
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-hero);
  color: var(--color-on-accent);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  font-size: 27px;
  font-weight: 800;
  gap: 7px;
  height: 228px;
  justify-content: center;
  line-height: 1.15;
  position: relative;
  transition: var(--ease-press);
  width: 228px;
  z-index: 2;
}

.c-hero__button:active {
  transform: scale(0.96);
}

.c-hero__button-sub {
  font-size: 13.5px;
  font-weight: 400;
  opacity: 0.95;
}

.c-hero__bottom {
  align-items: center;
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  margin-top: var(--space-2xl);
}

.c-hero__hint {
  color: var(--color-ink-soft);
  font-size: var(--text-base);
  line-height: 1.45;
  max-width: 300px;
  text-align: center;
}

.c-stamp {
  background: linear-gradient(180deg, rgb(255 255 255), rgb(252 254 254));
  border: 1px solid var(--color-line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  margin: var(--space-sm) 0 var(--space-3xs);
  padding: var(--space-md);
  text-align: center;
}

.c-stamp__check {
  align-items: center;
  background: var(--color-primary);
  border-radius: var(--radius-pill);
  box-shadow: 0 6px 16px rgb(15 118 110 / 0.3);
  color: var(--color-on-accent);
  display: flex;
  font-size: var(--text-2xl);
  height: 44px;
  justify-content: center;
  margin: 0 auto var(--space-xs);
  width: 44px;
}

.c-stamp__time {
  font-size: var(--text-time);
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1;
}

.c-stamp__date {
  color: var(--color-ink-soft);
  font-size: 13.5px;
  margin-top: 6px;
}

.c-question {
  font-size: var(--text-md);
  font-weight: 700;
  margin: var(--space-lg) 2px var(--space-xs);
}

.c-question__hint {
  color: var(--color-ink-soft);
  font-weight: 500;
}

.c-question--tight {
  margin-bottom: var(--space-3xs);
}

.c-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.c-chip {
  background: var(--color-surface);
  border: 1.5px solid var(--color-line);
  border-radius: var(--radius-pill);
  color: var(--color-ink);
  cursor: pointer;
  font-size: var(--text-base);
  min-height: 46px;
  padding: var(--space-xs) var(--space-sm);
  transition: var(--ease-press);
}

.c-chip:active {
  transform: scale(0.96);
}

.c-chip.is-selected {
  background: var(--color-pulse-soft);
  border-color: var(--color-pulse);
  color: var(--color-pulse-ink);
  font-weight: 700;
}

.c-field {
  background: var(--color-surface);
  border: 1.5px solid var(--color-line);
  border-radius: var(--radius-sm);
  color: var(--color-ink);
  font-family: inherit;
  font-size: var(--text-md);
  margin-top: var(--space-3xs);
  min-height: 84px;
  padding: var(--space-sm);
  resize: vertical;
  width: 100%;
}

.c-field:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px var(--color-primary-soft);
  outline: none;
}

.c-actionbar {
  background: linear-gradient(180deg, rgb(243 246 245 / 0), var(--color-bg) 30%);
  bottom: 0;
  padding: var(--space-sm) 0 max(var(--space-2xs), env(safe-area-inset-bottom));
  position: sticky;
}

.c-btn {
  background: var(--color-primary);
  border: none;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-btn);
  color: var(--color-on-accent);
  cursor: pointer;
  font-size: var(--text-lg);
  font-weight: 700;
  min-height: 56px;
  padding: 17px;
  transition: var(--ease-press);
  width: 100%;
}

.c-btn:active {
  transform: scale(0.985);
}

.c-btn--narrow {
  max-width: 230px;
}

.c-toast {
  align-items: center;
  background: linear-gradient(180deg, rgb(255 255 255), var(--color-primary-soft));
  border: 1px solid var(--color-primary-soft);
  border-left: 5px solid var(--color-primary);
  border-radius: var(--radius-md);
  box-shadow: 0 18px 44px rgb(15 118 110 / 0.28), 0 2px 8px rgb(19 32 30 / 0.12);
  cursor: grab;
  display: flex;
  gap: var(--space-xs);
  left: 12px;
  margin-inline: auto;
  max-width: 440px;
  opacity: 0;
  padding: 13px 15px;
  position: fixed;
  right: 12px;
  top: max(12px, env(safe-area-inset-top));
  touch-action: none;
  transform: translateY(-160%);
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.4s ease;
  user-select: none;
  z-index: 60;
}

.c-toast[hidden] {
  display: none;
}

.c-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.c-toast.is-dragging {
  cursor: grabbing;
  transition: none;
}

.c-toast__check {
  align-items: center;
  background: var(--color-primary);
  border-radius: var(--radius-pill);
  box-shadow: 0 4px 12px rgb(15 118 110 / 0.3);
  color: var(--color-on-accent);
  display: flex;
  flex: none;
  font-size: var(--text-md);
  font-weight: 700;
  height: 30px;
  justify-content: center;
  width: 30px;
}

.c-toast__body {
  flex: 1 1 0;
  min-width: 0;
}

.c-toast__title {
  font-size: var(--text-base);
  font-weight: 700;
  line-height: 1.2;
}

.c-toast__text {
  color: var(--color-ink-note);
  font-size: var(--text-sm);
  line-height: 1.35;
  margin-top: 1px;
}

.c-history__back {
  background: none;
  border: none;
  color: var(--color-primary);
  cursor: pointer;
  font-size: var(--text-base);
  margin: var(--space-xs) 0 var(--space-lg);
  padding: 0;
}

.c-history__title {
  font-size: var(--text-md);
  font-weight: 700;
  margin: 0 2px var(--space-xs);
}

.c-history__list {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.c-history__item {
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-sm);
  padding: var(--space-sm);
}

.c-history__time {
  font-size: var(--text-xl);
  font-weight: 700;
}

.c-history__date {
  color: var(--color-ink-soft);
  font-size: var(--text-sm);
  font-weight: 400;
  margin-left: 6px;
}

.c-history__symptoms {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: var(--space-2xs);
}

.c-history__symptom {
  background: var(--color-pulse-soft);
  border-radius: var(--radius-pill);
  color: var(--color-pulse-ink);
  font-size: var(--text-sm);
  font-weight: 600;
  padding: 4px 10px;
}

.c-history__note {
  color: var(--color-ink-note);
  font-size: var(--text-base);
  margin-top: var(--space-2xs);
}

.c-history__empty {
  color: var(--color-ink-soft);
  padding: 26px;
  text-align: center;
}

html.is-embedded .c-bar,
html.is-embedded .c-apphead__history.is-visible {
  display: none;
}

html.is-embedded .c-apphead {
  margin-top: var(--space-lg);
}

html.is-embedded .c-hero__button {
  font-size: 24px;
  height: 200px;
  width: 200px;
}

html.is-embedded .c-hero__button-sub {
  font-size: 12.5px;
}

html.is-embedded .c-hero__hint {
  font-size: 13px;
}
