body {
  background:
    radial-gradient(circle at 12% 0%, rgba(255, 196, 112, 0.32), transparent 28%),
    radial-gradient(circle at 82% 8%, rgba(92, 191, 166, 0.24), transparent 30%),
    #fbf8f0;
}

:root {
  --accent: #249b73;
  --accent-2: #ff7a59;
  --warm: #fff1cf;
  --rose: #ff6b70;
  --pink: #f89ac2;
  --sky: #5b8def;
  --leaf: #48b26b;
  --ink: #20252b;
}

.sidebar {
  background: linear-gradient(180deg, #fffdfa, #eefbf5);
}

.brand-mark {
  background: linear-gradient(135deg, #20a879, #ffad55);
}

.panel,
.task-card,
.inventory-card,
.ledger-row,
.okr-card {
  border-color: rgba(50, 72, 66, 0.14);
}

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

.weekday {
  border-radius: 8px;
  background: #fff5d9;
  color: #6b4f12;
  font-weight: 700;
  padding: 8px;
  text-align: center;
}

.month-panel {
  overflow: hidden;
}

.month-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.month-cell {
  position: relative;
  min-height: 118px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 8px;
}

.month-cell:nth-child(7n) {
  border-right: 0;
}

.month-cell.out-month {
  background: #faf7ef;
  color: #9a9388;
}

.day-add {
  position: absolute;
  top: 6px;
  right: 6px;
  display: none;
  width: 26px;
  min-height: 26px;
  border-radius: 50%;
  padding: 0;
  line-height: 1;
}

.day-cell:hover .day-add,
.month-cell:hover .day-add {
  display: grid;
  place-items: center;
}

.task-bar-layer {
  position: absolute;
  inset: 34px 0 8px;
  pointer-events: none;
}

.task-span {
  position: absolute;
  z-index: 1;
  height: 22px;
  border-radius: 999px;
  color: #fff;
  font-size: 12px;
  line-height: 22px;
  padding: 0 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  pointer-events: auto;
}

.time-dot {
  display: inline-flex;
  margin: 3px 3px 0 0;
  border-radius: 999px;
  background: rgba(32, 37, 43, 0.08);
  padding: 2px 6px;
  font-size: 11px;
}

.axis-board {
  display: grid;
  grid-template-columns: 42px 1fr;
  grid-template-rows: auto 1fr auto;
  gap: 8px;
}

.axis-y {
  grid-row: 2;
  writing-mode: vertical-rl;
  text-align: center;
  color: var(--muted);
  font-weight: 700;
}

.axis-x {
  grid-column: 2;
  text-align: center;
  color: var(--muted);
  font-weight: 700;
}

.axis-grid {
  grid-column: 2;
  grid-row: 2;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(220px, auto));
  gap: 12px;
}

.quadrant {
  min-height: 220px;
  border: 2px solid transparent;
}

.quadrant.q1 {
  background: #fff0f1;
  border-color: var(--rose);
}

.quadrant.q2 {
  background: #fff0f8;
  border-color: var(--pink);
}

.quadrant.q3 {
  background: #eef4ff;
  border-color: var(--sky);
}

.quadrant.q4 {
  background: #effaf1;
  border-color: var(--leaf);
}

.kanban-column {
  min-height: 420px;
  border: 2px dashed rgba(36, 155, 115, 0.22);
  background: rgba(255, 255, 255, 0.78);
}

.kanban-column.drag-over {
  border-color: var(--accent);
  background: #effaf5;
}

.kanban-task {
  cursor: grab;
}

.kanban-task:active {
  cursor: grabbing;
}

.farm-scene {
  display: grid;
  gap: 14px;
  place-items: center;
  margin-top: 18px;
}

.farm-plot {
  position: relative;
  width: min(440px, 100%);
  height: 180px;
  border: 3px solid #8f6438;
  border-radius: 8px;
  background:
    repeating-linear-gradient(90deg, rgba(105, 74, 42, 0.16) 0 16px, transparent 16px 32px),
    linear-gradient(#c6884c, #9f6a3e);
  overflow: hidden;
}

.crop {
  position: absolute;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  width: 90px;
  height: 90px;
}

.crop::before,
.crop::after {
  content: "";
  position: absolute;
  border-radius: 50%;
}

.crop::before {
  left: 28px;
  bottom: 0;
  width: 34px;
  height: var(--stem-height, 30px);
  border-radius: 18px;
  background: #2f9d58;
  transition: height 0.4s ease;
}

.crop::after {
  left: 18px;
  bottom: calc(var(--stem-height, 30px) - 6px);
  width: var(--fruit-size, 48px);
  height: var(--fruit-size, 48px);
  background: var(--fruit-color, #e8483f);
  box-shadow: 24px 8px 0 rgba(47, 157, 88, 0.72);
  transition: all 0.4s ease;
}

.farm-progress {
  width: min(440px, 100%);
}

.reward-hero {
  background: linear-gradient(135deg, #fff4d7, #effaf4);
}

.reward-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.icon-card h4::before {
  margin-right: 6px;
}

.icon-card[data-kind="crop"] h4::before { content: "🌱"; }
.icon-card[data-kind="voucher"] h4::before { content: "🎟"; }
.icon-card[data-kind="loot_box"] h4::before { content: "🎁"; }
.icon-card[data-kind="fund"] h4::before { content: "🎯"; }

@media (max-width: 700px) {
  .calendar-grid,
  .calendar-head,
  .month-grid {
    grid-template-columns: repeat(7, minmax(44px, 1fr));
    min-width: 620px;
  }

  .month-panel,
  .panel:has(.calendar-grid) {
    overflow-x: auto;
  }

  .month-cell {
    min-height: 110px;
  }

  .task-bar-layer {
    display: none;
  }

  .axis-board {
    grid-template-columns: 1fr;
  }

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

  .axis-y,
  .axis-x {
    writing-mode: initial;
    grid-column: auto;
    grid-row: auto;
  }
}


/* Reference-style visual refresh based on the provided desktop examples. */
:root {
  --bg: #f6f8fc;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --text: #0f172a;
  --muted: #94a3b8;
  --line: #e8edf5;
  --accent: #5b7df6;
  --accent-strong: #4f73f6;
  --shadow: none;
}

body {
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
}

.app-shell {
  grid-template-columns: 50px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  z-index: 10;
  width: 50px;
  padding: 10px 7px;
  border-right: 0;
  background: linear-gradient(180deg, #5b7df6, #4f73f6);
  box-shadow: none;
}

.brand {
  justify-content: center;
  margin-bottom: 18px;
}

.brand > div:not(.brand-mark) {
  display: none;
}

.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, #fde68a, #7dd3fc 55%, #86efac);
  color: #2453df;
  font-size: 14px;
}

.nav {
  align-content: start;
  gap: 10px;
}

.nav button {
  position: relative;
  display: grid;
  place-items: center;
  width: 36px;
  min-height: 36px;
  padding: 0;
  border-radius: 8px;
  background: transparent;
  color: transparent;
  font-size: 0;
}

.nav button::before {
  color: rgba(255, 255, 255, 0.72);
  font-size: 18px;
  line-height: 1;
}

.nav button:nth-child(1)::before { content: "✓"; }
.nav button:nth-child(2)::before { content: "＋"; }
.nav button:nth-child(3)::before { content: "▦"; }
.nav button:nth-child(4)::before { content: "✣"; }
.nav button:nth-child(5)::before { content: "◎"; }
.nav button:nth-child(6)::before { content: "◎"; }
.nav button:nth-child(7)::before { content: "◷"; }
.nav button:nth-child(8)::before { content: "◇"; }
.nav button:nth-child(9)::before { content: "↻"; }
.nav button:nth-child(10)::before { content: "?"; }

.nav button.active,
.nav button:hover {
  background: rgba(255, 255, 255, 0.18);
}

.nav button.active::before,
.nav button:hover::before {
  color: #fff;
}

.main {
  height: 100vh;
  overflow: hidden;
}

.topbar {
  display: none;
}

.content {
  height: 100vh;
  gap: 0;
  padding: 0;
  overflow: hidden;
}

.panel,
.task-card,
.inventory-card,
.ledger-row,
.okr-card {
  box-shadow: none;
}

.calendar-workbench,
.matrix-reference-page {
  height: 100vh;
  min-width: 0;
  overflow: hidden;
  background: var(--bg);
}

.reference-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  border-bottom: 1px solid var(--line);
  background: rgba(248, 250, 252, 0.96);
  padding: 0 18px;
}

.calendar-title {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
}

.calendar-title strong {
  font-size: 24px;
  line-height: 1;
}

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

.calendar-tools,
.mode-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.tool-icon,
.today-button,
.tool-chip {
  min-height: 32px;
  border: 1px solid #d7dee8;
  border-radius: 8px;
  background: #fff;
  color: #0f172a;
  padding: 0 11px;
  font-size: 14px;
}

.tool-icon {
  width: 32px;
  padding: 0;
  font-size: 18px;
}

.tool-chip.active {
  background: #e9eef8;
  font-weight: 700;
}

.date-jump {
  width: 132px;
  height: 32px;
  padding: 4px 8px;
  border-radius: 8px;
  background: #fff;
  font-size: 12px;
}

.more-dot {
  color: #0f172a;
  letter-spacing: 2px;
}

.time-page,
.month-page {
  height: calc(100vh - 64px);
  overflow: auto;
}

.time-week-label {
  height: 24px;
  padding: 8px 0 0 16px;
  color: var(--muted);
  font-size: 12px;
}

.day-single-head,
.week-header-row,
.week-all-day {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  border-bottom: 1px solid var(--line);
  background: #fbfcff;
}

.day-single-head {
  grid-template-columns: 68px 1fr auto;
  align-items: center;
  height: 52px;
  padding-right: 12px;
}

.day-single-head span {
  color: var(--muted);
  text-align: center;
}

.day-single-head small {
  color: var(--muted);
}

.date-badge,
.week-day-head.is-today strong,
.today-cell .month-date-line strong {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: var(--accent-strong);
  color: #fff;
  font-weight: 800;
}

.week-header-row,
.week-all-day {
  grid-template-columns: 68px repeat(7, minmax(138px, 1fr));
  min-width: 1020px;
}

.week-header-row {
  height: 54px;
}

.week-header-row > span,
.week-all-day > span {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 12px;
}

.week-day-head {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 8px;
  min-height: 54px;
  border: 0;
  border-left: 1px solid var(--line);
  border-radius: 0;
  background: #fbfcff;
  color: var(--text);
  padding: 0 10px;
  text-align: left;
}

.week-day-head small,
.week-day-head em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.week-day-head strong {
  font-size: 16px;
}

.week-all-day {
  min-height: 30px;
}

.all-day-strip {
  display: grid;
  gap: 3px;
  padding: 3px;
}

.all-day-strip .mini-task {
  min-height: 20px;
  border: 0;
  border-radius: 4px;
  color: rgba(15, 23, 42, 0.72);
  padding: 2px 6px;
  text-align: left;
}

.time-board {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  min-height: 780px;
  background:
    repeating-linear-gradient(to bottom, transparent 0 59px, var(--line) 59px 60px),
    #f8faff;
}

.week-board {
  min-width: 1020px;
}

.time-scale {
  display: grid;
  grid-template-rows: repeat(13, 60px);
  border-right: 1px solid var(--line);
  color: #8da0b8;
  font-size: 12px;
  text-align: right;
}

.time-scale span {
  padding: 6px 10px 0 0;
}

.week-columns {
  display: grid;
  grid-template-columns: repeat(7, minmax(138px, 1fr));
}

.time-column {
  position: relative;
  min-height: 780px;
  border-left: 1px solid var(--line);
}

.day-column {
  border-left: 0;
}

.time-event {
  position: absolute;
  left: 4px;
  right: 8px;
  top: var(--event-top);
  height: var(--event-height);
  min-height: 36px;
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, 0.05);
  border-radius: 4px;
  background: color-mix(in srgb, var(--event-color) 72%, #fff);
  color: #203044;
  padding: 7px 8px;
  text-align: left;
  cursor: pointer;
}

.time-event strong,
.time-event small {
  display: block;
  margin-left: 16px;
}

.time-event strong {
  font-size: 12px;
}

.time-event small {
  color: #31506a;
  font-size: 11px;
}

.event-check {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 10px;
  height: 10px;
  border: 1px solid rgba(15, 23, 42, 0.3);
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.45);
}

.event-check.checked {
  background: #d1d5db;
}

.floating-add {
  z-index: 4;
  display: none;
}

.time-column:hover .floating-add {
  display: grid;
}

.month-page {
  background: #f8faff;
}

.month-head-row {
  display: grid;
  grid-template-columns: repeat(7, minmax(150px, 1fr));
  min-width: 1050px;
  height: 24px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.month-head-row span {
  padding: 4px 0 0 10px;
}

.month-weeks {
  min-width: 1050px;
}

.reference-month-week {
  position: relative;
  min-height: calc((100vh - 116px) / 6);
  border-bottom: 1px solid var(--line);
}

.reference-month-week .month-grid {
  height: 100%;
  min-height: inherit;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.reference-month-week .month-cell {
  min-height: calc((100vh - 116px) / 6);
  border-color: var(--line);
  background: transparent;
  padding: 6px;
}

.month-date-line {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  color: var(--text);
  font-size: 14px;
}

.month-date-line small,
.month-more,
.calendar-hint {
  color: var(--muted);
  font-size: 12px;
}

.out-month .month-date-line {
  opacity: 0.58;
}

.month-task-layer {
  position: absolute;
  inset: 28px 0 8px;
  display: grid;
  grid-template-columns: repeat(7, minmax(150px, 1fr));
  grid-auto-rows: 20px;
  gap: 3px 5px;
  padding: 0 5px;
  pointer-events: none;
}

.month-task-bar {
  position: relative;
  min-height: 20px;
  border: 0;
  border-radius: 4px;
  color: rgba(15, 23, 42, 0.78);
  padding: 0 6px 0 22px;
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  pointer-events: auto;
}

.month-task-bar small {
  float: right;
  margin-left: 6px;
  color: rgba(15, 23, 42, 0.56);
}

.month-task-bar .event-check {
  top: 5px;
  left: 6px;
}

.calendar-hint {
  margin: 6px 0 0;
  text-align: center;
}

.matrix-reference-page {
  padding: 0;
}

.matrix-reference-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  height: calc(100vh - 64px);
  padding: 12px 14px 16px;
}

.matrix-list-panel {
  min-height: 0;
  overflow: auto;
  border-radius: 10px;
  background: #fff;
  padding: 16px 22px;
}

.matrix-title-row {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 10px;
  min-height: 38px;
}

.matrix-title-row h3 {
  margin: 0;
  font-size: 15px;
}

.matrix-badge {
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
}

.matrix-list-panel.q1 .matrix-badge { background: #f45b69; }
.matrix-list-panel.q2 .matrix-badge { background: #f59e0b; }
.matrix-list-panel.q3 .matrix-badge { background: #4f73f6; }
.matrix-list-panel.q4 .matrix-badge { background: #10b981; }
.matrix-list-panel.q1 h3 { color: #f45b69; }
.matrix-list-panel.q2 h3 { color: #f59e0b; }
.matrix-list-panel.q3 h3 { color: #4f73f6; }
.matrix-list-panel.q4 h3 { color: #10b981; }

.matrix-list-panel details {
  margin-top: 10px;
}

.matrix-list-panel summary {
  cursor: pointer;
  color: #111827;
  font-size: 14px;
  font-weight: 700;
}

.matrix-task-list {
  margin-top: 8px;
}

.matrix-task-row {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr) minmax(120px, 240px);
  align-items: center;
  width: 100%;
  min-height: 40px;
  border: 0;
  border-bottom: 1px solid #eef2f7;
  border-radius: 0;
  background: transparent;
  color: #111827;
  padding: 0 0 0 2px;
  text-align: left;
}

.matrix-task-row strong,
.matrix-task-row small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.matrix-task-row strong {
  font-size: 14px;
  font-weight: 500;
}

.matrix-task-row small {
  color: #9ca3af;
  font-size: 12px;
  text-align: right;
}

.matrix-more {
  min-height: 28px;
  margin-top: 10px;
  background: transparent;
  color: #8b95a5;
  padding: 0;
  font-size: 12px;
}

@media (max-width: 900px) {
  body {
    overflow: auto;
  }

  .app-shell {
    display: block;
    padding-bottom: 58px;
  }

  .sidebar {
    position: fixed;
    top: auto;
    bottom: 0;
    width: 100%;
    height: 58px;
    padding: 8px 10px;
  }

  .brand {
    display: none;
  }

  .nav {
    display: grid;
    grid-template-columns: repeat(10, minmax(0, 1fr));
    gap: 4px;
  }

  .nav button {
    width: 100%;
  }

  .main,
  .content,
  .calendar-workbench,
  .matrix-reference-page {
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  .reference-toolbar {
    align-items: flex-start;
    height: auto;
    gap: 12px;
    padding: 12px;
  }

  .calendar-tools {
    justify-content: flex-end;
    flex-wrap: wrap;
  }

  .date-jump {
    display: none;
  }

  .week-time-page,
  .month-page {
    overflow-x: auto;
  }

  .matrix-reference-grid {
    grid-template-columns: 1fr;
    height: auto;
  }

  .matrix-list-panel {
    min-height: 320px;
  }
}

/* Matrix row readability fix: keep the task title readable before metadata. */
.matrix-task-row {
  grid-template-columns: 14px minmax(0, 1fr);
  grid-template-areas:
    "check title"
    ". meta";
  row-gap: 2px;
  min-height: 46px;
  padding: 4px 0 5px 2px;
}

.matrix-task-row .event-check {
  grid-area: check;
  position: static;
}

.matrix-task-row strong {
  grid-area: title;
}

.matrix-task-row small {
  grid-area: meta;
  text-align: left;
}

/* Feedback fixes: text navigation, redesigned add buttons, lively farm, crop inventory cards. */
.app-shell {
  grid-template-columns: 176px minmax(0, 1fr);
}

.sidebar {
  width: 176px;
  padding: 16px 12px;
  background: linear-gradient(180deg, #5b7df6, #4f73f6);
}

.brand {
  justify-content: flex-start;
  gap: 10px;
  margin-bottom: 18px;
}

.brand > div:not(.brand-mark) {
  display: block;
}

.brand h1,
.brand p {
  color: #fff;
}

.brand p {
  opacity: 0.72;
}

.nav {
  gap: 6px;
}

.nav button {
  display: flex;
  justify-content: flex-start;
  width: 100%;
  min-height: 38px;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 14px;
  font-weight: 600;
  padding: 0 12px;
  text-align: left;
}

.nav button::before {
  content: none !important;
}

.nav button.active,
.nav button:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.tool-icon[data-action="quick-add-date"],
.day-add,
.matrix-title-row .tool-icon {
  position: relative;
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #6d8bff, #4f73f6);
  color: transparent;
  font-size: 0;
  box-shadow: 0 6px 16px rgba(79, 115, 246, 0.24);
}

.tool-icon[data-action="quick-add-date"]::before,
.tool-icon[data-action="quick-add-date"]::after,
.day-add::before,
.day-add::after,
.matrix-title-row .tool-icon::before,
.matrix-title-row .tool-icon::after {
  content: "";
  position: absolute;
  width: 12px;
  height: 2px;
  border-radius: 999px;
  background: #fff;
}

.tool-icon[data-action="quick-add-date"]::after,
.day-add::after,
.matrix-title-row .tool-icon::after {
  transform: rotate(90deg);
}

.day-add {
  width: 26px;
  height: 26px;
  min-height: 26px;
  padding: 0;
}

.farm-scene.animated-farm {
  width: min(460px, 100%);
  margin: 16px auto 0;
  border-radius: 18px;
  background: linear-gradient(180deg, #dff5ff 0%, #f6fff2 58%, #fff8df 100%);
  padding: 18px;
  box-shadow: inset 0 0 0 1px rgba(79, 115, 246, 0.12);
}

.farm-sky {
  position: relative;
  height: 38px;
  overflow: hidden;
}

.farm-sky span {
  position: absolute;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: rgba(255, 208, 90, 0.88);
  animation: farmSparkle 2.4s ease-in-out infinite;
}

.farm-sky span:nth-child(1) { left: 18%; top: 6px; }
.farm-sky span:nth-child(2) { left: 54%; top: 14px; animation-delay: .45s; }
.farm-sky span:nth-child(3) { left: 82%; top: 4px; animation-delay: .9s; }

.farm-plot.farm-plot-soft {
  position: relative;
  width: 100%;
  height: 190px;
  border: 0;
  border-radius: 18px;
  background: linear-gradient(180deg, #9ddf8f 0 28%, #bd8855 28% 100%);
  box-shadow: inset 0 -10px 0 rgba(84, 49, 22, 0.08), 0 14px 30px rgba(57, 99, 72, 0.12);
}

.farm-row {
  position: absolute;
  left: 26px;
  right: 26px;
  height: 18px;
  border-radius: 999px;
  background: rgba(111, 69, 33, 0.22);
}

.farm-row.row-1 { bottom: 38px; }
.farm-row.row-2 { bottom: 72px; }
.farm-row.row-3 { bottom: 106px; }

.farm-crop-icon {
  position: absolute;
  left: 50%;
  bottom: 74px;
  transform: translateX(-50%) scale(calc(0.7 + var(--focus-progress, 0) / 240));
  display: grid;
  place-items: center;
  width: 82px;
  height: 82px;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.78);
  font-size: 44px;
  filter: drop-shadow(0 12px 18px rgba(35, 64, 41, 0.18));
  animation: cropGrowBounce 1.35s ease-in-out infinite;
}

.farm-crop-icon.crop-sprout { background: rgba(218, 255, 228, 0.86); }
.farm-crop-icon.crop-flower { background: rgba(255, 232, 246, 0.9); }
.farm-crop-icon.crop-tree { background: rgba(224, 246, 218, 0.9); }
.farm-crop-icon.crop-tomato { background: rgba(255, 232, 225, 0.9); }

.farm-crop-icon.stage-1 { opacity: 0.72; }
.farm-crop-icon.stage-2 { opacity: 0.86; }
.farm-crop-icon.stage-3,
.farm-crop-icon.stage-4,
.farm-crop-icon.stage-5 { opacity: 1; }

.crop-stage {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.crop-token {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: #f1f5f9;
  font-size: 22px;
}

.crop-token-tomato { background: #ffe4df; }
.crop-token-sprout { background: #dcfce7; }
.crop-token-flower { background: #fce7f3; }
.crop-token-tree { background: #def7d7; }

.crop-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.crop-inventory-card h4 {
  margin: 0 0 4px;
}

.inventory-list-merged .inventory-card {
  border-left-width: 6px;
}

.category-manage-row {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 10px;
}

.category-color-code {
  color: var(--muted);
  font-size: 12px;
}

@keyframes cropGrowBounce {
  0%, 100% { transform: translateX(-50%) translateY(0) scale(calc(0.7 + var(--focus-progress, 0) / 240)); }
  50% { transform: translateX(-50%) translateY(-8px) scale(calc(0.76 + var(--focus-progress, 0) / 235)); }
}

@keyframes farmSparkle {
  0%, 100% { opacity: 0.35; transform: translateY(0) scale(0.8); }
  50% { opacity: 1; transform: translateY(-8px) scale(1.15); }
}

@media (max-width: 900px) {
  .app-shell {
    display: block;
    padding-bottom: 58px;
  }

  .sidebar {
    width: 100%;
  }

  .nav button {
    justify-content: center;
    padding: 0 4px;
    font-size: 12px;
  }
}

/* 2026-07-07 interaction cleanup: hover-only calendar add, compact kanban, focus modes. */
.month-cell .day-add,
.day-cell .day-add {
  display: none !important;
  opacity: 0;
  transform: translateY(-3px) scale(0.92);
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.month-cell:hover .day-add,
.month-cell:focus-within .day-add,
.day-cell:hover .day-add,
.day-cell:focus-within .day-add {
  display: grid !important;
  opacity: 1;
  transform: translateY(0) scale(1);
}

.month-cell .day-add {
  top: 30px;
  right: 8px;
  z-index: 8;
}

.month-date-line {
  position: relative;
  z-index: 9;
  min-height: 24px;
  padding-right: 34px;
}

.reference-month-week .month-cell {
  padding-top: 7px;
}

.month-task-layer {
  inset: 52px 0 8px;
  grid-auto-rows: 20px;
  z-index: 3;
}

.month-task-bar {
  min-height: 19px;
  line-height: 19px;
  box-shadow: none;
}

.today-cell .month-date-line strong {
  position: relative;
  z-index: 10;
}

.compact-kanban-page {
  height: 100vh;
  overflow: hidden;
  background: #f8faff;
}

.kanban-compact-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
  border-bottom: 1px solid var(--line);
  background: rgba(248, 250, 252, 0.98);
  padding: 10px 18px;
}

.kanban-compact-toolbar h3 {
  margin: 0;
  font-size: 20px;
}

.kanban-board-compact {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  height: calc(100vh - 58px);
  padding: 14px 16px 16px;
}

.kanban-board-compact .kanban-column {
  min-height: 0;
  overflow: auto;
  border-style: dashed;
  border-radius: 10px;
  padding: 14px;
}

.kanban-board-compact .kanban-column h3 {
  margin: 0 0 12px;
  font-size: 18px;
}

.focus-page-grid {
  display: grid;
  grid-template-columns: minmax(360px, 0.9fr) minmax(420px, 1fr);
  gap: 14px;
  padding: 0;
}

.focus-setup-panel,
.focus-timer,
.focus-history-panel {
  box-shadow: none;
}

.focus-toolbar {
  align-items: center;
  margin-bottom: 12px;
}

.focus-mode-toggle .tool-chip {
  min-height: 30px;
}

.focus-form {
  gap: 12px;
}

.synced-crop-preview {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
  padding: 6px 10px;
}

.synced-crop-preview span {
  color: var(--muted);
  font-size: 12px;
}

.crop-choice-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.crop-choice {
  display: grid;
  justify-items: center;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 10px 8px;
  text-align: center;
  cursor: pointer;
}

.crop-choice input {
  width: auto;
  margin: 0;
}

.crop-choice:has(input:checked) {
  border-color: #5b7df6;
  box-shadow: 0 0 0 2px rgba(91, 125, 246, 0.14);
}

.crop-choice strong {
  font-size: 13px;
}

.crop-choice span,
.focus-rule-text {
  color: var(--muted);
  font-size: 12px;
}

.center-actions {
  justify-content: center;
}

.countup-running .timer-value {
  color: #172554;
}

@media (max-width: 980px) {
  .kanban-board-compact,
  .focus-page-grid {
    grid-template-columns: 1fr;
    height: auto;
  }

  .compact-kanban-page {
    height: auto;
    overflow: visible;
  }

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

/* 2026-07-07 Forest-style visible farm inventory. */
.forest-timer-panel {
  overflow: hidden;
}

.forest-growth-scene {
  position: relative;
}

.forest-growth-scene .farm-plot-soft::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at 50% calc(88% - var(--focus-progress, 0) * .18), rgba(255, 255, 255, 0.38), transparent 30%);
  pointer-events: none;
}

.farm-growth-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  margin-top: 10px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(236, 253, 245, 0.95);
  color: #176b45;
  font-size: 13px;
  font-weight: 700;
}

.focus-garden-panel {
  margin-top: 14px;
  border: 1px solid #d9ead3;
  background: linear-gradient(180deg, #fbfff7 0%, #f3fbef 100%);
  box-shadow: none;
}

.focus-garden-toolbar {
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 14px;
}

.focus-garden-toolbar h3,
.focus-garden-toolbar p {
  margin: 0;
}

.coin-badge {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: #fff4cc;
  color: #7a4b00;
  white-space: nowrap;
}

.focus-garden-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
}

.farm-inventory-plot {
  display: grid;
  gap: 10px;
  border: 1px solid rgba(102, 146, 92, 0.24);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.78);
  padding: 12px;
  box-shadow: 0 14px 28px rgba(70, 105, 70, 0.08);
}

.plot-soil {
  position: relative;
  min-height: 138px;
  overflow: hidden;
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(142, 218, 128, 0.95) 0 34%, rgba(181, 120, 68, 0.95) 34% 100%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.08) 0 18px, transparent 18px 36px);
  box-shadow: inset 0 -10px 0 rgba(89, 55, 30, 0.08);
}

.plot-soil .plot-row {
  position: absolute;
  left: 18px;
  right: 18px;
  height: 14px;
  border-radius: 999px;
  background: rgba(96, 58, 30, 0.22);
}

.plot-soil .plot-row:nth-child(1) { bottom: 28px; }
.plot-soil .plot-row:nth-child(2) { bottom: 56px; }
.plot-soil .plot-row:nth-child(3) { bottom: 84px; }

.plot-crop-icon {
  position: absolute;
  left: 50%;
  bottom: 52px;
  display: grid;
  place-items: center;
  width: 74px;
  height: 74px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.82);
  font-size: 42px;
  transform: translateX(-50%);
  filter: drop-shadow(0 12px 16px rgba(45, 74, 47, 0.2));
  animation: gardenIdle 2.8s ease-in-out infinite;
  animation-delay: calc(var(--plot-index, 0) * .15s);
}

.plot-quantity {
  position: absolute;
  right: 10px;
  top: 10px;
  min-width: 34px;
  min-height: 26px;
  display: inline-grid;
  place-items: center;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.78);
  color: #fff;
  font-weight: 800;
}

.plot-info h4 {
  margin: 0 0 3px;
}

.plot-info p {
  margin: 0;
}

.farm-inventory-plot button {
  justify-self: start;
}

.focus-garden-empty {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 150px;
  border: 1px dashed #b7d6ae;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.6);
  padding: 16px;
}

.empty-farm-plot {
  position: relative;
  flex: 0 0 150px;
  height: 104px;
  overflow: hidden;
  border-radius: 16px;
  background: linear-gradient(180deg, #d9f7ca 0 35%, #c58b58 35% 100%);
}

.empty-farm-plot span {
  position: absolute;
  left: 18px;
  right: 18px;
  height: 12px;
  border-radius: 999px;
  background: rgba(90, 54, 27, 0.22);
}

.empty-farm-plot span:nth-child(1) { bottom: 22px; }
.empty-farm-plot span:nth-child(2) { bottom: 46px; }
.empty-farm-plot span:nth-child(3) { bottom: 70px; }

.focus-garden-empty h4,
.focus-garden-empty p {
  margin: 0;
}

@keyframes gardenIdle {
  0%, 100% { transform: translateX(-50%) translateY(0) rotate(-1deg); }
  50% { transform: translateX(-50%) translateY(-6px) rotate(1deg); }
}

@media (max-width: 720px) {
  .focus-garden-toolbar,
  .focus-garden-empty {
    align-items: stretch;
    flex-direction: column;
  }

  .empty-farm-plot {
    flex-basis: auto;
    width: 100%;
  }
}

/* 2026-07-07 garden layout review: keep plots as plots, not full-width rows. */
.focus-garden-grid {
  grid-template-columns: repeat(auto-fill, minmax(190px, 240px));
  align-items: stretch;
}

.farm-inventory-plot {
  min-width: 0;
}

/* 2026-07-07 Forest-like single plant growth scene and harvested farm. */
.forest-focus-grid {
  align-items: stretch;
}

.forest-timer-panel {
  display: grid;
  align-content: start;
  justify-items: center;
}

.forest-growth-stage {
  width: min(520px, 100%);
  margin: 14px auto 0;
  text-align: center;
}

.forest-orb {
  position: relative;
  width: min(360px, 92%);
  aspect-ratio: 1 / 1;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 999px;
  background: linear-gradient(180deg, #e9f7bd 0%, #ecf8c8 52%, #f6f0c8 100%);
  box-shadow: inset 0 0 0 1px rgba(44, 107, 69, 0.12), 0 18px 34px rgba(30, 80, 48, 0.13);
}

.forest-skyline span {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  animation: forestDrift 3.4s ease-in-out infinite;
}

.forest-skyline span:nth-child(1) { left: 22%; top: 18%; }
.forest-skyline span:nth-child(2) { left: 66%; top: 14%; animation-delay: .55s; }
.forest-skyline span:nth-child(3) { left: 78%; top: 35%; animation-delay: 1s; }

.forest-soil-bowl {
  position: absolute;
  left: 50%;
  bottom: 43px;
  width: 242px;
  height: 150px;
  transform: translateX(-50%);
}

.soil-rim {
  position: absolute;
  left: 12px;
  right: 12px;
  top: 28px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(180deg, #9a6425 0%, #7a4608 100%);
  box-shadow: inset 0 12px 0 rgba(190, 130, 52, 0.42);
  z-index: 3;
}

.soil-face {
  position: absolute;
  left: 28px;
  right: 28px;
  top: 58px;
  height: 70px;
  border-radius: 0 0 90px 90px;
  background: linear-gradient(180deg, #7a4608 0%, #5e3504 100%);
  z-index: 2;
}

.soil-underground {
  position: absolute;
  left: 76px;
  right: 76px;
  top: 68px;
  height: 62px;
  z-index: 4;
  pointer-events: none;
}

.root-trace,
.plant-root {
  position: absolute;
  width: 2px;
  border-radius: 999px;
  background: rgba(255, 249, 220, 0.92);
  transform-origin: top center;
  opacity: 0;
}

.forest-growth-stage[data-stage="root"] .root-trace,
.forest-growth-stage[data-stage="sprout"] .root-trace,
.forest-growth-stage[data-stage="growing"] .root-trace,
.forest-growth-stage[data-stage="mature"] .root-trace {
  opacity: 1;
}

.root-left { left: 48%; top: 0; height: 46px; transform: rotate(24deg); }
.root-right { left: 52%; top: 0; height: 52px; transform: rotate(-22deg); }

.plant-stage-mount {
  position: absolute;
  left: 50%;
  top: -18px;
  width: 150px;
  height: 150px;
  transform: translateX(-50%);
  z-index: 5;
}

.forest-plant {
  position: relative;
  width: 150px;
  height: 150px;
  margin: 0 auto;
  transform-origin: 50% 92%;
}

.active-forest-plant {
  animation: activePlantBreath 2.2s ease-in-out infinite;
}

.plant-seed,
.plant-stem,
.plant-leaf,
.plant-bud,
.plant-fruit,
.plant-canopy,
.plant-petal,
.plant-flower-center {
  position: absolute;
  opacity: 0;
  transition: opacity .2s ease, transform .2s ease;
}

.plant-seed {
  left: 69px;
  bottom: 39px;
  width: 13px;
  height: 10px;
  border-radius: 60% 40% 60% 40%;
  background: #9b6b1f;
  box-shadow: inset -2px -1px 0 rgba(92, 52, 10, 0.28);
  z-index: 7;
}

.plant-root.root-a { left: 75px; bottom: 4px; height: 42px; transform: rotate(18deg); }
.plant-root.root-b { left: 75px; bottom: 6px; height: 48px; transform: rotate(-19deg); }

.plant-stem {
  left: 72px;
  bottom: 42px;
  width: 7px;
  height: 58px;
  border-radius: 999px;
  background: linear-gradient(180deg, #74b816, #2f8f39);
  transform-origin: bottom center;
  z-index: 6;
}

.plant-leaf {
  width: 30px;
  height: 18px;
  border-radius: 999px 999px 999px 20px;
  background: linear-gradient(135deg, #98df3e, #35a853);
  z-index: 7;
}

.leaf-left { left: 43px; bottom: 76px; transform: rotate(-24deg); }
.leaf-right { right: 42px; bottom: 82px; transform: scaleX(-1) rotate(-24deg); }
.leaf-mid { left: 61px; bottom: 104px; transform: rotate(7deg) scale(.8); }

.plant-bud {
  left: 61px;
  bottom: 110px;
  width: 28px;
  height: 30px;
  border-radius: 60% 60% 48% 48%;
  background: #f7b3d1;
  z-index: 8;
}

.plant-fruit {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: radial-gradient(circle at 35% 28%, #ffb1a7 0 18%, #f44747 20% 100%);
  box-shadow: 0 5px 9px rgba(105, 20, 20, 0.18);
  z-index: 9;
}

.fruit-a { left: 51px; bottom: 91px; }
.fruit-b { left: 76px; bottom: 102px; transform: scale(.88); }
.fruit-c { left: 82px; bottom: 78px; transform: scale(.72); }

.plant-canopy {
  left: 35px;
  bottom: 83px;
  width: 80px;
  height: 58px;
  border-radius: 48% 52% 46% 54%;
  background: linear-gradient(180deg, #56b95c, #237541);
  box-shadow: 0 12px 0 rgba(35, 117, 65, 0.2);
  z-index: 9;
}

.canopy-b {
  left: 47px;
  bottom: 112px;
  width: 56px;
  height: 44px;
  background: linear-gradient(180deg, #78cf5a, #2b8d43);
}

.plant-petal {
  left: 66px;
  bottom: 121px;
  width: 24px;
  height: 34px;
  border-radius: 999px 999px 60% 60%;
  background: linear-gradient(180deg, #ffd5ec, #ef7ab8);
  transform-origin: 50% 95%;
  z-index: 8;
}

.petal-a { transform: rotate(0deg) translateY(-13px); }
.petal-b { transform: rotate(72deg) translateY(-13px); }
.petal-c { transform: rotate(144deg) translateY(-13px); }
.petal-d { transform: rotate(216deg) translateY(-13px); }
.petal-e { transform: rotate(288deg) translateY(-13px); }

.plant-flower-center {
  left: 68px;
  bottom: 119px;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #ffd64d;
  z-index: 10;
}

.forest-plant.stage-seed .plant-seed,
.forest-plant.stage-root .plant-seed,
.forest-plant.stage-root .plant-root,
.forest-plant.stage-sprout .plant-stem,
.forest-plant.stage-sprout .leaf-left,
.forest-plant.stage-sprout .leaf-right,
.forest-plant.stage-growing .plant-stem,
.forest-plant.stage-growing .plant-leaf,
.forest-plant.stage-mature .plant-stem,
.forest-plant.stage-mature .plant-leaf {
  opacity: 1;
}

.forest-plant.stage-seed { transform: scale(.72); }
.forest-plant.stage-root { transform: scale(.78); }
.forest-plant.stage-sprout { transform: scale(.84); }
.forest-plant.stage-growing { transform: scale(.96); }
.forest-plant.stage-mature { transform: scale(1.08); }

.forest-plant.stage-sprout .plant-stem { height: 33px; transform: scaleY(.58); }
.forest-plant.stage-sprout .leaf-left { bottom: 62px; transform: rotate(-26deg) scale(.72); }
.forest-plant.stage-sprout .leaf-right { bottom: 65px; transform: scaleX(-1) rotate(-26deg) scale(.72); }

.forest-plant.stage-growing.crop-tomato .fruit-a,
.forest-plant.stage-growing.crop-flower .plant-bud,
.forest-plant.stage-growing.crop-tree .canopy-a,
.forest-plant.stage-mature.crop-tomato .plant-fruit,
.forest-plant.stage-mature.crop-flower .plant-petal,
.forest-plant.stage-mature.crop-flower .plant-flower-center,
.forest-plant.stage-mature.crop-tree .plant-canopy {
  opacity: 1;
}

.forest-plant.stage-growing.crop-tree .canopy-a {
  transform: scale(.62) translateY(26px);
}

.forest-plant.stage-mature.crop-sprout .leaf-mid,
.forest-plant.stage-mature.crop-sprout .plant-bud {
  opacity: 1;
}

.forest-plant.stage-mature.crop-sprout .plant-bud {
  left: 66px;
  bottom: 112px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #baf25c;
}

.forest-plant.crop-tree .plant-stem {
  width: 12px;
  left: 69px;
  background: linear-gradient(180deg, #8b5a2b, #5d3515);
}

.forest-progress-wrap {
  width: min(360px, 92%);
  margin: 12px auto 0;
}

.forest-progress-wrap .progress {
  height: 9px;
  background: rgba(35, 71, 39, 0.13);
}

.forest-growth-label {
  margin-top: 9px;
}

.forest-idle-preview {
  opacity: .76;
  transform: scale(.9);
  transform-origin: top center;
}

.harvest-toast {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  margin: 14px 0;
  border: 1px solid #c7e8c1;
  border-radius: 14px;
  background: linear-gradient(90deg, #f2ffe8, #fffdf0);
  padding: 12px 14px;
  box-shadow: 0 12px 28px rgba(63, 112, 55, 0.1);
}

.harvest-toast h3,
.harvest-toast p {
  margin: 0;
}

.harvest-visual {
  width: 62px;
  height: 62px;
  overflow: hidden;
  border-radius: 18px;
  background: #e7f8da;
}

.harvest-plant {
  transform: translate(-44px, -55px) scale(.58) !important;
}

.forest-garden-panel {
  background: linear-gradient(180deg, #fbfff7 0%, #edf8e7 100%);
}

.forest-garden-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 250px));
  gap: 16px;
  align-items: stretch;
}

.forest-garden-card {
  display: grid;
  grid-template-rows: auto auto auto;
  gap: 10px;
  min-width: 0;
  border: 1px solid rgba(107, 143, 82, 0.24);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.82);
  padding: 12px;
  box-shadow: 0 14px 28px rgba(68, 97, 59, 0.09);
}

.forest-island {
  position: relative;
  min-height: 168px;
  overflow: hidden;
  border-radius: 18px;
}

.island-top {
  position: absolute;
  left: 12px;
  right: 12px;
  top: 14px;
  height: 116px;
  border-radius: 18px 18px 30px 30px;
  background: linear-gradient(135deg, #94e54d, #65bd35 62%, #4c9f2d);
  box-shadow: inset 0 -9px 0 rgba(36, 101, 33, 0.12);
  z-index: 2;
}

.island-side {
  position: absolute;
  left: 24px;
  right: 24px;
  top: 106px;
  height: 48px;
  border-radius: 0 0 24px 24px;
  background: linear-gradient(180deg, #8f6a25, #5b4218);
  box-shadow: inset 0 9px 0 rgba(139, 94, 32, 0.45);
  z-index: 1;
}

.mini-forest-grid {
  position: absolute;
  inset: 12px 16px 18px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 2px 6px;
  align-items: end;
  z-index: 3;
}

.mini-plant-slot {
  position: relative;
  display: grid;
  place-items: end center;
  min-width: 0;
}

.mini-forest-plant {
  width: 54px;
  height: 54px;
  transform: scale(.43) !important;
  transform-origin: 50% 90%;
  margin-bottom: -4px;
  filter: drop-shadow(0 6px 6px rgba(35, 66, 28, 0.18));
  animation: miniPlantSway 3.2s ease-in-out infinite;
  animation-delay: calc(var(--slot-index, 0) * .12s);
}

.forest-quantity {
  z-index: 5;
  max-width: calc(100% - 20px);
}

.forest-plot-info h4,
.forest-plot-info p {
  margin: 0;
}

.forest-garden-card button {
  justify-self: start;
}

.forest-garden-empty {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 180px;
  border: 1px dashed #acd89e;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.68);
  padding: 16px;
}

.empty-island {
  flex: 0 0 200px;
  min-height: 140px;
}

.empty-seed-bed {
  position: absolute;
  left: 46px;
  right: 46px;
  top: 44px;
  z-index: 4;
  display: flex;
  justify-content: center;
  gap: 12px;
}

.empty-seed-bed span {
  width: 10px;
  height: 7px;
  border-radius: 999px;
  background: rgba(84, 57, 23, 0.42);
}

@keyframes activePlantBreath {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -4px; }
}

@keyframes miniPlantSway {
  0%, 100% { rotate: -1deg; }
  50% { rotate: 1deg; }
}

@keyframes forestDrift {
  0%, 100% { opacity: .38; translate: 0 0; }
  50% { opacity: .9; translate: 0 -7px; }
}

@media (max-width: 980px) {
  .forest-orb {
    width: min(320px, 94%);
  }

  .forest-garden-grid {
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  }
}

@media (max-width: 720px) {
  .harvest-toast,
  .forest-garden-empty {
    grid-template-columns: 1fr;
  }

  .forest-garden-empty {
    align-items: stretch;
    flex-direction: column;
  }

  .empty-island {
    flex-basis: auto;
  }
}

/* 2026-07-07 visual review: make the planted seed readable at 0%. */
.plant-seed {
  width: 18px;
  height: 13px;
  box-shadow: inset -2px -1px 0 rgba(92, 52, 10, 0.28), 0 0 0 5px rgba(255, 225, 137, 0.16);
}

.forest-plant.stage-seed .plant-seed,
.forest-plant.stage-root .plant-seed {
  opacity: 1;
}

.forest-plant.stage-seed .plant-seed {
  animation: seedPulse 1.8s ease-in-out infinite;
}

@keyframes seedPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

/* 2026-07-07 responsive growth preview and one-field farm layout. */
.forest-timer-panel {
  container-type: inline-size;
}

.responsive-growth-stage {
  width: 100%;
  max-width: none;
  margin-top: clamp(8px, 1.4vh, 14px);
}

.responsive-forest-orb {
  width: clamp(220px, min(34cqw, 38vh), 390px);
  max-width: 78%;
}

.responsive-forest-orb .forest-soil-bowl {
  width: 68%;
  height: 42%;
  bottom: 11%;
}

.responsive-forest-orb .plant-stage-mount {
  width: 42%;
  height: 42%;
  top: -6%;
}

.responsive-forest-orb .forest-plant {
  width: 100%;
  height: 100%;
}

.forest-progress-preview {
  width: min(440px, 76%);
  margin-top: clamp(8px, 1.2vh, 12px);
}

.forest-preview-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
  width: min(440px, 76%);
  margin: 8px auto 0;
}

.forest-preview-control label {
  display: grid;
  gap: 4px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  text-align: left;
}

.forest-preview-control input[type="range"] {
  width: 100%;
  height: 18px;
  padding: 0;
  accent-color: #4f73f6;
  cursor: pointer;
}

.forest-preview-control .small {
  min-height: 30px;
  white-space: nowrap;
}

.forest-growth-label {
  max-width: min(440px, 76%);
  margin-left: auto;
  margin-right: auto;
}

.unified-farm-layout {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) minmax(190px, 240px);
  gap: 16px;
  align-items: stretch;
}

.single-farm-board {
  position: relative;
  min-height: clamp(260px, 31vw, 420px);
  overflow: hidden;
  border-radius: 22px;
  background: linear-gradient(180deg, #f8ffe9 0%, #eef9d4 100%);
  box-shadow: inset 0 0 0 1px rgba(98, 136, 70, 0.16), 0 16px 32px rgba(68, 97, 59, 0.08);
}

.single-farm-top {
  position: absolute;
  left: clamp(18px, 4%, 34px);
  right: clamp(18px, 4%, 34px);
  top: clamp(16px, 5%, 36px);
  height: 72%;
  border-radius: 28px 28px 48px 48px;
  background:
    radial-gradient(circle at 20% 22%, rgba(255, 255, 255, 0.3), transparent 18%),
    linear-gradient(135deg, #a9ed55 0%, #73cd37 58%, #4fa22d 100%);
  box-shadow: inset 0 -14px 0 rgba(42, 105, 30, 0.13);
  z-index: 2;
}

.single-farm-side {
  position: absolute;
  left: clamp(30px, 8%, 68px);
  right: clamp(30px, 8%, 68px);
  top: calc(clamp(16px, 5%, 36px) + 58%);
  height: 26%;
  border-radius: 0 0 38px 38px;
  background: linear-gradient(180deg, #8e6a25, #5b4217);
  box-shadow: inset 0 11px 0 rgba(150, 102, 35, 0.45);
  z-index: 1;
}

.single-farm-plant-grid {
  position: absolute;
  inset: 8% 7% 10%;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(42px, 1fr));
  grid-auto-rows: minmax(42px, 1fr);
  gap: clamp(2px, .8vw, 8px);
  align-items: end;
  z-index: 4;
}

.single-farm-slot {
  display: grid;
  place-items: end center;
  min-width: 0;
  min-height: 42px;
}

.single-field-plant {
  width: clamp(42px, 4.3vw, 66px);
  height: clamp(42px, 4.3vw, 66px);
  transform: scale(.43) !important;
  transform-origin: 50% 92%;
  filter: drop-shadow(0 7px 7px rgba(35, 66, 28, 0.18));
  animation: miniPlantSway 3.2s ease-in-out infinite;
  animation-delay: calc(var(--slot-index, 0) * .08s);
}

.single-farm-empty-mark {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 18px;
}

.single-farm-empty-mark span {
  width: 14px;
  height: 9px;
  border-radius: 999px;
  background: rgba(78, 55, 22, 0.28);
}

.single-farm-more {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 8;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.74);
  color: #fff;
  padding: 4px 9px;
  font-weight: 800;
}

.single-farm-legend {
  display: grid;
  align-content: start;
  gap: 10px;
  min-width: 0;
  border: 1px solid rgba(114, 150, 85, 0.18);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  padding: 12px;
}

.single-farm-legend h4 {
  margin: 0 0 2px;
}

.farm-legend-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-width: 0;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 12px;
  background: #fff;
  padding: 8px;
}

.legend-visual {
  width: 36px;
  height: 36px;
  overflow: hidden;
  border-radius: 12px;
  background: #e9f8dc;
}

.legend-plant {
  transform: translate(-55px, -68px) scale(.43) !important;
}

.legend-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.legend-copy strong,
.legend-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.legend-copy span {
  color: var(--muted);
  font-size: 12px;
}

.farm-legend-row .small {
  min-height: 30px;
  padding: 0 9px;
}

.empty-unified-farm .single-farm-board {
  min-height: clamp(220px, 26vw, 320px);
}

.empty-legend p {
  margin: 0;
}

.forest-garden-grid,
.forest-garden-card,
.forest-island,
.harvested-island {
  display: initial;
}

@media (max-width: 1180px) {
  .responsive-forest-orb {
    width: clamp(210px, min(40cqw, 34vh), 340px);
  }

  .unified-farm-layout {
    grid-template-columns: 1fr;
  }

  .single-farm-legend {
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  }

  .single-farm-legend h4,
  .empty-legend p {
    grid-column: 1 / -1;
  }
}

@media (max-width: 720px) {
  .responsive-forest-orb {
    width: clamp(190px, 72vw, 280px);
    max-width: 92%;
  }

  .forest-preview-control {
    grid-template-columns: 1fr;
    width: min(360px, 88%);
  }

  .forest-progress-preview,
  .forest-growth-label {
    width: min(360px, 88%);
    max-width: 88%;
  }

  .single-farm-board {
    min-height: 260px;
  }
}

/* 2026-07-07 adaptive layout repair: stable plant coordinate system, no overlap calendar/farm. */
* {
  box-sizing: border-box;
}

main,
.view,
.panel,
.focus-page-grid,
.forest-focus-grid,
.calendar-workbench,
.reference-month-week,
.month-grid,
.unified-farm-layout {
  min-width: 0;
}

.focus-page-grid.forest-focus-grid {
  grid-template-columns: minmax(320px, 0.95fr) minmax(360px, 1.05fr);
  align-items: stretch;
}

.focus-setup-panel,
.forest-timer-panel {
  min-height: clamp(360px, 46vh, 560px);
  overflow: hidden;
}

.forest-idle-timer,
.focus-running-layout {
  width: 100%;
  display: grid;
  justify-items: center;
  align-content: start;
  gap: clamp(6px, 1vh, 12px);
}

.forest-timer-panel .timer-value {
  font-size: clamp(56px, min(8cqw, 9vh), 128px);
  line-height: 0.95;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.responsive-growth-stage {
  display: grid;
  justify-items: center;
  width: 100%;
  margin-top: clamp(4px, 1vh, 12px);
  overflow: visible;
}

.responsive-forest-orb {
  --orb-size: clamp(190px, min(30cqw, 34vh), 330px);
  position: relative;
  width: var(--orb-size);
  max-width: 82%;
  aspect-ratio: 1 / 1;
  flex: 0 0 auto;
}

.responsive-forest-orb .forest-soil-bowl {
  left: 50%;
  bottom: 11%;
  width: min(242px, 72%);
  height: 42%;
  min-height: 112px;
  transform: translateX(-50%);
}

.responsive-forest-orb .soil-rim {
  top: 20%;
  height: 36%;
}

.responsive-forest-orb .soil-face {
  top: 40%;
  height: 47%;
}

.responsive-forest-orb .soil-underground {
  top: 45%;
  height: 45%;
}

.responsive-forest-orb .plant-stage-mount {
  left: 50%;
  top: auto;
  bottom: 20%;
  width: 150px;
  height: 150px;
  transform: translateX(-50%) scale(.84);
  transform-origin: 50% 92%;
}

.responsive-forest-orb .forest-plant {
  width: 150px;
  height: 150px;
}

.responsive-forest-orb .plant-root {
  max-height: 38px;
}

.forest-progress-preview {
  width: min(420px, 76%);
  margin-top: clamp(6px, 1vh, 10px);
}

.forest-preview-control {
  width: min(420px, 76%);
  align-items: center;
  margin-top: 6px;
}

.forest-preview-control label {
  min-width: 0;
}

.forest-preview-control input[type="range"] {
  min-width: 0;
}

.forest-growth-label {
  max-width: min(420px, 80%);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.focus-garden-panel.forest-garden-panel {
  overflow: hidden;
}

.unified-farm-layout {
  grid-template-columns: minmax(280px, 1fr) minmax(210px, clamp(210px, 18vw, 260px));
  align-items: stretch;
}

.single-farm-board {
  min-height: clamp(240px, 28vw, 380px);
  max-height: 48vh;
}

.single-farm-top {
  left: clamp(14px, 3.5%, 32px);
  right: clamp(14px, 3.5%, 32px);
  top: clamp(14px, 5%, 30px);
  height: 70%;
}

.single-farm-side {
  left: clamp(24px, 7%, 58px);
  right: clamp(24px, 7%, 58px);
  top: 64%;
  height: 22%;
}

.single-farm-plant-grid {
  inset: 10% 7% 14%;
  grid-template-columns: repeat(auto-fit, minmax(clamp(34px, 4.2vw, 54px), 1fr));
  grid-auto-rows: minmax(clamp(34px, 4.2vw, 54px), 1fr);
  align-content: end;
  overflow: hidden;
}

.single-field-plant {
  width: 150px;
  height: 150px;
  transform: scale(.34) !important;
}

.single-farm-legend {
  overflow: auto;
  max-height: min(48vh, 420px);
}

.farm-legend-row {
  grid-template-columns: 38px minmax(0, 1fr) auto;
}

.reference-month-week .month-cell {
  position: relative;
  min-height: clamp(92px, 14.2vh, 150px);
  padding: 8px 8px 6px;
  overflow: visible;
}

.month-date-line {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 8px;
  min-height: 34px;
  padding-right: 38px;
  position: relative;
  z-index: 12;
}

.today-cell .month-date-line strong {
  display: inline-grid;
  place-items: center;
  min-width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #5b7df6;
  color: #fff;
  box-shadow: 0 8px 18px rgba(91, 125, 246, 0.22);
}

.month-cell .day-add {
  top: 8px;
  right: 8px;
  z-index: 16;
}

.month-task-layer {
  inset: 48px 6px 8px 6px;
  z-index: 5;
  pointer-events: none;
  grid-auto-rows: minmax(18px, 22px);
  row-gap: 3px;
}

.month-task-bar {
  pointer-events: auto;
  min-height: 18px;
  max-height: 22px;
  line-height: 18px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0 6px;
}

.month-task-bar small {
  flex: 0 0 auto;
  max-width: 42px;
}

@media (max-width: 1180px) {
  .focus-page-grid.forest-focus-grid {
    grid-template-columns: 1fr;
  }

  .focus-setup-panel,
  .forest-timer-panel {
    min-height: auto;
  }

  .responsive-forest-orb {
    --orb-size: clamp(180px, min(42cqw, 32vh), 290px);
  }

  .responsive-forest-orb .plant-stage-mount {
    transform: translateX(-50%) scale(.78);
  }

  .unified-farm-layout {
    grid-template-columns: 1fr;
  }

  .single-farm-board {
    max-height: none;
  }

  .single-farm-legend {
    max-height: none;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  }
}

@media (max-width: 780px) {
  .forest-timer-panel .timer-value {
    font-size: clamp(46px, 16vw, 76px);
  }

  .responsive-forest-orb {
    --orb-size: clamp(170px, 70vw, 260px);
    max-width: 94%;
  }

  .responsive-forest-orb .plant-stage-mount {
    transform: translateX(-50%) scale(.68);
  }

  .forest-progress-preview,
  .forest-preview-control,
  .forest-growth-label {
    width: min(360px, 90%);
    max-width: 90%;
  }

  .unified-farm-layout {
    gap: 12px;
  }

  .single-farm-board {
    min-height: 230px;
  }

  .reference-month-week .month-cell {
    min-height: 88px;
  }

  .month-task-layer {
    inset: 46px 5px 7px 5px;
  }
}

/* 2026-07-07 adaptive repair correction: valid transform scale values. */
.responsive-forest-orb .plant-stage-mount {
  width: 150px;
  height: 150px;
  top: auto;
  bottom: 20%;
  left: 50%;
  transform: translateX(-50%) scale(.84);
  transform-origin: 50% 92%;
}

.responsive-forest-orb .forest-plant,
.responsive-forest-orb .active-forest-plant {
  width: 150px;
  height: 150px;
}

.single-field-plant {
  width: 150px;
  height: 150px;
  transform: scale(.34) !important;
  transform-origin: 50% 92%;
}

@media (min-width: 1500px) {
  .responsive-forest-orb .plant-stage-mount {
    transform: translateX(-50%) scale(.94);
  }

  .single-field-plant {
    transform: scale(.38) !important;
  }
}

@media (max-width: 1180px) {
  .responsive-forest-orb .plant-stage-mount {
    transform: translateX(-50%) scale(.78);
  }

  .single-field-plant {
    transform: scale(.32) !important;
  }
}

@media (max-width: 780px) {
  .responsive-forest-orb .plant-stage-mount {
    transform: translateX(-50%) scale(.66);
  }

  .single-field-plant {
    transform: scale(.27) !important;
  }

  .month-task-layer {
    inset: 46px 5px 7px 5px;
  }
}

/* 2026-07-07 adaptive page-flow correction: keep fixed dashboards fixed, let content-heavy pages scroll. */
.content:has(.forest-focus-grid),
.content:has(.task-list),
.content:has(.okr-workbench),
.content:has(.reward-workbench),
.content:has(.settings-workbench),
.content:has(.ledger-workbench) {
  height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
  align-content: start;
  grid-auto-rows: max-content;
}

.content:has(.calendar-workbench),
.content:has(.compact-kanban-page),
.content:has(.matrix-reference-page) {
  height: 100vh;
  overflow: hidden;
  align-content: stretch;
}

.focus-page-grid.forest-focus-grid {
  height: auto;
}

.focus-garden-panel.forest-garden-panel {
  height: auto;
  min-height: max-content;
  overflow: visible;
}

.focus-history-panel {
  position: relative;
  z-index: 0;
}

.unified-farm-layout {
  height: auto;
}

@media (max-height: 760px) {
  .focus-setup-panel,
  .forest-timer-panel {
    min-height: clamp(320px, 58vh, 460px);
  }

  .single-farm-board {
    min-height: clamp(220px, 42vh, 340px);
    max-height: none;
  }

  .single-farm-legend {
    max-height: 42vh;
  }
}

/* 2026-07-08 category color picker and month calendar hover/checkbox repair. */
.color-picker-field input[type="color"] {
  width: 100%;
  min-height: 42px;
  padding: 4px 8px;
  cursor: pointer;
}

.category-edit-actions {
  align-items: center;
}

#category-form.editing-category {
  border: 1px solid rgba(91, 125, 246, 0.28);
  border-radius: 10px;
  background: rgba(91, 125, 246, 0.05);
  padding: 10px;
}

.category-color-code {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
}

.category-color-swatch {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.45);
}

.reference-month-week .month-cell {
  overflow: hidden;
}

.month-date-line {
  padding-right: 0;
  z-index: 14;
}

.month-cell .day-add,
.day-cell .day-add {
  position: absolute !important;
  top: 58% !important;
  left: 50% !important;
  right: auto !important;
  bottom: auto !important;
  z-index: 18;
  transform: translate(-50%, -50%) scale(0.86);
  pointer-events: auto;
}

.month-cell:hover .day-add,
.month-cell:focus-within .day-add,
.day-cell:hover .day-add,
.day-cell:focus-within .day-add {
  transform: translate(-50%, -50%) scale(1);
}

.month-task-layer {
  inset: 48px 6px 8px 6px;
}

.month-task-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  padding: 0 7px 0 23px;
}

.month-task-bar .event-check {
  position: absolute;
  top: 50%;
  left: 7px;
  width: 10px;
  height: 10px;
  transform: translateY(-50%);
  flex: 0 0 auto;
}

.month-task-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.month-task-bar small {
  float: none;
  flex: 0 0 auto;
  margin-left: auto;
  max-width: 54px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 2026-07-08 stable month add target: no date layout shift, centered below date line. */
.month-cell.add-target .day-add,
.day-cell.add-target .day-add {
  display: grid !important;
  opacity: 1;
  top: 40px !important;
  left: 50% !important;
  right: auto !important;
  transform: translate(-50%, -50%) scale(1);
}

.month-cell.add-target .month-date-line,
.day-cell.add-target .month-date-line {
  transform: none;
}

/* 2026-07-08 task delete entry styling. */
button.danger,
button.ghost.danger,
.small.danger {
  border: 1px solid rgba(220, 38, 38, 0.16);
  background: #fff1f2;
  color: #b91c1c;
}

button.danger:hover,
button.ghost.danger:hover,
.small.danger:hover {
  border-color: rgba(220, 38, 38, 0.34);
  background: #ffe4e6;
  color: #991b1b;
}

.task-card-actions {
  flex-wrap: wrap;
}

/* 2026-07-08 collapse completed task and OKR content by default. */
.completed-fold {
  margin-top: 12px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 8px;
  background: #f8fafc;
  overflow: hidden;
}

.completed-fold summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 40px;
  padding: 0 12px;
  color: #64748b;
  cursor: pointer;
  font-weight: 700;
}

.completed-fold summary strong {
  display: inline-grid;
  place-items: center;
  min-width: 26px;
  height: 24px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #475569;
  font-size: 12px;
}

.completed-fold[open] {
  padding-bottom: 10px;
}

.completed-fold[open] > :not(summary) {
  margin: 0 10px 10px;
}

.completed-task-list .task-card,
.completed-row {
  opacity: 0.68;
}

.completed-task-list .task-card h4,
.completed-row h4,
.completed-row strong {
  text-decoration: line-through;
  text-decoration-thickness: 1px;
  text-decoration-color: rgba(100, 116, 139, 0.55);
}

.task-overview-toolbar {
  align-items: center;
}

.open-kanban-board {
  grid-template-columns: repeat(2, minmax(280px, 1fr));
  min-height: 0;
}

.kanban-completed-fold {
  margin: 12px 0 0;
}

.kanban-completed-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
}

.okr-completed-fold .okr-card,
.okr-completed-fold .okr-kr-card {
  box-shadow: none;
}

.matrix-completed-fold {
  background: rgba(248, 250, 252, 0.72);
}

@media (max-width: 900px) {
  .open-kanban-board {
    grid-template-columns: 1fr;
  }
}

/* 2026-07-08 habit growth board. */
.habit-page {
  display: grid;
  gap: 14px;
}

.habit-hero-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.habit-attribute-grid,
.habit-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.habit-attribute-card,
.habit-card {
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06);
}

.habit-attribute-card {
  padding: 14px;
}

.habit-attribute-head,
.habit-card-top,
.habit-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.habit-attribute-head > span {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--habit-color) 14%, white);
  color: var(--habit-color);
  font-weight: 800;
}

.habit-attribute-head small,
.habit-meta,
.habit-attribute-card p {
  color: var(--muted);
  font-size: 12px;
}

.habit-xp-bar,
.habit-healthbar {
  height: 14px;
  border-radius: 999px;
  background: #e5e7eb;
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.16);
}

.habit-xp-bar {
  margin: 14px 0 8px;
}

.habit-xp-bar span,
.habit-healthbar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--habit-color), color-mix(in srgb, var(--habit-color) 58%, #fef3c7));
}

.habit-card {
  padding: 14px;
  border-top: 4px solid var(--habit-color);
}

.habit-card h4 {
  margin: 0 0 4px;
}

.habit-card .subtle {
  margin: 0;
}

.habit-pill {
  flex: 0 0 auto;
  border-radius: 999px;
  background: color-mix(in srgb, var(--habit-color) 12%, white);
  color: var(--habit-color);
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 800;
}

.habit-healthbar {
  height: 18px;
  margin: 16px 0 8px;
}

.habit-actions {
  margin-top: 12px;
  flex-wrap: wrap;
}

.habit-form {
  border-color: rgba(37, 99, 235, 0.2);
  background: #f8fbff;
}

.habit-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}

@media (max-width: 720px) {
  .habit-hero-panel,
  .habit-card-top,
  .habit-meta {
    align-items: flex-start;
    flex-direction: column;
  }

  .habit-attribute-grid,
  .habit-card-grid {
    grid-template-columns: 1fr;
  }
}

/* 2026-07-08 task-flow layout and OKR management polish. */
.today-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 12px 14px 0;
}

.today-summary-panel {
  min-height: 96px;
  padding: 14px 16px;
}

.today-summary-panel h3,
.today-summary-panel p {
  margin: 0;
}

.today-summary-panel strong {
  display: block;
  margin-top: 4px;
  font-size: 28px;
  line-height: 1;
}

.today-task-panel,
.today-timeline-panel {
  margin: 12px 14px 0;
}

.scheduled-timeline {
  display: grid;
  gap: 6px;
}

.scheduled-timeline-row {
  display: grid;
  grid-template-columns: 14px minmax(130px, 190px) minmax(0, 1fr) minmax(72px, 120px);
  align-items: center;
  gap: 10px;
  min-height: 42px;
  border: 1px solid #eef2f7;
  border-radius: 8px;
  background: #fff;
  color: #0f172a;
  padding: 8px 10px;
  text-align: left;
}

.scheduled-timeline-row strong,
.scheduled-timeline-row small,
.timeline-time {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timeline-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.timeline-time,
.scheduled-timeline-row small {
  color: var(--muted);
  font-size: 12px;
}

.task-flow-page {
  height: 100vh;
  overflow: hidden;
  background: #f8faff;
}

.kanban-flow-scroll {
  display: grid;
  grid-template-rows: minmax(300px, 1fr) auto;
  gap: 12px;
  height: calc(100vh - 58px);
  overflow: auto;
  padding: 14px 16px 16px;
}

.kanban-board-compact.kanban-three-column,
.open-kanban-board.kanban-three-column {
  grid-template-columns: repeat(3, minmax(240px, 1fr));
  height: auto;
  min-height: 300px;
  padding: 0;
}

.kanban-three-column .kanban-column {
  min-height: 300px;
  max-height: none;
}

.task-gantt-panel {
  overflow: hidden;
}

.task-gantt {
  display: grid;
  gap: 8px;
  min-width: min(860px, 100%);
  overflow-x: auto;
}

.gantt-scale {
  display: flex;
  justify-content: space-between;
  padding-left: min(260px, 32%);
  color: var(--muted);
  font-size: 12px;
}

.gantt-row {
  display: grid;
  grid-template-columns: minmax(170px, 260px) minmax(360px, 1fr);
  gap: 12px;
  align-items: center;
  min-width: 620px;
}

.gantt-task-meta {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.gantt-task-meta strong,
.gantt-task-meta span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gantt-task-meta span {
  color: var(--muted);
  font-size: 12px;
}

.gantt-track {
  display: grid;
  grid-template-columns: repeat(var(--gantt-columns), minmax(28px, 1fr));
  min-height: 30px;
  border-radius: 999px;
  background: #edf2f7;
  padding: 4px;
}

.gantt-bar {
  grid-column: var(--gantt-start) / span var(--gantt-span);
  min-height: 22px;
  border: 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--event-color) 78%, #fff);
  color: #172033;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.okr-workbench {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.okr-objective-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.okr-objective-grid.multi-objective {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.okr-objective-grid .okr-card {
  min-width: 0;
}

.okr-card-toolbar {
  align-items: start;
  gap: 10px;
}

.okr-card-toolbar .row-actions {
  justify-content: flex-end;
  flex-wrap: wrap;
}

.okr-action-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
}

button.okr-action-row {
  border: 1px solid rgba(148, 163, 184, 0.18);
}

@media (min-width: 1500px) {
  .okr-objective-grid.multi-objective {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 1180px) {
  .today-summary-grid {
    grid-template-columns: 1fr;
  }

  .task-flow-page,
  .kanban-flow-scroll {
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  .kanban-board-compact.kanban-three-column,
  .open-kanban-board.kanban-three-column {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .today-summary-grid,
  .today-task-panel,
  .today-timeline-panel,
  .okr-workbench {
    margin: 0;
    padding: 10px;
  }

  .scheduled-timeline-row {
    grid-template-columns: 12px minmax(0, 1fr);
    grid-template-areas:
      "dot title"
      ". time"
      ". tag";
  }

  .timeline-dot { grid-area: dot; }
  .scheduled-timeline-row strong { grid-area: title; }
  .timeline-time { grid-area: time; }
  .scheduled-timeline-row small { grid-area: tag; }

  .gantt-row {
    grid-template-columns: 1fr;
    min-width: 360px;
  }

  .gantt-scale {
    padding-left: 0;
  }

  .okr-card-toolbar,
  .okr-action-row {
    grid-template-columns: 1fr;
  }
}

/* 2026-07-08 calendar scheduling behavior: completion, drag, weekends, holidays, recurrence. */
.recurrence-weekdays {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 0;
  padding: 10px 12px;
}

.recurrence-weekdays legend {
  padding: 0 5px;
  color: var(--muted);
  font-size: 13px;
}

.recurrence-weekdays label {
  display: inline-flex;
  grid-template-columns: none;
  align-items: center;
  gap: 5px;
  color: var(--text);
  font-size: 13px;
}

.recurrence-weekdays input {
  width: auto;
  margin: 0;
}

.calendar-task-item {
  user-select: none;
}

.calendar-task-item[draggable="true"] {
  cursor: grab;
}

.calendar-task-item[draggable="true"]:active {
  cursor: grabbing;
}

.calendar-task-done {
  color: #64748b !important;
  opacity: 0.78;
}

.calendar-task-done strong,
.calendar-task-done .month-task-title,
.calendar-task-done > span:not(.event-check) {
  text-decoration: line-through;
  text-decoration-thickness: 1px;
  text-decoration-color: rgba(71, 85, 105, 0.62);
}

.calendar-task-check.event-check {
  appearance: none;
  display: inline-grid;
  place-items: center;
  margin: 0;
  padding: 0;
  cursor: pointer;
}

.calendar-task-check.event-check:checked {
  border-color: rgba(51, 65, 85, 0.45);
  background: #475569;
}

.calendar-task-check.event-check:checked::after {
  content: "";
  width: 5px;
  height: 8px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: translateY(-1px) rotate(45deg);
}

.time-event.calendar-task-done {
  background: #e2e8f0;
}

.all-day-strip .mini-task.calendar-task-item {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  min-height: 22px;
}

.all-day-strip .mini-task.calendar-task-item span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.all-day-strip .mini-task .calendar-task-check {
  position: static;
  flex: 0 0 auto;
  transform: none;
}

.month-task-bar.calendar-task-done {
  background: #cbd5e1 !important;
}

.month-task-bar .calendar-task-check.event-check {
  position: absolute;
  top: 50%;
  left: 7px;
  transform: translateY(-50%);
}

.calendar-weekend {
  background-color: rgba(248, 113, 113, 0.055) !important;
}

.week-day-head.calendar-weekend,
.week-all-day > .calendar-weekend {
  background-color: rgba(248, 113, 113, 0.085) !important;
}

.calendar-holiday {
  background-color: rgba(248, 113, 113, 0.11) !important;
}

.calendar-rest-workday {
  background-color: rgba(234, 179, 8, 0.09) !important;
}

.calendar-day-note {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-day-note.holiday {
  color: #b91c1c;
  font-weight: 700;
}

.calendar-day-note.workday {
  color: #a16207;
  font-weight: 700;
}

.month-date-line .calendar-day-note {
  max-width: 74px;
}

.week-day-head .calendar-day-note {
  font-style: normal;
  text-align: right;
}

.week-column .floating-add,
.day-column .floating-add {
  position: absolute !important;
  top: 6px !important;
  right: 6px !important;
  bottom: auto !important;
  left: auto !important;
  transform: none !important;
}

.week-column:hover .floating-add,
.day-column:hover .floating-add,
.week-column:focus-within .floating-add,
.day-column:focus-within .floating-add {
  display: grid !important;
  opacity: 1;
  transform: none !important;
}

.calendar-drop-zone {
  outline-offset: -2px;
}

/* 2026-07-09 frozen-pane Gantt, recurrence detail, and stability polish. */
.frozen-gantt-panel {
  overflow: hidden;
}

.frozen-gantt {
  --gantt-left-width: clamp(190px, 24vw, 300px);
  --gantt-day-width: clamp(54px, 5.2vw, 72px);
  display: grid;
  grid-template-columns: var(--gantt-left-width) minmax(0, 1fr);
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.gantt-left-pane {
  position: relative;
  z-index: 2;
  border-right: 1px solid rgba(148, 163, 184, 0.28);
  background: #fff;
  box-shadow: 10px 0 18px rgba(15, 23, 42, 0.04);
}

.gantt-left-head,
.gantt-date-head span {
  display: grid;
  align-items: center;
  height: 42px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.24);
  background: #f8fafc;
  color: #475569;
  font-size: 12px;
  font-weight: 800;
}

.gantt-left-head {
  padding: 0 14px;
}

.gantt-left-row {
  display: grid;
  align-content: center;
  gap: 3px;
  width: 100%;
  height: 48px;
  border: 0;
  border-bottom: 1px solid rgba(226, 232, 240, 0.92);
  border-radius: 0;
  background: #fff;
  color: #0f172a;
  padding: 6px 14px;
  text-align: left;
}

.gantt-left-row:hover {
  background: #f8fbff;
}

.gantt-left-row strong,
.gantt-left-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gantt-left-row span {
  color: #64748b;
  font-size: 12px;
}

.gantt-right-pane {
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-gutter: stable;
}

.gantt-date-head,
.gantt-grid-row {
  display: grid;
  grid-template-columns: repeat(var(--gantt-days), var(--gantt-day-width));
  min-width: calc(var(--gantt-days) * var(--gantt-day-width));
}

.gantt-date-head span {
  justify-content: center;
  border-right: 1px solid rgba(226, 232, 240, 0.9);
  text-align: center;
}

.gantt-date-head span.is-weekend {
  background: #fff1f2;
  color: #b91c1c;
}

.gantt-date-body {
  min-width: calc(var(--gantt-days) * var(--gantt-day-width));
}

.gantt-grid-row {
  position: relative;
  align-items: center;
  height: 48px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.92);
  background-image: repeating-linear-gradient(
    to right,
    rgba(226, 232, 240, 0.92) 0,
    rgba(226, 232, 240, 0.92) 1px,
    transparent 1px,
    transparent var(--gantt-day-width)
  );
}

.gantt-date-bar {
  grid-column: var(--gantt-start) / span var(--gantt-span);
  min-width: 0;
  height: 28px;
  border: 1px solid color-mix(in srgb, var(--event-color) 42%, #fff);
  border-radius: 7px;
  background: color-mix(in srgb, var(--event-color) 22%, #fff);
  color: #172033;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.08);
}

.recurrence-editor {
  display: grid;
  grid-template-columns: minmax(180px, 240px) minmax(0, 1fr);
  gap: 10px 12px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 8px;
  background: #f8fafc;
  padding: 12px;
}

.recurrence-quick-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 8px;
}

.recurrence-dynamic,
.recurrence-until {
  grid-column: 1 / -1;
}

.recurrence-dynamic[hidden],
.recurrence-until[hidden] {
  display: none !important;
}

.recurrence-dynamic select[multiple] {
  min-height: 118px;
}

.recurrence-yearly-hint {
  margin: -4px 0 0;
}

.stable-edit-preview {
  margin-top: 12px;
}

.habit-card .habit-meta span:first-child {
  font-weight: 700;
  color: #334155;
}

@media (max-width: 760px) {
  .frozen-gantt {
    --gantt-left-width: 168px;
    --gantt-day-width: 56px;
  }

  .gantt-left-row,
  .gantt-grid-row {
    height: 52px;
  }

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

/* 2026-07-09 final readability and editable habit-attribute polish. */
.frozen-gantt {
  --gantt-left-width: clamp(260px, 30vw, 420px);
  --gantt-day-width: clamp(58px, 5.4vw, 76px);
  align-items: stretch;
}

.gantt-left-pane,
.gantt-right-pane {
  min-width: 0;
}

.gantt-left-row,
.gantt-grid-row {
  min-height: var(--gantt-row-height, 64px);
  height: var(--gantt-row-height, auto);
}

.gantt-left-row {
  align-content: start;
  gap: 5px;
  padding: 8px 14px;
  line-height: 1.28;
  white-space: normal;
}

.gantt-left-row strong,
.gantt-left-row span {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  word-break: break-word;
}

.gantt-left-row strong {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.gantt-left-row span {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.gantt-grid-row {
  padding: 8px 0;
}

.gantt-date-bar {
  display: flex;
  align-items: center;
  min-width: min(240px, calc(var(--gantt-span) * var(--gantt-day-width) + 96px));
  height: auto;
  min-height: 32px;
  max-height: calc(var(--gantt-row-height, 64px) - 14px);
  line-height: 1.25;
  white-space: normal;
  overflow: visible;
  z-index: 1;
}

.gantt-date-bar span {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

.habit-attribute-head {
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.habit-attribute-head button {
  justify-self: end;
}

.habit-attribute-form {
  border-top: 4px solid #2563eb;
}

.habit-attribute-picker {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
}

.habit-attribute-picker label {
  margin: 0;
}

@media (max-width: 760px) {
  .frozen-gantt {
    --gantt-left-width: 220px;
    --gantt-day-width: 60px;
  }

  .habit-attribute-picker {
    grid-template-columns: 1fr;
  }
}

/* 2026-07-09 final readability fixes for Gantt and editable habit attributes. */
.frozen-gantt {
  --gantt-left-width: clamp(260px, 32vw, 430px);
  align-items: stretch;
}

.gantt-left-pane,
.gantt-date-body {
  min-width: 0;
}

.gantt-left-row,
.gantt-grid-row {
  height: auto;
  min-height: var(--gantt-row-height, 58px);
}

.gantt-left-row {
  align-content: start;
  gap: 5px;
  padding: 9px 14px 10px;
}

.gantt-left-row strong,
.gantt-left-row span {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.28;
}

.gantt-left-row strong {
  font-size: 13px;
}

.gantt-left-row span {
  font-size: 12px;
}

.gantt-right-pane {
  padding-bottom: 14px;
  scrollbar-gutter: stable both-edges;
}

.gantt-date-body {
  padding-bottom: 2px;
}

.gantt-grid-row {
  padding: 6px 0;
}

.gantt-date-bar {
  display: flex;
  align-items: center;
  min-height: 32px;
  height: auto;
  max-height: calc(var(--gantt-row-height, 58px) - 14px);
  padding: 5px 10px;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.24;
}

.gantt-date-bar span {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.habit-attribute-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.habit-attribute-head strong,
.habit-attribute-head small {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.habit-attribute-form {
  border-color: color-mix(in srgb, var(--accent) 24%, #e2e8f0);
  background: #f8fbff;
}

.habit-attribute-picker {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 8px;
}

.habit-attribute-picker label {
  min-width: 0;
}

@media (max-width: 760px) {
  .frozen-gantt {
    --gantt-left-width: minmax(196px, 44vw);
    --gantt-day-width: 58px;
  }

  .gantt-left-row {
    padding-inline: 10px;
  }

  .habit-attribute-head,
  .habit-attribute-picker {
    grid-template-columns: 1fr;
  }
}

/* 2026-07-09 final scroll reliability pass. */
.content:has(.compact-kanban-page),
.content:has(.habit-page),
.content:has(.stable-task-form),
.content:has(.task-gantt-panel),
.content:has(.scheduled-timeline) {
  height: 100vh;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  align-content: start;
  grid-auto-rows: max-content;
  -webkit-overflow-scrolling: touch;
}

.content:has(.calendar-workbench) {
  overflow-x: hidden;
  overflow-y: auto;
}

.frozen-gantt-panel,
.frozen-gantt {
  max-width: 100%;
}

.gantt-right-pane {
  overscroll-behavior-x: contain;
  padding-bottom: 10px;
}

@media (max-width: 760px) {
  .content:has(.compact-kanban-page),
  .content:has(.habit-page),
  .content:has(.stable-task-form),
  .content:has(.task-gantt-panel),
  .content:has(.scheduled-timeline) {
    height: 100dvh;
  }
}

/* 2026-07-09 mobile tap target polish. */
@media (max-width: 760px) {
  button,
  .small,
  .ghost,
  .danger,
  .gold {
    min-height: 38px;
  }

  .small {
    min-width: 44px;
    padding-inline: 10px;
  }

  .sidebar button,
  .nav button,
  [data-view] {
    min-height: 42px;
  }
}

/* 2026-07-09 stronger mobile tap target override. */
@media (max-width: 760px) {
  button.small,
  .row-actions button.small,
  .habit-actions button.small,
  .habit-attribute-head button.small,
  .form-actions button,
  .toolbar button {
    min-height: 38px !important;
    height: auto !important;
    min-width: 44px !important;
    padding: 8px 12px !important;
  }
}

/* 2026-07-09 Objective grouped Gantt and habit reward settings. */
.grouped-gantt .gantt-objective-row,
.grouped-gantt .gantt-objective-grid-row {
  background: #f8fafc;
  border-bottom-color: rgba(100, 116, 139, 0.24);
}

.grouped-gantt .gantt-objective-row {
  padding-left: 14px;
}

.grouped-gantt .gantt-objective-row strong {
  color: #0f172a;
  font-size: 13px;
}

.grouped-gantt .gantt-child-row {
  padding-left: 30px;
  border-left: 3px solid rgba(99, 102, 241, 0.22);
}

.grouped-gantt .gantt-objective-bar {
  min-height: 26px;
  background: rgba(100, 116, 139, 0.14);
  border-color: rgba(100, 116, 139, 0.28);
  box-shadow: none;
  font-weight: 800;
}

.compact-actions {
  flex-wrap: nowrap;
  gap: 6px;
}

.habit-reward-rule-form {
  margin-bottom: 14px;
  border: 1px solid rgba(99, 102, 241, 0.18);
  border-radius: 8px;
  background: #f8fbff;
  padding: 12px;
}

@media (max-width: 760px) {
  .grouped-gantt .gantt-child-row {
    padding-left: 18px;
  }

  .compact-actions {
    justify-content: start;
  }
}

/* 2026-07-09 stable recurring delete modal. */
.modal-backdrop.recurring-delete-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.42);
}

.recurring-delete-dialog {
  width: min(420px, calc(100vw - 32px));
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.22);
  padding: 20px;
}

.recurring-delete-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.recurring-delete-options button {
  min-height: 40px;
}

/* 2026-07-09 mobile sidebar reachability. */
@media (max-width: 760px) {
  .sidebar {
    max-height: 100dvh;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
  }
}

/* 2026-07-09 P0 layout correction: stable month cells, Gantt group rows, settings scroll. */
.gantt-objective-grid-empty {
  background: #f8fafc;
}

.grouped-gantt .gantt-objective-bar {
  display: none !important;
}

.month-week-cell-list {
  position: relative;
  min-height: 132px;
}

.month-grid-cell-list {
  min-height: 132px;
}

.month-week-cell-list .month-task-layer {
  display: none !important;
}

.month-cell {
  min-width: 0;
  overflow: hidden;
}

.month-cell-task-list {
  display: grid;
  gap: 4px;
  margin-top: 8px;
  max-width: 100%;
}

.month-cell-task {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px;
  min-width: 0;
  min-height: 20px;
  border-radius: 4px;
  background: rgba(100, 116, 139, 0.18);
  padding: 2px 6px;
  color: rgba(15, 23, 42, 0.82);
  font-size: 12px;
  line-height: 1.2;
  cursor: pointer;
}

.month-cell-task .calendar-task-check {
  width: 12px;
  height: 12px;
  margin: 0;
}

.month-cell-task span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.month-cell-task small {
  color: #64748b;
  font-size: 10px;
}

.month-cell-task.calendar-task-done span {
  text-decoration: line-through;
  color: #64748b;
}

.month-more-inline {
  justify-self: start;
  min-height: 22px;
  border: 0;
  background: transparent;
  color: #5b7df6;
  padding: 0 2px;
  font-size: 12px;
}

html,
body,
.app-shell {
  height: 100%;
}

.app-shell {
  overflow: hidden;
}

.main {
  min-height: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.content {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
  align-content: start;
}

.content:has(.settings-category-panel),
.content:has(.habit-reward-rule-form),
.content:has(.lootbox-pool-panel) {
  overflow-y: auto !important;
}

/* 2026-07-09 restore continuous month bars and keep checkbox inside the bar. */
.month-week-continuous {
  position: relative;
  min-height: 132px;
}

.month-week-continuous .month-grid {
  min-height: 132px;
}

.month-week-continuous .month-cell-task-list,
.month-week-continuous .month-cell-task,
.month-week-continuous .month-more-inline {
  display: none !important;
}

.month-week-continuous .month-task-layer,
.month-week-continuous .month-task-continuous-layer {
  display: grid !important;
  position: absolute;
  inset: 44px 8px 8px 8px;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  grid-auto-rows: 23px;
  gap: 4px 8px;
  padding: 0;
  pointer-events: none;
  z-index: 6;
}

.month-task-continuous-bar {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr) auto;
  align-items: center;
  gap: 5px;
  min-width: 0;
  min-height: 22px;
  max-height: 23px;
  border: 1px solid rgba(100, 116, 139, 0.18);
  border-radius: 4px;
  padding: 2px 7px;
  overflow: hidden;
  pointer-events: auto;
  line-height: 1.2;
  color: rgba(15, 23, 42, 0.86);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.18);
}

.month-task-continuous-bar .calendar-task-check.event-check,
.month-task-continuous-bar .event-check {
  position: static !important;
  transform: none !important;
  top: auto !important;
  left: auto !important;
  width: 12px;
  height: 12px;
  margin: 0;
  flex: 0 0 auto;
}

.month-task-continuous-bar .month-task-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.month-task-continuous-bar small {
  float: none;
  margin-left: 4px;
  color: rgba(71, 85, 105, 0.72);
  font-size: 10px;
}

.month-task-continuous-bar.calendar-task-done .month-task-title {
  text-decoration: line-through;
  color: #64748b;
}

/* 2026-07-10 Kanban flow and inclusive Gantt span repair. */
.content:has(.task-flow-page) {
  min-height: 0;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  align-content: start;
  grid-auto-rows: max-content;
}

.task-flow-page {
  height: auto;
  min-height: 0;
  overflow: visible;
}

.kanban-flow-scroll {
  grid-template-rows: auto auto;
  height: auto;
  min-height: 0;
  max-height: none;
  overflow: visible;
}

.kanban-flow-scroll .task-gantt-panel {
  min-height: 0;
}

.gantt-date-bar {
  min-width: 0;
}

/* 2026-07-10 Gantt date bars must respect exact day span. */
.gantt-date-bar {
  min-width: 0 !important;
  width: auto !important;
  max-width: 100%;
  overflow: hidden !important;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gantt-date-bar span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 2026-07-10 Kanban page must allow full-page vertical scrolling. */
.compact-kanban-page {
  height: auto !important;
  min-height: 100%;
  overflow: visible !important;
  display: grid;
  gap: 12px;
}

.kanban-board-compact,
.open-kanban-board {
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
}

.kanban-board-compact .kanban-column,
.open-kanban-board .kanban-column {
  max-height: min(42vh, 420px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.compact-kanban-page .task-gantt-panel,
.compact-kanban-page .frozen-gantt-panel {
  overflow: visible;
}

.content:has(.compact-kanban-page) {
  height: auto !important;
  min-height: 0;
  overflow-y: auto !important;
  align-content: start;
}

/* 2026-07-10 packed dayGrid month layout. */
.month-week-packed,
.month-week-packed .month-grid {
  min-height: 150px;
}

.month-week-packed .month-task-packed-layer {
  inset: 44px 8px 24px 8px;
  grid-auto-rows: 23px;
  max-height: calc(var(--month-event-rows, 4) * 27px);
  overflow: hidden;
}

.month-more-packed {
  position: absolute;
  left: 8px;
  bottom: 6px;
  z-index: 9;
  min-height: 18px;
  border: 0;
  background: transparent;
  color: #5b7df6;
  padding: 0;
  font-size: 11px;
  line-height: 1;
}

/* 2026-07-10 final month packed geometry guard. */
.month-week-packed {
  --month-date-row-height: 36px;
  --month-event-row-height: 23px;
  --month-event-gap: 4px;
  --month-day-max-rows: 4;
  min-height: calc(var(--month-date-row-height) + (var(--month-day-max-rows) * var(--month-event-row-height)) + ((var(--month-day-max-rows) - 1) * var(--month-event-gap)) + 28px) !important;
}

.month-week-packed .month-task-packed-layer {
  top: calc(var(--month-date-row-height) + 8px) !important;
  left: 8px !important;
  right: 8px !important;
  bottom: auto !important;
  grid-auto-rows: var(--month-event-row-height) !important;
  gap: var(--month-event-gap) 8px !important;
}

.month-week-packed .month-cell .day-add {
  top: 8px !important;
  right: 8px !important;
  left: auto !important;
  transform: none !important;
}

.month-week-packed .month-task-continuous-bar .calendar-task-check.event-check,
.month-week-packed .month-task-continuous-bar .event-check {
  position: static !important;
  transform: none !important;
  top: auto !important;
  left: auto !important;
  margin: 0 !important;
}

/* 2026-07-14 mobile navigation and content reachability. */
@media (max-width: 760px) {
  :root {
    --mobile-nav-height: 64px;
  }

  html,
  body {
    width: 100%;
    min-height: 100%;
    height: auto;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .app-shell {
    display: block;
    width: 100%;
    min-height: 100dvh;
    height: auto;
    overflow: visible;
    padding-bottom: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom, 0px));
  }

  .main {
    width: 100%;
    min-width: 0;
    min-height: 100dvh;
    height: auto;
    overflow: visible;
  }

  .content,
  .content:has(.compact-kanban-page),
  .content:has(.habit-page),
  .content:has(.stable-task-form),
  .content:has(.task-gantt-panel),
  .content:has(.scheduled-timeline) {
    width: 100%;
    min-width: 0;
    min-height: 0 !important;
    height: auto !important;
    overflow-x: hidden !important;
    overflow-y: visible !important;
    padding: 12px 10px calc(24px + env(safe-area-inset-bottom, 0px));
  }

  .sidebar {
    position: fixed;
    z-index: 100;
    inset: auto 0 0 0;
    width: 100%;
    height: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom, 0px));
    max-height: none;
    overflow: hidden;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid rgba(255, 255, 255, 0.28);
    box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.14);
  }

  .nav {
    display: flex;
    align-items: stretch;
    width: 100%;
    height: 52px;
    gap: 4px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
  }

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

  .nav button,
  .sidebar .nav button,
  .nav [data-view] {
    flex: 0 0 62px;
    width: 62px;
    min-width: 62px;
    min-height: 48px;
    height: 48px;
    justify-content: center;
    align-items: center;
    scroll-snap-align: center;
    border-radius: 7px;
    padding: 0 5px;
    font-size: 12px;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: clip;
  }

  .topbar {
    min-height: 62px;
    padding: 10px 12px;
  }

  .topbar .eyebrow,
  .topbar .top-stats span {
    font-size: 11px;
  }

  .topbar h2 {
    font-size: 20px;
  }

  .top-stats {
    gap: 8px;
  }

  .top-stats > div {
    min-width: 62px;
  }

  .panel,
  .task-card,
  .task-item {
    min-width: 0;
  }

  .task-card {
    max-width: 100%;
    overflow: hidden;
  }

  .task-card .meta,
  .task-card .row-actions {
    max-width: 100%;
  }

  .task-card-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
    gap: 8px;
  }

  .task-card-actions button,
  .task-card-actions button.small {
    width: 100%;
    min-width: 0 !important;
    padding-inline: 6px !important;
  }

  .frozen-gantt-panel {
    max-width: 100%;
    overflow: hidden;
  }

  .frozen-gantt {
    --gantt-left-width: 150px;
    --gantt-day-width: 54px;
    max-width: 100%;
  }

  .import-json-field {
    display: grid;
    gap: 6px;
    margin-top: 14px;
  }

  .category-manage-row {
    grid-template-columns: minmax(0, 1fr) auto auto;
  }

  .category-manage-row .category-color-code {
    grid-column: 1 / -1;
    grid-row: 2;
  }
}

/* 2026-07-10 final OKR linked task title visibility guard. */
.okr-linked-task-row > div,
.okr-action-row > div:first-child {
  display: grid !important;
  gap: 6px !important;
  min-width: 0 !important;
}

.okr-linked-task-row strong,
.okr-action-row strong {
  display: block !important;
  min-height: 18px !important;
  font-size: 14px !important;
  line-height: 1.35 !important;
  font-weight: 700 !important;
  color: var(--text, #0f172a) !important;
  opacity: 1 !important;
  visibility: visible !important;
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
  overflow-wrap: anywhere !important;
}

.okr-linked-task-row .subtle,
.okr-action-row .subtle {
  margin: 0 !important;
}
