/* ============================================================
   隣のタグはよく上位表示されるね田鎖さん — style.css
   かのんさん（style.css）をベースに田鎖さん固有スタイルを追加
   ============================================================ */

/* ── リセット ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ── デザイントークン ── */
:root {
  --bg:           #FDF4EA;
  --surface:      #FFFFFF;
  --surface2:     #F5EAD8;
  --border:       rgba(73,167,206,0.15);
  --border2:      rgba(73,167,206,0.30);
  --text:         #2C2C2C;
  --muted:        #7A7A7A;
  --accent:       #49A7CE;
  --accent-dark:  #3388AD;
  --accent-light: rgba(73,167,206,0.10);
  --accent-glow:  rgba(73,167,206,0.20);
  --success:      #2DA870;
  --warning:      #D48A10;
  --danger:       #D64545;
  --success-bg:   rgba(45,168,112,0.09);
  --warning-bg:   rgba(212,138,16,0.09);
  --danger-bg:    rgba(214,69,69,0.09);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
}

/* ── ベース ── */
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Noto Sans JP', sans-serif;
  font-weight: 400;
  min-height: 100vh;
  line-height: 1.7;
}

/* ============================================================
   ヘッダー（かのんさん完全準拠）
   ============================================================ */
header {
  background: var(--surface);
  border-bottom: 1px solid var(--border2);
  padding: 0 2rem;
}

.header-inner {
  max-width: 860px;
  margin: 0 auto;
  padding: 1.2rem 0;
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo-link {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  text-decoration: none;
}

.logo-img {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  display: block;
}

.logo-text {
  font-family: 'Outfit', sans-serif;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.logo-text small {
  display: block;
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--muted);
  font-family: 'Noto Sans JP', sans-serif;
  letter-spacing: 0;
}

.header-free-badge {
  background: var(--accent);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  padding: 0.28rem 0.75rem;
  border-radius: 999px;
  white-space: nowrap;
  font-family: 'Noto Sans JP', sans-serif;
}

.header-usage-count {
  margin-left: auto;
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--muted);
  font-family: 'Noto Sans JP', sans-serif;
  white-space: nowrap;
}

.header-usage-count strong {
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  color: var(--accent-dark);
}

/* ============================================================
   ヒーロー（かのんさん完全準拠）
   ============================================================ */
.hero {
  background: linear-gradient(135deg, #FDF4EA 0%, #FEF1DA 50%, #FDF4EA 100%);
  border-bottom: 2px solid rgba(73,167,206,0.15);
  padding: 2.8rem 2rem 0;
  overflow: hidden;
}

.hero-inner {
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  align-items: flex-end;
  gap: 1rem;
}

.hero-text {
  flex: 1;
  padding-bottom: 2.5rem;
}

.hero h1 {
  font-family: 'Outfit', sans-serif;
  font-size: clamp(1.5rem, 4vw, 2.1rem);
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  letter-spacing: -0.02em;
  margin-bottom: 0.9rem;
}

.hero h1 em {
  font-style: normal;
  color: var(--accent);
}

.hero-lead {
  font-size: 0.92rem;
  color: var(--muted);
  line-height: 1.8;
  max-width: 480px;
  margin-bottom: 1.4rem;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.hero-badge {
  display: flex;
  align-items: center;
  gap: 5px;
  background: #fff;
  border: 1px solid var(--border2);
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  font-size: 0.8rem;
  color: var(--text);
  font-weight: 500;
}

.badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #AAAAAA;
  flex-shrink: 0;
  display: inline-block;
}

.hero-chara {
  flex-shrink: 0;
  width: 300px;
  height: 300px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow: hidden;
}

.hero-chara img {
  width: 300px;
  height: 300px;
  object-fit: contain;
  object-position: bottom;
  display: block;
}

/* ============================================================
   ツール本体（かのんさん完全準拠）
   ============================================================ */
.tool-section {
  max-width: 860px;
  margin: 0 auto;
  padding: 2.5rem 2rem;
}

.tool-heading {
  font-family: 'Outfit', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.tool-heading::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 1.1em;
  background: var(--accent);
  border-radius: 2px;
  flex-shrink: 0;
}

/* 入力カード */
.input-card {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  padding: 2rem 2.25rem;
  box-shadow: 0 2px 16px rgba(73,167,206,0.07);
}

.input-card h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.3rem;
  letter-spacing: -0.01em;
}

.input-card .sub {
  color: var(--muted);
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

.field-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.45rem;
}

/* ── URL textarea（田鎖さん固有）── */
.url-textarea {
  width: 100%;
  height: calc(8 * 1.75rem + 20px);
  min-height: 180px;
  max-height: calc(8 * 1.75rem + 20px);
  padding: 0.75rem 1rem;
  border: 2px dashed var(--border2);
  border-radius: var(--radius-md);
  background: var(--bg);
  font-family: 'Noto Sans JP', monospace, sans-serif;
  font-size: 0.9rem;
  color: var(--text);
  resize: none;
  outline: none;
  overflow-y: auto;
  line-height: 1.75;
  transition: background 0.2s, border-color 0.2s;
  cursor: text;
  display: block;
}

.url-textarea:focus {
  background: var(--surface);
  border-color: var(--accent);
}

.url-textarea::placeholder { color: #BBB; }

.url-count-row {
  font-size: 0.78rem;
  color: var(--muted);
  text-align: right;
  margin-top: 0.4rem;
  margin-bottom: 0;
}

/* ── タグチェック（田鎖さん固有）── */
.quality-wrap {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.1rem 1.25rem;
}

.quality-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.6rem;
}

.tag-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.2rem;
}

.tag-check-item {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 0.88rem;
  color: var(--text);
  user-select: none;
}

.tag-check-item input[type="checkbox"] {
  accent-color: var(--accent);
  width: 15px;
  height: 15px;
  cursor: pointer;
}

/* ── 調査ボタン ── */
.btn-run {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.9rem 2.5rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.03em;
  transition: background 0.15s, transform 0.1s;
}

.btn-run:hover  { background: var(--accent-dark); }
.btn-run:active { transform: scale(0.99); }
.btn-run:disabled { opacity: 0.45; cursor: not-allowed; }

/* ── プログレス（田鎖さん固有）── */
.progress-bar-outer {
  background: var(--border2);
  border-radius: 100px;
  height: 6px;
  overflow: hidden;
  margin-bottom: 0.6rem;
}

.progress-bar-inner {
  height: 100%;
  background: var(--accent);
  border-radius: 100px;
  transition: width 0.4s ease;
}

.progress-text {
  font-size: 0.82rem;
  color: var(--muted);
  text-align: center;
}

/* ── 結果コントロール ── */
.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.results-header h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}

.result-ctrl-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.result-ctrl-selects {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.ctrl-group {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.ctrl-select {
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 0.82rem;
  color: var(--text);
  background: var(--surface);
  outline: none;
  cursor: pointer;
}

.ctrl-select:focus { border-color: var(--accent); }

.result-dl-btns {
  display: flex;
  gap: 0.5rem;
}

/* ── ダウンロードボタン（かのんさんの.btn-dl-single準拠）── */
.btn-dl-single {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--accent-dark);
  background: var(--accent-light);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.85rem;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  transition: background 0.15s, color 0.15s;
}

.btn-dl-single:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ── 結果テーブル（田鎖さん固有）── */
.score-bar-wrap {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  margin-bottom: 1.25rem;
  box-shadow: 0 2px 12px rgba(73,167,206,0.06);
}

.result-table-outer {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.result-table-body-scroll {
  max-height: calc(10 * 45px);
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

.result-table--head,
.result-table--body {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
}

.result-table--head thead th {
  position: sticky;
  top: 0;
  z-index: 1;
}

.result-table--head th {
  background: var(--surface2);
  padding: 0.65rem 1rem;
  text-align: left;
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border2);
  white-space: nowrap;
}

.result-table--body td {
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  line-height: 1.6;
  font-size: 0.875rem;
  background: var(--surface);
}

.result-table--body tr:last-child td { border-bottom: none; }
.result-table--body tr:hover td { background: rgba(73,167,206,0.04); }

.col-tag    { width: 120px; }
.col-url    { width: 200px; }
.col-content{ width: auto; }
.col-len    { width: 72px; }

.cell-url    { word-break: break-all; }
.cell-content{ word-break: break-all; }
.cell-len    {
  text-align: right;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  color: var(--success);
}
.len--warn { color: var(--warning); }
.len--over { color: var(--danger); }

.url-link { font-size: 0.8rem; color: var(--accent-dark); }

.empty-cell {
  text-align: center;
  color: var(--muted);
  padding: 2rem !important;
}

/* タグバッジ */
.tag-badge {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 0.7rem;
  white-space: nowrap;
}
.tag--title { background: #E8F4FB; color: #2668A4; }
.tag--desc  { background: #EBF8F2; color: #1E7A51; }
.tag--h1    { background: #FEF3E8; color: #B85C00; }
.tag--h2    { background: #FFF6E8; color: #C07300; }
.tag--h3    { background: #F9F3FF; color: #7A3BB5; }

/* ── 頻出単語（田鎖さん固有）── */
.word-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.word-tab {
  padding: 0.3rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--border2);
  background: var(--surface);
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 0.78rem;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.word-tab.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.word-tab:hover:not(.active) { background: var(--accent-light); }

.word-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 0.9rem;
  align-items: center;
  padding: 1.2rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 0;
  min-height: 60px;
}

.word-tag {
  color: var(--accent-dark);
  font-family: 'Noto Sans JP', sans-serif;
  font-weight: 500;
  text-decoration: none;
  border-bottom: 1px dashed var(--border2);
  padding-bottom: 1px;
  transition: opacity 0.15s, color 0.15s, border-color 0.15s;
  cursor: pointer;
}

.word-tag:hover {
  opacity: 1 !important;
  color: var(--accent);
  border-bottom-color: var(--accent);
  text-decoration: none;
}

.word-rank-table {
  max-width: 380px;
}

.word-link {
  color: var(--accent-dark);
  text-decoration: none;
  border-bottom: 1px dashed var(--border2);
  padding-bottom: 1px;
  transition: color 0.15s, border-color 0.15s;
}

.word-link:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
  text-decoration: none;
}

.rare-toggle-wrap {
  margin-top: 0.75rem;
  text-align: center;
}

.rare-link {
  font-size: 0.82rem;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px dashed #CCC;
  padding-bottom: 1px;
  transition: color 0.15s, border-color 0.15s;
}

.rare-link:hover {
  color: var(--accent-dark);
  border-bottom-color: var(--accent-dark);
  text-decoration: none;
}

/* ── エラーログ（田鎖さん固有）── */
.limit-error-card {
  border-color: rgba(214,69,69,0.30);
}

.error-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.error-item {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.6rem 0.85rem;
  background: var(--danger-bg);
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
  flex-wrap: wrap;
}

.error-url    { color: var(--text); word-break: break-all; flex: 1; }
.error-reason { color: var(--danger); font-size: 0.78rem; white-space: nowrap; }

/* ============================================================
   コンテンツセクション（かのんさん完全準拠）
   ============================================================ */
.content-section {
  max-width: 860px;
  margin: 0 auto;
  padding: 3rem 2rem;
  border-top: 1px solid var(--border);
}

.section-heading {
  font-family: 'Outfit', sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
  margin-bottom: 0.4rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-heading::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 1.2em;
  background: var(--accent);
  border-radius: 2px;
  flex-shrink: 0;
}

.section-lead {
  color: var(--muted);
  font-size: 0.875rem;
  margin-bottom: 1.75rem;
}

/* できることグリッド（かのんさん完全準拠）*/
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.feature-card {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.35rem;
  transition: box-shadow 0.15s;
}

.feature-card:hover {
  box-shadow: 0 4px 16px rgba(73,167,206,0.10);
}

.feature-icon  { font-size: 1.5rem; margin-bottom: 0.6rem; }
.feature-title { font-size: 0.92rem; font-weight: 600; color: var(--text); margin-bottom: 0.4rem; }
.feature-desc  { font-size: 0.83rem; color: var(--muted); line-height: 1.65; }

/* 使用例リスト（かのんさん完全準拠）*/
.usecase-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.usecase-item {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.35rem;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.usecase-num {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 700;
  font-family: 'Outfit', sans-serif;
  margin-top: 1px;
}

.usecase-body strong {
  display: block;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.3rem;
}

.usecase-body p {
  font-size: 0.84rem;
  color: var(--muted);
  line-height: 1.65;
  margin: 0;
}

/* ============================================================
   開発コストテーブル（かのんさん完全準拠）
   ============================================================ */
.cost-table-wrap { overflow-x: auto; }

.cost-table {
  width: 100%;
  max-width: 480px;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.cost-table th,
.cost-table td {
  padding: 0.7rem 1.1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.cost-table th {
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  color: var(--muted);
  background: var(--surface2);
  text-transform: uppercase;
}

.cost-table td:nth-child(2),
.cost-table td:nth-child(3) { text-align: right; }
.cost-table th:nth-child(2),
.cost-table th:nth-child(3) { text-align: right; }

.cost-table-total td {
  font-weight: 600;
  color: var(--text);
  background: var(--accent-light);
  border-top: 2px solid var(--border2);
  border-bottom: none;
}

/* ============================================================
   フッター
   ============================================================ */
footer {
  text-align: center;
  font-size: 0.8rem;
  color: var(--muted);
  padding: 2rem;
  border-top: 1px solid var(--border2);
}

/* ============================================================
   レスポンシブ
   ============================================================ */
@media (max-width: 600px) {
  .hero h1          { font-size: 1.4rem; }
  .hero-chara       { display: none; }
  .features-grid    { grid-template-columns: 1fr; }
  .results-header   { flex-direction: column; align-items: flex-start; }
  .result-ctrl-right{ flex-direction: column; align-items: flex-start; }
  .tag-checks       { flex-direction: column; gap: 0.5rem; }
  .input-card       { padding: 1.25rem 1.1rem; }
  .header-usage-count { display: none; }
}

@media (max-width: 400px) {
  .result-dl-btns { width: 100%; }
  .btn-dl-single  { flex: 1; justify-content: center; }
}
