/* Unitick · todo.js 的面板、详情面板里的提醒和重复、改一件事的表单；一句话加待办（todoquick.js）、日历和加一门课的表单也用 td-in、td-f。
   类名都带 td- 前缀；颜色、圆角用 app.css 的变量。月历格子本身沿用 app.css 的 cal- 那一套，这里只补新加的。 */
:root { --td-late: var(--red); }

/* 分段按钮：重复那一块的不重复 / 每天 / 每周 / 每月 */
.td-seg { display: inline-flex; padding: 2px; border-radius: 10px; background: var(--soft); border: 1px solid var(--line); }
.td-seg > button { min-width: 0; padding: 4px 12px; border: 0; border-radius: 8px; background: none; color: var(--muted); font-size: 13px; }
:where(.td-seg > button):hover:not(:disabled) { background: none; color: var(--ink); }
.td-seg > button.is-on, :where(.td-seg > button.is-on):hover { background: var(--panel); color: var(--ink); box-shadow: var(--shadow-1); }

/* ---------------------------------------------------------------- 加一条 */
.td-in { min-width: 0; font: inherit; font-size: 14px; }

/* ---------------------------------------------------------------- 面板：宽屏从右边滑出，手机从底部升起 */
.td-layer { position: fixed; inset: 0; z-index: 52; pointer-events: none; }
.td-scrim { position: absolute; inset: 0; background: var(--overlay-a22); opacity: 0; transition: opacity var(--dur-3) var(--ease-out); pointer-events: auto; }
.td-sheet { position: absolute; display: flex; flex-direction: column; background: var(--panel); box-shadow: var(--shadow-3);
  pointer-events: auto; transition: transform var(--dur-4) var(--ease-out); }
.td-layer.is-open .td-scrim { opacity: 1; }
.td-layer.is-open .td-sheet { transform: none; }
@media (min-width: 760px) {   /* 和外框（shell.css）同一个分界：760px 以下是手机布局 */
  .td-sheet { top: 0; right: 0; bottom: 0; width: min(440px, 92vw); border-left: 1px solid var(--line); transform: translateX(104%); }
  .td-scrim { background: var(--overlay-a8); }
  .td-grab { display: none; }
}
@media (max-width: 759.98px) {
  .td-sheet { left: 0; right: 0; bottom: 0; max-width: 720px; margin: 0 auto; min-height: 50vh; min-height: 50dvh;
    max-height: min(90vh, 820px); max-height: min(90dvh, 820px);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0; transform: translateY(104%); transition-timing-function: var(--ease-sheet); }
  .td-grab { flex: none; width: 40px; height: 5px; margin: 8px auto 0; border-radius: 3px; background: var(--line-2); }
  html.td-lock, html.td-lock body { overflow: hidden; }
}
.td-sheet-h { flex: none; display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 6px 12px 6px 20px; border-bottom: 1px solid var(--line); }
.td-sheet-title { flex: 1; min-width: 0; font-size: 15px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.td-sheet-back { flex: none; font-size: 14px; }
.td-sheet-x { flex: none; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%; background: none; font-size: 22px; line-height: 1; color: var(--muted); }
:where(button).td-sheet-x:hover:not(:disabled) { background: var(--soft); color: var(--ink); }
.td-sheet-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 18px 20px calc(28px + env(safe-area-inset-bottom)); }
.td-sheet-body > * + * { margin-top: 18px; }

/* 详情面板里的提醒、重复两块（remindBox、repeatBox） */
.td-block > h3 { margin: 0 0 6px; font-size: 13px; color: var(--muted); }
/* 提醒：和设置里一样的勾选和自定义（app.css 的 rm- 类，remind.js 的 leadPicker）；详情面板窄，自定义的几条靠左 */
.td-rm-pick { display: grid; gap: 10px; }
.td-rm-pick .rm-cus, .td-rm-pick .rm-cus-rows { justify-items: start; }
/* 「提醒」标题旁边：跟着设置（灰，点了去设置）或单独设置（蓝）的小标签，单独设的后面一个「改回跟着设置」 */
h3.td-rm-h { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.td-rm-h .tag { letter-spacing: 0; }
.td-rm-h a.tag { text-decoration: none; }
.td-rm-h a.tag:hover { color: var(--ink); border-color: var(--line-2); text-decoration: none; }
.td-rm-h .td-rm-back { margin-left: auto; font-size: 12.5px; font-weight: 400; letter-spacing: 0; }
.td-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding-top: 6px; }
.td-form { display: grid; gap: 14px; }
.td-f { display: grid; gap: 4px; }
.td-f-l { font-size: 13px; color: var(--muted); }
.td-f-h { font-size: 12px; color: var(--faint); }
.td-f-auto { display: flex; align-items: center; gap: 6px; margin-top: -4px; font-size: 13px; color: var(--muted); }
.td-f textarea { resize: vertical; }


/* ---------------------------------------------------------------- 首页日历 */
.cal-c.is-dim { background: var(--calendar-dim-bg); }
.cal-c.is-dim .cal-n { color: var(--faint); }
.cal-c.is-past:not(.is-today) .cal-n { color: var(--muted); }
.cal-ev.is-late { color: var(--td-late); }
.cal-dots i.is-late { background: var(--td-late); }

@media (max-width: 640px) {
  .cal-c { position: relative; }
  .td-sheet-body { padding-left: 16px; padding-right: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .td-sheet, .td-scrim { transition: none; }
}

/* ---------------------------------------------------------------- #735：几点提醒、重复、改待办（详情面板里） */
.td-rm-b { display: grid; gap: 10px; justify-items: start; }
.td-tm { display: flex; flex-wrap: wrap; gap: 6px; }
.td-tm-i { display: inline-flex; align-items: center; gap: 2px; height: 28px; padding: 0 2px 0 10px; border: 1px solid var(--line); border-radius: 999px;
  font-size: 13px; font-variant-numeric: tabular-nums; }
.td-tm-i.is-past { color: var(--faint); }
button.ibtn.td-tm-x { width: 22px; height: 22px; border-radius: 50%; }
.td-tm-x .ic { width: 12px; height: 12px; }
.td-tm-add { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.td-tm-add[hidden] { display: none; }
.td-rp-v { display: flex; align-items: baseline; gap: 12px; font-size: 14px; }
.td-rp-e { display: grid; gap: 10px; justify-items: start; }
.td-rp-days { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 14px; }
.td-rp-days:empty { display: none; }
button.td-rp-d { width: 32px; height: 32px; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: none; color: var(--muted); font-size: 13px; }
button.td-rp-d.is-on { border-color: var(--ink); background: var(--ink); color: var(--on-dark); }
.td-rp-md { width: 7em; }
.td-rp-end { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); }
.td-rp-end[hidden] { display: none; }
.td-f-date { display: flex; align-items: center; gap: 6px; }
.td-f-date > input { flex: 1; }
.td-f-date > .ibtn[hidden] { display: none; }
