.task-dialog-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.task-dialog-grid label { min-width: 0; }
.task-dialog-grid select { width: 100%; min-height: 44px; }
.task-row { grid-template-columns: 24px 24px minmax(0, 1fr) auto 28px !important; }
.task-row b { align-self: end; }
.task-row small { grid-column: 3; color: var(--muted); font-size: 9px; font-weight: 750; text-transform: capitalize; }
.task-row > .task-remove { grid-column: 5; grid-row: 1 / span 2; }

.daily-flow-summary { display: grid; gap: 10px; padding: 12px 0 14px; border-bottom: 1px solid var(--line); }
.daily-flow-summary > header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.daily-flow-summary > header div { display: grid; gap: 2px; }
.daily-flow-summary > header button { width: auto; height: auto; flex: none; white-space: nowrap; }
.daily-flow-summary > header span { color: var(--studio-accent); font-size: 9px; font-weight: 900; }
.daily-flow-summary > header b { font-size: clamp(15px, 1.4vw, 21px); }
.daily-flow-summary button { min-height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 5px; color: inherit; background: transparent; font: inherit; font-size: 11px; font-weight: 800; }
.daily-outcome { min-height: 1.4em; margin: 0; overflow: hidden; color: var(--muted); font-size: 12px; line-height: 1.4; text-overflow: ellipsis; white-space: nowrap; }
.daily-load { display: grid; gap: 5px; }
.daily-load > div { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 9px; font-weight: 800; }
.daily-load > i { display: block; height: 5px; overflow: hidden; border-radius: 2px; background: color-mix(in srgb, var(--ink) 10%, transparent); }
.daily-load > i span { display: block; width: 0; height: 100%; background: var(--studio-accent); transition: width .3s ease; }
.daily-load > i span.overload { background: #ce5d4e; }
.daily-vitals { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.daily-vitals span { min-width: 0; display: grid; gap: 1px; padding-right: 8px; border-right: 1px solid var(--line); }
.daily-vitals span:last-child { border-right: 0; }
.daily-vitals b { font-size: clamp(14px, 1.5vw, 21px); font-variant-numeric: tabular-nums; }
.daily-vitals small { overflow: hidden; color: var(--muted); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.daily-flow-actions { display: grid; grid-template-columns: 1.35fr 1fr; gap: 7px; }
.daily-flow-actions .daily-primary { border-color: var(--studio-accent); color: #fff; background: var(--studio-accent); }
.daily-connection { margin: 0; padding: 7px 9px; border-left: 3px solid #c89b36; color: var(--muted); background: color-mix(in srgb, #c89b36 10%, transparent); font-size: 10px; line-height: 1.4; }
.daily-connection.error { border-color: #bd493d; color: #8e3028; background: color-mix(in srgb, #bd493d 10%, transparent); }
.daily-connection.hidden { display: none; }
.daily-flow-actions .is-closed::after { content: ' · listo'; color: #237c5b; }

.daily-flow-dialog { width: min(760px, calc(100vw - 24px)); max-height: min(820px, calc(100dvh - 24px)); padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: var(--panel); box-shadow: 0 30px 90px rgba(0,0,0,.32); }
.daily-flow-dialog::backdrop { background: rgba(6, 10, 8, .68); backdrop-filter: blur(7px); }
.daily-flow-dialog form { display: grid; grid-template-rows: auto auto minmax(0, 1fr); max-height: inherit; }
.daily-flow-dialog form > header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 20px 12px; }
.daily-flow-dialog form > header div { display: grid; gap: 4px; }
.daily-flow-dialog form > header span { color: var(--studio-accent); font-size: 9px; font-weight: 900; }
.daily-flow-dialog h2 { margin: 0; font-size: clamp(24px, 4vw, 42px); line-height: 1; }
.daily-flow-dialog form > header button { width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 50%; color: inherit; background: transparent; font-size: 24px; }
.daily-flow-tabs { display: flex; gap: 3px; padding: 0 20px 12px; border-bottom: 1px solid var(--line); }
.daily-flow-tabs button { min-height: 34px; padding: 0 14px; border: 0; border-bottom: 2px solid transparent; color: var(--muted); background: transparent; font: inherit; font-size: 11px; font-weight: 800; }
.daily-flow-tabs button { min-height: 44px; }
.daily-flow-tabs button.active { border-color: var(--studio-accent); color: var(--ink); }
.daily-flow-pane { min-height: 0; display: grid; align-content: start; gap: 16px; padding: 18px 20px 22px; overflow-y: auto; }
.daily-flow-pane.hidden { display: none; }
.daily-flow-pane label { display: grid; gap: 6px; color: var(--muted); font-size: 11px; font-weight: 800; }
.daily-flow-pane input, .daily-flow-pane select, .daily-flow-pane textarea { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 5px; color: var(--ink); background: transparent; font: inherit; }
.daily-flow-pane textarea { resize: vertical; }
.daily-outcome-field input { min-height: 54px; font-size: 17px; }
.daily-plan-grid { display: grid; grid-template-columns: minmax(180px, .8fr) minmax(280px, 1.2fr); gap: 14px; }
.daily-plan-grid fieldset { display: flex; align-items: center; gap: 8px; margin: 0; padding: 7px 10px; border: 1px solid var(--line); border-radius: 5px; }
.daily-plan-grid legend { padding: 0 5px; color: var(--muted); font-size: 10px; font-weight: 800; }
.daily-plan-grid fieldset label { min-width: 0; display: flex; align-items: center; gap: 4px; padding: 5px 7px; color: var(--ink); }
.daily-plan-grid fieldset input { width: 16px; min-height: 16px; padding: 0; accent-color: var(--studio-accent); }
.daily-task-picker { display: grid; gap: 8px; }
.daily-task-picker > header { display: flex; justify-content: space-between; gap: 10px; }
.daily-task-picker > header span { font-size: 10px; font-weight: 900; }
.daily-task-picker > header small { color: #237c5b; font-weight: 800; }
.daily-task-picker > header small.overload { color: #bd493d; }
#dailyTaskPicker { display: grid; gap: 6px; }
.daily-task-choice { min-width: 0; display: grid !important; grid-template-columns: auto minmax(0, 1fr) 92px; align-items: center; gap: 9px !important; padding: 8px 10px; border: 1px solid var(--line); border-radius: 5px; }
.daily-task-choice > input { width: 18px; min-height: 18px; padding: 0; accent-color: var(--studio-accent); }
.daily-task-choice > span { min-width: 0; display: grid; gap: 2px; }
.daily-task-choice b { overflow: hidden; color: var(--ink); text-overflow: ellipsis; white-space: nowrap; }
.daily-task-choice small { color: var(--muted); text-transform: capitalize; }
.daily-task-choice select { min-height: 34px; padding: 4px 7px; }
.daily-save { min-height: 46px; border: 1px solid var(--studio-accent); border-radius: 5px; color: #fff; background: var(--studio-accent); font: inherit; font-weight: 850; }
.daily-flow-pane > p, .daily-empty { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.habit-list { display: grid; gap: 7px; }
.habit-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 10px; min-height: 48px; padding: 7px 10px; border-bottom: 1px solid var(--line); }
.habit-row label { min-width: 0; display: flex; align-items: center; gap: 8px; color: var(--ink); }
.habit-row input { width: 18px; min-height: 18px; accent-color: var(--studio-accent); }
.habit-row small { color: var(--muted); font-size: 9px; }
.habit-row button { width: 44px; height: 44px; border: 0; color: var(--muted); background: transparent; font-size: 20px; }
.habit-add { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.habit-add button { min-width: 92px; border: 1px solid var(--line); border-radius: 5px; color: inherit; background: transparent; font-weight: 800; }
.daily-review-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; border: 1px solid var(--line); background: var(--line); }
.daily-review-metrics div { display: grid; gap: 3px; padding: 18px; background: var(--panel); }
.daily-review-metrics b { font-size: clamp(22px, 4vw, 38px); }
.daily-review-metrics span { color: var(--muted); font-size: 10px; font-weight: 800; }

.widget-xs .daily-flow-summary, .widget-sm .daily-flow-summary { gap: 4px; padding: 2px 0; }
.widget-xs .daily-flow-summary > header b, .widget-xs .daily-outcome, .widget-xs .daily-load, .widget-xs .daily-vitals, .widget-xs .daily-flow-actions button:last-child,
.widget-sm .daily-outcome, .widget-sm .daily-vitals { display: none; }
.widget-xs .daily-flow-summary > header span, .widget-xs .daily-flow-summary > header button { font-size: 7px; }
.widget-xs .daily-flow-actions { grid-template-columns: 1fr; }
.widget-xs .daily-flow-actions button { min-height: 24px; padding: 0 4px; font-size: 7px; }
.widget-sm .daily-flow-actions button { min-height: 28px; font-size: 8px; }

@media (max-width: 620px) {
  .widget-board [data-dashboard-widget="clock"] { grid-column: 1 / 11 !important; grid-row: 1 / 5 !important; }
  .widget-board [data-dashboard-widget="tasks"] { grid-column: 1 / 11 !important; grid-row: 5 / 15 !important; }
  .widget-board [data-dashboard-widget="calendar"] { grid-column: 1 / 11 !important; grid-row: 15 / 18 !important; }
  .widget-board [data-dashboard-widget="pomodoro"] { grid-column: 1 / 6 !important; grid-row: 18 / 21 !important; }
  .widget-board [data-dashboard-widget="brain"] { grid-column: 6 / 11 !important; grid-row: 18 / 21 !important; }
  .widget-board .calendar-panel .calendar-agenda,
  .widget-board .calendar-panel .month-toolbar,
  .widget-board .calendar-panel .month-grid { display: none !important; }
  .widget-board .calendar-panel .panel-heading { min-height: 38px; }
  .widget-board .calendar-panel #clockDate { font-size: 11px !important; white-space: normal; }
  .widget-board .calendar-panel .calendar-quick-add { display: block !important; min-height: 44px; margin-top: auto; }
  .widget-board .task-console { padding: 8px !important; }
  .daily-flow-summary { gap: 7px; padding-block: 7px 9px; }
  .daily-outcome { font-size: 10px; }
  .task-dialog-grid, .daily-plan-grid { grid-template-columns: 1fr; }
  .daily-flow-dialog { width: 100vw; max-width: none; height: 100dvh; max-height: none; border: 0; border-radius: 0; }
  .daily-flow-dialog form { height: 100%; }
  .daily-flow-dialog form > header { padding-top: max(16px, env(safe-area-inset-top)); }
  .daily-flow-dialog form > header button { width: 44px; height: 44px; }
  .daily-task-choice { grid-template-columns: auto minmax(0, 1fr) 76px; }
  .daily-review-metrics div { padding: 12px 8px; }
}
