/* 利用規約モーダル（ログイン／設定共通） */
.terms-overlay {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  background: rgba(2, 6, 14, 0.82);
  box-sizing: border-box;
}
.terms-overlay[hidden] {
  display: none !important;
}

.terms-panel {
  width: min(100%, 420px);
  max-height: min(88dvh, 720px);
  display: flex;
  flex-direction: column;
  background: #121826;
  border: 1.5px solid #334155;
  border-radius: 14px;
  color: #e2e8f0;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.85);
  overflow: hidden;
}

.terms-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid #1e293b;
  flex-shrink: 0;
}
.terms-head h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 900;
  color: #fbbf24;
  line-height: 1.3;
}
.terms-head .btn-close-modal,
.terms-head #terms-of-service-x {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 8px;
  background: #1e293b;
  color: #cbd5e1;
  font-size: 14px;
  cursor: pointer;
  flex-shrink: 0;
  line-height: 1;
}

.terms-body {
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 12px 14px 8px;
  font-size: 11px;
  line-height: 1.65;
  color: #cbd5e1;
  text-align: left;
  user-select: text;
  -webkit-user-select: text;
}

.terms-body .terms-lead {
  margin: 0 0 14px;
  color: #94a3b8;
}

.terms-body h4 {
  margin: 16px 0 6px;
  font-size: 12px;
  font-weight: 900;
  color: #fde68a;
}
.terms-body h4:first-child {
  margin-top: 0;
}

.terms-body h5 {
  margin: 10px 0 4px;
  font-size: 11px;
  font-weight: 800;
  color: #93c5fd;
}

.terms-body p {
  margin: 0 0 8px;
}

.terms-body ul {
  margin: 0 0 8px;
  padding-left: 1.2em;
}
.terms-body li {
  margin-bottom: 4px;
}

.terms-body .terms-appendix {
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px solid #1e293b;
  color: #94a3b8;
  font-size: 10.5px;
}

.terms-foot {
  flex-shrink: 0;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid #1e293b;
}
.terms-close-btn {
  width: 100%;
  height: 40px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, #0284c7, #0369a1);
  border: 1px solid #38bdf8;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.terms-link-btn {
  appearance: none;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  color: #7dd3fc;
  font-size: inherit;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
}
.terms-link-btn:hover {
  color: #bae6fd;
}

.auth-terms-row {
  margin-top: 10px;
  text-align: center;
  font-size: 11px;
  color: #94a3b8;
  line-height: 1.5;
}

.settings-terms-btn {
  width: 100%;
  height: 40px;
  border-radius: 8px;
  border: 1.5px solid #475569;
  background: #0f1422;
  color: #cbd5e1;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
  touch-action: manipulation;
}
