  /* App shell masthead + drawer (uses screening.html theme variables: --onyx, --text, --accent, --line, --muted) */

  /* page-level color-scheme: UA の scrollbar / form control 描画を theme に
     追従させる。未宣言だと dark theme でも UA が light 用 (白) の scrollbar を
     描く (全 view が本 file を load するためここで宣言)。 */
  :root { color-scheme: dark; }
  :root[data-theme="light"] { color-scheme: light; }

  .app-top {
    position: sticky; top: 0; z-index: 60;
    background: var(--onyx);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(8px);
  }
  .app-masthead {
    padding: 12px 16px;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 12px;
    max-width: 1500px;
    margin: 0 auto;
  }
  .app-brand-row {
    display: flex; align-items: baseline; gap: 10px;
    min-width: 0;
    /* PR-NV1: pill が狭幅で見切れないよう折返しを許可 */
    flex-wrap: wrap;
    row-gap: 4px;
  }
  .app-brand-b {
    font-family: 'Inter', 'Noto Sans JP', sans-serif;
    font-weight: 500;
    font-size: 18px;
    letter-spacing: -0.01em;
    color: var(--text);
    white-space: nowrap;
  }
  .app-brand-b em { font-style: normal; color: var(--accent); font-weight: 500; }
  .app-brand-ed {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: var(--text);
    letter-spacing: 0.06em;
    /* PR-NV1: 旧 overflow:hidden + nowrap は view pill を狭幅で見切らせて
       いた。pill 単位で折返す (各 span は nowrap のまま)。 */
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    row-gap: 4px;
    overflow: visible;
  }
  .app-brand-ed > span { white-space: nowrap; }
  .app-brand-ed .sep { color: var(--accent); padding: 0 4px; }
  /* PR-NV1 (2026-06-10): view pill を読みやすく — accent 塗り + 大きめ。
     文字色は theme 明示の固定値 (page 毎の --onyx alias 差でぶれないように):
     dark = light indigo #818CF8 bg + near-black / light = indigo #5E6AD2 bg + 白。 */
  .app-view-pill {
    display: inline-flex;
    align-items: center;
    font-family: 'Noto Sans JP', 'JetBrains Mono', monospace;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: #0B0B0D;
    background: var(--accent);
    border: 1px solid var(--accent);
    border-radius: 6px;
    padding: 4px 10px;
    margin-left: 8px;
  }
  [data-theme="light"] .app-view-pill { color: #FFFFFF; }
  .app-masthead-actions {
    display: inline-flex; align-items: center; gap: 6px;
  }
  .app-menu-btn, .app-theme-btn {
    background: var(--onyx-2);
    border: 1px solid var(--line);
    color: var(--text);
    font-size: 17px;
    width: 36px; height: 36px;
    border-radius: 4px;
    cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    transition: all 0.15s ease;
  }
  .app-theme-btn { font-size: 15px; }
  .app-menu-btn:hover, .app-theme-btn:hover { border-color: var(--accent); color: var(--accent); }

  /* 日付ナビ (masthead 下、section-nav の上) */
  .app-date-nav {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px 0;
    flex-wrap: wrap;
    max-width: 1500px;
    margin: 0 auto;
  }
  .app-date-btn {
    background: transparent;
    border: 1px solid var(--accent-deep, #9C7A35);
    color: var(--accent);
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    line-height: 1;
    padding: 5px 8px;
    border-radius: 3px;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
  }
  .app-date-btn:hover { background: rgba(221,180,95,0.1); border-color: var(--accent); }
  .app-date-input {
    background: var(--onyx-2, #161616);
    border: 1px solid var(--line);
    color: var(--text);
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 3px;
    min-width: 130px;
    /* ネイティブ日付ピッカー (calendar / dropdown) もダークテーマで表示する */
    color-scheme: dark;
  }
  /* ライトテーマ時はネイティブピッカーもライトに */
  [data-theme="light"] .app-date-input { color-scheme: light; }
  /* ネイティブカレンダーアイコンを gold に着色 */
  .app-date-input::-webkit-calendar-picker-indicator {
    filter: invert(0.7) sepia(1) saturate(3) hue-rotate(0deg);
    cursor: pointer;
  }
  .app-date-load {
    background: var(--accent);
    border: 1px solid var(--accent);
    color: var(--onyx, #0A0A0A);
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.06em;
    padding: 5px 12px;
    border-radius: 3px;
    cursor: pointer;
    font-weight: 600;
  }
  .app-date-load:hover { background: var(--accent-soft, #E8C77A); }
  .app-date-notice {
    margin: 6px auto 0;
    padding: 6px 10px;
    background: rgba(221,180,95,0.1);
    border: 1px solid var(--accent-deep, #9C7A35);
    border-radius: 3px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: var(--accent);
    line-height: 1.5;
    max-width: 1500px;
  }
  .app-date-notice[hidden] { display: none; }
  .app-section-nav {
    display: flex;
    padding: 0 16px;
    border-top: 1px solid var(--line);
    overflow-x: auto;
    scrollbar-width: none;
    max-width: 1500px;
    margin: 0 auto;
  }
  .app-section-nav::-webkit-scrollbar { display: none; }
  /* PR-NV1 (2026-06-10): asset タブを chip/tab 化 — 大きく・クリック可能と
     分かる affordance (枠 + hover で accent 反応) + 現在 asset の active 表示。
     旧 text link (opacity 0.55) は「ただのラベル」に見えていた。 */
  .app-section-nav a {
    flex-shrink: 0;
    padding: 8px 16px;
    margin: 8px 12px 8px 0;
    font-family: 'Inter', 'Noto Sans JP', sans-serif;
    font-style: normal;
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
    position: relative;
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    letter-spacing: -0.005em;
    opacity: 0.9;
    /* 非 active でも button と分かる枠 + 下地。fallback は theme 非依存の
       半透明 gray (ticker 等 --line/--onyx-2 alias を持たない page でも成立)。 */
    border: 1px solid var(--line, rgba(128, 128, 128, 0.38));
    background: var(--onyx-2, rgba(128, 128, 128, 0.10));
    border-radius: 7px;
    cursor: pointer;
    transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
  }
  .app-section-nav a:hover {
    opacity: 1;
    color: var(--accent);
    border-color: var(--accent);
    background: var(--accent-soft);
  }
  .app-section-nav a.app-active {
    opacity: 1;
    color: var(--accent);
    border-color: var(--accent);
    background: var(--accent-soft);
  }
  .app-section-nav .app-soon {
    font-family: 'JetBrains Mono', monospace;
    font-style: normal;
    font-size: 9.5px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
    border: 1px solid var(--accent);
    border-radius: 999px;
    padding: 2px 7px;
  }

  /* Editor's Note — sans-serif normal for readability (no Fraunces italic). */
  .app-editor-note {
    font-family: 'Noto Sans JP', sans-serif;
    font-style: normal;
    font-weight: 400;
    font-size: 16px;
    line-height: 1.7;
    color: var(--text);
    padding: 18px 20px;
    margin: 0 auto;
    max-width: 1500px;
    background: var(--onyx);
    border-bottom: 1px solid var(--line);
  }
  .app-editor-note::before { content: '"'; color: var(--accent); font-size: 1.3em; margin-right: 2px; vertical-align: -0.05em; }
  /* ::after で閉じ引用符を付けると、直前の .app-sig (display:block) のため
     署名の下に独立した行で浮いてしまう。pull-quote として開きのみ残す。 */
  .app-editor-note .app-sig {
    display: block;
    font-family: 'JetBrains Mono', monospace;
    font-style: normal;
    font-size: 10.5px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--text);
    opacity: 0.7;
    margin-top: 10px;
  }
  .app-editor-note .app-sig::before { content: '— '; color: var(--accent); }

  /* Drawer */
  .app-drawer-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 90;
    opacity: 0; visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
  }
  .app-drawer-overlay.app-open { opacity: 1; visibility: visible; }
  .app-drawer {
    position: fixed;
    top: 0; right: 0; bottom: 0;
    width: 320px;
    max-width: 86vw;
    background: var(--onyx);
    border-left: 1px solid var(--line);
    z-index: 100;
    transform: translateX(100%);
    transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
    overflow-y: auto;
    padding: 20px 22px 32px;
  }
  .app-drawer.app-open { transform: translateX(0); }
  .app-drawer-head {
    display: flex; align-items: center; justify-content: space-between;
    padding-bottom: 18px;
    margin-bottom: 14px;
    border-bottom: 1px solid var(--line);
  }
  .app-drawer-ttl {
    font-family: 'Inter', 'Noto Sans JP', sans-serif;
    font-weight: 500;
    font-size: 18px;
    color: var(--text);
  }
  .app-drawer-ttl em { font-style: normal; color: var(--accent); }
  .app-drawer-close {
    background: var(--onyx-2);
    border: 1px solid var(--line);
    color: var(--text);
    width: 32px; height: 32px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    display: inline-flex; align-items: center; justify-content: center;
  }
  .app-drawer-group { margin-bottom: 20px; }
  .app-drawer-group h4 {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 10px;
  }
  .app-drawer-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 11px 0;
    border-bottom: 1px solid var(--line);
    color: var(--text);
    text-decoration: none;
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 15px;
    cursor: pointer;
  }
  .app-drawer-item:last-child { border-bottom: none; }
  /* PR-PT1: display:flex が UA の [hidden] に勝つため明示上書き (TG CSS 原則) */
  .app-drawer-item[hidden] { display: none; }
  .app-drawer-item .app-left { display: flex; align-items: center; gap: 10px; }
  .app-drawer-item .app-icn {
    font-family: 'Inter', 'Noto Sans JP', sans-serif;
    color: var(--accent);
    font-size: 17px;
    width: 22px;
    text-align: center;
  }
  .app-drawer-item .app-lbl { font-weight: 500; }
  .app-drawer-item.app-active .app-lbl { color: var(--accent); }
  .app-drawer-item .app-ar {
    color: var(--accent);
    font-family: 'Inter', 'Noto Sans JP', sans-serif;
    font-style: normal;
    font-size: 14px;
  }
  .app-drawer-item .app-soon-badge {
    font-family: 'JetBrains Mono', monospace;
    font-size: 9.5px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
    border: 1px solid var(--accent);
    border-radius: 999px;
    padding: 2px 7px;
  }
  .app-theme-row,
  .app-lang-row { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
  .app-theme-row button,
  .app-lang-row button {
    background: var(--onyx-2);
    border: 1px solid var(--line);
    color: var(--text);
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 10px 8px;
    border-radius: 4px;
    cursor: pointer;
  }
  .app-theme-row button.app-active,
  .app-lang-row button.app-active {
    background: var(--accent);
    color: var(--onyx);
    border-color: var(--accent);
    font-weight: 600;
  }

  /* ════════════════════════════════════════════════════════════════
     App footer — F-13c Phase 3 (2026-06-05) で SSOT 化
     全 view 共通の brand line + 統一 meta line。paid view では追加で
     dispatch meta + disclaimer slot を表示 (data-driven、polling 更新)。
     ════════════════════════════════════════════════════════════════ */
  .app-footer {
    max-width: 1500px;
    margin: 56px auto 0;
    padding: 28px 16px 32px;
    border-top: 1px solid var(--line);
    color: var(--text-second, var(--muted));
    font-family: 'Inter', 'Noto Sans JP', sans-serif;
    font-size: 13px;
    line-height: 1.6;
    text-align: center;
  }
  .app-footer-brand {
    font-size: 14px;
    color: var(--text);
    margin-bottom: 4px;
  }
  .app-footer-brand em {
    font-style: normal;
    color: var(--accent);
  }
  .app-footer-brand .app-footer-sep {
    color: var(--accent);
    padding: 0 6px;
  }
  .app-footer-brand .app-footer-tagline {
    font-weight: 500;
  }
  .app-footer-meta {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.08em;
    color: var(--text-second, var(--muted));
    text-transform: uppercase;
    margin-top: 6px;
  }
  /* paid view 専用 (dashboard/complex/mobile): dispatch meta + disclaimer */
  .app-footer-dispatch-meta {
    margin-top: 14px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11.5px;
    color: var(--text-second, var(--muted));
    display: flex; flex-wrap: wrap; justify-content: center;
    gap: 4px 8px;
  }
  .app-footer-dispatch-meta b { color: var(--text); font-weight: 500; }
  .app-footer-dispatch-meta a {
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px solid var(--accent);
  }
  .app-footer-dispatch-meta .app-footer-sep { color: var(--accent); }
  .app-footer-disclaimer {
    margin-top: 14px;
    max-width: 640px;
    margin-left: auto; margin-right: auto;
    font-size: 12px;
    color: var(--text-second, var(--muted));
    line-height: 1.7;
  }
  .app-footer-disclaimer b { color: var(--text); font-weight: 500; }
  @media (max-width: 600px) {
    .app-footer { padding: 24px 14px 28px; }
    .app-footer-dispatch-meta { font-size: 11px; }
    .app-footer-disclaimer { font-size: 11.5px; }
  }

/* ════════════════════════════════════════════════════════════════
   THE FLOOR — market + TG stats strip (Phase 0.65 cross-view integration)
   Cross-injected by app-chrome.js into dashboard/complex view above the
   existing screening container. Mirrors Mobile (apps/app/daytrade/) styling
   but uses paid base theme variables (--onyx*, --line, --muted, --pos, --neg).
   ════════════════════════════════════════════════════════════════ */
  .app-floor-label {
    font-family: "JetBrains Mono", monospace;
    font-size: 12px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--muted);
    margin: 14px auto 10px;
    padding: 0 20px;
    max-width: 1500px;
  }
  .app-floor-label b { color: var(--accent); font-weight: 600; }

  .app-floor-strip {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--onyx-2);
    overflow: hidden;
    margin: 0 auto 10px;
    max-width: 1500px;
  }
  .app-floor-cell {
    padding: 12px 8px;
    text-align: center;
    border-right: 1px solid var(--line);
  }
  .app-floor-cell:last-child { border-right: none; }
  .app-floor-cell .lbl {
    font-family: "JetBrains Mono", monospace;
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 4px;
  }
  .app-floor-cell .val {
    font-family: "JetBrains Mono", monospace;
    font-size: 17px;
    font-weight: 600;
    color: var(--text);
  }
  .app-floor-cell.pos .val { color: var(--pos); }
  .app-floor-cell.neg .val { color: var(--neg); }

  .app-tg-stats {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--onyx-2);
    overflow: hidden;
    margin: 0 auto 18px;
    max-width: 1500px;
  }
  /* 狭画面では 3 列 × 2 行に折返し (chrome を使う view が将来 narrow viewport で
     表示される際の防御) */
  @media (max-width: 720px) {
    .app-tg-stats { grid-template-columns: repeat(3, 1fr); }
  }

  /* mobile view (data-app-view="mobile") は chrome を body 直下に注入する
     ため、`.container` の horizontal padding が効かない。floor / stats /
     editor's note などの card 要素は viewport 端まで張り出さないよう
     16px の side margin を持たせる。dashboard / complex (.container 経由)
     には適用しない。 */
  [data-app-view="mobile"] .app-floor-label,
  [data-app-view="mobile"] .app-floor-strip,
  [data-app-view="mobile"] .app-tg-stats {
    margin-left: 16px;
    margin-right: 16px;
  }
  [data-app-view="mobile"] .app-floor-label {
    padding-left: 0;
    padding-right: 0;
  }
  .app-tg-stats .app-tg-cell {
    padding: 12px 6px;
    text-align: center;
    border-right: 1px solid var(--line);
  }
  .app-tg-stats .app-tg-cell:last-child { border-right: none; }
  .app-tg-stats .app-tg-cell .lbl {
    font-family: "JetBrains Mono", monospace;
    font-size: 10.5px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 3px;
  }
  .app-tg-stats .app-tg-cell .val {
    font-family: "JetBrains Mono", monospace;
    font-size: 16px;
    font-weight: 600;
    color: var(--accent);
  }

  /* デスクトップ用の grid-template-columns 拡張は削除。実セル数 (3 / 4) と
     合わないと、cells が左半分にまとまり右半分が空白になるため。 */

  /* editorial 「hanging」整列。chrome は `.container` 直下に注入される (PR
     #339)。legacy `styles.css` の `#content > details.live-monitor` 等と
     同じ親で同じ margin-left: -20px / -36px を適用し、左端を完全に揃える。
     `.container` 外 (mobile 等) では基準位置のまま (中央寄せ)。 */
  .container > .app-top,
  .container > .app-floor-label,
  .container > .app-floor-strip,
  .container > .app-tg-stats,
  .container > .app-editor-note {
    max-width: none;  /* 親 (.container) で 1500px に制限済、calc を解除 */
  }
  .container > .app-top > .app-masthead,
  .container > .app-top > .app-section-nav,
  .container > .app-top > .app-date-nav,
  .container > .app-top > .app-date-notice {
    max-width: none;
    margin-left: 0;
    margin-right: 0;
  }
  @media (min-width: 768px) {
    .container > .app-top,
    .container > .app-floor-label,
    .container > .app-floor-strip,
    .container > .app-tg-stats,
    .container > .app-editor-note {
      margin-left: -20px;
    }
  }
  @media (min-width: 1024px) {
    .container > .app-top,
    .container > .app-floor-label,
    .container > .app-floor-strip,
    .container > .app-tg-stats,
    .container > .app-editor-note {
      margin-left: -36px;
    }
  }

/* ════════════════════════════════════════════════════════════════
   Filter chip bar — Phase 0.65-B
   Complex view 専用 (Dashboard では highlights card grid で全 category
   並列表示するため chip 不要)。dedup highlights の上に表示し、chip click
   で section (.hl-block) の表示を category で filter。
   ════════════════════════════════════════════════════════════════ */
  .app-chip-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 14px 4px 12px;
    padding-bottom: 4px;
  }
  .app-chip {
    flex-shrink: 0;
    background: var(--onyx-2);
    border: 1px solid var(--line);
    color: var(--muted);
    font-family: var(--f-body), sans-serif;
    font-size: 13px;
    font-weight: 500;
    padding: 7px 12px;
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.12s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
  }
  .app-chip:hover { border-color: var(--accent); color: var(--text); }
  .app-chip.app-chip-active {
    background: var(--accent-soft);
    color: var(--accent);
    border-color: var(--accent);
    font-weight: 600;
  }
  .app-chip-cnt {
    font-family: "JetBrains Mono", monospace;
    font-size: 11px;
    color: var(--muted);
    background: rgba(0,0,0,0.18);
    padding: 1px 6px;
    border-radius: 999px;
    font-weight: 400;
  }
  .app-chip.app-chip-active .app-chip-cnt { color: var(--accent); background: rgba(255,255,255,0.12); }

  /* Hide chip bar in Dashboard view (each category already has its own card) */
  html[data-app-view="dashboard"] .app-chip-bar { display: none; }

/* ════════════════════════════════════════════════════════════════
   Stock card border-left accent — Phase 0.65-B (#13)
   Dashboard view の highlights card (.tghl) に category 別 border-left
   ════════════════════════════════════════════════════════════════ */
  .tghl-champion { border-left: 3px solid var(--accent) !important; }
  .tghl-crown    { border-left: 3px solid var(--accent) !important; }
  .tghl-rainbow  { border-left: 3px solid #c879d9 !important; }
  .tghl-star     { border-left: 3px solid var(--accent-soft) !important; }
  .tghl-new      { border-left: 3px solid var(--simple) !important; }
