:root {
  color-scheme: light;
  --paper: #f4f1e9;
  --surface: #fffcf4;
  --ink: #22271c;
  --muted: #555a4b;
  --line: #d4d4c5;
  --green: #263f29;
  --mint: #e3ebd5;
  --danger: #8c3a28;
  font-family: system-ui,sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

button,input,select,textarea {
  font: inherit;
}

button,a,input,textarea,select {
  touch-action: manipulation;
}

button {
  cursor: pointer;
}

button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible {
  outline: 3px solid #627f35;
  outline-offset: 3px;
}

button:disabled {
  opacity: .55;
  cursor: default;
}

.wrap {
  width: min(100% - 2rem,62rem);
  margin-inline: auto;
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  min-height: 5.1rem;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  font-size: clamp(1rem,3.6vw,1.35rem);
  font-weight: 750;
  letter-spacing: -.055em;
}

.brand-mark {
  display: grid;
  place-items: center;
  border-radius: 34% 45% 35% 43%;
  background: var(--green);
  color: white;
  width: 2rem;
  height: 2rem;
  margin-right: .5rem;
  transform: rotate(-8deg);
}

.dot {
  color: #547234;
}

.plain {
  background: transparent;
  border: 0;
  color: var(--green);
  font-size: .875rem;
  font-weight: 680;
  min-height: 44px;
  padding: .35rem .45rem;
  text-align: left;
}

.plain:hover {
  text-decoration: underline;
}

main {
  padding-block: 2rem 7.5rem;
}

.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: var(--green);
  color: #fffef4;
  padding: clamp(1.4rem,5vw,3.5rem);
  border-radius: 1.8rem;
  min-height: 15rem;
  display: grid;
  align-content: center;
  justify-items: start;
}

.hero:before,.hero:after {
  content: '';
  position: absolute;
  border: 1px solid #e0f2b94d;
  width: 23rem;
  aspect-ratio: 1;
  border-radius: 40%;
  right: -8rem;
  top: -9rem;
  transform: rotate(-29deg);
  z-index: -1;
}

.hero:after {
  right: -10rem;
  top: -6rem;
  transform: rotate(-37deg);
}

.eyebrow {
  font-size: .875rem;
  margin: 0 0 .55rem;
  color: #dce8c7;
  font-weight: 650;
}

.hero h1,.page-title {
  font-family: Georgia,serif;
  font-weight: 500;
  font-size: clamp(2.4rem,8vw,5rem);
  line-height: 1;
  letter-spacing: -.065em;
  margin: 0 0 1rem;
}

.hero > p:not(.eyebrow) {
  max-width: 34rem;
  margin: 0 0 1.25rem;
  color: #ebf1dd;
}

.hero.today {
  min-height: 0;
}

.button {
  background: var(--green);
  color: white;
  border: 1px solid transparent;
  border-radius: .85rem;
  padding: .65rem .9rem;
  min-height: 44px;
  font-weight: 700;
}

.button:hover {
  filter: brightness(1.15);
}

.button.light {
  background: #e9f1d7;
  color: var(--green);
}

.button.secondary {
  background: var(--surface);
  color: var(--green);
  border-color: var(--line);
}

.columns {
  display: grid;
  grid-template-columns: 1.45fr 1fr;
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 1.25rem;
  padding: clamp(.85rem,3vw,1.4rem);
  min-width: 0;
}

.panel + .panel {
  margin-top: 1rem;
}

.columns>.panel + .panel {
  margin-top: 0;
}

h2 {
  font-size: 1.22rem;
  letter-spacing: -.035em;
  margin: 0 0 .75rem;
}

h3 {
  font-size: 1rem;
  margin: 0 0 .35rem;
}

p {
  line-height: 1.5;
}

.muted {
  color: var(--muted);
}

.empty {
  margin: .4rem 0;
  color: var(--muted);
}

.templates,.chips,.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem;
}

.chip {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 2rem;
  background: var(--surface);
  color: var(--green);
  padding: .4rem .75rem;
  font-weight: 650;
  font-size: .875rem;
}

.chip[aria-pressed=true] {
  background: var(--green);
  color: white;
}

.tag {
  display: inline-block;
  background: var(--mint);
  color: var(--green);
  padding: .2rem .5rem;
  border-radius: .5rem;
  font-size: .82rem;
  font-weight: 650;
}

.late {
  color: var(--danger);
  font-weight: 700;
}

.heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: .75rem;
}

.heading-row h2 {
  margin: 0;
}

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

.task {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  border-top: 1px solid var(--line);
  padding: .65rem 0;
}

.task:first-child {
  border-top: 0;
}

.task-info {
  min-width: 0;
  overflow-wrap: anywhere;
}

.task-title {
  display: block;
  min-height: 34px;
  padding: 0;
  text-align: left;
  color: var(--ink);
  font-size: 1rem;
  overflow-wrap: anywhere;
}

.details {
  display: flex;
  gap: .35rem .65rem;
  align-items: center;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: .875rem;
}

.task-action {
  flex-shrink: 0;
}

.stack {
  display: grid;
  gap: 1rem;
}

.section-head {
  margin-bottom: 1rem;
}

.summary-value {
  font-size: 2rem;
  font-family: Georgia,serif;
  margin: 0;
  overflow-wrap: anywhere;
}

.meter {
  width: 100%;
  accent-color: var(--green);
}

.bottom {
  position: fixed;
  inset: auto 0 0;
  background: var(--surface);
  border-top: 1px solid var(--line);
  z-index: 2;
  padding-bottom: env(safe-area-inset-bottom);
}

.nav-inner {
  display: grid;
  grid-template-columns: repeat(4,1fr);
  align-items: center;
  width: min(100%,32rem);
  margin: auto;
  min-height: 66px;
}

.nav-inner a {
  display: grid;
  text-align: center;
  align-content: center;
  min-height: 54px;
  font-size: .85rem;
  font-weight: 650;
  color: var(--muted);
}

.nav-inner a span {
  font-size: 1.2rem;
  line-height: 1.1;
}

.nav-inner a[aria-current=page] {
  color: var(--green);
  background: var(--mint);
  border-radius: .8rem;
}

.add {
  justify-self: center;
  background: var(--green);
  color: white;
  border: 0;
  border-radius: .85rem;
  width: 46px;
  height: 46px;
  font-size: 1.75rem;
  line-height: 1;
}

dialog {
  width: min(100% - 1.5rem,34rem);
  max-height: calc(100% - 1.5rem);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  border-radius: 1.25rem;
  padding: 1.15rem;
}

dialog::backdrop {
  background: #18291ab5;
}

dialog h2 {
  font-size: 1.45rem;
}

form {
  display: grid;
  gap: .85rem;
}

.field {
  display: grid;
  gap: .3rem;
  font-size: .9rem;
  font-weight: 650;
  min-width: 0;
}

input,select,textarea {
  background: #fffdf7;
  border: 1px solid #858a76;
  border-radius: .65rem;
  color: var(--ink);
  width: 100%;
  min-height: 44px;
  padding: .55rem .6rem;
  font-size: 1rem;
}

textarea {
  resize: vertical;
}

.check {
  display: flex;
  gap: .55rem;
  align-items: center;
  font-size: .9rem;
}

.check input {
  width: 1.2rem;
  min-height: 1.2rem;
  accent-color: var(--green);
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: .6rem;
}

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

.options summary {
  padding: .55rem 0;
  color: var(--green);
  font-weight: 650;
  cursor: pointer;
}

.options[open] > :not(summary) {
  margin-top: .55rem;
}

.reward-picker {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.reward-picker legend {
  margin-bottom: .55rem;
  padding: 0;
}

.reward-choices {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .45rem;
}

.reward-choice {
  position: relative;
  min-width: 0;
  cursor: pointer;
}

.reward-choice input {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 0;
  padding: 0;
  opacity: 0;
}

.reward-tile {
  display: grid;
  justify-items: center;
  gap: .35rem;
  min-height: 5rem;
  padding: .55rem .15rem;
  border: 1px solid var(--line);
  border-radius: .85rem;
  background: #fffdf7;
  font-size: .825rem;
  font-weight: 700;
  text-align: center;
  overflow-wrap: anywhere;
}

.reward-icon {
  display: grid;
  place-items: center;
  width: 2.15rem;
  height: 2.15rem;
  border-radius: .65rem;
  background: #edf0df;
  color: var(--green);
  font-size: 1.25rem;
}

.reward-choice input:checked + .reward-tile {
  border-color: var(--green);
  background: var(--mint);
  box-shadow: inset 0 0 0 1px var(--green);
}

.reward-choice input:focus-visible + .reward-tile {
  outline: 3px solid #627f35;
  outline-offset: 2px;
}

.time-setting,
.points-settings {
  padding: .75rem;
  border: 1px solid var(--line);
  border-radius: .9rem;
}

.time-setting {
  background: #edf0df;
}

.points-settings summary {
  padding: .15rem 0;
}

.points-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
  gap: .65rem;
}

.points-grid .setting {
  padding: .55rem;
  background: #f4f3ea;
  border-radius: .65rem;
}

.setting-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .4rem;
  min-width: 0;
  font-size: .9rem;
  font-weight: 700;
}

.setting-value {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: .2rem;
  min-height: 36px;
  padding: 0 .45rem;
  border: 1px solid #a2aa90;
  border-radius: .55rem;
  background: #fffdf7;
  color: var(--green);
  font-variant-numeric: tabular-nums;
}

.setting-value input {
  appearance: textfield;
  width: 3ch;
  min-height: 34px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--green);
  text-align: right;
  font-weight: 750;
}

.setting-value input[max="1440"],
.setting-value input[max="10000"] {
  width: 5ch;
}

.setting-value input::-webkit-inner-spin-button,
.setting-value input::-webkit-outer-spin-button {
  appearance: none;
  margin: 0;
}

.setting input[type="range"] {
  appearance: none;
  display: block;
  min-height: 44px;
  padding: 0;
  border: 0;
  margin: 0;
  background: transparent;
  cursor: pointer;
}

.setting input[type="range"]::-webkit-slider-runnable-track {
  height: .5rem;
  border-radius: .5rem;
  background: linear-gradient(to right, #47663a var(--slider-fill), #cbd3ba var(--slider-fill));
}

.setting input[type="range"]::-moz-range-track {
  height: .5rem;
  border-radius: .5rem;
  background: linear-gradient(to right, #47663a var(--slider-fill), #cbd3ba var(--slider-fill));
}

.setting input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 1.5rem;
  height: 1.5rem;
  border: 3px solid #fffdf7;
  border-radius: 50%;
  margin-top: -.5rem;
  background: var(--green);
  box-shadow: 0 0 0 1px var(--green);
}

.setting input[type="range"]::-moz-range-thumb {
  width: 1.15rem;
  height: 1.15rem;
  border: 3px solid #fffdf7;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 1px var(--green);
}

.setting-scale {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: .78rem;
}

@media (max-width: 350px) {
  .reward-choices {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

[data-leisure-plan]:empty,
[data-duty-plan]:empty {
  display: none;
}

fieldset {
  border: 1px solid var(--line);
  border-radius: .7rem;
  padding: .7rem;
}

legend {
  font-weight: 700;
}

.form-error {
  color: var(--danger);
  margin: 0;
}

.form-error:empty {
  display: none;
}

#status:not(:empty) {
  position: fixed;
  bottom: 5rem;
  right: 1rem;
  max-width: calc(100% - 2rem);
  padding: .8rem 1rem;
  background: var(--green);
  color: white;
  border-radius: .75rem;
  z-index: 3;
}

@media(max-width:620px) {
  .columns {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  main {
    padding-top: 1rem;
  }
  .top {
    min-height: 4rem;
  }
  .hero {
    min-height: 13rem;
  }
  .brand-mark {
    width: 1.7rem;
    height: 1.7rem;
  }
  .task-action {
    padding-inline: .55rem;
  }
}
