/* 割安株ウォッチ：古い投資の帳簿（レジャー）風。クリーム色の紙に深緑のヘッダー、見出しは明朝・セリフ、罫線は二重線。
   データの横棒は dataviz の検証済みパレットの先頭（青）1色。緑と金は飾りにだけ使い、意味は数字と文字でも出す */
:root {
  color-scheme: light;
  --page: #f6f3ea; --surface: #fffdf7; --surface-2: #f1ede1;
  --ink: #1b1b18; --ink-2: #45443e; --muted: #72705f;
  --grid: #e3dccb; --axis: #c8bfa8; --border: rgba(27,27,24,0.13);
  --bar: #2a78d6; --track: #ebe5d6;
  --accent: #1d5c4b; --gold: #b08a2e; --accent-wash: rgba(29,92,75,0.07); --warn: #8a4b0f; --warn-wash: rgba(176,110,20,0.10);
  --head: #1d4a3c;
  --serif: Georgia, "Yu Mincho", "YuMincho", "Hiragino Mincho ProN", "Noto Serif JP", serif;
  --mono: ui-monospace, "Cascadia Mono", "Consolas", "SFMono-Regular", monospace;
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --page: #0f1210; --surface: #161a17; --surface-2: #1b201c;
    --ink: #e9e6dc; --ink-2: #b9b5a8; --muted: #8b877a;
    --grid: #262c27; --axis: #3b433c; --border: rgba(255,255,255,0.10);
    --bar: #3987e5; --track: #232924;
    --accent: #7fd1b3; --gold: #d9b65c; --accent-wash: rgba(127,209,179,0.08); --warn: #f0b36b; --warn-wash: rgba(240,179,107,0.12);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0f1210; --surface: #161a17; --surface-2: #1b201c;
  --ink: #e9e6dc; --ink-2: #b9b5a8; --muted: #8b877a;
  --grid: #262c27; --axis: #3b433c; --border: rgba(255,255,255,0.10);
  --bar: #3987e5; --track: #232924;
  --accent: #7fd1b3; --gold: #d9b65c; --accent-wash: rgba(127,209,179,0.08); --warn: #f0b36b; --warn-wash: rgba(240,179,107,0.12);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; color: var(--ink); background: var(--page); font: 15px/1.8 system-ui, -apple-system, "Segoe UI", "Hiragino Sans", "Yu Gothic UI", "Meiryo", sans-serif; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }

/* ヘッダー：深緑に金の細い罫 */
.bar { position: sticky; top: 0; z-index: 10; background: var(--head); color: #f2efe4; border-bottom: 3px double #c9a44a; }
.bar-in { max-width: 1120px; margin: 0 auto; padding: 10px 20px 4px; display: flex; align-items: center; gap: 12px; }
.logo { display: flex; flex-direction: column; text-decoration: none; color: inherit; line-height: 1.25; min-width: 0; }
.mark-logo { font: 700 11px/1.4 var(--mono); letter-spacing: 0.26em; color: #d9bd72; white-space: nowrap; }
.logo .name { font: 700 22px/1.3 var(--serif); color: #fff; white-space: nowrap; }
.tools { margin-left: auto; display: flex; gap: 8px; flex-shrink: 0; }
.lang, .theme { white-space: nowrap; font: 500 12px var(--mono); color: #f2efe4; background: transparent; border: 1px solid #4f7467; border-radius: 3px;
  padding: 4px 10px; text-decoration: none; cursor: pointer; }
.lang:hover, .theme:hover { border-color: #d9bd72; }
.tabs { max-width: 1120px; margin: 0 auto; padding: 0 12px; display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.tabs a { position: relative; color: #b8cbc2; text-decoration: none; padding: 7px 10px 9px; font-size: 13.5px; white-space: nowrap; }
.tabs a:hover { color: #fff; }
.tabs a[aria-current] { color: #fff; font-weight: 700; }
.tabs a[aria-current]::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: 0; height: 3px; background: #d9bd72; }

main { max-width: 1120px; margin: 0 auto; padding: 8px 20px 24px; }
.alert { background: var(--warn-wash); border: 1px solid var(--warn); border-radius: 4px; padding: 10px 14px; margin: 16px 0; }

.hero { padding: 40px 0 10px; max-width: 920px; }
.kicker { display: inline-block; font: 700 12px var(--mono); letter-spacing: 0.24em; color: var(--accent); border-top: 1px solid var(--accent); border-bottom: 1px solid var(--accent);
  padding: 2px 4px; margin: 0 0 16px; }
.hero h1 { font: 700 clamp(28px, 4.4vw, 42px)/1.35 var(--serif); margin: 0 0 18px; }
.hero .mark { box-shadow: inset 0 -0.35em 0 var(--accent-wash); border-bottom: 2px solid var(--gold); }
.lead { color: var(--ink-2); font-size: 16px; margin: 0 0 14px; max-width: 880px; }

.block { margin: 40px 0; }
.block > h2 { font: 700 21px/1.4 var(--serif); margin: 0 0 14px; padding: 0 0 8px; border-bottom: 3px double var(--axis); }
.block h3 { font: 700 15.5px/1.5 var(--serif); margin: 20px 0 8px; }
.more { margin: 12px 0 0; font-weight: 600; }
.more a { text-decoration: none; }
.note { color: var(--muted); font-size: 12.5px; margin: 8px 0 0; }
.small { font-size: 12.5px; }
.muted { color: var(--muted); }
.updated { color: var(--muted); font: 12px var(--mono); margin: 32px 0 0; }
.disclaimer { margin: 28px 0 0; padding: 12px 14px; border: 1px dashed var(--axis); border-radius: 4px; font-size: 12.5px; color: var(--ink-2); background: var(--surface); }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin: 10px 0 14px; }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: 4px; padding: 10px 14px 12px; display: flex; flex-direction: column; border-top: 3px solid var(--accent); }
.t-label { font-size: 12px; color: var(--ink-2); line-height: 1.5; }
.t-val { font: 700 23px/1.35 system-ui, sans-serif; font-variant-numeric: tabular-nums; margin: 2px 0; overflow-wrap: anywhere; }
.t-note { font-size: 11.5px; color: var(--muted); line-height: 1.5; }

/* 表 */
.tbl-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 4px; }
table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
th, td { padding: 8px 10px; border-bottom: 1px solid var(--grid); text-align: left; vertical-align: top; }
thead th { font-size: 11.5px; color: var(--muted); font-weight: 600; background: var(--surface-2); line-height: 1.4; vertical-align: bottom; }
tbody tr:last-child th, tbody tr:last-child td { border-bottom: 0; }
table.num td { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.num td.txt { text-align: left; white-space: normal; }
table.num thead th { text-align: right; }
table.num thead th:first-child, table.num thead th:nth-child(2), table.num thead th:nth-child(3), table.num thead th:nth-last-child(-n+2) { text-align: left; }
table.cand th[scope="row"] { min-width: 190px; }
th small { display: block; font-weight: 400; color: var(--muted); font-size: 11.5px; }
th a { color: var(--ink); text-decoration: none; font-weight: 700; }
th a:hover { color: var(--accent); text-decoration: underline; }
td.rk { color: var(--muted); font-weight: 700; text-align: left !important; font-family: var(--mono); }
td.score { text-align: left !important; min-width: 130px; }
td.score .hb { margin: 5px 0 2px; }
td.score .sc { font-weight: 700; font-size: 14px; }
td.small { font-size: 12.5px; min-width: 260px; }
tbody tr:hover th, tbody tr:hover td { background: var(--accent-wash); }
.hb { display: block; height: 9px; background: var(--track); border-radius: 0 4px 4px 0; overflow: hidden; }
.hb i { display: block; height: 100%; background: var(--bar); border-radius: 0 4px 4px 0; }
.hb.avg i { background: var(--axis); }
.new { font: 700 10px var(--mono); color: var(--accent); border: 1px solid var(--accent); border-radius: 3px; padding: 0 4px; margin-left: 4px; vertical-align: 2px; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chip { font-size: 12px; line-height: 1.5; padding: 1px 8px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.chip.warn { border-color: var(--warn); color: var(--warn); background: var(--warn-wash); }
.chip.warn::before { content: "! "; font-weight: 700; }

/* 概要のカード */
.fcards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
.fc { background: var(--surface); border: 1px solid var(--border); border-top: 3px solid var(--accent); border-radius: 4px; padding: 12px 16px 12px; }
.fc h3 { margin: 0 0 6px; font: 700 16px/1.5 var(--serif); }
.fc h3 small { display: block; font: 400 12px/1.5 system-ui, sans-serif; color: var(--muted); }
.fc-n { margin: 0 0 10px; color: var(--ink-2); font-size: 13px; }
.fc-n b { display: block; font: 800 36px/1.15 system-ui, sans-serif; color: var(--ink); font-variant-numeric: tabular-nums; }
.fc-bars { display: grid; grid-template-columns: auto 1fr auto; gap: 5px 10px; align-items: center; font-size: 12.5px; }
.fc-bl { color: var(--ink-2); white-space: nowrap; }
.fc-bv { font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.fc-k { margin: 8px 0 0; font-size: 11.5px; color: var(--muted); }

/* 検証の横棒（同じ目盛り、全体の中央値に縦線） */
.rbars { display: grid; gap: 6px; }
.rb { display: grid; grid-template-columns: minmax(120px, 20%) 1fr 210px; gap: 10px; align-items: center; font-size: 13.5px; }
.rb-l { color: var(--ink-2); }
.rb.hi .rb-l { color: var(--ink); font-weight: 700; }
.rb-bar { position: relative; height: 14px; background: var(--track); border-radius: 0 4px 4px 0; }
.rb-bar i { display: block; height: 100%; background: var(--bar); border-radius: 0 4px 4px 0; }
.rb-bar b { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--ink); opacity: 0.55; }
.rb-v { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rb-v small { font-weight: 400; color: var(--muted); font-size: 11.5px; margin-left: 6px; }
.rb.neg .rb-v { color: var(--warn); }
.concl { margin: 0 0 8px; padding-left: 1.4em; display: grid; gap: 8px; font-size: 15.5px; }
.concl li::marker { color: var(--accent); font-weight: 700; }

/* 会社のページ */
.crumb { font-size: 13px; margin: 20px 0 0; color: var(--muted); }
h1.co { font: 700 clamp(22px, 3.6vw, 32px)/1.35 var(--serif); margin: 6px 0 12px; }
h1.co small { display: block; font: 400 13px system-ui, sans-serif; color: var(--muted); }
.verdict { background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--accent); border-radius: 4px; padding: 12px 16px; margin: 0 0 14px; font-size: 16px; }
.verdict p { margin: 0; }
.warns { margin: 0 0 10px; }
.warns p { margin: 4px 0; font-size: 13.5px; color: var(--ink-2); }
.warns .chip { margin-right: 8px; }
.thesis { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.thesis li { background: var(--surface); border: 1px solid var(--border); border-radius: 4px; padding: 10px 14px; }
.thesis li > p { margin: 0 0 6px; }
.thesis blockquote { margin: 0; padding: 4px 10px; border-left: 3px solid var(--gold); color: var(--ink-2); font-size: 13px; background: var(--surface-2); }
.thesis cite { display: block; font-style: normal; font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.thesis cite::before { content: "— "; }
.numsrc { margin: 0; font-size: 12.5px; color: var(--muted); }
.facts { display: grid; grid-template-columns: minmax(0, 1fr) auto; margin: 0 0 8px; background: var(--surface); border: 1px solid var(--border); border-radius: 4px; max-width: 560px; }
.facts dt, .facts dd { margin: 0; padding: 6px 12px; border-bottom: 1px solid var(--grid); }
.facts dt { color: var(--ink-2); font-size: 13px; }
.facts dd { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.facts dt:last-of-type, .facts dd:last-of-type { border-bottom: 0; }
.method dt { font: 700 15px var(--serif); margin: 16px 0 4px; }
.method dd { margin: 0; color: var(--ink-2); }

footer.site-foot { max-width: 1120px; margin: 0 auto; padding: 18px 20px 40px; border-top: 3px double var(--axis); display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 13px; color: var(--muted); }
footer.site-foot a { color: var(--ink); }

@media (max-width: 720px) {
  body { font-size: 14.5px; }
  .bar-in { padding: 10px 14px 4px; gap: 10px; }
  .mark-logo { font-size: 10px; letter-spacing: 0.16em; }
  .logo .name { font-size: 19px; }
  .lang, .theme { font-size: 11px; padding: 3px 8px; }
  main { padding: 4px 14px 20px; }
  .block { margin: 28px 0; }
  .hero { padding: 26px 0 6px; }
  .lead { font-size: 15px; }
  .tiles { grid-template-columns: 1fr 1fr; gap: 8px; }
  .t-val { font-size: 19px; }
  .tabs { -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); }
  .rb { grid-template-columns: 1fr auto; gap: 2px 8px; }
  .rb-bar { grid-column: 1 / -1; order: 3; }
  .rb-v small { display: block; margin: 0; text-align: right; }
  /* 表はスマホ幅では1行を1枚のカードに */
  .tbl-wrap { overflow: visible; background: transparent; border: 0; }
  table.stack thead { display: none; }
  table.stack, table.stack tbody { display: block; width: 100%; }
  table.stack tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 10px; row-gap: 4px; position: relative;
    background: var(--surface); border: 1px solid var(--border); border-radius: 4px; padding: 10px 12px; margin-bottom: 8px; }
  table.stack th[scope="row"] { grid-column: 1 / -1; padding: 0 40px 4px 0; border: 0; font-size: 15px; }
  table.stack td { display: flex; flex-direction: column; padding: 0; border: 0; text-align: left !important; white-space: normal; font-size: 15px; font-weight: 600; min-width: 0; }
  table.stack td::before { content: attr(data-label); color: var(--muted); font-size: 11px; font-weight: 400; line-height: 1.4; }
  table.stack td.txt, table.stack td.score { grid-column: 1 / -1; font-weight: 400; font-size: 13px; }
  table.stack td.score .sc { font-weight: 700; font-size: 15px; }
  table.stack td.rk { position: absolute; top: 10px; right: 12px; font-size: 16px; color: var(--accent); flex-direction: row; }
  table.stack td.rk::before { content: "#"; font-size: 14px; color: var(--accent); }
  tbody tr:hover th, tbody tr:hover td { background: transparent; }
  .facts { max-width: none; }
}
@media (forced-colors: active) { .hb i, .rb-bar i { forced-color-adjust: none; } }

/* 選び方の比較・Fスコアの点検 */
.fcards.four { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
table.cmp td { text-align: right; }
table.cmp td small { display: block; font-size: 11px; color: var(--muted); font-weight: 400; }
table.cmp td.neg { color: var(--warn); }
table.cmp tr.hi th, table.cmp tr.hi td { background: var(--accent-wash); font-weight: 700; }
table.cmp tr.hi th::before { content: "▶ "; color: var(--accent); }
ul.plain { margin: 8px 0 0; padding-left: 1.2em; font-size: 12.5px; color: var(--muted); }
.fchecks { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 6px; }
.fchecks li { background: var(--surface); border: 1px solid var(--border); border-radius: 4px; padding: 6px 10px; font-size: 13.5px; }
.fchecks li span { display: inline-block; width: 1.4em; font-weight: 700; }
.fchecks li.ok span { color: var(--accent); }
.fchecks li.ng { color: var(--ink-2); }
.fchecks li.ng span { color: var(--warn); }
.fchecks li.na { color: var(--muted); }
.fchecks li small { margin-left: 6px; font-size: 11px; }

table.cand thead th { white-space: nowrap; }
