:root {
  color-scheme: light;
  --paper: #f5f2ed;
  --card: #fffdfa;
  --ink: #25261f;
  --muted: #555b50;
  --line: #d8d3c8;
  --accent: #414f3b;
  --accent-hover: #2d3929;
  --accent-soft: #e6ebdf;
  --warm: #f1e4d1;
  --alert: #8e3e30;
  --serif: Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font: 1rem/1.55 var(--sans);
  overflow-wrap: anywhere;
}
p, h1, h2, h3, ul, dl, dd { margin: 0; }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 1.12; }
h1 { font-size: clamp(2.5rem, 5.5vw, 4.5rem); letter-spacing: -.043em; }
h2 { font-size: clamp(1.55rem, 2.4vw, 2rem); letter-spacing: -.025em; }
h3 { font-size: 1.3rem; }
a { color: var(--accent-hover); text-underline-offset: .2em; }
a:hover { text-decoration-thickness: .12em; }
:focus-visible { outline: 2px solid #5e6c4b; outline-offset: 4px; }
small, .mobile-label { color: var(--muted); font-size: .875rem; }
small { display: block; }
button, select, textarea, input { font: inherit; }
button { cursor: pointer; }
.shell { width: min(100% - 4rem, 75rem); margin-inline: auto; }
.skip, .visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}
.skip:focus { top: .6rem; left: .6rem; z-index: 3; width: auto; height: auto; padding: .6rem; clip-path: none; background: var(--card); }
.masthead { background: var(--card); border-bottom: 1px solid var(--line); }
.masthead-inner { display: flex; align-items: center; justify-content: space-between; gap: 1.2rem; min-height: 4.8rem; }
.brand { display: inline-flex; gap: .7rem; align-items: center; color: var(--ink); font: 1.35rem/1 var(--serif); text-decoration: none; }
.brand-mark {
  display: grid; place-items: center; width: 2.15rem; height: 2.15rem;
  flex: 0 0 2.15rem; border: 1px solid var(--accent); color: var(--accent);
  font-size: 1.42rem; border-radius: 50% 50% 43% 43%;
}
.main-nav, .account, .actions { display: flex; flex-wrap: wrap; align-items: center; gap: .65rem; }
.main-nav { gap: 1.3rem; }
.main-nav a { padding: .45rem .02rem; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; }
.main-nav a:hover, .main-nav a[aria-current="page"] { color: var(--ink); border-color: var(--accent); }
.account { gap: .95rem; flex-wrap: wrap; }
.account a, .account button { font-size: .875rem; }
.text-button {
  padding: 0; border: 0; background: none; color: var(--accent-hover);
  text-decoration: underline; text-underline-offset: .2em;
}
#main { padding-block: 2.8rem 4rem; }
#main:focus { outline: none; }
.page-head { display: flex; align-items: end; justify-content: space-between; gap: 1.35rem; margin-bottom: 1.8rem; }
.date { color: var(--muted); font-size: .875rem; margin-bottom: .5rem; }
.subtitle { color: var(--muted); margin-top: .5rem; }
.button {
  display: inline-flex; justify-content: center; align-items: center; min-height: 2.75rem;
  padding: .56rem .95rem; border: 1px solid transparent; border-radius: .35rem;
  font-size: .9375rem; font-weight: 620; line-height: 1.32; text-decoration: none; text-align: center;
}
.button.primary { background: var(--accent); color: #fff; }
.button.primary:hover { background: var(--accent-hover); }
.button.secondary { background: var(--card); border-color: var(--line); color: var(--accent-hover); }
.button.secondary:hover { background: var(--accent-soft); border-color: #b8c0ad; }
.button.small { padding-inline: .7rem; font-size: .875rem; }
.overview, .details { display: grid; grid-template-columns: 1.65fr 1fr; align-items: start; gap: 1.15rem; }
.panel {
  min-width: 0; padding: 1.35rem; border: 1px solid var(--line);
  border-radius: .55rem; background: var(--card);
}
.panel h2, .panel h3 { margin-bottom: .85rem; }
.panel h3:not(:first-child) { margin-top: 1.2rem; }
.panel-head { display: flex; gap: .75rem; justify-content: space-between; align-items: center; margin-bottom: .75rem; }
.panel-head h2 { margin: 0; }
.overview-side, .detail-main, .detail-side { display: grid; min-width: 0; gap: 1.15rem; }
.section-links { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .65rem; }
.section-links a {
  display: grid; gap: .45rem; padding: .85rem 1rem; border: 1px solid var(--line);
  border-radius: .5rem; background: var(--accent-soft); text-decoration: none;
}
.section-links a + a { background: var(--warm); }
.section-links a:hover { border-color: var(--accent); }
.section-links strong { font: 2.25rem/1 var(--serif); color: var(--ink); }
.entry-list, .record-list, .record-header, .messages, .errorlist { list-style: none; padding: 0; }
.entry-list > li + li { border-top: 1px solid var(--line); }
.entry-list > li { padding-block: .85rem; }
.entry-list > li:first-child { padding-top: .2rem; }
.entry-list > li:last-child { padding-bottom: .15rem; }
.entry-title { color: var(--ink); font-weight: 650; text-decoration: none; }
.entry-title:hover { text-decoration: underline; }
.entry-list p { margin-top: .25rem; }
.entry-list small { margin-top: .14rem; }
.entry-top { display: flex; justify-content: space-between; align-items: start; gap: .7rem; }
.entry-top > a:last-child { font-size: .875rem; }
.section-more { display: inline-block; margin-top: .95rem; }
.task { display: grid; grid-template-columns: minmax(6rem, 7.3rem) 1fr; gap: .7rem; }
.task-date { font-weight: 625; }
.overdue, .overdue small { color: var(--alert); }
.empty-text, .muted { color: var(--muted); }
.view-switch { display: flex; gap: 1.1rem; border-bottom: 1px solid var(--line); margin-bottom: 1rem; }
.view-switch a { padding: .4rem .1rem; border-bottom: 2px solid transparent; text-decoration: none; color: var(--muted); }
.view-switch a[aria-current="page"] { border-color: var(--accent); color: var(--ink); font-weight: 640; }
.filters { display: flex; align-items: end; flex-wrap: wrap; gap: .6rem; margin-bottom: 1.1rem; }
.filter-search { flex: 1 1 14rem; }
.filters .field:not(.filter-search) { flex: 0 1 11rem; }
.reset { align-self: center; margin-top: 1.25rem; padding-inline: .3rem; font-size: .875rem; }
.field { display: grid; gap: .28rem; min-width: 0; align-content: start; }
.field label, .field legend { color: var(--ink); font-size: .9rem; font-weight: 620; }
input:not([type="hidden"], [type="checkbox"]), select, textarea {
  width: 100%; min-width: 0; min-height: 2.75rem; padding: .49rem .65rem;
  border: 1px solid #bcb9af; border-radius: .35rem; background: var(--card); color: var(--ink);
}
textarea { resize: vertical; }
select {
  appearance: none;
  padding-right: 2rem;
  background-image: linear-gradient(45deg, transparent 50%, var(--accent) 50%),
                    linear-gradient(135deg, var(--accent) 50%, transparent 50%);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  background-position: calc(100% - 16px) center, calc(100% - 11px) center;
}
input[aria-invalid="true"], textarea[aria-invalid="true"], select[aria-invalid="true"] { border-color: var(--alert); }
.form-errors { color: var(--alert); font-size: .875rem; }
.help { color: var(--muted); font-size: .875rem; }
.help ul { padding-inline-start: 1.15rem; }
.records { background: var(--card); border: 1px solid var(--line); border-radius: .55rem; overflow: hidden; }
.record, .record-header { display: grid; grid-template-columns: 1.2fr .85fr .8fr 1.15fr; gap: .85rem; align-items: start; padding: .85rem 1rem; }
.record-header { background: #ece8df; font-size: .875rem; font-weight: 650; }
.record + .record { border-top: 1px solid var(--line); }
.record small { margin-top: .25rem; }
.mobile-label { display: none; }
.pill {
  display: inline-block; padding: .16rem .52rem; border-radius: 1rem; background: #ebe9e1;
  color: #3e4239; font-size: .875rem; line-height: 1.4;
}
.pill[data-state="active"], .pill[data-state="done"] { background: var(--accent-soft); color: #354a30; }
.pill[data-state="contact"], .pill[data-state="discuss"], .pill[data-state="doing"] { background: var(--warm); color: #644928; }
.pill[data-state="planned"] { background: #e3eaee; color: #3a5361; }
.pagination { display: flex; justify-content: center; gap: 1rem; margin-top: 1.2rem; flex-wrap: wrap; }
.back { display: inline-block; margin-bottom: .9rem; }
.detail-head h1 { font-size: clamp(2.3rem, 5vw, 4rem); }
.state-line { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: .8rem; }
dt { color: var(--muted); font-size: .875rem; }
dd + dt { margin-top: .65rem; }
dl + a { display: inline-block; margin-top: .85rem; }
.preserve { white-space: pre-wrap; }
.archive-action { text-align: right; }
.edit-form { display: grid; gap: 1rem; max-width: 52rem; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: .85rem; }
.field-wide { grid-column: 1 / -1; }
.checkbox-group { margin: 0; border: 1px solid var(--line); padding: .35rem .65rem .65rem; border-radius: .35rem; }
.checkbox-group > div { max-height: 12rem; overflow-y: auto; }
.checkbox-group label { display: flex; align-items: center; gap: .55rem; min-height: 2rem; font-weight: 400; }
.checkbox-group input { margin: 0; accent-color: var(--accent); }
.messages { margin-bottom: .9rem; }
.messages li { padding: .65rem .9rem; background: var(--accent-soft); border-left: 3px solid var(--accent); }
.login-card {
  max-width: 29rem; margin: clamp(1.5rem, 6vh, 5rem) auto 0;
  padding: clamp(1.25rem, 4.5vw, 2.2rem);
  background: var(--card); border: 1px solid var(--line); border-top: 3px solid var(--accent);
  border-radius: .55rem;
}
.login-card h1 { font-size: clamp(2.2rem, 4.5vw, 3rem); margin-bottom: 1.2rem; }
.login-card p { margin-bottom: .9rem; }
.form-stack { display: grid; gap: .85rem; }
.form-stack .button { margin-top: .3rem; justify-self: start; min-width: 7rem; }
.login-card .account-link { margin: .85rem 0 0; font-size: .875rem; }
@media (max-width: 55rem) {
  .shell { width: min(100% - 2.5rem, 75rem); }
  .masthead-inner { flex-wrap: wrap; gap: .4rem 1rem; padding-block: .7rem .35rem; }
  .signed-out .masthead-inner { padding-block: .65rem; }
  .main-nav { order: 3; flex: 1 1 100%; gap: 1.1rem; }
  #main { padding-top: 2rem; }
}
@media (max-width: 42rem) {
  .shell { width: min(100% - 2rem, 75rem); }
  .page-head { align-items: start; flex-direction: column; gap: .9rem; }
  .overview, .details { grid-template-columns: minmax(0, 1fr); }
  .record-header { display: none; }
  .record { grid-template-columns: repeat(2,minmax(0,1fr)); gap: .6rem; }
  .mobile-label { display: block; }
  .panel { padding: 1rem; }
  .field-grid { grid-template-columns: minmax(0, 1fr); }
  .filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter-search { grid-column: 1 / -1; }
  .filters .button, .reset { justify-self: start; }
  .reset { margin-top: 0; }
  .task { grid-template-columns: minmax(5.3rem, 6.4rem) 1fr; }
}
@media (max-width: 25rem) {
  .masthead-inner { align-items: start; flex-direction: column; }
  .main-nav { gap: .7rem; font-size: .875rem; }
  .account { gap: .65rem; }
  .panel-head { align-items: start; flex-direction: column; }
}
