:root {
  color-scheme: light;
  --bg: #f8faf8;
  --surface: #ffffff;
  --surface-soft: #f0f6f4;
  --ink: #374151;
  --muted: #64736d;
  --border: #dfe8e3;
  --green: #10b981;
  --green-soft: #d1fae5;
  --amber: #c98d28;
  --amber-soft: #fff1d8;
  --coral: #ff715f;
  --coral-soft: #ffe8e3;
  --blue: #3b6f9f;
  --blue-soft: #e2eef8;
  --shadow: 0 12px 34px rgba(34, 48, 42, 0.08);
  --radius: 18px;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(223, 241, 232, 0.75), transparent 280px),
    var(--bg);
  color: var(--ink);
}

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

button {
  border: 0;
}

.app-shell {
  width: min(1220px, 100%);
  min-height: 100vh;
  margin: 0 auto;
}

.layout {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr) 270px;
  gap: 24px;
  padding: 22px;
}

.sidebar,
.side-panel,
.main-panel {
  min-width: 0;
}

.sidebar {
  position: sticky;
  top: 22px;
  align-self: start;
  display: grid;
  gap: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 760;
  letter-spacing: 0;
}

.brand-logo {
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  object-fit: cover;
  box-shadow: 0 8px 20px rgba(255, 113, 95, 0.16);
}

.nav {
  display: grid;
  gap: 6px;
}

.nav-button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  text-align: left;
  cursor: pointer;
}

.nav-button svg {
  width: 19px;
  height: 19px;
  stroke-width: 2;
}

.nav-button.is-active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 8px 24px rgba(35, 55, 45, 0.08);
}

.desktop-note {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.main-panel {
  display: grid;
  align-content: start;
  gap: 14px;
}

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

.today-mini-dashboard {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 210px;
  gap: 2px;
  margin-left: auto;
  padding: 10px 13px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
  color: #4b5563;
  box-shadow: 0 8px 22px rgba(34, 48, 42, 0.06);
}

.energy-mini-select {
  min-height: 32px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--green-soft);
  color: #047857;
  padding: 0 8px;
  font-size: 12px;
  font-weight: 800;
}

.today-mini-dashboard strong {
  color: #047857;
  font-size: 13px;
}

.today-mini-dashboard > div {
  display: grid;
  gap: 2px;
}

.today-mini-dashboard span {
  font-size: 12px;
  line-height: 1.3;
}

.eyeline {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

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

h1 {
  margin-bottom: 0;
  color: #111827;
  font-size: clamp(29px, 4vw, 45px);
  line-height: 1.02;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 12px;
  font-size: 19px;
  line-height: 1.2;
}

h3 {
  margin-bottom: 6px;
  font-size: 15px;
  line-height: 1.25;
}

.date-card {
  flex: 0 0 auto;
  min-width: 88px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  text-align: center;
}

.date-card strong {
  display: block;
  font-size: 24px;
  line-height: 1;
}

.date-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.meter-card,
.routine-focus,
.section,
.settings-card,
.empty-state {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.meter-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 15px;
}

.summary-row .meter-card:nth-child(2) {
  grid-template-columns: 1fr;
}

.today-count-card {
  align-content: center;
}

.progress-ring {
  --pct: 0;
  display: grid;
  width: 74px;
  height: 74px;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, var(--surface) 57%, transparent 59%),
    conic-gradient(var(--green) calc(var(--pct) * 1%), #e6eee9 0);
  color: var(--ink);
  font-weight: 800;
}

.done-number {
  display: grid;
  width: 74px;
  height: 74px;
  place-items: center;
  border: 8px solid var(--green-soft);
  border-radius: 50%;
  color: var(--green);
  font-size: 28px;
  font-weight: 850;
}

.capacity {
  display: flex;
  gap: 6px;
  padding: 5px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.capacity button {
  flex: 1;
  min-height: 36px;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
}

.capacity button.is-active {
  background: var(--green);
  color: white;
}

.filter-summary-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  max-width: 100%;
  min-height: 42px;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: #4b5563;
  box-shadow: 0 10px 24px rgba(20, 30, 26, 0.06);
  backdrop-filter: blur(14px);
  cursor: pointer;
  text-align: left;
}

.filter-icons {
  display: inline-flex;
  flex: 0 1 auto;
  gap: 5px;
  min-width: 0;
  max-width: min(420px, 52vw);
  overflow: hidden;
}

.filter-icon-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--green-soft);
  color: #047857;
  font-size: 13px;
  font-weight: 800;
}

.summary-energy,
.summary-counter {
  flex: 0 0 auto;
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--green-soft);
  color: #047857;
  font-size: 12px;
  font-weight: 780;
}

.filter-summary-bar strong {
  flex: 0 0 auto;
  color: #047857;
  font-size: 13px;
}

.filter-overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(17, 24, 39, 0.2);
  backdrop-filter: blur(4px);
}

.filter-sheet {
  width: min(560px, 100%);
  max-height: min(720px, calc(100vh - 44px));
  overflow: auto;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 28px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(31, 41, 55, 0.18);
}

.sheet-handle {
  display: none;
}

.sheet-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.sheet-header h2 {
  margin-bottom: 4px;
  color: #111827;
  font-size: 22px;
}

.icon-close {
  display: inline-grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 999px;
  background: var(--surface-soft);
  color: #4b5563;
  cursor: pointer;
  font-size: 22px;
}

.filter-group {
  display: grid;
  gap: 9px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
}

.filter-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.line-clear {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: #047857;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.filter-heading {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 820;
  text-transform: uppercase;
}

.pill-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.day-timeline {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  overflow: hidden;
  border: 1px solid #ccecdf;
  border-radius: 999px;
  background: #e8f5e9;
}

.timeline-button {
  display: grid;
  min-height: 54px;
  place-items: center;
  gap: 2px;
  border-right: 1px solid #ccecdf;
  background: transparent;
  color: #2f5549;
  cursor: pointer;
  font-weight: 800;
}

.timeline-button:last-child {
  border-right: 0;
}

.timeline-button span {
  font-size: 16px;
}

.timeline-button small {
  font-size: 11px;
}

.timeline-button.is-active {
  background: var(--green);
  color: #fff;
}

.anytime-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid #ccecdf;
  border-radius: 999px;
  background: #e8f5e9;
  color: #2f5549;
  cursor: pointer;
}

.anytime-toggle.is-active {
  background: var(--green);
  color: #fff;
}

.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid #ccecdf;
  border-radius: 999px;
  background: #e8f5e9;
  color: #2f5549;
  cursor: pointer;
  font-size: 14px;
  font-weight: 780;
  transition:
    transform 150ms ease,
    background 150ms ease,
    box-shadow 150ms ease;
}

.filter-pill:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(16, 185, 129, 0.14);
}

.filter-pill.is-active {
  border-color: transparent;
  background: var(--green);
  color: white;
}

.filter-pill strong {
  font-size: 13px;
}

.energy-control {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  padding: 5px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
}

.energy-control button {
  min-height: 40px;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
  font-weight: 780;
}

.energy-control button.is-active {
  background: var(--green);
  color: white;
}

.filter-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  position: sticky;
  bottom: -18px;
  margin: 0 -18px -18px;
  padding-top: 12px;
  padding-right: 18px;
  padding-bottom: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.82), #fff 32%);
}

.clear-filters {
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: #047857;
  cursor: pointer;
  font-weight: 820;
}

.done-filters {
  min-height: 46px;
  min-width: 132px;
  padding: 0 20px;
  border-radius: 999px;
  background: var(--green);
  color: white;
  cursor: pointer;
  font-weight: 850;
}

.filter-panel {
  display: none;
}

.filter-row {
  display: grid;
  grid-template-columns: 126px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.filter-row h2 {
  margin-bottom: 3px;
  font-size: 14px;
}

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

.filter-options button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 760;
}

.filter-options button small {
  color: inherit;
  font-size: 11px;
  opacity: 0.72;
}

.filter-options button.is-active {
  border-color: transparent;
  background: var(--ink);
  color: white;
}

.section {
  padding: 16px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

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

.task-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(230px, 0.4fr);
  gap: 12px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(34, 48, 42, 0.05);
  transition:
    opacity 160ms ease,
    transform 160ms ease,
    box-shadow 160ms ease;
}

.task-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(34, 48, 42, 0.08);
}

.task-card.is-done {
  opacity: 0.66;
}

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

.task-title strong {
  overflow-wrap: anywhere;
  color: #111827;
  font-size: 16px;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 11px;
  font-weight: 720;
}

.tag.due,
.tag.ready {
  background: var(--amber-soft);
  color: #6f5a24;
}

.tag.very-due,
.tag.critical {
  background: var(--amber-soft);
  color: #6f5a24;
}

.tag.fresh,
.tag.can-wait {
  background: var(--green-soft);
  color: #27634d;
}

.tag.soon {
  background: var(--blue-soft);
  color: #295579;
}

.priority-bulb {
  display: inline-grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 999px;
}

.bulb-shape {
  position: relative;
  display: block;
  width: 13px;
  height: 16px;
  border: 2px solid currentColor;
  border-radius: 9px 9px 6px 6px;
  background: currentColor;
}

.bulb-shape::after {
  position: absolute;
  right: 2px;
  bottom: -6px;
  left: 2px;
  height: 4px;
  border-radius: 0 0 3px 3px;
  background: currentColor;
  content: "";
}

.priority-bulb.priority-high {
  background: #fff7cc;
  color: #facc15;
  box-shadow: 0 0 0 3px rgba(250, 204, 21, 0.18);
}

.priority-bulb.priority-normal {
  background: #fffbe8;
  color: #fde68a;
}

.priority-bulb.priority-low {
  border: 1px solid var(--border);
  background: #fff;
  color: #fff;
}

.priority-bulb.priority-low .bulb-shape {
  box-shadow: inset 0 0 0 2px #d1d5db;
}

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

.action-row {
  display: grid;
  grid-template-columns: 48px repeat(2, minmax(0, 1fr));
}

.mini-action {
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  font-size: 13px;
  font-weight: 780;
}

.mini-action.done {
  border-color: transparent;
  background: var(--green);
  color: white;
}

.task-checkbox,
.routine-checkbox {
  display: inline-grid;
  place-items: center;
  border: 2px solid var(--green);
  background: #fff;
  cursor: pointer;
}

.task-checkbox {
  width: 42px;
  min-height: 42px;
  border-radius: 12px;
}

.routine-checkbox {
  min-height: 48px;
  border-radius: 14px;
}

.task-checkbox::after,
.routine-checkbox::after {
  width: 18px;
  height: 18px;
  border: 2px solid var(--green);
  border-radius: 5px;
  content: "";
}

.routine-checkbox.is-checked {
  background: var(--green-soft);
}

.routine-checkbox.is-checked::after {
  display: grid;
  place-items: center;
  background: var(--green);
  color: #fff;
  content: "✓";
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
}

.mini-action.start {
  border-color: transparent;
  background: var(--green-soft);
  color: #047857;
}

.mini-action.later {
  background: var(--blue-soft);
  color: #295579;
}

.mini-action.remove {
  background: #f3f1ed;
  color: #6d6961;
}

.icon-button,
.primary-button,
.secondary-button,
.text-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 760;
}

.icon-button {
  width: 40px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
}

.icon-button svg {
  width: 18px;
  height: 18px;
}

.primary-button {
  gap: 8px;
  padding: 0 14px;
  background: var(--green);
  color: white;
}

.primary-button svg,
.secondary-button svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  stroke-width: 2;
}

.secondary-button {
  gap: 8px;
  padding: 0 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
}

.text-button {
  min-height: 34px;
  padding: 0 8px;
  background: transparent;
  color: var(--blue);
  font-size: 13px;
}

.icon-text-button {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: #047857;
  cursor: pointer;
  font-size: 16px;
  font-weight: 850;
}

.routine-focus {
  padding: 14px;
}

.routine-select-label {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.routine-select {
  width: 100%;
  min-height: 40px;
  margin-bottom: 10px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
  color: #374151;
  padding: 0 10px;
  font-weight: 760;
}

.routine-progress-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  padding: 9px 11px;
  border-radius: 14px;
  background: var(--green-soft);
  color: #047857;
}

.routine-progress-card strong {
  font-size: 13px;
}

.routine-progress-card span {
  font-size: 12px;
  font-weight: 760;
}

.focus-step {
  padding: 13px;
  border-radius: 16px;
  background: var(--surface-soft);
}

.focus-step strong {
  display: block;
  margin-bottom: 6px;
  font-size: 17px;
}

.focus-controls {
  display: grid;
  grid-template-columns: 48px 1fr 48px;
  gap: 8px;
  margin-top: 12px;
}

.focus-controls .primary-button,
.focus-controls .secondary-button {
  min-height: 48px;
  border-radius: 14px;
  font-size: 15px;
}

.routine-arrow {
  min-height: 48px;
  border-radius: 14px;
  background: var(--green);
  color: #fff;
  cursor: pointer;
  font-size: 28px;
  font-weight: 900;
}

.step-line {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: flex-start;
}

.collapse-button {
  display: inline-grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  cursor: pointer;
  font-size: 18px;
}

.routine-details {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.compact-steps {
  margin: 0;
  padding-left: 22px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.compact-steps .is-current {
  color: #047857;
  font-weight: 800;
}

.logic-card {
  padding: 10px 12px;
}

.logic-toggle {
  min-height: 34px;
  background: transparent;
  color: #047857;
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  text-align: left;
}

.quick-form {
  display: grid;
  gap: 10px;
}

.field {
  display: grid;
  gap: 5px;
}

.field label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  padding: 9px 10px;
  outline: none;
}

.field textarea {
  min-height: 74px;
  resize: vertical;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.side-panel {
  display: grid;
  align-content: start;
  gap: 16px;
}

.mobile-routine-panel {
  display: none;
}

.need-bar {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7eee9;
}

.need-bar span {
  display: block;
  width: min(var(--need), 100%);
  height: 100%;
  background: linear-gradient(90deg, var(--green), #79b7a6, var(--amber));
}

.list-row {
  display: grid;
  gap: 5px;
  padding: 8px 0;
  border-top: 1px solid var(--border);
}

.list-row:first-of-type {
  border-top: 0;
}

.row-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.row-top strong {
  overflow-wrap: anywhere;
}

.add-idea-button {
  width: 100%;
  min-height: 44px;
  margin-top: 12px;
  border-radius: 999px;
  background: var(--green);
  color: #fff;
  cursor: pointer;
  font-weight: 850;
}

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

.small {
  font-size: 12px;
}

.bottom-nav {
  display: none;
}

.daypart-tabs {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 10px 24px rgba(20, 30, 26, 0.08);
}

.bank-tabs {
  position: static;
}

.daypart-tabs button {
  display: grid;
  gap: 3px;
  min-height: 48px;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 760;
}

.daypart-tabs button span {
  color: inherit;
  font-size: 11px;
  opacity: 0.75;
}

.daypart-tabs button.is-active {
  background: var(--ink);
  color: #fff;
}

.daypart-stack {
  display: grid;
  gap: 14px;
}

.today-list-section {
  padding: 24px 12px 18px;
  box-shadow: none;
  background: transparent;
  border-color: transparent;
}

.daypart-section.is-focused {
  outline: 2px solid rgba(37, 168, 143, 0.24);
  outline-offset: 2px;
}

.daypart-section {
  scroll-margin-top: 76px;
}

.inline-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.edit-form {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.check-grid {
  display: grid;
  gap: 8px;
}

.check-grid label {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 8px;
  row-gap: 2px;
  align-items: start;
  padding: 9px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.check-grid input {
  margin-top: 3px;
}

.check-grid small {
  grid-column: 2;
  color: var(--muted);
  font-size: 11px;
}

.micro-row {
  padding: 9px 0;
  border-top: 1px solid var(--border);
  font-size: 13px;
  font-weight: 720;
}

.micro-row:first-of-type {
  border-top: 0;
}

.step-list {
  margin: 8px 0 14px;
  padding-left: 22px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.empty-state {
  padding: 18px;
  color: var(--muted);
  text-align: center;
}

.settings-card {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.capture-section {
  max-width: 560px;
}

@media (max-width: 980px) {
  .layout {
    grid-template-columns: minmax(0, 1fr);
    padding: 16px 16px 88px;
  }

  .sidebar {
    position: static;
  }

  .desktop-note {
    display: none;
  }

  .sidebar .nav {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 4px;
    padding: 6px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 10px 24px rgba(20, 30, 26, 0.08);
    backdrop-filter: blur(14px);
  }

  .sidebar .nav-button {
    display: grid;
    justify-items: center;
    gap: 3px;
    min-height: 54px;
    padding: 6px 3px;
    font-size: 11px;
    text-align: center;
  }

  .side-panel {
    display: none;
  }

  .mobile-routine-panel {
    display: grid;
  }

  .bottom-nav {
    display: none;
  }
}

@media (max-width: 640px) {
  .layout {
    padding: 14px 12px 88px;
  }

  .topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
  }

  .today-mini-dashboard {
    grid-column: 1 / -1;
    grid-row: 2;
    max-width: none;
    margin-left: 0;
  }

  .date-card {
    min-width: 74px;
  }

  .today-list-section {
    margin-top: 0;
    padding: 18px 0;
  }

  .task-card {
    grid-template-columns: 1fr;
    padding: 16px;
  }

  .action-row {
    grid-template-columns: 48px repeat(2, minmax(0, 1fr));
  }

  .mini-action {
    min-height: 44px;
  }

  .filter-summary-bar {
    width: 100%;
    border-radius: 20px;
  }

  .filter-icons {
    flex: 1;
    max-width: none;
  }

  .filter-overlay {
    align-items: end;
    padding: 0;
  }

  .filter-sheet {
    width: 100%;
    max-height: 96vh;
    border-radius: 28px 28px 0 0;
    padding: 10px 16px 18px;
  }

  .sheet-handle {
    display: block;
    width: 46px;
    height: 5px;
    margin: 4px auto 14px;
    border-radius: 999px;
    background: #d1d5db;
  }

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

  .filter-pill {
    min-height: 44px;
    justify-content: flex-start;
    padding: 0 12px;
    font-size: 13px;
  }

  .filter-footer {
    bottom: -18px;
    margin: 0 -16px -18px;
    padding-right: 16px;
  }

  .icon-button {
    width: 100%;
  }

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

  .daypart-tabs {
    overflow-x: auto;
    grid-template-columns: repeat(5, minmax(88px, 1fr));
    scroll-margin-top: 12px;
  }

  .daypart-section {
    scroll-margin-top: 66px;
  }

  .daypart-tabs button {
    min-height: 44px;
  }
}
