/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   利用規約チェッカー — style.css
   ベーススタイルは loan/style.css に準拠
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

* { margin: 0; padding: 0; box-sizing: border-box; }
button { touch-action: manipulation; }

body {
  font-family: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic ProN', sans-serif;
  background: #f5f5f5;
  color: #333;
  line-height: 1.7;
  overflow-x: hidden;
}

/* ── Header ── */
header {
  background: #fff;
  border-bottom: 1px solid #e0e0e0;
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner { max-width: 800px; margin: 0 auto; padding: 0 1.5rem; }
.logo { font-size: 1.2rem; font-weight: bold; color: #1a73e8; text-decoration: none; }

/* ── Main ── */
main { max-width: 800px; margin: 2rem auto; padding: 0 1.5rem; }

h2 { font-size: 1.2rem; font-weight: bold; margin-bottom: 1rem; }

/* ── Hero ── */
.hero { text-align: center; padding: 28px 0 20px; margin-bottom: 1.5rem; }
.hero-icon { font-size: 3rem; margin-bottom: 10px; }
.hero h1 { font-size: 1.8rem; font-weight: bold; margin-bottom: 6px; color: #1e293b; }
.hero .description { color: #666; font-size: 0.95rem; line-height: 1.7; margin-bottom: 0; }
.hero-badges { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 14px; }
.badge {
  display: inline-block; padding: 5px 13px;
  background: #dbeafe; color: #1a73e8;
  border: 1.5px solid #bfdbfe; border-radius: 20px;
  font-size: 0.8rem; font-weight: 600; white-space: nowrap;
}

/* ── Card ── */
.card {
  background: #fff;
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  border: 1px solid #e0e0e0;
}

/* ── 入力カード ── */
.input-card { padding: 0; overflow: hidden; }

.input-tabs { display: flex; gap: .4rem; padding: .4rem; border-bottom: 1px solid #e0e0e0; background: #fff; }
.input-tab {
  flex: 1; padding: .65rem .75rem; border: none; border-radius: 8px;
  font-size: .88rem; font-weight: 600; color: #888; background: transparent;
  cursor: pointer; transition: background .15s, color .15s; font-family: inherit;
}
.input-tab.active { background: #1a73e8; color: #fff; }
.input-tab:not(.active):hover { background: #f0f4ff; color: #1a73e8; }

.tab-panel { padding: 1.2rem 1.5rem 0; }
.tab-panel.hidden { display: none; }

.input-label { display: block; font-size: 0.875rem; color: #666; margin-bottom: 0.4rem; }

.url-input {
  width: 100%; padding: 10px 12px;
  border: 1.5px solid #e0e0e0; border-radius: 8px;
  font-size: 0.9rem; outline: none; transition: border-color .15s; font-family: inherit;
}
.url-input:focus { border-color: #1a73e8; }

.input-hint { font-size: 0.78rem; color: #999; margin-top: 6px; line-height: 1.55; }

.text-input {
  width: 100%; height: 180px; padding: 10px 12px;
  border: 1.5px solid #e0e0e0; border-radius: 8px;
  font-size: 0.875rem; resize: vertical; outline: none;
  transition: border-color .15s; font-family: inherit; line-height: 1.6;
}
.text-input:focus { border-color: #1a73e8; }

.char-hint { font-size: 0.78rem; color: #999; text-align: right; margin-top: 4px; }
.char-hint #char-count { font-weight: 700; color: #333; }

.analyze-btn {
  display: block; width: calc(100% - 3rem); margin: 1.2rem 1.5rem 1.5rem;
  padding: 0.85rem; background: #1a73e8; color: #fff;
  border: none; border-radius: 8px; font-size: 1rem; font-weight: 700;
  cursor: pointer; transition: background .15s; font-family: inherit;
}
.analyze-btn:hover { background: #1557b0; }
.analyze-btn:active { transform: scale(.98); }
.analyze-btn:disabled { background: #90a4ae; cursor: not-allowed; transform: none; }

/* ── Loading ── */
.loading-wrap {
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  padding: 2.5rem; background: #fff; border-radius: 12px;
  border: 1px solid #e0e0e0; margin-bottom: 1.5rem;
}
.loading-spinner {
  width: 40px; height: 40px;
  border: 4px solid #dbeafe; border-top-color: #1a73e8;
  border-radius: 50%; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-msg { color: #666; font-size: 0.9rem; }

/* ── Error ── */
.error-banner {
  background: #fffbeb; border: 1.5px solid #fde68a; border-radius: 10px;
  padding: .9rem 1.1rem; display: flex; align-items: flex-start;
  gap: 8px; flex-wrap: wrap; margin-bottom: 1.5rem;
  font-size: .85rem; color: #78716c; line-height: 1.65;
}
.error-icon { font-size: 1.1rem; flex-shrink: 0; }
#error-msg { flex: 1; }
.retry-btn {
  background: #1a73e8; color: #fff; border: none; border-radius: 6px;
  padding: 5px 14px; font-size: .82rem; cursor: pointer; font-family: inherit;
}
.hidden { display: none !important; }

/* ── 結果 ── */
#results { }

/* 文字数切り捨て警告 */
.truncation-warn {
  background: #e3f2fd; border: 1px solid #90caf9; border-radius: 8px;
  padding: .65rem 1rem; font-size: .82rem; color: #1565c0; margin-bottom: 1.5rem;
}

/* ── リスクメーター ── */
.meter-card { }
.meter-bar-wrap {
  background: #eee; border-radius: 8px; height: 16px;
  overflow: hidden; margin-bottom: 6px;
}
.meter-fill { height: 100%; border-radius: 8px; transition: width 1s cubic-bezier(.4,0,.2,1); }
.meter-labels {
  display: flex; justify-content: space-between;
  font-size: .76rem; color: #999; margin-bottom: 1rem;
}
.risk-badge {
  display: inline-block; padding: 4px 16px; border-radius: 20px;
  font-weight: 800; font-size: .95rem; margin-bottom: 6px;
}
.risk-summary-text { font-size: .85rem; color: #555; margin-bottom: 1rem; }

.category-scores { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.cat-item { }
.cat-label {
  font-size: .78rem; font-weight: 600; color: #666;
  margin-bottom: 4px; display: flex; justify-content: space-between;
}
.cat-bar-wrap { background: #eee; border-radius: 6px; height: 7px; overflow: hidden; }
.cat-bar { height: 100%; border-radius: 6px; transition: width .8s ease; }

/* ── フラグカード（赤・黄・緑）── */
.result-section h2 { font-size: 1.1rem; margin-bottom: .75rem; display: flex; align-items: center; gap: 8px; }
.count-badge {
  background: #555; color: #fff; border-radius: 12px;
  padding: 1px 8px; font-size: .76rem; font-weight: 700;
}

.flag-card {
  border-radius: 8px; padding: 1rem 1.1rem; margin-bottom: .75rem; border: 1px solid;
}
.flag-card:last-child { margin-bottom: 0; }
.flag-card.red    { background: #fff5f5; border-color: #ffcdd2; }
.flag-card.yellow { background: #fffde7; border-color: #fff59d; }
.flag-card.green  { background: #f1f8e9; border-color: #c5e1a5; }

.flag-card-head { display: flex; align-items: flex-start; gap: .75rem; cursor: pointer; user-select: none; }
.flag-icon { font-size: 1.3rem; flex-shrink: 0; margin-top: 2px; }
.flag-body { flex: 1; }
.flag-cat { font-size: .72rem; font-weight: 700; letter-spacing: .4px; margin-bottom: 1px; opacity: .75; }
.flag-title { font-size: .92rem; font-weight: 700; margin-bottom: 2px; }
.flag-desc { font-size: .82rem; line-height: 1.55; color: #555; }
.flag-toggle { font-size: .76rem; color: #999; flex-shrink: 0; margin-top: 4px; }

.flag-card.red    .flag-cat   { color: #c62828; }
.flag-card.yellow .flag-cat   { color: #e65100; }
.flag-card.green  .flag-cat   { color: #2e7d32; }
.flag-card.red    .flag-title { color: #c62828; }
.flag-card.yellow .flag-title { color: #e65100; }
.flag-card.green  .flag-title { color: #2e7d32; }

.flag-quote {
  margin-top: .75rem; padding: .6rem .85rem;
  background: rgba(0,0,0,.04); border-radius: 6px;
  font-size: .78rem; line-height: 1.65; color: #555;
  border-left: 3px solid; display: none;
}
.flag-card.red    .flag-quote { border-color: #ef9a9a; }
.flag-card.yellow .flag-quote { border-color: #ffe082; }
.flag-card.green  .flag-quote { border-color: #a5d6a7; }
.flag-quote.open { display: block; }

/* ── 解約ロードマップ ── */
.no-cancel-info {
  text-align: center; padding: 1.5rem;
  color: #999; font-size: .85rem; background: #f9f9f9; border-radius: 8px;
}
.cancel-steps { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-bottom: 1rem; }
.cancel-step {
  background: #dbeafe; color: #1a56db; border-radius: 8px;
  padding: .5rem .9rem; font-size: .82rem; font-weight: 600;
  line-height: 1.45; text-align: center; flex: 0 0 auto; max-width: 180px;
}
.cancel-arrow { color: #aaa; font-size: 1.1rem; flex-shrink: 0; }
.cancel-warnings { display: flex; flex-direction: column; gap: .45rem; }
.cancel-warn-item {
  display: flex; align-items: flex-start; gap: .5rem;
  font-size: .82rem; color: #c62828;
  background: #fff5f5; border-radius: 6px; padding: .55rem .85rem;
  border: 1px solid #ffcdd2;
}

/* ── シェアボタン ── */
.share-section { text-align: center; padding: .5rem; }
.share-btn {
  background: #fff; border: 2px solid #1a73e8; color: #1a73e8;
  border-radius: 8px; padding: .6rem 2rem; font-size: .9rem; font-weight: 700;
  cursor: pointer; transition: background .15s, color .15s; font-family: inherit;
}
.share-btn:hover { background: #1a73e8; color: #fff; }

/* ── Amazon ── */
.amazon-card h2 { margin-bottom: 0.25rem; }
.amazon-note { font-size: 0.82rem; color: #999; margin-bottom: 1rem; }
.amazon-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
.amazon-item {
  display: block; border: 1px solid #e0e0e0; border-radius: 10px;
  padding: 0.9rem; text-decoration: none; color: inherit;
  transition: border-color .2s, box-shadow .2s, transform .1s;
}
.amazon-item:hover {
  border-color: #FF9900; box-shadow: 0 2px 8px rgba(255,153,0,.15); transform: translateY(-1px);
}
.amazon-item-icon { font-size: 1.7rem; margin-bottom: 0.35rem; }
.amazon-item-name { font-size: 0.88rem; font-weight: bold; margin-bottom: 0.2rem; }
.amazon-item-desc { font-size: 0.76rem; color: #888; line-height: 1.5; margin-bottom: 0.45rem; }
.amazon-item-link { font-size: 0.78rem; color: #FF9900; font-weight: bold; }

/* ── 活用シーン ── */
.scene-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .75rem; }
.scene-item {
  display: flex; align-items: flex-start; gap: .75rem;
  padding: .85rem 1rem; background: #f0f6ff;
  border: 1.5px solid #bfdbfe; border-radius: 12px;
}
.scene-icon { font-size: 1.7rem; flex-shrink: 0; }
.scene-body strong { display: block; font-size: .88rem; font-weight: 700; color: #1a56db; margin-bottom: .2rem; }
.scene-body p { font-size: .78rem; color: #4b5563; line-height: 1.55; margin: 0; }

/* ── FAQ ── */
.faq-list { display: flex; flex-direction: column; }
.faq-item { padding: .9rem 0; border-bottom: 1px solid #f0f0f0; }
.faq-item:last-child { border-bottom: none; padding-bottom: 0; }
.faq-q { font-size: .9rem; font-weight: 700; color: #1a73e8; margin-bottom: .35rem; }
.faq-a { font-size: .85rem; color: #555; line-height: 1.75; }

/* ── 関連ツール ── */
.related-tools { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .75rem; }
.related-tool-item {
  display: flex; align-items: flex-start; gap: .75rem; padding: .85rem 1rem;
  border: 1.5px solid #e8edf5; border-radius: 10px; text-decoration: none; color: inherit;
  transition: border-color .15s, box-shadow .15s;
}
.related-tool-item:hover { border-color: #1a73e8; box-shadow: 0 2px 8px rgba(26,115,232,.1); }
.related-tool-icon { font-size: 1.6rem; flex-shrink: 0; }
.related-tool-item strong { display: block; font-size: .88rem; font-weight: 700; color: #1a73e8; margin-bottom: .2rem; }
.related-tool-item p { font-size: .76rem; color: #888; line-height: 1.5; margin: 0; }

/* ── Footer ── */
footer {
  text-align: center; padding: 1.5rem 1rem;
  font-size: .82rem; color: #a8a29e;
  border-top: 1px solid #e7e5e4; margin-top: auto;
}
footer a { color: #ea580c; text-decoration: none; }
footer a:hover { text-decoration: underline; }
footer p + p { margin-top: .3rem; }
.amazon-notice { font-size: 0.72rem; color: #bbb; margin-top: 0.2rem; }

/* ── Tips ── */
.tips-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; }
.tip-item { display: flex; gap: .65rem; }
.tip-icon { font-size: 1.4rem; flex-shrink: 0; }
.tip-text strong { display: block; font-weight: 700; margin-bottom: .15rem; font-size: .88rem; }
.tip-text p { font-size: .8rem; color: #78716c; line-height: 1.55; }

/* ── Responsive ── */
@media (max-width: 600px) {
  .hero h1 { font-size: 1.4rem; }
  .category-scores { grid-template-columns: 1fr; }
  .cancel-steps { flex-direction: column; align-items: flex-start; }
  .cancel-arrow { transform: rotate(90deg); }
  .cancel-step { max-width: 100%; width: 100%; }
  .amazon-grid { grid-template-columns: 1fr; }
  .scene-grid { grid-template-columns: 1fr; }
}
