/* App-only task and routine surfaces. No planner-paper selectors. */
.home-today,
.home-today-dialog {
  --ht-font: Pretendard, "Pretendard Variable", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", sans-serif;
  color: var(--shell-text, #37352f);
  font: 400 14px/1.5 var(--ht-font);
  letter-spacing: -.02em;
}
#calView > .st > .home-today {
  grid-column: 1 / -1;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  background: var(--shell-surface, #ffffff);
  border: 1px solid var(--shell-line, #e8e8e5);
  border-radius: var(--shell-radius, 10px);
  box-shadow: var(--shell-shadow);
}
.home-today *, .home-today-dialog * { box-sizing: border-box; }
.home-today button, .home-today-dialog button { font: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.home-today button:disabled, .home-today-dialog button:disabled { cursor: default; opacity: .4; }
.home-today button:focus-visible, .home-today-dialog button:focus-visible,
.home-today input:focus-visible, .home-today-dialog input:focus-visible, .home-today-dialog select:focus-visible { outline: 2px solid var(--shell-action, #37352f); outline-offset: 3px; }
.home-today svg, .home-today-dialog svg { width: 20px; height: 20px; flex: none; }
.home-today h2, .home-today h3, .home-today p, .home-today-dialog h2, .home-today-dialog h3, .home-today-dialog p { margin: 0; }
.ht-heading { padding: 24px 24px 20px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ht-heading p { font-size: 11px; color: var(--shell-muted, #787774); margin-bottom: 4px; letter-spacing: .015em; }
.ht-heading h2 { font-size: 22px; font-weight: 700; line-height: 1.35; letter-spacing: -.04em; }
.ht-text-button { display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-height: 40px; padding: 6px 8px; background: none; border: 0; color: var(--shell-muted, #787774) !important; white-space: nowrap; font-size: 12px !important; font-weight: 550 !important; }
.ht-text-button svg { width: 17px; height: 17px; }
.ht-tabs { display: flex; margin: 0 24px; border-bottom: 1px solid var(--shell-line, #e8e8e5); gap: 24px; }
.ht-tabs > button { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 49px; padding: 8px 0 12px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--shell-muted, #787774); font-weight: 600; }
.ht-tabs > button.is-active { color: var(--shell-text, #37352f); border-bottom-color: var(--shell-action, #37352f); }
.ht-tabs > button span { font-size: 11px; color: var(--shell-muted, #787774); font-variant-numeric: tabular-nums; background: var(--shell-soft, #f1f1ef); padding: 2px 7px; border-radius: 6px; }
.ht-tabs > button.is-active span { color: var(--shell-text, #37352f); background: var(--shell-soft, #f1f1ef); font-weight: 650; }
.ht-panel { padding: 8px 24px 20px; }
.ht-list-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 46px; }
.ht-list-toolbar > p { color: var(--shell-muted, #787774); font-size: 12px; }
.ht-list { list-style: none; margin: 0; padding: 0; }
.ht-row { display: flex; align-items: center; gap: 10px; padding: 5px 0; min-height: 65px; border-bottom: 1px solid var(--shell-line, #e8e8e5); }
.ht-row:last-child { border-bottom: 0; }
.ht-check { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 44px; padding: 9px; border: none; border-radius: 6px; background: transparent; position: relative; }
.ht-check::before { content: ''; width: 23px; height: 23px; border: 1.5px solid color-mix(in srgb, var(--shell-muted, #787774) 50%, transparent); border-radius: 4px; position: absolute; z-index: 0; }
.ht-check[aria-checked="true"]::before { background: var(--shell-action, #37352f); border-color: var(--shell-action, #37352f); }
.ht-check svg { position: relative; z-index: 1; color: var(--shell-action-text, #fff); width: 18px; height: 18px; }
.ht-item-copy { min-width: 0; flex: 1; text-align: left; background: none; border: 0; padding: 8px 0; display: flex; flex-direction: column; gap: 3px; line-height: 1.45 !important; }
.ht-item-title { display: block; font-size: 14px; font-weight: 550; overflow-wrap: anywhere; }
.is-done .ht-item-title { color: var(--shell-muted, #787774); text-decoration: line-through; text-decoration-thickness: 1px; }
.ht-star { color: var(--shell-muted, #787774); margin-right: 5px; font-size: 12px; }
.ht-meta { display: block; font-size: 11px; line-height: 1.45; color: var(--shell-muted, #787774); overflow-wrap: anywhere; }
.ht-icon-button { width: 40px; min-height: 40px; padding: 9px; flex: none; display: inline-flex; justify-content: center; align-items: center; border: 0; border-radius: 6px; background: transparent; color: var(--shell-muted, #787774) !important; }
.ht-icon-button:hover, .ht-text-button:hover { background: var(--shell-soft, #f1f1ef); }
.ht-quick { margin-top: 14px; display: flex; align-items: center; gap: 8px; padding: 3px 5px 3px 15px; background: var(--shell-soft, #f1f1ef); border: 1px solid var(--shell-line, #e8e8e5); border-radius: 8px; }
.ht-quick input { min-width: 0; flex: 1; height: 42px; background: transparent; color: inherit; border: 0; font: 400 14px var(--ht-font); }
.ht-quick input::placeholder { color: var(--shell-muted, #787774); opacity: .8; }
.ht-quick button { display: flex; align-items: center; justify-content: center; width: 38px; height: 38px; padding: 8px; border: 0; border-radius: 6px; background: var(--shell-action, #37352f); color: var(--shell-action-text, #fff); }
.ht-footnote { margin-top: 11px !important; font-size: 11px; color: var(--shell-muted, #787774); }
.ht-empty { text-align: center; padding: 29px 12px; color: var(--shell-muted, #787774); font-size: 13px; }
.ht-empty > span { display: inline-grid; place-items: center; margin: 0 auto 12px; width: 43px; height: 43px; border-radius: 8px; background: var(--shell-soft, #f1f1ef); color: var(--shell-action, #37352f); font-size: 23px; }
.ht-empty h3 { color: var(--shell-text, #37352f); font-size: 15px; margin-bottom: 7px; font-weight: 600; }
.ht-routine-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; padding: 14px 0 11px; }
.ht-primary-soft { display: inline-flex; gap: 5px; align-items: center; min-height: 40px; border: 1px solid var(--shell-line, #e8e8e5); border-radius: 6px; padding: 7px 10px; background: var(--shell-soft, #f1f1ef); font-size: 12px !important; font-weight: 600 !important; margin-right: auto; }
.ht-primary-soft svg { width: 16px; height: 16px; }
.ht-filter { display: flex; gap: 7px; overflow-x: auto; scrollbar-width: none; padding: 0 0 16px; }
.ht-filter::-webkit-scrollbar { display: none; }
.ht-filter > button { flex: none; min-height: 36px; padding: 6px 12px; border: 1px solid var(--shell-line, #e8e8e5); border-radius: 6px; background: transparent; color: var(--shell-muted, #787774); font-size: 12px; }
.ht-filter > button.is-active { border-color: var(--shell-line, #e8e8e5); color: var(--shell-text, #37352f); background: var(--shell-soft, #f1f1ef); font-weight: 600; }
.ht-routine-card { border: 1px solid var(--shell-line, #e8e8e5); border-radius: 8px; padding: 14px; margin-bottom: 12px; }
.ht-routine-card > header { display: flex; align-items: center; gap: 10px; }
.ht-routine-card > header > div { flex: 1; min-width: 0; }
.ht-routine-card h3 { font-size: 14px; font-weight: 650; overflow-wrap: anywhere; }
.ht-group-icon { display: grid; place-items: center; background: var(--shell-soft, #f1f1ef); width: 35px; height: 35px; border-radius: 6px; font-size: 20px; flex: none; }
.ht-group-icon svg { width: 19px; height: 19px; color: var(--shell-muted, #787774); }
.ht-empty > span svg { width: 23px; height: 23px; }
.ht-progress { height: 3px; background: var(--shell-soft, #f1f1ef); border-radius: 2px; margin: 12px 0 4px; overflow: hidden; }
.ht-progress > i { height: 100%; display: block; background: var(--shell-action, #37352f); border-radius: inherit; transition: width .18s ease; }
.ht-habit-icon { flex: none; display: grid; place-items: center; width: 28px; color: var(--shell-muted, #787774); font-size: 19px; }
.ht-habit-icon svg { width: 22px; height: 22px; }
.ht-counter { display: flex; align-items: center; gap: 1px; flex: none; }
.ht-counter > button { width: 32px; height: 42px; padding: 0; background: none; border: 0; border-radius: 4px; font-size: 20px; }
.ht-counter > span { font-variant-numeric: tabular-nums; white-space: nowrap; min-width: 32px; text-align: center; }
.ht-counter b { font-weight: 650; font-size: 13px; }
.ht-counter small { font-size: 10px; color: var(--shell-muted, #787774); }
.ht-muted-note { font-size: 12px; color: var(--shell-muted, #787774); margin-top: 11px !important; }
.ht-routine-footer { display: flex; justify-content: space-between; align-items: center; gap: 4px; flex-wrap: wrap; }
.ht-routine-footer > p { font-size: 11px; color: var(--shell-muted, #787774); }
.home-today-overlay { position: fixed; z-index: 50000; inset: 0; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgb(24 24 22 / 24%); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); }
.home-today-dialog { width: 480px; max-width: 100%; max-height: 90dvh; display: flex; flex-direction: column; overflow: hidden; background: var(--shell-surface, #ffffff); border: 1px solid var(--shell-line, #e8e8e5); border-radius: 8px; box-shadow: 0 10px 40px rgb(0 0 0 / 13%); }
.home-today-dialog > header { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px 12px 24px; border-bottom: 1px solid var(--shell-line, #e8e8e5); }
.home-today-dialog h2 { font-size: 18px; font-weight: 650; }
.ht-modal-content { padding: 20px 24px 24px; overflow-y: auto; overscroll-behavior: contain; }
.ht-field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 17px; }
.ht-field > span, .ht-rule-field > legend { font-size: 12px; font-weight: 600; }
.home-today-dialog input:not([type="checkbox"]), .home-today-dialog select { width: 100%; min-width: 0; height: 44px; padding: 8px 11px; border: 1px solid var(--shell-line, #e8e8e5); border-radius: 6px; background: var(--shell-soft, #f1f1ef); color: inherit; font: 400 14px var(--ht-font); }
.ht-rule-field { padding: 0; margin: 0 0 19px; border: 0; }
.ht-rule-field > legend { margin-bottom: 7px; }
.ht-weekdays { display: flex; gap: 6px; margin-top: 10px; }
.home-today-dialog [hidden] { display: none !important; }
.ht-weekdays label { flex: 1; position: relative; min-width: 0; }
.ht-weekdays input { position: absolute; width: 100%; height: 100%; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.ht-weekdays span { display: grid; place-items: center; height: 38px; border: 1px solid var(--shell-line, #e8e8e5); border-radius: 8px; font-size: 12px; }
.ht-weekdays input:checked + span { background: var(--shell-action, #37352f); color: var(--shell-action-text, #fff); border-color: var(--shell-action, #37352f); }
.ht-weekdays input:focus-visible + span { outline: 2px solid var(--shell-action, #37352f); outline-offset: 2px; }
.ht-form-row { display: flex; gap: 12px; }
.ht-form-row > .ht-field { flex: 1; min-width: 0; }
.ht-form-note { font-size: 12px; line-height: 1.65; color: var(--shell-muted, #787774); }
.ht-members { margin-top: 6px; border-top: 1px solid var(--shell-line, #e8e8e5); }
.ht-member { display: flex; align-items: center; border-bottom: 1px solid var(--shell-line, #e8e8e5); min-height: 52px; }
.ht-member > label { display: flex; align-items: center; gap: 11px; flex: 1; padding: 9px 2px; min-width: 0; cursor: pointer; }
.ht-member input { accent-color: var(--shell-action, #37352f); width: 18px; height: 18px; flex: none; }
.ht-member label > span { overflow-wrap: anywhere; }
.ht-member small { display: block; color: var(--shell-muted, #787774); font-size: 10px; }
.ht-member > span { display: flex; flex: none; }
.ht-member .ht-icon-button { width: 32px; font-size: 18px; }
.ht-modal-actions { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 22px; }
.ht-primary, .ht-secondary, .ht-danger { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 10px 20px; border: 0; border-radius: 6px; font-size: 13px !important; font-weight: 600 !important; }
.ht-primary { color: var(--shell-action-text, #fff) !important; background: var(--shell-action, #37352f); }
.ht-secondary { background: var(--shell-soft, #f1f1ef); }
.ht-danger { margin-right: auto; color: #b35a61 !important; background: transparent; padding-left: 0; }
.ht-modal-error { color: #b35a61; font-size: 12px; margin-top: 12px; }
.ht-modal-error:empty { display: none; }
.ht-templates { display: grid; gap: 13px; margin-top: 17px; }
.ht-templates > article { position: relative; padding: 18px; border: 1px solid var(--shell-line, #e8e8e5); border-radius: 8px; background: var(--shell-soft, #f1f1ef); }
.ht-template-icon { display: inline-grid; place-items: center; width: 30px; height: 30px; color: var(--shell-muted, #787774); margin-bottom: 7px; }
.ht-template-icon svg { width: 24px; height: 24px; }
.ht-templates h3 { font-size: 16px; font-weight: 650; margin-bottom: 5px; }
.ht-templates p { font-size: 12px; color: var(--shell-muted, #787774); line-height: 1.6; }
.ht-templates ol { font-size: 13px; line-height: 1.9; padding-left: 19px; margin: 12px 0 16px; }
.ht-templates .ht-primary { width: 100%; }
.ht-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
@media (min-width: 900px) {
  .home-today #ht-routines { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
  .ht-routine-actions, .ht-filter, .ht-routine-footer { grid-column: 1 / -1; }
  #ht-routines > .ht-empty { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
  .ht-heading { padding: 20px 17px 14px; }
  .ht-heading h2 { font-size: 20px; }
  .ht-tabs { margin: 0 17px; gap: 23px; }
  .ht-panel { padding: 7px 17px 18px; }
  .ht-routine-card { padding: 12px; }
  .ht-row { gap: 7px; }
  .ht-routine-card .ht-row { gap: 6px; }
  .ht-habit-icon { width: 23px; }
  .ht-item-title { font-size: 13px; }
  .ht-counter { margin-right: -5px; }
  .ht-counter > button { width: 29px; }
  .ht-counter > span { min-width: 29px; }
  .home-today-overlay { align-items: flex-end; padding: 12px 0 0; }
  .home-today-dialog { max-width: none; width: 100%; max-height: 92dvh; border-radius: 12px 12px 0 0; }
  .ht-modal-content { padding: 18px 20px max(24px, env(safe-area-inset-bottom)); }
  .home-today-dialog > header { padding-left: 20px; }
  .home-today-dialog input:not([type="checkbox"]), .home-today-dialog select, .ht-quick input { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) { .ht-progress > i { transition: none; } }
/* A routine badge fills while held, then commits only when the stationary pointer is released. */
.home-today .ht-habit-row :is([data-home-action="habit-edit"],[data-home-action="habit-toggle"]){touch-action:pan-y;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
.ht-habit-row .ht-habit-badge{position:relative;isolation:isolate;align-self:flex-start;display:inline-block;padding:1px 4px;border-radius:3px;color:var(--shell-text,#37352f);text-decoration:none}
.ht-habit-badge::before{content:"";position:absolute;z-index:-1;inset:12% 0 4%;border-radius:3px;background:color-mix(in srgb,var(--accent,#b39a6f) 25%,transparent);transform:scaleX(0);transform-origin:left center;pointer-events:none}
.ht-habit-row.is-done .ht-habit-badge::before{transform:scaleX(1)}
.ht-habit-row.ht-hold-fill .ht-habit-badge::before{animation:ht-habit-fill 320ms linear both}
.ht-habit-row.ht-hold-erase .ht-habit-badge::before{animation:ht-habit-fill 320ms linear reverse both}
.ht-habit-row.ht-replay-fill .ht-habit-badge::before{animation:ht-habit-fill 180ms ease-out both}
.ht-habit-row.ht-replay-erase .ht-habit-badge::before{animation:ht-habit-fill 180ms ease-out reverse both}
@keyframes ht-habit-fill{from{transform:scaleX(0)}to{transform:scaleX(1)}}
@media(prefers-reduced-motion:reduce){.ht-habit-row:is(.ht-hold-fill,.ht-hold-erase,.ht-replay-fill,.ht-replay-erase) .ht-habit-badge::before{animation:none}.ht-habit-row.ht-hold-fill .ht-habit-badge::before{transform:scaleX(1);opacity:.55}.ht-habit-row.ht-hold-erase .ht-habit-badge::before{transform:scaleX(1);opacity:.35}}
