:root {
  --cafe: #bc7d61;
  --warm: #efd7cb;
  --sand: #e9e0d5;
  --forest: #315d3a;
  --forest-deep: #23472d;
  --ink: #292b28;
  --white: #fffdf9;
  --muted: #706761;
  --border: rgba(49, 93, 58, 0.16);
  --shadow: 0 18px 50px rgba(61, 44, 33, 0.09), 0 2px 8px rgba(61, 44, 33, 0.04);
  --shadow-hover: 0 22px 60px rgba(61, 44, 33, 0.13), 0 4px 12px rgba(61, 44, 33, 0.05);
}

* { box-sizing: border-box; }

a,
button,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}

a,
button {
  touch-action: manipulation;
}

html {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: hidden;
  overflow-x: clip;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 12% -5%, rgba(239, 215, 203, 0.8), transparent 30rem),
    radial-gradient(circle at 92% 8%, rgba(183, 201, 179, 0.4), transparent 28rem),
    linear-gradient(180deg, #f8f4ef 0%, var(--sand) 100%);
  background-attachment: fixed;
  color: var(--ink);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(150px, 1fr) auto minmax(150px, 1fr);
  align-items: center;
  gap: 1.15rem;
  width: 100%;
  min-width: 0;
  padding: calc(0.85rem + env(safe-area-inset-top)) max(1.25rem, calc((100vw - 1200px) / 2), env(safe-area-inset-right)) 0.85rem max(1.25rem, calc((100vw - 1200px) / 2), env(safe-area-inset-left));
  background: rgba(255, 253, 249, 0.78);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  backdrop-filter: blur(20px) saturate(150%);
  border-bottom: 1px solid rgba(49, 93, 58, 0.1);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7);
}

.topbar-start {
  grid-column: 1;
  grid-row: 1;
  justify-self: start;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
}

.season-switcher {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 0.16rem;
  padding: 0.2rem;
  border: 1px solid rgba(49, 93, 58, 0.14);
  border-radius: 999px;
  background: rgba(234, 224, 213, 0.68);
  cursor: pointer;
  isolation: isolate;
}

.season-switcher::before {
  content: '';
  position: absolute;
  z-index: 0;
  top: 0.2rem;
  bottom: 0.2rem;
  left: 0.2rem;
  width: calc(50% - 0.28rem);
  border-radius: 999px;
  background: var(--white);
  box-shadow: 0 2px 8px rgba(61, 44, 33, 0.09);
  transition: transform 240ms cubic-bezier(.22, 1, .36, 1);
}

.season-switcher.is-summer::before {
  transform: translateX(calc(100% + 0.16rem));
}

.season-switcher:disabled { cursor: default; }

.season-option {
  position: relative;
  z-index: 1;
  padding: 0.34rem 0.58rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
  line-height: 1.1;
  transition: color 180ms ease;
}

.season-switcher:not(.is-summer) .season-option:first-child,
.season-switcher.is-summer .season-option:last-child {
  color: var(--forest-deep);
}

.add-item-field {
  grid-column: 3;
  grid-row: 1;
  justify-self: end;
  width: min(190px, 100%);
  min-width: 150px;
  padding: 0.7rem 1rem;
  border: 1px solid rgba(49, 93, 58, 0.18);
  border-radius: 999px;
  background: rgba(255, 253, 249, 0.72);
  color: var(--forest);
  text-align: left;
  cursor: pointer;
  box-shadow: 0 5px 18px rgba(58, 42, 32, 0.06);
  transition: transform 180ms ease, background-color 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.add-item-field:hover {
  transform: translateY(-1px);
  border-color: rgba(49, 93, 58, 0.34);
  background: var(--white);
  box-shadow: 0 8px 24px rgba(58, 42, 32, 0.09);
}

.add-item-field span {
  color: var(--forest);
  font-weight: 800;
  margin-right: 0.35rem;
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  justify-self: start;
  min-width: 0;
}

.brand-home {
  border-radius: 8px;
  text-decoration: none;
}

.brand-home:focus-visible {
  outline: 3px solid var(--cafe);
  outline-offset: 4px;
}

.brand-logo {
  width: 124px;
  height: auto;
  object-fit: contain;
  display: block;
}

.eyebrow {
  margin: 0;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

h1, h2, h3, h4, p {
  margin: 0;
}

h1 {
  font-size: clamp(1.4rem, 2vw, 1.9rem);
}

.nav {
  grid-column: 2;
  grid-row: 1;
  justify-self: center;
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.2rem;
  flex-wrap: nowrap;
  padding: 0.28rem;
  border: 1px solid rgba(49, 93, 58, 0.12);
  border-radius: 999px;
  background: rgba(234, 224, 213, 0.62);
  box-shadow: inset 0 1px 2px rgba(61, 44, 33, 0.06), 0 1px 0 rgba(255, 255, 255, 0.65);
  isolation: isolate;
}

.nav-indicator {
  position: absolute;
  z-index: 0;
  top: 0;
  left: 0;
  width: var(--nav-indicator-width, 0px);
  height: var(--nav-indicator-height, 0px);
  border-radius: 999px;
  background: rgba(255, 253, 249, 0.98);
  box-shadow: 0 4px 14px rgba(45, 52, 42, 0.1), 0 0 0 1px rgba(49, 93, 58, 0.08);
  transform: translate3d(var(--nav-indicator-x, 0px), var(--nav-indicator-y, 0px), 0);
  transition: transform 230ms cubic-bezier(.22, 1, .36, 1), width 230ms cubic-bezier(.22, 1, .36, 1), height 230ms cubic-bezier(.22, 1, .36, 1);
  pointer-events: none;
}

.nav:not(.nav-ready) .nav-link.active {
  background: rgba(255, 253, 249, 0.98);
  box-shadow: 0 4px 14px rgba(45, 52, 42, 0.1), 0 0 0 1px rgba(49, 93, 58, 0.08);
}

.nav.is-switching .nav-link {
  pointer-events: none;
}

.nav-link {
  position: relative;
  z-index: 1;
  text-decoration: none;
  padding: 0.56rem 0.86rem;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 650;
  white-space: nowrap;
  transition: color 180ms ease, transform 180ms ease;
}

.nav-link:hover {
  color: var(--forest);
}

.nav-link.active {
  color: var(--forest-deep);
}

.nav-link:active {
  transform: scale(0.97);
}

.page-shell {
  width: 100%;
  min-width: 0;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 2.5rem;
}

.tutorials-page {
  max-width: 1280px;
}

.tutorials-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1.25rem;
  margin-bottom: 1.35rem;
  padding: 0.4rem 0.15rem;
}

.tutorials-heading h1 {
  margin: 0.18rem 0 0.38rem;
  color: var(--forest-deep);
  font-size: clamp(2rem, 4vw, 3rem);
}

.tutorials-heading > div > p:last-child {
  color: var(--muted);
  font-size: 1rem;
}

.tutorial-add-button {
  flex: 0 0 auto;
  min-height: 2.8rem;
  padding-inline: 1.05rem;
}

.tutorial-search {
  display: flex;
  position: relative;
  z-index: 4;
  margin: -0.45rem 0 1.35rem;
}

.tutorial-search-combobox {
  width: min(36rem, 100%);
}

.tutorial-search-combobox input {
  width: 100%;
}

.tutorial-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.15rem;
}

.tutorial-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: rgba(255, 253, 249, 0.88);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.tutorial-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 32px rgba(61, 44, 33, 0.13);
}

.tutorial-card:focus-visible {
  outline: 3px solid rgba(188, 125, 97, 0.55);
  outline-offset: 3px;
}

.tutorial-video-wrap {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: linear-gradient(135deg, #243329, #111a14);
}

.tutorial-video-wrap video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #111;
}

.tutorial-video-wrap video:fullscreen,
.tutorial-video-wrap video:-webkit-full-screen {
  width: 100vw;
  height: 100vh;
  max-width: 100vw;
  max-height: 100vh;
  object-fit: contain;
  background: #000;
}

.tutorial-play-hint {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  width: 3.1rem;
  height: 3.1rem;
  place-items: center;
  padding-left: 0.15rem;
  border-radius: 50%;
  background: rgba(17, 26, 20, 0.76);
  color: var(--white);
  font-size: 1rem;
  pointer-events: none;
  transform: translate(-50%, -50%);
  transition: opacity 160ms ease, transform 160ms ease, background-color 160ms ease;
}

.tutorial-card:hover .tutorial-play-hint {
  background: rgba(35, 71, 45, 0.92);
  transform: translate(-50%, -50%) scale(1.07);
}

.tutorial-video-wrap.is-playing .tutorial-play-hint {
  opacity: 0;
}

.tutorial-card-copy {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.9rem 1rem 1rem;
}

.tutorial-card-copy h2 {
  color: var(--forest-deep);
  font-size: 1rem;
  line-height: 1.35;
}

.tutorial-delete {
  flex: 0 0 auto;
  opacity: 0.72;
}

.tutorial-empty {
  grid-column: 1 / -1;
  min-height: 18rem;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 0.55rem;
  padding: 2rem;
  border: 1px dashed rgba(55, 100, 56, 0.3);
  border-radius: 24px;
  background: rgba(255, 253, 249, 0.55);
  color: var(--muted);
  text-align: center;
}

.tutorial-empty > span {
  display: grid;
  width: 3.5rem;
  height: 3.5rem;
  place-items: center;
  border-radius: 50%;
  background: rgba(55, 100, 56, 0.1);
  color: var(--forest);
  font-size: 1.2rem;
}

.tutorial-empty h2 { color: var(--forest-deep); }

.tutorial-modal-card {
  width: min(560px, 100%);
  padding: 1.25rem;
}

.tutorial-form {
  display: grid;
  gap: 1rem;
}

.tutorial-form label {
  display: grid;
  gap: 0.42rem;
  color: var(--forest-deep);
  font-weight: 700;
}

.tutorial-form input {
  width: 100%;
}

.tutorial-file-field {
  display: grid;
  justify-items: start;
  gap: 0.42rem;
}

.tutorial-file-field small,
.tutorial-form-status {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 500;
}

.tutorial-form-status:empty { display: none; }

.period-progress-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
  margin-bottom: 0.8rem;
}

.completed-cycle-row {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 0.65rem;
}

.completed-cycle-button {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.62rem 0.78rem;
  border: 1px solid rgba(49, 93, 58, 0.2);
  border-radius: 999px;
  background: rgba(255, 253, 249, 0.78);
  color: var(--forest-deep);
  font-weight: 750;
  cursor: pointer;
}

.completed-cycle-button strong {
  display: grid;
  min-width: 1.7rem;
  min-height: 1.7rem;
  place-items: center;
  border-radius: 999px;
  background: var(--forest);
  color: var(--white);
  font-size: 0.78rem;
}

.period-progress-card {
  --period-progress-color: var(--forest);
  min-width: 0;
  padding: 0.55rem 0.65rem;
  border: 1px solid color-mix(in srgb, var(--period-progress-color) 28%, transparent);
  border-radius: 14px;
  background: rgba(255, 253, 249, 0.66);
  box-shadow: 0 5px 16px rgba(61, 44, 33, 0.05);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: default;
}

.period-progress-card.weekly { --period-progress-color: #b96842; }
.period-progress-card.monthly { --period-progress-color: #5277a6; }
.period-progress-card.yearly { --period-progress-color: #845796; }

.period-progress-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
  color: var(--period-progress-color);
  font-size: 0.78rem;
}

.period-progress-heading span {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
}

.period-progress-card .progress-track {
  height: 7px;
  background: color-mix(in srgb, var(--period-progress-color) 15%, transparent);
}

.period-progress-card .progress-track span {
  background: var(--period-progress-color);
}

.calendar-progress {
  display: grid;
  gap: 0.16rem;
  margin-top: 0.34rem;
}

.calendar-progress-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  color: color-mix(in srgb, var(--muted) 74%, transparent);
  font-size: 0.61rem;
  font-weight: 650;
  line-height: 1;
}

.calendar-progress-heading strong {
  color: color-mix(in srgb, var(--muted) 78%, transparent);
  font-size: 0.61rem;
}

.calendar-progress-track,
.calendar-progress-steps {
  height: 3px;
  overflow: hidden;
  border-radius: 999px;
}

.calendar-progress-track {
  background: color-mix(in srgb, var(--forest) 7%, transparent);
}

.calendar-progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: color-mix(in srgb, var(--forest) 38%, transparent);
}

.calendar-progress-steps {
  display: grid;
  grid-template-columns: repeat(var(--calendar-step-count), minmax(0, 1fr));
  gap: 1px;
  width: 100%;
}

.calendar-progress-step {
  min-width: 0;
  background: color-mix(in srgb, var(--forest) 7%, transparent);
}

.calendar-progress-step.is-reached {
  background: color-mix(in srgb, var(--forest) 38%, transparent);
}

.period-progress-card p {
  margin-top: 0.32rem;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 2.3fr) minmax(280px, 1fr);
  gap: 1.25rem;
}

.day-lists-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
  align-items: start;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal.hidden {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(33, 30, 26, 0.5);
}

.modal-card {
  position: relative;
  z-index: 1;
  width: min(760px, 100%);
  max-height: min(80vh, 760px);
  overflow: auto;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 1rem;
}

.completed-modal-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.completed-modal-card .modal-header,
.completed-modal-card .completed-modal-controls {
  flex: 0 0 auto;
}

.completed-modal-card .modal-header h2 {
  min-width: 0;
  overflow-wrap: anywhere;
}

.completed-modal-card .modal-header .icon-btn {
  flex: 0 0 auto;
}

.completed-modal-card .modal-list {
  min-height: 0;
  max-height: none;
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.day-task-type-card {
  width: min(560px, 100%);
  padding: 1.15rem;
}

.day-task-type-name {
  margin: 0 0 1rem;
  padding: 0.7rem 0.8rem;
  border-radius: 12px;
  background: rgba(239, 215, 203, 0.35);
  color: var(--forest-deep);
  font-weight: 750;
}

.day-task-type-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.day-task-type-option {
  display: grid;
  align-content: start;
  gap: 0.35rem;
  min-height: 8rem;
  padding: 1rem;
  border: 1px solid rgba(49, 93, 58, 0.2);
  border-radius: 16px;
  background: rgba(255, 253, 249, 0.86);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.day-task-type-option.recurring {
  background: rgba(49, 93, 58, 0.09);
}

.day-task-type-option:hover,
.day-task-type-option:focus-visible {
  border-color: rgba(49, 93, 58, 0.52);
  box-shadow: 0 8px 20px rgba(61, 44, 33, 0.09);
}

.day-task-type-option strong {
  color: var(--forest-deep);
  font-size: 1.05rem;
}

.day-task-type-option span {
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.45;
}

.modal-list {
  max-height: 60vh;
  overflow: auto;
}

.completed-section {
  margin-top: 1rem;
}

.main-panel, .side-panel {
  min-width: 0;
}

.panel-card {
  background: rgba(255, 253, 249, 0.7);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 1rem;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.panel-card > h2,
.task-groups > h2 {
  margin-bottom: 0.7rem;
}

.list-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.8rem;
}

.sort-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.16rem;
  padding: 0.2rem;
  border: 1px solid rgba(49, 93, 58, 0.13);
  border-radius: 999px;
  background: rgba(234, 224, 213, 0.55);
  cursor: pointer;
  isolation: isolate;
}

.sort-toggle::before {
  content: '';
  position: absolute;
  z-index: 0;
  top: 0.2rem;
  bottom: 0.2rem;
  left: 0.2rem;
  width: calc(50% - 0.28rem);
  border-radius: 999px;
  background: var(--white);
  box-shadow: 0 2px 8px rgba(61, 44, 33, 0.09);
  transition: transform 240ms cubic-bezier(.22, 1, .36, 1);
}

.sort-toggle.is-time::before {
  transform: translateX(calc(100% + 0.16rem));
}

.sort-toggle:disabled {
  cursor: default;
}

.sort-option {
  position: relative;
  z-index: 1;
  border-radius: 999px;
  padding: 0.34rem 0.58rem;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 750;
  line-height: 1.1;
  transition: color 180ms ease;
}

.sort-toggle:not(.is-time) .sort-option:first-child,
.sort-toggle.is-time .sort-option:last-child {
  color: var(--forest-deep);
}

.available-type-groups,
.available-time-groups {
  display: grid;
  gap: 1rem;
}

.available-home-groups {
  display: grid;
  gap: 1rem;
}

.available-title {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.urgent-task-group .available-type-heading {
  border-bottom-color: rgba(185, 104, 66, 0.42);
}

.urgent-task-group .available-type-heading h3 {
  color: #9a4d2d;
}

.available-type-group,
.available-time-group {
  display: grid;
  gap: 0.55rem;
}

.available-type-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.1rem 0 0.45rem;
  border-bottom: 1px solid rgba(188, 125, 97, 0.28);
}

.available-type-heading h3 {
  color: var(--forest);
  font-size: 0.9rem;
}

.list-progress {
  display: grid;
  width: 100%;
  gap: 0.45rem;
  margin-bottom: 1rem;
  padding: 0.75rem 0.85rem;
  border-radius: 16px;
  background: rgba(255, 253, 251, 0.8);
  border: 1px solid rgba(55, 100, 56, 0.14);
  color: inherit;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(58, 42, 32, 0.07);
}

.sticky-progress {
  position: sticky;
  top: calc(var(--topbar-height, 92px) + 0.5rem);
  z-index: 12;
  backdrop-filter: blur(12px);
}

.list-progress:hover {
  border-color: rgba(55, 100, 56, 0.3);
}

.progress-counts {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  color: var(--muted);
  font-size: 0.78rem;
}

.progress-counts strong {
  color: var(--forest);
  font-size: 1.05rem;
}

.progress-track {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(55, 100, 56, 0.12);
}

.progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #6fa174, var(--forest));
  transition: width 220ms ease;
}

.progress-message {
  color: var(--forest);
  font-size: 0.88rem;
  font-weight: 700;
}

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

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

.closing-groups {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.75rem;
  align-items: start;
}

.closing-groups-by-time {
  grid-template-columns: minmax(0, 1fr);
}

.closing-group {
  padding: 0.9rem;
  align-self: start;
}

.closing-group h3 {
  margin-bottom: 0.7rem;
  color: var(--forest);
}

.closing-time-area-groups {
  display: grid;
  gap: 0.85rem;
}

.opening-groups {
  display: grid;
  gap: 0.9rem;
}

.opening-group {
  display: grid;
  gap: 0.55rem;
  padding: 0.75rem;
  border: 1px solid rgba(49, 93, 58, 0.13);
  border-radius: 18px;
  background: rgba(255, 253, 249, 0.48);
}

.opening-group-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid rgba(188, 125, 97, 0.28);
}

.opening-group-heading h3 {
  color: var(--forest);
  font-size: 0.94rem;
}

.closing-area-block {
  display: grid;
  gap: 0.45rem;
}

.closing-area-block h4 {
  margin: 0;
  color: var(--forest);
  font-size: 0.95rem;
}

.task-groups {
  display: grid;
  gap: 1rem;
}

.group-card {
  background: rgba(255, 253, 249, 0.62);
  border: 1px solid rgba(55, 100, 56, 0.14);
  border-radius: 24px;
  padding: 1rem;
  box-shadow: 0 8px 30px rgba(61, 44, 33, 0.045);
  transition: border-color 200ms ease, box-shadow 200ms ease;
}

.group-card:hover {
  border-color: rgba(49, 93, 58, 0.24);
  box-shadow: 0 12px 34px rgba(61, 44, 33, 0.065);
}

.group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid rgba(198, 139, 112, 0.35);
}

.group-header h3 {
  font-size: 1.05rem;
  text-transform: capitalize;
  color: var(--forest);
}

.group-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
  background: var(--warm);
  color: var(--forest);
  font-size: 0.8rem;
  font-weight: 700;
}

.task-list {
  display: grid;
  gap: 0.75rem;
}

.task-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.4rem;
  align-items: center;
  padding: 0.42rem 0.52rem;
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(238,210,196,0.25), rgba(234,224,211,0.55));
  border: 1px solid rgba(198, 139, 112, 0.35);
  transition: border-color 180ms ease, box-shadow 180ms ease, background-color 180ms ease;
}

.task-item:hover {
  border-color: rgba(188, 125, 97, 0.52);
  box-shadow: 0 5px 16px rgba(61, 44, 33, 0.07);
}

.task-item:has(.task-details) {
  cursor: pointer;
}

.task-item-no-check {
  grid-template-columns: minmax(0, 1fr) auto;
}

.task-swipe-shell {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  background: transparent;
  touch-action: pan-y;
  user-select: none;
}

.task-swipe-action {
  position: absolute;
  inset: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.38rem;
  padding: 0 1.1rem;
  border-radius: 18px;
  background: #3f7948;
  color: var(--white);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  border: 0;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 90ms linear, background-color 160ms ease;
}

.task-swipe-action[data-swipe-complete] {
  inset: 0;
  border-radius: 18px;
}

.task-swipe-action::before {
  content: '✓';
  display: grid;
  width: 1.35rem;
  height: 1.35rem;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 50%;
  font-size: 0.8rem;
}

.task-swipe-action.tomorrow {
  inset: 0;
  justify-content: flex-start;
  border-radius: 18px;
  background: #edc94d;
  color: #57420b;
}

.task-swipe-action.tomorrow::before {
  content: '→';
}

.task-swipe-shell.swipe-left .task-swipe-action[data-swipe-complete],
.task-swipe-shell.swipe-right .task-swipe-action.tomorrow {
  opacity: 1;
  pointer-events: auto;
}

.task-swipe-shell.ready-to-complete.swipe-left .task-swipe-action[data-swipe-complete] {
  background: #326b3c;
}

.task-swipe-shell.ready-to-complete.swipe-right .task-swipe-action.tomorrow {
  background: #e2b928;
}

.task-swipe-content {
  position: relative;
  z-index: 1;
  border-radius: 18px;
  overflow: hidden;
  background: linear-gradient(180deg, #f8eee8, #eee4d8);
  box-shadow: inset 0 0 0 1px rgba(198, 139, 112, 0.35);
  transition: transform 260ms cubic-bezier(.2,.8,.2,1);
  backface-visibility: hidden;
  transform: translate3d(0, 0, 0);
  will-change: transform;
}

.task-item.urgent {
  border-color: rgba(55, 100, 56, 0.6);
  background: linear-gradient(180deg, #eef2e9, #f2e7dc);
}

.task-item.scheduled-tomorrow {
  border-color: rgba(196, 154, 38, 0.48);
  background: linear-gradient(180deg, #fff8d9, #f4e8b6);
  box-shadow: inset 0 0 0 1px rgba(196, 154, 38, 0.18);
}

.closing-complete-card {
  width: min(500px, 100%);
  padding: clamp(1.6rem, 4vw, 2.5rem);
  text-align: center;
}

.door-lock-reminder-card {
  width: min(760px, 100%);
  padding: clamp(0.8rem, 2.5vw, 1.25rem);
  text-align: center;
}

.door-lock-reminder-card h2 {
  margin: 0.15rem 0 0.85rem;
  color: var(--forest-deep);
  font-size: clamp(1.35rem, 4vw, 2rem);
}

.door-lock-reminder-card img {
  display: block;
  width: 100%;
  max-height: min(66vh, 680px);
  object-fit: contain;
  border-radius: 16px;
}

.door-lock-reminder-card .primary-btn {
  min-width: 9rem;
  margin-top: 1rem;
}

.closing-complete-card h2,
.celebration-card h2 {
  color: var(--forest-deep);
  font-size: clamp(2rem, 6vw, 3.15rem);
  line-height: 1;
  letter-spacing: -0.035em;
}

.closing-complete-icon {
  display: grid;
  width: 3rem;
  height: 3rem;
  margin: 0 auto 0.75rem;
  place-items: center;
  border-radius: 50%;
  background: var(--forest);
  color: var(--white);
  font-size: 1.4rem;
  font-weight: 800;
}

.closing-complete-card p {
  margin-top: 0.9rem;
  color: var(--ink);
  font-size: clamp(1.05rem, 2.4vw, 1.25rem);
  font-weight: 650;
  line-height: 1.45;
}

.closing-complete-card ul {
  width: fit-content;
  margin: 0.75rem auto 1.1rem;
  padding-left: 1.25rem;
  color: var(--forest-deep);
  font-weight: 700;
  text-align: left;
  font-size: 1.02rem;
  line-height: 1.65;
}

.celebration-card {
  width: min(540px, 100%);
  padding: clamp(1.8rem, 5vw, 3rem);
  overflow: hidden;
  text-align: center;
}

.celebration-card > p:not(.celebration-kicker) {
  max-width: 28rem;
  margin: 1rem auto 1.4rem;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.55;
}

.celebration-icon {
  display: grid;
  width: 4rem;
  height: 4rem;
  margin: 0 auto 0.8rem;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--forest), #6f9a65);
  box-shadow: 0 10px 24px rgba(55, 100, 56, 0.24);
  color: #fff6c7;
  font-size: 1.8rem;
}

.celebration-kicker {
  margin-bottom: 0.55rem;
  color: var(--cafe);
  font-size: 0.76rem;
  font-weight: 850;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.confetti-layer {
  position: fixed;
  z-index: 70;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.confetti-layer i {
  position: absolute;
  top: -1.2rem;
  left: var(--confetti-x);
  width: 0.62rem;
  height: 1rem;
  border-radius: 2px;
  background: var(--confetti-color);
  animation: confetti-fall var(--confetti-duration) var(--confetti-delay) cubic-bezier(.18,.7,.35,1) forwards;
}

.confetti-layer i:nth-child(3n) { border-radius: 50%; }
.confetti-layer i:nth-child(4n) { width: 0.38rem; height: 1.25rem; }

@keyframes confetti-fall {
  from { transform: translate3d(0, -4vh, 0) rotate(0deg); opacity: 1; }
  to { transform: translate3d(var(--confetti-drift), 108vh, 0) rotate(var(--confetti-rotation)); opacity: 0.92; }
}

.task-check {
  appearance: none;
  border: 2px solid var(--forest);
  width: 22px;
  height: 22px;
  border-radius: 8px;
  background: var(--white);
  display: grid;
  place-items: center;
  cursor: pointer;
}

.task-check:checked {
  background: var(--forest);
  border-color: var(--forest);
}

.task-check:checked::after {
  content: '✓';
  color: var(--white);
  font-size: 0.85rem;
  font-weight: 700;
}

.task-main {
  min-width: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.22rem 0.42rem;
}

.task-item.is-editing {
  background: rgba(255, 253, 251, 0.94);
  border-color: rgba(55, 100, 56, 0.45);
}

.inline-task-input {
  min-width: 0;
  padding: 0.42rem 0.52rem;
  border: 1px solid rgba(55, 100, 56, 0.38);
  border-radius: 10px;
  color: var(--ink);
  font-weight: 700;
}

.task-main h4 {
  font-size: 0.94rem;
  line-height: 1.2;
}

.task-main p {
  margin-top: 0.18rem;
  color: var(--muted);
  font-size: 0.8rem;
}

.task-details {
  margin: 0;
  color: var(--muted);
}

.task-details[open] {
  flex-basis: 100%;
}

.task-details summary {
  cursor: pointer;
  color: var(--forest);
  font-weight: 700;
  font-size: 0.8rem;
}

.task-details p {
  margin-top: 0.25rem;
  padding-left: 0.5rem;
  border-left: 2px solid rgba(55, 100, 56, 0.2);
  font-size: 0.76rem;
  white-space: pre-wrap;
}

.task-checklist summary span {
  margin-left: 0.3rem;
  color: var(--muted);
  font-weight: 650;
}

.checklist-items {
  display: grid;
  gap: 0.08rem;
  margin-top: 0.25rem;
}

.task-checklist-content {
  display: grid;
  grid-template-columns: fit-content(38rem) minmax(7rem, 13rem);
  align-items: start;
  justify-content: start;
  gap: 0.55rem;
  margin-top: 0.25rem;
}

.checklist-reference-image {
  width: 100%;
  max-width: 13rem;
  height: 8.4rem;
  object-fit: cover;
  border: 1px solid rgba(55,100,56,0.2);
  border-radius: 8px;
}

.checklist-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  min-height: 2.25rem;
  padding: 0.24rem 0.38rem;
  border-radius: 7px;
  color: var(--ink);
  border: 0;
  background: transparent;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 550;
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 150ms ease, color 150ms ease;
}

.checklist-item:hover {
  background: rgba(55,100,56,0.08);
}

.checklist-box {
  display: grid;
  width: 1.2rem;
  height: 1.2rem;
  flex: 0 0 auto;
  place-items: center;
  border: 1.5px solid rgba(49, 93, 58, 0.48);
  border-radius: 6px;
  background: rgba(255, 253, 249, 0.95);
  box-shadow: inset 0 1px 2px rgba(61, 44, 33, 0.06);
  transition: border-color 150ms ease, background-color 150ms ease, transform 150ms ease;
}

.checklist-item:active .checklist-box {
  transform: scale(0.94);
}

.checklist-item[aria-checked="true"] .checklist-box {
  border-color: var(--forest);
  background: var(--forest);
  transform: scale(1.03);
}

.checklist-item[aria-checked="true"] .checklist-box::after {
  content: '✓';
  color: var(--white);
  font-size: 0.76rem;
  font-weight: 900;
  line-height: 1;
}

.checklist-item:focus-visible .checklist-box {
  outline: 3px solid rgba(55,100,56,0.24);
  outline-offset: 2px;
}

.checklist-item.is-checked {
  background: rgba(55,100,56,0.055);
}

.checklist-item.is-checked .checklist-text {
  color: var(--muted);
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
}

.checklist-editor {
  display: grid;
  gap: 0.45rem;
  color: var(--forest);
  font-weight: 600;
}

.checklist-editor-items {
  display: grid;
  gap: 0.38rem;
}

.checklist-editor-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(10rem, 0.55fr);
  align-items: start;
  gap: 0.75rem;
}

.checklist-image-editor {
  display: grid;
  gap: 0.45rem;
}

.checklist-image-upload {
  display: grid;
  gap: 0.25rem;
  padding: 0.55rem 0.65rem;
  border: 1px dashed rgba(55,100,56,0.42);
  border-radius: 10px;
  background: rgba(55,100,56,0.04);
  font-size: 0.78rem;
  cursor: pointer;
}

.checklist-image-upload input {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  font-size: 0.72rem;
}

.checklist-image-preview {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 0.4rem;
}

.checklist-image-preview img {
  width: 100%;
  max-height: 8.4rem;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid rgba(55,100,56,0.2);
}

.checklist-editor-row {
  display: grid;
  grid-template-columns: 1.15rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.55rem;
}

.checklist-editor-box {
  width: 1.05rem;
  height: 1.05rem;
  border: 1.5px solid rgba(55,100,56,0.55);
  border-radius: 5px;
  background: var(--white);
}

.checklist-editor-input {
  min-width: 0;
}

.checklist-editor-row .icon-btn {
  padding: 0.42rem 0.55rem;
}

.checklist-add-item {
  justify-self: start;
}

.task-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  flex-wrap: wrap;
  margin: 0;
}

.meta-pill {
  display: inline-block;
  padding: 0.16rem 0.42rem;
  border-radius: 999px;
  font-size: 0.64rem;
  font-weight: 700;
  text-transform: capitalize;
}

.category-pill {
  background: rgba(55,100,56,0.12);
  color: var(--forest);
}

.area-pill {
  display: inline-flex;
  align-items: center;
  margin: 0;
  padding: 0.16rem 0.42rem;
  border-radius: 999px;
  background: rgba(55, 100, 56, 0.12);
  color: var(--forest);
  font-size: 0.68rem;
  font-weight: 800;
}

.period-pill.daily {
  background: #dfe9d8;
  color: #2d5d2a;
}

.period-pill.weekly {
  background: #f0bf75;
  color: #6d3f13;
}

.period-pill.monthly {
  background: #86b7e8;
  color: #1f4f82;
}

.period-pill.yearly {
  background: #c69bd7;
  color: #57326b;
}

.meta-pill.urgent {
  background: rgba(198,139,112,0.2);
  color: var(--forest);
}

.time-pill {
  display: inline-flex;
  align-items: center;
  margin: 0;
  padding: 0.16rem 0.42rem;
  border-radius: 999px;
  background: rgba(198, 139, 112, 0.26);
  color: #71412d;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.admin-item .time-pill {
  margin-top: 0;
}

.task-actions {
  display: flex;
  align-items: center;
  gap: 0.32rem;
}

.icon-btn, .primary-btn, .secondary-btn {
  border: none;
  border-radius: 12px;
  padding: 0.45rem 0.65rem;
  font-weight: 700;
  cursor: pointer;
  line-height: 1.1;
  text-decoration: none;
  transition: transform 160ms ease, filter 160ms ease, box-shadow 160ms ease;
}

.icon-btn:hover, .primary-btn:hover, .secondary-btn:hover {
  transform: translateY(-1px);
  filter: saturate(1.08);
}

.primary-btn:hover {
  box-shadow: 0 6px 16px rgba(35, 71, 45, 0.2);
}

.primary-btn:disabled {
  background: rgba(49, 93, 58, 0.3);
  color: rgba(255, 253, 249, 0.74);
  box-shadow: none;
  cursor: not-allowed;
  filter: none;
  transform: none;
}

:where(a, button, input, textarea, select):focus-visible {
  outline: 3px solid rgba(188, 125, 97, 0.55);
  outline-offset: 3px;
}

.icon-btn {
  background: rgba(55,100,56,0.12);
  color: var(--forest);
}

.primary-btn {
  background: var(--forest);
  color: var(--white);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.danger-btn {
  border: 0;
  border-radius: 12px;
  padding: 0.45rem 0.65rem;
  background: #8e3e35;
  color: var(--white);
  font-weight: 700;
  cursor: pointer;
  margin-left: auto;
}

.secondary-btn {
  background: var(--warm);
  color: var(--forest);
}

.today-empty {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 0.7rem;
}

.today-task-list {
  margin-top: 0.7rem;
}

.quick-day-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.5rem;
  margin-bottom: 0.8rem;
}

.quick-day-combobox {
  position: relative;
  min-width: 0;
}

.quick-day-combobox input[type="search"] {
  padding-inline-end: 2.65rem;
}

.quick-day-combobox input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
}

.search-clear-button {
  position: absolute;
  top: 50%;
  right: 0.42rem;
  display: grid;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  transform: translateY(-50%);
}

.search-clear-button:hover,
.search-clear-button:focus-visible {
  background: rgba(49, 93, 58, 0.1);
  color: var(--forest-deep);
}

.search-clear-button[hidden] {
  display: none;
}

.available-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.55rem;
}

.task-search-combobox {
  width: min(15rem, 42vw);
}

.task-search-combobox input {
  padding: 0.5rem 0.7rem;
}

.completed-search {
  flex: 1 1 auto;
  width: auto;
  margin: 0;
}

.completed-modal-controls {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.9rem;
}

.completed-sort-toggle {
  flex: 0 0 auto;
}

.completed-sort-toggle .sort-option {
  flex: 1 1 50%;
  text-align: center;
}

.panel-card.has-active-suggestions {
  position: relative;
  z-index: 16;
  overflow: visible;
}

.quick-day-form input {
  height: 100%;
  padding: 0.55rem 0.7rem;
}

.quick-day-suggestions {
  position: absolute;
  z-index: 15;
  top: calc(100% + 0.35rem);
  right: 0;
  left: 0;
  display: grid;
  gap: 0.2rem;
  max-height: 15rem;
  overflow: auto;
  padding: 0.3rem;
  border: 1px solid rgba(49, 93, 58, 0.18);
  border-radius: 14px;
  background: rgba(255, 253, 249, 0.98);
  box-shadow: 0 12px 28px rgba(61, 44, 33, 0.14);
}

.task-tutorial-field {
  grid-column: 1 / -1;
  gap: 0.45rem;
}

.task-tutorial-combobox {
  max-width: 34rem;
}

.task-tutorial-selection {
  color: var(--forest);
  font-size: 0.78rem;
  font-weight: 700;
}

.task-tutorial-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  max-width: 34rem;
}

.task-tutorial-actions small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 500;
}

.task-tutorial-button {
  white-space: nowrap;
}

.quick-day-suggestion {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  border: 0;
  border-radius: 10px;
  padding: 0.48rem 0.55rem;
  background: transparent;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 650;
  text-align: left;
  cursor: pointer;
}

.quick-day-suggestion:hover,
.quick-day-suggestion:focus-visible {
  background: rgba(239, 215, 203, 0.58);
}

.one-off-item {
  border-style: dashed;
}

.day-notes-section {
  display: grid;
  gap: 0.7rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.day-notes-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.day-notes-heading h3 {
  margin: 0;
  color: var(--forest-deep);
  font-size: 1rem;
}

.day-note-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 0.5rem;
}

.day-note-form textarea {
  min-height: 4.5rem;
  padding: 0.6rem 0.7rem;
}

.day-note-form .secondary-btn {
  min-height: 44px;
}

.day-note-list {
  display: grid;
  gap: 0.55rem;
}

.day-note-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem;
  border: 1px solid rgba(188, 125, 97, 0.18);
  border-radius: 14px;
  background: rgba(239, 215, 203, 0.28);
}

.day-note-item p {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.day-notes-empty {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}

[hidden] {
  display: none !important;
}

.mini-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.6rem;
}

.mini-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.7rem 0.8rem;
  border-radius: 14px;
  border: 1px solid rgba(55, 100, 56, 0.15);
  background: rgba(234,224,211,0.5);
}

.completed-task-info {
  min-width: 0;
  display: grid;
  gap: 0.18rem;
}

.completed-task-info strong {
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}

.completed-task-info time {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 650;
}

.completed-task-info .meta-pill {
  justify-self: start;
}

.completed-type-groups,
.completed-date-groups {
  display: grid;
  gap: 1rem;
}

.completed-type-section {
  padding: 0.85rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255, 253, 249, 0.5);
}

.completed-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.7rem;
}

.completed-section-heading h3,
.completed-date-section h4 {
  margin: 0;
  color: var(--forest-deep);
}

.completed-date-section h4 {
  margin-bottom: 0.45rem;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
}

.completed-type-section .completed-date-section + .completed-date-section {
  margin-top: 0.8rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--border);
}

.empty-state {
  color: var(--muted);
  font-size: 0.88rem;
}

.admin-shell {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(0, 1.5fr);
  gap: 1rem;
}

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

label,
.form-field {
  display: grid;
  gap: 0.45rem;
  font-weight: 600;
  color: var(--forest);
}

input, textarea, select {
  width: 100%;
  border: 1px solid rgba(55,100,56,0.25);
  border-radius: 12px;
  padding: 0.75rem 0.85rem;
  background: rgba(255,255,255,0.8);
}

textarea {
  resize: vertical;
}

.checkbox-dropdown {
  position: relative;
  min-width: 0;
}

.checkbox-dropdown summary {
  min-height: 49px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid rgba(55,100,56,0.25);
  border-radius: 12px;
  background: rgba(255,255,255,0.8);
  color: var(--ink);
  font-weight: 400;
  cursor: pointer;
  list-style: none;
}

.checkbox-dropdown summary::-webkit-details-marker {
  display: none;
}

.checkbox-dropdown summary::after {
  content: '⌄';
  flex: 0 0 auto;
  color: var(--forest);
  font-weight: 800;
  transition: transform 160ms ease;
}

.checkbox-dropdown[open] summary::after {
  transform: rotate(180deg);
}

.checkbox-dropdown-menu {
  position: absolute;
  z-index: 10;
  top: calc(100% + 0.35rem);
  left: 0;
  right: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.35rem;
  padding: 0.5rem;
  border: 1px solid rgba(55,100,56,0.2);
  border-radius: 14px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.checkbox-dropdown-menu label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.52rem 0.58rem;
  border: 1px solid transparent;
  border-radius: 10px;
  background: rgba(55,100,56,0.04);
  color: var(--ink);
  font-weight: 500;
  cursor: pointer;
}

.checkbox-dropdown-menu label:hover {
  background: rgba(55,100,56,0.1);
}

.checkbox-dropdown-menu label:has(input:checked) {
  border-color: rgba(55,100,56,0.34);
  background: rgba(55,100,56,0.12);
}

.checkbox-dropdown-menu input {
  appearance: none;
  -webkit-appearance: none;
  width: 1.15rem;
  height: 1.15rem;
  margin: 0;
  padding: 0;
  display: grid;
  flex: 0 0 auto;
  place-content: center;
  border: 1.5px solid rgba(55,100,56,0.55);
  border-radius: 5px;
  background: var(--white);
}

.checkbox-dropdown-menu input:checked {
  border-color: var(--forest);
  background: var(--forest);
}

.checkbox-dropdown-menu input:checked::after {
  content: '✓';
  color: var(--white);
  font-size: 0.76rem;
  font-weight: 900;
  line-height: 1;
}

.checkbox-dropdown-menu input:focus-visible {
  outline: 2px solid var(--cafe);
  outline-offset: 2px;
}

.form-panel form {
  display: grid;
  gap: 1rem;
}

.task-form-modal form {
  display: grid;
  gap: 1rem;
}

.form-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.admin-task-list {
  display: grid;
  gap: 0.8rem;
}

.admin-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.75rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid rgba(55,100,56,0.12);
  border-radius: 16px;
  background: rgba(255,255,255,0.5);
}

.admin-item.completed {
  background: rgba(55,100,56,0.08);
}

.admin-category-block {
  margin-top: 0.8rem;
}

.admin-category-block h4 {
  margin-bottom: 0.5rem;
  color: var(--forest);
  text-transform: capitalize;
}

.admin-item h4 {
  margin-bottom: 0.2rem;
}

.admin-item .meta {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.8rem;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
}

.status-pill.done {
  background: rgba(55,100,56,0.12);
  color: var(--forest);
}

.status-pill.open {
  background: rgba(198,139,112,0.18);
  color: var(--cafe);
}

.admin-item .actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

@media (max-width: 1100px) {
  .topbar {
    grid-template-columns: 1fr auto;
  }

  .topbar-start {
    grid-column: 1;
    grid-row: 1;
  }

  .add-item-field {
    grid-column: 2;
    grid-row: 1;
  }

  .nav {
    grid-column: 1 / -1;
    grid-row: 2;
  }
}

@media (max-width: 900px) {
  body {
    background-attachment: scroll;
  }

  .content-grid,
  .admin-shell,
  .dashboard-grid,
  .day-lists-grid {
    grid-template-columns: 1fr;
  }

  .tutorial-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .topbar {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.55rem;
    max-width: 100%;
    overflow: visible;
    padding: calc(0.65rem + env(safe-area-inset-top)) max(0.75rem, env(safe-area-inset-right)) 0.65rem max(0.75rem, env(safe-area-inset-left));
  }

  .topbar-start {
    min-width: 0;
    gap: 0.4rem;
  }

  .brand-logo { width: 72px; }

  .topbar-start { gap: 0.55rem; }

  .season-option {
    padding: 0.34rem 0.5rem;
    font-size: 0.72rem;
  }
  .add-item-field {
    width: auto;
    min-width: 0;
    padding: 0.62rem 0.72rem;
    font-size: 0.82rem;
    white-space: nowrap;
  }

  .nav {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .field-grid {
    grid-template-columns: 1fr;
  }

  input,
  textarea,
  select {
    font-size: 16px;
  }

  .period-progress-card {
    padding: 0.65rem 0.7rem;
  }

  .period-progress-card p {
    font-size: 0.68rem;
  }

  .period-progress-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.6rem;
  }

  .task-item {
    grid-template-columns: auto minmax(0, 1fr);
    padding: 0.45rem 0.55rem;
  }

  .task-item-no-check {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .task-actions {
    justify-content: flex-end;
  }

  .nav {
    display: flex;
    justify-self: stretch;
    gap: 0.2rem;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    padding: 0.28rem;
    border-radius: 999px;
    scroll-padding-inline: 0.4rem;
    -webkit-overflow-scrolling: touch;
  }

  .nav::-webkit-scrollbar { display: none; }

  .nav-link {
    flex: 0 0 auto;
    min-height: 44px;
    display: flex;
    align-items: center;
    padding: 0.52rem 0.7rem;
    font-size: 0.8rem;
    text-align: center;
  }

  .task-checklist-content {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.55rem;
  }

  .checklist-item {
    min-height: 2.75rem;
  }

  .checklist-reference-image {
    max-width: 100%;
    height: auto;
    max-height: 14rem;
  }

  .nav-indicator {
    border-radius: 999px;
  }

  .page-shell {
    padding: 1rem max(0.75rem, env(safe-area-inset-right)) calc(2rem + env(safe-area-inset-bottom)) max(0.75rem, env(safe-area-inset-left));
  }

  .tutorials-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .tutorial-add-button {
    width: 100%;
  }

  .list-title-row,
  .available-controls {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .task-search-combobox {
    width: 100%;
    flex: 1 1 100%;
  }

  .completed-modal-controls {
    align-items: stretch;
    flex-direction: column;
  }

  .completed-search,
  .completed-sort-toggle {
    width: 100%;
  }

  .quick-day-form {
    grid-template-columns: minmax(0, 1fr);
  }

  .quick-day-form .primary-btn,
  .day-note-form .secondary-btn {
    min-height: 44px;
  }

  .day-note-form {
    grid-template-columns: minmax(0, 1fr);
  }

  .checklist-editor-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .modal {
    align-items: flex-end;
    padding: max(0.75rem, env(safe-area-inset-top)) max(0.75rem, env(safe-area-inset-right)) max(0.75rem, env(safe-area-inset-bottom)) max(0.75rem, env(safe-area-inset-left));
  }

  .modal-card {
    max-height: calc(100dvh - 1.5rem - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    border-radius: 20px;
  }

  .completed-modal-card {
    height: calc(100dvh - 1.5rem - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  }

  .completed-modal-card .modal-header h2 {
    font-size: clamp(1.45rem, 7vw, 2rem);
    line-height: 1.08;
  }

  .completed-modal-card .completed-type-section {
    padding: 0.7rem;
  }

  .completed-modal-card .mini-list li {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .completed-modal-card .mini-list .icon-btn {
    align-self: start;
  }

  .day-task-type-options {
    grid-template-columns: minmax(0, 1fr);
  }

  .day-task-type-option {
    min-height: 0;
  }

  .panel-card,
  .group-card {
    border-radius: 18px;
  }

  .tutorial-grid { grid-template-columns: 1fr; }
}

@media (max-width: 420px) {
  .season-option {
    padding: 0.32rem 0.4rem;
    font-size: 0.68rem;
  }

  .brand-logo { width: 64px; }

  .add-item-field {
    display: grid;
    width: 2.7rem;
    height: 2.7rem;
    place-items: center;
    padding: 0;
    font-size: 0;
    text-align: center;
  }

  .add-item-field span {
    margin: 0;
    font-size: 1.15rem;
    line-height: 1;
  }

  .mini-list li {
    align-items: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  .task-swipe-content,
  .nav-indicator,
  .sort-toggle::before {
    transition-duration: 1ms !important;
  }

  .season-switcher::before { transition-duration: 1ms !important; }

  .confetti-layer { display: none; }
}

/* Winter mode */
body[data-season="winter"],
body[data-page="tutorials"] {
  --cafe: #7899b9;
  --warm: #e3edf6;
  --sand: #dce8f2;
  --forest: #3b6482;
  --forest-deep: #244761;
  --ink: #263847;
  --white: #fbfdff;
  --muted: #6e7e8d;
  --border: rgba(59, 100, 130, 0.18);
  --shadow: 0 18px 50px rgba(49, 76, 99, 0.1), 0 2px 8px rgba(49, 76, 99, 0.05);
  --shadow-hover: 0 22px 60px rgba(49, 76, 99, 0.16), 0 4px 12px rgba(49, 76, 99, 0.07);
  background:
    radial-gradient(circle at 8% -6%, rgba(255, 255, 255, 0.95), transparent 24rem),
    radial-gradient(circle at 93% 7%, rgba(177, 205, 226, 0.52), transparent 30rem),
    radial-gradient(circle at 72% 76%, rgba(255, 255, 255, 0.42), transparent 22rem),
    linear-gradient(180deg, #f6faff 0%, var(--sand) 100%);
}

body[data-season="winter"]::before,
body[data-page="tutorials"]::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.38;
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.9) 0 1px, transparent 1.5px);
  background-size: 30px 30px;
  mask-image: linear-gradient(180deg, black, transparent 80%);
}

body[data-season="winter"] .topbar,
body[data-page="tutorials"] .topbar {
  background: rgba(249, 252, 255, 0.82);
  border-bottom-color: rgba(59, 100, 130, 0.14);
}

body[data-season="winter"] .season-switcher,
body[data-page="tutorials"] .nav {
  background: rgba(218, 231, 242, 0.74);
  border-color: rgba(59, 100, 130, 0.2);
}

body[data-page="tutorials"] .tutorials-heading h1,
body[data-page="tutorials"] .tutorial-card-heading h2,
body[data-page="tutorials"] .tutorial-card-copy h3,
body[data-page="tutorials"] .tutorial-empty h2 {
  color: var(--forest-deep);
}

.tutorial-grid {
  align-items: start;
}

.tutorial-card {
  display: grid;
  border-color: rgba(59, 100, 130, 0.18);
  background: rgba(251, 253, 255, 0.9);
  box-shadow: 0 18px 42px rgba(49, 76, 99, 0.11);
}

.tutorial-card:hover {
  box-shadow: 0 22px 48px rgba(49, 76, 99, 0.17);
}

.tutorial-card-heading {
  padding: 1rem 1rem 0.9rem;
}

.tutorial-card-heading h2 {
  color: var(--forest-deep);
  font-size: 1.05rem;
  line-height: 1.35;
}

.tutorial-media-shell {
  position: relative;
  overflow: hidden;
  background: linear-gradient(145deg, #dceaf6, #8facbf);
}

.tutorial-media-stage {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: linear-gradient(145deg, #33546b, #152c3c);
  cursor: zoom-in;
  touch-action: pan-y pinch-zoom;
}

.tutorial-media-stage video,
.tutorial-media-stage img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #142a39;
  -webkit-user-drag: none;
}

.tutorial-media-stage video {
  object-fit: contain;
}

.tutorial-media-stage:fullscreen,
.tutorial-media-stage:-webkit-full-screen {
  width: 100vw;
  height: 100vh;
  background: #0b1721;
}

.tutorial-media-stage:fullscreen video,
.tutorial-media-stage:fullscreen img,
.tutorial-media-stage:-webkit-full-screen video,
.tutorial-media-stage:-webkit-full-screen img {
  object-fit: contain;
}

.tutorial-play-hint {
  background: rgba(25, 56, 76, 0.78);
}

.tutorial-slide-numbers {
  position: absolute;
  left: 0.75rem;
  bottom: 0.7rem;
  display: flex;
  gap: 0.35rem;
  max-width: calc(100% - 5rem);
  overflow-x: auto;
  padding: 0.18rem;
  border-radius: 999px;
  background: rgba(16, 39, 53, 0.58);
  backdrop-filter: blur(10px);
}

.tutorial-slide-number {
  display: grid;
  width: 1.8rem;
  height: 1.8rem;
  flex: 0 0 auto;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 50%;
  background: transparent;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.72rem;
  font-weight: 850;
  cursor: pointer;
}

.tutorial-slide-number.is-active {
  border-color: #fff;
  background: #fff;
  color: var(--forest-deep);
}

.tutorial-slide-counter {
  position: absolute;
  right: 0.75rem;
  bottom: 0.8rem;
  padding: 0.26rem 0.48rem;
  border-radius: 999px;
  background: rgba(16, 39, 53, 0.58);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  backdrop-filter: blur(10px);
}

.tutorial-slide-arrow {
  position: absolute;
  top: 50%;
  display: grid;
  width: 2.25rem;
  height: 2.25rem;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  background: rgba(19, 44, 60, 0.62);
  color: #fff;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  transform: translateY(-50%);
  backdrop-filter: blur(8px);
}

.tutorial-slide-arrow.previous { left: 0.75rem; }
.tutorial-slide-arrow.next { right: 0.75rem; }
.tutorial-slide-arrow:disabled { opacity: 0.25; cursor: default; }

.tutorial-card-copy {
  min-height: 8.2rem;
  align-items: flex-start;
  padding: 1rem 1rem 1.05rem;
}

.tutorial-card-content {
  min-width: 0;
}

.tutorial-card-step {
  display: block;
  margin-top: 0.55rem;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.tutorial-card-copy h2 {
  margin-top: 0.45rem;
  font-size: 1.05rem;
}

.tutorial-card-copy h3 {
  margin-top: 0.25rem;
  font-size: 0.93rem;
}

.tutorial-card-copy p {
  margin-top: 0.25rem;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.5;
  white-space: pre-wrap;
}

.tutorial-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.tutorial-tag {
  padding: 0.18rem 0.48rem;
  border: 1px solid rgba(59, 100, 130, 0.18);
  border-radius: 999px;
  background: #e8f1f8;
  color: var(--forest);
  font-size: 0.65rem;
  font-weight: 800;
}

.tutorial-edit {
  flex: 0 0 auto;
  margin-top: 0.05rem;
  background: #e5eff7;
  color: var(--forest-deep);
}

.tutorial-modal-card {
  width: min(820px, 100%);
  background: rgba(249, 252, 255, 0.98);
}

.tutorial-form {
  gap: 1.1rem;
}

.tutorial-tag-field {
  margin: 0;
  padding: 0;
  border: 0;
}

.tutorial-tag-field legend {
  margin-bottom: 0.45rem;
  color: var(--forest-deep);
  font-weight: 750;
}

.tutorial-tag-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.tutorial-tag-picker label {
  display: inline-flex;
  grid-template-columns: none;
  align-items: center;
  gap: 0.38rem;
  padding: 0.42rem 0.62rem;
  border: 1px solid rgba(59, 100, 130, 0.2);
  border-radius: 999px;
  background: #edf5fa;
  color: var(--forest);
  font-size: 0.78rem;
  cursor: pointer;
}

.tutorial-tag-picker input { width: auto; }

.tutorial-tag-picker label:has(input:checked) {
  border-color: var(--forest);
  background: var(--forest);
  color: #fff;
}

.tutorial-slides-editor {
  display: grid;
  gap: 0.65rem;
}

.tutorial-editor-heading,
.tutorial-slide-editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.tutorial-editor-heading h3 {
  margin-top: 0.12rem;
  color: var(--forest-deep);
}

.tutorial-slide-editor-list {
  display: grid;
  gap: 0.9rem;
}

.tutorial-slide-editor {
  display: grid;
  gap: 0.7rem;
  padding: 0.85rem;
  border: 1px solid rgba(59, 100, 130, 0.18);
  border-radius: 16px;
  background: rgba(227, 237, 246, 0.46);
}

.tutorial-editor-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.1rem;
}

.tutorial-editor-dots {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.tutorial-editor-dot {
  display: grid;
  width: 1.8rem;
  height: 1.8rem;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(59, 100, 130, 0.3);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.72);
  color: var(--forest-deep);
  font-size: 0.75rem;
  font-weight: 800;
  cursor: pointer;
}

.tutorial-editor-dot.is-active,
.tutorial-editor-dot:focus-visible {
  border-color: var(--forest);
  background: var(--forest);
  color: #fff;
}

.tutorial-slide-preview {
  display: grid;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  place-items: center;
  border: 1px solid rgba(59, 100, 130, 0.18);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
}

.tutorial-slide-preview img,
.tutorial-slide-preview video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tutorial-form .tutorial-file-picker {
  position: relative;
  min-height: 44px;
  padding: 0.6rem 0.9rem;
  place-items: center;
  align-content: center;
  border: 1px dashed rgba(55, 100, 56, 0.38);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  text-align: center;
}

.tutorial-file-picker:hover {
  border-color: var(--forest);
}

.tutorial-file-picker:focus-within {
  outline: 2px solid var(--forest);
  outline-offset: 2px;
}

.tutorial-file-picker input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.tutorial-slide-preview[hidden] + .tutorial-file-field .tutorial-file-picker {
  width: 100%;
  aspect-ratio: 4 / 3;
}

.tutorial-file-picker-icon {
  display: none;
}

.tutorial-slide-preview[hidden] + .tutorial-file-field .tutorial-file-picker-icon {
  display: grid;
  width: 2rem;
  height: 2rem;
  place-items: center;
  border: 1px dashed rgba(59, 100, 130, 0.4);
  border-radius: 50%;
  font-size: 1.3rem;
  color: var(--forest);
}

.tutorial-slide-editor-header strong {
  color: var(--forest-deep);
}

.tutorial-slide-editor textarea {
  width: 100%;
  resize: vertical;
}

.tutorial-form small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 500;
}

@media (max-width: 640px) {
  .tutorial-media-stage { aspect-ratio: 4 / 3; }
  .tutorial-card-copy { min-height: 0; }
  .tutorial-editor-heading { align-items: flex-start; }
  .tutorial-editor-heading .secondary-btn { white-space: nowrap; }
}

/* Tutorial detail view: keep the pager below the media and preview the next step. */
.tutorial-media-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.tutorial-media-stage {
  grid-column: 1 / -1;
  grid-row: 1;
}

.tutorial-slide-numbers {
  position: static;
  grid-column: 1;
  grid-row: 2;
  max-width: 100%;
  overflow-x: auto;
  padding: 0.55rem 0.75rem 0.62rem;
  border-radius: 0;
  background: rgba(232, 241, 248, 0.92);
  backdrop-filter: none;
}

.tutorial-slide-number {
  border-color: rgba(59, 100, 130, 0.34);
  background: rgba(255, 255, 255, 0.56);
  color: var(--forest-deep);
}

.tutorial-slide-number.is-active {
  border-color: var(--forest);
  background: var(--forest);
  color: #fff;
}

.tutorial-slide-counter {
  position: static;
  grid-column: 2;
  grid-row: 2;
  align-self: center;
  margin-right: 0.75rem;
  padding: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.72rem;
  backdrop-filter: none;
}

.tutorial-card {
  cursor: pointer;
}

.tutorial-card video {
  cursor: default;
}

.tutorial-detail-card {
  width: min(1120px, 100%);
  max-height: min(88vh, 900px);
  padding: clamp(1rem, 2vw, 1.35rem);
  background: rgba(249, 252, 255, 0.98);
}

.tutorial-detail-heading {
  min-width: 0;
}

.tutorial-detail-heading h2 {
  margin-top: 0.35rem;
  color: var(--forest-deep);
  font-size: clamp(1.2rem, 2.4vw, 1.7rem);
}

.tutorial-detail-tags .tutorial-tags {
  margin: 0;
}

.tutorial-detail-track {
  display: flex;
  gap: 0.9rem;
  overflow-x: auto;
  padding: 0.15rem 0.15rem 0.75rem;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
}

.tutorial-detail-slide {
  position: relative;
  min-width: 0;
  flex: 0 0 72%;
  overflow: hidden;
  border: 1px solid rgba(59, 100, 130, 0.18);
  border-radius: 20px;
  background: #eef5fa;
  scroll-snap-align: start;
}

.tutorial-detail-slide.next {
  flex-basis: 38%;
  cursor: pointer;
}

.tutorial-detail-media {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #152c3c;
}

.tutorial-detail-media video,
.tutorial-detail-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #152c3c;
}

.tutorial-detail-media img {
  object-fit: cover;
}

.tutorial-detail-copy {
  padding: 0.9rem 1rem 1.05rem;
}

.tutorial-detail-step {
  color: var(--forest);
  font-size: 0.7rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tutorial-detail-copy h3 {
  margin-top: 0.28rem;
  color: var(--forest-deep);
  font-size: clamp(1rem, 1.8vw, 1.25rem);
}

.tutorial-detail-copy p {
  margin-top: 0.35rem;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
  white-space: pre-wrap;
}

.tutorial-detail-next-label {
  position: absolute;
  left: 0.65rem;
  bottom: 0.65rem;
  padding: 0.28rem 0.5rem;
  border-radius: 999px;
  background: rgba(18, 43, 59, 0.78);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  backdrop-filter: blur(8px);
}

.tutorial-detail-next-label b {
  display: inline-grid;
  width: 1.2rem;
  height: 1.2rem;
  margin-left: 0.2rem;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 50%;
}

.tutorial-detail-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding-top: 0.25rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

.tutorial-detail-footer > div {
  display: flex;
  gap: 0.45rem;
}

@media (max-width: 640px) {
  .tutorial-detail-slide.active { flex-basis: 88%; }
  .tutorial-detail-slide.next { flex-basis: 64%; }
  .tutorial-detail-footer { align-items: stretch; flex-direction: column; }
  .tutorial-detail-footer > div { width: 100%; }
  .tutorial-detail-footer button { flex: 1 1 0; }
}

/* Carry the winter treatment through the entire task board, not only the shell. */
body[data-season="winter"] .period-progress-card.weekly,
body[data-season="winter"] .period-progress-card.monthly,
body[data-season="winter"] .period-progress-card.yearly {
  --period-progress-color: #5d88a7;
}

body[data-season="winter"] .period-progress-card,
body[data-season="winter"] .completed-cycle-button,
body[data-season="winter"] .group-card,
body[data-season="winter"] .panel-card,
body[data-season="winter"] .opening-group,
body[data-season="winter"] .closing-group,
body[data-season="winter"] .task-swipe-content {
  background: rgba(249, 252, 255, 0.78);
  border-color: rgba(59, 100, 130, 0.19);
  box-shadow: 0 12px 32px rgba(49, 76, 99, 0.07);
}

body[data-season="winter"] .group-header,
body[data-season="winter"] .opening-group-heading {
  border-bottom-color: rgba(111, 154, 184, 0.34);
}

body[data-season="winter"] .task-item {
  background: linear-gradient(180deg, rgba(225, 237, 247, 0.88), rgba(237, 245, 250, 0.94));
  border-color: rgba(111, 154, 184, 0.38);
}

body[data-season="winter"] .task-item:hover {
  border-color: rgba(59, 100, 130, 0.5);
  box-shadow: 0 7px 18px rgba(49, 76, 99, 0.09);
}

body[data-season="winter"] .task-item.urgent {
  border-color: rgba(59, 100, 130, 0.52);
  background: linear-gradient(180deg, #e5f0f8, #f0f6fa);
}

body[data-season="winter"] .task-item.scheduled-tomorrow {
  border-color: rgba(196, 154, 38, 0.46);
  background: linear-gradient(180deg, #f7f4dd, #eef0d8);
}

body[data-season="winter"] .group-badge,
body[data-season="winter"] .completed-cycle-button strong,
body[data-season="winter"] .category-pill,
body[data-season="winter"] .area-pill {
  background: #e2eef6;
  color: var(--forest-deep);
}

body[data-season="winter"] .period-pill.weekly {
  background: #dcebf4;
  color: #3b6482;
}

body[data-season="winter"] .period-pill.monthly {
  background: #d8e9f5;
  color: #315b79;
}

body[data-season="winter"] .period-pill.yearly {
  background: #e2e8f4;
  color: #4f5f80;
}

.tutorial-media-shell {
  background: #e8f1f8;
}

.tutorial-slide-counter {
  min-width: 4.15rem;
  margin-right: 0;
  padding: 0.55rem 0.75rem 0.62rem 0.2rem;
  background: #e8f1f8;
  color: var(--forest-deep);
  text-align: center;
}

/* Winter contrast pass: keep the navigation and compact labels readable across every page. */
body[data-season="winter"] .topbar {
  background: rgba(242, 248, 252, 0.94);
  border-bottom-color: rgba(36, 71, 97, 0.18);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.92), 0 8px 22px rgba(49, 76, 99, 0.06);
}

body[data-season="winter"] .nav {
  background: rgba(207, 225, 238, 0.94);
  border-color: rgba(36, 71, 97, 0.22);
  box-shadow: inset 0 1px 2px rgba(36, 71, 97, 0.1), 0 2px 0 rgba(255, 255, 255, 0.58);
}

body[data-season="winter"] .nav-indicator,
body[data-season="winter"] .nav:not(.nav-ready) .nav-link.active {
  background: #f8fcff;
  box-shadow: 0 4px 14px rgba(36, 71, 97, 0.16), 0 0 0 1px rgba(36, 71, 97, 0.12);
}

body[data-season="winter"] .nav-link {
  color: #355970;
  font-weight: 750;
}

body[data-season="winter"] .nav-link:hover {
  color: #173b55;
}

body[data-season="winter"] .nav-link.active {
  color: #173b55;
}

body[data-season="winter"] label,
body[data-season="winter"] .form-field,
body[data-season="winter"] .tutorial-tag-field legend {
  color: #1f4b67;
}

body[data-season="winter"] .meta-pill,
body[data-season="winter"] .time-pill,
body[data-season="winter"] .status-pill,
body[data-season="winter"] .group-badge,
body[data-season="winter"] .category-pill,
body[data-season="winter"] .area-pill,
body[data-season="winter"] .period-pill {
  border: 1px solid rgba(36, 71, 97, 0.18);
  font-weight: 800;
}

body[data-season="winter"] .group-badge,
body[data-season="winter"] .category-pill,
body[data-season="winter"] .area-pill {
  background: #d1e5f1;
  color: #1d4b67;
}

body[data-season="winter"] .period-pill.daily {
  background: #d9ebe1;
  color: #275b4c;
}

body[data-season="winter"] .period-pill.weekly {
  background: #f4cf72;
  border-color: #c69220;
  color: #5b3a08;
}

body[data-season="winter"] .period-pill.monthly {
  background: #8bc5ee;
  border-color: #3e8fc4;
  color: #123f66;
}

body[data-season="winter"] .period-pill.yearly {
  background: #cda7ec;
  border-color: #8c5ab2;
  color: #4b2868;
}

body[data-season="winter"] .time-pill {
  background: #f2e3c8;
  color: #694b1f;
}

body[data-season="winter"] .meta-pill.urgent,
body[data-season="winter"] .status-pill.open {
  background: #f1d9d7;
  color: #7a3f46;
}

body[data-season="winter"] .status-pill.done {
  background: #d6ebdf;
  color: #275c4d;
}

body[data-season="winter"] .tutorial-tag {
  border-color: rgba(36, 71, 97, 0.28);
  background: #d9eaf4;
  color: #1d4b67;
}

/* iPad-friendly tutorial detail: use a native horizontal carousel. */
.tutorial-detail-track {
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0.15rem 0.15rem 0.75rem;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  overscroll-behavior-x: contain;
  touch-action: pan-y pinch-zoom;
  scrollbar-width: none;
}

.tutorial-detail-copy {
  order: 1;
}

.tutorial-detail-media {
  order: 2;
}

.tutorial-detail-track::-webkit-scrollbar {
  display: none;
}

.tutorial-detail-slide,
.tutorial-detail-slide.active {
  display: flex;
  flex-direction: column;
  min-width: 100%;
  flex: 0 0 100%;
}

/* Give portrait photos and videos a taller canvas so they use the card width naturally. */
.tutorial-media-stage,
.tutorial-detail-media {
  aspect-ratio: 4 / 5;
}

.tutorial-media-stage,
.tutorial-detail-media {
  background: #dceaf5;
}

.tutorial-media-stage img,
.tutorial-detail-media img {
  object-fit: contain;
}

.tutorial-detail-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.1rem;
  min-height: 2.2rem;
  padding: 0.15rem 0;
}

.tutorial-detail-dot {
  width: 1.55rem;
  height: 1.55rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: radial-gradient(circle, #c5ced5 0 0.28rem, transparent 0.31rem);
  cursor: pointer;
}

.tutorial-detail-dot.is-active {
  background: radial-gradient(circle, #536c7c 0 0.32rem, transparent 0.35rem);
}

.tutorial-tag-nav {
  display: flex;
  gap: 0.45rem;
  max-width: 100%;
  margin: -0.45rem 0 1.1rem;
  padding: 0.2rem 0.1rem 0.45rem;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.tutorial-tag-nav::-webkit-scrollbar {
  display: none;
}

.tutorial-filter-tag {
  flex: 0 0 auto;
  padding: 0.52rem 0.82rem;
  border: 1px solid rgba(59, 100, 130, 0.24);
  border-radius: 999px;
  background: rgba(232, 241, 248, 0.82);
  color: #355970;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.tutorial-filter-tag:hover {
  transform: translateY(-1px);
  border-color: rgba(59, 100, 130, 0.4);
  color: #173b55;
}

.tutorial-filter-tag.is-active {
  border-color: #3b6482;
  background: #3b6482;
  color: #fff;
  box-shadow: 0 4px 12px rgba(49, 76, 99, 0.15);
}
