/* Phase 3h briefing home ("Direction 2 ブリーフィング"). Light newspaper page. */
:root {
  --paper: #f3eee4;
  --ink: #1c1612;
  --rule: #d4c8b6;
  --muted: #6a6156;
  --faint: #8a8176;
  --major: #8e1e18;
  --major-bg: #f7ebe6;
  --card: #faf7f1;
  --track: #e3d9cb;
  --serif: "Newsreader", "Hiragino Mincho ProN", "Yu Mincho", "YuMincho", "Noto Serif CJK JP", "Noto Serif JP", serif;
  --sans: "IBM Plex Sans", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans CJK JP", "Noto Sans JP", sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--paper); color: var(--ink);
  font-family: var(--sans); font-size: 14px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 2px solid var(--major); outline-offset: 2px; }
[hidden] { display: none !important; }

.app { max-width: 1440px; min-height: 100vh; margin: 0 auto; padding: 0 48px; display: flex; flex-direction: column; }

/* ---------------------------------------------------------------- masthead */
.mast {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 24px;
  padding: 22px 0 14px; border-bottom: 3px solid var(--ink);
}
.mast h1 { font-family: var(--serif); font-size: 36px; font-weight: 600; letter-spacing: -0.03em; line-height: 1; }
.mast .kicker { font-size: 11px; letter-spacing: 0.16em; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
/* Kicker row with a short way into the knowledge graph (the CTA in the rail is far down on phones). */
.mast-top { display: flex; align-items: center; gap: 16px; margin-bottom: 2px; }
.mast-top .kicker { margin-bottom: 0; }
.mast-graph {
  display: inline-flex; align-items: center; gap: 4px; min-height: 24px; padding: 0 2px;
  font-size: 12px; font-weight: 600; color: var(--muted); border-bottom: 1px solid var(--rule); white-space: nowrap;
}
.mast-graph:hover { color: var(--major); border-color: var(--major); }
.mast .meta { text-align: right; font-size: 12px; color: var(--muted); line-height: 1.55; font-variant-numeric: tabular-nums; }
.mast .meta b { color: var(--ink); font-weight: 600; }
.meta .ok { color: var(--muted); }
.meta .bad { color: var(--major); font-weight: 600; }

.stale-warning {
  margin-top: 8px; padding: 7px 10px; border: 1px solid var(--major); background: var(--major-bg);
  color: var(--major); font-size: 13px; font-weight: 600;
}

/* ---------------------------------------------------------------- honesty strip */
.honesty {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px;
  padding: 8px 0 10px; border-bottom: 1px solid var(--rule); font-size: 12px; color: var(--muted);
}
.honesty-text { flex: 1 1 400px; min-width: 0; }
.badge {
  display: inline-flex; align-items: center; height: 20px; padding: 0 8px; flex: none;
  border: 1px solid var(--major); color: var(--major); font-size: 11px; font-weight: 600;
  letter-spacing: 0.04em; background: var(--major-bg); white-space: nowrap;
}
.caveats { flex: none; font-size: 12px; }
.caveats summary {
  cursor: pointer; color: var(--muted); list-style: none; border-bottom: 1px dotted var(--faint);
  padding: 3px 0; white-space: nowrap;
}
.caveats summary::-webkit-details-marker { display: none; }
.caveats summary::after { content: " ▾"; font-size: 10px; }
.caveats[open] summary::after { content: " ▴"; }
.caveats[open] { flex-basis: 100%; }
.caveats ul {
  list-style: none; margin-top: 8px; padding: 10px 14px; background: var(--card); border: 1px solid var(--rule);
  display: grid; gap: 6px; color: var(--ink); line-height: 1.6; max-width: 980px;
}
.caveats li { padding-left: 12px; position: relative; }
.caveats li::before { content: ""; position: absolute; left: 0; top: 0.75em; width: 5px; height: 1px; background: var(--faint); }

/* ---------------------------------------------------------------- grid */
.grid { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 36px; padding: 14px 0 28px; }
.leads { display: flex; flex-direction: column; min-width: 0; }

.tabs-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.tabs { display: flex; gap: 0; border: 1px solid var(--rule); }
.tabs button {
  font: inherit; font-size: 12px; font-weight: 600; color: var(--muted); background: transparent;
  border: 0; border-left: 1px solid var(--rule); padding: 0 12px; height: 28px; cursor: pointer; letter-spacing: 0.02em;
}
.tabs button:first-child { border-left: 0; }
.tabs button:hover { color: var(--ink); }
.tabs button[aria-selected="true"] { background: var(--ink); color: var(--paper); }
.feed-status { font-size: 11px; color: var(--faint); text-align: right; font-variant-numeric: tabular-nums; }
.feed-status.err { color: var(--major); }
.feed-note { font-size: 12px; color: var(--muted); margin: -4px 0 12px; }

/* lead headlines */
.lead { padding-bottom: 16px; border-bottom: 1px solid var(--rule); margin-bottom: 14px; }
.flag-line { font-size: 11px; font-weight: 700; letter-spacing: 0.12em; color: var(--major); text-transform: uppercase; }
.flag-line.n { color: var(--muted); }
.lead h2 {
  font-family: var(--serif); font-size: 32px; font-weight: 600; letter-spacing: -0.025em; line-height: 1.15;
  margin: 6px 0 8px; overflow-wrap: anywhere;
}
.lead h2 a:hover, .row .ttl a:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.lead.second h2 { font-size: 22px; line-height: 1.22; }
.lead .sum { font-size: 14px; color: var(--ink); margin: -2px 0 6px; line-height: 1.6; max-width: 62em; }
.lead .by { font-size: 12px; color: var(--muted); }
.new {
  display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: 0.1em; color: var(--paper);
  background: var(--major); padding: 1px 5px; margin-left: 2px; vertical-align: 1px; line-height: 1.4;
}

/* dense list */
.stack-head { display: none; }
.lead-brief { display: none; }  /* phones only (see the mobile block) */
.stack { display: flex; flex-direction: column; }
.row { display: grid; grid-template-columns: 52px 112px minmax(0, 1fr); gap: 8px; padding: 8px 0; border-top: 1px solid var(--rule); }
.row:last-child { border-bottom: 1px solid var(--rule); }
.row .flag { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; color: var(--muted); padding-top: 2px; }
.row .flag.m { color: var(--major); }
.row .flag.minor { color: var(--faint); font-weight: 600; }
.row .who { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.row .who b { display: block; color: var(--ink); font-weight: 600; font-size: 12.5px; }
.row .ttl { font-size: 15px; font-weight: 500; line-height: 1.35; font-family: var(--serif); overflow-wrap: anywhere; }
.row .ttl .new { font-family: var(--sans); margin: 0 6px 0 0; }
.row .sum { display: block; font-family: var(--sans); font-size: 12px; color: var(--muted); font-weight: 400; margin-top: 2px; }
.empty { font-size: 13px; color: var(--muted); padding: 14px 0; }
.empty.err { color: var(--major); }
.feed-more { font-size: 12px; color: var(--faint); padding: 10px 0 0; }

/* ---------------------------------------------------------------- right rail */
.rail { border-left: 1px solid var(--rule); padding-left: 28px; display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.rail h3, .mobile-probs h3, .stack-head { font-size: 11px; letter-spacing: 0.14em; font-weight: 700; color: var(--muted); }
.plist { display: flex; flex-direction: column; margin-top: 2px; }
.p { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 8px 0; border-top: 1px solid var(--rule); align-items: end; min-height: 62px; }
.p:first-child { border-top: 0; }
.p .co { font-size: 13px; font-weight: 600; }
.p .sub { font-size: 10px; color: var(--faint); grid-column: 1; font-variant-numeric: tabular-nums; }
.p .pct { font-family: var(--sans); font-size: 22px; font-weight: 500; letter-spacing: -0.03em; line-height: 1; text-align: right; font-variant-numeric: tabular-nums; }
.p .pct.na { font-size: 13px; color: var(--faint); letter-spacing: 0; }
.p .chg { font-size: 10px; color: var(--faint); text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.p .chg.up, .p .chg.down { color: var(--ink); font-weight: 600; }
.p .bar { grid-column: 1 / -1; height: 3px; background: var(--track); position: relative; margin-top: 2px; }
.p .bar i { display: block; height: 100%; background: var(--ink); }
.p .bar b { position: absolute; top: -2px; width: 1px; height: 7px; background: var(--major); }
/* 根拠 (reason_ja) of the top company: the full text, wrapped (no clamp, nothing cut off) */
.p .why { grid-column: 1 / -1; font-size: 12px; color: var(--muted); line-height: 1.5; overflow-wrap: anywhere; padding: 2px 0 0; }
/* 根拠 of the other companies: their own reason_ja, 2 lines here (1 on phones); tap/click = full text */
.p .why-more { grid-column: 1 / -1; font-size: 12px; color: var(--muted); line-height: 1.5; }
.p .why-sum {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
  min-height: 24px; padding: 2px 0 0; cursor: pointer; list-style: none; overflow-wrap: anywhere;
}
.p .why-sum::-webkit-details-marker { display: none; }
.p .why-sum:hover { color: var(--ink); }
.p .why-more[open] .why-sum { display: block; -webkit-line-clamp: none; overflow: visible; }
.p-skel { height: 62px; }
.prob-foot { font-size: 10.5px; color: var(--faint); margin-top: 4px; line-height: 1.5; }

.event { background: var(--card); border: 1px solid var(--rule); padding: 12px 14px; margin-top: 8px; display: block; }
.event + .event { margin-top: 8px; }
.event .when { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; color: var(--major); text-transform: uppercase; }
.event .ttl { font-family: var(--serif); font-size: 14px; font-weight: 600; margin: 6px 0; line-height: 1.4; overflow-wrap: anywhere; }
.event .src { font-size: 11px; color: var(--faint); }
/* small links get a >= 24px box (inline padding / inline-block; the text itself does not move) */
.event .src a { border-bottom: 1px solid var(--rule); display: inline-block; line-height: 24px; }
.event .ttl a, .row .ttl a { padding: 3px 0; }
.feed-more a { display: inline-block; line-height: 24px; border-bottom: 1px solid var(--rule); }
.event .src a:hover { color: var(--ink); border-color: var(--ink); }
.windows { margin-top: 12px; }
.windows h4 { font-size: 10.5px; font-weight: 600; color: var(--faint); letter-spacing: 0.04em; }
.windows ul { list-style: none; font-size: 11px; color: var(--muted); margin-top: 4px; }
.windows li { display: flex; justify-content: space-between; border-top: 1px dotted var(--rule); padding: 3px 0; font-variant-numeric: tabular-nums; }

.cta { font-size: 13px; font-weight: 600; border-bottom: 1px solid var(--ink); align-self: start; padding-bottom: 2px; }
.cta:hover { color: var(--major); border-color: var(--major); }
.srcnote { font-size: 11px; color: var(--faint); margin-top: auto; line-height: 1.6; }
.noscript { padding: 24px 48px; }

/* ---------------------------------------------------------------- mid widths */
@media (max-width: 1100px) {
  .app { padding: 0 28px; }
  .grid { grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; }
  .rail { padding-left: 20px; }
  .lead h2 { font-size: 28px; }
}

/* ---------------------------------------------------------------- mobile (d2-mobile) */
@media (max-width: 760px) {
  body { font-size: 15px; }
  .app { padding: 0 16px; }
  .mast { display: block; padding: 22px 0 12px; }
  .mast .kicker-ja { display: none; }
  .mast-top { justify-content: space-between; }
  .mast h1 { font-size: 34px; margin-top: 2px; }
  .mast .meta { text-align: left; font-size: 13px; margin-top: 8px; line-height: 1.6; }
  .mast .meta br { display: none; }
  .mast .meta > * + *::before { content: "　·　"; color: var(--faint); font-weight: 400; }
  .honesty { padding: 10px 0 12px; font-size: 13px; line-height: 1.5; }
  .honesty-text { flex-basis: 100%; order: 2; }
  /* 注意事項 shares the badge's row (saves a line before the top stories) */
  .honesty .caveats { order: 1; margin-left: auto; }
  .grid { display: block; padding: 14px 0 28px; }
  .tabs-row { flex-direction: column; align-items: stretch; gap: 4px; }
  .tabs { width: 100%; }
  .tabs button { flex: 1 1 0; height: 40px; font-size: 13px; padding: 0 4px; white-space: nowrap; }
  .feed-status { text-align: left; }
  .lead { padding-bottom: 12px; margin-bottom: 12px; }
  .lead h2 { font-size: 28px; line-height: 1.18; margin: 4px 0 6px; }
  .lead.second h2 { font-size: 21px; line-height: 1.28; }
  .lead .by { font-size: 13px; }
  /* top 3 first: when fewer than 3 items are major, the next ones follow as one-line headlines
     (their rows in the stack below are hidden here), then the probability block */
  .lead-brief { display: block; margin: -2px 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--rule); }
  .brief-row { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
  .brief-who { flex: none; font-size: 12px; font-weight: 700; letter-spacing: 0.06em; color: var(--muted); white-space: nowrap; }
  /* the headline wraps to at most 2 lines (most of it readable), in a >= 44px tap box */
  .brief-ttl {
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
    flex: 1 1 auto; min-width: 0; min-height: 44px; font-family: var(--serif); font-size: 17px; font-weight: 500;
    line-height: 24px; padding: 0 0 2px; overflow-wrap: anywhere;
  }
  a.brief-ttl:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
  .stack .row.in-brief { display: none; }
  .stack-head.brief-all { display: none; }
  .mobile-probs { margin: 0 0 22px; }
  .mobile-probs .probs-block h3 { padding-bottom: 8px; border-bottom: 1px solid var(--rule); }
  .mobile-probs .p { grid-template-columns: minmax(0, 1fr) auto; min-height: 0; padding: 10px 0; align-items: center; }
  .mobile-probs .p:first-child { border-top: 0; }
  .mobile-probs .p .co { font-size: 15px; }
  .mobile-probs .p .sub { font-size: 12px; }
  .mobile-probs .p .pct { grid-row: 1 / span 2; grid-column: 2; font-size: 22px; }
  .mobile-probs .p .chg { display: none; }
  .mobile-probs .p .sub .chg-inline { display: inline; }
  .mobile-probs .p .bar { display: none; }
  .mobile-probs .p .why-more { font-size: 12.5px; }
  .mobile-probs .p .why-sum { -webkit-line-clamp: 1; }
  .mobile-probs .p .why-more[open] .why-sum { -webkit-line-clamp: none; }
  /* confirmed events right under the probabilities (moved by home.js); none = no block */
  .mobile-probs .events-block { margin-top: 18px; }
  .mobile-probs .events-block h3 { padding-bottom: 8px; border-bottom: 1px solid var(--rule); }
  .mobile-probs .events-block.no-events { display: none; }
  /* 前回から only: new items first, then the probability block (other tabs keep the DOM order) */
  body.t-since .mobile-probs { order: 1; margin: 22px 0 0; }
  .stack-head { display: block; padding-bottom: 8px; }
  .row { grid-template-columns: minmax(0, 1fr); gap: 2px; padding: 12px 0; }
  .row .flag { display: none; }
  .row .who { font-size: 12.5px; }
  .row .who b { display: inline; font-weight: 400; color: var(--muted); font-size: 12.5px; }
  .row .who b::after { content: "　·　"; color: var(--faint); }
  .row .who .imp { color: var(--muted); font-weight: 700; margin-right: 6px; letter-spacing: 0.06em; }
  .row .who .imp.m { color: var(--major); }
  .row .ttl { font-size: 18px; line-height: 1.38; font-weight: 500; }
  .rail { border-left: 0; padding-left: 0; margin-top: 24px; gap: 20px; }
  .event .ttl { font-size: 17px; }
  .cta { font-size: 15px; padding: 8px 0 3px; }
}
.p .sub .chg-inline { display: none; }
.row .who .imp { display: none; }
@media (max-width: 760px) { .row .who .imp { display: inline; } }

.nw { white-space: nowrap; }
