:root {
  color-scheme: light;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  --page: #f7f6f5;
  --surface: #ffffff;
  --surface-soft: #fbf9f8;
  --line: #e8e4e2;
  --ink: #242121;
  --muted: #716b69;
  --red: #c62830;
  --red-deep: #a71f27;
  --red-tint: #f9eded;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  overflow-x: clip;
}

body {
  min-width: 0;
  min-height: 100vh;
  margin: 0;
  overflow-x: clip;
  background: var(--page);
  color: var(--ink);
}

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

button {
  color: inherit;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 3px;
}

.app-shell {
  min-height: 100vh;
  overflow-x: clip;
}

.topbar {
  position: sticky;
  z-index: 2;
  top: 0;
  display: flex;
  height: 68px;
  align-items: center;
  justify-content: space-between;
  padding: 0 34px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 19px;
  font-weight: 650;
  letter-spacing: -0.75px;
  text-decoration: none;
}

.brand img {
  display: block;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  object-fit: contain;
}

.brand-period {
  color: var(--red);
}

.topbar-label {
  margin-left: auto;
  padding-right: 20px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.8px;
}

.topbar-nav {
  display: none;
  height: 100%;
  align-items: center;
  gap: 7px;
  margin-left: auto;
  padding-right: 20px;
}

.topbar-nav a {
  display: inline-flex;
  height: 36px;
  align-items: center;
  padding: 0 14px;
  border-radius: 20px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 550;
  text-decoration: none;
  transition: background-color 140ms ease, color 140ms ease;
}

.topbar-nav a:hover,
.topbar-nav a.is-current {
  background: var(--red-tint);
  color: var(--red-deep);
}

.avatar {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid #e8caca;
  border-radius: 50%;
  background: var(--red-tint);
  color: var(--red-deep);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  padding: 0;
}

.profile-menu {
  position: relative;
  flex: 0 0 auto;
}

.profile-menu-panel {
  position: absolute;
  z-index: 20;
  top: calc(100% + 10px);
  right: 0;
  display: grid;
  width: min(250px, calc(100vw - 24px));
  gap: 4px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 12px 30px rgb(34 24 24 / 16%);
}

.profile-menu-panel[hidden] {
  display: none;
}

.profile-menu-account {
  display: grid;
  gap: 3px;
  padding: 8px 9px 10px;
  border-bottom: 1px solid var(--line);
}

.profile-menu-account strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-menu-account span {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-menu-panel a,
.profile-menu-panel button {
  display: flex;
  min-height: 38px;
  align-items: center;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  text-align: left;
  text-decoration: none;
}

.profile-menu-panel a:hover,
.profile-menu-panel button:hover,
.profile-menu-panel a:focus-visible,
.profile-menu-panel button:focus-visible {
  outline: none;
  background: var(--red-tint);
  color: var(--red-deep);
}

.profile-menu-panel .profile-menu-signout {
  color: var(--red-deep);
}

.workspace-shell {
  display: grid;
  width: 100%;
  min-height: calc(100vh - 68px);
  grid-template-columns: clamp(216px, 18vw, 256px) minmax(0, 1fr);
  margin: 0;
}

.journal-workspace {
  grid-template-columns: clamp(216px, 18vw, 256px) minmax(0, 1fr);
}

.workspace-shell.sidebar-collapsed {
  grid-template-columns: 0 minmax(0, 1fr);
}

.workspace-shell.sidebar-collapsed .sidebar {
  display: none;
}

.sidebar {
  position: sticky;
  top: 68px;
  align-self: start;
  display: flex;
  height: calc(100vh - 68px);
  flex-direction: column;
  padding: 24px 8px;
  overflow-y: auto;
  scrollbar-width: none;
  border-right: 1px solid var(--line);
  background: var(--surface);
}

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

.sidebar-create {
  display: flex;
  min-height: 46px;
  align-items: center;
  gap: 12px;
  margin: 0 8px 27px;
  padding: 0 17px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: 0 2px 5px rgb(34 24 24 / 8%);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: box-shadow 140ms ease, background-color 140ms ease;
}

.sidebar-create-wrap {
  position: relative;
  margin: 0 8px 27px;
}

.sidebar-create-wrap .sidebar-create {
  width: 100%;
  margin: 0;
  text-decoration: none;
}

.task-creation-menu {
  position: fixed;
  z-index: 1000;
  top: 0;
  left: 0;
  display: grid;
  width: 192px;
  gap: 8px;
}

.task-creation-menu[hidden] {
  display: none;
}

.task-creation-menu button {
  min-height: 54px;
  padding: 0 18px;
  border: 1px solid #eee9e7;
  border-radius: 28px;
  background: #ffffff;
  box-shadow: 0 8px 18px rgb(35 25 25 / 18%);
  color: var(--ink);
  cursor: pointer;
  font-size: 12px;
  font-weight: 550;
  text-align: center;
  transition: background-color 130ms ease, transform 130ms ease;
}

.task-creation-menu button:hover {
  transform: translateY(-1px);
  background: #fff9f8;
}

.sidebar-create:hover {
  background: #fffafa;
  box-shadow: 0 3px 9px rgb(34 24 24 / 13%);
}

.sidebar-create > span {
  color: var(--red);
  font-size: 21px;
  font-weight: 400;
}

.sidebar-label {
  margin: 0 12px 9px;
  color: #85807e;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1px;
}

.filter-nav {
  display: grid;
  gap: 3px;
}

.workspace-nav {
  display: grid;
  gap: 3px;
  margin-bottom: 28px;
}

.filter-option {
  display: grid;
  min-height: 43px;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  border: 0;
  border-radius: 0 24px 24px 0;
  background: transparent;
  color: #4a4543;
  cursor: pointer;
  font-size: 12px;
  text-align: left;
  text-decoration: none;
  transition: background-color 130ms ease, color 130ms ease;
}

.filter-option:hover {
  background: #f8f4f3;
}

.filter-option.is-active,
.filter-option.is-current {
  background: #f8eaea;
  color: var(--red-deep);
  font-weight: 650;
}

.filter-icon {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  color: #77706e;
  font-size: 17px;
}

.is-active .filter-icon,
.is-current .filter-icon {
  color: var(--red);
}

.all-icon {
  font-size: 15px;
}

.planned-icon {
  font-size: 20px;
}

.filter-count {
  color: var(--muted);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.category-label {
  margin-top: 31px;
}

.category-nav {
  gap: 1px;
}

.category-nav .filter-option {
  min-height: 38px;
}

.category-dot {
  width: 9px;
  height: 9px;
  justify-self: center;
  border-radius: 50%;
  background: var(--red);
}

.dot-personal {
  background: #6b5b58;
}

.dot-fitness {
  background: #8d6453;
}

.dot-routine {
  background: #b37b5e;
}

.dot-savings {
  background: #647d67;
}

.dot-other {
  background: #8d8986;
}

.sidebar-note {
  display: grid;
  grid-template-columns: 23px 1fr;
  align-items: center;
  gap: 2px 8px;
  margin: auto 7px 0;
  padding: 15px 11px;
  border-top: 1px solid var(--line);
}

.sidebar-note-mark {
  grid-row: 1 / span 2;
  color: var(--red);
  font-size: 18px;
}

.sidebar-note p {
  margin: 0;
  font-size: 11px;
  font-weight: 650;
}

.sidebar-note > span:last-child {
  color: var(--muted);
  font-size: 10px;
}

.page-content {
  width: 100%;
  max-width: 1480px;
  margin: 0 auto;
  padding: 48px clamp(24px, 3vw, 44px) 64px;
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 25px;
  margin-bottom: 35px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.8px;
}

.eyebrow span {
  padding: 0 5px;
  color: #b3abaa;
}

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

h1 {
  margin-bottom: 11px;
  font-size: clamp(29px, 3.4vw, 40px);
  font-weight: 580;
  letter-spacing: -1.6px;
  line-height: 1.15;
}

h1 span {
  color: var(--red);
}

.page-description {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid transparent;
  border-radius: 7px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 650;
  transition: background-color 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.primary-button {
  flex: 0 0 auto;
  padding: 0 16px;
  background: var(--red);
  color: #ffffff;
}

.primary-button:hover {
  background: var(--red-deep);
  box-shadow: 0 2px 5px rgb(115 23 28 / 20%);
}

.button-plus {
  font-size: 19px;
  font-weight: 400;
  line-height: 1;
}

.page-content:has(.task-board) {
  max-width: 980px;
}

.task-board {
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.task-board .section-heading {
  min-height: 0;
  padding: 0 0 14px;
  border-bottom: 1px solid var(--line);
}

.task-board .task-toolbar {
  margin-bottom: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
}

.section-heading {
  display: flex;
  min-height: 79px;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 17px 22px;
  border-bottom: 1px solid var(--line);
}

.section-kicker {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.65px;
}

.section-heading h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -0.2px;
}

.record-toolbar {
  display: flex;
  min-height: 52px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 8px 20px;
  border-bottom: 1px solid var(--line);
  background: #fdfcfb;
}

.sort-control,
.selection-controls,
.select-all-control {
  display: inline-flex;
  align-items: center;
}

.sort-control {
  gap: 8px;
  color: var(--muted);
  font-size: 10px;
}

.sort-control select {
  min-height: 32px;
  padding: 0 25px 0 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  font-size: 10px;
}

.selection-controls {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.select-all-control,
.record-selection {
  gap: 7px;
  color: var(--muted);
  cursor: pointer;
  font-size: 10px;
}

.select-all-control input,
.record-checkbox {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--red);
}

.selection-count {
  color: var(--muted);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.bulk-delete:disabled {
  border-color: transparent;
  background: transparent;
  color: #aaa4a1;
  cursor: not-allowed;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  clip-path: inset(50%);
}

.task-count {
  color: var(--muted);
  font-size: 11px;
}

.task-list {
  display: grid;
  margin: 0;
  padding: 0 20px;
  list-style: none;
}

.empty-state {
  display: flex;
  min-height: 255px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 30px 14px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.empty-icon {
  display: grid;
  width: 42px;
  height: 42px;
  margin-bottom: 3px;
  place-items: center;
  border: 1px solid #ead3d2;
  border-radius: 50%;
  background: #fff9f8;
  color: var(--red);
  font-size: 22px;
  font-weight: 350;
}

.empty-title {
  color: var(--ink);
  font-size: 14px;
  font-weight: 650;
}

.empty-description {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.empty-action {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 5px;
  padding: 4px 0;
  border: 0;
  background: transparent;
  color: var(--red-deep);
  cursor: pointer;
  font-size: 11px;
  font-weight: 650;
}

.empty-action:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.record-action {
  min-height: 30px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: #5f5957;
  cursor: pointer;
  font-size: 10px;
  font-weight: 600;
  transition: background-color 130ms ease, border-color 130ms ease, color 130ms ease;
}

.record-action:hover {
  border-color: var(--line);
  background: #ffffff;
  color: var(--ink);
}

.record-action.record-delete:hover {
  border-color: #efcdcc;
  background: #fff7f6;
  color: var(--red-deep);
}

.priority-medium {
  background: #f9eded;
  color: #9c3338;
}

.priority-high {
  background: var(--red);
  color: #ffffff;
}

.save-notice {
  min-height: 17px;
  margin: 12px 2px 0;
  color: var(--muted);
  font-size: 10px;
}

.save-notice.is-error,
.journal-notice.is-error {
  color: var(--red-deep);
}

dialog:modal {
  overscroll-behavior: contain;
}

dialog::backdrop {
  overflow: hidden;
  overscroll-behavior: contain;
}

.task-dialog {
  width: min(100% - 32px, 540px);
  max-width: 540px;
  max-height: min(90vh, 810px);
  max-height: min(90dvh, 810px);
  padding: 0;
  overflow: auto;
  border: 1px solid #ded8d6;
  border-radius: 14px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 20px 60px rgb(27 18 18 / 25%);
}

.task-dialog:not(.journal-entry-dialog):not(.task-detail-dialog) {
  overflow: hidden;
}

.task-dialog:not(.journal-entry-dialog):not(.task-detail-dialog)[open] {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.task-dialog::backdrop {
  background: rgb(25 20 20 / 48%);
  backdrop-filter: blur(2px);
}

.task-form {
  padding: 26px 28px 20px;
}

.task-dialog > .task-form {
  display: grid;
  min-width: 0;
  min-height: 0;
  max-height: min(90vh, 810px);
  max-height: min(90dvh, 810px);
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  padding: 0;
  overflow: hidden;
  background: inherit;
}

.task-dialog > .task-form > * {
  min-width: 0;
}

.task-dialog > .task-form > .dialog-header {
  padding: 22px 26px 18px;
  background: inherit;
}

.task-dialog > .task-form > .form-fields {
  min-width: 0;
  min-height: 0;
  grid-template-columns: minmax(0, 1fr);
  padding: 20px 26px 22px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.task-dialog > .task-form > .dialog-footer {
  padding: 14px 26px 18px;
  background: inherit;
}

.task-dialog > .task-form > .settings-feedback {
  margin: 0;
  padding: 0 26px 16px;
}

.task-dialog > .task-form > .settings-feedback:empty {
  display: none;
}

.task-form .field :is(input, select, textarea):focus-visible {
  border-color: var(--red);
  outline: 2px solid var(--red);
  outline-offset: 0;
}

.dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 21px;
  border-bottom: 1px solid var(--line);
}

.dialog-header .eyebrow {
  margin-bottom: 9px;
  font-size: 9px;
  letter-spacing: 0.9px;
}

.dialog-header h2 {
  margin-bottom: 7px;
  font-size: 24px;
  font-weight: 620;
  letter-spacing: -0.8px;
}

.dialog-description {
  max-width: 390px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

.icon-button {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}

.icon-button:hover,
.secondary-button:hover {
  border-color: #d3b8b7;
  background: #fcf6f5;
  color: var(--red-deep);
}

.form-fields {
  display: grid;
  gap: 17px;
  padding: 21px 0 22px;
}

.field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 14px;
}

.task-classification-fields {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

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

.field label {
  color: #393332;
  font-size: 11px;
  font-weight: 620;
}

.required-mark {
  color: var(--red);
}

.optional-label {
  margin-left: 5px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.55px;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 41px;
  padding: 10px 11px;
  border: 1px solid #ddd7d5;
  border-radius: 7px;
  background: #ffffff;
  color: var(--ink);
  font-size: 12px;
}

.field textarea {
  min-height: 73px;
  resize: vertical;
  line-height: 1.55;
}

.field input::placeholder,
.field textarea::placeholder {
  color: #89817f;
}

.field input[type="date"],
.field input[type="datetime-local"] {
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background-color: var(--surface);
  color: var(--ink);
  color-scheme: light;
  accent-color: var(--red);
  cursor: pointer;
}

.field input[type="date"]:focus-visible,
.field input[type="datetime-local"]:focus-visible {
  border-color: var(--red);
  outline: 3px solid rgb(178 48 64 / 15%);
  outline-offset: 1px;
}

.date-picker {
  position: relative;
  min-width: 0;
}

.date-picker-input {
  min-height: 44px !important;
  padding-right: 42px !important;
  border-color: var(--line) !important;
  border-radius: 9px !important;
  background: var(--surface) !important;
  color: var(--ink) !important;
  cursor: pointer;
  text-overflow: ellipsis;
}

.date-picker-input::placeholder {
  color: var(--muted);
}

.date-picker-icon {
  position: absolute;
  top: 50%;
  right: 13px;
  color: var(--red);
  font-size: 15px;
  line-height: 1;
  pointer-events: none;
  transform: translateY(-50%);
}

.quick-notification-section {
  display: grid;
  min-width: 0;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
}

.quick-notification-section h3 {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
}

.quick-notification-section p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.quick-notification-section p a {
  color: var(--red-deep);
  font-weight: 650;
  text-underline-offset: 2px;
}

.quick-notification-section .field {
  gap: 6px;
}

.date-picker-popover {
  position: fixed;
  z-index: 1000;
  top: 0;
  left: 0;
  width: min(320px, calc(100vw - 42px));
  max-height: min(410px, calc(100vh - 24px));
  max-height: min(410px, calc(100dvh - 24px));
  overflow-y: auto;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 14px 36px rgb(34 24 24 / 18%);
}

.date-picker-header {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 36px;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  text-align: center;
}

.date-picker-month {
  font-size: 13px;
  font-weight: 700;
}

.date-picker-nav {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
  color: var(--ink);
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}

.date-picker-nav:disabled {
  color: var(--muted);
  cursor: not-allowed;
  opacity: 0.45;
}

.date-picker-weekdays,
.date-picker-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 3px;
}

.date-picker-weekdays {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  text-align: center;
  text-transform: uppercase;
}

.date-picker-weekdays span {
  padding: 5px 0;
}

.date-picker-day {
  display: grid;
  min-width: 0;
  min-height: 35px;
  place-items: center;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.date-picker-day:hover:not(:disabled) {
  background: var(--red-tint);
  color: var(--red-deep);
}

.date-picker-day.is-outside-month {
  color: var(--muted);
  opacity: 0.58;
}

.date-picker-day.is-today {
  box-shadow: inset 0 0 0 1px var(--red);
  color: var(--red-deep);
  font-weight: 700;
}

.date-picker-day.is-selected {
  background: var(--red);
  color: #fff;
  font-weight: 700;
  opacity: 1;
}

.date-picker-day:disabled {
  color: #b7b0ae;
  cursor: not-allowed;
  opacity: 0.42;
}

.date-picker-footer {
  display: flex;
  justify-content: space-between;
  margin-top: 9px;
  padding-top: 9px;
  border-top: 1px solid var(--line);
}

.date-picker-footer button {
  min-height: 32px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--red-deep);
  cursor: pointer;
  font-size: 11px;
  font-weight: 650;
}

.date-picker-footer button:hover:not(:disabled) {
  background: var(--red-tint);
}

.date-picker-footer button:disabled {
  color: var(--muted);
  cursor: not-allowed;
  opacity: 0.5;
}

.due-date-time-fields {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  align-items: end;
  gap: 9px;
}

.time-picker {
  position: relative;
  min-width: 0;
}

.time-picker-trigger {
  display: flex;
  width: 100%;
  min-height: 44px;
  align-items: center;
  gap: 8px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  text-align: left;
}

.time-picker-trigger:hover,
.time-picker-trigger[aria-expanded="true"] {
  border-color: #d7a8aa;
  background: var(--red-tint);
}

.time-picker-trigger:focus-visible {
  outline: 3px solid rgb(178 48 64 / 15%);
  outline-offset: 1px;
}

.time-picker-trigger svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.time-picker-label {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  color: var(--ink);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.time-picker-chevron {
  color: var(--muted);
  font-size: 12px;
}

.time-picker-popover {
  position: fixed;
  z-index: 1000;
  top: 0;
  left: 0;
  width: min(330px, calc(100vw - 42px));
  max-height: min(260px, calc(100vh - 24px));
  max-height: min(260px, calc(100dvh - 24px));
  overflow-y: auto;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
  box-shadow: 0 14px 36px rgb(34 24 24 / 18%);
}

.time-picker-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.time-picker-part {
  display: grid;
  min-width: 0;
  gap: 5px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 650;
}

.time-picker-part select {
  width: 100%;
  min-height: 38px;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 11px;
}

.time-picker-message {
  margin: 8px 0 0;
  color: var(--red-deep);
  font-size: 10px;
}

.time-picker-footer {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid var(--line);
}

.time-picker-footer button {
  min-height: 32px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--red-deep);
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  font-weight: 650;
}

.time-picker-footer button:hover {
  background: var(--red-tint);
}

.time-picker-footer .time-picker-apply {
  background: var(--red);
  color: #fff;
}

.time-picker-footer .time-picker-apply:hover {
  background: var(--red-deep);
}

.input-with-suffix {
  position: relative;
}

.input-with-suffix input {
  padding-right: 64px;
}

.input-with-suffix > span {
  position: absolute;
  top: 50%;
  right: 11px;
  color: var(--muted);
  font-size: 10px;
  pointer-events: none;
  transform: translateY(-50%);
}

.field-hint {
  margin: -2px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.dialog-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.dialog-footer > p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
}

.footer-actions {
  display: flex;
  gap: 9px;
}

.secondary-button {
  min-height: 40px;
  padding: 0 14px;
  border-color: var(--line);
  background: transparent;
  color: #393130;
  font-size: 12px;
}

.dialog-footer .primary-button {
  min-height: 40px;
  font-size: 12px;
}

.journal-content {
  width: min(100% - 64px, 1020px);
  margin: 0 auto;
  padding: 48px 0 84px;
}

.journal-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 36px;
}

.journal-heading-actions {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: flex-end;
  gap: 16px;
}

.journal-new-entry {
  min-height: 42px;
}

.journal-heading h1 {
  margin-bottom: 11px;
  font-size: clamp(32px, 4vw, 46px);
}

.journal-date-mark {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 11px;
}

.journal-layout {
  display: block;
}

.journal-composer {
  padding: 25px 27px 19px;
  border: 1px solid #e7e2e0;
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 1px 2px rgb(28 20 20 / 3%);
}

.journal-entry-dialog {
  width: min(100% - 32px, 620px);
  max-width: 620px;
  max-height: min(90vh, 820px);
  padding: 25px 27px 19px;
}

.journal-entry-dialog .composer-heading {
  position: relative;
  padding-right: 42px;
}

.journal-entry-dialog .composer-heading .icon-button {
  position: absolute;
  top: 0;
  right: 0;
}

.composer-heading {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.composer-number {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: var(--red-tint);
  color: var(--red-deep);
  font-size: 12px;
  font-weight: 650;
}

.composer-heading .section-kicker,
.feed-heading .section-kicker {
  margin-bottom: 5px;
}

.composer-heading h2,
.feed-heading h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 650;
  letter-spacing: -0.3px;
}

.journal-composer .field {
  margin-bottom: 17px;
}

.journal-composer textarea {
  min-height: 155px;
  padding: 14px 15px;
}

.journal-composer #entry-content {
  line-height: 1.7;
}

.entry-meta {
  display: flex;
  min-height: 14px;
  justify-content: space-between;
  gap: 12px;
}

.character-count {
  color: var(--muted);
  font-size: 9px;
  text-align: right;
}

.field-error {
  color: var(--red-deep);
  font-size: 10px;
}

.journal-fields {
  margin-bottom: 19px;
}

.composer-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.local-save-note {
  margin: 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.5;
}

.composer-footer .primary-button {
  min-height: 40px;
  font-size: 11px;
}

.composer-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}

.composer-actions .secondary-button {
  min-height: 40px;
  font-size: 10px;
}

.journal-notice {
  min-height: 14px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.journal-feed {
  min-width: 0;
}

.feed-heading {
  display: flex;
  min-height: 82px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.feed-count {
  display: inline-grid;
  min-width: 22px;
  height: 22px;
  place-items: center;
  margin-left: 5px;
  border-radius: 50%;
  background: #f0eeed;
  color: var(--muted);
  font-size: 10px;
  vertical-align: 2px;
}

.field.journal-note-title-field input,
.journal-note-title-input {
  width: 100%;
  min-height: 0;
  padding: 4px 2px 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--ink);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.02em;
  outline: none;
}

.field.journal-note-title-field input:focus,
.field.journal-note-title-field input:focus-visible,
.journal-note-title-input:focus,
.journal-note-title-input:focus-visible {
  border-bottom-color: var(--red);
  outline: none;
  outline-offset: 0;
}

.field.journal-note-body-field textarea,
.journal-note-body-input {
  width: 100%;
  min-height: 150px;
  padding: 8px 2px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.7;
  resize: vertical;
  outline: none;
}

.field.journal-note-body-field textarea:focus,
.field.journal-note-body-field textarea:focus-visible,
.journal-note-body-input:focus,
.journal-note-body-input:focus-visible {
  outline: none;
  outline-offset: 0;
}

.journal-fields {
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.feed-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 16px 0 0;
}

.journal-empty {
  grid-column: 1 / -1;
  display: flex;
  min-height: 235px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.journal-empty .empty-icon {
  font-size: 18px;
}

.journal-empty strong {
  color: var(--ink);
  font-size: 13px;
}

.journal-entry {
  padding: 22px 0 23px;
  border-bottom: 1px solid var(--line);
  animation: entry-arrive 220ms ease both;
}

.entry-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 10px;
}

.entry-card-meta-details {
  display: flex;
  min-height: 30px;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
}

.mood-tag {
  padding: 4px 8px;
  border-radius: 12px;
  background: var(--red-tint);
  color: var(--red-deep);
  font-size: 9px;
  font-weight: 550;
}

.journal-entry h3 {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.2px;
}

.entry-card-content {
  margin: 0;
  color: #4e4846;
  font-size: 12px;
  line-height: 1.8;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

@keyframes entry-arrive {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 760px) {
  .topbar {
    height: 62px;
    padding: 0 16px;
  }

  .topbar-nav {
    display: none;
  }

  .topbar-label {
    display: none;
  }

  .workspace-shell {
    grid-template-columns: minmax(0, 1fr);
    align-content: start;
    min-width: 0;
    max-width: 100%;
    overflow-x: clip;
  }

  .sidebar {
    position: static;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    height: auto;
    min-height: 0;
    padding: 0;
    overflow: visible;
    border-right: 0;
    border-bottom: 0;
    background: transparent;
    box-shadow: none;
  }

  .sidebar:has(.filter-nav),
  .sidebar:has(.category-nav) {
    position: sticky;
    z-index: 3;
    top: 62px;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    overflow-x: hidden;
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 7px;
    padding: 9px 12px 10px;
    border-bottom: 1px solid var(--line);
    background: var(--surface);
    box-shadow: 0 5px 16px rgb(34 24 24 / 5%);
  }

  .sidebar-create,
  .sidebar-create-wrap,
  .sidebar-label,
  .sidebar-note {
    display: none;
  }

  .workspace-nav {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 40;
    display: grid;
    width: 100%;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 4px;
    margin: 0;
    padding: 6px 8px calc(10px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: var(--surface, #fff);
    box-shadow: 0 -4px 18px rgb(34 24 24 / 8%);
  }

  .workspace-nav a[href*="calendar.html"],
  .workspace-nav a[href*="pet.html"],
  .workspace-nav a[href*="settings.html"] {
    display: none;
  }

  .workspace-nav a[href*="index.html"] { order: 1; }
  .workspace-nav a[href*="tasks.html"] { order: 2; }
  .workspace-nav a[href*="ai.html"] { order: 3; }
  .workspace-nav a[href*="journal.html"] { order: 4; }
  .workspace-nav a[href*="stats.html"] { order: 5; }

  .workspace-nav a[href*="ai.html"] .filter-icon {
    color: var(--red);
  }

  body.mobile-input-focused .workspace-nav {
    display: none;
  }

  .workspace-nav .filter-option {
    display: grid;
    width: 100%;
    min-width: 0;
    min-height: 46px;
    grid-template-columns: minmax(0, 1fr);
    align-content: center;
    justify-items: center;
    gap: 2px;
    padding: 4px 2px;
    border-radius: 12px;
    font-size: 10px;
    text-align: center;
  }

  .workspace-nav .filter-option > span:last-child {
    overflow-wrap: anywhere;
    line-height: 1.15;
  }

  .workspace-nav .filter-icon {
    width: 20px;
    height: 20px;
    font-size: 15px;
  }

  .sidebar:has(.filter-nav) .sidebar-label,
  .sidebar:has(.category-nav) .sidebar-label {
    display: block;
    margin: 1px 3px 0;
    color: var(--muted);
    font-size: 8px;
  }

  .filter-nav,
  .category-nav {
    display: flex;
    width: 100%;
    flex: 0 0 auto;
    gap: 6px;
    margin: 0;
    padding: 0 0 2px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .filter-nav::-webkit-scrollbar,
  .category-nav::-webkit-scrollbar {
    display: none;
  }

  .filter-nav > .filter-option,
  .category-nav .filter-option {
    width: auto;
    min-width: max-content;
    min-height: 34px;
    grid-template-columns: 18px auto;
    gap: 6px;
    padding: 0 11px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--surface);
    font-size: 10px;
  }

  .filter-nav > .filter-option.is-active,
  .category-nav .filter-option.is-active {
    border-color: #efc7c8;
    background: var(--red-tint);
  }

  .filter-count {
    display: none;
  }

  .filter-icon {
    width: 18px;
    font-size: 15px;
  }

  .category-dot {
    width: 7px;
    height: 7px;
  }

  .page-content {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    padding: 27px 18px calc(92px + env(safe-area-inset-bottom));
  }

  .page-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 26px;
  }

  .journal-content {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    padding: 27px 18px calc(92px + env(safe-area-inset-bottom));
  }

  .journal-heading-actions {
    align-items: flex-start;
    flex-direction: row;
    justify-content: space-between;
    width: 100%;
  }

  .feed-heading {
    min-height: 68px;
  }

  .record-toolbar {
    padding-right: 14px;
    padding-left: 14px;
  }
}

@media (max-width: 560px) {
  .topbar {
    height: 62px;
    padding: 0 16px;
  }

  .topbar-nav {
    gap: 1px;
    padding-right: 8px;
  }

  .topbar-nav a {
    padding: 0 10px;
    font-size: 11px;
  }

  .workspace-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    min-height: calc(100vh - 62px);
  }

  .sidebar {
    padding: 0;
  }

  .sidebar:has(.filter-nav),
  .sidebar:has(.category-nav) {
    gap: 6px;
    padding: 8px 9px 9px;
  }

  .workspace-nav {
    gap: 2px;
    padding: 6px 6px calc(10px + env(safe-area-inset-bottom));
  }

  .workspace-nav .filter-option {
    min-height: 48px;
    padding: 5px 2px;
    gap: 3px;
    border-radius: 10px;
    font-size: 10px;
  }

  .page-content {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    padding: 23px 14px calc(92px + env(safe-area-inset-bottom));
  }

  .journal-content {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    padding: 23px 14px calc(92px + env(safe-area-inset-bottom));
  }

  .date-picker-popover {
    width: min(320px, calc(100vw - 32px));
    padding: 11px;
  }

  .date-picker-day {
    min-height: 34px;
  }

  .journal-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 25px;
  }

  .journal-heading h1 {
    font-size: clamp(31px, 9vw, 39px);
  }

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

  .composer-footer .primary-button {
    width: 100%;
  }

  .composer-actions {
    width: 100%;
  }

  .composer-actions button {
    flex: 1;
  }

  .page-heading {
    gap: 17px;
    margin-bottom: 23px;
  }

  h1 {
    font-size: clamp(28px, 8vw, 36px);
  }

  .page-heading .primary-button {
    width: 100%;
  }

  .section-heading {
    min-height: 69px;
    padding: 14px 16px;
  }

  .record-toolbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
    padding: 11px 14px;
  }

  .selection-controls {
    width: 100%;
    justify-content: flex-start;
    gap: 9px;
  }

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

  .empty-state {
    min-height: 230px;
  }

  .record-action {
    min-height: 32px;
  }

  .entry-card-meta {
    flex-direction: column;
  }

  .journal-entry .entry-card-meta {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    width: 100%;
  }

  .journal-entry .entry-card-meta-details {
    min-height: 0;
  }

  .journal-entry .record-actions {
    margin-left: auto;
  }

  .task-form {
    padding: 22px 18px 17px;
  }

  .task-dialog > .task-form > .dialog-header {
    padding: 16px 18px 14px;
  }

  .task-dialog > .task-form > .form-fields {
    padding: 16px 18px 18px;
  }

  .task-dialog > .task-form > .dialog-footer {
    padding: 12px 18px 14px;
    gap: 8px;
  }

  .task-dialog > .task-form > .settings-feedback {
    padding: 0 18px 14px;
  }

  .dialog-header h2 {
    font-size: 21px;
  }

  .field-row {
    grid-template-columns: 1fr;
    gap: 17px;
  }

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

  .journal-entry-dialog {
    max-height: 90vh;
    padding: 20px 17px 15px;
  }

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

  .footer-actions {
    width: 100%;
  }

  .footer-actions button {
    flex: 1;
  }
}

.task-item-title:hover {
  text-decoration: underline;
  text-decoration-color: currentColor;
  text-underline-offset: 3px;
}

.task-item-title:focus-visible {
  border-radius: 3px;
  outline: 2px solid #4976a5;
  outline-offset: 3px;
}

.task-ai-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.task-voice-icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.weekly-picker { display: grid; gap: 10px; }
.weekly-picker-label { color: #393332; font-size: 11px; font-weight: 620; }
.weekday-buttons { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 7px; }
.weekday-button { min-width: 0; min-height: 62px; border: 1px solid #d8cfcd; border-radius: 999px; background: var(--surface); color: var(--ink); cursor: pointer; }
.weekday-button span { display: block; font-size: 10px; font-weight: 700; }
.weekday-button strong { display: block; margin-top: 4px; font-size: 14px; }
.weekday-button.is-selected { border-color: var(--red); background: var(--red); color: #fff; }
.field-error { margin: 0; color: var(--red-deep); font-size: 11px; }
.text-button { width: fit-content; padding: 0; border: 0; background: transparent; color: var(--red-deep); cursor: pointer; font-size: 11px; }
.inline-category { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px; }
.goal-hint { margin: 2px 0 0; color: var(--muted); font-size: 12px; }
.step-compose { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.step-list { display: grid; gap: 7px; }
.step-row { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: center; gap: 8px; }
.step-row input { width: 100%; }
.step-number { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 50%; background: var(--red-tint); color: var(--red-deep); font-size: 11px; font-weight: 700; }
.step-row-actions { display: flex; gap: 4px; }
.step-row button { width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); cursor: pointer; }
.step-row button:disabled { opacity: 0.4; cursor: default; }
.field-label-row { display: flex; min-height: 0; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 0; line-height: 1.2; }
.field-label-row label { margin: 0; }
.field-label-row .text-button { flex: 0 0 auto; white-space: nowrap; }
.steps-heading { display: grid; gap: 4px; }
.steps-heading .field-hint { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.task-detail-tabs { display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid var(--line); }
.task-detail-tabs button { min-height: 44px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); cursor: pointer; font-size: 12px; font-weight: 650; }
.task-detail-tabs button[aria-selected="true"] { border-bottom-color: var(--red); color: var(--red-deep); }
.task-detail-meta { margin: 7px 0 0; color: var(--muted); font-size: 11px; }
.progressive-detail { display: grid; gap: 12px; margin-bottom: 18px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-soft); }
.detail-step-summary { display: grid; gap: 8px; color: var(--muted); font-size: 12px; font-weight: 650; }
.detail-step-progress-track { display: block; height: 7px; overflow: hidden; border-radius: 999px; background: var(--line); }
.task-more-options {
  border-top: 1px dashed var(--line);
  padding-top: 10px;
}

.task-more-options > summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--red-deep);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

.task-more-options > summary::-webkit-details-marker {
  display: none;
}

.task-more-options-body {
  display: grid;
  gap: 14px;
  margin-top: 12px;
}

.detail-step-progress-track > span { display: block; height: 100%; border-radius: inherit; background: #2f855a; transition: width 180ms ease; }
.detail-step-list { display: grid; gap: 8px; }
.detail-step { display: grid; width: 100%; min-width: 0; min-height: 54px; grid-template-columns: 22px 28px minmax(0, 1fr); align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); cursor: pointer; }
.detail-step input { width: 17px; height: 17px; margin: 0; accent-color: var(--red); }
.detail-step-number { display: grid; width: 26px; height: 26px; place-items: center; border-radius: 50%; background: var(--surface-soft); color: var(--muted); font-size: 11px; font-weight: 700; }
.detail-step-title { min-width: 0; color: var(--ink); font-size: 13px; line-height: 1.45; overflow-wrap: anywhere; }
.detail-step.is-complete { border-color: #dce5dd; background: #f8fbf8; }
.detail-step.is-complete .detail-step-number { background: #e7f0e8; color: #39804e; }
.detail-step.is-complete .detail-step-title { color: var(--muted); text-decoration: line-through; }
.goal-progress-heading { display: flex; align-items: baseline; justify-content: space-between; }
.goal-progress-heading strong { color: var(--red-deep); font-size: 28px; }
.goal-progress-track { height: 12px; overflow: hidden; border-radius: 999px; background: #e9e2e0; }
.goal-progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--red); transition: width 500ms ease, box-shadow 500ms ease; }
.goal-progress-track.is-glowing span { box-shadow: 0 0 16px 5px rgb(178 48 64 / 55%); }
.goal-progress-summary { margin: 0; color: var(--muted); font-size: 12px; }
.goal-add-form { display: grid; gap: 7px; }
.goal-add-form > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.goal-history h3 { margin: 4px 0 8px; font-size: 13px; }
.goal-history-item { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 8px; min-height: 36px; border-top: 1px solid var(--line); font-size: 12px; }
.goal-celebration { color: var(--red-deep); font-size: 16px; font-weight: 750; text-align: center; animation: goalFade 1.5s ease; }
@keyframes goalFade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.goal-confetti { position: fixed; z-index: 9999; width: 8px; height: 8px; pointer-events: none; animation: confetti 2s ease-out forwards; }
@keyframes confetti { to { transform: translate(var(--x), var(--y)) rotate(540deg); opacity: 0; } }

.task-detail-dialog {
  width: min(100% - 24px, 780px);
  max-width: 780px;
  height: fit-content;
  max-height: min(90vh, 900px);
  max-height: min(90dvh, 900px);
  overflow: hidden;
}

.task-detail-dialog[open] {
  display: flex;
  flex-direction: column;
}

.task-detail-shell {
  display: grid;
  flex: 0 1 auto;
  min-width: 0;
  min-height: 0;
  max-height: min(90vh, 900px);
  max-height: min(90dvh, 900px);
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto minmax(0, 1fr) auto;
}

#journal-detail-dialog .task-detail-shell,
.task-detail-shell:not(:has(.task-detail-tabs)) {
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.task-detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--line);
}

.task-detail-header h2 {
  margin: 0;
  color: var(--ink);
  font-size: 22px;
  overflow-wrap: anywhere;
}

.task-detail-header .eyebrow {
  margin: 0 0 6px;
}

.task-detail-content {
  display: grid;
  align-content: start;
  min-height: 0;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  padding: 16px 22px;
  overflow-y: auto;
}

.task-detail-tab-panel,
.task-detail-steps,
.detail-step-list {
  width: 100%;
  min-width: 0;
}

.task-detail-section {
  display: grid;
  align-content: start;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
  width: 100%;
  min-width: 0;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.task-detail-section:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.task-detail-section h3 {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
}

#task-detail-description,
#task-detail-deadline {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

#task-detail-description {
  white-space: pre-wrap;
}

#task-detail-deadline {
  color: var(--red-deep);
  font-weight: 650;
}

.task-journal-list {
  display: grid;
  max-height: 320px;
  gap: 9px;
  overflow-y: auto;
}

.task-journal-entry {
  display: grid;
  gap: 5px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.task-journal-entry h4 {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
}

.task-journal-entry time {
  color: var(--muted);
  font-size: 10px;
}

.task-journal-entry p {
  margin: 3px 0 0;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.55;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.task-journal-empty {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.task-detail-journal-form {
  display: grid;
  gap: 8px;
  justify-items: start;
  margin-top: 3px;
}

.task-detail-journal-form label {
  color: var(--ink);
  font-size: 11px;
  font-weight: 650;
}

.task-detail-journal-form textarea {
  width: 100%;
  min-height: 72px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  resize: vertical;
}

.task-detail-status {
  min-height: 15px;
  margin: 0;
  color: var(--muted);
  font-size: 10px;
}

.task-detail-status.is-error {
  color: var(--red-deep);
}

.task-detail-chat-messages {
  min-height: 130px;
  max-height: 250px;
}

.task-detail-chat-form textarea {
  min-height: 56px;
}

.task-detail-footer {
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 12px 26px 18px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.task-detail-status:empty {
  display: none;
}

.task-detail-actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
}

.task-detail-actions #task-finish-task {
  margin-left: auto;
}

.task-detail-actions .record-delete {
  color: var(--red-deep);
}

.task-detail-actions .primary-button:disabled {
  cursor: default;
  opacity: 0.65;
}

:root[data-theme="dark"] .task-detail-dialog {
  border-color: #49413f;
}

:root[data-theme="dark"] .task-journal-entry,
:root[data-theme="dark"] .task-detail-journal-form textarea {
  background: #282423;
}

:root[data-theme="dark"] #task-detail-deadline {
  color: #ff9a9f;
}

@media (max-width: 560px) {
  .task-detail-header {
    padding: 18px 17px 14px;
  }

  .task-detail-header h2 {
    font-size: 20px;
  }

  .task-detail-content {
    gap: 13px;
    padding: 15px 17px;
  }

  .task-detail-footer {
    padding: 10px 17px 14px;
  }

  .task-detail-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .task-detail-actions #task-finish-task {
    grid-column: 1 / -1;
  }

  .task-detail-actions #journal-detail-delete {
    grid-column: 1 / -1;
    min-height: 38px;
    border: 1px solid #efcdcc;
    border-radius: 10px;
    background: #fff7f6;
  }

  :root[data-theme="dark"] .task-detail-actions #journal-detail-delete {
    border-color: #6b383a;
    background: #3a2021;
  }
}

/* Dashboard */
.dashboard-content {
  width: min(100%, 1120px);
  max-width: 1120px;
}

.dashboard-heading {
  margin-bottom: 24px;
}

.week-strip {
  display: grid;
  grid-template-columns: 165px minmax(0, 1fr);
  align-items: center;
  min-height: 92px;
  margin-bottom: 18px;
  border: 1px solid #e7e2e0;
  border-radius: 12px;
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.week-strip:hover {
  border-color: #e6bfc1;
  box-shadow: 0 3px 10px rgb(34 24 24 / 6%);
}

.week-strip-heading {
  display: grid;
  gap: 5px;
  padding: 10px 18px;
  border-right: 1px solid var(--line);
}

.week-strip-heading > span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.8px;
}

.week-strip-heading strong {
  font-size: 12px;
  font-weight: 650;
}

.week-strip-link {
  color: var(--red-deep);
  font-size: 10px;
  font-weight: 700;
  text-decoration: none;
}

.week-strip-link:hover {
  text-decoration: underline;
}

.week-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(54px, 1fr));
  align-items: center;
  padding: 8px 14px;
}

.week-days button {
  display: grid;
  min-height: 68px;
  place-items: center;
  align-content: center;
  gap: 5px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  cursor: pointer;
}

.week-days button span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
}

.week-days button strong {
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  border-radius: 50%;
  font-size: 12px;
}

.week-days button.is-today {
  background: var(--red-tint);
}

.week-days button.is-today span,
.week-days button.is-today strong {
  color: var(--red-deep);
}

.week-days button.is-today strong {
  background: var(--red);
  color: #ffffff;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  grid-template-areas:
    "pet today"
    "priority chat";
  gap: 18px;
}

.pet-card,
.today-card,
.priority-card,
.chat-card {
  min-width: 0;
  max-width: 100%;
  border: 1px solid #e7e2e0;
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 1px 2px rgb(28 20 20 / 3%);
}

.pet-card {
  grid-area: pet;
  display: grid;
  min-height: 235px;
  grid-template-columns: 175px 125px;
  overflow: hidden;
  background: linear-gradient(135deg, #ffffff 0%, #fffafa 100%);
}

.pet-card-copy {
  min-width: 0;
  padding: 26px 26px 23px;
}

.pet-card-copy h2 {
  margin: 3px 0 10px;
  font-size: 24px;
  letter-spacing: -0.8px;
}

.streak-count {
  display: flex;
  align-items: baseline;
  gap: 7px;
  color: var(--red-deep);
}

.streak-count strong {
  font-size: 38px;
  line-height: 1;
}

.streak-count span {
  font-size: 12px;
  font-weight: 650;
}

.pet-stage {
  margin: 12px 0 9px;
  color: var(--muted);
  font-size: 11px;
}

.pet-progress-track {
  width: 100%;
  max-width: 170px;
  height: 5px;
  margin-bottom: 16px;
  overflow: hidden;
  border-radius: 5px;
  background: #eee9e7;
}

.pet-progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--red);
  transition: width 300ms ease;
}

.pet-card-copy a {
  color: var(--red-deep);
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
}

.pet-visual {
  display: grid;
  place-items: center;
  border-left: 1px solid #f1ecea;
  font-size: 94px;
  filter: drop-shadow(0 12px 12px rgb(115 23 28 / 14%));
}

.today-card,
.priority-card,
.chat-card {
  padding: 22px;
}

.today-card {
  grid-area: today;
  min-height: 235px;
}

.priority-card {
  grid-area: priority;
  min-height: 220px;
}

.chat-card {
  grid-area: chat;
  min-height: 220px;
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.section-heading h2,
.chat-heading h2 {
  margin: 3px 0 0;
  font-size: 17px;
  letter-spacing: -0.45px;
}

.section-kicker {
  color: var(--muted);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.9px;
}

.section-link {
  color: var(--red-deep);
  font-size: 10px;
  font-weight: 700;
  text-decoration: none;
}

.dashboard-task-list {
  display: grid;
  gap: 7px;
  margin: 17px 0 0;
  padding: 0;
  list-style: none;
}

.dashboard-task {
  min-height: 55px;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.dashboard-task-link {
  display: grid;
  min-height: 53px;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  color: inherit;
  text-decoration: none;
}

.dashboard-task-link:hover {
  background: var(--surface-soft);
  text-decoration: none;
}

.dashboard-task-link:focus-visible {
  outline: 3px solid #4976a5;
  outline-offset: -3px;
}

.dashboard-task-link > div {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.dashboard-task strong {
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-task-link > div span {
  color: var(--muted);
  font-size: 9px;
}

.dashboard-task.is-completed strong {
  color: var(--muted);
  text-decoration: line-through;
}

.dashboard-priority {
  border-radius: 12px;
  padding: 5px 7px;
  background: #f1efed;
  color: var(--muted);
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
}

.priority-high {
  background: var(--red-tint);
  color: var(--red-deep);
}

.priority-low {
  background: #edf6ee;
  color: #4d7251;
}

.dashboard-empty {
  display: flex;
  min-height: 78px;
  align-items: center;
  gap: 11px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
}

.dashboard-empty > span {
  margin-left: 14px;
  color: var(--red);
  font-size: 22px;
}

.dashboard-empty div {
  display: grid;
  gap: 3px;
}

.dashboard-empty strong {
  color: var(--ink);
  font-size: 11px;
}

.dashboard-empty div span {
  font-size: 9px;
}

.chat-heading,
.chat-heading > div {
  display: flex;
  align-items: center;
}

.chat-heading {
  justify-content: space-between;
}

.chat-heading > div {
  gap: 10px;
}

.chat-heading > a {
  color: var(--muted);
  text-decoration: none;
}

.chat-icon {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 50%;
  background: var(--red-tint);
  color: var(--red);
  font-size: 13px;
}

.chat-messages {
  height: 88px;
  margin: 13px 0 10px;
  overflow-y: auto;
}

.chat-message {
  max-width: 88%;
  margin: 0 0 7px;
  border-radius: 9px;
  padding: 8px 10px;
  font-size: 10px;
  line-height: 1.45;
}

.chat-message.assistant {
  background: #f5f2f1;
}

.chat-message.user {
  margin-left: auto;
  background: var(--red-tint);
  color: var(--red-deep);
}

.chat-form {
  display: grid;
  height: 40px;
  grid-template-columns: minmax(0, 1fr) 34px;
  gap: 5px;
  padding: 3px 3px 3px 10px;
  border: 1px solid var(--line);
  border-radius: 20px;
}

.chat-form input {
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 10px;
}

.chat-form button {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--red);
  color: #ffffff;
  cursor: pointer;
}

/* Calendar */
.calendar-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(260px, 0.45fr);
  gap: 18px;
}

.calendar-card,
.calendar-agenda,
.pet-main-card,
.pet-details-card,
.stats-overview-card,
.stats-summary-card,
.category-card,
.activity-card {
  border: 1px solid #e7e2e0;
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 1px 2px rgb(28 20 20 / 3%);
}

.calendar-header {
  display: grid;
  min-height: 70px;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  text-align: center;
}

.calendar-header h2 {
  margin: 0;
  font-size: 16px;
  letter-spacing: -0.35px;
}

.calendar-nav {
  margin: 0 auto;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 24px;
}

.calendar-weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

.calendar-weekdays {
  min-height: 38px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  text-align: center;
  text-transform: uppercase;
}

.calendar-day {
  position: relative;
  display: flex;
  min-height: 92px;
  align-items: flex-start;
  justify-content: space-between;
  padding: 12px;
  border: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  cursor: pointer;
  font-size: 11px;
}

.calendar-day:disabled {
  color: #b7b0ae;
  background: var(--surface-soft);
  cursor: not-allowed;
  opacity: 0.62;
}

.calendar-day:disabled.is-today strong {
  color: #fff;
}

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

.calendar-day:nth-child(n+29) {
  border-bottom: 0;
}

.calendar-day.outside-month {
  color: #bbb5b3;
  background: #fcfbfa;
}

.calendar-day.is-today strong {
  display: grid;
  width: 25px;
  height: 25px;
  margin-top: -7px;
  margin-left: -7px;
  place-items: center;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
}

.calendar-day.is-selected {
  background: var(--red-tint);
  box-shadow: inset 0 0 0 1px #e6bfc1;
}

.calendar-dots {
  display: flex;
  align-self: flex-end;
  gap: 3px;
}

.calendar-dots i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--red);
}

.calendar-agenda {
  padding: 22px;
}

.agenda-date {
  margin: 8px 0 16px;
  color: var(--muted);
  font-size: 11px;
}

.agenda-list,
.accomplishment-list,
.milestone-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.agenda-list li,
.accomplishment-list li {
  display: grid;
  min-height: 54px;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 9px;
}

.agenda-list li:not(.agenda-empty) {
  display: block;
  padding: 0;
  overflow: hidden;
}

.agenda-task-link {
  display: grid;
  min-height: 52px;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 8px 11px;
  color: inherit;
  text-decoration: none;
}

.agenda-task-link:hover {
  background: var(--surface-soft);
  text-decoration: none;
}

.agenda-task-link:focus-visible {
  outline: 3px solid #4976a5;
  outline-offset: -3px;
}

.agenda-list li.is-completed .agenda-task-link strong {
  color: var(--muted);
  text-decoration: line-through;
}

.agenda-task-arrow {
  color: var(--red);
  font-size: 15px !important;
}

.agenda-list li div,
.accomplishment-list li div {
  display: grid;
  gap: 3px;
}

.agenda-list li strong,
.accomplishment-list li strong {
  font-size: 11px;
}

.agenda-list li span,
.accomplishment-list li span {
  color: var(--muted);
  font-size: 9px;
}

.accomplishment-check {
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border: 1px solid #cbc3c1;
  border-radius: 50%;
  background: #fff;
  color: #fff;
  font-size: 10px;
}

.accomplishment-check {
  border-color: var(--red);
  background: var(--red);
  color: #fff;
}

.agenda-empty {
  grid-template-columns: 24px 1fr !important;
}

.agenda-empty > span {
  color: var(--red) !important;
  font-size: 18px !important;
}

.schedule-disclosure {
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.schedule-disclosure-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  list-style: none;
  cursor: pointer;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  padding: 6px 2px;
  user-select: none;
}

.schedule-disclosure-toggle::-webkit-details-marker {
  display: none;
}

.schedule-disclosure-chevron {
  color: var(--muted);
  font-size: 12px;
  transition: transform 0.16s ease;
}

.schedule-disclosure[open] .schedule-disclosure-chevron {
  transform: rotate(180deg);
}

.schedule-ai {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.schedule-ai-more {
  margin-top: 2px;
}

.schedule-ai-more > summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  list-style: none;
  padding: 4px 0;
}

.schedule-ai-more > summary::-webkit-details-marker {
  display: none;
}

.schedule-ai-more > summary::before {
  content: "+ ";
  color: var(--red);
  font-weight: 700;
}

.schedule-ai-more[open] > summary::before {
  content: "− ";
}

.schedule-ai-more-body {
  display: grid;
  gap: 6px;
  margin-top: 6px;
}

.schedule-ai-inline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: stretch;
}

.schedule-ai-inline .primary-button {
  min-height: 40px;
  padding: 0 12px;
  white-space: nowrap;
}

.schedule-ai label {
  color: var(--muted);
  font-size: 10px;
}

.schedule-ai input,
.rename-pet-form input {
  min-height: 40px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 11px;
  background: #fff;
  font-size: 11px;
}

#schedule-suggestion {
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft, #fbf9f8);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

#schedule-suggestion strong {
  color: var(--ink);
}

#schedule-suggestion button {
  width: fit-content;
  border: 0;
  border-radius: 6px;
  background: var(--red-tint);
  color: var(--red-deep);
  padding: 7px 9px;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}

/* Streak pet */
.pet-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: 18px;
}

.pet-main-card {
  display: grid;
  min-height: 330px;
  grid-template-columns: minmax(0, 1fr) 200px;
  overflow: hidden;
  background: linear-gradient(135deg, #fff 0%, #fffafa 100%);
}

.pet-main-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 35px;
}

.pet-main-copy h2 {
  margin: 5px 0 12px;
  font-size: 28px;
}

.pet-day-count {
  display: flex;
  align-items: baseline;
  gap: 8px;
  color: var(--red-deep);
}

.pet-day-count strong {
  font-size: 54px;
  line-height: 1;
}

.pet-day-count span,
.pet-main-copy > p {
  font-size: 12px;
}

.pet-stage-visual {
  display: grid;
  grid-column: 2;
  grid-row: 1;
  place-items: center;
  border-left: 1px solid #f1ecea;
  font-size: 125px;
  filter: drop-shadow(0 16px 14px rgb(115 23 28 / 15%));
}

.pet-details-card {
  padding: 22px;
}

.rename-pet-form {
  display: grid;
  gap: 8px;
  margin-top: 16px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.rename-pet-form label {
  color: var(--muted);
  font-size: 10px;
}

.rename-pet-form > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.milestone-section {
  padding-top: 20px;
}

.milestone {
  display: grid;
  min-height: 54px;
  grid-template-columns: 34px 1fr;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 10px;
}

.milestone > span {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  background: #f2efed;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.milestone.is-unlocked > span {
  background: var(--red);
  color: #fff;
}

.milestone div {
  display: grid;
  gap: 3px;
}

.milestone strong {
  font-size: 11px;
}

.milestone small {
  color: var(--muted);
  font-size: 9px;
}

/* Stats */
.stats-grid {
  display: grid;
  width: 100%;
  grid-template-columns: minmax(300px, 0.9fr) minmax(0, 1.6fr);
  grid-template-areas:
    "overview summary"
    "progress progress"
    "categories activity";
  gap: 18px;
}

.stats-overview-card {
  grid-area: overview;
  min-height: 280px;
  padding: 22px;
}

.stats-summary-card {
  grid-area: summary;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 18px;
}

.progress-chart-card {
  grid-area: progress;
  min-width: 0;
  padding: 22px;
  border: 1px solid #e7e2e0;
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 1px 2px rgb(28 20 20 / 3%);
}

.progress-chart-heading {
  align-items: flex-start;
  gap: 16px;
}

.stats-chart-caption {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.stats-chart-ranges {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
}

.stats-chart-ranges button {
  min-height: 32px;
  padding: 0 11px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  font-weight: 650;
}

.stats-chart-ranges button.is-active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 3px rgb(28 20 20 / 12%);
}

.stats-chart-ranges button:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}

.progress-chart {
  display: block;
  width: 100%;
  height: auto;
  margin-top: 12px;
  overflow: visible;
}

.progress-chart-grid {
  stroke: var(--line);
  stroke-dasharray: 3 5;
  stroke-width: 1;
}

.progress-chart-axis-label {
  fill: var(--muted);
  font-size: 11px;
}

.progress-chart-series {
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.progress-chart-series.completed-series,
.progress-chart-point.completed-series {
  stroke: var(--red);
}

.progress-chart-series.goal-series,
.progress-chart-point.goal-series {
  stroke: #56866c;
}

.progress-chart-point {
  fill: var(--surface);
  stroke-width: 3;
  vector-effect: non-scaling-stroke;
}

.stats-chart-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 18px;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.stats-chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.stats-legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.stats-legend-dot.completed-series {
  background: var(--red);
}

.stats-legend-dot.goal-series {
  background: #56866c;
}

.stats-chart-summary {
  min-height: 16px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.stats-insights {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.stats-insights article {
  display: grid;
  min-width: 0;
  gap: 5px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
}

.stats-insights article > span,
.stats-insights article > small {
  color: var(--muted);
  font-size: 10px;
}

.stats-insights article > strong {
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 20px;
}

.stats-error {
  margin: 0 0 16px;
  padding: 12px 14px;
  border: 1px solid #e9b9b9;
  border-radius: 10px;
  background: #fff6f5;
  color: #9e3338;
  font-size: 12px;
}

.summary-stat {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 9px;
  border-right: 1px solid var(--line);
  text-align: center;
}

.summary-stat:last-child {
  border-right: 0;
}

.summary-stat-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 50%;
  background: var(--red-tint);
  font-size: 18px;
}

.summary-stat div {
  display: grid;
  gap: 3px;
}

.summary-stat strong {
  font-size: 24px;
}

.summary-stat div span {
  color: var(--muted);
  font-size: 9px;
}

.category-card,
.activity-card {
  min-height: 230px;
  padding: 22px;
}

.category-card {
  grid-area: categories;
}

.activity-card {
  grid-area: activity;
}

.completion-ring {
  position: relative;
  width: 150px;
  height: 150px;
  margin: 14px auto 8px;
}

.completion-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.completion-ring-bg,
.completion-ring-progress {
  fill: none;
  stroke-width: 11;
}

.completion-ring-bg {
  stroke: #f1edeb;
}

.completion-ring-progress {
  stroke: var(--red);
  stroke-linecap: round;
  transition: stroke-dashoffset 400ms ease;
}

.completion-ring > div {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 2px;
}

.completion-ring strong {
  font-size: 27px;
}

.completion-ring div span {
  color: var(--muted);
  font-size: 9px;
}

.completion-counts {
  display: flex;
  justify-content: center;
  gap: 18px;
  color: var(--muted);
  font-size: 9px;
}

.completion-counts strong {
  color: var(--ink);
}

.category-bars {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.category-bar-row {
  display: grid;
  gap: 7px;
}

.category-bar-row > div:first-child {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
}

.category-bar-row > div span {
  color: var(--muted);
  font-size: 9px;
}

.category-bar-track {
  height: 7px;
  overflow: hidden;
  border-radius: 7px;
  background: #f1edeb;
}

.category-bar-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--red);
}

.stats-empty,
.accomplishment-list .stats-empty {
  display: block;
  border: 1px dashed var(--line);
  color: var(--muted);
  font-size: 10px;
  text-align: center;
  padding: 18px;
}

/* Authentication */
.auth-page {
  display: grid;
  min-width: 320px;
  min-height: 100vh;
  place-items: center;
  padding: 28px;
  background:
    radial-gradient(circle at 8% 12%, rgb(198 40 48 / 11%), transparent 25%),
    radial-gradient(circle at 92% 90%, rgb(198 40 48 / 8%), transparent 28%),
    #f7f6f5;
}

.auth-layout {
  display: grid;
  width: min(1120px, 100%);
  min-height: min(680px, calc(100vh - 56px));
  grid-template-columns: minmax(0, 1.15fr) minmax(390px, 0.85fr);
  overflow: hidden;
  border: 1px solid rgb(255 255 255 / 75%);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: 0 24px 80px rgb(36 20 20 / 18%);
}

.auth-brand-panel {
  position: relative;
  display: flex;
  min-height: 600px;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  padding: clamp(30px, 5vw, 64px);
  background: linear-gradient(145deg, #a51625 0%, #df2434 52%, #ff454d 100%);
}

.auth-brand-panel::before,
.auth-brand-panel::after {
  position: absolute;
  border: 1px solid rgb(255 255 255 / 34%);
  border-radius: 50%;
  content: "";
  pointer-events: none;
}

.auth-brand-panel::before {
  width: 580px;
  height: 580px;
  right: -210px;
  bottom: -240px;
  background: rgb(255 255 255 / 12%);
}

.auth-brand-panel::after {
  width: 400px;
  height: 400px;
  right: -115px;
  bottom: -155px;
}

.auth-brand {
  z-index: 1;
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 17px;
  color: #ffffff;
  font-size: clamp(31px, 4vw, 54px);
  font-weight: 700;
  letter-spacing: -2px;
  text-decoration: none;
}

.auth-brand img {
  width: clamp(72px, 11vw, 128px);
  aspect-ratio: 1;
  object-fit: contain;
}

.auth-brand > span > span {
  color: #ffffff;
}

.auth-brand-message {
  z-index: 1;
  max-width: 420px;
  margin-bottom: 12px;
}

.auth-brand-message > p {
  display: inline-flex;
  align-items: center;
  margin-bottom: 13px;
  border: 1px solid rgb(255 255 255 / 30%);
  border-radius: 20px;
  padding: 7px 10px;
  background: rgb(255 255 255 / 12%);
  color: #ffffff;
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 1px;
}

.auth-brand-message h1 {
  max-width: 390px;
  margin: 0 0 12px;
  color: #ffffff;
  font-size: clamp(30px, 4vw, 48px);
  letter-spacing: -1.6px;
}

.auth-brand-message > span {
  max-width: 340px;
  color: rgb(255 255 255 / 84%);
  font-size: 13px;
  line-height: 1.6;
}

.auth-decoration {
  position: absolute;
  z-index: 0;
  width: 190px;
  height: 190px;
  border-radius: 42% 58% 66% 34% / 46% 41% 59% 54%;
  background: rgb(255 255 255 / 17%);
  transform: rotate(-24deg);
}

.auth-decoration-one {
  top: 28%;
  left: -100px;
}

.auth-decoration-two {
  top: 12%;
  right: 12%;
  width: 110px;
  height: 110px;
}

.auth-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(30px, 5vw, 64px);
  background:
    radial-gradient(circle at 100% 0%, rgb(255 54 68 / 20%), transparent 30%),
    linear-gradient(155deg, #202020, #111111);
  color: #ffffff;
}

.auth-mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 30px;
  border-bottom: 1px solid rgb(255 255 255 / 19%);
}

.auth-mode-switch button {
  min-height: 42px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: rgb(255 255 255 / 60%);
  cursor: pointer;
  font-size: 12px;
  font-weight: 650;
}

.auth-mode-switch button.is-selected {
  border-bottom-color: #ff3f4d;
  color: #ffffff;
}

.auth-panel h2 {
  margin: 0 0 7px;
  font-size: 30px;
  letter-spacing: -0.8px;
}

.auth-description {
  margin: 0 0 24px;
  color: rgb(255 255 255 / 76%);
  font-size: 12px;
  line-height: 1.5;
}

.auth-status {
  min-height: 0;
  margin: -10px 0 14px;
  font-size: 11px;
  line-height: 1.45;
}

.auth-status:empty {
  display: none;
}

.auth-status.is-error {
  color: #ffe0e0;
}

.auth-status.is-success {
  color: #ffffff;
}

.auth-form {
  display: grid;
  gap: 16px;
}

.auth-form .field {
  gap: 7px;
}

.auth-form .field label {
  color: #ffffff;
  font-size: 11px;
}

.auth-form .field input {
  min-height: 48px;
  border: 1px solid rgb(255 255 255 / 23%);
  border-radius: 9px;
  background: rgb(255 255 255 / 9%);
  color: #ffffff;
  font-size: 14px;
}

.auth-form .field input:focus {
  border-color: #ff5964;
  outline-color: #ff5964;
  background: rgb(255 255 255 / 13%);
}

.auth-hint,
.auth-footnote,
.auth-code-note {
  color: rgb(255 255 255 / 70%);
  font-size: 10px;
  line-height: 1.5;
}

.auth-hint {
  margin-top: -1px;
}

.auth-code-note {
  margin: 0;
}

.auth-code-note strong {
  color: #ffffff;
  overflow-wrap: anywhere;
}

.auth-submit,
.auth-secondary {
  min-height: 48px;
  border: 1px solid #ff5964;
  border-radius: 9px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  transition: background-color 140ms ease, color 140ms ease;
}

.auth-submit {
  margin-top: 8px;
  background: linear-gradient(100deg, #e52335, #ff454f);
  box-shadow: 0 8px 20px rgb(255 54 68 / 28%);
  color: #ffffff;
}

.auth-submit:hover {
  background: linear-gradient(100deg, #f13242, #ff626b);
  box-shadow: 0 10px 24px rgb(255 54 68 / 38%);
  transform: translateY(-1px);
}

.auth-submit:disabled {
  cursor: wait;
  opacity: 0.7;
}

.auth-secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-color: #ff5964;
  background: #ffffff;
  color: #242121;
}

.gmail-icon {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
}

.auth-secondary:hover {
  background: #fff1f1;
}

.auth-back {
  justify-self: center;
  border: 0;
  background: transparent;
  color: #ffffff;
  cursor: pointer;
  font-size: 10px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

@media (max-width: 760px) {
  .week-strip {
    grid-template-columns: minmax(0, 1fr);
  }

  .week-strip-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 9px 14px 7px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .week-strip-heading > span:first-child {
    display: none;
  }

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

  .dashboard-grid {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "pet"
      "today"
      "priority"
      "chat";
  }

  .pet-card {
    grid-template-columns: minmax(0, 1fr) 140px;
  }

  .calendar-layout,
  .pet-layout,
  .stats-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .stats-grid {
    grid-template-areas:
      "overview"
      "summary"
      "progress"
      "categories"
      "activity";
  }

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

  .pet-main-card {
    grid-template-columns: minmax(0, 1fr) 150px;
  }
}

@media (max-width: 560px) {
  .progress-chart-card {
    padding: 17px 13px;
  }

  .progress-chart-heading {
    flex-direction: column;
  }

  .stats-chart-ranges {
    align-self: stretch;
  }

  .stats-chart-ranges button {
    flex: 1;
  }

  .stats-insights article {
    padding: 11px;
  }

  .week-days button {
    min-height: 58px;
  }

  .pet-card {
    min-height: 210px;
    grid-template-columns: minmax(0, 1fr) 105px;
  }

  .pet-card-copy {
    padding: 21px 18px;
  }

  .pet-visual {
    font-size: 62px;
  }

  .pet-progress-track {
    width: 130px;
  }

  .today-card,
  .priority-card,
  .chat-card {
    padding: 18px;
  }

  .calendar-day {
    min-height: 68px;
    padding: 8px;
  }

  .calendar-dots i {
    width: 4px;
    height: 4px;
  }

  .stats-summary-card {
    grid-template-columns: minmax(0, 1fr);
  }

  .summary-stat {
    min-height: 92px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .summary-stat:last-child {
    border-bottom: 0;
  }

  .pet-main-card {
    min-height: 280px;
    grid-template-columns: minmax(0, 1fr) 100px;
  }

  .pet-main-copy {
    padding: 22px;
  }

  .pet-stage-visual {
    font-size: 58px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }

  .journal-entry {
    animation: none;
  }
}

@media (max-width: 760px) {
  .auth-page {
    display: block;
    padding: 12px;
    background:
      radial-gradient(circle at 0% 0%, rgb(255 54 68 / 20%), transparent 30%),
      #181818;
  }

  .auth-layout {
    width: min(520px, 100%);
    min-height: 0;
    grid-template-columns: minmax(0, 1fr);
    margin: 0 auto;
  }

  .auth-brand-panel {
    min-height: 205px;
    justify-content: center;
    gap: 12px;
    padding: 20px 24px;
  }

  .auth-brand {
    gap: 10px;
    font-size: 30px;
    letter-spacing: -1px;
  }

  .auth-brand img {
    width: 52px;
  }

  .auth-brand-message {
    margin: 0;
  }

  .auth-brand-message > p {
    display: inline-flex;
    margin-bottom: 5px;
    padding: 5px 8px;
    font-size: 7px;
  }

  .auth-brand-message h1 {
    margin: 0 0 4px;
    font-size: 23px;
    letter-spacing: -0.5px;
  }

  .auth-brand-message > span {
    font-size: 10px;
  }

  .auth-panel {
    padding: 28px clamp(22px, 7vw, 40px) 32px;
  }

  .auth-mode-switch {
    margin-bottom: 22px;
  }
}

@media (max-width: 400px) {
  .auth-layout {
    min-height: 100vh;
    border-radius: 0;
  }

  .auth-brand-panel {
    min-height: 185px;
  }

  .auth-panel {
    justify-content: flex-start;
    padding: 24px 20px 30px;
  }
}

.task-ai-assist {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid #ecd8d7;
  border-radius: 10px;
  background: #fff9f8;
}

.task-ai-assist textarea {
  width: 100%;
  min-height: 68px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  font-size: 12px;
  resize: vertical;
}

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

.task-manual-fields {
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(0, 1fr);
  gap: 17px;
}

.task-ai-messages {
  display: flex;
  min-height: 110px;
  max-height: 230px;
  flex-direction: column;
  align-items: flex-start;
  gap: 9px;
  padding: 10px;
  overflow: auto;
  border: 1px solid #efedec;
  border-radius: 8px;
  background: #fdfcfb;
}

.task-ai-message {
  max-width: 94%;
  margin: 0;
  padding: 8px 11px;
  border-radius: 12px;
  background: #f0eeed;
  color: var(--ink);
  font-size: 11px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.task-ai-message.user {
  align-self: flex-end;
  background: var(--red);
  color: #ffffff;
}

.task-chat-page {
  display: grid;
  min-width: 0;
  max-width: 100%;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 22px;
}

.task-chat-panel {
  display: grid;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  min-height: min(680px, calc(100vh - 180px));
  grid-template-rows: auto auto auto minmax(180px, 1fr) auto;
  gap: 14px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 8px 26px rgb(34 24 24 / 4%);
}

.task-chat-toolbar {
  display: flex;
  min-width: 0;
  align-items: end;
  gap: 12px;
}

.task-chat-toolbar .field {
  flex: 1;
  min-width: 0;
}

.task-chat-toolbar .field > span {
  color: #393332;
  font-size: 11px;
  font-weight: 620;
}

.task-chat-toolbar select,
.task-chat-form textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  font-size: 12px;
}

.task-chat-task-summary {
  min-width: 0;
  margin: 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: #fbf8f7;
  color: var(--muted);
  font-size: 11px;
  overflow-wrap: anywhere;
}

.task-chat-status {
  min-height: 15px;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.task-chat-status.is-error {
  color: var(--red-deep);
}

.task-chat-messages {
  display: flex;
  min-width: 0;
  max-width: 100%;
  min-height: 180px;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  padding: 18px;
  overflow: auto;
  border: 1px solid #efedec;
  border-radius: 10px;
  background: #fdfcfb;
}

.task-chat-message {
  max-width: min(82%, 720px);
  margin: 0;
  padding: 11px 14px;
  border-radius: 14px;
  background: #f0eeed;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.task-chat-message.user {
  align-self: flex-end;
  border-bottom-right-radius: 4px;
  background: var(--red);
  color: #ffffff;
}

.task-chat-message.assistant {
  border-bottom-left-radius: 4px;
}

.task-chat-draft {
  display: grid;
  width: min(82%, 720px);
  gap: 8px;
  padding: 12px 14px;
  border: 1px solid #ecd8d7;
  border-radius: 10px;
  background: #fff9f8;
}

.task-chat-draft strong {
  font-size: 12px;
}

.task-chat-draft p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.task-chat-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
}

.task-chat-form textarea {
  min-height: 52px;
  max-height: 180px;
  resize: vertical;
}

.task-chat-form .primary-button {
  min-height: 44px;
}

@media (max-width: 760px) {
  .task-chat-panel {
    min-height: calc(100vh - 175px);
    padding: 16px;
  }
}

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

  .task-chat-toolbar .secondary-button {
    align-self: flex-start;
  }

  .task-chat-message,
  .task-chat-draft {
    max-width: 94%;
    width: auto;
  }

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

  .task-chat-form .primary-button {
    justify-self: end;
  }
}

.settings-page {
  display: block;
}

.settings-section {
  display: grid;
  gap: 20px;
  margin-top: 24px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.settings-section-heading h2 {
  margin: 4px 0 7px;
  font-size: 18px;
  letter-spacing: -0.4px;
}

.settings-section-heading .page-description {
  margin: 0;
  font-size: 11px;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: end;
  gap: 16px;
}

.settings-grid .field input,
.settings-grid .field select {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink);
  font-size: 12px;
}

.settings-grid .field small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.settings-actions {
  display: flex;
  min-height: 40px;
  grid-column: 1 / -1;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.settings-feedback {
  min-height: 15px;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.settings-feedback.is-error {
  color: var(--red-deep);
}

.avatar-settings {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  align-items: center;
  gap: 20px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
}

.avatar-preview-frame {
  display: grid;
  width: 112px;
  height: 112px;
  place-items: center;
  padding: 5px;
  border: 1px solid #e8caca;
  border-radius: 22px;
  background: linear-gradient(145deg, #fff 0%, #fff1f1 100%);
}

.avatar-preview {
  display: grid;
  width: 100%;
  height: 100%;
  overflow: hidden;
  place-items: center;
  border-radius: 16px;
  background: var(--red-tint);
  color: var(--red-deep);
  font-size: 24px;
  font-weight: 700;
}

.avatar-preview-image,
.avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-settings-controls {
  display: grid;
  justify-items: start;
  gap: 10px;
}

.avatar-settings-controls h3 {
  margin: 0 0 4px;
  color: var(--ink);
  font-size: 14px;
}

.avatar-settings-controls p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.avatar-settings-controls > small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.avatar-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.profile-account-info {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.profile-account-info > span,
.profile-account-info > small,
.account-email-note {
  color: var(--muted);
  font-size: 10px;
}

.profile-account-info > strong {
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
}

.account-email-note {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 11px;
}

.account-email-note strong {
  color: var(--ink);
  font-weight: 650;
}

.data-reset-zone {
  border-color: #e7d8c2;
  background: #fffdf9;
}

.settings-confirm {
  display: flex;
  grid-column: 1 / -1;
  align-items: flex-start;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.settings-confirm input {
  margin-top: 2px;
  accent-color: var(--red);
}

.danger-zone {
  border-color: #efcdcc;
  background: #fffafa;
}

.danger-button {
  min-height: 38px;
  padding: 0 15px;
  border: 1px solid #c24b50;
  border-radius: 20px;
  background: #b7232a;
  color: #ffffff;
  cursor: pointer;
  font-size: 11px;
  font-weight: 650;
}

.danger-button:hover:not(:disabled) {
  background: #941b22;
}

.danger-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #171616;
  --surface: #242221;
  --surface-soft: #2b2928;
  --line: #403b39;
  --ink: #f3efed;
  --muted: #b5adaa;
  --red: #e04a52;
  --red-deep: #f0787d;
  --red-tint: #3b2627;
}

:root[data-theme="dark"] body {
  background: var(--page);
  color: var(--ink);
}

:root[data-theme="dark"] :is(.topbar, .sidebar, .today-card, .priority-card, .chat-card, .pet-card, .settings-section, .task-chat-panel) {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
}

@media (prefers-reduced-motion: reduce) {
  .goal-confetti { display: none; }
  .goal-progress-track span { transition: none; }
  .goal-celebration { animation: none; }
}

@media (max-width: 680px) {
  .task-dialog,
  .task-detail-dialog {
    width: min(calc(100% - 20px), 560px);
    max-width: calc(100% - 20px);
    height: fit-content;
    max-height: 86dvh;
    margin: auto;
    border: 1px solid var(--line);
    border-radius: 16px;
  }
  .task-dialog > .task-form { max-height: 86dvh; }
  .task-detail-shell { max-height: 86dvh; height: fit-content; }
  .weekday-buttons { gap: 4px; }
  .weekday-button { min-height: 56px; }
  .field-row { grid-template-columns: 1fr; }
  .step-row { grid-template-columns: 30px minmax(0, 1fr) auto; }
}

:root[data-theme="dark"] :is(.task-creation-menu button, .task-dialog, .journal-entry, .task-chat-messages, .task-chat-task-summary) {
  border-color: var(--line);
  background: #2b2928;
  color: var(--ink);
}

:root[data-theme="dark"] :is(input, select, textarea) {
  border-color: #514a47;
  background: #201e1d;
  color: var(--ink);
}

:root[data-theme="dark"] .field input[type="date"],
:root[data-theme="dark"] .field input[type="datetime-local"] {
  color-scheme: dark;
}

:root[data-theme="dark"] :is(.record-toolbar, .empty-state, .dashboard-task, .task-chat-draft) {
  border-color: var(--line);
  background: #292726;
  color: var(--ink);
}

:root[data-theme="dark"] .danger-zone {
  border-color: #744245;
  background: #2b2021;
}

:root[data-theme="dark"] :is(.pet-main-card, .pet-details-card) {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
}

:root[data-theme="dark"] .pet-stage-visual {
  border-left-color: var(--line);
}

:root[data-theme="dark"] .calendar-day.outside-month {
  background: var(--surface-soft);
  color: var(--muted);
}

:root[data-theme="dark"] .completion-ring-bg {
  stroke: var(--line);
}

:root[data-theme="dark"] :is(.milestone, .profile-account-info, .avatar-settings, .data-reset-zone) {
  border-color: var(--line);
  background: var(--surface-soft);
  color: var(--ink);
}

:root[data-theme="dark"] .avatar-preview-frame {
  border-color: var(--line);
  background: linear-gradient(145deg, #302d2c 0%, #3b2627 100%);
}

@media (max-width: 560px) {
  .settings-section {
    padding: 18px 15px;
  }

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

  .settings-actions,
  .settings-confirm {
    grid-column: 1;
  }

  .avatar-settings {
    grid-template-columns: 1fr;
  }

  .avatar-preview-frame {
    width: 96px;
    height: 96px;
  }
}

.task-summary-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: -12px 0 20px;
}

.task-summary-pill {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  gap: 7px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  font-size: 11px;
  transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

.task-summary-pill:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgb(34 24 24 / 8%);
}

.task-summary-pill strong {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.task-summary-pill.is-overdue {
  border-color: #efc3c4;
  background: #fff1f1;
  color: #8c1d24;
}

.task-summary-pill.is-today {
  border-color: #f0c9b0;
  background: #fff4ed;
  color: #873d16;
}

.task-summary-pill.is-week {
  border-color: #cdd8e6;
  background: #f1f5fb;
  color: #344c6b;
}

.task-summary-pill:disabled {
  cursor: default;
  opacity: 0.62;
}

.task-board {
  overflow: visible;
}

.task-list {
  display: grid;
  gap: 18px;
  padding: 0;
}

.deadline-section {
  overflow: visible;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
}

.deadline-section:last-child {
  border-bottom: 0;
}

@supports selector(details::details-content) {
  .deadline-section {
    interpolate-size: allow-keywords;
  }

  .deadline-section::details-content {
    block-size: 0;
    overflow: clip;
    transition: block-size 180ms ease, content-visibility 180ms allow-discrete;
  }

  .deadline-section[open]::details-content {
    block-size: auto;
  }
}

.deadline-section > summary {
  display: flex;
  min-height: 44px;
  align-items: center;
  gap: 8px;
  padding: 4px 2px 10px;
  color: var(--ink);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  list-style: none;
}

.deadline-section > summary::-webkit-details-marker {
  display: none;
}

.deadline-section > summary::before {
  content: "›";
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  transform: rotate(0);
  transition: transform 160ms ease;
}

.deadline-section[open] > summary::before {
  transform: rotate(90deg);
}

.group-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: 0 0 auto;
  background: var(--muted);
}

.group-dot.is-overdue { background: var(--red); }
.group-dot.is-today { background: #d97706; }
.group-dot.is-tomorrow { background: #d99a20; }
.group-dot.is-week { background: #557aa5; }
.group-dot.is-later { background: #8792a0; }
.group-dot.is-completed { background: #2f855a; }

.deadline-section-title {
  flex: 1;
}

.deadline-count {
  display: grid;
  min-width: 24px;
  height: 22px;
  place-items: center;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.deadline-section-overdue > summary .deadline-section-title {
  color: var(--red-deep);
}

.deadline-section-today > summary .deadline-section-title {
  color: #9a491d;
}

.deadline-section-completed > summary .deadline-section-title {
  color: var(--muted);
}

.deadline-task-list {
  display: grid;
  gap: 8px;
  padding: 0 0 18px;
}

.task-item {
  position: relative;
  display: grid;
  min-height: 0;
  grid-template-columns: 28px minmax(0, 1fr) auto 32px;
  grid-template-areas: "check main side overflow";
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  overflow: visible;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  cursor: pointer;
  transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease, opacity 180ms ease;
}

.task-item:hover {
  z-index: 1;
  transform: translateY(-1px);
  border-color: #e6bfc1;
  box-shadow: 0 4px 14px rgb(24 18 18 / 6%);
}

.task-item:focus-visible {
  outline: 3px solid #4976a5;
  outline-offset: 2px;
}

.task-item.is-completed {
  opacity: 0.72;
}

.task-item.is-completing {
  opacity: 0;
  transform: translateX(8px);
}

.task-check-circle {
  grid-area: check;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 2px solid var(--muted);
  border-radius: 50%;
  background: transparent;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: border-color 140ms ease, background-color 140ms ease, transform 140ms ease;
}

.task-check-circle:hover {
  border-color: var(--red);
  transform: scale(1.06);
}

.task-item.is-completed .task-check-circle {
  border-color: #2f855a;
  background: #2f855a;
}

.task-item-main {
  grid-area: main;
  display: grid;
  min-width: 0;
  gap: 7px;
}

.task-title-row {
  display: flex;
  min-width: 0;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.task-item-title {
  width: fit-content;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
  overflow-wrap: anywhere;
  text-align: left;
  cursor: pointer;
}

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

.priority-badge {
  justify-self: auto;
  padding: 3px 7px;
  border: 1px solid #d5d0ce;
  border-radius: 12px;
  background: transparent;
  color: #554f4c;
  font-size: 9px;
  font-weight: 650;
  line-height: 1.2;
  text-transform: capitalize;
}

.priority-high {
  border-color: #bf3339;
  color: #a51d24;
  background: #fffafa;
}

.priority-medium {
  border-color: #d39a2e;
  color: #76500b;
  background: #fffdf6;
}

.priority-low {
  border-color: #c9c4c1;
  color: #514b49;
  background: #f5f4f3;
}

.task-item-details {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  overflow-wrap: anywhere;
  color: #5e5856;
  font-size: 10px;
  line-height: 1.5;
}

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

.task-category-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #87817f;
}

.task-meta-item + .task-meta-item::before {
  margin-right: 7px;
  color: #aaa4a1;
  content: "·";
}

.task-step-progress {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #514b49;
  font-size: 9px;
}

.task-progress-track {
  width: 56px;
  height: 5px;
  overflow: hidden;
  border-radius: 4px;
  background: #e7e3e1;
}

.task-progress-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #39804e;
  transition: width 180ms ease;
}

.task-card-side {
  grid-area: side;
  display: flex;
  min-width: 0;
  flex-direction: row;
  align-items: center;
  gap: 12px;
}

.task-deadline {
  display: grid;
  justify-items: end;
  gap: 4px;
}

.deadline-chip {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  border-radius: 16px;
  color: #3d4147;
  background: #eceff2;
  font-size: 10px;
  font-weight: 650;
  line-height: 1.3;
  white-space: nowrap;
}

.deadline-symbol {
  font-size: 12px;
  font-weight: 750;
}

.deadline-overdue {
  background: var(--red-tint);
  color: var(--red-deep);
}

.deadline-today {
  background: #fff3e6;
  color: #9c4a12;
}

.deadline-tomorrow {
  background: #ffedbd;
  color: #684600;
}

.deadline-this-week,
.deadline-later {
  background: #e9edf1;
  color: #3e4a59;
}

.deadline-no-date {
  background: #eeecea;
  color: #514b49;
}

.deadline-completed {
  background: #e3f1e7;
  color: #245738;
}

.relative-time {
  min-height: 12px;
  color: #625c59;
  font-size: 9px;
  text-align: right;
}

.task-start {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  justify-content: center;
  padding: 0 15px;
  border: 1px solid #a51d24;
  border-radius: 18px;
  background: #b4232b;
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  text-decoration: none;
  transition: background-color 150ms ease, transform 150ms ease;
}

.task-start:hover {
  background: #941b22;
  transform: translateY(-1px);
}

.task-start[hidden] {
  display: none;
}

.task-overflow {
  grid-area: overflow;
  position: relative;
  align-self: start;
  justify-self: end;
}

.task-overflow[open] {
  z-index: 6;
}

.task-overflow > summary {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  line-height: 1;
  list-style: none;
  transition: background-color 130ms ease, border-color 130ms ease, color 130ms ease;
}

.task-overflow > summary svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.task-overflow > summary::-webkit-details-marker {
  display: none;
}

.task-overflow > summary::marker {
  content: "";
}

.task-overflow > summary:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}

.task-overflow > summary:hover,
.task-overflow[open] > summary {
  border-color: #e2b9ba;
  background: var(--red-tint);
  color: var(--red-deep);
}

.task-overflow-menu {
  position: absolute;
  z-index: 5;
  top: calc(100% + 5px);
  right: 0;
  display: grid;
  min-width: 175px;
  gap: 2px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  box-shadow: 0 8px 24px rgb(30 20 20 / 14%);
}

.task-overflow-menu .record-action {
  min-height: 34px;
  padding: 0 9px;
  text-align: left;
}

.task-ai-assist {
  grid-template-rows: minmax(120px, 1fr) auto;
}

.task-ai-messages {
  min-height: 150px;
  max-height: 260px;
}

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

.task-ai-compose textarea {
  min-height: 68px;
  max-height: 160px;
  resize: vertical;
}

.task-ai-actions {
  align-items: center;
}

.task-voice-button {
  width: 40px;
  min-width: 40px;
  padding: 0;
  font-size: 17px;
}

.task-voice-button[aria-pressed="true"] {
  border-color: #b4232b;
  background: #b4232b;
  color: #ffffff;
}

.journal-status {
  min-height: 16px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.journal-status.is-error {
  color: var(--red-deep);
}

.journal-feed {
  overflow: visible;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.journal-feed .feed-heading {
  min-height: 0;
  padding-bottom: 14px;
}

.journal-toolbar {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
}

.journal-entry {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 1px 3px rgb(28 20 20 / 4%);
  transition: transform 150ms ease, box-shadow 150ms ease, border-color 150ms ease;
}

.journal-entry:hover {
  transform: translateY(-1px);
  border-color: #e6bfc1;
  box-shadow: 0 6px 18px rgb(35 25 25 / 7%);
}

.journal-entry .entry-card-meta {
  align-items: center;
  margin-bottom: 4px;
}

.journal-entry .entry-card-meta-details {
  gap: 8px;
}

.journal-entry .record-selection input {
  accent-color: var(--red);
}

.journal-entry .entry-card-meta time {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.journal-entry h3 {
  margin: 0;
  font-size: 16px;
}

.journal-entry .entry-card-content {
  display: -webkit-box;
  max-width: 65ch;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

:root[data-theme="dark"] .task-summary-pill,
:root[data-theme="dark"] .task-item,
:root[data-theme="dark"] .journal-entry {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
}

:root[data-theme="dark"] .deadline-section {
  border-color: var(--line);
  background: transparent;
}

:root[data-theme="dark"] .task-board,
:root[data-theme="dark"] .journal-feed {
  border-color: var(--line);
  background: transparent;
}

:root[data-theme="dark"] .deadline-overdue {
  background: #3a2325;
  color: #ffc2c4;
}

:root[data-theme="dark"] .deadline-today {
  background: #3a2a1e;
  color: #ffd1b6;
}

:root[data-theme="dark"] .deadline-section-today > summary .deadline-section-title {
  color: #ffd1b6;
}

:root[data-theme="dark"] .field.journal-note-title-field input,
:root[data-theme="dark"] .field.journal-note-body-field textarea,
:root[data-theme="dark"] .journal-note-title-input,
:root[data-theme="dark"] .journal-note-body-input {
  background: transparent;
  color: var(--ink);
}

:root[data-theme="dark"] .task-summary-pill.is-overdue {
  border-color: #744245;
  background: #392426;
  color: #ffbfc2;
}

:root[data-theme="dark"] .task-summary-pill.is-today {
  border-color: #79513e;
  background: #382a24;
  color: #ffd1b6;
}

:root[data-theme="dark"] .task-summary-pill.is-week {
  border-color: #495c73;
  background: #252e39;
  color: #c5d5e8;
}

:root[data-theme="dark"] .task-item.is-overdue {
  border-color: #704043;
  background: #2b2021;
}

:root[data-theme="dark"] .task-item.is-today {
  border-color: #704b39;
  background: #2c2420;
}

:root[data-theme="dark"] .task-item.is-completed {
  border-color: #435748;
  background: #222a24;
}

:root[data-theme="dark"] .task-item-details,
:root[data-theme="dark"] .task-step-progress,
:root[data-theme="dark"] .relative-time,
:root[data-theme="dark"] .journal-entry .entry-card-meta time,
:root[data-theme="dark"] .journal-entry .entry-card-content {
  color: #c2bcb9;
}

:root[data-theme="dark"] .priority-high {
  border-color: #f0787d;
  background: #3b2627;
  color: #ffc2c4;
}

:root[data-theme="dark"] .priority-medium {
  border-color: #d4a84e;
  background: #352e22;
  color: #f6d990;
}

:root[data-theme="dark"] .priority-low {
  border-color: #68615e;
  background: #302d2c;
  color: #e0dad7;
}

:root[data-theme="dark"] .deadline-tomorrow {
  background: #59451f;
  color: #ffe4a3;
}

:root[data-theme="dark"] .deadline-this-week,
:root[data-theme="dark"] .deadline-later {
  background: #343c45;
  color: #e0e7ef;
}

:root[data-theme="dark"] .deadline-no-date {
  background: #393533;
  color: #e1dcda;
}

:root[data-theme="dark"] .deadline-completed {
  background: #27402f;
  color: #c8ebd1;
}

:root[data-theme="dark"] .deadline-count {
  background: #393533;
  color: #e1dcda;
}

:root[data-theme="dark"] .task-overflow-menu {
  background: var(--surface);
}

:root[data-theme="dark"] .task-overflow > summary {
  color: var(--ink);
}

@media (max-width: 760px) {
  .feed-list {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .task-list {
    padding: 0;
  }

  .task-item {
    min-height: 0;
    grid-template-columns: 28px minmax(0, 1fr) 34px;
    grid-template-areas:
      "check main overflow"
      "check side side";
    align-items: start;
    gap: 8px 10px;
    padding: 13px 12px;
  }

  .task-check-circle {
    margin-top: 2px;
  }

  .task-card-side {
    grid-area: side;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    justify-self: stretch;
  }

  .task-deadline {
    justify-items: start;
  }

  .relative-time {
    text-align: left;
  }

  .task-item-main {
    grid-area: main;
  }

  .task-overflow {
    grid-area: overflow;
  }
}

@media (max-width: 560px) {
  .due-date-time-fields {
    grid-template-columns: minmax(0, 1fr);
  }

  .task-summary-pills {
    gap: 7px;
    margin-top: -6px;
  }

  .task-summary-pill {
    min-height: 34px;
    padding: 0 9px;
    font-size: 10px;
  }

  .task-list {
    padding: 0;
  }

  .deadline-section > summary {
    min-height: 44px;
    padding: 4px 2px 8px;
  }

  .deadline-task-list {
    padding: 0 0 14px;
  }

  .task-item {
    min-height: 0;
    grid-template-columns: 26px minmax(0, 1fr) 34px;
    grid-template-areas:
      "check main overflow"
      "check side side";
    gap: 8px;
    padding: 12px 10px;
  }

  .task-item-title {
    font-size: 15px;
  }

  .task-overflow > summary {
    width: 34px;
    height: 34px;
  }

  .task-card-side {
    align-items: flex-start;
  }

  .deadline-chip {
    min-height: 26px;
    padding: 0 9px;
    font-size: 10px;
    white-space: normal;
  }

  .task-item-details {
    gap: 5px 8px;
  }

  .task-step-progress {
    flex-wrap: wrap;
  }

  .journal-entry {
    padding: 16px 14px;
  }
}

:root[data-theme="dark"] .date-picker-popover {
  border-color: var(--line);
  background: #2b2928;
  color: var(--ink);
}

:root[data-theme="dark"] .time-picker-popover,
:root[data-theme="dark"] .profile-menu-panel {
  border-color: var(--line);
  background: #2b2928;
  color: var(--ink);
}

:root[data-theme="dark"] :is(
  .calendar-card,
  .calendar-agenda,
  .journal-composer,
  .task-chat-panel,
  .task-detail-dialog,
  .task-dialog,
  .task-journal-entry,
  .date-picker-popover,
  .time-picker-popover,
  .profile-menu-panel,
  .schedule-ai,
  .agenda-list > li
) {
  border-color: var(--line);
  background-color: var(--surface);
  color: var(--ink);
}

:root[data-theme="dark"] :is(
  .task-ai-messages,
  .task-chat-messages,
  .task-chat-task-summary,
  .task-chat-draft,
  .calendar-day,
  .calendar-header,
  .agenda-date,
  .date-picker-day,
  .time-picker-option,
  .sidebar-note
) {
  border-color: var(--line);
  background-color: var(--surface-soft);
  color: var(--ink);
}

:root[data-theme="dark"] :is(
  .task-ai-message:not(.user),
  .task-chat-message.assistant
) {
  background: #393635;
  color: #f3efed;
}

:root[data-theme="dark"] :is(
  .field > label,
  .field-label-row label,
  .weekly-picker-label,
  .task-chat-toolbar .field > span,
  .calendar-agenda h2,
  .calendar-day,
  .date-picker-day
) {
  color: var(--ink);
}

:root[data-theme="dark"] :is(
  .task-chat-toolbar select,
  .task-chat-form textarea,
  .task-ai-compose textarea,
  .task-detail-journal-form textarea,
  .journal-composer textarea,
  .field input,
  .field select,
  .field textarea
) {
  border-color: var(--line);
  background: #201e1d;
  color: var(--ink);
}

:root[data-theme="dark"] :is(
  .filter-option:hover,
  .profile-menu-panel a:hover,
  .profile-menu-panel button:hover
) {
  background: #342d2c;
  color: var(--ink);
}

:root[data-theme="dark"] :is(.filter-option.is-active, .filter-option.is-current) {
  background: #3b2627;
  color: #ffbfc2;
}

:root[data-theme="dark"] .filter-option {
  color: var(--ink);
}

:root[data-theme="dark"] .sidebar-label {
  color: var(--muted);
}

:root[data-theme="dark"] input:not([type="checkbox"]):not([type="radio"]),
:root[data-theme="dark"] select,
:root[data-theme="dark"] textarea {
  border-color: var(--line);
  background-color: #201e1d;
  color: var(--ink);
}

:root[data-theme="dark"] .journal-entry .entry-card-content,
:root[data-theme="dark"] .journal-entry .entry-card-meta time {
  color: #d3ccca;
}

:root[data-theme="dark"] .calendar-day.is-today,
:root[data-theme="dark"] .calendar-day.is-selected {
  border-color: var(--red);
  background: #3b2627;
  color: #fff;
}

:root[data-theme="dark"] .calendar-day:disabled {
  color: #827a77;
}

.study-drill-body {
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  margin-top: 14px;
}

.study-drill-empty {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.study-drill-cta {
  width: fit-content;
  text-decoration: none;
}

.study-drill-meta {
  display: flex;
  min-width: 0;
  max-width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.study-drill-badge {
  min-width: 0;
  max-width: 100%;
  flex: 0 1 auto;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--red-tint);
  color: var(--red-deep);
  font-size: 10px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.study-drill-counter {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
}

.study-drill-question {
  min-width: 0;
  max-width: 100%;
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.study-drill-options {
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
}

.study-drill-opt {
  min-width: 0;
  max-width: 100%;
  text-align: left;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--ink);
  font-size: 12px;
  line-height: 1.4;
  overflow-wrap: anywhere;
  cursor: pointer;
  transition: border-color 130ms ease, background-color 130ms ease;
}

.study-drill-opt:hover {
  border-color: #d6b6b8;
}

.study-drill-opt.is-correct {
  border-color: #10b981;
  background: #ecfdf5;
  color: #065f46;
  font-weight: 650;
}

.study-drill-opt.is-wrong {
  border-color: #ef4444;
  background: #fef2f2;
  color: #991b1b;
}

:root[data-theme="dark"] .study-drill-opt.is-correct {
  background: #1a3327;
  color: #a7f3d0;
}

:root[data-theme="dark"] .study-drill-opt.is-wrong {
  background: #3a2021;
  color: #fecaca;
}

.study-drill-exp {
  margin: 0;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.study-drill-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 2px;
}

.study-drill-next {
  min-height: 32px;
  padding: 0 11px;
  font-size: 11px;
}

@media (max-width: 980px) {
  :root[data-theme="dark"] .sidebar {
    background: transparent;
  }

  :root[data-theme="dark"] .sidebar:has(.filter-nav),
  :root[data-theme="dark"] .sidebar:has(.category-nav) {
    background: var(--surface);
  }

  :root[data-theme="dark"] .workspace-nav {
    border-top-color: var(--line);
    background: var(--surface);
    box-shadow: 0 -4px 18px rgb(0 0 0 / 35%);
  }

  :root[data-theme="dark"] .pet-peek-dock {
    border-color: var(--line);
    background: var(--surface);
    box-shadow: 0 8px 24px rgb(0 0 0 / 45%);
  }
}

@media (max-width: 760px) {
  .sidebar:has(.filter-nav),
  .sidebar:has(.category-nav) {
    padding-right: 12px;
    padding-left: 12px;
  }

  .page-content {
    max-width: none;
  }
}

.pet-peek-dock {
  display: none;
}

@media (max-width: 980px) {
  .pet-peek-dock {
    position: fixed;
    right: 0;
    bottom: calc(78px + env(safe-area-inset-bottom));
    z-index: 35;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 8px 6px 10px;
    border: 1px solid var(--line);
    border-right: 0;
    border-radius: 999px 0 0 999px;
    background: var(--surface, #fff);
    box-shadow: 0 6px 20px rgb(34 24 24 / 14%);
    transform: translateX(calc(100% + 16px));
    transition: transform 0.36s cubic-bezier(0.22, 1, 0.36, 1);
  }

  .pet-peek-dock[hidden] {
    display: none;
  }

  .pet-peek-dock.is-visible {
    transform: translateX(0);
  }

  .pet-peek-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--ink);
    font-size: 11px;
    font-weight: 700;
    text-decoration: none;
  }

  .pet-peek-emoji {
    font-size: 16px;
    line-height: 1;
    animation: pet-peek-bob 1.8s ease-in-out infinite;
  }

  .pet-peek-close {
    display: grid;
    width: 20px;
    height: 20px;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--muted);
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
  }

  @keyframes pet-peek-bob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-2px); }
  }
}

.dashboard-heading-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dashboard-voice-button {
  display: inline-grid;
  place-items: center;
  min-height: 40px;
  height: 40px;
}

.gemini-sparkle-icon {
  width: 20px;
  height: 20px;
  display: block;
}

.voice-task-toast {
  position: fixed;
  top: auto;
  bottom: 24px;
  right: 24px;
  z-index: 60;
  width: min(380px, calc(100vw - 32px));
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 14px 36px rgb(28 20 20 / 16%);
  display: grid;
  gap: 10px;
}

.voice-task-toast[hidden] {
  display: none;
}

.voice-toast-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.voice-toast-kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.voice-toast-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}

.voice-toast-text {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted);
}

.voice-toast-text.is-error {
  color: var(--red-deep);
}

.voice-toast-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.voice-toast-chip {
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--ink);
  font-size: 11px;
  font-weight: 600;
}

.voice-toast-steps {
  margin: 0;
  padding-left: 18px;
  font-size: 12px;
  color: var(--muted);
  display: grid;
  gap: 2px;
}

.voice-toast-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.voice-toast-actions button {
  min-height: 34px;
  padding: 6px 12px;
  font-size: 12px;
}

.voice-task-toast .secondary-button {
  background: var(--surface-soft);
  border-color: var(--line);
  color: var(--ink);
}

.schedule-ai select {
  min-height: 40px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 11px;
  background: var(--surface, #fff);
  color: var(--ink);
  font-size: 11px;
}

.schedule-ai-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.schedule-overview {
  display: grid;
  gap: 6px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft, #fbf9f8);
  font-size: 10px;
  color: var(--muted);
}

.schedule-overview strong {
  color: var(--ink);
}

.schedule-overview-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.overview-day-chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface, #fff);
  color: var(--ink);
  padding: 4px 8px;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
}

.overview-day-chip:hover,
.overview-day-chip.is-active {
  border-color: var(--red);
  background: var(--red-tint);
  color: var(--red-deep);
}

#schedule-suggestion[hidden] {
  display: none;
}

.schedule-confirm-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

#schedule-suggestion button.schedule-confirm-btn {
  width: fit-content;
  border: 0;
  border-radius: 6px;
  background: var(--red);
  color: #fff;
  padding: 7px 10px;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}

#schedule-suggestion button.schedule-cancel-btn {
  width: fit-content;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface, #fff);
  color: var(--ink);
  padding: 7px 10px;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
}

.streak-pet-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
}

.streak-pet-stage-1 {
  background: linear-gradient(to bottom, rgba(250, 204, 21, 0.2), rgba(245, 158, 11, 0.1));
}

.streak-pet-stage-2 {
  background: linear-gradient(to bottom, rgba(249, 115, 22, 0.2), rgba(239, 68, 68, 0.1));
}

.streak-pet-stage-3 {
  background: linear-gradient(to bottom, rgba(147, 51, 234, 0.2), rgba(219, 39, 119, 0.1));
}

.streak-pet-stage-4 {
  background: linear-gradient(to bottom, rgba(37, 99, 235, 0.2), rgba(79, 70, 229, 0.1));
}

.streak-pet-stage-5 {
  background: linear-gradient(to bottom, rgba(6, 182, 212, 0.2), rgba(20, 184, 166, 0.1));
}

.streak-pet-media {
  position: relative;
  width: 176px;
  height: 176px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.streak-pet-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 4px 3px rgba(0, 0, 0, 0.07)) drop-shadow(0 2px 2px rgba(0, 0, 0, 0.06));
  user-select: none;
}

.streak-pet-fallback {
  font-size: 4rem;
  line-height: 1;
  user-select: none;
}

.streak-pet-title {
  margin: 16px 0 0;
  font-size: 1.25rem;
  line-height: 1.75rem;
  font-weight: 700;
  letter-spacing: 0.025em;
}

.streak-pet-label {
  margin: 4px 0 0;
  font-size: 0.75rem;
  line-height: 1rem;
  color: var(--muted, #a3a3a3);
}

.streak-pet-status {
  margin-top: 8px;
  padding: 4px 12px;
  border-radius: 9999px;
  background: rgba(0, 0, 0, 0.2);
  color: var(--ink, #d4d4d4);
  font-size: 0.75rem;
  line-height: 1rem;
  font-weight: 500;
}
