/* Gyro.fi - Dark theme with teal accents */

:root {
    /* Site-owned type and translucent-colour tokens. */
    --font-body: 'Inter', system-ui, -apple-system, sans-serif;
    --font-display: 'Space Grotesk', sans-serif;
    --on-accent: var(--bg-primary);
    --font-mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
    --accent-rgb: 0, 217, 192;
    --bg-primary-rgb: 13, 27, 42;
    --text-secondary-rgb: 119, 141, 169;
    --success-rgb: 16, 185, 129;
    --warning-rgb: 240, 165, 0;
    --danger-rgb: 239, 68, 68;
    /* Colors */
    --bg-primary: #0D1B2A;
    --bg-secondary: #1B263B;
    --bg-card: #1B263B;
    --bg-card-hover: #243447;
    --accent: #00D9C0;
    --accent-light: #00F5D8;
    --accent-dark: #00B8A3;
    --accent-glow: rgba(var(--accent-rgb), 0.2);
    --warning: #F0A500;
    --danger: #ef4444;
    --success: #10b981;
    --text-primary: #E0E1DD;
    --text-secondary: #778DA9;
    --text-muted: #4A5568;
    --border: #2D3748;
    --border-light: #3D4A5C;

    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px var(--accent-glow);

    /* Radii */
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --radius-full: 9999px;

    /* Transitions */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* The reset above overrides native dialog centring. Keep these in the top
   layer with their own margins; page scroll must not place them at (0, 0). */
dialog.gyro-position-card,
dialog.gyro-referrals {
    margin: auto;
    inset: 0;
}

/* Component display rules must not reveal controls explicitly hidden by JS. */
dialog.gyro-position-card [hidden],
dialog.gyro-referrals [hidden] {
    display: none !important;
}

body {
    font-family: var(--font-body);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* Header */
#price-distance { color: var(--accent); }
#price-distance.is-above-strike { color: var(--warning); }
#deposit-swap-impact { color: var(--text-secondary); }
#deposit-swap-impact.has-high-impact { color: var(--warning); }

.header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

/* Totals banner — whole-vault headline (this vault, all strikes) */
.totals-banner {
    display: flex;
    gap: 1rem;
    margin: 0.25rem 0 1.25rem;
}

.totals-banner-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 1rem 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.totals-banner-label {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
}

.totals-banner-value {
    font-family: var(--font-display);
    font-size: 1.9rem;
    font-weight: 700;
    line-height: 1.1;
    color: var(--accent);
}

.totals-banner-sub {
    font-size: 0.72rem;
    color: var(--text-muted);
    letter-spacing: 0.02em;
}

@media (max-width: 560px) {
    .totals-banner { flex-direction: column; gap: 0.75rem; }
    .totals-banner-value { font-size: 1.6rem; }
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.brand-icon {
    width: 40px;
    height: 40px;
    color: var(--accent);
}

.gyro-icon {
    width: 100%;
    height: 100%;
    animation: spin-slow 20s linear infinite;
}

@keyframes spin-slow {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.brand-text h1 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.brand-text h1 span {
    color: var(--accent);
}

.brand-text .tagline {
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin: 0;
    letter-spacing: 0.5px;
}

/* Wallet */
.wallet-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-connect {
    background: var(--accent);
    color: var(--on-accent);
    border: none;
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-connect:hover {
    background: var(--accent-light);
    box-shadow: var(--shadow-glow);
}

.wallet-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--bg-card);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.network-badge {
    background: var(--accent);
    color: var(--on-accent);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    font-weight: 600;
}

#wallet-address {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.btn-disconnect {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    transition: var(--transition-fast);
}

.btn-disconnect:hover {
    color: var(--danger);
}

/* Main Content */
.main-content {
    max-width: var(--app-content-width, 800px);
    margin: 0 auto;
    padding: var(--app-content-padding, 2rem 1.5rem);
}

/* Visualizer Section */
.visualizer-section {
    text-align: center;
    margin-bottom: 2rem;
}

.accumulation-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 0.25rem;
}

.accumulation-mode {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--accent);
}

.mode-icon {
    font-size: 1.3rem;
}

/* P1 — sub-caption under the accumulation mode badge explaining WHY. */
.mode-why {
    display: block;
    margin-top: 0.4rem;
    max-width: 34rem;
    font-family: var(--font-display);
    font-size: 0.8rem;
    font-weight: 400;
    line-height: 1.45;
    color: var(--text-secondary);
}

.mode-why:empty {
    display: none;
}

/* P4 (Batch M2) — live accumulation-record rollup chip under the mode badge. */
.accum-rollup {
    display: inline-block;
    margin-top: 0.5rem;
    padding: 0.2rem 0.6rem;
    max-width: 34rem;
    font-family: var(--font-display);
    font-size: 0.72rem;
    font-weight: 500;
    line-height: 1.35;
    border-radius: var(--radius-sm);
    background: var(--bg-card-hover);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}
.accum-rollup-pass {
    color: var(--success);
    border-color: rgba(var(--success-rgb), 0.35);
}
.accum-rollup-fail {
    color: var(--warning);
    border-color: rgba(var(--warning-rgb), 0.35);
}
.accum-rollup-empty {
    color: var(--text-muted);
}

.accumulation-growth {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.growth-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.growth-value {
    font-family: var(--font-mono);
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--success);
}

/* Status Section */
.status-section {
    display: grid;
    grid-template-columns: var(--status-columns, repeat(3, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

@media (max-width: 768px) {
    .status-section {
        grid-template-columns: 1fr;
    }
}

.status-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    transition: var(--transition);
}

.status-card:hover {
    border-color: var(--border-light);
    background: var(--bg-card-hover);
}

.status-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
}

.status-header i {
    color: var(--accent);
}

.status-value {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.status-detail {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.status-detail .highlight {
    color: var(--accent);
    font-weight: 500;
}

.epoch-progress {
    height: 4px;
    background: var(--border);
    border-radius: var(--radius-full);
    margin: 0.75rem 0;
    overflow: hidden;
}

.epoch-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent-light));
    border-radius: var(--radius-full);
    transition: width 0.5s ease;
}

/* Action Section */
.action-section {
    margin-bottom: 2rem;
}

.action-buttons {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.btn-action {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
    border: none;
}

.btn-action i {
    font-size: 1.1rem;
}

.btn-primary {
    background: var(--accent);
    color: var(--on-accent);
}

.btn-primary:hover {
    background: var(--accent-light);
    box-shadow: var(--shadow-glow);
}

.btn-primary:disabled {
    background: var(--text-muted);
    cursor: not-allowed;
}

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-light);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
    border: none;
}

.btn-danger:hover {
    filter: brightness(1.15);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid transparent;
}

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

/* Action Panels */
.action-panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
}

.panel-header h3 {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 600;
}

.btn-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    transition: var(--transition-fast);
}

.btn-close:hover {
    color: var(--text-primary);
}

.panel-body {
    padding: 1.25rem;
}

.panel-description {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1.25rem;
}

.ratio-display {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-primary);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1.25rem;
    font-size: 0.9rem;
}

.ratio-value {
    color: var(--accent);
    font-weight: 500;
    font-family: var(--font-mono);
}

.input-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

@media (max-width: 480px) {
    .input-row {
        grid-template-columns: 1fr;
    }
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.input-group label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.input-with-max {
    display: flex;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: var(--transition-fast);
}

.input-with-max:focus-within {
    border-color: var(--accent);
}

.input-with-max input {
    flex: 1;
    background: transparent;
    border: none;
    padding: 0.75rem;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.95rem;
    outline: none;
}

.input-with-max input::placeholder {
    color: var(--text-muted);
}

.btn-max {
    background: var(--bg-card);
    border: none;
    color: var(--accent);
    padding: 0 0.75rem;
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-max:hover {
    background: var(--bg-card-hover);
}

.input-balance {
    font-size: 0.75rem;
    color: var(--text-muted);
}

#deposit-dual-mode .deposit-input-error {
    font-size: 0.75rem;
    color: var(--danger);
}

#deposit-dual-mode .deposit-input-error[hidden] { display: none; }
#deposit-dual-mode input[aria-invalid="true"] { outline: 1px solid var(--danger); }

.preview-box {
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
    padding: 1rem;
    margin-bottom: 1.25rem;
}

.preview-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
}

.preview-row:last-child {
    border-bottom: none;
}

.preview-row.highlight {
    color: var(--accent);
    font-weight: 500;
}

.fill-surcharge-note {
    margin: 0.75rem 0 0;
    font-size: 0.72rem;
    line-height: 1.4;
    color: var(--text-muted);
}

/* Calls-input helper line (≈ shares, per-call premium, min-premium / no-depth) */
.fill-calls-helper {
    font-size: 0.75rem;
    color: var(--text-muted);
    min-height: 1em;
    margin-top: 0.1rem;
}

.fill-calls-helper.fill-warn {
    color: var(--warning);
}

/* Per-call premium chip in the lens preview row */
.premium-preview-percall {
    color: var(--accent);
}

/* Advanced (max IV / max premium override) disclosure under the buy panel */
.fill-advanced {
    margin-bottom: 1.25rem;
}

.fill-advanced > summary {
    cursor: pointer;
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 0.75rem;
    user-select: none;
}

.fill-advanced[open] > summary {
    margin-bottom: 1rem;
}

/* Slippage selector spacing inside the buy panel */
#fill-slippage {
    margin-bottom: 1.25rem;
}

.panel-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.panel-actions .btn-action {
    flex: 0;
    padding: 0.75rem 1.5rem;
}

/* Position Summary */
.position-summary {
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
    padding: 1rem;
    margin-bottom: 1.25rem;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    font-size: 0.9rem;
}

.summary-row .highlight {
    color: var(--success);
}

/* Slider */
.slider-group {
    margin-bottom: 1.25rem;
}

.slider-group label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.slider-group input[type="range"] {
    width: 100%;
    height: 6px;
    background: var(--border);
    border-radius: var(--radius-full);
    outline: none;
    -webkit-appearance: none;
}

.slider-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: var(--accent);
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition-fast);
}

.slider-group input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-glow);
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

.slider-labels span:nth-child(2) {
    color: var(--accent);
    font-weight: 500;
}

/* Details Section */
.details-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
}

.details-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}

.details-header h2 {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 600;
}

.btn-refresh {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}

.btn-refresh:hover {
    color: var(--accent);
    background: var(--bg-primary);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 2rem;
}

.empty-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1rem;
    color: var(--text-muted);
}

.gyro-icon-large {
    width: 100%;
    height: 100%;
}

.empty-state p {
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.empty-state span {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.position-loading-state {
    text-align: center;
    padding: 2rem;
}

.position-loading-icon {
    width: 44px;
    height: 44px;
    margin: 0 auto 0.9rem;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    color: var(--accent);
    border: 1px solid var(--border);
}

.position-loading-state p {
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.position-loading-state span {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Position Details */
.position-details {
    display: var(--position-display, grid);
    grid-template-columns: var(--position-columns, 1fr 1fr);
    gap: 1rem;
}

@media (max-width: 480px) {
    .position-details {
        grid-template-columns: 1fr;
    }
}

.position-card {
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
    padding: 1rem;
}

.position-header {
    margin-bottom: 0.75rem;
}

.position-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.position-values {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.holding {
    display: flex;
    flex-direction: column;
}

.holding-value {
    font-family: var(--font-mono);
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--text-primary);
}

.holding-label {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.holding-divider {
    color: var(--text-muted);
    font-size: 1.25rem;
}

/* P2 (Batch M2) — target-asset lead line on the Holdings card. Visually the
   headline figure; the base+quote blend below it is the secondary anchor. */
.holding-target {
    font-family: var(--font-mono);
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

/* P2 — target-asset secondary line on the withdraw Estimated Value + the
   target-asset sub-line under Vault TVL. Muted; an estimate, not a promise. */
.summary-row-target span:last-child,
.status-detail-target span:last-child {
    color: var(--text-secondary);
    font-style: italic;
}
.summary-row-target {
    font-size: 0.82rem;
    color: var(--text-muted);
}

.fees-display .fee-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    padding: 0.35rem 0;
}

.fees-display .highlight {
    color: var(--success);
    font-weight: 500;
}

/* LP Details */
.lp-details {
    margin-top: 1.25rem;
    border-top: 1px solid var(--border);
    padding-top: 1.25rem;
}

.position-load-status {
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    margin-bottom: 1rem;
    border: 1px dashed var(--border-light);
    border-radius: var(--radius-sm);
    background: var(--bg-primary);
    color: var(--text-secondary);
}

.position-load-status i {
    color: var(--accent);
    font-size: 1rem;
}

.position-load-status strong {
    display: block;
    color: var(--text-primary);
    font-size: 0.86rem;
    font-weight: 600;
    line-height: 1.25;
}

.position-load-status span {
    display: block;
    color: var(--text-muted);
    font-size: 0.78rem;
    line-height: 1.35;
}

.lp-details summary {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 0.9rem;
    list-style: none;
}

.lp-details summary::-webkit-details-marker {
    display: none;
}

.lp-details summary .chevron {
    margin-left: auto;
    transition: var(--transition-fast);
}

.lp-details[open] summary .chevron {
    transform: rotate(180deg);
}

.lp-content {
    margin-top: 1rem;
}

/* Opt-in standalone disclosure: old .lp-details remain inline dividers.
 * A shell supplies title/body hooks; native details owns keyboard and open state. */
.disclosure-card {
    --disclosure-inset: 18px;
    --disclosure-gap: 10px;
    padding: 0;
    margin: 14px 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    min-width: 0;
}
.disclosure-card > summary {
    display: grid;
    grid-template-columns: 16px minmax(0, 1fr) 16px;
    gap: var(--disclosure-gap);
    align-items: center;
    min-height: 56px;
    padding: 16px var(--disclosure-inset);
    list-style: none;
    cursor: pointer;
    color: var(--text-secondary);
}
.disclosure-card > summary::-webkit-details-marker { display: none; }
.disclosure-card > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -4px; border-radius: var(--radius-lg); }
.disclosure-card > summary > .disclosure-title { min-width: 0; overflow-wrap: anywhere; line-height: 1.5; }
.disclosure-card > summary > .chevron { margin: 0; justify-self: end; transition: var(--transition-fast); }
.disclosure-card[open] > summary > .chevron { transform: rotate(180deg); }
.disclosure-card > .disclosure-body { margin: 0; min-width: 0; padding: 0 var(--disclosure-inset) var(--disclosure-inset); }

.lp-visual {
    margin-bottom: 1.5rem;
    padding: 0.5rem;
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
}

.tick-labels {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.3rem;
    font-size: 0.65rem;
    color: var(--text-secondary);
    font-family: var(--font-mono);
}

.tick-gauge {
    display: flex;
    flex-direction: row;
    height: 28px;
    border-radius: 6px;
    overflow: hidden;
    background: var(--bg-card);
    border: 1px solid var(--border);
}

.tick {
    flex: 1;
    display: flex;
    flex-direction: row;
    height: 100%;
    position: relative;
}

.tick + .tick {
    border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.tick-fill-base {
    height: 100%;
    background: var(--base-gradient, linear-gradient(to right, #f7931a, #ffb347));
    transition: width 0.5s ease;
}

.tick-fill-usdc {
    height: 100%;
    background: linear-gradient(to right, #2775ca, #5a9fd4);
    transition: width 0.5s ease;
}

.tick.active {
    box-shadow: inset 0 -3px 0 var(--accent);
}

.tick-legend {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 0.75rem;
    font-size: 0.7rem;
}

.legend-base, .legend-usdc {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--text-secondary);
}

.legend-base::before {
    content: '';
    display: inline-block;
    width: 10px;
    height: 10px;
    background: var(--base-gradient, linear-gradient(to top, #f7931a, #ffb347));
    border-radius: 2px;
}

.legend-usdc::before {
    content: '';
    display: inline-block;
    width: 10px;
    height: 10px;
    background: linear-gradient(to top, #2775ca, #5a9fd4);
    border-radius: 2px;
}

/* Position Tooltip */
.position-tooltip {
    position: fixed;
    transform: translate(-50%, -100%);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.75rem;
    font-size: 0.8rem;
    z-index: 1000;
    box-shadow: var(--shadow-lg);
    display: none;
    min-width: 200px;
}

.position-tooltip .tooltip-row {
    margin-bottom: 0.4rem;
    color: var(--text-secondary);
}

.position-tooltip .tooltip-row strong {
    color: var(--text-primary);
}

.position-tooltip .tooltip-link {
    display: block;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border);
    color: var(--accent);
    text-decoration: none;
    font-size: 0.75rem;
}

.position-tooltip .tooltip-link:hover {
    text-decoration: underline;
}

.tick-label {
    /* Unused - labels now in .tick-labels row above gauge */
}

.spot-indicator {
    text-align: center;
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.lp-stats .stat-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    padding: 0.35rem 0;
    color: var(--text-secondary);
}

/* Fee Summary */
.fee-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.fee-metric {
    flex: 1;
    text-align: center;
    padding: 0.75rem;
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
}

.fee-metric-label {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.fee-metric-value {
    display: block;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    font-family: var(--font-mono);
}

.fee-metric-value.highlight {
    color: var(--accent);
}

.fee-metric-note {
    display: block;
    margin-top: 0.2rem;
    font-size: 0.6rem;
    font-style: italic;
    color: var(--text-muted);
    letter-spacing: 0.02em;
}

@media (max-width: 760px) {
    .fee-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 420px) {
    .fee-summary {
        grid-template-columns: 1fr;
    }
}

/* Fee Events List */
/* Fee-log loading bar (segments). width of fill = done/total. */
.fee-load-progress {
    margin: 0 0 0.6rem 0;
}

.fee-load-progress-label {
    font-size: 0.68rem;
    color: var(--text-muted);
    margin-bottom: 0.3rem;
    letter-spacing: 0.02em;
}

.fee-load-progress-track {
    width: 100%;
    height: 4px;
    border-radius: 3px;
    background: var(--bg-secondary);
    overflow: hidden;
}

.fee-load-progress-fill {
    height: 100%;
    border-radius: 3px;
    background: var(--accent);
    transition: width 0.25s ease;
}

.fee-events {
    font-size: 0.8rem;
    max-height: 200px;
    overflow-y: auto;
}

.fee-event-header {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    font-size: 0.65rem;
    letter-spacing: 0.05em;
}

.fee-event-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
}

.fee-event-row:last-child {
    border-bottom: none;
}

.fee-event-row span:not(:first-child) {
    font-family: var(--font-mono);
    text-align: right;
}

.fee-event-empty {
    text-align: center;
    padding: 1.5rem;
    color: var(--text-muted);
    font-style: italic;
}

/* Accumulation History (G-07) */
.accum-note {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin: 0 0 0.6rem 0;
    line-height: 1.4;
}

#inherited-history a {
    color: var(--accent);
    text-underline-offset: 2px;
}

#inherited-history a:hover {
    color: var(--accent-light);
}

.inherited-source + .inherited-source {
    margin-top: 0.9rem;
    padding-top: 0.9rem;
    border-top: 1px solid var(--border);
}

.inherited-source-heading {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    margin-bottom: 0.4rem;
    font-size: 0.75rem;
    line-height: 1.5;
}

.inherited-price-basis {
    font-size: 0.7rem;
    color: var(--text-secondary);
}

#inherited-history .accum-epoch-outcome {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.2rem 0.35rem;
    min-width: 0;
}

#inherited-history .accum-flip {
    margin-left: 0;
}

.accum-events {
    font-size: 0.8rem;
    max-height: 240px;
    overflow-y: auto;
}

/* Stacked 2-line per-epoch card — replaces the old 5-column grid (too busy at
   ~700px). Line 1 = outcome tag (left) + result + ⓘ (right); line 2 = compact
   dot-separated context (#epoch · date · one-liner · spot · epoch-len). */
.accum-epoch {
    padding: 0.625rem 0;
    border-bottom: 1px solid var(--border);
}
.accum-epoch:last-child {
    border-bottom: none;
}

.accum-epoch-top {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.6rem;
}

.accum-epoch-score {
    white-space: nowrap;
}

.accum-epoch-result {
    font-size: 1.05rem;
    font-weight: 600;
    font-family: var(--font-mono);
}

.accum-info {
    margin-left: 6px;
    font-size: 0.72rem;
    color: var(--text-muted);
    cursor: help;
}

.accum-epoch-sub {
    margin-top: 3px;
    font-size: 0.82rem;
    line-height: 1.4;
    color: var(--text-muted);
}

.accum-pass { color: var(--success); }
.accum-fail { color: var(--danger); }

/* Outcome tags — assigned (converted) vs kept. */
.accum-tag-assigned,
.accum-tag-kept {
    display: inline-block;
    padding: 0.05rem 0.35rem;
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    border-radius: var(--radius-sm);
    white-space: nowrap;
}
.accum-tag-assigned {
    background: var(--accent-glow);
    color: var(--accent);
}
.accum-tag-kept {
    background: var(--bg-card-hover);
    color: var(--text-secondary);
}

/* Small vault-IV footnote under the epoch table. */
.accum-iv-note {
    margin-top: 0.55rem;
    font-size: 0.68rem;
    color: var(--text-muted);
    text-align: right;
}

/* --- Market tab: IV-drift signal + two-audience explainers --- */
/* #market-iv-expand is a .market-section .lp-details (same pattern as the
   sell-bucket) reskinned with the accent highlight. .lp-details adds a top
   border + padding-top meant for an in-card sub-section; here it's the whole
   card, so neutralize those so the accent card reads clean. */
.market-iv-signal {
    border-color: var(--accent);
    box-shadow: var(--shadow-glow);
    border-top: 1px solid var(--accent);
    margin-top: 0;
    padding-top: 1.25rem;
}

/* Summary row: label + live reading (always visible) + compact drift hint +
   chevron pushed to the right by .lp-details summary .chevron { margin-left:auto }. */
.market-iv-signal > summary {
    align-items: baseline;
}

.iv-signal-label {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.iv-signal-value {
    font-family: var(--font-mono);
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--accent);
}

/* Tiny signed drift hint in the collapsed summary (e.g. "▼0.7%"). Honest, muted —
   hidden when empty (no history yet). */
.iv-summary-delta {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
}

.iv-summary-delta:empty {
    display: none;
}

.market-rv-note:empty {
    display: none;
}

/* ── IV history & drift (#market-iv-history) — now the BODY of the shared
   #market-iv-expand <details>. The big reading lives in the summary, so this body
   shows only deltas + caption + chart (no duplicate reading card here). */
.iv-hist-deltas {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.iv-hist-delta,
.iv-hist-delta-roll {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.iv-hist-delta-roll {
    color: var(--text-muted);
    font-weight: 500;
}

.iv-hist-caption {
    font-size: 0.8rem;
    line-height: 1.5;
    color: var(--text-secondary);
    margin: 0 0 0.75rem;
}

.iv-hist-caption strong {
    color: var(--text-primary);
    font-weight: 600;
}

.iv-hist-nochart {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 0;
    font-style: italic;
}

.iv-hist-chart-wrap {
    width: 100%;
    margin-top: 0.25rem;
}

.iv-hist-chart {
    width: 100%;
    height: auto;
    display: block;
    overflow: visible;
}

.iv-hist-line {
    fill: none;
    stroke: var(--accent);
    stroke-width: 2;
    vector-effect: non-scaling-stroke;
    stroke-linejoin: round;
    stroke-linecap: round;
}

.iv-hist-baseline {
    stroke: var(--accent-glow);
    stroke-width: 1;
    stroke-dasharray: 3 3;
    vector-effect: non-scaling-stroke;
    opacity: 0.7;
}

.iv-hist-dot {
    fill: var(--accent);
    stroke: var(--bg-card);
    stroke-width: 1.5;
    vector-effect: non-scaling-stroke;
}

.iv-hist-axis {
    fill: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 9px;
}

.market-explainer .explainer-title {
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.45rem;
}

.market-explainer .explainer-body {
    font-size: 0.82rem;
    line-height: 1.5;
    color: var(--text-secondary);
    margin: 0;
}

.explainer-eyebrow {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 0.35rem;
}

.seller-explainer strong {
    color: var(--text-primary);
    font-weight: 600;
}

.seller-explainer-fifo {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.accum-flip {
    display: inline-block;
    margin-left: 0.35rem;
    padding: 0.05rem 0.3rem;
    font-size: 0.55rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    border-radius: var(--radius-sm);
    background: var(--bg-card-hover);
    color: var(--accent);
    vertical-align: middle;
}

/* "Where this came from" — expandable 3-tranche ledger under each epoch card.
   Visually subordinate to the headline: a small muted summary, a subtle top
   border + indent so it reads as a nested detail, not a second card. */
.accum-breakdown {
    margin-top: 0.45rem;
    padding-top: 0.4rem;
    padding-left: 0.55rem;
    border-top: 1px dashed var(--border);
}
.accum-breakdown > summary {
    list-style: none;
    cursor: pointer;
    font-size: 0.7rem;
    color: var(--text-muted);
    user-select: none;
}
.accum-breakdown > summary::-webkit-details-marker { display: none; }
.accum-breakdown > summary::before {
    content: '▸';
    display: inline-block;
    margin-right: 0.35rem;
    font-size: 0.6rem;
    transition: transform 0.15s ease;
}
.accum-breakdown[open] > summary::before { transform: rotate(90deg); }
.accum-breakdown > summary:hover { color: var(--text-secondary); }

.accum-tr-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.6rem;
    margin-top: 0.3rem;
    font-size: 0.78rem;
    color: var(--text-secondary);
}
.accum-tr-label { color: var(--text-muted); }
.accum-tr-note { color: var(--text-muted); font-size: 0.72rem; }
.accum-tr-val {
    white-space: nowrap;
    font-family: var(--font-mono);
    color: var(--text-secondary);
}

.accum-tr-net {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.6rem;
    margin-top: 0.4rem;
    padding-top: 0.35rem;
    border-top: 1px solid var(--border);
    font-size: 0.8rem;
    font-weight: 600;
}
.accum-tr-net .accum-tr-val {
    font-weight: 600;
}

.accum-tr-keep {
    margin-top: 0.3rem;
    font-size: 0.78rem;
    color: var(--text-secondary);
}
.accum-tr-drift {
    margin-top: 0.25rem;
    font-size: 0.72rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

/* Toast */
.toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: var(--shadow-lg);
    animation: toastIn 0.3s ease;
    min-width: 280px;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.toast.success {
    border-left: 3px solid var(--success);
}

.toast.error {
    border-left: 3px solid var(--danger);
}

.toast.info {
    border-left: 3px solid var(--accent);
}

.toast-icon {
    font-size: 1.2rem;
}

.toast.success .toast-icon {
    color: var(--success);
}

.toast.error .toast-icon {
    color: var(--danger);
}

.toast.info .toast-icon {
    color: var(--accent);
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 500;
    font-size: 0.9rem;
    margin-bottom: 0.15rem;
}

.toast-message {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* ===========================
   Tab Navigation
   =========================== */
.tab-nav {
    display: flex;
    gap: 0.25rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.25rem;
    margin-bottom: 1.5rem;
}

.tab-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-secondary);
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.tab-btn:hover {
    color: var(--text-primary);
    background: var(--bg-card-hover);
}

.tab-btn.active {
    background: var(--accent);
    color: var(--on-accent);
}

.tab-btn i {
    font-size: 1.1rem;
}

/* Asset Tabs */
/* Chain Toggle */
/* Wrong-chain banner — shown when the wallet is on an unsupported network.
   Uses shared theme vars so it adapts to each dapp's palette automatically. */
.wrong-chain-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    padding: 0.65rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--danger);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
    color: var(--text-primary);
    font-size: 0.9rem;
    text-align: center;
}

.wrong-chain-banner #wrong-chain-msg {
    color: var(--text-primary);
    font-weight: 600;
}

.wrong-chain-banner #switch-chain-btn {
    border: none;
    cursor: pointer;
    padding: 0.4rem 0.9rem;
    border-radius: var(--radius-full);
    background: var(--accent);
    color: #fff;
    font-weight: 600;
    font-size: 0.85rem;
    transition: var(--transition-fast);
}

.wrong-chain-banner #switch-chain-btn:hover {
    background: var(--accent-dark);
}

.chain-toggle {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 0.5rem;
    justify-content: center;
}

.chain-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    background: var(--bg-secondary);
    color: var(--text-muted);
    font-family: var(--font-display);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    cursor: pointer;
    transition: var(--transition-fast);
}

.chain-pill:hover {
    color: var(--text-primary);
    background: var(--bg-card-hover);
    border-color: var(--border-light);
}

.chain-pill.active {
    background: var(--bg-primary);
    color: var(--accent);
    border-color: var(--accent);
}

.asset-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-bottom: 1rem;
    justify-content: center;
}

.asset-tab {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.9rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
    white-space: nowrap;
}

.asset-tab:hover {
    color: var(--text-primary);
    background: var(--bg-card-hover);
    border-color: var(--border-light);
}

.asset-tab.active {
    background: var(--accent);
    color: var(--on-accent);
    border-color: var(--accent);
}

/* Strike Selector */
.series-selector-container {
    display: var(--strike-selector-display, flex);
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.strike-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.strike-pill-group {
    display: flex;
    gap: 0.25rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.25rem;
    flex-wrap: wrap;
}

.spot-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    background: var(--bg-secondary);
    color: var(--text-muted);
    font-family: var(--font-display);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-left: auto;
}

.spot-pill strong {
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    letter-spacing: 0;
    text-transform: none;
}

.strike-pill {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.85rem;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
    white-space: nowrap;
}

/* Opt-in separated picker: label above equal strike targets, spot is context. */
.strike-picker-separated {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 8px 24px;
}
.strike-picker-separated > .strike-label { grid-column: 1; grid-row: 1; }
.strike-picker-separated > .strike-pill-group {
    grid-column: 1;
    grid-row: 2;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--strike-min-width, 96px)), 1fr));
    gap: var(--strike-control-gap, 8px);
    width: 100%;
    max-width: var(--strike-group-width, 648px);
    border: 0;
    border-radius: 0;
    background: transparent;
    padding: 0;
}
.strike-picker-separated .strike-pill {
    justify-content: center;
    flex-wrap: wrap;
    min-width: 0;
    min-height: var(--strike-control-height, 44px);
    font-variant-numeric: tabular-nums;
}
.strike-picker-separated > .spot-pill {
    grid-column: 2;
    grid-row: 2;
    align-self: center;
    min-height: var(--strike-control-height, 44px);
    margin: 0;
}
@media (max-width: 640px) {
    .strike-picker-separated { grid-template-columns: minmax(0, 1fr); }
    .strike-picker-separated > .spot-pill { grid-column: 1; grid-row: 3; justify-self: start; }
}

.strike-pill:hover {
    color: var(--text-primary);
    background: var(--bg-card-hover);
}

.strike-pill.active {
    background: var(--accent);
    color: var(--on-accent);
    box-shadow: 0 0 12px rgba(var(--accent-rgb), 0.2);
}

.strike-pill.active .strike-badge {
    background: rgba(var(--bg-primary-rgb), 0.25);
    color: var(--on-accent);
}

.strike-badge {
    font-size: 0.6rem;
    font-weight: 700;
    padding: 0.1rem 0.35rem;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.strike-badge.itm {
    background: rgba(var(--success-rgb), 0.15);
    color: var(--success);
}

.strike-badge.atm {
    background: rgba(var(--accent-rgb), 0.15);
    color: var(--accent);
}

.strike-badge.otm {
    background: rgba(var(--text-secondary-rgb), 0.1);
    color: var(--text-muted);
}

/* Tab Content */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* ===========================
   Market Sub-tabs (Buyer / Seller)
   Mirrors .tab-nav / .tab-btn / .tab-content. Buttons reuse .tab-btn for look;
   .market-subtab-content visibility mirrors .tab-content (class-driven, no inline
   styles). #market-iv-signal (top) and Claims (bottom) live outside these wrappers
   so they show on both sub-tabs.
   =========================== */
.market-subtab-nav {
    display: flex;
    gap: 0.25rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.25rem;
    margin-bottom: 1.5rem;
}

.market-subtab-btn.active {
    background: var(--accent);
    color: var(--on-accent);
}

.market-subtab-content {
    display: none;
}

.market-subtab-content.active {
    display: block;
}

/* Buyer empty-state — shown when no bucket has fillable liquidity.
   Uses gyro's teal accent; friendly voice; points the user to the Seller sub-tab. */
.depth-empty-state {
    margin-top: 1.25rem;
    padding: 1.5rem 1.25rem;
    text-align: center;
    background: linear-gradient(160deg, var(--accent-glow), rgba(var(--accent-rgb), 0.04));
    border: 1px dashed var(--accent);
    border-radius: var(--radius-lg);
}

.depth-empty-state-icon {
    font-size: 1.75rem;
    color: var(--accent);
    margin-bottom: 0.5rem;
}

.depth-empty-state-title {
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.4rem;
}

.depth-empty-state-body {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.55;
    max-width: 30rem;
    margin: 0 auto 0.85rem;
}

.depth-empty-state-cta {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0;
}

.depth-empty-state-link {
    display: inline-block;
    margin-top: 0.35rem;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: var(--radius-full);
    background: var(--accent);
    color: var(--on-accent);
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
}

.depth-empty-state-link:hover {
    background: var(--accent-light);
    color: var(--on-accent);
}

/* ===========================
   Market Tab
   =========================== */
.market-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    margin-bottom: 1.25rem;
}

.market-section .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.market-section .section-header h3 {
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Market Controls (Calls/Puts toggle) */
.market-controls {
    display: flex;
    gap: 0.25rem;
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
    padding: 0.2rem;
}

.btn-toggle {
    padding: 0.4rem 0.9rem;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-toggle:hover {
    color: var(--text-primary);
}

.btn-toggle.active {
    background: var(--accent);
    color: var(--on-accent);
}

/* Market Info Bar */
.market-info-bar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
}

.market-info-bar span {
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.market-info-bar strong {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-primary);
    margin-top: 0.15rem;
}

/* Depth Chart */
.depth-chart {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 140px;
    padding: 0.5rem 0;
    min-height: 80px;
}

.depth-bar {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    height: 100%;
    cursor: pointer;
    position: relative;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    transition: var(--transition-fast);
}

.depth-bar:hover {
    opacity: 0.85;
}

.depth-bar-fill {
    background: linear-gradient(to top, var(--accent-dark), var(--accent));
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    transition: height 0.4s ease;
    min-height: 2px;
}

.depth-bar:hover .depth-bar-fill {
    box-shadow: 0 0 8px var(--accent-glow);
}

.depth-bar-label {
    position: absolute;
    bottom: -18px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.6rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
    white-space: nowrap;
}

.depth-bar-amount {
    position: absolute;
    top: -16px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.6rem;
    color: var(--text-secondary);
    font-family: var(--font-mono);
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.2s;
}

.depth-bar:hover .depth-bar-amount {
    opacity: 1;
}

.depth-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-style: italic;
}

.depth-legend {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.25rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
}

.depth-legend-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.legend-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.legend-dot.accent {
    background: var(--accent);
}

.depth-legend-hint {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-style: italic;
}

/* ===== Options Chain table (buyer view) ===== */
.options-chain {
    width: 100%;
    overflow-x: auto;
}

.options-chain-table {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--font-mono);
}

.options-chain-table thead th {
    padding: 0.5rem 0.6rem;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
    text-align: center;
}

.options-chain-table .chain-th-call { text-align: left; color: var(--success); }
.options-chain-table .chain-th-put  { text-align: right; color: var(--danger); }
.options-chain-table .chain-th-strike { color: var(--text-primary); }

.chain-row {
    transition: var(--transition-fast);
}

.chain-row:hover {
    background: var(--bg-card-hover);
}

.chain-row-active {
    background: var(--accent-glow);
}

.chain-cell,
.chain-strike {
    padding: 0.55rem 0.6rem;
    font-size: 0.85rem;
    border-bottom: 1px solid var(--border);
}

.chain-strike {
    text-align: center;
    font-weight: 700;
    color: var(--text-primary);
    background: var(--bg-primary);
    white-space: nowrap;
}

.chain-cell-call { text-align: left; }
.chain-cell-put  { text-align: right; }

.chain-cell-empty {
    color: var(--text-muted);
    text-align: center;
}

.chain-cell-live {
    cursor: pointer;
}

.chain-cell-live .chain-price {
    display: inline-block;
    font-weight: 600;
    color: var(--accent);
}

.chain-cell-call.chain-cell-live .chain-price { color: var(--success); }
.chain-cell-put.chain-cell-live  .chain-price { color: var(--danger); }

.chain-cell-live .chain-depth {
    display: block;
    font-size: 0.62rem;
    color: var(--text-muted);
    margin-top: 0.1rem;
}

.chain-cell-live:hover {
    background: var(--bg-card-hover);
}

.chain-cell-live:hover .chain-price {
    text-decoration: underline;
}

.chain-cell-live:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: -2px;
}

.chain-spot-row td {
    padding: 0.2rem 0.6rem;
    text-align: center;
    border-bottom: 1px dashed var(--accent);
    background: transparent;
}

.chain-spot-label {
    display: inline-block;
    font-size: 0.64rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--accent);
}

/* Options List */
.options-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.option-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1rem;
    transition: var(--transition-fast);
}

.option-card:hover {
    border-color: var(--border-light);
}

.option-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.option-type {
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.option-details {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-family: var(--font-mono);
}

.option-status {
    font-size: 0.7rem;
    font-weight: 500;
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-sm);
}

.option-status.active {
    background: rgba(var(--accent-rgb), 0.15);
    color: var(--accent);
}

.option-status.exercisable {
    background: rgba(var(--success-rgb), 0.15);
    color: var(--success);
}

.option-status.expired {
    background: rgba(var(--danger-rgb), 0.15);
    color: var(--danger);
}

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

.exercise-buttons {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.btn-exercise {
    background: var(--success);
    color: #fff;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.8rem;
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-exercise:hover {
    filter: brightness(1.15);
    box-shadow: 0 0 12px rgba(var(--success-rgb), 0.3);
}

.btn-exercise:disabled {
    background: var(--text-muted);
    cursor: not-allowed;
    box-shadow: none;
    filter: none;
}

/* Claims */
.claims-display {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.claim-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-primary);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.claim-token {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.claim-amount {
    font-family: var(--font-mono);
    font-size: 0.95rem;
    color: var(--accent);
    font-weight: 500;
}

.btn-claim {
    background: var(--accent);
    color: var(--on-accent);
    border: none;
    padding: 0.4rem 0.9rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.8rem;
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-claim:hover {
    background: var(--accent-light);
    box-shadow: var(--shadow-glow);
}

/* Seller Positions */
.seller-entry {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
}

.seller-entry:last-child {
    margin-bottom: 0;
}

.seller-entry-info {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.seller-entry-info strong {
    color: var(--text-primary);
    font-family: var(--font-mono);
}

.btn-cancel-entry {
    background: transparent;
    border: 1px solid var(--danger);
    color: var(--danger);
    padding: 0.35rem 0.7rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-cancel-entry:hover {
    background: var(--danger);
    color: #fff;
}

/* Market Not Deployed state */
.market-not-deployed {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--text-muted);
}

.market-not-deployed i {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    display: block;
    color: var(--text-muted);
}

.market-not-deployed p {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.market-not-deployed span {
    font-size: 0.85rem;
}

/* Themed selects + bare number inputs.
 * Originally scoped to .market-section select only, but the write-options
 * disclosure on the Vault tab also contains selects and the Market-tab
 * seller-shares input is a bare <input type="number"> without the
 * .input-with-max wrapper — both fell through to browser defaults
 * (white background, Arial). Broaden the rule to cover deposit panels,
 * market sections, and write-options bodies. */
.market-section select,
.action-panel select,
.write-options-body select,
.market-section input[type="number"]:not(.input-with-max input),
.write-options-body input[type="number"],
.lp-content > .input-row input[type="number"],
.lp-content > .input-group input[type="number"] {
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.75rem;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    width: 100%;
    cursor: pointer;
    outline: none;
    transition: var(--transition-fast);
}

.market-section select:focus,
.action-panel select:focus,
.write-options-body select:focus,
.market-section input[type="number"]:focus,
.write-options-body input[type="number"]:focus,
.lp-content input[type="number"]:focus {
    border-color: var(--accent);
}

/* Mobile Adjustments */
@media (max-width: 480px) {
    .header {
        padding: 0.75rem 1rem;
    }

    .brand-text h1 {
        font-size: 1.25rem;
    }

    .main-content {
        padding: 1.5rem 1rem;
    }

    .status-value {
        font-size: 1.25rem;
    }

    .action-buttons {
        flex-direction: column;
    }

    .panel-actions {
        flex-direction: column;
    }

    .panel-actions .btn-action {
        width: 100%;
    }

    .strike-pill {
        padding: 0.4rem 0.65rem;
        font-size: 0.75rem;
    }

    .strike-badge {
        font-size: 0.55rem;
    }

    .market-info-bar {
        grid-template-columns: repeat(2, 1fr);
    }

    .option-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .option-actions {
        width: 100%;
    }

    .option-actions .btn-exercise {
        width: 100%;
    }

    .depth-chart {
        height: 100px;
    }

    .claim-row {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .tab-btn {
        font-size: 0.85rem;
        padding: 0.6rem 0.75rem;
    }
}

/* ===========================
   P&L Badges (ITM/OTM)
   =========================== */
.pnl-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-sm);
    margin-left: 0.35rem;
    font-family: var(--font-mono);
    vertical-align: middle;
}

.pnl-badge.itm {
    background: rgba(var(--success-rgb), 0.15);
    color: var(--success);
}

.pnl-badge.otm {
    background: rgba(var(--text-secondary-rgb), 0.1);
    color: var(--text-muted);
}

/* ===========================
   Option Row Styles
   =========================== */
.option-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1rem;
    transition: var(--transition-fast);
    flex-wrap: wrap;
    gap: 0.5rem;
}

.option-row:hover {
    border-color: var(--border-light);
}

.option-row .option-info {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
}

.option-side {
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 700;
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
}

.option-side.call {
    background: rgba(var(--accent-rgb), 0.15);
    color: var(--accent);
}

.option-side.put {
    background: rgba(var(--warning-rgb), 0.15);
    color: var(--warning);
}

.option-notional {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-primary);
    font-weight: 500;
}

.option-strike,
.option-expiry {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.option-status.status-active {
    font-size: 0.7rem;
    font-weight: 500;
    padding: 0.15rem 0.45rem;
    border-radius: var(--radius-sm);
    background: rgba(var(--accent-rgb), 0.15);
    color: var(--accent);
}

.option-status.status-exercised {
    font-size: 0.7rem;
    font-weight: 500;
    padding: 0.15rem 0.45rem;
    border-radius: var(--radius-sm);
    background: rgba(var(--success-rgb), 0.15);
    color: var(--success);
}

.option-status.status-expired {
    font-size: 0.7rem;
    font-weight: 500;
    padding: 0.15rem 0.45rem;
    border-radius: var(--radius-sm);
    background: rgba(var(--danger-rgb), 0.15);
    color: var(--danger);
}

/* Small action buttons */
.btn-sm {
    padding: 0.4rem 0.8rem !important;
    font-size: 0.8rem !important;
}

/* ===========================
   Fill Premium Preview
   =========================== */
.fill-premium-preview {
    background: var(--bg-primary);
    border: 1px solid var(--accent-dark);
    border-radius: var(--radius-sm);
    padding: 0.65rem 1rem;
    margin-bottom: 1rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
}

.premium-preview-label {
    color: var(--text-secondary);
    font-weight: 500;
}

.premium-preview-value {
    font-family: var(--font-mono);
    font-weight: 600;
    color: var(--accent);
}

.premium-preview-tranches {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-style: italic;
}

.premium-preview-partial {
    font-size: 0.75rem;
    color: var(--warning);
    font-weight: 500;
}

/* K2a — Market-tab seller info + greeks */
.premium-preview-iv,
.premium-preview-delta,
.premium-preview-intrinsic {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
    white-space: nowrap;
}

.premium-preview-delta {
    font-family: var(--font-mono);
}

.write-preview-fill {
    font-size: 0.75rem;
    font-weight: 500;
    margin-top: 0.4rem;
    padding-top: 0.4rem;
    border-top: 1px dashed var(--border, rgba(255, 255, 255, 0.08));
}

.fill-good { color: var(--success); }
.fill-warn { color: var(--warning); }
.fill-muted { color: var(--text-muted); }
.money-good { color: var(--success); }
.money-warn { color: var(--warning); }

.seller-pos-queue,
.seller-pos-contrib {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.seller-pos-fill,
.seller-pos-moneyness {
    font-size: 0.72rem;
    font-weight: 500;
    padding: 0.1rem 0.4rem;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.04);
}

/* ===========================
   Seller Position Row
   =========================== */
.seller-position-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
}

.seller-position-row:last-child {
    margin-bottom: 0;
}

.seller-pos-info {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.seller-pos-iv {
    font-family: var(--font-mono);
    font-weight: 600;
    color: var(--text-primary);
}

.seller-pos-shares {
    font-family: var(--font-mono);
    color: var(--text-secondary);
}

.seller-pos-min {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.seller-pos-actions {
    display: flex;
    gap: 0.35rem;
    flex-shrink: 0;
}

.status-expired {
    font-size: 0.7rem;
    font-weight: 500;
    padding: 0.15rem 0.45rem;
    border-radius: var(--radius-sm);
    background: rgba(var(--danger-rgb), 0.15);
    color: var(--danger);
}

/* Depth chart bars container */
.depth-bars {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 100%;
    width: 100%;
}

.depth-bar-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    cursor: pointer;
    position: relative;
}

.depth-bar-wrapper .depth-bar {
    width: 100%;
    background: linear-gradient(to top, var(--accent-dark), var(--accent));
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    transition: height 0.4s ease;
    min-height: 2px;
}

.depth-bar-wrapper:hover .depth-bar {
    box-shadow: 0 0 8px var(--accent-glow);
    opacity: 0.85;
}

.depth-bar-wrapper .depth-bar-label {
    font-size: 0.6rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
    margin-top: 4px;
    white-space: nowrap;
}

.depth-bar-wrapper .depth-bar-shares {
    font-size: 0.55rem;
    color: var(--text-secondary);
    font-family: var(--font-mono);
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.2s;
    position: absolute;
    top: -14px;
}

.depth-bar-wrapper:hover .depth-bar-shares {
    opacity: 1;
}

/* Mobile adjustments for new elements */
@media (max-width: 480px) {
    .option-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .option-row .exercise-buttons {
        width: 100%;
    }

    .option-row .exercise-buttons .btn-sm {
        flex: 1;
    }

    .seller-position-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .seller-pos-actions {
        width: 100%;
    }

    .seller-pos-actions .btn-sm {
        flex: 1;
    }

    .fill-premium-preview {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ===========================
   Deposit Mode Toggle
   =========================== */
.deposit-mode-toggle {
    display: flex;
    background: var(--bg-primary);
    border-radius: var(--radius-full);
    padding: 3px;
    margin-bottom: 1rem;
    border: 1px solid var(--border);
}

.deposit-mode-toggle .mode-btn {
    flex: 1;
    padding: 0.5rem 1rem;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: var(--transition-fast);
}

.deposit-mode-toggle .mode-btn:hover {
    color: var(--text-primary);
}

.deposit-mode-toggle .mode-btn.active {
    background: var(--accent);
    color: var(--on-accent);
    font-weight: 600;
}

/* ===========================
   Token Selector
   =========================== */
.token-selector {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.token-btn {
    flex: 1;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    background: var(--bg-primary);
    color: var(--text-secondary);
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition-fast);
    text-align: center;
}

.token-btn:hover {
    border-color: var(--accent-dark);
    color: var(--text-primary);
}

.token-btn.active {
    border-color: var(--accent);
    background: rgba(var(--accent-rgb), 0.1);
    color: var(--accent);
    font-weight: 600;
}

/* ===========================
   Preview Section Label
   =========================== */
.preview-section-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid var(--border);
}

/* ===========================
   Spin Animation
   =========================== */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.spin {
    display: inline-block;
    animation: spin 1s linear infinite;
}

/* ===========================
   Quote Refresh Indicator
   =========================== */
.quote-refresh-indicator {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-style: italic;
    padding-top: 0.4rem;
    border-top: 1px solid var(--border);
    margin-top: 0.4rem;
}

.quote-refresh-indicator .spin {
    font-size: 0.8rem;
    color: var(--accent-dark);
}

/* Mobile: token selector + mode toggle */
@media (max-width: 480px) {
    .deposit-mode-toggle {
        flex-direction: row;
    }

    .deposit-mode-toggle .mode-btn {
        font-size: 0.8rem;
        padding: 0.4rem 0.5rem;
    }

    .token-selector {
        flex-wrap: wrap;
    }

    .token-btn {
        font-size: 0.8rem;
        padding: 0.4rem 0.5rem;
    }
}

/* Button active/dimmed states for deposit/withdraw */
.btn-action.active {
    box-shadow: 0 0 0 2px var(--accent);
}

.btn-action.dimmed {
    opacity: 0.4;
    /* No pointer-events: none — dimmed means "not the active panel" but the
     * button must still be clickable so the user can toggle from Deposit to
     * Withdraw or vice-versa without first clicking Cancel. */
}

.btn-action.dimmed:hover {
    opacity: 0.65;
}

/* You Receive multi-line display */
.receive-line {
    display: flex;
    align-items: baseline;
    gap: 0.25rem;
    line-height: 1.6;
}

.receive-amount {
    font-family: var(--font-mono);
    font-weight: 500;
}

.receive-symbol {
    font-size: 0.85em;
    opacity: 0.8;
}

.receive-usd {
    font-size: 0.8em;
    color: var(--text-muted);
}

/* Pending fee row */
.fee-event-row.fee-pending {
    color: var(--accent);
    font-weight: 500;
    border-bottom: 1px solid var(--accent);
    opacity: 0.9;
}

.fee-event-row.fee-pending span:first-child::before {
    content: '\23F3  ';
}

/* ===========================
   Write Options Disclosure
   =========================== */
.write-options-box {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-primary);
}

.write-options-summary {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 500;
    list-style: none;
}

.write-options-summary::-webkit-details-marker {
    display: none;
}

.write-options-summary .chevron {
    margin-left: auto;
    transition: var(--transition-fast);
}

.write-options-box[open] .write-options-summary .chevron {
    transform: rotate(180deg);
}

.write-options-hint {
    color: var(--text-secondary);
    font-weight: 400;
    font-size: 0.8rem;
}

.write-options-body {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.write-options-description {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.4;
    margin: 0;
}

.write-fraction-value {
    margin-left: auto;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 400;
}

#write-fraction {
    width: 100%;
    accent-color: var(--accent);
}

.write-preview-box {
    margin-top: 0.5rem;
}

.write-preview-empty {
    padding: 0.75rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-align: center;
    background: var(--bg-card);
    border: 1px dashed var(--border);
    border-radius: var(--radius-sm);
}

.write-side-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-style: italic;
    padding: 0.5rem 0.75rem;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--accent);
}

.write-side-label:empty {
    display: none;
}

/* P3 — narrative settlement note on Deposit / Withdraw panels.
   Same italic, accent-bordered treatment as .write-side-label. */
.settlement-note {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-style: italic;
    line-height: 1.45;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.85rem;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--accent);
}

.settlement-note:empty {
    display: none;
}

.pending-bucket-banner {
    position: fixed;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    max-width: 560px;
    width: calc(100% - 2rem);
    background: var(--bg-card);
    border: 1px solid var(--warning, #f7931a);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    display: none;
}

.pending-bucket-inner {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.pending-bucket-text {
    flex: 1;
    font-size: 0.85rem;
    color: var(--text-primary);
    line-height: 1.4;
}

.pending-bucket-actions {
    display: flex;
    gap: 0.5rem;
}

.pending-bucket-actions .btn-action {
    font-size: 0.8rem;
    padding: 0.4rem 0.75rem;
}

.seller-available-banner {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 0.85rem;
    margin-bottom: 0.75rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.seller-available-banner strong {
    color: var(--text-primary);
    font-family: var(--font-mono);
}

.btn-max-seller {
    margin-left: auto;
    padding: 0.25rem 0.6rem;
    font-size: 0.7rem;
    background: var(--accent);
    color: var(--on-accent);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 600;
}

.btn-max-seller:hover {
    opacity: 0.85;
}

/* ===========================
   Vault operational state (G-05 / G-13)
   =========================== */

/* Keeper-health pill — sits under the epoch countdown in its status card. */
.keeper-health {
    display: inline-block;
    margin-top: 0.5rem;
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-full);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    line-height: 1.3;
    white-space: nowrap;
}
.keeper-health.keeper-ok {
    color: var(--success);
    background: rgba(var(--success-rgb), 0.12);
    border: 1px solid rgba(var(--success-rgb), 0.4);
}
.keeper-health.keeper-new {
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border, rgba(255, 255, 255, 0.12));
}
.keeper-health.keeper-stale {
    color: var(--warning);
    background: rgba(var(--warning-rgb), 0.14);
    border: 1px solid var(--warning);
}

/* Vault-paused banner — same layout as the wrong-chain banner. */
.paused-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 0.75rem;
    padding: 0.65rem 1rem;
    background: rgba(var(--warning-rgb), 0.1);
    border: 1px solid var(--warning);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
    color: var(--warning);
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
}
.paused-banner i {
    font-size: 1.05rem;
}

/* Poke eligibility preview (G-12) — sits under the action buttons; read-only
   bounty / cooldown / eligibility hints for the Poke action. */
.poke-preview {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.4rem 0.7rem;
    margin-top: 0.6rem;
    font-size: 0.74rem;
    line-height: 1.3;
}
.poke-preview-status {
    font-weight: 600;
    padding: 0.15rem 0.55rem;
    border-radius: var(--radius-full);
}
.poke-preview-status.poke-eligible {
    color: var(--success);
    background: rgba(var(--success-rgb), 0.12);
    border: 1px solid rgba(var(--success-rgb), 0.4);
}
.poke-preview-status.poke-ineligible {
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border, rgba(255, 255, 255, 0.12));
}
.poke-preview-detail {
    color: var(--text-secondary);
    font-weight: 500;
}

/* Active-tick GAP (G-13) — an empty LP slot inside the active range. */
.tick.tick-gap {
    position: relative;
    border: 1px solid var(--warning) !important;
    box-shadow: inset 0 0 0 1px rgba(var(--warning-rgb), 0.35);
    background:
        repeating-linear-gradient(
            45deg,
            rgba(var(--warning-rgb), 0.18) 0,
            rgba(var(--warning-rgb), 0.18) 6px,
            transparent 6px,
            transparent 12px
        );
}
.tick-gap-badge {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 0.05rem 0.35rem;
    border-radius: var(--radius-sm);
    background: var(--warning);
    color: var(--on-accent);
    font-size: 0.6rem;
    font-weight: 700;
    white-space: nowrap;
    pointer-events: none;
}
.tick-gap-caption {
    margin-top: 0.5rem;
    color: var(--warning);
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
}
:is(#order-book-board, #buy-option-panel, #markets-pause-state)[hidden] { display: none !important; }
.venue-control { display: contents; }
.venue-control:disabled > button { font-size: 0; }
.venue-control:disabled > button > * { display: none; }
.venue-control:disabled > button::after { content: 'Closed'; font-size: .9rem; }
