:root {
  --bg: #0c0f14; --panel: #131922; --line: #243044; --text: #d7e0ec; --muted: #8b98ab;
  --up: #26a69a; --dn: #ef5350; --gold: #e8b15a; --chip: #1c2636;
  color-scheme: dark;
  font-family: "Segoe UI", "Helvetica Neue", system-ui, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 650; letter-spacing: .04em; font-size: 20px; }
.brand.sm { font-size: 16px; }
.mark { width: 18px; height: 18px; border-radius: 5px; background:
  linear-gradient(160deg, transparent 40%, var(--gold) 41% 46%, transparent 47%),
  linear-gradient(#e8b15a, #e8b15a) 2px 12px / 8px 2px no-repeat,
  #1a1408; border: 1px solid #6e5424; }
.gate { position: fixed; inset: 0; display: grid; place-items: center; padding: 24px; background:
  radial-gradient(800px 400px at 50% 0%, #1a2230, transparent 70%), var(--bg); }
.card { width: min(420px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 28px 26px; box-shadow: 0 20px 60px #0008; }
.card.slim { text-align: center; }
.lede, .hint { color: var(--muted); line-height: 1.45; }
.gbtn, .primary, .ghost, .iconbtn, .symbtn {
  border: 1px solid var(--line); background: var(--chip); border-radius: 10px; padding: 10px 14px;
}
.gbtn { width: 100%; display: flex; gap: 10px; align-items: center; justify-content: center; background: #fff; color: #1f1f1f; font-weight: 600; }
.gbtn:hover { filter: brightness(1.05); }
.primary { background: var(--gold); color: #1a1408; border-color: transparent; font-weight: 650; }
.ghost { background: transparent; }
.iconbtn { padding: 6px 10px; background: transparent; }
.err { color: var(--dn); }
#gSlot { position: relative; min-height: 0; }
#gSlot:not(:empty) { min-height: 44px; }
#devForm { display: grid; gap: 8px; margin-top: 14px; }
#devForm[hidden] { display: none; }
#devForm input { background: #0c0f14; border: 1px solid var(--line); border-radius: 8px; padding: 10px; }
.queue { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: #000; z-index: 30; }
.queue-col, .wait-col { display: flex; flex-direction: column; align-items: center; width: min(480px, 100%); text-align: center; gap: 8px; }
#queueSplash, #waitSplash { position: relative; width: min(440px, 92vw); height: min(46vh, 480px); }
#chartLoad { position: absolute; inset: 0; z-index: 4; }
#chartLoad:empty, #markWait:empty, #queueSplash:empty, #waitSplash:empty { display: none; }
#markWait { position: absolute; top: 8px; right: 8px; width: 140px; height: 88px; z-index: 5; }
#deskWrap { position: relative; min-height: 200px; }
.arkano-splash { background: #000; transition: opacity .32s ease; }
.arkano-splash.is-full { position: fixed; inset: 0; z-index: 45; }
.arkano-splash.is-inline { position: absolute; inset: 0; }
.arkano-splash.is-hidden { opacity: 0; pointer-events: none; }
.arkano-splash.is-gone { display: none; }
.arkano-splash svg { width: 100%; height: 100%; display: block; }
.news-chip { position: relative; display: inline-flex; align-items: center; gap: 6px; border: 1px solid #6e5424; background: transparent; color: #d6ab45; border-radius: 999px; padding: 4px 10px; font-size: 11px; letter-spacing: .08em; font-weight: 700; }
.news-chip.on { background: #1a1408; box-shadow: inset 0 0 0 1px #d6ab45; }
.news-chip .dots { width: 18px; height: 8px; background:
  radial-gradient(circle at 2px 4px, #d6ab45 2px, transparent 2.2px),
  radial-gradient(circle at 9px 4px, #d6ab45 2px, transparent 2.2px),
  radial-gradient(circle at 16px 4px, #d6ab45 2px, transparent 2.2px); }
.news-chip .soon { position: absolute; top: -3px; right: -3px; width: 8px; height: 8px; border-radius: 50%; background: #e24b4b; box-shadow: 0 0 0 2px #10151d; }
.news-strip { position: absolute; z-index: 7; left: 8px; top: 40px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; width: min(340px, calc(100% - 96px)); max-width: calc(100% - 96px); padding: 4px 6px 6px; background: rgba(12, 16, 22, .78); border: 1px solid rgba(214, 171, 69, .35); border-radius: 10px; box-shadow: 0 8px 24px #0006; touch-action: none; cursor: grab; user-select: none; }
.news-strip:active { cursor: grabbing; }
.news-tools { grid-column: 2; grid-row: 1; display: flex; align-items: center; }
.news-x { width: 22px; height: 22px; flex: none; border: 0; border-radius: 6px; background: transparent; color: #c5cad3; padding: 0; line-height: 1; font-size: 13px; }
.news-next, .news-then { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 6px; row-gap: 1px; align-items: start; min-width: 0; width: auto; background: transparent; border: 0; color: inherit; text-align: left; padding: 1px 0; cursor: pointer; overflow: visible; }
.news-next { grid-column: 1; grid-row: 1; padding-right: 2px; }
.news-then { grid-column: 1 / -1; grid-row: 2; }
.news-next .k, .news-then .k { grid-column: 1; grid-row: 1; }
.news-next .k { color: #d6ab45; font-size: 10px; letter-spacing: .08em; font-weight: 700; }
.news-then .k { color: var(--muted); font-size: 10px; letter-spacing: .08em; font-weight: 700; padding-top: 2px; }
.news-strip .nm { grid-column: 2; grid-row: 1; font-weight: 650; line-height: 1.25; white-space: normal; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; min-width: 0; max-width: none; }
.news-strip .meta { grid-column: 2; grid-row: 2; display: flex; align-items: center; gap: 6px; min-width: 0; overflow: visible; }
.news-strip .pill, .news-strip .chev, .news-strip .tm, .news-strip .cd { flex: none; overflow: visible; }
.news-strip .tm, .news-strip .cd { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.news-strip .cd { color: var(--text); font-weight: 700; }
.pill { font-size: 10px; letter-spacing: .06em; border-radius: 4px; padding: 1px 6px; font-weight: 700; }
.pill.High { background: #7a2430; color: #ffb4b4; }
.pill.Medium { background: #6a4a12; color: #f0d090; }
.pill.Low, .pill.Holiday, .pill.Non-economic { background: #2a2e36; color: #c5cad3; }
.chev { color: var(--muted); font-size: 16px; }
.news-list, .news-set { position: absolute; z-index: 8; top: calc(100% + 6px); left: 0; right: auto; background: rgba(16, 21, 28, .94); border: 1px solid var(--line); border-radius: 12px; padding: 10px; min-width: 220px; max-width: min(320px, calc(100vw - 24px)); max-height: 240px; overflow: auto; }
.news-strip.list-up .news-list, .news-strip.list-up .news-set { top: auto; bottom: calc(100% + 6px); }
.news-list button { display: flex; gap: 8px; width: 100%; background: transparent; border: 0; border-bottom: 1px solid #1c2636; color: inherit; padding: 8px 4px; text-align: left; }
.news-set { display: grid; gap: 8px; left: 8px; right: auto; }
.news-set label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.news-set input, .news-set select { background: #0c0f14; border: 1px solid var(--line); border-radius: 8px; padding: 6px; }
.news-card { position: absolute; z-index: 8; width: min(280px, 88%); background: #161b22; border: 1px solid #e24b4b; border-radius: 12px; padding: 12px; box-shadow: 0 12px 40px #000a; }
.news-card.Medium { border-color: #d6ab45; }
.news-card.Low, .news-card.Holiday, .news-card.Non-economic { border-color: #5c6570; }
.news-card header { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 0 0 8px; border: 0; background: transparent; }
.news-card h3 { margin: 0 0 4px; font-size: 16px; }
.news-card .when { color: var(--muted); font-size: 12px; margin-bottom: 8px; }
.news-card .row { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid #1c2636; }
.news-card .ccy { border: 1px solid var(--line); border-radius: 8px; padding: 2px 6px; font-size: 11px; }
#app { height: 100%; display: flex; flex-direction: column; }
header { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-bottom: 1px solid var(--line); background: #10151d; }
.symbtn { font-weight: 650; }
.px { font-variant-numeric: tabular-nums; font-weight: 650; min-width: 7ch; }
.px.up { color: var(--up); } .px.dn { color: var(--dn); }
.tfs { display: flex; gap: 2px; flex-wrap: wrap; }
.tfs button { border: 0; background: transparent; color: var(--muted); padding: 6px 7px; border-radius: 7px; }
.tfs button.on { background: var(--chip); color: var(--text); }
.spacer { flex: 1; }
.who { color: var(--muted); font-size: 12px; max-width: 18ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.body { flex: 1; display: flex; min-height: 0; }
aside { width: 240px; border-right: 1px solid var(--line); display: flex; flex-direction: column; background: #10151d; }
aside input { margin: 8px; background: #0c0f14; border: 1px solid var(--line); border-radius: 8px; padding: 8px; }
#symList { overflow: auto; }
.srow { display: flex; justify-content: space-between; gap: 8px; padding: 8px 12px; border: 0; background: transparent; width: 100%; text-align: left; }
.srow.on { background: #1c2636; }
.srow small { color: var(--muted); }
main { position: relative; flex: 1; min-width: 0; }
canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
#ui { pointer-events: auto; }
#legend { position: absolute; left: 10px; bottom: 30px; top: auto; font-size: 11px; color: var(--muted); pointer-events: none; display: flex; gap: 10px; flex-wrap: wrap; }
.empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); pointer-events: none; }
.toast { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); background: #1c2636; border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; max-width: min(560px, calc(100% - 24px)); z-index: 30; }
.sheet { position: fixed; inset: 0; background: #0008; display: grid; place-items: center; z-index: 25; padding: 16px; }
.sheetCard { width: min(720px, 100%); max-height: min(86vh, 800px); overflow: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; }
.sheetCard > header { position: sticky; top: 0; background: var(--panel); }
#sheetBody { padding: 8px 16px 18px; }
.tabs { display: flex; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.row { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid #1c2636; }
.row .st { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--gold); }
.grid { display: grid; gap: 8px; }
.grid label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.grid input, .grid select { background: #0c0f14; border: 1px solid var(--line); border-radius: 8px; padding: 8px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
td, th { text-align: left; padding: 6px 4px; border-bottom: 1px solid #1c2636; }
.masterOnly[hidden] { display: none !important; }
@media (max-width: 800px) {
  aside { position: absolute; z-index: 5; inset: 62px auto 0 0; width: min(280px, 86vw); box-shadow: 8px 0 24px #0008; }
  .who, #btnInd, .brand.sm { display: none; }
  header { flex-wrap: wrap; gap: 2px 4px; padding: 3px 6px 1px; }
  .tfs { order: 10; flex: 1 1 auto; flex-wrap: nowrap; min-width: 0; }
  .tfs button { padding: 2px 5px; }
  #btnReplay, #btnDesk, #btnOut { order: 11; }
  .ghost, .iconbtn, .symbtn { padding: 3px 7px; }
  .news-chip { padding: 3px 8px; }
  .spacer { display: none; }
  .px { min-width: 0; }
}
