/* D · 手机首页. One accent: vermilion marks only things you can answer (and a deadline that has passed). */
.variant-d {
  --paper: #f6f4ef; --paper-2: #eeebe3; --card: #fffefb; --ink: #17171a; --ink-2: #55565c; --ink-3: #8a8b90; --line: #e5e1d7;
  --red: #d9402a; --red-ink: #b8321f; --red-soft: #fbe9e5; --ease: cubic-bezier(.2,.75,.25,1);
  min-height: 100vh; background: #ecebe6; color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", sans-serif;
}
.d-stage { display: flex; justify-content: center; align-items: flex-start; gap: 56px; padding: 28px 24px 110px; }
:where(.variant-d) :where(button) { font-family: inherit; font-size: inherit; line-height: inherit; color: inherit; }
.variant-d :focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* ---- rail ---- */
.d-rail { width: 300px; flex-shrink: 0; position: sticky; top: 28px; font-size: 13px; line-height: 1.55; color: var(--ink-2); max-height: calc(100vh - 140px); overflow: auto; padding: 0 4px 0 2px; scrollbar-width: thin; }
.d-rail-brand { font-weight: 800; color: var(--ink); letter-spacing: .02em; font-size: 15px; }
.d-rail-brand span { font-weight: 500; color: var(--ink-3); margin-left: 6px; font-size: 13px; }
.d-rail-time { margin-top: 22px; }
.d-rail-date { font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.d-rail-title { margin: 4px 0 6px; font-size: 19px; line-height: 1.35; color: var(--ink); font-weight: 700; }
.d-rail-signal { margin: 0; font-size: 12px; color: var(--ink-3); }
.d-rail-steps { display: flex; align-items: center; gap: 6px; margin: 14px 0 10px; }
.d-rail-steps button { flex-shrink: 0; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); font-size: 18px; line-height: 1; color: var(--ink); cursor: pointer; display: grid; place-items: center; padding: 0; }
.d-rail-steps .d-play { font-size: 11px; letter-spacing: -1px; }
.d-rail-steps .d-play.is-on { background: var(--ink); color: var(--card); border-color: var(--ink); }
.d-track { position: relative; flex: 1; height: 34px; cursor: pointer; touch-action: none; border-radius: 8px; }
.d-track:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--ink); }
.d-track-line { position: absolute; left: 0; right: 0; top: 16px; height: 2px; border-radius: 1px; background: #d8d4ca; }
.d-track-ticks i { position: absolute; top: 13px; width: 2px; height: 8px; margin-left: -1px; border-radius: 1px; background: #cbc6bb; transition: background-color .2s; }
.d-track-ticks i.is-day { top: 9px; height: 16px; background: #b4afa4; }
.d-track-ticks i.is-past { background: var(--ink-2); }
.d-track-thumb { position: absolute; top: 7px; width: 20px; height: 20px; margin-left: -10px; border-radius: 50%; background: var(--card); box-shadow: 0 0 0 2px var(--ink), 0 2px 6px #0003; transition: left .26s var(--ease); pointer-events: none; }
.d-rail-narrative { margin: 0 0 16px; font-size: 12.5px; }
.d-rail-block { border-top: 1px solid var(--line); padding: 12px 0 4px; }
.d-rail-block h2 { margin: 0 0 8px; font-size: 12px; color: var(--ink); font-weight: 700; }
.d-surface-toggle { display: inline-flex; background: #e2e0d9; border-radius: 10px; padding: 3px; }
.d-surface-toggle button { border: 0; background: transparent; padding: 6px 12px; border-radius: 8px; font-size: 12.5px; color: var(--ink-2); cursor: pointer; transition: background-color .2s, color .2s; }
.d-surface-toggle button[aria-checked="true"] { background: var(--card); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px #0001; }
.d-surface-policy { margin: 8px 0 4px; font-size: 12px; }
.d-base { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink); }
.d-base-btn { flex: 1; display: flex; justify-content: space-between; align-items: center; padding: 7px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); font-size: 12.5px; cursor: pointer; text-align: left; }
.d-base-btn span { font-size: 10px; color: var(--ink-3); }
.d-base-menu { margin-top: 6px; max-height: 260px; overflow: auto; background: var(--card); border-radius: 12px; box-shadow: 0 10px 30px -10px #0004, 0 0 0 1px var(--line); padding: 4px; scrollbar-width: thin; }
.d-base-menu button { display: block; width: 100%; text-align: left; border: 0; background: none; border-radius: 8px; padding: 7px 9px; cursor: pointer; }
.d-base-menu button:hover, .d-base-menu button:focus-visible { background: #f2efe8; outline: none; }
.d-base-menu button[aria-selected="true"] { background: var(--ink); color: #fff; }
.d-base-menu button[aria-selected="true"] small, .d-base-menu button[aria-selected="true"] em { color: #fffc; }
.d-base-menu span { font-size: 12.5px; font-variant-numeric: tabular-nums; }
.d-base-menu em { font-style: normal; font-size: 11px; color: var(--red); margin-left: 6px; }
.d-base-menu small { display: block; font-size: 11px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.d-small { font-size: 11.5px; color: var(--ink-3); margin: 6px 0; line-height: 1.5; }
.d-legend ol { margin: 0; padding-left: 18px; font-size: 12px; }
.d-legend li { margin-bottom: 6px; }
.d-legend b { display: block; color: var(--ink); font-weight: 600; }
.d-chip-demo { display: inline-block; font-size: 10.5px; padding: 0 6px; border: 1px solid var(--red); color: var(--red); border-radius: 99px; margin: 0 2px; line-height: 16px; }
.d-chip-demo.is-fill { background: var(--red); color: #fff; }
.d-link { border: 0; background: none; padding: 0; color: var(--red); font-size: inherit; cursor: pointer; }
.d-link.is-quiet { color: var(--ink-3); text-decoration: underline dotted; text-underline-offset: 3px; }

/* ---- device ---- */
.d-device { --scale: 1; width: calc(390px * var(--scale)); height: calc(844px * var(--scale)); flex-shrink: 0; }
.d-phone { width: 390px; height: 844px; transform: scale(var(--scale)); transform-origin: top left; border-radius: 56px; background: #111; padding: 11px; box-shadow: 0 30px 60px -20px #0004, 0 0 0 1px #0003; }
.d-screen { position: relative; width: 100%; height: 100%; border-radius: 46px; background: var(--paper); overflow: hidden; display: flex; flex-direction: column; outline: none; }
.d-statusbar { flex-shrink: 0; height: 46px; display: flex; align-items: center; justify-content: space-between; padding: 0 28px 0 34px; font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.d-island { width: 118px; height: 33px; border-radius: 20px; background: #111; }
.d-status-icons { font-size: 9px; letter-spacing: 1px; }
.d-scroll { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 0 12px 18px; scrollbar-width: none; overscroll-behavior: contain; overflow-anchor: none; }
.d-scroll::-webkit-scrollbar { display: none; }
.d-ghost { pointer-events: none; box-sizing: border-box; }

/* ---- head: how many wait, since when ---- */
.d-head { padding: 2px 4px 10px; }
.d-head-main { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 32px; }
.d-date { flex: 1; min-width: 0; font-size: 13px; font-weight: 600; color: var(--ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.d-head-tools { display: flex; gap: 2px; align-items: center; }
.d-snoozed { border: 1px solid var(--line); background: var(--card); border-radius: 99px; padding: 5px 11px; font-size: 12px; cursor: pointer; white-space: nowrap; }
.d-log-btn { border: 0; background: none; min-height: 32px; padding: 0 4px; font-size: 12px; color: var(--ink-3); cursor: pointer; }
.d-headline { margin: 2px 0 2px; font-size: 27px; line-height: 1.2; font-weight: 800; letter-spacing: -.01em; }
.d-headline:empty { display: none; }
.d-count { position: relative; display: inline-block; min-width: .62em; font-variant-numeric: tabular-nums; }
.d-count-new { display: inline-block; }
.d-count-old { position: absolute; left: 0; top: 0; }
.d-since { margin: 2px 0 0; font-size: 12.5px; line-height: 1.5; color: var(--ink-2); }
.d-since:empty { display: none; }
.d-since b { color: var(--ink); font-weight: 650; }
.d-surface-chip { position: relative; border: 0; background: none; padding: 0; font-size: inherit; color: var(--ink-3); cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; }
.d-signal { margin: 8px 0 0; padding: 7px 10px; font-size: 11.5px; color: var(--ink-2); background: var(--paper-2); border-radius: 10px; line-height: 1.45; }

/* ---- the ask zone: three big cards, the rest folded ---- */
.d-cards, .d-rows, .d-known { display: flex; flex-direction: column; gap: 8px; }
.d-card { position: relative; box-sizing: border-box; background: var(--card); border-radius: 20px; padding: 13px 15px 10px; box-shadow: 0 1px 0 #00000008, 0 8px 20px -14px #0004; cursor: pointer; display: flex; flex-direction: column; }
.d-card:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--ink); }
.d-why { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; min-height: 20px; }
.d-tag { font-size: 11px; line-height: 18px; padding: 0 7px; border-radius: 99px; background: var(--paper-2); color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.d-tag.is-weight { background: var(--ink); color: #fff; font-weight: 600; }
.d-tag.is-hot { background: var(--red-soft); color: var(--red-ink); font-weight: 600; }
.d-tag.is-new { background: transparent; color: var(--red-ink); box-shadow: inset 0 0 0 1px currentColor; font-weight: 600; }
.d-tag.is-share { margin-left: auto; background: none; color: var(--ink-3); padding-right: 0; }
.d-kicker { margin: 7px 0 0; display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 12px; line-height: 1.4; color: var(--ink-3); }
.d-kicker > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.d-cat { flex-shrink: 0; width: 7px; height: 7px; border-radius: 50%; background: var(--tone, #999); }
.d-card h3 { margin: 3px 0 0; font-size: 17.5px; line-height: 1.38; font-weight: 750; letter-spacing: -.005em; text-wrap: pretty; }
.d-card.is-lead { padding: 15px 16px 11px; }
.d-card.is-lead h3 { font-size: 21px; line-height: 1.32; margin-top: 4px; }
.d-context { margin: 5px 0 0; font-size: 13px; line-height: 1.5; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.d-trace { margin: 7px 0 0; font-size: 12px; line-height: 1.45; color: var(--ink); }
.d-trace.is-quiet { color: var(--ink-3); margin-top: 3px; }
.d-prior { margin: 7px 0 0; font-size: 12px; line-height: 1.45; color: var(--ink-2); display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; }
.d-card.is-pulse::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1.5px var(--red); opacity: 0; animation: d-new 1.6s var(--ease) var(--glow-delay, .25s) 1 both; pointer-events: none; }
@keyframes d-new { 0% { opacity: 0; } 18% { opacity: 1; } 100% { opacity: 0; } }

/* answer controls: the form of the button says what is asked */
.d-answer { margin-top: 10px; }
.d-actions { display: flex; gap: 8px; align-items: stretch; flex-wrap: wrap; }
.d-btn { flex: 1 1 0; min-width: 0; min-height: 44px; border-radius: 13px; font-size: 15px; font-weight: 700; cursor: pointer; padding: 0 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: transform .12s var(--ease), background-color .15s; }
.d-btn:active { transform: scale(.97); }
.d-btn.is-fill { background: var(--red); color: #fff; border: 1px solid var(--red); }
.d-btn.is-line { background: transparent; color: var(--red-ink); border: 1.5px solid var(--red); }
.d-btn small { font-size: 11px; font-weight: 600; opacity: .85; margin-left: 6px; padding-left: 6px; border-left: 1px solid #fff7; }
.d-write { text-align: left; padding: 0 14px; }
.d-subject { margin: 7px 0 0; font-size: 11.5px; color: var(--ink-3); }
.d-secondary { display: flex; align-items: center; gap: 2px; margin: 2px -6px -6px; }
.d-write-link, .d-snooze, .d-more-link { min-height: 44px; border: 0; background: none; padding: 0 8px; font-size: 13px; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; border-radius: 10px; }
.d-write-link { color: var(--red-ink); font-weight: 600; }
.d-snooze { color: var(--ink-3); }
.d-snooze span { font-size: 12.5px; }
.d-more-link { margin-left: auto; color: var(--ink-3); font-size: 12.5px; }
.d-write-link:hover, .d-snooze:hover, .d-more-link:hover { background: var(--paper); }
.d-input { flex: 1; display: flex; align-items: center; gap: 8px; margin: 0; }
.d-input .d-btn { flex: 0 0 auto; }
.d-amount { flex: 1; min-width: 0; min-height: 44px; display: flex; align-items: center; gap: 6px; border: 0; border-radius: 13px; padding: 0 12px; background: var(--paper-2); cursor: pointer; text-align: left; }
.d-amount span { font-weight: 700; font-size: 15px; color: var(--ink-2); }
.d-amount b { flex: 1; font-size: 19px; font-variant-numeric: tabular-nums; }
.d-amount i { font-style: normal; font-size: 13px; color: var(--ink-3); }
.d-composer { display: flex; align-items: flex-end; gap: 8px; padding: 4px 4px 4px 14px; border-radius: 22px; background: var(--paper-2); box-shadow: inset 0 0 0 1.5px transparent; transition: box-shadow .2s; }
.d-composer:focus-within { box-shadow: inset 0 0 0 1.5px var(--red); background: var(--card); }
.d-composer textarea { flex: 1; min-height: 36px; border: 0; background: none; resize: none; font: inherit; font-size: 15px; line-height: 1.45; padding: 8px 0; outline: none; color: var(--ink); field-sizing: content; max-height: 120px; }
.d-composer textarea::placeholder { color: var(--ink-3); }
.d-send { width: 44px; height: 44px; flex-shrink: 0; border: 0; border-radius: 50%; background: var(--red); color: #fff; font-size: 18px; font-weight: 700; cursor: pointer; }
.d-suggest { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 8px; }
.d-suggest button, .d-keypad-chips button { min-height: 36px; border: 1.5px solid var(--red); color: var(--red-ink); background: none; border-radius: 99px; padding: 0 14px; font-size: 13.5px; font-weight: 600; cursor: pointer; }
.d-keypad-value { text-align: center; font-size: 22px; font-weight: 600; color: var(--ink-2); margin: 10px 0 12px; }
.d-keypad-value b { font-size: 40px; color: var(--ink); margin-left: 4px; font-variant-numeric: tabular-nums; }
.d-keypad-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 12px; }
.d-keypad-keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.d-keypad-keys button { height: 48px; border: 0; border-radius: 12px; background: var(--paper-2); font-size: 21px; font-weight: 600; cursor: pointer; }
.d-keypad-keys button:active { background: #e4e0d6; }
.d-keypad-done { width: 100%; margin-top: 12px; min-height: 46px; flex: none; }

/* answered: the card folds into one receipt line, in place */
.d-card.is-answered { padding: 9px 12px 9px 15px; background: #fbfaf6; box-shadow: 0 0 0 1px var(--line); }
.d-card.is-answered .d-kicker { margin: 0; }
.d-receipt { display: flex; align-items: center; gap: 10px; margin-top: 4px; font-size: 13.5px; font-weight: 650; color: var(--ink); }
.d-receipt > span:nth-child(2) { flex: 1; min-width: 0; }
.d-receipt small { display: block; margin-top: 1px; font-size: 11.5px; font-weight: 400; color: var(--ink-3); }
.d-check { position: relative; width: 22px; height: 22px; border-radius: 50%; background: var(--card); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); display: grid; place-items: center; font-size: 12px; flex-shrink: 0; transition: background-color .3s, color .3s; }
.d-receipt.is-acknowledged .d-check { background: var(--ink); color: #fff; }
.d-undo { flex-shrink: 0; min-height: 44px; min-width: 44px; border: 0; background: none; padding: 0 6px; color: var(--red-ink); font-size: 13px; font-weight: 600; cursor: pointer; border-radius: 10px; }
.d-undo:hover { background: var(--paper-2); }
.d-prior .d-undo { min-height: 0; padding: 0; }
.d-acked { display: flex; align-items: center; justify-content: flex-end; gap: 8px; font-size: 12.5px; color: var(--ink-3); }

/* folded counts: the rest of the asks, and the low/trace tail */
.d-fold-row { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 54px; box-sizing: border-box; border: 0; border-radius: 16px; padding: 8px 14px; background: var(--paper-2); cursor: pointer; text-align: left; position: relative; }
.d-fold-row.is-asks { background: var(--card); box-shadow: 0 0 0 1px var(--line); }
.d-fold-row.is-asks::before, .d-fold-row.is-asks::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: -4px; height: 6px; border-radius: 0 0 12px 12px; background: var(--card); box-shadow: 0 0 0 1px var(--line); z-index: -1; transition: opacity .2s, transform .25s var(--ease); }
.d-fold-row.is-asks::after { left: 22px; right: 22px; bottom: -8px; background: #f7f5ef; }
.d-fold-row.is-open::before, .d-fold-row.is-open::after, .d-fold-row.is-one::after { opacity: 0; transform: translateY(-4px); }
.d-cards, .d-rows, .d-known { position: relative; isolation: isolate; }
:is(.d-cards, .d-rows, .d-known) > [data-key] { position: relative; } /* z-index and covers work without reading styles mid-beat */
.d-fold-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.35; }
.d-fold-row-main b { font-size: 14.5px; font-weight: 700; color: var(--ink); }
.d-fold-row.is-asks .d-fold-row-main b::before { content: ""; display: inline-block; width: 7px; height: 7px; margin: 0 7px 1px 0; border-radius: 50%; background: var(--red); vertical-align: middle; }
.d-fold-row-main small { font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.d-chev { font-size: 15px; color: var(--ink-3); transition: transform .28s var(--ease); }
.d-fold-row.is-open .d-chev { transform: rotate(180deg); }
.d-fold-row.is-asks + .d-ask-row { margin-top: 4px; }

.d-ask-row { position: relative; display: flex; align-items: center; gap: 10px; box-sizing: border-box; min-height: 64px; padding: 9px 10px 9px 14px; background: var(--card); border-radius: 16px; box-shadow: 0 0 0 1px var(--line); cursor: pointer; }
.d-ask-row:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--ink); }
.d-ask-row-text { flex: 1; min-width: 0; }
.d-ask-row .d-kicker { margin: 0; }
.d-ask-row .d-kicker em { flex-shrink: 0; font-style: normal; color: var(--ink-3); }
.d-ask-row .d-kicker em.is-hot { color: var(--red-ink); font-weight: 600; }
.d-ask-row h3 { margin: 2px 0 0; font-size: 14.5px; line-height: 1.38; font-weight: 650; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.d-ask-row.is-done { background: #fbfaf6; }
.d-ask-row.is-done h3 { color: var(--ink-3); font-weight: 500; }
.d-row-done { flex-shrink: 0; max-width: 40%; font-size: 12px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.d-chip { position: relative; flex-shrink: 0; min-height: 34px; border: 1.5px solid var(--red); color: var(--red-ink); background: none; border-radius: 99px; font-size: 12.5px; font-weight: 700; padding: 0 11px; cursor: pointer; white-space: nowrap; }
.d-chip::after { content: ""; position: absolute; inset: -6px -4px; }
.d-chip.is-decide { background: var(--red-soft); }
.d-chip span { margin-left: 3px; }

/* ---- rows: in progress and results, plain paper ---- */
.d-rows:not(:empty) { margin-top: 10px; gap: 0; }
.d-zone-head { display: flex; justify-content: space-between; align-items: center; min-height: 34px; padding: 0 4px; font-size: 12px; color: var(--ink-3); letter-spacing: .02em; }
.d-zone-head .d-link { min-height: 34px; }
.d-line { position: relative; isolation: isolate; box-sizing: border-box; padding: 11px 4px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; justify-content: center; min-height: 48px; cursor: pointer; touch-action: pan-y; background: var(--paper); }
.d-line:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--ink); border-radius: 8px; }
.d-line-head { display: flex; align-items: baseline; gap: 10px; }
.d-line h3 { flex: 1; min-width: 0; margin: 0; font-size: 15px; font-weight: 600; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.d-line.is-big h3 { font-size: 16px; font-weight: 700; }
.d-line .d-context { margin-top: 3px; }
.d-line.is-read h3, .d-line.is-read .d-context { color: var(--ink-3); }
.d-status { flex-shrink: 0; font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }

.d-known:not(:empty) { margin-top: 12px; gap: 6px; }
.d-tail-item { position: relative; display: flex; align-items: center; gap: 10px; min-height: 48px; box-sizing: border-box; padding: 6px 6px 6px 14px; background: var(--card); border-radius: 13px; box-shadow: 0 0 0 1px var(--line); cursor: pointer; }
.d-tail-item:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--ink); }
.d-tail-title { flex: 1; min-width: 0; font-size: 13.5px; line-height: 1.35; }
.d-tail-title small { display: block; font-size: 11px; color: var(--ink-3); }
.d-tail-item.is-done { opacity: .6; }
.d-tail-foot { display: flex; justify-content: space-between; padding: 0 6px; }
.d-tail-foot .d-link { min-height: 40px; }
.d-quiet { flex-shrink: 0; min-height: 44px; border: 0; background: none; color: var(--red-ink); font-size: 13px; font-weight: 600; cursor: pointer; padding: 0 8px; border-radius: 10px; }
.d-quiet:hover { background: var(--paper-2); }
.d-tick { color: var(--ink-3); font-size: 13px; padding: 0 12px; }
.d-empty { min-height: 300px; display: grid; place-content: center; text-align: center; color: var(--ink-3); }
.d-empty p { margin: 0 0 4px; font-size: 18px; color: var(--ink-2); font-weight: 600; }

/* ---- fold band: what the Agent folded for you ---- */
.d-fold { flex-shrink: 0; position: relative; z-index: 7; margin: 0 10px 26px; min-height: 50px; border: 0; border-radius: 14px; background: #e6e3da; display: flex; align-items: center; gap: 10px; padding: 0 14px 0 0; overflow: hidden; cursor: pointer; text-align: left; color: var(--ink-2); }
.d-fold-tex { align-self: stretch; width: 54px; background: repeating-linear-gradient(to bottom, #cfcabe 0 1px, transparent 1px 3px); mask: linear-gradient(to right, #000 40%, transparent); }
.d-fold-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.d-fold-text b { font-size: 12.5px; color: var(--ink); font-weight: 600; }
.d-fold-text small { font-size: 11px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.d-fold-more { font-size: 18px; color: var(--ink-3); }

/* ---- detail ---- */
.d-detail { position: absolute; inset: 46px 0 0; z-index: 20; display: flex; flex-direction: column; }
.d-detail-bg { position: absolute; inset: 0; z-index: -1; background: var(--paper); }
.d-detail-bar { flex-shrink: 0; display: flex; align-items: center; gap: 8px; padding: 2px 14px 4px; font-size: 13px; color: var(--ink-3); }
.d-detail-bar button { flex-shrink: 0; width: 44px; height: 44px; border: 0; background: none; font-size: 30px; line-height: 1; color: var(--ink); cursor: pointer; border-radius: 12px; }
.d-detail-bar span:nth-child(2) { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.d-detail-share { font-variant-numeric: tabular-nums; padding-right: 6px; }
.d-detail-body { flex: 1; overflow-y: auto; padding: 2px 20px 22px; scrollbar-width: none; overscroll-behavior: contain; }
.d-meta { margin: 0; font-size: 12px; color: var(--ink-3); }
.d-exp { color: var(--red-ink); font-weight: 650; }
.d-detail-body h2 { margin: 4px 0 6px; font-size: 22px; line-height: 1.32; text-wrap: pretty; }
.d-detail-title { display: flex; align-items: center; gap: 7px; margin: 0; font-size: 13px; color: var(--ink-2); }
.d-detail-body section { margin-top: 20px; }
.d-detail-body h4 { margin: 0 0 8px; font-size: 13px; color: var(--ink); }
.d-detail-body section > p { margin: 0 0 6px; font-size: 13.5px; line-height: 1.6; color: var(--ink-2); }
.d-why-box { background: var(--card); border-radius: 16px; padding: 12px 14px 8px; box-shadow: 0 0 0 1px var(--line); }
.d-facts { display: flex; flex-wrap: wrap; gap: 4px 6px; }
.d-facts span { font-size: 11.5px; line-height: 20px; padding: 0 8px; border-radius: 99px; background: var(--paper-2); color: var(--ink-2); }
.d-reason { color: var(--ink) !important; }
.d-source { display: flex; gap: 10px; margin-bottom: 10px; }
.d-source > div { flex: 1; min-width: 0; }
.d-source small { font-size: 11px; color: var(--ink-3); }
.d-source p { margin: 3px 0 0; padding: 8px 11px; background: var(--card); border-radius: 4px 14px 14px 14px; font-size: 13px; line-height: 1.55; box-shadow: 0 0 0 1px #0000000a; overflow-wrap: anywhere; }
.d-source a { font-size: 11.5px; color: var(--ink-2); }
.d-avatar { --tone: #aaa; flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 12px; font-weight: 700; color: #fff; background: color-mix(in oklab, var(--tone) 82%, #333); }
.d-timeline { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 2px solid var(--line); }
.d-timeline li { position: relative; padding: 0 0 11px 8px; font-size: 13px; line-height: 1.45; color: var(--ink-2); }
.d-timeline li::before { content: ""; position: absolute; left: -20px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: #c9c5bb; box-shadow: 0 0 0 2px var(--paper); }
.d-timeline li.is-you::before { background: var(--paper); box-shadow: inset 0 0 0 2px var(--ink-2), 0 0 0 2px var(--paper); }
.d-timeline li.is-ask::before { background: var(--red); }
.d-timeline li.is-now { color: var(--ink); font-weight: 600; }
.d-timeline li.is-now::before { background: var(--ink); }
.d-timeline time { display: block; font-size: 11px; color: var(--ink-3); font-weight: 400; font-variant-numeric: tabular-nums; }
.d-timeline small { display: block; font-size: 11.5px; color: var(--ink-3); font-weight: 400; }
.d-timeline em { font-style: normal; color: var(--ink-3); }
.d-loop { margin: 0 0 6px; font-size: 13px; line-height: 1.5; color: var(--ink); }
.d-loop time { color: var(--ink-3); font-size: 11.5px; margin-right: 4px; font-variant-numeric: tabular-nums; }
.d-loop small { display: block; font-size: 11px; color: var(--ink-3); }
.d-earlier summary { font-size: 12px; color: var(--ink-3); cursor: pointer; margin-bottom: 8px; min-height: 28px; }
.d-children { display: flex; flex-direction: column; gap: 5px; }
.d-children button { min-height: 48px; text-align: left; border: 0; background: var(--card); border-radius: 12px; padding: 8px 12px; cursor: pointer; box-shadow: 0 0 0 1px #0000000a; display: flex; flex-direction: column; justify-content: center; }
.d-children span { font-size: 13.5px; font-weight: 600; }
.d-children small { font-size: 11px; color: var(--ink-3); margin-top: 2px; }
.d-json { margin-top: 20px; font-size: 12px; color: var(--ink-3); min-height: 32px; }
.d-detail-actions { flex-shrink: 0; padding: 10px 16px 28px; background: var(--card); box-shadow: 0 -1px 0 var(--line); }
.d-detail-actions .d-answer { margin-top: 0; }
.d-detail-actions .d-actions.is-quiet { justify-content: flex-start; }
.d-detail-actions .d-actions.is-quiet .d-btn { flex: 0 0 auto; padding: 0 22px; }
.d-detail-actions .d-receipt { margin: 0; min-height: 44px; }

/* ---- sheets & toast ---- */
.d-sheet-backdrop { position: absolute; inset: 0; z-index: 30; background: #0003; }
.d-sheet { position: absolute; left: 0; right: 0; bottom: 0; z-index: 31; max-height: 74%; overflow: auto; background: var(--card); border-radius: 26px 26px 0 0; padding: 8px 18px 34px; box-shadow: 0 -10px 30px -12px #0003; overscroll-behavior: contain; }
.d-sheet-grip { width: 38px; height: 5px; border-radius: 3px; background: #ddd9d0; margin: 0 auto 12px; }
.d-sheet h3 { margin: 0 0 6px; font-size: 18px; line-height: 1.35; }
.d-sheet h4 { margin: 16px 0 6px; font-size: 13px; }
.d-sheet .d-answer { margin-top: 12px; }
.d-sheet-kicker { display: flex; align-items: center; gap: 6px; margin: 0 0 4px; font-size: 12px; color: var(--ink-3); }
.d-sheet-detail { display: block; margin: 10px auto 0; min-height: 40px; font-size: 13px; }
.d-sheet-options { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.d-sheet-options button { display: flex; justify-content: space-between; align-items: center; min-height: 48px; border: 1px solid var(--line); background: var(--paper); border-radius: 14px; padding: 0 14px; font-size: 15px; font-weight: 600; cursor: pointer; }
.d-sheet-options small { font-size: 12px; color: var(--ink-3); font-weight: 400; }
.rs-custom { display: flex; gap: 8px; align-items: center; margin: 10px 0; font-size: 13px; color: var(--ink-2); }
.rs-custom input { font: inherit; min-height: 40px; padding: 0 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); }
.d-sheet > .d-btn { width: 100%; }
.d-fold-list { list-style: none; margin: 8px 0 0; padding: 0; }
.d-fold-list li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.d-fold-list small { display: flex; justify-content: space-between; gap: 8px; font-size: 11px; color: var(--ink-3); }
.d-fold-list b { font-weight: 600; color: var(--ink-2); }
.d-fold-list p { margin: 3px 0 0; font-size: 13px; line-height: 1.5; }
.d-log b { display: block; font-size: 12.5px; margin-bottom: 2px; }
.d-log .d-link { font-size: 12px; margin: 4px 12px 0 0; min-height: 32px; }
.d-sheet-links { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.d-sheet-links button { border: 1px solid var(--line); background: var(--paper); border-radius: 99px; min-height: 36px; padding: 0 12px; font-size: 12px; cursor: pointer; }
.d-toast { position: absolute; left: 50%; top: 52px; z-index: 40; transform: translate(-50%, -6px); opacity: 0; pointer-events: none; background: #222; color: #fff; font-size: 12.5px; padding: 9px 14px; border-radius: 12px; white-space: nowrap; transition: opacity .2s, transform .25s var(--ease); }
.d-toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---- a real phone: drop the device chrome; the page itself scrolls ---- */
@media (max-width: 760px) {
  .d-stage { display: block; padding: 0; }
  .d-rail { position: sticky; top: 0; z-index: 12; width: auto; max-height: none; padding: 6px 10px 6px 14px; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 0 8px; border-bottom: 1px solid var(--line); background: var(--paper); overflow: visible; }
  .d-rail-brand, .d-rail-narrative, .d-rail-block, .d-rail > .d-small, .d-rail-signal, .d-rail-date, .d-track { display: none; }
  .d-rail-time { margin: 0; min-width: 0; }
  .d-rail-title { font-size: 13.5px; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .d-rail-steps { margin: 0; gap: 2px; }
  .d-rail-steps button { width: 44px; height: 44px; border: 0; background: none; }
  .d-device { width: auto; height: auto; }
  .d-phone { width: auto; height: auto; min-height: 0; transform: none; border-radius: 0; padding: 0; background: none; box-shadow: none; }
  .d-screen { height: auto; overflow: visible; border-radius: 0; }
  .d-statusbar { display: none; }
  .d-scroll { overflow: visible; flex: none; padding: 6px 12px 10px; }
  .d-fold { position: sticky; bottom: 118px; z-index: 11; margin-bottom: 10px; box-shadow: 0 -6px 16px -10px #0003; }
  .d-detail { position: fixed; inset: 0; z-index: 95; }
  .d-detail-bar { padding-top: 10px; }
  .d-detail-actions { padding-bottom: 16px; }
  .d-sheet-backdrop { position: fixed; z-index: 96; }
  .d-sheet { position: fixed; z-index: 97; }
  .d-toast { position: fixed; top: 60px; z-index: 98; }
}
@media (max-width: 480px) { .d-fold { bottom: 72px; } }
/* ---- motion (d-motion.mjs): every moving part is transform or opacity ---- */
/* the box of an item while it changes face: three pieces that translate and scale (the corners keep their radius) */
.d-box { position: absolute; left: 0; top: 0; width: 0; height: 0; z-index: -1; pointer-events: none; }
.d-box > i { position: absolute; left: 0; top: 0; display: block; transform-origin: 0 0; }
.d-box-drop { box-shadow: 0 1px 0 #00000008, 0 8px 20px -14px #0004; }
.is-morphing { position: relative; isolation: isolate; background: transparent !important; box-shadow: none !important; border-color: transparent !important; }
.d-ghost.is-face { background: none !important; box-shadow: none !important; border-color: transparent !important; }
.d-ghost.is-face::before, .d-ghost.is-face::after { display: none; }
.d-face.d-ghost.is-face::before { display: none; }
/* a top-down reveal: a paper cover shrinks to the bottom edge */
.d-cover { position: absolute; inset: -2px -2px -6px; z-index: 5; display: block; background: var(--paper); transform-origin: 50% 100%; pointer-events: none; }
.d-line > .d-cover, .d-zone-head > .d-cover, .d-tail-foot > .d-cover { inset: 0; }
/* the receipt's check fills when the Agent has read it */
.d-check-fill { position: absolute; inset: 0; display: grid; place-items: center; border-radius: 50%; background: var(--ink); color: #fff; font-style: normal; font-size: 12px; }
.d-receipt.is-filling .d-check { background: var(--card); color: var(--ink); }
.d-row-receipt { display: flex; align-items: center; gap: 6px; margin: 3px 0 0; font-size: 12px; line-height: 1.45; color: var(--ink-2); }
.d-check-mini { width: 14px; height: 14px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 8.5px; background: var(--ink); color: #fff; flex-shrink: 0; }
.d-row-lapse { margin: 3px 0 0; font-size: 12px; line-height: 1.45; color: var(--ink-3); }
/* the 64-cell band under the 累计 bar: grey runs per item in first-seen order, blank cells as a faint grid */
.d-band { position: absolute; left: 64px; right: 34px; bottom: 6px; display: block; height: 2px; pointer-events: none;
  background: repeating-linear-gradient(to right, #d3cec2 0 calc(var(--cell, 4.6px) - 1px), transparent calc(var(--cell, 4.6px) - 1px) var(--cell, 4.6px)); }
.d-band > i { position: absolute; left: 0; top: 0; display: block; width: var(--cell, 4.6px); height: 2px; background: var(--ink-3); transform-origin: 0 0; }
.d-fold-tex { transform-origin: 50% 100%; }
/* dim the rest to 70 % while one row or card is summarised or open */
:is(.d-cards, .d-rows, .d-known) > [data-key] { transition: opacity .1s var(--undim-delay, 0s); }
.d-scroll.is-dim :is(.d-cards, .d-rows, .d-known) > [data-key]:not(.is-focus) { opacity: .7; transition: opacity .15s; }
/* long press: the row darkens a little at 0.15 s; a paper row lifts onto a card while its summary is up */
:is(.d-card, .d-ask-row, .d-line, .d-tail-item, .d-fold)::before { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: inherit; background: var(--ink); opacity: 0; transition: opacity .15s; pointer-events: none; }
:is(.d-card, .d-ask-row, .d-line, .d-tail-item, .d-fold).is-pressing::before { opacity: .05; }
.d-line::after { content: ""; position: absolute; inset: 0 -8px; z-index: -1; border-radius: 12px; background: var(--card); box-shadow: 0 10px 24px -14px #0005, 0 0 0 1px var(--line); opacity: 0; transition: opacity .15s; pointer-events: none; }
.d-line.is-lifted::after { opacity: 1; }
/* swiping a row left: “✓ 知道了” is uncovered at its right edge, grey until 80 px, then ink */
.d-swipe-hint { position: absolute; right: 4px; top: 50%; margin-top: -10px; height: 20px; line-height: 20px; font-size: 13px; font-weight: 600; color: var(--ink-3); white-space: nowrap; pointer-events: none; }
.d-swipe-hint.is-armed { color: var(--ink); }
.d-card, .d-ask-row, .d-line, .d-tail-item, .d-fold { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
.variant-d textarea, .variant-d input { -webkit-user-select: text; user-select: text; }
/* the summary card (ix.mjs peekHTML), on paper */
.variant-d {
  --d-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", sans-serif;
  --ix-fg: var(--ink); --ix-fg-2: var(--ink-2); --ix-fg-3: var(--ink-3); --ix-rule: var(--line); --ix-mono: var(--d-sans);
  --ix-ask: #c98a7d; --ix-ask-urgent: var(--red); --ix-mark: 7px; --ix-mark-gap: 7px; --ix-strong: 650;
  --ix-k-font: 11.5px/1.4 var(--d-sans); --ix-q-font: 700 15px/1.35 var(--d-sans); --ix-q-margin: 2px 0 3px; --ix-d-font: 12.5px/1.5 var(--d-sans);
  --ix-ask-font: 600 13px/1.4 var(--d-sans); --ix-ask-small-font: 400 11.5px/1.4 var(--d-sans);
  --ix-trend-h: 28px; --ix-bar: #c9c4b8; --ix-bar-later: #e7e3da; --ix-bar-off: #ddd8cd; --ix-axis-font: 10.5px var(--d-sans);
  --ix-list-font: 12.5px/1.5 var(--d-sans); --ix-meta-font: 11px var(--d-sans); --ix-none-size: 12px; --ix-none-lh: 1.5; --ix-none-lh-list: 1.5;
}
.d-peek { position: absolute; z-index: 8; box-sizing: border-box; width: 300px; padding: 10px 14px 11px; background: var(--card); border-radius: 14px; box-shadow: 0 14px 34px -14px #0006, 0 0 0 1px var(--line); transform-origin: 50% 0; cursor: pointer; font-variant-numeric: tabular-nums; }
.d-peek[hidden] { display: none; }
/* the detail's share-by-round bars and this round's inputs (ix.mjs detailHTML sections) */
.d-ixsec section { margin-top: 16px; }
.d-ixsec h5 { display: flex; justify-content: space-between; align-items: baseline; margin: 0 0 6px; font-size: 13px; color: var(--ink); }
.d-ixsec h5 b { font-size: 12px; font-weight: 500; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.d-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

@media (prefers-reduced-motion: reduce) {
  .d-card.is-pulse::after { animation: none; }
  .variant-d *, .variant-d *::before, .variant-d *::after { transition-duration: 0s !important; }
}
.d-sheet.is-leaving, .d-detail.is-leaving { pointer-events: none; }
/* small inline controls keep a 44px hit area without changing the line */
.d-log-btn, .d-snoozed { position: relative; }
.d-surface-chip::after, .d-log-btn::after, .d-snoozed::after, .d-link::after { content: ""; position: absolute; inset: -12px -6px; }
.d-link { position: relative; }
