:root {
  --navy: #12233f;
  --gold: #d4a24c;
  --ink: #222;
  --sub: #667085;
  --line: #e4e7ec;
  --bg: #f6f7f9;
  --card: #ffffff;
  --red: #c94f3d;
  --green: #1a9e6f;
  --g1: #1e5bd6;
  --g2: #c94f3d;
  --g3: #1a9e6f;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP", sans-serif;
  background: var(--bg); color: var(--ink);
  font-size: 15px; line-height: 1.55;
}
#app { max-width: 640px; margin: 0 auto; padding: 0 12px 48px; }

/* ---- 共通 ---- */
.topbar {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 14px 2px 10px;
}
.topbar h1 { font-size: 19px; color: var(--navy); }
.topbar .gen { font-size: 11px; color: var(--sub); }
.stale {
  background: var(--red); color: #fff; font-size: 12.5px; font-weight: 700;
  padding: 8px 12px; border-radius: 8px; margin-bottom: 10px;
}
.badge {
  display: inline-block; font-size: 11px; font-weight: 800; color: #fff;
  padding: 2px 8px; border-radius: 4px; letter-spacing: .5px; vertical-align: middle;
}
.badge.G1 { background: var(--g1); }
.badge.G2 { background: var(--g2); }
.badge.G3 { background: var(--g3); }
.stbadge {
  display: inline-block; font-size: 10.5px; font-weight: 700;
  padding: 2px 7px; border-radius: 999px; vertical-align: middle;
  background: #eef1f5; color: var(--sub);
}
.stbadge.warn { background: #fdf0e7; color: #b4590a; }
.stbadge.ok { background: #e7f6ef; color: var(--green); }

/* ---- 一覧カード ---- */
.card {
  display: block; background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; padding: 13px 14px; margin-bottom: 10px;
  text-decoration: none; color: inherit;
}
.card.past { opacity: .55; }
.card .row1 { display: flex; align-items: center; gap: 8px; }
.card .name { font-size: 17px; font-weight: 800; color: var(--navy); }
.card .meta { font-size: 12.5px; color: var(--sub); margin-top: 3px; }
.card .marks { font-size: 13.5px; margin-top: 7px; font-weight: 600; }
.empty { text-align: center; color: var(--sub); padding: 48px 0; }

/* ---- 詳細 ---- */
.back {
  display: inline-block; margin: 12px 0 4px; font-size: 14px;
  color: var(--navy); text-decoration: none; font-weight: 700; padding: 6px 0;
}
.rhead {
  background: var(--navy); color: #fff; border-radius: 12px;
  padding: 14px 16px; margin-bottom: 10px;
}
.rhead h2 { font-size: 20px; display: flex; align-items: center; gap: 8px; }
.rhead .meta { font-size: 12.5px; opacity: .85; margin-top: 4px; }
.rhead .odds { font-size: 11.5px; opacity: .75; margin-top: 2px; }
.notice {
  background: #fdf0e7; color: #b4590a; font-size: 12.5px;
  padding: 8px 12px; border-radius: 8px; margin-bottom: 10px; font-weight: 600;
}

.section {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 13px 14px; margin-bottom: 10px;
}
.section h3 {
  font-size: 13px; color: var(--sub); font-weight: 700;
  letter-spacing: .5px; margin-bottom: 8px;
}

/* 印リスト */
.horse { border-bottom: 1px solid var(--line); }
.horse:last-child { border-bottom: none; }
.hrow {
  display: flex; align-items: center; gap: 8px; min-height: 48px;
  width: 100%; background: none; border: none; text-align: left;
  font: inherit; cursor: pointer; padding: 6px 2px;
}
.hrow .mark { width: 26px; font-size: 18px; font-weight: 800; color: var(--navy); text-align: center; }
.hrow .mark.kesi { color: var(--red); font-size: 14px; }
.hrow .um {
  width: 24px; height: 24px; border-radius: 5px; background: var(--navy);
  color: #fff; font-size: 13px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; flex: none;
}
.hrow .hname { font-size: 15.5px; font-weight: 700; flex: 1; min-width: 0; }
.hrow .hname small { display: block; font-size: 11px; color: var(--sub); font-weight: 500; }
.hrow .right { text-align: right; flex: none; }
.hrow .pop { font-size: 12px; color: var(--sub); }
.hrow .total { font-size: 14.5px; font-weight: 800; color: var(--navy); }
.fbadge {
  display: inline-block; background: var(--gold); color: #fff;
  font-size: 10px; font-weight: 800; padding: 1px 6px; border-radius: 4px;
  margin-left: 4px; vertical-align: 1px;
}
.hdetail { padding: 2px 6px 12px 34px; display: none; }
.horse.open .hdetail { display: block; }
.axis { display: flex; align-items: center; gap: 6px; margin: 3px 0; font-size: 12px; }
.axis .alabel { width: 3.6em; color: var(--sub); flex: none; }
.axis .atrack { flex: 1; height: 10px; position: relative; background: #f0f2f5; border-radius: 5px; overflow: hidden; }
.axis .abar { position: absolute; top: 0; bottom: 0; }
.axis .abar.pos { background: var(--navy); left: 50%; }
.axis .abar.neg { background: var(--red); right: 50%; }
.axis .aval { width: 3.4em; text-align: right; font-weight: 700; flex: none; }
.axis .aval.neg { color: var(--red); }
.reasons { margin-top: 7px; font-size: 12.5px; color: var(--ink); }
.reasons li { margin: 2px 0 2px 1.2em; }

/* 傾向バー */
.tbar { display: flex; align-items: center; gap: 6px; margin: 4px 0; font-size: 12.5px; }
.tbar .tlabel { width: 6.4em; flex: none; color: var(--ink); }
.tbar .ttrack { display: block; flex: 1; height: 12px; background: #f0f2f5; border-radius: 6px; overflow: hidden; }
.tbar .tfill { display: block; height: 100%; background: var(--navy); border-radius: 6px; }
.tbar .tfill.gold { background: var(--gold); }
.tbar .tval { width: 8.5em; text-align: right; font-weight: 700; flex: none; }
.tbar.thin .tval, .tbar.thin .tlabel { color: #9aa0a6; font-weight: 500; }
.tbar.thin .tfill { background: #c6ccd4; }
.smallnote { font-size: 11px; color: var(--sub); margin-top: 6px; }

/* 買い目案 */
.plan { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; }
.plan .pname { font-size: 14.5px; font-weight: 800; color: var(--navy); margin-bottom: 6px; }
.plan .ppts {
  float: right; font-size: 11.5px; font-weight: 700; color: var(--sub);
  background: #eef1f5; border-radius: 999px; padding: 2px 9px;
}
.plan .pitem { display: flex; gap: 10px; margin: 4px 0; font-size: 13.5px; }
.plan .ptype {
  flex: none; width: 5.5em; font-weight: 700; color: #fff; background: var(--navy);
  border-radius: 5px; text-align: center; font-size: 12px; padding: 2px 0; height: fit-content;
}
.plan .plines { font-weight: 600; line-height: 1.7; }
.plan .pnote { font-size: 11.5px; color: var(--sub); margin-top: 6px; }

/* コピー・免責 */
.copybtns { display: flex; gap: 8px; }
.copybtns button {
  flex: 1; min-height: 44px; border: 1.5px solid var(--navy); background: #fff;
  color: var(--navy); font-weight: 700; font-size: 13.5px; border-radius: 9px;
  cursor: pointer; font-family: inherit;
}
.copybtns button:active { background: var(--navy); color: #fff; }
.disclaimer {
  font-size: 11.5px; color: var(--sub); text-align: center;
  padding: 4px 8px 0; line-height: 1.6;
}
