.trade-journal-page { max-width: 1120px; }
.trade-journal-page h1 { margin-bottom: 12px; }
.journal-heading { position: relative; }
.journal-heading h1 { padding-right: 44px; }
.journal-info { margin: 0; }
.journal-info > summary {
    position: absolute; top: 0; right: 0;
    display: flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; box-sizing: border-box; list-style: none;
    border: 1px solid #94a3b8; border-radius: 50%; background: #eff6ff;
    color: #1e3a8a; font: bold 1rem Georgia, serif; cursor: pointer;
}
.journal-info > summary::-webkit-details-marker { display: none; }
.journal-info > summary:hover, .journal-info[open] > summary { background: #dbeafe; }
.journal-info > summary:focus-visible { outline: 2px solid #2563eb; outline-offset: 3px; }
.journal-info-content { padding: 8px 14px; margin-top: 8px; border: 1px solid #bfdbfe; border-radius: 6px; background: #f8fafc; }
.journal-info-content p { margin: 12px 0; line-height: 1.6; }
.journal-info-content h2 { font-size: 1.3rem; }
.journal-guide-section { margin-top: 20px; }
.journal-guide-section h3 { margin-bottom: 12px; }
.journal-example-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 12px; margin-top: 12px; }
.journal-example-fields dt { font-weight: 600; }
.journal-example-fields dd { margin-top: 4px; }
.journal-chart-coverage { color: #475569; font-size: .85rem; }
#journal-reset-filters { margin-bottom: 24px; }
.journal-section { margin-top: 24px; padding-top: 20px; border-top: 1px solid #bfdbfe; }
.journal-section h2 { margin-bottom: 12px; font-size: 1.3rem; }
.journal-section p, .journal-notice { margin: 12px 0; line-height: 1.6; }
.journal-notice { padding: 12px; background: #fffbeb; border-left: 3px solid #f59e0b; }
.journal-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: 14px; margin: 16px 0; }
.journal-fields label, .journal-actions label { display: flex; flex-direction: column; gap: 5px; font-weight: 600; color: #1e293b; }
.journal-fields [hidden] { display: none; }
.journal-fields input, .journal-fields select, .journal-fields textarea, .journal-actions input {
    width: 100%; min-width: 0; padding: 9px 10px; border: 1px solid #94a3b8; border-radius: 6px;
    background: #fff; color: #0f172a; font: inherit;
}
.journal-fields textarea { resize: vertical; }
.journal-field-wide { grid-column: 1 / -1; }
.journal-section h3 { margin: 18px 0 6px; font-size: 1.05rem; }
.journal-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 14px 0; }
#journal-capital-form { align-items: flex-end; }
#journal-capital-form label { margin: 0; }
#journal-capital-form input, #journal-capital-form button { height: 42px; margin: 0; }
.trade-journal-page button, .journal-import {
    padding: 9px 12px; border: 1px solid #94a3b8; border-radius: 6px; font: inherit;
    background: #eff6ff; color: #1e3a8a; cursor: pointer; font-weight: 600;
}
.trade-journal-page button:disabled { opacity: .5; cursor: not-allowed; }
#journal-status { padding: 8px 0; font-weight: 600; overflow-wrap: anywhere; }
.journal-error { color: #b91c1c; }
.journal-entry { padding: 14px; margin: 12px 0; border: 1px solid #bfdbfe; border-radius: 8px; background: #f8fafc; overflow-wrap: anywhere; }
.journal-entry h3 { font-size: 1.05rem; }
.journal-entry details { margin-top: 8px; }
.journal-entry pre { white-space: pre-wrap; overflow-wrap: anywhere; font-size: .85rem; }
.journal-pnl-svg { display: block; width: 100%; height: auto; background: #f8fafc; border: 1px solid #bfdbfe; border-radius: 8px; }
.journal-table-scroll { overflow-x: auto; }
.journal-trades-table { width: 100%; border-collapse: collapse; font-size: .85rem; font-variant-numeric: tabular-nums; }
.journal-trades-table th, .journal-trades-table td { padding: 10px; border-bottom: 1px solid #bfdbfe; text-align: left; white-space: nowrap; }
.journal-trades-table thead { background: #eff6ff; color: #1e293b; }
.journal-trade-row { cursor: pointer; }
.journal-trade-row:hover, .journal-trade-row:focus-within { background: #eff6ff; }
#journal-pnl-dialog { --modal-width: 720px; }
#journal-pnl-content { overflow-wrap: anywhere; }
#journal-pnl-content p { margin: 12px 0; line-height: 1.6; }
#journal-pnl-content pre { white-space: pre-wrap; font-size: .85rem; }
.journal-trade-pnl { font-size: 2rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.journal-gain { color: #047857; }
.journal-loss { color: #b91c1c; }
#journal-chart-details table, .journal-guide-table { border-collapse: collapse; width: 100%; margin: 12px 0; }
#journal-chart-details th, #journal-chart-details td, .journal-guide-table th, .journal-guide-table td { padding: 8px; border-bottom: 1px solid #bfdbfe; text-align: right; white-space: nowrap; }
#journal-chart-details th:first-child, #journal-chart-details td:first-child, .journal-guide-table th:first-child, .journal-guide-table td:first-child { text-align: left; }
/* Chrome comes from the shared .modal-surface rule in modals.css. */
#clear-journal-dialog p { margin-top: 12px; line-height: 1.6; }
@media (max-width: 600px) {
    .journal-actions > label { width: 100%; }
    .journal-import input { max-width: 100%; }
}
