/* ── Self-hosted fonts (DM Sans + DM Mono) ── */
/* DM Mono 300 */
@font-face {
  font-family: 'DM Mono';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url('/static/fonts/dm-mono-300-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'DM Mono';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url('/static/fonts/dm-mono-300.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* DM Mono 400 */
@font-face {
  font-family: 'DM Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/static/fonts/dm-mono-400-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'DM Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/static/fonts/dm-mono-400.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* DM Mono 500 */
@font-face {
  font-family: 'DM Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/static/fonts/dm-mono-500-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'DM Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/static/fonts/dm-mono-500.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* DM Sans 400 */
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/static/fonts/dm-sans-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/static/fonts/dm-sans-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* DM Sans 500 */
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/static/fonts/dm-sans-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/static/fonts/dm-sans-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* DM Sans 600 */
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/static/fonts/dm-sans-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/static/fonts/dm-sans-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* DM Sans 700 */
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/static/fonts/dm-sans-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/static/fonts/dm-sans-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

  /* ── Stockbit terminal tokens (ported from sj-lowcap desktop.css) ── */
  :root {
    --bg:           #0a0d12;
    --bg-2:         #050810;
    --line:         #1a1f2a;
    --line-strong:  #232938;
    --text:         #e6edf7;
    --text-dim:     #8b98a5;
    --text-faint:   #7c8694;
    --up:           #22c55e;
    --dn:           #ef4444;
    --warn:         #f59e0b;
    --amber:        #FFA500;
    --blue:         #3b82f6;
    --sans: 'DM Sans', -apple-system, system-ui, sans-serif;
    --mono: 'DM Mono', ui-monospace, 'SF Mono', monospace;
  }
  * { box-sizing: border-box; margin: 0; padding: 0; }
  html, body { height: 100%; overflow: hidden; max-width: 100vw; }
  body {
    background: var(--bg); color: var(--text);
    font-family: var(--sans); font-size: 13px;
    -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  }
  button { font-family: inherit; }
  .tnum { font-variant-numeric: tabular-nums; }
  .mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
  .up { color: var(--up); } .dn { color: var(--dn); } .muted { color: var(--text-dim); }
  *::-webkit-scrollbar { width: 8px; height: 8px; }
  *::-webkit-scrollbar-track { background: transparent; }
  *::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 4px; }
  *::-webkit-scrollbar-thumb:hover { background: var(--text-faint); }

  /* ── Shell ── */
  .shell {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr) 340px;
    grid-template-rows: 56px minmax(0, 1fr);
    grid-template-areas: "topbar topbar topbar" "rail main side";
    height: 100dvh; width: 100vw; max-width: 100vw; overflow: hidden;
  }

  /* ── Icon system (inline SVG, single stroke weight) ── */
  .ic { flex: none; vertical-align: middle; }

  /* ── Skip to content (keyboard a11y) ── */
  .skip-link {
    position: fixed; top: 8px; left: 8px; z-index: 200; transform: translateY(-150%);
    background: var(--amber); color: #0a0a0a; padding: 8px 14px; border-radius: 6px;
    font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: 0.06em;
    text-transform: uppercase; text-decoration: none; transition: transform 140ms ease;
  }
  .skip-link:focus { transform: translateY(0); outline: 2px solid #0a0a0a; outline-offset: 2px; }

  /* ── Topbar ── */
  .topbar {
    grid-area: topbar; display: flex; align-items: center; justify-content: space-between;
    padding: 0 20px; border-bottom: 1px solid var(--line); background: var(--bg-2); position: relative;
  }
  .brand { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; letter-spacing: -0.01em; }
  .desk-brand-chip {
    width: 22px; height: 22px; background: var(--amber); color: #0a0a0a;
    display: flex; align-items: center; justify-content: center;
    font-family: var(--mono); font-size: 14px; font-weight: 700; border-radius: 3px;
  }
  .brand-text { display: inline-flex; align-items: baseline; color: var(--text); }
  .brand-text .br { color: var(--amber); font-weight: 600; }
  .brand-sub { font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em; color: var(--text-dim); margin-left: 4px; }
  .topbar-search { flex: 0 1 360px; margin: 0 24px; position: relative; }
  .topbar-search input {
    width: 100%; height: 32px; padding: 0 12px 0 32px; background: var(--bg);
    border: 1px solid var(--line); border-radius: 6px; color: var(--text);
    font-family: var(--mono); font-size: 12px; outline: none; transition: border-color 120ms;
  }
  .topbar-search input:focus { border-color: var(--line-strong); }
  .topbar-search input::placeholder { color: var(--text-faint); }
  .topbar-search .si { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text-dim); display: inline-flex; }
  .topbar-search .si svg { width: 15px; height: 15px; display: block; }
  .topbar-right { display: flex; align-items: center; gap: 16px; }
  .market-pill {
    display: inline-flex; align-items: center; gap: 8px;
    font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; color: var(--text-dim);
  }
  .market-pill .dot-amber { width: 6px; height: 6px; border-radius: 999px; background: var(--amber); }
  .topbar-clock { font-family: var(--mono); font-size: 11px; color: var(--text-faint); letter-spacing: 0.04em; }
  .avatar {
    width: 28px; height: 28px; border-radius: 999px; background: var(--bg);
    border: 1px solid var(--line-strong); display: flex; align-items: center; justify-content: center;
    color: var(--text-dim); font-family: var(--mono); font-size: 11px; font-weight: 500;
  }

  /* ── Rail ── */
  .rail { grid-area: rail; border-right: 1px solid var(--line); background: var(--bg-2); display: flex; flex-direction: column; overflow-y: auto; padding-bottom: 36px; }
  .rail-section { padding: 20px 16px 8px; font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-faint); }
  .nav { display: flex; flex-direction: column; padding: 4px 8px; }
  .nav-item {
    display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 6px;
    color: var(--text-dim); font-size: 13px; font-weight: 500; cursor: pointer; border: none;
    background: transparent; text-align: left; transition: color 120ms, background 120ms; position: relative;
  }
  .nav-item .ni { width: 16px; height: 16px; flex: none; display: inline-flex; align-items: center; justify-content: center; opacity: 0.8; }
  .nav-item .ni svg { width: 16px; height: 16px; }
  .nav-item:hover { color: var(--text); background: rgba(255,165,0,0.04); }
  .nav-item.active { color: var(--text); background: rgba(255,165,0,0.06); }
  .nav-item.active::before { content: ''; position: absolute; left: 0; top: 8px; bottom: 8px; width: 2px; background: var(--amber); border-radius: 0 2px 2px 0; }
  .nav-item .nav-count {
    margin-left: auto; font-family: var(--mono); font-size: 10px; color: var(--amber);
    background: rgba(255,165,0,0.1); padding: 2px 6px; border-radius: 999px; letter-spacing: 0.04em;
  }
  /* quieter: flat (no card border/bg), steady dot (no glowing pulse) */
  .rail-bot { margin: 10px 16px 24px; padding: 0; }   /* 16px inset aligns under "BOT STATUS" */
  .rail-bot-status { display: flex; align-items: center; gap: 9px; margin-bottom: 16px; }
  .dot { width: 6px; height: 6px; border-radius: 999px; background: color-mix(in oklch, var(--up) 78%, var(--text-dim)); }
  .dot.paused { background: var(--amber); }
  .rail-bot-label { font-size: 13px; font-weight: 500; color: var(--text-dim); letter-spacing: -0.005em; }
  .rail-bot-meta { font-family: var(--mono); font-size: 10px; color: var(--text-dim); letter-spacing: 0.06em; margin-bottom: 14px; line-height: 1.6; }
  .btn-rail {
    width: 100%; height: 30px; background: transparent; border: 1px solid var(--line-strong);
    color: var(--text); font-family: var(--mono); font-size: 10px; letter-spacing: 0.10em;
    text-transform: uppercase; cursor: pointer; border-radius: 4px; transition: background 120ms, border-color 120ms, color 120ms;
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  }
  .btn-rail:hover { background: rgba(255,165,0,0.06); border-color: var(--amber); color: var(--amber); }
  .rail-bot-controls { margin-bottom: 8px; }
  .btn-rail.btn-pause:hover { background: rgba(255,165,0,0.06); border-color: var(--amber); color: var(--amber); }
  .btn-rail.btn-resume { border-color: var(--up); color: var(--up); }
  .btn-rail.btn-resume:hover { background: rgba(46,204,113,0.08); border-color: var(--up); color: var(--up); }
  .rail-foot { margin-top: auto; padding: 16px; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
  .rail-foot .av { width: 28px; height: 28px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line-strong); display: flex; align-items: center; justify-content: center; color: var(--text-dim); font-family: var(--mono); font-size: 10px; }
  .rail-foot .meta { font-family: var(--mono); font-size: 10px; color: var(--text-dim); letter-spacing: 0.04em; line-height: 1.5; }
  .rail-foot .meta b { color: var(--text); font-weight: 500; }

  /* ── Main ── */
  .main { grid-area: main; overflow-y: auto; overflow-x: auto; display: flex; flex-direction: column; padding-bottom: 36px; min-width: 0; position: relative; }
  /* keep all real content crisp above the faint watermark */
  .main-header, .stat-strip, .tabs, .panel { position: relative; z-index: 1; }
  .main-header { padding: 24px 28px 0; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
  .head-left { display: flex; align-items: center; min-width: 0; }
  /* Large faint schematic watermark — bleeds off the top-right (Linear/Raycast hero backdrop) */
  /* confined to the header band; fades out above the tabs so it never touches table rows */
  .head-watermark { position: absolute; top: -20px; right: 10px; width: 400px; height: 196px;
    overflow: hidden; pointer-events: none; z-index: 0;
    -webkit-mask-image: linear-gradient(to bottom, #000 56%, transparent);
            mask-image: linear-gradient(to bottom, #000 56%, transparent); }
  .head-watermark svg.iso-v { position: absolute; top: -2px; right: -28px; width: 360px; height: auto; opacity: .42; }
  @media (max-width: 1180px){ .head-watermark { display: none; } }  /* hide before it crowds content */
  .h-eyebrow { display: none; }  /* quieter: title alone; topbar already brands */
  .h-title { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; color: var(--text); }
  .btn-refresh {
    display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 14px;
    background: transparent; border: 1px solid var(--line-strong); border-radius: 6px;
    color: var(--text-dim); font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em;
    text-transform: uppercase; cursor: pointer; transition: color 120ms, border-color 120ms;
  }
  .btn-refresh:hover { color: var(--amber); border-color: var(--amber); }

  /* Stat strip */
  .stat-strip { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); margin: 24px 0 4px; border-bottom: 1px solid var(--line); }
  .stat-cell { padding: 18px 18px 20px; min-width: 0; overflow: hidden; }
  .stat-cell .label { font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-faint); margin-bottom: 8px; white-space: nowrap; }
  .stat-cell .value { font-family: var(--mono); font-size: 20px; font-weight: 500; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; color: var(--text); line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .stat-cell .value[title] { cursor: help; }

  /* Tabs (mirror rail nav for quick switching) */
  .tabs { display: flex; gap: 2px; padding: 0 28px; border-bottom: 1px solid var(--line); }
  .tab { padding: 14px 18px 13px; background: transparent; border: none; color: var(--text-dim); font-family: var(--sans); font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; cursor: pointer; position: relative; transition: color 120ms; }
  .tab:hover { color: var(--text); }
  .tab.active { color: var(--text); }
  .tab.active::after { content: ''; position: absolute; bottom: -1px; left: 14px; right: 14px; height: 2px; background: var(--amber); }

  /* Table */
  .table-wrap { padding: 0 0 8px; }
  .table { width: 100%; border-collapse: collapse; table-layout: auto; }
  .table thead th { padding: 10px; text-align: left; font-family: var(--mono); font-size: 10px; font-weight: 500; letter-spacing: 0.10em; text-transform: uppercase; color: var(--text-faint); border-bottom: 1px solid var(--line); white-space: nowrap; }
  .table thead th:first-child { padding-left: 28px; }
  .table thead th:last-child { padding-right: 28px; }
  .table thead th.right { text-align: right; }
  .table tbody tr { transition: background 120ms ease; }
  .table tbody tr:hover { background: var(--bg-2); }
  .table tbody td { padding: 12px 10px; vertical-align: middle; }
  .table tbody tr + tr td { border-top: 1px solid var(--line); }
  .table tbody td:first-child { padding-left: 28px; }
  .table tbody td:last-child { padding-right: 28px; }
  .table .ticker { font-family: var(--sans); font-size: 14px; font-weight: 700; letter-spacing: -0.005em; color: var(--text); white-space: nowrap; }
  /* Ticker → TradingView chart. Inherits the cell's weight/colour; faint chart glyph brightens on hover. */
  .tv-link { color: inherit; text-decoration: none; border-bottom: 1px dashed transparent; transition: color 120ms ease, border-color 120ms ease; white-space: nowrap; }
  .tv-link:hover, .tv-link:focus-visible { color: var(--accent-text, var(--amber)); border-bottom-color: currentColor; outline: none; }
  .tv-ic { width: 11px; height: 11px; margin-left: 4px; vertical-align: -1px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; opacity: .38; transition: opacity 120ms ease; }
  .tv-link:hover .tv-ic, .tv-link:focus-visible .tv-ic { opacity: .95; }
  .table .num { font-family: var(--mono); font-weight: 500; font-size: 12px; font-variant-numeric: tabular-nums; color: var(--text); letter-spacing: -0.01em; white-space: nowrap; }
  .table .num.up { color: var(--up); } .table .num.dn { color: var(--dn); }
  .table .right { text-align: right; }

  .live-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--up); margin-right: 5px; animation: blink 2s infinite; }
  @keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }

  .badge-mode { display: inline-flex; align-items: center; padding: 3px 8px; border-radius: 3px; font-family: var(--mono); font-size: 10px; font-weight: 500; letter-spacing: 0.10em; text-transform: uppercase; }
  .badge-in  { background: color-mix(in oklch, var(--up) 14%, transparent); color: color-mix(in oklch, var(--up) 55%, var(--text)); }
  .badge-out { background: color-mix(in oklch, var(--dn) 14%, transparent); color: color-mix(in oklch, var(--dn) 55%, var(--text)); }

  .empty { padding: 52px 28px 60px; text-align: center; color: var(--text-dim); font-size: 13px;
    background-image: radial-gradient(rgba(120,134,160,0.05) 1px, transparent 1px);
    background-size: 22px 22px; background-position: center; }
  .empty-art { display: flex; justify-content: center; margin-bottom: 14px; }
  .empty-art svg.iso-v { width: 248px; height: auto; overflow: visible; }
  .empty-msg { font-size: 14px; font-weight: 500; color: var(--text); }
  .empty .hint { font-family: var(--mono); font-size: 11px; letter-spacing: 0.04em; color: var(--text-faint); margin-top: 8px; }

  /* Watchlist add form + inline stop editor */
  .wl-form { display: flex; gap: 8px; padding: 16px 28px; flex-wrap: wrap; align-items: center; }
  .wl-form input {
    background: var(--bg-2); border: 1px solid var(--line); border-radius: 6px;
    padding: 0 12px; height: 34px; color: var(--text); font-family: var(--mono); font-size: 12px; outline: none;
  }
  .wl-form input:focus { border-color: var(--line-strong); }
  .wl-form input#wl-ticker { width: 130px; text-transform: uppercase; }
  .btn-add { height: 34px; padding: 0 16px; background: var(--amber); color: #0a0a0a; border: none; border-radius: 6px; font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; cursor: pointer; transition: opacity 120ms; }
  .btn-add:hover { opacity: 0.88; }
  .rm-btn { background: transparent; color: var(--text-dim); border: 1px solid var(--line-strong); border-radius: 4px; padding: 5px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; transition: color 120ms, border-color 120ms; }
  .rm-btn:hover { color: var(--dn); border-color: color-mix(in oklch, var(--dn) 50%, transparent); }
  .stop-edit {
    width: 108px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 5px;
    padding: 5px 8px; color: var(--text); font-family: var(--mono); font-size: 12px; outline: none;
    text-align: right; transition: border-color 120ms;
  }
  .stop-edit:focus { border-color: var(--blue); }
  .stop-empty { border-color: color-mix(in oklch, var(--warn) 55%, transparent); }
  .stop-empty::placeholder { color: var(--warn); }
  /* stop hangus: sudah ada close>entry — cutloss tak berlaku, exit = d+4 */
  .stop-voided { opacity: 0.45; text-decoration: line-through; }
  .stop-edit.dirty { border-color: var(--amber); }
  @keyframes stopSaved { 0% { border-color: var(--up); box-shadow: 0 0 0 2px color-mix(in oklch, var(--up) 35%, transparent); }
    100% { border-color: var(--line); box-shadow: none; } }
  .stop-edit.saved-flash { animation: stopSaved .9s ease-out; }
  /* ── cutloss cell: input + explicit ✓ save button ── */
  .stop-cell { display: inline-flex; align-items: center; gap: 6px; }
  .stop-save {
    width: 26px; height: 26px; flex: none; display: inline-flex; align-items: center; justify-content: center;
    background: transparent; border: 1px solid var(--line); border-radius: 5px; color: var(--text-faint);
    font-size: 13px; cursor: pointer; opacity: 0; transform: scale(.85);
    transition: opacity 120ms, transform 120ms, color 120ms, border-color 120ms; pointer-events: none;
  }
  .stop-save.show { opacity: 1; transform: scale(1); pointer-events: auto; color: var(--up); border-color: color-mix(in oklch, var(--up) 50%, transparent); }
  .stop-save.show:hover { background: color-mix(in oklch, var(--up) 16%, transparent); }
  .stop-save:disabled { cursor: default; }
  /* hide number-input spinner arrows */
  .stop-edit::-webkit-outer-spin-button, .stop-edit::-webkit-inner-spin-button,
  #wl-stop::-webkit-outer-spin-button, #wl-stop::-webkit-inner-spin-button {
    -webkit-appearance: none; margin: 0;
  }
  .stop-edit, #wl-stop { -moz-appearance: textfield; appearance: textfield; }

  /* quieter: no filled box — a calm line under a hairline (Linear-style notice) */
  /* gap:0 + margin on the label so spacing survives the inline display:block
     override some banners use (otherwise "SETUP 03" jams against the text). */
  .wl-banner { margin: 0 28px 16px; padding: 0 0 13px;
    display: flex; align-items: baseline; gap: 0; flex-wrap: wrap;
    background: none; border: none; border-bottom: 1px solid var(--line);
    color: var(--text-dim); font-size: 12.5px; line-height: 1.65; }
  .wl-banner b { color: var(--text); font-weight: 500; }
  .wl-banner-k { flex: none; margin-right: 10px; font-family: var(--mono); font-size: 9px; font-weight: 500;
    letter-spacing: .16em; text-transform: uppercase; color: var(--warn); }
  /* protection-mode banner — same calm hairline language as .wl-banner */
  .regime-banner { margin: 0 28px 16px; padding: 0 0 13px;
    display: flex; align-items: baseline; gap: 0; flex-wrap: wrap;
    border-bottom: 1px solid var(--line);
    color: var(--text-dim); font-size: 12.5px; line-height: 1.65; }
  .regime-banner[hidden] { display: none; }
  .regime-banner b { color: var(--text); font-weight: 500; }
  .regime-banner-k { flex: none; margin-right: 10px; display: inline-flex; align-items: center; gap: 5px;
    font-family: var(--mono); font-size: 9px; font-weight: 500;
    letter-spacing: .16em; text-transform: uppercase; color: var(--warn); }

  .cl-badge { display: inline-flex; align-items: center; gap: 4px; margin-left: 8px; padding: 2px 6px;
    border-radius: 3px; font-size: 10px; font-weight: 600; letter-spacing: .03em;
    background: color-mix(in oklch, var(--dn) 15%, transparent);
    color: color-mix(in oklch, var(--dn) 55%, var(--text));
    border: 1px solid color-mix(in oklch, var(--dn) 40%, transparent);
    vertical-align: middle; }

  .panel { display: none; } .panel.active { display: block; }

  /* ── Right rail ── */
  .side { grid-area: side; border-left: 1px solid var(--line); background: var(--bg-2); overflow-y: auto; display: flex; flex-direction: column; padding-bottom: 36px; }
  .side-section + .side-section { border-top: 1px solid var(--line); }
  .side-head { padding: 20px 22px 10px; display: flex; align-items: center; justify-content: space-between; }
  .side-head .title { font-family: var(--mono); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-dim); display: flex; align-items: center; gap: 8px; }
  .side-empty { padding: 0 22px 22px; color: var(--text-dim); font-size: 13px; font-style: italic; }

  /* Signal card (latest alert) */
  .signal-card { margin: 0 14px 14px; padding: 14px; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; }
  .signal-tkr { display: inline-flex; align-items: center; gap: 7px; }
  .signal-tkr::before { content: ''; width: 5px; height: 5px; flex: none; background: var(--amber); border-radius: 1px; box-shadow: 0 0 7px color-mix(in oklch, var(--amber) 70%, transparent); }
  .signal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
  .signal-tkr { font-size: 16px; font-weight: 700; letter-spacing: 0.02em; }
  .signal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 8px; padding: 10px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-bottom: 10px; }
  .signal-grid .k { font-family: var(--mono); font-size: 9px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-faint); margin-bottom: 3px; }
  .signal-grid .v { font-family: var(--mono); font-size: 13px; font-weight: 500; font-variant-numeric: tabular-nums; color: var(--text); }
  .signal-meta { display: flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 10px; color: var(--text-dim); letter-spacing: 0.04em; }

  /* Equity block */
  .equity-box { padding: 4px 22px 22px; }
  .equity-row { display: flex; align-items: baseline; justify-content: space-between; padding: 9px 0; border-bottom: 1px dashed var(--line); }
  .equity-row:last-child { border-bottom: none; }
  .equity-row .k { font-family: var(--mono); font-size: 10px; letter-spacing: 0.10em; text-transform: uppercase; color: var(--text-faint); }
  .equity-row .v { font-family: var(--mono); font-size: 15px; font-weight: 500; font-variant-numeric: tabular-nums; color: var(--text); }

  /* Activity log */
  .log { padding: 0 18px 18px; }
  .log-row { display: grid; grid-template-columns: 58px 1fr; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); align-items: baseline; }
  .log-row:last-child { border-bottom: none; }
  .log-row .t { font-family: var(--mono); font-size: 10px; color: var(--text-faint); letter-spacing: 0.02em; }
  .log-row .d { font-size: 13px; color: var(--text); display: flex; align-items: center; gap: 8px; }
  .log-tag { font-family: var(--mono); font-size: 9px; font-weight: 500; letter-spacing: 0.10em; text-transform: uppercase; padding: 2px 6px; border-radius: 2px; }
  .log-tag.in  { color: var(--up); border: 1px solid color-mix(in oklch, var(--up) 40%, transparent); }
  .log-tag.out { color: var(--dn); border: 1px solid color-mix(in oklch, var(--dn) 40%, transparent); }
  .log-row .d b { color: var(--text); font-weight: 600; }

  /* Bottom status console */
  .status-console {
    position: fixed; left: 0; right: 0; bottom: 0; display: flex; gap: 22px; align-items: center;
    padding: 6px 18px; font-family: var(--mono); font-size: 11px; color: var(--text-dim);
    background: color-mix(in oklch, var(--bg) 88%, transparent);
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    border-top: 1px solid var(--line); z-index: 90; white-space: nowrap;
  }
  .status-console .seg { display: inline-flex; align-items: center; gap: 6px; }
  .status-console .seg.up { color: var(--up); } .status-console .seg.dn { color: var(--dn); }
  .status-console .cdot { width: 6px; height: 6px; border-radius: 999px; background: var(--up); }
  .status-console .clock { margin-left: auto; color: var(--text-faint); }

  /* Logout link */
  .logout-link { margin-left: 12px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em;
    color: var(--text-dim); text-decoration: none; padding: 5px 9px; border-radius: 4px;
    transition: color 120ms, background 120ms; }
  .logout-link:hover { color: var(--amber); background: rgba(255,165,0,0.06); }
  .logout-link:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }

  /* Role gating */
  body.role-viewer .admin-only { display: none !important; }

  /* Narrow fallback */
  @media (max-width: 1080px) {
    html, body { overflow: auto; }
    .shell { grid-template-columns: 1fr; grid-template-rows: 56px auto auto auto; grid-template-areas: "topbar" "main" "side" "rail"; height: auto; }
    .rail, .side { border: none; border-top: 1px solid var(--line); }
    .stat-strip { grid-template-columns: repeat(3, 1fr); }
    .stat-cell:nth-child(3n) { border-left: 1px solid var(--line); }
    /* comfortable touch targets on touch/narrow viewports */
    .rm-btn, .stop-save, .stop-edit, .btn-add { min-height: 40px; }
    .stop-save { width: 40px; }
  }

  /* ── Progressive loading states ── */
  .loading { display:flex; align-items:center; gap:8px; padding:24px; color:var(--text-dim); font-size:13px; font-family:var(--mono); }
  .spinner { width:12px; height:12px; border:2px solid currentColor; border-right-color:transparent; border-radius:50%; animation:spin .6s linear infinite; flex-shrink:0; }
  .px-loading { opacity:.5; animation:pulseFade 1s ease-in-out infinite; }
  @keyframes spin { to { transform:rotate(360deg); } }
  @keyframes pulseFade { 50% { opacity:.2; } }

/* ── Portfolio History ── */
.ph-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); border-bottom: 1px solid var(--line); }
.ph-chips { display: flex; gap: 6px; padding: 14px 28px 6px; }
.chip { background: transparent; border: 1px solid var(--line-strong); border-radius: 999px; padding: 4px 12px; color: var(--text-dim); font-family: var(--mono); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; cursor: pointer; }
.chip.active { border-color: var(--up); color: var(--text); }
.badge-cp { background: rgba(245,158,11,0.16); color: #fbbf24; }
.ph-curve { padding: 18px 28px 6px; }
.eq-curve { width: 100%; height: 160px; display: block; }
.eq-line { fill: none; stroke: var(--up); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.eq-dash { fill: none; stroke: var(--text-dim); stroke-width: 1.5; stroke-dasharray: 4 3; vector-effect: non-scaling-stroke; }
.eq-dot { fill: var(--up); }
.ph-caption { font-family: var(--mono); font-size: 10px; color: var(--text-faint); letter-spacing: 0.04em; margin-top: 6px; }
.ph-section { padding: 16px 28px 18px; border-bottom: 1px solid var(--line); }
.ph-section-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.ph-section-k { font-family: var(--mono); font-size: 9px; font-weight: 500;
  letter-spacing: .16em; text-transform: uppercase; color: var(--warn); }
.ph-section-sub { font-size: 12.5px; color: var(--text-dim); }
.ph-section-sub b { color: var(--text); font-weight: 500; }
.size-list { display: flex; flex-direction: column; gap: 6px; }
.size-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.size-row .size-tkr { font-family: var(--mono); font-weight: 500; color: var(--text); min-width: 56px; }
.size-row .size-meta { font-family: var(--mono); font-size: 11px; color: var(--text-dim); min-width: 150px; }
.size-row input { width: 110px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 5px; padding: 5px 8px; color: var(--text); font-family: var(--mono); font-size: 12px; outline: none; }
.size-row input:focus { border-color: var(--line-strong); }
.size-save { height: 30px; padding: 0 12px; background: transparent; border: 1px solid var(--line-strong); border-radius: 4px; color: var(--text-dim); font-family: var(--mono); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.size-save:hover { color: var(--text); border-color: var(--up); }

/* Equity override (admin) — moved out of inline styles in app.js */
.equity-override-row { gap: 8px; flex-wrap: wrap; }
.equity-override-input { flex: 1; min-width: 120px; background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 5px; padding: 5px 8px; color: var(--text); font-family: var(--mono); font-size: 12px; outline: none; }
.equity-override-input:focus { border-color: var(--line-strong); }
.btn-equity-set { height: 30px; padding: 0 12px; background: transparent; border: 1px solid var(--line-strong);
  border-radius: 4px; color: var(--text-dim); font-family: var(--mono); font-size: 10px; letter-spacing: 0.08em;
  text-transform: uppercase; cursor: pointer; transition: color 120ms, border-color 120ms; }
.btn-equity-set:hover { color: var(--amber); border-color: var(--amber); }

/* ── Shariah verdict badges ── */
.sh-badge { display:inline-flex; align-items:center; gap:4px; font-size:11px;
  font-weight:600; padding:2px 7px; border-radius:5px; white-space:nowrap;
  border:1px solid transparent; }
.sh-badge .ic { flex:0 0 auto; }
.sh-yes { color:#15803d; background:rgba(34,197,94,.12); border-color:rgba(34,197,94,.3); }
.sh-no  { color:#dc2626; background:rgba(239,68,68,.12); border-color:rgba(239,68,68,.3); }
.sh-unk { color:var(--muted, #888); background:rgba(148,163,184,.12); border-color:rgba(148,163,184,.3); }
.sh-chips { margin:8px 0; flex-wrap:wrap; align-items:center; }
.sh-chips .chip-sep { width:1px; align-self:stretch; background:var(--line-strong); margin:0 4px; }
.sh-chips .chip .ic { vertical-align:-1px; margin-left:4px; }
@media (max-width: 720px) {
  /* wrapped chip rows leave the divider dangling — drop it on mobile */
  .sh-chips .chip-sep { display:none; }
}

/* ── Shariah lookup card ── */
.sh-card { margin-top:14px; padding:14px 16px; border:1px solid var(--line,#e5e7eb);
  border-radius:8px; max-width:420px; }
.sh-card-head { display:flex; align-items:center; gap:10px; font-size:18px; }
.sh-card-meta { margin-top:8px; font-size:12px; color:var(--muted,#888); }
.sh-link { display:inline-block; margin-top:10px; font-size:12px; font-weight:600; }

/* ════════ MOBILE-NATIVE (≤720px) — desktop untouched ════════ */
.tabbar { display: none; }
.more-sheet { display: none; }

@media (max-width: 720px) {
  /* Bottom tab bar */
  .tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    background: var(--bg-2); border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .tabbar-item {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
    background: none; border: 0; cursor: pointer; padding: 8px 2px 7px;
    color: var(--text-dim); min-height: 52px; font-family: var(--mono);
  }
  .tabbar-item .tb-ic svg { width: 20px; height: 20px; display: block; }
  .tabbar-item .tb-lb { font-size: 9.5px; letter-spacing: 0.06em; text-transform: uppercase; }
  .tabbar-item.active { color: var(--up); }

  /* More sheet */
  .more-sheet { display: block; position: fixed; inset: 0; z-index: 60; pointer-events: none;
    visibility: hidden; transition: visibility 0s 200ms; }   /* delay hide until close anim ends */
  .more-sheet.open { pointer-events: auto; visibility: visible; transition: visibility 0s; }
  .more-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.5); opacity: 0; transition: opacity 160ms; }
  .more-sheet.open .more-backdrop { opacity: 1; }
  .more-panel {
    position: absolute; left: 0; right: 0; bottom: 0; transform: translateY(100%);
    transition: transform 200ms ease; background: var(--bg-2); border-top: 1px solid var(--line);
    border-radius: 14px 14px 0 0; padding: 8px 18px calc(20px + env(safe-area-inset-bottom));
    display: flex; flex-direction: column; gap: 4px;
  }
  .more-sheet.open .more-panel { transform: translateY(0); }
  .more-grip { width: 36px; height: 4px; border-radius: 2px; background: var(--line-strong); margin: 6px auto 12px; }
  .more-link {
    background: none; border: 0; text-align: left; padding: 13px 4px; cursor: pointer;
    color: var(--text); font-size: 15px; border-bottom: 1px solid var(--line);
  }
  .more-logout { color: var(--dn); text-decoration: none; }
  .more-controls { display: flex; gap: 8px; padding: 12px 0; }
  .more-controls .btn-rail { flex: 1; min-height: 44px; }

  /* Single-column, content-first: main before side; nav handled by tab bar */
  /* Scroll the document normally: base .shell overflow:hidden makes a
     non-scrolling clip ancestor (kills the sticky topbar) and silently
     clips any horizontal overflow (e.g. device font scaling). */
  html { height: auto; overflow-x: hidden; overflow-y: auto;
    -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
  body { height: auto; overflow: visible; }
  .shell {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "topbar" "main" "side";
    grid-template-rows: 52px auto auto;
    height: auto;
    overflow: visible;
  }
  .topbar, .main, .side { min-width: 0; }
  .equity-row { flex-wrap: wrap; }
  .equity-row .v { margin-left: auto; }
  .empty { padding: 32px 20px 40px; }
  .rail { display: none; }
  .tabs { display: none; }            /* top tab row replaced by bottom bar */
  .status-console { display: none; }  /* redundant + collides with tab bar */
  .side { grid-area: side; border-left: 0; border-top: 1px solid var(--line); }

  /* room so fixed tab bar never covers content — only .side needs it
     (it's the last block in the document; clearance on .main was a
     dead zone mid-page) */
  .main { padding-bottom: 20px; }
  .side { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }

  /* Topbar: keep brand + clock + logout/avatar. #whoami's min-content
     (~40px past a 393px phone) forced the whole layout viewport wider —
     everything then laid out at ~435px and clipped at the screen edge. */
  .topbar { position: sticky; top: 0; z-index: 40; padding: 0 14px; }
  .topbar #whoami { display: none; }
  .topbar-right { min-width: 0; gap: 12px; }
  .stat-strip { grid-template-columns: repeat(2, 1fr); }
  .stat-cell:nth-child(3n) { border-left: 0; }
  .stat-cell:nth-child(2n) { border-left: 1px solid var(--line); }

  /* Tables → stacked cards */
  .table-wrap { padding: 0 14px 8px; }
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tbody tr {
    border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px;
    margin-bottom: 10px; background: var(--bg-2);
  }
  .table tbody tr + tr td { border-top: 0; }       /* cancel desktop row borders */
  .table tbody td {
    display: flex; justify-content: space-between; align-items: center; gap: 12px;
    padding: 5px 0; text-align: right; border: 0;
  }
  .table tbody td:first-child, .table tbody td:last-child { padding-left: 0; padding-right: 0; }
  .table tbody td::before {
    content: attr(data-label); text-align: left; color: var(--text-faint);
    font-family: var(--mono); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase;
  }
  .table td.ticker { font-size: 16px; padding-bottom: 8px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
  .table td.ticker::before { content: none; }       /* ticker is the card title, no label */
  .table td[data-label=""]::before { content: none; }
  .table td .stop-cell { flex: 1; justify-content: flex-end; display: inline-flex; }
}

@media (max-width: 480px) {
  .topbar-search { display: none; }
  .market-pill { display: none; }
}

/* ── Setup switcher: 2 setup live paralel (01 Breakout · 02 PredR) ─────────── */
.setup-tabs { display: flex; gap: 8px; padding: 14px 28px 0; }
.setup-tab {
  padding: 7px 14px; background: transparent; border: 1px solid var(--line);
  border-radius: 6px; color: var(--text-dim); font-family: var(--sans);
  font-size: 11px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase;
  cursor: pointer; transition: color 120ms, border-color 120ms;
  display: inline-flex; align-items: center; gap: 7px;
}
.setup-tab:hover { color: var(--text); }
.setup-tab.active { color: var(--text); border-color: var(--amber); }
/* tab sub-nav hanya menampilkan tab milik setup aktif */
body[data-setup="breakout"] .tab[data-setup="predr"] { display: none; }
body[data-setup="predr"] .tab[data-setup="breakout"] { display: none; }
/* stat strip global = summary Setup 1; Setup 2/3 punya KPI sendiri di panel */
body[data-setup="predr"] #stats,
body[data-setup="prebreakout"] #stats { display: none; }

/* more-sheet section headers (mobile secondary nav) */
.more-sec { font-family: var(--mono); font-size: 10px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--text-faint); padding: 12px 4px 4px; }
/* chip mode PredR (LIVE hijau / SHADOW redup) */
.predr-mode-chip { display: inline-block; padding: 1px 6px; border-radius: 4px;
  font-size: 9px; font-weight: 700; letter-spacing: 0.08em;
  background: var(--line); color: var(--text-dim); }
.predr-mode-chip:empty { display: none; }
.predr-mode-chip.live { background: rgba(52, 199, 123, 0.15); color: var(--green, #34c77b); }
@media (max-width: 900px) {
  .setup-tabs { padding: 12px 16px 0; }
}

/* ════════════════════════════════════════════════════════════════════
   DEEP DIVE additions — di atas chassis idx portal (jangan ubah blok atas
   biar gampang di-diff sama sj-idx/satujurus-bot/static/app.css)
   ════════════════════════════════════════════════════════════════════ */

.panel { padding-bottom: 40px; }
.panel .p-body { padding: 20px 28px 0; }
.panel .p-sub { color: var(--text-dim); font-size: 13px; max-width: 68ch; line-height: 1.65; padding: 6px 28px 0; }

/* dua kolom playbook */
.dd-grid { display: grid; grid-template-columns: 360px minmax(0,1fr); gap: 0; align-items: start; }
.dd-col-l { border-right: 1px solid var(--line); padding: 16px 0 0 28px; }
.dd-col-r { padding: 16px 28px 0 24px; min-width: 0; }
@media (max-width: 1180px){ .dd-grid { grid-template-columns: 1fr; } .dd-col-l { border-right: none; padding-right: 28px; } }

/* filter bar */
.dd-filters { display: flex; gap: 8px; flex-wrap: wrap; padding-right: 20px; }
.dd-filters input, .dd-filters select {
  flex: 1; min-width: 96px; height: 32px; padding: 0 10px; background: var(--bg-2);
  border: 1px solid var(--line); border-radius: 6px; color: var(--text);
  font-family: var(--mono); font-size: 11.5px; outline: none; transition: border-color 120ms;
}
.dd-filters input:focus, .dd-filters select:focus { border-color: var(--line-strong); }

/* trade index list */
.dd-tlist { max-height: calc(100dvh - 320px); overflow-y: auto; display: flex; flex-direction: column; margin-top: 12px; padding-right: 20px; }
.dd-trow { display: grid; grid-template-columns: auto minmax(0,1fr) auto; gap: 10px; align-items: center;
  padding: 10px 10px; border: none; border-top: 1px solid var(--line); background: transparent;
  text-align: left; cursor: pointer; transition: background 120ms; }
.dd-trow:first-child { border-top: none; }
.dd-trow:hover { background: rgba(255,165,0,0.04); }
.dd-trow.active { background: rgba(255,165,0,0.07); box-shadow: inset 2px 0 0 var(--amber); }
.dd-trow .tk { font-family: var(--sans); font-size: 13.5px; font-weight: 700; color: var(--text); }
.dd-trow .meta { font-family: var(--mono); font-size: 10px; color: var(--text-faint); letter-spacing: 0.03em; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dd-trow .rg { font-family: var(--mono); font-size: 12px; font-weight: 500; text-align: right; white-space: nowrap; }
.dd-more { margin: 10px 20px 16px 0; }

/* setup badges */
.badge-setup { display: inline-flex; align-items: center; padding: 3px 7px; border-radius: 3px;
  font-family: var(--mono); font-size: 9.5px; font-weight: 500; letter-spacing: 0.08em; }
.bs-BO   { background: rgba(34,197,94,0.12);  color: color-mix(in oklch, var(--up) 70%, var(--text)); }
.bs-FLAG { background: rgba(167,139,250,0.12); color: #b9a5f5; }
.bs-PB   { background: rgba(59,130,246,0.14);  color: #7fb0f7; }
.bs-HI52 { background: rgba(255,165,0,0.12);   color: var(--amber); }
.bs-MM   { background: rgba(0,200,150,0.12);   color: #2fd3a8; }
.badge-mkt { font-family: var(--mono); font-size: 9px; letter-spacing: 0.1em; padding: 1px 5px; border-radius: 3px; }
.bm-IDX { color: var(--amber); background: rgba(255,165,0,0.09); }
.bm-US  { color: #00C896; background: rgba(0,200,150,0.09); }

/* chart card */
.dd-chart-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.dd-chart-head .tk { font-family: var(--mono); font-size: 19px; font-weight: 500; color: var(--text); }
.dd-chart-head .legend { margin-left: auto; font-family: var(--mono); font-size: 10px; color: var(--text-faint); }
.dd-chart-head .legend i { font-style: normal; margin-left: 12px; }
canvas.dd-canvas { width: 100%; display: block; border: 1px solid var(--line); border-radius: 6px; background: var(--bg-2); }
.dd-note { margin-top: 12px; padding: 11px 14px; border-left: 2px solid var(--amber);
  background: rgba(255,165,0,0.04); color: var(--text-dim); font-size: 12.5px; line-height: 1.6; border-radius: 0 6px 6px 0; }
.dd-stats { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); border-bottom: 1px solid var(--line); margin-top: 6px; }
.dd-stats .stat-cell { padding: 14px 14px 16px; }
.dd-tl { margin-top: 4px; }
.dd-tl-item { display: flex; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--text-dim); }
.dd-tl-item:first-child { border-top: none; }
.dd-tl-item .when { flex: none; width: 120px; font-family: var(--mono); font-size: 10px; color: var(--text-faint); letter-spacing: 0.04em; padding-top: 2px; }

/* tanya jurus */
.dd-chat { display: flex; flex-direction: column; height: calc(100dvh - 260px); min-height: 380px; }
.dd-msgs { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; padding: 4px 2px; }
.dd-msg { max-width: 76%; padding: 11px 14px; border-radius: 8px; font-size: 13px; line-height: 1.6; white-space: pre-line; }
.dd-msg.u { align-self: flex-end; background: rgba(255,165,0,0.07); border: 1px solid rgba(255,165,0,0.18); }
.dd-msg.a { align-self: flex-start; background: var(--bg-2); border: 1px solid var(--line); color: var(--text-dim); }
.dd-cite { display: inline-block; font-family: var(--mono); font-size: 9.5px; color: var(--blue);
  border: 1px solid rgba(59,130,246,0.3); border-radius: 3px; padding: 1px 6px; margin: 8px 6px 0 0; white-space: normal; }
.dd-chat-in { display: flex; gap: 8px; margin-top: 12px; }
.dd-chat-in input { flex: 1; height: 36px; padding: 0 12px; background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 6px; color: var(--text); font-family: var(--mono); font-size: 12px; outline: none; }
.dd-chat-in input:focus { border-color: var(--line-strong); }
.dd-preset { display: flex; flex-direction: column; gap: 6px; }
.dd-preset button { text-align: left; background: transparent; border: 1px solid var(--line); border-radius: 6px;
  padding: 9px 11px; color: var(--text-dim); font-size: 12px; cursor: pointer; transition: color 120ms, border-color 120ms; }
.dd-preset button:hover { color: var(--amber); border-color: var(--amber); }

/* simulator */
.dd-sim-ans { display: flex; gap: 10px; margin-top: 14px; }
.dd-sim-ans button { flex: 1; height: 44px; background: transparent; border: 1px solid var(--line-strong);
  border-radius: 6px; color: var(--text); font-family: var(--mono); font-size: 12px; font-weight: 500;
  letter-spacing: 0.08em; text-transform: uppercase; cursor: pointer; transition: all 140ms; }
.dd-sim-ans .y:hover { border-color: var(--up); color: var(--up); background: rgba(34,197,94,0.06); }
.dd-sim-ans .u:hover { border-color: var(--amber); color: var(--amber); background: rgba(255,165,0,0.06); }
.dd-sim-ans .n:hover { border-color: var(--dn); color: var(--dn); background: rgba(239,68,68,0.06); }
.dd-verdict { margin-top: 14px; padding: 14px 16px; border-radius: 6px; border: 1px solid; font-size: 13px; }
.dd-verdict.took { border-color: color-mix(in oklch, var(--up) 40%, transparent); background: rgba(34,197,94,0.05); }
.dd-verdict.pass { border-color: color-mix(in oklch, var(--dn) 40%, transparent); background: rgba(239,68,68,0.05); }
.dd-verdict h3 { font-family: var(--mono); font-size: 12px; letter-spacing: 0.1em; margin-bottom: 6px; }
.dd-verdict p { color: var(--text-dim); line-height: 1.6; }

/* jalur belajar */
.dd-lesson { display: grid; grid-template-columns: 44px minmax(0,1fr) auto; gap: 16px; align-items: start;
  padding: 18px 28px; border-top: 1px solid var(--line); }
.dd-lesson:first-child { border-top: none; }
.dd-lesson .no { font-family: var(--mono); font-size: 16px; color: var(--text-faint); padding-top: 1px; }
.dd-lesson.done .no { color: var(--up); }
.dd-lesson b { font-size: 14px; font-weight: 600; letter-spacing: -0.01em; }
.dd-lesson p { color: var(--text-dim); font-size: 12.5px; line-height: 1.65; margin-top: 5px; max-width: 72ch; }
.dd-lesson .drill { margin-top: 8px; font-family: var(--mono); font-size: 10.5px; color: var(--blue); letter-spacing: 0.02em; }
.dd-lesson .drill::before { content: "DRILL → "; color: var(--text-faint); }

/* journey */
.dd-mile { display: flex; gap: 16px; padding: 15px 28px; border-top: 1px solid var(--line); }
.dd-mile:first-child { border-top: none; }
.dd-mile .yr { flex: none; width: 80px; font-family: var(--mono); font-size: 11px; color: var(--amber); padding-top: 2px; }
.dd-mile b { font-size: 13.5px; font-weight: 600; }
.dd-mile p { color: var(--text-dim); font-size: 12.5px; line-height: 1.65; margin-top: 3px; max-width: 76ch; }

/* progress heatmap */
.dd-heat { display: grid; grid-template-columns: repeat(53, 1fr); gap: 3px; margin: 14px 0 8px; }
.dd-heat i { aspect-ratio: 1; border-radius: 2px; background: var(--bg-2); border: 1px solid var(--line); }
.dd-heat .h1 { background: #3a2f10; } .dd-heat .h2 { background: #7a5a10; }
.dd-heat .h3 { background: #c58a0a; } .dd-heat .h4 { background: var(--amber); }

.dd-hint { margin: 16px 28px 0; padding: 12px 14px; border: 1px dashed var(--line); border-radius: 6px;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.03em; color: var(--text-faint); line-height: 1.8; }
.dd-hint b { color: var(--amber); font-weight: 500; }

.btn-amber { height: 34px; padding: 0 16px; background: var(--amber); color: #0a0a0a; border: none; border-radius: 6px;
  font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase;
  cursor: pointer; transition: opacity 120ms; }
.btn-amber:hover { opacity: 0.88; }

/* ── Login hero (bahasa visual login idx: aurora + spotlight + scanline) ── */
.dd-login { position: fixed; inset: 0; z-index: 100; background: var(--bg); overflow-y: auto;
  display: flex; align-items: center; justify-content: center; padding: 32px 20px; }
.dd-login[hidden] { display: none; }
.dd-login .fx { position: fixed; inset: 0; pointer-events: none; }
.dd-login .fx-dots { position: absolute; inset: -40px;
  background-image: radial-gradient(rgba(120,134,160,0.07) 1px, transparent 1px); background-size: 26px 26px; }
.dd-login .fx-aurora { position: absolute; inset: -15%; filter: blur(72px); opacity: 0.5;
  background: radial-gradient(36% 40% at 74% 14%, rgba(255,165,0,0.13), transparent 70%),
              radial-gradient(42% 46% at 20% 80%, rgba(0,200,150,0.08), transparent 72%); }
.dd-login .fx-spot { position: absolute; inset: 0; opacity: 0; transition: opacity 0.5s ease;
  background: radial-gradient(420px 420px at var(--mx,50%) var(--my,30%), rgba(255,165,0,0.07), transparent 62%); }
.dd-login-inner { position: relative; display: grid; grid-template-columns: minmax(0,560px) 400px; gap: 56px; align-items: center; max-width: 1060px; }
@media (max-width: 980px){ .dd-login-inner { grid-template-columns: 1fr; gap: 32px; max-width: 480px; } }
.dd-hero .brand-row { display: flex; align-items: center; gap: 10px; margin-bottom: 34px; }
.dd-hero .eyebrow { display: inline-flex; align-items: center; gap: 9px; font-family: var(--mono); font-size: 10.5px;
  letter-spacing: 0.2em; text-transform: uppercase; color: var(--amber); margin-bottom: 20px; }
.dd-hero .eyebrow::before { content: ""; width: 26px; height: 1px; background: var(--amber); }
.dd-hero h1 { font-size: clamp(30px, 4.6vw, 46px); font-weight: 700; letter-spacing: -0.025em; line-height: 1.08; margin-bottom: 18px; }
.dd-hero h1 .accent { color: var(--amber); }
.dd-hero .lede { color: var(--text-dim); font-size: 14.5px; line-height: 1.75; max-width: 54ch; margin-bottom: 26px; }
.dd-callouts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 24px; }
.dd-callout { display: flex; gap: 10px; align-items: flex-start; }
.dd-callout .cd { width: 7px; height: 7px; border-radius: 2px; background: var(--amber); margin-top: 5px; flex: none; }
.dd-callout b { display: block; font-size: 12.5px; font-weight: 600; }
.dd-callout span { color: var(--text-faint); font-size: 11.5px; line-height: 1.5; }
.dd-hero-fig { margin-top: 30px; padding-top: 16px; border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; gap: 8px 22px; font-family: var(--mono); font-size: 10px;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-faint); }

.dd-term { position: relative; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-2);
  overflow: hidden; box-shadow: 0 40px 90px -40px rgba(0,0,0,0.85); }
.dd-term-bar { display: flex; align-items: center; gap: 7px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.dd-term-bar i { width: 10px; height: 10px; border-radius: 50%; background: #2a323f; }
.dd-term-bar .t { margin-left: 8px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; color: var(--text-faint); }
.dd-term-body { padding: 20px 20px 22px; }
.dd-term-body label { display: block; font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--text-faint); margin: 14px 0 6px; }
.dd-term-body label:first-child { margin-top: 0; }
.dd-term-body input { width: 100%; height: 36px; padding: 0 12px; background: var(--bg); border: 1px solid var(--line);
  border-radius: 6px; color: var(--text); font-family: var(--mono); font-size: 12px; outline: none; transition: border-color 120ms; }
.dd-term-body input:focus { border-color: var(--amber); }
.dd-term-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 18px; }
.btn-ghost-rail { height: 34px; background: transparent; border: 1px solid var(--line-strong); border-radius: 6px;
  color: var(--text-dim); font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  cursor: pointer; transition: color 120ms, border-color 120ms; }
.btn-ghost-rail:hover { color: var(--amber); border-color: var(--amber); }
.dd-term .scan { position: absolute; left: 0; right: 0; top: -36px; height: 36px; pointer-events: none; opacity: 0; z-index: 2;
  background: linear-gradient(180deg, transparent, rgba(255,165,0,0.10), transparent); }
html.js-motion .dd-term .scan { animation: ddScan 3.6s linear 1.4s infinite; }
@keyframes ddScan { 0% { top: -36px; opacity: 0; } 10% { opacity: 1; } 90% { opacity: 1; } 100% { top: 100%; opacity: 0; } }
.dd-readout { margin-top: 12px; font-family: var(--mono); font-size: 10px; letter-spacing: 0.06em;
  color: var(--text-faint); line-height: 1.9; border: 1px dashed var(--line); border-radius: 6px; padding: 11px 13px; }
.dd-readout .ok { color: var(--up); } .dd-readout .am { color: var(--amber); }

/* side rail widgets */
.dd-side-stat { padding: 0 22px 18px; }
.dd-side-stat .big { font-family: var(--mono); font-size: 26px; font-weight: 500; letter-spacing: -0.02em; }
.dd-side-stat .sub { font-family: var(--mono); font-size: 10px; color: var(--text-faint); letter-spacing: 0.08em; text-transform: uppercase; margin-top: 4px; }
.dd-side-list { padding: 0 22px 18px; font-size: 12.5px; color: var(--text-dim); line-height: 1.7; }
.dd-side-list b { color: var(--text); font-weight: 600; }

@media (prefers-reduced-motion: reduce) { .dd-term .scan { animation: none; } }

/* ── Mode tamu: lock + modal upsell ── */
.guest-banner { margin: 0 28px 0; padding: 10px 14px; border: 1px solid rgba(255,165,0,0.3);
  background: rgba(255,165,0,0.05); border-radius: 6px; display: none;
  font-size: 12.5px; color: var(--text-dim); align-items: center; gap: 10px; }
.guest-banner.show { display: flex; }
.guest-banner b { color: var(--amber); font-weight: 600; }
.guest-banner .btn-amber { margin-left: auto; height: 28px; padding: 0 12px; font-size: 10px; flex: none; }
.dd-lock { opacity: 0.55; }
.dd-lock .drill, .dd-lock p { filter: blur(0); }
.lock-tag { font-family: var(--mono); font-size: 9px; letter-spacing: 0.1em; color: var(--amber);
  border: 1px solid rgba(255,165,0,0.35); border-radius: 3px; padding: 1px 6px; margin-left: 8px; }
.upsell { position: fixed; inset: 0; z-index: 300; display: none; align-items: center; justify-content: center; }
.upsell.show { display: flex; }
.upsell .back { position: absolute; inset: 0; background: rgba(5,8,16,0.8); backdrop-filter: blur(3px); }
.upsell .box { position: relative; width: 400px; max-width: calc(100vw - 40px);
  background: var(--bg-2); border: 1px solid var(--line-strong); border-radius: 10px;
  padding: 26px 26px 24px; box-shadow: 0 40px 90px -30px rgba(0,0,0,0.9); }
.upsell .box::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--amber), transparent); border-radius: 10px 10px 0 0; }
.upsell h3 { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; margin-bottom: 8px; }
.upsell p { color: var(--text-dim); font-size: 13px; line-height: 1.65; margin-bottom: 18px; }
.upsell .acts { display: flex; flex-direction: column; gap: 8px; }
.upsell .acts a, .upsell .acts button { text-decoration: none; text-align: center; }
.upsell .close { position: absolute; top: 12px; right: 14px; background: none; border: none;
  color: var(--text-faint); font-size: 16px; cursor: pointer; }
.tg-widget-slot { margin-bottom: 12px; display: flex; justify-content: center; }
.bs-LIVE { background: rgba(255,165,0,0.16); color: var(--amber); border: 1px solid rgba(255,165,0,0.4); }
