html,
body {
  height: 100%;
  margin: 0;
}

/* 起動中（data-booted が付くまで）だけの控えめな読込表示。起動後は製品スタイルへ渡す。 */
html:not([data-booted]),
html:not([data-booted]) body {
  background: #fcfefd;
  color: #202a33;
  font-family:
    Inter,
    'Noto Sans JP',
    'Noto Sans CJK JP',
    -apple-system,
    BlinkMacSystemFont,
    'Hiragino Sans',
    'Hiragino Kaku Gothic ProN',
    'Yu Gothic',
    sans-serif;
  -webkit-font-smoothing: antialiased;
}

#boot-hint {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: #fcfefd;
  box-sizing: border-box;
}

.boot-hint__card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
  opacity: 0;
  animation: boot-fade-in 0.18s ease-out 0.1s forwards;
}

.boot-hint__logo {
  display: block;
  width: 176px;
  height: auto;
  opacity: 0.92;
}

.boot-hint__status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.boot-hint__spinner {
  flex: none;
  width: 15px;
  height: 15px;
  border: 2px solid #dce7e7;
  border-top-color: #0e7c5a;
  border-radius: 50%;
  box-sizing: border-box;
  animation: boot-spin 0.75s linear infinite;
}

.boot-hint__title {
  display: none;
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  color: #202a33;
}

.boot-hint__text {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.5;
  color: #72828d;
}

/* 起動失敗・4秒超過時のみ白カード＋再読み込み導線を即時表示する */
#boot-hint.is-error .boot-hint__card {
  width: min(100%, 400px);
  padding: 24px;
  gap: 12px;
  background: #ffffff;
  border: 1px solid #e5ecee;
  border-radius: 14px;
  box-shadow: 0 13px 34px rgb(24 86 71 / 8%);
  box-sizing: border-box;
  opacity: 1;
  animation: none;
}

#boot-hint.is-error .boot-hint__logo {
  width: 148px;
  margin-bottom: 2px;
}

#boot-hint.is-error .boot-hint__status {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  gap: 8px;
}

#boot-hint.is-error .boot-hint__spinner {
  display: none;
}

#boot-hint.is-error .boot-hint__title {
  display: block;
}

#boot-hint.is-error .boot-hint__text {
  padding: 9px 12px;
  border-radius: 8px;
  border: 1px solid #fecdd3;
  background: #fff1f2;
  color: #be123c;
  font-size: 12px;
  font-weight: 400;
  text-align: center;
  word-break: break-word;
}

.boot-hint__reload {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  margin-top: 2px;
  padding: 0 16px;
  border: none;
  border-radius: 8px;
  background: #0e7c5a;
  color: #ffffff;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.boot-hint__reload:hover {
  background: #0b6549;
}

.boot-hint__reload:focus-visible {
  outline: 2px solid #0e7c5a;
  outline-offset: 2px;
}

#root:not([data-booted]) {
  padding: 24px;
  font-size: 13px;
  line-height: 1.5;
  color: #72828d;
}

@keyframes boot-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes boot-fade-in {
  to {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .boot-hint__card {
    opacity: 1;
    animation: none;
  }

  .boot-hint__spinner {
    animation: none;
  }
}
