/* Dswin — 軽量スタイル（フレームワーク不使用） */
:root {
  --bg: #f4f5f7; --fg: #1f2328; --muted: #6b7280; --line: #dcdfe4; --card: #fff;
  --accent: #1f5fbf; --accent-bg: #e8f0fc; --ok: #187a3c; --ok-bg: #e5f5ea; --warn: #b45309; --warn-bg: #fff4e0; --err: #b91c1c; --err-bg: #fde8e8;
  --catA: #c62828; --catB: #1565c0; --catC: #2e7d32;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", "Noto Sans JP", Meiryo, sans-serif; font-size: 14px; line-height: 1.5; color: var(--fg); background: var(--bg); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: ui-monospace, Consolas, monospace; font-size: 12px; background: #eef; padding: 0 3px; border-radius: 3px; }
h1 { font-size: 20px; margin: 0 0 10px; }
h2 { font-size: 15px; margin: 0 0 8px; padding-bottom: 4px; border-bottom: 1px solid var(--line); }
h3 { font-size: 14px; margin: 10px 0 4px; }
.small { font-size: 12px; }
.muted { color: var(--muted); font-weight: normal; }
.err { color: var(--err); background: var(--err-bg); padding: 6px 10px; border-radius: 4px; }
.ok { color: var(--ok); background: var(--ok-bg); padding: 6px 10px; border-radius: 4px; }
.plus { color: var(--ok); } .minus { color: var(--err); }

header.top { display: flex; align-items: center; gap: 16px; padding: 0 14px; height: 44px; background: #1c2a3f; color: #fff; }
header.top .brand { color: #fff; font-weight: bold; font-size: 16px; letter-spacing: .5px; }
header.top nav { display: flex; gap: 2px; margin-left: auto; align-items: center; }
header.top nav a, header.top nav button.link { color: #cfd8e6; padding: 6px 10px; border-radius: 4px; background: none; border: 0; font: inherit; cursor: pointer; }
header.top nav a.on, header.top nav a:hover, header.top nav button.link:hover { background: rgba(255,255,255,.12); color: #fff; text-decoration: none; }
header.top nav .muted { color: #9aa8bd; }
main { max-width: 1280px; margin: 0 auto; padding: 14px; }
main.bare { max-width: 480px; padding-top: 60px; }
footer.foot { text-align: center; padding: 20px; font-size: 12px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 12px 14px; margin-bottom: 14px; }
.card.narrow { max-width: 420px; margin: 0 auto; }
.row { display: flex; gap: 10px; align-items: center; }
.row.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.inline { display: inline; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 900px) { .grid2 { grid-template-columns: 1fr; } }

form label { display: block; margin: 8px 0; }
form.filters label { display: inline-block; margin: 4px 10px 4px 0; }
input, select, textarea, button { font: inherit; }
input[type=text], input[type=password], input[type=number], input[type=date], input:not([type]), select, textarea { padding: 5px 7px; border: 1px solid #b8bec8; border-radius: 4px; background: #fff; }
form.card label input:not([type]), form.card label input[type=password] { width: 100%; }
.card.narrow input:not([type]), .card.narrow input[type=password] { width: 100%; display: block; margin-top: 3px; }
textarea { width: 100%; font-family: ui-monospace, Consolas, monospace; font-size: 12px; }
.w4 { width: 4.5em; } .w5 { width: 6em; } .w12 { width: 100%; min-width: 12em; }
button { padding: 5px 12px; border: 1px solid #b8bec8; border-radius: 4px; background: #fff; cursor: pointer; }
button.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn { display: inline-block; padding: 5px 10px; border: 1px solid #b8bec8; border-radius: 4px; background: #fff; }
.navrl { display: flex; gap: 6px; align-items: flex-start; }

.tablewrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { border-collapse: collapse; width: 100%; }
table.list th, table.list td, table.entries th, table.entries td { padding: 4px 6px; border-bottom: 1px solid #eceff3; text-align: center; white-space: nowrap; }
table.list th, table.entries th { background: #f0f2f5; font-weight: 600; font-size: 12px; color: #444; }
table td.left, table th.left { text-align: left; }
table td.num, table th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.compact td, table.compact th { padding: 2px 6px; font-size: 12px; }
table tr.done td { color: #666; }
table tr.cancel td { color: #aaa; text-decoration: line-through; }
table tr.sum td { background: #f7f8fa; font-weight: 600; }
table tr.hl td { background: #fffbe6; }
table tr.hitrow td { background: #eefaf0; }
table tr.errrow td { background: var(--err-bg); color: var(--err); }
table td.msg { white-space: normal; max-width: 420px; word-break: break-all; }
table.settings td { vertical-align: top; }
table.settings td.left { white-space: normal; }
table.settings input.w12 { width: 100%; }
table.totals td { font-size: 14px; }

.badge { display: inline-block; padding: 0 6px; border-radius: 10px; font-size: 11px; line-height: 18px; background: #eee; color: #444; vertical-align: middle; }
.badge.st-confirmed { background: #e0e0e0; }
.badge.st-odds { background: var(--accent-bg); color: var(--accent); }
.badge.st-card { background: #eef7ff; color: #2b5d9c; }
.badge.st-cancelled { background: var(--err-bg); color: var(--err); }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }

.racehead { margin-bottom: 12px; }
.crumbs { font-size: 12px; color: var(--muted); }
.meta { font-size: 13px; }
.kv > div { display: flex; gap: 8px; padding: 2px 0; font-size: 13px; }
.kv > div > span:first-child { flex: 0 0 5.5em; color: var(--muted); }
.shobu { padding: 8px 10px; border-radius: 4px; font-size: 14px; margin: 6px 0 10px; }
.shobu.yes { background: #fff0f0; color: var(--err); border: 1px solid #f3b4b4; font-size: 16px; }
.shobu.no { background: #f3f4f6; color: #555; }

table.pairs { width: auto; min-width: 260px; margin: 8px 0; }
table.pairs td { padding: 1px 6px; font-size: 13px; }
table.pairs td.lbl { font-weight: bold; }
table.pairs td.bar { width: 160px; }
table.pairs td.bar div { height: 10px; background: var(--accent); border-radius: 2px; min-width: 1px; }
table.pairs tr.dim td { color: #aaa; }
table.pairs tr.dim td.bar div { background: #c9d3e6; }

.catA { color: var(--catA); font-weight: bold; }
.catB { color: var(--catB); font-weight: bold; }
.catC { color: var(--catC); font-weight: bold; }
.catX { color: #999; }
span.cat { display: inline-block; width: 1.6em; text-align: center; border-radius: 3px; background: #f3f4f6; }

.reco { margin-bottom: 12px; }
.combos { display: flex; flex-wrap: wrap; gap: 5px; }
.combo { display: inline-block; padding: 2px 7px; border: 1px solid var(--line); border-radius: 4px; background: #fafbfc; font-size: 13px; }
.combo b { font-size: 14px; }
.combo em { font-style: normal; color: #555; margin-left: 3px; }
.combo.hit { background: #fff0f0; border-color: #e57373; }
.pnl { margin: 6px 0 0; font-size: 13px; }
.pnl.hit { color: var(--err); font-weight: 600; }
.pnl.miss { color: #555; }

table.entries tr.scr td { color: #aaa; text-decoration: line-through; }
table.entries tr.no1 td { background: #fffdf2; }
table.entries td.rankhi { color: var(--catA); font-weight: 600; }
.waku { display: inline-block; width: 1.5em; line-height: 1.5em; border-radius: 3px; font-size: 12px; text-align: center; border: 1px solid #ccc; background: #fff; }
.waku.w1 { background: #fff; } .waku.w2 { background: #222; color: #fff; } .waku.w3 { background: #e53935; color: #fff; } .waku.w4 { background: #1e88e5; color: #fff; }
.waku.w5 { background: #fdd835; } .waku.w6 { background: #43a047; color: #fff; } .waku.w7 { background: #fb8c00; color: #fff; } .waku.w8 { background: #f48fb1; }
.place { display: inline-block; min-width: 1.6em; text-align: center; border-radius: 3px; }
.place.p1 { background: #ffd54f; font-weight: bold; } .place.p2 { background: #cfd8dc; font-weight: bold; } .place.p3 { background: #ffccbc; font-weight: bold; }
details.katen summary { cursor: pointer; list-style: none; }
details.katen summary::-webkit-details-marker { display: none; }
.katendetail { text-align: left; font-size: 11px; white-space: normal; max-width: 200px; background: #f7f8fa; padding: 4px 6px; border-radius: 4px; }
.katendetail span { display: inline-block; margin-right: 6px; }
.pager a { display: inline-block; padding: 2px 8px; border: 1px solid var(--line); border-radius: 3px; margin: 2px; }
.pager a.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.jyo { font-size: 17px; }

@media (max-width: 640px) {
  main { padding: 8px; }
  h1 { font-size: 17px; }
  header.top { padding: 0 8px; gap: 8px; }
  header.top nav a, header.top nav button.link { padding: 6px 7px; font-size: 13px; }
  header.top nav .muted { display: none; }
  table.list th, table.list td, table.entries th, table.entries td { padding: 3px 4px; font-size: 12px; }
  .kv > div { flex-direction: column; gap: 0; }
}
