/* =====================================================================
   OPIFY Option Scanner — v2.1
   Scoped under .osx (plus a few base-template hooks kept from v1)
===================================================================== */

.container {
  max-width: 1450px;
  margin: auto;
  padding-bottom: 10px;
}
.css-ifkflopfryuie{
  display: none;
}
.osx {
  --brand: #3f51b5;
  --brand-600: #3949a3;
  --brand-50: #eef0fb;
  --ink: #111827;
  --ink-2: #374151;
  --muted: #6b7280;
  --line: #e5e7eb;
  --line-2: #eef0f3;
  --card: #ffffff;
  --up: #15803d;
  --up-bg: #ecfdf3;
  --down: #c62828;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 6px 20px rgba(16, 24, 40, 0.05);
  --osx-sticky-top: 55px;          /* mobile: set to your fixed site-header height */

  --lb: #15803d; --lb-bg: #e3f6ea;
  --sc: #0f766e; --sc-bg: #def5f1;
  --sb: #c62828; --sb-bg: #fde8e8;
  --lu: #c2410c; --lu-bg: #fdeee3;
  --neu: #6b7280; --neu-bg: #f1f2f4;

  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  -webkit-tap-highlight-color: transparent;
}
.osx *, .osx *::before, .osx *::after { box-sizing: border-box; }
.osx button { font-family: inherit; }
.osx [hidden] { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ---------- controls ---------- */
.osx-select, .osx input[type="time"], .osx input[type="date"], .osx input[type="number"], .osx input[type="text"] {
  height: 36px; padding: 0 10px; border: 1px solid #d5d9e0; border-radius: 8px; background: #fff;
  color: var(--ink); font-size: 14px; font-family: inherit; outline: none;
}
.osx-select:focus, .osx input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(63, 81, 181, 0.15); }
.osx-select { cursor: pointer; }

.osx-btn {
  height: 38px; padding: 0 16px; border-radius: 8px; border: 1px solid transparent;
  font-size: 14px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
}
.osx-btn.sm { height: 36px; padding: 0 14px; }
.osx-btn.primary { background: var(--brand); color: #fff; }
.osx-btn.primary:hover { background: var(--brand-600); }
.osx-btn.ghost { background: #fff; color: var(--brand); border-color: #cfd5f2; }
.osx-btn.ghost:hover { background: var(--brand-50); }
.osx-linkbtn { background: none; border: none; color: var(--brand); font-size: 13px; font-weight: 600; cursor: pointer; padding: 4px 6px; }
.osx-iconbtn {
  width: 40px; height: 36px; border-radius: 8px; border: 1px solid #d5d9e0; background: #fff;
  color: var(--brand); font-size: 16px; cursor: pointer; flex: none; display: inline-flex; align-items: center; justify-content: center;
}
.osx-iconbtn.sm { width: 30px; height: 30px; font-size: 13px; }
.osx-iconbtn:hover { background: var(--brand-50); }
[data-action="refresh"].spin i { animation: osx-spin 0.8s linear infinite; }
@keyframes osx-spin { to { transform: rotate(360deg); } }
.osx-x {
  width: 32px; height: 32px; border: none; background: transparent; font-size: 22px; line-height: 1;
  color: var(--muted); cursor: pointer; border-radius: 8px; flex: none;
}
.osx-x.sm { width: 24px; height: 24px; font-size: 16px; }
.osx-x:hover { background: var(--line-2); color: var(--ink); }
.osx-lock { font-size: 10px; margin-left: 6px; opacity: 0.55; }
.osx-muted { color: var(--muted); font-size: 13px; line-height: 1.45; margin: 0; }
.osx-pad { padding: 16px; }
.osx-mini-h { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; margin-right: 4px; }
.osx-inline { display: flex; align-items: center; gap: 8px; }
.osx-mob-only, .osx-mbar { display: none !important; }

.osx-switch { display: inline-flex; align-items: center; gap: 10px; font-size: 13px; color: var(--ink-2); cursor: pointer; position: relative; }
.osx-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.osx-switch-ui { width: 36px; height: 21px; flex: none; border-radius: 99px; background: #cbd0d8; position: relative; transition: background 0.15s; }
.osx-switch-ui::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 17px; height: 17px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2); transition: transform 0.15s;
}
.osx-switch input:checked + .osx-switch-ui { background: var(--brand); }
.osx-switch input:checked + .osx-switch-ui::after { transform: translateX(15px); }
.osx-switch input:focus-visible + .osx-switch-ui { box-shadow: 0 0 0 3px rgba(63, 81, 181, 0.25); }
.osx-autosw-l { display: inline-flex; align-items: baseline; gap: 2px; }
.osx-autosw-l small { margin-left: 6px; font-size: 11px; color: var(--muted); }
.osx-autosw.off-hours .osx-switch-ui { opacity: 0.45; }

/* ---------- toolbar ---------- */
.osx-toolbar { margin-top: 24px; }
.osx-head { display: flex;flex-direction: row-reverse;align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.osx-title { display: flex; align-items: center; gap: 10px; }
.osx-title h2 { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: -0.01em; }
.osx-livebadge {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600;
  padding: 3px 9px; border-radius: 99px; background: var(--line-2); color: var(--muted); white-space: nowrap;
}
.osx-livebadge.live { background: var(--up-bg); color: var(--up); }
.osx-livebadge.live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: osx-pulse 1.6s ease-in-out infinite; }
.osx-livebadge.past { background: #fff6e5; color: #9a5b00; }
@keyframes osx-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

.osx-market { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.osx-market-row { display: flex; gap: 8px; align-items: center; }
.osx-market-line { display: flex; gap: 16px; font-size: 13px; color: var(--muted); flex-wrap: wrap; align-items: center; }
.osx-market-line b { color: var(--ink); font-weight: 600; margin-left: 3px; }

.osx-chips { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; align-items: center; }
.osx-chip {
  height: 36px; padding: 0 14px; border-radius: 99px; border: 1px solid #d5d9e0; background: #fff;
  color: var(--ink-2); font-size: 14px; font-weight: 500; cursor: pointer; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 6px; transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.osx-chip:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); }
.osx-chip.active, .osx-chip.active:hover:not(:disabled) { background: var(--brand); border-color: var(--brand); color: #fff; }
.osx-chip.active .osx-lock { opacity: 0.8; }
.osx-chip:disabled { opacity: 0.45; cursor: not-allowed; }
.osx-chip.sm { height: 30px; padding: 0 11px; font-size: 13px; }
.osx-chip .osx-caret { font-size: 10px; opacity: 0.7; }
.osx-chip.osx-compare.active, .osx-chip.osx-compare.active:hover { background: #1e293b; border-color: #1e293b; color: #fff; }
.osx-chip-sep { width: 1px; height: 22px; background: var(--line); margin: 0 4px; }

/* ---------- panels (inline on desktop) ---------- */
.osx-sheet {
  display: none; margin-top: 12px; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); max-width: 760px;
}
.osx-sheet.open { display: block; animation: osx-drop 0.16s ease-out; }
.osx-sheet[data-panel="window"] { display: none !important; } /* mobile only */
@keyframes osx-drop { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.osx-sheet-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px 12px 18px;
  border-bottom: 1px solid var(--line-2); font-size: 15px;
}
.osx-sheet-body { padding: 16px 18px 18px; display: grid; gap: 16px; }
.osx-timepick { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.osx-timepick label { display: grid; gap: 6px; font-size: 12px; font-weight: 600; color: var(--muted); }
.osx-timepick input[type="time"] { width: 130px; font-size: 15px; }
.osx-timepick input:disabled { background: var(--line-2); color: var(--muted); }
.osx-arrow { color: var(--muted); padding-bottom: 9px; }
.osx-check { display: flex !important; flex-direction: row; align-items: center; gap: 6px; padding-bottom: 9px; color: var(--ink-2) !important; font-size: 14px !important; font-weight: 500 !important; cursor: pointer; }
.osx-check input { width: 16px; height: 16px; accent-color: var(--brand); }
.osx-quick, .osx-savedwrap { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.osx-savedwrap:empty { display: none; }
.osx-saved { display: inline-flex; align-items: center; }
.osx-sheet-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; border-top: 1px solid var(--line-2); padding-top: 14px; }
.osx-saveform { display: flex; gap: 8px; }
.osx-saveform input { width: 160px; }
.osx-tip { font-size: 12px; }

.osx-levelform { display: grid; gap: 6px; }
.osx-levelform label { font-size: 12px; font-weight: 600; color: var(--muted); }
.osx-levelform input { width: 150px; }
.osx-events { display: grid; gap: 6px; }
.osx-ev-item {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; color: var(--ink);
}
.osx-ev-item:hover:not(:disabled) { border-color: var(--brand); background: var(--brand-50); }
.osx-ev-item.active { border-color: var(--brand); box-shadow: inset 3px 0 0 var(--brand); }
.osx-ev-item:disabled { opacity: 0.5; cursor: not-allowed; background: #fafbfc; }
.osx-ev-t { font-weight: 700; font-size: 14px; min-width: 46px; color: var(--brand); }
.osx-ev-b { display: grid; gap: 2px; flex: 1; }
.osx-ev-b b { font-size: 14px; font-weight: 600; }
.osx-ev-b small { font-size: 12px; color: var(--muted); }
.osx-ev-item .fa-chevron-right { color: var(--muted); font-size: 12px; }

/* ---------- context card ---------- */
.osx-context {
  position: relative; margin-top: 16px; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px 16px; overflow: hidden;
}
.osx-progress { position: absolute; left: 0; top: 0; height: 2px; width: 100%; overflow: hidden; opacity: 0; transition: opacity 0.2s; }
.osx-progress::after { content: ""; position: absolute; top: 0; left: -40%; width: 40%; height: 100%; background: var(--brand); animation: osx-bar 1.1s ease-in-out infinite; }
body.osx-is-loading .osx-progress { opacity: 1; }
@keyframes osx-bar { to { left: 100%; } }

.osx-range-main { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 22px; font-weight: 700; letter-spacing: -0.01em; }
.osx-seg { padding: 2px 10px; border-radius: 8px; background: var(--brand-50); color: var(--brand); }
.osx-seg.before { background: #f1f5f9; color: #475569; }
.osx-seg.err { background: #fff6e5; color: #9a5b00; font-size: 15px; font-weight: 600; padding: 8px 12px; }
.osx-vs { font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; }
.osx-range-sub { margin-top: 6px; font-size: 14px; color: var(--ink-2); }
.osx-range-note { margin-top: 2px; font-size: 12px; color: var(--muted); }
.osx-skel {
  display: inline-block; height: 14px; border-radius: 6px; vertical-align: middle;
  background: linear-gradient(90deg, #eef0f3 0%, #f7f8fa 50%, #eef0f3 100%); background-size: 200% 100%;
  animation: osx-shimmer 1.2s linear infinite;
}
.osx-range-main .osx-skel { height: 24px; }
.osx-skel-chart { display: block; width: 100%; height: 100%; border-radius: 10px; }
@keyframes osx-shimmer { to { background-position: -200% 0; } }

/* chart */
.osx-chart { position: relative; margin: 14px 0 6px; user-select: none; -webkit-user-select: none; }
.osx-chart > .osx-skel-chart, .osx-chart-empty { height: 128px; }
.osx-plot { position: relative; height: 128px; cursor: crosshair; touch-action: pan-y; }
.osx-chart-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.osx-chart-svg path, .osx-chart-svg line { vector-effect: non-scaling-stroke; }
.osx-line { fill: none; stroke: var(--brand); stroke-width: 1.8; stroke-linejoin: round; }
.osx-area { fill: rgba(63, 81, 181, 0.07); stroke: none; }
.osx-level { stroke: #9a5b00; stroke-width: 1; stroke-dasharray: 2 3; }
.osx-brush {
  position: absolute; top: 0; bottom: 0; background: rgba(63, 81, 181, 0.13);
  border-left: 1.5px dashed var(--brand); pointer-events: none;
}
.osx-brush.before { background: rgba(100, 116, 139, 0.13); border-left: 1px dashed #94a3b8; }
.osx-brush .osx-h { display: none; }
.osx-brush.editable { border-right: 1.5px solid rgba(63, 81, 181, 0.35); }
.osx-brush.editable .osx-h {
  display: block; position: absolute; top: 50%; width: 8px; height: 28px; margin-top: -14px; border-radius: 4px;
  background: #fff; border: 1.5px solid var(--brand); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}
.osx-brush .osx-h.l { left: -5px; }
.osx-brush .osx-h.r { right: -5px; }
body.osx-dragging .osx-brush.main { background: rgba(63, 81, 181, 0.2); }
body.osx-dragging { cursor: grabbing; }
.osx-dotm { position: absolute; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%; border: 1.5px solid #fff; pointer-events: none; }
.osx-dotm.high { background: var(--up); }
.osx-dotm.low { background: var(--down); }
.osx-cross { position: absolute; top: 0; bottom: 0; width: 1px; background: #94a3b8; pointer-events: none; }
.osx-chart-hi, .osx-chart-lo { position: absolute; right: 0; font-size: 11px; color: var(--muted); background: rgba(255, 255, 255, 0.85); padding: 0 4px; border-radius: 4px; pointer-events: none; }
.osx-chart-hi { top: 0; }
.osx-chart-lo { bottom: 0; }
.osx-chart-last { position: absolute; width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 4px rgba(63, 81, 181, 0.18); pointer-events: none; }
.osx-chart-axis { position: relative; height: 18px; margin-top: 4px; font-size: 11px; color: var(--muted); }
.osx-chart-axis span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.osx-chart-axis span:first-child { transform: none; }
.osx-chart-axis span:last-child { transform: translateX(-100%); }
.osx-chart-tip {
  position: absolute; top: -6px; transform: translate(-50%, -100%); background: #111827; color: #fff;
  font-size: 12px; padding: 6px 9px; border-radius: 8px; pointer-events: none; white-space: nowrap; z-index: 3;
  display: grid; gap: 1px; text-align: center;
}
.osx-chart-tip small { opacity: 0.7; font-size: 11px; }
.osx-chart-act {
  position: absolute; bottom: 8px; transform: translateX(-50%); z-index: 3; height: 34px; padding: 0 14px;
  border-radius: 99px; border: none; background: var(--brand); color: #fff; font-size: 13px; font-weight: 600;
  box-shadow: 0 4px 14px rgba(63, 81, 181, 0.35); white-space: nowrap;
}
.osx-chart-hint { margin-top: 2px; font-size: 11px; color: var(--muted); }
.osx-chart-empty { display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 13px; background: #fafbfc; border-radius: 8px; }

/* stats */
.osx-stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
.osx-stats:empty, .osx-actbar:empty { display: none; }
.osx-stat { background: #f8f9fc; border: 1px solid var(--line-2); border-radius: 10px; padding: 10px 12px; display: grid; gap: 4px; min-width: 0; }
.osx-stat-l { font-size: 12px; color: var(--muted); font-weight: 500; }
.osx-stat-v { font-size: 17px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.osx-stat-c { font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* activity bar */
.osx-actbar { margin-top: 14px; }
.osx-actbar-track { display: flex; height: 6px; border-radius: 99px; overflow: hidden; background: var(--line-2); gap: 2px; }
.osx-actbar-seg { height: 100%; }
.osx-actbar-seg.a-lb { background: var(--lb); }
.osx-actbar-seg.a-sc { background: var(--sc); }
.osx-actbar-seg.a-sb { background: var(--sb); }
.osx-actbar-seg.a-lu { background: var(--lu); }
.osx-actbar-seg.a-neu { background: #cbd0d8; }
.osx-actbar-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; align-items: center; }
.osx-actchip {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; font-size: 13px;
  border-radius: 99px; border: 1px solid var(--line); background: #fff; color: var(--ink-2); cursor: pointer; white-space: nowrap;
}
.osx-actchip b { font-weight: 700; color: var(--ink); }
.osx-actchip .osx-dot { width: 8px; height: 8px; border-radius: 50%; }
.osx-actchip.a-lb .osx-dot { background: var(--lb); }
.osx-actchip.a-sc .osx-dot { background: var(--sc); }
.osx-actchip.a-sb .osx-dot { background: var(--sb); }
.osx-actchip.a-lu .osx-dot { background: var(--lu); }
.osx-actchip.a-neu .osx-dot { background: #aab1bc; }
.osx-actchip:hover { border-color: #b8c0cc; }
.osx-actchip.active { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }

/* tones */
.osx .up { color: var(--up); }
.osx .down { color: var(--down); }
.osx .flat { color: var(--ink-2); }

/* ---------- results ---------- */
.osx-results { margin-top: 16px; }
.osx-settings-body { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.osx-field { display: flex; align-items: center; gap: 8px; }
.osx-field-l { font-size: 13px; color: var(--muted); font-weight: 500; }
.osx-push { margin-left: auto; }
#osxSortField { display: none; }
.osx-seg-group, .osx-viewseg { display: inline-flex; border: 1px solid #d5d9e0; border-radius: 8px; overflow: hidden; background: #fff; }
.osx-seg-group button, .osx-viewseg button {
  height: 34px; padding: 0 14px; border: none; background: none; font-size: 13px; font-weight: 500;
  color: var(--ink-2); cursor: pointer; border-left: 1px solid #e3e6eb; display: inline-flex; align-items: center;
}
.osx-seg-group button:first-child, .osx-viewseg button:first-child { border-left: none; }
.osx-seg-group button:hover:not(.active) { background: var(--brand-50); }
.osx-seg-group button.active, .osx-viewseg button.active { background: var(--brand); color: #fff; }
.osx-onlyshift.active, .osx-onlyshift.active:hover { background: #1e293b; color: #fff; border-color: #1e293b; }

.osx-results-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 14px 2px 8px; flex-wrap: wrap; position: relative; }
.osx-count { font-size: 13px; color: var(--muted); font-weight: 500; }
.osx-legend summary { cursor: pointer; font-size: 13px; color: var(--brand); font-weight: 600; list-style: none; display: inline-flex; align-items: center; }
.osx-legend summary::-webkit-details-marker { display: none; }
.osx-legend-body {
  position: absolute; right: 0; z-index: 20; margin-top: 8px; padding: 12px 14px; background: var(--card); border: 1px solid var(--line);
  border-radius: 10px; font-size: 13px; color: var(--ink-2); width: min(480px, calc(100vw - 32px)); box-shadow: 0 10px 30px rgba(16, 24, 40, 0.12);
}
.osx-legend-body p { margin: 0 0 8px; line-height: 1.5; }
.osx-legend-body ul { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 6px; }
.osx-legend-body li { display: flex; align-items: center; gap: 8px; }
.osx-legend-body .osx-pill { min-width: 150px; }

/* table */
.osx-tablewrap {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  overflow: auto; max-height: 65vh; transition: opacity 0.2s;
}
body.osx-is-loading .osx-tablewrap, body.osx-is-loading .osx-cards { opacity: 0.6; }
.osx-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.osx-table th {
  position: sticky; top: 0; z-index: 1; background: #f8f9fc; text-align: left; font-size: 12px; font-weight: 600;
  color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap;
  text-transform: uppercase; letter-spacing: 0.03em; font-family: inherit;
}
.osx-table th small { display: block; font-size: 11px; font-weight: 500; text-transform: none; letter-spacing: 0; color: #9aa1ad; }
.osx-table th.num, .osx-table td.num { text-align: right; }
.osx-table th.sortable { cursor: pointer; }
.osx-table th.sortable span { display: inline-block; }
.osx-table th.sortable i { margin-left: 5px; font-size: 11px; opacity: 0.35; }
.osx-table th.sorted { color: var(--brand); }
.osx-table th.sorted i { opacity: 1; }
.osx-table th.sortable:hover { color: var(--ink); }
.osx-table th.col-before, .osx-table td.col-before { background: #fafbfc; }
.osx-table td {
  padding: 10px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; text-align: left;
  font-family: inherit; border-left: none; border-right: none; border-top: none;
}
.osx-table tbody tr:last-child td { border-bottom: none; }
.osx-table tbody tr:hover td { background: #f9faff; }
.osx-table tr.is-atm td { background: #f5f7ff; }
.osx-table tr.is-atm td:first-child { box-shadow: inset 3px 0 0 var(--brand); }
.osx-table tr.is-shift td:first-child { box-shadow: inset 3px 0 0 #1e293b; }
.osx-table tr.osx-skel-row td { padding: 16px 12px; }
.osx-table td.num b { display: block; font-weight: 600; }
.osx-table td.num small { display: block; font-size: 12px; color: var(--muted); margin-top: 1px; }
.osx-td-strike small { font-size: 12px; color: var(--muted); }
.osx-strike { display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: 15px; }
.osx-side { font-size: 11px; font-weight: 700; padding: 2px 6px; border-radius: 5px; letter-spacing: 0.02em; }
.osx-side.ce { background: #e8f0fe; color: #1d4ed8; }
.osx-side.pe { background: #fdf0e6; color: #b45309; }
.osx-tag { font-size: 10px; font-weight: 700; padding: 2px 5px; border-radius: 4px; background: var(--line-2); color: var(--muted); letter-spacing: 0.03em; }
.osx-tag.atm { background: var(--brand); color: #fff; }
.osx-td-sum { color: var(--ink-2); font-size: 13px; line-height: 1.4; min-width: 200px; max-width: 280px; }

.osx-pill { display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 6px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.osx-pill.a-lb, .osx-ab.a-lb { background: var(--lb-bg); color: var(--lb); }
.osx-pill.a-sc, .osx-ab.a-sc { background: var(--sc-bg); color: var(--sc); }
.osx-pill.a-sb, .osx-ab.a-sb { background: var(--sb-bg); color: var(--sb); }
.osx-pill.a-lu, .osx-ab.a-lu { background: var(--lu-bg); color: var(--lu); }
.osx-pill.a-neu, .osx-pill.a-na, .osx-ab.a-neu, .osx-ab.a-na { background: var(--neu-bg); color: var(--neu); }
.osx-pill.muted { opacity: 0.6; }
.osx-ab { display: inline-flex; align-items: center; height: 18px; padding: 0 5px; border-radius: 4px; font-size: 10px; font-weight: 800; letter-spacing: 0.02em; }
.osx-shift { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.osx-shift > i { font-size: 11px; color: var(--muted); }
.osx-shift-badge { font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 99px; background: #1e293b; color: #fff; white-space: nowrap; }

.osx-analytics {
  width: 34px; height: 34px; border-radius: 8px; border: 1px solid transparent; background: transparent;
  color: var(--brand); font-size: 16px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.osx-analytics:hover { background: var(--brand-50); border-color: #cfd5f2; }
.osx-analytics.wide { width: 100%; height: 46px; background: var(--brand); color: #fff; font-size: 15px; font-weight: 600; border-radius: 12px; }
.osx-analytics.wide:hover { background: var(--brand-600); }

.osx-empty {
  display: flex; align-items: center; gap: 14px; padding: 28px; margin-top: 12px; background: var(--card);
  border: 1px dashed #d5d9e0; border-radius: var(--radius); color: var(--ink-2);
}
.osx-empty > i { font-size: 26px; color: #9aa1ad; }
.osx-empty div { display: grid; gap: 4px; }
.osx-empty span { font-size: 13px; color: var(--muted); }

.osx-cards { display: none; }

.osx-disclaimer { margin: 16px 2px 0; font-size: 12px; line-height: 1.55; color: var(--muted); display: flex; gap: 8px; }
.osx-disclaimer i { margin-top: 3px; }

/* ---------- detail sheet (desktop: centered dialog) ---------- */
.osx-detail.open {
  position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 1000001; width: min(440px, calc(100vw - 32px));
  margin: 0; max-height: 86vh; overflow: auto; animation: none;
}
.osx-dt-title { display: flex; align-items: center; gap: 6px; font-size: 18px; }
.osx-dt-top { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.osx-dt-top > div { display: grid; gap: 2px; }
.osx-dt-top small { font-size: 11px; color: var(--muted); }
.osx-dt-top b { font-size: 16px; }
.osx-dt-act { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.osx-dt-act > i { color: var(--muted); font-size: 11px; }
.osx-dt-sum { margin: 0; font-size: 14px; color: var(--ink-2); }
.osx-dt-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.osx-dt-grid > div { background: #f8f9fc; border-radius: 10px; padding: 10px 12px; display: grid; gap: 2px; }
.osx-dt-grid span { font-size: 12px; color: var(--muted); }
.osx-dt-grid b { font-size: 18px; font-weight: 700; }
.osx-dt-grid small { font-size: 12px; color: var(--muted); }
.osx-dt-cmp { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; font-size: 14px; }
.osx-dt-cmp > div { display: grid; grid-template-columns: 64px 1fr 1fr; padding: 8px 12px; border-top: 1px solid var(--line-2); align-items: center; }
.osx-dt-cmp > div:first-child { border-top: none; background: #f8f9fc; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.osx-dt-cmp small { display: block; font-weight: 500; color: var(--muted); font-size: 11px; }
.osx-dt-cmp span:first-child { color: var(--muted); font-size: 12px; }

/* ---------- FAQ ---------- */
.osx-faq { margin: 44px auto 0; max-width: 920px; display: grid; gap: 10px; }
.osx-faq h3 { text-align: center; font-size: 20px; margin: 0 0 8px; }
.osx-faq details { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 0 18px; }
.osx-faq summary { cursor: pointer; list-style: none; padding: 16px 0; font-weight: 600; font-size: 15px; display: flex; justify-content: space-between; gap: 12px; }
.osx-faq summary::-webkit-details-marker { display: none; }
.osx-faq summary::after { content: "+"; font-size: 20px; line-height: 1; color: var(--muted); }
.osx-faq details[open] summary::after { content: "−"; }
.osx-faq details p { margin: 0 0 16px; font-size: 14px; line-height: 1.6; color: var(--ink-2); }

/* ---------- toast / backdrop ---------- */
.osx-toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); background: #111827; color: #fff;
  font-size: 14px; padding: 10px 16px; border-radius: 10px; opacity: 0; pointer-events: none; z-index: 1000002;
  transition: opacity 0.2s, transform 0.2s; max-width: calc(100% - 32px); text-align: center;
}
.osx-toast.show { opacity: 1; transform: translate(-50%, 0); }
.osx-toast.warn { background: #9a5b00; }
.osx-backdrop { display: none; }
body.osx-sheet-open .osx-backdrop { display: block; position: fixed; inset: 0; background: rgba(15, 23, 42, 0.45); z-index: 1000000; }

.osx button:focus-visible, .osx summary:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* =====================================================================
   TABLET
===================================================================== */
@media (max-width: 1100px) {
  .osx-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .osx-td-sum { display: none; }
}

/* =====================================================================
   MOBILE — app-like layout
===================================================================== */
@media (max-width: 760px) {
  .osx-mob-only { display: flex !important; }
  .osx-desk-only, .osx-title, .osx-chips { display: none !important; }

  .css-fifkflfpoEE { margin: 8px; }
  .css-fifkflfpoEE h1 {
    position: fixed; top: -20px; margin: 0 !important; z-index: 100000; left: 150px; font-size: 17px;
    transition: transform 0.5s ease, opacity 0.5s ease; transform: translateY(0%); opacity: 0;
  }
  .css-fifkflfpoEE h1.active { transform: translateY(200%); opacity: 1; }

  .osx { padding-bottom: 0px; }
  .osx-toolbar { margin-top: 0; }

  /* sticky window bar */
  .osx-mbar {
    display: flex !important; gap: 8px; align-items: stretch; position: sticky; top: var(--osx-sticky-top); z-index: 90;
    margin: 0 -8px; padding: 10px 8px; background: rgba(246, 247, 251, 0.92);
    backdrop-filter: saturate(180%) blur(12px); -webkit-backdrop-filter: saturate(180%) blur(12px);
    padding-bottom: 0;
  }
  .osx-winbtn {
    flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 12px;
    border-radius: 14px; border: 1px solid var(--line); background: #fff; text-align: left; cursor: pointer;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05); color: var(--ink);
  }
  .osx-winbtn:active { background: #f4f5f8; }
  .osx-winbtn-ic { width: 32px; height: 32px; border-radius: 10px; background: var(--brand-50); color: var(--brand); display: grid; place-items: center; flex: none; }
  .osx-winbtn-b { display: grid; min-width: 0; flex: 1; }
  .osx-winbtn-b b { font-size: 15px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .osx-winbtn-b small { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .osx-winbtn-caret { font-size: 12px; color: var(--muted); }
  .osx-mbtn {
    height: 52px; min-width: 52px; padding: 0 10px; border-radius: 14px; border: 1px solid var(--line); background: #fff;
    color: var(--ink-2); display: grid; place-items: center; gap: 0; font-size: 16px; cursor: pointer; flex: none;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
  }
  .osx-mbtn span { font-size: 10px; font-weight: 600; margin-top: -6px; }
  .osx-mbtn.icon { width: 52px; }
  .osx-mbtn.active { background: #1e293b; border-color: #1e293b; color: #fff; }
  .osx-mbtn:active, .osx-winbtn:active { transform: scale(0.98); }

  /* bottom bar: index / expiry / filters */
  .osx-market {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 100; background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    padding: 10px 12px calc(8px + env(safe-area-inset-bottom)); gap: 6px; flex-direction: column; align-items: stretch;
    box-shadow: 0 -1px 0 var(--line), 0 -6px 16px rgba(16, 24, 40, 0.06);
  }
  .osx-market-row .osx-select { flex: 1; min-width: 0; height: 40px; text-align: center; font-weight: 600; border-radius: 10px; }
  .osx-market-row .osx-iconbtn { height: 40px; width: 44px; border-radius: 10px; }
  .osx-market-line { justify-content: center; font-size: 12px; gap: 14px; }

  /* sheets */
  .osx-panel { display: none; }
  .osx-sheet, .osx-sheet[data-panel="window"], .osx-settings, .osx-detail.open {
    position: fixed; left: 0; right: 0; bottom: 0; top: auto; transform: none; width: auto; margin: 0; max-width: none; z-index: 1000001;
    border-radius: 18px 18px 0 0; max-height: 88vh; overflow-y: auto; background: #fff; border: none;
    padding-bottom: env(safe-area-inset-bottom); box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.18); overscroll-behavior: contain;
  }
  .osx-panel.open, .osx-sheet[data-panel="window"].open { display: block !important; animation: osx-up 0.22s cubic-bezier(0.2, 0.9, 0.3, 1); }
  @keyframes osx-up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
  .osx-sheet-head { position: sticky; top: 0; background: #fff; z-index: 1; padding: 18px 12px 12px 18px; font-size: 16px; }
  .osx-sheet-head::before {
    content: ""; position: absolute; left: 50%; top: 6px; width: 36px; height: 4px; border-radius: 99px; background: #d5d9e0; transform: translateX(-50%);
  }
  .osx-sheet-body { padding: 14px 16px 22px; }
  body.osx-sheet-open { overflow: hidden; }

  /* window sheet */
  .osx-wq { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
  .osx-wq-btn {
    height: 48px; border-radius: 12px; border: 1px solid var(--line); background: #fff; font-size: 15px; font-weight: 600;
    color: var(--ink); cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  }
  .osx-wq-btn.active { background: var(--brand); border-color: var(--brand); color: #fff; }
  .osx-list { display: grid; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
  .osx-list-item {
    display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: #fff; border: none;
    border-top: 1px solid var(--line-2); text-align: left; cursor: pointer; width: 100%; color: var(--ink);
  }
  .osx-list .osx-list-item:first-child { border-top: none; }
  .osx-list-item:disabled { opacity: 0.45; }
  .osx-list-item.active .osx-li-b b { color: var(--brand); }
  .osx-li-ic { width: 34px; height: 34px; border-radius: 10px; background: var(--line-2); color: var(--ink-2); display: grid; place-items: center; flex: none; }
  .osx-list-item.active .osx-li-ic { background: var(--brand-50); color: var(--brand); }
  .osx-li-b { display: grid; gap: 1px; flex: 1; min-width: 0; }
  .osx-li-b b { font-size: 15px; font-weight: 600; }
  .osx-li-b small { font-size: 12px; color: var(--muted); }
  .osx-li-end { color: var(--muted); font-size: 13px; }
  .osx-list-item.active .osx-li-end { color: var(--brand); }
  .osx-li-toggle { border: 1px solid var(--line); border-radius: 14px; }

  /* settings sheet */
  .osx-settings-body { flex-direction: column; align-items: stretch; gap: 0; padding: 4px 16px 22px; }
  .osx-settings-body > * { padding: 14px 0; border-top: 1px solid var(--line-2); }
  .osx-settings-body > *:first-child { border-top: none; }
  .osx-field { justify-content: space-between; }
  .osx-field-l { font-size: 15px; color: var(--ink); }
  #osxSortField { display: flex; }
  .osx-push { margin-left: 0; }
  .osx-settings .osx-select { min-width: 170px; height: 40px; }
  .osx-autosw { justify-content: space-between; font-size: 15px; color: var(--ink); }

  .osx-timepick { display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; }
  .osx-timepick input[type="time"] { width: 100%; height: 44px; font-size: 16px; }
  .osx-timepick .osx-check { grid-column: 1 / -1; padding-bottom: 0; }
  .osx-sheet-actions { flex-direction: column-reverse; align-items: stretch; }
  .osx-sheet-actions .osx-btn.primary { justify-content: center; height: 48px; font-size: 16px; border-radius: 12px; }
  .osx-saveform input { flex: 1; width: auto; height: 40px; }
  .osx-levelform input { height: 44px; font-size: 16px; flex: 1; }
  .osx-ev-item { padding: 12px; }

  /* context card — compact */
  .osx-context { margin-top: 48px; padding: 12px 12px 10px; border-radius: 16px; }
  .osx-range-main { font-size: 17px; gap: 6px; }
  .osx-seg { padding: 1px 8px; }
  .osx-range-sub { font-size: 12px; margin-top: 4px; }
  .osx-range-note { display: none; }
  .osx-chart { margin: 10px 0 2px; }
  .osx-plot, .osx-chart > .osx-skel-chart, .osx-chart-empty { height: 104px; }
  .osx-chart-hint { font-size: 11px; }
  .osx-stats { display: flex; overflow-x: auto; scrollbar-width: none; gap: 8px; margin: 8px -12px 0; padding: 0 12px 2px; scroll-snap-type: x mandatory; }
  .osx-stats::-webkit-scrollbar { display: none; }
  .osx-stat { flex: 0 0 auto; min-width: 124px; padding: 8px 10px; scroll-snap-align: start; }
  .osx-stat-v { font-size: 15px; }
  .osx-actbar-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 8px -12px 0; padding: 0 12px 2px; }
  .osx-actbar-chips::-webkit-scrollbar { display: none; }
  .osx-actchip { flex: none; height: 32px; }

  /* results */
  .osx-results { margin-top: 12px; }
  .osx-results-head { margin: 0 0 8px; gap: 8px; flex-wrap: nowrap; }
  .osx-viewseg { border-radius: 10px; flex: none; }
  .osx-viewseg button { height: 34px; padding: 0 12px; font-weight: 600; white-space: nowrap; }
  .osx-results-head .osx-onlyshift { white-space: nowrap; }
  #osxMCount { margin-left: auto; white-space: nowrap; }
  .osx-legend summary { width: 34px; height: 34px; justify-content: center; font-size: 16px; }
  .osx-tablewrap { display: none; }
  .osx-cards { display: block; background: #fff; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }

  /* chain ladder */
  .osx-lad-head, .osx-lad-row { display: grid; grid-template-columns: 1fr 76px 1fr; align-items: stretch; }
  .osx-lad-head { background: #f8f9fc; border-bottom: 1px solid var(--line); font-size: 11px; font-weight: 700; color: var(--muted); letter-spacing: 0.04em; }
  .osx-lad-head span { padding: 8px 10px; display: grid; }
  .osx-lad-head span:first-child { text-align: right; }
  .osx-lad-head span:nth-child(2) { text-align: center; align-content: center; }
  .osx-lad-head small { font-weight: 500; letter-spacing: 0; font-size: 10px; }
  .osx-lad-row { border-top: 1px solid var(--line-2); }
  .osx-lad-row:nth-child(2) { border-top: none; }
  .osx-lad-row.is-atm { background: #f5f7ff; }
  .osx-lad-strike { display: grid; place-content: center; justify-items: center; gap: 2px; font-size: 14px; background: #fafbfc; border-left: 1px solid var(--line-2); border-right: 1px solid var(--line-2); }
  .osx-lad-row.is-atm .osx-lad-strike { background: var(--brand-50); }
  .osx-lad-strike .osx-tag { font-size: 9px; padding: 1px 4px; }
  .osx-lad-cell {
    position: relative; display: grid; gap: 2px; padding: 9px 10px; min-height: 58px; align-content: center; border: none;
    background: transparent; text-align: right; cursor: pointer; color: var(--ink); font-size: 13px; width: 100%;
  }
  .osx-lad-row > .osx-lad-cell:last-child { text-align: left; }
  .osx-lad-cell:active { background: #eef0f6; }
  .osx-lad-cell.empty { color: var(--muted); cursor: default; }
  .osx-lad-top { display: flex; align-items: center; gap: 6px; justify-content: flex-end; }
  .osx-lad-row > .osx-lad-cell:last-child .osx-lad-top { justify-content: flex-start; flex-direction: row-reverse; }
  .osx-lad-top b { font-size: 16px; font-weight: 700; }
  .osx-lad-cell small { font-size: 12px; font-weight: 600; }
  .osx-lad-cell::after { content: ""; position: absolute; top: 8px; bottom: 8px; width: 3px; border-radius: 3px; }
  .osx-lad-row > .osx-lad-cell:first-child::after { left: 0; }
  .osx-lad-row > .osx-lad-cell:last-child::after { right: 0; }
  .osx-lad-cell.a-lb::after { background: var(--lb); }
  .osx-lad-cell.a-sc::after { background: var(--sc); }
  .osx-lad-cell.a-sb::after { background: var(--sb); }
  .osx-lad-cell.a-lu::after { background: var(--lu); }
  .osx-lad-cell.dim { opacity: 0.25; }
  .osx-lad-shift { position: absolute; top: 6px; width: 6px; height: 6px; border-radius: 50%; background: #1e293b; }
  .osx-lad-row > .osx-lad-cell:first-child .osx-lad-shift { left: 8px; }
  .osx-lad-row > .osx-lad-cell:last-child .osx-lad-shift { right: 8px; }
  .osx-skel-row .osx-lad-cell { align-content: center; justify-items: end; }
  .osx-skel-row .osx-lad-cell:last-child { justify-items: start; }

  /* top movers */
  .osx-mv-row {
    display: grid; grid-template-columns: auto 1fr auto 12px; align-items: center; gap: 10px; width: 100%;
    padding: 12px 12px; border: none; border-top: 1px solid var(--line-2); background: #fff; text-align: left; cursor: pointer; color: var(--ink);
  }
  .osx-mv-row:first-child { border-top: none; }
  .osx-mv-row:active { background: #f4f5f8; }
  .osx-mv-row.is-shift { box-shadow: inset 3px 0 0 #1e293b; }
  .osx-mv-name { display: flex; align-items: center; gap: 5px; font-size: 15px; }
  .osx-mv-act { display: flex; align-items: center; gap: 4px; justify-content: flex-start; min-width: 0; overflow: hidden; }
  .osx-mv-act > i { font-size: 9px; color: var(--muted); }
  .osx-mv-act .osx-pill { height: 22px; padding: 0 7px; font-size: 11px; min-width: 0; overflow: hidden; text-overflow: ellipsis; display: block; line-height: 22px; }
  .osx-mv-num { display: grid; text-align: right; }
  .osx-mv-num b { font-size: 15px; }
  .osx-mv-num small { font-size: 12px; font-weight: 600; }
  .osx-mv-chev { font-size: 11px; color: #b8bec8; }

  .osx-detail .osx-sheet-body { gap: 14px; }

  .osx-empty { padding: 20px; }
  .osx-disclaimer { margin-top: 22x; }
  .osx-faq { margin-top: 28px; }
  .osx-faq summary { font-size: 14px; }
  .osx-toast { bottom: 118px; }
}

@media (max-width: 370px) {
  .osx-mv-act .osx-pill { display: none; }
  .osx-lad-head, .osx-lad-row { grid-template-columns: 1fr 66px 1fr; }
  .osx-mbtn span { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .osx *, .osx *::before, .osx *::after { animation: none !important; transition: none !important; }
}

/* ---------- v2.4: analytics links, refresh cooldown, analytics hand-off tab ---------- */
a.osx-analytics { text-decoration: none; }
a.osx-analytics.wide { color: #fff; }
.osx-analytics .osx-ext { font-size: 12px; opacity: 0.8; }

[data-action="refresh"] { position: relative; }
[data-action="refresh"].cooldown { color: var(--muted); cursor: default; }
[data-action="refresh"].cooldown::after {
  content: ""; position: absolute; inset: 3px; border-radius: 50%; pointer-events: none;
  background: conic-gradient(var(--brand) var(--osx-cd, 0deg), transparent 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 2px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 2px));
  opacity: 0.55;
}

.osx.osx-handoff > *:not(.osx-legacy) { visibility: hidden; }
.osx-handoff-msg {
  position: fixed; inset: 0; z-index: 1000003; display: flex; flex-direction: column; gap: 14px;
  align-items: center; justify-content: center; background: #f6f7fb; color: #111827;
  font: 600 16px system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; text-align: center; padding: 24px;
}
.osx-handoff-msg a { color: #3f51b5; font-weight: 600; }

/* ---------- v2.5: data-unavailable banner ---------- */
.osx-apibanner {
  display: flex; gap: 12px; align-items: flex-start; margin: 16px 0 0; padding: 14px 16px;
  background: #fff6e5; border: 1px solid #f3d29a; border-radius: 12px; color: #6b4200; font-size: 14px; line-height: 1.5;
}
.osx-apibanner > i { margin-top: 3px; color: #b45309; }
.osx-apibanner div { display: grid; gap: 2px; }
.osx-apibanner span { font-size: 13px; }
@media (max-width: 760px) { .osx-apibanner { margin: 8px 0 4px; } }

/* ---------- refresh off outside market hours / past sessions ---------- */
[data-action="refresh"].off { opacity: 0.4; cursor: not-allowed; }
[data-action="refresh"].off::after { display: none; }
.osx-switch input:disabled + .osx-switch-ui { opacity: 0.4; cursor: not-allowed; }

/* ---------- session calendar ---------- */
.osx-datepick { position: relative; }
.osx-datebtn { display: inline-flex; align-items: center; gap: 8px; min-width: 150px; font-weight: 500; }
.osx-datebtn .osx-caret { font-size: 10px; opacity: 0.6; margin-left: auto; }
.osx-cal {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 50; width: 288px; padding: 12px;
  background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgba(16, 24, 40, 0.16);
}
.osx-cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; font-size: 14px; }
.osx-cal-head .osx-x:disabled { opacity: 0.25; cursor: default; }
.osx-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.osx-cal-wd { font-size: 11px; color: var(--muted); text-align: center; padding: 2px 0 4px; font-weight: 600; }
.osx-cal-day {
  height: 34px; border: none; border-radius: 8px; background: var(--brand-50); color: var(--brand);
  font-size: 13px; font-weight: 700; cursor: pointer; position: relative;
}
.osx-cal-day:hover:not(:disabled) { background: #dfe3f7; }
.osx-cal-day.off { background: transparent; color: #c3c8d1; font-weight: 400; cursor: not-allowed; }
.osx-cal-day.sel { background: var(--brand); color: #fff; }
.osx-cal-day.latest::after {
  content: ""; position: absolute; left: 50%; bottom: 4px; width: 4px; height: 4px; margin-left: -2px;
  border-radius: 50%; background: currentColor;
}
.osx-cal-foot { margin-top: 8px; font-size: 11px; color: var(--muted); text-align: center; }

@media (max-width: 760px) {
  .osx-datebtn { min-width: 170px; height: 40px; }
  .osx-push .osx-inline { flex-direction: column; align-items: flex-end; }
  .osx-cal { position: static; width: 100%; max-width: 340px; margin-top: 8px; box-shadow: none; }
  .osx-cal-day { height: 40px; font-size: 14px; }
}

/* ---------- first-visit tour (mobile) ---------- */
.osx-tourbtn { color: var(--brand); }
.osx-tour {
  position: fixed; inset: 0; z-index: 1000004; display: flex; align-items: flex-end; justify-content: center;
  background: rgba(15, 23, 42, 0.55); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px);
  animation: osx-fade 0.2s ease-out;
}
.osx-tour[hidden] { display: none; }
@keyframes osx-fade { from { opacity: 0; } to { opacity: 1; } }
body.osx-tour-open { overflow: hidden; }
.osx-tour-card {
  width: 100%; max-width: 440px; background: #fff; border-radius: 20px 20px 0 0; padding: 14px 16px calc(16px + env(safe-area-inset-bottom));
  display: grid; gap: 12px; box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.25); animation: osx-up 0.25s cubic-bezier(0.2, 0.9, 0.3, 1);
}
.osx-tour-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.osx-tour-head b { display: block; font-size: 17px; }
.osx-tour-head small { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.osx-tour-video {
  position: relative; margin: 0 auto; height: min(62vh, 560px); aspect-ratio: 780 / 1688;
  border-radius: 18px; overflow: hidden; background: #f6f7fb; box-shadow: 0 0 0 6px #111827, 0 12px 30px rgba(0, 0, 0, 0.2);
}
.osx-tour-video video { width: 100%; height: 100%; object-fit: cover; display: block; }
.osx-tour-play {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: inline-flex; align-items: center; gap: 8px;
  height: 46px; padding: 0 20px; border: none; border-radius: 99px; background: var(--brand); color: #fff;
  font-size: 15px; font-weight: 600; box-shadow: 0 8px 24px rgba(63, 81, 181, 0.45); cursor: pointer;
}
.osx-tour-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(17, 24, 39, 0.12); }
.osx-tour-progress span { display: block; height: 100%; width: 0; background: var(--brand); transition: width 0.25s linear; }
.osx-tour-actions { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; }
.osx-tour-actions .osx-btn { justify-content: center; height: 46px; border-radius: 12px; font-size: 15px; }
@media (min-width: 761px) {
  .osx-tour { align-items: center; }
  .osx-tour-card { border-radius: 20px; padding-bottom: 16px; }
}
.osx-li-tour { border: 1px solid var(--line); border-radius: 14px; }
.osx-li-tour .osx-li-ic { background: var(--brand-50); color: var(--brand); }
.osx-tourlink { padding: 4px 0; display: inline-flex; gap: 6px; align-items: center; }
@media (max-width: 760px) {
  .osx-results-head { flex-wrap: wrap; row-gap: 6px; }
}

/* ---------- desktop tour (widescreen video, centred dialog) ---------- */
.osx-tourchip { height: 30px; }
.osx-tour[data-variant="desktop"] { align-items: center; padding: 24px; }
.osx-tour[data-variant="desktop"] .osx-tour-card {
  max-width: min(980px, 100%); border-radius: 20px; padding: 18px 20px 20px; gap: 14px;
  animation: osx-pop 0.22s cubic-bezier(0.2, 0.9, 0.3, 1);
}
@keyframes osx-pop { from { transform: scale(0.97); opacity: 0; } to { transform: none; opacity: 1; } }
.osx-tour[data-variant="desktop"] .osx-tour-video {
  width: 100%; height: auto; max-height: calc(100vh - 220px); aspect-ratio: 1920 / 1140;
  border-radius: 12px; box-shadow: 0 0 0 1px var(--line), 0 16px 40px rgba(16, 24, 40, 0.18);
  padding-top: 22px; background: #eef0f3;
}
.osx-tour[data-variant="desktop"] .osx-tour-video::before {
  content: ""; position: absolute; top: 7px; left: 12px; width: 44px; height: 8px; z-index: 1;
  background: radial-gradient(circle at 4px 4px, #f87171 3.5px, transparent 4px),
              radial-gradient(circle at 20px 4px, #fbbf24 3.5px, transparent 4px),
              radial-gradient(circle at 36px 4px, #34d399 3.5px, transparent 4px);
}
.osx-tour[data-variant="desktop"] .osx-tour-video video { object-fit: contain; background: #f6f7fb; }
.osx-tour[data-variant="desktop"] .osx-tour-actions { grid-template-columns: auto auto; justify-content: end; }
.osx-tour[data-variant="desktop"] .osx-tour-actions .osx-btn { height: 42px; padding: 0 22px; }