/* Functional habits inherit the shared blue, black and light theme tokens. */
.habit-page-toolbar { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:22px; flex-wrap:wrap; }
.habit-stats { display:grid; grid-template-columns:1fr 1fr; gap:16px; margin-top:24px; }
.habit-stat strong { display:block; font-family:var(--display); color:var(--accent); font-size:32px; line-height:1.25; margin:10px 0 7px; }
.habit-stat p { font-size:12px; }
.habit-stat>span:not(.eyebrow), .habit-stat small { display:block; color:var(--muted); font-size:11px; margin-top:7px; }
.habit-stat-note { font-size:11px; color:var(--muted); margin:14px 2px 0; line-height:1.7; }
.habit-error { background:var(--accent-soft); border:1px solid var(--accent); border-radius:10px; padding:12px 15px; font-size:12px; margin:12px 0; overflow-wrap:anywhere; }
.habit-error[hidden], .habit-editor-fields[hidden] { display:none; }
.habit-date-panel { margin-bottom:18px; }
.habit-date-navigation { display:flex; align-items:flex-end; gap:10px; margin-bottom:22px; }
.habit-date-navigation>div { flex:1; max-width:250px; min-width:0; }
.habit-date-navigation .field-label { font-size:11px; margin-bottom:6px; }
.habit-date-navigation input { min-width:0; max-width:100%; }
.habit-date-navigation .icon-button { flex-shrink:0; font-size:22px; height:46px; }
.habit-functional-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; }
.habit-functional-card h2 { font-size:19px; overflow-wrap:anywhere; }
.habit-card-heading { display:flex; justify-content:space-between; align-items:center; margin-bottom:10px; gap:10px; }
.habit-card-heading .habit-symbol { margin:0; display:block; padding:10px; border-radius:12px; background:var(--accent-soft); }
.habit-card-meta { color:var(--muted); font-size:11px; margin:7px 0 19px; overflow-wrap:anywhere; }
.habit-complete { border-color:var(--accent)!important; background:var(--accent-soft)!important; }
.habit-quantity-form { padding:11px 0; border-bottom:1px solid var(--line); }
.habit-functional-card .habit-quantity-form { padding:0; border:0; }
.habit-quantity-form .form-helper { display:block; }
.habit-quantity-controls { display:flex; align-items:center; gap:8px; }
.habit-quantity-controls input { min-width:0; flex:1; }
.habit-quantity-controls .button { flex-shrink:0; }
.habit-empty { grid-column:1/-1; text-align:center; padding:35px 22px!important; }
.habit-empty .habit-symbol { display:flex; justify-content:center; }
.habit-empty p { color:var(--muted); font-size:13px; margin:12px auto 20px; max-width:390px; }
.habit-management-row { display:flex; align-items:center; justify-content:space-between; gap:18px; padding:16px 0; border-bottom:1px solid var(--line); }
.habit-management-row>div:first-child { min-width:0; }
.habit-management-row h3 { overflow-wrap:anywhere; }
.habit-management-row p { font-size:11px; color:var(--muted); margin-top:4px; overflow-wrap:anywhere; }
.habit-management-actions { display:flex; align-items:center; gap:8px; flex-shrink:0; }
.habit-backup { margin-top:18px; }
.habit-backup>div>p { color:var(--muted); margin:8px 0 16px; font-size:12px; }
.habit-backup-actions { display:flex; gap:9px; flex-wrap:wrap; }
.habit-history { margin-bottom:18px; }
.habit-week { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); gap:8px; }
.habit-week-day { border:1px solid var(--line); border-radius:12px; background:var(--bg); color:var(--ink); min-width:0; padding:12px 2px; display:flex; align-items:center; flex-direction:column; gap:5px; }
.habit-week-day>span { font-size:11px; color:var(--muted); }
.habit-week-day strong { font-size:19px; font-weight:500; }
.habit-week-day small { font-size:10px; color:var(--accent); }
.habit-month-label { color:var(--muted); font-size:11px; width:180px; max-width:50%; }
.habit-month-label input { margin-top:5px; padding-left:9px; padding-right:9px; }
.habit-calendar { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); gap:8px; }
.habit-calendar-label { color:var(--muted); text-align:center; font-size:11px; margin:8px 0; }
.habit-calendar-day { display:flex; align-items:center; flex-direction:column; gap:8px; padding:14px 3px 10px; border:1px solid var(--line); border-radius:10px; background:var(--bg); min-width:0; }
.habit-calendar-day strong { font-size:15px; font-weight:500; }
.habit-calendar-day span { font-size:10px; color:var(--muted); }
.habit-calendar-day.habit-partial { border-bottom:3px solid var(--accent); }
.habit-is-today strong { color:var(--accent); font-weight:750; }
.habit-dialog { width:560px; max-height:calc(100dvh - 32px); overflow-y:auto; }
.habit-dialog-heading { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.habit-dialog-heading h2 { margin:0; }
.habit-dialog-heading .icon-button { font-size:24px; }
.habit-editor-intro { margin:7px 0 24px; }
.habit-editor-fields { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:18px 14px; }
.habit-field-full { grid-column:1/-1; }
.habit-days { border:0; margin:0; padding:0; min-width:0; }
.habit-days-options { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); gap:7px; }
.habit-days-options label { position:relative; min-width:0; cursor:pointer; }
.habit-days-options input { width:1px; height:1px; min-height:0; opacity:0; position:absolute; }
.habit-days-options span { display:flex; align-items:center; justify-content:center; min-height:45px; border:1px solid var(--control-border); border-radius:10px; font-size:11px; }
.habit-days-options input:checked+span { background:var(--accent-soft); color:var(--accent); border-color:var(--accent); font-weight:700; }
.habit-days-options input:focus-visible+span { outline:3px solid var(--accent); outline-offset:3px; }
.habit-days-shortcuts { display:flex; gap:18px; }
.habit-days-shortcuts .text-link { font-size:11px; }
@media(max-width:700px) {
  .habit-page-toolbar { gap:12px; }
  .habit-page-toolbar>.segmented { order:2; width:100%; }
  .habit-page-toolbar .segment { flex:1; }
  .habit-page-toolbar>.button { margin-left:auto; }
  .habit-functional-grid { grid-template-columns:1fr; gap:12px; }
  .habit-stats { gap:10px; }
  .habit-stat { padding:17px!important; }
  .habit-stat .eyebrow { font-size:9px; }
  .habit-stat strong { font-size:28px; }
  .habit-stat p { font-size:11px; }
  .habit-stat small { font-size:10px; }
  .habit-date-navigation { gap:7px; flex-wrap:wrap; }
  .habit-date-navigation>.button { padding-left:10px; padding-right:10px; }
  .habit-date-navigation .icon-button { width:38px; }
  .habit-date-panel .progress-summary { font-size:11px; gap:12px; }
  .habit-management-row { align-items:flex-start; flex-direction:column; gap:12px; }
  .habit-management-actions { width:100%; }
  .habit-management-actions .button { flex:1; }
  .habit-week, .habit-calendar { gap:5px; }
  .habit-week-day { border-radius:9px; }
  .habit-calendar-day { border-radius:8px; padding:10px 1px; }
  .habit-history>.card-header h2 { font-size:17px; }
  .habit-history>.card-header { align-items:flex-end; }
  .habit-month-label { max-width:55%; }
  .habit-month-label input { font-size:13px; min-width:0; }
  .habit-dialog { padding:21px; }
  .habit-dialog h2 { font-size:21px; }
  .habit-editor-fields { gap:15px 10px; }
  .habit-days-options { gap:5px; }
  .habit-days-options span { font-size:10px; border-radius:8px; }
  .habit-days-shortcuts { gap:20px; }
  .habit-backup-actions .button { flex:1; }
}
@media(max-width:359px) {
  .habit-dialog { padding:17px; }
  .habit-date-navigation>.button { width:100%; }
  .habit-days-options { gap:3px; }
  .habit-days-options span { font-size:9px; }
  .habit-editor-fields:not(#habit-goal-fields) { grid-template-columns:1fr; }
  .habit-stats { grid-template-columns:1fr; }
}
