/* Personal practice and smoking screens in the shared botanical palette. */
.habits-page { margin-top: 22px; min-width: 0; }
.habits-page .panel { margin-bottom: 18px; }
.habits-page h2 { margin: 0 0 10px; line-height: 1.3; }
.habits-page h3 { margin: 6px 0 10px; color: #5e3c49; font-size: 18px; line-height: 1.45; }
.habits-page p, .habits-page li { overflow-wrap: anywhere; }
.habit-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.habit-heading > div { min-width: 0; }
.habit-help { margin: 8px 0 14px; color: #765666; font-size: 13px; line-height: 1.7; }
.habit-prose { margin: 10px 0; white-space: pre-wrap; font-size: 14px; line-height: 1.7; color: #634853; }
.habit-privacy { margin: 8px 0 0; color: #766474; font-size: 12px; line-height: 1.6; }
.habit-intro { background: linear-gradient(125deg, #fff8f3, #fff1f7 65%, #f5f8f0); }
.habit-summary-strip { display: flex; flex-wrap: wrap; gap: 12px 24px; padding-top: 12px; margin: 12px 0 0; border-top: 1px solid #ead9df; }
.habit-summary-strip > span { display: grid; gap: 5px; color: #78616c; font-size: 12px; line-height: 1.5; }
.habit-summary-strip strong { color: #8e4160; font-size: 19px; line-height: 1.45; }
.habit-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; margin-top: 14px; }
.habit-actions .button { min-height: 44px; padding: 10px 14px; font-size: 13px; }
.habits-page .button[disabled], .habits-page input[disabled], .habits-page select[disabled], .habits-page textarea[disabled] { opacity: .55; cursor: not-allowed; }
.habit-form { display: grid; gap: 16px; }
.habit-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: end; }
.habit-field { display: flex; flex-direction: column; gap: 7px; min-width: 0; color: #70465a; font-size: 13px; font-weight: 700; line-height: 1.5; }
.habit-field input, .habit-field select, .habit-field textarea { box-sizing: border-box; min-width: 0; max-width: 100%; width: 100%; min-height: 46px; border: 1px solid #dfbfd0; border-radius: 12px; background: #fffdfd; color: #49353e; padding: 11px 12px; font: inherit; font-size: 16px; font-weight: 400; }
.habit-field textarea { min-height: 100px; resize: vertical; line-height: 1.7; }
.habit-field input::placeholder { color: #8a6c7b; opacity: 1; }
.habit-date-picker { width: 205px; max-width: 100%; }
.habit-category-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0 0 16px; }
.habit-category-grid button { display: grid; justify-items: start; gap: 9px; min-height: 125px; padding: 18px 20px; border: 1px solid #e7cbd6; border-radius: 18px; background: linear-gradient(145deg, #fffdf8, #fff6fa); color: #6c4253; text-align: left; box-shadow: 0 5px 18px #64394b06; }
.habit-category-grid button:nth-child(3n + 2) { background: linear-gradient(145deg, #fffdf8, #f3f7ec); }
.habit-category-grid button:nth-child(3n) { background: linear-gradient(145deg, #fffdfb, #f6f0fc); }
.habit-category-grid button[aria-pressed="true"] { border-color: #a34a70; box-shadow: inset 0 0 0 2px #a34a70; }
.habit-category-grid button > span { font-size: 27px; line-height: 1; }
.habit-category-grid button > strong { font-size: 19px; line-height: 1.25; }
.habit-category-grid button > small { font-size: 12px; color: #806674; }
.habit-filter-actions { margin: 0 0 18px; }
.habit-skill-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; margin-top: 17px; }
.habit-skill-card { min-width: 0; display: flex; flex-direction: column; padding: 19px; border: 1px solid #ead2dc; border-radius: 18px; background: #fffbfc; }
.habit-skill-card > .habit-heading { align-items: flex-start; justify-content: flex-start; gap: 10px; }
.habit-skill-card > .habit-heading > div { flex: 1 1 130px; }
.habit-skill-card small { color: #826070; font-size: 12px; font-weight: 400; }
.habit-skill-card h3 { margin: 5px 0 0; font-size: 19px; }
.habit-skill-card > .habit-actions { margin-top: auto; padding-top: 8px; }
.habit-category-icon { display: grid; place-items: center; flex: 0 0 39px; width: 39px; height: 39px; border-radius: 12px; background: #fae9f0; font-size: 24px; }
.habit-badge { display: inline-flex; align-items: center; min-height: 28px; padding: 5px 9px; border-radius: 10px; background: #f2e6f7; color: #76508a; font-size: 11px; font-weight: 700; line-height: 1.4; }
.habit-badge.is-due { color: #4e7053; background: #edf3e4; }
.habit-score-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 14px 0; margin-top: 10px; border-block: 1px solid #f0e1e8; }
.habit-score-pair > div { display: grid; gap: 8px; align-content: start; }
.habit-score-pair > div > span { color: #7c5c6d; font-size: 12px; line-height: 1.5; }
.habit-score-pair strong { color: #8d4666; font-size: 22px; line-height: 1.4; }
.habit-score-pair strong > small { font-size: 12px; }
.habit-empty { padding: 23px; border: 1px dashed #e0bfcd; border-radius: 16px; background: #fff9fc; color: #7b5a6c; font-size: 14px; line-height: 1.7; }
.habit-empty > span { font-size: 28px; }
.habit-empty h3 { margin: 7px 0; }
.habit-empty p { margin: 7px 0; }
.habit-history-list { display: grid; gap: 12px; list-style: none; padding: 0; margin: 16px 0 0; }
.habit-history-list > li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding: 15px; border: 1px solid #ecd2dc; border-radius: 14px; background: #fffafc; }
.habit-history-list > li > div:first-child { flex: 1 1 220px; min-width: 0; }
.habit-history-list strong { color: #704354; font-size: 14px; line-height: 1.6; }
.habit-history-list p { margin: 5px 0; color: #7d606e; font-size: 13px; line-height: 1.65; }
.habit-history-list .habit-actions { margin-top: 0; }
.habit-history-list > li.is-archived { background: #f9f7f7; border-style: dashed; }
.habits-page details > summary { min-height: 44px; padding: 12px 0; color: #7b455d; font-size: 13px; font-weight: 700; line-height: 1.55; cursor: pointer; }
.habit-smoking-card { background: linear-gradient(150deg, #fffefb, #fff8fc) !important; }
.habit-slider-block { padding: 12px 0 5px; }
.habit-slider-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 9px; }
.habit-slider-heading > label { color: #5d3e4c; font-size: 15px; font-weight: 700; line-height: 1.5; }
.habit-slider-heading > input[type="number"] { box-sizing: border-box; width: 80px; min-height: 44px; padding: 8px; border: 1px solid #e0c9d5; border-radius: 10px; background: #fff; color: #71425b; text-align: center; font-size: 17px; }
.habit-slider-block > input[type="range"] { display: block; box-sizing: border-box; width: 100%; min-height: 38px; margin: 0; accent-color: #9870b6; cursor: pointer; }
.habit-slider-block:nth-of-type(2) > input[type="range"] { accent-color: #75967b; }
.habit-range-labels { display: flex; justify-content: space-between; padding: 0 2px; color: #8d7382; font-size: 11px; }
.habit-grams { min-width: 0; margin: 0; padding: 14px; border: 1px solid #ebd3dc; border-radius: 15px; }
.habit-grams legend { padding: 0 8px; color: #70465b; font-size: 13px; font-weight: 700; line-height: 1.6; }
.habit-grams > div { display: flex; flex-wrap: wrap; gap: 9px; }
.habit-grams > div > .button { flex: 1; min-height: 44px; min-width: 70px; padding: 10px; background: #fffdfb; }
.habit-grams > div > .button[aria-pressed="true"] { border-color: #779b78; color: #416346; background: #edf3e6; box-shadow: inset 0 0 0 1px #779b78; }
.habit-cost-preview { padding: 17px; border: 1px solid #ecd8e1; border-radius: 16px; background: linear-gradient(135deg, #fff4f7, #f6f0fa); }
.habit-money-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.habit-money-grid > div { display: grid; gap: 9px; align-content: start; }
.habit-money-grid span { color: #79596d; font-size: 12px; line-height: 1.55; }
.habit-money-grid strong { color: #71445a; font-family: Georgia, 'Times New Roman', serif; font-size: clamp(21px, 3vw, 28px); line-height: 1.4; }
.habit-money-grid small { color: #836c78; font-size: 12px; line-height: 1.55; }
.habit-money-grid strong.habit-savings { color: #4c7554; }
.habit-cost-preview > .habit-help:last-child { margin-bottom: 0; }
.habit-triggers { display: grid; gap: 7px; padding: 18px; border: 1px solid #ecdae1; border-radius: 16px; background: linear-gradient(145deg, #fffaf3, #fffafd); }
.habit-triggers h3, .habit-triggers .habit-help { margin: 0; }
.habit-trigger-options { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 10px; }
.habit-trigger { min-height: 44px; flex: 1 1 90px; padding: 10px 11px; border: 1px solid transparent; border-radius: 12px; color: #6c495b; background: #f5eaf7; font-size: 13px; font-weight: 600; }
.habit-trigger.stress { background: #fce4e8; }
.habit-trigger.boredom { background: #edf3e6; }
.habit-trigger.habit { background: #ffeadb; }
.habit-trigger[aria-pressed="true"] { border-color: #a44c71; outline: 1px solid #a44c71; outline-offset: 1px; }
.habit-trigger > span { margin-right: 3px; font-size: 16px; }
.habit-money-link { background: linear-gradient(135deg, #fff8ed, #fbfaf4); }
.habit-money-link > div:first-child > span { float: left; margin: 0 12px 8px 0; font-size: 34px; }
.habit-working, .habit-offline, .habit-draft-status { margin: 0 0 14px; padding: 12px 14px; border: 1px solid #e1bbce; border-radius: 12px; background: #fff1f7; color: #795167; font-size: 13px; line-height: 1.65; }
.habit-working { position: sticky; top: 8px; z-index: 5; font-weight: 700; }
.habit-offline { background: #fff6e9; border-color: #dec4a5; color: #7c5b39; }
.habit-pending { background: #fff8ec !important; border-color: #dbc09c !important; }
.habit-backup { background: #fffbfc; }
.habit-backup-picker { margin-top: 20px; }
.habit-backup-picker input { font-size: 13px; }
.habit-backup-review { margin-top: 15px; padding: 16px; border: 1px solid #ddc4d0; border-radius: 14px; background: #fff5f9; }
#habit-skill-editor, #habit-session-editor, #habit-skill-history, #habit-purchase-editor, #habit-smoking-settings { scroll-margin-top: 18px; }
@media (max-width: 760px) {
  .habit-skill-grid { grid-template-columns: 1fr; }
  .habit-category-grid { gap: 10px; }
  .habit-category-grid button { padding: 16px; }
  .habit-category-grid button > strong { font-size: 17px; }
}
@media (max-width: 540px) {
  .habits-page .panel { padding: 20px 16px; }
  .habit-form-grid { grid-template-columns: 1fr; }
  .habit-heading { align-items: flex-start; }
  .habit-heading > .button, .habit-date-picker { width: 100%; }
  .habit-category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .habit-category-grid button { min-height: 117px; padding: 16px; }
  .habit-actions .primary { flex: 1 1 100%; }
  .habit-skill-card, .habit-triggers, .habit-cost-preview { padding: 14px; }
  .habit-money-grid { gap: 12px; }
  .habit-history-list > li { padding: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  .habits-page * { scroll-behavior: auto !important; }
}
