  :root {
    --bg: #0b0e14; --panel: #11151d; --panel2: #161b26; --line: #222a38; --text: #d7dde8; --sub: #7f8a9c;
    --up: #ef5350; --down: #4f8ef7; --accent: #f5b041; --scout: #e67e22; --add: #b9770e; --star: #ff6b6b; --ok: #2ecc71;
  }
  * { box-sizing: border-box; }
  html, body { height: 100%; margin: 0; background: var(--bg); color: var(--text);
    font: 13px/1.5 "Segoe UI", "Hiragino Sans", "Meiryo UI", Meiryo, sans-serif; -webkit-font-smoothing: antialiased; }
  .app { display: grid; grid-template-columns: 300px 1fr; height: 100dvh; }
  /* ---- 左：銘柄の一覧 ---- */
  .side { background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
  .side-head { padding: 12px 12px 8px; border-bottom: 1px solid var(--line); }
  .brand { font-weight: 700; letter-spacing: .04em; font-size: 14px; display: flex; justify-content: space-between; align-items: baseline; }
  .brand small { color: var(--sub); font-weight: 400; font-size: 11px; }
  .search { width: 100%; margin-top: 8px; padding: 7px 10px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; color: var(--text); outline: none; }
  .search:focus { border-color: #3a4558; }
  .seg { display: flex; gap: 4px; margin-top: 8px; }
  .seg button, .periods button, .toggles button { background: transparent; color: var(--sub); border: 1px solid var(--line); border-radius: 999px;
    padding: 3px 10px; font-size: 11px; cursor: pointer; }
  .seg button.on, .periods button.on, .toggles button.on { color: var(--bg); background: var(--text); border-color: var(--text); font-weight: 600; }
  .list { overflow-y: auto; flex: 1; padding: 4px 0 16px; }
  .group { padding: 10px 12px 4px; color: var(--sub); font-size: 11px; letter-spacing: .08em; }
  .item { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; padding: 7px 12px; cursor: pointer; border-left: 3px solid transparent; }
  .item:hover { background: var(--panel2); }
  .item.on { background: var(--panel2); border-left-color: var(--accent); }
  .item .nm { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .item .nm span { color: var(--sub); font-weight: 400; margin-right: 6px; font-variant-numeric: tabular-nums; }
  .item .px { text-align: right; font-variant-numeric: tabular-nums; }
  .item .meta { grid-column: 1 / -1; display: flex; gap: 6px; flex-wrap: wrap; color: var(--sub); font-size: 11px; }
  .badge { padding: 0 6px; border-radius: 4px; background: #1c2230; font-variant-numeric: tabular-nums; }
  .badge.hot { background: rgba(255,107,107,.16); color: var(--star); font-weight: 600; }
  .badge.near { background: rgba(230,126,34,.16); color: var(--scout); font-weight: 600; }
  .badge.hit { background: rgba(239,83,80,.22); color: #ff8a80; font-weight: 700; }
  .badge.earn { background: rgba(46,204,113,.14); color: var(--ok); }
  .up { color: var(--up); } .down { color: var(--down); }
  /* ---- 右：チャート ---- */
  .main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
  .head { padding: 12px 18px 8px; border-bottom: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: baseline; }
  .head .title { font-size: 20px; font-weight: 700; } .head .title span { color: var(--sub); font-weight: 400; font-size: 14px; margin-right: 8px; }
  .head .price { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
  .head .chg { font-size: 14px; font-variant-numeric: tabular-nums; }
  .chips { display: flex; gap: 6px; flex-wrap: wrap; width: 100%; }
  .chip { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 2px 9px; font-size: 11px; color: var(--sub); }
  .chip b { color: var(--text); font-weight: 600; margin-left: 5px; font-variant-numeric: tabular-nums; }
  .chip.hot b { color: var(--star); } .chip.near b { color: var(--scout); } .chip.earn b { color: var(--ok); }
  .bar { display: flex; gap: 12px; align-items: center; padding: 8px 18px; flex-wrap: wrap; }
  .periods, .toggles { display: flex; gap: 4px; }
  .legend { margin-left: auto; color: var(--sub); font-size: 11px; font-variant-numeric: tabular-nums; min-height: 17px; }
  .legend b { color: var(--text); font-weight: 500; }
  .chartwrap { position: relative; flex: 1; min-height: 260px; }
  #chart { position: absolute; inset: 0; }
  .notes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 10px 18px 14px; border-top: 1px solid var(--line); }
  .note { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; }
  .note h4 { margin: 0 0 3px; font-size: 11px; font-weight: 600; color: var(--sub); letter-spacing: .06em; }
  .note p { margin: 0; font-size: 12px; }
  .note.kill h4 { color: #d98880; }
  .foot { padding: 0 18px 10px; color: #566073; font-size: 10px; display: flex; gap: 12px; flex-wrap: wrap; }
  .foot a { color: #6f7b8f; }
  .menu { display: none; }
  /* ---- スマホ：一覧は引き出し ---- */
  @media (max-width: 820px) {
    .app { grid-template-columns: 1fr; }
    .side { position: fixed; inset: 0 18% 0 0; z-index: 20; transform: translateX(-102%); transition: transform .2s ease; box-shadow: 8px 0 30px rgba(0,0,0,.5); }
    .side.open { transform: none; }
    .menu { display: inline-flex; background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 4px 10px; font-size: 12px; }
    .notes { grid-template-columns: 1fr; }
    .head .title { font-size: 17px; } .legend { width: 100%; margin-left: 0; }
  }
  /* ---- 本人確認の途中・失敗のときの幕 ---- */
  .gate { position: fixed; inset: 0; z-index: 50; background: var(--bg); display: grid; place-content: center; text-align: center; padding: 24px; color: var(--sub); }
  .gate[hidden] { display: none; }
  .gate b { color: var(--text); font-size: 15px; display: block; margin-bottom: 8px; }
  .gate code { display: inline-block; margin-top: 8px; padding: 4px 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; color: var(--accent); user-select: all; }
  /* ---- 画像用（?shot=コード）：一覧・操作・説明を隠して、見出しとチャートだけにする ---- */
  .shot .app { grid-template-columns: 1fr; }
  .shot .side, .shot .menu, .shot .toggles, .shot .notes, .shot .foot { display: none; }
  .shot .periods button:not(.on) { display: none; }
