
/* Habits — daily ritual cards shared by both established app themes */
.ht-home,.ht-page{font-family:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif}
.ht-panel,.ht-sleep-reading{background:linear-gradient(145deg,rgba(255,254,249,.97),rgba(241,248,237,.97));color:#263f33;border:1px solid #e1eadb;border-radius:21px;box-shadow:0 13px 30px #1e4a3520;padding:clamp(16px,2.4vw,25px);min-width:0}
.ht-home{margin:0 0 20px}
.ht-eyebrow{color:#507c62;letter-spacing:1.55px;font-size:10px;font-weight:850;text-transform:uppercase}
.ht-toprow{display:flex;align-items:center;justify-content:space-between;gap:13px}
.ht-toprow h2{font:500 clamp(29px,3.5vw,39px)/1.12 Georgia,"Times New Roman",serif;color:#254b37;margin:7px 0}
.ht-toprow p{font-size:13px;color:#5b7663;line-height:1.5;margin:4px 0}
.ht-ring,.ht-smallring{border-radius:50%;background:conic-gradient(#4f8c67 var(--ht-p),#e2eadf var(--ht-p));display:grid;place-items:center;flex-shrink:0;padding:9px;box-shadow:0 7px 15px #28513b24}
.ht-ring{width:112px;height:112px}
.ht-ring>div,.ht-smallring>b{background:#fffdf5;border-radius:50%;width:100%;height:100%;display:flex;align-items:center;justify-content:center;flex-direction:column;color:#34634a}
.ht-ring strong{font:600 26px Georgia,serif}
.ht-ring span{font-size:10px;font-weight:700}
.ht-smallring{width:65px;height:65px;padding:6px}
.ht-smallring>b{font-size:15px}
.ht-home-actions{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin-top:18px}
.ht-compact,.ht-action{position:relative;display:flex;align-items:center;gap:10px;min-width:0;text-align:left;background:#fffefa;color:#284b39;border:1.5px solid #dbe9d9;border-radius:15px;padding:12px;box-shadow:0 3px 11px #24533a11;min-height:62px}
.ht-compact:hover,.ht-action:hover{border-color:#90c6a5}
.ht-compact.ht-done,.ht-action.ht-done{background:#e9f6e9;border-color:#8dbca0}
.ht-icon{width:34px;height:34px;display:grid;place-items:center;flex-shrink:0;border-radius:10px;background:#ecf3e5;color:#3d7754;font-size:22px}
.ht-name{min-width:0;flex:1}
.ht-name strong{display:block;font-size:13px;font-weight:760;line-height:1.35;overflow-wrap:anywhere}
.ht-name small{display:block;color:#617d6e;font-size:11px;line-height:1.45;margin-top:4px}
.ht-tick{font-size:22px;color:#6b8a72;flex:0 0 auto}
.ht-done .ht-tick{color:#217a4c}
.ht-bottom{display:flex;gap:12px;justify-content:space-between;align-items:center;margin-top:15px;flex-wrap:wrap;font-size:13px;color:#607968}
.ht-cta{background:#2b7450!important;color:#fff!important;border:1px solid #26704b!important;border-radius:12px!important;padding:11px 15px!important;font-weight:750!important;font-size:13px!important;min-height:42px!important;box-shadow:0 5px 13px #2b74503b;cursor:pointer}
.ht-cta:hover{background:#1f6543!important}
.ht-page{max-width:1100px;margin:0 auto}
.ht-hero{background:linear-gradient(110deg,#204335df,#54765cd2),var(--ht-bg,linear-gradient(140deg,#6b9c80,#183f39));background-position:center;background-size:cover;border-radius:23px;padding:clamp(22px,4vw,40px);color:#fff9ee;margin-bottom:17px;box-shadow:0 10px 25px #24462f2e}
.ht-hero .ht-eyebrow{color:#f0dcb3}
.ht-hero h2{font:500 clamp(30px,4vw,44px)/1.14 Georgia,serif;color:#fff;margin:9px 0}
.ht-hero p{max-width:550px;line-height:1.55;margin:0;color:#eef8ed}
.ht-columns{display:grid;grid-template-columns:1fr 1fr;gap:15px;align-items:start}
.ht-columns>div{display:grid;gap:15px;min-width:0}
.ht-row{display:flex;align-items:center;justify-content:space-between;gap:12px}
.ht-panel h3,.ht-sleep-reading h3{font:600 24px Georgia,serif;color:#2b5840;margin:8px 0 14px}
.ht-week{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:5px;margin:16px 0}
.ht-week button{background:#f4f8ef;border:1px solid #dbe6d7;border-radius:10px;min-height:54px;padding:6px 2px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;color:#657967;font-size:9px;text-align:center}
.ht-week button b{font-size:13px}
.ht-week button.selected{background:#2d7652;border-color:#2d7652;color:#fff}
.ht-actions{display:grid;gap:8px}
.ht-action{min-height:65px}
.ht-action .ht-name strong{font-size:14px}
.ht-sleep-entry{border-top:1px solid #e1e8de;margin-top:17px;padding-top:16px}
.ht-sleep-entry label{font-weight:700;color:#386348;font-size:13px;line-height:1.4}
.ht-sleep-entry input{max-width:130px}
.ht-muted{font-size:12px;line-height:1.55;color:#64806c;margin:12px 0}
.ht-metrics{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
.ht-metrics label,.ht-purpose{display:grid;gap:6px;color:#467057;font-size:12px;font-weight:750;line-height:1.4}
.ht-metrics .field{width:100%;min-width:0;color:#274732;background:#fff;border:1px solid #c8dfcb;border-radius:11px;padding:11px;font-weight:700;min-height:44px}
.ht-times{grid-template-columns:1fr 1fr;border-top:1px solid #e1e8de;padding-top:15px;margin-top:15px}
.ht-purpose{margin-top:14px}
.ht-purpose textarea{width:100%;min-height:90px;background:#fff;color:#284a37;border:1px solid #c8dfcb;border-radius:12px;padding:12px;resize:vertical;font-size:13px}
.ht-weight-result{display:grid;gap:4px;border-radius:13px;background:#eaf4e7;padding:12px;color:#54705e;font-size:12px;line-height:1.5;margin:13px 0}
.ht-weight-result b{color:#276745;font-size:15px}
.ht-settings{margin-top:0}
.ht-settings summary{display:flex;justify-content:space-between;cursor:pointer;font-weight:800;color:#2d6c4a;list-style:none;align-items:center}
.ht-settings summary::-webkit-details-marker{display:none}
.ht-settings-row{border-bottom:1px solid #e1e9da;padding:10px 0;display:flex;align-items:center;justify-content:space-between;gap:10px;color:#40634e;font-size:13px}
.ht-settings-row label{display:flex;align-items:center;gap:10px;cursor:pointer}
.ht-settings-row input{accent-color:#2d7a53;height:18px;width:18px}
.ht-settings-row button{border:1px solid #ead6ca;background:#fffaf3;border-radius:10px;padding:7px 9px;color:#92684d;font-size:11px}
.ht-add-row{display:flex;gap:9px;margin-top:14px}
.ht-add-row input{flex:1;min-width:0;border:1px solid #c7dfc9;border-radius:12px;background:#fff;padding:10px;color:#28553a}
.ht-sleep-reading{padding:20px}
.ht-sleep-reading>p{line-height:1.65;font-size:13px;color:#557262;margin:11px 0}
.ht-sleep-facts{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:15px 0}
.ht-sleep-facts div{border-radius:13px;background:#eaf5e8;padding:13px;display:grid;gap:5px}
.ht-sleep-facts strong{font:600 20px Georgia,serif;color:#2b714e}
.ht-sleep-facts span{font-size:11px;color:#5c7465}
.ht-sleep-reading .ht-disclaimer{font-size:11px;color:#748579}
.ht-material-hint{font-size:12px;color:#597860}
.ht-profile-short{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:16px;margin-bottom:14px;background:#e8f5e9;color:#275f44;border-radius:16px}
.ht-profile-short b{font-size:15px}
main.content.ht-main-home>.sectionhead,main.content.ht-main-home>.journey{display:none!important}
#s-habits .ht-panel,#s-habits .ht-sleep-reading{color:#284434}
#s-habits .ht-panel .field{background:#fff;color:#274732}
@media(max-width:850px){.ht-columns{grid-template-columns:1fr}.ht-home-actions{grid-template-columns:repeat(2,minmax(0,1fr))}.ht-ring{width:95px;height:95px}}
@media(max-width:540px){.ht-panel,.ht-sleep-reading{padding:14px}.ht-home-actions{gap:7px}.ht-compact{padding:9px;gap:7px;min-height:64px}.ht-icon{width:28px;height:28px;font-size:19px}.ht-name strong{font-size:12px}.ht-tick{font-size:19px}.ht-toprow h2{font-size:28px}.ht-toprow p{font-size:11px}.ht-ring{width:83px;height:83px;padding:7px}.ht-ring strong{font-size:22px}.ht-week button{font-size:8px}.ht-metrics{grid-template-columns:1fr 1fr}.ht-metrics label:last-child{grid-column:span 2}.ht-times label:last-child{grid-column:span 1}.ht-sleep-facts{grid-template-columns:1fr 1fr}.ht-sleep-reading>p{font-size:12px}}
@media(max-width:375px){.ht-home-actions{grid-template-columns:1fr}.ht-metrics{grid-template-columns:1fr}.ht-metrics label:last-child{grid-column:span 1}}

.ht-export{margin-top:13px;border-top:1px solid #deeadf;padding-top:14px}.ht-export .ht-cta{max-width:100%;width:100%}

/* Weekly checklist layout — visually clear, mobile-first, one-tap cells */
.ht-matrix-panel{margin-bottom:17px}
.ht-matrix-home{overflow:visible}
.ht-inline-create{display:block;margin:17px 0 15px;padding:12px 14px;background:linear-gradient(115deg,#e9f2e5,#f7f1db);border:1px solid #c9dbc1;border-radius:15px}
.ht-inline-create>label{display:block;color:#385b42;font-size:13px;font-weight:800;margin-bottom:9px}
.ht-create-line{display:flex;align-items:center;gap:9px}
.ht-create-line .field{flex:1;min-width:0;min-height:44px;padding:10px 12px;border:1px solid #a3c3a7;background:#fffefa!important;color:#2a4535!important;border-radius:11px;font-size:13px}
.ht-create-line .ht-cta{white-space:nowrap;min-height:44px!important}
.ht-week-nav{display:flex;gap:7px;align-items:center;justify-content:space-between;margin:15px 0 10px}
.ht-week-nav strong{flex:1;text-align:center;font:600 clamp(13px,1.9vw,17px) Georgia,serif;color:#375e45}
.ht-week-nav button{border:1px solid #cadcc7;background:#fbfcf7;color:#395d46;border-radius:10px;min-height:37px;padding:7px 11px;font-weight:750;font-size:12px;cursor:pointer}
.ht-week-nav button:not(:disabled):hover{background:#e5eee3;border-color:#a8cbb0}
.ht-week-nav button:disabled{opacity:.34;cursor:default}
.ht-table-scroller{max-width:100%;overflow-x:auto;overscroll-behavior-inline:contain;border:1px solid #d5dfd0;border-radius:14px;box-shadow:0 7px 17px #42654a15;background:#fffdfa;scrollbar-color:#a2bda4 transparent;scrollbar-width:thin}
.ht-table-scroller:focus-visible{outline:3px solid #d2ad70;outline-offset:3px}
.ht-week-table{border-collapse:separate;border-spacing:0;width:100%;min-width:480px;table-layout:fixed;background:#fffef9;color:#354f3e;font-size:12px}
.ht-week-table th,.ht-week-table td{border-right:1px solid #e4eadf;border-bottom:1px solid #e4eadf;vertical-align:middle}
.ht-week-table tr:last-child td,.ht-week-table tr:last-child th{border-bottom:0}
.ht-week-table tr th:last-child,.ht-week-table tr td:last-child{border-right:0}
.ht-week-table thead th{background:#e7eee3;color:#41634d;text-align:center;height:56px}
.ht-week-table thead .ht-habit-head{background:#e3ebde;text-align:left}
.ht-week-table .ht-habit-name{position:sticky;left:0;z-index:2;background:#fbfcf5;width:clamp(130px,28%,240px);min-width:130px;padding:8px 10px;text-align:left;line-height:1.28}
.ht-week-table thead .ht-habit-name{z-index:4;background:#e3ebde}
.ht-week-table tfoot .ht-habit-name{background:#e6eedf}
.ht-week-table .ht-day-head button{border:0;width:100%;min-height:51px;display:flex;flex-direction:column;justify-content:center;gap:2px;align-items:center;padding:4px 0;background:transparent;color:inherit;cursor:pointer}
.ht-week-table .ht-day-head button:disabled{cursor:default;opacity:.65}
.ht-week-table .ht-day-head span{font-size:12px;line-height:1.1;font-weight:750}
.ht-week-table .ht-day-head b{font-size:15px;line-height:1.1}
.ht-week-table .ht-today-head{background:#f1e3ba;color:#755620}
.ht-week-table .ht-future-head{color:#849189}
.ht-week-table tbody tr:nth-child(even) .ht-habit-name{background:#f2f6ec}
.ht-week-table .ht-habit-icon{display:inline-grid;width:25px;height:25px;place-items:center;border-radius:9px;background:#e5eddf;color:#396449;font-size:17px;flex-shrink:0}
.ht-week-table .ht-habit-description{display:inline-flex;flex-direction:column;min-width:0;gap:3px;flex:1}
.ht-week-table .ht-habit-description strong{font-size:12px;line-height:1.3;color:#35533f;overflow-wrap:anywhere}
.ht-week-table .ht-habit-description small{font-size:10px;line-height:1.3;color:#758579}
.ht-week-table .ht-habit-name:has(.ht-habit-description){display:flex;align-items:center;gap:7px;min-height:54px}
.ht-week-table tbody tr:nth-child(even){background:#fafdF6}
.ht-week-table td.ht-cell{padding:5px;background:transparent;text-align:center}
.ht-week-table td.ht-today-cell{background:rgba(239,221,178,.24)}
.ht-week-table .ht-cell-button{display:grid;place-items:center;aspect-ratio:1;max-width:42px;width:100%;min-width:30px;min-height:34px;margin:auto;border:1.5px solid #b5cbb5;border-radius:10px;background:#fff;color:#266342;font-size:21px;font-weight:800;cursor:pointer;transition:background-color .13s,border-color .13s}
.ht-week-table .ht-cell-button:hover{background:#e3efe0;border-color:#5b9270}
.ht-week-table .ht-cell-button:focus-visible{outline:3px solid #d5af67;outline-offset:2px}
.ht-week-table .ht-marked .ht-cell-button{background:#3f8057;border-color:#3f8057;color:#fff}
.ht-week-table .ht-future .ht-cell-button{color:#a5b6a4;background:#f1f4ed;border-color:#e4e8df;cursor:not-allowed}
.ht-week-table tfoot th,.ht-week-table tfoot td{background:#e6eee0;font-weight:850;text-align:center;color:#42614b;height:38px}
.ht-week-table tfoot td.ht-today-cell{background:#ecdfb4}
.ht-hint-scroll{margin:9px 0 0!important;font-size:11px!important;color:#667d6c!important;line-height:1.55}
.ht-settings-columns{margin-top:17px}
.ht-settings-columns .ht-settings{align-self:start}
.ht-empty-week{text-align:center;padding:20px 12px;color:#677d6a}
@media(max-width:680px){
 .ht-week-nav{gap:4px}
 .ht-week-nav button{font-size:11px;padding:6px 8px;min-height:34px}
 .ht-week-nav button span{display:none}
 .ht-create-line{gap:7px}
 .ht-create-line .ht-cta{font-size:12px!important;padding:9px!important}
 .ht-week-table{min-width:405px}
 .ht-week-table .ht-habit-name{width:112px;min-width:112px;padding:6px}
 .ht-week-table .ht-habit-name:has(.ht-habit-description){gap:5px}
 .ht-week-table .ht-habit-icon{width:20px;height:20px;font-size:14px}
 .ht-week-table .ht-habit-description strong{font-size:11px}
 .ht-week-table .ht-habit-description small{display:none}
 .ht-week-table .ht-day-head button{min-height:47px}
 .ht-week-table .ht-day-head span{font-size:10px}
 .ht-week-table .ht-day-head b{font-size:13px}
 .ht-week-table .ht-cell-button{min-width:30px;min-height:34px;border-radius:9px}
 .ht-week-table td.ht-cell{padding:4px}
 .ht-inline-create{padding:11px;margin:15px 0 13px}
}
@media(max-width:365px){
 .ht-week-table{min-width:392px}
 .ht-week-nav strong{font-size:12px}
 .ht-create-line .field{font-size:12px;padding:9px}
}

/* Keep the sticky habit heading a real table-cell; align its inner content. */
.ht-week-table .ht-habit-name:has(.ht-habit-description){display:table-cell;min-height:0}
.ht-week-table .ht-habit-inner{display:flex;align-items:center;gap:7px;width:100%;min-width:0}
@media(max-width:680px){.ht-week-table .ht-habit-inner{gap:5px}}

/* Legibility hotfix: the first column keeps full words instead of 2–3 letters.
   Horizontal scrolling moves only date columns; name stays visible. */
.ht-home,.ht-matrix-panel,.ht-table-scroller{min-width:0}
.ht-table-scroller{overflow-x:auto;overflow-y:hidden;-webkit-overflow-scrolling:touch}
.ht-week-table{table-layout:fixed!important;min-width:790px!important;width:100%!important}
.ht-week-table .ht-habit-name{
 width:230px!important;
 min-width:230px!important;
 max-width:230px!important;
 background:#f9faf3;
 border-right:2px solid #b6c8b8;
 padding:10px 11px!important;
}
.ht-week-table .ht-habit-name:has(.ht-habit-description){display:table-cell!important}
.ht-week-table .ht-habit-inner{display:flex;align-items:center;gap:10px;min-width:0}
.ht-week-table .ht-habit-description{display:block;flex:1;min-width:0}
.ht-week-table .ht-habit-description strong{
 font-size:13px!important;
 line-height:1.38!important;
 color:#304b3b;
 white-space:normal!important;
 word-break:normal!important;
 overflow-wrap:break-word!important;
 hyphens:auto;
}
.ht-week-table .ht-habit-description small{
 display:block;
 font-size:10px!important;
 line-height:1.35;
 margin-top:4px;
 color:#708072;
 white-space:normal;
 overflow-wrap:break-word;
}
.ht-week-table .ht-habit-icon{flex-shrink:0;width:29px;height:29px}
.ht-week-table td.ht-cell{min-width:67px}
.ht-week-table .ht-cell-button{min-width:40px;min-height:40px}
.ht-week-table .ht-habit-head{font-size:13px}
@media(max-width:680px){
 .ht-week-table{min-width:720px!important}
 .ht-week-table .ht-habit-name{width:215px!important;min-width:215px!important;max-width:215px!important;padding:9px!important}
 .ht-week-table .ht-habit-description strong{font-size:12.5px!important}
 .ht-week-table .ht-habit-description small{display:none}
 .ht-week-table .ht-habit-icon{width:25px;height:25px}
 .ht-week-table .ht-cell-button{min-width:40px;min-height:42px}
}

/* Readable habit names: fixed generous first column + horizontal week scroll. */
.ht-table-scroller{overflow-x:auto;overflow-y:hidden;-webkit-overflow-scrolling:touch;scrollbar-width:thin;scrollbar-color:#9baca5 #e9ede7}
.ht-week-table{width:100%;min-width:940px;table-layout:fixed}
.ht-week-table .ht-habit-name,
.ht-week-table thead .ht-habit-head,
.ht-week-table tfoot .ht-habit-head{
  display:table-cell!important;width:268px!important;min-width:268px!important;max-width:268px!important;
  padding:10px 14px!important;
  white-space:normal!important;
  text-align:left;box-sizing:border-box;vertical-align:middle;
}
.ht-week-table .ht-habit-inner{display:flex;align-items:center;gap:10px;min-width:0;width:100%}
.ht-week-table .ht-habit-description{display:block;flex:1;min-width:0;overflow:visible}
.ht-week-table .ht-habit-description strong{
  display:block;white-space:normal!important;overflow-wrap:normal!important;word-break:normal!important;
  hyphens:none!important;line-height:1.42;font-size:13px;max-width:100%;
}
.ht-week-table .ht-habit-description small{
  display:block;white-space:normal;overflow-wrap:normal;word-break:normal;
  font-size:10px;line-height:1.4;margin-top:4px;
}
.ht-week-table .ht-day-head{width:96px;min-width:96px}
.ht-week-table .ht-cell{min-width:78px}
.ht-hint-scroll{font-size:12px!important;font-weight:600;color:#4d6658!important}
@media(max-width:780px){
  .ht-week-table{min-width:855px!important}
  .ht-week-table .ht-habit-name,
  .ht-week-table thead .ht-habit-head,
  .ht-week-table tfoot .ht-habit-head{width:245px!important;min-width:245px!important;max-width:245px!important;padding:9px 11px!important}
  .ht-week-table .ht-habit-description small{display:block!important}
  .ht-week-table .ht-habit-description strong{font-size:12px}
  .ht-week-table .ht-habit-icon{width:26px;height:26px;font-size:16px}
  .ht-week-table .ht-day-head{width:87px}
}
@media(max-width:420px){
  .ht-week-table{min-width:835px!important}
  .ht-week-table .ht-habit-name,
  .ht-week-table thead .ht-habit-head,
  .ht-week-table tfoot .ht-habit-head{width:230px!important;min-width:230px!important;max-width:230px!important}
  .ht-week-table .ht-habit-description strong{font-size:12px}
  .ht-week-table .ht-habit-description small{font-size:10px}
}
