/* Craft Group. Plain CSS, no build step. Light and dark follow the reader's
   system setting; every colour is a token defined twice, below. */

:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --text: #1f1d1a;
  --muted: #5d5850;
  --line: #dcd6cc;
  --accent: #8a3b12;
  --accent-text: #ffffff;
  --focus: #1a5fb4;
  --tag-bg: #f1ece3;
  --grey-text: #6f6a62;
  --gutter: 16px;
  --measure: 46rem;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161513;
    --surface: #1f1d1a;
    --text: #ece8e1;
    --muted: #b3ada3;
    --line: #3a3732;
    --accent: #f0a877;
    --accent-text: #161513;
    --focus: #8cb8ff;
    --tag-bg: #2b2925;
    --grey-text: #97918a;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  padding: 0 var(--gutter);
  background: var(--bg);
  color: var(--text);
  font: 1rem/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.masthead,
main,
.footer {
  max-width: var(--measure);
  margin: 0 auto;
}

a {
  color: var(--accent);
  text-underline-offset: 0.15em;
}

a:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible,
.list:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.skip {
  position: absolute;
  left: -999px;
  top: 0;
}

.skip:focus {
  left: var(--gutter);
  background: var(--surface);
  padding: 0.5rem;
  z-index: 1;
}

.masthead {
  padding: 1.5rem 0 1rem;
  border-bottom: 1px solid var(--line);
}

.masthead h1 {
  margin: 0 0 0.5rem;
  font-size: 1.6rem;
  line-height: 1.2;
}

.lede {
  margin: 0 0 0.5rem;
  color: var(--muted);
}

.controls {
  display: grid;
  gap: 1rem;
  margin: 1rem 0;
  padding: 0.75rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.controls[hidden] {
  display: none;
}

.weeks,
.days {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.week,
.day,
.locate,
.clear {
  min-height: 2.75rem;
  padding: 0 0.9rem;
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
}

.week {
  flex: 1 1 8rem;
  font-weight: 600;
}

.day {
  min-width: 3.25rem;
  padding: 0 0.6rem;
}

.week[aria-pressed="true"],
.day[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
}

.week:focus-visible,
.day:focus-visible,
.locate:focus-visible,
.clear:focus-visible,
.where input:focus-visible,
.where select:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.where > label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.where-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.5rem;
}

.where-row label.inline {
  font-weight: 600;
}

.where input,
.where select {
  min-height: 2.75rem;
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 0.5rem;
}

.where input {
  flex: 1 1 14rem;
  min-width: 0;
}

.where select:disabled {
  opacity: 0.6;
}

.where-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.875rem;
}

.after-work label {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  min-height: 2.25rem;
  padding: 0.25rem 0;
  font-weight: 600;
}

.after-work label.inline {
  font-weight: 400;
  padding-left: 1.75rem;
}

.after-work input {
  width: 1.25rem;
  height: 1.25rem;
  margin: 0.15rem 0 0;
  flex: none;
  accent-color: var(--accent);
}

.after-work .hint {
  margin: 0 0 0.5rem 1.75rem;
}

.more summary {
  cursor: pointer;
  font-weight: 600;
  min-height: 2.25rem;
  display: flex;
  align-items: center;
}

.more label {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  min-height: 2.25rem;
  padding: 0.25rem 0;
}

.more input {
  width: 1.25rem;
  height: 1.25rem;
  margin: 0.15rem 0 0;
  flex: none;
  accent-color: var(--accent);
}

.status {
  color: var(--muted);
  margin: 1rem 0;
}

.place-view {
  margin: 1rem 0;
  padding: 0.75rem;
  border-left: 4px solid var(--accent);
  background: var(--surface);
}

.place-view h2 {
  margin: 0 0 0.25rem;
  font-size: 1.25rem;
}

.place-view p {
  margin: 0.25rem 0;
}

.day-group {
  margin: 1.5rem 0 0;
}

.day-group h2 {
  font-size: 1.25rem;
  margin: 0 0 0.5rem;
  padding-bottom: 0.25rem;
  border-bottom: 2px solid var(--accent);
}

.entries {
  list-style: none;
  margin: 0;
  padding: 0;
}

.entry {
  display: grid;
  grid-template-columns: 6.5rem minmax(0, 1fr);
  gap: 0 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--line);
}

.entry .time {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  margin: 0;
}

.entry .body {
  min-width: 0;
  overflow-wrap: anywhere;
}

.entry .body > * {
  margin: 0 0 0.2rem;
}

.entry h3 {
  font-size: 1.05rem;
  line-height: 1.3;
}

.entry .where,
.entry .when {
  color: var(--muted);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  list-style: none;
  padding: 0;
}

.tags li {
  background: var(--tag-bg);
  border-radius: 999px;
  padding: 0 0.6rem;
  font-size: 0.875rem;
}

.source {
  font-size: 0.875rem;
  color: var(--muted);
}

.entry details {
  font-size: 0.875rem;
  color: var(--muted);
}

.entry summary {
  cursor: pointer;
}

.entry.grey .time,
.entry.grey .body {
  color: var(--grey-text);
}

.entry.grey h3 {
  font-weight: 500;
}

.stale-note {
  font-size: 0.875rem;
  font-style: italic;
}

.prose {
  padding: 1rem 0;
}

.prose h2 {
  font-size: 1.2rem;
  margin: 1.5rem 0 0.5rem;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9em;
  overflow-wrap: anywhere;
}

.footer {
  padding: 1rem 0 2rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.875rem;
}

.terms {
  font-weight: 600;
}

.submit a {
  font-weight: 600;
}

.suggest {
  margin: 0.5rem 0 1rem;
}

.hint {
  margin: 0 0 0.5rem;
  color: var(--muted);
}

.miles {
  font-weight: 600;
  white-space: nowrap;
}

.upcoming {
  margin: 0.25rem 0 0.5rem;
  padding-left: 1.25rem;
}

@media (max-width: 30rem) {
  .entry {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
  }
}

.details,
.checked {
  margin: 0.25rem 0;
}

.checked {
  color: var(--muted);
  font-size: 0.875rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: center;
  margin: 0.5rem 0 0;
}

.add-cal,
.save-contact {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  min-height: 2.5rem;
  padding: 0 0.9rem;
  font: inherit;
  font-weight: 600;
  color: var(--accent-text);
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 999px;
  cursor: pointer;
}

.add-cal:focus-visible,
.save-contact:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.correct {
  font-size: 0.875rem;
  color: var(--muted);
}

.disclaimer,
.credit {
  margin: 0.5rem 0;
}

.facts {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 0.15rem 0.75rem;
  margin: 0.25rem 0 0.5rem;
}

.facts dt {
  color: var(--muted);
  font-size: 0.875rem;
  padding-top: 0.1rem;
}

.facts dd {
  margin: 0;
}

.description {
  margin: 0.25rem 0 0.5rem;
}

.linkish {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: var(--accent);
  text-decoration: underline;
  cursor: pointer;
}

.comment {
  width: min(32rem, calc(100vw - 2rem));
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  padding: 1rem;
  background: var(--surface);
  color: var(--text);
}

.comment::backdrop {
  background: rgb(0 0 0 / 0.4);
}

.comment label {
  display: block;
  font-weight: 600;
  margin: 0.75rem 0 0.25rem;
}

.comment textarea,
.comment input {
  width: 100%;
  box-sizing: border-box;
  font: inherit;
  padding: 0.5rem;
}

.comment .trap {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.comment .actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
}

.privacy summary {
  cursor: pointer;
  font-weight: 600;
}
