:root {
  --ink: #17211c;
  --paper: #f6f1e8;
  --surface: #fffaf1;
  --line: #d8cdbb;
  --muted: #626a62;
  --green: #287852;
  --orange: #d57936;
  --gray: #c4c6bf;
  --red: #a33a32;
  --record: #d73535;
  --sans: "Trebuchet MS", Verdana, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.6 Georgia, "Times New Roman", serif; }
a { color: inherit; text-underline-offset: 3px; }
button, input, textarea, summary, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 4px; }
h1, h2, p { margin: 0 0 12px; overflow-wrap: anywhere; }
h1 { font-size: 36px; line-height: 1.15; }
h2 { font-size: 20px; line-height: 1.3; }
.topbar { min-height: 64px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 8px 24px; }
.brand { font-size: 22px; line-height: 1.2; font-weight: 700; text-decoration: none; }
.site-menu-toggle { display: none; }
.site-menu > nav { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.topbar nav { font: 14px/1.5 var(--sans); }
.topbar nav a, .link-button { display: inline-flex; align-items: center; min-height: 44px; background: transparent; color: var(--ink); padding: 0; border: 0; font: inherit; text-decoration: none; }
.shell { max-width: 1120px; margin: auto; padding: 32px 20px 48px; }
.reflection-column { max-width: 560px; margin: auto; }
.install-guide { max-width: 640px; margin: auto; display: grid; gap: 24px; }
.install-guide .page-heading { margin-bottom: 0; }
.install-guide ol { padding-left: 24px; margin: 16px 0; }
.install-guide li { padding-left: 4px; margin-bottom: 12px; }
.install-guide a { display: inline-flex; align-items: center; min-height: 44px; }
.page-heading { margin-bottom: 24px; }
.eyebrow, .meta { font: 12px/1.4 var(--sans); color: var(--muted); }
.eyebrow { text-transform: uppercase; letter-spacing: .06em; margin-bottom: 10px; }
.meta { display: block; margin-bottom: 8px; overflow-wrap: anywhere; }
.muted { color: var(--muted); font: 14px/1.5 var(--sans); }
.auth-panel, .commitment-row, .empty-state, .entry-panel, .record-panel, .disclosure { border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.auth-panel { max-width: 560px; margin: 24px auto; padding: 32px; display: grid; gap: 24px; }
.entry-panel, .empty-state, .commitment-row { padding: 24px; min-width: 0; }
.entry-panel p:last-child, .empty-state p:last-child { margin-bottom: 0; }
.stack { display: grid; gap: 12px; }
label { display: grid; gap: 8px; font: 700 16px/1.4 var(--sans); }
input, textarea { width: 100%; min-width: 0; padding: 12px; border: 1px solid #858b80; border-radius: 6px; background: #fffdf8; color: var(--ink); font: 16px/1.6 Georgia, serif; }
textarea { resize: vertical; }
button, .button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 10px 16px; border: 1px solid var(--ink); border-radius: 6px; background: var(--ink); color: var(--surface); font: 700 16px/1.4 var(--sans); text-decoration: none; cursor: pointer; }
button:hover, .button:hover { filter: brightness(.92); }
button.secondary, .button.secondary { color: var(--ink); background: transparent; }
button.danger { background: var(--red); border-color: var(--red); }
button:disabled { cursor: wait; }
.row-actions, .inline-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.inline-actions { margin-top: 16px; }
.commitment-row, .two-col { display: flex; justify-content: space-between; align-items: center; gap: 24px; }
.commitment-row > div { min-width: 0; }
.commitment-row p { max-width: 560px; }
.split { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 24px; margin-bottom: 24px; }
.wide { margin-bottom: 24px; }
.completion-status { display: flex; align-items: center; gap: 8px; font: 14px/1.5 var(--sans); color: var(--muted); margin: 0; }
.completion-status::before { content: ''; width: 8px; height: 8px; flex: 0 0 8px; border-radius: 50%; background: var(--orange); }
.completion-status.is-complete::before { background: var(--green); }
.record-panel { padding: 32px 20px 24px; margin-bottom: 16px; }
.record-form { display: flex; flex-direction: column; align-items: center; text-align: center; font: 16px/1.4 var(--sans); }
.record-button { width: 80px; height: 80px; flex: 0 0 80px; border-radius: 50%; padding: 24px; margin: 4px 0 20px; color: white; background: var(--record); border: 1px solid #bc2525; box-shadow: 0 0 0 4px var(--surface), 0 0 0 5px #e8b5ad; touch-action: none; user-select: none; -webkit-user-select: none; transition: background-color 150ms, box-shadow 150ms; }
.record-button svg { width: 30px; height: 30px; pointer-events: none; }
.record-button:hover { background: #bc2525; filter: none; }
.record-button:focus-visible { outline-offset: 8px; }
.record-button.recording { background: #a31f1f; box-shadow: 0 0 0 4px var(--surface), 0 0 0 7px var(--record); }
.recording-wash { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 100; }
.recording-wash-wave { position: absolute; border-radius: 50%; background: var(--record); opacity: 0; animation: recording-soft-wash 550ms cubic-bezier(.15,.65,.3,1) both; }
@keyframes recording-soft-wash {
  from { transform: scale(var(--wash-start-scale)); opacity: .112; }
  65% { opacity: .07; }
  to { transform: scale(1); opacity: 0; }
}
.record-status { display: block; font: 14px/1.5 var(--sans); color: var(--muted); margin-top: 8px; }
.record-status.is-error, .form-error { color: var(--red); }
.record-alternative { font: 14px/1.5 var(--sans); padding: 12px; }
.disclosure { margin: 12px 0; }
summary { cursor: pointer; }
.disclosure > summary { list-style: none; min-height: 56px; padding: 16px 20px; display: flex; justify-content: space-between; align-items: center; gap: 16px; font: 700 16px/1.4 var(--sans); }
.disclosure > summary::-webkit-details-marker { display: none; }
.disclosure > summary::after { content: '+'; font-size: 24px; font-weight: 400; }
.disclosure[open] > summary::after { content: '\2212'; }
summary small { display: block; margin-top: 4px; font: 14px/1.5 var(--sans); color: var(--muted); }
.disclosure-body { padding: 0 20px 20px; }
.calendar-month + .calendar-month { margin-top: 24px; }
.calendar-month h2 { text-align: center; margin-bottom: 16px; }
.calendar-grid, .calendar-weekdays { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); gap: 8px; }
.calendar-weekdays { font: 12px/1.4 var(--sans); text-align: center; margin-bottom: 8px; color: var(--muted); }
.day-square { min-width: 0; min-height: 32px; aspect-ratio: 1; display: flex; justify-content: center; align-items: center; border: 1px solid var(--line); border-radius: 5px; font: 14px/1 var(--sans); text-decoration: none; }
.day-square.completed, .legend .completed { background: var(--green); color: white; }
.day-square.missed, .legend .missed { background: var(--orange); color: var(--ink); }
.day-square.today, .legend .today { background: white; border-color: var(--ink); }
.day-square.today-completed { box-shadow: inset 0 -5px var(--green); }
.day-square.future, .legend .future { background: var(--gray); }
.legend { display: flex; flex-wrap: wrap; gap: 8px 16px; font: 12px/1.5 var(--sans); color: var(--muted); margin-top: 20px; }
.legend i { display: inline-block; width: 10px; height: 10px; margin-right: 5px; border: 1px solid var(--line); border-radius: 2px; }
.calendar-help { margin: 12px 0 0; }
.calendar-return { display: flex; align-items: center; justify-content: space-between; min-height: 56px; padding: 12px 20px; margin-top: 12px; border: 1px solid var(--line); border-radius: 8px; font: 16px/1.4 var(--sans); background: var(--surface); text-decoration: none; }
.saved-reflections { padding: 24px 0; }
.entry-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 16px; }
.entry-list li { padding-top: 16px; border-top: 1px solid var(--line); min-width: 0; overflow-wrap: anywhere; }
.reflection-text { white-space: pre-wrap; }
.entry-edit summary { padding: 8px 0; font: 14px/1.5 var(--sans); }
.entry-edit .stack { margin-top: 12px; }
.text-link { display: inline-block; font: 14px/1.5 var(--sans); padding: 12px 0; }
.reflection-settings { display: flex; flex-wrap: wrap; gap: 8px 24px; border-top: 1px solid var(--line); padding-top: 16px; font: 14px/1.5 var(--sans); color: var(--muted); }
.reflection-settings > a, .settings-disclosure > summary { display: inline-flex; align-items: center; min-height: 44px; }
.settings-disclosure { flex: 1; min-width: 180px; }
.settings-disclosure > summary { text-decoration: underline; text-underline-offset: 3px; }
.settings-disclosure .stack { margin-top: 12px; }
.flash-stack { display: grid; gap: 12px; margin: 0 auto 24px; max-width: 560px; }
.flash { padding: 12px 16px; border: 1px solid var(--line); border-radius: 6px; font: 14px/1.5 var(--sans); background: var(--surface); }
.flash.error { border-color: var(--red); }
.form-error { font: 14px/1.5 var(--sans); margin: 0; }
@media(max-width: 780px) {
  h1 { font-size: 32px; }
  .topbar { padding: 8px 20px; }
  .site-menu { position: relative; flex-shrink: 0; }
  .shell { padding-top: 24px; }
  .site-menu-toggle { display: flex; min-height: 44px; min-width: 44px; align-items: center; justify-content: center; padding: 0; border: 0; background: transparent; color: var(--ink); font-size: 24px; }
  .site-menu:not([data-menu-open]) > nav { display: none; }
  .site-menu[data-menu-open] > nav { position: absolute; top: calc(100% + 8px); right: 0; z-index: 20; display: flex; flex-direction: column; align-items: stretch; gap: 4px; width: 200px; max-width: calc(100vw - 40px); padding: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 6px 18px rgb(23 33 28 / 12%); }
  .site-menu > nav form { width: 100%; margin: 0; }
  .site-menu > nav a, .site-menu > nav .link-button { display: flex; justify-content: flex-start; width: 100%; min-height: 44px; padding: 8px 12px; border-radius: 6px; text-align: left; font: inherit; }
  .site-menu > nav a:hover, .site-menu > nav .link-button:hover { background: var(--paper); }
  .split { grid-template-columns: 1fr; }
  .commitment-row, .two-col { flex-direction: column; align-items: stretch; }
  .auth-panel { padding: 24px; margin-top: 0; }
}
@media(max-width: 359px) {
  .shell { padding-left: 16px; padding-right: 16px; }
  .disclosure-body, .disclosure > summary { padding-left: 16px; padding-right: 16px; }
  .calendar-grid, .calendar-weekdays { gap: 6px; }
  .day-square { min-height: 24px; }
}
@media(prefers-reduced-motion: reduce) { .record-button { transition: none; } .recording-wash { display: none; } }
