/* Field Journal */
.journal-layout {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem;
}

.journal-header {
    margin-bottom: 1.5rem;
}

.journal-header h1 {
    margin: 0 0 0.25rem;
    font-size: 2rem;
}

.journal-progress {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
}

.journal-progress-bar {
    width: 200px;
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

.journal-progress-bar::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: var(--progress, 0%);
    background: var(--accent);
    transition: width 0.4s ease;
}

.journal-progress-text {
    color: var(--muted);
    font-size: 0.9rem;
}

.journal-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.journal-search {
    flex: 1 1 240px;
    padding: 0.6rem 0.9rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--panel);
    color: var(--text);
    font-size: 1rem;
}

.journal-search:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--border-glow);
}

.journal-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.journal-filter {
    padding: 0.4rem 0.8rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--panel);
    color: var(--muted);
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.15s ease;
}

.journal-filter:hover,
.journal-filter.active {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(0, 212, 240, 0.08);
}

.journal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.25rem;
}

.journal-card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow);
    transition: transform 0.15s ease, border-color 0.15s ease;
}

.journal-card:hover {
    transform: translateY(-2px);
    border-color: var(--accent);
}

.journal-card.locked {
    opacity: 0.55;
    border-style: dashed;
}

.journal-card.locked:hover {
    border-color: var(--border);
    transform: none;
}

.journal-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.journal-domain {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--accent);
}

.journal-status {
    font-size: 0.8rem;
    color: var(--muted);
}

.journal-card h3 {
    margin: 0 0 0.75rem;
    font-size: 1.25rem;
}

.journal-teaser {
    color: var(--muted);
    font-style: italic;
}

.journal-section {
    margin-top: 0.75rem;
}

.journal-section h4 {
    margin: 0 0 0.25rem;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--warning);
}

.journal-section p {
    margin: 0;
    color: var(--text);
    font-size: 0.95rem;
}

.hub-tab-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

/* Formula helper =========================================================== */

.formula-helper {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    margin-top: 1rem;
    box-shadow: var(--shadow);
}

.formula-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.formula-label {
    font-weight: 700;
    color: var(--accent);
}

.formula-hint {
    font-size: 0.85rem;
    color: var(--muted);
}

.formula-bar {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.formula-input {
    flex: 1;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    padding: 0.5rem 0.75rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.95rem;
}

.formula-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--border-glow);
}

.formula-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.75rem;
}

.formula-chip {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text);
    padding: 0.25rem 0.6rem;
    font-size: 0.8rem;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.formula-chip:hover {
    border-color: var(--accent);
    background: var(--panel-hover);
}

.formula-preview {
    overflow-x: auto;
}

.formula-preview-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.formula-preview-table th,
.formula-preview-table td {
    border: 1px solid var(--border);
    padding: 0.4rem 0.6rem;
    text-align: left;
}

.formula-preview-table th {
    background: var(--bg);
    color: var(--accent);
    font-weight: 600;
}

.formula-error {
    color: var(--error);
    background: rgba(255, 82, 82, 0.08);
    border: 1px solid rgba(255, 82, 82, 0.3);
    border-radius: 6px;
    padding: 0.6rem 0.8rem;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

/* Dr. Ray's notes: one habit per filed case, numbered in story order. */
.journal-ray { margin: 0 0 1.5rem; padding: 1rem 1.25rem; border: 1px solid var(--border); border-radius: 8px; }
.journal-ray h2 { margin: 0 0 .25rem; font-size: 1.25rem; }
.journal-ray-list { margin: .75rem 0 0; padding-left: 1.4rem; }
.journal-ray-list li { margin: 0 0 .9rem; }
.journal-ray-list p { margin: .2rem 0; }
.journal-ray-habit { font-weight: 600; }
.journal-ray-from { color: var(--muted); font-size: .85rem; }
