:root {
    /* Colors */
    --theme-color: #1CA1F2;
    --trim-color: #f59e0b;
    --profit-color: #28a745;
    --text-primary: #374151;
    --text-secondary: #6b7280;
    /* Spacing scaled up by ~10% */
    --spacing-sm: 11px;
    --spacing-md: 17px;
    --spacing-lg: 22px;
    /* Other */
    --border-radius: 8px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.12);
    --shadow-md: 0 4px 20px rgba(0,0,0,0.15);
    /* Journal colors */
    --journal-color: #10b981;
    --journal-secondary: #059669;
}

html {
    line-height: 1.15;
    -webkit-text-size-adjust: 100%;
}

* {
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 0;
}

body {
    background: 
        radial-gradient(circle at 80% 20%, rgba(194, 229, 255, 0.2) 0%, transparent 40%),
        linear-gradient(135deg, #ffffff 0%, #e6f3ff 50%, #c2e5ff 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.calculator-container {
    max-width: 990px;
    width: 90%;
    max-height: 92vh;
    overflow: auto;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    padding: var(--spacing-lg);
    margin: 16px;
    contain: layout style;
    -ms-overflow-style: thin;
    scrollbar-width: thin;
    scrollbar-color: #ddd transparent;
}

.calculator-container::-webkit-scrollbar {
    width: 6px;
}

.calculator-container::-webkit-scrollbar-thumb {
    background-color: #ddd;
    border-radius: 3px;
}

.calculator-title {
    font-size: 29px;
    font-weight: bold;
    text-align: center;
    margin: 0 0 var(--spacing-md) 0;
    color: var(--theme-color);
}

.calculator-subtitle {
    font-size: 17px;
    font-weight: 400;
    text-align: center;
    margin: -11px 0 0 0;
    color: var(--text-secondary);
    line-height: 1.4;
    font-style: italic;
}



/* ==========================================================================
   SIMPLE TOOLTIP
   ========================================================================== */

.simple-tooltip {
    position: fixed;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    line-height: 1.3;
    max-width: 250px;
    z-index: 1000;
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
    white-space: nowrap;
}

.simple-tooltip.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Dark theme */
[data-theme="dark"] .simple-tooltip {
    background: rgba(255, 255, 255, 0.9);
    color: #1f2937;
}

/* Mobile: hide tooltips on small screens */
@media (max-width: 768px) {
    .simple-tooltip {
        display: none;
    }
}

/* ==========================================================================
   SNAPSHOT MANAGEMENT
   ========================================================================== */

.snapshots-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.snapshots-modal-content {
    background: white;
    border-radius: 12px;
    max-width: 800px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.snapshots-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
}

.snapshots-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #374151;
}

.modal-close {
    background: #e5e7eb;
    border: 1px solid #d1d5db;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    color: #374151;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
}

.modal-close:hover {
    background: #d1d5db;
    color: #1f2937;
    border-color: #9ca3af;
}

.snapshots-list {
    max-height: 60vh;
    overflow-y: auto;
    padding: 16px;
}

.snapshot-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
    transition: box-shadow 0.2s ease, border-color 0.2s ease, opacity 0.3s ease, transform 0.3s ease;
}

.snapshot-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: #d1d5db;
}

.snapshot-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.snapshot-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.snapshot-ticker-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.snapshot-ticker {
    font-weight: 600;
    font-size: 16px;
    color: #1CA1F2;
}

.snapshot-date {
    font-size: 13px;
    color: #6b7280;
}

.snapshot-actions {
    display: flex;
    gap: 8px;
}

.snapshot-action {
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    padding: 6px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.snapshot-action:hover {
    background: #f3f4f6;
}

.snapshot-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.snapshot-row {
    display: flex;
    gap: 16px;
    align-items: center;
}

.snapshot-label {
    font-weight: 500;
    color: #6b7280;
    min-width: 60px;
    font-size: 13px;
}

.snapshot-value {
    font-weight: 600;
    color: #374151;
    font-size: 13px;
}

.snapshot-notes {
    display: flex;
    gap: 8px;
    align-items: flex-start;
}

.snapshot-notes .snapshot-label {
    min-width: 50px;
}

.snapshot-notes .snapshot-value {
    flex: 1;
    font-weight: normal;
    color: #6b7280;
    font-style: italic;
}

/* Status Pills */
.status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px 10px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.3px;
    text-align: center;
    white-space: nowrap;
}

.status-open {
    background: #d1fae5;
    color: #065f46;
}

.status-trimmed {
    background: #fef3c7;
    color: #92400e;
}

.status-closed {
    background: #e5e7eb;
    color: #6b7280;
}

/* Open Risk Banner */
.open-risk-banner {
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    border-bottom: 1px solid #e5e7eb;
}

.open-risk-banner.risk-low {
    background: #d1fae5;
    color: #065f46;
}

.open-risk-banner.risk-medium {
    background: #fef3c7;
    color: #78350f;
}

.open-risk-banner.risk-high {
    background: #fee2e2;
    color: #991b1b;
}

.open-risk-banner .risk-icon {
    font-size: 18px;
}

.open-risk-banner .risk-detail {
    font-weight: normal;
    opacity: 0.8;
}

/* Filter Bar */
.snapshots-filter-bar {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}

.filter-btn {
    padding: 8px 16px;
    border: 1px solid #d1d5db;
    background: white;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-btn:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.filter-btn.active {
    background: #1CA1F2;
    color: white;
    border-color: #1CA1F2;
}

/* Snapshot Action Row */
.snapshot-action-row {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e5e7eb;
}

.snapshot-status-action {
    width: 100%;
    padding: 10px 16px;
    background: #1CA1F2;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.snapshot-status-action:hover {
    background: #1890d9;
}

/* Trimmed Info Display */
.snapshot-trimmed-info {
    margin-top: 12px;
    padding: 12px;
    background: #fef3c7;
    border: 1px solid #fbbf24;
    border-radius: 6px;
}

.trim-summary-header {
    font-size: 14px;
    color: #78350f;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #fbbf24;
}

.trim-detail {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    font-size: 13px;
    color: #78350f;
}

.trim-detail:last-child {
    margin-bottom: 0;
}

.trim-icon {
    font-size: 14px;
}

.trim-exit-rule {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #fbbf24;
    font-weight: 600;
}

/* Highlight 5R Target */
.snapshot-5r-highlight {
    color: #10b981 !important;
    font-weight: 700 !important;
}

/* Highlight Risk % */
.snapshot-risk-highlight {
    color: #f59e0b !important;
    font-weight: 700 !important;
}

/* Trim Modal Styles */
.trim-summary {
    padding: 12px;
    background: #f3f4f6;
    border-radius: 6px;
    margin-bottom: 16px;
}

.trim-percent-buttons {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.trim-percent-btn {
    padding: 8px 16px;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s ease;
}

.trim-percent-btn:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.trim-percent-btn.active {
    background: #1CA1F2;
    color: white;
    border-color: #1CA1F2;
}

/* Trim Modal Styles */

.trim-summary p {
    margin: 4px 0;
    font-size: 14px;
    color: #374151;
}

.trim-preview {
    margin-top: 12px;
    padding: 12px;
    background: #ecfdf5;
    border: 1px solid #10b981;
    border-radius: 6px;
}

.trim-preview.error {
    background: #fee2e2;
    border-color: #dc2626;
}

.trim-preview h4 {
    margin: 0 0 8px 0;
    font-size: 14px;
    color: #065f46;
}

.trim-preview.error h4 {
    color: #dc2626;
}

.trim-preview p {
    margin: 4px 0;
    font-size: 13px;
    color: #047857;
}

.trim-preview.error p {
    color: #dc2626;
}

.input-hint {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: #6b7280;
    font-style: italic;
}

/* Edit Modal */
.edit-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1100;
}

.edit-modal-content {
    background: white;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.edit-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
}

.edit-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #374151;
}

.edit-form {
    padding: 24px;
}

.edit-group {
    margin-bottom: 20px;
}

.edit-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #374151;
    font-size: 14px;
}

.edit-group input,
.edit-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s ease;
}

.edit-group input:focus,
.edit-group textarea:focus {
    outline: none;
    border-color: #1CA1F2;
    box-shadow: 0 0 0 3px rgba(28, 161, 242, 0.1);
}

.edit-group textarea {
    min-height: 80px;
    resize: vertical;
}

.edit-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

.btn-primary,
.btn-secondary {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary {
    background: #1CA1F2;
    color: white;
}

.btn-primary:hover {
    background: #0d8bd9;
}

.btn-secondary {
    background: #f3f4f6;
    color: #374151;
}

.btn-secondary:hover {
    background: #e5e7eb;
}

/* Dark theme support */
[data-theme="dark"] .snapshots-modal-content,
[data-theme="dark"] .edit-modal-content {
    background: #1f2937;
    color: #f9fafb;
}

[data-theme="dark"] .snapshots-modal-header,
[data-theme="dark"] .edit-modal-header {
    background: #374151;
    border-bottom-color: #4b5563;
}

[data-theme="dark"] .snapshots-modal-header h3,
[data-theme="dark"] .edit-modal-header h3 {
    color: #f9fafb;
}

[data-theme="dark"] .snapshot-card {
    background: #374151;
    border-color: #4b5563;
    color: #f9fafb;
}

[data-theme="dark"] .snapshot-card:hover {
    border-color: #6b7280;
}

[data-theme="dark"] .snapshot-ticker {
    color: #60a5fa;
}

[data-theme="dark"] .snapshot-label {
    color: #9ca3af;
}

[data-theme="dark"] .snapshot-value {
    color: #f9fafb;
}

[data-theme="dark"] .snapshot-notes .snapshot-value {
    color: #d1d5db;
}

[data-theme="dark"] .status-open {
    background: #064e3b;
    color: #d1fae5;
}

[data-theme="dark"] .status-trimmed {
    background: #78350f;
    color: #fef3c7;
}

[data-theme="dark"] .status-closed {
    background: #4b5563;
    color: #d1d5db;
}

[data-theme="dark"] .snapshots-filter-bar {
    background: #374151;
    border-bottom-color: #4b5563;
}

[data-theme="dark"] .filter-btn {
    background: #4b5563;
    border-color: #6b7280;
    color: #f9fafb;
}

[data-theme="dark"] .filter-btn:hover {
    background: #6b7280;
}

[data-theme="dark"] .filter-btn.active {
    background: #1CA1F2;
    border-color: #1CA1F2;
}

[data-theme="dark"] .snapshot-action-row {
    border-top-color: #4b5563;
}

[data-theme="dark"] .snapshot-trimmed-info {
    background: #78350f;
    border-color: #92400e;
}

[data-theme="dark"] .trim-summary-header {
    color: #fef3c7;
    border-bottom-color: #92400e;
}

[data-theme="dark"] .trim-detail {
    color: #fef3c7;
}

[data-theme="dark"] .trim-exit-rule {
    border-top-color: #92400e;
}

[data-theme="dark"] .trim-summary {
    background: #374151;
}

[data-theme="dark"] .trim-summary p {
    color: #f9fafb;
}

[data-theme="dark"] .trim-preview {
    background: #064e3b;
    border-color: #065f46;
}

[data-theme="dark"] .trim-preview.error {
    background: #7f1d1d;
    border-color: #dc2626;
}

[data-theme="dark"] .trim-preview h4 {
    color: #d1fae5;
}

[data-theme="dark"] .trim-preview.error h4 {
    color: #fca5a5;
}

[data-theme="dark"] .trim-preview p {
    color: #a7f3d0;
}

[data-theme="dark"] .trim-preview.error p {
    color: #fca5a5;
}

[data-theme="dark"] .input-hint {
    color: #9ca3af;
}

[data-theme="dark"] .edit-group input,
[data-theme="dark"] .edit-group textarea,
[data-theme="dark"] .edit-group select {
    background: #374151;
    border-color: #6b7280;
    color: #f9fafb;
}

[data-theme="dark"] .edit-group input:focus,
[data-theme="dark"] .edit-group textarea:focus {
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.1);
}

[data-theme="dark"] .edit-group label {
    color: #f9fafb;
}

[data-theme="dark"] .edit-actions {
    border-top-color: #4b5563;
}

[data-theme="dark"] .btn-secondary {
    background: #4b5563;
    color: #f9fafb;
}

[data-theme="dark"] .btn-secondary:hover {
    background: #6b7280;
}

[data-theme="dark"] .modal-close {
    background: #6b7280;
    border-color: #9ca3af;
    color: #f9fafb;
}

[data-theme="dark"] .modal-close:hover {
    background: #9ca3af;
    color: #1f2937;
    border-color: #d1d5db;
}



/* ==========================================================================
   SECTION ORGANIZATION
   ========================================================================== */

/* Main sections */
.calculator-section,
.journal-section {
    width: 100%;
}

.calculator-section {
    /* All existing styles remain the same */
}

.journal-section {
    margin-top: var(--spacing-lg);
    padding-top: var(--spacing-lg);
    border-top: 1px solid #e5e7eb;
}

.journal-section.hidden {
    display: none;
}

/* Calculator output grouping */
.calculator-output {
    /* Groups results, info, and scenarios for better organization */
}

/* Dark mode subtitle */
body.dark-mode .calculator-subtitle {
    color: #9ca3af;
}

body.dark-mode .journal-section {
    border-top-color: #374151;
}

.grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-lg);
    align-items: start;
}

.section-title {
    font-size: 20px;
    font-weight: 600;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 7px;
    margin-bottom: var(--spacing-sm);
    color: var(--theme-color);
}

.input-group {
    margin-bottom: var(--spacing-sm);
    min-height: 80px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

/* Adjust the Target Price section to align with Max % of Account */
.input-group:has(#targetPrice) {
    margin-top: 4px;
}

.input-label {
    display: block;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.input-container {
    position: relative;
}

.input-prefix {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    pointer-events: none;
    font-size: 15px;
}

.input-suffix {
    position: absolute;
    right: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    pointer-events: none;
    font-size: 15px;
}

.text-input, .number-input {
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-sm) var(--spacing-sm) 31px;
    border: 1px solid #d1d5db;
    border-radius: var(--border-radius);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-size: 18px;
    height: 46px;
    appearance: none;
    -webkit-appearance: none;
    will-change: border-color, box-shadow;
}

.text-input:focus, .number-input:focus {
    border-color: var(--theme-color);
    box-shadow: 0 0 0 2px rgba(28, 161, 242, 0.2);
}

/* Error state styles */
.text-input.error, .number-input.error {
    border-color: #ef4444;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
}

.text-input.error:focus, .number-input.error:focus {
    border-color: #ef4444;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.3);
}

.number-input-pct {
    padding-right: 31px;
}

.helper-text {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.error-text {
    font-size: 14px;
    color: #ef4444;
    margin-top: 4px;
}

/* Risk header with scenarios button */
.risk-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.quick-scenarios-button {
    background-color: rgba(28, 161, 242, 0.1);
    color: var(--theme-color);
    border: 1px solid rgba(28, 161, 242, 0.2);
    border-radius: 5px;
    padding: 4px 8px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s ease;
}

.quick-scenarios-button:hover {
    background-color: rgba(28, 161, 242, 0.15);
    border-color: rgba(28, 161, 242, 0.3);
}

.quick-scenarios-button:active {
    transform: scale(0.98);
}

.scenarios-icon {
    font-size: 11px;
    line-height: 1;
}

.risk-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.risk-button {
    padding: 9px 0;
    background-color: #f3f4f6;
    color: var(--text-primary);
    border: none;
    border-radius: var(--border-radius);
    font-weight: 500;
    cursor: pointer;
    flex: 1;
    min-width: 64px;
    font-size: 15px;
    transition: all 0.2s ease;
}

.risk-button:focus {
    outline: 2px solid var(--theme-color);
    outline-offset: 2px;
}

.risk-button.active {
    background-color: var(--theme-color);
    color: white;
}

.clear-button {
    display: block;
    margin: var(--spacing-md) auto;
    background-color: #f3f4f6;
    color: var(--text-primary);
    border: 1px solid #d1d5db;
    border-radius: var(--border-radius);
    padding: 9px var(--spacing-md);
    font-weight: 500;
    cursor: pointer;
    font-size: 15px;
}

.results-section {
    margin-top: var(--spacing-md);
    padding: var(--spacing-md);
    background-color: rgba(28, 161, 242, 0.1);
    border-radius: 8px;
}

.results-title {
    font-size: 20px;
    font-weight: 600;
    border-bottom: 1px solid rgba(28, 161, 242, 0.3);
    padding-bottom: 7px;
    margin-bottom: var(--spacing-md);
    color: var(--theme-color);
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-md);
}

.result-card {
    background-color: white;
    padding: 15px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    border-left: 4px solid var(--theme-color);
}

.result-card.full-width {
    grid-column: 1 / -1;
    padding: var(--spacing-md);
}

.five-r-card {
    margin-top: 4px;
}

.result-label {
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.result-value {
    font-size: 22px;
    font-weight: bold;
    color: var(--theme-color);
}

.result-value.large {
    font-size: 26px;
}

.result-value.trim {
    color: var(--trim-color);
}

.trim-tag {
    display: inline-block;
    margin-left: 7px;
    background-color: #fef3c7;
    color: #92400e;
    font-size: 13px;
    font-weight: 500;
    padding: 3px 7px;
    border-radius: 5px;
}

.info-button {
    display: flex;
    align-items: center;
    background-color: transparent;
    border: none;
    color: var(--theme-color);
    font-weight: 500;
    padding: 0;
    cursor: pointer;
    font-size: 15px;
    margin-top: var(--spacing-md);
}

.info-icon {
    margin-right: 7px;
    font-size: 16px;
    font-weight: bold;
    line-height: 1;
}

.info-content {
    margin-top: 8px;
    padding: 0;
    background-color: #f8fafc;
    border-radius: var(--border-radius);
    border: 1px solid #e2e8f0;
    overflow: hidden;
}

.info-header {
    background-color: var(--theme-color);
    padding: 13px 18px;
    color: white;
}

.info-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.example-scenario {
    padding: 18px;
}

.scenario-intro {
    font-size: 17px;
    color: var(--text-primary);
    margin-bottom: 18px;
    line-height: 1.5;
}

.calculation-steps {
    display: flex;
    flex-direction: column;
    gap: 11px;
    margin-bottom: 18px;
}

.calc-step {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 11px 15px;
    background-color: white;
    border-radius: 6px;
    border-left: 3px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.calc-step.highlight {
    border-left-color: var(--theme-color);
    background-color: rgba(28, 161, 242, 0.05);
}

.step-label {
    font-size: 15px;
    color: var(--text-primary);
    font-weight: 500;
}

.step-value {
    font-size: 15px;
    color: var(--theme-color);
    font-weight: 600;
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
}

.calc-step.highlight .step-value {
    color: var(--theme-color);
    font-weight: 700;
}

.info-conclusion {
    background-color: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 6px;
    padding: 13px;
    text-align: center;
}

.info-conclusion p {
    margin: 0;
    font-size: 15px;
    color: #0369a1;
    font-weight: 500;
}

.hidden {
    display: none;
}

.calculator-footer {
    text-align: center;
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: var(--spacing-md);
    padding-top: var(--spacing-md);
    border-top: 1px solid #e5e7eb;
    line-height: 1.4;
}

.heart {
    color: #ff6b6b;
}

.calculator-footer a {
    color: var(--theme-color);
    text-decoration: none;
}

@media (max-width: 768px) {
    .calculator-container {
        padding: var(--spacing-md);
        max-height: 100%;
        width: 100%;
        margin: 0;
        border-radius: 0;
    }

    .grid, .results-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }

    .calculator-title {
        font-size: 24px;
    }

    .section-title {
        font-size: 18px;
    }

    .text-input, .number-input {
        font-size: 16px;
        height: 44px;
    }
}

.theme-toggle-container {
    display: flex;
    justify-content: center;
    margin-bottom: var(--spacing-lg);
}

.theme-segmented-control {
    display: inline-flex;
    background-color: #f3f4f6;
    border-radius: 8px;
    padding: 4px;
    box-shadow: var(--shadow-sm);
    border: 1px solid #e5e7eb;
}

.theme-segmented-control input {
    display: none;
}

.theme-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 60px;
    background-color: transparent;
    border: none;
}

.theme-option:hover {
    background-color: rgba(156, 163, 175, 0.1);
}

.theme-segmented-control input:checked + .theme-option {
    background-color: white;
    box-shadow: var(--shadow-sm);
    color: var(--theme-color);
}

.theme-icon {
    font-size: 16px;
    line-height: 1;
    margin-bottom: 2px;
}

.theme-label {
    font-size: 11px;
    font-weight: 500;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.theme-segmented-control input:checked + .theme-option .theme-label {
    color: var(--theme-color);
}

body.dark-mode {
    background: 
        radial-gradient(circle at 80% 20%, rgba(15, 52, 96, 0.3) 0%, transparent 40%),
        linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
}

body.dark-mode .calculator-container {
    background-color: rgba(30, 41, 59, 0.95);
    box-shadow: var(--shadow-md);
}

body.dark-mode .calculator-title,
body.dark-mode .section-title,
body.dark-mode .info-button,
body.dark-mode .calculator-footer a {
    color: var(--theme-color);
}

body.dark-mode .input-label,
body.dark-mode .input-suffix,
body.dark-mode .input-prefix {
    color: #d1d5db;
}

body.dark-mode .text-input,
body.dark-mode .number-input {
    background-color: #1f2937;
    border-color: #374151;
    color: #e5e7eb;
}

body.dark-mode .helper-text,
body.dark-mode .calculator-footer {
    color: #9ca3af;
}

body.dark-mode .risk-button {
    background-color: #374151;
    color: #d1d5db;
}

body.dark-mode .risk-button.active {
    background-color: var(--theme-color);
    color: white;
}

body.dark-mode .clear-button {
    background-color: #374151;
    border-color: #4b5563;
    color: #e5e7eb;
}

body.dark-mode .results-section {
    background-color: rgba(28, 161, 242, 0.15);
}

body.dark-mode .result-card {
    background-color: #1f2937;
}

body.dark-mode .result-label {
    color: #9ca3af;
}

body.dark-mode .calculator-container::-webkit-scrollbar-thumb {
    background-color: #4b5563;
}

/* Dark mode styles for quick scenarios button */
body.dark-mode .quick-scenarios-button {
    background-color: rgba(28, 161, 242, 0.15);
    border-color: rgba(28, 161, 242, 0.3);
}

body.dark-mode .quick-scenarios-button:hover {
    background-color: rgba(28, 161, 242, 0.2);
    border-color: rgba(28, 161, 242, 0.4);
}

/* Profit Section */
.profit-section {
    margin-top: var(--spacing-md);
    border-top: 1px solid rgba(28, 161, 242, 0.3);
    padding-top: var(--spacing-md);
}

.profit-section.hidden {
    display: none;
}

.profit-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: var(--spacing-md);
    color: var(--theme-color);
}

.profit-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-md);
}

.result-value.profit {
    color: var(--profit-color);
}

.result-card.profit-card {
    border-left: 3px solid var(--profit-color);
}

@media (max-width: 640px) {
    .profit-grid {
        grid-template-columns: 1fr;
    }
}

/* 💸 Add Profit Button Styles */
.profit-with-button {
    display: flex;
    align-items: center;
    gap: 6px;
}

.add-profit-button {
    background-color: var(--profit-color);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: bold;
    padding: 2px 8px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.add-profit-button:hover {
    background-color: #218838;
}

.add-profit-button:active {
    transform: scale(0.95);
}

body.dark-mode .add-profit-button {
    background-color: var(--profit-color);
    color: white;
}

/* Account Growth Text */
.account-growth-text {
    font-size: 13px;
    font-weight: 500;
    color: var(--profit-color);
    margin-top: 2px;
    opacity: 0.85;
}

.account-growth-text.hidden {
    display: none;
}

/* ==========================================================================
   SEGMENTED EXIT STYLES
   ========================================================================== */

.segment-section {
    margin-top: var(--spacing-md);
    border-top: 1px solid rgba(40, 167, 69, 0.3);
    padding-top: var(--spacing-md);
}

.segment-section.hidden {
    display: none;
}

.segment-toggle-btn {
    background: none;
    border: none;
    color: var(--profit-color);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0;
    transition: opacity 0.2s;
}

.segment-toggle-btn:hover {
    opacity: 0.8;
}

.segment-toggle-icon {
    font-size: 10px;
    transition: transform 0.2s;
}

.segment-toggle-icon.open {
    transform: rotate(90deg);
}

.segment-content {
    margin-top: 12px;
}

.segment-content.hidden {
    display: none;
}

.segment-rows {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.segment-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.segment-row-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 18px;
    text-align: center;
}

.segment-input {
    width: 80px;
    padding: 7px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    text-align: center;
}

.segment-input:focus {
    border-color: var(--profit-color);
    box-shadow: 0 0 0 2px rgba(40, 167, 69, 0.2);
}

.segment-input-group {
    display: flex;
    align-items: center;
    gap: 4px;
}

.segment-input-suffix {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.segment-price-input {
    width: 100px;
}

.segment-remove-btn {
    background: none;
    border: none;
    font-size: 16px;
    color: #ef4444;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background-color 0.2s;
    line-height: 1;
}

.segment-remove-btn:hover {
    background-color: rgba(239, 68, 68, 0.1);
}

.segment-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
    gap: 12px;
}

.segment-add-btn {
    background: rgba(40, 167, 69, 0.1);
    border: 1px solid rgba(40, 167, 69, 0.3);
    color: var(--profit-color);
    font-size: 13px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.segment-add-btn:hover {
    background: rgba(40, 167, 69, 0.15);
    border-color: rgba(40, 167, 69, 0.4);
}

.segment-add-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.segment-validation {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    max-width: 200px;
}

.segment-validation-bar {
    flex: 1;
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    overflow: hidden;
}

.segment-validation-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s, background-color 0.3s;
    width: 0%;
    background-color: #ef4444;
}

.segment-validation-fill.valid {
    background-color: var(--profit-color);
}

.segment-validation-text {
    font-size: 12px;
    font-weight: 600;
    min-width: 36px;
    text-align: right;
}

.segment-validation-text.valid {
    color: var(--profit-color);
}

.segment-validation-text.invalid {
    color: #ef4444;
}

.segment-results {
    margin-top: 12px;
    padding: 12px;
    background: rgba(40, 167, 69, 0.06);
    border: 1px solid rgba(40, 167, 69, 0.2);
    border-radius: 8px;
}

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

.segment-result-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    font-size: 13px;
}

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

.segment-result-value {
    color: var(--profit-color);
    font-weight: 600;
}

.segment-result-total {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(40, 167, 69, 0.3);
    font-size: 14px;
    font-weight: 700;
}

/* Mobile segment styles */
@media (max-width: 640px) {
    .segment-row {
        flex-wrap: wrap;
        gap: 6px;
    }

    .segment-input {
        width: 70px;
        font-size: 13px;
    }

    .segment-price-input {
        width: 90px;
    }

    .segment-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .segment-validation {
        max-width: 100%;
    }
}

/* Dark mode segment styles */
body.dark-mode .segment-section {
    border-top-color: rgba(40, 167, 69, 0.3);
}

body.dark-mode .segment-input {
    background-color: #1f2937;
    border-color: #374151;
    color: #e5e7eb;
}

body.dark-mode .segment-input:focus {
    border-color: var(--profit-color);
    box-shadow: 0 0 0 2px rgba(40, 167, 69, 0.2);
}

body.dark-mode .segment-add-btn {
    background: rgba(40, 167, 69, 0.15);
    border-color: rgba(40, 167, 69, 0.3);
}

body.dark-mode .segment-validation-bar {
    background: #374151;
}

body.dark-mode .segment-results {
    background: rgba(40, 167, 69, 0.1);
    border-color: rgba(40, 167, 69, 0.25);
}

body.dark-mode .segment-result-label {
    color: #9ca3af;
}

body.dark-mode .segment-row-label {
    color: #9ca3af;
}

/* Steel mode segment styles */
body.steel-mode .segment-section {
    border-top-color: rgba(40, 167, 69, 0.3);
}

body.steel-mode .segment-input {
    background-color: #383838;
    border-color: #4c4c4c;
    color: #e5e7eb;
}

body.steel-mode .segment-input:focus {
    border-color: var(--profit-color);
    box-shadow: 0 0 0 2px rgba(40, 167, 69, 0.2);
}

body.steel-mode .segment-add-btn {
    background: rgba(40, 167, 69, 0.15);
    border-color: rgba(40, 167, 69, 0.3);
}

body.steel-mode .segment-validation-bar {
    background: #4c4c4c;
}

body.steel-mode .segment-results {
    background: rgba(40, 167, 69, 0.1);
    border-color: rgba(40, 167, 69, 0.25);
}

body.steel-mode .segment-result-label {
    color: #9ca3af;
}

body.steel-mode .segment-row-label {
    color: #9ca3af;
}

/* Risk Scenarios Styles */
.scenarios-content {
    margin-top: 7px;
    padding: 13px;
    background-color: #f9fafb;
    border-radius: var(--border-radius);
    font-size: 15px;
}

.scenarios-grid {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.scenario-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 9px 11px;
    background-color: white;
    border-radius: 6px;
    border-left: 4px solid #e5e7eb;
    transition: all 0.2s ease;
}

.scenario-item.current {
    border-left-color: var(--theme-color);
    background-color: rgba(28, 161, 242, 0.05);
}

.scenario-risk {
    font-weight: 500;
    color: var(--text-primary);
    min-width: 94px;
    font-size: 15px;
}

.scenario-details {
    color: var(--text-secondary);
    font-size: 14px;
}

.scenario-item.current .scenario-risk {
    color: var(--theme-color);
}

.scenario-item.current .scenario-details {
    color: var(--theme-color);
    font-weight: 500;
}

/* Dark mode styles for info content */
body.dark-mode .info-content {
    background-color: #1e293b;
    border-color: #334155;
}

body.dark-mode .example-scenario {
    background-color: #1e293b;
}

body.dark-mode .scenario-intro {
    color: #e2e8f0;
}

body.dark-mode .calc-step {
    background-color: #334155;
    border-left-color: #475569;
}

body.dark-mode .calc-step.highlight {
    background-color: rgba(28, 161, 242, 0.15);
    border-left-color: var(--theme-color);
}

body.dark-mode .step-label {
    color: #e2e8f0;
}

body.dark-mode .step-value {
    color: var(--theme-color);
}

body.dark-mode .info-conclusion {
    background-color: rgba(28, 161, 242, 0.1);
    border-color: rgba(28, 161, 242, 0.3);
}

body.dark-mode .info-conclusion p {
    color: #7dd3fc;
}

/* Dark mode styles for scenarios */
body.dark-mode .scenarios-content {
    background-color: #1f2937;
}

body.dark-mode .scenario-item {
    background-color: #374151;
}

body.dark-mode .scenario-item.current {
    background-color: rgba(28, 161, 242, 0.15);
}

body.dark-mode .scenario-risk {
    color: #e5e7eb;
}

body.dark-mode .scenario-details {
    color: #9ca3af;
}

/* ==========================================================================
   JOURNAL PLACEHOLDER STYLES
   ========================================================================== */

.journal-placeholder {
    text-align: center;
    padding: var(--spacing-lg);
    color: var(--text-secondary);
    font-style: italic;
}

body.dark-mode .journal-placeholder {
    color: #9ca3af;
}

/* ==========================================================================
   FUTURE JOURNAL STYLES (Prepared)
   ========================================================================== */

/* Journal components will use these base styles for consistency */
.journal-card {
    background-color: white;
    padding: var(--spacing-md);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    border-left: 4px solid var(--journal-color);
}

.journal-button {
    background-color: var(--journal-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    padding: 9px var(--spacing-md);
    font-weight: 500;
    cursor: pointer;
    font-size: 15px;
    transition: all 0.2s ease;
}

.journal-button:hover {
    background-color: var(--journal-secondary);
}

.journal-input {
    width: 100%;
    padding: var(--spacing-sm);
    border: 1px solid #d1d5db;
    border-radius: var(--border-radius);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-size: 15px;
    height: 40px;
}

.journal-input:focus {
    border-color: var(--journal-color);
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

/* Dark mode journal styles */
body.dark-mode .journal-card {
    background-color: #1f2937;
}

body.dark-mode .journal-input {
    background-color: #1f2937;
    border-color: #374151;
    color: #e5e7eb;
}

/* Dark mode styles for theme segmented control */
body.dark-mode .theme-segmented-control {
    background-color: #374151;
    border-color: #4b5563;
}

body.dark-mode .theme-option:hover {
    background-color: rgba(156, 163, 175, 0.2);
}

body.dark-mode .theme-segmented-control input:checked + .theme-option {
    background-color: #1f2937;
    color: var(--theme-color);
}

body.dark-mode .theme-label {
    color: #9ca3af;
}

body.dark-mode .theme-segmented-control input:checked + .theme-option .theme-label {
    color: var(--theme-color);
}

.max-account-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.max-account-button {
    padding: 9px 0;
    background-color: #f3f4f6;
    color: var(--text-primary);
    border: none;
    border-radius: var(--border-radius);
    font-weight: 500;
    cursor: pointer;
    flex: 1;
    min-width: 64px;
    font-size: 15px;
    transition: all 0.2s ease;
}

.max-account-button:focus {
    outline: 2px solid var(--theme-color);
    outline-offset: 2px;
}

.max-account-button.active {
    background-color: var(--theme-color);
    color: white;
}

.result-card.limited {
    border-left-color: #ef4444;
}

.result-card.limited .result-value {
    color: #ef4444;
}

.original-percentage {
    text-decoration: line-through;
    color: var(--text-secondary);
    margin-right: 8px;
}

.limited-percentage {
    color: #ef4444;
    font-weight: 600;
}

body.dark-mode .max-account-button {
    background-color: #374151;
    color: #d1d5db;
}

body.dark-mode .max-account-button.active {
    background-color: var(--theme-color);
    color: white;
}

/* ==========================================================================
   IMPORT ALERT FEATURE STYLES
   ========================================================================== */

/* Import button container */
.import-alert-bar {
    margin-top: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
    display: flex;
    justify-content: center;
}

/* Import button */
.import-alert-button {
    background-color: rgba(28, 161, 242, 0.12);
    color: var(--theme-color);
    border: 1px solid rgba(28, 161, 242, 0.3);
    padding: 10px 16px;
    border-radius: var(--border-radius);
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.import-alert-button:hover {
    background-color: rgba(28, 161, 242, 0.18);
    border-color: rgba(28, 161, 242, 0.4);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.import-alert-button:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

/* Modal backdrop */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(2px);
}

/* Modal card */
.modal-card {
    max-width: 640px;
    width: 95%;
    background: #fff;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    overflow: hidden;
    animation: modalSlideIn 0.2s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Modal header */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--theme-color);
    color: #fff;
    padding: 16px 20px;
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    background: #6b7280;
    border: 1px solid #9ca3af;
    font-size: 24px;
    color: #f9fafb;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.modal-close:hover {
    background-color: #9ca3af;
    border-color: #d1d5db;
}

/* Modal body */
.modal-body {
    padding: 20px;
}

/* Modal textarea */
.modal-textarea {
    width: 100%;
    height: 180px;
    border: 1px solid #d1d5db;
    border-radius: var(--border-radius);
    padding: 12px;
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
    min-height: 120px;
    max-height: 300px;
    max-width: 100%;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.modal-textarea:focus {
    border-color: var(--theme-color);
    box-shadow: 0 0 0 2px rgba(28, 161, 242, 0.2);
}

.modal-textarea.error {
    border-color: #ef4444;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
}

.modal-textarea::placeholder {
    color: #9ca3af;
    font-style: italic;
}

/* Modal actions */
.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 20px;
    background-color: #f9fafb;
    border-top: 1px solid #e5e7eb;
}

/* Button styles */
.btn-primary {
    background: var(--theme-color);
    color: #fff;
    border: none;
    border-radius: var(--border-radius);
    padding: 10px 16px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary:hover {
    background: #0ea5e9;
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-secondary {
    background: #f3f4f6;
    color: var(--text-primary);
    border: 1px solid #d1d5db;
    border-radius: var(--border-radius);
    padding: 10px 16px;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: #e5e7eb;
    border-color: #9ca3af;
}

/* Toast container */
#toastHost {
    position: fixed;
    right: 20px;
    bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 1100;
    pointer-events: none;
}

/* Toast styles */
.toast {
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    background: #111827;
    color: #fff;
    border-radius: var(--border-radius);
    padding: 12px 16px;
    font-weight: 600;
    font-size: 14px;
    box-shadow: var(--shadow-md);
    pointer-events: auto;
    min-width: 200px;
    text-align: center;
}

.toast.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Dark mode styles for import alert */
body.dark-mode .import-alert-button {
    background-color: rgba(28, 161, 242, 0.15);
    border-color: rgba(28, 161, 242, 0.4);
}

body.dark-mode .import-alert-button:hover {
    background-color: rgba(28, 161, 242, 0.2);
    border-color: rgba(28, 161, 242, 0.5);
}

body.dark-mode .modal-card {
    background: #1f2937;
}

body.dark-mode .modal-textarea {
    background-color: #374151;
    border-color: #4b5563;
    color: #e5e7eb;
}

body.dark-mode .modal-textarea:focus {
    border-color: var(--theme-color);
    box-shadow: 0 0 0 2px rgba(28, 161, 242, 0.2);
}

body.dark-mode .modal-textarea::placeholder {
    color: #9ca3af;
}

body.dark-mode .modal-actions {
    background-color: #374151;
    border-top-color: #4b5563;
}

body.dark-mode .btn-secondary {
    background: #4b5563;
    border-color: #6b7280;
    color: #e5e7eb;
}

body.dark-mode .btn-secondary:hover {
    background: #6b7280;
    border-color: #9ca3af;
}

body.dark-mode .btn-primary:disabled {
    background: #6b7280;
}

/* Dark mode trim percent buttons */
body.dark-mode .trim-percent-btn {
    background: #374151;
    border-color: #4b5563;
    color: #e5e7eb;
}

body.dark-mode .trim-percent-btn:hover {
    background: #4b5563;
    border-color: #6b7280;
}

body.dark-mode .trim-percent-btn.active {
    background: #1CA1F2;
    color: white;
    border-color: #1CA1F2;
}

/* Dark mode journal/snapshots modal */
body.dark-mode .snapshots-modal-content,
body.dark-mode .edit-modal-content {
    background: #1f2937;
    color: #f9fafb;
}

body.dark-mode .snapshots-modal-header,
body.dark-mode .edit-modal-header {
    background: #374151;
    border-bottom-color: #4b5563;
}

body.dark-mode .snapshots-modal-header h3,
body.dark-mode .edit-modal-header h3 {
    color: #f9fafb;
}

body.dark-mode .open-risk-banner {
    border-bottom-color: #4b5563;
}

body.dark-mode .open-risk-banner.risk-low {
    background: #064e3b;
    color: #d1fae5;
}

body.dark-mode .open-risk-banner.risk-medium {
    background: #78350f;
    color: #fef3c7;
}

body.dark-mode .open-risk-banner.risk-high {
    background: #7f1d1d;
    color: #fecaca;
}

body.dark-mode .snapshots-filter-bar {
    background: #374151;
    border-bottom-color: #4b5563;
}

body.dark-mode .filter-btn {
    background: #4b5563;
    border-color: #6b7280;
    color: #f9fafb;
}

body.dark-mode .filter-btn:hover {
    background: #6b7280;
}

body.dark-mode .filter-btn.active {
    background: #1CA1F2;
    border-color: #1CA1F2;
}

body.dark-mode .snapshot-card {
    background: #374151;
    border-color: #4b5563;
    color: #f9fafb;
}

body.dark-mode .snapshot-card:hover {
    border-color: #6b7280;
}

body.dark-mode .snapshot-ticker {
    color: #60a5fa;
}

body.dark-mode .snapshot-label {
    color: #9ca3af;
}

body.dark-mode .snapshot-value {
    color: #f9fafb;
}

body.dark-mode .snapshot-notes .snapshot-value {
    color: #d1d5db;
}

body.dark-mode .status-open {
    background: #064e3b;
    color: #d1fae5;
}

body.dark-mode .status-trimmed {
    background: #78350f;
    color: #fef3c7;
}

body.dark-mode .status-closed {
    background: #4b5563;
    color: #d1d5db;
}

body.dark-mode .snapshot-action-row {
    border-top-color: #4b5563;
}

body.dark-mode .snapshot-trimmed-info {
    background: #78350f;
    border-color: #92400e;
}

body.dark-mode .trim-summary-header {
    color: #fef3c7;
    border-bottom-color: #92400e;
}

body.dark-mode .trim-detail {
    color: #fef3c7;
}

body.dark-mode .trim-exit-rule {
    color: #d1d5db;
}

body.dark-mode .trim-summary {
    background: #374151;
    border-color: #4b5563;
}

body.dark-mode .trim-summary p {
    color: #e5e7eb;
}

body.dark-mode .trim-preview {
    background: #374151;
    border-color: #4b5563;
}

body.dark-mode .trim-preview h4 {
    color: #60a5fa;
}

body.dark-mode .trim-preview p {
    color: #e5e7eb;
}

body.dark-mode .trim-preview.error {
    background: #7f1d1d;
    border-color: #dc2626;
}

body.dark-mode .trim-preview.error h4,
body.dark-mode .trim-preview.error p {
    color: #fecaca;
}

body.dark-mode .input-hint {
    color: #9ca3af;
}

body.dark-mode .edit-group input,
body.dark-mode .edit-group textarea,
body.dark-mode .edit-group select {
    background: #374151;
    border-color: #4b5563;
    color: #f9fafb;
}

body.dark-mode .edit-group input:focus,
body.dark-mode .edit-group textarea:focus {
    border-color: #1CA1F2;
    box-shadow: 0 0 0 3px rgba(28, 161, 242, 0.1);
}

body.dark-mode .edit-group label {
    color: #f9fafb;
}

body.dark-mode .edit-actions {
    border-top-color: #4b5563;
}

body.dark-mode .modal-close {
    background: #4b5563;
    border-color: #6b7280;
    color: #f9fafb;
}

body.dark-mode .modal-close:hover {
    background: #6b7280;
}

/* ==========================================================================
   LOGBOOK LITE STYLES
   ========================================================================== */

.logbook-bar {
    margin-top: var(--spacing-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    background: rgba(28, 161, 242, 0.06);
    border: 1px solid rgba(28, 161, 242, 0.2);
    border-radius: var(--border-radius);
    padding: 12px 16px;
    flex-wrap: wrap;
}

.log-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.log-count {
    opacity: 0.75;
    font-weight: 600;
    font-size: 14px;
    color: var(--theme-color);
}

.log-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.logbook-btn {
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 8px 12px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.logbook-btn:hover {
    background: #e5e7eb;
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.logbook-btn:active {
    transform: translateY(0);
}

.logbook-btn.primary {
    background: var(--theme-color);
    color: white;
    border-color: var(--theme-color);
}

.logbook-btn.primary:hover {
    background: #0ea5e9;
    border-color: #0ea5e9;
}

.logbook-btn.danger {
    border-color: #ef4444;
    color: #ef4444;
    background: #fff;
}

.logbook-btn.danger:hover {
    background: #fef2f2;
    border-color: #dc2626;
    color: #dc2626;
}

/* Notes Section Styles */
.notes-section {
    margin-top: var(--spacing-md);
    background: rgba(16, 185, 129, 0.06);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: var(--border-radius);
    padding: 16px;
}

.notes-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 8px;
}

.notes-label {
    font-size: 16px;
    font-weight: 600;
    color: var(--journal-color);
    display: flex;
    align-items: center;
    gap: 6px;
}

.notes-hint {
    font-size: 13px;
    color: var(--text-secondary);
    font-style: italic;
}

.notes-textarea {
    width: 100%;
    min-height: 80px;
    padding: 12px;
    border: 1px solid #d1d5db;
    border-radius: var(--border-radius);
    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    background-color: white;
}

.notes-textarea:focus {
    border-color: var(--journal-color);
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

.notes-textarea::placeholder {
    color: #9ca3af;
    font-style: italic;
}

/* Dark mode logbook styles */
body.dark-mode .logbook-bar {
    background: rgba(28, 161, 242, 0.12);
    border-color: rgba(28, 161, 242, 0.25);
}

body.dark-mode .log-count {
    color: #7dd3fc;
}

body.dark-mode .logbook-btn {
    background: #374151;
    border-color: #4b5563;
    color: #e5e7eb;
}

body.dark-mode .logbook-btn:hover {
    background: #4b5563;
}

body.dark-mode .logbook-btn.primary {
    background: var(--theme-color);
    color: white;
    border-color: var(--theme-color);
}

body.dark-mode .logbook-btn.primary:hover {
    background: #0ea5e9;
}

body.dark-mode .logbook-btn.danger {
    background: #1f2937;
    border-color: #ef4444;
    color: #ef4444;
}

body.dark-mode .logbook-btn.danger:hover {
    background: #374151;
    border-color: #dc2626;
    color: #dc2626;
}

/* Dark mode notes styles */
body.dark-mode .notes-section {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.25);
}

body.dark-mode .notes-label {
    color: #10b981;
}

body.dark-mode .notes-hint {
    color: #9ca3af;
}

body.dark-mode .notes-textarea {
    background-color: #1f2937;
    border-color: #374151;
    color: #e5e7eb;
}

body.dark-mode .notes-textarea:focus {
    border-color: var(--journal-color);
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

body.dark-mode .notes-textarea::placeholder {
    color: #9ca3af;
}

/* Mobile responsiveness for logbook */
@media (max-width: 640px) {
    .logbook-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .log-left {
        justify-content: center;
    }
    
    .log-actions {
        justify-content: center;
        gap: 6px;
    }
    
    .logbook-btn {
        flex: 1;
        min-width: 70px;
        padding: 6px 8px;
        font-size: 12px;
    }
    
    .notes-section {
        padding: 12px;
    }
    
    .notes-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
    
    .notes-textarea {
        min-height: 60px;
        font-size: 13px;
    }
}
@media (max-width: 640px) {
    .modal-card {
        width: 100%;
        margin: 20px;
    }
    
    .modal-header {
        padding: 12px 16px;
    }
    
    .modal-header h3 {
        font-size: 16px;
    }
    
    .modal-body {
        padding: 16px;
    }
    
    .modal-textarea {
        height: 140px;
        font-size: 13px;
    }
    
    .modal-actions {
        padding: 12px 16px;
        gap: 8px;
    }
    
    .btn-primary,
    .btn-secondary {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    #toastHost {
        right: 16px;
        bottom: 16px;
        left: 16px;
    }
    
    .toast {
        min-width: auto;
        font-size: 13px;
        padding: 10px 14px;
    }
    
    .import-alert-button {
        padding: 8px 12px;
        font-size: 14px;
    }
}

/* ==========================================================================
   STEEL GRAY THEME
   ========================================================================== */

body.steel-mode {
    background:
        radial-gradient(circle at 80% 20%, rgba(68, 72, 77, 0.3) 0%, transparent 40%),
        linear-gradient(135deg, #2c2c2c 0%, #1f1f1f 50%, #141414 100%);
}

body.steel-mode .calculator-container {
    background-color: rgba(44, 44, 44, 0.95);
    box-shadow: var(--shadow-md);
}

body.steel-mode .calculator-title,
body.steel-mode .section-title,
body.steel-mode .info-button,
body.steel-mode .calculator-footer a {
    color: var(--theme-color);
}

body.steel-mode .calculator-subtitle {
    color: #9ca3af;
}

body.steel-mode .journal-section {
    border-top-color: #383838;
}

body.steel-mode .input-label,
body.steel-mode .input-suffix,
body.steel-mode .input-prefix {
    color: #d1d5db;
}

body.steel-mode .text-input,
body.steel-mode .number-input {
    background-color: #383838;
    border-color: #4c4c4c;
    color: #e5e7eb;
}

body.steel-mode .helper-text,
body.steel-mode .calculator-footer {
    color: #9ca3af;
}

body.steel-mode .risk-button {
    background-color: #4c4c4c;
    color: #d1d5db;
}

body.steel-mode .risk-button.active {
    background-color: var(--theme-color);
    color: white;
}

body.steel-mode .clear-button {
    background-color: #4c4c4c;
    border-color: #5a5a5a;
    color: #e5e7eb;
}

body.steel-mode .results-section {
    background-color: rgba(28, 161, 242, 0.15);
}

body.steel-mode .result-card {
    background-color: #383838;
}

body.steel-mode .result-label {
    color: #9ca3af;
}

body.steel-mode .calculator-container::-webkit-scrollbar-thumb {
    background-color: #5a5a5a;
}

body.steel-mode .quick-scenarios-button {
    background-color: rgba(28, 161, 242, 0.15);
    border-color: rgba(28, 161, 242, 0.3);
}

body.steel-mode .quick-scenarios-button:hover {
    background-color: rgba(28, 161, 242, 0.2);
    border-color: rgba(28, 161, 242, 0.4);
}

body.steel-mode .add-profit-button {
    background-color: var(--profit-color);
    color: white;
}

body.steel-mode .info-content {
    background-color: #2a2a2a;
    border-color: #3a3a3a;
}

body.steel-mode .example-scenario {
    background-color: #2a2a2a;
}

body.steel-mode .scenario-intro {
    color: #e2e8f0;
}

body.steel-mode .calc-step {
    background-color: #3a3a3a;
    border-left-color: #4a4a4a;
}

body.steel-mode .calc-step.highlight {
    background-color: rgba(28, 161, 242, 0.15);
    border-left-color: var(--theme-color);
}

body.steel-mode .step-label {
    color: #e2e8f0;
}

body.steel-mode .step-value {
    color: var(--theme-color);
}

body.steel-mode .info-conclusion {
    background-color: rgba(28, 161, 242, 0.1);
    border-color: rgba(28, 161, 242, 0.3);
}

body.steel-mode .info-conclusion p {
    color: #7dd3fc;
}

body.steel-mode .scenarios-content {
    background-color: #383838;
}

body.steel-mode .scenario-item {
    background-color: #4c4c4c;
}

body.steel-mode .scenario-item.current {
    background-color: rgba(28, 161, 242, 0.15);
}

body.steel-mode .scenario-risk {
    color: #e5e7eb;
}

body.steel-mode .scenario-details {
    color: #9ca3af;
}

body.steel-mode .journal-placeholder {
    color: #9ca3af;
}

body.steel-mode .journal-card {
    background-color: #383838;
}

body.steel-mode .journal-input {
    background-color: #383838;
    border-color: #4c4c4c;
    color: #e5e7eb;
}

/* Steel mode styles for theme segmented control */
body.steel-mode .theme-segmented-control {
    background-color: #4c4c4c;
    border-color: #5a5a5a;
}

body.steel-mode .theme-option:hover {
    background-color: rgba(156, 163, 175, 0.2);
}

body.steel-mode .theme-segmented-control input:checked + .theme-option {
    background-color: #383838;
    color: var(--theme-color);
}

body.steel-mode .theme-label {
    color: #9ca3af;
}

body.steel-mode .theme-segmented-control input:checked + .theme-option .theme-label {
    color: var(--theme-color);
}

/* Steel mode styles for snapshots and modals */
body.steel-mode .simple-tooltip {
    background: rgba(255, 255, 255, 0.9);
    color: #383838;
}

body.steel-mode .snapshots-modal-content,
body.steel-mode .edit-modal-content {
    background: #2c2c2c;
    color: #f9fafb;
}

body.steel-mode .snapshots-modal-header,
body.steel-mode .edit-modal-header {
    background: #383838;
    border-bottom-color: #4c4c4c;
}

body.steel-mode .snapshots-modal-header h3,
body.steel-mode .edit-modal-header h3 {
    color: #f9fafb;
}

body.steel-mode .snapshot-card {
    background: #383838;
    border-color: #4c4c4c;
    color: #f9fafb;
}

body.steel-mode .snapshot-card:hover {
    border-color: #5a5a5a;
}

body.steel-mode .snapshot-ticker {
    color: #60a5fa;
}

body.steel-mode .snapshot-label {
    color: #9ca3af;
}

body.steel-mode .snapshot-value {
    color: #f9fafb;
}

body.steel-mode .snapshot-notes .snapshot-value {
    color: #d1d5db;
}

body.steel-mode .status-open {
    background: #064e3b;
    color: #d1fae5;
}

body.steel-mode .status-trimmed {
    background: #78350f;
    color: #fef3c7;
}

body.steel-mode .status-closed {
    background: #4c4c4c;
    color: #d1d5db;
}

body.steel-mode .snapshots-filter-bar {
    background: #383838;
    border-bottom-color: #4c4c4c;
}

body.steel-mode .filter-btn {
    background: #4c4c4c;
    border-color: #5a5a5a;
    color: #f9fafb;
}

body.steel-mode .filter-btn:hover {
    background: #5a5a5a;
}

body.steel-mode .filter-btn.active {
    background: #1CA1F2;
    border-color: #1CA1F2;
}

body.steel-mode .snapshot-action-row {
    border-top-color: #4c4c4c;
}

body.steel-mode .snapshot-trimmed-info {
    background: #78350f;
    border-color: #92400e;
}

body.steel-mode .trim-summary-header {
    color: #fef3c7;
    border-bottom-color: #92400e;
}

body.steel-mode .trim-detail {
    color: #fef3c7;
}

body.steel-mode .trim-exit-rule {
    border-top-color: #92400e;
}

body.steel-mode .trim-summary {
    background: #383838;
}

body.steel-mode .trim-summary p {
    color: #f9fafb;
}

body.steel-mode .trim-preview {
    background: #064e3b;
    border-color: #065f46;
}

body.steel-mode .trim-preview.error {
    background: #7f1d1d;
    border-color: #dc2626;
}

body.steel-mode .trim-preview h4 {
    color: #d1fae5;
}

body.steel-mode .trim-preview.error h4 {
    color: #fca5a5;
}

body.steel-mode .trim-preview p {
    color: #a7f3d0;
}

body.steel-mode .trim-preview.error p {
    color: #fca5a5;
}

body.steel-mode .input-hint {
    color: #9ca3af;
}

body.steel-mode .edit-group input,
body.steel-mode .edit-group textarea,
body.steel-mode .edit-group select {
    background: #383838;
    border-color: #5a5a5a;
    color: #f9fafb;
}

body.steel-mode .edit-group input:focus,
body.steel-mode .edit-group textarea:focus {
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.1);
}

body.steel-mode .edit-group label {
    color: #f9fafb;
}

body.steel-mode .edit-actions {
    border-top-color: #4c4c4c;
}

body.steel-mode .btn-secondary {
    background: #4c4c4c;
    color: #f9fafb;
}

body.steel-mode .btn-secondary:hover {
    background: #5a5a5a;
}

body.steel-mode .modal-close {
    background: #5a5a5a;
    border-color: #9ca3af;
    color: #f9fafb;
}

body.steel-mode .modal-close:hover {
    background: #9ca3af;
    color: #2c2c2c;
    border-color: #d1d5db;
}

/* Steel mode trim percent buttons */
body.steel-mode .trim-percent-btn {
    background: #4c4c4c;
    border-color: #5a5a5a;
    color: #f9fafb;
}

body.steel-mode .trim-percent-btn:hover {
    background: #5a5a5a;
    border-color: #6b7280;
}

body.steel-mode .trim-percent-btn.active {
    background: #60a5fa;
    color: white;
    border-color: #60a5fa;
}
