:root {
  --ink: #0e1a22;
  --ink-soft: #243640;
  --paper: #e7eef2;
  --paper-2: #d5e2e8;
  --mist: rgba(14, 26, 34, 0.06);
  --line: rgba(14, 26, 34, 0.14);
  --accent: #0f7a6c;
  --accent-deep: #0a5349;
  --up: #0d7a45;
  --up-bg: rgba(13, 122, 69, 0.12);
  --down: #b42318;
  --down-bg: rgba(180, 35, 24, 0.12);
  --flat: #5b6b75;
  --flat-bg: rgba(91, 107, 117, 0.12);
  --display: "Syne", sans-serif;
  --body: "IBM Plex Sans", sans-serif;
  --streak-topbar-h: 3.25rem;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--body);
  background: var(--paper);
  min-height: 100vh;
  min-height: 100dvh;
  position: relative;
  padding-left: var(--safe-left);
  padding-right: var(--safe-right);
}

.atmosphere {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(ellipse 80% 50% at 10% -10%, #9ec9c0 0%, transparent 55%),
    radial-gradient(ellipse 70% 45% at 100% 0%, #7ea0b5 0%, transparent 50%),
    linear-gradient(165deg, #edf4f6 0%, #d9e6ec 42%, #c5d5de 100%);
}

.noise {
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: 0.07;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(10px);
  background: rgba(231, 238, 242, 0.82);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.55rem 1.5rem;
  padding-top: max(0.55rem, env(safe-area-inset-top));
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.topbar-inner .user-chip {
  margin-left: 0;
}

.topbar-brand {
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.03em;
  color: var(--accent-deep);
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 40px;
}

.user-email {
  font-size: 0.82rem;
  color: var(--ink-soft);
  max-width: 42vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chip-btn {
  appearance: none;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.55);
  color: var(--ink);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.45rem 0.75rem;
  min-height: 40px;
  cursor: pointer;
}

.chip-btn:hover {
  border-color: var(--accent);
}

.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background:
    radial-gradient(ellipse 80% 50% at 10% -10%, #9ec9c0 0%, transparent 55%),
    radial-gradient(ellipse 70% 45% at 100% 0%, #7ea0b5 0%, transparent 50%),
    linear-gradient(165deg, #edf4f6 0%, #d9e6ec 42%, #c5d5de 100%);
}

.auth-card {
  width: min(420px, 100%);
  padding: 2rem 1.5rem;
  background: rgba(255, 255, 255, 0.72);
  border-top: 3px solid var(--accent-deep);
}

.auth-brand {
  font-size: clamp(2.4rem, 10vw, 3.4rem) !important;
  margin-bottom: 0.75rem !important;
}

.auth-card h1 {
  margin: 0 0 0.5rem;
  font-family: var(--display);
  font-size: 1.6rem;
  letter-spacing: -0.02em;
}

.auth-lede {
  margin: 0 0 1.25rem;
  color: var(--ink-soft);
  line-height: 1.45;
}

.auth-google {
  width: 100%;
  text-align: center;
  border: 0;
  cursor: pointer;
  font: inherit;
}

.auth-error {
  min-height: 1.25rem;
  margin: 0.85rem 0 0;
  color: var(--down);
  font-size: 0.88rem;
}

#appShell.auth-blocked > :not(.topbar) {
  visibility: hidden;
}

.hero {
  max-width: 1100px;
  margin: 0 auto;
  padding: clamp(2rem, 6vh, 3.75rem) 1.5rem 1.5rem;
  min-height: 42vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  animation: rise 0.7s ease-out both;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 0.25rem;
}

.refresh-bar {
  position: sticky;
  top: var(--streak-topbar-h);
  z-index: 30;
  backdrop-filter: blur(10px);
  background: rgba(213, 226, 232, 0.88);
  border-bottom: 1px solid var(--line);
}

.refresh-bar-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.65rem 1.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem 1rem;
}

.refresh-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.gift-pointer {
  position: relative;
  top: auto;
  z-index: 1;
  background: rgba(255, 255, 255, 0.4);
  border-bottom: 1px solid var(--line);
}

.gift-pointer-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.45rem 1.5rem 0.55rem;
}

.gift-pointer-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.gift-pointer-title {
  margin: 0;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.gift-pointer.is-collapsed .gift-pointer-title-row,
.gift-pointer.is-collapsed .gift-pointer-body {
  display: none;
}

.gift-pointer-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1.1rem;
  margin-top: 0.35rem;
  align-items: flex-end;
}

.gift-stat .label {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.gift-stat .value {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--ink);
}

.gift-gap-value.up,
.gift-stat .value.up {
  color: #0d7a45;
}

.gift-gap-value.down,
.gift-stat .value.down {
  color: #b42318;
}

.gift-gap-value.flat,
.gift-stat .value.flat {
  color: #5b6b75;
}

.gift-sub {
  font-size: 0.72rem;
  color: var(--ink-soft);
}

.gift-gauge {
  margin-top: 0.45rem;
}

.gift-gauge-track {
  position: relative;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, #f3c0bc 0%, #e7eef2 50%, #b7e0c8 100%);
  border: 1px solid var(--line);
}

.gift-gauge-tick {
  position: absolute;
  top: -3px;
  width: 2px;
  height: 16px;
  margin-left: -1px;
  background: #5b6b75;
  opacity: 0.55;
}

.gift-gauge-zero {
  height: 18px;
  top: -4px;
  background: #0e1a22;
  opacity: 0.7;
}

.gift-gauge-marker {
  position: absolute;
  top: -5px;
  width: 10px;
  height: 20px;
  margin-left: -5px;
  border-radius: 2px;
  background: #5b6b75;
  border: 1px solid #0e1a22;
  box-sizing: border-box;
}

.gift-gauge-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 0.2rem;
  font-size: 0.68rem;
  font-variant-numeric: tabular-nums;
  color: var(--ink-soft);
}

.gift-spark {
  display: block;
  width: 100%;
  height: 36px;
  min-height: 36px;
  margin-top: 0.4rem;
  background: rgba(255, 255, 255, 0.35);
}

.gift-spark.is-empty {
  display: none;
}

.gift-blurb,
.gift-meta {
  margin: 0.3rem 0 0;
  font-size: 0.78rem;
  line-height: 1.35;
  color: var(--ink-soft);
}

.gift-meta {
  font-size: 0.72rem;
}

.gift-pointer.is-stale .gift-meta {
  color: #b42318;
}

.gift-pointer-summary {
  margin-top: 0;
}

/* Daily decision strip - 5-second index bias scan */
.decision-strip {
  position: relative;
  top: auto;
  z-index: 2;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(10, 83, 73, 0.12) 0%, rgba(213, 226, 232, 0.88) 100%);
  backdrop-filter: blur(8px);
}

.decision-strip-inner {
  max-width: none;
  margin: 0;
  padding: 0.5rem 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 0.85rem;
}

.decision-strip-primary,
.decision-strip-secondary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.55rem;
}

.decision-strip-secondary {
  margin-left: auto;
}

.decision-pill {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
  padding: 0.35rem 0.65rem;
  min-height: 44px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.decision-pill-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.decision-pill-value {
  font-weight: 700;
  font-size: 0.92rem;
}

.decision-pill-sub {
  font-size: 0.78rem;
  color: var(--ink-soft);
}

.decision-pill.up {
  border-color: rgba(13, 122, 69, 0.35);
  background: rgba(13, 122, 69, 0.12);
}

.decision-pill.down {
  border-color: rgba(180, 35, 24, 0.35);
  background: rgba(180, 35, 24, 0.1);
}

.decision-pill.flat {
  border-color: rgba(91, 107, 117, 0.35);
}

.decision-pill.aligned {
  border-color: rgba(10, 83, 73, 0.45);
  background: rgba(10, 83, 73, 0.14);
}

.decision-pill.mixed {
  border-color: rgba(180, 35, 24, 0.4);
  background: rgba(255, 236, 179, 0.45);
}

.decision-pill.partial {
  border-color: rgba(154, 107, 22, 0.35);
  background: rgba(255, 248, 230, 0.55);
}

.decision-world-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.decision-world-flag {
  display: inline-block;
  padding: 0.28rem 0.5rem;
  min-height: 32px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.55);
}

.decision-world-flag.up {
  color: #0d7a45;
  border-color: rgba(13, 122, 69, 0.3);
}

.decision-world-flag.down {
  color: #b42318;
  border-color: rgba(180, 35, 24, 0.3);
}

.daily-decision-legend {
  margin-bottom: 0.85rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.4);
}

.decision-legend-list {
  margin: 0.35rem 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.78rem;
  line-height: 1.55;
  color: var(--ink-soft);
}

.decision-legend-list li {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0.15rem 0;
}

.daily-evidence-jump {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.85rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.35);
}

.evidence-jump-btn {
  appearance: none;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.55);
  color: var(--ink);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  text-align: left;
  min-height: 44px;
  padding: 0.45rem 0.65rem;
  border-radius: 6px;
  cursor: pointer;
}

.evidence-jump-btn:hover {
  background: rgba(10, 83, 73, 0.08);
  border-color: rgba(10, 83, 73, 0.25);
}

/* Evidence accordions - collapsed by default below boards */
.evidence-panel {
  position: relative;
  top: auto;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.35);
}

.evidence-panel-inner {
  max-width: none;
  margin: 0;
  padding: 0.45rem 1rem 0.55rem;
}

.evidence-panel.is-collapsed .evidence-panel-head,
.evidence-panel.is-collapsed .gift-pointer-body,
.evidence-panel.is-collapsed .macro-tape-body,
.evidence-panel.is-collapsed .index-options-body,
.evidence-panel.is-collapsed .index-options-status,
.evidence-panel.is-collapsed .index-options-lede {
  display: none;
}

.evidence-panel.is-collapsed .gift-pointer-title-row,
.evidence-panel.is-collapsed .macro-tape-title-row,
.evidence-panel.is-collapsed .index-options-title-row {
  display: none;
}

.evidence-summary {
  display: none;
  width: 100%;
  text-align: left;
  margin: 0;
  min-height: 44px;
  padding: 0.55rem 0.65rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
}

.evidence-panel.is-collapsed .evidence-summary {
  display: block;
}

.index-options-panel--daily {
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}

/* Macro tape - evidence on demand */
.macro-tape {
  border-bottom: none;
  background: transparent;
}

.macro-tape-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.45rem 1.5rem 0.55rem;
}

.macro-tape-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.macro-tape-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}

.macro-tape-title {
  margin: 0;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.macro-tape.is-collapsed .macro-tape-title-row,
.macro-tape.is-collapsed .macro-tape-body {
  display: none;
}

.macro-tape-summary {
  margin-top: 0;
}

.macro-status {
  margin: 0.2rem 0 0.35rem;
  font-size: 0.72rem;
  color: var(--ink-soft);
}

.macro-status.is-error {
  color: #b42318;
}

.macro-skips {
  margin-bottom: 0.35rem;
}

.macro-skip-banner {
  margin: 0.15rem 0;
  padding: 0.25rem 0.45rem;
  font-size: 0.72rem;
  line-height: 1.35;
  color: #7a4f00;
  background: rgba(255, 236, 179, 0.55);
  border-radius: 4px;
  border-left: 3px solid #c98a00;
}

.macro-gap-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.85rem;
  margin-bottom: 0.45rem;
  padding: 0.35rem 0.5rem;
  background: rgba(213, 226, 232, 0.45);
  border-radius: 6px;
  border: 1px solid var(--line);
}

.macro-gap-chip-wrap {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.macro-gap-chip-wrap .label {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.macro-heuristic-tag {
  font-size: 0.65rem;
  color: var(--ink-soft);
  font-style: italic;
}

.macro-gap-reason {
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.35;
  color: var(--ink-soft);
  flex: 1 1 200px;
}

.macro-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.55rem 0.85rem;
  margin-bottom: 0.45rem;
}

.macro-section-title {
  margin: 0 0 0.25rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.macro-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}

.macro-table th,
.macro-table td {
  padding: 0.15rem 0.35rem 0.15rem 0;
  text-align: right;
}

.macro-table th[scope="row"] {
  text-align: left;
  font-weight: 600;
}

.macro-table td.up,
.macro-table th.up {
  color: #0d7a45;
}

.macro-table td.down,
.macro-table th.down {
  color: #b42318;
}

.macro-note,
.macro-skip {
  margin: 0.2rem 0 0;
  font-size: 0.68rem;
  line-height: 1.35;
  color: var(--ink-soft);
}

.macro-date {
  font-weight: 600;
}

.macro-prov {
  color: #7a4f00;
}

.macro-vix-stats {
  display: flex;
  align-items: baseline;
  gap: 0.65rem;
}

.macro-vix-last {
  font-size: 1.25rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.macro-vix-chg {
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
  color: var(--ink-soft);
}

.macro-vix-chg.up {
  color: #0d7a45;
}

.macro-vix-chg.down {
  color: #b42318;
}

.macro-world-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.4rem;
}

.macro-world-card {
  padding: 0.35rem 0.45rem;
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid var(--line);
  border-radius: 5px;
  font-size: 0.72rem;
}

.macro-world-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.25rem;
}

.macro-world-label {
  font-weight: 600;
}

.macro-world-session {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.05rem 0.25rem;
  border-radius: 3px;
  background: #e7eef2;
  color: var(--ink-soft);
}

.macro-world-session.live {
  background: #d4edda;
  color: #0d7a45;
}

.macro-world-last {
  font-size: 0.95rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  margin: 0.15rem 0;
}

.macro-world-last.up {
  color: #0d7a45;
}

.macro-world-last.down {
  color: #b42318;
}

.macro-world-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.45rem;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}

.macro-world-tz {
  margin-top: 0.1rem;
  font-size: 0.62rem;
  color: var(--ink-soft);
  opacity: 0.85;
}

.macro-meta {
  margin: 0.35rem 0 0;
  font-size: 0.68rem;
  color: var(--ink-soft);
}

.refresh-btn {
  appearance: none;
  font: inherit;
  font-weight: 600;
  font-size: 0.88rem;
  min-height: 44px;
  padding: 0.55rem 0.95rem;
  cursor: pointer;
  border: 1px solid var(--line);
  transition: background 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}

.refresh-btn:disabled {
  opacity: 0.55;
  cursor: wait;
}

.refresh-btn-light {
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink);
}

.refresh-btn-light:hover:not(:disabled) {
  border-color: var(--accent);
}

.refresh-btn-heavy {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

.refresh-btn-heavy:hover:not(:disabled) {
  background: var(--accent-deep);
  border-color: var(--accent-deep);
}

.refresh-status {
  margin: 0;
  font-size: 0.82rem;
  color: var(--ink-soft);
  max-width: 100%;
}

.refresh-status.is-running {
  color: var(--accent-deep);
  font-weight: 600;
}

.refresh-status.is-success {
  color: var(--up);
}

.refresh-status.is-error {
  color: var(--down);
}

.tz-indicator {
  margin: 0;
  width: 100%;
  font-size: 0.75rem;
  color: var(--ink-soft);
  opacity: 0.9;
}

.options-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
  margin-bottom: 0.85rem;
}

.options-tabs {
  display: flex;
  gap: 0.35rem;
  margin: 0 0 0.55rem;
  flex-wrap: wrap;
}

.options-tab {
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.4rem 0.85rem;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.45);
  color: var(--ink-soft);
  cursor: pointer;
  min-height: 40px;
}

.options-tab.active,
.options-tab[aria-selected="true"] {
  background: rgba(10, 83, 73, 0.12);
  border-color: var(--accent-deep);
  color: var(--ink);
}

.options-expiry-meta {
  margin-top: 0;
  margin-bottom: 0.65rem;
}

.slope-cell {
  font-variant-numeric: tabular-nums;
  font-size: 0.78rem;
  white-space: nowrap;
  letter-spacing: -0.01em;
}

.slope-cell .slope-bit {
  margin: 0 0.05rem;
}

.slope-cell .slope-sep {
  color: var(--ink-soft);
  opacity: 0.55;
  margin: 0 0.08rem;
}

.options-status {
  margin: 0;
  flex: 1 1 12rem;
  font-size: 0.82rem;
  color: var(--ink-soft);
}

.options-status.is-running {
  color: var(--accent-deep);
  font-weight: 600;
}

.options-status.is-success {
  color: var(--up);
}

.options-status.is-error {
  color: var(--down);
}

.options-sr {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: 0.85rem;
}

.sr-callout {
  padding: 0.55rem 0.75rem;
  border-left: 3px solid var(--line);
  background: rgba(255, 255, 255, 0.4);
  font-size: 0.9rem;
  line-height: 1.4;
}

.sr-callout.sr-support {
  border-left-color: var(--up);
}

.sr-callout.sr-resistance {
  border-left-color: var(--down);
}

.sr-callout.sr-neutral {
  border-left-color: var(--flat);
}

.sr-meta {
  color: var(--ink-soft);
  font-size: 0.82rem;
}

#optionsOiTable tr.atm-row td {
  background: rgba(10, 83, 73, 0.08);
}

/* F&O contract picker (post-pass) */
.contract-picker {
  margin-top: 0.35rem;
}

.contract-picker.is-stale .contract-picker-head {
  color: var(--down);
}

.contract-picker-head {
  font-size: 0.92rem;
  margin-bottom: 0.65rem;
}

.contract-direction {
  font-weight: 600;
}

.contract-hedge {
  color: var(--ink-soft);
}

.contract-picker-skip,
.contract-picker-skip-inline {
  color: var(--down);
}

.contract-rec-block {
  margin: 0.5rem 0 0.75rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.35);
}

.contract-rec-block.is-focus {
  border-color: rgba(10, 83, 73, 0.35);
  background: rgba(10, 83, 73, 0.06);
}

.contract-rec-list {
  margin: 0.35rem 0 0;
  padding-left: 1.1rem;
  font-size: 0.88rem;
  line-height: 1.45;
}

.contract-rec-reason {
  color: var(--ink-soft);
  font-size: 0.82rem;
}

.contract-near-table tr.contract-focus-leg td {
  background: rgba(10, 83, 73, 0.06);
}

.contract-picker-subhead {
  margin: 0.85rem 0 0.35rem;
  font-size: 0.95rem;
}

.contract-scoring-hint {
  font-size: 0.82rem;
}

.options-badge,
.futures-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.12rem 0.4rem;
  border-radius: 4px;
  vertical-align: middle;
}

.options-badge {
  color: var(--ink);
  background: rgba(10, 83, 73, 0.12);
}

.futures-badge {
  color: var(--ink);
  background: rgba(30, 64, 120, 0.12);
}

.fno-combined-picker {
  margin-top: 0.35rem;
}

.fno-section {
  margin-top: 0.65rem;
}

.fno-section-options {
  padding-bottom: 0.35rem;
  border-bottom: 1px dashed var(--line);
}

.fno-section-futures {
  margin-top: 0.75rem;
}

.future-picker {
  margin-top: 0.25rem;
}

.futures-head .futures-badge {
  margin-right: 0.15rem;
}

.futures-rec {
  border-color: rgba(30, 64, 120, 0.25);
  background: rgba(30, 64, 120, 0.05);
}

.index-futures-block .futures-near-table .col-hide {
  display: table-cell;
}

.focus-contract-picker {
  margin-top: 0.75rem;
  padding-top: 0.5rem;
  border-top: 1px dashed var(--line);
}

/* Index options (NIFTY / SENSEX) - full Greeks visible */
.index-options-panel {
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--line);
}

.index-options-panel--monthly {
  margin: 0 0 1.25rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.45);
}

.index-options-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem 0.75rem;
  margin-bottom: 0.35rem;
}

.index-options-title-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.45rem 0.55rem;
}

.index-options-panel.is-collapsed .index-options-title-row,
.index-options-panel.is-collapsed .index-options-body,
.index-options-panel.is-collapsed .index-options-status {
  display: none;
}

.index-options-panel.is-collapsed .index-options-summary {
  display: block;
}

.index-options-summary {
  margin-top: 0;
}

.index-options-panel.is-collapsed .focus-checklist-chevron {
  transform: rotate(45deg);
  margin-top: -0.1rem;
}

.index-options-title {
  margin: 0;
  font-size: 1rem;
}

.index-options-ticker {
  font-weight: 500;
  color: var(--ink-soft);
  font-size: 0.88em;
}

.index-options-status {
  font-size: 0.82rem;
  color: var(--ink-soft);
  margin: 0.25rem 0 0.5rem;
}

.index-options-status.is-error {
  color: var(--down);
}

.index-options-direction {
  font-size: 0.88rem;
  margin: 0 0 0.75rem;
}

.index-options-meta {
  font-size: 0.8rem;
  color: var(--ink-soft);
  margin: 0.15rem 0 0.35rem;
}

.index-options-caveat {
  font-size: 0.78rem;
  color: var(--ink-soft);
  margin: 0 0 0.35rem;
}

.index-options-symbol {
  margin-bottom: 1rem;
}

.index-options-symbol-head h4 {
  margin: 0 0 0.15rem;
  font-size: 0.95rem;
}

.index-options-panel .contract-near-table .col-hide {
  display: table-cell;
}

.index-options-foot {
  margin-top: 0.5rem;
}

.index-options-refresh {
  font-size: 0.82rem;
  padding: 0.35rem 0.65rem;
}

.options-table-wrap {
  margin-top: 0.35rem;
}

.search-bar {
  position: sticky;
  top: calc(var(--streak-topbar-h) + var(--streak-refresh-h, 3.55rem) + var(--streak-gift-h, 0px));
  z-index: 28;
  backdrop-filter: blur(10px);
  background: rgba(231, 238, 242, 0.9);
  border-bottom: 1px solid var(--line);
}

.search-bar-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.55rem 1.5rem 0.7rem;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas:
    "label wrap"
    ". status";
  align-items: center;
  gap: 0.35rem 0.75rem;
}

.search-label {
  grid-area: label;
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--ink-soft);
  white-space: nowrap;
}

.search-wrap {
  grid-area: wrap;
  position: relative;
  min-width: 0;
}

.search-wrap input {
  width: 100%;
  min-height: 44px;
  appearance: none;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  padding: 0.55rem 0.85rem;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.75);
  color: var(--ink);
  border-radius: 0;
}

.search-wrap input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}

.search-results {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 2px);
  z-index: 50;
  margin: 0;
  padding: 0.25rem 0;
  list-style: none;
  max-height: min(50vh, 280px);
  overflow: auto;
  background: #f4f8fa;
  border: 1px solid var(--line);
  box-shadow: 0 10px 28px rgba(14, 26, 34, 0.12);
}

.search-results.hidden {
  display: none;
}

.search-results li {
  margin: 0;
}

.search-results button {
  appearance: none;
  width: 100%;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  text-align: left;
  border: 0;
  background: transparent;
  font: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.65rem 0.85rem;
  cursor: pointer;
  color: var(--ink);
  min-height: 44px;
}

.search-results button:hover,
.search-results button.active,
.search-results li[aria-selected="true"] button {
  background: rgba(15, 122, 108, 0.12);
}

.search-results .match-meta {
  font-weight: 500;
  font-size: 0.78rem;
  color: var(--ink-soft);
  white-space: nowrap;
}

.search-status {
  grid-area: status;
  margin: 0;
  font-size: 0.8rem;
  color: var(--ink-soft);
  min-height: 1.1em;
}

.search-bar-inner--with-universe {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.75rem;
}

.search-bar-inner--with-universe .search-label {
  flex: 0 0 auto;
}

.search-bar-inner--with-universe .search-wrap {
  flex: 1 1 14rem;
  min-width: 0;
  grid-area: auto;
}

.search-universe-filter {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.45rem;
  flex: 0 1 auto;
  min-height: 44px;
}

.search-universe-filter .filter-label {
  margin: 0;
  white-space: nowrap;
}

.search-universe-filter select {
  appearance: none;
  min-height: 44px;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.55rem 0.85rem;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.75);
  color: var(--ink);
  border-radius: 0;
}

.search-universe-filter select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}

.search-bar-inner--with-universe .search-status {
  flex: 1 1 100%;
  grid-area: auto;
}

.search-status.is-error {
  color: var(--down);
}

.search-status.is-note {
  color: var(--accent-deep);
}

.signal-stages {
  margin: 0 auto;
  max-width: 72rem;
  padding: 0.85rem 1.25rem;
  border-left: 3px solid var(--accent-deep);
  background: linear-gradient(
    105deg,
    rgba(15, 122, 108, 0.14),
    rgba(255, 255, 255, 0.35) 55%
  );
  color: var(--ink);
  font-family: var(--display);
  font-size: clamp(0.95rem, 2vw, 1.1rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.35;
}

.earlier-signals {
  margin: 0 auto 1.5rem;
  max-width: 72rem;
  padding: 0 1rem 0.5rem;
  scroll-margin-top: 10.5rem;
}

.earlier-signals .section-head {
  margin-bottom: 0.75rem;
}

.coil-open-form {
  margin-bottom: 1.25rem;
}

.coil-params {
  border-color: color-mix(in srgb, #1f6f8b 40%, var(--line));
  background: color-mix(in srgb, #1f6f8b 7%, rgba(255, 255, 255, 0.4));
}

.open-params {
  border-color: color-mix(in srgb, #b7791f 40%, var(--line));
  background: color-mix(in srgb, #b7791f 8%, rgba(255, 255, 255, 0.4));
}

.coil-board,
.open-alerts-board {
  margin-top: 1rem;
  scroll-margin-top: 10.5rem;
}

.open-alert-banner {
  margin: 0 0 0.75rem;
  padding: 0.65rem 0.85rem;
  border-left: 3px solid #b7791f;
  background: rgba(183, 121, 31, 0.12);
  color: var(--ink);
  font-size: 0.88rem;
  line-height: 1.4;
}

.open-alert-banner.hidden {
  display: none;
}

.coil-actions {
  position: relative;
  bottom: auto;
  margin-top: 0.25rem;
}

.focus-funnel {
  line-height: 1.55;
}

.focus-funnel code {
  font-size: 0.85em;
}

.focus-params-panel {
  scroll-margin-top: 10.5rem;
}

.focus-checklist-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
}

.focus-checklist-title-row h2 {
  margin: 0;
}

.focus-checklist-toggle {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.15rem;
  padding: 0.35rem 0.65rem;
  border: 1px solid var(--line, rgba(20, 32, 28, 0.18));
  border-radius: 0.35rem;
  background: rgba(255, 255, 255, 0.55);
  color: var(--accent-deep, #0a5349);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.focus-checklist-toggle:hover,
.focus-checklist-toggle:focus-visible {
  border-color: var(--accent-deep, #0a5349);
  outline: none;
}

.focus-checklist-chevron {
  display: inline-block;
  width: 0.45rem;
  height: 0.45rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-135deg);
  margin-top: 0.15rem;
  transition: transform 0.15s ease;
}

.focus-params-panel.is-checklist-collapsed .focus-checklist-chevron,
.monthly-params-panel.is-checklist-collapsed .focus-checklist-chevron,
.daily-params-panel.is-checklist-collapsed .focus-checklist-chevron,
.gift-pointer.is-collapsed .focus-checklist-chevron {
  transform: rotate(45deg);
  margin-top: -0.1rem;
}

.focus-checklist-summary {
  display: block;
  width: 100%;
  margin: 0.35rem 0 0;
  padding: 0.55rem 0.75rem;
  border: 1px dashed var(--line, rgba(20, 32, 28, 0.22));
  border-radius: 0.35rem;
  background: rgba(255, 255, 255, 0.4);
  color: var(--ink-soft, #3a4a44);
  font: inherit;
  font-size: 0.92rem;
  text-align: left;
  cursor: pointer;
}

.focus-checklist-summary:hover,
.focus-checklist-summary:focus-visible {
  border-color: var(--accent-deep, #0a5349);
  color: var(--accent-deep, #0a5349);
  outline: none;
}

.focus-checklist-summary.hidden {
  display: none;
}

.focus-params-panel.is-checklist-collapsed .focus-checklist-lede,
.monthly-params-panel.is-checklist-collapsed .focus-checklist-lede,
.daily-params-panel.is-checklist-collapsed .focus-checklist-lede {
  display: none;
}

.focus-params-panel.is-checklist-collapsed .focus-checklist-body,
.monthly-params-panel.is-checklist-collapsed .focus-checklist-body,
.daily-params-panel.is-checklist-collapsed .focus-checklist-body {
  display: none;
}

.monthly-focus-params {
  border-color: color-mix(in srgb, #0f7a6c 45%, var(--line));
  background: color-mix(in srgb, #0f7a6c 8%, rgba(255, 255, 255, 0.4));
}

.running-focus-params {
  border-color: color-mix(in srgb, #4a5568 35%, var(--line));
  background: color-mix(in srgb, #4a5568 6%, rgba(255, 255, 255, 0.4));
}

.composite-focus-params {
  border-color: color-mix(in srgb, #9b2c2c 35%, var(--line));
  background: color-mix(in srgb, #9b2c2c 6%, rgba(255, 255, 255, 0.4));
}

.focus-board {
  margin: 0 0 1.25rem;
  max-width: none;
  padding: 0.85rem 0 0;
  scroll-margin-top: 0;
}

.focus-board .board-section-head h2 {
  font-size: clamp(1.15rem, 2.2vw, 1.45rem);
}

.focus-lane-header td {
  padding: 0.55rem 0.65rem 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.35);
}

.focus-lane-header.focus-lane-active td {
  color: #0a5349;
  border-left: 3px solid #0a5349;
}

.focus-lane-header.focus-lane-watch td {
  color: #145368;
  border-left: 3px solid #1f6f8b;
}

.focus-lane-header.focus-lane-manage td {
  color: #7a5410;
  border-left: 3px solid #9a6b16;
}

.focus-lane-count {
  margin-left: 0.45rem;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.06);
  font-variant-numeric: tabular-nums;
}

.focus-board-hint {
  margin: 0.5rem 0 0;
}

.focus-tags {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  color: var(--ink-muted, #3d4a45);
}

.focus-badge {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  border-radius: 0.25rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.focus-badge-watch {
  background: rgba(31, 111, 139, 0.16);
  color: #145368;
}

.focus-badge-active {
  background: rgba(15, 122, 108, 0.16);
  color: #0a5349;
}

.focus-badge-manage {
  background: rgba(154, 107, 22, 0.18);
  color: #7a5410;
}

.focus-monthly-cell {
  font-size: 0.75rem;
  line-height: 1.45;
}

.focus-m-badge {
  display: inline-block;
  margin: 0 0.2rem 0.15rem 0;
  padding: 0.1rem 0.35rem;
  border-radius: 0.2rem;
  background: rgba(0, 0, 0, 0.05);
  color: var(--ink-muted, #3d4a45);
  white-space: nowrap;
}

.focus-m-badge.is-on {
  background: rgba(15, 122, 108, 0.14);
  color: #0a5349;
  font-weight: 600;
}

.focus-m-badge.is-na {
  opacity: 0.7;
}

.focus-playbook {
  font-size: 0.82rem;
  line-height: 1.35;
  color: var(--ink, #14201c);
}

.focus-row {
  cursor: pointer;
}

.focus-row:hover {
  background: rgba(15, 122, 108, 0.06);
}

.focus-detail-row td {
  background: color-mix(in srgb, #0f7a6c 6%, rgba(255, 255, 255, 0.85));
  padding: 0.85rem 1rem;
}

.focus-detail-action {
  margin: 0 0 0.75rem;
}

.focus-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 0.75rem 1rem;
}

.focus-detail-grid h4 {
  margin: 0 0 0.25rem;
  font-size: 0.82rem;
  font-weight: 650;
}

.focus-detail-grid p {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.4;
  color: var(--ink-muted, #3d4a45);
}

.focus-detail-link {
  margin: 0.75rem 0 0;
}

.text-btn {
  background: none;
  border: none;
  padding: 0;
  color: var(--accent-deep, #0a5349);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
}

.focus-secondary {
  margin: 0 auto 2rem;
  max-width: 72rem;
  padding: 0 1rem;
  scroll-margin-top: 10.5rem;
  border: 1px solid var(--line, rgba(20, 32, 28, 0.12));
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.35);
}

.focus-secondary > summary {
  cursor: pointer;
  list-style: none;
  padding: 0.9rem 1rem;
  font-weight: 600;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.focus-secondary > summary::-webkit-details-marker {
  display: none;
}

.focus-secondary > summary .step-label {
  margin: 0;
}

.focus-secondary[open] > summary {
  border-bottom: 1px solid var(--line, rgba(20, 32, 28, 0.1));
}

.focus-secondary-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0.75rem 1rem 0;
}

.focus-secondary-panel {
  padding: 0.5rem 0 1rem;
}

.focus-secondary-panel.hidden {
  display: none;
}

.analysis-banner {
  margin: 0 0 1rem;
  padding: 0.7rem 0.9rem;
  border-left: 3px solid var(--accent-deep);
  background: rgba(15, 122, 108, 0.1);
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.4;
}

.analysis-banner.hidden {
  display: none;
}

.analysis-banner.is-warn {
  border-left-color: #9a6b16;
  background: rgba(154, 107, 22, 0.1);
}

.step-label {
  margin: 0 0 0.2rem;
  width: 100%;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-deep);
}

.section-head {
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
}

.section-head h2 {
  width: 100%;
}

.brand {
  margin: 0 0 1rem;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(3.2rem, 9vw, 6.5rem);
  letter-spacing: -0.04em;
  line-height: 0.9;
  color: var(--accent-deep);
}

.hero h1 {
  margin: 0;
  max-width: 14ch;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(1.6rem, 3.4vw, 2.35rem);
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.lede {
  margin: 1rem 0 0;
  max-width: 42rem;
  font-size: 1.05rem;
  line-height: 1.55;
  color: var(--ink-soft);
}

.cta {
  margin-top: 1.75rem;
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 0.85rem 1.35rem;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: transform 0.2s ease, background 0.2s ease;
}

.cta:hover {
  background: var(--accent-deep);
  transform: translateY(-2px);
}

.cta-secondary {
  margin-top: 0.75rem;
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--ink);
}

.hero-actions .cta,
.hero-actions .cta-secondary {
  margin-top: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.7rem 1.15rem;
}

.cta-secondary:hover {
  background: var(--ink);
  color: var(--paper);
}

.hero-note {
  margin: 1.25rem 0 0;
  max-width: 36rem;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--ink-soft);
}

main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem 4rem;
  display: grid;
  gap: 2.75rem;
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.35rem 1rem;
  margin-bottom: 1rem;
}

h2 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(1.25rem, 3.5vw, 1.55rem);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.meta {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.legend {
  padding: 1.1rem 1.25rem;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.35);
  animation: rise 0.8s ease-out 0.1s both;
}

.legend h2 {
  font-size: 1.05rem;
  margin-bottom: 0.65rem;
}

.legend ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.45rem;
}

.legend li {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
  font-size: 0.92rem;
  color: var(--ink-soft);
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.5rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.chip.up,
.dir.up {
  color: var(--up);
  background: var(--up-bg);
}

.chip.down,
.dir.down {
  color: var(--down);
  background: var(--down-bg);
}

.chip.flat,
.dir.flat {
  color: var(--flat);
  background: var(--flat-bg);
}

.dir {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.12rem 0.45rem;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  white-space: nowrap;
}

.filters,
.params-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem 1rem;
  margin-bottom: 1.15rem;
  padding: 0.9rem 1rem;
  background: rgba(255, 255, 255, 0.4);
  border-top: 2px solid var(--accent);
}

.params-form {
  display: grid;
  gap: 1rem;
  align-items: stretch;
  margin-bottom: 0;
  padding-bottom: 5.5rem; /* clear sticky Apply bar so extras stay scrollable */
}

.params-panel,
.board,
.detail,
.earlier-signals {
  scroll-margin-top: 10.5rem;
}

.param-group {
  margin: 0;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.35);
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
}

.param-group legend {
  font-family: var(--display);
  font-size: 0.95rem;
  padding: 0 0.35rem;
}

.param-group.checks {
  display: grid;
  gap: 0.45rem;
}

.param-group.confluence-extras {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
  background: color-mix(in srgb, var(--accent) 6%, rgba(255, 255, 255, 0.4));
}

.param-group-lede,
.param-help {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.4;
  color: var(--ink-soft);
  grid-column: 1 / -1;
}

.param-help code {
  font-size: 0.74rem;
  padding: 0.05rem 0.3rem;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.55);
}

.check-row {
  display: grid;
  grid-template-columns: auto minmax(10rem, 1.4fr) 5.5rem auto;
  gap: 0.55rem;
  align-items: center;
  font-size: 0.88rem;
  min-height: 44px;
}

.check-row.check-row-hint {
  grid-template-columns: auto minmax(10rem, 1.2fr) minmax(8rem, 1.6fr);
}

.check-row.check-row-hint .check-hint {
  grid-column: 3;
  margin-left: 0;
}

.check-row input[type="checkbox"] {
  width: 1.15rem;
  height: 1.15rem;
}

.check-row input[type="number"],
.check-row select {
  appearance: none;
  width: 100%;
  min-height: 40px;
  padding: 0.45rem 0.5rem;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.75);
  font-family: var(--body);
  font-size: 0.88rem;
  font-variant-numeric: tabular-nums;
}

.check-name {
  color: var(--ink-soft);
}

.check-row .unit {
  font-size: 0.75rem;
  color: var(--ink-soft);
}

.filter-field {
  display: grid;
  gap: 0.35rem;
  min-width: 9rem;
}

.filter-field.wide {
  min-width: 16rem;
  flex: 1;
}

.param-group.trading-window .filter-field select {
  appearance: none;
  min-height: 40px;
  padding: 0.45rem 0.5rem;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.75);
  font-family: var(--body);
  font-size: 0.88rem;
}

.window-hint {
  flex: 1 1 100%;
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.35;
  color: var(--ink-soft);
}

.filter-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-soft);
  font-weight: 600;
}

.filters input,
.params-form .filter-field input {
  appearance: none;
  width: 7.5rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink);
  font-family: var(--body);
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
}

.filters input:focus,
.params-form input:focus,
.params-form select:focus {
  outline: 2px solid rgba(15, 122, 108, 0.35);
  border-color: var(--accent);
}

.params-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: center;
}

.sticky-actions {
  position: sticky;
  bottom: 0;
  z-index: 20;
  margin: 0 -0.15rem;
  padding: 0.75rem 0.15rem;
  padding-bottom: max(0.75rem, env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(231, 238, 242, 0) 0%, rgba(231, 238, 242, 0.94) 28%, rgba(231, 238, 242, 0.98) 100%);
}

.filter-apply,
.filter-reset {
  appearance: none;
  border: none;
  font-family: var(--body);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.7rem 1.15rem;
  min-height: 44px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}

.filter-apply {
  background: var(--ink);
  color: var(--paper);
}

.filter-apply:hover {
  background: var(--accent-deep);
  transform: translateY(-1px);
}

.filter-reset {
  background: transparent;
  color: var(--ink-soft);
  border: 1px solid var(--line);
}

.filter-reset:hover {
  border-color: var(--accent);
  color: var(--ink);
}

.filter-hint {
  margin: 0;
  flex: 1 1 14rem;
  font-size: 0.82rem;
  color: var(--ink-soft);
  line-height: 1.4;
  align-self: center;
}

.params-save-hint {
  margin: 0;
  flex: 1 1 100%;
  font-size: 0.78rem;
  color: var(--ink-soft);
  line-height: 1.35;
  opacity: 0.85;
  min-height: 1.1em;
}

.params-save-hint:empty {
  display: none;
}

.tape-mode {
  margin: -0.35rem 0 0.85rem;
}

.score {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

#checklistTable tr.pass {
  background: rgba(13, 122, 69, 0.06);
}

#checklistTable tr.fail {
  background: rgba(180, 35, 24, 0.06);
}

#checklistTable tr.na {
  opacity: 0.75;
}

.price-cell {
  line-height: 1.25;
}

.price {
  display: block;
  font-weight: 600;
}

.price-src {
  display: block;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
}

.roll-cell {
  min-width: 16rem;
}

.roll {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin: 0.12rem 0.35rem 0.12rem 0;
  font-size: 0.78rem;
  color: var(--ink-soft);
  white-space: nowrap;
}

.rolling-row {
  margin-top: -0.5rem;
}

.analysis {
  padding: 1.25rem 0 0.5rem;
  border-top: 1px solid var(--line);
}

.analysis-disclaimer {
  margin: 0 0 1.25rem;
  padding: 0.7rem 0.9rem;
  background: rgba(255, 255, 255, 0.45);
  border-left: 3px solid var(--accent);
  color: var(--ink-soft);
  font-size: 0.88rem;
  line-height: 1.45;
}

.analysis-block {
  margin-bottom: 2rem;
  padding-bottom: 0.5rem;
}

.analysis-block h3 {
  margin: 0 0 0.35rem;
  font-family: var(--display);
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.block-note {
  margin: 0 0 0.85rem;
  color: var(--ink-soft);
  font-size: 0.85rem;
}

.symbol-select {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.symbol-btn {
  appearance: none;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.55);
  color: var(--ink);
  font-family: var(--body);
  font-weight: 600;
  font-size: 0.88rem;
  padding: 0.55rem 0.8rem;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.symbol-btn:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.symbol-btn.active {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

.symbol-btn.near-miss {
  opacity: 0.82;
  border-style: dashed;
}

.symbol-btn.near-miss.active {
  opacity: 1;
}

tr.near-miss td {
  opacity: 0.88;
}

.near-tag {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.1rem 0.35rem;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--flat);
  background: var(--flat-bg);
}

.day-date-cell {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
  max-width: 14rem;
}

.day-anchor-tag {
  display: inline-block;
  padding: 0.08rem 0.32rem;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--ink);
  background: rgba(15, 122, 108, 0.12);
  border: 1px solid rgba(15, 122, 108, 0.28);
}

.day-anchor-tag.t7 {
  color: var(--ink-soft);
  background: rgba(91, 107, 117, 0.12);
  border-color: rgba(91, 107, 117, 0.3);
}

.day-anchor-tag.context,
.day-anchor-tag.outside {
  color: var(--ink-soft);
  background: rgba(14, 26, 34, 0.06);
  border-color: rgba(14, 26, 34, 0.14);
  text-transform: none;
  letter-spacing: 0.02em;
  font-weight: 500;
}

#dayTable tbody tr.context-day td {
  opacity: 0.88;
}

#dayTable tbody tr.anchor-today td:first-child,
#dayTable tbody tr.anchor-t7 td:first-child {
  font-weight: 600;
}

/* Compact day-date sizing lives under html.layout-phone. */

.streak-cell {
  min-width: 11rem;
  vertical-align: top;
}

.streak-summary {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.streak-head,
.streak-one {
  font-size: 0.88rem;
  color: var(--ink);
}

.streak-nest {
  margin: 0;
  padding: 0 0 0 0.9rem;
  list-style: disc;
  color: var(--ink-soft);
  font-size: 0.78rem;
  line-height: 1.35;
}

.streak-nest li.latest {
  color: var(--ink);
  font-weight: 600;
}

.streak-history {
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.streak-history li {
  padding: 0.45rem 0.65rem;
  border-left: 3px solid var(--line);
  background: rgba(255, 255, 255, 0.35);
  font-size: 0.88rem;
  color: var(--ink-soft);
}

.streak-history li.latest {
  border-left-color: var(--accent);
  color: var(--ink);
  font-weight: 500;
}

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}

th,
td {
  padding: 0.7rem 0.65rem;
  text-align: left;
  border-bottom: 1px solid var(--mist);
}

th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  font-weight: 600;
}

td.num,
th.num {
  text-align: right;
}

tbody tr {
  cursor: pointer;
  transition: background 0.12s ease;
}

tbody tr:hover,
tbody tr.active {
  background: rgba(15, 122, 108, 0.08);
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.stat {
  padding: 0.85rem 0.9rem;
  border-top: 2px solid var(--accent);
  background: rgba(255, 255, 255, 0.4);
}

.stat .v {
  font-family: var(--display);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.stat .l {
  margin-top: 0.2rem;
  font-size: 0.78rem;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.live-strip {
  margin-bottom: 1.25rem;
  padding: 0.9rem 1rem;
  background: rgba(255, 255, 255, 0.45);
  border-left: 3px solid var(--accent);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}

.live-strip .label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-soft);
}

.live-strip .value {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.1rem;
}

.charts {
  display: grid;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}

figure {
  margin: 0;
  padding: 0.75rem 0.5rem 0.25rem;
  background: rgba(255, 255, 255, 0.35);
  border-top: 1px solid var(--line);
}

figcaption {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-soft);
  margin: 0 0.4rem 0.5rem;
}

canvas {
  width: 100%;
  height: auto;
  display: block;
}

.hidden {
  display: none !important;
}

footer {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem 3rem;
  color: var(--ink-soft);
  font-size: 0.82rem;
  line-height: 1.5;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Compact rules: html.layout-phone at end of file (forced Phone or Auto-narrow). */

/* -- View tabs (Daily / Monthly) -- */
.view-tabs {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: 0.75rem;
  margin-right: auto;
}

.view-tab {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-soft);
  font: inherit;
  font-weight: 600;
  font-size: 0.88rem;
  padding: 0.4rem 0.75rem;
  min-height: 36px;
  cursor: pointer;
  border-radius: 0;
}

.layout-switch {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-left: auto;
}

.layout-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0.15rem 0.45rem;
  border: 1px solid var(--line);
  background: rgba(10, 83, 73, 0.08);
  color: var(--accent-deep);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.layout-prefs {
  display: inline-flex;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.55);
}

.layout-pref-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  min-height: 36px;
  padding: 0.3rem 0.65rem;
  cursor: pointer;
}

.layout-pref-btn + .layout-pref-btn {
  border-left: 1px solid var(--line);
}

.layout-pref-btn.is-active {
  background: rgba(10, 83, 73, 0.12);
  color: var(--accent-deep);
}

.topbar-inner .user-chip {
  margin-left: 0;
}

.view-tab:hover {
  color: var(--ink);
  border-color: var(--line);
}

.view-tab.is-active {
  color: var(--accent-deep);
  border-bottom: 2px solid var(--accent-deep);
  background: rgba(255, 255, 255, 0.35);
}

.fno-badge {
  display: inline-block;
  margin-left: 0.35rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent-deep);
  border: 1px solid rgba(10, 83, 73, 0.35);
  padding: 0.1rem 0.35rem;
  vertical-align: middle;
}

.fno-badge.fno-off {
  color: var(--flat);
  border-color: rgba(91, 107, 117, 0.35);
  font-weight: 600;
}

.submeta {
  font-size: 0.72rem;
  color: var(--ink-soft);
  margin-top: 0.15rem;
}

.spark-cell {
  white-space: nowrap;
  vertical-align: middle;
}

.spark {
  display: inline-block;
  vertical-align: middle;
  margin-right: 0.35rem;
}

.slope-strip {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  font-variant-numeric: tabular-nums;
  font-size: 0.72rem;
  font-weight: 600;
}

.slope-chip.up {
  color: var(--up);
}

.slope-chip.down {
  color: var(--down);
}

.slope-chip.flat {
  color: var(--flat);
}

.slope-sep {
  color: var(--flat);
  font-weight: 400;
}

.monthly-charts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.monthly-charts figure {
  margin: 0;
  min-width: 0;
}

.monthly-charts canvas {
  width: 100%;
  max-width: 100%;
  height: 160px;
  min-height: 160px;
  display: block;
  background: rgba(255, 255, 255, 0.35);
}

.chart-range {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 0.55rem;
  margin: 0.35rem 0 0;
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
  color: var(--ink-soft);
  letter-spacing: 0.01em;
}

.chart-range .is-current {
  font-weight: 650;
  color: var(--ink);
}

.ref-charts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.ref-card {
  min-width: 0;
  padding: 0.7rem 0.75rem 0.65rem;
  background: rgba(255, 255, 255, 0.4);
  border: 1px solid var(--line);
}

.ref-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.45rem;
}

.ref-card-title {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.ref-card-range {
  margin: 0 0 0.5rem;
}

.ref-card-head .spark {
  flex: 0 0 auto;
  margin-right: 0;
}

.ref-scale {
  display: grid;
  grid-template-columns: 2.1rem minmax(0, 1fr) 2.5rem;
  gap: 0.4rem;
  align-items: center;
  margin-bottom: 0.35rem;
  font-size: 0.62rem;
  color: var(--ink-soft);
}

.ref-scale-bar {
  display: flex;
  justify-content: space-between;
  font-variant-numeric: tabular-nums;
}

.ref-scale-s {
  text-align: center;
}

.ref-wins {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.ref-win-vis {
  display: grid;
  grid-template-columns: 2.1rem minmax(0, 1fr) 2.5rem;
  gap: 0.4rem;
  align-items: center;
}

.ref-win-n {
  font-size: 0.72rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  color: var(--ink-soft);
}

.ref-ratio-bar {
  position: relative;
  display: block;
  height: 10px;
  background: rgba(14, 26, 34, 0.08);
  border-radius: 1px;
}

.ref-ratio-mid {
  position: absolute;
  left: 50%;
  top: -2px;
  bottom: -2px;
  width: 1px;
  background: var(--ink);
  opacity: 0.38;
}

.ref-ratio-fill {
  position: absolute;
  top: 0;
  height: 100%;
  opacity: 0.78;
}

.ref-ratio-dot {
  position: absolute;
  top: 50%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.ref-ratio-fill.up,
.ref-ratio-dot.up {
  background: var(--up);
}

.ref-ratio-fill.down,
.ref-ratio-dot.down {
  background: var(--down);
}

.ref-ratio-fill.flat,
.ref-ratio-dot.flat {
  background: var(--flat);
}

.ref-slope-glyph {
  display: block;
  justify-self: center;
}

.ref-slope-base {
  stroke: var(--ink);
  stroke-opacity: 0.22;
  stroke-width: 1;
  stroke-dasharray: 2 2;
}

.ref-slope-glyph .ref-slope-line {
  stroke-width: 1.75;
  stroke-linecap: round;
}

.ref-slope-glyph.up .ref-slope-line {
  stroke: var(--up);
}

.ref-slope-glyph.down .ref-slope-line {
  stroke: var(--down);
}

.ref-slope-glyph.flat .ref-slope-line {
  stroke: var(--flat);
}

.ref-win-cap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 0.55rem;
  margin: 0.12rem 0 0 2.5rem;
  font-size: 0.68rem;
  font-variant-numeric: tabular-nums;
  color: var(--ink-soft);
}

.ref-win-cap .up {
  color: var(--up);
  font-weight: 650;
}

.ref-win-cap .down {
  color: var(--down);
  font-weight: 650;
}

.ref-win-cap .flat {
  color: var(--flat);
}

.empty-row {
  text-align: center;
  color: var(--ink-soft);
  padding: 1.25rem 0.75rem !important;
}

#mBoardTable tr.board-row {
  cursor: pointer;
}

#mBoardTable tr.board-row.is-active {
  background: rgba(15, 122, 108, 0.1);
}

.candle-cell {
  white-space: nowrap;
  font-size: 0.72rem;
}

.candle-chip,
.bias-toggle {
  display: inline-flex;
  margin: 0.65rem 0 0.85rem;
  border: 1px solid rgba(14, 26, 34, 0.22);
  background: rgba(255, 255, 255, 0.55);
  overflow: hidden;
}

.bias-toggle-btn {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0.42rem 1.05rem;
  font: inherit;
  font-weight: 650;
  letter-spacing: 0.02em;
  color: var(--ink-soft);
  cursor: pointer;
}

.bias-toggle-btn + .bias-toggle-btn {
  border-left: 1px solid rgba(14, 26, 34, 0.18);
}

.bias-toggle-btn.is-active {
  background: rgba(10, 83, 73, 0.12);
  color: var(--ink);
}

.bias-toggle[data-bias="bearish"] .bias-toggle-btn.is-active {
  background: rgba(176, 54, 54, 0.12);
  color: var(--down);
}

.bias-chip {
  display: inline-block;
  margin: 0.05rem 0.1rem 0.05rem 0;
  padding: 0.08rem 0.28rem;
  border: 1px solid rgba(14, 26, 34, 0.18);
  font-weight: 600;
  letter-spacing: 0.01em;
  vertical-align: middle;
}

.candle-chip.up,
.bias-chip.up {
  color: var(--up);
  border-color: rgba(15, 122, 108, 0.35);
}

.candle-chip.down,
.bias-chip.down {
  color: var(--down);
  border-color: rgba(176, 54, 54, 0.35);
}

.candle-chip.flat,
.bias-chip.flat {
  color: var(--flat);
}

.sector-chip,
.meta-badge {
  display: inline-block;
  margin: 0.05rem 0.12rem 0.05rem 0;
  padding: 0.08rem 0.3rem;
  border: 1px solid rgba(14, 26, 34, 0.18);
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.01em;
  vertical-align: middle;
  white-space: nowrap;
}

.sector-chip.up,
.meta-badge.up {
  color: var(--up);
  border-color: rgba(15, 122, 108, 0.35);
}

.sector-chip.down,
.meta-badge.down {
  color: var(--down);
  border-color: rgba(176, 54, 54, 0.35);
}

.sector-chip.flat,
.meta-badge.flat {
  color: var(--flat);
}

.sector-cell,
.badge-cell {
  font-size: 0.72rem;
  max-width: 9.5rem;
}

.check-row-na {
  opacity: 0.72;
}

.check-row-na input[disabled] {
  cursor: not-allowed;
}

tr.check-na td {
  color: var(--ink-soft);
}

.check-hint {
  font-size: 0.72rem;
  color: var(--ink-soft);
  margin-left: 0.25rem;
}

.inv-col.hidden {
  display: none;
}

td.inv-cell {
  font-variant-numeric: tabular-nums;
  font-size: 0.8rem;
}

.confluence-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr));
  gap: 0.65rem 0.85rem;
  margin-bottom: 0.75rem;
}

.confluence-stat {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.confluence-stat .k {
  font-size: 0.72rem;
  color: var(--ink-soft);
  letter-spacing: 0.02em;
}

.confluence-stat .v {
  font-variant-numeric: tabular-nums;
  font-weight: 650;
}

.confluence-stat .v.up {
  color: var(--up);
}

.confluence-stat .v.down {
  color: var(--down);
}

.confluence-stat .v.flat {
  color: var(--flat);
}

/* Monthly compact charts: html.layout-phone. */
html.layout-phone #mDetail,
html.layout-phone .analysis-block {
  min-width: 0;
  max-width: 100%;
  overflow: visible;
}

html.layout-phone .monthly-charts,
html.layout-phone .ref-charts {
  width: 100%;
  max-width: 100%;
  overflow: visible;
}

html.layout-phone .monthly-charts figure {
  overflow: visible;
  max-width: 100%;
}

html.layout-phone .monthly-charts canvas {
  width: 100% !important;
  max-width: 100%;
  height: 140px !important;
  min-height: 140px;
}

html.layout-phone .ref-card {
  padding: 0.6rem 0.65rem 0.55rem;
  overflow: visible;
}

html.layout-phone .ref-card-head {
  flex-wrap: wrap;
  align-items: center;
}

html.layout-phone .ref-card-head .spark {
  width: 100%;
  height: 40px;
  flex: 1 1 100%;
  margin: 0.15rem 0 0;
}

html.layout-phone .spark {
  overflow: visible;
}

html.layout-phone .ref-ratio-bar {
  min-height: 10px;
}

html.layout-phone .chart-range,
html.layout-phone .ref-card-range {
  font-size: 0.68rem;
  gap: 0.1rem 0.45rem;
}

html.layout-phone .ref-win-cap {
  margin-left: 0;
}

/* -- Ops / Runs -- */
.hero-ops {
  padding-bottom: 1.25rem;
}

.ops-bar {
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.28);
}

.ops-bar-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
}

.ops-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.ops-tool-btn {
  appearance: none;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.55);
  color: var(--ink);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.35rem 0.55rem;
  cursor: pointer;
  min-height: 34px;
}

.ops-tool-btn:hover:not(:disabled) {
  border-color: var(--accent-deep);
  color: var(--accent-deep);
}

.ops-tool-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.ops-toolbar-sep {
  width: 1px;
  height: 1.4rem;
  background: var(--line);
  margin: 0 0.15rem;
}

.ops-selected-count {
  font-size: 0.75rem;
  color: var(--ink-soft);
  margin-left: 0.25rem;
}

.ops-meta {
  margin: 0;
  font-size: 0.85rem;
  color: var(--ink-soft);
  flex: 1 1 16rem;
}

.ops-meta.is-error {
  color: var(--down);
}

.ops-meta.is-ok {
  color: var(--up);
}

.ops-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.25rem 1.5rem 3rem;
}

.ops-table-wrap {
  overflow-x: auto;
}

.ops-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.ops-table th,
.ops-table td {
  text-align: left;
  vertical-align: top;
  padding: 0.75rem 0.65rem;
  border-bottom: 1px solid var(--line);
}

.ops-table th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  font-weight: 600;
}

.ops-check-col,
.ops-check-cell {
  width: 2rem;
  text-align: center;
  vertical-align: middle;
}

.ops-job-name {
  font-weight: 600;
  color: var(--ink);
}

.ops-job-desc {
  margin: 0.25rem 0 0;
  font-size: 0.78rem;
  color: var(--ink-soft);
  line-height: 1.35;
  max-width: 22rem;
}

.ops-schedule {
  font-size: 0.8rem;
  color: var(--ink-soft);
  white-space: nowrap;
}

.ops-sub {
  font-size: 0.72rem;
  color: var(--flat);
  margin-top: 0.2rem;
}

.ops-msg {
  font-size: 0.78rem;
  color: var(--ink-soft);
  margin-bottom: 0.45rem;
  max-width: 18rem;
  line-height: 1.35;
}

.ops-pill {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 0.15rem 0.45rem;
  border: 1px solid var(--line);
  color: var(--flat);
}

.ops-pill-ok {
  color: var(--up);
  background: var(--up-bg);
  border-color: rgba(13, 122, 69, 0.35);
}

.ops-pill-running {
  color: var(--accent-deep);
  background: rgba(15, 122, 108, 0.12);
  border-color: rgba(10, 83, 73, 0.35);
}

.ops-pill-error {
  color: var(--down);
  background: var(--down-bg);
  border-color: rgba(180, 35, 24, 0.35);
}

.ops-pill-skipped {
  color: #6b4f00;
  background: rgba(180, 140, 20, 0.14);
  border-color: rgba(140, 110, 10, 0.4);
}

.ops-skip-reason {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--ink);
  margin-top: 0.35rem;
  max-width: 14rem;
  line-height: 1.35;
}

.ops-pill-idle {
  color: var(--flat);
}

.ops-pill-paused {
  color: #8a5a00;
  background: rgba(180, 120, 20, 0.12);
  border-color: rgba(140, 90, 10, 0.35);
}

.ops-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.ops-run-btn {
  appearance: none;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.55);
  color: var(--ink);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.35rem 0.65rem;
  cursor: pointer;
  min-height: 34px;
}

.ops-run-btn:hover:not(:disabled) {
  border-color: var(--accent-deep);
  color: var(--accent-deep);
}

.ops-run-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.ops-stop-btn:hover:not(:disabled) {
  border-color: var(--down);
  color: var(--down);
}

tr.is-paused .ops-job-name {
  color: var(--ink-soft);
}

/* iOS zoom-on-focus: keep controls at 16px on narrow viewports even in Desktop layout. */
@media (max-width: 768px) {
  input,
  select,
  textarea {
    font-size: 16px !important;
  }
}

/* -- Phone / compact layout (Auto-narrow, iPhone PWA, or forced Phone) -- */
html.layout-phone {
  font-size: 16px;
}

html.layout-phone body {
  touch-action: manipulation;
}

html.layout-phone .topbar-inner {
  padding: 0.35rem 0.85rem;
  padding-top: max(0.35rem, var(--safe-top));
  gap: 0.45rem 0.55rem;
}

html.layout-phone .topbar-brand {
  font-size: 0.95rem;
}

html.layout-phone .view-tabs {
  margin-left: 0;
  margin-right: 0;
}

html.layout-phone .view-tab {
  min-height: 44px;
  padding: 0.45rem 0.7rem;
  font-size: 0.88rem;
}

html.layout-phone .layout-pref-btn,
html.layout-phone .chip-btn,
html.layout-phone .bias-toggle-btn,
html.layout-phone .focus-checklist-toggle,
html.layout-phone .focus-checklist-summary,
html.layout-phone .gift-pointer-toggle,
html.layout-phone .gift-pointer-summary,
html.layout-phone .symbol-btn,
html.layout-phone .options-tab,
html.layout-phone .ops-tool-btn,
html.layout-phone .ops-run-btn {
  min-height: 44px;
}

html.layout-phone .focus-checklist-toggle {
  padding: 0.45rem 0.75rem;
}

html.layout-phone .hero {
  min-height: 0;
  padding: 0.7rem 1rem 0.75rem;
  justify-content: flex-start;
}

html.layout-phone .hero-ops {
  padding-bottom: 0.65rem;
}

html.layout-phone .brand {
  font-size: clamp(1.55rem, 9vw, 2.15rem);
  margin-bottom: 0.3rem;
  line-height: 0.95;
}

html.layout-phone .hero h1 {
  font-size: 1.15rem;
  max-width: none;
  line-height: 1.2;
}

html.layout-phone .lede {
  margin-top: 0.35rem;
  font-size: 0.95rem;
  line-height: 1.45;
}

html.layout-phone .hero-note {
  display: none;
}

html.layout-phone .hero-actions {
  margin-top: 0.45rem;
  gap: 0.4rem;
  flex-direction: row;
}

html.layout-phone .hero-actions .cta,
html.layout-phone .hero-actions .cta-secondary {
  width: auto;
  min-height: 44px;
  padding: 0.45rem 0.75rem;
  font-size: 0.88rem;
}

html.layout-phone .focus-funnel,
html.layout-phone .signal-stages {
  font-size: 0.82rem;
  padding: 0.5rem 1rem;
  line-height: 1.4;
}

html.layout-phone .refresh-bar {
  position: relative;
  top: auto;
}

html.layout-phone .gift-pointer,
html.layout-phone .macro-tape,
html.layout-phone .decision-strip {
  position: relative;
  top: auto;
  z-index: 1;
}

html.layout-phone .search-bar {
  top: auto;
}

html.layout-phone .decision-strip-inner {
  padding: 0.45rem 0.85rem;
  flex-direction: column;
  align-items: stretch;
}

html.layout-phone .decision-strip-secondary {
  margin-left: 0;
}

html.layout-phone .decision-pill,
html.layout-phone .evidence-summary,
html.layout-phone .evidence-jump-btn {
  min-height: 44px;
}

html.layout-phone .gift-pointer-inner {
  padding-left: 0.85rem;
  padding-right: 0.85rem;
  padding-top: 0.4rem;
  padding-bottom: 0.45rem;
}

html.layout-phone .gift-pointer-title {
  font-size: 0.98rem;
}

html.layout-phone .gift-spark {
  height: 36px;
  min-height: 36px;
}

html.layout-phone .gift-pointer-toggle {
  min-height: 44px;
}

html.layout-phone .refresh-bar-inner,
html.layout-phone .search-bar-inner,
html.layout-phone .ops-bar-inner,
html.layout-phone .topbar-inner,
html.layout-phone .hero,
html.layout-phone main,
html.layout-phone footer,
html.layout-phone .ops-main {
  padding-left: 0.85rem;
  padding-right: 0.85rem;
}

html.layout-phone .search-bar-inner {
  grid-template-columns: 1fr;
  grid-template-areas:
    "label"
    "wrap"
    "status";
  padding-top: 0.4rem;
  padding-bottom: 0.5rem;
}

html.layout-phone .search-bar-inner--with-universe {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}

html.layout-phone .search-bar-inner--with-universe .search-label {
  flex: 1 1 100%;
}

html.layout-phone .search-bar-inner--with-universe .search-wrap {
  flex: 1 1 12rem;
}

html.layout-phone .search-universe-filter {
  flex: 1 1 auto;
}

html.layout-phone .search-universe-filter select {
  flex: 1 1 auto;
  min-width: 9.5rem;
}

html.layout-phone .refresh-actions {
  width: 100%;
}

html.layout-phone .refresh-btn {
  flex: 1 1 auto;
}

html.layout-phone input,
html.layout-phone select,
html.layout-phone textarea {
  font-size: 16px !important;
}

html.layout-phone .check-row {
  grid-template-columns: auto 1fr;
  gap: 0.4rem 0.65rem;
  min-height: 44px;
}

html.layout-phone .check-row input[type="checkbox"] {
  width: 1.25rem;
  height: 1.25rem;
  min-width: 1.25rem;
}

html.layout-phone .check-row input[type="number"],
html.layout-phone .check-row select,
html.layout-phone .check-row .unit {
  grid-column: 2;
}

html.layout-phone .check-row.check-row-hint {
  grid-template-columns: auto 1fr;
}

html.layout-phone .check-row.check-row-hint .check-hint {
  grid-column: 2;
  margin-left: 0;
}

html.layout-phone .param-group {
  flex-direction: column;
  flex-wrap: nowrap;
}

html.layout-phone .filter-field,
html.layout-phone .filter-field.wide {
  min-width: 0;
  width: 100%;
}

html.layout-phone .filters input,
html.layout-phone .params-form .filter-field input {
  width: 100%;
}

html.layout-phone .params-form {
  padding-bottom: calc(7rem + var(--safe-bottom));
}

html.layout-phone .sticky-actions {
  padding-bottom: max(0.65rem, var(--safe-bottom));
}

html.layout-phone .filter-apply,
html.layout-phone .filter-reset {
  flex: 1 1 auto;
}

html.layout-phone #viewDaily main,
html.layout-phone #viewMonthly main {
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
  padding-bottom: calc(3.5rem + var(--safe-bottom));
}

html.layout-phone #focusBoard,
html.layout-phone #mBoard {
  order: -1;
}

html.layout-phone .params-panel,
html.layout-phone .board,
html.layout-phone .detail,
html.layout-phone .earlier-signals,
html.layout-phone .focus-board,
html.layout-phone .focus-secondary,
html.layout-phone .coil-board,
html.layout-phone .open-alerts-board {
  scroll-margin-top: calc(var(--streak-topbar-h) + 4.25rem);
}

html.layout-phone .col-hide {
  display: none !important;
}

html.layout-phone table {
  font-size: 0.8rem;
}

html.layout-phone th,
html.layout-phone td {
  padding: 0.55rem 0.45rem;
}

html.layout-phone .table-wrap table:not(.ops-table) th:first-child,
html.layout-phone .table-wrap table:not(.ops-table) td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  min-width: 5.25rem;
  background: var(--paper);
  box-shadow: 1px 0 0 var(--line);
}

html.layout-phone .table-wrap table:not(.ops-table) thead th:first-child {
  z-index: 2;
  background: var(--paper-2);
}

html.layout-phone tbody tr:hover td:first-child,
html.layout-phone tbody tr.active td:first-child,
html.layout-phone #mBoardTable tr.board-row.is-active td:first-child {
  background: #d7e6e2;
}

html.layout-phone .ops-table th:first-child,
html.layout-phone .ops-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--paper);
}

html.layout-phone .ops-table th:nth-child(2),
html.layout-phone .ops-table td:nth-child(2) {
  position: sticky;
  left: 2.1rem;
  z-index: 1;
  background: var(--paper);
  box-shadow: 1px 0 0 var(--line);
}

html.layout-phone .ops-check-col input,
html.layout-phone .ops-check-cell input {
  width: 1.25rem;
  height: 1.25rem;
}

html.layout-phone .stat-row,
html.layout-phone .live-strip,
html.layout-phone .charts,
html.layout-phone .monthly-charts,
html.layout-phone .ref-charts,
html.layout-phone .focus-detail-grid,
html.layout-phone .confluence-grid {
  grid-template-columns: 1fr;
}

html.layout-phone .options-controls {
  flex-direction: column;
  align-items: stretch;
}

html.layout-phone .options-controls .refresh-btn,
html.layout-phone #fetchOptionsBtn {
  width: 100%;
}

html.layout-phone .options-tabs {
  width: 100%;
}

html.layout-phone .options-tab {
  flex: 1 1 auto;
}

html.layout-phone .user-email {
  max-width: 22vw;
}

html.layout-phone .ops-schedule {
  white-space: normal;
}

html.layout-phone .ops-job-desc,
html.layout-phone .ops-msg {
  max-width: none;
}

html.layout-phone .ops-toolbar-sep {
  display: none;
}

html.layout-phone .ops-toolbar {
  width: 100%;
}

html.layout-phone .ops-tool-btn {
  flex: 1 1 auto;
  font-size: 0.82rem;
}

html.layout-phone .day-date-cell {
  max-width: 9.5rem;
  font-size: 0.82rem;
}

html.layout-phone .day-anchor-tag {
  font-size: 0.6rem;
  padding: 0.06rem 0.25rem;
}

html.layout-phone footer {
  padding-bottom: calc(2rem + var(--safe-bottom));
}

/* -- Analytics tab + Hist badges + Save for tracking -- */
.board-section-head {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.35rem;
  overflow: visible;
}

.board-head-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem 0.85rem;
  width: 100%;
}

.board-head-title {
  flex: 1 1 12rem;
  min-width: 0;
}

.board-head-title h2 {
  width: auto;
}

.board-head-toolbar .track-save-wrap {
  flex: 0 1 auto;
  align-self: flex-start;
}

.track-save-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.65rem;
  margin-left: auto;
}

.track-save-btn {
  appearance: none;
  border: 1px solid var(--accent-deep);
  background: rgba(10, 83, 73, 0.08);
  color: var(--accent-deep);
  font: inherit;
  font-weight: 600;
  font-size: 0.82rem;
  padding: 0.45rem 0.85rem;
  min-height: 44px;
  min-width: 44px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.track-save-btn:hover:not(:disabled) {
  background: rgba(10, 83, 73, 0.16);
}

.track-save-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.track-save-hint {
  margin: 0;
  font-size: 0.78rem;
  color: var(--ink-soft);
  min-height: 1.1em;
}

.hist-cell {
  position: relative;
  vertical-align: middle;
  white-space: nowrap;
}

.hist-badge {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  display: inline-flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.15rem 0.3rem;
  padding: 0.15rem 0;
  min-height: 32px;
  cursor: default;
  text-align: left;
}

button.hist-badge {
  cursor: pointer;
}

.hist-total {
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--accent-deep);
}

.hist-win {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.hist-chips {
  display: inline-flex;
  gap: 0.15rem;
}

.hist-chip {
  display: inline-block;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 0.08rem 0.28rem;
  border: 1px solid rgba(10, 83, 73, 0.3);
  color: var(--accent-deep);
}

.hist-badge.hist-new {
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--ink-soft);
  opacity: 0.7;
  min-height: 0;
  padding: 0;
}

.hist-pop {
  position: absolute;
  left: 0;
  top: 100%;
  z-index: 8;
  max-width: 16rem;
  padding: 0.4rem 0.55rem;
  background: #f4f8fa;
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 0.72rem;
  line-height: 1.35;
  white-space: normal;
}

.analytics-lookback-mount {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.analytics-lookback-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.js-analytics-lookback {
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  min-height: 36px;
  padding: 0.25rem 0.45rem;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink);
}

.analytics-filter {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.analytics-filter .filter-label {
  font-size: 0.72rem;
}

.analytics-filter select,
#analyticsDateFilter,
#analyticsSourceFilter {
  font: inherit;
  font-size: 0.82rem;
  min-height: 36px;
  padding: 0.25rem 0.45rem;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.7);
}

.analytics-empty {
  margin: 0 0 1rem;
  color: var(--ink-soft);
}

.analytics-snap-row {
  cursor: pointer;
}

.analytics-inner-table {
  width: 100%;
}

.analytics-detail {
  padding: 0.4rem 0 0.6rem;
}

html.layout-phone .view-tabs {
  flex-wrap: wrap;
}

html.layout-phone .view-tab {
  padding: 0.45rem 0.55rem;
}

html.layout-phone .track-save-btn,
html.layout-phone .js-analytics-lookback,
html.layout-phone #analyticsSourceFilter,
html.layout-phone #analyticsDateFilter,
html.layout-phone #analyticsLookbackReset {
  min-height: 44px;
}

html.layout-phone .board-head-toolbar {
  flex-direction: column;
  align-items: stretch;
  gap: 0.65rem;
}

html.layout-phone .board-head-toolbar .track-save-wrap {
  margin-left: 0;
  width: 100%;
  flex: 1 1 auto;
}

html.layout-phone .board-head-toolbar .track-save-btn {
  width: 100%;
}

html.layout-phone .board-section-head {
  position: relative;
  z-index: 2;
  overflow: visible;
}

html.layout-phone .focus-secondary > summary {
  min-height: 44px;
  padding-top: 1rem;
  padding-bottom: 1rem;
}

html.layout-phone .focus-secondary[open] .board-section-head .track-save-wrap {
  display: flex;
}

html.layout-phone .hist-chips {
  display: none;
}

html.layout-phone .hist-badge {
  min-height: 44px;
  align-items: center;
}

html.layout-phone .hist-badge.hist-new {
  min-height: 0;
}

html.layout-phone .track-save-wrap {
  margin-left: 0;
  width: 100%;
}

html.layout-phone .focus-board .board-section-head,
html.layout-phone .coil-board .board-section-head,
html.layout-phone #board > .board-section-head,
html.layout-phone #mBoard > .board-section-head {
  scroll-margin-top: calc(var(--streak-topbar-h) + 4.25rem);
}

html.layout-phone #board > .board-section-head,
html.layout-phone .coil-board > .board-section-head {
  /* potential + coil boards inside secondary - keep toolbar above table scroll */
  padding-bottom: 0.15rem;
}

html.layout-phone .analytics-bar-inner {
  gap: 0.55rem;
}

html.layout-phone #viewAnalytics main {
  padding-bottom: calc(3.5rem + var(--safe-bottom));
}

/* -- GIFT vs Nifty open (Analytics 30d) -- */
.gift-accuracy-section {
  margin-top: 1.5rem;
}

.gift-accuracy-meta {
  margin: 0 0 0.65rem;
}

.gift-accuracy-chart-wrap {
  margin: 0 0 0.35rem;
  width: 100%;
}

.gift-accuracy-chart {
  display: block;
  width: 100%;
  max-width: 920px;
}

.gift-accuracy-caption {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin: 0 0 0.85rem;
  font-size: 0.78rem;
  color: var(--ink-soft);
}

.gift-legend {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.gift-legend-swatch {
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 1px;
  flex-shrink: 0;
}

.gift-accuracy-table .gift-gap-cell.up .gift-gap-pts {
  color: #0d7a45;
}

.gift-accuracy-table .gift-gap-cell.down .gift-gap-pts {
  color: #b42318;
}

.gift-gap-missing {
  color: var(--ink-soft);
  font-style: italic;
}

.gift-hit-yes {
  color: #0a5349;
  font-weight: 700;
}

.gift-hit-no {
  color: #c45c26;
  font-weight: 700;
}

.gift-hit-na {
  color: var(--ink-soft);
}

.gift-row-hit {
  background: rgba(10, 83, 73, 0.04);
}

.gift-row-miss {
  background: rgba(196, 92, 38, 0.05);
}

.gift-row-missing {
  opacity: 0.92;
}

.gift-row-note {
  color: #c45c26;
}

html.layout-phone .gift-accuracy-chart {
  height: 160px !important;
  min-height: 160px;
}

html.layout-phone .gift-accuracy-table .col-hide {
  display: none;
}

html.layout-phone .gift-accuracy-table td:first-child .submeta.col-hide {
  display: block;
  font-size: 0.68rem;
}

/* -- Two-region side layout: collapsible left filters + full-width center (inline deep dive) -- */
html.layout-phone.side-drawer-open body {
  overflow: hidden;
  touch-action: none;
}

html.layout-desktop #viewDaily > .hero,
html.layout-desktop #viewDaily > .focus-funnel,
html.layout-desktop #viewMonthly > .hero,
html.layout-desktop #viewAnalytics > .hero {
  display: none;
}

html.layout-desktop .side-layout-shell {
  --side-left-w: var(--streak-left-rail-w, 260px);
  display: grid;
  grid-template-columns: var(--side-left-w) 5px minmax(0, 1fr);
  gap: 0;
  height: calc(100dvh - var(--streak-topbar-h));
  min-height: 0;
  overflow: hidden;
  border-top: 1px solid var(--line);
}

html.layout-desktop .side-layout-shell.is-left-collapsed {
  /* Two columns only - resizer is display:none and must not leave a 0-width track */
  grid-template-columns: 36px minmax(0, 1fr);
}

html.layout-desktop .side-layout-left {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  background: rgba(255, 255, 255, 0.28);
  border-right: 1px solid var(--line);
  position: relative;
}

html.layout-desktop .side-layout-shell.is-left-collapsed .side-layout-left-scroll,
html.layout-desktop .side-layout-shell.is-left-collapsed .side-rail-head {
  display: none;
}

html.layout-desktop .side-left-collapse {
  appearance: none;
  border: 0;
  background: rgba(231, 238, 242, 0.92);
  color: var(--accent-deep);
  font: inherit;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1;
  width: 100%;
  min-height: 36px;
  padding: 0.35rem 0;
  cursor: pointer;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}

html.layout-desktop .side-layout-shell.is-left-collapsed .side-left-collapse {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-bottom: 0;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-size: 1rem;
}

html.layout-desktop .side-left-resizer {
  cursor: col-resize;
  touch-action: none;
  background: linear-gradient(90deg, transparent 0%, rgba(14, 26, 34, 0.08) 50%, transparent 100%);
  min-height: 0;
}

html.layout-desktop .side-left-resizer:hover,
html.layout-desktop .side-left-resizer:focus-visible {
  background: rgba(15, 122, 108, 0.18);
  outline: none;
}

html.layout-desktop .side-left-resizer.is-hidden {
  display: none;
}

html.layout-desktop.side-left-resizing,
html.layout-desktop.side-left-resizing * {
  cursor: col-resize !important;
  user-select: none !important;
}

html.layout-desktop .side-layout-left-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 0.65rem 0.75rem 1rem;
}

html.layout-desktop .side-layout-center {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}

html.layout-desktop .side-layout-center-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

html.layout-desktop .side-layout-center-scroll > main,
html.layout-desktop .side-layout-center-scroll main.side-layout-main {
  max-width: none;
  margin: 0;
  padding: 0 1rem 2rem;
  display: grid;
  gap: 1.75rem;
}

html.layout-desktop .side-layout-center-scroll .refresh-bar,
html.layout-desktop .side-layout-center-scroll .decision-strip,
html.layout-desktop .side-layout-center-scroll .gift-pointer,
html.layout-desktop .side-layout-center-scroll .macro-tape,
html.layout-desktop .side-layout-center-scroll .search-bar,
html.layout-desktop .side-layout-center-scroll .index-options-panel--daily {
  position: relative;
  top: auto;
  z-index: 1;
}

html.layout-desktop .side-layout-center-scroll .refresh-bar-inner,
html.layout-desktop .side-layout-center-scroll .decision-strip-inner,
html.layout-desktop .side-layout-center-scroll .gift-pointer-inner,
html.layout-desktop .side-layout-center-scroll .macro-tape-inner,
html.layout-desktop .side-layout-center-scroll .search-bar-inner,
html.layout-desktop .side-layout-center-scroll .index-options-panel--daily .evidence-panel-inner {
  max-width: none;
  margin: 0;
  padding-left: 1rem;
  padding-right: 1rem;
}


html.layout-desktop .side-layout-left-scroll .params-panel,
html.layout-desktop .side-layout-left-scroll .params-form {
  margin-bottom: 0;
}

html.layout-desktop .side-layout-left-scroll .params-form {
  padding-bottom: 0.5rem;
}

html.layout-desktop .side-layout-left-scroll .sticky-actions {
  position: sticky;
  bottom: 0;
  z-index: 5;
  margin: 0 -0.75rem;
  padding: 0.65rem 0.75rem;
  padding-bottom: max(0.65rem, env(safe-area-inset-bottom));
  background: linear-gradient(
    180deg,
    rgba(231, 238, 242, 0) 0%,
    rgba(231, 238, 242, 0.94) 28%,
    rgba(231, 238, 242, 0.98) 100%
  );
}

html.layout-desktop .side-layout-left-scroll .params-panel,
html.layout-desktop .side-layout-left-scroll .board,
html.layout-desktop .side-layout-left-scroll .detail {
  scroll-margin-top: 0;
}

html.layout-desktop .side-layout-left-scroll .focus-params-panel,
html.layout-desktop .side-layout-left-scroll .daily-params-panel,
html.layout-desktop .side-layout-left-scroll .monthly-params-panel {
  padding: 0;
  background: transparent;
  border: 0;
}

html.layout-desktop .side-layout-left-scroll .param-group.checks {
  gap: 0.35rem;
}

html.layout-desktop .side-layout-left-scroll .check-row {
  grid-template-columns: auto minmax(0, 1fr) 4.5rem auto;
  font-size: 0.82rem;
}

html.layout-desktop .analytics-lookback-mount--rail {
  margin-bottom: 0.75rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.45);
}

html.layout-desktop .focus-board,
html.layout-desktop .focus-secondary,
html.layout-desktop #mBoard {
  max-width: none;
  padding: 0;
  margin: 0;
}

.side-rail-head {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--line);
  background: rgba(231, 238, 242, 0.92);
}

.side-rail-label {
  margin: 0;
  font-family: var(--display);
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--accent-deep);
}

.side-rail-dismiss {
  appearance: none;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.55);
  color: var(--ink);
  font: inherit;
  font-size: 1.1rem;
  line-height: 1;
  width: 2.25rem;
  height: 2.25rem;
  cursor: pointer;
}

.side-phone-bar {
  display: none;
}

html.layout-phone .side-phone-bar {
  display: flex;
  gap: 0.5rem;
  position: fixed;
  left: max(0.85rem, var(--safe-left));
  right: max(0.85rem, var(--safe-right));
  bottom: max(0.65rem, var(--safe-bottom));
  z-index: 45;
}

html.layout-phone .side-phone-btn {
  flex: 1 1 auto;
  appearance: none;
  border: 1px solid var(--line);
  background: rgba(231, 238, 242, 0.96);
  backdrop-filter: blur(8px);
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  font-size: 0.88rem;
  min-height: 44px;
  padding: 0.55rem 0.85rem;
  cursor: pointer;
}

html.layout-phone .side-layout-shell {
  display: block;
}

html.layout-phone .side-layout-left {
  display: none;
}

html.layout-phone .side-left-resizer,
html.layout-phone .side-left-collapse {
  display: none;
}

html.layout-phone .side-layout-left.is-drawer-open {
  display: flex;
  flex-direction: column;
  position: fixed;
  z-index: 50;
  background: var(--paper);
  box-shadow: 0 12px 40px rgba(14, 26, 34, 0.18);
  top: var(--streak-topbar-h);
  left: 0;
  bottom: 0;
  width: min(92vw, 22rem);
  border-right: 1px solid var(--line);
}

html.layout-phone .side-layout-shell.is-overlay::before {
  content: "";
  position: fixed;
  inset: var(--streak-topbar-h) 0 0 0;
  z-index: 49;
  background: rgba(14, 26, 34, 0.35);
}

html.layout-phone .side-layout-left.is-drawer-open .side-rail-head {
  display: flex;
}

html.layout-phone .side-layout-left-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 0.65rem 0.85rem 1rem;
}

html.layout-phone .side-layout-left-scroll .sticky-actions {
  position: sticky;
  bottom: 0;
  z-index: 5;
  margin: 0 -0.85rem;
  padding: 0.65rem 0.85rem;
  padding-bottom: max(0.65rem, env(safe-area-inset-bottom));
  background: linear-gradient(
    180deg,
    rgba(231, 238, 242, 0) 0%,
    rgba(231, 238, 242, 0.96) 30%,
    rgba(231, 238, 242, 1) 100%
  );
}

html.layout-phone .side-layout-center-scroll .refresh-bar {
  position: relative;
  top: auto;
}

html.layout-phone .side-layout-center-scroll {
  display: block;
  padding-bottom: calc(4.25rem + var(--safe-bottom));
}

html.layout-phone .side-layout-center-scroll > main {
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
}

html.layout-phone .search-bar-inner--with-universe .search-universe-filter {
  display: none;
}

html.layout-phone .side-layout-left-scroll .search-universe-filter {
  display: flex;
  margin-bottom: 0.75rem;
  width: 100%;
}

html.layout-phone .analytics-lookback-mount--rail {
  margin-bottom: 0.75rem;
}


/* ---------- Owner lock (owner-lock.js) ---------- */
.owner-chip {
  appearance: none;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.55);
  color: var(--ink);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 0.3rem 0.6rem;
  min-height: 30px;
  cursor: pointer;
  white-space: nowrap;
}
.owner-chip[data-state="owner"] {
  border-color: var(--up);
  color: var(--up);
  background: var(--up-bg);
}
.owner-chip[data-state="locked"] {
  color: var(--ink-soft);
}
.owner-chip[data-state="open"] {
  border-color: var(--down);
  color: var(--down);
  background: var(--down-bg);
}
.owner-dialog {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(14, 26, 34, 0.45);
}
.owner-dialog-card {
  width: min(28rem, 100%);
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 1.25rem 1.25rem 1rem;
  box-shadow: 0 18px 48px rgba(14, 26, 34, 0.25);
}
.owner-dialog-card h2 {
  margin: 0 0 0.5rem;
  font-family: var(--display);
  font-size: 1.15rem;
}
.owner-dialog-lede {
  margin: 0 0 0.9rem;
  font-size: 0.85rem;
  color: var(--ink-soft);
  line-height: 1.45;
}
.owner-dialog-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 0.3rem;
}
.owner-dialog-card input {
  width: 100%;
  font: inherit;
  font-size: 16px; /* no iOS zoom */
  padding: 0.55rem 0.6rem;
  border: 1px solid var(--line);
  background: #fff;
}
.owner-dialog-err {
  min-height: 1.2rem;
  margin: 0.4rem 0 0.6rem;
  font-size: 0.8rem;
  color: var(--down);
}
.owner-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

/* ---------- Ops → Visitors (visitors.js) ---------- */
.vis-section {
  margin-top: 1.5rem;
}
.vis-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 1rem;
  margin: 0.5rem 0 0.9rem;
}
.vis-days {
  font-size: 0.82rem;
  color: var(--ink-soft);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.vis-days select {
  font: inherit;
  padding: 0.3rem 0.4rem;
}
.vis-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr));
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.vis-stat {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.45);
  padding: 0.55rem 0.7rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.vis-stat-k {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.vis-stat-v {
  font-family: var(--display);
  font-size: 1.25rem;
  font-variant-numeric: tabular-nums;
}
.vis-h3 {
  margin: 1rem 0 0.4rem;
  font-size: 0.9rem;
}
.vis-table td.num,
.vis-table th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.vis-sub,
.vis-rel {
  font-size: 0.72rem;
  color: var(--ink-soft);
}
.vis-tag {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0 0.35rem;
  font-size: 0.66rem;
  font-weight: 700;
  border: 1px solid var(--line);
  color: var(--ink-soft);
  vertical-align: middle;
}
.vis-tag-owner {
  color: var(--up);
  border-color: var(--up);
  background: var(--up-bg);
}
.vis-tag-live {
  color: var(--accent-deep);
  border-color: var(--accent);
  background: rgba(15, 122, 108, 0.12);
}
.vis-live td {
  background: rgba(15, 122, 108, 0.05);
}
.vis-empty {
  color: var(--ink-soft);
  font-style: italic;
}

/* Narrow left rail: let the checklist title wrap so "Hide checklist" isn't clipped. */
html.layout-desktop .side-layout-left-scroll .focus-checklist-title-row {
  flex-wrap: wrap;
  row-gap: 0.4rem;
}
html.layout-desktop .side-layout-left-scroll .focus-checklist-title-row > div {
  min-width: 0;
  flex: 1 1 10rem;
}
html.layout-desktop .side-layout-left-scroll .focus-checklist-toggle {
  max-width: 100%;
}

/* ---- Members (Ops) and tier hints - api/tiers.py */
.owner-chip[data-state="member"] {
  border-color: var(--accent);
  color: var(--accent);
}
.lean-locked {
  margin: 0.5rem 0;
  padding: 0.5rem 0.7rem;
  border: 1px dashed var(--line);
  border-radius: 8px;
  font-size: 0.85rem;
  color: var(--ink-soft);
}
.mem-share {
  margin: 0.6rem 0 0.4rem;
}
.mem-switch {
  display: flex;
  gap: 0.55rem;
  align-items: flex-start;
  cursor: pointer;
}
.mem-switch input {
  margin-top: 0.2rem;
}
.mem-warn {
  margin: 0.35rem 0 0 1.6rem;
  font-size: 0.8rem;
  color: var(--ink-soft);
  max-width: 62rem;
}
.mem-table .mem-n {
  width: 4.5rem;
  text-align: right;
  font: inherit;
  padding: 0.2rem 0.35rem;
}
.mem-actions,
.mem-add {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin: 0.6rem 0;
}
.mem-add input[type="email"] {
  flex: 1 1 14rem;
  min-width: 0;
  font: inherit;
  padding: 0.35rem 0.5rem;
}
.mem-add select,
.mem-table select {
  font: inherit;
  padding: 0.25rem 0.35rem;
}
.mem-table .mem-off {
  opacity: 0.45;
}

/* ---- Market status chip + holiday banner + Ops calendar (market-status.js, api/market_calendar.py) */
.market-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 30px;
  max-width: 100%;
  padding: 0.25rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  color: var(--ink-soft);
  font: inherit;
  font-size: 0.74rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}
.market-pill .market-detail {
  font-weight: 400;
  overflow: hidden;
  text-overflow: ellipsis;
}
.market-dot {
  width: 0.5rem;
  height: 0.5rem;
  flex: none;
  border-radius: 50%;
  background: var(--flat);
}
.market-pill[data-state="open"] {
  border-color: var(--up);
  color: var(--up);
  background: var(--up-bg);
}
.market-pill[data-state="open"] .market-dot {
  background: var(--up);
  animation: market-pulse 1.8s ease-in-out infinite;
}
.market-pill[data-state="pre_open"] {
  border-color: #b26b00;
  color: #8a5300;
  background: rgba(178, 107, 0, 0.1);
}
.market-pill[data-state="pre_open"] .market-dot {
  background: #b26b00;
}
.market-pill[data-state="holiday"] {
  border-color: var(--down);
  color: var(--down);
  background: var(--down-bg);
}
.market-pill[data-state="holiday"] .market-dot {
  background: var(--down);
}
.market-pill[data-state="loading"] .market-detail {
  display: none;
}
@keyframes market-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(13, 122, 69, 0.45); }
  50% { box-shadow: 0 0 0 0.3rem rgba(13, 122, 69, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .market-pill[data-state="open"] .market-dot { animation: none; }
}
@media (max-width: 640px) {
  .market-pill .market-detail { display: none; }  /* tap the chip for the detail */
}
.market-banner {
  max-width: 1100px;
  margin: 0.5rem auto 0;
  padding: 0.55rem 0.9rem;
  border: 1px solid var(--line);
  border-left: 3px solid var(--down);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.7);
  font-size: 0.86rem;
  color: var(--ink-soft);
}
@media (max-width: 1148px) {
  .market-banner { margin-left: 1rem; margin-right: 1rem; }
}
.cal-table .cal-today td {
  background: var(--mist);
  font-weight: 600;
}
.cal-table .cal-past td {
  color: var(--flat);
}
.cal-add input[type="date"],
.cal-add input[type="time"],
.cal-add input[type="text"] {
  font: inherit;
  padding: 0.3rem 0.45rem;
}
.cal-add input[type="text"] {
  flex: 1 1 12rem;
  min-width: 0;
}
.market-pill[data-state="holiday"] .market-detail {
  display: none;  /* the banner under the bar carries the holiday's name and the next session */
}


/* ---- Screens & modules (ui-modules.js, api/modules.py): hide what this caller's tier / add-ons don't include */
html.m-ready:not(.m-today_bar) [data-module="today_bar"],
html.m-ready:not(.m-lean_shifts) [data-module="lean_shifts"],
html.m-ready:not(.m-traps) [data-module="traps"],
html.m-ready:not(.m-setups) [data-module="setups"],
html.m-ready:not(.m-next_sessions) [data-module="next_sessions"],
html.m-ready:not(.m-lean_readings) [data-module="lean_readings"],
html.m-ready:not(.m-gift_nifty) [data-module="gift_nifty"],
html.m-ready:not(.m-macro_tape) [data-module="macro_tape"],
html.m-ready:not(.m-index_fno) [data-module="index_fno"],
html.m-ready:not(.m-focus) [data-module="focus"],
html.m-ready:not(.m-coil) [data-module="coil"],
html.m-ready:not(.m-potential_moves) [data-module="potential_moves"],
html.m-ready:not(.m-monthly) [data-module="monthly"],
html.m-ready:not(.m-analytics) [data-module="analytics"],
html.m-ready:not(.m-positions) [data-module="positions"],
html.m-ready:not(.m-trade_ideas) [data-module="trade_ideas"],
html.m-ready:not(.m-stock) [data-module="stock"],
html.m-ready:not(.m-refboards) [data-module="refboards"] {
  display: none !important;
}
/* today-bar tiles keep their numbers, but don't jump to a panel this caller doesn't have */
html.m-ready:not(.m-macro_tape) [data-evidence-target="macroTape"],
html.m-ready:not(.m-gift_nifty) [data-evidence-target="giftNiftyPointer"] {
  pointer-events: none;
  cursor: default;
}
/* no stock add-on: no filter rail on the market screen - the centre takes the width */
html.layout-desktop.m-ready:not(.m-stock) #dailySideShell {
  grid-template-columns: minmax(0, 1fr);
}
html.m-ready:not(.m-stock) #dailyLeftRail,
html.m-ready:not(.m-stock) #dailyLeftResizer,
html.m-ready:not(.m-stock) #dailyOpenFilters,
html.m-ready:not(.m-stock) #viewDaily .side-phone-bar {
  display: none !important;
}
.hero-market h1 {
  max-width: 22em;
}
.hero-market .lede b {
  color: var(--accent-deep);
}

/* owner preview bar */
.preview-bar {
  position: relative;
  z-index: 60;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.4rem 0.8rem;
  padding: 0.45rem 1rem;
  background: #fff4d6;
  border-bottom: 1px solid #e3c46b;
  color: #5c4500;
  font-size: 0.84rem;
}

/* Ops → Screens & modules */
.mod-table th,
.mod-table td {
  text-align: center;
}
.mod-table th:first-child,
.mod-table td:first-child {
  text-align: left;
}
.mod-table tr.mod-group th {
  text-align: left;
  background: var(--mist);
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.mod-table td.mod-na {
  color: var(--flat);
}
.mod-preview .chip-btn {
  min-height: 30px;
}
.mod-person select,
.mod-person input[type="date"] {
  font: inherit;
  padding: 0.2rem 0.35rem;
}

/* the market screen's intro: for everyone but the owner, until they've read it ("Got it") */
html.m-ready:not(.m-positions):not(.hero-seen) #viewDaily > .hero.hero-market {
  display: block !important;
  min-height: 0;
  padding: 1rem 1.5rem 0.9rem;
  max-width: 1100px;
  margin: 0 auto;
}
.hero-market .brand {
  display: none;
}
.hero-market h1 {
  font-size: clamp(1.25rem, 2.4vw, 1.8rem);
  margin: 0 0 0.35rem;
}
.hero-market .lede {
  max-width: 52rem;
  margin: 0 0 0.6rem;
}
.hero-market .hero-actions {
  margin: 0 0 0.4rem;
}
.hero-market .hero-note {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin: 0;
}
html.layout-phone .hero-market .hero-note {
  display: flex;
}

/* Ops → Data source (data-source.js) */
.ds-line {
  margin: 0.4rem 0;
}
.ds-choice {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.5rem 0.8rem;
  margin: 0.6rem 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.4rem;
}
.ds-choice legend {
  font-size: 0.78rem;
  color: var(--ink-soft);
  padding: 0 0.3rem;
}
.ds-choice label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
}
.kite-nudge {
  border-left-color: #b26b00;
}

/* Ops → Backtest · Kite history (backtest.js) */
.bt-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 1rem;
  margin-bottom: 0.75rem;
}
.bt-form label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
}
.bt-form input[type="date"] {
  min-height: 36px;
  padding: 0 0.5rem;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  font: inherit;
}
.bt-job {
  margin: 0.25rem 0 0.75rem;
  font-size: 0.85rem;
  color: var(--ink-soft);
}
.bt-err {
  color: var(--down);
}
.bt-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.seg-mini {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  border-radius: 8px;
  background: var(--mist);
}
.seg-mini button {
  border: 0;
  background: transparent;
  padding: 0.3rem 0.7rem;
  border-radius: 6px;
  font: inherit;
  font-size: 0.8rem;
  color: var(--muted);
  cursor: pointer;
}
.seg-mini button[aria-pressed="true"] {
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
}
.bt-table th[scope="row"] {
  text-align: left;
  font-weight: 500;
}
.bt-table tr.bt-live th {
  font-weight: 700;
}
.bt-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0.75rem;
  margin: 0.75rem 0;
}
.bt-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  font-size: 0.9rem;
  line-height: 1.45;
}
.bt-runs summary {
  cursor: pointer;
  font-size: 0.85rem;
  margin: 0.5rem 0;
}
.bt-table th[scope="row"] {
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.88rem;
  color: var(--ink);
}
.bt-list {
  margin: 0.25rem 0 0.5rem;
  padding-left: 1.2rem;
  font-size: 0.82rem;
  color: var(--ink-soft);
}
.bt-h3 {
  margin: 1rem 0 0.4rem;
  font-size: 1rem;
}

/* Ops / Analytics: fold and unfold sections (sections.js) */
.sec-bar {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin: 0 0 0.75rem;
}
.sec-head-fold {
  position: relative;
  padding-right: 2.75rem;
}
.sec-fold {
  position: absolute;
  top: 0.1rem;
  right: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.sec-fold:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.sec-fold svg {
  transition: transform 0.15s ease;
}
.ops-section.is-folded .sec-fold svg {
  transform: rotate(-90deg);
}
.sec-title {
  cursor: pointer;
}
.ops-section.is-folded > :not(.section-head) {
  display: none !important;
}
.ops-section.is-folded > .section-head .meta {
  display: none;
}
.ops-section.is-folded > .section-head {
  margin-bottom: 0;
}

/* Market lean: every block folds (sections.js · watchPanes) */
.fold-hidden {
  display: none !important;
}
.pane-head.fold-head {
  position: relative;
  min-height: 32px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 0.35em;
  padding-right: 2.4rem;
  cursor: pointer;
}
.pane-head.fold-head.is-folded {
  margin-bottom: 6px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
}
.fold-mini {
  position: absolute;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.fold-mini:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.fold-mini svg {
  transition: transform 0.15s ease;
}
.pane-head.is-folded .fold-mini svg {
  transform: rotate(-90deg);
}
.pane-head.is-folded .muted {
  opacity: 0.7;
}

/* Trade ideas: the strategy that made each idea (market-lean.js · ideaCard) */
.idea-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 2px 0 6px;
}
.idea-tag {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  background: transparent;
  white-space: nowrap;
}
.idea-tag.t-lean {
  color: var(--accent);
  border-color: var(--accent);
}
.idea-tag.t-gann {
  color: #8d63d6;
  border-color: #a37ce0;
}
.idea-tag.t-open {
  color: var(--down);
  border-color: var(--down);
}
.idea-tag.t-condor,
.idea-tag.t-fii {
  color: var(--ink-2);
  border-color: var(--line-strong);
}
.idea-tag.t-test {
  color: var(--amber);
  border-color: var(--amber);
  border-style: dashed;
}
.idea-tag.t-sub {
  font-weight: 600;
}
.idea-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 10px;
}
.idea-filter .idea-tag {
  min-height: 30px;
  padding: 0 12px;
  cursor: pointer;
  font-size: 12px;
}
.idea-filter .idea-tag[aria-pressed="true"] {
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px currentColor;
}
.idea-signal {
  font-size: 0.85rem;
}
.idea-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  margin: 6px 0 12px;
  padding: 8px 0;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.idea-top .idea-filter {
  margin: 0;
}
.idea-day {
  display: inline-flex;
  flex: 1 1 280px;
  min-width: 0;
  max-width: 560px;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}
.idea-day select {
  flex: 1;
  min-width: 0;
  width: 100%;
  min-height: 32px;
  font: inherit;
  font-weight: 600;
  color: var(--ink);
}
.idea-sum {
  flex-basis: 100%;
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}
.vis-tag-signed {
  color: var(--accent);
  border-color: var(--accent);
  text-transform: capitalize;
}

/* Trade strategies tab (market-lean.js · strategiesBlock): lean shifts, Gann, opening sell, ... */
.strat-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 4px 0 12px;
}
.strat-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink-2);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.strat-chip[aria-selected="true"] {
  background: var(--surface-2);
  border-color: var(--line-strong);
  color: var(--ink);
  box-shadow: inset 0 -2px 0 currentColor;
}
.strat-chip .muted {
  font-weight: 500;
}
.strat-mark {
  font-weight: 800;
}
.s-lean .strat-mark {
  color: var(--shift-up, #2563eb);
  letter-spacing: -1px;
  font-size: 11px;
}
.s-gann .strat-mark {
  color: var(--strat-gann, #7c3aed);
}
.s-opening_sell .strat-mark {
  color: var(--strat-open, #c026d3);
}
.strat-table td {
  vertical-align: top;
  font-size: 0.85rem;
}
.strat-deep {
  margin: 4px 0 8px;
}
.lean-strategy .cdl {
  margin: 6px 0 12px;
}
.strat-table .strat-plan td {
  padding-top: 0;
  border-top: 0;
}
.strat-plan td {
  font-size: 0.8rem;
  line-height: 1.9;
}
.plan-buy,
.plan-rung,
.plan-res {
  display: inline-block;
  margin: 0 6px 4px 0;
  padding: 1px 8px;
  border-radius: 6px;
  border: 1px solid var(--line);
  white-space: nowrap;
}
.plan-buy {
  border-color: var(--line-strong);
  background: var(--surface-2);
}
.plan-rung.hit {
  border-color: var(--accent);
}
.plan-rung.hit b {
  color: var(--accent);
}
.plan-rung.sl b {
  color: var(--muted);
}
.plan-res {
  font-weight: 700;
}

/* Ops → App history (members.js · renderApp) */
.app-hist {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 0.6rem;
  max-width: 46rem;
}
.app-hist > label:not(.mem-switch) {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}
.app-hist > label > span:first-child {
  min-width: 13rem;
}
.app-hist input[type="number"] {
  width: 6.5rem;
  text-align: right;
  font: inherit;
  padding: 0.25rem 0.4rem;
}
.lean-shifts .sess-group {
  margin: 0.9rem 0 0.2rem;
  font-weight: 600;
  color: var(--ink);
}

/* Opening drive (api/opening_drive.py): the 5-minute read and the strip on the lean-shifts view (13 Oct 2026) */
.s-drive .strat-mark {
  color: var(--accent);
}
.drive-strip {
  margin: 6px 0 10px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--line-strong, var(--line));
  border-radius: 8px;
  font-size: 13px;
  color: var(--ink-2);
}
.drive-strip.up {
  border-left-color: var(--up);
  background: var(--up-bg);
}
.drive-strip.down {
  border-left-color: var(--down);
  background: var(--down-bg);
}
.drive-strip.building {
  border-left-color: var(--amber);
  background: var(--amber-bg);
}
.drive-strip .link-btn,
.link-btn {
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  color: var(--accent);
  text-decoration: underline;
  cursor: pointer;
}
.drive-reads {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 6px 0 4px;
}
.drive-read {
  display: inline-flex;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid var(--line);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--ink-2);
}
.drive-read.is-check {
  border-color: var(--line-strong, var(--ink-2));
  border-width: 2px;
}
.drive-read.building {
  color: var(--amber);
  background: var(--amber-bg);
}
.drive-read.up {
  color: var(--up);
  background: var(--up-bg);
}
.drive-read.down {
  color: var(--down);
  background: var(--down-bg);
}

/* shift quality grades and the day's regime (api/regime.py, 23 Oct 2026) */
.q-chip {
  display: inline-block;
  min-width: 1.35em;
  padding: 0 0.3em;
  margin-right: 0.3em;
  border-radius: 4px;
  font-weight: 700;
  font-size: 0.78em;
  line-height: 1.4;
  text-align: center;
  border: 1px solid currentColor;
}
.q-chip.g-A {
  color: var(--up);
  background: var(--up-bg);
}
.q-chip.g-B {
  color: var(--flat);
  background: var(--flat-bg);
}
.q-chip.g-C {
  color: var(--down);
  background: var(--down-bg);
}
.q-block {
  margin: 0.4rem 0;
  padding: 0.45rem 0.6rem;
  border-left: 3px solid var(--line);
  background: var(--mist);
  border-radius: 4px;
}
.q-block p {
  margin: 0.15rem 0;
}
.q-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 0.8rem;
  font-size: 0.88em;
}
.q-tag.good {
  color: var(--up);
}
.q-tag.bad {
  color: var(--down);
}
.q-rec {
  font-size: 0.82em;
}
.regime-line {
  margin: 0.35rem 0;
  padding: 0.35rem 0.6rem;
  border-left: 3px solid var(--line);
  font-size: 0.92em;
}
.regime-line.up {
  border-left-color: var(--up);
}
.regime-line.down {
  border-left-color: var(--down);
}
.regime-line.side {
  border-left-color: var(--flat);
  background: var(--flat-bg);
}

/* a shift logged by the straddle breakout (lean_log.straddle_break, 7 Nov 2026) and a grade-C no-trade */
.trig-chip {
  display: inline-block;
  margin-right: 0.35em;
  padding: 0 0.55em;
  border-radius: 999px;
  font-size: 0.75em;
  font-weight: 700;
  color: var(--amber);
  background: var(--amber-bg);
  border: 1px solid color-mix(in srgb, var(--amber) 35%, transparent);
  white-space: nowrap;
}
.q-block.q-skip {
  border-left-color: var(--down);
}

/* ---------------------------------------------------------------- BANK NIFTY / SENSEX beta, owner (index-watch.js, 7 Nov 2026) */
.ixw { margin: 4px 0 12px; display: flex; flex-direction: column; gap: 10px; }
.ixw-cells { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.ixw-cell { text-align: left; font: inherit; cursor: pointer; display: flex; flex-direction: column; gap: 3px; padding: 8px 10px; min-height: 44px; border-radius: 12px; background: var(--surface); color: var(--ink); border: 1.5px solid var(--line); }
.ixw-cell[aria-pressed="true"] { border-color: var(--ix); box-shadow: inset 0 -3px 0 var(--ix); }
.ixw-name { display: inline-flex; align-items: center; gap: 6px; font-size: 0.8rem; font-weight: 600; color: var(--ink-2); }
.ixw-name small { font-size: 0.62rem; letter-spacing: 0.06em; color: var(--amber); font-weight: 700; }
.ixw-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ix); display: inline-block; flex: none; }
.ixw-cell b { font-size: 0.95rem; }
.ixw-fine { font-size: 0.78rem; color: var(--muted); margin: 0; }
.ixw-split, .ixw-beta { margin: 0; padding: 8px 12px; border-radius: 10px; background: var(--amber-bg); font-size: 0.85rem; line-height: 1.45; }
.ixw-split b, .ixw-beta b { color: var(--amber); }
.ixw-detail { border-top: 4px solid var(--ix); border-radius: 12px; background: var(--surface); border-left: 1px solid var(--line); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.ixw-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.ixw-chip { padding: 3px 10px; border-radius: 999px; background: var(--ix); color: #fff; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.02em; }
.ixw-level { font-size: 1.5rem; font-weight: 600; }
.ixw-chart { width: 100%; height: 170px; display: block; border-radius: 8px; background: var(--surface-2); }
.ixw-up { fill: var(--up); fill-opacity: 0.12; }
.ixw-dn { fill: var(--down); fill-opacity: 0.12; }
.ixw-table { overflow-x: auto; }
.ixw-table table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.ixw-table th, .ixw-table td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.ixw-table th { font-size: 0.72rem; color: var(--muted); font-weight: 600; }
.ixw .q-chip { display: inline-block; min-width: 1.4em; padding: 0 4px; margin-right: 5px; border-radius: 4px; border: 1px solid currentColor; font-size: 0.7rem; font-weight: 700; text-align: center; }
.ixw .q-chip.g-A { color: var(--up); background: var(--up-bg); }
.ixw .q-chip.g-C { color: var(--down); background: var(--down-bg); }
@media (max-width: 560px) { .ixw-cells { gap: 6px; } .ixw-cell { padding: 6px 8px; } }
.ixw .up { color: var(--up); }
.ixw .down { color: var(--down); }
