html {
  scroll-behavior: smooth;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Noto Sans JP", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

[x-cloak] {
  display: none !important;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-body {
  min-height: 100vh;
  background: #f9fafb;
  color: #1f2937;
}

.app-body.is-login-open,
.app-body.is-modal-open {
  overflow: hidden;
}

.container {
  width: 100%;
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 1rem;
}

.skip-link {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link:focus {
  position: fixed;
  z-index: 50;
  width: auto;
  height: auto;
  margin: 0.75rem;
  padding: 0.5rem 1rem;
  overflow: visible;
  clip: auto;
  border-radius: 0.5rem;
  background: #fff;
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid #e5e7eb;
  background: rgb(255 255 255 / 0.8);
  backdrop-filter: blur(8px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

.brand,
.desktop-nav,
.desktop-actions,
.card-heading,
.section-header,
.news-meta,
.modal-header {
  display: flex;
  align-items: center;
}

.brand {
  gap: 0.5rem;
}

.brand-mark {
  display: inline-flex;
  width: 2rem;
  height: 2rem;
  align-items: center;
  justify-content: center;
  border-radius: 0.75rem;
  background: #111827;
  color: #fff;
  font-weight: 700;
}

.brand-name {
  font-size: 1.125rem;
  font-weight: 700;
}

.desktop-nav {
  display: none;
  gap: 1rem;
}

.nav-link,
.subtle-link {
  color: #4b5563;
  font-size: 0.875rem;
}

.nav-link {
  padding: 0.5rem 0.75rem;
}

.nav-link:hover,
.subtle-link:hover {
  color: #111827;
}

.desktop-actions {
  display: none;
  gap: 0.5rem;
}

.user-greeting {
  margin-right: 0.5rem;
  color: #4b5563;
  font-size: 0.875rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 0.75rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  transition: background-color 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.btn:focus-visible,
.icon-button:focus-visible,
.mobile-toggle:focus-visible,
.form-input:focus {
  outline: none;
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px #9ca3af;
}

.btn-primary {
  background: #4f46e5;
  color: #fff;
}

.btn-primary:hover {
  background: #4338ca;
}

.btn-primary:focus-visible {
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px #818cf8;
}

.btn-secondary {
  border-color: #d1d5db;
  background: #fff;
  color: #1f2937;
}

.btn-secondary:hover {
  background: #f3f4f6;
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

.signup-trigger {
  white-space: nowrap;
}

.btn-large {
  border-radius: 1rem;
  padding: 0.75rem 1.25rem;
  font-weight: 600;
}

.btn-submit {
  width: 100%;
  margin-top: 0.5rem;
  font-weight: 600;
}

.mobile-toggle,
.icon-button {
  border: 0;
  background: transparent;
  color: inherit;
}

.mobile-toggle,
.icon-button {
  padding: 0.5rem;
}

.icon {
  display: block;
  flex-shrink: 0;
}

.icon-menu {
  width: 1.5rem;
  height: 1.5rem;
}

.icon-arrow,
.icon-close {
  width: 1.25rem;
  height: 1.25rem;
}

.icon-arrow {
  width: 1rem;
  height: 1rem;
}

.mobile-menu-panel {
  border-top: 1px solid #e5e7eb;
  background: #fff;
  padding: 0 1rem 0.75rem;
}

.mobile-link {
  display: block;
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 0;
  background: transparent;
  color: #1f2937;
  font-size: 0.875rem;
  text-align: left;
}

.mobile-link + .mobile-link {
  margin-top: 0.25rem;
}

.mobile-link:disabled {
  color: #9ca3af;
  cursor: not-allowed;
}

.hero {
  position: relative;
  overflow: hidden;
}

.hero-inner {
  padding-top: 3rem;
  padding-bottom: 3rem;
}

.hero-grid,
.cards-grid {
  display: grid;
  gap: 2rem;
}

.hero-grid {
  align-items: center;
}

.hero-title {
  margin: 0;
  color: #111827;
  font-size: 1.875rem;
  line-height: 2.25rem;
  font-weight: 800;
}

.hero-copy,
.card-copy,
.news-copy {
  color: #4b5563;
  line-height: 1.625;
}

.hero-copy {
  margin: 1rem 0 0;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.note-text {
  margin: 0.75rem 0 0;
  color: #6b7280;
  font-size: 0.75rem;
}

.hero-media {
  position: relative;
}

.hero-figure {
  aspect-ratio: 16 / 9;
  margin: 0;
  overflow: hidden;
  border: 1px solid #e5e7eb;
  border-radius: 1rem;
  box-shadow: inset 0 2px 4px 0 rgb(0 0 0 / 0.05);
}

.hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-callout {
  position: absolute;
  right: -0.75rem;
  bottom: -0.75rem;
  max-width: calc(100% - 1rem);
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  background: #fff;
  padding: 0.75rem;
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

.callout-title {
  font-size: 0.75rem;
  font-weight: 500;
}

.callout-text {
  color: #6b7280;
  font-size: 0.6875rem;
}

.section {
  border-top: 1px solid #e5e7eb;
  padding: 2.5rem 0;
}

.section-white {
  background: #fff;
}

.section-muted {
  background: #f9fafb;
}

.section-header {
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.section-title {
  margin: 0;
  color: #111827;
  font-size: 1.25rem;
  line-height: 1.75rem;
  font-weight: 700;
}

.services-grid {
  gap: 1.5rem;
}

.service-card,
.mypage-card,
.news-card {
  border: 1px solid #e5e7eb;
  transition: box-shadow 150ms ease;
}

.service-card,
.news-card {
  background: #f9fafb;
}

.service-card,
.mypage-card {
  padding: 1.25rem;
}

.service-card {
  position: relative;
  border-radius: 1rem;
}

.service-card:hover,
.mypage-card:hover {
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

.card-heading {
  justify-content: space-between;
  margin-bottom: 0.75rem;
  gap: 1rem;
}

.card-title,
.news-item-title {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
}

.service-card .card-title {
  font-size: 1rem;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 9999px;
  background: #4338ca;
  color: #fff;
  padding: 0.25rem 0.5rem;
  font-size: 0.625rem;
  line-height: 1;
  white-space: nowrap;
}

.card-copy,
.news-copy {
  margin: 0;
  font-size: 0.875rem;
}

.card-action {
  margin-top: 1rem;
}

.arrow-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
}

.arrow-link:hover,
.text-link:hover {
  text-decoration: underline;
}

.mypage-grid {
  gap: 1.5rem;
}

.mypage-card {
  display: block;
  border-radius: 1rem;
  background: #fff;
}

.mypage-card .card-title,
.mypage-card .card-note {
  display: block;
}

.mypage-card-action {
  width: 100%;
  color: inherit;
  text-align: left;
}

.mypage-card-action:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px #9ca3af;
}

.card-action-text {
  display: inline-flex;
  margin-top: 0.75rem;
  color: #4f46e5;
  font-size: 0.75rem;
  font-weight: 600;
}

.card-note {
  margin-top: 0.25rem;
  color: #6b7280;
  font-size: 0.75rem;
}

.news-title {
  margin-bottom: 1.5rem;
}

.news-list > * + * {
  margin-top: 0.75rem;
}

.news-card {
  border-radius: 0.75rem;
  padding: 1rem;
}

.news-meta {
  gap: 0.5rem;
  color: #6b7280;
  font-size: 0.75rem;
}

.news-item-title {
  margin-top: 0.25rem;
  color: #111827;
}

.news-copy {
  margin-top: 0.25rem;
}

.site-footer {
  border-top: 1px solid #e5e7eb;
  background: #f9fafb;
  padding: 2.5rem 0;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  color: #6b7280;
  font-size: 0.75rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-links a:hover {
  color: #374151;
}

.login-modal,
.purchase-history-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgb(0 0 0 / 0.4);
}

.modal-card {
  position: relative;
  width: 100%;
  max-width: 28rem;
  border: 1px solid #e5e7eb;
  border-radius: 1rem;
  background: #fff;
  padding: 1.5rem;
  box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

.signup-card {
  max-height: calc(100dvh - 2rem);
  overflow-y: auto;
}

.modal-header {
  justify-content: space-between;
  margin-bottom: 1rem;
}

.modal-title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
}

.login-form > * + * {
  margin-top: 0.75rem;
}

.form-label {
  display: block;
  color: #4b5563;
  font-size: 0.75rem;
}

.form-input {
  display: block;
  width: 100%;
  margin-top: 0.25rem;
  border: 1px solid #d1d5db;
  border-radius: 0.75rem;
  padding: 0.5rem 0.75rem;
  color: #111827;
}

.form-input:focus {
  border-color: #111827;
}

.form-error {
  margin: 0;
  color: #dc2626;
  font-size: 0.875rem;
}

.form-success {
  margin: 0;
  color: #047857;
  font-size: 0.875rem;
}

.consent-check {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  color: #4b5563;
  font-size: 0.75rem;
  line-height: 1.5;
}

.consent-check input {
  width: 1rem;
  height: 1rem;
  margin-top: 0.125rem;
  flex-shrink: 0;
}

.start-error {
  margin-top: 0.75rem;
}

.modal-note {
  margin: 0.75rem 0 0;
  color: #6b7280;
  font-size: 0.6875rem;
}

.purchase-history-card {
  display: flex;
  width: min(720px, 100%);
  max-width: min(720px, 100%);
  max-height: calc(100dvh - 48px);
  flex-direction: column;
  overflow: hidden;
  padding: 0;
}

.purchase-history-header {
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0;
  border-bottom: 1px solid #e5e7eb;
  padding: 1.25rem 1.25rem 1rem;
}

.purchase-history-header .icon-button {
  display: inline-flex;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.purchase-history-lead {
  margin: 0.25rem 0 0;
  color: #6b7280;
  font-size: 0.875rem;
}

.purchase-history-toolbar {
  display: flex;
  justify-content: flex-end;
  border-bottom: 1px solid #e5e7eb;
  padding: 0.75rem 1.25rem;
}

.purchase-history-reload,
.purchase-history-state-actions .btn,
.purchase-download-button {
  min-height: 44px;
}

.purchase-history-content {
  min-height: 0;
  overflow-y: auto;
  padding: 1rem 1.25rem 1.25rem;
}

.purchase-history-state {
  border: 1px dashed #d1d5db;
  border-radius: 0.75rem;
  background: #f9fafb;
  padding: 1rem;
}

.purchase-history-state-error {
  border-color: #fecaca;
  background: #fff7f7;
}

.purchase-history-state-title,
.purchase-history-state-copy {
  margin: 0;
}

.purchase-history-state-title {
  color: #111827;
  font-size: 0.9375rem;
  font-weight: 600;
}

.purchase-history-state-copy {
  margin-top: 0.35rem;
  color: #6b7280;
  font-size: 0.8125rem;
}

.purchase-history-state-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.875rem;
}

.purchase-history-list {
  display: grid;
  gap: 0.75rem;
}

.purchase-history-item {
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  background: #fff;
  padding: 1rem;
}

.purchase-history-item-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.purchase-history-item-title {
  margin: 0;
  color: #111827;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.5;
}

.purchase-status-badge {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  border-radius: 9999px;
  background: #eef2ff;
  color: #3730a3;
  padding: 0.25rem 0.5rem;
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

.purchase-history-meta {
  display: grid;
  gap: 0.5rem;
  margin: 0.875rem 0 0;
}

.purchase-history-meta-row {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  color: #4b5563;
  font-size: 0.8125rem;
}

.purchase-history-meta-row dt {
  color: #6b7280;
}

.purchase-history-meta-row dd {
  margin: 0;
  color: #111827;
  text-align: right;
}

.purchase-history-note,
.purchase-history-unavailable,
.purchase-history-download-error {
  margin: 0.75rem 0 0;
  font-size: 0.8125rem;
}

.purchase-history-note {
  border-radius: 0.75rem;
  background: #f9fafb;
  color: #4b5563;
  padding: 0.75rem;
}

.purchase-history-unavailable {
  color: #6b7280;
}

.purchase-history-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 1rem;
}

.purchase-download-button {
  width: 100%;
}

.text-link {
  color: #4f46e5;
  font-weight: 500;
}

.text-link-button {
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  font: inherit;
}

@media (min-width: 640px) {
  .services-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .footer-inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .purchase-history-meta {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .purchase-history-meta-row {
    display: block;
  }

  .purchase-history-meta-row dd {
    margin-top: 0.25rem;
    text-align: left;
  }

  .purchase-history-actions {
    align-items: flex-end;
  }

  .purchase-download-button {
    width: auto;
    min-width: 13rem;
  }
}

@media (min-width: 768px) {
  .desktop-nav,
  .desktop-actions {
    display: flex;
  }

  .mobile-toggle,
  .mobile-menu {
    display: none;
  }

  .hero-inner {
    padding-top: 4rem;
    padding-bottom: 4rem;
  }

  .hero-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero-title {
    font-size: 2.25rem;
    line-height: 2.5rem;
  }

  .section {
    padding: 3.5rem 0;
  }

  .section-title {
    font-size: 1.5rem;
    line-height: 2rem;
  }

  .mypage-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .services-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
