html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  width: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f7f7f7;
  color: #222;
  overflow: hidden; /* スクロールバーを消して画面にフィットさせる */
}
#app {
  display: grid;
  grid-template-rows: auto auto auto 1fr; /* ヘッダー・操作系・地図の配分 */
  height: 100vh; /* 画面全体の高さ */
  height: 100dvh;
  width: 100%;
}
.top {
  padding: 16px 20px 10px;
  background: white;
  border-bottom: 1px solid #e6e6e6;
}
.top h1 {
  margin: 0 0 6px;
  font-size: 20px;
}
.top p {
  margin: 0;
  color: #666;
  font-size: 12px;
  line-height: 1.5;
}
.controls {
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
  padding: 10px 20px;
  background: white;
  border-bottom: 1px solid #e6e6e6;
}
.legend {
  display: flex;
  align-items: center;
  gap: 8px;
}
.gradient {
  width: 200px;
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    #2166ac 0%,
    #ffffff 50%,
    #b2182b 100%
  );
  border: 1px solid #d0d0d0;
}
.small {
  font-size: 11px;
  color: #666;
}
.status {
  padding: 6px 20px;
  background: #f9fafb;
  border-bottom: 1px solid #e6e6e6;
  font-size: 11px;
  color: #374151;
  display: none;
}
#map {
  height: 100%;
  width: 100%;
  min-height: 0; /* Grid内での縮小を許可 */
}
.info {
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.15);
  border-radius: 8px;
  line-height: 1.4;
  min-width: 220px;
}
.info h4 {
  margin: 0 0 6px;
  font-size: 13px;
}
.info .name {
  font-weight: 700;
  font-size: 14px;
}
.credit {
  background: rgba(255, 255, 255, 0.9);
  padding: 4px 8px;
  font-size: 10px;
  border-radius: 4px;
}
.leaflet-container {
  background: #eef5fb;
}
.share-actions {
  position: fixed;
  top: 50%;
  right: 20px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transform: translateY(-50%);
}
.share-button {
  position: relative;
  display: inline-flex;
  flex: 0 0 32px;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid #e5e7eb;
  background: #fff;
  box-sizing: border-box;
  color: #1c1b1f;
  text-decoration: none;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.16);
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    opacity 160ms ease;
}
.share-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.2);
}
.share-button:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.35);
  outline-offset: 3px;
}
.share-button svg {
  width: 20px;
  height: 20px;
}
.share-button .copied-icon {
  display: none;
}
.share-button.is-copied .copy-icon {
  display: none;
}
.share-button.is-copied .copied-icon {
  display: block;
}
.share-button--x {
  order: 1;
  color: #111;
}
.share-button--facebook {
  order: 2;
  color: #1877f2;
}
.share-button--copy {
  order: 3;
  color: #1c1b1f;
}
.share-button--copy.is-copied {
  color: #16a34a;
}
@media (max-width: 767px) {
  .share-actions {
    display: none;
  }
}
.teacher-cta {
  position: fixed;
  right: 20px;
  bottom: 32px;
  z-index: 1000;
  width: 144px;
  height: 144px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #52b33b;
  box-sizing: border-box;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.24);
  cursor: pointer;
  overflow: hidden;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    opacity 160ms ease;
}
.teacher-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.3);
}
.teacher-cta:focus-visible {
  outline: 3px solid rgba(250, 204, 21, 0.65);
  outline-offset: 4px;
}
.teacher-cta__photo {
  width: 100%;
  height: 100%;
}
@media (max-width: 767px) {
  .teacher-cta {
    display: none;
  }
}
.teacher-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition:
    opacity 220ms ease,
    visibility 0s linear 220ms;
}
.teacher-modal.is-open {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
  transition: opacity 220ms ease;
}
.teacher-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  opacity: 0;
  transition: opacity 220ms ease;
}
.teacher-modal.is-open .teacher-modal__backdrop {
  opacity: 1;
}
.teacher-modal__panel {
  position: relative;
  z-index: 1;
  width: min(560px, 100%);
  max-height: calc(100vh - 48px);
  border-radius: 16px;
  background: #fff;
  overflow: hidden auto;
  opacity: 0;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.32);
  transform: translateY(12px) scale(0.98);
  transition:
    opacity 220ms ease,
    transform 240ms cubic-bezier(0.22, 1, 0.36, 1);
}
.teacher-modal.is-open .teacher-modal__panel {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.teacher-modal__hero {
  position: relative;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  grid-template-areas:
    "teacher body"
    "teacher follow";
  column-gap: 20px;
  row-gap: 16px;
  align-items: start;
  padding: 32px 32px 0;
  background: #1e9c33;
  color: #fff;
  text-align: center;
  overflow: hidden;
}
.teacher-modal__teacher {
  grid-area: teacher;
  align-self: end;
  width: 220px;
  height: 242px;
  object-fit: contain;
  flex: 0 0 auto;
}
.teacher-modal__hero-body {
  grid-area: body;
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: center;
  align-self: end;
}
.teacher-modal__label {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
}
.teacher-modal__title {
  margin: 0 0 8px;
  font-size: 24px;
  font-weight: 700;
  line-height: 32px;
}
.teacher-modal__lead {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
}
.teacher-modal__lead-break {
  display: none;
}
.teacher-modal__follow {
  grid-area: follow;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  z-index: 1;
  align-self: start;
  width: 100%;
  height: 56px;
  border-radius: 14px;
  background: #000;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  line-height: 24px;
  text-decoration: none;
  transition: background-color 160ms ease;
}
.teacher-modal__follow:hover {
  background: #1f2937;
}
.teacher-modal__follow svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}
.teacher-modal__body {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 24px;
}
.teacher-modal__share-title {
  margin: 0 0 12px;
  color: #364153;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
}
.teacher-modal__share-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.teacher-modal__share-button {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border: 1px solid #dadfe5;
  border-radius: 12px;
  background: #fff;
  box-sizing: border-box;
  color: #101828;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 160ms ease;
}
.teacher-modal__share-button:hover {
  background: #f3f4f6;
}
.teacher-modal__share-button svg {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
}
.teacher-modal__share-label {
  margin-left: 6px;
  white-space: nowrap;
}
.teacher-modal__share-button .copied-icon {
  display: none;
}
.teacher-modal__share-button.is-copied .copy-icon {
  display: none;
}
.teacher-modal__share-button.is-copied .copied-icon {
  display: block;
}
.teacher-modal__share-button--facebook {
  color: #1877f2;
}
.teacher-modal__share-button--copy.is-copied {
  color: #16a34a;
}
.teacher-modal__info {
  display: flex;
  flex-direction: column;
  border-radius: 14px;
  background: #f9fafb;
  overflow: hidden;
}
.teacher-modal__info-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px;
  color: #101828;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
  cursor: pointer;
  list-style: none;
}
.teacher-modal__info-summary::-webkit-details-marker {
  display: none;
}
.teacher-modal__info-summary::after {
  width: 8px;
  height: 8px;
  border-right: 2px solid #4a5565;
  border-bottom: 2px solid #4a5565;
  content: "";
  transform: rotate(45deg);
  transition: transform 160ms ease;
}
.teacher-modal__info[open] .teacher-modal__info-summary::after {
  transform: rotate(225deg);
}
.teacher-modal__info-content {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow: hidden;
  padding: 0 20px 20px;
  transition:
    height 240ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 180ms ease;
}
.teacher-modal__info-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.teacher-modal__info-title {
  margin: 0;
  color: #101828;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
}
.teacher-modal__info-text {
  margin: 0;
  color: #4a5565;
  font-size: 12px;
  line-height: 1.5;
}
.teacher-modal__consortium {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  border: 1px solid #dadfe5;
  border-radius: 12px;
  background: #fff;
  text-decoration: none;
  transition: background-color 160ms ease;
}
.teacher-modal__consortium:hover {
  background: #f3f4f6;
}
.teacher-modal__consortium img {
  width: 200px;
  object-fit: contain;
}
.teacher-modal__close {
  position: absolute;
  top: 8px;
  right: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #fff;
  cursor: pointer;
}
.teacher-modal__close:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.35);
  outline-offset: 3px;
}
.teacher-modal__close svg {
  width: 24px;
  height: 24px;
}
@media (prefers-reduced-motion: reduce) {
  .teacher-modal,
  .teacher-modal__backdrop,
  .teacher-modal__panel,
  .teacher-modal__info-content,
  .teacher-modal__info-summary::after {
    transition: none;
  }
}
@media (max-width: 767px) {
  .top {
    padding: 12px 12px 8px;
  }
  .top h1 {
    font-size: 17px;
    line-height: 1.35;
  }
  .top p {
    font-size: 11px;
  }
  .controls {
    gap: 8px;
    padding: 8px 12px;
  }
  .legend {
    gap: 6px;
  }
  .gradient {
    width: min(150px, 38vw);
  }
  .share-actions {
    top: auto;
    right: auto;
    bottom: 16px;
    left: 12px;
    display: flex;
    flex-direction: row;
    transform: none;
  }
  .teacher-cta {
    right: 12px;
    bottom: 16px;
    display: block;
    width: 96px;
    height: 96px;
  }
  .teacher-modal {
    align-items: center;
    padding: 16px;
  }
  .teacher-modal__panel {
    width: min(420px, calc(100vw - 32px));
    max-height: calc(100dvh - 32px);
    border-radius: 16px;
  }
  .teacher-modal__hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 42px 16px 24px;
  }
  .teacher-modal__teacher {
    align-self: center;
    width: min(280px, 86%);
    height: auto;
  }
  .teacher-modal__hero-body {
    width: 100%;
    padding-top: 0;
  }
  .teacher-modal__title {
    margin-bottom: 8px;
    font-size: 26px;
    line-height: 1.35;
  }
  .teacher-modal__lead {
    font-size: 14px;
  }
  .teacher-modal__lead-break {
    display: block;
  }
  .teacher-modal__follow {
    max-width: 496px;
    height: 52px;
    margin-top: -28px;
    border-radius: 12px;
    font-size: 16px;
  }
  .teacher-modal__body {
    gap: 16px;
    padding: 16px;
  }
  .teacher-modal__share-list {
    gap: 8px;
  }
  .teacher-modal__share-button {
    height: 44px;
    padding: 0 10px;
  }
  .teacher-modal__share-label {
    display: none;
  }
  .teacher-modal__info-summary {
    padding: 16px;
  }
  .teacher-modal__info-content {
    gap: 16px;
    padding: 0 16px 16px;
  }
  .teacher-modal__consortium img {
    width: min(200px, 72vw);
  }
}
@media (max-width: 374px) {
  .teacher-modal__hero {
    gap: 10px;
    padding: 40px 14px 22px;
  }
  .teacher-modal__teacher {
    width: min(230px, 84%);
  }
  .teacher-modal__hero-body {
    width: 100%;
  }
  .teacher-modal__title {
    font-size: 22px;
  }
  .teacher-modal__lead {
    font-size: 12px;
  }
  .teacher-modal__follow {
    height: 48px;
    gap: 6px;
    margin-top: -24px;
    font-size: 14px;
  }
  .teacher-modal__follow svg {
    width: 16px;
    height: 16px;
  }
  .teacher-modal__share-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .teacher-modal__share-button {
    height: 40px;
    padding: 0 8px;
  }
  .teacher-modal__share-button svg {
    width: 18px;
    height: 18px;
  }
}
