/* ShareDesk – dark & light themes */
:root, [data-theme="dark"] {
  --bg: #0a0e17; --bg2: #0f1420; --surface: #131a28; --surface2: #182132; --border: #222c3f; --grid: #1f2a3d;
  --text: #e6eaf2; --muted: #8592a8; --accent: #6d72f6; --accent2: #22d3ee; --accent-soft: rgba(109,114,246,.14);
  --up: #16c784; --down: #f0475a; --up-soft: rgba(22,199,132,.13); --down-soft: rgba(240,71,90,.13);
  --warn: #f59e0b; --shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 10px 30px -12px rgba(0,0,0,.5);
  --order: rgba(245,158,11,.10); --order-b: #f59e0b;
  color-scheme: dark;
}
[data-theme="light"] {
  --bg: #f4f6fb; --bg2: #eef1f7; --surface: #ffffff; --surface2: #f7f8fc; --border: #e3e7ef; --grid: #edf0f5;
  --text: #121826; --muted: #66728a; --accent: #4f46e5; --accent2: #0891b2; --accent-soft: rgba(79,70,229,.09);
  --up: #0a9b63; --down: #d92d43; --up-soft: rgba(10,155,99,.10); --down-soft: rgba(217,45,67,.09);
  --shadow: 0 1px 2px rgba(16,24,40,.04), 0 8px 24px -12px rgba(16,24,40,.12);
  --order: #fff7e6; --order-b: #f59e0b;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
h1, h2, h3, h4 { margin: 0; letter-spacing: -.01em; }
h1 { font-size: 24px; font-weight: 750; }
h2 { font-size: 20px; } h3 { font-size: 15px; font-weight: 650; display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
h4 { font-size: 13px; font-weight: 650; margin: 14px 0 8px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.card-head h3 { margin: 0; }
p { margin: 0 0 8px; }
small, .small { font-size: 12px; }
.muted { color: var(--muted); }
.up { color: var(--up); } .down { color: var(--down); }
.r { text-align: right; } .c { text-align: center; } .nowrap { white-space: nowrap; } .cap { text-transform: capitalize; }
.mt { margin-top: 16px; } .pad { padding: 12px; } .row { display: flex; align-items: center; justify-content: space-between; } .gap { gap: 10px; display: flex; align-items: center; }
.col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.ic { flex: none; vertical-align: middle; }
input, select, textarea { font: inherit; color: var(--text); background: var(--bg2); border: 1px solid var(--border); border-radius: 10px; padding: 9px 12px; outline: none; width: 100%; transition: border .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea { min-height: 90px; resize: vertical; }
input[type=checkbox] { width: auto; accent-color: var(--accent); }
.tbl td, .tbl th, .ratios b, .big-price, .stat b, .tk b, .idx b { font-variant-numeric: tabular-nums; }

/* buttons */
.btn { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--border); background: var(--surface2); color: var(--text); padding: 9px 14px; border-radius: 10px; font-weight: 600; cursor: pointer; font-size: 13.5px; transition: .15s; white-space: nowrap; }
.btn:hover { border-color: var(--accent); color: var(--text); }
.btn.primary { background: linear-gradient(135deg, var(--accent), #8b5cf6); border-color: transparent; color: #fff; box-shadow: 0 6px 18px -8px var(--accent); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { background: var(--down); border-color: transparent; color: #fff; }
.btn.ghost { background: transparent; }
.btn.sm { padding: 6px 10px; font-size: 12.5px; border-radius: 8px; }
.btn.block { width: 100%; justify-content: center; padding: 11px; }
.btn:disabled { opacity: .6; cursor: wait; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; border: 1px solid transparent; background: transparent; color: var(--muted); cursor: pointer; position: relative; }
.icon-btn:hover { background: var(--surface2); color: var(--text); border-color: var(--border); }
.icon-btn.sm { width: 30px; height: 30px; border-radius: 8px; }
.link { background: none; border: 0; color: var(--accent); cursor: pointer; padding: 0 6px 0 0; font: inherit; font-size: 12.5px; display: inline-flex; align-items: center; gap: 4px; }
.link.danger { color: var(--down); }

/* layout */
.app { display: flex; min-height: 100vh; }
.side { width: 232px; flex: none; background: var(--surface); border-right: 1px solid var(--border); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; padding: 18px 12px; z-index: 30; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; padding: 0 8px 18px; letter-spacing: -.02em; }
.brand.big { font-size: 26px; }
.side nav { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow: auto; }
.side nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--muted); font-weight: 550; }
.side nav a:hover { background: var(--surface2); color: var(--text); }
.side nav a.active { background: var(--accent-soft); color: var(--accent); }
.side-foot { padding: 10px 8px 0; border-top: 1px solid var(--border); }
.demo-badge { background: var(--warn); color: #111; font-weight: 800; font-size: 11px; padding: 4px 8px; border-radius: 6px; display: inline-block; letter-spacing: .06em; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.top { height: 64px; display: flex; align-items: center; gap: 14px; padding: 0 24px; border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(10px); position: sticky; top: 0; z-index: 20; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.search { position: relative; flex: 1; max-width: 560px; display: flex; align-items: center; }
.search > .ic { position: absolute; left: 12px; color: var(--muted); }
.search input { padding-left: 38px; background: var(--surface); height: 40px; }
.search.big input { height: 48px; font-size: 15px; border-radius: 12px; }
.search-results { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); display: none; max-height: 420px; overflow: auto; z-index: 50; }
.search-results.open { display: block; }
.search-results a { display: grid; grid-template-columns: 110px 1fr auto; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--border); align-items: center; }
.search-results a:last-child { border: 0; }
.search-results a:hover, .search-results a.sel { background: var(--accent-soft); color: var(--text); }
.search-results span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.search-results em { font-style: normal; font-size: 11px; color: var(--muted); }
#view { padding: 24px; max-width: 1500px; width: 100%; margin: 0 auto; display: flex; flex-direction: column; gap: 18px; }
.only-mobile { display: none; }
.avatar { width: 36px; height: 36px; border-radius: 50%; border: 0; background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #fff; font-weight: 700; cursor: pointer; display: inline-grid; place-items: center; flex: none; }
.avatar.sm { width: 32px; height: 32px; font-size: 13px; cursor: default; }
.badge { position: absolute; top: 3px; right: 2px; background: var(--down); color: #fff; font-size: 10px; font-style: normal; border-radius: 9px; padding: 0 5px; line-height: 16px; font-weight: 700; }

/* dropdowns */
.dd { position: relative; }
.dd-menu { position: absolute; right: 0; top: calc(100% + 8px); width: 260px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); display: none; overflow: hidden; z-index: 60; }
.dd-menu.open { display: block; }
.dd-menu > a { display: flex; gap: 10px; align-items: center; padding: 10px 14px; }
.dd-menu > a:hover { background: var(--surface2); }
.dd-head { padding: 12px 14px; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; }
.dd-head span { color: var(--muted); font-size: 12px; }
.dd-head.row { flex-direction: row; }
.notif-menu { width: 360px; max-height: 480px; overflow: auto; }
.notif { display: flex !important; flex-direction: column; align-items: flex-start !important; gap: 2px !important; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.notif span { color: var(--muted); font-size: 12.5px; }
.notif em { font-style: normal; font-size: 11px; color: var(--muted); }
.notif.unread { background: var(--accent-soft); }
.notif-list .notif { border-radius: 8px; }

/* ticker */
.ticker { overflow: hidden; border-bottom: 1px solid var(--border); background: var(--surface); white-space: nowrap; height: 36px; display: flex; align-items: center; }
.ticker-track { display: inline-flex; animation: scroll 60s linear infinite; }
.ticker:hover .ticker-track { animation-play-state: paused; }
.tk { display: inline-flex; gap: 8px; padding: 0 22px; border-right: 1px solid var(--border); font-size: 12.5px; }
.tk span { color: var(--muted); } .tk i { font-style: normal; font-weight: 600; }
@keyframes scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 18px; box-shadow: var(--shadow); min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head p { margin: 4px 0 0; }
.actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.cards4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.cards3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.stat { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; }
.stat > span { color: var(--muted); font-size: 12.5px; font-weight: 550; }
.stat > small { color: var(--muted); }
.stat b { font-size: 22px; font-weight: 750; letter-spacing: -.02em; }
.grid-main { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(320px, 1fr); gap: 18px; }
.grid2c { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.section-title { margin: 12px 0 0; display: flex; gap: 8px; align-items: center; }
.error, .form-error { color: var(--down); font-size: 13px; }
.error-card { border-color: var(--down); }
.note { margin-top: 12px; padding: 10px 12px; background: var(--surface2); border-radius: 10px; }

/* index tiles */
.idx-grid { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 12px; }
.idx { padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; position: relative; overflow: hidden; }
.idx::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--border); }
.idx.up::after { background: var(--up); } .idx.down::after { background: var(--down); }
.idx span { font-size: 11px; color: var(--muted); font-weight: 650; letter-spacing: .04em; }
.idx b { font-size: 16px; } .idx i { font-style: normal; font-size: 12px; }

/* toolbar, segments, tabs */
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.seg { display: inline-flex; background: var(--bg2); border: 1px solid var(--border); border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; color: var(--muted); padding: 6px 12px; border-radius: 8px; font: inherit; font-weight: 600; font-size: 13px; cursor: pointer; }
.seg button.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.seg.sm button { padding: 4px 10px; font-size: 12px; }
.filter { max-width: 240px; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--border); flex: 1; }
.tab { border: 0; background: none; color: var(--muted); padding: 8px 12px; font: inherit; font-weight: 600; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* tables */
.table-wrap { overflow-x: auto; margin: 0 -18px; padding: 0 18px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th { text-align: left; color: var(--muted); font-weight: 600; font-size: 12px; padding: 10px 8px; border-bottom: 1px solid var(--border); white-space: nowrap; position: sticky; top: 0; background: var(--surface); }
.tbl th.r { text-align: right; } .tbl th.c { text-align: center; }
.tbl th[data-sort] { cursor: pointer; user-select: none; }
.tbl th[data-sort]:hover { color: var(--text); }
.tbl th[data-dir="asc"]::after { content: " ↑"; } .tbl th[data-dir="desc"]::after { content: " ↓"; }
.tbl td.r, .tbl td.c { white-space: nowrap; }
.tbl td { padding: 10px 8px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tbody tr:hover td { background: var(--surface2); }
.tbl tr.hl td { background: var(--accent-soft); }
.tbl tr.b td { font-weight: 650; }
.tbl tr.total td { font-size: 15px; border-top: 2px solid var(--border); }
.tbl tr.click { cursor: pointer; }
.tbl.compact td, .tbl.compact th { padding: 7px 8px; }
.tbl.fin td:first-child { white-space: nowrap; color: var(--muted); }
.tbl.fin tr.b td:first-child { color: var(--text); }
.tbl .neg-cell { background: var(--down-soft); }
.tbl small { color: var(--muted); }
.stock-cell { display: flex; align-items: center; gap: 8px; min-width: 200px; }
.stock-cell a { display: flex; flex-direction: column; line-height: 1.25; }
.stock-cell a span { color: var(--muted); font-size: 12px; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.src { font-style: normal; font-size: 10.5px; padding: 2px 6px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); white-space: nowrap; }
.src.watch { background: var(--surface2); color: var(--muted); }
.exp { border: 0; background: var(--surface2); color: var(--muted); width: 20px; height: 20px; border-radius: 6px; cursor: pointer; transition: .15s; flex: none; }
.exp.on { transform: rotate(90deg); color: var(--accent); }
.exp-sp { width: 20px; flex: none; }
.row-actions { opacity: .55; } tr:hover .row-actions { opacity: 1; }
.tr.sub td, tr.sub td { background: var(--bg2) !important; }
.lots { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; padding: 4px 0 4px 28px; font-size: 12.5px; }
.lot { display: flex; gap: 10px; align-items: center; }
.range { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); justify-content: center; }
.range .bar { width: 70px; height: 4px; border-radius: 4px; background: linear-gradient(90deg, var(--down), var(--warn), var(--up)); position: relative; opacity: .8; }
.range .bar i { position: absolute; top: -4px; width: 4px; height: 12px; border-radius: 2px; background: var(--text); transform: translateX(-50%); }
.range.mini .bar { width: 60px; }
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 650; padding: 2px 7px; border-radius: 6px; background: var(--surface2); color: var(--muted); border: 1px solid var(--border); white-space: nowrap; }
.tag.buy { color: var(--up); background: var(--up-soft); border-color: transparent; }
.tag.sell { color: var(--down); background: var(--down-soft); border-color: transparent; }
.tag.down { color: var(--down); }
.order-tag { background: var(--order-b) !important; color: #1a1300 !important; border-color: transparent !important; }
.pill { padding: 2px 8px; border-radius: 6px; font-weight: 650; font-size: 12px; }
.pill.up { background: var(--up-soft); } .pill.down { background: var(--down-soft); }

/* stock page */
.stock-head { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; align-items: flex-start; }
.sh-left { min-width: 0; flex: 1; }
.sh-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sh-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface2); font-size: 12px; font-weight: 550; cursor: pointer; color: var(--text); font-family: inherit; }
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip.ghost { background: transparent; color: var(--muted); }
.sh-right { text-align: right; }
.big-price { font-size: 32px; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.big-price.sm { font-size: 22px; display: flex; gap: 10px; align-items: baseline; }
.big-price.sm span { font-size: 14px; }
.sh-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 10px; }
.holding-strip { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; background: linear-gradient(135deg, var(--accent-soft), transparent); }
.holding-strip span { display: block; color: var(--muted); font-size: 12px; } .holding-strip b { font-size: 16px; }
.chart { position: relative; min-height: 200px; }
.chart.sm { min-height: 0; margin-bottom: 8px; }
.chart-host { position: relative; }
.chart-host svg { display: block; }
.chart-tip { position: absolute; display: none; pointer-events: none; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; font-size: 12px; box-shadow: var(--shadow); z-index: 5; min-width: 150px; }
.chart-tip b, .chart-tip span { display: block; } .chart-tip i { font-style: normal; font-weight: 650; }
.chart-foot { margin-top: 6px; }
.ratios { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.ratios > div { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--border); font-size: 13px; }
.ratios span { color: var(--muted); } .ratios b { font-weight: 650; text-align: right; }
.pc { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.pc li { padding: 8px 12px 8px 30px; border-radius: 10px; position: relative; }
.pc.up li { background: var(--up-soft); } .pc.down li { background: var(--down-soft); }
.pc li::before { position: absolute; left: 11px; font-weight: 800; }
.pc.up li::before { content: "✓"; color: var(--up); } .pc.down li::before { content: "!"; color: var(--down); left: 14px; }
.ann-list { display: flex; flex-direction: column; gap: 6px; max-height: 460px; overflow: auto; }
.ann { display: grid; grid-template-columns: auto 1fr auto auto; gap: 12px; align-items: start; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); }
.ann p { margin: 3px 0 0; color: var(--muted); font-size: 12.5px; }
.ann em { font-style: normal; color: var(--muted); font-size: 12px; white-space: nowrap; }
.ann.order { background: var(--order); border-color: var(--order-b); box-shadow: inset 3px 0 0 var(--order-b); }
.ann-list.compact .ann { padding: 8px 10px; }
.about { color: var(--muted); max-height: 220px; overflow: auto; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 6px 0 12px; font-size: 13px; }
.kv span { color: var(--muted); } .kv b { text-align: right; }
.kv.inline { grid-template-columns: repeat(4, auto 1fr); }
.stackbar { display: flex; height: 12px; border-radius: 8px; overflow: hidden; background: var(--grid); }
.legend-row { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 8px; font-size: 12px; color: var(--muted); }
.legend-row i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 5px; }
.news { display: flex; flex-direction: column; }
.news-item { display: flex; flex-direction: column; gap: 2px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.news-item:last-child { border: 0; }
.news-item b { font-weight: 600; line-height: 1.35; }
.news-item span { color: var(--muted); font-size: 12px; }
.movers { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.movers h4 { margin-top: 0; }
.mover { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 13px; align-items: center; }
.mover i { font-style: normal; font-weight: 650; font-size: 12px; }
.home-search { display: flex; flex-direction: column; gap: 14px; }
.home-search .search { max-width: none; }
.preview { border-top: 1px solid var(--border); padding-top: 14px; }
.pv-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.markets { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 18px; }
.query { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 14px; min-height: 120px; line-height: 1.6; }
.examples { display: flex; flex-direction: column; gap: 8px; }
.ex { text-align: left; border: 1px solid var(--border); background: var(--surface2); border-radius: 10px; padding: 9px 12px; cursor: pointer; color: var(--text); font: inherit; }
.ex:hover { border-color: var(--accent); }
.ex b { display: block; font-size: 13px; } .ex span { color: var(--muted); font-size: 11.5px; font-family: ui-monospace, monospace; }
.saved { display: flex; justify-content: space-between; align-items: center; padding: 4px 0; }
.fields { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
details summary { cursor: pointer; }

/* donut */
.donut { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; justify-content: center; }
.donut-k { fill: var(--muted); font-size: 11px; } .donut-v { fill: var(--text); font-size: 14px; font-weight: 750; }
.legend { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; flex: 1; min-width: 160px; }
.legend li { display: grid; grid-template-columns: 12px 1fr auto; gap: 8px; align-items: center; font-size: 13px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; }

.nw-hero { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; background: linear-gradient(135deg, var(--accent-soft), transparent 60%), var(--surface); }
.nw-hero h2 { font-size: 36px; font-weight: 800; letter-spacing: -.03em; }
.nw-hero .cards3 { flex: 1; max-width: 640px; } .nw-hero .stat { box-shadow: none; }

/* forum */
.thread { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; padding: 14px 4px; border-bottom: 1px solid var(--border); align-items: start; }
.thread:last-child { border: 0; }
.thread p { color: var(--muted); margin: 3px 0; }
.thread em { font-style: normal; color: var(--muted); display: flex; gap: 4px; align-items: center; font-size: 13px; }
.back { color: var(--muted); }
.post { display: flex; gap: 14px; }
.post h1 { font-size: 21px; }
.post-body { margin: 12px 0; line-height: 1.65; }
.compose { display: flex; gap: 10px; align-items: flex-end; margin-bottom: 16px; }
.compose textarea { min-height: 60px; }
.compose.sm textarea { min-height: 44px; }
.comments { display: flex; flex-direction: column; }
.comment { display: flex; gap: 10px; padding: 10px 0 10px calc(var(--d) * 28px); border-top: 1px solid var(--border); }
.c-body { flex: 1; min-width: 0; }
.c-head { display: flex; gap: 8px; align-items: baseline; }
.c-text { margin: 4px 0; line-height: 1.6; word-wrap: break-word; }
.reply-box { margin-top: 8px; }
.cashtag { color: var(--accent); font-weight: 600; }
.help-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.help-grid > div { padding: 12px; border: 1px solid var(--border); border-radius: 12px; }

/* forms, switches, modals */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > span { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.field small { color: var(--muted); }
.check { display: flex; gap: 8px; align-items: center; cursor: pointer; margin-bottom: 12px; }
.switch { position: relative; display: inline-block; width: 38px; height: 22px; cursor: pointer; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch i { position: absolute; inset: 0; background: var(--border); border-radius: 22px; transition: .2s; }
.switch i::before { content: ""; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; }
.switch input:checked + i { background: var(--up); }
.switch input:checked + i::before { transform: translateX(16px); }
.modal-wrap { position: fixed; inset: 0; background: rgba(5,8,15,.6); backdrop-filter: blur(3px); display: grid; place-items: center; z-index: 100; opacity: 0; transition: opacity .2s; padding: 16px; }
.modal-wrap.show { opacity: 1; }
.modal { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; width: 100%; max-width: 560px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; box-shadow: 0 30px 80px -20px rgba(0,0,0,.6); transform: translateY(10px); transition: transform .2s; }
.modal.wide { max-width: 760px; }
.modal-wrap.show .modal { transform: none; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-body { padding: 18px 20px 4px; overflow: auto; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; align-items: center; padding: 14px 20px; border-top: 1px solid var(--border); }
.modal-foot .form-error { margin-right: auto; }
.ac-wrap { position: relative; }
.ac-list { position: absolute; left: 0; right: 0; top: 100%; z-index: 10; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow); max-height: 260px; overflow: auto; }
.ac-list:empty { display: none; }
.ac-item { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; padding: 8px 12px; cursor: pointer; font-size: 13px; }
.ac-item:hover { background: var(--accent-soft); }
.ac-item span { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ac-item em { font-style: normal; color: var(--muted); font-size: 11px; }
#toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 200; max-width: 380px; }
.toast { background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--accent); padding: 12px 14px; border-radius: 10px; box-shadow: var(--shadow); transform: translateX(120%); transition: transform .25s; }
.toast.show { transform: none; }
.toast.success { border-left-color: var(--up); } .toast.error { border-left-color: var(--down); }

/* loaders, empty */
.loader { display: flex; gap: 10px; align-items: center; justify-content: center; color: var(--muted); padding: 30px; }
.loader.full { height: 100vh; }
.spin { width: 16px; height: 16px; border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty { display: flex; flex-direction: column; align-items: center; gap: 10px; color: var(--muted); padding: 34px 16px; text-align: center; }
.empty .ic { width: 34px; height: 34px; opacity: .6; }
.empty.small { padding: 18px; }

/* auth */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-art { padding: 60px; display: flex; flex-direction: column; justify-content: center; gap: 24px;
  background: radial-gradient(circle at 20% 20%, rgba(109,114,246,.35), transparent 50%), radial-gradient(circle at 80% 80%, rgba(34,211,238,.2), transparent 50%), var(--bg2); }
.auth-art h1 { font-size: 40px; line-height: 1.15; max-width: 520px; letter-spacing: -.03em; }
.auth-art ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 14px; color: var(--muted); font-size: 15px; }
.auth-art li { display: flex; gap: 12px; align-items: center; } .auth-art li .ic { color: var(--accent); }
.auth-card { align-self: center; justify-self: center; width: 100%; max-width: 400px; padding: 36px; background: var(--surface); border: 1px solid var(--border); border-radius: 20px; box-shadow: var(--shadow); margin: 24px; }
.auth-card h2 { font-size: 24px; margin-bottom: 4px; }
.auth-card .muted { margin-bottom: 22px; }
.switch-l, .auth-card .switch { display: block; width: auto; height: auto; text-align: center; margin-top: 16px; color: var(--muted); cursor: default; }
.auth-card .switch a { color: var(--accent); cursor: pointer; }

/* responsive */
@media (max-width: 1280px) { .idx-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 1100px) {
  .grid-main, .grid2c { grid-template-columns: minmax(0, 1fr); }
  .cards4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .holding-strip { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 820px) {
  .side { position: fixed; left: 0; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow); }
  .side.open { transform: none; }
  .only-mobile { display: inline-grid; }
  #view { padding: 14px; }
  .top { padding: 0 12px; }
  .auth { grid-template-columns: 1fr; } .auth-art { display: none; }
  .ratios { grid-template-columns: 1fr; }
  .cards3, .grid2, .movers { grid-template-columns: 1fr; }
  .idx-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sh-right { text-align: left; } .sh-actions { justify-content: flex-start; }
  .markets { grid-template-columns: 1fr; }
  .kv.inline { grid-template-columns: auto 1fr; }
  .notif-menu { width: 300px; }
}
.span2 { grid-column: 1 / -1; }
.mono, code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; word-break: break-all; }
code { background: var(--surface2); padding: 1px 5px; border-radius: 5px; }

/* setup wizard */
.setup { min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(circle at 15% 10%, rgba(109,114,246,.25), transparent 45%), radial-gradient(circle at 90% 90%, rgba(34,211,238,.15), transparent 45%), var(--bg); }
.setup-card { width: 100%; max-width: 760px; background: var(--surface); border: 1px solid var(--border); border-radius: 22px; padding: 32px; box-shadow: var(--shadow); }
.setup-card h2 { margin: 8px 0 6px; }
.steps { list-style: none; display: flex; gap: 8px; padding: 0; margin: 4px 0 22px; counter-reset: s; }
.steps li { flex: 1; padding: 8px 12px; border-radius: 10px; background: var(--surface2); color: var(--muted); font-size: 13px; font-weight: 600; counter-increment: s; }
.steps li::before { content: counter(s) ". "; }
.steps li.active { background: var(--accent-soft); color: var(--accent); }
.steps li.done { color: var(--up); } .steps li.done::before { content: "✓ "; }
.kind-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 16px 0 20px; }
.kind { text-align: left; border: 1.5px solid var(--border); background: var(--surface2); border-radius: 14px; padding: 14px; cursor: pointer; color: var(--text); font: inherit; display: flex; flex-direction: column; gap: 6px; }
.kind:hover { border-color: var(--accent); }
.kind.active { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 3px var(--accent-soft); }
.kind span { color: var(--muted); font-size: 12.5px; line-height: 1.4; }
.kind em { font-style: normal; color: var(--warn); font-size: 11.5px; }
.setup-actions { display: flex; justify-content: space-between; gap: 10px; margin-top: 8px; }
.error-note { border: 1px solid var(--down); background: var(--down-soft); margin: 0 0 16px; }
.done-box { text-align: center; padding: 20px 0; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.done-box .ic { color: var(--up); }
@media (max-width: 700px) { .kind-grid { grid-template-columns: 1fr; } .setup-card { padding: 20px; } }
#admin { display: flex; flex-direction: column; gap: 18px; }
