:root {
  color-scheme: light;
  --ink: #202333;
  --muted: #727684;
  --faint: #a1a4ad;
  --paper: #f5f4ef;
  --surface: #fffefa;
  --line: #e4e3dc;
  --line-strong: #d4d3cb;
  --primary: #5367d9;
  --primary-dark: #3f50b8;
  --primary-soft: #e8ebfb;
  --urgent: #d75454;
  --urgent-soft: #fbe9e7;
  --important: #bd8420;
  --important-soft: #fbf1d8;
  --success: #39836e;
  --success-soft: #e1f1eb;
  --shadow: 0 20px 60px rgba(49, 54, 78, 0.09);
  --shadow-small: 0 8px 25px rgba(49, 54, 78, 0.06);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 83% 5%, rgba(83, 103, 217, 0.09), transparent 27rem),
    var(--paper);
}

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

button { color: inherit; }

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(83, 103, 217, 0.2);
  outline-offset: 2px;
}

svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

h1,
h2,
h3,
p { margin-top: 0; }

h1,
h2,
h3 { letter-spacing: -0.035em; }

.is-hidden { display: none !important; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.button,
.icon-button,
.nav-button,
.text-button {
  border: 0;
  cursor: pointer;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 17px;
  border-radius: 13px;
  font-size: 13px;
  font-weight: 750;
  transition: 150ms ease;
}

.button:hover { transform: translateY(-1px); }

.button-primary {
  color: #fff;
  background: var(--primary);
  box-shadow: 0 8px 18px rgba(83, 103, 217, 0.2);
}

.button-primary:hover { background: var(--primary-dark); }

.button-ghost {
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.76);
}

.button-danger {
  color: #b84747;
  background: var(--urgent-soft);
}

.button-wide { width: 100%; }

.icon-button {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.75);
  transition: 150ms ease;
}

.icon-button:hover {
  border-color: #c8c9d4;
  background: #fff;
  transform: translateY(-1px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
  font-size: 19px;
  font-weight: 850;
  letter-spacing: -0.04em;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  color: #fff;
  background: var(--primary);
}

.brand-mark svg { width: 19px; }

.app-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: 235px minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
  min-height: 72px;
  padding: 0 max(24px, calc((100vw - 1440px) / 2));
  border-bottom: 1px solid rgba(60, 63, 79, 0.08);
  background: rgba(245, 244, 239, 0.88);
  backdrop-filter: blur(18px);
}

.primary-nav {
  display: flex;
  justify-content: center;
  gap: 3px;
  min-width: 0;
}

.nav-button {
  position: relative;
  padding: 11px 13px;
  border-radius: 10px;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

.nav-button:hover { color: var(--ink); }

.nav-button.is-active {
  color: var(--primary-dark);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow-small);
}

.nav-count {
  display: inline-grid;
  min-width: 18px;
  height: 18px;
  margin-left: 4px;
  padding: 0 5px;
  place-items: center;
  border-radius: 99px;
  color: var(--muted);
  background: #e8e7e1;
  font-size: 9px;
}

.nav-button.is-active .nav-count {
  color: #fff;
  background: var(--primary);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.avatar-button {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  color: var(--primary-dark);
  background: var(--primary-soft);
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
}

.app-layout {
  display: grid;
  grid-template-columns: 235px minmax(0, 1fr);
  gap: 28px;
  width: min(1392px, calc(100% - 48px));
  margin: 0 auto;
  padding: 34px 0 100px;
}

.sidebar {
  position: sticky;
  top: 105px;
  align-self: start;
  display: grid;
  gap: 22px;
  max-height: calc(100vh - 130px);
  overflow: auto;
  padding: 4px 8px 20px 0;
}

.sidebar-section { display: grid; gap: 7px; }

.sidebar-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 7px;
}

.sidebar-heading h2 {
  margin: 0;
  color: var(--faint);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.sidebar-add {
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  font-size: 18px;
  cursor: pointer;
}

.sidebar-add:hover { color: var(--primary); background: var(--primary-soft); }

.filter-button {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 37px;
  padding: 7px 9px;
  border: 0;
  border-radius: 10px;
  color: var(--muted);
  background: transparent;
  text-align: left;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}

.filter-button:hover { color: var(--ink); background: rgba(255, 255, 255, 0.55); }

.filter-button.is-active {
  color: var(--primary-dark);
  background: var(--primary-soft);
}

.filter-dot {
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--filter-color, var(--faint));
}

.filter-button > span:nth-child(2) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.filter-button small {
  margin-left: auto;
  color: var(--faint);
  font-size: 9px;
}

.content { min-width: 0; }

.content-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin: 0 0 24px;
}

.content-header h1 {
  margin: 0;
  font-size: clamp(36px, 5vw, 62px);
  line-height: 0.98;
}

.content-header p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.content-summary {
  display: flex;
  align-items: baseline;
  gap: 7px;
  color: var(--muted);
  white-space: nowrap;
}

.content-summary strong {
  color: var(--ink);
  font-size: 28px;
}

.quick-add {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin-bottom: 17px;
  padding: 10px 10px 10px 17px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 254, 250, 0.92);
  box-shadow: var(--shadow-small);
}

.quick-add > svg { color: var(--primary); }

.quick-add input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-size: 14px;
}

.quick-add input::placeholder { color: var(--faint); }

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 13px;
}

.search-field {
  position: relative;
  display: flex;
  align-items: center;
  width: min(300px, 100%);
}

.search-field svg {
  position: absolute;
  left: 12px;
  width: 17px;
  color: var(--faint);
  pointer-events: none;
}

.search-field input {
  width: 100%;
  height: 39px;
  padding: 0 13px 0 37px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.58);
  font-size: 12px;
}

.clear-filters {
  padding: 8px;
  color: var(--primary);
  background: transparent;
  font-size: 11px;
  font-weight: 750;
}

.task-list {
  display: grid;
  gap: 9px;
}

.task-card {
  --task-color: var(--primary);
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 76px;
  padding: 14px 14px 14px 17px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 254, 250, 0.88);
  box-shadow: 0 5px 18px rgba(49, 54, 78, 0.035);
  transition: 150ms ease;
}

.task-card::before {
  position: absolute;
  top: 15px;
  bottom: 15px;
  left: -1px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--task-color);
  content: "";
  opacity: 0.7;
}

.task-card:hover {
  border-color: #d4d5df;
  box-shadow: var(--shadow-small);
  transform: translateY(-1px);
}

.task-card.is-completed { opacity: 0.68; }

.task-card.is-completed .task-title { text-decoration: line-through; }

.task-check {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1.5px solid color-mix(in srgb, var(--task-color) 48%, var(--line-strong));
  border-radius: 50%;
  color: #fff;
  background: transparent;
  cursor: pointer;
}

.task-check:hover { background: color-mix(in srgb, var(--task-color) 12%, white); }

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

.task-check svg { width: 16px; opacity: 0; }
.task-check.is-checked svg { opacity: 1; }

.task-main {
  min-width: 0;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.task-title {
  display: block;
  overflow: hidden;
  font-size: 14px;
  font-weight: 760;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 7px;
}

.meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 21px;
  padding: 2px 7px;
  border-radius: 7px;
  color: var(--chip-color, var(--muted));
  background: color-mix(in srgb, var(--chip-color, #8a8f98) 10%, white);
  font-size: 9px;
  font-weight: 750;
  white-space: nowrap;
}

.meta-chip.is-urgent { --chip-color: var(--urgent); }
.meta-chip.is-important { --chip-color: var(--important); }
.meta-chip.is-overdue { --chip-color: var(--urgent); }

.meta-chip svg { width: 11px; height: 11px; }

.task-notes-preview {
  display: block;
  overflow: hidden;
  max-width: 700px;
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.week-planner {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.weekly-pool {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 254, 250, 0.82);
  box-shadow: var(--shadow-small);
  transition: 150ms ease;
}

.weekly-pool-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 14px;
}

.weekly-pool-header h2 {
  margin: 2px 0 3px;
  font-size: 22px;
}

.weekly-pool-header p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.planner-eyebrow {
  color: var(--primary);
  font-size: 8px;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.planner-count {
  display: grid;
  min-width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 11px;
  color: var(--primary-dark);
  background: var(--primary-soft);
  font-size: 13px;
  font-weight: 850;
}

.weekly-pool-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(245px, 1fr));
  gap: 8px;
}

.planner-instruction {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 32px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.planner-instruction svg {
  width: 15px;
  height: 15px;
}

.planner-mobile-instruction { display: none; }

.week-day-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(126px, 1fr));
  gap: 8px;
  min-width: 0;
  padding-bottom: 6px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.week-day {
  min-height: 315px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.4);
  transition: 150ms ease;
}

.week-day.is-today {
  border-color: color-mix(in srgb, var(--primary) 35%, var(--line));
  background: color-mix(in srgb, var(--primary-soft) 52%, white);
}

.week-day-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-height: 43px;
  margin-bottom: 8px;
  padding: 0 2px 7px;
  border-bottom: 1px solid var(--line);
}

.week-day-header > div {
  display: flex;
  align-items: baseline;
  gap: 5px;
}

.week-day-header span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.week-day-header strong { font-size: 19px; }

.week-day-header button {
  display: grid;
  width: 27px;
  height: 27px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 9px;
  color: var(--primary);
  background: transparent;
  cursor: pointer;
}

.week-day-header button:hover { background: var(--primary-soft); }
.week-day-header svg { width: 15px; height: 15px; }

.week-day-tasks {
  display: grid;
  align-content: start;
  gap: 7px;
  min-height: 245px;
}

.planner-card {
  --task-color: var(--primary);
  position: relative;
  display: grid;
  grid-template-columns: 19px 25px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  min-width: 0;
  padding: 9px;
  border: 1px solid var(--line);
  border-left: 3px solid color-mix(in srgb, var(--task-color) 72%, white);
  border-radius: 13px;
  background: var(--surface);
  box-shadow: 0 4px 12px rgba(49, 54, 78, 0.045);
  transition: 150ms ease;
}

.planner-card:hover {
  border-color: color-mix(in srgb, var(--task-color) 30%, var(--line));
  border-left-color: var(--task-color);
  box-shadow: var(--shadow-small);
}

.planner-card.is-dragging,
.planner-card.is-moving {
  opacity: 0.42;
  transform: scale(0.98);
}

.planner-grip,
.planner-more,
.planner-task-main {
  min-width: 0;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
}

.planner-grip {
  display: grid;
  width: 19px;
  height: 30px;
  place-items: center;
  color: var(--faint);
  cursor: grab;
  touch-action: none;
}

.planner-grip:active { cursor: grabbing; }
.planner-grip svg { width: 16px; height: 16px; }
.planner-card .task-check { width: 25px; height: 25px; }
.planner-card .task-check svg { width: 14px; }

.planner-task-main {
  display: block;
  text-align: left;
  cursor: pointer;
}

.planner-task-title {
  display: block;
  overflow: hidden;
  font-size: 11px;
  font-weight: 780;
  line-height: 1.3;
  text-overflow: ellipsis;
}

.planner-task-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 5px;
  color: var(--muted);
  font-size: 7px;
  font-weight: 700;
}

.planner-task-meta > span {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  min-width: 0;
}

.planner-task-meta svg { width: 9px; height: 9px; }

.planner-category::before {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--planner-category);
  content: "";
}

.planner-priority {
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
}

.planner-priority.is-urgent { color: var(--urgent); background: var(--urgent-soft); }
.planner-priority.is-important { color: var(--important); background: var(--important-soft); }
.planner-more { display: none; }

.planner-mobile-move { display: none; }

.planner-drop-empty,
.day-drop-empty {
  display: grid;
  place-items: center;
  min-height: 68px;
  padding: 12px;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  color: var(--faint);
  text-align: center;
}

.planner-drop-empty strong { color: var(--muted); font-size: 11px; }
.planner-drop-empty span { margin-top: 3px; font-size: 9px; }
.day-drop-empty { min-height: 78px; font-size: 9px; font-weight: 700; }

.planner-drop-zone.is-drag-over {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary-soft) 68%, white);
  box-shadow: inset 0 0 0 1px var(--primary);
}

.empty-state {
  display: grid;
  justify-items: center;
  min-height: 330px;
  padding: 55px 24px;
  border: 1px dashed var(--line-strong);
  border-radius: 22px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.35);
  text-align: center;
}

.empty-icon {
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  margin-bottom: 18px;
  border-radius: 18px;
  color: var(--primary);
  background: var(--primary-soft);
}

.empty-icon svg { width: 28px; height: 28px; }

.empty-state h2 {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 22px;
}

.empty-state p {
  max-width: 420px;
  margin: 0 0 18px;
  font-size: 12px;
  line-height: 1.6;
}

.auth-shell,
.setup-shell,
.loading-shell {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 34px 20px;
}

.auth-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(370px, 0.75fr);
  align-items: center;
  gap: clamp(50px, 8vw, 120px);
  width: min(1080px, 100%);
  min-width: 0;
}

.auth-intro,
.auth-card { min-width: 0; }

.auth-intro h1 {
  max-width: 670px;
  margin-bottom: 22px;
  font-size: clamp(54px, 7vw, 86px);
  line-height: 0.94;
}

.auth-intro > p {
  max-width: 530px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
}

.auth-features {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 28px;
}

.auth-features span {
  padding: 8px 11px;
  border-radius: 99px;
  color: var(--primary-dark);
  background: var(--primary-soft);
  font-size: 10px;
  font-weight: 750;
}

.auth-card,
.setup-card,
.loading-card {
  width: 100%;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 25px;
  background: rgba(255, 254, 250, 0.92);
  box-shadow: var(--shadow);
}

.auth-card .brand { margin-bottom: 44px; }

.auth-card h2,
.setup-card h1 {
  margin-bottom: 10px;
  font-size: 30px;
}

.auth-card > p,
.setup-card > p,
.loading-card p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.setup-card,
.loading-card {
  max-width: 620px;
  text-align: center;
}

.setup-icon,
.loading-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin: 0 auto 20px;
  border-radius: 18px;
  color: var(--primary);
  background: var(--primary-soft);
}

.setup-card code {
  display: block;
  margin: 20px 0;
  padding: 13px;
  border-radius: 11px;
  color: var(--primary-dark);
  background: var(--primary-soft);
  font-size: 11px;
  overflow-wrap: anywhere;
}

.loading-icon svg { animation: spin 900ms linear infinite; }

@keyframes spin { to { transform: rotate(360deg); } }

.field {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.field > span,
.choice-field legend {
  color: #5f6370;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.field > span i {
  color: var(--faint);
  font-style: normal;
  font-weight: 600;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-width: 0;
  min-height: 46px;
  padding: 11px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  color: var(--ink);
  background: #fff;
  outline: 0;
}

.field textarea {
  min-height: 86px;
  resize: vertical;
  line-height: 1.5;
}

.field input:focus,
.field select:focus,
.field textarea:focus { border-color: var(--primary); }

.field-wide { margin-bottom: 17px; }

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
  margin-bottom: 17px;
}

.choice-field {
  min-width: 0;
  margin: 0 0 17px;
  padding: 0;
  border: 0;
}

.choice-field legend { margin-bottom: 8px; }

.segmented-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 4px;
  border-radius: 13px;
  background: #ecebe6;
}

.segmented-options label { cursor: pointer; }
.segmented-options input { position: absolute; opacity: 0; pointer-events: none; }

.segmented-options span {
  display: grid;
  min-height: 38px;
  place-items: center;
  border-radius: 9px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.segmented-options input:checked + span {
  color: var(--primary-dark);
  background: #fff;
  box-shadow: 0 3px 10px rgba(49, 54, 78, 0.08);
}

.toggle-field {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.65);
  cursor: pointer;
}

.toggle-field input {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

.toggle-field span,
.toggle-field strong,
.toggle-field small { display: block; }

.toggle-field strong { font-size: 11px; }
.toggle-field small { margin-top: 2px; color: var(--muted); font-size: 8px; }
.toggle-field.is-disabled { opacity: 0.5; pointer-events: none; }

.tag-options {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.tag-option { cursor: pointer; }
.tag-option input { position: absolute; opacity: 0; pointer-events: none; }

.tag-option span {
  display: inline-flex;
  align-items: center;
  min-height: 31px;
  padding: 5px 10px;
  border: 1px solid color-mix(in srgb, var(--tag-color) 25%, var(--line));
  border-radius: 99px;
  color: var(--tag-color);
  background: color-mix(in srgb, var(--tag-color) 7%, white);
  font-size: 10px;
  font-weight: 750;
}

.tag-option input:checked + span {
  color: #fff;
  border-color: var(--tag-color);
  background: var(--tag-color);
}

.dialog {
  width: min(610px, calc(100% - 28px));
  max-height: calc(100vh - 30px);
  padding: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 24px;
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 35px 100px rgba(35, 39, 58, 0.25);
}

.dialog::backdrop {
  background: rgba(31, 34, 48, 0.38);
  backdrop-filter: blur(6px);
}

.dialog form { padding: 27px; }
.dialog-small { width: min(440px, calc(100% - 28px)); }

.dialog-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.dialog-heading h2 { margin: 0; font-size: 28px; }

.dialog-actions {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 9px;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.toast {
  position: fixed;
  z-index: 100;
  right: 20px;
  bottom: 20px;
  max-width: min(390px, calc(100% - 40px));
  padding: 13px 16px;
  border-radius: 13px;
  color: #fff;
  background: #252938;
  box-shadow: 0 18px 50px rgba(31, 34, 48, 0.24);
  font-size: 12px;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: 180ms ease;
}

.toast.is-visible { opacity: 1; transform: translateY(0); }

@media (max-width: 1050px) {
  .app-header { grid-template-columns: auto minmax(0, 1fr) auto; }
  .app-layout { grid-template-columns: 190px minmax(0, 1fr); }
  .primary-nav { justify-content: flex-start; overflow-x: auto; }
  .auth-layout { grid-template-columns: 1fr; max-width: 680px; }
  .auth-intro { text-align: center; }
  .auth-intro > p { margin-right: auto; margin-left: auto; }
  .auth-features { justify-content: center; }
}

@media (max-width: 760px) {
  .app-header {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    min-height: 64px;
    padding: 0 14px;
    backdrop-filter: none;
  }

  .app-header .brand { font-size: 17px; }
  .app-header .brand-mark { width: 31px; height: 31px; }

  .primary-nav {
    position: fixed;
    z-index: 35;
    right: 0;
    bottom: 0;
    left: 0;
    justify-content: flex-start;
    gap: 1px;
    padding: 7px 10px calc(7px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: rgba(255, 254, 250, 0.94);
    box-shadow: 0 -10px 35px rgba(49, 54, 78, 0.08);
    backdrop-filter: blur(18px);
  }

  .nav-button { flex: 1 0 auto; min-width: 74px; padding: 9px 8px; }
  .header-actions .button { width: 40px; padding: 0; border-radius: 50%; font-size: 0; }
  .header-actions .button svg { margin: 0; }

  .app-layout {
    display: block;
    width: calc(100% - 24px);
    padding: 25px 0 105px;
  }

  .sidebar {
    position: static;
    display: flex;
    gap: 7px;
    max-height: none;
    margin-bottom: 20px;
    padding: 0 0 4px;
    overflow-x: auto;
  }

  .sidebar-section { display: flex; gap: 6px; }
  .sidebar-heading { display: none; }
  .sidebar-section:last-child { padding-right: 8px; }

  .filter-button {
    flex: 0 0 auto;
    width: auto;
    min-height: 34px;
    padding: 6px 10px;
    border: 1px solid var(--line);
    border-radius: 99px;
    background: rgba(255, 255, 255, 0.58);
  }

  .filter-button small { display: none; }
  .content-header h1 { font-size: 42px; }
  .quick-add { grid-template-columns: auto minmax(0, 1fr) auto; }
  .quick-add .button { width: 40px; padding: 0; font-size: 0; }

  .weekly-pool { padding: 15px; }
  .weekly-pool-list { grid-template-columns: 1fr; }
  .planner-instruction { justify-content: flex-start; padding-left: 4px; }
  .planner-instruction svg,
  .planner-desktop-instruction { display: none; }
  .planner-mobile-instruction { display: inline; }
  .week-day-grid {
    grid-template-columns: repeat(7, min(78vw, 310px));
    margin-right: -12px;
    padding-right: 12px;
    scroll-snap-type: x proximity;
  }
  .week-day { min-height: 350px; scroll-snap-align: start; }
  .week-day-tasks { min-height: 275px; }
  .planner-card { grid-template-columns: 25px minmax(0, 1fr); padding: 10px; }
  .planner-grip { display: none; }
  .planner-task-title { font-size: 12px; }
  .planner-task-meta { font-size: 8px; }
  .planner-mobile-move {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    margin-top: 3px;
    padding-top: 7px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 8px;
    font-weight: 750;
  }
  .planner-mobile-move select {
    width: 100%;
    min-width: 0;
    height: 32px;
    padding: 0 8px;
    border: 1px solid var(--line);
    border-radius: 9px;
    color: var(--ink);
    background: #fff;
    font-size: 10px;
  }
}

@media (max-width: 560px) {
  .content-header { align-items: flex-start; }
  .content-summary { display: none; }
  .content-header h1 { font-size: 38px; }
  .content-header p { font-size: 11px; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .search-field { width: 100%; }
  .clear-filters { align-self: flex-end; }
  .task-card { grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; padding: 13px 9px 13px 13px; }
  .task-title { font-size: 13px; }
  .task-notes-preview { max-width: 58vw; }
  .auth-shell { padding: 24px 12px; }
  .auth-layout { gap: 30px; width: 100%; }
  .auth-intro { width: 100%; }
  .auth-intro h1 { max-width: 100%; font-size: clamp(41px, 12vw, 48px); overflow-wrap: anywhere; }
  .auth-intro > p { font-size: 13px; }
  .auth-features { justify-content: center; margin-top: 20px; }
  .auth-card { max-width: 100%; padding: 23px 19px; }
  .auth-card .brand { margin-bottom: 32px; }
  .auth-card h2 { font-size: 27px; }
  .dialog form { padding: 22px 17px; }
  .dialog-heading h2 { font-size: 25px; }
  .form-grid { grid-template-columns: 1fr; }
  .dialog-actions { grid-template-columns: 1fr 1fr; }
  .dialog-actions > span { display: none; }
  .dialog-actions .button-danger { grid-column: 1 / -1; }
  .dialog-actions .button-primary,
  .dialog-actions .button-ghost { width: 100%; }
  .toast { right: 12px; bottom: 82px; max-width: calc(100% - 24px); }
}
