:root {
  --bg: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-text: #ffffff;
  --accent: #eab308;
  --accent-text: #422006;
  --success: #059669;
  --danger: #b91c1c;
  --warn: #b45309;
  --shadow: 0 10px 28px rgba(15, 23, 42, 0.07), 0 2px 8px rgba(15, 23, 42, 0.04);

  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", ui-sans-serif, system-ui, sans-serif;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left));
  padding-right: max(16px, env(safe-area-inset-right));
}

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.muted {
  color: var(--muted);
}

.btn {
  appearance: none;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  border-radius: 10px;
  padding: 12px 16px;
  min-height: 44px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
}

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

.btn-primary {
  border-color: var(--primary);
  background: var(--primary);
  color: var(--primary-text);
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}

.input,
.textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 15px;
  font-family: inherit;
  background: #fff;
}

.textarea {
  min-height: 140px;
  resize: vertical;
  line-height: 1.6;
}

.err {
  color: var(--danger);
  font-weight: 700;
  font-size: 14px;
}

.err-insufficient-coins {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
}

.err-charge-link {
  border: 0;
  background: none;
  padding: 0;
  color: var(--primary, #2563eb);
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
}

.err-charge-link:hover {
  opacity: 0.85;
}

.note {
  font-size: 13px;
  line-height: 1.65;
}

/* Loading spinner (共通) */
.smr-loading {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.smr-loading--block {
  display: flex;
  width: 100%;
  padding: 36px 16px;
}

.smr-loading--btn {
  gap: 8px;
  font-size: inherit;
  font-weight: inherit;
  color: inherit;
}

.smr-loading-cell {
  text-align: center;
  padding: 36px 16px !important;
}

.smr-spinner {
  width: 22px;
  height: 22px;
  border: 2.5px solid #e2e8f0;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: smr-spin 0.65s linear infinite;
  flex-shrink: 0;
}

.smr-loading--btn .smr-spinner {
  width: 16px;
  height: 16px;
  border-width: 2px;
}

.btn-primary .smr-spinner {
  border-color: rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
}

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

/* Header */
.top-bar {
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.top-bar-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  min-height: 72px;
  padding: 12px 0;
}

.top-bar-inner--compact {
  grid-template-columns: 1fr auto;
}

.top-bar-spacer {
  min-height: 1px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
  font-size: 18px;
}

.brand-logo {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.catalog-intro {
  text-align: center;
}

.catalog-intro-title {
  display: block;
  font-size: 18px;
  font-weight: 900;
}

.catalog-intro-lead {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
}

.top-bar-actions {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
}

[data-account-logged-in] {
  display: none;
}

[data-account-logged-out],
[data-mypage-logged-out],
.account-auth-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
}

body.smr-authed [data-account-logged-in] {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
}

body.smr-authed [data-account-logged-out],
body.smr-authed [data-mypage-logged-out] {
  display: none;
}

.auth-cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

.auth-cta-btn__icon {
  font-size: 12px;
  opacity: 0.9;
}

.auth-cta-btn-primary {
  border-color: var(--primary);
  background: var(--primary);
  color: var(--primary-text);
}

.auth-cta-btn-primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}

.account-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 800;
}

.account-logged-in {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.account-menu {
  position: relative;
}

.account-menu__trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 8px 14px;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.account-menu__trigger:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.account-menu__trigger:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.account-menu__avatar {
  font-size: 14px;
  color: var(--primary);
  flex-shrink: 0;
}

.account-menu__chevron {
  font-size: 0.7rem;
  color: var(--muted);
}

.account-menu__panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 200;
  min-width: 12.5rem;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
}

.account-menu__profile {
  padding: 8px 12px 6px;
}

.account-menu__profile-name {
  margin: 0;
  font-size: 13px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.4;
}

.account-menu__profile-email {
  margin: 2px 0 0;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  line-height: 1.4;
  word-break: break-all;
}

.account-menu__divider {
  height: 1px;
  margin: 4px 6px 6px;
  background: var(--line);
}

.account-menu__item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-radius: 8px;
  background: transparent;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  color: var(--text);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.account-menu__icon {
  flex-shrink: 0;
  width: 1rem;
  font-size: 0.85rem;
  color: var(--muted);
  text-align: center;
}

.account-menu__item:hover {
  background: #f8fafc;
}

.account-menu__item--logout {
  color: var(--muted);
}

.account-menu__item--logout:hover {
  color: var(--text);
}

.account-menu__item--logout:hover .account-menu__icon {
  color: var(--text);
}

.account-sep {
  color: var(--muted);
  font-weight: 600;
  user-select: none;
}

.account-logout-link {
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  font: inherit;
  font-weight: 800;
  color: var(--muted);
  cursor: pointer;
}

.account-page-link {
  font: inherit;
  font-weight: 800;
  color: var(--primary);
  text-decoration: none;
}

.account-page-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.account-logout-link:hover {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.top-sub-bar {
  background: #f8fafc;
  border-bottom: 1px solid var(--line);
}

.top-sub-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  min-height: 40px;
  padding: 8px 0;
  font-size: 13px;
}

.top-sub-text {
  margin: 0;
  font-weight: 700;
}

.top-sub-tel {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 900;
  color: var(--primary);
  text-decoration: none;
}

.top-sub-tel:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.balance-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.balance-pill .fa-coins {
  font-size: 14px;
  color: #d97706;
}

button.balance-pill {
  border: none;
  cursor: pointer;
  font: inherit;
  font-weight: 900;
  transition: background 0.15s;
}

button.balance-pill:hover {
  background: #dbeafe;
}

button.balance-pill:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.balance-pill--register {
  background: #fff7ed;
  color: #c2410c;
  animation: balance-pill-register-pulse 1.5s ease-in-out infinite;
}

.balance-pill--register:hover {
  animation: none;
  background: #ffedd5;
}

.balance-pill--register .fa-credit-card {
  font-size: 14px;
}

@keyframes balance-pill-register-pulse {
  0%,
  100% {
    background: #fff7ed;
    box-shadow: 0 0 0 0 rgba(249, 115, 22, 0);
  }

  50% {
    background: #ffedd5;
    box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.22);
  }
}

@media (prefers-reduced-motion: reduce) {
  .balance-pill--register {
    animation: none;
  }
}

/* Catalog (coin-shop ProductCatalogCard 準拠) */
.catalog-top {
  display: grid;
  gap: 20px;
  align-content: start;
}

.contact-card {
  padding: 14px 16px;
  display: grid;
  gap: 4px;
  background: #f8fafc;
}

.contact-card > p:first-child {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
}

.contact-tel {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 900;
  color: #1d4ed8;
  letter-spacing: 0.01em;
}

.product-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  align-items: start;
  justify-items: start;
}

.catalog-item {
  position: relative;
  display: block;
  width: min(100%, 420px);
  padding: 0;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.05);
  transition:
    transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.25s ease,
    box-shadow 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.catalog-item-photo {
  display: block;
  width: 100%;
  height: auto;
  vertical-align: top;
}

.catalog-item-body {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 6px;
  padding: 14px 16px;
  background: linear-gradient(
    to top,
    rgba(15, 23, 42, 0.88) 0%,
    rgba(15, 23, 42, 0.45) 42%,
    transparent 72%
  );
}

.catalog-item:hover {
  transform: translate3d(0, -4px, 0);
  border-color: rgba(37, 99, 235, 0.42);
  box-shadow:
    0 14px 36px rgba(15, 23, 42, 0.09),
    0 0 0 1px rgba(37, 99, 235, 0.06);
}

.catalog-row {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  height: 100%;
}

.catalog-icon-pane {
  position: relative;
  flex: 0 0 76px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(165deg, #f8fafc 0%, #eef2ff 100%);
  border-right: 1px solid var(--line);
  border-bottom: none;
}

.catalog-icon-pane i {
  font-size: 26px;
  color: var(--primary);
}

.catalog-icon-glow {
  position: absolute;
  inset: 22%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.12) 0%, transparent 68%);
  pointer-events: none;
}

.catalog-text-pane {
  flex: 1;
  padding: 14px 16px 14px 14px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  gap: 6px;
}

.catalog-title {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.35;
  color: #fff;
  letter-spacing: -0.01em;
}

.catalog-desc {
  margin: 0;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.catalog-cta {
  margin: 2px 0 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 800;
  color: #bfdbfe;
}

.catalog-cta i {
  font-size: 10px;
  transition: transform 0.2s ease;
}

.catalog-item:hover .catalog-cta i {
  transform: translateX(2px);
}

@media (max-width: 560px) {
  .product-grid {
    grid-template-columns: 1fr;
  }

  .catalog-item {
    max-width: none;
  }
}

@media (max-width: 420px) {
  .catalog-icon-pane {
    flex-basis: 68px;
  }

  .catalog-icon-pane i {
    font-size: 22px;
  }

  .catalog-text-pane {
    padding: 12px 14px 12px 12px;
    gap: 5px;
  }

  .catalog-title {
    font-size: 16px;
  }

  .catalog-desc {
    font-size: 13px;
  }
}

.section-h {
  margin: 0 0 14px;
  font-size: 16px;
  font-weight: 900;
}

/* Orders */
.page-h {
  margin: 0 0 8px;
  font-size: 24px;
}

.mypage-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.mypage-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.mypage-title {
  margin: 0;
  flex-shrink: 0;
}

.id-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  width: min(260px, 100%);
  flex-shrink: 0;
  margin-left: auto;
}

.id-search__icon {
  position: absolute;
  left: 10px;
  color: var(--muted);
  font-size: 12px;
  pointer-events: none;
}

.id-search {
  flex: 1;
  min-width: 0;
  padding: 7px 10px 7px 30px;
  min-height: 34px;
  font-size: 13px;
}

.id-search__btn {
  flex-shrink: 0;
  min-width: 56px;
  min-height: 34px;
  padding: 7px 10px;
  font-size: 12px;
}

.mypage-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  margin-bottom: 0;
}

.mypage-tab {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.mypage-tab.is-active {
  border-color: var(--primary);
  background: #eff6ff;
  color: var(--primary);
}

.orders-table-wrap {
  overflow-x: auto;
  padding: 4px;
}

.orders-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 14px;
}

.orders-table th,
.orders-table td {
  border-bottom: 1px solid var(--line);
  padding: 12px 10px;
  text-align: left;
  vertical-align: top;
}

.orders-table th {
  font-size: 12px;
  color: var(--muted);
  font-weight: 800;
}

.orders-table tbody tr:last-child td {
  border-bottom: none;
}

.orders-table--tasks .col-id {
  width: 5rem;
}

.orders-table--tasks .col-skill {
  width: 11rem;
}

.orders-table--tasks .col-datetime {
  width: 10.5rem;
}

.orders-table--tasks .col-prompt {
  width: auto;
}

.orders-table--tasks .col-status {
  width: 9.5rem;
}

.orders-table--tasks .col-coins {
  width: 8rem;
}

.orders-table--tasks .col-id,
.orders-table--tasks .col-datetime,
.orders-table--tasks .col-status,
.orders-table--tasks .col-coins {
  white-space: nowrap;
}

.orders-table--tasks .col-prompt {
  word-break: break-word;
}

.orders-table--wallet .col-date {
  width: 12rem;
}

.orders-table--wallet .col-type {
  width: 6rem;
}

.orders-table--wallet .col-coins {
  width: 8rem;
}

.orders-table--wallet .col-id {
  width: 5rem;
}

.orders-table--wallet .col-date,
.orders-table--wallet .col-type,
.orders-table--wallet .col-coins,
.orders-table--wallet .col-id {
  white-space: nowrap;
}

.order-id-short {
  font-size: 13px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.coin-inline {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 14px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #1d4ed8;
}

.coin-inline .fa-coins {
  font-size: 13px;
  color: #d97706;
}

.coins-amount {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.status-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  background: #f1f5f9;
}

.status-pending {
  background: #fef3c7;
  color: #92400e;
}

.status-in_progress {
  background: #dbeafe;
  color: #1e40af;
}

.status-completed {
  background: #d1fae5;
  color: #065f46;
}

.status-cancelled {
  background: #fee2e2;
  color: #991b1b;
}

.report-open-btn {
  appearance: none;
  border: 1px solid #2563eb;
  background: linear-gradient(145deg, #2563eb 0%, #1e3a8a 100%);
  color: #fff;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 6px 18px rgba(30, 58, 138, 0.28);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.report-open-btn:hover {
  transform: translateY(-1px);
  background: #fff;
  color: #1d4ed8;
  box-shadow: 0 2px 10px rgba(29, 78, 216, 0.12);
}

.report-backdrop {
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(4px);
  z-index: 200;
}

.report-modal {
  position: relative;
  width: min(680px, 100%);
  padding: 0;
  border-radius: 16px;
  overflow: hidden;
  border: none;
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.14);
  background: #ffffff;
  color: #0f172a;
  animation: report-modal-in 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.report-modal::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 16px;
  padding: 3px;
  background: linear-gradient(135deg, #93c5fd 0%, #2563eb 35%, #1d4ed8 65%, #1e3a8a 100%);
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  mask-composite: exclude;
  pointer-events: none;
}

@keyframes report-modal-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.report-head {
  padding: 28px 28px 0;
  text-align: center;
}

.report-skill-name {
  margin: 0;
  font-size: clamp(18px, 3vw, 22px);
  font-weight: 900;
  line-height: 1.4;
  color: #1e3a8a;
  letter-spacing: 0.02em;
}

.report-title {
  margin: 10px 0 0;
  font-size: clamp(15px, 2.2vw, 17px);
  font-weight: 700;
  line-height: 1.5;
  color: #334155;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.report-title i {
  color: #2563eb;
  font-size: 1.15em;
}

.report-body {
  margin: 20px 24px 0;
  padding: 16px 18px;
  border-radius: 12px;
  background: #fafafa;
  border: 1px solid #e2e8f0;
  max-height: min(320px, 45vh);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.report-text {
  margin: 0;
  font-size: 15px;
  line-height: 1.85;
  color: #1e293b;
  word-break: break-word;
}

.report-link {
  color: #1d4ed8;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
  word-break: break-all;
}

.report-link:hover {
  color: #1e3a8a;
}

.report-actions {
  padding: 20px 28px 24px;
  display: flex;
  justify-content: center;
}

.report-dismiss-btn {
  appearance: none;
  border: none;
  background: linear-gradient(145deg, #2563eb 0%, #1e3a8a 100%);
  color: #fff;
  border-radius: 999px;
  padding: 12px 32px;
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
  min-width: 160px;
  box-shadow: 0 4px 16px rgba(30, 58, 138, 0.25);
}

.wallet-type-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  background: #f1f5f9;
  color: var(--text);
  white-space: nowrap;
}

.wallet-type-charge {
  background: #dbeafe;
  color: #1e40af;
}

.wallet-type-coupon {
  background: #ede9fe;
  color: #5b21b6;
}

.wallet-type-debit {
  background: #ffedd5;
  color: #9a3412;
}

.wallet-type-refund {
  background: #d1fae5;
  color: #065f46;
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 100;
}

.modal-backdrop.open {
  display: flex;
}

.modal {
  width: min(520px, 100%);
  padding: 24px;
  box-shadow: var(--shadow);
}

.modal h2 {
  margin: 0 0 8px;
  font-size: 20px;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 16px;
}

.field {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}

.field label {
  font-size: 13px;
  font-weight: 800;
}

.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  left: auto;
  max-width: min(360px, calc(100vw - 32px));
  background: #0f172a;
  color: #fff;
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.45;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.18);
  z-index: 9200;
  visibility: hidden;
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
  pointer-events: none;
}

.toast.show {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
}

.coupon-flash-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9400;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(15, 23, 42, 0.38);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.12s ease, visibility 0.12s ease;
}

.coupon-flash-backdrop.open {
  opacity: 1;
  visibility: visible;
}

.coupon-flash-backdrop.open .coupon-flash {
  animation: coupon-flash-in 0.24s ease;
}

@keyframes coupon-flash-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.coupon-flash {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(22rem, 100%);
  padding: 1.75rem 1.5rem 1.4rem;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.18);
  text-align: center;
}

.coupon-flash__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #ecfdf5, #d1fae5);
  color: #059669;
  font-size: 1.45rem;
  box-shadow: inset 0 0 0 1px rgba(5, 150, 105, 0.12);
}

.coupon-flash__title {
  margin: 0.9rem 0 0;
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.4;
  color: var(--text);
}

.coupon-flash__added {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  margin: 1rem 0 0;
  padding: 0.85rem 1rem;
  border-radius: 14px;
  background: linear-gradient(135deg, #f0fdf4, #dcfce7);
  font-size: 1.55rem;
  font-weight: 900;
  line-height: 1.2;
  color: #047857;
  font-variant-numeric: tabular-nums;
  box-shadow: inset 0 0 0 1px rgba(5, 150, 105, 0.1);
}

.coupon-flash__added i {
  font-size: 1.1rem;
  color: #d97706;
}

.coupon-flash__balance {
  margin: 0.85rem 0 0;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.5;
  color: var(--muted);
}

.coupon-flash__balance span {
  font-size: 1rem;
  font-weight: 900;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.main {
  padding: 24px 0 48px;
}

@media (max-width: 720px) {
  .top-bar-inner {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .top-bar-actions,
  .brand {
    justify-self: center;
  }
}
/* ログインモーダル */

.auth-gate-backdrop {
  z-index: 8600;
}

.auth-gate-modal {
  position: relative;
  width: min(420px, calc(100vw - 32px));
  max-height: min(90vh, 720px);
  overflow-y: auto;
  padding: 0;
  border-radius: 16px;
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.18);
}

.auth-gate-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.85);
  color: var(--muted);
  font-size: 16px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.auth-gate-close:hover {
  background: #fff;
  color: var(--text);
}

.auth-gate-hero {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 28px 24px 20px;
  text-align: center;
  background: linear-gradient(165deg, #eff6ff 0%, #f8fafc 55%, #fff 100%);
  border-bottom: 1px solid var(--line);
}

.auth-gate-hero-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: #fff;
  color: var(--primary);
  font-size: 22px;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.14);
}

.auth-gate-title {
  margin: 0;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 0.01em;
}

.auth-gate-lead {
  margin: 0;
  max-width: 26em;
  font-size: 13px;
  line-height: 1.65;
  color: var(--muted);
  font-weight: 600;
}

.auth-gate-body {
  display: grid;
  gap: 16px;
  padding: 20px 24px 24px;
}

.auth-gate-field {
  display: grid;
  gap: 8px;
}

.auth-gate-lbl {
  font-size: 13px;
  font-weight: 800;
}

.auth-gate-input-wrap {
  position: relative;
}

.auth-gate-input-icon {
  position: absolute;
  top: 50%;
  left: 14px;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: 14px;
  pointer-events: none;
}

.auth-gate-input {
  padding-left: 42px;
  min-height: 48px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.auth-gate-input:focus {
  outline: none;
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.auth-gate-input-wrap:focus-within .auth-gate-input-icon {
  color: var(--primary);
}

.auth-gate-error {
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fef2f2;
  border: 1px solid #fecaca;
}

.auth-gate-error[hidden] {
  display: none !important;
}

.auth-gate-actions {
  display: grid;
  gap: 10px;
  margin-top: 4px;
}

.auth-gate-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 48px;
  font-size: 15px;
}

.auth-gate-submit-icon {
  font-size: 14px;
}

.auth-gate-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.35rem 0.5rem;
  margin: 4px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
  font-weight: 600;
}

.auth-gate-footer-icon {
  color: #94a3b8;
  font-size: 12px;
}

.auth-gate-signup {
  color: var(--primary);
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.auth-gate-signup:hover {
  color: var(--primary-hover);
}
/* コインチャージ */

.charge-backdrop {
  z-index: 8700;
}

.charge-modal {
  width: min(400px, calc(100vw - 32px));
  padding: 0;
  overflow: hidden;
  border-radius: 16px;
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.18);
}

.charge-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 0;
}

.charge-tabs {
  display: flex;
  gap: 0.35rem;
  margin: 0 20px 0;
  padding: 0.2rem;
  border-radius: 10px;
  background: #f1f5f9;
}

.charge-tab {
  flex: 1;
  border: none;
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}

.charge-tab:hover {
  color: var(--text);
}

.charge-tab.is-active {
  background: #fff;
  color: #15803d;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.charge-title {
  margin: 0;
  font-size: 18px;
  font-weight: 900;
  flex: 1 1 auto;
  min-width: 0;
}

.charge-close {
  border: none;
  background: transparent;
  font-size: 28px;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  padding: 0 4px;
}

.charge-body {
  display: grid;
  gap: 20px;
  padding: 16px 20px 24px;
}

.charge-balance {
  display: grid;
  gap: 6px;
  justify-items: center;
  padding: 20px 16px;
  border-radius: 14px;
  background: linear-gradient(160deg, #eff6ff 0%, #f8fafc 100%);
}

.charge-balance-label {
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
  letter-spacing: 0.06em;
}

.charge-balance-value {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 32px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  color: #1d4ed8;
  line-height: 1;
}

.charge-balance-value strong {
  font-weight: 900;
}

.charge-balance-value .fa-coins {
  font-size: 0.72em;
  color: #d97706;
}

.charge-rate-note {
  margin: -8px 0 0;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.charge-error {
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fef2f2;
  color: var(--danger);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}

.charge-phase {
  display: grid;
  gap: 16px;
}

.charge-panels {
  min-height: 220px;
}

.charge-panel {
  display: grid;
  gap: 16px;
}

.charge-content {
  min-height: 196px;
}

.charge-setup-btn {
  appearance: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 52px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: #fff;
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.charge-setup-btn:hover {
  border-color: var(--primary);
  background: #f8fafc;
}

.charge-setup-btn i {
  font-size: 18px;
  color: var(--primary);
}

.charge-preset-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.charge-preset-btn {
  appearance: none;
  display: grid;
  gap: 2px;
  justify-items: center;
  border: 1.5px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 12px 6px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
}

.charge-preset-btn:hover {
  border-color: #93c5fd;
  background: #f8fafc;
}

.charge-preset-btn.is-selected {
  border-color: var(--primary);
  background: #eff6ff;
  transform: translateY(-1px);
}

.charge-preset-amt {
  font-size: 15px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.charge-preset-unit {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
}

.charge-preset-btn.is-selected .charge-preset-unit {
  color: var(--primary);
}

.charge-input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 4px 14px;
  background: #fff;
  transition: border-color 0.15s;
}

.charge-input-wrap:focus-within {
  border-color: var(--primary);
}

.charge-input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  padding: 12px 0;
  font-size: 22px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  text-align: right;
  outline: none;
}

.charge-input-unit {
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 800;
  color: var(--muted);
}

.charge-submit-btn {
  width: 100%;
  min-height: 48px;
  font-size: 15px;
  border-radius: 12px;
}

.charge-confirm-backdrop {
  z-index: 8800;
}

.charge-confirm-modal {
  width: min(400px, calc(100vw - 32px));
  padding: 22px 22px 20px;
}

.charge-confirm-modal__title {
  margin: 0 0 12px;
  font-size: 18px;
  font-weight: 900;
}

.charge-confirm-modal__message {
  margin: 0 0 20px;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.65;
  color: var(--text);
}

.charge-confirm-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.charge-coupon-lead {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

.charge-coupon-form {
  display: grid;
  gap: 14px;
}

.charge-coupon-field {
  display: grid;
  gap: 6px;
}

.charge-coupon-label {
  font-size: 13px;
  font-weight: 800;
}

.charge-coupon-input {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.04em;
  outline: none;
  transition: border-color 0.15s;
}

.charge-coupon-input:focus {
  border-color: var(--primary);
}

.charge-coupon-submit {
  width: 100%;
  min-height: 48px;
  font-size: 15px;
  border-radius: 12px;
}

.mypage-wallet-btn {
  display: none;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  background: #fff;
  color: #15803d;
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s;
}

body.smr-authed .mypage-wallet-btn {
  display: inline-flex;
}

.mypage-wallet-btn:hover {
  border-color: #86efac;
  background: #ecfdf5;
}

.mypage-wallet-btn:focus-visible {
  outline: 2px solid #22c55e;
  outline-offset: 2px;
}

@media (max-width: 480px) {
  .charge-preset-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .mypage-tabs {
    flex-wrap: wrap;
  }
}
/* Site footer (coin-shop LegalNoticeFooter 準拠) */

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-shell .main {
  flex: 1;
}

.site-footer {
  margin-top: auto;
  background: #131921;
  color: #e8e8e8;
  padding: 16px 0 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.site-footer .footer-wrap {
  position: relative;
  padding-left: 0;
}

.footer-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 78px;
}

.footer-company {
  position: absolute;
  left: -20px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  max-width: min(280px, 42vw);
}

.footer-logo {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 2px;
  background: #fff;
}

.footer-company-line {
  margin: 0 0 3px;
  font-size: 11px;
  line-height: 1.25;
  color: #f3f4f6;
}

.footer-nav {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  width: 100%;
  gap: 7px 12px;
  margin: 0;
  font-size: 11px;
  line-height: 1.5;
  white-space: nowrap;
}

.footer-sep {
  color: rgba(255, 255, 255, 0.35);
  user-select: none;
}

.footer-link {
  appearance: none;
  margin: 0;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  font: inherit;
  color: #fff;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}

.footer-link:hover {
  color: #febd69;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.footer-copyright {
  margin: 0;
  width: 100%;
  text-align: center;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.55);
}

.footer-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: rgba(15, 23, 42, 0.55);
}

.footer-modal-backdrop.open {
  display: flex;
}

.footer-modal-panel {
  width: min(100%, 720px);
  max-height: min(84vh, 720px);
  display: flex;
  flex-direction: column;
  border-radius: 14px;
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.18);
  background: #fff;
  color: var(--text);
}

.footer-modal-panel.wide {
  width: min(100%, 880px);
}

.footer-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 18px 12px;
  border-bottom: 1px solid var(--line);
}

.footer-modal-title {
  margin: 0;
  font-size: 17px;
  font-weight: 900;
}

.footer-modal-close {
  border: none;
  background: transparent;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
}

.footer-modal-body {
  padding: 16px 18px 20px;
  overflow-y: auto;
  font-size: 13px;
  line-height: 1.65;
}

.footer-modal-body h1,
.footer-modal-body h2,
.footer-modal-body h3 {
  margin: 1em 0 0.5em;
  font-size: 15px;
}

.footer-modal-body p {
  margin: 0 0 0.75em;
}

.footer-modal-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.5em 0 1em;
  font-size: 12px;
}

.footer-modal-body th,
.footer-modal-body td {
  border: 1px solid var(--line);
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
}

.footer-modal-body th {
  background: #f8fafc;
}

.footer-modal-body ul {
  margin: 0 0 0.75em;
  padding-left: 1.2em;
}

@media (max-width: 900px) {
  .footer-wrap {
    align-items: stretch;
    gap: 12px;
    padding-left: max(8px, env(safe-area-inset-left));
  }

  .footer-company {
    position: static;
    transform: none;
    max-width: none;
    margin-left: 0;
  }

  .footer-nav {
    justify-content: center;
    width: 100%;
    overflow-x: auto;
  }

  .footer-copyright {
    text-align: center;
  }
}
