/* v0.4 · independent Habit Tracker, using the existing workspace tokens. */
.hab-module{max-width:1180px;margin:0 auto;text-wrap:pretty}.hab-heading{display:flex;align-items:center;justify-content:space-between;gap:14px;margin-bottom:24px}.hab-kicker,.hab-datebar small{font-size:10px;font-weight:700;letter-spacing:1.3px;color:var(--muted)}.hab-heading h1{font-size:clamp(28px,4vw,36px);font-weight:650;letter-spacing:-1.6px;line-height:1.2;margin:5px 0}.hab-heading p,.hab-panel-head p{margin:0;color:var(--muted);font-size:13px}.hab-tabs{display:flex;border-bottom:1px solid var(--line);margin-bottom:26px;gap:8px;overflow-x:auto}.hab-tabs .tab{white-space:nowrap}.hab-datebar{display:flex;align-items:center;justify-content:space-between;gap:10px;margin:0 0 16px}.hab-datebar h2{font-size:21px;letter-spacing:-.6px;font-weight:620;margin:3px 0}.hab-datebar h2 span{color:var(--accent);font-size:13px;font-weight:500;white-space:nowrap}.hab-date-controls{display:flex;gap:6px;align-items:center}.hab-date-controls button{min-height:36px}.hab-date-controls button:first-child,.hab-date-controls button:last-child{font-size:21px;padding:2px 12px}.hab-date-controls button:disabled,.hab-day:disabled{opacity:.42;cursor:default;transform:none}.hab-metrics{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin-bottom:18px}.hab-stat{display:grid;gap:5px;min-width:0;background:var(--panel);border:1px solid var(--line);border-radius:10px;padding:17px}.hab-stat>small,.hab-stat>span{font-size:12px;color:var(--muted)}.hab-stat strong{font-size:clamp(23px,3vw,32px);font-weight:650;letter-spacing:-1px;font-variant-numeric:tabular-nums;line-height:1.2}.hab-stat strong small{font-size:15px;color:var(--muted);font-weight:400}.hab-panel{padding:20px;margin-bottom:16px;border:1px solid var(--line);border-radius:12px;background:var(--panel);min-width:0}.hab-panel-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:18px}.hab-panel h2{font-size:17px;letter-spacing:-.3px;margin:0 0 4px;font-weight:650}.hab-pill{white-space:nowrap;padding:5px 10px;background:var(--accent-bg);color:var(--accent);border-radius:5px;font-size:12px;font-weight:600}.hab-week-strip{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:8px;margin-bottom:12px}.hab-day{display:grid;justify-items:center;gap:3px;border:1px solid var(--line);border-radius:8px;padding:8px 4px;color:var(--muted);min-height:53px}.hab-day small{font-size:11px}.hab-day strong{font-size:15px;color:var(--text);font-variant-numeric:tabular-nums}.hab-day.selected{background:var(--accent-bg);border-color:var(--accent);color:var(--accent)}.hab-day.selected strong{color:var(--accent)}.hab-day:not(:disabled):hover{background:var(--hover)}.hab-row{display:flex;justify-content:space-between;align-items:center;gap:14px;padding:16px 0;border-bottom:1px solid var(--line)}.hab-row:last-child{border-bottom:0;padding-bottom:0}.hab-row-main{display:flex;gap:13px;align-items:center;flex:1;min-width:0}.hab-symbol{width:37px;height:37px;display:grid;place-items:center;flex-shrink:0;border:1px solid var(--line);border-radius:50%;color:var(--accent);background:var(--bg)}.hab-symbol>span{width:13px;height:13px;border:1.5px solid var(--muted);border-radius:50%}.hab-symbol.complete{background:var(--accent-bg);border-color:var(--accent-bg)}.hab-row-text{min-width:0;flex:1}.hab-row-text strong,.hab-manage-row strong{display:block;font-weight:600;overflow-wrap:anywhere}.hab-row-text small,.hab-manage-row small{color:var(--muted);font-size:12px;display:block;overflow-wrap:anywhere}.hab-row-actions{display:flex;align-items:center;gap:8px;flex-shrink:0}.hab-check-button{display:flex;align-items:center;justify-content:center;gap:5px;border:1px solid var(--line);border-radius:7px;min-height:36px;padding:7px 12px;font-size:12px;font-weight:600;white-space:nowrap}.hab-check-button:hover{background:var(--hover)}.hab-check-button.done{background:var(--accent-bg);border-color:var(--accent-bg);color:var(--accent)}.hab-check-button svg{width:14px;height:14px}.hab-edit{padding:8px;color:var(--muted);font-size:12px;border-radius:6px}.hab-edit:hover{background:var(--hover);color:var(--text)}.hab-progress{height:5px;max-width:230px;background:var(--hover);border-radius:4px;overflow:hidden;margin-top:8px}.hab-progress i{height:100%;display:block;background:var(--accent);border-radius:4px}.hab-table-wrap{overflow:auto;max-width:100%;padding-bottom:4px}.hab-table{border-collapse:separate;border-spacing:0;width:100%;text-align:center;font-size:12px;font-variant-numeric:tabular-nums}.hab-table th,.hab-table td{padding:8px 5px;border-bottom:1px solid var(--line);white-space:nowrap}.hab-table thead th{color:var(--muted);font-weight:550;font-size:11px}.hab-table th:first-child{text-align:left;position:sticky;left:0;background:var(--panel);z-index:1;max-width:185px;min-width:110px;white-space:normal;overflow-wrap:anywhere;padding-right:14px}.hab-table tbody th{font-weight:550}.hab-table tr:last-child td,.hab-table tr:last-child th{border-bottom:0}.hab-table th small{display:block;color:var(--muted);font-weight:400}.hab-cell{display:inline-flex;align-items:center;justify-content:center;vertical-align:middle;border:1px solid transparent;width:31px;height:31px;border-radius:6px;font-size:10px;overflow:hidden;font-variant-numeric:tabular-nums}.hab-cell.done{background:var(--accent);color:var(--bg)}.hab-cell.partial{background:var(--accent-bg);color:var(--accent);border-color:var(--accent)}.hab-cell.missed{background:var(--hover);border-color:var(--line)}.hab-cell.off{color:var(--muted);opacity:.55}.hab-cell.future{border:1px dashed var(--line)}.hab-cell.is-today{outline:1px solid var(--accent);outline-offset:1px}.hab-cell:is(button):hover{outline:2px solid var(--accent);outline-offset:1px}.hab-cell svg{height:15px;width:15px}.hab-cell-small{width:23px;height:23px;border-radius:4px}.hab-cell-small svg{width:12px;height:12px}.hab-month-table td,.hab-month-table th{padding:5px 3px}.hab-month-table th:last-child,.hab-month-table td:last-child{padding-left:12px}.hab-legend{display:flex;gap:12px;flex-wrap:wrap;margin-top:17px;color:var(--muted);font-size:11px}.hab-legend span{display:flex;align-items:center;gap:5px}.hab-legend .hab-cell{width:12px;height:12px;border-radius:3px}.hab-empty{padding:28px 8px;text-align:center;color:var(--muted)}.hab-empty h3{margin:8px 0 3px;font-size:16px;font-weight:600;color:var(--text)}.hab-empty p{margin:0 0 16px;font-size:13px}.hab-empty-mark{width:44px;height:44px;margin:0 auto 10px;background:var(--accent-bg);color:var(--accent);border-radius:50%;display:grid;place-items:center}.hab-empty-mark svg{width:23px;height:23px}.hab-manage-row{display:flex;align-items:center;justify-content:space-between;gap:15px;padding:15px 0;border-bottom:1px solid var(--line)}.hab-manage-row:last-child{border-bottom:0}.hab-manage-row>div{min-width:0}.hab-form-body{max-height:65dvh;overflow:auto;display:grid;gap:14px}.hab-field{display:grid;gap:5px;font-size:12px;font-weight:600}.hab-field input,.hab-field select{width:100%;font-weight:400}.hab-number-fields{display:grid;grid-template-columns:1fr 1fr;gap:10px}.hab-number-fields[hidden]{display:none}.hab-weekdays{border:0;padding:0;margin:0;display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:5px}.hab-weekdays legend{font-size:12px;font-weight:600;margin-bottom:8px}.hab-weekdays label{position:relative;cursor:pointer}.hab-weekdays input{position:absolute;opacity:0;width:1px;height:1px}.hab-weekdays span{display:block;text-align:center;padding:8px 3px;border:1px solid var(--line);border-radius:6px;font-size:11px;color:var(--muted)}.hab-weekdays input:checked+span{background:var(--accent-bg);border-color:var(--accent);color:var(--accent);font-weight:600}.hab-weekdays input:focus-visible+span{outline:2px solid var(--accent);outline-offset:2px}.hab-weekdays input:disabled+span{opacity:.5;cursor:default}.hab-form-note{font-size:12px;color:var(--muted);margin:0}.hab-danger{color:var(--red);margin-right:auto;font-size:12px;padding:8px}.hab-modal-footer{flex-wrap:wrap}.hab-streak-table td{padding:14px 8px}.hab-streak-table th:first-child{max-width:240px}
@media(max-width:650px){.hab-heading{align-items:flex-start;gap:8px}.hab-heading .primary{padding:9px 10px;font-size:12px;white-space:nowrap}.hab-datebar h2{font-size:17px}.hab-datebar h2 span{font-size:11px}.hab-date-controls{gap:3px}.hab-date-controls button{font-size:11px;padding:7px 8px}.hab-date-controls button:first-child,.hab-date-controls button:last-child{padding:2px 9px}.hab-metrics{gap:6px}.hab-stat{padding:11px 9px}.hab-stat>small,.hab-stat>span{font-size:10px}.hab-stat strong{font-size:23px}.hab-panel{padding:13px}.hab-week-strip{gap:4px}.hab-row{gap:8px}.hab-row-main{gap:7px}.hab-symbol{width:29px;height:29px}.hab-row-text small{font-size:11px}.hab-row-actions{gap:3px}.hab-check-button{min-height:44px;padding:6px 8px;font-size:11px}.hab-edit{padding:10px 5px;min-height:44px}.hab-cell{width:29px;height:29px}.hab-cell-small{width:26px;height:26px}.hab-table th:first-child{min-width:100px;max-width:125px}.hab-week-table td,.hab-week-table th{padding:5px 3px}.hab-panel-head{gap:8px}.hab-panel-head p{font-size:11px}.hab-panel-head .hab-pill{font-size:10px;padding:5px 7px}.hab-day{min-height:52px}.hab-weekdays span{padding:10px 2px}}
@media(prefers-reduced-motion:reduce){.hab-module button{transition:none}}
