/* カワウソキーワード — 川辺の和紙エディトリアル */
:root {
  --paper: #f6f1e6;
  --paper-deep: #efe7d5;
  --ink: #1d2a28;
  --teal: #155e63;
  --teal-deep: #0e3d41;
  --teal-dark: #0a2f33;
  --kaki: #e2601a;
  --kaki-soft: #f8ddc9;
  --line: #d8cdb4;
  --ok: #2e7d4f;
  --warn: #a05c00;
  --warn-bg: #fdf0d5;
  --card: #fffdf7;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
  --jp: "Hiragino Sans", "ヒラギノ角ゴシック", "Hiragino Kaku Gothic ProN", sans-serif;
  --radius: 14px;
  --shadow: 0 2px 10px rgba(29, 42, 40, 0.07), 0 12px 32px rgba(29, 42, 40, 0.05);
  --main-max: 1600px; /* 設定「コンテンツ幅」で変更 */
}
html[data-width="standard"] { --main-max: 1150px; }
html[data-width="wide"] { --main-max: 1600px; }
html[data-width="full"] { --main-max: 100%; }

* { margin: 0; padding: 0; box-sizing: border-box; }

/* ヒラギノ角ゴ W6(本文)/W7(ボタン等)/W8(見出し) 構成 */
body {
  font-family: var(--jp);
  font-weight: 600;
  background:
    radial-gradient(1200px 500px at 85% -10%, rgba(21, 94, 99, 0.06), transparent 60%),
    radial-gradient(900px 400px at -10% 110%, rgba(226, 96, 26, 0.05), transparent 60%),
    var(--paper);
  color: var(--ink);
  min-height: 100vh;
  line-height: 1.7;
}

h1, h2, h3, .display { font-family: var(--jp); font-weight: 800; }

.layout { display: flex; min-height: 100vh; }

/* ===== サイドバー ===== */
.sidebar {
  width: 248px; flex-shrink: 0;
  background: linear-gradient(175deg, var(--teal-deep), var(--teal-dark) 70%);
  color: #e9f2ee;
  padding: 20px 0 40px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.25) transparent;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 18px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  cursor: pointer;
}
.brand img { width: 44px; height: 44px; filter: drop-shadow(0 2px 4px rgba(0,0,0,.3)); }
.brand img.brand-logo { border-radius: 50%; object-fit: cover; border: 2px solid rgba(255,255,255,.35); }
.brand-name { font-family: var(--jp); font-weight: 800; font-size: 17px; letter-spacing: .02em; }
.brand-sub { font-size: 10px; opacity: .65; letter-spacing: .08em; }

.nav-group { margin-top: 16px; }
.nav-group-title {
  font-size: 10.5px; letter-spacing: .18em; opacity: .55;
  padding: 0 18px 6px; text-transform: uppercase;
}
.nav-item {
  display: flex; align-items: center; gap: 8px;
  padding: 6.5px 18px; font-size: 13.5px; cursor: pointer;
  border-left: 3px solid transparent;
  transition: background .15s, border-color .15s;
  color: #d5e5df; text-decoration: none;
}
.nav-item:hover { background: rgba(255, 255, 255, 0.07); }
.nav-item.active {
  background: rgba(226, 96, 26, 0.16);
  border-left-color: var(--kaki);
  color: #fff; font-weight: 600;
}
/* サジェスト配下のプラットフォーム別サブ項目 */
.nav-sub {
  display: flex; align-items: center; gap: 6px;
  padding: 4.5px 18px 4.5px 42px; font-size: 12.5px;
  color: #b9cfc8; text-decoration: none; cursor: pointer;
  border-left: 3px solid transparent;
  transition: background .15s, color .15s;
}
.nav-sub:hover { background: rgba(255, 255, 255, 0.07); color: #fff; }
.nav-sub.active {
  background: rgba(10, 47, 51, 0.85);
  border-left-color: var(--kaki);
  color: #fff; font-weight: 700;
}
.nav-sub.disabled { opacity: .45; cursor: not-allowed; }
.nav-sub .mini-badge { font-size: 9px; padding: 1px 5px; border-radius: 999px; background: rgba(255,255,255,.14); }

.nav-item .mini-badge {
  font-size: 9px; padding: 1px 5px; border-radius: 999px;
  background: rgba(255,255,255,.14); letter-spacing: .05em;
}
.nav-item .mini-badge.ai { background: rgba(226, 96, 26, .5); }

/* ===== メイン ===== */
.main { flex: 1; padding: 28px 36px 80px; max-width: var(--main-max); }

.page-head { margin-bottom: 18px; animation: rise .4s ease both; }
.page-head h1 { font-size: 26px; color: var(--teal-deep); letter-spacing: .01em; }
.page-head .desc { font-size: 13.5px; color: #5c6862; margin-top: 2px; }

.badges { display: inline-flex; gap: 6px; margin-left: 10px; vertical-align: middle; }
.badge {
  font-size: 11px; padding: 2px 9px; border-radius: 999px; font-weight: 600;
  letter-spacing: .03em; white-space: nowrap;
}
.badge.free { background: #ddefe3; color: var(--ok); }
.badge.simple { background: var(--warn-bg); color: var(--warn); }
.badge.ai { background: var(--kaki-soft); color: #b34a10; }
.badge.unverified { background: #f3e0e0; color: #a03030; }

/* ===== 検索フォーム ===== */
.tool-form {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
  display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end;
  animation: rise .45s .05s ease both;
}
.field { display: flex; flex-direction: column; gap: 4px; }
.field label { font-size: 11.5px; font-weight: 600; color: #6b7570; letter-spacing: .04em; }
.field input[type="text"], .field select, .field textarea {
  font-family: inherit; font-size: 14.5px;
  padding: 9px 12px;
  border: 1.5px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.field input[type="text"]:focus, .field select:focus, .field textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(21, 94, 99, 0.12);
}
.field.grow { flex: 1; min-width: 220px; }
.field textarea { min-height: 110px; resize: vertical; font-family: var(--mono); font-size: 13px; }

.btn {
  font-family: var(--jp);
  font-size: 14.5px; font-weight: 700;
  padding: 10px 22px;
  border: none; border-radius: 10px;
  background: linear-gradient(180deg, var(--kaki), #c95212);
  color: #fff; cursor: pointer;
  box-shadow: 0 3px 8px rgba(226, 96, 26, 0.35);
  transition: transform .12s, box-shadow .12s, filter .12s;
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.06); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .55; cursor: wait; transform: none; }
.btn.ghost {
  background: transparent; color: var(--teal);
  border: 1.5px solid var(--teal); box-shadow: none;
  font-size: 12.5px; padding: 6px 14px;
}
.btn.ghost:hover { background: rgba(21, 94, 99, 0.07); }

/* ===== 結果 ===== */
.results { margin-top: 20px; animation: rise .4s ease both; }
.result-meta {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font-size: 12.5px; color: #5c6862; margin-bottom: 10px;
}
.result-meta .count { font-family: var(--mono); font-weight: 600; color: var(--teal-deep); font-size: 15px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 16px;
}
.card .card-title {
  padding: 10px 16px; font-size: 13.5px; font-weight: 700;
  background: var(--paper-deep); color: var(--teal-deep);
  border-bottom: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap;
}

table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th {
  text-align: left; padding: 8px 14px; font-size: 11.5px;
  color: #77817b; font-weight: 600; letter-spacing: .05em;
  border-bottom: 1.5px solid var(--line); background: #fbf8f0;
  white-space: nowrap;
}
.tbl td { padding: 7.5px 14px; border-bottom: 1px solid #eee7d6; vertical-align: top; }
.tbl tr:hover td { background: #f7f2e4; }
.tbl td.num { font-family: var(--mono); text-align: right; white-space: nowrap; }
.tbl a { color: var(--teal); text-decoration: none; word-break: break-all; }
.tbl a:hover { text-decoration: underline; }
.tbl .pos {
  display: inline-block; min-width: 26px; text-align: center;
  font-family: var(--mono); font-weight: 700; font-size: 12.5px;
  background: var(--teal); color: #fff; border-radius: 7px; padding: 1px 5px;
}
.tbl .pos.top3 { background: var(--kaki); }

.chips { display: flex; flex-wrap: wrap; gap: 7px; padding: 14px 16px; }
.chip {
  font-size: 13px; padding: 4px 12px; border-radius: 999px;
  background: #eef3ec; border: 1px solid #d7e0d5; cursor: pointer;
  transition: background .12s, border-color .12s;
}
.chip:hover { background: var(--kaki-soft); border-color: var(--kaki); }
.ai-write-btn {
  display: inline-block; margin-left: 5px; cursor: pointer;
  padding: 2px 5px; border-radius: 6px; transition: background .12s;
}
.ai-write-btn:hover { background: var(--kaki-soft); }

pre.output {
  padding: 16px 18px; white-space: pre-wrap; word-break: break-word;
  font-family: var(--mono); font-size: 13px; line-height: 1.75;
  max-height: 560px; overflow-y: auto;
}

/* 関連キーワード: フィルタバー・HITバッジ・難易度 */
.filter-bar {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 12px 16px; margin-bottom: 4px;
}
.filter-bar .field input, .filter-bar .field select { font-size: 13px; padding: 6px 10px; }
.hit-badge {
  border: 2px solid #c0392b; color: #c0392b; border-radius: 8px;
  padding: 2px 12px; font-weight: 700; font-family: var(--mono); font-size: 13px;
  background: #fff;
}
.hit-badge .count { color: #c0392b; }
.kd-btn {
  font-family: inherit; font-size: 11px; padding: 2px 10px;
  border: 1px solid var(--teal); color: var(--teal); background: #fff;
  border-radius: 999px; cursor: pointer;
}
.kd-btn:hover { background: rgba(21, 94, 99, 0.08); }
.kd-score {
  display: inline-block; min-width: 34px; text-align: center;
  font-family: var(--mono); font-weight: 700; font-size: 13px;
  border: 2px solid; border-radius: 999px; padding: 1px 8px; background: #fff;
}
.tbl td.dim { color: #b6ad97; }

.note {
  font-size: 12px; color: var(--warn);
  background: var(--warn-bg); border: 1px solid #ecd9ae;
  border-radius: 9px; padding: 8px 12px; margin-top: 10px;
}
.error-box {
  background: #fbeaea; border: 1px solid #e4b8b8; color: #963a3a;
  border-radius: 9px; padding: 12px 16px; font-size: 13.5px; margin-top: 16px;
}

/* ローディング（泳ぐカワウソ） */
.loading { display: flex; align-items: center; gap: 12px; padding: 28px 8px; color: #6b7570; font-size: 13.5px; }
.swim { display: flex; gap: 5px; }
.swim span {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--teal); opacity: .3;
  animation: swim 1.2s infinite ease-in-out;
}
.swim span:nth-child(2) { animation-delay: .15s; }
.swim span:nth-child(3) { animation-delay: .3s; }
.swim span:nth-child(4) { animation-delay: .45s; background: var(--kaki); }
@keyframes swim { 0%, 100% { transform: translateY(0); opacity: .3; } 50% { transform: translateY(-7px); opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* ===== ダッシュボード（ホーム） ===== */
.hero {
  text-align: center; padding: 38px 20px 30px;
  animation: rise .4s ease both;
}
.hero img { width: 140px; height: 140px; border-radius: 50%; object-fit: cover; box-shadow: 0 6px 24px rgba(29,42,40,.15); animation: bob 3.2s ease-in-out infinite; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
.hero h1 { font-size: 34px; color: var(--teal-deep); margin-top: 6px; }
.hero .tagline { color: #5c6862; font-size: 14px; margin-top: 4px; }
.hero-search {
  display: flex; gap: 10px; max-width: 640px; margin: 24px auto 0;
}
.hero-search input {
  flex: 1; font-size: 16px; padding: 13px 18px;
  border: 2px solid var(--teal); border-radius: 12px;
  background: #fff; outline: none; font-family: inherit;
}
.hero-search input:focus { box-shadow: 0 0 0 4px rgba(21, 94, 99, 0.14); }
.hero-search select {
  font-family: inherit; font-size: 13.5px; font-weight: 600;
  padding: 0 12px; border: 2px solid var(--teal); border-radius: 12px;
  background: #fff; color: var(--teal-deep); outline: none; cursor: pointer;
}
.quick-tags { display: flex; gap: 8px; justify-content: center; margin-top: 14px; flex-wrap: wrap; }
.feature-links { display: flex; gap: 18px; justify-content: center; margin-top: 12px; flex-wrap: wrap; font-size: 13px; }
.feature-links a { color: var(--teal); text-decoration: none; font-weight: 600; }
.feature-links a:hover { text-decoration: underline; }

/* サジェスト深掘りセクション */
.sg-group { border-bottom: 1px dashed #e5dcc6; }
.sg-group:last-child { border-bottom: none; }
.sg-group-title {
  padding: 10px 16px 0; font-size: 12.5px; font-weight: 700; color: var(--teal-deep);
}
.sg-group .chips { padding-top: 8px; }

/* 初心者ガイド（カワウソさんの吹き出し） */
.guide { display: flex; gap: 18px; align-items: flex-start; padding: 22px 24px; border: none; }
.guide img { width: 76px; height: 76px; border-radius: 50%; flex-shrink: 0; box-shadow: 0 3px 10px rgba(29,42,40,.15); }
.guide-bubble {
  position: relative; flex: 1;
  background: #fbf8f0; border: 1px solid var(--line); border-radius: 14px;
  padding: 16px 20px; font-size: 14.5px; line-height: 1.9;
}
.guide-bubble::before {
  content: ""; position: absolute; left: -9px; top: 28px;
  width: 16px; height: 16px; background: #fbf8f0;
  border-left: 1px solid var(--line); border-bottom: 1px solid var(--line);
  transform: rotate(45deg);
}
.example-links { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 10px; }
.example-link {
  font-family: inherit; font-size: 13.5px; font-weight: 600;
  background: none; border: none; cursor: pointer;
  color: var(--teal); padding: 2px 0;
}
.example-link:hover { text-decoration: underline; color: var(--kaki); }

.tool-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px; margin-top: 28px;
}
.tool-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px;
  cursor: pointer; transition: transform .15s, box-shadow .15s, border-color .15s;
  animation: rise .5s ease both;
}
.tool-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--teal); }
.tool-card h3 { font-size: 15px; color: var(--teal-deep); }
.tool-card p { font-size: 12px; color: #6b7570; margin-top: 4px; }

/* ===== ジャンル別トレンド ===== */
.gt-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 16px; margin-top: 4px;
}
.gt-card .card-title { align-items: baseline; }
.gt-rank { list-style: none; padding: 10px 16px 4px; display: flex; flex-direction: column; gap: 8px; }
.gt-rank li { display: flex; align-items: center; gap: 8px; }
.gt-idx {
  width: 18px; flex-shrink: 0; text-align: right;
  font-family: var(--mono); font-size: 11.5px; color: #8a9490;
}
.gt-kw { flex-shrink: 0; max-width: 46%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gt-bar {
  flex: 1; height: 6px; border-radius: 3px; background: #eee7d6; overflow: hidden;
}
.gt-bar span { display: block; height: 100%; background: var(--teal); border-radius: 3px; }
.gt-val { width: 2.5em; flex-shrink: 0; text-align: right; font-family: var(--mono); font-size: 11.5px; color: #8a9490; }
.gt-rising { border-top: 1px dashed #e5dcc6; padding: 10px 16px 14px; }
.gt-rising-title {
  font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--warn); font-weight: 700; margin-bottom: 8px;
}
.gt-rising .chips { padding: 0; }
.gt-rising-chip strong { color: var(--warn); font-family: var(--mono); margin-left: 4px; }

/* ===== 料金プラン ===== */
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-top: 8px; }
.plan {
  background: var(--card); border: 1.5px solid var(--line);
  border-radius: var(--radius); padding: 20px 18px; text-align: center;
  animation: rise .5s ease both;
}
.plan.featured { border-color: var(--kaki); box-shadow: 0 6px 20px rgba(226, 96, 26, .18); position: relative; }
.plan.featured::before {
  content: "人気"; position: absolute; top: -11px; left: 50%; transform: translateX(-50%);
  background: var(--kaki); color: #fff; font-size: 11px; font-weight: 700;
  padding: 2px 14px; border-radius: 999px;
}
.plan h3 { font-size: 16px; color: var(--teal-deep); }
.plan .price { font-family: var(--mono); font-size: 26px; font-weight: 700; margin: 8px 0 2px; }
.plan .price small { font-size: 12px; font-weight: 400; color: #6b7570; }
.plan ul { list-style: none; text-align: left; margin-top: 12px; font-size: 12.5px; color: #47524d; }
.plan ul li { padding: 4px 0; border-bottom: 1px dashed #e5dcc6; }
.plan ul li::before { content: "✓ "; color: var(--ok); font-weight: 700; }

.compare-wrap { overflow-x: auto; margin-top: 20px; }
.compare-wrap table.tbl { min-width: 700px; }
.compare-wrap .tbl td { font-size: 12.5px; }

/* ===== 見積書 ===== */
.quote-sheet {
  background: #fff; border: 1px solid var(--line); border-radius: 4px;
  max-width: 720px; padding: 44px 48px; margin-top: 18px;
  box-shadow: var(--shadow); font-size: 13.5px;
}
.quote-sheet h2 {
  text-align: center; font-size: 24px; letter-spacing: .5em; text-indent: .5em;
  border-bottom: 3px double var(--ink); padding-bottom: 10px; margin-bottom: 24px;
}
.quote-row { display: flex; justify-content: space-between; gap: 24px; margin-bottom: 20px; }
.quote-to { font-size: 16px; border-bottom: 1px solid var(--ink); padding: 4px 8px; min-width: 260px; }
.quote-issuer { text-align: right; font-size: 12px; line-height: 1.8; }
.quote-total {
  font-size: 18px; font-weight: 700; border: 2px solid var(--ink);
  padding: 8px 18px; display: inline-block; margin: 12px 0;
}
.quote-sheet table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.quote-sheet table th, .quote-sheet table td { border: 1px solid #999; padding: 8px 12px; font-size: 13px; }
.quote-sheet table th { background: #f0ece0; }
.quote-sheet .amount { text-align: right; font-family: var(--mono); }

/* ===== クチコミ ===== */
.review {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 18px; margin-bottom: 10px; animation: rise .4s ease both;
}
.review .stars { color: var(--kaki); letter-spacing: 2px; }
.review .who { font-size: 12px; color: #77817b; margin-top: 4px; }

/* ===== APIドキュメント ===== */
.api-code {
  background: var(--teal-dark); color: #cfe8e2;
  border-radius: 10px; padding: 14px 18px;
  font-family: var(--mono); font-size: 12.5px; line-height: 1.7;
  overflow-x: auto; white-space: pre; margin: 10px 0;
}
.method-get, .method-post {
  font-family: var(--mono); font-size: 11px; font-weight: 700;
  padding: 2px 8px; border-radius: 6px; margin-right: 6px;
}
.method-get { background: #ddefe3; color: var(--ok); }
.method-post { background: var(--kaki-soft); color: #b34a10; }

/* ===== トレンドチャート ===== */
.gt-wrap { position: relative; padding: 18px 18px 8px; }
.gt-legend { display: flex; flex-wrap: wrap; gap: 14px; padding: 12px 18px 0; font-size: 12.5px; }
.gt-legend .dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; }
.gt-svg { width: 100%; height: auto; display: block; }
.gt-tooltip {
  position: absolute; pointer-events: none; display: none;
  background: #fff; border: 1px solid var(--line); border-radius: 9px;
  box-shadow: var(--shadow); padding: 8px 12px; font-size: 12px; line-height: 1.6;
  min-width: 140px; z-index: 5;
}
.gt-tooltip .tt-time { font-weight: 700; color: #5c6862; margin-bottom: 2px; }
.gt-tooltip .num { font-family: var(--mono); font-weight: 600; float: right; margin-left: 12px; }
.gt-table summary { cursor: pointer; padding: 10px 18px; font-size: 12.5px; color: var(--teal); }
.rising-badge { font-family: var(--mono); font-size: 11px; font-weight: 700; color: #c0392b; background: #fbeaea; border-radius: 6px; padding: 1px 7px; }

/* 印刷: 見積書のみ */
@media print {
  .sidebar, .tool-form, .page-head, .no-print { display: none !important; }
  .main { padding: 0; max-width: none; }
  .quote-sheet { box-shadow: none; border: none; max-width: none; }
  body { background: #fff; }
}

@media (max-width: 860px) {
  .layout { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; }
  .main { padding: 20px 16px 60px; }
}
