*, *::before, *::after { box-sizing: border-box; }
:root {
  color-scheme: light;
  --paper: #f6f5ef;
  --ink: #243e34;
  --muted: #626b60;
  --line: #d9ddd2;
  --surface: #fffef9;
}
body { margin: 0; background: var(--paper); color: var(--ink); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; line-height: 1.6; }
main { max-width: 1060px; margin: auto; padding: 0 48px; }
.masthead { display: flex; align-items: center; justify-content: space-between; padding: 30px 0; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-size: 25px; font-weight: 650; letter-spacing: -1px; }
.brand-mark { background: var(--ink); color: var(--paper); width: 33px; height: 35px; border-radius: 10px 10px 10px 2px; text-align: center; font-family: Georgia, serif; line-height: 31px; }
.brand-dot { color: #87977d; font-weight: 400; }
.edition, .eyebrow, .date-label { font-size: 10px; letter-spacing: 2px; font-weight: 650; }
.edition { color: var(--muted); }
.intro { display: grid; grid-template-columns: 1.5fr 1fr; align-items: center; gap: 40px; padding: 56px 0 46px; }
.eyebrow { color: #607651; margin: 0 0 17px; }
h1 { font-family: Georgia, "Times New Roman", serif; font-weight: 400; font-size: clamp(40px, 5vw, 60px); line-height: 1.08; letter-spacing: -2px; margin: 0; }
h1 > span { color: #aa6546; }
.intro-copy { font-size: 14px; color: var(--muted); margin: 21px 0 0; }
.date-note { border-left: 1px solid #cdd4c3; padding: 14px 0 14px 32px; }
.date-label { color: var(--muted); }
#date-display { font-family: Georgia, serif; font-size: 25px; margin: 10px 0 14px; }
.note-line { display: block; width: 34px; border-top: 2px solid #a6b196; margin-bottom: 14px; }
.date-caption { font-size: 12px; color: var(--muted); font-style: italic; }
.journal-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.journal-heading h2 { margin: 0; font-size: 16px; font-weight: 600; }
.journal-heading > span { font-size: 12px; color: var(--muted); }
.activity-toggles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 28px; }
.toggle-label { position: relative; display: flex; align-items: center; gap: 13px; min-height: 106px; padding: 20px 32px 20px 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); cursor: pointer; transition: background .15s, border-color .15s; }
.toggle-label:hover { border-color: #7e8e77; }
.toggle-label:has(input:checked) { background: #e8eee1; border-color: #607651; }
.toggle-label.creative:has(input:checked) { background: #f6e9e0; border-color: #a86b4c; }
.toggle-label.learning:has(input:checked) { background: #e9e9f3; border-color: #77709c; }
.toggle-label input { position: absolute; top: 12px; right: 12px; width: 15px; height: 15px; accent-color: var(--ink); margin: 0; }
.activity-icon { display: grid; place-items: center; background: #e9eddf; color: #516b36; border-radius: 50%; width: 40px; height: 40px; flex-shrink: 0; font-size: 26px; }
.creative .activity-icon { background: #f4e7dc; color: #9e5b3d; }
.learning .activity-icon { background: #eae7f2; color: #6b6091; }
.activity-copy strong { display: block; font-size: 17px; font-weight: 600; }
.activity-copy small { display: block; font-size: 10px; color: var(--muted); margin-top: 3px; }
section { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 26px 30px; margin-bottom: 18px; }
section[hidden] { display: none; }
section h2 { font-family: Georgia, serif; font-weight: 400; font-size: 24px; margin: 0 0 18px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.section-number { font-family: system-ui, sans-serif; font-size: 11px; color: var(--muted); margin-right: 12px; }
section > label, legend { display: block; font-size: 12px; font-weight: 600; margin: 16px 0 6px; }
input[type="text"], input[type="number"], textarea { font: inherit; font-size: 15px; width: 100%; padding: 12px 14px; color: var(--ink); background: #f8f8f3; border: 1px solid #c8cec1; border-radius: 7px; }
input::placeholder, textarea::placeholder { color: #72776d; opacity: 1; }
textarea { resize: vertical; min-height: 90px; }
:focus-visible { outline: 3px solid #8a6541; outline-offset: 4px; }
.duration-fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
.duration-fieldset legend { padding: 0; padding-top: 16px; }
.duration-inputs { display: flex; align-items: center; gap: 10px; }
.duration-inputs input[type="number"] { width: 90px; }
.duration-inputs span { color: var(--muted); font-size: 12px; margin-right: 12px; }
.form-actions { display: flex; align-items: center; gap: 22px; border-top: 1px solid var(--line); padding-top: 24px; }
button { font: inherit; font-size: 13px; cursor: pointer; border: 0; border-radius: 7px; padding: 14px 22px; }
button[type="submit"] { background: var(--ink); color: #fffef9; font-weight: 600; }
button[type="submit"] span { margin-left: 24px; font-size: 18px; }
button[type="submit"]:hover:not(:disabled) { background: #395a46; }
button:disabled { opacity: .6; cursor: wait; }
button[type="button"] { background: transparent; color: var(--muted); padding: 12px 0; text-decoration: underline; text-underline-offset: 4px; }
button[type="button"]:hover { color: var(--ink); }
#status-msg { min-height: 24px; font-size: 14px; margin: 16px 0; }
#status-msg.success { color: #31613e; }
#status-msg.error { color: #a12f26; }
.page-footer { display: flex; justify-content: space-between; padding: 25px 0 32px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.page-footer > span:first-child { font-family: Georgia, serif; font-style: italic; font-size: 14px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
@media (max-width: 740px) {
  main { padding: 0 22px; }
  .edition { font-size: 8px; letter-spacing: 1px; }
  .intro { grid-template-columns: 1fr; gap: 28px; padding: 36px 0; }
  .date-note { padding: 0 0 0 18px; }
  #date-display { font-size: 22px; margin: 4px 0; }
  .note-line, .date-caption { display: none; }
  .activity-toggles { gap: 9px; }
  .toggle-label { flex-direction: column; align-items: flex-start; padding: 16px 12px; gap: 9px; }
  .activity-copy strong { font-size: 15px; }
  .activity-copy small { display: none; }
  .journal-heading { flex-direction: column; gap: 2px; }
  section { padding: 20px; }
  .form-actions { flex-wrap: wrap; gap: 10px 20px; }
  .page-footer { gap: 15px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* Keep each selection control next to its fields for multi-activity entry. */
main { max-width: 1240px; padding: 0 32px; }
.masthead { padding: 18px 0; }
.intro { padding: 26px 0; gap: 24px; }
h1 { font-size: 36px; letter-spacing: -1px; }
h1 br { display: none; }
.eyebrow { margin-bottom: 8px; }
.intro-copy { margin-top: 10px; }
.desktop-break { display: none; }
.date-note { padding: 0 0 0 24px; }
#date-display { font-size: 21px; margin: 5px 0; }
.note-line, .date-caption { display: none; }
.activity-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; margin-bottom: 22px; }
.activity-panel { min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.activity-panel .toggle-label { border: 0; min-height: 82px; border-radius: 11px; padding: 16px 32px 16px 16px; flex-direction: row; align-items: center; }
.activity-panel:has(input:checked) .toggle-label { border-radius: 11px 11px 0 0; }
.activity-panel section { border: 0; margin: 0; padding: 4px 18px 18px; background: transparent; }
.activity-panel section > label { margin-top: 12px; }
.activity-panel input[type="text"], .activity-panel input[type="number"], .activity-panel textarea { padding: 9px 10px; }
.activity-panel .duration-inputs { gap: 6px; }
.activity-panel .duration-inputs input { width: 65px; }
.activity-panel textarea { min-height: 68px; }
.activity-panel .activity-copy small { display: block; }
.form-actions { position: sticky; bottom: 0; padding: 14px 0; background: var(--paper); z-index: 1; }
.page-footer { padding: 15px 0; }
@media (max-width: 680px) {
  main { padding: 0 18px; }
  .intro { gap: 14px; padding: 22px 0; }
  h1 { font-size: 31px; }
  .intro-copy { display: none; }
  .date-note { border: 0; padding: 0; }
  .date-label { display: none; }
  .activity-grid { grid-template-columns: 1fr; gap: 12px; }
  .form-actions { gap: 12px; }
  button { padding: 12px; }
  button[type="submit"] span { margin-left: 8px; }
}

/* Current form totals replace decorative copy. */
.entry-summary { display: flex; align-items: center; gap: 36px; padding: 18px 22px; margin-bottom: 26px; background: #e9eddf; border-radius: 10px; }
.entry-summary strong { display: block; font-size: 19px; font-weight: 600; }
.summary-label { color: var(--muted); font-size: 12px; }
.entry-summary p { margin: 0 0 0 auto; max-width: 160px; color: var(--muted); font-size: 11px; }
@media (max-width: 680px) { .entry-summary { flex-wrap: wrap; gap: 12px 24px; } .entry-summary p { margin: 0; max-width: none; width: 100%; } }

/* Authentication uses the same form styling on web and Android. */
[hidden] { display: none !important; }
#login-form { max-width: 420px; margin: 40px auto; }
#login-form label { display: block; margin-top: 16px; }
#login-form input { width: 100%; padding: 12px; font: inherit; margin-bottom: 12px; }
#login-status { color: #a12f26; }
