:root {
  color-scheme: dark;
  --bg: #111419;
  --surface: #1c212a;
  --line: #2a313d;
  --border: #37404f;
  --mint: #6edbc5;
  --mint-bg: #24463f;
  --blue: #acbdf1;
  --text: #f3f5fa;
  --muted: #b6bfcc;
  --error: #f5a9a4;
  --width: 430px;
  font-family: "Noto Sans JP", -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", Meiryo, sans-serif;
  background: #0c0f14;
  color: var(--text);
  font-size: 16px;
}
* { box-sizing: border-box; }
body { margin: 0; }
body.large { font-size: 1.15rem; }
.frame { max-width: var(--width); margin: 0 auto; min-height: 100dvh; background: var(--bg); }
header { display: flex; align-items: center; min-height: 69px; margin: 0 22px; gap: 8px; border-bottom: 1px solid var(--line); padding: max(12px, env(safe-area-inset-top)) 0 10px; }
header h1 { font-size: 1.3em; font-weight: 650; line-height: 1.4; margin: 0; flex: 1; }
header .back { padding: 0; background: none; border: 0; width: 32px; min-width: 32px; font-size: 1.35em; }
.demo-badge { color: var(--muted); font-size: .68em; white-space: nowrap; }
.lang-toggle { margin-left: auto; flex: 0 0 auto; min-height: 0; width: auto; padding: 5px 11px; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--muted); font-size: 12px; }
main { padding: 16px 22px calc(110px + env(safe-area-inset-bottom)); }
nav { position: fixed; z-index: 5; bottom: 0; left: 50%; transform: translateX(-50%); width: min(100%, var(--width)); background: var(--bg); padding: 0 18px max(8px, env(safe-area-inset-bottom)); }
.nav-items { border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(5, 1fr); min-height: 68px; }
.nav-items a { color: var(--muted); text-align: center; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: .66em; gap: 5px; }
.nav-items a.active { color: var(--mint); }
.nav-icon { height: 22px; display: grid; place-items: center; font-size: 1.82em; font-weight: 500; }
.nav-icon img { width: 21px; height: 21px; }
.nav-icon .bars { display: flex; align-items: flex-end; gap: 3px; height: 16px; }
.bars i { width: 4px; height: 10px; background: currentColor; border-radius: 1px; }
.bars i:nth-child(2) { height: 17px; }.bars i:nth-child(3) { height: 13px; }
a { color: var(--mint); text-decoration: none; }
a:hover { text-decoration: underline; }
a.card:hover, a.button:hover, nav a:hover, a.row:hover { text-decoration: none; }
:focus-visible { outline: 2px solid var(--mint); outline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
button, .button { display: inline-flex; align-items: center; justify-content: center; text-align: center; min-height: 47px; padding: 9px 13px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--mint); cursor: pointer; font-weight: 600; font-size: .93em; }
button:hover, .button:hover { filter: brightness(1.12); text-decoration: none; }
button[disabled], .button[aria-disabled="true"] { opacity: .48; cursor: default; }
.primary { color: #091a1d; border-color: var(--mint); background: var(--mint); }
.ghost { min-height: 38px; border: 0; background: transparent; padding: 0; }
.full { width: 100%; }
h2,h3,p { margin: 0 0 12px; }
h2 { font-size: 1.25em; line-height: 1.5; }
h3 { font-size: 1em; line-height: 1.55; }
p, li { line-height: 1.65; }
p:last-child { margin-bottom: 0; }
small,.small { font-size: .78em; }
.muted { color: var(--muted); }
.mint,.high,.positive,.win { color: var(--mint); }
.low,.negative,.loss { color: var(--blue); }
.error { color: var(--error); }
.error:empty { display: none; }
section + section { margin-top: 24px; }
.stack { display: grid; gap: 12px; }
.stack > :is(p,h2,h3) { margin: 0; }
.stack.big { gap: 21px; }
.duo { display: flex; gap: 8px; }
.duo > * { flex: 1; min-width: 0; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.flex { display: flex; align-items: center; gap: 10px; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; }
.center { text-align: center; }
.card { display: block; color: var(--text); background: var(--surface); border: 1px solid var(--border); padding: 13px; border-radius: 15px; box-shadow: 0 2px 2px #0004; }
.card + .card { margin-top: 10px; }
.stack > .card { margin-top: 0; }
.card h3 { margin-bottom: 7px; }
.card-soft { background: #26323c; }
.row { display: flex; align-items: center; gap: 10px; padding: 13px 2px; min-height: 55px; border-bottom: 1px solid var(--line); color: var(--text); }
.row .main { flex: 1; min-width: 0; }
.row small { display: block; color: var(--muted); margin-top: 4px; }
.row:hover .arrow { color: var(--text); }
.arrow { color: var(--mint); }
.textlink { display: inline-flex; align-items: center; min-height: 40px; font-size: .84em; }
.textlink::after { content: ' ›'; margin-left: 5px; }
.tabs { display: flex; gap: 5px; margin: 0; }
.tabs > * { flex: 1; min-width: 0; }
.tab { min-height: 40px; padding: 6px; font-size: .78em; color: var(--muted); }
.tab.selected, .choice.selected { background: var(--mint-bg); color: var(--mint); border-color: var(--mint); }
.choice { min-height: 86px; display: grid; gap: 6px; font-size: 1.4em; font-weight: 500; }
.choice small { font-size: .54em; }
.choice.low { color: var(--blue); }
.choice.low.selected { background: #283551; border-color: var(--blue); }
input:not([type=checkbox]):not([type=file]), select, textarea { width: 100%; min-width: 0; min-height: 47px; padding: 11px 12px; border: 1px solid var(--border); border-radius: 11px; background: var(--surface); color: var(--text); }
textarea { min-height: 92px; resize: vertical; }
input::placeholder,textarea::placeholder { color: var(--muted); }
input[type=checkbox] { width: 19px; height: 19px; accent-color: var(--mint); }
label { display: block; }
.field { display: grid; gap: 6px; }
.field-error { margin: 0; color: var(--error); font-size: .79em; }
.number { font-variant-numeric: tabular-nums; font-weight: 650; }
.big-number { font-size: 1.85em; line-height: 1.35; letter-spacing: -.03em; }
.price { font-size: 1.7em; }
.right { text-align: right; }
.asset-icon,.avatar { display: grid; place-items: center; color: var(--mint); background: var(--mint-bg); width: 34px; height: 34px; flex: 0 0 34px; border-radius: 50%; overflow: hidden; font-weight: 650; }
.asset-icon img,.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.large { flex-basis: 66px; width: 66px; height: 66px; font-size: 1.45em; }
.metric-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 6px; }
.metric-grid a { color: var(--text); min-height: 48px; }
.metric-grid small { display: block; margin-bottom: 5px; }
.metric-grid .number { font-size: 1.4em; }
.market-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
.market-grid .card { margin-top: 0; min-width: 0; }
.market-grid .asset-icon { width: 27px; height: 27px; flex-basis: 27px; }
.market-grid .number { font-size: 1.06em; overflow-wrap: anywhere; }
.chart-shell { background: var(--surface); padding: 10px; border-radius: 13px; }
canvas.chart { width: 100%; height: 155px; display: block; }
canvas.spark { width: 54px; height: 27px; display: block; }
.gallery-title { margin: 3px 0; }
.ratio-bar { width: 100%; height: 8px; border: 0; display: block; accent-color: var(--mint); background: var(--blue); }
.ratio-bar::-webkit-progress-bar { background: var(--blue); border-radius: 10px; }
.ratio-bar::-webkit-progress-value { background: var(--mint); border-radius: 10px; }
.ratio-bar::-moz-progress-bar { background: var(--mint); border-radius: 10px; }
.kv { display: grid; grid-template-columns: minmax(5em, 1fr) minmax(0,1.4fr); align-items: baseline; gap: 8px 12px; margin: 0; }
.kv dt { color: var(--muted); font-size: .82em; }
.kv dd { text-align: right; margin: 0; overflow-wrap: anywhere; }
.prohero { font-size: 1.5em; letter-spacing: .006em; line-height: 1.45; }
.rule-section { padding: 17px 0; border-bottom: 1px solid var(--line); }
.notice { border-left: 3px solid var(--mint); padding-left: 10px; }
.empty { padding: 32px 10px; text-align: center; }
.skeleton { height: 90px; border-radius: 12px; background: var(--surface); margin: 10px 0; animation: pulse 1.2s alternate infinite; }
@keyframes pulse { from { opacity: .55; } to { opacity: 1; } }
.status { border-radius: 7px; background: var(--mint-bg); color: var(--mint); display: inline-block; padding: 2px 8px; font-size: .74em; }
.toast { position: fixed; z-index: 10; bottom: max(82px, calc(70px + env(safe-area-inset-bottom))); left: 50%; transform: translateX(-50%); text-align: center; width: min(370px, calc(100% - 26px)); padding: 10px; border-radius: 10px; background: #35434c; box-shadow: 0 3px 12px #0005; pointer-events: none; }
.toast:empty { display: none; }
dialog { max-width: min(370px, calc(100% - 32px)); border: 1px solid var(--border); border-radius: 16px; padding: 18px; background: var(--surface); color: var(--text); }
dialog::backdrop { background: #080b12bb; }
hr { border: 0; border-top: 1px solid var(--line); width: 100%; margin: 14px 0; }
details { padding: 12px 0; border-bottom: 1px solid var(--line); }
summary { cursor: pointer; color: var(--text); padding-bottom: 8px; }
abbr[title] { text-decoration: none; }
@media (min-width: 650px) {
  .frame { border-inline: 1px solid #262d36; }
}
@media (max-width: 355px) {
  main { padding-inline: 14px; }
  header { margin-inline: 14px; }
  canvas.spark { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .skeleton { animation: none; }
}
.prediction-row > .flex { width: 100%; }
.prediction-row small { display: block; margin-top: 4px; }
[data-form="market-search"] .duo > button { flex: 0 0 64px; }
.participants-controls {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--bg);
  padding-block: 8px;
}
.participants-search { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
:root[data-theme="light"] {
  color-scheme: light; --bg: #f9fafc; --surface: #eef2f5; --line: #d2dbe4; --border: #b6c5d2;
  --mint: #097663; --mint-bg: #d7ede7; --text: #142231; --muted: #43566a; --blue: #355586; --error: #9f2825;
  background: #e5ecf0;
}
:root[data-theme="light"] .primary { color: white; }
:root[data-theme="light"] .card-soft { background: #e0ebef; }
@media (prefers-color-scheme: light) {
  :root[data-theme="system"] {
    color-scheme: light; --bg: #f9fafc; --surface: #eef2f5; --line: #d2dbe4; --border: #b6c5d2;
    --mint: #097663; --mint-bg: #d7ede7; --text: #142231; --muted: #43566a; --blue: #355586; --error: #9f2825;
    background: #e5ecf0;
  }
  :root[data-theme="system"] .primary { color: white; }
  :root[data-theme="system"] .card-soft { background: #e0ebef; }
}
