:root {
  color-scheme: light;
  --canvas: #f4f5f1;
  --surface: #ffffff;
  --surface-soft: #f8f9f6;
  --ink: #202b25;
  --muted: #7c877f;
  --muted-light: #a4ada6;
  --line: #e7ebe5;
  --line-strong: #dce3db;
  --green: #365d49;
  --green-dark: #294b39;
  --green-soft: #eaf1eb;
  --green-pale: #f1f6f1;
  --gold: #c49b62;
  --shadow: 0 18px 55px rgba(35, 55, 42, .055), 0 2px 8px rgba(35, 55, 42, .025);
  --sans: Inter, 'Avenir Next', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --serif: 'Iowan Old Style', 'Palatino Linotype', 'Book Antiqua', Georgia, 'Times New Roman', serif;
}
* { box-sizing: border-box; }
html { min-height: 100%; background: var(--canvas); }
body { margin: 0; min-width: 320px; min-height: 100vh; color: var(--ink); background: var(--canvas); font-family: var(--sans); -webkit-font-smoothing: antialiased; }
button, textarea { font: inherit; }
button { color: inherit; cursor: pointer; }
button:focus-visible, textarea:focus-visible { outline: 3px solid rgba(54, 93, 73, .32); outline-offset: 3px; }
.app-shell { width: min(1160px, 100% - 64px); min-height: 100vh; margin: 0 auto; display: flex; flex-direction: column; }
.site-header { min-height: 88px; display: flex; align-items: center; justify-content: space-between; gap: 24px; border-bottom: 1px solid var(--line-strong); }
.brand { display: inline-flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.brand-mark { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 13px; color: #fff; background: var(--green); font: 25px/1 var(--serif); box-shadow: 0 5px 12px rgba(41, 75, 57, .16); }
.brand-copy { display: grid; gap: 2px; }
.brand-name { font: 600 21px/1 var(--serif); letter-spacing: -.55px; }
.brand-note { color: var(--muted); font-size: 10px; letter-spacing: .015em; }
.header-actions { display: flex; align-items: center; gap: 8px; }
.text-button, .primary-button { min-height: 38px; padding: 0 14px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: #526158; font-size: 12px; font-weight: 600; transition: background .18s, border-color .18s, color .18s, transform .18s; }
.text-button:hover { background: #e9ede7; color: var(--green-dark); }
.header-divider { width: 1px; height: 22px; margin: 0 5px; background: var(--line-strong); }
.today-button { border-color: var(--line-strong); background: var(--surface); color: var(--green-dark); }
.today-button:hover { border-color: #b9c9bb; background: var(--green-pale); }
.primary-button { border-color: var(--green); background: var(--green); color: white; }
.primary-button:hover { background: var(--green-dark); transform: translateY(-1px); }
.main-content { flex: 1; padding: 44px 0 32px; }
.welcome-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 28px; margin-bottom: 48px; }
.eyebrow, .section-kicker { margin: 0 0 12px; color: var(--green); font-size: 10px; font-weight: 700; letter-spacing: .17em; }
.page-heading { margin: 0; font: 400 clamp(34px, 4.5vw, 48px)/1.13 var(--serif); letter-spacing: -1.35px; }
.page-heading em { color: var(--green); font-weight: 400; }
.page-intro { margin: 12px 0 0; color: var(--muted); font-size: 13px; line-height: 1.7; }
.privacy-note { display: flex; align-items: center; gap: 11px; padding: 13px 16px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,.58); }
.privacy-icon { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; background: var(--green-soft); color: var(--green); font-size: 19px; }
.privacy-note strong, .privacy-note small { display: block; }
.privacy-note strong { color: #42554a; font-size: 11px; font-weight: 600; }
.privacy-note small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.calendar-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 17px; }
.section-kicker { margin-bottom: 7px; color: var(--muted); font-size: 9px; }
.month-title { margin: 0; font: 400 29px/1.2 var(--serif); letter-spacing: -.55px; }
.month-controls, .day-nav { display: flex; gap: 7px; }
.icon-button { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--surface); color: #52675a; font-size: 17px; transition: border-color .18s, background .18s, transform .18s; }
.icon-button:hover { border-color: #b8c9ba; background: var(--green-pale); transform: translateY(-1px); }
.calendar-card { overflow: hidden; border: 1px solid var(--line-strong); border-radius: 13px; background: var(--surface); box-shadow: var(--shadow); }
.weekdays, .days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.weekdays { border-bottom: 1px solid var(--line); background: #f9faf8; }
.weekday { padding: 14px 6px; color: #849087; text-align: center; font-size: 9px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.day { position: relative; display: flex; min-width: 0; min-height: clamp(105px, 11.8vw, 138px); flex-direction: column; align-items: flex-start; gap: 9px; padding: 13px 12px; border: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface); text-align: left; transition: background .16s; }
.day:nth-child(7n) { border-right: 0; }
.day:nth-last-child(-n+7) { border-bottom: 0; }
.day:hover { background: #f7faf6; }
.day.outside { background: #fbfcfa; color: #b8c0b9; }
.day.outside .day-number { color: #aeb7af; }
.day.today { background: #f4f8f3; }
.day-number { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 8px; color: #56645a; font-size: 11px; font-weight: 600; }
.day.today .day-number { background: var(--green); color: white; box-shadow: 0 3px 8px rgba(54, 93, 73, .18); }
.day-preview { display: -webkit-box; overflow: hidden; color: #77847a; font-size: 10px; line-height: 1.55; overflow-wrap: anywhere; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.entry-dot { position: absolute; top: 20px; right: 15px; width: 6px; height: 6px; border-radius: 50%; background: var(--gold); }
.calendar-meta { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 14px 3px 0; color: var(--muted); font-size: 10px; }
.calendar-legend { display: flex; align-items: center; gap: 8px; }
.legend-dot { width: 6px; height: 6px; flex: 0 0 auto; border-radius: 50%; background: var(--gold); }
.editor-view { display: none; }
.editor-view.active { display: block; }
.calendar-view.hidden { display: none; }
.editor-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 0 0 20px; }
.back-button { padding: 9px 0; border: 0; background: transparent; color: var(--green); font-size: 12px; font-weight: 600; }
.back-button:hover { color: var(--green-dark); }
.back-button span { margin-right: 7px; }
.editor-card { display: flex; width: min(850px, 100%); min-height: min(690px, 72vh); flex-direction: column; margin: 0 auto; padding: clamp(25px, 5vw, 58px); border: 1px solid var(--line-strong); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); }
.editor-card-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 34px; }
.editor-label { color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .16em; }
.editor-private { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 10px; }
.editor-private .legend-dot { width: 5px; height: 5px; background: var(--green); }
.editor-date { margin: 0; font: 400 clamp(29px, 4vw, 39px)/1.2 var(--serif); letter-spacing: -.8px; }
.editor-subtitle { margin: 9px 0 29px; color: var(--muted); font-size: 12px; }
.writing-area { width: 100%; min-height: 350px; flex: 1; resize: vertical; padding: 0; border: 0; outline: 0 !important; background: transparent; color: #35443a; font: 400 15px/2 var(--serif); }
.writing-area::placeholder { color: #b2bbb3; }
.editor-bottom { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 25px; padding-top: 15px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.save-status { display: flex; align-items: center; gap: 8px; }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: #c4a16f; }
.status-dot.saved { background: #6b9b76; }
.word-count { white-space: nowrap; }
.editor-footnote { margin: 17px auto 0; color: var(--muted); font: italic 12px var(--serif); }
.site-footer { display: flex; justify-content: space-between; gap: 14px; padding: 19px 0 23px; border-top: 1px solid var(--line-strong); color: #9aa39b; font-size: 9px; }
.site-footer span:first-child { font-weight: 700; letter-spacing: .16em; }
.toast { position: fixed; z-index: 10; bottom: calc(22px + env(safe-area-inset-bottom)); left: 50%; max-width: calc(100vw - 32px); padding: 12px 18px; transform: translateX(-50%); border: 1px solid rgba(255,255,255,.12); border-radius: 9px; background: #263b2e; color: #fff; box-shadow: 0 10px 30px rgba(22, 39, 28, .2); font-size: 11px; line-height: 1.5; opacity: 0; pointer-events: none; transition: opacity .2s; }
.toast.show { opacity: 1; }
@media (min-width: 900px) { .day { min-height: 132px; padding: 14px 15px; } .day-preview { font-size: 11px; } }
@media (max-width: 700px) {
  .app-shell { width: min(100% - 36px, 560px); }
  .site-header { min-height: 76px; }
  .brand-note { display: none; }
  .main-content { padding-top: 31px; }
  .welcome-row { align-items: flex-start; margin-bottom: 36px; }
  .privacy-note { padding: 10px; }
  .privacy-note small { max-width: 125px; line-height: 1.4; }
  .page-heading { font-size: 37px; }
  .day { min-height: clamp(74px, 14vw, 100px); gap: 5px; padding: 8px 6px; }
  .day-number { width: 24px; height: 24px; font-size: 10px; }
  .entry-dot { top: 13px; right: 7px; width: 5px; height: 5px; }
  .day-preview { font-size: 9px; line-height: 1.4; -webkit-line-clamp: 2; }
}
@media (max-width: 480px) {
  .app-shell { width: calc(100% - 24px); }
  .site-header { align-items: center; gap: 8px; }
  .brand { gap: 8px; }
  .brand-mark { width: 35px; height: 35px; border-radius: 11px; font-size: 22px; }
  .brand-name { font-size: 19px; }
  .header-actions { gap: 2px; }
  .text-button, .primary-button { min-height: 34px; padding: 0 8px; font-size: 10px; }
  .header-divider { margin: 0 3px; }
  .welcome-row { display: block; }
  .page-heading { font-size: 34px; }
  .page-intro { max-width: 290px; font-size: 12px; }
  .privacy-note { display: none; }
  .calendar-heading { margin-bottom: 13px; }
  .month-title { font-size: 25px; }
  .icon-button { width: 34px; height: 34px; border-radius: 8px; }
  .weekday { padding: 12px 1px; font-size: 8px; letter-spacing: .06em; }
  .day { min-height: clamp(63px, 16vw, 82px); padding: 6px 4px; }
  .day-number { width: 21px; height: 21px; border-radius: 7px; font-size: 9px; }
  .entry-dot { top: 10px; right: 5px; width: 4px; height: 4px; }
  .day-preview { font-size: 8px; line-height: 1.3; -webkit-line-clamp: 2; }
  .calendar-meta { font-size: 9px; }
  .editor-card { min-height: 70vh; padding: 23px 18px; }
  .editor-card-top { align-items: flex-start; margin-bottom: 28px; }
  .editor-private { font-size: 9px; }
  .editor-date { font-size: 28px; }
  .writing-area { min-height: 42vh; font-size: 15px; }
  .site-footer { font-size: 8px; }
}
@media (max-width: 360px) {
  .app-shell { width: calc(100% - 18px); }
  .brand-name { font-size: 17px; }
  .text-button, .primary-button { padding: 0 6px; font-size: 9px; }
  .page-heading { font-size: 31px; }
  .day { min-height: 59px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
