/* =============================================================================
   TCM Stocks AI — sai.css
   Layout: one long page of quiet panels; green/red carry meaning only (money in/out).
   Themes: data-skin = dark (રાત) · light (દિવસ) · ocean (સમુદ્ર). Saved as "tcm_skin" (site-wide).
============================================================================= */
:root, [data-skin="dark"] {
  --bg: #070B12; --surface: #0D141F; --surface2: #121B29; --line: #1C2738; --line2: #263349;
  --ink: #E7EDF6; --muted: #8B9AB0; --faint: #5E6C82;
  --accent: #22D3EE; --accent-ink: #04212A;
  --in: #22C55E; --out: #F43F5E; --trap: #F59E0B; --calm: #64748B;
  --in-soft: rgba(34,197,94,.13); --out-soft: rgba(244,63,94,.13); --trap-soft: rgba(245,158,11,.13);
  --shadow: 0 10px 30px rgba(0,0,0,.35);
  color-scheme: dark;
}
[data-skin="light"] {
  --bg: #F3F6FA; --surface: #FFFFFF; --surface2: #F1F4F9; --line: #DFE5EE; --line2: #CBD5E3;
  --ink: #0E1A2B; --muted: #55657A; --faint: #8593A6;
  --accent: #0891B2; --accent-ink: #FFFFFF;
  --in: #15803D; --out: #DC2626; --trap: #B45309; --calm: #64748B;
  --in-soft: rgba(21,128,61,.10); --out-soft: rgba(220,38,38,.09); --trap-soft: rgba(180,83,9,.10);
  --shadow: 0 10px 30px rgba(15,26,43,.10);
  color-scheme: light;
}
[data-skin="ocean"] {
  --bg: #04161F; --surface: #08212D; --surface2: #0C2A39; --line: #133A4D; --line2: #1B4A62;
  --ink: #E1F2F7; --muted: #8FB1C2; --faint: #5F8597;
  --accent: #5EEAD4; --accent-ink: #032420;
  --in: #34D399; --out: #FB7185; --trap: #FBBF24; --calm: #6B8A99;
  --in-soft: rgba(52,211,153,.13); --out-soft: rgba(251,113,133,.13); --trap-soft: rgba(251,191,36,.12);
  --shadow: 0 10px 30px rgba(0,0,0,.35);
  color-scheme: dark;
}

body.sai-body { background: var(--bg) !important; color: var(--ink); margin: 0; }
.sai [hidden], .intro[hidden], .drawer[hidden], .sai-hero [hidden], .tape[hidden] { display: none !important; }
.sai, .dock, .intro, .drawer {
  --f-head: "Anek Gujarati", "Noto Sans Gujarati", system-ui, sans-serif;
  --f-body: "Hind Vadodara", "Noto Sans Gujarati", Inter, system-ui, sans-serif;
  --f-num: Inter, system-ui, sans-serif;
  font-family: var(--f-body); font-size: 16px; line-height: 1.55; color: var(--ink);
}
.sai *, .intro *, .drawer *, .dock * { box-sizing: border-box; }
.sai h1, .sai h2, .sai h3, .intro h2, .drawer h2, .drawer h3 {
  font-family: var(--f-head) !important; color: var(--ink) !important; letter-spacing: 0 !important;
  margin: 0; line-height: 1.2; text-wrap: balance; font-weight: 700 !important;
}
.sai small, .intro small, .drawer small { font-family: var(--f-num); font-weight: 500; font-size: .72em; color: var(--muted); letter-spacing: .02em; }
.sai p { margin: 0; }
.num, .sai td, .card-px, .idx b { font-family: var(--f-num); font-variant-numeric: tabular-nums; }
.sai-wrap { max-width: 1240px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.c-in { color: var(--in); font-style: normal; font-weight: 700; }
.c-out { color: var(--out); font-style: normal; font-weight: 700; }
button { font: inherit; }
.sai button:focus-visible, .intro button:focus-visible, .drawer button:focus-visible, .dock button:focus-visible, .sai input:focus-visible, .sai select:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}

/* ---------- buttons ---------- */
.sai-btn { display: inline-flex; align-items: center; gap: 8px; border-radius: 10px; padding: 10px 16px; border: 1px solid var(--line2);
  background: var(--surface2); color: var(--ink); cursor: pointer; font-weight: 600; font-size: 15px; transition: background .15s, border-color .15s; }
.sai-btn:hover { border-color: var(--accent); }
.sai-btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.sai-btn.primary small { color: inherit; opacity: .8; }
.sai-btn.ghost { background: transparent; }

/* ---------- hero ---------- */
.sai { display: block; padding-top: var(--sai-pad, 0px); }
.sai-hero { padding: 28px 0 0; border-bottom: 1px solid var(--line); position: relative; overflow: hidden; }
.sai-hero::before { content: ""; position: absolute; inset: -40% -10% auto auto; width: 55%; height: 180%;
  background: radial-gradient(closest-side, var(--in-soft), transparent 70%); pointer-events: none; }
.sai-hero::after { content: ""; position: absolute; inset: auto auto -60% -10%; width: 45%; height: 160%;
  background: radial-gradient(closest-side, var(--out-soft), transparent 70%); pointer-events: none; }
.hero-grid { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 18px; position: relative; z-index: 1; padding-bottom: 20px; }
.hero-text { min-width: 0; max-width: 760px; }
.eyebrow { font-family: var(--f-num); font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); display: flex; align-items: center; gap: 8px; margin: 0 0 14px; }
.sai-hero h1 { font-size: clamp(32px, 5.2vw, 58px); font-weight: 800 !important; }
.sai-hero h1 .hl { color: var(--accent); }
.sai-hero .sub { color: var(--muted); font-size: 17px; margin-top: 10px; max-width: 64ch; }
.sai-hero .sub b { color: var(--ink); }
.hero-side { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.sai-status { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; padding: 7px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line2); }
.sai-status .dot, .pulse { width: 9px; height: 9px; border-radius: 50%; background: var(--calm); flex: 0 0 auto; }
.sai-status.live .dot, .pulse.live { background: var(--in); box-shadow: 0 0 0 0 var(--in); animation: ping 1.6s infinite; }
.sai-status.warn .dot { background: var(--trap); }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(34,197,94,.55); } 80%, 100% { box-shadow: 0 0 0 9px rgba(34,197,94,0); } }

/* money tape */
.tape { position: relative; z-index: 1; border-top: 1px solid var(--line); background: var(--surface); overflow: hidden; }
.tape-track { display: flex; gap: 28px; width: max-content; padding: 9px 0; animation: tape 70s linear infinite; }
.tape:hover .tape-track { animation-play-state: paused; }
@keyframes tape { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.tape-item { font-family: var(--f-num); font-size: 13.5px; white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; cursor: pointer; color: var(--ink); background: none; border: 0; padding: 0; }
.tape-item b { font-weight: 700; }
.tape-item .up { color: var(--in); } .tape-item .dn { color: var(--out); }
.tape-label { color: var(--muted); font-family: var(--f-body); }

/* ---------- mood row ---------- */
.mood-row { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px; padding-top: 20px; padding-bottom: 4px; }
.idx-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 10px; align-content: start; }
.idx { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.idx span { display: block; font-size: 12px; color: var(--muted); font-family: var(--f-num); font-weight: 600; letter-spacing: .04em; }
.idx b { display: block; font-size: 19px; font-weight: 700; margin-top: 2px; }
.idx i { font-style: normal; font-family: var(--f-num); font-size: 13px; font-weight: 700; }
.up { color: var(--in); } .dn { color: var(--out); } .fl { color: var(--muted); }
.mood-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 14px; align-items: center; }
.mood-card svg { width: 150px; height: auto; display: block; }
.mood-card h3 { font-size: 13px !important; color: var(--muted) !important; font-family: var(--f-num) !important; text-transform: uppercase; letter-spacing: .08em !important; }
.mood-word { font-family: var(--f-head); font-size: 22px; font-weight: 700; margin-top: 2px; }
.breadth { margin-top: 8px; }
.breadth .bar { display: flex; height: 8px; border-radius: 99px; overflow: hidden; background: var(--line); }
.breadth .bar i { display: block; height: 100%; }
.breadth p { font-size: 13px; color: var(--muted); margin-top: 6px; }

/* ---------- controls ---------- */
.ctrl { position: sticky; top: var(--sai-stick, env(safe-area-inset-top, 0px)); z-index: 30; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); margin-top: 16px; }
.ctrl-in { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding-top: 10px; padding-bottom: 10px; }
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--line2); border-radius: 12px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; color: var(--muted); padding: 7px 12px; border-radius: 9px; cursor: pointer; font-weight: 600; font-size: 15px; display: flex; flex-direction: column; align-items: center; line-height: 1.15; }
.seg button small { font-size: 10.5px; }
.seg button.on { background: var(--accent); color: var(--accent-ink); }
.seg button.on small { color: inherit; opacity: .8; }
.sai-search { position: relative; flex: 1 1 220px; min-width: 0; }
.sai-search i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--faint); font-size: 14px; }
.sai-search input { width: 100%; background: var(--surface); border: 1px solid var(--line2); color: var(--ink); border-radius: 12px; padding: 11px 12px 11px 36px; font: inherit; font-size: 15px; }
.sai-search input::placeholder { color: var(--faint); }
.sugg { position: absolute; left: 0; right: 0; top: calc(100% + 6px); background: var(--surface); border: 1px solid var(--line2); border-radius: 12px; box-shadow: var(--shadow); max-height: 340px; overflow: auto; z-index: 40; }
.sugg button { display: flex; width: 100%; justify-content: space-between; gap: 10px; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--line); color: var(--ink); padding: 10px 12px; cursor: pointer; }
.sugg button:hover, .sugg button.on { background: var(--surface2); }
.sugg b { font-family: var(--f-num); }
.sugg span { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tf-note { color: var(--muted); font-size: 13.5px; margin: 14px 0 0; }
.setup-note { margin-top: 12px; display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 12px;
  background: var(--trap-soft); border: 1px solid color-mix(in srgb, var(--trap) 40%, transparent); font-size: 14.5px; }
.setup-note i { color: var(--trap); font-size: 18px; margin-top: 2px; }
.setup-note b { color: var(--ink); }
.setup-note .bar { height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; margin-top: 8px; }
.setup-note .bar span { display: block; height: 100%; background: var(--trap); }

/* ---------- blocks ---------- */
.block { margin-top: 26px; }
.bh { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 10px; margin-bottom: 14px; }
.bh > div { min-width: 0; max-width: 820px; }
.bh h2 { font-size: clamp(21px, 2.6vw, 27px); }
.bh p { color: var(--muted); font-size: 14.5px; margin-top: 4px; }
.chip-x { background: var(--surface2); border: 1px solid var(--accent); color: var(--ink); border-radius: 999px; padding: 6px 12px; cursor: pointer; font-weight: 600; font-size: 14px; }
.sai-empty { color: var(--muted); font-size: 14.5px; padding: 18px; border: 1px dashed var(--line2); border-radius: 12px; text-align: center; list-style: none; }

/* sector tiles */
.sec-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.sec { text-align: left; border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px; cursor: pointer; color: var(--ink); background: var(--surface); position: relative; overflow: hidden; }
.sec::before { content: ""; position: absolute; inset: 0; background: var(--tint, transparent); pointer-events: none; }
.sec > * { position: relative; }
.sec.on { outline: 2px solid var(--accent); }
.sec .sn { font-family: var(--f-head); font-weight: 700; font-size: 16px; display: block; }
.sec .se { font-family: var(--f-num); font-size: 11px; color: var(--muted); display: block; }
.sec .sv { font-family: var(--f-num); font-weight: 800; font-size: 18px; margin-top: 6px; display: block; }
.sec .sc { font-family: var(--f-num); font-size: 12px; color: var(--muted); display: flex; gap: 8px; margin-top: 2px; }

/* flows */
.flows { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.flow { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px; min-width: 0; }
.flow-in { border-top: 3px solid var(--in); }
.flow-out { border-top: 3px solid var(--out); }
.flow-h { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.flow-h h2 { font-size: 24px; }
.flow-h p { color: var(--muted); font-size: 13.5px; }
.flow-ico { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-size: 18px; flex: 0 0 auto; }
.flow-in .flow-ico { background: var(--in-soft); color: var(--in); }
.flow-out .flow-ico { background: var(--out-soft); color: var(--out); }
.sai-cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.sai-card { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 10px 10px 8px; border-radius: 12px; background: var(--surface2); border: 1px solid transparent; cursor: pointer; }
.sai-card:hover { border-color: var(--line2); }
.sai-card .rk { font-family: var(--f-num); font-weight: 800; color: var(--faint); text-align: center; font-size: 14px; }
.sai-card .nm { min-width: 0; }
.sai-card .nm b { font-family: var(--f-num); font-weight: 800; font-size: 15.5px; }
.sai-card .nm span { display: block; color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sai-card .why { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.sai-card .why i { font-style: normal; font-size: 11.5px; padding: 2px 7px; border-radius: 6px; background: var(--bg); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.sai-card .why i.g { color: var(--in); border-color: color-mix(in srgb, var(--in) 35%, transparent); }
.sai-card .why i.r { color: var(--out); border-color: color-mix(in srgb, var(--out) 35%, transparent); }
.sai-card .why i.a { color: var(--trap); border-color: color-mix(in srgb, var(--trap) 40%, transparent); }
.sai-card .rt { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.card-px { font-weight: 700; font-size: 14.5px; }
.sai-card .ch { font-family: var(--f-num); font-weight: 700; font-size: 13px; }
.dots { display: inline-flex; gap: 3px; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--line2); display: block; }
.flow-in .dots i.on, .dots.g i.on { background: var(--in); }
.flow-out .dots i.on, .dots.r i.on { background: var(--out); }
.star { background: none; border: 0; color: var(--faint); cursor: pointer; padding: 2px 4px; font-size: 14px; }
.star.on { color: #FACC15; }

/* meter (−100..+100) */
.meter { position: relative; height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; }
.meter::after { content: ""; position: absolute; left: 50%; top: -2px; bottom: -2px; width: 2px; background: var(--bg); }
.meter i { position: absolute; top: 0; bottom: 0; border-radius: 99px; display: block; }
.sai-card .meter { margin-top: 7px; }

/* trap */
.trap-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.trap { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px; min-width: 0; }
.trap h3 { font-size: 19px; display: flex; gap: 10px; align-items: center; }
.trap-s h3 i { color: var(--in); } .trap-b h3 i { color: var(--out); }
.trap-why { color: var(--muted); font-size: 13.5px; margin: 4px 0 10px !important; }
.trap ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.trap li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 8px 10px; background: var(--surface2); border-radius: 10px; cursor: pointer; font-size: 14px; }
.trap li b { font-family: var(--f-num); }
.trap li span { font-family: var(--f-num); font-size: 13px; color: var(--muted); text-align: right; }

/* stages */
.stage-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.stage { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px; min-width: 0; }
.stage .st-n { font-family: var(--f-num); font-weight: 800; font-size: 12px; letter-spacing: .1em; color: var(--muted); }
.stage h3 { font-size: 21px; margin-top: 2px; }
.stage .st-c { font-family: var(--f-num); font-size: 28px; font-weight: 800; margin-top: 6px; }
.stage p { color: var(--muted); font-size: 13px; margin-top: 4px !important; }
.stage svg { width: 100%; height: 38px; display: block; margin-top: 8px; }
.stage ul { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-wrap: wrap; gap: 5px; }
.stage li button { font-family: var(--f-num); font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 7px; background: var(--surface2); border: 1px solid var(--line); color: var(--ink); cursor: pointer; }
.st1 { border-top: 3px solid var(--calm); } .st2 { border-top: 3px solid var(--in); } .st3 { border-top: 3px solid var(--trap); } .st4 { border-top: 3px solid var(--out); }

/* option walls */
.oc-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.oc { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px; min-width: 0; }
.oc-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.oc-top h3 { font-size: 20px; }
.oc-top span { font-family: var(--f-num); color: var(--muted); font-size: 13px; }
.walls { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 12px 0; }
.wall { background: var(--surface2); border-radius: 10px; padding: 8px 10px; }
.wall span { display: block; font-size: 12px; color: var(--muted); }
.wall b { font-family: var(--f-num); font-size: 17px; }
.wall.r b { color: var(--out); } .wall.g b { color: var(--in); }
.fly { display: grid; gap: 2px; font-family: var(--f-num); font-size: 11.5px; }
.fly-row { display: grid; grid-template-columns: minmax(0, 1fr) 64px minmax(0, 1fr); align-items: center; gap: 6px; }
.fly-row .l { display: flex; justify-content: flex-end; }
.fly-row .l i, .fly-row .r i { display: block; height: 11px; border-radius: 3px; }
.fly-row .l i { background: color-mix(in srgb, var(--out) 75%, transparent); }
.fly-row .r i { background: color-mix(in srgb, var(--in) 75%, transparent); }
.fly-row .k { text-align: center; color: var(--muted); }
.fly-row.atm .k { color: var(--ink); font-weight: 800; background: var(--surface2); border-radius: 4px; }
.fly-row.cw .k { color: var(--out); font-weight: 800; } .fly-row.pw .k { color: var(--in); font-weight: 800; }
.fly-leg { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.oc-read { font-size: 14px; color: var(--muted); margin-top: 10px !important; }
.oc-read b { color: var(--ink); }

/* time machine */
.sai-select { background: var(--surface); color: var(--ink); border: 1px solid var(--line2); border-radius: 10px; padding: 8px 10px; font: inherit; font-size: 14px; }
.tm-times { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
.tm-times button { flex: 0 0 auto; font-family: var(--f-num); font-weight: 700; font-size: 13px; border: 1px solid var(--line2); background: var(--surface); color: var(--muted); border-radius: 9px; padding: 6px 10px; cursor: pointer; }
.tm-times button.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.tm-lists { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 10px; }
.tm-box { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px; min-width: 0; }
.tm-box h3 { font-size: 17px; margin-bottom: 8px; }
.tm-box table { width: 100%; border-collapse: collapse; font-size: 14px; }
.tm-box th { font-size: 12px; color: var(--muted); font-weight: 600; text-align: right; padding: 4px 6px; }
.tm-box th:first-child, .tm-box td:first-child { text-align: left; }
.tm-box td { padding: 7px 6px; border-top: 1px solid var(--line); text-align: right; }
.tm-box tr[data-s] { cursor: pointer; }
.tm-box tr[data-s]:hover td { background: var(--surface2); }

/* board */
.sai-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.sai-chips button { border: 1px solid var(--line2); background: var(--surface); color: var(--muted); border-radius: 999px; padding: 6px 12px; cursor: pointer; font-weight: 600; font-size: 14px; }
.sai-chips button.on { color: var(--ink); border-color: var(--accent); background: var(--surface2); }
.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
table.board { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 760px; }
.board th { position: sticky; top: 0; background: var(--surface2); color: var(--muted); font-weight: 600; font-size: 12.5px; text-align: right; padding: 10px; cursor: pointer; white-space: nowrap; user-select: none; }
.board th:first-child, .board td:first-child, .board th:nth-child(2), .board td:nth-child(2) { text-align: left; }
.board th.sorted { color: var(--ink); }
.board td { padding: 9px 10px; border-top: 1px solid var(--line); text-align: right; white-space: nowrap; }
.board tbody tr { cursor: pointer; }
.board tbody tr:hover td { background: var(--surface2); }
.board td .nm b { font-family: var(--f-num); font-weight: 700; }
.board td .nm span { display: block; color: var(--muted); font-size: 12px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.board .meter { width: 90px; display: inline-block; vertical-align: middle; }
.sai-pill { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 2px 9px; font-size: 12.5px; font-weight: 700; white-space: nowrap; font-family: var(--f-body); }
.sai-pill.g { background: var(--in-soft); color: var(--in); }
.sai-pill.r { background: var(--out-soft); color: var(--out); }
.sai-pill.a { background: var(--trap-soft); color: var(--trap); }
.sai-pill.n { background: var(--surface2); color: var(--muted); }
.sai-more { margin: 12px auto 0; display: flex; }

.disclaimer { margin: 34px 0 40px; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--muted); font-size: 14px; }
.disclaimer h2 { font-size: 19px; margin-bottom: 6px; }
.disclaimer p + p { margin-top: 8px; }
.disclaimer b { color: var(--ink); }
.disclaimer .small { font-size: 12.5px; }

/* ---------- theme dock (right side) ---------- */
.dock { position: fixed; right: max(10px, env(safe-area-inset-right, 0px)); top: 50%; transform: translateY(-50%); z-index: 950;
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 6px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--line2); box-shadow: var(--shadow); }
.dock-t { font-family: var(--f-num); font-size: 9.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.dock button { background: none; border: 0; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 3px; border-radius: 9px; }
.dock em { font-style: normal; font-size: 10.5px; color: var(--muted); }
.dock button.on em { color: var(--ink); font-weight: 700; }
.sw { width: 24px; height: 24px; border-radius: 50%; display: block; border: 2px solid var(--line2); }
.dock button.on .sw { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.sw-dark { background: linear-gradient(135deg, #0D141F 50%, #22C55E 50%); }
.sw-light { background: linear-gradient(135deg, #FFFFFF 50%, #0891B2 50%); }
.sw-ocean { background: linear-gradient(135deg, #08212D 50%, #5EEAD4 50%); }

/* ---------- intro ---------- */
.intro { position: fixed; inset: 0; z-index: 20000; display: grid; place-items: center; padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(16px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  background: color-mix(in srgb, var(--bg) 70%, transparent); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.intro-card { width: min(680px, 100%); max-height: 100%; overflow: auto; background: var(--surface); border: 1px solid var(--line2); border-radius: 20px; padding: 24px; box-shadow: var(--shadow); }
.intro h2 { font-size: clamp(24px, 3.2vw, 30px); }
.steps { list-style: none; counter-reset: st; margin: 18px 0 0; padding: 0; display: grid; gap: 10px; }
.steps li { counter-increment: st; display: grid; grid-template-columns: 34px minmax(0, 1fr); column-gap: 12px; row-gap: 2px; align-items: start; background: var(--surface2); border-radius: 12px; padding: 12px; }
.steps li::before { content: counter(st); grid-row: span 2; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); font-family: var(--f-num); font-weight: 800; }
.steps b { font-family: var(--f-head); font-size: 17px; }
.steps span { color: var(--muted); font-size: 14.5px; }
.steps span b { font-family: inherit; font-size: inherit; color: var(--ink); }
.intro-btns { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.intro-btns .sai-btn { flex: 1 1 200px; justify-content: center; padding: 13px 16px; }

/* ---------- drawer ---------- */
.drawer { position: fixed; inset: 0; z-index: 19000; }
.drawer-bg { position: absolute; inset: 0; background: rgba(0,0,0,.45); }
.drawer-panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(560px, 100%); background: var(--bg); border-left: 1px solid var(--line2); overflow-y: auto;
  padding: max(16px, env(safe-area-inset-top, 0px)) max(18px, env(safe-area-inset-right, 0px)) max(24px, env(safe-area-inset-bottom, 0px)) 18px; box-shadow: var(--shadow); }
.dr-back { display: inline-flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line2); color: var(--ink); border-radius: 10px; padding: 8px 12px; cursor: pointer; font-weight: 600; }
.dr-head { margin-top: 14px; display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.dr-head h2 { font-size: 30px; font-family: var(--f-num) !important; font-weight: 800 !important; }
.dr-head p { color: var(--muted); font-size: 14px; }
.dr-px { display: flex; align-items: baseline; gap: 10px; margin-top: 6px; font-family: var(--f-num); }
.dr-px b { font-size: 26px; font-weight: 800; }
.dr-px i { font-style: normal; font-weight: 700; }
.tug { margin-top: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.tug .bar { display: flex; height: 12px; border-radius: 99px; overflow: hidden; margin: 8px 0 6px; }
.tug .bar i { display: block; height: 100%; }
.tug .lr { display: flex; justify-content: space-between; font-size: 13px; font-weight: 700; }
.tug h3 { font-size: 15px; }
.tf-cards { display: grid; gap: 10px; margin-top: 12px; }
.tfc { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.tfc-h { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.tfc-h h3 { font-size: 16px; }
.tfc .meter { margin: 10px 0 8px; height: 10px; }
.tfc ul { margin: 0; padding-left: 18px; color: var(--muted); font-size: 14px; }
.tfc ul li + li { margin-top: 3px; }
.tfc ul b { color: var(--ink); }
.chart-box { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; margin-top: 12px; }
.chart-box h3 { font-size: 15px; display: flex; justify-content: space-between; gap: 8px; }
.chart-box h3 span { font-family: var(--f-num); font-size: 12px; color: var(--muted); font-weight: 500; }
.chart-box svg { width: 100%; height: auto; display: block; margin-top: 6px; }
.chart-box .lg { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 4px; }
.chart-box .lg i { display: inline-block; width: 12px; height: 3px; border-radius: 2px; vertical-align: middle; margin-right: 4px; }
svg .ax { fill: var(--muted); font-family: Inter, system-ui, sans-serif; font-size: 10px; }
svg .gr { stroke: var(--line); stroke-width: 1; }
.dr-foot { color: var(--faint); font-size: 12.5px; margin-top: 16px; }

/* ---------- session bar: LIVE / PRE-OPEN / CLOSED / HOLIDAY ---------- */
.sess-wrap { position: relative; z-index: 1; }
.sess { --sc: var(--calm); position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 20px; align-items: center;
  margin: 0 0 18px; padding: 14px 18px 10px 20px; border-radius: 16px; overflow: hidden;
  background: color-mix(in srgb, var(--surface) 90%, transparent); border: 1px solid var(--line2); }
.sess::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--sc); }
.sess[data-state="live"] { --sc: var(--in); }
.sess[data-state="opening"], .sess[data-state="delayed"], .sess[data-state="preopen"], .sess[data-state="pre"] { --sc: var(--trap); }
.sess[data-state="closed"], .sess[data-state="weekend"], .sess[data-state="holiday"] { --sc: var(--calm); }
.sess-l { display: flex; align-items: center; gap: 14px; min-width: 0; }
.sess-chip { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 7px; padding: 6px 11px; border-radius: 999px;
  font: 800 11.5px/1 var(--f-num); letter-spacing: .12em; color: var(--sc);
  background: color-mix(in srgb, var(--sc) 14%, transparent); border: 1px solid color-mix(in srgb, var(--sc) 45%, transparent); }
.sess-chip i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; display: block; }
.sess[data-state="live"] .sess-chip i { animation: ping 1.6s infinite; }
.sess-txt { min-width: 0; }
.sess-txt b { display: block; font-family: var(--f-head); font-size: 17px; font-weight: 700; line-height: 1.25; }
.sess-txt > span { display: block; color: var(--muted); font-size: 13.5px; margin-top: 2px; }
.sess-txt > span b { display: inline; font: inherit; font-weight: 700; color: var(--ink); }
.sess-hol { display: inline-flex !important; align-items: center; gap: 5px; margin-left: 4px; padding: 1px 8px; border-radius: 999px;
  background: color-mix(in srgb, var(--trap) 14%, transparent); color: var(--trap); font-weight: 600; }
.sess-r { text-align: right; }
.sess-cd-l { display: block; font-size: 12px; color: var(--muted); }
.sess-cd { display: block; font: 800 24px/1.15 var(--f-num); font-variant-numeric: tabular-nums; letter-spacing: .02em; color: var(--ink); white-space: nowrap; }
.sess-line { grid-column: 1 / -1; position: relative; height: 26px; margin-top: 2px; }
.sess-line .trk { position: absolute; left: 0; right: 0; top: 5px; height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; }
.sess-line .trk i { position: absolute; top: 0; bottom: 0; }
.sess-line .z-pre { background: color-mix(in srgb, var(--trap) 30%, transparent); }
.sess-line .z-mkt { background: color-mix(in srgb, var(--muted) 18%, transparent); }
.sess-line .fill { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(90deg, var(--trap), var(--in) 12%, var(--in)); opacity: .9; }
.sess[data-state="closed"] .sess-line .fill, .sess[data-state="delayed"] .sess-line .fill { background: var(--calm); opacity: .65; }
.sess-line .now { position: absolute; top: 1px; width: 3px; height: 14px; margin-left: -1.5px; border-radius: 2px; background: var(--ink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--sc) 30%, transparent); }
.sess-line .lb { position: absolute; top: 13px; transform: translateX(-50%); font: 600 10.5px/1.2 var(--f-num); color: var(--faint); white-space: nowrap; }
.sess-line .lb.mid { color: var(--muted); }
.sess-act { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 0 4px; border-top: 1px dashed var(--line2); }
.sess-act > span { font-size: 13px; color: var(--muted); margin-right: 2px; }
.sess-act button { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 10px; cursor: pointer;
  background: var(--surface2); border: 1px solid var(--line2); color: var(--ink); font-weight: 600; font-size: 14px; }
.sess-act button:hover { border-color: var(--accent); }
.sess-act button i { color: var(--accent); }
.sess-act button small { font-size: 11px; }

/* બજાર બંધ: શાંત, અટકેલું — પણ રંગ અને આંકડા વાંચી શકાય */
.sai-status.off { color: var(--muted); background: color-mix(in srgb, var(--surface) 70%, transparent); }
.sai-status.off .dot { background: var(--calm); }
.sai.is-closed .sai-hero::before, .sai.is-closed .sai-hero::after { opacity: .35; filter: saturate(.4); transition: opacity .4s; }
.tape.still { overflow-x: auto; scrollbar-width: none; }
.tape.still::-webkit-scrollbar { display: none; }
.tape.still .tape-track { animation: none; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: 16px; }
.tape.still .tape-item { opacity: .85; }
.tape-label i { margin-right: 2px; color: var(--muted); }
.idx .itag { font-style: normal; margin-left: 8px; padding: 1px 6px; border-radius: 6px; font-size: 10px; letter-spacing: .06em; vertical-align: 1px;
  color: var(--muted); background: var(--surface2); border: 1px solid var(--line2); }
.ctag { display: inline-flex; align-items: center; gap: 5px; vertical-align: middle; margin-left: 6px; padding: 2px 9px; border-radius: 999px;
  font: 600 11.5px/1.5 var(--f-num) !important; letter-spacing: .02em; color: var(--muted); background: var(--surface2); border: 1px solid var(--line2); }
.ctag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--calm); }
.note-help { display: inline-flex; align-items: center; gap: 6px; margin-left: 6px; padding: 2px 10px; border-radius: 999px; cursor: pointer;
  background: transparent; border: 1px solid var(--line2); color: var(--accent); font-size: 13px; font-weight: 600; }
.note-help:hover { border-color: var(--accent); }
.tf-note b { color: var(--ink); }

/* ---------- guide (intro) — tabs ---------- */
.intro-card { display: flex; flex-direction: column; width: min(760px, 100%); max-height: 100%; overflow: hidden; padding: 0; }
.g-head { padding: 22px 24px 0; }
.g-head .eyebrow { margin-bottom: 4px; }
.g-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; margin-top: 14px; padding: 4px; border-radius: 14px; background: var(--surface2); border: 1px solid var(--line); }
.g-tabs button { border: 0; background: transparent; color: var(--muted); cursor: pointer; border-radius: 10px; padding: 8px 6px; display: flex; flex-direction: column; align-items: center; line-height: 1.15; }
.g-tabs button b { font-family: var(--f-head); font-size: 16px; }
.g-tabs button small { font-size: 10.5px; }
.g-tabs button.on { background: var(--accent); color: var(--accent-ink); }
.g-tabs button.on small { color: inherit; opacity: .8; }
.g-body { flex: 1 1 auto; overflow-y: auto; padding: 16px 24px 8px; overscroll-behavior: contain; }
.g-lead { color: var(--muted); font-size: 15px; }
.g-lead b { color: var(--ink); }
.g-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.g-meta span { display: inline-flex; align-items: center; gap: 7px; padding: 6px 11px; border-radius: 10px; background: var(--surface2); border: 1px solid var(--line); font-size: 13.5px; color: var(--ink); }
.g-meta i { color: var(--accent); }
.g-meta b { color: var(--muted); font-weight: 600; margin-right: 2px; }
.g-panel .steps { margin-top: 14px; }
.g-tip, .g-ex, .g-warn { margin-top: 12px; border-radius: 12px; padding: 12px 14px; font-size: 14.5px; }
.g-tip { display: flex; gap: 12px; align-items: flex-start; background: color-mix(in srgb, var(--calm) 12%, transparent); border: 1px solid var(--line2); color: var(--muted); }
.g-tip i { color: var(--ink); margin-top: 3px; }
.g-tip b { color: var(--ink); }
.g-ex { background: color-mix(in srgb, var(--accent) 8%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); }
.g-ex > b, .g-warn > b { display: flex; align-items: center; gap: 8px; font-family: var(--f-head); font-size: 16px; }
.g-ex > b i { color: var(--accent); }
.g-ex p { color: var(--muted); margin-top: 4px !important; }
.g-ex p i { font-style: normal; color: var(--ink); font-family: var(--f-num); font-size: 13.5px; }
.g-ex p b { color: var(--ink); }
.g-warn { background: color-mix(in srgb, var(--trap) 8%, transparent); border: 1px solid color-mix(in srgb, var(--trap) 32%, transparent); }
.g-warn > b i { color: var(--trap); }
.g-warn ul { margin: 6px 0 0; padding-left: 20px; color: var(--muted); }
.g-warn li + li { margin-top: 3px; }
.g-go { margin: 14px 0 6px; }
.g-go i { font-size: 13px; }
.intro .intro-btns { margin: 0; padding: 14px 24px 18px; border-top: 1px solid var(--line); background: var(--surface); }

/* ---------- theme: desktop = જમણી બાજુની પટ્ટી · phone = શીર્ષક પાસે 3 નાનાં બટન (કંઈ ઢંકાય નહીં) ---------- */
.hero-act { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.hero-theme { display: none; align-items: center; gap: 4px; padding: 4px 6px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line2); }
.hero-theme button { background: none; border: 0; padding: 4px; border-radius: 50%; cursor: pointer; display: flex; }
.hero-theme .sw { width: 24px; height: 24px; }
.hero-theme button.on .sw { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .mood-row { grid-template-columns: minmax(0, 1fr); }
  .stage-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .flows, .trap-grid, .oc-grid, .tm-lists { grid-template-columns: minmax(0, 1fr); }
  .hero-side { align-items: flex-start; }
  .ctrl-in { gap: 8px; }
  .seg { width: 100%; }
  .seg button { flex: 1 1 0; padding: 7px 6px; font-size: 14px; }
  .mood-card { grid-template-columns: 120px minmax(0, 1fr); }
  .mood-card svg { width: 120px; }
  .dock { display: none !important; }
  .hero-theme { display: inline-flex; }
  .hero-act { justify-content: flex-start; width: 100%; }
  .hero-act .sai-btn { flex: 1 1 auto; justify-content: center; }
  .hero-side { width: 100%; }
  .hero-side .sai-status { display: none; }
  .walls { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .idx-strip { display: flex; overflow-x: auto; gap: 8px; scrollbar-width: none; }
  .idx-strip .idx { flex: 0 0 auto; min-width: 128px; padding: 10px 12px; }
  .sec-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .sec { padding: 8px; }
  .sec .sn { font-size: 14px; } .sec .se { display: none; }
  .sec .sv { font-size: 15px; margin-top: 2px; } .sec .sv small { display: none; }
  .sec .sc { font-size: 10.5px; gap: 4px; flex-wrap: wrap; }
  .tm-box { overflow-x: auto; padding: 12px 10px; }
  .tm-box table { font-size: 13px; }
  .sess { grid-template-columns: minmax(0, 1fr); padding: 12px 14px 8px 16px; gap: 6px; }
  .sess-l { flex-direction: column; align-items: flex-start; gap: 8px; }
  .sess-hol { display: flex !important; width: fit-content; margin: 6px 0 0; }
  .sess-txt b { font-size: 16px; }
  .sess-r { display: flex; align-items: baseline; gap: 8px; text-align: left; }
  .sess-cd-l { display: inline; }
  .sess-cd { display: inline; font-size: 18px; }
  .sess-act > span { flex-basis: 100%; }
  .sess-act button { flex: 1 1 auto; justify-content: center; padding: 7px 8px; font-size: 13.5px; }
  .sess-act button small { display: none; }
  .g-head { padding: 16px 16px 0; }
  .g-body { padding: 14px 16px 6px; }
  .g-tabs button { padding: 7px 2px; }
  .g-tabs button b { font-size: 14.5px; }
  .g-tabs button small { font-size: 9.5px; }
  .intro .intro-btns { padding: 12px 16px 14px; }
  .intro .intro-btns .sai-btn { flex: 1 1 100%; padding: 11px 14px; }
  .steps li { grid-template-columns: 28px minmax(0, 1fr); column-gap: 10px; padding: 10px; }
  .steps li::before { width: 28px; height: 28px; font-size: 14px; }
  .steps b { font-size: 15.5px; }
  .steps span { font-size: 14px; }
}
@media (max-width: 460px) {
  .stage-grid { grid-template-columns: minmax(0, 1fr); }
  .idx-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sai-card { grid-template-columns: 20px minmax(0, 1fr) auto; gap: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .tape-track { animation: none; }
  .sai-status.live .dot, .pulse.live { animation: none; }
  .tape { overflow-x: auto; }
}