:root {
    --od-bg: #f4f6fb;
    --od-surface: #ffffff;
    --od-surface-alt: #f8fafc;
    --od-border: #e4e8f1;
    --od-text: #0f172a;
    --od-muted: #64748b;
    --od-faint: #94a3b8;
    --od-accent: #0ea5e9;
    --od-accent-dark: #0284c7;
    --od-green: #059669;
    --od-green-soft: #ecfdf5;
    --od-red: #dc2626;
    --od-red-soft: #fef2f2;
    --od-amber: #b45309;
    --od-amber-soft: #fffbeb;
    --od-sidebar: #0b1220;
    --od-sidebar-soft: #131c2f;
    --od-radius: 14px;
    --od-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px -18px rgba(15, 23, 42, 0.35);
}

html, body {
    font-family: "Inter", "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
    background: var(--od-bg);
    color: var(--od-text);
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
}

a, .btn-link {
    color: var(--od-accent-dark);
}

h1, h2, h3, h4 {
    letter-spacing: -0.015em;
}

.content {
    padding-top: 1.35rem;
    padding-bottom: 3rem;
}

/* ---------- Page chrome ---------- */
.od-page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0.9rem;
    margin-bottom: 1.15rem;
}

.od-title {
    font-size: 1.65rem;
    font-weight: 700;
    margin: 0;
}

.od-subtitle {
    color: var(--od-muted);
    font-size: 0.9rem;
    margin: 0.25rem 0 0;
    max-width: 70ch;
}

.od-eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--od-accent-dark);
    margin-bottom: 0.35rem;
}

/* ---------- Layout helpers ---------- */
.od-grid {
    display: grid;
    gap: 1rem;
}

.od-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.od-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.od-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.od-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.od-cols-sidebar { grid-template-columns: minmax(280px, 340px) minmax(0, 1fr); align-items: start; }
.od-gap-sm { gap: 0.6rem; }
.od-stack { display: flex; flex-direction: column; gap: 1rem; }
.od-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; }
.od-toolbar .form-control,
.od-toolbar .form-select { width: auto; min-width: 8rem; }
.od-spacer { flex: 1; }
.od-muted { color: var(--od-muted); }
.od-small { font-size: 0.82rem; }
.od-tiny { font-size: 0.74rem; }
.od-mono { font-family: "Cascadia Mono", "SFMono-Regular", Consolas, monospace; }
.od-num { font-variant-numeric: tabular-nums; }
.od-pos { color: var(--od-green); }
.od-neg { color: var(--od-red); }
.od-nowrap { white-space: nowrap; }
.od-mt { margin-top: 1rem; }
.od-mb { margin-bottom: 1rem; }

@media (max-width: 1200px) {
    .od-cols-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .od-cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 992px) {
    .od-cols-sidebar { grid-template-columns: minmax(0, 1fr); }
    .od-cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
    .od-cols-2, .od-cols-3, .od-cols-4, .od-cols-5 { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Cards and stats ---------- */
.od-card {
    background: var(--od-surface);
    border: 1px solid var(--od-border);
    border-radius: var(--od-radius);
    box-shadow: var(--od-shadow);
    padding: 1.05rem 1.15rem;
    min-width: 0;
}

.od-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
}

.od-card-title {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--od-muted);
    margin: 0;
}

.od-stat {
    font-size: 1.55rem;
    font-weight: 700;
    line-height: 1.15;
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}

.od-stat-sm { font-size: 1.15rem; }
.od-stat-label { color: var(--od-muted); font-size: 0.78rem; margin-top: 0.2rem; }

.od-stat-card {
    position: relative;
    overflow: hidden;
}

.od-stat-card::after {
    content: "";
    position: absolute;
    inset: auto -25% -60% auto;
    width: 120px;
    height: 120px;
    background: radial-gradient(circle, rgba(14, 165, 233, 0.10), transparent 65%);
    pointer-events: none;
}

/* ---------- Badges ---------- */
.od-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.16rem 0.55rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.5;
    border: 1px solid transparent;
    white-space: nowrap;
}

.od-badge.ok { background: var(--od-green-soft); color: var(--od-green); border-color: #a7f3d0; }
.od-badge.bad { background: var(--od-red-soft); color: var(--od-red); border-color: #fecaca; }
.od-badge.warn { background: var(--od-amber-soft); color: var(--od-amber); border-color: #fde68a; }
.od-badge.info { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.od-badge.neutral { background: #f1f5f9; color: var(--od-muted); border-color: #e2e8f0; }

.od-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    animation: od-pulse 1.8s ease-in-out infinite;
}

@keyframes od-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.35; }
}

/* ---------- Tables ---------- */
.od-table-wrap {
    overflow: auto;
    border: 1px solid var(--od-border);
    border-radius: 12px;
    background: var(--od-surface);
}

.od-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.83rem;
    margin: 0;
}

.od-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--od-surface-alt);
    color: var(--od-muted);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    padding: 0.55rem 0.7rem;
    border-bottom: 1px solid var(--od-border);
    white-space: nowrap;
}

.od-table tbody td {
    padding: 0.5rem 0.7rem;
    border-bottom: 1px solid #eef1f6;
    vertical-align: middle;
}

.od-table tbody tr:last-child td { border-bottom: none; }
.od-table tbody tr:hover { background: #f8fafc; }
.od-table .od-num { text-align: right; }
.od-table tfoot td { padding: 0.55rem 0.7rem; font-weight: 600; background: var(--od-surface-alt); }

.od-scroll-sm { max-height: 260px; overflow: auto; }
.od-scroll-md { max-height: 420px; overflow: auto; }
.od-scroll-lg { max-height: 560px; overflow: auto; }

/* ---------- Forms ---------- */
.form-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--od-muted);
    margin-bottom: 0.25rem;
}

.form-control, .form-select {
    border-color: #d8deea;
    border-radius: 9px;
    font-size: 0.88rem;
}

    .form-control:focus, .form-select:focus {
        border-color: var(--od-accent);
        box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
    }

.form-check-input:checked {
    background-color: var(--od-accent);
    border-color: var(--od-accent);
}

.btn {
    border-radius: 9px;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.42rem 0.9rem;
}

.btn-primary {
    background: var(--od-accent);
    border-color: var(--od-accent);
    color: #04212f;
}

    .btn-primary:hover, .btn-primary:focus {
        background: var(--od-accent-dark);
        border-color: var(--od-accent-dark);
        color: #fff;
    }

    .btn-primary:disabled {
        background: #bae6fd;
        border-color: #bae6fd;
        color: #0c4a6e;
    }

.btn-outline-secondary {
    border-color: #d8deea;
    color: var(--od-text);
}

    .btn-outline-secondary:hover {
        background: #eef2f9;
        border-color: #c9d2e3;
        color: var(--od-text);
    }

.btn-danger-soft {
    background: var(--od-red-soft);
    border: 1px solid #fecaca;
    color: var(--od-red);
}

/* ---------- Progress ---------- */
.od-progress {
    height: 7px;
    background: #e8edf6;
    border-radius: 999px;
    overflow: hidden;
}

.od-progress > span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, #38bdf8, var(--od-accent));
    border-radius: 999px;
    transition: width 0.25s ease;
}

/* ---------- Tabs ---------- */
.od-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    border-bottom: 1px solid var(--od-border);
    margin-bottom: 1rem;
}

.od-tab {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--od-muted);
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.55rem 0.85rem;
    margin-bottom: -1px;
    cursor: pointer;
}

    .od-tab:hover { color: var(--od-text); }
    .od-tab.active { color: var(--od-accent-dark); border-bottom-color: var(--od-accent); }

/* ---------- Logs and code ---------- */
.od-log {
    background: #0b1220;
    color: #cbd5e1;
    border-radius: 12px;
    padding: 0.85rem 1rem;
    font-family: "Cascadia Mono", Consolas, monospace;
    font-size: 0.76rem;
    line-height: 1.65;
    max-height: 340px;
    overflow: auto;
}

    .od-log div { white-space: pre-wrap; overflow-wrap: anywhere; }
    .od-log .err { color: #fca5a5; }

.od-code {
    background: #0b1220;
    color: #e2e8f0;
    border: 1px solid #1e293b;
    border-radius: 10px;
    font-family: "Cascadia Mono", Consolas, monospace;
    font-size: 0.82rem;
    padding: 0.75rem 0.9rem;
    width: 100%;
    resize: vertical;
}

/* ---------- Key/value ---------- */
.od-kv {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.45rem 1rem;
    font-size: 0.84rem;
}

    .od-kv dt { color: var(--od-muted); font-weight: 500; margin: 0; }
    .od-kv dd { margin: 0; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

/* ---------- Empty state ---------- */
.od-empty {
    text-align: center;
    color: var(--od-muted);
    padding: 2.2rem 1rem;
    font-size: 0.9rem;
}

/* ---------- Chart ---------- */
.od-chart { width: 100%; height: auto; display: block; }
.od-chart .axis { stroke: #e8edf5; stroke-width: 1; }
.od-chart .line { fill: none; stroke: var(--od-accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.od-chart.gain .line { stroke: var(--od-green); }
.od-chart.loss .line { stroke: var(--od-red); }
.od-chart text { fill: var(--od-faint); font-size: 10px; }

/* ---------- Icons and small chrome ---------- */
.od-icon { display: block; flex: 0 0 auto; }

.od-stat-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: #f1f5f9;
    color: var(--od-muted);
}

.od-table a { font-weight: 600; text-decoration: none; }
.od-table a:hover { text-decoration: underline; }


/* ---------- Alerts ---------- */
.od-alert {
    border-radius: 10px;
    padding: 0.65rem 0.85rem;
    font-size: 0.84rem;
    border: 1px solid var(--od-border);
    background: var(--od-surface-alt);
}

    .od-alert.ok { background: var(--od-green-soft); border-color: #a7f3d0; color: #065f46; }
    .od-alert.bad { background: var(--od-red-soft); border-color: #fecaca; color: #991b1b; }
    .od-alert.warn { background: var(--od-amber-soft); border-color: #fde68a; color: #92400e; }

/* ---------- Blazor error ---------- */
#blazor-error-ui {
    color-scheme: light only;
    background: #fef3c7;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    background: var(--od-red-soft);
    border: 1px solid #fecaca;
    color: #991b1b;
    padding: 1rem;
    border-radius: 10px;
}

    .blazor-error-boundary::after {
        content: "An error has occurred.";
    }

.valid.modified:not([type=checkbox]) { outline: 1px solid #26b050; }
.invalid { outline: 1px solid #e50000; }
.validation-message { color: #e50000; }

h1:focus { outline: none; }

/* Status text used by verification and availability tables. */
.od-ok { color: var(--od-green); font-weight: 600; }
.od-bad { color: var(--od-red); font-weight: 600; }

/* ---------- Account pages (Razor Pages, no Blazor circuit) ---------- */
.od-auth-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    background:
        radial-gradient(circle at 15% 10%, rgba(14, 165, 233, 0.12), transparent 45%),
        radial-gradient(circle at 85% 90%, rgba(5, 150, 105, 0.10), transparent 40%),
        var(--od-bg);
}

.od-auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--od-surface);
    border: 1px solid var(--od-border);
    border-radius: var(--od-radius);
    box-shadow: var(--od-shadow);
    padding: 2rem;
}

.od-auth-brand {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    margin-bottom: 1.5rem;
}

.od-auth-brand .od-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.od-auth-brand .od-brand-text small {
    color: var(--od-muted);
    font-size: 0.72rem;
}

.od-auth-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0 0 0.2rem;
}

.od-auth-subtitle {
    color: var(--od-muted);
    font-size: 0.86rem;
    margin: 0 0 1.25rem;
}

.od-auth-submit {
    width: 100%;
    margin-top: 1.1rem;
}

.od-auth-actions {
    display: flex;
    gap: 0.6rem;
    margin-top: 1.25rem;
}

.od-auth-actions .btn {
    flex: 1;
}

.od-auth-error {
    background: var(--od-red-soft);
    border: 1px solid #fecaca;
    color: #991b1b;
    border-radius: 10px;
    font-size: 0.85rem;
    padding: 0.6rem 0.75rem;
    margin-bottom: 1rem;
}

.od-auth-success {
    background: var(--od-green-soft);
    border: 1px solid #a7f3d0;
    color: #065f46;
    border-radius: 10px;
    font-size: 0.85rem;
    padding: 0.6rem 0.75rem;
    margin-bottom: 1rem;
}

.od-auth-foot {
    border-top: 1px solid var(--od-border);
    color: var(--od-muted);
    font-size: 0.75rem;
    margin: 1.4rem 0 0;
    padding-top: 0.9rem;
}

/* ---------- Forms and navigation identity ---------- */
.od-field {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.od-field > span {
    color: var(--od-muted);
    font-size: 0.78rem;
    font-weight: 500;
}

.od-role-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.1rem 0.6rem;
}

.od-mt-sm { margin-top: 0.45rem; }

.od-nav-user {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 0.8rem;
    margin-bottom: 0.85rem;
}

.od-nav-user-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.od-nav-user-text strong {
    color: #e2e8f0;
    font-size: 0.78rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.od-nav-user-text small {
    color: var(--od-faint);
    font-size: 0.66rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.od-nav-user-action {
    color: #cbd5e1;
    display: inline-flex;
    padding: 0.25rem;
    border-radius: 6px;
}

.od-nav-user-action:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.od-topbar-user {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--od-muted);
    font-size: 0.78rem;
    text-decoration: none;
    padding: 0.25rem 0.5rem;
    border-radius: 8px;
}

.od-topbar-user:hover {
    background: var(--od-surface-alt);
    color: var(--od-text);
}

/* ---------- Strategy builder ---------- */
.od-cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }

@media (max-width: 1200px) {
    .od-cols-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
    .od-cols-6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.od-toolbar .od-field > span { font-size: 0.7rem; }

.od-sb-stats { align-items: start; }

/* ---------- Builder form ---------- */
.od-sb-form {
    --od-sb-primary: #5b3df5;
    --od-sb-primary-dark: #4a2fe0;
    --od-sb-field: #f8f9fc;
    --od-sb-line: #e4e7f0;
    gap: 0.9rem;
}

.od-sb-form .form-control,
.od-sb-form .form-select {
    background-color: var(--od-sb-field);
    border-color: var(--od-sb-line);
    font-size: 0.86rem;
}

.od-sb-form .form-control:focus,
.od-sb-form .form-select:focus {
    background-color: #ffffff;
    border-color: var(--od-sb-primary);
    box-shadow: 0 0 0 3px rgba(91, 61, 245, 0.12);
}

.od-sb-form .form-control:disabled,
.od-sb-form .form-select:disabled {
    background-color: #f1f2f6;
    opacity: 0.65;
}

/* Collapsible wizard cards */
.od-wizard {
    padding: 0;
    overflow: hidden;
}

.od-wizard-head {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    width: 100%;
    padding: 0.95rem 1.15rem;
    border: 0;
    background: transparent;
    color: var(--od-text);
    text-align: left;
    cursor: pointer;
}

.od-wizard-head:hover { background: var(--od-surface-alt); }

.od-wizard-head:focus-visible {
    outline: 2px solid var(--od-sb-primary);
    outline-offset: -2px;
}

.od-wizard-title {
    font-size: 1rem;
    font-weight: 650;
    letter-spacing: -0.01em;
}

.od-wizard-meta {
    margin-left: auto;
    color: var(--od-muted);
    font-size: 0.78rem;
    text-align: right;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.od-wizard-chevron {
    flex: none;
    width: 8px;
    height: 8px;
    margin: -3px 0.2rem 0 0;
    border-right: 2px solid var(--od-muted);
    border-bottom: 2px solid var(--od-muted);
    transform: rotate(45deg);
    transition: transform 0.15s ease;
}

.od-wizard-chevron.collapsed {
    margin-top: 3px;
    transform: rotate(225deg);
}

.od-wizard-body { padding: 0.15rem 1.15rem 1.2rem; }

.od-wizard .od-field > span {
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 0.68rem;
    font-weight: 600;
}

/* Entry setting */
.od-entry-row {
    display: grid;
    gap: 1rem 1.35rem;
    align-items: start;
}

.od-entry-row-main {
    grid-template-columns: minmax(0, 2.4fr) minmax(8.5rem, 1fr) minmax(0, 2.2fr);
}

.od-entry-row-times {
    grid-template-columns: minmax(9rem, 1fr) minmax(9rem, 1fr) minmax(10rem, 1.3fr) minmax(13rem, 1.7fr);
    margin-top: 1.15rem;
}

.od-type-pill {
    display: inline-flex;
    align-self: flex-start;
    align-items: center;
    justify-content: center;
    min-width: 6rem;
    min-height: 2.15rem;
    padding: 0.35rem 1.15rem;
    border-radius: 7px;
    background: var(--od-sb-primary);
    color: #ffffff;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.od-segmented {
    display: inline-flex;
    align-self: flex-start;
    gap: 0.2rem;
    padding: 0.2rem;
    border: 1px solid var(--od-sb-line);
    border-radius: 8px;
    background: #ffffff;
}

.od-segmented button {
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--od-muted);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    padding: 0.4rem 0.95rem;
    cursor: pointer;
    transition: background 0.12s ease, color 0.12s ease;
}

.od-segmented button:hover { color: var(--od-text); }

.od-segmented button.active {
    background: var(--od-sb-primary);
    color: #ffffff;
}

.od-info {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 15px;
    height: 15px;
    margin-left: 0.2rem;
    border: 1px solid var(--od-faint);
    border-radius: 50%;
    color: var(--od-muted);
    font-size: 0.58rem;
    font-weight: 700;
    line-height: 1;
    cursor: help;
    vertical-align: middle;
}

.od-time {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.od-time .form-select {
    flex: 1;
    min-width: 0;
    padding-left: 0.5rem;
    padding-right: 1.4rem;
    background-position: right 0.35rem center;
}

.od-time-sep {
    color: var(--od-faint);
    font-weight: 600;
}

/* Enter-on-days multi select */
.od-days { position: relative; }

.od-days-box {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.3rem;
    width: 100%;
    min-height: 2.15rem;
    padding: 0.26rem 2rem 0.26rem 0.4rem;
    border: 1px solid var(--od-sb-line);
    border-radius: 6px;
    background: #ffffff;
    text-align: left;
    cursor: pointer;
}

.od-days-box:hover { border-color: #c9cfe0; }

.od-day-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.14rem 0.4rem;
    border-radius: 4px;
    background: var(--od-sb-primary);
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.2;
}

.od-day-x {
    cursor: pointer;
    font-size: 0.8rem;
    line-height: 1;
    opacity: 0.85;
}

.od-day-x:hover { opacity: 1; }

.od-days-empty {
    color: var(--od-faint);
    font-size: 0.82rem;
}

.od-days-chev {
    position: absolute;
    right: 0.7rem;
    top: 50%;
    width: 7px;
    height: 7px;
    border-right: 2px solid var(--od-muted);
    border-bottom: 2px solid var(--od-muted);
    transform: translateY(-70%) rotate(45deg);
    pointer-events: none;
}

.od-days-chev.open { transform: translateY(-30%) rotate(225deg); }

.od-days-menu {
    position: absolute;
    z-index: 30;
    top: calc(100% + 0.25rem);
    left: 0;
    min-width: 12rem;
    padding: 0.35rem;
    border: 1px solid var(--od-border);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 12px 28px -14px rgba(15, 23, 42, 0.45);
}

.od-days-option {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.35rem 0.45rem;
    border-radius: 6px;
    font-size: 0.82rem;
    cursor: pointer;
}

.od-days-option:hover { background: var(--od-surface-alt); }

/* Positions */
.od-positions-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.9rem;
}

.od-positions-label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--od-muted);
}

.od-segment { width: 16rem; }

.od-btn-primary {
    background: var(--od-sb-primary);
    border: 1px solid var(--od-sb-primary);
    color: #ffffff;
    font-weight: 600;
}

.od-btn-primary:hover,
.od-btn-primary:focus {
    background: var(--od-sb-primary-dark);
    border-color: var(--od-sb-primary-dark);
    color: #ffffff;
}

.od-add-leg { width: 12rem; }

.od-leg {
    border: 1px solid #eceef5;
    border-radius: 8px;
    background: #f5f6fa;
    padding: 0.6rem 0.65rem 0.7rem;
    margin-bottom: 0.6rem;
}

.od-leg-main {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.od-leg-no {
    min-width: 1.5rem;
    color: var(--od-muted);
    font-size: 0.78rem;
    font-weight: 700;
}

.od-side {
    width: 4.1rem;
    padding: 0.22rem 0;
    border: 0;
    border-radius: 5px;
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    cursor: pointer;
    transition: filter 0.12s ease;
}

.od-side.sell { background: #e11d48; }
.od-side.buy { background: #16a34a; }
.od-side:hover { filter: brightness(0.92); }

.od-product {
    padding: 0.18rem 0.4rem;
    border-radius: 4px;
    background: #e3e5ec;
    color: #4b5563;
    font-size: 0.68rem;
    font-weight: 700;
}

.od-strike-mode { width: 7.2rem; }
.od-strike-value { width: 4.5rem; }
.od-strike-offset { width: 6.5rem; }
.od-opt-type { width: 4.1rem; font-weight: 600; }
.od-lots { width: 4rem; }

.od-check {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin: 0;
    color: var(--od-muted);
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    white-space: nowrap;
    cursor: pointer;
}

.od-check input[type="checkbox"] {
    width: 15px;
    height: 15px;
    margin: 0;
    accent-color: var(--od-sb-primary);
    cursor: pointer;
}

.od-check-hint {
    margin-left: -0.15rem;
    color: var(--od-faint);
    font-size: 0.62rem;
}

.od-leg-tool {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: var(--od-muted);
    cursor: pointer;
}

.od-leg-tool:hover {
    border-color: var(--od-sb-line);
    background: #ffffff;
    color: var(--od-text);
}

.od-leg-tool.danger:hover {
    border-color: #fecaca;
    background: var(--od-red-soft);
    color: var(--od-red);
}

.od-leg-rules {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.75fr) minmax(0, 1.25fr);
    gap: 0.7rem 1rem;
    margin-top: 0.55rem;
}

.od-rule {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 0;
}

.od-rule .form-select,
.od-rule .form-control { width: 100%; }

.od-rule-inline {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.8fr) minmax(0, 1.1fr) minmax(0, 0.8fr);
    gap: 0.35rem;
}

.od-rule-inline .form-select { min-width: 0; }

.od-leg-flags {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-top: 0.4rem;
    padding-top: 0.9rem;
    border-top: 1px solid var(--od-border);
}

.od-positions-empty {
    border: 1px dashed #cfd5e3;
    border-radius: 8px;
    padding: 1.6rem 1rem;
    text-align: center;
    color: var(--od-muted);
    font-size: 0.88rem;
}

.od-sb-submit {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.6rem;
    padding: 0.4rem 0 0.2rem;
}

@media (max-width: 992px) {
    .od-entry-row-main { grid-template-columns: minmax(0, 1fr) minmax(8.5rem, 1fr); }
    .od-entry-row-main > :first-child { grid-column: 1 / -1; }
    .od-entry-row-times { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .od-leg-rules { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
    .od-entry-row-main,
    .od-entry-row-times,
    .od-leg-rules { grid-template-columns: minmax(0, 1fr); }
    .od-entry-row-main > :first-child { grid-column: auto; }
    .od-segment,
    .od-add-leg { width: 100%; }
    .od-wizard-meta { display: none; }
}

/* Payoff chart */
.od-payoff {
    width: 100%;
    height: auto;
    display: block;
    overflow: visible;
}

.od-payoff.compact { height: 86px; }

.od-payoff text {
    fill: var(--od-faint);
    font-size: 10px;
    font-family: inherit;
}

.od-payoff .area { stroke: none; }
.od-payoff .area.profit { fill: rgba(5, 150, 105, 0.16); }
.od-payoff .area.loss { fill: rgba(220, 38, 38, 0.13); }

.od-payoff .expiry {
    fill: none;
    stroke: var(--od-accent-dark);
    stroke-width: 2.2;
    stroke-linejoin: round;
    stroke-linecap: round;
}

.od-payoff .target {
    fill: none;
    stroke: var(--od-green);
    stroke-width: 1.6;
    stroke-dasharray: 5 4;
}

.od-payoff .grid { stroke: #eef1f6; stroke-width: 1; }
.od-payoff .zero { stroke: #cbd5e1; stroke-width: 1.2; }
.od-payoff .spot { stroke: var(--od-amber); stroke-width: 1.2; stroke-dasharray: 3 3; }
.od-payoff .spot-label { fill: var(--od-amber); font-weight: 700; }
.od-payoff .be { stroke: #94a3b8; stroke-width: 1; stroke-dasharray: 2 4; }
.od-payoff .be-label { fill: var(--od-muted); font-weight: 600; }

.od-payoff .legend { stroke-width: 2; }
.od-payoff .legend.expiry { stroke: var(--od-accent-dark); }
.od-payoff .legend.target { stroke: var(--od-green); stroke-dasharray: 5 4; }

/* ---------- Paged data grids ---------- */
.od-pager {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    margin-top: 0.85rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--od-border);
}

.od-pager-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.55rem;
}

