:root {
  --bg: #ece8e1;
  --bg-top: rgba(255, 255, 255, 0.9);
  --bg-bottom: #e3ddd2;
  --panel: rgba(255, 255, 255, 0.96);
  --panel-strong: #ffffff;
  --panel-soft: #f7f2e8;
  --surface-subtle: rgba(255, 255, 255, 0.76);
  --surface-soft: rgba(255, 255, 255, 0.88);
  --surface-quiet: rgba(255, 255, 255, 0.94);
  --surface-muted: rgba(239, 234, 225, 0.94);
  --surface-hover: #f3ede4;
  --surface-table: rgba(255, 255, 255, 0.88);
  --surface-empty: rgba(255, 255, 255, 0.62);
  --surface-overlay: rgba(251, 248, 241, 0.98);
  --surface-backdrop: rgba(12, 11, 10, 0.36);
  --surface-backdrop-soft: rgba(12, 11, 10, 0.28);
  --line: #d6cec1;
  --line-soft: #e4dccf;
  --line-strong: #c4b5a0;
  --text: #16130f;
  --muted: #5d554b;
  --muted-soft: #766d61;
  --text-subtle-strong: #2f2a24;
  --text-subtle: #47413a;
  --text-faint: rgba(22, 19, 15, 0.78);
  --text-faint-soft: rgba(22, 19, 15, 0.64);
  --border-contrast: rgba(20, 17, 13, 0.08);
  --border-contrast-strong: rgba(20, 17, 13, 0.14);
  --shadow: 0 28px 70px rgba(26, 21, 15, 0.12);
  --shadow-card: 0 12px 28px rgba(27, 21, 15, 0.08);
  --shadow-raised: 0 18px 42px rgba(20, 17, 13, 0.14);
  --accent: #3168f5;
  --accent-strong: #2451cb;
  --accent-soft: rgba(49, 104, 245, 0.12);
  --accent-soft-strong: rgba(49, 104, 245, 0.18);
  --button-primary-bg: linear-gradient(180deg, #3d74ff 0%, #2757d4 100%);
  --button-primary-text: #fbfdff;
  --button-secondary-bg: #f5f0e8;
  --button-secondary-border: #d8cfbf;
  --button-secondary-text: #1b1712;
  --button-surface: #f3ede4;
  --button-surface-hover: #fbf8f3;
  --status-planned-bg: #ede4d6;
  --status-planned-text: #6f5a48;
  --status-in-progress-bg: #dfece5;
  --status-in-progress-text: #35564a;
  --status-review-bg: #e8e5f2;
  --status-review-text: #52527b;
  --status-completed-bg: #d8e7db;
  --status-completed-text: #32503d;
  --focus-ring: 0 0 0 4px rgba(49, 104, 245, 0.18);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 999px;
}

body.theme-dark {
  --bg: #0f1114;
  --bg-top: rgba(83, 90, 101, 0.18);
  --bg-bottom: #0a0c0f;
  --panel: rgba(23, 26, 30, 0.96);
  --panel-strong: #16191d;
  --panel-soft: #1d2228;
  --surface-subtle: rgba(27, 31, 36, 0.94);
  --surface-soft: rgba(20, 23, 28, 0.96);
  --surface-quiet: rgba(24, 28, 33, 0.97);
  --surface-muted: rgba(19, 22, 25, 0.94);
  --surface-hover: #252b34;
  --surface-table: rgba(20, 23, 26, 0.94);
  --surface-empty: rgba(17, 19, 22, 0.92);
  --surface-overlay: rgba(12, 14, 17, 0.98);
  --surface-backdrop: rgba(0, 0, 0, 0.5);
  --surface-backdrop-soft: rgba(0, 0, 0, 0.4);
  --line: #363d47;
  --line-soft: #2b3139;
  --line-strong: #48515e;
  --text: #f5efe4;
  --muted: #b3ab9f;
  --muted-soft: #958e83;
  --text-subtle-strong: #f0e8dc;
  --text-subtle: #d6cfc3;
  --text-faint: rgba(245, 239, 228, 0.82);
  --text-faint-soft: rgba(245, 239, 228, 0.68);
  --border-contrast: rgba(255, 255, 255, 0.1);
  --border-contrast-strong: rgba(255, 255, 255, 0.16);
  --shadow: 0 34px 84px rgba(0, 0, 0, 0.42);
  --shadow-card: 0 16px 34px rgba(0, 0, 0, 0.24);
  --shadow-raised: 0 20px 46px rgba(0, 0, 0, 0.36);
  --accent: #7ea7ff;
  --accent-strong: #aecaFF;
  --accent-soft: rgba(126, 167, 255, 0.16);
  --accent-soft-strong: rgba(126, 167, 255, 0.24);
  --button-primary-bg: linear-gradient(180deg, #8eb5ff 0%, #6b95f8 100%);
  --button-primary-text: #151821;
  --button-secondary-bg: #20242a;
  --button-secondary-border: #39414b;
  --button-secondary-text: #f4efe5;
  --button-surface: #20242a;
  --button-surface-hover: #2a3038;
  --status-planned-bg: #44372d;
  --status-planned-text: #f1dfcb;
  --status-in-progress-bg: #1f3b3d;
  --status-in-progress-text: #c9f0e9;
  --status-review-bg: #37344a;
  --status-review-text: #e1dcff;
  --status-completed-bg: #395543;
  --status-completed-text: #eff8ec;
  --focus-ring: 0 0 0 4px rgba(126, 167, 255, 0.26);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

html {
  font-size: 14px;
  scroll-behavior: smooth;
}

body {
  background:
    radial-gradient(circle at top left, color-mix(in srgb, var(--bg-top) 74%, transparent), transparent 28%),
    radial-gradient(circle at top right, color-mix(in srgb, var(--panel) 20%, transparent), transparent 24%),
    linear-gradient(180deg, color-mix(in srgb, var(--bg) 78%, white) 0%, var(--bg-bottom) 100%);
  color: var(--text);
  font-family: "Instrument Sans", sans-serif;
  line-height: 1.55;
  transition: background 0.22s ease, color 0.22s ease;
}

body.is-resizing {
  cursor: ew-resize;
  user-select: none;
}

body.life-drawer-open,
body.app-locked {
  overflow: hidden;
}

body.app-locked .page-shell {
  filter: blur(10px);
  pointer-events: none;
  user-select: none;
}

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

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

.page-shell {
  width: 100%;
  max-width: 1680px;
  margin: 0 auto;
  padding: 10px 14px 18px;
}

.page-header,
.panel-head,
.calendar-head,
.modal-header,
.calendar-controls,
.folder-row,
.folder-main,
.task-card__meta,
.task-card__footer,
.actions-cell,
.modal-actions,
.life-drawer__header,
.life-toolbar,
.life-toolbar__actions,
.life-footer {
  display: flex;
  align-items: center;
}

.page-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  position: sticky;
  top: 12px;
  z-index: 20;
  gap: 10px;
  margin-bottom: 10px;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--line) 90%, transparent);
  border-radius: 20px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--panel-strong) 92%, transparent), color-mix(in srgb, var(--panel) 96%, transparent));
  box-shadow: 0 18px 42px rgba(18, 16, 13, 0.1);
  backdrop-filter: blur(16px);
}

.page-title-group,
.section-title-block {
  display: grid;
  gap: 4px;
}

.page-title-group {
  flex: 0 0 auto;
  min-width: 0;
}

.page-title-group h1 {
  white-space: nowrap;
}

.header-actions,
.header-actions__secondary {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.header-menu {
  position: relative;
}

.header-menu[open] .header-menu__trigger {
  background: color-mix(in srgb, var(--accent-soft) 72%, var(--button-surface-hover));
  border-color: color-mix(in srgb, var(--accent) 42%, var(--button-secondary-border));
}

.header-menu__trigger {
  list-style: none;
}

.header-menu__trigger::-webkit-details-marker {
  display: none;
}

.header-menu__icon,
.header-menu__icon::before,
.header-menu__icon::after {
  display: block;
  width: 16px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transition: transform 0.18s ease, opacity 0.18s ease;
}

.header-menu__icon {
  position: relative;
}

.header-menu__icon::before,
.header-menu__icon::after {
  content: "";
  position: absolute;
  left: 0;
}

.header-menu__icon::before {
  top: -5px;
}

.header-menu__icon::after {
  top: 5px;
}

.header-menu[open] .header-menu__icon {
  background: transparent;
}

.header-menu[open] .header-menu__icon::before {
  transform: translateY(5px) rotate(45deg);
}

.header-menu[open] .header-menu__icon::after {
  transform: translateY(-5px) rotate(-45deg);
}

.header-menu__panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: min(320px, calc(100vw - 28px));
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid color-mix(in srgb, var(--line) 90%, transparent);
  border-radius: 18px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--panel-strong) 96%, transparent), color-mix(in srgb, var(--panel) 98%, transparent));
  box-shadow: 0 24px 46px rgba(18, 16, 13, 0.16);
}

.header-menu__group {
  display: grid;
  gap: 8px;
  padding-bottom: 10px;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 84%, transparent);
}

.header-menu__group:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.header-menu__panel .secondary-button {
  width: 100%;
  justify-content: flex-start;
  text-align: left;
}

.header-actions {
  flex: 1 1 auto;
  justify-content: flex-end;
  justify-self: end;
  gap: 8px;
  min-width: 0;
}

#addTaskButton {
  display: none !important;
}

.eyebrow {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1 {
  font-size: clamp(1.45rem, 1.55vw, 1.9rem);
  line-height: 1;
  letter-spacing: -0.055em;
}

h2 {
  font-size: clamp(1.04rem, 1.1vw, 1.26rem);
  line-height: 1.1;
  letter-spacing: -0.045em;
}

h3 {
  font-size: 0.9rem;
  line-height: 1.2;
  letter-spacing: -0.025em;
}

.panel-shell,
.tool-card,
.modal-card {
  background: var(--panel);
  border: 1px solid color-mix(in srgb, var(--line) 90%, transparent);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.panel-shell {
  border-radius: 24px;
  padding: 11px;
}

.planner-layout {
  display: grid;
  gap: 8px;
  align-items: start;
}

.panel-head {
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.planner-tools,
.calendar-panel {
  margin-bottom: 0;
}

.calendar-panel {
  position: relative;
  border-color: color-mix(in srgb, var(--line-strong) 34%, var(--line));
  box-shadow:
    0 20px 48px rgba(18, 16, 13, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.38);
}

.planner-tools {
  border-color: color-mix(in srgb, var(--line) 82%, transparent);
  box-shadow: 0 14px 36px rgba(18, 16, 13, 0.08);
}

.planner-tools {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.tools-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  align-items: start;
}

.tool-card {
  border-radius: 18px;
  padding: 10px;
}

.folder-card,
.task-groups-card {
  min-height: 0;
}

.folder-card {
  display: none !important;
}

.task-groups-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.section-head p {
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.45;
  font-size: 0.74rem;
  max-width: 48rem;
}

.folder-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin: 8px 0 8px;
}

.folder-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.unscheduled-list {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(196px, 214px);
  gap: 8px;
  align-items: start;
  min-height: 160px;
  overflow: auto;
  padding: 2px 4px 4px 2px;
  align-content: start;
}

.folder-row {
  justify-content: space-between;
  gap: 8px;
  width: min(190px, 100%);
  min-height: 38px;
  padding: 7px 10px;
  border: 1px solid color-mix(in srgb, var(--folder-border, #d8d2c6) 76%, var(--line));
  border-radius: 18px;
  background:
    linear-gradient(
      180deg,
      color-mix(in srgb, var(--folder-bg-strong, var(--folder-bg, #f4f1ea)) 92%, var(--panel-strong)),
      color-mix(in srgb, var(--folder-bg, #f4f1ea) 74%, var(--panel))
    );
  color: var(--folder-text, #62584d);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.44),
    0 8px 18px color-mix(in srgb, var(--folder-accent, #8d8378) 14%, transparent);
}

.folder-main {
  gap: 8px;
  min-width: 0;
}

.folder-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.9;
}

.folder-name {
  font-weight: 700;
  font-size: 0.78rem;
}

.folder-count {
  opacity: 0.92;
  font-size: 0.68rem;
  font-weight: 700;
}

button.folder-main,
.icon-button,
.mini-icon-button,
.text-button,
.primary-button,
.secondary-button {
  border: 0;
  cursor: pointer;
  transition:
    transform 0.18s ease,
    background-color 0.18s ease,
    color 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}

button.folder-main {
  padding: 0;
  background: transparent;
  color: inherit;
}

.primary-button,
.secondary-button {
  min-height: 34px;
  padding: 0 11px;
  border-radius: 10px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.page-header .secondary-button,
.page-header .primary-button {
  min-height: 34px;
  padding: 0 10px;
  font-size: 0.72rem;
}

.primary-button {
  background: var(--button-primary-bg);
  color: var(--button-primary-text);
  box-shadow: 0 10px 24px color-mix(in srgb, var(--accent) 24%, rgba(17, 14, 11, 0.14));
}

.secondary-button {
  background: var(--button-secondary-bg);
  color: var(--button-secondary-text);
  border: 1px solid var(--button-secondary-border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.36);
}

#addTaskButton {
  background: var(--button-primary-bg);
  color: var(--button-primary-text);
  border: 1px solid color-mix(in srgb, var(--accent-strong) 60%, transparent);
}

.icon-button,
.mini-icon-button {
  display: inline-grid;
  place-items: center;
  background: var(--button-surface);
  color: var(--muted);
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
}

.icon-button {
  width: 34px;
  height: 34px;
}

.mini-icon-button {
  width: 30px;
  height: 30px;
}

.text-button {
  padding: 8px 11px;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
}

.primary-button:hover,
.secondary-button:hover,
.icon-button:hover,
.mini-icon-button:hover,
.text-button:hover,
.folder-row:hover {
  transform: translateY(-1px);
}

.primary-button:hover {
  box-shadow: 0 14px 30px color-mix(in srgb, var(--accent) 30%, rgba(17, 14, 11, 0.18));
}

.secondary-button:hover,
.icon-button:hover,
.mini-icon-button:hover {
  background: var(--button-surface-hover);
  border-color: color-mix(in srgb, var(--accent) 30%, var(--button-secondary-border));
}

.mini-icon-button.danger:hover,
.text-button.danger:hover {
  background: color-mix(in srgb, #a45757 18%, transparent);
  color: #d08989;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[contenteditable="true"]:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

input[type="text"],
input[type="date"],
select,
textarea {
  width: 100%;
  border: 1px solid color-mix(in srgb, var(--line) 86%, transparent);
  border-radius: 14px;
  background: var(--panel-strong);
  color: var(--text);
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

input[type="text"],
input[type="date"],
select {
  min-height: 46px;
  padding: 0 14px;
  font-size: 0.9rem;
}

textarea {
  resize: vertical;
  min-height: 122px;
  padding: 12px 14px;
  font-size: 0.92rem;
}

input[type="text"]:focus,
input[type="date"]:focus,
select:focus,
textarea:focus {
  border-color: color-mix(in srgb, var(--accent) 60%, var(--line-strong));
  background: color-mix(in srgb, var(--accent-soft) 14%, var(--panel-strong));
}

.calendar-head {
  justify-content: space-between;
  align-items: center;
}

.calendar-controls {
  gap: 4px;
  flex-wrap: wrap;
}

.calendar-helper {
  display: none;
}

.calendar-frame {
  width: 100%;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--line) 92%, transparent);
  border-radius: 16px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--panel-strong) 96%, transparent), color-mix(in srgb, var(--surface-soft) 98%, transparent));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.55),
    0 18px 34px rgba(18, 16, 13, 0.08);
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  margin-bottom: 2px;
}

.calendar-weekdays span {
  padding: 0 6px 4px;
  color: var(--muted);
  font-size: 0.58rem;
  font-weight: 700;
  text-align: center;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.calendar-grid {
  display: grid;
  gap: 3px;
}

.calendar-week {
  border: 1px solid color-mix(in srgb, var(--line) 88%, transparent);
  border-radius: 14px;
  padding: 3px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--surface-subtle) 96%, transparent), color-mix(in srgb, var(--surface-quiet) 92%, transparent));
}

.week-days,
.week-bars {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.week-bars {
  gap: 6px;
  margin-top: 6px;
  grid-auto-rows: minmax(32px, auto);
  align-items: start;
}

.week-bars--open {
  margin-top: 4px;
}

.week-completed {
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px dashed var(--line);
}

.week-completed__label {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.54rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.calendar-day {
  min-width: 0;
  min-height: 38px;
  padding: 5px 5px 3px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--surface-quiet);
  overflow: hidden;
}

.week-days > .calendar-day:nth-child(7n) {
  border-right: 0;
}

.week-days > .calendar-day:nth-last-child(-n + 7) {
  border-bottom: 0;
}

.calendar-day.other-month {
  background: var(--surface-muted);
}

.calendar-day.drag-over {
  background: color-mix(in srgb, var(--accent-soft) 42%, var(--panel-strong));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 42%, transparent);
}

.calendar-day.today .day-number {
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 8px 16px color-mix(in srgb, var(--accent) 26%, transparent);
}

.day-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 0;
}

.day-weekday {
  display: none;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.day-number {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  color: var(--text-subtle-strong);
  font-size: 0.62rem;
  font-weight: 800;
}

.day-tasks {
  display: grid;
  gap: 4px;
  min-width: 0;
  align-content: start;
}

.calendar-bar,
.calendar-task,
.unscheduled-card {
  position: relative;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 7px;
  border: 1px solid color-mix(in srgb, var(--folder-border, #d9d4c8) 76%, var(--line));
  border-radius: 14px;
  background:
    linear-gradient(
      180deg,
      color-mix(in srgb, var(--folder-bg-strong, var(--folder-bg, #f4f1ea)) 94%, var(--panel-strong)),
      color-mix(in srgb, var(--folder-bg, #f4f1ea) 74%, var(--panel))
    );
  color: var(--folder-text, #62584d);
  cursor: grab;
  overflow: hidden;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.34),
    0 8px 16px color-mix(in srgb, var(--folder-accent, #8d8378) 10%, transparent),
    var(--shadow-card);
  transition:
    transform 0.16s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease;
}

.calendar-bar::before,
.calendar-task::before,
.unscheduled-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  border-radius: 999px;
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--folder-accent, #8d8378) 90%, white),
    color-mix(in srgb, var(--folder-text, #62584d) 88%, black)
  );
  opacity: 1;
}

.calendar-bar:hover,
.calendar-task:hover,
.unscheduled-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--folder-accent, #8d8378) 58%, var(--accent) 14%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.36),
    0 14px 26px color-mix(in srgb, var(--folder-accent, #8d8378) 16%, transparent),
    var(--shadow-raised);
}

.calendar-bar:active,
.calendar-task:active,
.unscheduled-card:active {
  cursor: grabbing;
}

.unscheduled-card.is-scheduled {
  opacity: 1;
}

.task-state-open {
  border-color: color-mix(in srgb, var(--folder-border, #d9d4c8) 90%, var(--folder-accent, #8d8378));
}

.task-state-complete {
  border-color: color-mix(in srgb, var(--status-completed-text) 26%, var(--folder-accent, #8d8378));
  background:
    linear-gradient(
      180deg,
      color-mix(in srgb, var(--status-completed-bg) 34%, var(--folder-bg-strong, var(--folder-bg, #f4f1ea))),
      color-mix(in srgb, var(--status-completed-bg) 18%, var(--folder-bg, #f4f1ea))
    );
  color: color-mix(in srgb, var(--folder-text, #62584d) 68%, var(--status-completed-text));
  box-shadow:
    inset 6px 0 0 color-mix(in srgb, var(--folder-accent, #8d8378) 44%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    var(--shadow-card);
}

.task-state-complete::before {
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--folder-accent, #8d8378) 92%, white),
    color-mix(in srgb, var(--status-completed-text) 84%, black)
  );
  opacity: 0.9;
}

body.theme-dark .task-state-complete {
  border-color: color-mix(in srgb, var(--folder-accent, #8d8378) 42%, #5b6a62);
  background:
    linear-gradient(
      180deg,
      color-mix(in srgb, var(--folder-accent, #8d8378) 16%, #24282d),
      color-mix(in srgb, var(--status-completed-bg) 58%, #171a1d)
    );
  color: color-mix(in srgb, var(--status-completed-text) 94%, #ffffff);
  box-shadow:
    inset 6px 0 0 color-mix(in srgb, var(--folder-accent, #8d8378) 76%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    var(--shadow-card);
}

.week-bars--completed .calendar-bar {
  min-height: 60px;
}

.calendar-bar {
  display: flex;
  align-items: stretch;
  gap: 8px;
  min-height: 40px;
  padding: 6px 8px;
  border-radius: 14px;
}

.calendar-bar__body {
  display: grid;
  gap: 4px;
  min-width: 0;
  flex: 1 1 auto;
  padding: 0 1px;
}

.calendar-bar__top,
.calendar-bar__footer,
.task-card__meta,
.task-card__footer,
.actions-cell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  flex-wrap: wrap;
}

.task-card__meta {
  justify-content: flex-start;
}

.calendar-bar__title,
.calendar-task__title,
.unscheduled-card__title {
  display: -webkit-box;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.02em;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow-wrap: anywhere;
  overflow: hidden;
}

.calendar-bar__title {
  font-size: 0.76rem;
}

.calendar-task__title,
.unscheduled-card__title {
  font-size: 0.78rem;
}

.calendar-task__range,
.calendar-task__note,
.unscheduled-card__note {
  margin-top: 8px;
  color: var(--text-faint);
  font-size: 0.66rem;
  line-height: 1.26;
  overflow-wrap: anywhere;
}

.task-card__footer {
  margin-top: 8px;
}

.tray-schedule-label {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--folder-bg-strong, var(--folder-bg, #f4f1ea)) 64%, var(--panel-strong));
  border: 1px solid color-mix(in srgb, var(--folder-border, #d8d2c6) 74%, transparent);
  color: color-mix(in srgb, var(--folder-text, #62584d) 88%, var(--text-subtle));
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.35;
}

.calendar-bar .task-check,
.calendar-bar .status-pill,
.calendar-bar .folder-pill,
.calendar-bar .tray-schedule-label {
  min-height: 24px;
  font-size: 0.66rem;
}

.calendar-bar .task-check {
  gap: 8px;
  min-height: 26px;
  font-size: 0.72rem;
}

.calendar-bar .task-check input {
  width: 16px;
  height: 16px;
}

.task-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 4px 0;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-subtle);
}

.task-check--compact {
  font-size: 0.94rem;
}

.task-check input,
.checkbox-field input,
.checkbox-input {
  width: 20px;
  height: 20px;
  accent-color: #171411;
  cursor: pointer;
  flex: 0 0 auto;
}

body.theme-dark .task-check input,
body.theme-dark .checkbox-field input,
body.theme-dark .checkbox-input {
  accent-color: #f2eee6;
}

.status-pill,
.folder-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  max-width: 100%;
  padding: 0 8px;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.folder-pill {
  background: color-mix(in srgb, var(--folder-bg-strong, var(--folder-bg, #f4f1ea)) 88%, var(--panel-strong));
  border: 1px solid color-mix(in srgb, var(--folder-accent, #8d8378) 32%, transparent);
  color: color-mix(in srgb, var(--folder-text, #62584d) 92%, black);
}

.status-planned {
  background: var(--status-planned-bg);
  color: var(--status-planned-text);
}

.status-in-progress {
  background: var(--status-in-progress-bg);
  color: var(--status-in-progress-text);
}

.status-review {
  background: var(--status-review-bg);
  color: var(--status-review-text);
}

.status-completed {
  background: var(--status-completed-bg);
  color: var(--status-completed-text);
}

.task-state-complete .calendar-bar__title,
.task-state-complete .calendar-task__title,
.task-state-complete .unscheduled-card__title {
  color: color-mix(in srgb, currentColor 88%, var(--status-completed-text));
}

.task-state-complete .calendar-task__note,
.task-state-complete .unscheduled-card__note,
.task-state-complete .tray-schedule-label,
.task-state-complete .task-check,
.task-state-complete .folder-pill {
  opacity: 0.9;
}

body.theme-dark .task-state-complete .calendar-bar__title,
body.theme-dark .task-state-complete .calendar-task__title,
body.theme-dark .task-state-complete .unscheduled-card__title {
  color: #f7fbf4;
}

body.theme-dark .task-state-complete .calendar-task__note,
body.theme-dark .task-state-complete .unscheduled-card__note,
body.theme-dark .task-state-complete .tray-schedule-label,
body.theme-dark .task-state-complete .task-check,
body.theme-dark .task-state-complete .folder-pill {
  color: color-mix(in srgb, var(--status-completed-text) 84%, #dfead8);
  opacity: 0.96;
}

.task-state-open .status-pill.status-completed,
.task-state-complete .status-pill.status-completed {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--status-completed-text) 18%, transparent);
}

body.theme-dark .task-state-complete .status-pill.status-completed {
  background: color-mix(in srgb, var(--status-completed-text) 18%, #273128);
  color: #f2f8ee;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.resize-handle {
  position: absolute;
  top: 10px;
  bottom: 10px;
  width: 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--panel-strong) 92%, transparent);
  border: 1px solid var(--border-contrast-strong);
  opacity: 0;
  transition: opacity 0.16s ease;
  cursor: ew-resize;
}

.calendar-bar:hover .resize-handle {
  opacity: 1;
}

.resize-handle--left {
  left: 6px;
}

.resize-handle--right {
  right: 6px;
}

.toolbar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.toolbar-group,
.form-field {
  display: grid;
  gap: 8px;
}

.field-label,
.form-field span,
.helper-text {
  color: var(--muted);
  font-size: 0.82rem;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line-soft);
  border-radius: 22px;
  background: var(--surface-table);
}

.task-table {
  width: 100%;
  min-width: 1080px;
  border-collapse: collapse;
}

.task-table th,
.task-table td {
  padding: 18px 16px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  vertical-align: top;
}

.task-table th {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.task-table tbody tr:hover {
  background: var(--button-surface-hover);
}

.task-table tbody tr:last-child td {
  border-bottom: 0;
}

.database-row--open {
  background: color-mix(in srgb, var(--panel-strong) 18%, transparent);
}

.database-row--done {
  background:
    linear-gradient(
      90deg,
      color-mix(in srgb, var(--status-completed-bg) 42%, var(--panel)) 0,
      color-mix(in srgb, var(--status-completed-bg) 16%, var(--panel)) 16px,
      color-mix(in srgb, var(--surface-empty) 84%, var(--panel)) 16px
    );
}

.database-row--done td {
  color: color-mix(in srgb, var(--text) 72%, var(--muted));
}

.database-row--done .task-note,
.database-row--done .task-date,
.database-row--done .task-range-detail,
.database-row--done .folder-pill,
.database-row--done .status-pill {
  opacity: 0.86;
}

.task-title {
  font-weight: 800;
  font-size: 1.08rem;
  line-height: 1.35;
}

.task-title.done {
  color: color-mix(in srgb, var(--status-completed-text) 64%, var(--muted));
}

.task-note {
  color: var(--muted);
  font-size: 0.96rem;
  line-height: 1.58;
}

.task-date {
  color: var(--text-subtle);
  font-size: 0.96rem;
  white-space: nowrap;
}

.task-date.unscheduled,
.task-note.empty,
.task-range-detail {
  color: var(--muted);
}

.task-range-detail {
  margin-top: 6px;
  font-size: 0.9rem;
  line-height: 1.46;
}

.calendar-day__empty {
  padding: 12px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  color: var(--muted);
  font-size: 0.82rem;
  background: color-mix(in srgb, var(--surface-subtle) 82%, transparent);
}

.unschedule-dropzone {
  margin-bottom: 10px;
  padding: 10px 12px;
  border: 1.5px dashed color-mix(in srgb, var(--line) 92%, transparent);
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface-subtle) 84%, var(--panel-strong));
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  text-align: center;
  transition: border-color 0.18s ease, background-color 0.18s ease, color 0.18s ease;
}

.unschedule-dropzone.drag-over {
  border-color: color-mix(in srgb, var(--accent) 70%, transparent);
  background: color-mix(in srgb, var(--accent-soft) 56%, var(--panel-strong));
  color: color-mix(in srgb, var(--accent-strong) 74%, var(--text));
}

.task-group {
  display: grid;
  grid-template-rows: auto 1fr;
  width: min(214px, 100%);
  min-height: 100%;
  border: 1px solid color-mix(in srgb, var(--folder-border, #d8d2c6) 76%, var(--line));
  border-radius: 18px;
  background:
    linear-gradient(
      180deg,
      color-mix(in srgb, var(--folder-bg-strong, var(--folder-bg, #f4f1ea)) 80%, var(--panel-strong)),
      color-mix(in srgb, var(--folder-bg, #f4f1ea) 22%, var(--panel-strong))
    );
  overflow: hidden;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.46),
    0 10px 20px color-mix(in srgb, var(--folder-accent, #8d8378) 12%, transparent);
}

.task-group__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 10px 8px;
  font-weight: 800;
  font-size: 0.82rem;
  color: var(--folder-text, #62584d);
}

.task-group__summary-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.task-group__folder {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.task-group__folder::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.72;
}

.task-group__count {
  min-width: 24px;
  padding: 0 7px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--folder-bg-strong, var(--folder-bg, #f4f1ea)) 88%, var(--panel-strong));
  border: 1px solid color-mix(in srgb, var(--folder-accent, #8d8378) 22%, transparent);
  text-align: center;
  font-size: 0.7rem;
}

.task-group__delete {
  width: 22px;
  height: 22px;
  min-width: 22px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--folder-accent, #8d8378) 22%, transparent);
  background: color-mix(in srgb, var(--panel-strong) 54%, transparent);
  color: currentColor;
  box-shadow: none;
}

.task-group__body {
  display: grid;
  gap: 8px;
  align-content: start;
  padding: 0 10px 10px;
}

.task-group__quick-add {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid color-mix(in srgb, var(--folder-border, #d8d2c6) 62%, var(--border-contrast-strong));
  border-radius: 12px;
  background: color-mix(in srgb, var(--folder-bg-strong, var(--folder-bg, #f4f1ea)) 52%, var(--panel-strong));
  color: var(--folder-text, #62584d);
  font-size: 0.74rem;
  font-weight: 700;
  justify-content: flex-start;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.32);
}

.task-group__quick-add:hover {
  background: color-mix(in srgb, var(--folder-bg-strong, var(--folder-bg, #f4f1ea)) 74%, var(--panel-strong));
  border-color: color-mix(in srgb, var(--accent) 40%, var(--folder-accent, #8d8378));
}

.task-group__quick-add-icon {
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  font-size: 0.86rem;
  line-height: 1;
}

.task-group__empty {
  min-height: 94px;
  padding: 10px;
  border: 1px dashed var(--border-contrast-strong);
  border-radius: 12px;
  color: var(--text-faint-soft);
  font-size: 0.7rem;
  background: color-mix(in srgb, var(--panel-strong) 42%, transparent);
}

.task-group--add,
.task-group--composer {
  background:
    linear-gradient(
      180deg,
      color-mix(in srgb, var(--panel-strong) 92%, transparent),
      color-mix(in srgb, var(--surface-subtle) 86%, transparent)
    );
  border-style: dashed;
  border-color: color-mix(in srgb, var(--line-strong) 78%, transparent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.task-group--add {
  display: flex;
}

.task-group__add-folder {
  width: 100%;
  min-height: 100%;
  min-height: 160px;
  border: 0;
  border-radius: inherit;
  background: transparent;
  color: var(--muted);
  display: grid;
  place-items: center;
  gap: 10px;
  font-size: 0.86rem;
  font-weight: 700;
}

.task-group__add-folder:hover {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent-soft) 34%, transparent);
}

.task-group__add-folder-icon {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--line-strong) 75%, transparent);
  background: color-mix(in srgb, var(--panel-strong) 88%, transparent);
  font-size: 1rem;
  line-height: 1;
}

.task-group__composer {
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 100%;
}

.task-group__composer-input {
  width: 100%;
  min-height: 38px;
}

.task-group__composer-actions {
  display: flex;
  gap: 8px;
}

.empty-state,
.empty-tray {
  display: grid;
  place-items: center;
  gap: 10px;
  min-height: 180px;
  padding: 30px;
  border: 1px dashed var(--line);
  border-radius: 22px;
  background: var(--surface-empty);
  text-align: center;
  color: var(--muted);
}

.modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  z-index: 50;
}

.hidden,
.modal.hidden {
  display: none !important;
}

.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-gate__backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at top, color-mix(in srgb, var(--accent-soft) 36%, transparent), transparent 36%),
    color-mix(in srgb, var(--surface-backdrop) 92%, rgba(0, 0, 0, 0.12));
  backdrop-filter: blur(12px);
}

.auth-gate__card {
  position: relative;
  width: min(100%, 500px);
  padding: 24px;
  border: 1px solid color-mix(in srgb, var(--line) 86%, transparent);
  border-radius: 24px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--panel-strong) 96%, transparent), color-mix(in srgb, var(--panel) 96%, transparent));
  box-shadow: var(--shadow);
}

.auth-gate__copy {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.auth-form {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.auth-remember {
  margin-top: 2px;
}

.auth-error {
  min-height: 28px;
  color: #a64e4e;
  font-size: 0.84rem;
  font-weight: 700;
}

.auth-error.is-soft {
  color: var(--muted);
}

.auth-actions {
  justify-content: stretch;
}

.auth-actions .primary-button {
  width: 100%;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: var(--surface-backdrop);
  backdrop-filter: blur(10px);
}

.modal-card {
  position: relative;
  width: min(100%, 620px);
  border-radius: 24px;
  padding: 22px;
}

.modal-header {
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.task-form {
  display: grid;
  gap: 14px;
}

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

.checkbox-field {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}

.modal-actions {
  justify-content: flex-end;
  gap: 10px;
}

.journal-drawer {
  position: fixed;
  inset: 0;
  z-index: 58;
}

.journal-drawer__backdrop {
  position: absolute;
  inset: 0;
  background: var(--surface-backdrop-soft);
  backdrop-filter: blur(6px);
}

.journal-drawer__panel {
  position: absolute;
  inset: 14px;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 16px;
  padding: 18px 18px 20px;
  background: var(--surface-overlay);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: 0 30px 80px rgba(19, 19, 17, 0.18);
  overflow: hidden;
}

.journal-drawer__header,
.journal-toolbar,
.journal-toolbar__actions,
.journal-editor-card__head {
  display: flex;
  align-items: center;
}

.journal-drawer__header {
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 4px;
}

.journal-workspace {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.24fr) minmax(360px, 0.88fr);
  gap: 14px;
  height: 100%;
}

.journal-calendar-card,
.journal-editor-card {
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 22px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--panel-strong) 94%, transparent), color-mix(in srgb, var(--panel) 82%, transparent));
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--panel-strong) 72%, transparent);
}

.journal-calendar-card {
  display: grid;
  grid-template-rows: auto 1fr;
  height: 100%;
  padding: 16px;
}

.journal-toolbar {
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.journal-toolbar h3,
.journal-editor-card__head h3 {
  font-size: 1.3rem;
  line-height: 1.14;
  letter-spacing: -0.035em;
}

.journal-toolbar__actions {
  gap: 8px;
  flex-wrap: wrap;
}

.journal-nav-button {
  min-height: 34px;
  padding: 0 12px;
}

.journal-calendar {
  min-height: 0;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 10px;
  height: 100%;
}

.journal-calendar__weekdays {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.journal-calendar__weekdays span {
  color: var(--text-faint-soft);
  font-size: 0.76rem;
  font-weight: 700;
  text-align: center;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.journal-calendar__grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  grid-template-rows: repeat(var(--journal-week-count, 5), minmax(106px, 1fr));
  gap: 8px;
  align-content: start;
  height: 100%;
}

.journal-day {
  min-height: 0;
  height: 100%;
  display: grid;
  grid-template-rows: auto 1fr;
  align-items: start;
  gap: 8px;
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--line) 84%, transparent);
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface-subtle) 88%, var(--panel-strong));
  color: var(--text);
  text-align: left;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.32);
}

.journal-day:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--line-strong) 64%, var(--text));
  background: color-mix(in srgb, var(--surface-hover) 84%, var(--panel-strong));
}

.journal-day.is-other-month {
  background: var(--surface-muted);
  color: var(--text-faint-soft);
}

.journal-day.is-today {
  border-color: color-mix(in srgb, var(--accent) 44%, var(--line-strong));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.24),
    0 0 0 1px color-mix(in srgb, var(--accent) 18%, transparent);
}

.journal-day.is-selected {
  border-color: color-mix(in srgb, var(--accent) 48%, var(--line-strong));
  background: color-mix(in srgb, var(--accent-soft) 36%, var(--panel-strong));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.32),
    0 12px 24px rgba(17, 14, 11, 0.08);
}

.journal-day__number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  min-height: 36px;
  padding: 0 11px;
  border-radius: 999px;
  font-size: 0.94rem;
  font-weight: 800;
  color: var(--text-subtle-strong);
}

.journal-day.is-today .journal-day__number {
  background: var(--accent);
  color: #ffffff;
}

.journal-day__preview {
  display: grid;
  gap: 6px;
  align-content: start;
  color: var(--text-subtle);
  font-size: 0.8rem;
  line-height: 1.38;
  overflow: hidden;
  min-width: 0;
}

.journal-day__preview-line {
  display: block;
  padding-left: 8px;
  border-left: 2px solid color-mix(in srgb, var(--accent) 26%, transparent);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.journal-day__dot {
  width: 8px;
  height: 8px;
  margin-top: auto;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 72%, var(--line));
  opacity: 0.18;
}

.journal-day:has(.journal-day__preview) .journal-day__dot {
  display: none;
}

.journal-editor-card {
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 12px;
  height: 100%;
  padding: 16px;
}

.journal-editor-card__head {
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
}

.journal-save-status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--button-secondary-bg) 78%, transparent);
  border: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.journal-helper {
  color: var(--muted);
  line-height: 1.48;
  font-size: 0.84rem;
}

.journal-editor-field {
  min-height: 0;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 10px;
}

.journal-editor-field textarea {
  min-height: 300px;
  height: 100%;
  max-height: none;
  padding: 16px;
  border-radius: 18px;
  line-height: 1.6;
  font-size: 0.9rem;
}

.life-drawer {
  position: fixed;
  inset: 0;
  z-index: 60;
}

.life-drawer__backdrop {
  position: absolute;
  inset: 0;
  background: var(--surface-backdrop-soft);
  backdrop-filter: blur(6px);
}

.life-drawer__panel {
  position: absolute;
  inset: 14px;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 16px;
  padding: 20px;
  background: var(--surface-overlay);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: 0 30px 80px rgba(19, 19, 17, 0.18);
  overflow: hidden;
}

.life-drawer__header {
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 4px;
}

.life-workspace {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
  gap: 16px;
}

.life-sidebar {
  display: grid;
  grid-template-rows: auto auto auto;
  gap: 12px;
  min-height: 0;
}

.life-sidebar__hero,
.life-sidebar__card {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: color-mix(in srgb, var(--panel-strong) 72%, transparent);
  padding: 16px;
}

.life-sidebar__hero {
  background:
    radial-gradient(circle at top right, color-mix(in srgb, var(--panel) 74%, transparent), transparent 44%),
    color-mix(in srgb, var(--panel-strong) 80%, transparent);
}

.life-sidebar__badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent-soft) 62%, var(--panel-strong));
  color: var(--text);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.life-sidebar__hero h3 {
  margin-top: 14px;
  font-size: 1.34rem;
  line-height: 1.1;
  letter-spacing: -0.04em;
}

.life-sidebar__hero p,
.life-sidebar__note {
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.55;
  font-size: 0.88rem;
}

.life-sidebar__label {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.life-sidebar__list {
  margin: 12px 0 0;
  padding-left: 18px;
  color: var(--text);
  line-height: 1.6;
  font-size: 0.88rem;
}

.life-main {
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 12px;
}

.life-toolbar {
  flex-wrap: wrap;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: color-mix(in srgb, var(--panel-strong) 78%, transparent);
}

.life-title-input {
  flex: 1 1 240px;
  min-height: 50px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel-strong);
  color: var(--text);
  font-size: 1.04rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.life-toolbar__actions {
  flex-wrap: wrap;
  gap: 8px;
}

.life-tool-button {
  min-height: 36px;
  padding: 0 12px;
}

.life-helper {
  color: var(--muted);
  line-height: 1.55;
  padding: 0 4px;
  font-size: 0.84rem;
}

.life-canvas {
  display: flex;
  min-height: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--panel-strong) 94%, transparent), color-mix(in srgb, var(--panel) 78%, transparent));
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--panel-strong) 72%, transparent);
}

.life-editor {
  overflow: auto;
  height: 100%;
  min-height: 100%;
  padding: 12px 10px 24px;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 0.96rem;
  line-height: 1.72;
  outline: none;
}

.life-editor:empty::before {
  content: "Start writing here...";
  color: var(--muted);
}

.life-editor h2,
.life-editor h3 {
  margin: 1.2em 0 0.5em;
  letter-spacing: -0.03em;
}

.life-editor p,
.life-editor ul {
  margin: 0.8em 0;
}

.life-editor img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 14px 0;
  border-radius: 14px;
  border: 1px solid var(--line);
}

.life-editor a {
  color: color-mix(in srgb, var(--accent) 84%, var(--text));
  text-decoration: underline;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.16em;
  word-break: break-word;
}

.life-editor a:hover {
  color: color-mix(in srgb, var(--accent-strong) 84%, var(--text));
}

body.theme-dark .life-editor a {
  color: color-mix(in srgb, var(--accent) 90%, white);
}

body.theme-dark .life-editor a:hover {
  color: color-mix(in srgb, var(--accent-strong) 96%, white);
}

body.theme-dark .calendar-task,
body.theme-dark .calendar-bar,
body.theme-dark .unscheduled-card,
body.theme-dark .task-group,
body.theme-dark .folder-row,
body.theme-dark .task-group__quick-add {
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.04),
    0 18px 36px color-mix(in srgb, var(--folder-accent, #8d8378) 12%, rgba(0, 0, 0, 0.24));
}

body.theme-dark .calendar-bar,
body.theme-dark .calendar-task,
body.theme-dark .unscheduled-card {
  background:
    linear-gradient(
      180deg,
      color-mix(in srgb, var(--folder-accent, #8d8378) 18%, #24282d),
      color-mix(in srgb, var(--folder-bg, #f4f1ea) 14%, #171a1d)
    );
  color: color-mix(in srgb, var(--folder-text, #62584d) 40%, #f4efe5);
  border-color: color-mix(in srgb, var(--folder-accent, #8d8378) 42%, #3f4650);
}

body.theme-dark .folder-pill {
  background: color-mix(in srgb, var(--folder-accent, #8d8378) 22%, #20242a);
  border-color: color-mix(in srgb, var(--folder-accent, #8d8378) 44%, #4a5160);
  color: #f7f1e8;
}

body.theme-dark .tray-schedule-label {
  background: color-mix(in srgb, var(--folder-accent, #8d8378) 18%, #20242a);
  border-color: color-mix(in srgb, var(--folder-accent, #8d8378) 34%, #3f4650);
  color: #ece5da;
}

.life-footer {
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.92rem;
  padding: 0 4px;
}

@media (min-width: 821px) {
  .page-shell {
    padding: 10px 12px 16px;
  }

  .page-header {
    top: 8px;
    gap: 8px;
    margin-bottom: 8px;
    padding: 8px 10px;
  }

  .header-actions,
  .header-actions__secondary {
    gap: 6px;
  }

  .eyebrow {
    margin-bottom: 4px;
    font-size: 0.64rem;
  }

  .panel-shell {
    padding: 10px;
  }

  .planner-layout {
    gap: 8px;
  }

  .panel-head {
    margin-bottom: 8px;
  }

  .calendar-helper {
    display: none;
  }

  .calendar-frame {
    border-radius: 16px;
  }

  .calendar-weekdays {
    margin-bottom: 2px;
  }

  .calendar-weekdays span {
    padding: 0 6px 4px;
    font-size: 0.62rem;
  }

  .calendar-grid {
    gap: 3px;
  }

  .calendar-week {
    border-radius: 14px;
    padding: 3px;
  }

  .week-bars,
  .week-bars--open,
  .week-completed {
    margin-top: 4px;
  }

  .week-completed {
    padding-top: 4px;
  }

  .week-completed__label {
    margin-bottom: 4px;
    font-size: 0.56rem;
  }

  .calendar-day {
    min-height: 44px;
    padding: 5px 5px 4px;
  }

  .day-header {
    margin-bottom: 0;
  }

  .day-tasks {
    gap: 4px;
  }

  .planner-tools {
    margin-top: 0;
  }

  .tool-card {
    padding: 10px;
  }
}

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

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

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

  .folder-row {
    width: 100%;
  }

  .unscheduled-list {
    grid-auto-flow: row;
    grid-auto-columns: unset;
    grid-template-columns: 1fr;
    min-height: 0;
    padding: 0;
  }

  .task-group {
    width: 100%;
  }

  .life-workspace {
    grid-template-columns: 1fr;
  }

  .journal-workspace {
    grid-template-columns: 1fr;
  }

  .journal-calendar__grid {
    grid-template-rows: repeat(var(--journal-week-count, 5), minmax(112px, 1fr));
  }

  .life-sidebar {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: none;
  }
}

@media (max-width: 820px) {
  html {
    font-size: 15px;
  }

  .page-shell {
    padding: 12px 10px 22px;
  }

  .page-header,
  .calendar-head,
  .modal-header {
    align-items: stretch;
  }

  .page-header {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 14px;
  }

  .header-actions,
  .header-actions__secondary {
    width: 100%;
  }

  .header-actions {
    justify-self: stretch;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  #addTaskButton {
    min-width: 0;
    flex: 1 1 auto;
  }

  .header-menu {
    flex: 0 0 auto;
  }

  .header-menu__panel {
    width: min(280px, calc(100vw - 24px));
  }

  .planner-layout {
    gap: 16px;
  }

  .panel-shell,
  .tool-card,
  .modal-card {
    border-radius: 24px;
  }

  .calendar-panel,
  .planner-tools {
    padding: 16px;
  }

  .calendar-helper {
    display: none;
  }

  .tools-grid,
  .toolbar,
  .form-grid,
  .folder-form,
  .folder-list {
    grid-template-columns: 1fr;
  }

  .calendar-frame {
    overflow: visible;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .calendar-weekdays {
    display: none;
  }

  .calendar-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .calendar-day {
    min-height: 0;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--panel);
  }

  .calendar-day.other-month {
    display: none;
  }

  .day-weekday {
    display: inline-block;
  }

  .day-number {
    width: auto;
    height: auto;
    padding: 0;
    border-radius: 0;
    background: transparent;
    font-size: 1.1rem;
  }

  .calendar-day.today .day-number {
    padding: 6px 10px;
    border-radius: 999px;
  }

  .unschedule-dropzone {
    padding: 12px 14px;
    font-size: 0.82rem;
  }

  .task-group__summary {
    padding: 16px 16px 12px;
  }

  .task-group__body {
    padding: 0 14px 14px;
  }

  .task-table,
  .task-table thead,
  .task-table tbody,
  .task-table tr,
  .task-table td {
    display: block;
    width: 100%;
  }

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

  .task-table thead {
    display: none;
  }

  .task-table tbody {
    display: grid;
    gap: 14px;
    padding: 14px;
  }

  .task-table tr {
    padding: 18px;
    border: 1px solid var(--line-soft);
    border-radius: 20px;
    background: var(--panel);
  }

  .task-table td {
    padding: 0;
    border: 0;
  }

  .task-table td + td {
    margin-top: 14px;
  }

  .task-table td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }

  .modal-actions {
    flex-direction: column;
  }

  .journal-drawer__panel,
  .life-drawer__panel {
    inset: 0;
    border-radius: 0;
    padding: 18px 16px;
    border: 0;
  }

  .journal-toolbar,
  .journal-editor-card__head,
  .life-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .journal-calendar__weekdays {
    gap: 6px;
  }

  .journal-calendar__grid {
    gap: 8px;
    grid-template-rows: none;
  }

  .journal-day {
    min-height: 108px;
    padding: 12px;
    border-radius: 16px;
  }

  .journal-day__preview {
    font-size: 0.94rem;
  }

  .journal-editor-field textarea {
    min-height: 320px;
    font-size: 1rem;
  }

  .life-toolbar__actions {
    width: 100%;
  }

  .life-tool-button {
    flex: 1 1 auto;
  }

  .life-sidebar {
    grid-template-columns: 1fr;
  }

  .life-canvas {
    padding: 16px;
    border-radius: 24px;
  }
}
