/* Receipt layout adapted from nonchaiovo/timed-checklist.
 * Source blob: 7074ca2e6a035e6e1f0ada50c43e177026ab2f84. Personal, non-commercial use.
 * Copyright (c) 2026 nonchaiovo. Full notice: third_party/timed-checklist-LICENSE.
 */
/* Every selector is namespaced; the chat theme and global typography stay intact. */
.tc-sheet,.tc-home{
  --tc-paper:var(--theme-paper, #eee0db); --tc-ink:var(--theme-ink, #51423f); --tc-faded:var(--theme-muted, #85716b);
  --tc-veryfaded:var(--theme-faint, #a18b84); --tc-rule:rgba(var(--theme-ink-rgb, 109,78,68),.35); --tc-rule-soft:rgba(var(--theme-ink-rgb, 109,78,68),.19);
  --tc-stamp:var(--theme-accent, #a66c5c); --tc-overdue:#955b52;
  --tc-task-ink:var(--theme-title, #352b29); --tc-task-accent:var(--theme-accent, #834f43);
  font-family:var(--font-cn); color:var(--tc-ink);
}

.tc-home{display:flex;align-items:center;gap:15px;width:100%;padding:20px 21px;margin:22px 0 8px;
  border:1px solid rgba(255,255,255,.55);border-radius:18px;background:rgba(var(--theme-tint-rgb, 237,221,216),.52);
  box-shadow:0 8px 24px rgba(var(--theme-ink-rgb, 104,82,80), .03);text-align:left;cursor:pointer;}
.tc-home-mark{font-family:var(--font-en);font-size:32px;font-style:italic;opacity:.65;}
.tc-home-copy{flex:1;display:grid;gap:4px;}
.tc-home strong{font-weight:500;font-size:16px;letter-spacing:1px;}
.tc-home small{font-size:11px;color:var(--tc-faded);line-height:1.7;}
.tc-home-arrow{display:flex;align-items:center;flex:none;}
.tc-home-arrow svg{display:block;width:20px;height:20px;}
.tc-sheet{position:fixed;inset:auto 0 0;margin:0 auto;padding:0;border:0;outline:0;border-radius:0;
  width:min(100%,480px);max-width:100%;height:var(--tc-height,62dvh);max-height:92dvh;
  background:var(--tc-paper);background-image:repeating-linear-gradient(90deg,rgba(var(--theme-ink-rgb, 112,78,65), .012) 0,rgba(var(--theme-ink-rgb, 112,78,65), .012) 1px,transparent 1px,transparent 3px);
  box-shadow:0 -14px 60px rgba(var(--theme-ink-rgb, 62,45,53), .19);overflow:hidden;
  clip-path:polygon(0 8px,2% 0,4% 8px,6% 0,8% 8px,10% 0,12% 8px,14% 0,16% 8px,18% 0,20% 8px,22% 0,24% 8px,26% 0,28% 8px,30% 0,32% 8px,34% 0,36% 8px,38% 0,40% 8px,42% 0,44% 8px,46% 0,48% 8px,50% 0,52% 8px,54% 0,56% 8px,58% 0,60% 8px,62% 0,64% 8px,66% 0,68% 8px,70% 0,72% 8px,74% 0,76% 8px,78% 0,80% 8px,82% 0,84% 8px,86% 0,88% 8px,90% 0,92% 8px,94% 0,96% 8px,98% 0,100% 8px,100% 100%,0 100%);
  transition:height .26s cubic-bezier(.32,.72,0,1);}
.tc-sheet[open]{display:flex;flex-direction:column;animation:tc-arrive .32s cubic-bezier(.32,.72,0,1);}
.tc-sheet::backdrop{background:rgba(var(--theme-ink-rgb, 60,43,49),.3);backdrop-filter:blur(3px);}
@keyframes tc-arrive{from{transform:translateY(100%)}to{transform:translateY(0)}}
.tc-sheet button,.tc-sheet input,.tc-sheet select,.tc-sheet textarea{font-family:inherit;color:inherit;}
.tc-sheet button{touch-action:manipulation;}
.tc-sheet button:focus-visible,.tc-sheet input:focus-visible,.tc-sheet select:focus-visible,.tc-sheet textarea:focus-visible{outline:2px solid var(--tc-stamp);outline-offset:3px;}
.tc-sheet button:disabled{opacity:.5;cursor:wait;}
.tc-top{position:relative;flex:0 0 43px;}
.tc-handle{position:absolute;top:8px;left:calc(50% - 44px);width:88px;height:33px;border:0;background:transparent;cursor:ns-resize;touch-action:none;}
.tc-handle::before{content:"";display:block;width:39px;height:4px;margin:auto;background:var(--tc-faded);opacity:.4;border-radius:3px;}
.tc-close{position:absolute;top:8px;right:10px;display:grid;place-items:center;width:40px;height:34px;background:none;border:0;font-size:25px;cursor:pointer;}
.tc-scroll{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;padding:0 26px calc(env(safe-area-inset-bottom,0px) + 24px);}
.tc-sheet [hidden]{display:none!important;}
.tc-sheet .tc-brand{font-family:var(--font-en),var(--font-cn);font-size:12px;letter-spacing:3px;}
.tc-sheet .tc-title{font-size:38px;font-weight:500;margin:0;line-height:1.12;}
.tc-sheet .tc-date{font-size:11px;letter-spacing:1px;margin-top:10px;}
.tc-sheet .tc-head{margin-bottom:19px;}
.tc-sheet .tc-section-label{font-family:var(--font-en),var(--font-cn);font-size:12px;letter-spacing:1.8px;padding:10px 0;}
.tc-sheet .tc-item{padding:8px 0;gap:7px;align-items:center;}
.tc-sheet .tc-check,.tc-sheet .tc-del-x{min-width:28px;min-height:34px;}
.tc-sheet .tc-check{font-family:var(--font-cn);color:var(--tc-task-ink);}
.tc-sheet .tc-body{padding:0;border:0;background:none;text-align:left;font-size:14px;line-height:1.7;cursor:pointer;letter-spacing:0;color:var(--tc-task-ink);font-weight:500;}
.tc-sheet .tc-trigger{font-size:11px;letter-spacing:0;white-space:nowrap;max-width:105px;color:var(--tc-task-accent);font-weight:500;}
.tc-sheet .tc-overdue-bang{color:var(--tc-task-accent);}
/* Read-only examples and pending saves keep the same legible task text. */
.tc-sheet .tc-body:disabled,.tc-sheet .tc-check:disabled{opacity:1;cursor:default;-webkit-text-fill-color:currentColor;}
.tc-item-detail{display:block;font-size:10px;color:var(--tc-faded);line-height:1.7;text-decoration:none;}
.tc-row-main{display:flex;align-items:center;flex:1;gap:7px;min-width:0;flex-wrap:wrap;}
.tc-row-main .tc-body{flex:1 1 95px;}
.tc-empty{padding:19px 4px;text-align:center;color:var(--tc-faded);font-size:12px;line-height:1.9;}
.tc-add{display:block;width:100%;text-align:left;border:0;border-bottom:1px dashed var(--tc-rule-soft);background:none;padding:13px 4px;font-size:13px;cursor:pointer;}
.tc-status{font-size:11px;line-height:1.8;color:var(--tc-faded);margin:12px 0;}
.tc-status.error{color:var(--tc-overdue);}
.tc-toolbar{display:flex;gap:14px;justify-content:center;margin-top:13px;}
.tc-link{padding:5px 0;border:0;border-bottom:1px solid var(--tc-rule-soft);font-size:11px;background:none;cursor:pointer;}
.tc-form{margin:13px 0 17px;padding:17px 14px;border:1px dashed var(--tc-rule);background:#fff4;}
.tc-form h3{margin:0 0 12px;font-size:14px;font-weight:500;}
.tc-form label{display:grid;gap:7px;font-size:11px;color:var(--tc-faded);margin-bottom:12px;}
.tc-form input,.tc-form textarea,.tc-form select{width:100%;min-width:0;border:1px solid var(--tc-rule-soft);background:#fff5;border-radius:5px;padding:9px 10px;font-size:16px;line-height:1.5;box-sizing:border-box;}
.tc-form textarea{resize:vertical;min-height:66px;max-height:160px;}
.tc-form-fields{display:grid;grid-template-columns:1fr 1fr;gap:12px;}
.tc-form-actions{display:flex;gap:10px;margin-top:12px;}
.tc-form-actions button{border:1px solid var(--tc-rule);background:transparent;border-radius:5px;padding:8px 14px;font-size:12px;cursor:pointer;}
.tc-form-actions button[type="submit"]{background:var(--tc-stamp);border-color:var(--tc-stamp);color:#fff8f4;}
.tc-confirm{padding:11px;border:1px dashed var(--tc-rule);font-size:12px;line-height:1.8;}
.tc-confirm button{border:0;border-bottom:1px solid var(--tc-rule);background:none;padding:5px;margin-left:10px;}
.tc-sheet .tc-progress-bar{font-family:ui-monospace,monospace;font-size:11px;color:var(--tc-stamp);}
.tc-sheet .tc-stamp{font-size:20px;font-weight:500;letter-spacing:2px;border-width:2px;padding:6px 19px;}
.tc-sheet .tc-foot-note{font-style:normal;font-size:12px;white-space:pre-line;}
.tc-sheet .tc-barcode-serial{font-family:var(--font-en);font-size:12px;}
@media(max-width:360px){.tc-scroll{padding-left:18px;padding-right:18px}.tc-row-main .tc-body{flex-basis:75px}}
@media(prefers-reduced-motion:reduce){.tc-sheet[open]{animation:none}.tc-sheet{transition:none}}
  /* ── receipt chrome ── */
  .tc-head { text-align: center; margin-bottom: 10px; }
  .tc-brand { font-size: 10px; color: var(--tc-faded); letter-spacing: 4px; font-weight: 700; }
  .tc-title { font-family: var(--font-en), var(--font-cn); font-style: italic; font-size: 30px; font-weight: 700;
    color: var(--tc-ink); margin-top: 4px; letter-spacing: 1px; line-height: 1.1; }
  .tc-date { font-size: 11px; color: var(--tc-faded); margin-top: 6px; letter-spacing: 2px; }
  .tc-dashes { font-size: 11px; color: var(--tc-rule); letter-spacing: 1px; text-align: center;
    user-select: none; padding: 4px 0; white-space: nowrap; overflow: hidden; }
  .tc-row { display: flex; justify-content: space-between; font-size: 12px; color: var(--tc-ink);
    letter-spacing: 0.5px; padding: 3px 0; }
  .tc-row.faded { color: var(--tc-faded); }
  .tc-section-label { text-align: center; font-size: 11px; color: var(--tc-faded);
    letter-spacing: 3px; font-weight: 700; padding: 4px 0 10px; }

  /* ── task rows: [ ]/[✓] + time badge (FRONT) + text + by + × ── */
  .tc-item { display: flex; align-items: flex-start; gap: 10px; padding: 6px 0;
    border-bottom: 0.5px dashed var(--tc-rule-soft); -webkit-tap-highlight-color: transparent; }
  .tc-check { flex: 0 0 auto; border: 0; background: transparent; padding: 0; margin: 0;
    font-family: var(--font-cn); font-size: 14px; color: var(--tc-ink); letter-spacing: 0.5px;
    line-height: 1.45; cursor: pointer; transition: transform .12s ease; }
  .tc-check:active { transform: scale(0.85); }
  .tc-check::before { content: "[ ]"; }
  .tc-item.done .tc-check::before { content: "[\2713]"; }

  /* the timestamp badge — rendered BEFORE the task text */
  .tc-trigger { flex: 0 0 auto; align-self: flex-start; margin-top: 1px;
    font-family: var(--font-cn); font-size: 11.5px; letter-spacing: 0.4px; color: var(--tc-stamp);
    padding: 0 5px; border: 0.5px solid var(--tc-rule-soft); border-radius: 3px; line-height: 1.6; }
  /* overdue-but-not-done: a small "!" after the text (no highlight; item floats to top) */
  .tc-overdue-bang { flex: 0 0 auto; align-self: flex-start;
    font-family: var(--font-cn); font-size: 13.5px; font-weight: 700; color: var(--tc-stamp); line-height: 1.45; }

  .tc-body { flex: 1; min-width: 0; font-family: var(--font-cn); font-size: 13.5px;
    line-height: 1.45; letter-spacing: 0.2px; color: var(--tc-ink);
    white-space: pre-wrap; word-break: break-word; outline: none; }
  .tc-item.done .tc-body { color: var(--tc-veryfaded);
    text-decoration: line-through; text-decoration-color: var(--tc-faded); }

  .tc-by { flex: 0 0 auto; font-style: italic; font-size: 11px; color: var(--tc-faded);
    letter-spacing: 0.5px; line-height: 1.6; }
  .tc-del-x { flex: 0 0 auto; border: 0; background: transparent; cursor: pointer;
    font-family: var(--font-cn); font-size: 14px; color: var(--tc-veryfaded); line-height: 1.45; padding: 0 2px; }
  .tc-del-x::before { content: "\00d7"; }
  .tc-del-x:hover { color: var(--tc-stamp); }

  .tc-item-new { border-bottom: 0.5px dashed var(--tc-rule-soft); }
  .tc-item-new .tc-body { color: var(--tc-faded); font-size: 13px; }
  .tc-item-new .tc-body:empty::before { content: "+ 新增一项"; color: var(--tc-faded); }
  .tc-item-new .tc-del-x, .tc-item-new .tc-check { visibility: hidden; }

  .tc-progress-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; font-size: 12px;
    color: var(--tc-ink); letter-spacing: 0.5px; }
  .tc-progress-bar { flex: 1; letter-spacing: -0.5px; overflow: hidden; white-space: nowrap; }
  .tc-progress-pct { font-size: 11px; color: var(--tc-faded); }

  .tc-stamp-wrap { text-align: center; padding: 14px 0 4px; }
  .tc-stamp { display: inline-block; padding: 6px 14px; border: 2.5px solid var(--tc-stamp);
    border-radius: 4px; color: var(--tc-stamp); font-family: var(--font-en), var(--font-cn); font-style: italic;
    font-size: 14px; font-weight: 700; letter-spacing: 2px; transform: rotate(-4deg); opacity: 0.82; }
  .tc-foot-note { text-align: center; padding: 8px 8px 0; font-family: var(--font-en), var(--font-cn);
    font-style: italic; font-size: 13px; color: var(--tc-faded); line-height: 1.7; }
  .tc-barcode { display: flex; align-items: flex-end; gap: 1px; justify-content: center; height: 38px; padding: 14px 0 4px; }
  .tc-barcode i { display: block; background: var(--tc-ink); opacity: 0.85; }
  .tc-barcode-serial { text-align: center; font-size: 10px; color: var(--tc-faded); letter-spacing: 3px; margin-top: 2px; }
