/* Daily's approved routine cards and editor; shell layout stays with Daily. */
.daily-routine-workspace,.daily-routine-dialog{font:12px/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;color:#172033;min-width:0}
.daily-routine-workspace *,.daily-routine-dialog *{box-sizing:border-box}
.daily-routine-workspace [hidden],.daily-routine-dialog [hidden]{display:none!important}
.daily-routine-workspace button,.daily-routine-dialog button{font:inherit;cursor:pointer;touch-action:manipulation}
.daily-routine-workspace button:disabled,.daily-routine-dialog button:disabled{opacity:.4;cursor:default}
.daily-routine-workspace :focus-visible,.daily-routine-dialog :focus-visible{outline:2px solid #5576dd;outline-offset:2px}
.dv-problem-pane-content:has(.daily-routine-workspace),.dv-daily-record-context-panel:has(.daily-routine-workspace){padding:0!important}
.daily-routine-workspace>[role=tabpanel]:not(.rp-routines){padding:12px}
.daily-routine-workspace .rp-routines{padding-bottom:14px}
.rp-workspace-state{padding:20px 12px;color:#64748b}
.rp-workspace-state button{display:block;margin:10px 0;border:1px solid #cbd5e1;border-radius:5px;padding:7px 12px;background:white}
/* Use the same compact white headers / slate body as ImprovementWorkspace. */
.rp-panel-tabs{position:sticky;top:0;display:grid;grid-template-columns:1fr 1fr;gap:5px;background:#fff;z-index:4;border-bottom:1px solid #e2e8f0;padding:10px 12px 8px}
.rp-panel-tabs button{min-height:34px;border:0;border-radius:6px;background:transparent;color:#64748b;font-size:12px;font-weight:600;display:flex;align-items:center;justify-content:center;gap:4px}
.rp-panel-tabs button[aria-selected=true]{color:#2c3e50;background:#f1f5f9}
.rp-panel-tabs small{font-size:10px;font-weight:400;padding:2px 5px;background:#f1f5f9;border-radius:10px}
.rp-routines,.rp-problems{padding:10px 12px 90px;color:#172033;font:12px/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif}
.rp-routine-summary{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:10px}
.rp-routine-summary strong{font-size:12px;font-weight:600;color:#2c3e50}
.rp-routine-summary small{display:block;font-size:10px;color:#64748b;margin-top:2px}
:is(.daily-routine-workspace,.daily-routine-dialog) .rp-routine-summary>button{border:1px solid #cbd5e1;background:white;color:#64748b;border-radius:5px;min-height:28px;padding:4px 7px;font-size:10px;white-space:nowrap}
.rp-routine-card{position:relative;border:1px solid #e2e8f0;border-radius:8px;padding:0;margin:0 0 8px;background:#f8fafc;min-width:0;overflow:hidden}
.rp-routine-card.is-open{border-color:#e2e8f0}
.rp-routine-head{position:relative;display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:40px;padding:5px 10px 5px 14px;border-bottom:1px solid #e2e8f0;background:#fff}
.rp-routine-heading{display:flex;align-items:center;flex-wrap:wrap;gap:2px 10px;min-width:0;flex:1}
.rp-routine-heading>strong{display:flex;align-items:center;font-size:12px;font-weight:600;color:#172033;min-width:0;overflow-wrap:anywhere}
.rp-routine-head i{position:absolute;left:0;top:10px;display:block;width:3px;height:18px;border-radius:0 3px 3px 0}
:is(.daily-routine-workspace,.daily-routine-dialog) .rp-check{display:flex;align-items:center;justify-content:center;gap:5px;min-height:28px;padding:4px 7px;white-space:nowrap;border:1px solid #cbd5e1;background:white;border-radius:5px;color:#64748b;font-size:10px!important;flex-shrink:0}
:is(.daily-routine-workspace,.daily-routine-dialog) .rp-check.is-done{color:#fff;background:#15803d;border-color:#15803d;font-weight:600}
.rp-routine-actions{display:flex;align-items:center;gap:10px;flex-shrink:0}
.rp-routine-actions .rp-streak{font-size:9px;white-space:nowrap}
.rp-streak{display:inline-flex;align-items:center;gap:3px;color:#475569}
.rp-streak .rr-detail-streak-badge.dv-routine-streak-badge{position:static;margin:0;flex-shrink:0}
.rp-streak .dv-routine-streak-badge:not(.is-fire):not(.is-inferno){display:inline-grid;place-items:center;min-width:18px;height:18px;padding:0 4px;border:0;box-shadow:none;font-family:Arial,sans-serif;font-size:9px;line-height:1;font-variant-numeric:tabular-nums;text-align:center}
:is(.daily-routine-workspace,.daily-routine-dialog) .rp-disclosure{display:flex;align-items:center;justify-content:space-between;width:calc(100% - 20px);margin:0 10px;border:0;background:transparent;border-radius:4px;padding:4px 0;color:#64748b;font-size:10px!important;min-height:25px}
.rp-stack{list-style:none;margin:0 12px;padding:0 0 6px;display:flex;flex-direction:column;gap:0}
.rp-stack li{display:flex;gap:8px;align-items:center;position:relative;padding:6px 0}
.rp-stack li+li:before{content:"";position:absolute;top:-6px;left:10px;height:12px;border-left:1px solid #e2e8f0}
.rp-stack li>span{display:grid;place-items:center;min-width:22px;height:22px;border:1px solid #e2e8f0;border-radius:5px;font-size:9px;color:#64748b;background:white;z-index:1}
.rp-stack li strong{display:block;font-size:11px;line-height:16px;font-weight:500;color:#334155}
.rp-stack li small{display:inline-block;font-size:9px;color:#64748b;line-height:14px;background:#eef2f6;border-radius:3px;padding:0 4px}
.rp-week{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:4px;margin:4px 10px 10px}
.rp-week button{border:0;background:none;padding:0;display:flex;flex-direction:column;align-items:center;gap:4px;min-width:0}
.rp-week small{font-size:9px;color:#64748b}
.rp-week span{display:grid;place-items:center;width:100%;height:26px;border:1px solid #e2e8f0;border-radius:5px;font-size:10px;color:#64748b;background:#fff}
.rp-week .is-done span{background:#15803d;border-color:#15803d;color:#fff;font-weight:600}
.rp-week .is-today span{outline:2px solid #3b82f6;outline-offset:1px;font-weight:600}
.rp-month-nav{display:flex;align-items:center;justify-content:center;gap:10px;margin:8px 0 12px}
.rp-month-nav strong{font-size:12px;min-width:100px;text-align:center}
.rp-month-nav button{border:1px solid #cbd5e1;background:#fff;min-width:28px;min-height:28px;border-radius:5px;font-size:18px;line-height:1}
.rp-month-calendar{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:4px;margin:10px}
.rp-month-calendar>small{text-align:center;font-size:9px;color:#64748b;padding:0 0 3px}
:is(.daily-routine-workspace,.daily-routine-dialog) .rp-month-calendar button{height:28px;padding:0;border:1px solid #e2e8f0;background:#fff;color:#64748b;border-radius:5px;font-size:10px;min-width:0}
:is(.daily-routine-workspace,.daily-routine-dialog) .rp-month-calendar button.is-done{background:#15803d;border-color:#15803d;color:#fff;font-weight:600}
:is(.daily-routine-workspace,.daily-routine-dialog) .rp-month-calendar button.is-today{outline:2px solid #3b82f6;outline-offset:1px;font-weight:600}
:is(.daily-routine-workspace,.daily-routine-dialog) .rp-month-calendar button.is-today:not(.is-done){color:#1d4ed8}
:is(.daily-routine-workspace,.daily-routine-dialog) .rr-table-check.is-completed{background:#15803d;border-color:#15803d;color:#fff}
.rp-month-calendar button:disabled{opacity:.4;cursor:default}
.rp-routine-card details{border-top:1px solid #e2e8f0}
.rp-routine-card summary{cursor:pointer;font-size:10px;color:#64748b;padding:7px 10px;background:#fff}
.rp-stack-toolbar{display:flex;align-items:center;gap:8px;padding:0 10px;min-height:28px}
.rp-habit-details{position:relative}
.rp-habit-details>details>summary{display:flex;align-items:center;justify-content:flex-start;gap:5px;min-height:30px;padding-right:90px;list-style:none;border-radius:5px}
.rp-habit-details>details>summary::-webkit-details-marker{display:none}
.rp-chevron{display:block;width:14px;height:14px;flex:0 0 14px;pointer-events:none}
.rp-disclosure[aria-expanded=true] .rp-chevron,.rp-habit-details>details[open]>summary .rp-chevron{transform:rotate(180deg)}
:is(.daily-routine-workspace,.daily-routine-dialog) :is(.rp-disclosure,.rp-habit-details>details>summary):focus-visible{outline:2px solid #5576dd;outline-offset:-2px}
.rp-habit-details>.rp-edit-habits{position:absolute;top:0;right:10px}
:is(.daily-routine-workspace,.daily-routine-dialog) .rp-stack-toolbar .rp-disclosure{width:auto;margin:0;flex:1;justify-content:flex-start;gap:5px}
:is(.daily-routine-workspace,.daily-routine-dialog) .rp-edit-habits{border:0;border-radius:4px;background:transparent;color:#64748b;font-size:10px;padding:4px 3px;min-height:28px;white-space:nowrap}
:is(.daily-routine-workspace,.daily-routine-dialog) .rp-edit-habits:hover{background:#e2e8f0;color:#2c3e50}
.rp-habit-editor{width:520px;max-width:calc(100vw - 24px);max-height:none;padding:0;border:1px solid #e2e8f0;border-radius:16px;background:#fff;color:#172033;font:12px/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;overflow:hidden;box-shadow:0 24px 80px #0f172a26}
.rp-habit-editor:focus{outline:none}
.rp-habit-editor::backdrop{background:#0f172a66}
.rp-habit-form{display:flex;flex-direction:column;max-height:90dvh;margin:0}
.rp-habit-form>header{display:flex;align-items:center;justify-content:space-between;padding:23px 24px 18px;flex-shrink:0}
.rp-habit-form h2{font-size:20px;font-weight:650;letter-spacing:-.5px;margin:6px 0 0}
.rp-habit-form small{display:flex;align-items:center;gap:6px;font-size:11px;color:#64748b}
.rp-habit-form small i{width:7px;height:7px;border-radius:50%}
.rp-habit-editor button{min-height:32px;border:1px solid #cbd5e1;border-radius:5px;background:white;padding:5px 10px;font:inherit;color:#475569}
.rp-habit-editor button:disabled{opacity:.35;cursor:default}
.rp-habit-editor button:enabled:hover{background:#f1f5f9}
.rp-habit-form>header>button{font-size:20px;min-width:34px;border:0;background:#f1f5f9;border-radius:50%}
.rp-habit-editor-body{padding:0 24px 24px;flex:1;min-height:0;overflow:auto;background:#fff}
.rp-editor-notice{font-size:10px;color:#94a3b8;margin:0 0 18px}
.rp-editor-warning{font-size:11px;color:#92400e;background:#fffbeb;border:0;border-left:2px solid #fcd34d;border-radius:4px;padding:7px 10px;margin:0 0 14px}
.rp-habit-fields{list-style:none;padding:0;margin:0;display:grid;gap:14px}
.rp-habit-fields>li{position:relative;display:grid;grid-template-columns:28px minmax(0,1fr) 28px;align-items:start;gap:10px;border:1px solid #edf0f4;border-radius:12px;background:#fafbfc;padding:14px 10px;min-width:0}
.rp-habit-fields>li:focus-within{border-color:#cbd5e1;background:#fff;box-shadow:0 2px 8px #0f172a06}
.rp-habit-fields>li:not(:last-child)::after{content:"";position:absolute;top:100%;left:24px;height:16px;border-left:1px dashed #cbd5e1}
.rp-habit-number{display:grid;place-items:center;width:28px;height:28px;border:1px solid #e2e8f0;border-radius:50%;background:white;color:#64748b;font-size:10px;margin-top:2px}
.rp-habit-content{min-width:0}
.rp-habit-menu{position:relative}
.rp-habit-menu[open]{z-index:2}
.rp-habit-menu summary{display:grid;place-items:center;list-style:none;width:28px;min-height:30px;cursor:pointer;border-radius:6px;color:#94a3b8;font-size:20px;line-height:1}
.rp-habit-menu summary::-webkit-details-marker{display:none}
.rp-habit-menu summary:hover,.rp-habit-menu[open] summary{background:#e2e8f0;color:#475569}
.rp-habit-menu>div{position:absolute;top:34px;right:0;min-width:160px;max-width:calc(100vw - 70px);padding:5px;border:1px solid #e2e8f0;border-radius:9px;background:white;box-shadow:0 8px 28px #0f172a1f}
.rp-habit-menu>div>button{display:block;text-align:left;width:100%;border:0;white-space:normal}
.rp-habit-editor .rp-habit-delete{color:#b91c1c}
.rp-habit-fields input{display:block;width:100%;min-height:32px;border:1px solid transparent;border-radius:5px;padding:3px 4px;background:transparent;color:#172033;font:600 14px/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;letter-spacing:-.2px}
.rp-habit-fields input:hover{border-color:#e2e8f0;background:#fff}
.rp-habit-fields input:focus-visible{outline:2px solid #94a3b8;outline-offset:1px;background:#fff}
.rp-habit-fields input::placeholder{color:#94a3b8;font-weight:400}
.rp-habit-status{display:flex;flex-wrap:wrap;align-items:center;gap:4px;margin:5px 0 0}
.rp-habit-editor .rp-habit-status button{border:1px solid transparent;border-radius:20px;min-height:26px;font-size:10px;padding:3px 7px;background:transparent;color:#94a3b8;white-space:normal;text-align:left}
.rp-habit-editor .rp-habit-status button[data-habit-status=core][aria-pressed=true]{color:#397456;background:#edf5ef;border-color:#deebe1}
.rp-habit-editor .rp-habit-status button[data-habit-status=building][aria-pressed=true]{color:#a5672a;background:#fff5e8;border-color:#f5e4cd}
.rp-habit-editor .rp-habit-add{display:flex;align-items:center;justify-content:center;gap:8px;width:100%;min-height:42px;margin-top:14px;border:1px dashed #d4dde5;border-radius:10px;background:white;color:#64748b}
.rp-habit-add>span{font-size:20px;font-weight:300;color:#64748b}
.rp-habit-form>footer{display:flex;justify-content:flex-end;gap:8px;padding:14px 24px;border-top:1px solid #f1f5f9;background:white;flex-shrink:0}
.rp-habit-editor .rp-habit-save{background:#2c3e50;border-color:#2c3e50;color:white;min-width:80px}
.rp-habit-editor .rp-habit-save:hover{background:#34495e}
:is(.daily-routine-workspace,.daily-routine-dialog) .rp-check:hover,:is(.daily-routine-workspace,.daily-routine-dialog) .rp-routine-summary>button:hover,:is(.daily-routine-workspace,.daily-routine-dialog) .rp-month-nav button:hover,:is(.daily-routine-workspace,.daily-routine-dialog) .rp-disclosure:hover{background:#f1f5f9;color:#2c3e50}
:is(.daily-routine-workspace,.daily-routine-dialog) .rp-check.is-done:hover{background:#166534;border-color:#166534;color:#fff}
.rp-week button:hover span,:is(.daily-routine-workspace,.daily-routine-dialog) .rp-month-calendar button:enabled:hover{border-color:#94a3b8}
.rp-week .is-done:hover span,:is(.daily-routine-workspace,.daily-routine-dialog) .rp-month-calendar button.is-done:enabled:hover{background:#166534;border-color:#166534;color:#fff}
.rp-expanded{padding:0;border:1px solid #e2e8f0;border-radius:10px;width:min(1500px,96vw);height:min(950px,92dvh);max-width:none;max-height:none;background:#f8fafc;color:#172033;overflow:hidden;font:13px/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif}
.rp-expanded[open]{display:flex;flex-direction:column}
.rp-expanded:focus{outline:none}
.rp-expanded::backdrop{background:#20364bc2;backdrop-filter:blur(3px)}
.rp-expanded-head{display:flex;align-items:center;justify-content:space-between;gap:15px;padding:21px 25px;background:white;border-bottom:1px solid #dfe7f0;flex-shrink:0}
.rp-expanded-head h2{font-size:21px;margin:4px 0 0}
.rp-expanded-head small{font-size:10px;color:#8c9fb3}
.rp-expanded-head>button{display:grid;place-items:center;flex:0 0 36px;width:36px;height:36px;min-height:36px;border:0;border-radius:8px;padding:0;background:transparent;color:#64748b}
.rp-expanded-head>button:hover{background:#f1f5f9;color:#2c3e50}
.rp-expanded-head>button svg{display:block;width:20px;height:20px;pointer-events:none}
.rp-month-nav .rp-month-prev .rp-chevron{transform:rotate(90deg)}
.rp-month-nav .rp-month-next .rp-chevron{transform:rotate(-90deg)}
.rp-month-nav button{display:grid;place-items:center;padding:0}
.rp-expanded-tools{display:flex;align-items:center;justify-content:space-between;padding:10px 25px;border-bottom:1px solid #e4ebf3;flex-shrink:0}
.rp-expanded-tools .rp-month-nav{margin:0}
.rp-view-toggle{display:flex;gap:3px;background:#e9eff7;border:1px solid #dbe4ee;border-radius:8px;padding:3px}
.rp-view-toggle button{border:0;background:none;border-radius:6px;padding:8px 14px;font-size:11px;min-height:34px}
.rp-view-toggle button[aria-pressed=true]{background:white;color:#355b92}
.rp-expanded-body{flex:1;min-height:0;overflow:auto;padding:25px}
.rp-expanded-cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(230px,1fr));gap:14px;align-items:start}
.rp-expanded-cards .rp-routine-card{margin:0}
.rp-expanded-cards .rp-month-calendar button{height:34px}
.rp-expanded-metrics{display:flex;gap:35px;margin:12px}
.rp-expanded-metrics b{display:block;font-size:17px;font-weight:500}
.rp-expanded-metrics small{display:block;font-size:10px;color:#8ba1b7;margin-top:3px}

@media(max-width:800px){
 .rp-panel-tabs{padding:8px 12px}
 .rp-panel-tabs button{min-height:40px;font-size:12px}
 .rp-routines,.rp-problems{padding:10px 12px 90px}
 .rp-routine-summary strong{font-size:12px}
 :is(.daily-routine-workspace,.daily-routine-dialog) .rp-routine-summary>button{min-height:36px;font-size:11px;padding:6px 9px}
 .rp-routine-card{padding:0;margin-bottom:8px}
 .rp-routine-head{min-height:48px}
 .rp-routine-heading>strong{font-size:13px}
 .rp-routine-head i{top:15px}
 :is(.daily-routine-workspace,.daily-routine-dialog) .rp-check{min-height:36px;font-size:11px!important;padding:6px 9px}
 :is(.daily-routine-workspace,.daily-routine-dialog) .rp-disclosure{font-size:11px!important;min-height:32px}
 :is(.daily-routine-workspace,.daily-routine-dialog) .rp-edit-habits{min-height:36px}
 .rp-habit-details>details>summary{min-height:36px;padding-top:10px;padding-bottom:10px}
 .rp-habit-editor{width:100vw;max-width:none;height:100dvh;margin:0;border:0;border-radius:0}
 .rp-habit-form{height:100%;max-height:none}
 .rp-habit-form>header{padding:16px}
 .rp-habit-editor-body{padding:14px}
 .rp-habit-editor button{min-height:40px}
 .rp-habit-fields input{font-size:16px;min-height:38px}
 .rp-habit-fields>li{gap:8px;padding:12px 10px}
 .rp-habit-menu summary{min-height:40px}
 .rp-habit-menu>div{top:42px}
 .rp-habit-editor .rp-habit-status button{min-height:34px;padding:5px 7px}
 .rp-habit-form>footer{padding:12px 16px max(12px,env(safe-area-inset-bottom))}
 .rp-stack li{padding:7px 0}
 .rp-stack li strong{font-size:12px}
 .rp-stack li small{font-size:10px}
 .rp-week span{height:32px;font-size:11px}
 .rp-week small{font-size:10px}
 :is(.daily-routine-workspace,.daily-routine-dialog) .rp-month-calendar button{height:36px;font-size:11px}
 .rp-expanded{width:100vw;height:100dvh;margin:0;border:0;border-radius:0}
 .rp-expanded-head{padding:16px;gap:8px}
 .rp-expanded-head h2{font-size:19px}
 .rp-expanded-head>button{flex-basis:44px;width:44px;height:44px;min-height:44px;padding:0}
 .rp-expanded-tools{padding:12px 14px;gap:8px;justify-content:center}
 .rp-expanded-tools .rp-month-nav{gap:7px}
 .rp-month-nav strong{font-size:12px;min-width:90px}
 .rp-view-toggle button{padding:6px 9px;font-size:10px}
 .rp-expanded-body{padding:14px 14px max(20px,env(safe-area-inset-bottom))}
 .rp-expanded-cards{grid-template-columns:1fr;gap:14px}
 :is(.daily-routine-workspace,.daily-routine-dialog) .rp-expanded-cards .rp-month-calendar button{height:40px;font-size:12px}
 .daily-routine-workspace .rp-routines{padding-bottom:16px}
}
/* Phones use the same four workflow controls, one pane at a time. */
@media(max-width:767px){
 .purpose-shell:has(.daily-routine-workspace){height:100%;min-height:0}
 .dv-wrapper:has(.daily-routine-workspace){height:100%;min-height:0;overflow:hidden}
 .dv-wrapper:has(.daily-routine-workspace) .dv-tablet-workflow-tabs{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:4px;padding:5px 8px;margin:0;height:50px;flex:0 0 50px;background:white;border-bottom:1px solid #e2e8f0}
 .dv-wrapper:has(.daily-routine-workspace) .dv-tablet-workflow-tab{display:flex;align-items:center;justify-content:center;gap:5px;border:0;border-radius:5px;background:white;color:#64748b;font:12px/1.4 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}
 .dv-wrapper:has(.daily-routine-workspace) .dv-tablet-workflow-tab[aria-selected=true]{background:#f1f5f9;color:#2c3e50}
 .dv-wrapper:has(.daily-routine-workspace) .dv-tablet-workflow-tab__description{display:none}
 .dv-wrapper:has(.daily-routine-workspace) .dv-tablet-workflow-tab__number{font-size:9px}
 .dv-wrapper:has(.daily-routine-workspace) .dv-page-container{display:block;flex:1;min-height:0;min-width:0;width:100%;padding:0;margin:0;overflow:hidden}
 .dv-wrapper:has(.daily-routine-workspace) .dv-page-container>div{display:none!important;position:relative;inset:auto;min-width:0;min-height:0;max-width:none;width:100%;height:100%;border:0;border-radius:0;margin:0;transform:none}
 .dv-wrapper.dv-tablet-step-plan:has(.daily-routine-workspace) .dv-left-pane,
 .dv-wrapper.dv-tablet-step-track:has(.daily-routine-workspace) .dv-center-pane,
 .dv-wrapper.dv-tablet-step-fix:has(.daily-routine-workspace) .dv-problem-pane,
 .dv-wrapper.dv-tablet-step-review:has(.daily-routine-workspace) .dv-right-pane{display:flex!important}
 .dv-wrapper:has(.daily-routine-workspace) .dv-workflow-step{display:none}
 .dv-wrapper:has(.daily-routine-workspace) .dv-problem-pane-content{flex:1;min-height:0;overflow:auto}
 .dv-wrapper:has(.daily-routine-workspace) #daily-task-context-panel{min-width:0;width:100%;max-width:none;box-sizing:border-box}
}
