:root {
  font-family: Arial, Helvetica, sans-serif;
  color: #263b2e;
  background: #fafbef;
  font-size: 16px;
  --paper: #fffef8;
  --line: #dce2cd;
  --green: #345f43;
  --muted: #5e6c59;
  --soft: #eaf0dd;
  --gold: #d6a854;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  outline-offset: 4px;
}
a {
  color: var(--green);
}
button,
.button {
  border: 0;
  border-radius: 12px;
  padding: 12px 18px;
  background: var(--green);
  color: white;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
button:hover,
.button:hover {
  filter: brightness(0.93);
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
button.secondary {
  color: var(--green);
  background: var(--soft);
}
button.text {
  background: transparent;
  color: var(--green);
  padding: 8px;
}
.brand {
  font-size: 27px;
  font-weight: 800;
  letter-spacing: -1px;
  text-decoration: none;
}
.brand span {
  color: #a97823;
}
.tagline {
  color: var(--muted);
  font-size: 14px;
}
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 240px;
  background: #f0f3e4;
  border-right: 1px solid var(--line);
  padding: 35px 22px;
  display: flex;
  flex-direction: column;
  z-index: 5;
}
.sidebar nav {
  display: grid;
  gap: 8px;
  margin-top: 36px;
}
.sidebar nav button {
  text-align: left;
  background: transparent;
  color: var(--muted);
  font-size: 16px;
}
.sidebar nav button.active {
  background: #dfe8cb;
  color: #263b2e;
}
.profile {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding-top: 24px;
}
.profile strong,
.profile small {
  display: block;
  margin: 8px 0;
}
.profile small {
  color: var(--muted);
}
main {
  margin-left: 240px;
  padding: 40px 5vw 70px;
  max-width: 1550px;
}
h1 {
  font-size: clamp(30px, 4vw, 44px);
  letter-spacing: -1.5px;
  margin: 10px 0 12px;
}
h2 {
  font-size: 21px;
  margin: 0 0 20px;
}
h3 {
  font-size: 17px;
  margin: 0 0 7px;
}
p {
  line-height: 1.6;
}
.eyebrow {
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 2px;
  font-weight: 800;
  color: var(--muted);
}
.topline,
.section-title,
.actions,
.task,
.task-head {
  display: flex;
  align-items: center;
  gap: 12px;
}
.topline,
.section-title {
  justify-content: space-between;
}
.topline {
  margin-bottom: 35px;
}
.welcome {
  margin-bottom: 30px;
}
.welcome p {
  color: var(--muted);
}
.grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(260px, 1fr);
  gap: 24px;
  align-items: start;
}
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 26px;
  margin-bottom: 24px;
}
.buddy {
  background: #e8eed8;
  display: flex;
  align-items: center;
  gap: 25px;
  min-height: 175px;
}
.house {
  font-size: 72px;
  color: #9d7027;
  line-height: 1;
}
.buddy p {
  margin: 8px 0;
  color: var(--muted);
}
.task {
  border-top: 1px solid var(--line);
  padding: 18px 0;
  align-items: flex-start;
}
.task-body {
  flex: 1;
  min-width: 0;
}
.task-body button {
  padding: 0;
  text-align: left;
  background: transparent;
  color: inherit;
}
.task p {
  font-size: 13px;
  color: var(--muted);
  margin: 6px 0;
}
.task.done h3 {
  text-decoration: line-through;
  color: var(--muted);
}
.check {
  width: 29px;
  height: 29px;
  border: 2px solid #93a980;
  border-radius: 50%;
  background: transparent;
  color: var(--green);
  padding: 0;
  flex-shrink: 0;
  font-size: 18px;
}
.done .check {
  background: var(--soft);
}
.tag {
  display: inline-block;
  background: var(--soft);
  font-size: 11px;
  padding: 5px 8px;
  border-radius: 7px;
  margin: 3px 4px 0 0;
}
.muted {
  color: var(--muted);
  font-size: 14px;
}
.empty {
  padding: 20px 0;
  color: var(--muted);
  line-height: 1.7;
}
.progress {
  height: 8px;
  background: var(--soft);
  border-radius: 10px;
  margin-bottom: 16px;
  overflow: hidden;
}
.progress::-webkit-progress-bar {
  background: var(--soft);
}
.progress::-webkit-progress-value {
  background: var(--green);
}
progress {
  width: 100%;
  accent-color: var(--green);
}
.auth {
  max-width: 470px;
  margin: 6vh auto;
  padding: 24px;
}
.auth .brand {
  display: block;
  margin-bottom: 35px;
}
.auth .card {
  margin-top: 22px;
}
.auth h1 {
  font-size: 32px;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
label {
  display: grid;
  gap: 8px;
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 18px;
}
label.inline {
  display: flex;
  align-items: center;
}
input,
select,
textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid #aab79a;
  border-radius: 10px;
  background: var(--paper);
  color: inherit;
}
input[type="checkbox"] {
  width: 20px;
  height: 20px;
}
textarea {
  min-height: 90px;
  resize: vertical;
}
.actions {
  flex-wrap: wrap;
  margin-top: 20px;
}
.error {
  color: #a32f27;
  background: #ffede8;
  padding: 12px;
  border-radius: 10px;
}
.banner {
  background: #fff0ca;
  border: 1px solid #dfc781;
  padding: 16px;
  border-radius: 14px;
  margin-bottom: 24px;
}
.banner p {
  margin: 5px 0;
}
.secret {
  font: 20px monospace;
  overflow-wrap: anywhere;
  background: var(--soft);
  padding: 20px;
  border-radius: 12px;
  user-select: all;
}
.history {
  border-top: 1px solid var(--line);
  padding: 18px 0;
}
.history p {
  margin: 4px 0;
  white-space: pre-wrap;
}
.tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.tabs button {
  background: var(--soft);
  color: var(--green);
}
.tabs button.active {
  background: var(--green);
  color: white;
}
.member {
  border-top: 1px solid var(--line);
  padding: 18px 0;
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}
.member p {
  margin: 4px 0;
}
.menu-toggle {
  display: none;
}
dialog {
  width: min(620px, 95vw);
  max-height: 90vh;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--paper);
  color: inherit;
  padding: 28px;
}
dialog::backdrop {
  background: #15291d88;
}
.dialog-top {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 20px;
}
.dialog-top button {
  padding: 8px 13px;
}
.detail-notes {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
#notice {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #263b2e;
  color: white;
  padding: 14px 22px;
  border-radius: 15px;
  z-index: 20;
  max-width: 90vw;
}
#notice:empty {
  display: none;
}
.loading {
  text-align: center;
  padding: 50px;
}
.auth .actions button {
  flex: 1;
}
.mobile-title {
  display: none;
}
.metric {
  font-size: 42px;
  font-weight: 800;
  display: block;
  margin: 12px 0;
}
footer {
  font-size: 12px;
  color: var(--muted);
  margin-top: 30px;
}
.full {
  grid-column: 1/-1;
}
.row-end {
  margin-left: auto;
}
.danger {
  color: #a32f27;
}
.dark {
  --paper: #233027;
  --line: #41513a;
  --green: #b7d49b;
  --muted: #c0cbb6;
  --soft: #344631;
  color: #f1f3e7;
  background: #17251d;
}
.dark .sidebar {
  background: #1c2c21;
}
.dark button,
.dark .button {
  color: #17251d;
}
.dark .sidebar nav button {
  color: var(--muted);
}
.dark .sidebar nav button.active {
  background: #344631;
  color: #f1f3e7;
}
.dark .buddy {
  background: #344631;
}
.dark .banner {
  background: #4a3b1f;
  border-color: #806c37;
}
.dark .check {
  color: var(--green);
}
.dark .task-body button {
  color: inherit;
}
.dark .error {
  background: #502c28;
  color: #ffcec1;
}
@media (max-width: 800px),
  (hover: none) and (pointer: coarse),
  (orientation: portrait) and (any-pointer: coarse) {
  main {
    margin-left: 0;
    padding: 22px 18px 45px;
  }
  .grid {
    grid-template-columns: 1fr;
  }
  .sidebar {
    display: none;
    width: min(300px, 90vw);
    box-shadow: 0 0 0 100vw #15291d66;
  }
  .sidebar.open {
    display: flex;
  }
  .menu-toggle {
    display: block;
  }
  .topline {
    margin-bottom: 25px;
  }
  .mobile-title {
    display: block;
  }
  .card {
    padding: 21px;
    border-radius: 20px;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .buddy {
    min-height: 140px;
  }
  .auth {
    margin: 1vh auto;
  }
  .topline .eyebrow {
    display: none;
  }
  .member {
    align-items: start;
    flex-wrap: wrap;
  }
}

[hidden] {
  display: none !important;
}
button:disabled {
  cursor: default;
}
.task h3 {
  overflow-wrap: anywhere;
}

.house {
  width: 110px;
  flex-shrink: 0;
}
.house svg {
  display: block;
  width: 100%;
  height: auto;
}
@media (max-width: 450px) {
  .house {
    width: 85px;
  }
  .buddy {
    gap: 18px;
  }
}

.weather-fields {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
  margin: 18px 0;
}
.weather-fields legend {
  font-weight: 700;
}
.weather-tag {
  background: var(--soft);
}

.location-result {
  display: block;
  margin: 10px 0;
  max-width: 100%;
  text-align: left;
}
.weather-overview h2 {
  margin-bottom: 10px;
}
.weather-overview p {
  margin: 6px 0;
}

.task-view-controls {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  margin: 20px 0;
}
.task-view-controls > div {
  flex: 1;
  min-width: 180px;
  max-width: 320px;
  margin: 0;
}
.task-group + .task-group {
  margin-top: 28px;
}
.task-group h2 {
  margin-bottom: 12px;
  text-transform: none;
}
.task-group h2::first-letter {
  text-transform: uppercase;
}

.task-view-controls label {
  display: block;
  margin-bottom: 8px;
}

.mobile-weather {
  display: none;
}
@media (max-width: 800px),
  (hover: none) and (pointer: coarse),
  (orientation: portrait) and (any-pointer: coarse) {
  input,
  select,
  textarea {
    font-size: 16px;
  }
  button,
  .button {
    min-height: 44px;
  }
  .sidebar {
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  dialog {
    max-height: 90vh;
    max-height: 90dvh;
    padding: 20px;
    overflow-y: auto;
  }
  .overview-page {
    padding: 16px 14px 32px;
  }
  .overview-page .topline {
    gap: 6px;
    margin-bottom: 18px;
  }
  .overview-page .topline .actions {
    margin: 0;
    gap: 6px;
    flex: 1;
    justify-content: flex-end;
  }
  .overview-page .topline button {
    padding: 10px;
    font-size: 14px;
  }
  .overview-page #theme {
    font-size: 0;
    width: 44px;
    flex-shrink: 0;
  }
  .overview-page #theme::before {
    content: "◐";
    font-size: 22px;
  }
  .overview-page .welcome {
    margin-bottom: 18px;
  }
  .overview-page .welcome h1 {
    font-size: 30px;
    margin: 8px 0;
  }
  .overview-page .welcome p {
    display: none;
  }
  .overview-page .buddy {
    min-height: 0;
    padding: 14px 18px;
    gap: 14px;
  }
  .overview-page .buddy .house {
    width: 64px;
  }
  .overview-page .buddy h2 {
    font-size: 19px;
    margin: 4px 0;
  }
  .overview-page .buddy p {
    display: none;
  }
  .overview-page .card {
    padding: 16px;
    margin-bottom: 16px;
    border-radius: 18px;
  }
  .overview-page .grid {
    gap: 0;
  }
  .overview-page .weather-overview h2 {
    display: none;
  }
  .overview-page .desktop-weather {
    display: none;
  }
  .overview-page .mobile-weather {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 14px;
    margin: 0;
    font-size: 15px;
  }
  .overview-page .weather-waiting {
    padding: 12px 16px;
    margin-bottom: 16px;
    font-size: 14px;
  }
  .overview-page .weather-waiting p,
  .overview-page .weather-waiting button {
    display: none;
  }
  .overview-page .task {
    padding: 7px 0;
    gap: 10px;
    align-items: center;
  }
  .overview-page .task-extra,
  .overview-page .task-details-link {
    display: none;
  }
  .overview-page .task-body > button {
    display: flex;
    align-items: center;
    min-height: 44px;
    width: 100%;
  }
  .overview-page .task h3 {
    margin: 0;
    font-size: 16px;
    line-height: 1.4;
  }
  .overview-page .check {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
  }
  .overview-page .section-title h2 {
    font-size: 19px;
  }
  .overview-page .history {
    padding: 12px 0;
  }
  .overview-page .history p {
    font-size: 14px;
  }
}

.example-entry {
  margin: 16px 0;
}
.example-group {
  border-top: 1px solid var(--line);
  padding: 14px 0;
}
.example-group summary {
  cursor: pointer;
  font-weight: 700;
  line-height: 1.5;
  min-height: 44px;
  padding: 10px 0;
}
.example-choice {
  display: block;
  text-align: left;
  width: 100%;
  background: var(--soft);
  color: var(--green);
  margin: 8px 0;
  font-size: 15px;
  line-height: 1.4;
}
.example-choice small {
  display: block;
  font-weight: 400;
  margin-top: 5px;
}
.dark .example-choice {
  color: var(--green);
}
#choose-task-example {
  margin-bottom: 18px;
}

.task-checklist {
  margin: 12px 0 0;
}
.task-checklist label {
  font-size: 14px;
  font-weight: 400;
  margin: 4px 0;
  min-height: 44px;
  line-height: 1.4;
}
.task-checklist input {
  flex-shrink: 0;
}
.task-checklist span {
  overflow-wrap: anywhere;
}

.task:has(.task-checklist) {
  align-items: flex-start;
}

.new-round-button {
  margin-top: 12px;
}
.collaboration-panel {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
  margin: 18px 0;
}
.collaboration-panel h3 {
  margin-top: 12px;
}
.task-body .new-round-button {
  background: var(--soft);
  color: var(--green);
  padding: 10px 14px;
  text-align: left;
}

/* Dark dialogs and native form controls need explicit foreground colours. */
.dark {
  color-scheme: dark;
}
.dark dialog,
.dark dialog label,
.dark dialog legend {
  color: #f1f3e7;
}
.dark input,
.dark textarea,
.dark select,
.dark option {
  color: #f1f3e7;
  background-color: var(--paper);
}
.dark input::placeholder,
.dark textarea::placeholder {
  color: var(--muted);
  opacity: 1;
}
.dark button.secondary,
.dark button.text {
  color: var(--green);
}

.overview-page .task-details-link {
  display: none;
}
.checklist-toggle {
  width: 44px;
  min-width: 44px;
  height: 44px;
  flex-shrink: 0;
  font-size: 24px;
  padding: 0 !important;
  display: flex;
  align-items: center;
  justify-content: center;
}
.overview-page .task .checklist-toggle {
  font-size: 24px;
}

.admin-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.admin-number { display: block; font-size: 1.8rem; }
@media (max-width: 700px) { .admin-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.offline-status { padding: 12px 16px; margin: 12px 0 20px; border: 1px solid var(--line); border-radius: 12px; background: var(--soft); font-size: .9rem; }
.offline-status p { margin: 4px 0 10px; }
.offline-status article { border-top: 1px solid var(--line); padding: 12px 0; }
.offline-status button { margin: 4px 8px 4px 0; }
