:root {
  color-scheme: light;
  font-family: system-ui, sans-serif;
  color: #24251f;
  background: #f7f4ee;
  line-height: 1.65;
}
body { margin: 0; }
main { width: min(42rem, calc(100% - 3rem)); margin: 3rem auto; }
h1 { font-size: clamp(2rem, 6vw, 2.75rem); font-weight: 550; line-height: 1.12; }
h2 { font-size: 1.2rem; font-weight: 600; margin-top: 2rem; }
a { color: #3e5c3b; text-underline-offset: .18em; overflow-wrap: anywhere; }
a:focus-visible { outline: .15rem solid #3e5c3b; outline-offset: .2rem; }
nav { border-bottom: 1px solid #d7d4cb; padding-bottom: .8rem; }
nav a + a { margin-left: 1rem; }
li + li { margin-top: .5rem; }
.app-icon { display: block; border-radius: .9rem; }

@font-face {
  font-family: 'Instrument Serif'; src: url('/assets/InstrumentSerif-Regular.ttf') format('truetype'); font-display: swap;
}
:root {
  --paper: #f5f1e7; --sheet: #fffdf7; --evergreen: #173d31; --ink: #1c3027;
  --muted: #53635a; --line: #d7d8cc; --soft: #e3ebe1; --radius: 1.05rem;
}
*, *::after, *::before { box-sizing: border-box; }
body { color: var(--ink); background: var(--paper); }
button, input, textarea, select { font: inherit; color: inherit; }
button, .button {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  min-height: 44px; padding: .5rem .9rem; color: var(--evergreen); background: var(--sheet);
  border: 1px solid var(--line); border-radius: .55rem; text-decoration: none;
}
button:not(:disabled) { cursor: pointer; }
button:disabled { opacity: .55; }
button:hover:not(:disabled), .button:hover { background: var(--soft); }
button.primary, .button.primary { color: #fffdf7; background: var(--evergreen); border-color: var(--evergreen); }
button.primary:hover:not(:disabled), .button.primary:hover { background: #225644; }
.text-button { border-color: transparent; background: transparent; text-decoration: underline; text-underline-offset: .23em; }
.danger { color: #843a31; }
:where(a, button, input, select, textarea, summary):focus-visible { outline: 2px solid #22634c; outline-offset: 3px; }
[hidden] { display: none !important; }
.sr-only, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.skip:focus { position: fixed; top: .5rem; left: 1rem; z-index: 3; padding: .4rem 1rem; background: var(--sheet); }
.wrap { width: min(68rem, calc(100% - 2rem)); margin: 0 auto; }
.site-header { border-bottom: 1px solid var(--line); background: var(--sheet); }
.site-nav { display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; min-height: 4rem; padding-block: .65rem; }
.brand { display: inline-flex; align-items: center; gap: .65rem; font-weight: 700; text-decoration: none; color: var(--ink); }
.brand img { border-radius: 26%; }
.site-nav > nav { display: flex; align-items: center; margin-inline-start: auto; padding: 0; border: 0; gap: .3rem; }
.site-nav nav a { margin: 0; padding: .4rem .65rem; color: var(--muted); text-decoration: none; border-radius: .4rem; }
.site-nav nav [aria-current] { color: var(--evergreen); background: var(--soft); font-weight: 650; }
.page-footer { display: flex; gap: 1.25rem; flex-wrap: wrap; border-top: 1px solid var(--line); padding-block: 1.25rem 2.25rem; font-size: .9rem; color: var(--muted); }
.workspace { min-height: 65vh; padding-block: 2.6rem 3rem; }
.workspace h1, .support-page h1, .support-page h2 { font-family: 'Instrument Serif', Georgia, serif; font-weight: 400; }
.workspace h1, .support-page h1 { font-size: clamp(2.9rem, 9vw, 5.15rem); margin: 0; line-height: .98; }
.workspace h2 { margin: 0 0 .5rem; line-height: 1.35; }
.workspace-title { display: flex; align-items: end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.35rem; }
.workspace-title p, .sign-in-message p { margin: .55rem 0 0; color: var(--muted); }
.surface { background: var(--sheet); border: 1px solid var(--line); border-radius: var(--radius); }
#status:empty { display: none; }
#status { display: flex; align-items: center; flex-wrap: wrap; gap: .8rem; padding: .65rem .95rem; background: var(--soft); border-radius: .55rem; margin: 0 0 1.1rem; }
#status.error { background: #f4e5db; }
.sign-in-layout { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 2rem; align-items: stretch; }
.sign-in-message {
  padding: clamp(1.5rem, 6vw, 4rem); display: grid; align-content: end;
  background: linear-gradient(180deg, #173d3130, #132e25f8), url('/assets/courtyard.webp') center/cover;
  color: #fff9e8; border-radius: var(--radius); min-height: 23rem;
}
.sign-in-message p { color: #f4eddf; max-width: 28ch; }
.sign-in-form, .city-form { display: grid; align-content: start; gap: 1rem; padding: clamp(1rem, 3vw, 1.75rem); }
.sign-in-form { align-content: center; }
.app-page form label, .search-label { display: grid; gap: .3rem; font-weight: 600; }
.app-page input:not([type=checkbox]), .app-page textarea, .app-page select { width: 100%; min-width: 0; border: 1px solid #abb5a9; background: #fffefa; border-radius: .5rem; padding: .52rem .7rem; }
textarea { resize: vertical; }
input[type=checkbox] { accent-color: var(--evergreen); width: 1.15rem; height: 1.15rem; margin: 0; flex: none; }
.date-controls, .actions { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; }
.date-controls { margin-bottom: 1.2rem; }
.app-page .date-controls input { width: auto; flex: 0 1 auto; }
.task-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); align-items: start; gap: 1rem; }
.task-rail { display: grid; gap: 1rem; }
.task-list { padding: 1rem 1.15rem; overflow: hidden; }
.task-list h2 { padding-inline: .3rem; }
.check-row { min-height: 3rem; display: flex; align-items: center; gap: .75rem; cursor: pointer; padding: .4rem .3rem; }
.check-row + .check-row { border-top: 1px solid var(--line); }
.check-row small { color: var(--muted); text-align: end; flex-shrink: 0; margin-inline-start: auto; }
.check-name { min-width: 0; overflow-wrap: anywhere; }
.check-row:has(input:checked) .check-name { color: var(--evergreen); }
.city-form { max-width: 37rem; }
.city-form p { margin: 0; color: var(--muted); }
.city-results { display: grid; gap: .3rem; padding-block: .6rem; }
.city-results button { justify-content: space-between; gap: 1rem; text-align: start; }
.city-results small { color: var(--muted); }
.search-label { max-width: 25rem; margin-bottom: 1rem; }
.notes-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr)); gap: .9rem; align-items: start; }
.note-card { min-width: 0; white-space: normal; overflow-wrap: anywhere; display: grid; align-items: start; justify-content: stretch; text-align: start; gap: .35rem; padding: 1.05rem; }
.card-title { font-weight: 650; }
.note-preview { white-space: pre-wrap; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; }
.note-card small { color: var(--muted); }
.color-1 { background: #f2e4c9; }.color-2 { background: #e6ecdb; }.color-3 { background: #e3ebf0; }
.color-4 { background: #efdfda; }.color-5 { background: #ebe2ec; }
.empty { color: var(--muted); }
.support-main { width: min(67rem, calc(100% - 2rem)); margin: 0 auto; padding-block: 3.25rem; }
.support-grid { display: grid; grid-template-columns: minmax(10rem, .35fr) minmax(0, 1fr); gap: clamp(1.5rem, 5vw, 4.5rem); align-items: start; margin-top: 2.6rem; }
.on-this-page { display: grid; gap: .55rem; padding: 0; border: 0; position: sticky; top: 1rem; }
.on-this-page a { margin: 0; }
.support-page article { max-width: 68ch; min-width: 0; }
.support-page article > :first-child { margin-top: 0; }
.support-page .lead { max-width: 59ch; color: var(--muted); margin: 1rem 0 0; }
.support-page h2 { font-size: 2.2rem; line-height: 1.05; }
.support-page [id] { scroll-margin-top: 1rem; }
.delete-action { margin-block: 1.4rem; padding: 1.25rem; }
.delete-action p { margin: 0 0 .9rem; }
@media (max-width: 680px) {
  .site-nav { gap: .55rem; }.site-nav .brand { margin-inline-end: auto; }.site-nav > nav { margin-inline-start: 0; }
  .site-nav nav a { padding-inline: .4rem; }
  .sign-in-layout, .task-grid, .support-grid { grid-template-columns: 1fr; }
  .sign-in-message { min-height: 14rem; }
  .on-this-page { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: no-preference) {
  button, .button, .site-nav nav a { transition: background-color 140ms ease; }
}

/* The browser workspace fills the viewport, including its signed-out shell. */
html { min-height: 100%; background: var(--paper); }
.app-page, .support-page { min-height: 100svh; display: flex; flex-direction: column; }
.app-page .wrap { width: calc(100% - 2 * var(--page-gutter)); }
.app-page { --page-gutter: clamp(1rem, 4vw, 5rem); }
.app-page .site-nav { min-height: 70px; }
.app-page .workspace { flex: 1; min-height: 0; }
.app-page .page-footer { padding-block: .95rem; }
.support-page .support-main { flex: 1; }
.app-page .site-nav > #sign-out { margin-inline-start: auto; }
.app-page .site-nav > nav:not([hidden]) + #sign-out { margin-inline-start: 0; }

.signed-out .workspace { width: 100%; padding: 0; display: flex; flex-direction: column; }
.signed-out #view { flex: 1; display: flex; }
.sign-in-layout { flex: 1; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 0; }
.sign-in-message {
  isolation: isolate; position: relative; overflow: hidden; border-radius: 0;
  min-height: 33rem; padding: clamp(2rem, 6vw, 7rem);
  background: linear-gradient(180deg, #13201716 23%, #111d16d9 100%), url('/assets/courtyard.webp') 54% center/cover;
}
.sign-in-copy { position: relative; z-index: 1; }
.sign-in-message h1 { font-size: clamp(3.7rem, 6.8vw, 9rem); letter-spacing: -.025em; }
.sign-in-message p { color: #fff9ed; margin-top: .95rem; max-width: 31ch; font-size: clamp(1rem, 1.5vw, 1.25rem); }
.sign-in-side { align-self: stretch; display: grid; place-items: center; padding: clamp(2rem, 6vw, 6rem); }
.sign-in-form { width: min(100%, 27rem); padding: 0; gap: 1rem; }
.sign-in-heading { margin-bottom: .85rem; }
.sign-in-heading h2 { font: 400 clamp(2.2rem, 4vw, 3.5rem)/1 'Instrument Serif', Georgia, serif; }
.sign-in-heading p { margin: .65rem 0 0; color: var(--muted); }
.sign-in-form input:not([type=checkbox]) { min-height: 48px; }
.sign-in-form .primary { min-height: 48px; }
.sign-in-form .text-button { justify-self: center; }
.form-status { margin: 0; color: var(--muted); }
.form-status:empty { display: none; }
.signed-out .page-footer { width: 100%; padding-inline: var(--page-gutter); background: var(--sheet); }

.notes-page {
  --paper: #f8f4f7; --sheet: #fffbfe; --evergreen: #4b385e; --ink: #2d2336;
  --muted: #61576a; --line: #dad0dc; --soft: #ece2ee;
  accent-color: var(--evergreen);
}
.notes-page a { color: var(--evergreen); }
.notes-page :where(a, button, input, select, textarea, summary):focus-visible { outline-color: #714b84; }
.notes-page button.primary:hover:not(:disabled) { background: #604571; }
.notes-page input:not([type=checkbox]), .notes-page textarea, .notes-page select { border-color: #b9abbe; background-color: #fffaff; }
.notes-page .sign-in-message {
  color: #382a43; background: radial-gradient(ellipse at 69% 30%, #f5e9ee, #e5d8e9 90%);
  padding-top: clamp(13rem, 35vh, 25rem);
}
.notes-page .sign-in-message p { color: #4e4058; }
.paper-study { position: absolute; inset: 5% 10% 37%; pointer-events: none; }
.paper-back, .paper-front {
  position: absolute; inset: 8% 18%; border-radius: .35rem;
  box-shadow: 0 1.2rem 3.5rem #4f365b2a; transform: rotate(-11deg);
}
.paper-back { background: #ae91bc; }
.paper-front {
  inset: 6% 14% 7% 27%; display: grid; align-content: center; gap: 11%;
  padding-inline: 16%; background: #fff8ee; transform: rotate(7deg);
}
.paper-front i { display: block; min-height: 2px; background: #c5b5cb; }
.paper-front i:first-child { width: 58%; min-height: 4px; background: #715784; }
.paper-front i:last-child { width: 76%; }
.notes-page .note-card { min-height: 7rem; }
.notes-page .note-card:hover { border-color: #8f729e; background-color: var(--soft); }

@media (max-width: 730px) {
  .sign-in-layout { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .sign-in-message { min-height: 15.5rem; padding: 2rem var(--page-gutter); }
  .sign-in-message h1 { font-size: clamp(3.2rem, 12vw, 5rem); }
  .sign-in-side { padding: 2rem var(--page-gutter); }
  .notes-page .sign-in-message { padding-top: 8rem; }
  .paper-study { inset: 5% 0 50% 38%; }
}

.note-dialog {
  --editor-edge: clamp(1rem, 4vw, 2rem);
  width: min(44rem, calc(100% - 2rem)); max-width: none; max-height: calc(100dvh - 2rem);
  padding: 0; border: 1px solid #3d284536; border-radius: 1rem;
  color: var(--ink); box-shadow: 0 1.25rem 4rem #21162f40;
}
.note-dialog.color-0 { background: var(--sheet); }
.note-dialog::backdrop { background: #251a2f85; }
body:has(.note-dialog[open]) { overflow: hidden; }
.note-editor { display: flex; flex-direction: column; max-height: calc(100dvh - 2rem - 2px); }
.note-editor-head, .note-editor-toolbar { display: flex; align-items: center; gap: .55rem; padding-inline: var(--editor-edge); }
.note-editor-head { padding-block: 1rem .55rem; }
.note-editor-content { overflow: auto; overscroll-behavior: contain; padding: 0 var(--editor-edge) 1rem; }
.app-page .note-editor :is(input[type=text], textarea) {
  background: transparent; border: 0; border-radius: 0; padding: .45rem .1rem;
}
.app-page .note-editor :is(input[type=text], textarea):focus-visible { outline-offset: -2px; border-radius: .25rem; }
.note-editor-head input { font: 400 clamp(1.9rem, 4vw, 2.65rem)/1.12 'Instrument Serif', Georgia, serif; }
.note-editor-content textarea { display: block; min-height: 5rem; field-sizing: content; resize: vertical; }
.note-editor-content:has([data-item-text]) textarea:placeholder-shown { min-height: 2.75rem; }
.editable-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: .65rem; align-items: center; min-height: 44px; }
.editable-item + .editable-item { border-top: 1px solid #36274320; }
.editable-item input[type=checkbox] { width: 1.2rem; height: 1.2rem; cursor: pointer; }
.editable-item.completed input[type=text] { text-decoration: line-through; color: var(--muted); }
.note-items details { border-top: 1px solid #36274335; margin-top: .45rem; }
.note-items summary { cursor: pointer; min-height: 44px; padding-block: .55rem; color: var(--muted); }
.note-editor .add-item, .note-editor .remove-item { border-color: transparent; background: transparent; }
.note-editor .add-item { padding-inline-start: 0; color: var(--muted); }
.note-editor .add-item span { font-size: 1.2rem; }
.note-editor .remove-item { min-width: 44px; font-size: 1.25rem; }
.note-editor .note-toggle, .note-editor .note-delete { background: transparent; }
.note-editor [aria-pressed=true] { color: #fff; background: var(--evergreen); border-color: var(--evergreen); }
.note-editor [aria-pressed=true]:hover:not(:disabled) { color: var(--evergreen); }
.note-edited { display: block; text-align: end; margin-top: .5rem; font-size: .8rem; color: var(--muted); }
.note-editor-toolbar { flex-wrap: wrap; padding-block: .7rem; border-top: 1px solid #36274328; }
.note-editor .note-color { display: flex; align-items: center; gap: .45rem; font-size: .875rem; }
.note-color select { min-height: 44px; }
.note-editor-actions { display: flex; gap: .5rem; margin-inline-start: auto; }
.note-editor #note-editor-status:not(:empty) { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; padding: .5rem var(--editor-edge); }
@media (max-width: 520px) {
  .note-dialog { width: calc(100% - 1rem); max-height: calc(100dvh - 1rem); margin-block: auto .5rem; border-radius: 1rem; }
  .note-editor { max-height: calc(100dvh - 1rem - 2px); }
}
@media (max-width: 400px) {
  .note-editor-actions { width: 100%; justify-content: end; }
}
@media (prefers-reduced-motion: no-preference) {
  .note-dialog[open] { animation: note-open 150ms ease-out; }
  @keyframes note-open { from { opacity: 0; transform: translateY(.4rem); } }
}
