:root {
    --bg-color: white;
    --text-color: black;
}

@media (prefers-color-scheme: dark) {
    :root {
    --bg-color: #181A1B;
    --text-color: white;
    --link-color: rgb(107, 107, 255);
    }
}

body {
    font-family: monospace;
    background-color: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    margin: 0;
    padding: 20px;
    box-sizing: border-box;
}

#login-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: var(--bg-color);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: monospace;
}

.input-line {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

input {
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--text-color);
    color: var(--text-color);
    font-family: inherit;
    font-size: inherit;
    outline: none;
}

a, a:visited { color: var(--link-color) !important; }

.heatmap-container {
    margin-bottom: 15px;
}

.viz-container {
    margin: 10px 0 20px 0;
    padding: 15px;
    border: 1px solid var(--text-color);
}

.viz-row {
    display: flex;
    justify-content: space-between;
    margin: 8px 0;
}

.viz-label {
    color: var(--link-color);
}

.viz-value {
    font-weight: bold;
}

.timeline-event {
    margin: 4px 0;
}

.timeline-time {
    color: var(--link-color);
    margin-right: 10px;
}

.context-bar {
    height: 8px;
    background: var(--text-color);
    margin: 10px 0;
    position: relative;
}

.context-marker {
    position: absolute;
    width: 12px;
    height: 12px;
    background: var(--link-color);
    border-radius: 50%;
    top: -2px;
    transition: left 0.3s;
}

.todo-item {
    color: #ff6b6b;
}

.data-sheet {
    border-collapse: collapse;
    width: 100%;
    font-size: 0.85em;
}

.data-sheet th,
.data-sheet td {
    border: 1px solid var(--text-color);
    padding: 6px 10px;
    text-align: center;
}

.data-sheet th {
    color: var(--link-color);
    font-weight: normal;
}

.data-sheet td {
    white-space: nowrap;
}

.check {
    background: rgba(76, 175, 80, 0.35);
}

.miss {
    color: #666;
}

.sheet-bar-row td {
    padding: 0 !important;
    border-top: none !important;
}

.sheet-bar-cell {
    padding: 0 !important;
}

.sheet-timeline-bar {
    position: relative;
    height: 14px;
    background: rgba(128, 128, 128, 0.08);
    width: 100%;
    overflow: hidden;
}

.sheet-bar-segment {
    position: absolute;
    top: 0;
    height: 100%;
    opacity: 0.75;
}

.sheet-bar-tick {
    position: absolute;
    top: 0;
    height: 100%;
    width: 1px;
    background: rgba(128, 128, 128, 0.25);
}

.sheet-bar-legend {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 8px;
    font-size: 0.8em;
}

.sheet-legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.sheet-legend-swatch {
    display: inline-block;
    width: 12px;
    height: 12px;
    opacity: 0.75;
}

.progress-controls {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.progress-controls label {
    display: flex;
    align-items: center;
    gap: 8px;
}

.progress-controls select,
.progress-controls button {
    background: transparent;
    border: 1px solid var(--text-color);
    color: var(--text-color);
    font-family: monospace;
    font-size: inherit;
    padding: 4px 8px;
    cursor: pointer;
}

.progress-controls button:hover {
    background: var(--text-color);
    color: var(--bg-color);
}

.progress-display {
    position: relative;
    width: 100%;
    max-width: 600px;
    aspect-ratio: 3/4;
    border: 1px solid var(--text-color);
    display: flex;
    align-items: center;
    justify-content: center;
}

.progress-placeholder {
    color: #666;
}

.progress-image-container {
    position: relative;
    width: 100%;
    height: 100%;
}

.progress-image-container img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.progress-date-overlay {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: rgba(0,0,0,0.6);
    color: white;
    padding: 4px 10px;
    font-size: 0.85em;
}

.journal-entry {
    border: 1px solid var(--text-color);
    margin-bottom: 12px;
    cursor: pointer;
}

.journal-header {
    padding: 8px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.journal-date {
    color: var(--link-color);
}

.journal-toggle {
    font-size: 1.2em;
}

.journal-body {
    display: none;
    padding: 0 12px 12px 12px;
    border-top: 1px solid var(--text-color);
}

.journal-body.open {
    display: block;
}

.journal-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin: 8px 0;
}

.journal-tag {
    border: 1px solid var(--link-color);
    color: var(--link-color);
    padding: 2px 8px;
    font-size: 0.8em;
}

.journal-summary {
    margin: 8px 0;
    line-height: 1.5;
}

.journal-transcription {
    margin: 8px 0;
    max-height: 200px;
    overflow-y: auto;
    color: #888;
    font-size: 0.9em;
    line-height: 1.4;
}

.journal-audio {
    margin: 8px 0;
}

.journal-audio audio {
    width: 100%;
}

.journal-no-meta {
    color: #666;
    font-style: italic;
}

.journal-tasks {
    list-style: none;
    margin: 8px 0;
    padding: 0;
}

.journal-task-item {
    border-left: 2px solid var(--text-color);
    padding: 2px 0 2px 8px;
    margin: 4px 0;
}

.journal-task-detail {
    color: #888;
    font-size: 0.85em;
    margin-left: 6px;
}

.journal-tasks-warning {
    color: #ff6b6b;
    font-size: 0.85em;
    margin: 4px 0;
}

.heatmap-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.heatmap-nav {
    background: transparent;
    border: 1px solid var(--text-color);
    color: var(--text-color);
    font-family: monospace;
    font-size: inherit;
    padding: 2px 10px;
    cursor: pointer;
}

.heatmap-nav:hover {
    background: var(--text-color);
    color: var(--bg-color);
}

.heatmap-nav:disabled {
    opacity: 0.3;
    cursor: default;
}

.heatmap-nav:disabled:hover {
    background: transparent;
    color: var(--text-color);
}

.heatmap-grid {
    overflow-x: auto;
}

.heatmap-loading {
    color: #666;
}

.heatmap-legend {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 8px;
    font-size: 0.8em;
    color: #666;
}

.heatmap-legend-cell {
    width: 10px;
    height: 10px;
    background: #1eff00;
    border-radius: 2px;
}

.heatmap-tooltip {
    display: none;
    position: absolute;
    z-index: 1000;
    background: var(--bg-color);
    border: 1px solid var(--text-color);
    padding: 8px 12px;
    font-family: monospace;
    font-size: 0.85em;
    pointer-events: none;
    min-width: 120px;
}

.heatmap-tooltip-date {
    font-weight: bold;
    margin-bottom: 4px;
}

.heatmap-tooltip-score {
    color: var(--link-color);
    margin-bottom: 4px;
}

.heatmap-tooltip-done {
    color: #1eff00;
}

.heatmap-tooltip-miss {
    color: #666;
}

.timeline-chart {
    margin-bottom: 10px;
    overflow-x: auto;
}

.timeline-legend {
    margin-top: 6px;
    overflow-x: auto;
}

.radar-controls {
    display: flex;
    gap: 6px;
    margin-bottom: 10px;
}

.radar-mode-btn {
    background: transparent;
    border: 1px solid var(--text-color);
    color: var(--text-color);
    font-family: monospace;
    font-size: 0.85em;
    padding: 3px 10px;
    cursor: pointer;
}

.radar-mode-btn:hover {
    background: var(--text-color);
    color: var(--bg-color);
}

.radar-mode-btn.active {
    background: var(--text-color);
    color: var(--bg-color);
}

.radar-slider-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.radar-slider-wrap input[type="range"] {
    flex: 1;
    max-width: 400px;
    border: none;
    padding: 0;
}

.radar-slider-label {
    color: var(--link-color);
    font-size: 0.9em;
    white-space: nowrap;
}

.radar-chart {
    display: flex;
    justify-content: center;
}

.stock-container {
    border: 1px solid var(--text-color);
}

.stock-stats {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.stock-stats-left {
    display: flex;
    flex-direction: column;
}

.stock-stats-right {
    display: flex;
    flex-direction: column;
    gap: 8px;
    justify-content: center;
}

.stock-streak {
    display: flex;
    gap: 8px;
    align-items: baseline;
}

.stock-streak-dates {
    color: #666;
    font-size: 0.75em;
}

.stock-score {
    font-size: 1.8em;
    font-weight: bold;
    color: #1eff00;
    margin-bottom: 6px;
}

.stock-stats-row {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.stock-stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.stock-stat-label {
    color: #666;
    font-size: 0.8em;
}

.stock-up {
    color: #1eff00;
}

.stock-down {
    color: #ff6b6b;
}

.stock-chart {
    overflow-x: auto;
}

.progress-weight-row {
    display: flex;
    gap: 24px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.right-column {
    flex: 1;
    min-width: 300px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}