:root {
  --bg: #f5f6f8;
  --panel: #ffffff;
  --ink: #20242c;
  --muted: #737b88;
  --line: #e5e8ed;
  --soft: #eef1f5;
  --accent: #222b45;
  --accent-soft: #e9ecf5;
  --danger: #a43c3c;
  --today: #f8f5e9;
  --shadow: 0 10px 28px rgba(29, 38, 58, 0.06);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  min-width: 320px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(255,255,255,.9), transparent 28rem),
    var(--bg);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(1540px, calc(100% - 36px));
  margin: 0 auto;
  padding: 34px 0 42px;
}

.topbar,
.section-heading,
.summary-strip,
.task-form,
.quick-form,
footer {
  display: flex;
  align-items: center;
}

.topbar {
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(2rem, 4vw, 3.45rem);
  line-height: .98;
  letter-spacing: -0.055em;
  font-weight: 760;
}

h2 {
  font-size: 1.08rem;
  letter-spacing: -0.02em;
}

.eyebrow {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: .7rem;
  letter-spacing: .13em;
  font-weight: 800;
}

.week-range {
  color: var(--muted);
  margin-top: 10px;
  font-weight: 600;
}

.week-nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

button {
  border: 0;
}

.ghost-btn,
.primary-btn,
.small-btn {
  border-radius: 999px;
  padding: 10px 15px;
  font-weight: 720;
}

.ghost-btn {
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--line);
}

.primary-btn,
.small-btn {
  background: var(--accent);
  color: #fff;
}

.small-btn {
  padding: 9px 13px;
  white-space: nowrap;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.goals-card {
  padding: 18px;
  margin-bottom: 14px;
}

.section-heading {
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 13px;
}

.muted {
  color: var(--muted);
  font-size: .78rem;
}

.goal-list {
  display: grid;
  gap: 8px;
}

.goal-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 9px;
  padding: 9px 11px;
  border-radius: 12px;
  background: #f9fafb;
  border: 1px solid var(--line);
}

.goal-row input {
  border: 0;
  background: transparent;
  width: 100%;
  outline: 0;
  color: var(--ink);
}

.goal-star {
  font-size: 1rem;
}

.icon-btn {
  background: transparent;
  color: var(--muted);
  font-size: 1.1rem;
  padding: 0 4px;
}

.quick-form {
  gap: 9px;
  margin-top: 11px;
}

.quick-form input,
.task-form input,
.task-form select {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 11px;
  background: #fff;
  outline: none;
  color: var(--ink);
}

.quick-form input:focus,
.task-form input:focus,
.task-form select:focus {
  border-color: #b6bdca;
  box-shadow: 0 0 0 3px rgba(34,43,69,.07);
}

.quick-form input {
  flex: 1;
}

.summary-strip {
  min-height: 58px;
  gap: 16px;
  padding: 0 6px;
  margin: 4px 0 14px;
}

.summary-item {
  display: flex;
  flex-direction: column;
  min-width: 112px;
}

.summary-label {
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--muted);
  font-weight: 760;
}

.progress-track {
  height: 8px;
  flex: 1;
  border-radius: 999px;
  background: #e2e5ea;
  overflow: hidden;
}

.progress-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width .2s ease;
}

.summary-percent {
  min-width: auto;
}

.week-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(190px, 1fr));
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 5px;
}

.day-column {
  min-height: 475px;
  display: flex;
  flex-direction: column;
  padding: 13px;
  background: rgba(255,255,255,.88);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 8px 22px rgba(29,38,58,.045);
}

.day-column.today {
  background: var(--today);
  border-color: #ddd5b8;
}

.day-column.drag-over,
.unscheduled.drag-over {
  outline: 2px dashed #7f899c;
  outline-offset: -4px;
}

.day-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 10px;
  padding: 3px 2px 12px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 10px;
}

.day-name {
  text-transform: uppercase;
  font-size: .76rem;
  letter-spacing: .08em;
  font-weight: 830;
}

.day-date {
  color: var(--muted);
  font-size: .75rem;
  margin-top: 4px;
}

.workload {
  color: var(--muted);
  font-size: .72rem;
  white-space: nowrap;
}

.workload.overloaded {
  color: var(--danger);
  font-weight: 800;
}

.task-list {
  display: grid;
  gap: 7px;
  align-content: start;
}

.day-column .task-list {
  flex: 1;
  min-height: 96px;
}

.task-card {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: start;
  gap: 7px;
  padding: 9px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 11px;
  transition: transform .12s ease, box-shadow .12s ease, opacity .12s ease;
}

.task-card:hover {
  box-shadow: 0 6px 16px rgba(29,38,58,.07);
}

.task-card.dragging {
  opacity: .48;
  transform: rotate(1deg);
}

.task-card.completed {
  opacity: .58;
}

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

.check-btn {
  width: 17px;
  height: 17px;
  margin-top: 2px;
  border: 1.5px solid #aab1be;
  border-radius: 5px;
  background: transparent;
  position: relative;
  flex: 0 0 auto;
}

.completed .check-btn {
  background: var(--accent);
  border-color: var(--accent);
}

.completed .check-btn::after {
  content: "✓";
  position: absolute;
  inset: -2px 0 0;
  color: white;
  font-size: .72rem;
  text-align: center;
  line-height: 17px;
}

.task-content {
  min-width: 0;
}

.task-title {
  width: 100%;
  border: 0;
  outline: 0;
  padding: 0;
  color: var(--ink);
  background: transparent;
  font-size: .87rem;
  line-height: 1.28;
  font-weight: 620;
}

.task-meta {
  color: var(--muted);
  font-size: .69rem;
  margin-top: 5px;
}

.star-btn,
.delete-btn {
  padding: 0 2px;
  background: transparent;
  color: #89909d;
  font-size: 1rem;
  line-height: 1;
}

.star-btn.important {
  color: #78641a;
}

.delete-btn:hover {
  color: var(--danger);
}

.task-form {
  gap: 6px;
  margin-top: 10px;
}

.task-form input {
  flex: 1 1 auto;
  width: 100%;
}

.task-form select {
  width: 86px;
  color: var(--muted);
  font-size: .76rem;
}

.day-column .task-form {
  display: grid;
  grid-template-columns: 1fr auto;
}

.day-column .task-form select {
  width: 100%;
  grid-column: 1 / -1;
}

.unscheduled {
  margin-top: 14px;
  padding: 18px;
}

.unscheduled .task-list {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.unscheduled .task-form {
  max-width: 780px;
}

.empty-hint {
  color: var(--muted);
  font-size: .78rem;
  padding: 8px 2px 12px;
}

footer {
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  font-size: .77rem;
  padding: 22px 4px 0;
}

.text-btn {
  background: transparent;
  color: var(--muted);
  padding: 4px 0;
}

.text-btn.danger:hover {
  color: var(--danger);
}

@media (max-width: 900px) {
  .app-shell {
    width: min(100% - 22px, 1540px);
    padding-top: 20px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .week-nav {
    justify-content: flex-start;
  }

  .week-grid {
    grid-template-columns: repeat(7, minmax(260px, 78vw));
    scroll-snap-type: x proximity;
  }

  .day-column {
    scroll-snap-align: start;
  }

  .muted {
    display: none;
  }
}

@media (max-width: 560px) {
  .week-nav {
    width: 100%;
  }

  .week-nav button {
    flex: 1;
  }

  .summary-strip {
    gap: 9px;
  }

  .quick-form,
  .unscheduled .task-form {
    align-items: stretch;
    flex-direction: column;
  }

  .unscheduled .task-form select {
    width: 100%;
  }

  .unscheduled .task-list {
    grid-template-columns: 1fr;
  }
}

.hidden { display: none !important; }

.auth-gate {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 28px;
  background: radial-gradient(circle at top left, rgba(255,255,255,.95), transparent 34rem), var(--bg);
}

.login-card {
  width: min(100%, 460px);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 34px;
  box-shadow: var(--shadow);
}

.login-card h1 { font-size: clamp(2.2rem, 7vw, 3.5rem); }
.login-copy { margin: 18px 0 24px; color: var(--muted); line-height: 1.55; }
.google-btn { width: 100%; min-height: 48px; border-radius: 12px; border: 1px solid var(--line); background: #fff; color: var(--ink); font-weight: 760; display: inline-flex; align-items: center; justify-content: center; gap: 11px; }
.google-btn:hover { background: #f9fafb; }
.google-g { width: 25px; height: 25px; display: inline-grid; place-items: center; border-radius: 50%; border: 1px solid var(--line); font-weight: 900; font-family: Arial, sans-serif; }
.auth-message { min-height: 20px; margin-top: 14px; color: var(--danger); font-size: .8rem; line-height: 1.4; }
.top-actions { display: flex; align-items: center; justify-content: flex-end; gap: 14px; flex-wrap: wrap; }
.account-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 9px; max-width: 370px; padding: 7px 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 999px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.account-copy { min-width: 0; display: flex; flex-direction: column; }
.account-copy strong, .account-copy span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-copy strong { font-size: .76rem; }
.account-copy span { max-width: 190px; color: var(--muted); font-size: .68rem; }
.sync-row { min-height: 26px; display: flex; align-items: center; justify-content: flex-end; gap: 7px; color: var(--muted); font-size: .72rem; margin: -8px 5px 8px; }
.sync-dot { width: 7px; height: 7px; border-radius: 50%; background: #a6adb8; }
.sync-row.saving .sync-dot { background: #9c7b24; }
.sync-row.saved .sync-dot { background: #4d7a59; }
.sync-row.error .sync-dot { background: var(--danger); }

@media (max-width: 900px) {
  .top-actions { width: 100%; justify-content: flex-start; }
  .account-card { max-width: 100%; }
  .sync-row { justify-content: flex-start; }
}

@media (max-width: 560px) {
  .auth-gate { padding: 16px; }
  .login-card { padding: 25px 20px; }
  .top-actions { align-items: stretch; flex-direction: column; }
  .account-card { border-radius: 14px; }
}


/* V1.2: categories, scheduled time and global timezone */
.view-toolbar {
  display: grid;
  grid-template-columns: minmax(250px, 1.4fr) minmax(190px, .8fr) auto;
  align-items: end;
  gap: 14px;
  padding: 14px 16px;
  margin-bottom: 14px;
}

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

.toolbar-field label {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  font-weight: 800;
}

.toolbar-field select {
  width: 100%;
  min-width: 0;
  min-height: 39px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  padding: 8px 10px;
  outline: none;
}

.toolbar-field select:focus {
  border-color: #b6bdca;
  box-shadow: 0 0 0 3px rgba(34,43,69,.07);
}

.toolbar-field small {
  color: var(--muted);
  font-size: .69rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.view-toolbar .sync-row {
  margin: 0;
  align-self: center;
  min-width: 120px;
}

.task-card {
  position: relative;
  overflow: hidden;
}

.task-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: #b7bdc7;
}

.task-card.cat-work::before { background: #536b8d; }
.task-card.cat-personal::before { background: #8a678c; }
.task-card.cat-family::before { background: #9a7351; }
.task-card.cat-health::before { background: #5b806b; }
.task-card.cat-learning::before { background: #6c6e9b; }
.task-card.cat-errand::before { background: #8b8458; }
.task-card.cat-other::before { background: #7d838c; }

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

.time-readout {
  min-width: 42px;
  font-variant-numeric: tabular-nums;
  font-size: .72rem;
  font-weight: 820;
  color: var(--ink);
}

.day-shift {
  font-size: .63rem;
  font-weight: 760;
  color: var(--danger);
  background: #fbefef;
  border-radius: 999px;
  padding: 2px 5px;
}

.task-time-input,
.task-category,
.task-duration {
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f9fafb;
  color: var(--muted);
  padding: 4px 5px;
  font-size: .66rem;
  outline: none;
}

.task-time-input {
  width: 72px;
}

.task-category {
  width: 78px;
}

.task-duration {
  width: 84px;
}

.task-time-input:focus,
.task-category:focus,
.task-duration:focus {
  border-color: #b6bdca;
}

.day-column .task-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
}

.day-column .task-form input[name="title"] {
  grid-column: 1 / -1;
}

.day-column .task-form input[type="time"],
.day-column .task-form select {
  width: 100%;
  min-width: 0;
}

.day-column .task-form button {
  align-self: stretch;
}

.task-form input[type="time"] {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 8px;
  background: #fff;
  color: var(--ink);
}

.backlog-form {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 130px 110px auto;
  gap: 7px;
  max-width: none;
}

.backlog-form select {
  width: 100%;
}

.overflow-panel {
  margin-top: 14px;
  padding: 18px;
}

.overflow-panel .task-list {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

@media (max-width: 900px) {
  .view-toolbar {
    grid-template-columns: 1fr 1fr;
  }

  .view-toolbar .sync-row {
    grid-column: 1 / -1;
  }

  .backlog-form {
    grid-template-columns: 1fr 1fr;
  }

  .backlog-form input[name="title"] {
    grid-column: 1 / -1;
  }
}

@media (max-width: 560px) {
  .view-toolbar {
    grid-template-columns: 1fr;
  }

  .view-toolbar .sync-row {
    grid-column: auto;
  }

  .toolbar-field small {
    white-space: normal;
  }

  .backlog-form {
    grid-template-columns: 1fr;
  }

  .backlog-form input[name="title"] {
    grid-column: auto;
  }

  .task-time-input,
  .task-category,
  .task-duration {
    min-height: 32px;
  }
}


/* =========================================================
   V1.3 — Friendly, calmer visual design
   ========================================================= */

:root {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --ink: #243044;
  --muted: #7b8494;
  --line: #e7eaf0;
  --soft: #f0f3f8;
  --accent: #405f8f;
  --accent-soft: #edf3fb;
  --danger: #b05252;
  --today: #f4f8ff;
  --shadow: 0 8px 24px rgba(41, 55, 82, 0.055);
}

body {
  background:
    radial-gradient(circle at 5% 0%, rgba(218, 231, 249, .55), transparent 28rem),
    radial-gradient(circle at 100% 12%, rgba(238, 226, 244, .45), transparent 30rem),
    var(--bg);
}

.panel,
.day-column {
  border-color: #e8ebf1;
  box-shadow: var(--shadow);
}

.primary-btn,
.small-btn {
  background: #405f8f;
}

.ghost-btn {
  background: rgba(255,255,255,.9);
}

.view-toolbar {
  display: block;
  padding: 16px 18px;
  margin-bottom: 16px;
}

.toolbar-topline {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
}

.timezone-field {
  width: min(100%, 470px);
}

.toolbar-topline .sync-row {
  margin: 0 0 6px;
  min-width: 130px;
}

.category-filter-section {
  margin-top: 16px;
  padding-top: 15px;
  border-top: 1px solid var(--line);
}

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

.filter-heading > div {
  display: grid;
  gap: 2px;
}

.filter-label {
  color: var(--ink);
  font-size: .78rem;
  font-weight: 820;
}

.filter-heading small {
  color: var(--muted);
  font-size: .69rem;
}

.filter-reset {
  padding: 7px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #f8fafc;
  color: var(--muted);
  font-weight: 720;
}

.filter-reset.active {
  color: #405f8f;
  background: #edf3fb;
  border-color: #cfdaea;
}

.category-filter-pills {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 0 11px 0 8px;
  color: #687386;
  cursor: pointer;
  user-select: none;
  transition: background .15s ease, border-color .15s ease, color .15s ease, transform .15s ease;
}

.filter-pill input {
  appearance: none;
  width: 17px;
  height: 17px;
  margin: 0 7px 0 0;
  border-radius: 50%;
  border: 1.5px solid #b9c0cc;
  background: #fff;
  display: grid;
  place-items: center;
}

.filter-pill input::after {
  content: "✓";
  font-size: .65rem;
  font-weight: 900;
  color: #fff;
  opacity: 0;
}

.filter-pill input:checked::after {
  opacity: 1;
}

.filter-pill span {
  font-size: .73rem;
  font-weight: 760;
}

.filter-pill.selected {
  border-color: transparent;
  color: #344257;
}

.filter-pill.cat-work.selected { background: #eaf1fb; }
.filter-pill.cat-work input:checked { background: #57749c; border-color: #57749c; }

.filter-pill.cat-personal.selected { background: #f3eaf5; }
.filter-pill.cat-personal input:checked { background: #906c97; border-color: #906c97; }

.filter-pill.cat-family.selected { background: #f8efe7; }
.filter-pill.cat-family input:checked { background: #aa7955; border-color: #aa7955; }

.filter-pill.cat-health.selected { background: #e9f4ed; }
.filter-pill.cat-health input:checked { background: #5e876e; border-color: #5e876e; }

.filter-pill.cat-learning.selected { background: #eeeefa; }
.filter-pill.cat-learning input:checked { background: #7074a5; border-color: #7074a5; }

.filter-pill.cat-errand.selected { background: #f5f2df; }
.filter-pill.cat-errand input:checked { background: #8d8551; border-color: #8d8551; }

.filter-pill.cat-other.selected { background: #eef0f3; }
.filter-pill.cat-other input:checked { background: #737c89; border-color: #737c89; }

.week-grid {
  grid-template-columns: repeat(7, minmax(225px, 1fr));
  gap: 12px;
}

.day-column {
  min-height: 500px;
  padding: 14px;
  border-radius: 18px;
}

.day-column.today {
  background: var(--today);
  border-color: #cfdced;
  box-shadow: 0 8px 26px rgba(64, 95, 143, .08);
}

.day-column.today .day-name::after {
  content: "Today";
  display: inline-block;
  margin-left: 7px;
  padding: 2px 6px;
  border-radius: 999px;
  background: #dfeafa;
  color: #405f8f;
  font-size: .57rem;
  letter-spacing: 0;
  text-transform: none;
  vertical-align: 1px;
}

/* Clean task card: display first, edit only on demand */
.task-card {
  grid-template-columns: 22px 48px minmax(0, 1fr) auto;
  align-items: start;
  gap: 9px;
  padding: 11px 10px;
  border-radius: 13px;
  background: #fff;
  border: 1px solid #e6eaf0;
  box-shadow: 0 2px 7px rgba(41,55,82,.025);
  overflow: visible;
}

.task-card::before {
  width: 4px;
  border-radius: 13px 0 0 13px;
}

.task-time-block {
  padding-top: 1px;
}

.time-readout {
  display: block;
  min-width: 0;
  color: #40506a;
  font-size: .76rem;
  font-weight: 840;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.01em;
}

.task-content {
  min-width: 0;
}

.task-title {
  display: block;
  width: 100%;
  min-height: 22px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #29364a;
  font-size: .87rem;
  line-height: 1.35;
  font-weight: 690;
  text-overflow: ellipsis;
}

.task-title[readonly] {
  cursor: default;
}

.task-title:not([readonly]) {
  background: #f8fafc;
  border: 1px solid #dfe4ec;
  border-radius: 7px;
  padding: 6px 7px;
}

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

.category-badge,
.duration-readout {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border-radius: 999px;
  padding: 3px 7px;
  font-size: .63rem;
  font-weight: 760;
  white-space: nowrap;
}

.duration-readout {
  background: #f3f5f8;
  color: #7a8391;
}

.category-badge.cat-work { background: #eaf1fb; color: #4d6b94; }
.category-badge.cat-personal { background: #f3eaf5; color: #7d5e85; }
.category-badge.cat-family { background: #f8efe7; color: #916748; }
.category-badge.cat-health { background: #e9f4ed; color: #507961; }
.category-badge.cat-learning { background: #eeeefa; color: #626797; }
.category-badge.cat-errand { background: #f5f2df; color: #77713f; }
.category-badge.cat-other { background: #eef0f3; color: #68717e; }

.task-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin-top: -1px;
}

.star-btn,
.edit-btn,
.delete-btn {
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  padding: 0;
  background: transparent;
  color: #9aa2ae;
  font-size: .86rem;
}

.edit-btn {
  font-size: .72rem;
  font-weight: 760;
}

.task-card.editing .edit-btn {
  width: auto;
  padding: 0 6px;
  background: #edf3fb;
  color: #405f8f;
}

.task-editor {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin-top: 9px;
  padding: 9px;
  border-radius: 10px;
  background: #f7f9fc;
  border: 1px solid #e8ebf1;
}

.task-editor label {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.task-editor label > span {
  color: var(--muted);
  font-size: .61rem;
  font-weight: 760;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.task-editor select {
  width: 100%;
  min-width: 0;
  min-height: 31px;
  border: 1px solid #dfe4eb;
  border-radius: 7px;
  background: #fff;
  padding: 5px 6px;
  color: #5f6978;
  font-size: .68rem;
}

.task-card.completed {
  opacity: .62;
}

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

.day-shift {
  background: #fff0f0;
  color: #a45353;
}

.check-btn {
  margin-top: 1px;
  width: 18px;
  height: 18px;
  border-radius: 6px;
}

.task-card:hover {
  box-shadow: 0 6px 16px rgba(41,55,82,.07);
  transform: translateY(-1px);
}

.day-column .task-form {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #edf0f4;
}

.day-column .task-form input,
.day-column .task-form select {
  background: #fbfcfd;
}

.unscheduled {
  background: rgba(255,255,255,.94);
}

.backlog-form {
  padding-top: 2px;
}

.progress-bar {
  background: linear-gradient(90deg, #57749c, #6e84a8);
}

@media (hover: hover) and (pointer: fine) {
  .filter-pill:hover {
    transform: translateY(-1px);
    border-color: #d6dbe3;
  }

  .star-btn:hover,
  .edit-btn:hover,
  .delete-btn:hover {
    background: #f3f5f8;
    color: #566174;
  }

  .delete-btn:hover {
    background: #fff0f0;
    color: var(--danger);
  }
}

@media (max-width: 900px) {
  .toolbar-topline {
    align-items: stretch;
    flex-direction: column;
  }

  .toolbar-topline .sync-row {
    justify-content: flex-start;
  }

  .week-grid {
    grid-template-columns: repeat(7, minmax(275px, 82vw));
  }
}

@media (max-width: 560px) {
  .view-toolbar {
    padding: 14px;
  }

  .filter-heading {
    align-items: flex-start;
  }

  .category-filter-pills {
    gap: 7px;
  }

  .filter-pill {
    min-height: 36px;
  }

  .task-card {
    grid-template-columns: 22px 44px minmax(0, 1fr) auto;
  }

  .task-editor {
    grid-template-columns: 1fr;
  }
}


/* =========================================================
   V1.4 — Vivid category colours + true multi-select filters
   ========================================================= */

:root {
  --accent: #2563eb;
  --accent-soft: #eaf2ff;
  --today: #eef5ff;
}

/* All categories master checkbox */
.all-categories-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  background: #172033;
  color: #fff;
  font-size: .73rem;
  font-weight: 820;
  cursor: pointer;
  white-space: nowrap;
}

.all-categories-control input {
  appearance: none;
  width: 17px;
  height: 17px;
  margin: 0;
  border-radius: 5px;
  border: 1.5px solid rgba(255,255,255,.65);
  background: transparent;
  display: grid;
  place-items: center;
}

.all-categories-control input::after {
  content: "✓";
  color: white;
  font-size: .67rem;
  font-weight: 900;
  opacity: 0;
}

.all-categories-control input:checked {
  background: #22c55e;
  border-color: #22c55e;
}

.all-categories-control input:checked::after {
  opacity: 1;
}

.all-categories-control input:indeterminate {
  background: #f59e0b;
  border-color: #f59e0b;
}

.all-categories-control input:indeterminate::after {
  content: "–";
  opacity: 1;
  font-size: .8rem;
}

/* Vivid selected filter pills */
.filter-pill {
  border-width: 1.5px;
  font-weight: 800;
}

.filter-pill.selected {
  color: #fff;
  box-shadow: 0 4px 12px rgba(31, 41, 55, .10);
}

.filter-pill.cat-work.selected {
  background: #2563eb;
  border-color: #2563eb;
}
.filter-pill.cat-work input:checked {
  background: #fff;
  border-color: #fff;
}
.filter-pill.cat-work input:checked::after { color: #2563eb; }

.filter-pill.cat-personal.selected {
  background: #db2777;
  border-color: #db2777;
}
.filter-pill.cat-personal input:checked {
  background: #fff;
  border-color: #fff;
}
.filter-pill.cat-personal input:checked::after { color: #db2777; }

.filter-pill.cat-family.selected {
  background: #f97316;
  border-color: #f97316;
}
.filter-pill.cat-family input:checked {
  background: #fff;
  border-color: #fff;
}
.filter-pill.cat-family input:checked::after { color: #f97316; }

.filter-pill.cat-health.selected {
  background: #16a34a;
  border-color: #16a34a;
}
.filter-pill.cat-health input:checked {
  background: #fff;
  border-color: #fff;
}
.filter-pill.cat-health input:checked::after { color: #16a34a; }

.filter-pill.cat-learning.selected {
  background: #7c3aed;
  border-color: #7c3aed;
}
.filter-pill.cat-learning input:checked {
  background: #fff;
  border-color: #fff;
}
.filter-pill.cat-learning input:checked::after { color: #7c3aed; }

.filter-pill.cat-errand.selected {
  background: #eab308;
  border-color: #eab308;
  color: #342b00;
}
.filter-pill.cat-errand input:checked {
  background: #fff;
  border-color: #fff;
}
.filter-pill.cat-errand input:checked::after { color: #a16207; }

.filter-pill.cat-other.selected {
  background: #0891b2;
  border-color: #0891b2;
}
.filter-pill.cat-other input:checked {
  background: #fff;
  border-color: #fff;
}
.filter-pill.cat-other input:checked::after { color: #0891b2; }

/* Vivid category stripe and badges on task cards */
.task-card.cat-work::before { background: #2563eb; }
.task-card.cat-personal::before { background: #db2777; }
.task-card.cat-family::before { background: #f97316; }
.task-card.cat-health::before { background: #16a34a; }
.task-card.cat-learning::before { background: #7c3aed; }
.task-card.cat-errand::before { background: #eab308; }
.task-card.cat-other::before { background: #0891b2; }

.category-badge {
  color: #fff !important;
  font-weight: 820;
  box-shadow: 0 2px 6px rgba(31,41,55,.08);
}

.category-badge.cat-work { background: #2563eb; }
.category-badge.cat-personal { background: #db2777; }
.category-badge.cat-family { background: #f97316; }
.category-badge.cat-health { background: #16a34a; }
.category-badge.cat-learning { background: #7c3aed; }
.category-badge.cat-errand {
  background: #eab308;
  color: #342b00 !important;
}
.category-badge.cat-other { background: #0891b2; }

.primary-btn,
.small-btn {
  background: linear-gradient(135deg, #2563eb, #4f46e5);
}

.progress-bar {
  background: linear-gradient(90deg, #2563eb, #7c3aed, #db2777);
}

.day-column.today {
  border-color: #93b4ef;
  background:
    linear-gradient(180deg, rgba(239,246,255,.96), rgba(255,255,255,.96));
}

.day-column.today .day-name::after {
  background: #2563eb;
  color: #fff;
}

@media (hover: hover) and (pointer: fine) {
  .filter-pill.selected:hover {
    filter: brightness(1.04);
  }

  .all-categories-control:hover {
    background: #222d45;
  }
}


/* =========================================================
   V1.5 — Seven-day fit + softly differentiated weekdays
   ========================================================= */

/* Each weekday has its own subtle tint. */
.day-column.day-monday    { background: #f3f7ff; }
.day-column.day-tuesday   { background: #fff6f8; }
.day-column.day-wednesday { background: #f5fbf6; }
.day-column.day-thursday  { background: #fff9ef; }
.day-column.day-friday    { background: #f8f5ff; }
.day-column.day-saturday  { background: #f2fbfb; }
.day-column.day-sunday    { background: #fff5ef; }

/* Keep the Today distinction without replacing the weekday colour. */
.day-column.today {
  border-color: #6f9de6;
  box-shadow:
    0 0 0 2px rgba(37, 99, 235, .10),
    0 8px 24px rgba(41, 55, 82, .07);
}

/* Desktop: all seven days must fit in one browser-width row. */
@media (min-width: 1000px) {
  .app-shell {
    width: calc(100% - 18px);
    max-width: none;
    padding-left: 0;
    padding-right: 0;
  }

  .week-grid {
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 8px;
    overflow-x: visible;
    width: 100%;
  }

  .day-column {
    min-width: 0;
    width: 100%;
    padding: 10px;
    border-radius: 14px;
  }

  .day-head {
    gap: 5px;
    padding-bottom: 9px;
    margin-bottom: 8px;
  }

  .day-name {
    font-size: .68rem;
    letter-spacing: .055em;
  }

  .day-date,
  .workload {
    font-size: .66rem;
  }

  .task-list {
    gap: 6px;
  }

  .task-card {
    grid-template-columns: 19px 39px minmax(0, 1fr) auto;
    gap: 6px;
    padding: 9px 7px;
  }

  .time-readout {
    font-size: .68rem;
  }

  .task-title {
    font-size: .79rem;
  }

  .category-badge,
  .duration-readout {
    font-size: .58rem;
    padding: 2px 5px;
  }

  .task-actions {
    gap: 2px;
  }

  .star-btn,
  .edit-btn,
  .delete-btn {
    width: 22px;
    height: 22px;
  }

  .day-column .task-form {
    gap: 5px;
  }

  .day-column .task-form input,
  .day-column .task-form select {
    min-width: 0;
    font-size: .72rem;
  }

  .day-column .task-form .small-btn {
    padding-left: 9px;
    padding-right: 9px;
  }
}

/* Narrow screens still prioritize usability rather than squeezing seven tiny columns. */
@media (max-width: 999px) {
  .week-grid {
    grid-template-columns: repeat(7, minmax(260px, 78vw));
    overflow-x: auto;
  }
}
