﻿:root {
  color-scheme: light;
  font-family: system-ui, sans-serif;
  color: #192b22;
  background: #24392b;
  --paper: #f8f3e7;
  --cream: #fffaf0;
  --forest: #143729;
  --clay: #9c4124;
  --muted: #505d51;
  --rule: #cabeaa;
  --panel-radius: .85rem;
}

:root[data-season="spring"] { --forest-image: url("/scenery/spring.jpg"); }
:root[data-season="summer"] { --forest-image: url("/scenery/summer.jpg"); }
:root[data-season="autumn"] { --forest-image: url("/scenery/autumn.jpg"); }
:root[data-season="winter"] { --forest-image: url("/scenery/winter.jpg"); }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; isolation: isolate; }
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: linear-gradient(#14281d47, #14281d65), var(--forest-image, none);
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}
header, main { max-width: 84rem; margin: auto; padding-inline: clamp(.65rem, 5vw, 3.5rem); }
#auth-masthead { display: flex; justify-content: center; align-items: center; min-height: 2.75rem; padding-top: 1.25rem; }
#auth-masthead h1 { color: var(--cream); background: var(--forest); border-radius: .45rem; padding: .4rem .7rem; }
main { padding-block: .85rem 1.25rem; }
h1, h2 { font-family: Georgia, serif; line-height: 1.05; margin: 0 0 1rem; overflow-wrap: anywhere; }
h1 { font-size: 1.5rem; color: var(--forest); }
h2 { font-size: clamp(1.65rem, 4vw, 2.75rem); }
header h1 { margin: 0; }
#logout { min-height: 2rem; padding: .2rem .5rem; font-size: .85rem; }
section, aside { min-width: 0; padding: clamp(1rem, 3vw, 2rem); }
aside { background: var(--forest); color: var(--cream); padding: var(--heading-top) clamp(.65rem, 2vw, 1.2rem) clamp(.65rem, 2vw, 1.2rem); }
.sidebar-masthead { display: flex; align-items: center; flex-wrap: wrap; justify-content: space-between; gap: .3rem; min-height: var(--heading-row); margin-bottom: .4rem; }
.sidebar-masthead h1 { margin: 0; color: inherit; font-size: 1.55rem; }
#authentication { max-width: 30rem; margin: 1rem auto; background: var(--cream); border-radius: var(--panel-radius); box-shadow: 0 10px 36px #0d1f1740; }
.workspace { --heading-top: .55rem; --heading-row: 2.15rem; display: grid; grid-template-columns: minmax(14rem, 1fr) minmax(0, 3fr); background: var(--paper); border-radius: var(--panel-radius); box-shadow: 0 10px 36px #0d1f1740; }
.workspace > aside { border-radius: var(--panel-radius) 0 0 var(--panel-radius); }
.workspace > section { min-height: 65vh; padding: var(--heading-top) clamp(.65rem, 2vw, 1.25rem) 1rem; }
form, nav { display: flex; flex-wrap: wrap; align-items: end; gap: .7rem; margin-bottom: 1rem; }
aside form, nav, #auth-form { align-items: stretch; flex-direction: column; }
aside form { padding-top: .4rem; margin-bottom: .35rem; }
#search-all-lists { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .3rem; margin: 0 .15rem .35rem; padding: 0; }
#search-all-lists input, #search-all-lists button { min-height: 2.1rem; padding: .2rem .45rem; font-size: .9rem; }
#lists { --nav-row-height: 2.1rem; flex-wrap: nowrap; gap: .2rem; padding: .2rem .15rem; margin-bottom: .55rem; }
#lists button { min-height: var(--nav-row-height); padding: .22rem .55rem; text-align: left; overflow-wrap: anywhere; }
.list-navigation-row { display: flex; gap: .15rem; position: relative; flex: none; }
.list-navigation-row > :first-child { flex: 1; min-width: 0; }
#lists .list-handle { width: var(--nav-row-height); flex-shrink: 0; padding: 0; background: transparent; border-color: transparent; color: #d2e4d7; cursor: grab; touch-action: none; user-select: none; }
#lists .list-handle:hover { background: #305d49; }
.list-handle::before { content: ""; display: block; margin: auto; width: 12px; height: 18px; background: radial-gradient(circle, currentColor 1.25px, transparent 1.65px) 0 0 / 6px 6px; }
.list-navigation-row.dragging { opacity: .55; }
#lists .dragging .list-handle { cursor: grabbing; }
.list-navigation-row[data-drop]::after { content: ""; position: absolute; left: 0; right: 0; height: 2px; background: #f7c89b; pointer-events: none; }
.list-navigation-row[data-drop="before"]::after { top: 0; }
.list-navigation-row[data-drop="after"]::after { bottom: 0; }
.sidebar-actions { display: grid; gap: .15rem; padding-top: .35rem; border-top: 1px solid #668373; }
.sidebar-actions details { margin: 0; }
.sidebar-actions summary, #open-paste-import { min-height: 2rem; padding: .35rem .45rem; margin: 0; font-size: .9rem; }
#open-paste-import { text-align: left; border-color: transparent; background: transparent; }
#open-paste-import:hover { background: #305d49; }
#open-admin, #open-password { text-align: left; min-height: 2rem; padding: .35rem .45rem; font-size: .9rem; }
@media (pointer: coarse) { #open-password { min-height: 2.75rem; } }
#password-dialog { width: min(28rem, calc(100% - 1.5rem)); padding: 1.2rem; border: 1px solid var(--rule); border-radius: var(--panel-radius); background: var(--cream); color: inherit; }
#password-dialog::backdrop { background: #14281d88; }
#password-dialog h2 { font-size: 1.55rem; }
#change-password { display: grid; gap: .65rem; margin: 0; }
#change-password input { width: 100%; }
.password-actions { display: flex; flex-wrap: wrap; gap: .45rem; }
#password-error { margin: 0; color: var(--clay); }
.admin-content { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); gap: 1.2rem; padding: .85rem 0; }
.admin-content section { padding: 0; }
#admin-title { margin: 0; font-size: 1.5rem; }
.admin-content h3 { margin: 0 0 .6rem; font-size: 1.05rem; }
.admin-content form { flex-direction: column; align-items: stretch; }
.admin-content select { font: inherit; color: inherit; background: var(--cream); border: 1px solid #847c69; border-radius: .3rem; padding: .5rem; min-height: 2.75rem; width: 100%; }
#admin-members, #admin-user-directory ul { list-style: none; padding: 0; }
#admin-members li { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .25rem 0; border-bottom: 1px solid var(--rule); }
#admin-members li span, #admin-user-directory li { overflow-wrap: anywhere; }
#admin-members button { flex-shrink: 0; }
#lists :focus-visible { outline-offset: -2px; }
@media (pointer: coarse) {
  #lists { --nav-row-height: 2.75rem; }
  .sidebar-actions summary, #open-paste-import, #open-admin { min-height: 2.75rem; }
}
label { min-width: 0; display: grid; gap: .3rem; font-size: .9rem; }
.check { display: flex; align-items: center; min-height: 2.75rem; gap: .5rem; }
input, button, .primary { font: inherit; border: 1px solid #847c69; border-radius: .3rem; padding: .5rem .7rem; min-width: 0; min-height: 2.75rem; }
input { background: var(--cream); color: inherit; }
#paste-import { padding: 0 0 1rem; margin-bottom: 1.5rem; border-bottom: 1px solid var(--rule); }
#paste-import-form { align-items: stretch; flex-direction: column; }
#paste-import-text { width: 100%; resize: vertical; background: var(--cream); color: inherit; font: inherit; padding: .65rem; border: 1px solid #847c69; border-radius: .3rem; }
aside input { color: #192b22; }
input[type="checkbox"] { min-height: auto; width: 1.05rem; height: 1.05rem; accent-color: var(--forest); }
button, .primary { cursor: pointer; background: #ede6d7; color: var(--forest); }
button:hover { background: #e4d8c1; }
aside button { background: #224a3a; color: var(--cream); border-color: #668373; }
aside button:hover { background: #305d49; }
.primary, aside [aria-current="true"], #auth-submit { background: var(--clay); color: white; border-color: var(--clay); }
.primary:hover, aside [aria-current="true"]:hover, #auth-submit:hover { background: #7f321c; }
button:disabled { cursor: wait; opacity: .65; }
:focus-visible { outline: 2px solid #255d42; outline-offset: 3px; }
aside :focus-visible { outline-color: #fff5d9; }
#status { position: fixed; z-index: 5; right: 1rem; bottom: 1rem; max-width: min(30rem, calc(100vw - 2rem)); margin: 0; padding: .5rem .75rem; background: var(--cream); border: 1px solid var(--rule); border-left: .25rem solid var(--forest); }
#status.error { border-color: var(--clay); }
.announcer { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.list-toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .25rem .8rem; min-height: calc(var(--heading-row) + .4rem + 1px); padding-bottom: .4rem; border-bottom: 1px solid var(--rule); }
.list-heading { min-width: 0; }
#list-title { margin: 0; min-width: 0; font-size: 1.35rem; }
#rename-list-button { padding: 0 .2rem; min-height: var(--heading-row); border: 0; background: transparent; color: inherit; text-align: left; overflow-wrap: anywhere; }
#rename-list-button:hover { background: #eae1cf; }
#rename-list { margin: 0; gap: .3rem; align-items: center; }
#rename-list input { flex: 1 1 10rem; width: 100%; min-height: var(--heading-row); padding: .2rem .45rem; }
#rename-list button { min-height: var(--heading-row); padding: .2rem .55rem; font-size: .9rem; }
.list-tools { display: flex; flex-wrap: wrap; align-items: center; gap: .15rem .55rem; }
.list-tools .check, .list-tools button, #list-actions > summary { min-height: var(--heading-row); }
.list-tools button, #list-actions > summary { padding: .25rem .55rem; font-size: .9rem; }
#list-actions { position: relative; margin: 0; }
#list-actions > summary { display: grid; place-content: center; border: 1px solid var(--rule); border-radius: .3rem; margin: 0; list-style: none; font-weight: 700; }
#list-actions > summary::-webkit-details-marker { display: none; }
.list-actions-menu { position: absolute; top: calc(100% + .25rem); right: 0; z-index: 2; padding: .3rem; border: 1px solid var(--rule); background: var(--cream); border-radius: .3rem; }
.list-actions-menu button { width: 100%; }
#tasks { padding: 0; margin: 0; list-style: none; }
.task-entry { position: sticky; bottom: 0; z-index: 2; display: grid; grid-template-columns: var(--task-control) minmax(0, 1fr); gap: .35rem; align-items: center; margin: 0; padding: .2rem 0 var(--entry-bottom-padding); background: var(--paper); border-bottom: 1px solid var(--rule); }
.task-entry span { text-align: center; color: var(--muted); }
.task-entry input { width: 100%; min-height: var(--task-control); padding: .25rem .35rem; background: transparent; border-color: transparent; }
.task-entry input:focus-visible { outline-offset: -2px; }
#tasks > li { border-top: 1px solid var(--rule); }
#tasks > li:first-child { border-top: 0; }
#tasks > li:last-child { border-bottom: 1px solid var(--rule); }
.sub-item-group { margin-left: 2rem; }
.sub-items { list-style: none; margin: 0; padding: 0; }
.sub-items li { display: grid; grid-template-columns: var(--task-control) minmax(0, 1fr); align-items: center; column-gap: .25rem; }
.sub-item-entry { bottom: calc(var(--task-control) + .2rem + var(--entry-bottom-padding) + 1px); z-index: 1; gap: .25rem; padding-bottom: .2rem; border-bottom: 0; }
#list-detail:has(> #new-task[hidden]) .sub-item-entry { bottom: 0; }
.sub-item-title { font-size: .94rem; }
.sub-item-done .sub-item-title { color: var(--muted); text-decoration: line-through; }
.sub-item-check, .completion, .importance, .sub-items-toggle { width: var(--task-control); padding: 0; background: transparent; border: 0; position: relative; }
.sub-item-check { font-size: 1.1rem; }
.task-row { display: flex; align-items: center; gap: .35rem; }
.task-name { flex: 1; }
.title-button { text-align: left; overflow-wrap: anywhere; background: transparent; border: 0; padding: .25rem .35rem; }
.title-button:hover, .title-button[aria-expanded="true"] { background: #eae1cf; }
.task-title { font-size: 1rem; }
.task-list-name { display: block; color: var(--muted); font-size: .9rem; }
.task-search-matches { display: block; color: var(--muted); font-size: .85rem; }
#matching-lists { padding: .6rem 0; }
#matching-lists h3 { margin: 0 0 .3rem; font-size: .95rem; }
#matching-lists ul { list-style: none; display: flex; flex-wrap: wrap; gap: .35rem; padding: 0; margin: 0; }
#matching-lists button { min-height: 2rem; text-align: left; overflow-wrap: anywhere; }
#search-limit { color: var(--muted); font-size: .9rem; }
.completed .task-title { color: var(--muted); text-decoration: line-through; }
.task-date { font-size: .9rem; color: var(--muted); }
#list-detail { --task-control: 2.25rem; --entry-bottom-padding: max(.2rem, env(safe-area-inset-bottom)); }
#tasks :is(.title-button, .completion, .importance, .sub-item-check, .sub-items-toggle) { min-height: var(--task-control); }
.completion, .importance, .sub-items-toggle { flex: 0 0 var(--task-control); }
.completion { color: white; isolation: isolate; display: grid; place-items: center; font-size: .7rem; font-weight: 800; }
.completion::before { content: ""; position: absolute; top: 50%; left: 50%; box-sizing: border-box; width: .9rem; height: .9rem; transform: translate(-50%, -50%); border: 2px solid var(--forest); border-radius: 50%; z-index: -1; }
.completion[aria-pressed="true"]::before { background: var(--forest); }
.sub-items-toggle { display: grid; place-items: center; color: var(--muted); }
.sub-items-toggle::before { content: ""; width: .42rem; height: .42rem; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(-45deg); }
.sub-items-toggle[aria-expanded="true"]::before { transform: translateY(-.08rem) rotate(45deg); }
.importance { color: var(--muted); font-size: 1.2rem; padding: 0; }
.importance[aria-pressed="true"] { color: var(--clay); }
.task-editor, .sub-item-editor { padding: .6rem; background: var(--cream); border: 1px solid var(--rule); }
.task-editor { margin: .25rem 0 .5rem var(--task-control); }
.task-editor form:last-child { margin-bottom: 0; }
.sub-item-editor { grid-column: 2; margin: 0 0 .35rem; }
.completion-history { margin: .5rem 0 0; color: var(--muted); font-size: .9rem; overflow-wrap: anywhere; }
.completion-history summary { margin-bottom: .25rem; }
.completion-history ol { margin: .25rem 0 0; padding-left: 1.25rem; }
#tasks .completion-history li { margin: .2rem 0; }
#members li { margin-block: .4rem; overflow-wrap: anywhere; }
#members button { margin-inline-start: .5rem; }
details { margin-top: 1rem; }
summary { cursor: pointer; margin-bottom: .65rem; }
@media (pointer: coarse) {
  .workspace { --heading-row: 2.75rem; }
  #list-detail { --task-control: 2.75rem; }
  .task-entry input { font-size: 1rem; }
  #search-all-lists input, #search-all-lists button, #matching-lists button { min-height: 2.75rem; }
  #search-all-lists input { font-size: 1rem; }
  #logout { min-height: var(--heading-row); }
  #list-actions > summary { min-width: 2.75rem; }
}
@media (max-width: 28rem) {
  .task-date { max-width: 4rem; font-size: .8rem; }
  .sub-item-group { margin-left: .75rem; }
}
@media (max-width: 46rem) {
  .workspace { grid-template-columns: 1fr; }
  .workspace > aside { border-radius: var(--panel-radius) var(--panel-radius) 0 0; }
  .workspace > section { min-height: 0; }
}
