:root {
  --bg: #0b0d14; --bg2: #121624; --card: #161b2c; --card2: #1d2338; --line: #2a3150;
  --text: #eef0f7; --muted: #8d94b2; --gold: #e8c15a; --gold2: #b8902b;
  --good: #3ecf8e; --warn: #f2b53c; --bad: #f2555a; --blue: #5b8cff;
  --r: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.45 Inter, system-ui, -apple-system, sans-serif; }
body { min-height: 100vh; overflow-x: hidden; }
button, input, select { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; }
small { color: var(--muted); }
.muted { color: var(--muted); font-size: 13px; margin: 6px 0; }
.gold { color: var(--gold); } .goodc { color: var(--good); } .negc { color: var(--bad); }

/* title & setup */
body.title-screen { background: radial-gradient(1200px 600px at 50% -10%, #2b2410 0%, var(--bg) 60%); }
.title-wrap { max-width: 640px; margin: 0 auto; padding: 12vh 16px 40px; text-align: center; }
.title-logo { width: 120px; height: 120px; filter: drop-shadow(0 10px 30px rgba(232, 193, 90, .35)); }
.title { font: 800 64px/1 'Playfair Display', serif; letter-spacing: -1px; margin: 18px 0 10px; }
.title span { color: var(--gold); }
.title.small { font-size: 40px; text-align: center; margin: 24px 0 8px; }
.tag { font-size: 18px; color: #cfd3e6; }
.tag em { color: var(--gold); font-style: normal; font-weight: 700; }
.title-btns { display: flex; gap: 12px; justify-content: center; margin: 28px 0; flex-wrap: wrap; }
.fine { color: var(--muted); font-size: 13px; max-width: 480px; margin: 0 auto; }
.setup { max-width: 1040px; margin: 0 auto; padding: 0 16px 60px; }
.setup h2 { font-size: 16px; color: var(--gold); margin: 26px 0 12px; text-transform: uppercase; letter-spacing: 1px; }
.jobs { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.jobcard { text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; cursor: pointer; transition: .15s; }
.jobcard:hover { border-color: var(--gold2); transform: translateY(-2px); }
.jobcard.on { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold), 0 8px 30px rgba(232, 193, 90, .15); }
.jobcard .ji { font-size: 30px; } .jobcard b { display: block; font-size: 16px; margin-top: 6px; } .jobcard p { color: var(--muted); font-size: 12.5px; margin: 6px 0 0; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; margin: 10px 0; }
label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--muted); }
label.check { flex-direction: row; align-items: center; gap: 8px; color: var(--text); }
input, select { background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 9px 10px; min-width: 0; }
input:focus, select:focus { outline: 2px solid var(--gold2); border-color: transparent; }
.setup-go { display: flex; justify-content: space-between; gap: 12px; margin-top: 30px; flex-wrap: wrap; }

/* buttons */
.btn { background: var(--card2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; cursor: pointer; transition: .12s; white-space: nowrap; }
.btn:hover:not(:disabled) { border-color: var(--gold2); background: #252c46; }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn.gold { background: linear-gradient(180deg, #f0cd6a, #c99a2e); color: #1a1406; border-color: #f3d27a; font-weight: 700; }
.btn.gold:hover:not(:disabled) { filter: brightness(1.08); background: linear-gradient(180deg, #f0cd6a, #c99a2e); }
.btn.danger { border-color: #6b2a33; color: #ff9da0; }
.btn.big { padding: 13px 22px; font-size: 16px; border-radius: 12px; }
.btn.sm { padding: 5px 9px; font-size: 12.5px; }
.btns { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0; }

/* header */
.top { position: sticky; top: 0; z-index: 20; display: grid; grid-template-columns: 1.3fr 1fr 1fr auto; gap: 14px; align-items: center; padding: 10px 16px; background: rgba(11, 13, 20, .92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.who { display: flex; gap: 10px; align-items: center; min-width: 0; }
.who b { display: block; font-size: 15px; } .who small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-logo { width: 36px; height: 36px; flex: none; }
.nw, .cashbox { display: flex; flex-direction: column; line-height: 1.2; }
.nw b { font: 800 24px 'Playfair Display', serif; color: var(--gold); }
.nw.neg b { color: var(--bad); }
.cashbox b { font-size: 18px; }
.next { background: linear-gradient(180deg, #f0cd6a, #c99a2e); color: #1a1406; border: 0; border-radius: 12px; padding: 12px 18px; font-weight: 800; font-size: 15px; cursor: pointer; box-shadow: 0 6px 20px rgba(232, 193, 90, .25); white-space: nowrap; }
.next:hover { filter: brightness(1.08); } .next:disabled { opacity: .4; }
.meters { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--bg2); }
.meter { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; font-size: 12px; align-items: center; }
.meter span { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .meter .bar { grid-column: 1 / -1; grid-row: 2; } .meter b { grid-column: 2; grid-row: 1; }
.bar { height: 7px; background: #262c45; border-radius: 9px; overflow: hidden; margin: 3px 0 6px; }
.bar i { display: block; height: 100%; border-radius: 9px; transition: width .4s; }
.warns { padding: 8px 16px; background: #2a1517; border-bottom: 1px solid #5a2328; color: #ffb4b6; font-size: 13px; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.tabs { display: flex; gap: 4px; overflow-x: auto; padding: 8px 12px; border-bottom: 1px solid var(--line); scrollbar-width: none; position: sticky; top: 63px; z-index: 15; background: var(--bg); }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { background: none; border: 0; padding: 8px 12px; border-radius: 9px; color: var(--muted); cursor: pointer; white-space: nowrap; position: relative; }
.tabs button:hover { color: var(--text); background: var(--card); }
.tabs button.on { color: #1a1406; background: var(--gold); font-weight: 700; }
.badge { position: absolute; top: 1px; right: 0; background: var(--bad); color: #fff; font-style: normal; font-size: 10px; font-weight: 700; border-radius: 9px; padding: 0 5px; line-height: 16px; }
main { padding: 16px; max-width: 1400px; margin: 0 auto; }
.subtabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.subtabs button, .chips button { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 6px 12px; cursor: pointer; font-size: 13px; }
.subtabs button.on, .chips button.on { background: var(--gold); color: #1a1406; border-color: var(--gold); font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 10px; }
.chips button:hover:not(.on) { border-color: var(--gold2); }

/* cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 14px; align-items: start; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; min-width: 0; }
.card.wide { grid-column: 1 / -1; overflow-x: auto; }
.card h3 { font-size: 16px; margin-bottom: 10px; } .card h3 small { font-weight: 400; margin-left: 6px; }
.card h4 { font-size: 13px; color: var(--gold); margin: 14px 0 6px; text-transform: uppercase; letter-spacing: .6px; }
.row { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; border-bottom: 1px dashed #232a44; font-size: 13.5px; }
.row span { color: #c6cbe0; min-width: 0; } .row b { text-align: right; white-space: nowrap; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin-bottom: 10px; }
.stats div { background: var(--bg2); border-radius: 10px; padding: 8px 10px; } .stats small { display: block; font-size: 11.5px; } .stats b { font-size: 14px; }
.list { display: flex; flex-direction: column; }
.li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid #222842; }
.li > div:first-child { min-width: 0; } .li b { display: inline; } .li small { display: block; }
.li .btns { margin: 0; flex: none; justify-content: flex-end; }
.li select { max-width: 160px; padding: 6px; font-size: 12.5px; }
.pill { background: #2b2a1a; color: var(--gold); border: 1px solid #5a4b1d; border-radius: 20px; padding: 3px 9px; font-size: 12px; white-space: nowrap; }
.alert { background: var(--bg2); border-left: 3px solid var(--blue); padding: 8px 12px; border-radius: 8px; margin: 8px 0; }
.alert.bad { border-color: var(--bad); color: #ffc0c2; }
.logs { display: flex; flex-direction: column; gap: 4px; max-height: 420px; overflow-y: auto; }
.logs.full { max-height: none; }
.lg { padding: 6px 9px; border-radius: 8px; background: var(--bg2); font-size: 13px; border-left: 3px solid var(--line); }
.lg.good { border-color: var(--good); } .lg.bad { border-color: var(--bad); } .lg.warn { border-color: var(--warn); } .lg.event { border-color: var(--gold); }
.lg small { margin-right: 6px; }
.nwchart { width: 100%; height: 140px; display: block; }
.nwchart .line { fill: none; stroke: var(--gold); stroke-width: 2.5; vector-effect: non-scaling-stroke; }
.nwchart .area { fill: rgba(232, 193, 90, .1); stroke: none; }
.nwchart .bline { stroke: var(--bad); stroke-dasharray: 5 5; stroke-width: 1.3; vector-effect: non-scaling-stroke; }
.chart-cap { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin: 2px 0 8px; }
.chart-empty { height: 80px; display: grid; place-items: center; color: var(--muted); background: var(--bg2); border-radius: 10px; margin-bottom: 8px; }
.offer { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 12px; margin-bottom: 10px; background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; }
.offer p { margin: 4px 0; color: #c6cbe0; font-size: 13px; }
.bills { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.bill { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center; background: var(--bg2); border-radius: 10px; padding: 8px 10px; }
.bill small { display: block; } .bill.od { border: 1px solid #6b2a33; }
table.stocks { width: 100%; border-collapse: collapse; min-width: 640px; }
table.stocks th { text-align: left; color: var(--muted); font-weight: 500; font-size: 12px; padding: 6px; border-bottom: 1px solid var(--line); }
table.stocks td { padding: 8px 6px; border-bottom: 1px solid #222842; vertical-align: middle; }
table.stocks td small { display: block; }
.tbtns { display: flex; gap: 4px; justify-content: flex-end; }
.spark { width: 80px; height: 24px; } .spark polyline { fill: none; stroke-width: 1.6; } .spark .up { stroke: var(--good); } .spark .down { stroke: var(--bad); }
.taxrow { display: flex; gap: 10px; align-items: center; } .taxrow input { flex: 1; padding: 0; }
.venues { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px; }
.venue { flex-direction: row; align-items: center; gap: 6px; background: var(--bg2); border: 1px solid var(--line); border-radius: 9px; padding: 6px 8px; color: var(--text); cursor: pointer; font-size: 12.5px; }
.venue.on { border-color: var(--gold); } .venue small { margin-left: auto; font-size: 11px; text-align: right; }
.est { background: var(--bg2); border-radius: 10px; padding: 8px 12px; margin: 10px 0; }
.slots { font-size: 34px; letter-spacing: 6px; margin: 4px 0; }
.bj { background: #0f3322; border-radius: 10px; padding: 10px; font-size: 16px; } .bj > div { margin: 4px 0; }
.acct { border-bottom: 1px solid #222842; padding-bottom: 6px; } .acct .li { border: 0; }

/* modal */
#modal { position: fixed; inset: 0; background: rgba(4, 5, 10, .72); backdrop-filter: blur(4px); display: none; align-items: center; justify-content: center; z-index: 50; padding: 16px; }
#modal.on { display: flex; }
.modal-card { background: linear-gradient(180deg, #1c2236, #141929); border: 1px solid #3a4266; border-radius: 18px; max-width: 520px; width: 100%; padding: 22px; box-shadow: 0 30px 80px rgba(0, 0, 0, .6); animation: pop .2s ease-out; max-height: 90vh; overflow-y: auto; }
@keyframes pop { from { transform: scale(.94); opacity: 0; } }
.modal-card h2 { font: 800 24px 'Playfair Display', serif; margin-bottom: 8px; }
.modal-card p { font-size: 15px; color: #d5d9ea; }
.ev-count { font-size: 12px; color: var(--gold); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 4px; }
.choices { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.choice { text-align: left; padding: 11px 14px; white-space: normal; }
.verdict { padding: 12px; border-radius: 10px; margin: 12px 0; font-weight: 700; }
.verdict.win { background: #13301f; color: var(--good); } .verdict.lose { background: #33161a; color: #ff9da0; }
#toasts { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 6px; z-index: 60; width: min(440px, calc(100% - 32px)); pointer-events: none; }
.toast { background: #1f2640; border: 1px solid #3a4266; border-left: 4px solid var(--blue); padding: 10px 14px; border-radius: 10px; box-shadow: 0 10px 30px rgba(0, 0, 0, .4); transition: .4s; font-size: 13.5px; }
.toast.good { border-left-color: var(--good); } .toast.bad { border-left-color: var(--bad); } .toast.out { opacity: 0; transform: translateY(8px); }

@media (max-width: 860px) {
  .top { grid-template-columns: 1fr 1fr; gap: 8px 12px; }
  .next { grid-column: 1 / -1; }
  .tabs { top: 0; position: static; }
  .meters { grid-template-columns: repeat(3, 1fr); }
  .grid { grid-template-columns: 1fr; }
  .title { font-size: 46px; }
}
@media (max-width: 520px) {
  .top { position: static; }
  .who { grid-column: 1 / -1; }
  main { padding: 12px; }
  .li { flex-wrap: wrap; } .li .btns { justify-content: flex-start; }
  .offer { flex-direction: column; align-items: stretch; }
  .bill { grid-template-columns: 1fr auto; } .bill .btn { grid-column: 1 / -1; }
  .meters { gap: 6px 10px; }
}
