/* Compact routine database. Scope overrides to the table so daily badges stay untouched. */
.htb{--htb-date:106px;--htb-cell:46px;--htb-progress:126px;color:#37352f;min-width:0;font-size:11px}
.htb-scroll{max-width:100%;max-height:476px;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#d5d5d2 transparent;border-top:1px solid #e9e9e6;border-bottom:1px solid #e9e9e6;isolation:isolate}
.htb.is-empty .htb-scroll{max-height:290px}
.htb table{width:max-content;min-width:100%;table-layout:fixed;border-collapse:separate;border-spacing:0;font:inherit;text-align:left}
.htb th,.htb td{height:36px;padding:0;box-sizing:border-box;border-bottom:1px solid #eeeeec;background:#fff}
.htb tbody tr:last-child :is(th,td){border-bottom:0}
.htb thead th{height:38px;position:sticky;top:0;z-index:3;font-weight:400;color:#8a8a84;background:#fff}
.htb :is(thead th:first-child,tbody th){position:sticky;left:0;z-index:2;width:var(--htb-date);min-width:var(--htb-date);max-width:var(--htb-date);background:#fff;border-right:1px solid #efefed}
.htb thead th:first-child{z-index:4}
.htb-date-head{padding-left:8px!important}
.htb-date-head>svg{display:inline-block!important;vertical-align:-2px;margin-right:5px}
.htb svg{width:13px!important;height:13px!important;display:block;fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round}
.htb .htb-routine-head,.htb tbody td:not(.htb-progress-cell){width:var(--htb-cell);min-width:var(--htb-cell);max-width:var(--htb-cell);text-align:center}
.htb-column-name{display:flex;align-items:center;justify-content:center;width:100%;height:37px;border:0;background:transparent;padding:0;color:inherit;font-size:17px!important;position:relative;cursor:pointer;touch-action:manipulation}
.htb-column-name:focus-visible{outline:2px solid var(--accent,#858780);outline-offset:-2px;border-radius:4px}
.htb-column-name:focus:after{content:attr(data-label);position:absolute;z-index:8;top:32px;left:50%;transform:translateX(-50%);padding:5px 7px;border:1px solid #e9e9e5;border-radius:4px;background:#fff;color:#77776f;box-shadow:0 2px 5px #0000000a;font-size:11px;font-weight:400;white-space:nowrap;pointer-events:none}
.htb-add-routine{height:37px;width:100%;border:0;background:transparent;padding:0 8px;color:#94948a;font-size:11px!important;white-space:nowrap}
.htb .htb-placeholder{min-width:95px!important;width:95px!important;max-width:95px!important;text-align:center}
.htb-progress-head,.htb-progress-cell{width:var(--htb-progress);min-width:var(--htb-progress);padding-left:9px!important;padding-right:8px!important}
.htb-progress-head{font-size:11px}
.htb-day{display:flex;align-items:center;gap:4px;position:relative;width:100%;height:35px;background:transparent;border:0;border-radius:0;padding:0 8px;text-align:left;white-space:nowrap;color:#696963;font-size:11px!important;font-weight:400;font-variant-numeric:tabular-nums}
.htb-day:hover{background:#f6f6f3}
.htb-day small{font-size:10px;color:#92928d;margin-left:2px}
.htb-day i{width:3px;height:3px;background:#696963;border-radius:50%;margin-left:auto;flex:none}
.htb tr.is-today th{background:#f8f8f5}
.htb tr.is-today .htb-day{color:#37352f;font-weight:550}
.htb tr.is-unavailable :is(th,td){background:#fcfcfb}
/* Counts and font baselines must never change the center of a routine mark. */
.htb .htb-toggle{position:relative;display:grid;place-items:center;gap:0;width:100%;height:35px;min-height:32px;margin:0;border:0;border-radius:0;background:transparent;padding:0;text-align:center;color:#7b7b75;touch-action:pan-x pan-y}
.htb .htb-toggle:disabled{opacity:.45}
.htb .htb-toggle:not(:disabled):hover{background:#f8f8f5}
.htb .htb-mark{position:relative;display:grid;place-items:center;align-self:center;justify-self:center;width:22px;height:22px;min-width:22px;max-width:22px;flex:0 0 22px;margin:0;padding:0;border:0;overflow:hidden;box-sizing:border-box;isolation:isolate;background:transparent;font-size:0;line-height:1;color:#7d8074}
.htb .htb-mark>span{position:relative;z-index:1;display:block;width:15px;height:15px;box-sizing:border-box;font-size:0;line-height:0}
.htb .is-mark-o .htb-mark>span{border:1.6px solid currentColor;border-radius:50%}
.htb .is-mark-tri .htb-mark>span{width:16px;background:currentColor;clip-path:polygon(evenodd,50% 0%,100% 100%,0% 100%,50% 0%,50% 24%,18% 87%,82% 87%,50% 24%)}
.htb .is-mark-x .htb-mark>span:before,.htb .is-mark-x .htb-mark>span:after{content:"";position:absolute;width:1.6px;height:15px;top:0;left:6.7px;background:currentColor;border-radius:1px;transform:rotate(45deg)}
.htb .is-mark-x .htb-mark>span:after{transform:rotate(-45deg)}
.htb .htb-mark:before{inset:2px 0;border-radius:2px;opacity:.25;background:var(--hb-routine-ink,#858780);transform:scaleX(var(--htb-current-fill,0));transform-origin:left center}
.htb .htb-toggle.is-done .htb-mark:before{transform:scaleX(1)}
.htb .htb-toggle.is-mark-tri .htb-mark{color:#9a9b85}
.htb .htb-toggle.is-mark-x .htb-mark{color:#b89a98}
.htb .htb-toggle.is-mark-blank .htb-mark:after{content:"";width:3px;height:3px;border-radius:50%;background:#deded8;position:absolute;left:50%;top:50%;transform:translate(-50%,-50%)}
.htb .htb-toggle.is-holding .htb-mark:before,.htb .htb-toggle.is-holding.is-done .htb-mark:before{animation:htb-marker-hold var(--hb-hold-ms,320ms) linear both}
.htb .htb-mark.is-filling:before,.htb .htb-mark.is-unfilling:before{animation:htb-marker-motion var(--hb-hold-ms,320ms) linear both}
.htb .htb-toggle.is-hold-ready .htb-mark:before{transform:scaleX(var(--htb-next-fill,1))}
.htb .htb-mark.is-filling:before,.htb .htb-mark.is-unfilling:before{animation-delay:var(--hb-motion-delay,0ms)}
.htb-count{position:absolute;left:0;right:0;bottom:0;margin:0 auto;font-size:8px;color:#999992;line-height:8px;font-variant-numeric:tabular-nums;max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;pointer-events:none}
.htb .htb-toggle.is-mark-tri .htb-count{color:#787a70}
.htb-unset{font-size:10px;color:#d0d0ca}
.htb-progress{display:flex;align-items:center;gap:8px;font-size:10px;color:#777770;font-variant-numeric:tabular-nums}
.htb-progress>span{width:30px;flex:none}
.htb-progress>i{display:block;height:3px;flex:1;border-radius:2px;background:#eeeeeb;overflow:hidden}
.htb-progress>i>b{display:block;height:100%;background:#8d9b89;border-radius:inherit;transition:width .2s ease}
.htb-footer{display:flex;justify-content:space-between;gap:12px;color:#92928a;font-size:10px;padding:11px 8px 0}
.htb-footer b{color:#71766c;font-weight:500;margin-left:10px}
.htb-footer-muted{color:#b0b0a8}
.htb-empty{padding:24px 8px;border-top:1px solid #e9e9e6;border-bottom:1px solid #e9e9e6;color:#8a8a83;font-size:12px}
.htb-empty p{margin:0 0 6px;color:#73736d}.htb-empty>span{font-size:11px;color:#aaa99f}
@keyframes htb-marker-hold{from{transform:scaleX(var(--htb-current-fill,0))}to{transform:scaleX(var(--htb-next-fill,1))}}
@keyframes htb-marker-motion{from{transform:scaleX(var(--htb-motion-from,0))}to{transform:scaleX(var(--htb-current-fill,1))}}
@media(max-width:700px){.htb{--htb-date:92px;--htb-cell:44px;--htb-progress:105px}.htb-scroll{max-height:402px}.htb-day{font-size:11px!important;padding:0 6px}.htb-column-name{font-size:17px!important}.htb-progress{gap:5px;font-size:10px}.htb-progress>span{width:29px}.htb-progress-head{font-size:11px}}
@media(prefers-reduced-motion:reduce){.htb *,.htb *:before{animation:none!important;transition:none!important}.htb .htb-toggle.is-hold-ready .htb-mark:before{transform:scaleX(var(--htb-next-fill,1))}}
/* A small weekly matrix uses the same icon identity as the daily planner. */
#calView>.st .htb{color:var(--shell-text,#27292c);font-family:var(--home-font,Pretendard,sans-serif)}
#calView>.st .htb :is(th,td){background:var(--shell-surface,#fff);border-bottom-color:var(--shell-line,#e5e5e5)}
#calView>.st .htb-scroll{border-color:var(--shell-line,#e5e5e5)}
#calView>.st .htb svg{width:20px!important;height:20px!important;stroke-width:1.8;color:var(--shell-muted,#84888d)}
#calView>.st .htb .htb-toggle{color:var(--accent,#de7786)}
#calView>.st .htb :is(.htb-toggle.is-mark-o .htb-mark,.htb-toggle.is-mark-tri .htb-mark){color:var(--accent,#de7786)}
#calView>.st .htb .htb-toggle.is-mark-x .htb-mark{color:var(--shell-muted,#84888d)}
#calView>.st .htb .htb-mark{font-family:var(--home-font,Pretendard,sans-serif);font-weight:400}
#calView>.st .htb .htb-column-name:focus:after{background:var(--shell-surface,#fff);border-color:var(--shell-line,#e5e5e5);color:var(--shell-muted,#84888d)}
/* Match the project overview's 32px icon gutter and 38px rows. Buttons use
   the 37px interior so a table border cannot expand a row by another pixel. */
#calView>.st .htb-week{--htb-date:32px;--htb-cell:auto;--htb-progress:0}
#calView>.st .htb-week .htb-scroll{max-height:none;overflow:visible;border-top:0;border-bottom:0}
#calView>.st .htb-week table{width:100%;min-width:0;table-layout:fixed}
#calView>.st .htb-week :is(th,td){height:38px;min-width:0;max-width:none;width:auto;text-align:center;padding:0;border-right:0}
#calView>.st .htb-week :is(thead th:first-child,tbody th){width:32px;min-width:32px;max-width:32px;border-right:0}
#calView>.st .htb-week .htb-week-date{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;min-height:37px;width:100%;border:0;background:transparent;padding:0;color:var(--shell-muted,#84888d);font-size:10px}
#calView>.st .htb-week .htb-week-date b{font-size:11px;font-weight:400}
#calView>.st .htb-week .is-today .htb-week-date{color:var(--accent,#de7786)}
#calView>.st .htb-week .htb-week-date:disabled{opacity:.5}
#calView>.st .htb-week .htb-column-name{height:37px;color:var(--shell-muted,#84888d)}
#calView>.st .htb-week .htb-column-name svg{margin:auto}
#calView>.st .htb-week .htb-toggle{height:37px}
#calView>.st .htb-week .htb-count{max-width:100%;margin:0 auto}
#calView>.st .htb-week.is-empty{display:flex;align-items:center;gap:10px;flex-wrap:wrap;padding:5px 0}
#calView>.st .htb-empty-note{margin:0;font-size:12px;color:var(--shell-muted,#84888d);flex:1}
#calView>.st .htb-week.is-empty .htb-add-routine{width:auto;min-height:32px;color:var(--shell-muted,#84888d);padding:0;font-size:11px!important}
#calView>.st .htb-week .htb-row-fold{display:block;min-height:32px;margin:6px auto 0;padding:4px 12px;border:0;border-radius:999px;background:transparent;color:var(--shell-muted,#84888d);font-size:11px}
/* Icon changes use the same small anchored picker as the planner's other tools. */
#pop.home-routine-icon-picker{padding:8px;max-width:calc(100vw - 16px)}
#pop .home-routine-icon-grid{display:grid;grid-template-columns:repeat(6,36px);gap:4px;max-height:min(280px,45dvh);overflow-y:auto;overscroll-behavior:contain;touch-action:pan-y;scrollbar-width:thin}
#pop .home-routine-icon-grid button{display:grid;place-items:center;width:36px;height:36px;padding:7px;border:0;border-radius:50%;background:transparent;color:var(--ink,#30343a);cursor:pointer;touch-action:manipulation}
#pop .home-routine-icon-grid button:is(.on,[aria-pressed="true"]){background:var(--hl,#f3d0d5);color:var(--accent,#de7786)}
#pop .home-routine-icon-grid button:focus-visible{outline:2px solid var(--accent,#de7786);outline-offset:-2px}
#pop .home-routine-icon-grid svg{width:21px;height:21px}
#pop.home-routine-icon-picker{width:294px;box-sizing:border-box;padding:12px;color:var(--ink,#30343a);font-family:var(--home-font,Pretendard,sans-serif);max-height:calc(100dvh - 24px);overflow:auto;overscroll-behavior:contain}
#pop .home-routine-icon-head{display:flex;align-items:center;gap:8px;padding-bottom:10px;border-bottom:1px solid var(--shell-line,#e5e5e5)}
#pop .home-routine-icon-head b{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:14px}
#pop .home-routine-icon-head [data-home-routine-preview]{display:grid;place-items:center;width:28px;height:28px;border-radius:50%;background:var(--hl,#f3d0d5);color:var(--accent,#de7786)}
#pop .home-routine-icon-head svg{width:20px;height:20px}
#pop .home-routine-icon-head button{border:0;background:transparent;color:var(--shell-muted,#84888d);padding:0;width:28px;height:28px;font-size:22px}
#pop .home-routine-editor-fields{display:grid;gap:8px;padding:10px 0}
#pop .home-routine-editor-fields label{display:flex;align-items:center;gap:8px;font-size:11px;color:var(--shell-muted,#84888d);min-width:0}
#pop .home-routine-editor-fields :is(input,select){min-width:0;min-height:34px;box-sizing:border-box;border:1px solid var(--shell-line,#e5e5e5);border-radius:8px;background:var(--shell-surface,#fff);color:var(--ink,#30343a);font-family:inherit;font-size:16px;padding:4px 6px;flex:1;width:100%}
#pop .home-routine-editor-fields select{font-size:16px}
#pop .home-routine-editor-time{display:flex;align-items:center;gap:5px}
#pop .home-routine-editor-time label{flex:1;flex-direction:column;gap:4px;align-items:stretch}
#pop .home-routine-no-time{font-size:11px;color:var(--shell-muted,#84888d)}
#pop .home-routine-editor-label{font-size:11px;color:var(--shell-muted,#84888d);padding:0 0 6px}
#pop.home-routine-icon-picker .home-routine-icon-grid{grid-template-columns:repeat(6,minmax(0,1fr));max-height:min(200px,29dvh);gap:4px}
#pop .home-routine-editor-error{font-size:11px;color:var(--accent,#de7786);margin:6px 0;min-height:0}
#pop .home-routine-editor-error:empty{display:none}
#pop .home-routine-editor-footer{display:flex;align-items:center;gap:8px;justify-content:space-between;padding-top:10px;border-top:1px solid var(--shell-line,#e5e5e5);margin-top:8px}
#pop .home-routine-editor-footer span{font-size:10px;color:var(--shell-muted,#84888d)}
#pop .home-routine-editor-footer button{min-height:34px;border:0;border-radius:18px;background:var(--ink,#30343a);color:#fff;padding:0 16px;font:inherit;font-size:12px}
