.starter-pack{grid-column:1/-1;margin-bottom:16px}
.starter-pack.complete{border-color:color-mix(in srgb,var(--accent) 35%,var(--border))}
.starter-list{display:grid;gap:8px;padding:0 16px 16px}
.starter-row{display:grid;grid-template-columns:28px 1fr auto;align-items:center;gap:10px;width:100%;border:1px solid var(--border);border-radius:12px;background:var(--surface);color:var(--text);padding:12px 14px;text-align:left;cursor:pointer}
.starter-row:hover{border-color:var(--accent);background:var(--accent-soft)}
.starter-row.done{opacity:.72}
.starter-check{font-size:20px;color:var(--accent)}
.starter-arrow{font-size:22px;color:var(--muted)}

.habit-card{overflow:hidden}
.habit-card select,.habit-card input,.habit-card textarea{width:100%}
.habit-card textarea{resize:vertical}
.habit-tabs{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:3px;margin-bottom:14px;padding:3px;border:1px solid var(--border);border-radius:10px;background:var(--surface-2)}
.habit-tabs button{min-height:34px;padding:6px 12px;border:0;border-radius:7px;background:transparent;color:var(--muted);font:inherit;font-size:13px;font-weight:650;cursor:pointer;transition:background .16s ease,color .16s ease,box-shadow .16s ease}
.habit-tabs button:hover{color:var(--text)}
.habit-tabs button.active{background:var(--surface-solid);color:var(--text);box-shadow:0 1px 4px rgb(0 0 0 / 8%)}
.habit-tabs button:focus-visible{outline:2px solid color-mix(in srgb,var(--accent) 45%,transparent);outline-offset:1px}

.habit-dashboard{display:grid;gap:14px;min-width:0}
.habit-dashboard-title{display:flex;align-items:flex-start;justify-content:space-between;gap:14px}
.habit-dashboard-title h3{margin:2px 0 3px;font-size:18px;line-height:1.25}
.habit-meta-line{margin:0;color:var(--accent);font-size:11px;font-weight:700;letter-spacing:.06em;text-transform:uppercase}
.habit-schedule-summary{display:block;font-size:12px}
.habit-lead{margin:0;line-height:1.5}
.habit-back-link{justify-self:start;padding:0;border:0;background:transparent;color:var(--muted);font:inherit;cursor:pointer}
.habit-back-link:hover{color:var(--text)}

.habit-progress{display:grid;gap:8px}
.habit-progress-bar{height:8px;border-radius:999px;background:var(--surface);border:1px solid var(--border);overflow:hidden}
.habit-progress-bar>span{display:block;height:100%;background:var(--accent);border-radius:inherit}
.habit-lifetime-stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.habit-lifetime-stats>div{display:grid;gap:2px;padding:10px 12px;border-radius:10px;background:var(--surface-2)}
.habit-lifetime-stats strong{font-size:18px;line-height:1.1}
.habit-lifetime-stats span{font-size:11px;color:var(--muted)}
.habit-today-note{display:grid;gap:6px}
.habit-today-note textarea{min-height:64px;max-height:140px}
.habit-checkin-row{display:flex;align-items:center;gap:12px;flex-wrap:wrap}
.habit-checkin-row .button{width:auto;min-width:160px}
.habit-paused-note{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:11px 12px;border-radius:10px;background:var(--surface-2);color:var(--muted);font-size:13px}
.habit-achievements{display:grid;gap:8px;margin-top:2px}
.habit-achievements>div{display:flex;flex-wrap:wrap;gap:8px}
.habit-achievement{display:inline-flex;align-items:center;gap:5px;border:1px solid var(--border);border-radius:999px;padding:6px 9px;font-size:12px;background:var(--surface)}
.habit-recent-notes{display:grid;gap:7px;padding-top:2px}
.habit-note-row{display:grid;grid-template-columns:86px minmax(0,1fr);gap:10px;font-size:12px;line-height:1.4}
.habit-note-row time{color:var(--muted);font-variant-numeric:tabular-nums}

.habit-start-simple{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px 14px}
.habit-start-simple .habit-new-actions{grid-column:1/-1}
.habit-new-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.habit-new-actions .button.primary{width:auto;min-width:170px}
.habit-replace-copy{margin:0;line-height:1.55;color:var(--muted)}

.habit-plan-form{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px 14px}
.habit-plan-form .span-2{grid-column:1/-1}
.habit-plan-days{grid-column:1/-1;margin:0;padding:0;border:0}
.habit-plan-days legend{margin-bottom:7px;font-size:12px;font-weight:650;color:var(--muted)}
.habit-plan-days>div{display:flex;gap:6px;flex-wrap:wrap}
.habit-day-toggle{position:relative}
.habit-day-toggle input{position:absolute;opacity:0;pointer-events:none}
.habit-day-toggle span{display:grid;place-items:center;min-width:36px;height:34px;padding:0 8px;border:1px solid var(--border);border-radius:9px;background:var(--surface);font-size:12px;cursor:pointer;transition:.16s ease}
.habit-day-toggle input:checked+span{border-color:color-mix(in srgb,var(--accent) 55%,var(--border));background:var(--accent-soft);color:var(--accent);font-weight:700}
.habit-day-toggle input:focus-visible+span{outline:2px solid color-mix(in srgb,var(--accent) 40%,transparent);outline-offset:2px}
.habit-plan-save{display:flex;justify-content:flex-end}
.habit-plan-save .button{width:auto;min-width:150px}
.habit-lifecycle-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap;padding-top:4px;border-top:1px solid var(--border)}
.habit-lifecycle-actions .button{width:auto}
.danger-text{color:var(--danger)!important}

/* Dashboard: tasks and habits share one work surface. */
.dashboard-focus-card .card-header{gap:12px;align-items:center}
.dashboard-focus-tabs{display:inline-flex;min-width:0;max-width:100%;padding:3px}
.dashboard-focus-tabs button{min-height:32px;padding:5px 11px;white-space:nowrap;font-size:13px}
.dashboard-focus-card>.table-wrap{min-height:0}
.dashboard-habit-table{width:100%;table-layout:fixed}
.dashboard-habit-table th:first-child,.dashboard-habit-table td:first-child{width:58px}
.dashboard-habit-table th:last-child,.dashboard-habit-table td:last-child{width:245px}
.dashboard-habit-row td{vertical-align:middle}
.dashboard-habit-row .task-description{margin-top:3px;color:var(--muted);font-size:12px}
.dashboard-habit-row .check-button[disabled]{cursor:default;opacity:1}
.dashboard-habit-meta{display:flex;align-items:center;justify-content:flex-end;gap:8px;min-width:0;color:var(--muted);font-size:12px;white-space:nowrap}
.dashboard-habit-meta strong{color:var(--text);font-weight:700}
.dashboard-habit-meta .badge{flex:0 0 auto}
.dashboard-habit-empty{min-height:132px}
.dashboard-habit-empty .button{margin-top:4px}

.habit-dashboard-widget{grid-column:1/-1}
.habit-dashboard-widget .card-header{align-items:center}
.habit-dashboard-widget-body{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:12px 16px 16px}
.habit-dashboard-widget-meta{display:grid;gap:3px;min-width:0}
.habit-dashboard-widget-meta strong{font-size:14px}
.habit-dashboard-widget-meta span{font-size:12px}
.habit-dashboard-widget-body .button{width:auto;white-space:nowrap}

.habit-90-achievement{display:grid;grid-template-columns:auto 1fr;gap:14px;align-items:start;margin-bottom:18px;padding:16px;border:1px solid color-mix(in srgb,var(--accent) 40%,var(--border));border-radius:14px;background:var(--accent-soft)}
.habit-90-trophy{font-size:32px;line-height:1}
.habit-90-achievement strong{display:block;font-size:16px}
.habit-90-achievement p{margin:4px 0;font-weight:700}
.habit-90-achievement span{font-size:13px;color:var(--muted);line-height:1.4}

@media(max-width:700px){
  .starter-row{grid-template-columns:24px 1fr auto;padding:11px}
  .habit-dashboard-title{display:grid}
  .habit-dashboard-title .badge{justify-self:start}
  .habit-lifetime-stats{grid-template-columns:repeat(3,1fr)}
  .habit-lifetime-stats>div{padding:9px}
  .habit-lifetime-stats strong{font-size:16px}
  .habit-start-simple,.habit-plan-form{grid-template-columns:1fr}
  .habit-start-simple .habit-new-actions,.habit-plan-form .span-2,.habit-plan-days{grid-column:1}
  .habit-plan-save{justify-content:stretch}
  .habit-plan-save .button{width:100%}
  .habit-checkin-row{display:grid;grid-template-columns:1fr}
  .habit-checkin-row .button{width:100%}
  .habit-paused-note{align-items:flex-start;flex-direction:column}
  .habit-dashboard-widget-body{align-items:stretch;flex-direction:column}
  .habit-dashboard-widget-body .button{width:100%}
  .habit-note-row{grid-template-columns:1fr;gap:2px}
  .habit-lifecycle-actions{display:grid;grid-template-columns:1fr}
  .habit-lifecycle-actions .button{width:100%}
  .habit-90-achievement{grid-template-columns:1fr}
  .habit-90-trophy{font-size:28px}
  .dashboard-focus-card .card-header{align-items:stretch;flex-direction:column}
  .dashboard-focus-tabs{width:100%;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,.72fr)}
  .dashboard-focus-tabs button{white-space:normal}
  .dashboard-focus-card [data-dashboard-focus-all]{align-self:flex-end}
  .dashboard-habit-table th:last-child,.dashboard-habit-table td:last-child{width:150px}
  .dashboard-habit-meta{align-items:flex-end;flex-direction:column;gap:3px;white-space:normal}
}
