/* Ritmo 0.8: a continuous calendar canvas, with the selected day as its anchor.
   Surfaces: 20px; controls: 10px; category labels: 5px. Motion answers input only. */
:root {
  --cloud: #f4f4f8;
  --ink: #302d3d;
  --muted: #686375;
  --plum: #624b80;
  --lavender: #eee8f6;
  --line: #e6e2ec;
  --surface: #ffffff;
  --quiet: #faf9fc;
  --focus: #8c6daf;
}
.app-shell { grid-template-columns: 220px minmax(0, 1fr); min-height: 100dvh; }
.sidebar { height: 100dvh; padding: 36px 20px 24px; background: #eeedf4; border-color: var(--line); }
.sidebar > .brand, .sidebar > .brand-description, .sidebar > .main-nav, .sidebar > .areas, .sidebar > .sidebar-bottom { flex-shrink: 0; }
.brand { padding-left: 10px; }
.brand-description { margin: 15px 0 34px; padding-left: 10px; font-size: 12px; }
.main-nav { gap: 5px; }
.nav-item { padding: 13px 14px; min-height: 46px; font-size: 13px; color: var(--muted); }
.nav-item.active { background: var(--surface); color: var(--plum); box-shadow: 0 2px 8px #44335d08; }
.nav-item.active svg { stroke-width: 2; }
.nav-count { background: var(--lavender); color: var(--plum); }
.areas h2 { font-size: 12px; margin-bottom: 14px; }
.area-button { font-size: 12px; padding: 10px 14px; }
.area-button.selected { background: #e2dcec; color: #4e3b66; }
.category-dot, .all-dot { width: 8px; height: 8px; }
.small-note { font-size: 12px; line-height: 1.7; }
.data-button { font-size: 12px; }
.studio-link { font-size: 11px; }
main { padding: 36px 32px 24px; max-width: 1600px; }
.page-header { margin-bottom: 28px; }
.page-header h1 { font-size: clamp(28px, 2.5vw, 36px); letter-spacing: -.045em; font-weight: 700; }
.today-label { font-size: 12px; margin-bottom: 8px; }
.header-description { font-size: 13px; margin-top: 8px; }
.button { min-height: 42px; padding: 10px 16px; font-size: 12px; border-radius: 10px; }
.primary { box-shadow: 0 3px 8px #624b8014; }
.secondary { background: var(--surface); border-color: #d9d2e2; }
.icon-button { min-width: 34px; min-height: 34px; border-radius: 10px; }
.example-banner { background: transparent; border: 1px solid #ddd6e8; padding: 10px 14px; font-size: 12px; color: var(--muted); margin-bottom: 20px; }
.example-banner button { font-size: 12px; color: var(--plum); }
.calendar-layout { grid-template-columns: minmax(0, 1fr) 300px; gap: 22px; }
.calendar-panel, .day-panel, .tasks-view { border-radius: 20px; border-color: var(--line); box-shadow: 0 4px 20px #44335d04; }
.calendar-toolbar { padding: 26px 24px 20px; align-items: center; }
.calendar-toolbar h2 { font-size: 29px; font-weight: 700; }
.calendar-year { font-size: 20px; color: var(--muted); }
.calendar-toolbar p { font-size: 12px; margin-top: 8px; }
.month-actions { gap: 6px; }
.calendar-toolbar .today-button { min-height: 34px; font-size: 12px; }
.month-actions > .icon-button { background: var(--quiet); border: 1px solid var(--line); }
.weekday-row { padding: 0 14px; }
.weekday-row span { padding: 13px 0; font-size: 11px; color: var(--muted); }
.weekday-row span:nth-last-child(-n+2) { color: var(--muted); }
.calendar-grid { padding: 0 14px 14px; }
.calendar-cell { padding: 0; min-height: 118px; border-top: 1px solid var(--line); border-right: 1px solid var(--line); }
.calendar-week:last-child .calendar-cell { border-bottom: 0; }
.calendar-cell:last-child { border-right: 0; }
.date-button { min-height: 118px; padding: 10px 7px; border-radius: 0; background: transparent; gap: 8px; }
.calendar-cell:nth-last-child(-n+2) .date-button { background: var(--quiet); }
.date-button:hover { background: #f4f0f8; }
.date-button.selected, .calendar-cell:nth-last-child(-n+2) .date-button.selected { background: var(--lavender); border-color: #b8a4cd; border-radius: 10px; box-shadow: inset 0 0 0 1px #b8a4cd; }
.date-button.outside { opacity: 1; color: #8b8497; }
.date-button.outside .cell-items { opacity: .7; }
.date-number { font-size: 14px; font-variant-numeric: tabular-nums; width: 30px; height: 30px; }
.date-button.today .date-number { box-shadow: none; }
.cell-items { gap: 4px; }
.cell-item { font-size: 10px; line-height: 1.5; padding: 3px 5px; }
.cell-item.habit-marker { color: var(--muted); font-size: 10px; }
.cell-item.completed { text-decoration: line-through; color: var(--muted); background: #f0edf3; border-left-color: #aaa1b5; }
.more-items { font-size: 10px; }
.calendar-footer { background: var(--surface); padding: 14px 24px; font-size: 11px; }
.day-panel { background: var(--surface); }
.day-header { background: var(--plum); padding: 24px; border-color: var(--plum); }
.day-header > p, .day-header > span { color: #efe8f7; font-size: 12px; }
.day-header h2 { color: #fff; font-size: 29px; font-weight: 650; }
.day-header > span { margin-top: 12px; }
.day-section { padding: 22px 20px; }
.day-section + .day-section { border-color: var(--line); }
.section-title { margin-bottom: 12px; }
.section-title h3 { font-size: 13px; font-weight: 700; }
.section-title .icon-button { background: var(--quiet); color: var(--plum); }
.day-panel .task-title { font-size: 13px; line-height: 1.65; }
.task-meta, .habit-day-meta, .day-panel .task-meta { font-size: 11px; line-height: 1.7; }
.task-category-pill { font-size: 11px; padding: 2px 7px; border-radius: 5px; }
.demo-label { font-size: 10px; color: #706079; background: #f0ecf6; }
.task-checkbox { width: 18px; height: 18px; border-radius: 6px; }
.day-panel .commitment-row { padding: 14px 0; }
.breathing-room { background: var(--quiet); color: var(--muted); font-size: 12px; padding: 20px; }
.empty-day { font-size: 12px; color: var(--muted); line-height: 1.8; }
.completed-items { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 10px; }
.completed-items summary { cursor: pointer; color: var(--muted); font-size: 12px; padding: 8px 0; }
.completed-items summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 5px; }
.tasks-view { padding: 30px; }
.tasks-toolbar h2 { font-size: 27px; }
.tasks-toolbar p { font-size: 13px; }
.tasks-view .task-title, .habit-info strong { font-size: 15px; font-weight: 650; }
.tasks-view .task-meta, .habit-info > span, .wish-note { font-size: 12px; }
.task-group h3 { font-size: 12px; }
.search-field { background: var(--quiet); border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; min-height: 42px; }
.search-field input { font-size: 13px; }
.segmented { border-radius: 10px; padding: 4px; }
.segmented button { min-height: 34px; font-size: 12px; }
.segmented button.selected { color: var(--plum); }
.activity-card { padding: 22px 0; }
.activity-commitments { border-color: #d3c7e0; }
.habit-week-toolbar h3 { font-size: 14px; }
.habit-week-toolbar p, .habit-footnote { font-size: 12px; }
.habit-check { width: 42px; height: 46px; font-size: 12px; }
.habit-week-day > span { font-size: 11px; }
.app-footer { font-size: 11px; }
.step-dialog .composer-heading h2 { font-size: 26px; }
.composer-heading p, .composer-dialog label:not(.checkbox-label), .composer-dialog .hint { font-size: 12px; }
.wizard-progress button { font-size: 11px; min-height: 38px; }
.wizard-status { font-size: 11px; }
.picker-trigger { font-size: 13px; min-height: 48px; background: var(--quiet); }
.type-choices strong { font-size: 13px; }
.type-choices span { font-size: 11px; }
.picker-options > button { min-height: 42px; font-size: 13px; }
.composer-section-title h3 { font-size: 13px; }
.step-dialog .composer-footer { background: var(--quiet); }
button { filter: none; }
button:hover { filter: none; }
.nav-item:hover:not(.active), .area-button:hover:not(.selected) { background: #e5e1ed; }
.primary:hover { background: #513b6d; }
.secondary:hover, .icon-button:hover { background: var(--lavender); }
.task-edit:hover .task-title, .habit-info:hover strong { color: var(--plum); }
:is(button, a, input, textarea, select):focus-visible { outline-color: var(--focus); }
.stats-heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.stats-heading h2 { font-size: 29px; font-weight: 700; }
.stats-heading p { color: var(--muted); font-size: 13px; margin-top: 8px; }
.stats-context { color: var(--muted); font-size: 12px; margin: 18px 0 24px; }
.stats-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 26px 0; }
.stats-metric { padding: 0 24px; min-width: 0; border-right: 1px solid var(--line); }
.stats-metric:last-child { border-right: 0; }
.stats-metric h3 { font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.stats-metric strong { display: block; font-size: 42px; font-weight: 650; color: var(--plum); letter-spacing: -.05em; line-height: 1.25; margin: 13px 0 9px; font-variant-numeric: tabular-nums; }
.stats-metric p { font-size: 11px; color: var(--muted); }
.stats-chart-panel, .stats-category-panel { margin-top: 22px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 26px; }
.stats-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.stats-section-heading h3 { font-size: 18px; letter-spacing: -.025em; font-weight: 650; }
.stats-section-heading p { font-size: 12px; color: var(--muted); margin-top: 7px; max-width: 65ch; }
.stats-legend { display: flex; gap: 16px; font-size: 11px; color: var(--muted); flex-shrink: 0; }
.stats-legend span { display: flex; align-items: center; gap: 7px; }
.stats-legend i { width: 10px; height: 10px; border-radius: 3px; }
.planned-key { background: #ded6e9; }
.done-key { background: var(--sage); }
.stats-chart { display: flex; gap: 14px; padding: 24px 0 0; margin: 0 0 20px; list-style: none; overflow-x: auto; }
.stats-chart li { flex: 1; min-width: 52px; text-align: center; padding: 5px 2px; border-radius: 8px; }
.stats-chart li:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.stats-bar-value { font-size: 12px; color: var(--sage); font-weight: 700; }
.stats-bar-pair { height: 145px; display: flex; align-items: flex-end; justify-content: center; gap: 5px; border-bottom: 1px solid var(--line); margin: 10px 0; }
.stats-bar { display: block; width: min(28px, 38%); height: var(--bar); border-radius: 5px 5px 0 0; }
.stats-bar.planned { background: #ded6e9; }
.stats-bar.done { background: var(--sage); }
.stats-bar-label { display: block; font-size: 10px; line-height: 1.6; color: var(--muted); }
.stats-note { color: var(--muted); font-size: 11px; line-height: 1.8; margin-top: 20px; max-width: 100ch; }
.stats-chart-empty { padding: 45px 0 25px; font-size: 13px; color: var(--muted); }
.stats-table-scroll { overflow-x: auto; margin-top: 22px; border-radius: 8px; }
.stats-table-scroll:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.stats-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.stats-table th, .stats-table td { text-align: right; padding: 15px 12px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.stats-table thead th { font-size: 11px; color: var(--muted); font-weight: 550; background: var(--quiet); }
.stats-table th:first-child { text-align: left; }
.stats-table tbody th { font-weight: 600; }
.stats-table tbody tr:last-child th, .stats-table tbody tr:last-child td { border: 0; }
.stats-category-name { display: flex; align-items: center; gap: 9px; overflow-wrap: anywhere; }
.stats-category-name i { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.stats-empty { padding: 52px 28px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; }
.stats-empty h3 { font-size: 23px; }
.stats-empty p { font-size: 13px; color: var(--muted); margin: 12px 0 22px; max-width: 55ch; }
@media (max-width: 1200px) {
  .stats-metric { padding: 0 18px; }
  .stats-heading { flex-wrap: wrap; gap: 18px; }
}
@media (max-width: 720px) {
  .stats-heading h2 { font-size: 25px; }
  .stats-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 0; overflow: hidden; }
  .stats-metric { padding: 20px 16px; }
  .stats-metric:nth-child(2) { border-right: 0; }
  .stats-metric:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .stats-metric strong { font-size: 36px; }
  .stats-chart-panel, .stats-category-panel { padding: 20px 16px; }
  .stats-section-heading { flex-wrap: wrap; gap: 14px; }
  .stats-section-heading h3 { font-size: 17px; }
  .stats-chart { gap: 6px; }
  .stats-chart li { min-width: 28px; }
  .stats-bar-pair { height: 120px; gap: 3px; }
  .stats-table { min-width: 430px; }
  .stats-context { font-size: 11px; }
  .stats-empty { padding: 32px 20px; }
}
.date-button:focus-visible { outline-offset: -3px; position: relative; z-index: 1; }
@media (prefers-reduced-motion: no-preference) {
  .button, .nav-item, .icon-button, .habit-check { transition: background-color 140ms ease, transform 140ms ease; }
  .button:active, .icon-button:active, .habit-check:active { transform: scale(.97); }
}
@media (min-width: 1600px) {
  .calendar-layout { grid-template-columns: minmax(0, 1fr) 330px; }
  .date-button, .calendar-cell { min-height: 132px; }
  .cell-item, .cell-item.habit-marker { font-size: 11px; }
}
@media (max-width: 1200px) {
  .app-shell { grid-template-columns: 190px minmax(0, 1fr); }
  .sidebar { padding: 30px 14px 20px; }
  main { padding: 30px 22px 22px; }
  .calendar-layout { grid-template-columns: minmax(0, 1fr) 270px; gap: 16px; }
  .calendar-toolbar { padding: 22px 18px; }
  .calendar-toolbar h2 { font-size: 25px; }
  .cell-item, .cell-item.habit-marker { font-size: 9px; }
}
@media (max-width: 1020px) {
  .calendar-layout { grid-template-columns: 1fr; }
  .day-header { padding: 22px; }
  .cell-item, .cell-item.habit-marker { font-size: 10px; }
}
@media (max-width: 720px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { height: auto; padding: 22px 18px 12px; background: #eeedf4; }
  .brand { padding-left: 0; }
  .sidebar-bottom { display: flex; gap: 5px; }
  .data-button { font-size: 0; min-width: 40px; min-height: 40px; justify-content: center; background: #ffffff80; border-radius: 10px; }
  .main-nav { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .nav-item { min-height: 42px; width: 100%; padding: 9px 7px; font-size: 11px; gap: 6px; }
  .nav-item svg { width: 16px; height: 16px; }
  .nav-count { padding: 0 4px; font-size: 10px; }
  .areas { flex-wrap: wrap; overflow: visible; gap: 4px; }
  #category-filters { flex-wrap: wrap; flex-shrink: 1; gap: 3px; }
  .area-button { padding: 8px; font-size: 11px; }
  .areas #manage-categories { position: static; background: transparent; box-shadow: none; color: var(--plum); }
  main { padding: 25px 16px 20px; }
  .page-header { align-items: flex-start; gap: 12px; margin-bottom: 22px; }
  .page-header h1 { font-size: 27px; max-width: 12ch; }
  .today-label { font-size: 11px; }
  .header-description { font-size: 12px; }
  .page-header .primary { margin-top: 24px; min-height: 42px; }
  .example-banner { font-size: 11px; gap: 10px; }
  .example-banner button { font-size: 11px; }
  .calendar-toolbar { padding: 22px 14px 16px; gap: 6px; }
  .calendar-toolbar h2 { font-size: 25px; }
  .calendar-year { display: block; font-size: 15px; margin: 5px 0 0; }
  .month-actions { gap: 4px; }
  .calendar-toolbar .today-button { padding: 6px 9px; }
  .weekday-row { padding: 0 6px; }
  .weekday-row span { font-size: 10px; }
  .calendar-grid { padding: 0 6px 10px; }
  .calendar-cell, .date-button { min-height: 78px; }
  .date-button { padding: 7px 3px; gap: 6px; }
  .date-number { width: 27px; height: 27px; font-size: 12px; align-self: center; }
  .cell-item, .cell-item.habit-marker { font-size: 0; border: 0; height: 4px; padding: 0; margin: 0 5px; background: var(--category); border-radius: 3px; }
  .cell-item.completed { background: repeating-linear-gradient(90deg, var(--muted) 0 3px, transparent 3px 6px); opacity: .65; }
  .calendar-footer { padding: 12px 14px; font-size: 10px; }
  .day-header h2 { font-size: 28px; }
  .day-section { padding: 20px; }
  .tasks-view { padding: 20px; }
  .tasks-toolbar { flex-wrap: wrap; gap: 16px; }
  .tasks-toolbar h2 { font-size: 24px; }
  .tasks-toolbar p { font-size: 12px; }
  .tasks-toolbar .button { font-size: 12px; padding: 9px 12px; }
  .task-controls { gap: 12px; }
  .segmented button { font-size: 11px; padding: 7px 10px; }
  .habit-check { width: 100%; max-width: 42px; }
  .step-dialog .composer-heading h2 { font-size: 23px; }
  .wizard-progress button { font-size: 10px; }
  .picker-trigger { font-size: 12px; }
  .app-footer { font-size: 10px; }
}
@media (max-width: 360px) {
  main { padding-left: 12px; padding-right: 12px; }
  .sidebar { padding-left: 14px; padding-right: 14px; }
  .page-header h1 { font-size: 24px; }
  .calendar-toolbar h2 { font-size: 22px; }
  .month-actions { gap: 2px; }
  .month-actions > .icon-button { min-width: 30px; }
  .wizard-progress button { font-size: 9px; }
  .type-choices span { font-size: 10px; }
}
