.journal { max-width: 1220px; margin: auto; padding: clamp(22px, 4vw, 55px) clamp(18px, 5vw, 72px) 3rem; }
.journal-cover { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: clamp(20px, 3.7vw, 50px); border-radius: 26px 72px 20px 20px; background: #e5ead3; }
.journal-cover h1 { font-size: clamp(2.5rem, 5.8vw, 5.4rem); }
.journal-cover p { max-width: 33ch; margin-top: .7rem; font-size: clamp(1.08rem, 1.8vw, 1.45rem); }
.journal-cover img { width: clamp(100px, 22vw, 245px); height: auto; mix-blend-mode: multiply; }
.journal h2, #share-dialog h2 { font-size: clamp(1.7rem, 3.1vw, 2.6rem); overflow-wrap: anywhere; }
.journal label, #share-dialog label { display: block; min-width: 0; font-weight: bold; }
.journal :is(input:not([type="radio"], [type="checkbox"]), select, textarea), #share-dialog textarea { display: block; width: 100%; margin-top: .35rem; min-height: 46px; min-width: 0; padding: .65rem .8rem; border: 1px solid #96876c; border-radius: 8px; background-color: #fffdf6; color: var(--ink); font: 1rem/1.35 var(--body); }
.journal select { padding-right: 1.9rem; }
.journal textarea, #share-dialog textarea { resize: vertical; }
textarea:focus-visible { outline: 3px solid #005b8d; outline-offset: 3px; }
.profile-panel, .entry-panel { background: #fff9ed; border: 1px solid var(--rule); border-radius: 16px; padding: clamp(18px, 3vw, 32px); }
.profile-panel { margin-top: 1.5rem; }
.profile-panel > p { margin: .45rem 0 1.2rem; font-size: 1.05rem; }
.profile-fields { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 1rem; }
.form-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .4rem 1rem; margin-top: 1.2rem; }
.journal button, #share-dialog button { min-height: 44px; }
.save, .outline { padding: .6rem 1.2rem; border: 1px solid transparent; border-radius: 2rem; font: 400 1rem/1.3 var(--display); }
.save { color: #fff9ee; background: var(--red); }
.save:hover { background: var(--red-dark); }
.outline { border-color: #8b8e76; background: transparent; }
.outline:hover:enabled { background: #e9e8d3; }
.journal button:disabled { opacity: .6; cursor: default; }
.quiet { display: inline-flex; align-items: center; min-height: 44px; padding: .28rem .2rem; color: var(--ink); text-decoration: underline; text-underline-offset: .2em; background: none; border: 0; font: 1rem/1.3 var(--body); }
.pet-switch { display: flex; align-items: end; flex-wrap: wrap; gap: .5rem 1.2rem; margin-block: 1.6rem; }
.pet-switch label { width: min(100%, 320px); }
.journal-spread { display: grid; grid-template-columns: minmax(0, .86fr) minmax(0, 1.14fr); align-items: start; gap: clamp(20px, 3.8vw, 52px); }
.entry-kinds { display: flex; flex-wrap: wrap; gap: .35rem; margin: 1.1rem 0; border: 0; padding: 0; }
.entry-kinds legend { margin-bottom: .4rem; font-weight: bold; }
.entry-kinds label { position: relative; display: inline-flex; align-items: center; min-height: 44px; padding: .45rem .9rem; border: 1px solid #90937c; border-radius: 99px; cursor: pointer; }
.entry-kinds label:has(:checked) { background: var(--ink); color: var(--paper); }
.entry-kinds label:focus-within { outline: 3px solid #005b8d; outline-offset: 2px; }
.entry-kinds input { position: absolute; width: 1px; opacity: 0; }
.measure-row { display: flex; gap: .7rem; }
.measure-row label { flex: 1; }
#entry-form > label { margin-top: .8rem; }
.optional { font-weight: normal; }
.history-panel { padding-top: .5rem; }
.history-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .65rem; padding-bottom: .9rem; border-bottom: 1px solid var(--rule); }
#empty-history { margin: 1.3rem 0; font-size: 1.08rem; }
#history { list-style: none; margin: 0; padding: 0; }
#history li { padding: .95rem 0 .6rem; border-bottom: 1px solid var(--rule); overflow-wrap: anywhere; }
#history h3 { font: 400 1.25rem/1.3 var(--display); letter-spacing: -.03em; }
#history time { display: inline-block; font-size: .94rem; margin: .2rem 0 .25rem; color: #4c594a; }
.entry-note { white-space: pre-wrap; }
.record-actions { display: flex; flex-wrap: wrap; gap: .25rem 1rem; }
.journal-feedback:not(:empty), .journal-notice { padding: .75rem 1rem; background: #e8eddc; margin: 1rem 0; border-radius: 8px; }
.journal-notice { background: #f7dfbb; }
.privacy-note { margin-top: 1.5rem; color: #4f584a; max-width: 74ch; }
.journal-transfer { margin-top: .9rem; padding: .6rem clamp(16px, 3vw, 28px); border: 1px solid var(--rule); border-radius: 14px; background: #fff9ed; }
.journal-transfer summary { padding: .55rem 0; min-height: 44px; font: 400 1.2rem/1.4 var(--display); cursor: pointer; }
.transfer-tools { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); gap: 1.25rem 2.5rem; padding: 1rem 0; border-top: 1px solid var(--rule); }
.transfer-tools h3 { font: 400 1.2rem/1.4 var(--display); }
.transfer-tools p { margin: .35rem 0 .75rem; max-width: 52ch; }
.journal #backup-file { max-width: 100%; padding: .4rem; }
#backup-file::file-selector-button { padding: .35rem .6rem; margin-right: .5rem; cursor: pointer; }
#backup-status:not(:empty) { margin: .4rem 0 .75rem; padding: .65rem .85rem; background: #e8eddc; border-radius: 8px; white-space: pre-line; }
#backup-actions { margin: .5rem 0; }
#share-dialog label { margin-top: 1.1rem; }
#share-status:not(:empty) { margin-top: .7rem; }
.care-card { margin-top: clamp(24px, 4vw, 54px); padding: clamp(18px, 3vw, 32px); border: 1px solid var(--rule); background: #fbefdc; border-radius: 18px; }
#care-intro { margin: .45rem 0 1.1rem; }
.care-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.care-hint, #care-choices-help { margin-top: .5rem; font-size: .95rem; color: #495545; }
.care-choices { min-width: 0; margin: 1.2rem 0; padding: 0; border: 0; }
.care-choices legend { padding: 0; font-weight: bold; }
#care-choices { margin-top: .45rem; }
#care-choices label { display: flex; align-items: baseline; gap: .75rem; padding: .5rem 0; border-bottom: 1px solid var(--rule); min-height: 44px; cursor: pointer; }
#care-choices input { width: 1.1rem; height: 1.1rem; accent-color: var(--ink); flex: 0 0 auto; }
#care-choices label > span { min-width: 0; overflow-wrap: anywhere; }
#care-choices small { display: inline-block; margin-inline-start: .55rem; font-weight: normal; }
.care-entry-note { display: block; white-space: pre-wrap; font-weight: normal; }
#care-feedback:not(:empty) { margin-top: .6rem; }
@media(max-width: 770px) {
  .journal-spread { grid-template-columns: 1fr; }
  .history-panel { padding-top: .2rem; }
  .care-fields { grid-template-columns: minmax(0, 1fr); }
}
@media(max-width: 560px) {
  .profile-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
  .profile-fields label:first-child { grid-column: 1/-1; }
  .journal-cover { border-radius: 16px 42px 12px 12px; }
  .journal-cover { display: grid; grid-template-columns: minmax(0, 1fr) clamp(80px, 22vw, 112px); gap: .65rem .2rem; }
  .journal-cover > div { display: contents; }
  .journal-cover h1 { grid-row: 1; }
  .journal-cover p { grid-column: 1/-1; grid-row: 2; margin: 0; }
  .journal-cover img { grid-row: 1; grid-column: 2; width: 100%; }
}
