/* Private, opt-in diary — a paper notebook with clear consent and generation states. */
.diary-page { max-width: 1120px; }
.diary-page *, .diary-page *::before, .diary-page *::after { min-width: 0; }
.diary-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 4px 0 18px; border-bottom: 3px solid var(--comic-ink); }
.diary-header nav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px 18px; font-size: 11px; font-weight: 750; }
.diary-header .comic-brand-sub { font-size: 8px; letter-spacing: 1px; }
.diary-cover { display: flex; align-items: stretch; justify-content: space-between; gap: 20px; margin: 25px 0 30px; border: 3px solid var(--comic-ink); background: white; box-shadow: 6px 6px 0 var(--comic-ink); overflow: hidden; }
.diary-cover > div:first-child { padding: 25px 29px; }
.diary-cover h1 { margin: 15px 0 10px; color: var(--comic-ink); font-size: 34px; font-weight: 900; line-height: 1.35; letter-spacing: -1px; }
.diary-cover h1 em { font-style: normal; color: var(--comic-blue); }
.diary-cover p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.8; }
.diary-cover-art { position: relative; width: 260px; flex-shrink: 0; border-left: 3px solid var(--comic-ink); }
.diary-cover-art img { display: block; width: 100%; height: 100%; max-height: 250px; object-fit: cover; }
.diary-cover-art > span { position: absolute; bottom: 16px; right: 12px; padding: 8px 12px; color: var(--comic-ink); font-size: 13px; font-weight: 800; background: var(--comic-yellow); border: 2px solid var(--comic-ink); border-radius: 50%; transform: rotate(-7deg); }
.diary-settings-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.diary-page .card { padding: 24px; margin-bottom: 24px; }
.diary-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 18px; }
.diary-section-heading > div { display: flex; align-items: center; gap: 12px; }
.diary-section-heading h2 { margin: 0; font-size: 19px; font-weight: 850; }
.diary-section-heading .panel-number { font-size: 29px; align-self: center; }
.diary-section-heading .chip { font-size: 10px; }
.diary-small-note { color: var(--muted); font-size: 11px; line-height: 1.9; margin: 10px 0 16px; }
.diary-page fieldset { margin: 0; padding: 0; border: 0; }
.diary-toggle-label { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin: 18px 0; padding: 16px; background: var(--comic-pale); border: 1px solid #c5d3ed; border-radius: 4px; cursor: pointer; }
.diary-toggle-label strong, .diary-toggle-label small { display: block; }
.diary-toggle-label strong { font-size: 14px; }
.diary-toggle-label small { margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.8; }
.diary-toggle-label input { width: 21px; height: 21px; flex: 0 0 21px; accent-color: var(--comic-blue); cursor: pointer; }
.diary-time-field { display: grid; grid-template-columns: minmax(0, 1fr) 135px; align-items: center; gap: 7px 14px; margin: 20px 0; }
.diary-time-field > label { font-size: 12px; font-weight: 750; }
.diary-time-field > .input { font-size: 15px; padding: 10px 12px; background: white; box-shadow: none; border: 2px solid #a5b3ca; border-radius: 5px; min-height: 45px; }
.diary-time-field > span { grid-column: 1 / -1; color: var(--muted); font-size: 10px; }
.diary-consent-block { margin: 20px 0; padding-top: 4px; border-top: 1px dashed #b6c2d5; }
.diary-consent-block .checkbox { display: flex; align-items: start; gap: 10px; margin: 15px 0 0; font-size: 11px; line-height: 1.9; cursor: pointer; }
.diary-consent-block .checkbox input { width: 17px; height: 17px; flex: 0 0 17px; margin-top: 3px; accent-color: var(--comic-blue); }
.diary-settings-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.diary-settings-actions > .btn { font-size: 12px; }
.diary-settings-actions > span { color: var(--muted); font-size: 10px; }
.diary-writing-note { border: 2px solid var(--comic-ink); background: #fff8dd; padding: 18px 20px; box-shadow: 4px 4px 0 #dfd1a5; }
.diary-note-heading { display: flex; align-items: center; gap: 12px; padding-bottom: 12px; border-bottom: 1px dashed #c9b984; }
.diary-note-heading > img { width: 65px; height: 75px; object-fit: contain; }
.diary-note-heading .chapter-label { font-size: 9px; }
.diary-note-heading h2 { margin: 12px 0 0; color: var(--comic-ink); font-size: 18px; font-weight: 850; }
.diary-writing-note > ul { padding: 0 0 0 18px; margin: 18px 0; }
.diary-writing-note li { color: #6b644f; font-size: 11px; line-height: 1.9; margin: 8px 0; }
.diary-writing-note > p { color: var(--comic-ink); padding-top: 10px; border-top: 1px dashed #c9b984; font-size: 11px; line-height: 1.8; }
.diary-writing-note > .text-button { display: inline-block; font-size: 11px; }
.diary-date-label { color: var(--muted); font-size: 12px; font-weight: 750; }
.diary-today-summary { display: flex; align-items: center; justify-content: space-between; gap: 25px; }
.diary-today-summary > div { flex: 1; }
.diary-today-summary h3 { margin: 11px 0 8px; font-size: 20px; font-weight: 850; }
.diary-today-summary p { color: var(--muted); font-size: 12px; line-height: 1.9; margin: 0; }
.diary-today-summary > .btn { font-size: 12px; padding: 12px 16px; flex-shrink: 0; }
.diary-generating { display: flex; align-items: start; gap: 13px; padding: 15px; margin-top: 18px; border: 1px solid #b6c9ec; background: var(--comic-pale); }
.diary-generating strong { font-size: 12px; }
.diary-generating p { color: var(--muted); font-size: 11px; margin: 5px 0 0; line-height: 1.8; }
.diary-loading-dot { margin-top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--comic-blue); flex: 0 0 10px; animation: diaryPulse 1s ease-in-out infinite; }
@keyframes diaryPulse { 50% { opacity: .3; } }
.diary-message { padding: 12px 14px; margin-top: 15px; background: #eef8f2; border: 1px solid #a6c7b5; border-radius: 4px; color: #2c624a; font-size: 12px; line-height: 1.8; overflow-wrap: anywhere; }
.diary-message.error { background: #fff1ee; border-color: #d8b2a9; color: #8c4236; }
.diary-history { margin-top: 12px; }
.diary-history-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 26px 0 20px; }
.diary-history-heading h2 { margin: 13px 0 0; font-size: 25px; font-weight: 900; }
.diary-history-heading > .btn { font-size: 12px; }
.diary-entry-list { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.diary-entry-card { margin: 0; padding: 20px; border: 2px solid var(--comic-ink); background: #fffefa; box-shadow: 4px 4px 0 #d2dcef; }
.diary-entry-card > .row { flex-wrap: wrap; gap: 9px; }
.diary-entry-card > .row > time { font-size: 11px; color: var(--muted); }
.diary-entry-card h3 { font-size: 18px; font-weight: 850; line-height: 1.5; margin: 16px 0 9px; overflow-wrap: anywhere; }
.diary-entry-card > p { color: var(--muted); font-size: 11px; line-height: 1.9; margin: 0 0 10px; overflow-wrap: anywhere; }
.diary-entry-source { margin: 15px 0 0; padding-top: 10px; border-top: 1px dashed #bdc7d9; color: var(--muted); font-size: 10px; line-height: 1.8; }
.diary-entry-card .btn-row { gap: 10px; margin-top: 15px; }
.diary-entry-card .btn { font-size: 11px; }
.diary-entry-card.status-deleted { opacity: .78; border-style: dashed; }
.diary-empty { grid-column: 1 / -1; display: flex; align-items: center; justify-content: center; gap: 25px; min-height: 210px; padding: 25px; border: 2px dashed #aebcd5; background: #f2f5fc; }
.diary-empty img { width: 115px; height: 130px; object-fit: cover; border: 2px solid var(--comic-ink); border-radius: 50%; }
.diary-empty h3 { font-size: 20px; font-weight: 850; margin-bottom: 9px; }
.diary-empty p { color: var(--muted); font-size: 12px; line-height: 1.9; margin: 0; }
.diary-read-meta { display: flex; flex-wrap: wrap; gap: 9px; margin: 8px 0 16px; font-size: 10px; color: #5a6a84; }
.diary-read-body { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; line-height: 2; color: var(--comic-ink); padding: 17px; border: 1px solid #dce3f0; background: #fffefa; }
.diary-read-note { font-size: 10px; color: var(--muted); line-height: 1.8; margin: 15px 0; }
.diary-colophon { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; border-top: 2px solid var(--comic-ink); padding-top: 15px; margin-top: 35px; color: var(--muted); font-size: 9px; letter-spacing: .5px; }
@media(max-width:800px) { .diary-settings-grid { grid-template-columns: 1fr; gap: 0; } .diary-writing-note { margin-bottom: 24px; } }
@media(max-width:640px) {
  .diary-header { align-items: start; gap: 12px; }
  .diary-header .comic-brand { font-size: 19px; }
  .diary-header .comic-brand > img { width: 36px; height: 36px; }
  .diary-header .comic-brand-sub { font-size: 7px; letter-spacing: 0; }
  .diary-header nav { max-width: 100px; gap: 5px 9px; font-size: 9px; }
  .diary-cover { gap: 0; margin: 21px 0 25px; }
  .diary-cover > div:first-child { padding: 19px 16px; }
  .diary-cover .chapter-label { font-size: 8px; padding: 3px 5px; }
  .diary-cover h1 { font-size: 25px; margin: 13px 0 9px; }
  .diary-cover p { font-size: 10px; }
  .diary-cover-art { width: 112px; }
  .diary-cover-art img { max-height: none; object-position: 45% center; }
  .diary-cover-art > span { font-size: 10px; padding: 6px 8px; right: 5px; bottom: 14px; }
  .diary-page .card { padding: 19px; margin-bottom: 22px; }
  .diary-section-heading { gap: 10px; }
  .diary-section-heading > div { gap: 10px; }
  .diary-section-heading h2 { font-size: 17px; }
  .diary-section-heading .panel-number { font-size: 26px; }
  .diary-section-heading .chip { font-size: 9px; }
  .diary-small-note { font-size: 10px; }
  .diary-toggle-label { padding: 13px; gap: 12px; }
  .diary-toggle-label strong { font-size: 13px; }
  .diary-toggle-label small { font-size: 9px; }
  .diary-time-field { grid-template-columns: minmax(0,1fr) 120px; gap: 7px 12px; }
  .diary-time-field > label { font-size: 11px; }
  .diary-time-field > .input { font-size: 13px; padding: 9px; }
  .diary-consent-block .checkbox { font-size: 10px; }
  .diary-settings-actions > .btn { font-size: 11px; }
  .diary-writing-note { padding: 16px; }
  .diary-note-heading h2 { font-size: 17px; }
  .diary-note-heading > img { width: 55px; height: 65px; }
  .diary-writing-note li { font-size: 10px; }
  .diary-today-summary { flex-direction: column; align-items: stretch; gap: 17px; }
  .diary-today-summary h3 { font-size: 19px; }
  .diary-today-summary p { font-size: 11px; }
  .diary-today-summary > .btn { width: 100%; }
  .diary-date-label { font-size: 10px; }
  .diary-history-heading { gap: 15px; }
  .diary-history-heading h2 { font-size: 22px; }
  .diary-history-heading > .btn { font-size: 10px; padding: 9px 12px; }
  .diary-entry-list { grid-template-columns: 1fr; gap: 17px; }
  .diary-entry-card { padding: 18px; }
  .diary-empty { padding: 20px 15px; gap: 15px; min-height: 170px; }
  .diary-empty img { width: 79px; height: 100px; }
  .diary-empty h3 { font-size: 17px; }
  .diary-empty p { font-size: 10px; }
  .diary-read-body { font-size: 13px; padding: 13px; }
  .diary-colophon { font-size: 8px; }
  .diary-colophon > span:nth-child(2) { display: none; }
}
@media(max-width:359px) {
  .diary-header .comic-brand > img { display: none; }
  .diary-header .comic-brand { font-size: 18px; }
  .diary-cover > div:first-child { padding: 16px 12px; }
  .diary-cover .chapter-label { font-size: 7px; }
  .diary-cover h1 { font-size: 22px; }
  .diary-cover-art { width: 82px; }
  .diary-cover-art > span { font-size: 9px; padding: 5px 6px; }
  .diary-page .card { padding: 16px; }
  .diary-section-heading h2 { font-size: 15px; }
  .diary-section-heading > div { gap: 8px; }
  .diary-section-heading .panel-number { font-size: 24px; }
  .diary-note-heading h2 { font-size: 15px; }
  .diary-time-field { grid-template-columns: minmax(0,1fr) 108px; }
}
@media(prefers-reduced-motion:reduce) { .diary-page *, .diary-page *::before, .diary-page *::after { transition:none!important;animation:none!important;scroll-behavior:auto!important; } }
