/* Routines use the same palette in the dashboard and the desktop companion. */
.routines-modal { z-index: 10150; padding: 20px; box-sizing: border-box; }
.routines-dialog { width: min(660px, 100%); max-height: min(820px, 90dvh); display: flex; flex-direction: column; overflow: hidden; color: var(--text); }
.routines-dialog .appearance-header { flex: none; }
.routines-dialog .appearance-close-btn { width: 32px; height: 32px; }
.routines-view { padding: 20px; min-height: 0; overflow: auto; }
.routines-view [hidden], .companion-routines[hidden] { display: none !important; }
.routines-intro { margin: 0 0 20px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.routines-form { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(130px, 1fr); gap: 14px; padding-bottom: 20px; margin-bottom: 18px; border-bottom: 1px solid rgba(128,128,128,.22); }
.routines-form label { display: flex; flex-direction: column; gap: 7px; font-size: 12px; font-weight: 500; }
.routines-form input:not([type="checkbox"]), .routines-form select { box-sizing: border-box; width: 100%; min-width: 0; height: 40px; padding: 8px 10px; border: 1px solid rgba(128,128,128,.3); border-radius: 7px; background: var(--card); color: var(--text); font: inherit; font-size: 13px; }
.routines-form .routine-start-option { flex-direction: row; align-items: center; gap: 8px; font-weight: 400; }
.routine-start-option input { accent-color: var(--text); width: 16px; height: 16px; margin: 0; }
.routine-form-actions { display: flex; justify-content: flex-end; gap: 8px; }
.routine-form-actions button { padding: 9px 14px; white-space: nowrap; }
.routines-list { display: flex; flex-direction: column; gap: 9px; }
.routine-row { display: grid; grid-template-columns: minmax(0, 1fr) 46px auto 30px; align-items: center; gap: 10px; padding: 12px; border: 1px solid rgba(128,128,128,.22); border-radius: 10px; background: rgba(128,128,128,.035); }
.routine-row:has(.task-timer.is-running) { border-color: #229c7b; background: rgba(26,137,104,.07); }
.routine-main { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-width: 0; border: 0; background: none; color: inherit; text-align: left; cursor: pointer; padding: 3px 0; font: inherit; }
.routine-title { font-size: 14px; font-weight: 500; overflow-wrap: anywhere; line-height: 1.4; }
.routine-category { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 11px; }
.routine-category::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--routine-category); flex: none; }
.routine-row .task-timer { min-height: 42px; justify-content: center; }
.routine-row .task-timer-btn { width: 32px; height: 32px; }
.routine-row .task-timer-time { font-size: 10px; }
.routine-history-toggle, .routine-delete { border: 0; background: none; color: var(--muted); cursor: pointer; min-height: 32px; font: inherit; font-size: 11px; border-radius: 5px; }
.routine-history-toggle:hover, .routine-delete:hover { background: rgba(128,128,128,.12); color: var(--text); }
.routine-delete { font-size: 22px; }
.routine-history { grid-column: 1 / -1; border-top: 1px solid rgba(128,128,128,.2); padding-top: 12px; min-width: 0; }
.routines-empty { padding: 20px; margin: 0; text-align: center; color: var(--muted); font-size: 13px; line-height: 1.7; border: 1px dashed rgba(128,128,128,.3); border-radius: 8px; }
.routines-footnote { margin: 18px 0 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.routines-view :is(button, input, select):focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }
.companion-routines { flex: 1; }
.companion-tabs button { font-size: 12px; padding: 7px 10px; }
body[data-style="paper"] .routine-row, body[data-style="paper"] .routines-form :is(input, select) { border-radius: 2px; }
@media (max-width: 480px) {
  .routines-modal { padding: 10px; }
  .routines-view { padding: 16px; }
  .routines-form { grid-template-columns: 1fr; gap: 12px; }
  .routine-form-actions { justify-content: flex-start; }
  .routine-row { gap: 6px; padding: 10px; }
}
