/* Client area, back office and auth pages. Builds on the tokens in app.css. */
body.portal { font-size: 14px; background: var(--bg); }
.portal [hidden] { display: none !important; }
.portal section { padding: 0; }
.ic { width: 18px; height: 18px; flex: none; }

/* shell */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; background: linear-gradient(90deg, var(--bg2) 248px, var(--line) 248px, var(--line) 249px, transparent 249px); }
.side { background: var(--bg2); border-right: 1px solid var(--line); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side .brand { display: flex; align-items: center; gap: 10px; padding: 16px 18px; font-weight: 800; font-size: 16px; color: var(--text) !important; text-decoration: none !important; border-bottom: 1px solid var(--line); }
.side .brand svg { width: 30px; height: 30px; }
.side .brand small { display: block; font-weight: 600; font-size: 11px; color: var(--muted); letter-spacing: .03em; }
.side nav { padding: 10px; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.side nav .grp { font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 12px 10px 4px; font-weight: 700; }
.side nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--text) !important; text-decoration: none !important; font-weight: 500; }
.side nav a:hover { background: var(--surface2); }
.side nav a.on { background: color-mix(in srgb, var(--accent-2) 14%, transparent); color: var(--accent-2) !important; font-weight: 600; }
:root[data-theme="dark"] .side nav a.on { color: var(--accent) !important; background: color-mix(in srgb, var(--accent) 12%, transparent); }
.side nav a .badge { margin-left: auto; font-size: 11px; font-weight: 700; background: var(--sell); color: #fff; border-radius: 9px; padding: 0 7px; min-width: 20px; text-align: center; }
.side .foot { padding: 12px 16px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.main { min-width: 0; display: flex; flex-direction: column; }
.top { height: 60px; display: flex; align-items: center; gap: 12px; padding: 0 24px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg2) 92%, transparent); backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 40; }
.top h1 { font-size: 18px; margin: 0; flex: 1; }
.top .ib { background: none; border: 1px solid var(--line); color: var(--text); border-radius: 9px; height: 36px; min-width: 36px; display: inline-grid; place-items: center; cursor: pointer; padding: 0 8px; position: relative; }
.top .ib:hover { background: var(--surface2); }
.top .ib .dot { position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--sell); }
.top .who { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.top .who .av { width: 34px; height: 34px; border-radius: 50%; background: var(--accent-2); color: #fff; display: grid; place-items: center; font-weight: 700; }
.burger2 { display: none !important; }
.content { padding: 24px; max-width: 1400px; width: 100%; }
.demo-strip { background: color-mix(in srgb, var(--warn) 14%, transparent); color: var(--text); font-size: 12.5px; padding: 6px 24px; border-bottom: 1px solid color-mix(in srgb, var(--warn) 30%, transparent); }
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; background: none; }
  .side { position: fixed; z-index: 60; left: 0; top: 0; width: 260px; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow); }
  .side.open { transform: none; }
  .burger2 { display: inline-grid !important; }
  .top { padding: 0 12px; } .content { padding: 16px; } .top .who span { display: none; }
}

/* building blocks */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.stat .l { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.stat .v { font-size: 24px; font-weight: 800; letter-spacing: -.02em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat .s { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.stat.link { cursor: pointer; } .stat.link:hover { border-color: var(--accent-2); }
.card { margin-bottom: 20px; }
.card > h3, .card-h h3 { font-size: 15px; margin: 0; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card.flush { padding: 0; overflow: hidden; } .card.flush .card-h { padding: 16px 18px 0; }
.cols2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; } .cols3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.cols-main { display: grid; grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); gap: 20px; align-items: start; }
@media (max-width: 1100px) { .cols2, .cols3, .cols-main { grid-template-columns: 1fr; } }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar input, .toolbar select { width: auto; min-width: 140px; padding: 8px 10px; }
.toolbar input[type=search] { min-width: 240px; flex: 1; max-width: 380px; }
.toolbar .sp { flex: 1; }
.table-wrap { border-radius: 12px; }
.table-wrap .table td, .table-wrap .table th { padding: 9px 12px; }
.table tr.click { cursor: pointer; }
.table .n { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.table td .sub { display: block; color: var(--muted); font-size: 12px; }
.empty { padding: 36px; text-align: center; color: var(--muted); }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 8px 14px; font-size: 14px; }
.kv > span:nth-child(odd) { color: var(--muted); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 620px) { .form-grid { grid-template-columns: 1fr; } .kv { grid-template-columns: 1fr; } }
.acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.pills { display: flex; gap: 6px; flex-wrap: wrap; }
.pill { font-size: 12px; padding: 2px 9px; border-radius: 99px; background: var(--surface2); border: 1px solid var(--line); }
.subtabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.subtabs button { background: none; border: 0; color: var(--muted); font: inherit; font-weight: 600; padding: 10px 12px; cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; }
.subtabs button.on { color: var(--text); border-bottom-color: var(--accent); }
.timeline { display: flex; flex-direction: column; gap: 10px; }
.timeline .it { border-left: 2px solid var(--line); padding: 2px 0 2px 12px; }
.timeline .it .m { font-size: 12px; color: var(--muted); }
.timeline .it.note { border-color: var(--accent-2); }
.timeline .it pre { white-space: pre-wrap; font: inherit; margin: 4px 0 0; }
.progress { height: 8px; background: var(--surface2); border-radius: 6px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--accent); }
.steps-h { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.steps-h .st { flex: 1; min-width: 150px; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 10px 12px; font-size: 13px; }
.steps-h .st b { display: block; }
.steps-h .st.done { border-color: color-mix(in srgb, var(--buy) 50%, transparent); }
.steps-h .st.done b::before { content: '✓ '; color: var(--buy); }
.drop { border: 2px dashed var(--line); border-radius: 12px; padding: 18px; text-align: center; color: var(--muted); cursor: pointer; }
.drop:hover { border-color: var(--accent-2); }
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(230px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.kanban .col { background: var(--surface2); border-radius: 12px; padding: 10px; min-height: 200px; }
.kanban .col h4 { margin: 2px 4px 10px; font-size: 12.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); display: flex; justify-content: space-between; }
.kanban .kc { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px; margin-bottom: 8px; cursor: grab; font-size: 13px; }
.kanban .kc:hover { border-color: var(--accent-2); }
.kanban .kc .m { color: var(--muted); font-size: 12px; }
.kanban .col.over { outline: 2px dashed var(--accent-2); }
.chart-box { height: 220px; }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 160px; padding-top: 10px; }
.bars i { flex: 1; background: var(--accent-2); border-radius: 3px 3px 0 0; min-height: 2px; position: relative; }
.bars i:hover { background: var(--accent); }
.bars-x { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: 4px; }
.qr { background: #fff; padding: 10px; border-radius: 10px; display: inline-block; }
.secret { font-family: var(--mono); background: var(--surface2); padding: 6px 10px; border-radius: 8px; word-break: break-all; }
.mono { font-family: var(--mono); }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.small { font-size: 12.5px; }
.modal { width: min(600px, 100%); }
.modal.wide { width: min(860px, 100%); }
.modal .acts { justify-content: flex-end; }
textarea { min-height: 90px; resize: vertical; }
.notif { padding: 12px 14px; border-bottom: 1px solid var(--line); }
.notif.unread { background: color-mix(in srgb, var(--accent-2) 7%, transparent); }
.notif b { display: block; }
.chat { display: flex; flex-direction: column; gap: 10px; max-height: 420px; overflow-y: auto; padding: 4px; }
.chat .msg { max-width: 80%; padding: 10px 12px; border-radius: 12px; background: var(--surface2); }
.chat .msg.me { align-self: flex-end; background: color-mix(in srgb, var(--accent-2) 16%, transparent); }
.chat .msg .m { font-size: 11.5px; color: var(--muted); margin-bottom: 3px; }
.chat .msg p { margin: 0; white-space: pre-wrap; }

/* auth pages */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth .art { background: radial-gradient(900px 500px at 85% -10%, rgba(47, 107, 255, .55), transparent 60%), radial-gradient(700px 500px at 0% 110%, rgba(15, 180, 138, .35), transparent 60%), linear-gradient(160deg, var(--hero1), var(--hero2)); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; }
.auth .art h2 { font-size: 34px; margin: 0 0 12px; max-width: 460px; }
.auth .art p { color: #c7cce0; max-width: 460px; }
.auth .art .logo { color: #fff !important; }
.auth .art ul { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 10px; }
.auth .art li { display: flex; gap: 10px; align-items: center; color: #dfe3f3; }
.auth .art li svg { color: #2ee6a6; }
.auth .art small { color: #9aa2bd; font-size: 12px; }
.auth .pane { display: grid; place-items: center; padding: 32px 20px; }
.auth .box { width: min(420px, 100%); }
.auth .box h1 { font-size: 28px; margin-bottom: 6px; }
.auth .or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; margin: 16px 0; }
.auth .or::before, .auth .or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.pw-meter { height: 4px; border-radius: 3px; background: var(--surface2); margin-top: 6px; overflow: hidden; }
.pw-meter i { display: block; height: 100%; width: 0; transition: width .2s, background .2s; }
@media (max-width: 900px) { .auth { grid-template-columns: 1fr; } .auth .art { display: none; } }
/* checkbox labels with inline markup: keep text in one flow next to the box */
.portal .check { display: block; position: relative; padding-left: 26px; }
.portal .check > input { position: absolute; left: 0; top: 3px; margin: 0; }

/* market movers (dashboard) and markets page */
.movers { display: flex; flex-direction: column; }
.movers .mv { display: grid; grid-template-columns: minmax(0, 1fr) auto 72px; gap: 12px; align-items: center; padding: 9px 4px; border: 0; border-bottom: 1px solid var(--line); background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; border-radius: 6px; }
.movers .mv:last-child { border-bottom: 0; }
.movers .mv:hover { background: var(--surface2); }
.movers .mv small { display: block; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.movers .mv .mono:last-child { text-align: right; }
.table .star { border: 0; background: none; color: var(--line); cursor: pointer; padding: 0; vertical-align: -3px; }
.table .star svg { width: 16px; height: 16px; } .table .star.on { color: var(--warn); } .table .star.on svg { fill: currentColor; }
.top #cSearch { margin-left: auto; }
.golive-card { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 16px; border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); background: linear-gradient(120deg, color-mix(in srgb, var(--accent) 9%, var(--surface)), var(--surface)); }
.golive-card h3 { margin: 0 0 4px; } .golive-card p { margin: 0; }
@media (max-width: 620px) { .golive-card { flex-direction: column; align-items: stretch; } }
.fdot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; border: 1.5px solid var(--muted); margin-right: 5px; vertical-align: 1px; }
.fdot.on { background: var(--buy); border-color: var(--buy); }
.flip { display: inline-flex; transform: rotate(180deg); }
.btn-xs .ic { width: 14px; height: 14px; }
.chain { display: flex; flex-wrap: wrap; gap: 4px; white-space: normal; min-width: 220px; }

/* IB portal: subscription */
.paywall { max-width: 640px; margin: 40px auto; text-align: center; padding: 36px 32px; }
.paywall h2 { margin: 12px 0 8px; }
.paywall .pw-ic { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; margin: 0 auto; background: color-mix(in srgb, var(--accent-2) 14%, transparent); color: var(--accent-2); }
.paywall .pw-ic svg { width: 28px; height: 28px; }
.paywall .bul { text-align: left; display: inline-block; margin: 12px 0 20px; }
.bul { padding-left: 20px; } .bul li { margin: 3px 0; }
.plans { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.plan { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px; display: flex; flex-direction: column; }
.plan.cur { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.plan .pl-h { display: flex; justify-content: space-between; align-items: center; font-size: 16px; }
.plan .pl-p { font-size: 28px; font-weight: 800; margin: 8px 0 2px; font-family: var(--mono); }
.plan .pl-p small { font-size: 13px; font-weight: 500; color: var(--muted); font-family: var(--font); }
.plan .bul { flex: 1; margin: 8px 0 14px; }
.seg small { font-weight: 700; }

/* ---------- shared ---------- */
.btn-danger { background: var(--sell); color: #fff; border-color: var(--sell); }
