.journal,
.journal *,
body > footer {
    box-sizing: border-box;
}

.journal {
    width: 100%;
    max-width: 880px;
    padding: 40px 24px 64px;
    color: #252b31;
}

.journal-heading h1 {
    margin: 0 0 10px;
    font-size: clamp(1.8rem, 5vw, 2.3rem);
    letter-spacing: -0.035em;
}

.journal-heading p,
.journal-hint,
.journal-empty {
    color: #626b73;
    line-height: 1.6;
}

.journal-heading p { margin: 0 0 28px; }

.journal-tabs {
    display: flex;
    gap: 4px;
    max-width: 340px;
    padding: 5px;
    border: 1px solid #dfe4e2;
    border-radius: 10px;
    background: #f2f5f3;
}

.journal-tabs button {
    flex: 1;
    border: 0;
    border-radius: 6px;
    padding: 12px 20px;
    background: transparent;
    color: #526057;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.journal-tabs button[aria-selected="true"] {
    color: #fff;
    background: #245c45;
    box-shadow: 0 2px 4px #183c2420;
}

.journal :is(button, a, input, textarea, [contenteditable]):focus-visible {
    outline: 3px solid #539a77;
    outline-offset: 3px;
}

.journal-notice {
    font-size: 0.875rem;
    color: #626b73;
    line-height: 1.6;
    margin: 18px 0 28px;
}

.journal-notice:empty { display: none; }
.journal-panel { margin-top: 28px; }
.journal-panel[hidden], .journal [hidden] { display: none; }

.journal-panel-heading,
.journal-entry-heading,
.journal-editor-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.journal-panel-heading { margin-bottom: 22px; }
.journal-panel-heading h2 { margin: 0; font-size: 1.1rem; }

.journal-button {
    padding: 10px 16px;
    min-height: 42px;
    border: 1px solid #245c45;
    border-radius: 7px;
    background: #245c45;
    color: #fff;
    font: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
}

.journal-button:hover { background: #194632; }
.journal-button-secondary { color: #414b45; background: #fff; border-color: #cdd5d0; }
.journal-button-secondary:hover { background: #f2f5f3; }
.journal-button:disabled { opacity: 0.55; cursor: wait; }

.journal-day {
    margin-top: 28px;
    border-top: 1px solid #e1e6e3;
    padding-top: 22px;
}

.journal-day h3 { margin: 0 0 18px; font-size: 1.3rem; }
.journal-empty { margin: 0; padding: 24px; border: 1px dashed #cdd5d0; border-radius: 10px; }

.journal-editor,
.journal-entry {
    padding: 24px;
    border: 1px solid #dce3df;
    border-radius: 10px;
    margin-bottom: 18px;
}

.journal-editor { background: #f8faf9; }
.journal-editor h3 { margin: 0 0 22px; }
.journal-editor label { display: block; font-weight: 600; margin-top: 18px; font-size: 0.9rem; }

.journal-editor :is(input, textarea) {
    display: block;
    width: 100%;
    min-width: 0;
    padding: 11px;
    margin-top: 8px;
    border: 1px solid #bdc9c1;
    border-radius: 6px;
    background: #fff;
    color: #252b31;
    font: inherit;
    font-weight: 400;
    line-height: 1.5;
}

.journal-editor input[type="date"] { max-width: 210px; }
.journal-editor textarea { resize: vertical; }
.journal-paste-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 14px; }
.journal-paste-controls span { color: #626b73; font-size: 0.85rem; line-height: 1.5; }
.journal-paste-box { min-height: 82px; margin-top: 12px; padding: 22px 16px; border: 1px dashed #9aafa0; border-radius: 7px; background: #fff; cursor: text; line-height: 1.5; }
.journal-paste-box:empty::before { content: attr(data-placeholder); color: #626b73; pointer-events: none; }
.journal-paste-box.is-dragging { background: #edf5ef; border-color: #245c45; }
.journal-hint { margin-top: 8px; font-size: 0.8rem; }
.journal-editor-actions { justify-content: flex-start; }
.journal-editor-status { line-height: 1.5; color: #914121; }
.journal-entry-description { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.7; margin: 0 0 20px; }
.journal-entry-description:last-child { margin-bottom: 0; }
.journal-entry-heading { justify-content: flex-end; margin-bottom: 16px; }
.journal-entry-images { display: grid; gap: 16px; }
.journal-entry-images a { display: block; }
.journal-entry-images img { display: block; width: 100%; height: auto; border: 1px solid #e1e6e3; border-radius: 6px; }
.journal-image-previews { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; }
.journal-image-preview { margin: 0; min-width: 0; }
.journal-image-preview img { width: 100%; height: 100px; object-fit: contain; background: #eef2ef; border-radius: 6px; }
.journal-image-preview button { width: 100%; margin-top: 6px; }

@media (max-width: 540px) {
    .journal { padding: 28px 16px 40px; }
    .journal-tabs { max-width: none; }
    .journal-editor, .journal-entry { padding: 16px; }
}
