/* Điện thoại demo ở hero. Màn trong máy dựng theo đúng toạ độ app (iPhone 393 pt ngang, số đo lấy từ
   StyleSheet trong screens/*.tsx), rồi thu nhỏ bằng --k cho vừa khung. Khung có kích thước cố định,
   đổi tab không làm trang nhảy. Màu dùng biến của web (trùng lib/theme.ts), nên theo sáng / tối. */

.phone-wrap { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.phone {
  --pw: 300px; --k: 0.71247; --nh: 833px;
  width: var(--pw); height: calc(var(--pw) * 2.0444); position: relative; flex: none;
  background: #0f0d0c; border-radius: 44px; padding: 10px;
  box-shadow: 8px 8px 0 var(--accent);
  transform: none;
}
.phone::before { content: ''; position: absolute; inset: 3px; border-radius: 41px; border: 1px solid rgba(255, 255, 255, 0.12); pointer-events: none; }
@media (max-width: 359px) { .phone { --pw: 268px; --k: 0.63104; --nh: 837px; } }
.phone .screen { width: 100%; height: 100%; border-radius: 35px; overflow: hidden; position: relative; background: var(--bg); padding: 0; isolation: isolate; }
.phone-hint { font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-mute); text-align: center; max-width: 300px; line-height: 1.6; margin: 0; }

/* Ép sáng / tối riêng trong máy (Cài đặt → Chế độ tối) */
.phone.dk .d-native { --bg: #1c1917; --bg2: #292524; --ink: #f4efe6; --ink-soft: #c8bfae; --ink-mute: #78716c; --paper: #2a2622; --line: #f4efe6; --line-soft: #44403c; --accent: #f97316; --accent2: #6ea585; --accent3: #eab308; --accent4: #d4729a; --on-accent: #1c1917; }
.phone.lt .d-native { --bg: #f4efe6; --bg2: #ebe3d4; --ink: #1a1714; --ink-soft: #4a423a; --ink-mute: #8a8278; --paper: #faf6ed; --line: #1a1714; --line-soft: #c8bfae; --accent: #d4541f; --accent2: #2d5a3d; --accent3: #c89b3c; --accent4: #8b3a62; --on-accent: #faf6ed; }

.d-native {
  position: absolute; left: 0; top: 0; width: 393px; height: var(--nh);
  transform: scale(var(--k)); transform-origin: 0 0;
  background: var(--bg); color: var(--ink); font-family: var(--serif); font-size: 14px; line-height: 1.35;
  overflow: hidden; transition: background-color 0.3s, color 0.3s;
  -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none;
}
:where(.d-native button) { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; text-align: inherit; }
.d-native button:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.d-native p { margin: 0; }
.d-native .i { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; display: block; }
.d-native [hidden] { display: none !important; }

/* Thanh trạng thái */
.d-status { position: absolute; top: 0; left: 0; right: 0; height: 54px; z-index: 6; display: flex; align-items: center; justify-content: space-between; padding: 6px 30px 0 44px; font: 600 16px/1 -apple-system, 'SF Pro Text', system-ui, sans-serif; color: var(--ink); }
.d-island { position: absolute; left: 50%; top: 11px; width: 124px; height: 36px; margin-left: -62px; background: #000; border-radius: 20px; }
.d-sys { display: flex; align-items: flex-end; gap: 2px; }
.d-sys i { width: 3.5px; background: currentColor; border-radius: 1px; }
.d-sys i:nth-child(1) { height: 4px; } .d-sys i:nth-child(2) { height: 6px; } .d-sys i:nth-child(3) { height: 8.5px; } .d-sys i:nth-child(4) { height: 11px; }
.d-sys b { width: 25px; height: 12px; border: 1.5px solid currentColor; border-radius: 4px; margin-left: 6px; position: relative; opacity: 0.9; }
.d-sys b::after { content: ''; position: absolute; inset: 1.5px; right: 5px; background: currentColor; border-radius: 1.5px; }

/* Màn */
.d-scr { position: absolute; top: 54px; left: 0; right: 0; bottom: 0; overflow: hidden; }
.d-scr.enter { animation: d-in 0.38s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
@keyframes d-in { from { opacity: 0; transform: translateY(14px); } }
.d-pad { padding: 8px 20px 0; }
/* Vùng cuộn trong máy (như ScrollView của app), ẩn thanh cuộn, chừa chỗ cho thanh tab nổi */
.d-scroll { position: absolute; inset: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; padding-bottom: 130px; }
.d-scroll::-webkit-scrollbar { display: none; }
.d-scr[data-scr='today']:not([hidden]) { display: flex; flex-direction: column; }
.d-scr[data-scr='today'] .d-tcontent { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; padding-bottom: 200px; }
.d-scr[data-scr='today'] .d-tcontent::-webkit-scrollbar { display: none; }
.d-sec { font-family: var(--mono); font-weight: 500; font-size: 10px; letter-spacing: 2px; text-transform: uppercase; color: var(--ink-soft); margin: 0 0 8px; }
.d-card { background: var(--paper); border: 1.5px solid var(--line); border-radius: 14px; box-shadow: 2px 2px 0 var(--ink); margin-bottom: 12px; }

/* Thanh tab nổi */
.d-tabbar { position: absolute; left: 32px; right: 32px; bottom: 24px; z-index: 7; display: flex; justify-content: space-around; align-items: center; padding: 10px; background: var(--paper); border: 2px solid var(--line); border-radius: 26px; box-shadow: 2px 2px 0 var(--ink); }
.d-tabbar button { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; color: var(--ink-mute); border: 2px solid transparent; transition: background-color 0.18s, transform 0.12s; }
.d-tabbar button .i { width: 20px; height: 20px; }
.d-tabbar button.on { background: var(--accent); border-color: var(--ink); color: var(--on-accent); }
.d-tabbar button.on .i { width: 21px; height: 21px; }
.d-tabbar button:active { transform: scale(0.9); }

/* Thông báo nhỏ */
.d-toast { position: absolute; left: 50%; top: 64px; z-index: 9; transform: translate(-50%, -12px); opacity: 0; pointer-events: none; white-space: nowrap; background: var(--ink); color: var(--bg); font-family: var(--mono); font-size: 12px; letter-spacing: 1px; padding: 11px 18px; border-radius: 99px; transition: opacity 0.25s, transform 0.25s; }
.d-toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Nút + tròn */
.d-fab { position: absolute; right: 20px; bottom: 120px; z-index: 4; width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: var(--accent) !important; border: 2px solid var(--line) !important; color: var(--on-accent) !important; box-shadow: 2px 2px 0 var(--ink); transition: transform 0.12s; }
.d-fab .i { width: 24px; height: 24px; }
.d-fab:active { transform: scale(0.92); }

/* ── Nhật ký ── */
.d-seg { display: flex; gap: 4px; margin: 2px 20px 0; padding: 4px; background: var(--bg2); border: 1.5px solid var(--line); border-radius: 10px; }
.d-seg button { flex: 1; padding: 8px 0; border-radius: 6px; text-align: center; font-family: var(--mono); font-size: 10px; letter-spacing: 1px; text-transform: uppercase; color: var(--ink-mute); transition: background-color 0.18s; }
.d-seg button.on { background: var(--ink); color: var(--paper); }
.d-jw { position: absolute; top: 52px; left: 0; right: 0; bottom: 0; display: flex; flex-direction: column; }
.d-jdate { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.d-arrow { width: 36px; height: 36px; display: grid; place-items: center; color: var(--ink-mute); }
.d-arrow:disabled { color: var(--line-soft); cursor: default; }
.d-jc { text-align: center; flex: 1; }
.d-jc b { display: block; font-weight: 500; font-style: italic; font-size: 30px; line-height: 34px; }
.d-jc small { display: block; font-family: var(--mono); font-size: 9px; letter-spacing: 2px; text-transform: uppercase; color: var(--ink-mute); margin-top: 4px; }
.d-dots { display: flex; justify-content: center; gap: 6px; padding: 8px 0; }
.d-dots i { width: 5px; height: 5px; border-radius: 3px; background: var(--line-soft); }
.d-dots i.on { width: 16px; background: var(--ink); }
.d-moods { display: flex; justify-content: space-around; padding: 12px 20px 0; margin-bottom: 20px; }
.d-mood { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line) !important; background: var(--bg2) !important; display: grid; place-items: center; color: var(--ink-soft) !important; transition: transform 0.15s, background-color 0.15s; }
.d-mood .i { width: 24px; height: 24px; stroke-width: 1.7; }
.d-mood.on { background: var(--accent) !important; border: 2px solid var(--ink) !important; color: var(--on-accent) !important; }
.d-mood.pop { animation: d-pop 0.32s ease; }
@keyframes d-pop { 40% { transform: scale(1.18); } }
.d-editor { flex: 1; overflow: hidden; margin: 0 20px; }
.d-editor p { font-family: 'Lora', Georgia, serif; font-size: 17px; line-height: 28px; color: var(--ink); }
.d-editor p.swap { animation: d-fade 0.3s ease; }
@keyframes d-fade { from { opacity: 0; } }
.d-at { color: var(--accent); }
.d-jbot { padding: 10px 20px 102px; border-top: 1px solid var(--line-soft); }
.d-imgs { display: flex; gap: 8px; margin-bottom: 10px; height: 80px; overflow: hidden; }
.d-thumb { position: relative; width: 80px; height: 80px; flex: none; border-radius: 8px; overflow: hidden; }
.d-thumb > i { position: absolute; inset: 0; background: radial-gradient(circle at 70% 30%, rgba(255, 255, 255, 0.55) 0 8%, transparent 9%), linear-gradient(160deg, #9fb3b8 0%, #6e8a8f 45%, #c89b3c 46%, #8a6a3c 100%); }
.d-thumb.v2 > i { background: radial-gradient(circle at 30% 35%, #f4efe6 0 10%, transparent 11%), linear-gradient(200deg, #d4541f 0%, #8b3a62 55%, #2d5a3d 56%, #1f3a28 100%); }
.d-thumb.v3 > i { background: radial-gradient(circle at 60% 60%, #faf6ed 0 14%, transparent 15%), linear-gradient(120deg, #c89b3c, #6ea585); }
.d-thumb.fresh { animation: d-pop 0.35s ease; }
.d-rm { position: absolute; top: 4px; right: 4px; width: 18px; height: 18px; border-radius: 50%; background: rgba(0, 0, 0, 0.55) !important; color: #fff !important; display: grid; place-items: center; }
.d-rm .i { width: 10px; height: 10px; stroke-width: 2.5; }
.d-addimg { width: 80px; height: 80px; flex: none; border-radius: 8px; border: 1.5px dashed var(--line) !important; background: var(--bg2) !important; display: grid; place-items: center; color: var(--ink-mute) !important; }
.d-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.d-tag { border: 1px solid var(--line) !important; border-radius: 99px; padding: 3px 8px !important; background: var(--paper) !important; font-family: var(--mono) !important; font-size: 9px !important; letter-spacing: 0.5px; text-transform: lowercase; color: var(--ink) !important; transition: background-color 0.15s; }
.d-tag.on { background: var(--ink) !important; color: var(--paper) !important; }
.d-native .d-save { display: block; margin: 0 auto 12px; min-width: 220px; padding: 14px 36px !important; border-radius: 99px; border: 2px solid #000 !important; background: var(--accent) !important; color: var(--on-accent) !important; box-shadow: 2px 2px 0 #000; text-align: center !important; font-family: var(--mono) !important; font-weight: 500; font-size: 12px !important; letter-spacing: 2px; text-transform: uppercase; transition: transform 0.1s, box-shadow 0.1s; }
.d-save:active, .d-save.busy { transform: translate(2px, 2px); box-shadow: 0 0 0 #000; }
.d-jh { position: absolute; top: 52px; left: 0; right: 0; bottom: 0; padding: 14px 20px 0; }
.d-search { display: flex; align-items: center; gap: 8px; border: 1.5px solid var(--line); border-radius: 99px; padding: 9px 14px; background: var(--paper); box-shadow: 2px 2px 0 var(--ink); font-family: var(--mono); font-size: 12px; color: var(--ink-mute); }
.d-search .i { width: 13px; height: 13px; }
.d-hmeta { font-family: var(--mono); font-size: 9px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--ink-mute); margin: 12px 0 10px; }
.d-hist { padding: 16px; }
.d-hh { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 6px; }
.d-hh b { display: block; font-weight: 500; font-style: italic; font-size: 19px; }
.d-hh small { font-family: var(--mono); font-size: 9px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--ink-mute); }
.d-hm { color: var(--accent); }
.d-hm .i { width: 24px; height: 24px; stroke-width: 1.7; }
.d-hist p { font-family: 'Lora', Georgia, serif; font-size: 14px; line-height: 21px; color: var(--ink-soft); margin-bottom: 8px; }
.d-htags { display: flex; gap: 6px; }
.d-htags span { border: 1px solid var(--line-soft); border-radius: 99px; padding: 2px 8px; font-family: var(--mono); font-size: 9px; color: var(--ink-soft); }

/* ── Việc cần làm ── */
.d-thead { padding: 8px 20px 0; margin-bottom: 4px; }
.d-greet { font-weight: 500; font-style: italic; font-size: 22px; color: var(--accent); margin-bottom: -2px; }
.d-ttitle { font-size: 24px; line-height: 30px; letter-spacing: -0.3px; }
.d-ttitle em { color: var(--accent); font-style: italic; display: inline-block; }
.d-ttitle em.bump { animation: d-bump 0.45s ease; }
@keyframes d-bump { 0% { transform: translateY(0); } 35% { transform: translateY(-6px); opacity: 0.4; } 36% { transform: translateY(6px); } 100% { transform: translateY(0); opacity: 1; } }
.d-tnav { display: flex; align-items: center; gap: 6px; margin-top: 6px; color: var(--ink-mute); font-family: var(--mono); font-size: 10px; letter-spacing: 2px; text-transform: uppercase; }
.d-tnav .i { width: 16px; height: 16px; stroke-width: 1.4; }
.d-tnav span { flex: 1; }
.d-chips { display: flex; align-items: center; padding: 10px 20px; overflow-x: auto; scrollbar-width: none; white-space: nowrap; }
.d-chips::-webkit-scrollbar { display: none; }
.d-chip { flex: none; padding: 6px 12px !important; margin-right: 6px !important; border-radius: 99px; border: 1.5px solid var(--line-soft) !important; background: var(--paper) !important; font-family: var(--mono) !important; font-weight: 500; font-size: 10px !important; letter-spacing: 1.5px; text-transform: uppercase; color: var(--ink-soft) !important; transition: background-color 0.15s; }
.d-chip.on { border-color: var(--ink) !important; color: var(--paper) !important; }
.d-chip.on[data-c='ink'] { background: var(--ink) !important; }
.d-chip.on[data-c='accent'] { background: var(--accent) !important; }
.d-chip.on[data-c='accent2'] { background: var(--accent2) !important; }
.d-chip.on[data-c='accent4'] { background: var(--accent4) !important; }
.d-chip-add { flex: none; width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid var(--line-soft); background: var(--paper); display: grid; place-items: center; color: var(--ink-soft); margin-left: 4px; }
.d-chip-add .i { width: 14px; height: 14px; }
.d-tcontent { padding: 4px 20px 0; }
.d-list { overflow: hidden; margin-bottom: 14px; }
.d-tempty { font-style: italic; font-size: 18px; color: var(--ink-mute); text-align: center; padding: 18px 0 26px; }
.d-task { border-bottom: 1px dashed var(--line-soft); }
.d-task:last-child { border-bottom: 0; }
.d-task.fresh { animation: d-slide 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
@keyframes d-slide { from { opacity: 0; transform: translateX(-24px); background: var(--bg2); } }
.d-trow { display: flex; gap: 10px; padding: 12px 14px; }
.d-box { width: 20px; height: 20px; flex: none; margin-top: 2px; border: 1.5px solid var(--line) !important; border-radius: 5px; display: grid; place-items: center; color: var(--paper) !important; transition: background-color 0.15s, transform 0.15s; }
.d-box .i { width: 13px; height: 13px; opacity: 0; stroke-width: 2.6; }
.d-task.done > .d-trow .d-box { background: var(--accent2) !important; border-color: var(--accent2) !important; }
.d-task.done > .d-trow .d-box .i { opacity: 1; }
.d-box:active { transform: scale(0.85); }
.d-tbody { flex: 1; min-width: 0; }
.d-ttl { font-size: 14px; line-height: 19px; transition: opacity 0.2s; }
.d-task.done .d-ttl { text-decoration: line-through; opacity: 0.55; }
.d-meta { display: flex; align-items: center; gap: 8px; margin-top: 3px; color: var(--ink-mute); }
.d-meta:empty { display: none; }
.d-tm { font-family: var(--mono); font-size: 9px; letter-spacing: 1px; }
.d-xs { width: 12px !important; height: 12px !important; stroke-width: 2.4 !important; }
.d-tg { display: inline-flex; align-items: center; gap: 4px; font-family: var(--mono); font-size: 9px; letter-spacing: 1px; text-transform: uppercase; }
.d-tg i { width: 5px; height: 5px; border-radius: 50%; }
.d-subn { display: flex; align-items: center; gap: 4px; padding-left: 6px !important; align-self: flex-start; margin-top: 1px; font-family: var(--mono) !important; font-weight: 500; font-size: 10px !important; letter-spacing: 1px; color: var(--ink-soft) !important; }
.d-subn.all { color: var(--accent2) !important; }
.d-subn .i { width: 14px; height: 14px; color: var(--ink-mute); }
.d-subs { padding: 0 14px 6px 44px; }
.d-subs:not([hidden]) { animation: d-fade 0.25s ease; }
.d-sub { display: flex !important; align-items: center; gap: 8px; width: 100%; padding: 5px 0 !important; font-size: 13px !important; }
.d-sbox { width: 16px; height: 16px; flex: none; border: 1.5px solid var(--ink-mute); border-radius: 4px; display: grid; place-items: center; color: var(--paper); }
.d-sbox .i { width: 10px; height: 10px; opacity: 0; stroke-width: 3; }
.d-sub.done .d-sbox { background: var(--accent2); border-color: var(--accent2); }
.d-sub.done .d-sbox .i { opacity: 1; }
.d-sub.done span:last-child { text-decoration: line-through; color: var(--ink-mute); }
.d-quick { position: absolute; left: 20px; right: 88px; bottom: 120px; z-index: 4; display: flex !important; align-items: center; gap: 10px; min-height: 56px; padding: 8px 8px 8px 14px !important; background: var(--paper) !important; border: 2px solid var(--line) !important; border-radius: 26px; box-shadow: 2px 2px 0 var(--ink); }
.d-qbox { width: 22px; height: 22px; flex: none; border: 1.5px dashed var(--line-soft); border-radius: 6px; display: grid; place-items: center; color: var(--ink-mute); }
.d-qbox .i { width: 13px; height: 13px; stroke-width: 2.5; }
.d-qtext { flex: 1; font-size: 15px; color: var(--ink-mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.d-qtext.typing { color: var(--ink); }
.d-qtext.typing::after { content: ''; display: inline-block; width: 1.5px; height: 17px; margin-left: 1px; vertical-align: -3px; background: var(--accent); animation: d-blink 0.8s steps(1) infinite; }
@keyframes d-blink { 50% { opacity: 0; } }
.d-qsend { width: 34px; height: 34px; flex: none; border-radius: 50%; background: var(--accent); border: 2px solid var(--line); display: grid; place-items: center; color: var(--on-accent); transform: scale(0); transition: transform 0.2s; }
.d-qsend .i { width: 15px; height: 15px; stroke-width: 2.5; }
.d-quick.ready .d-qsend { transform: scale(1); }

/* ── Lịch ── */
.d-chead { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; }
.d-chead b { display: block; font-weight: 400; font-style: italic; font-size: 26px; line-height: 32px; }
.d-chead small { display: block; font-family: var(--mono); font-size: 10px; letter-spacing: 2px; text-transform: uppercase; color: var(--ink-mute); }
.d-pills { display: flex; gap: 6px; margin-top: 4px; }
.d-pills button { border: 1.5px solid var(--line) !important; border-radius: 99px; padding: 5px 12px !important; background: var(--paper) !important; font-family: var(--mono) !important; font-weight: 500; font-size: 10px !important; letter-spacing: 1.5px; text-transform: uppercase; }
.d-pills button.on { background: var(--ink) !important; color: var(--paper) !important; }
.d-mnav { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.d-nb { width: 30px; height: 30px; border-radius: 50%; border: 1.5px solid var(--line) !important; background: var(--paper) !important; display: grid; place-items: center; }
.d-nb .i { width: 16px; height: 16px; }
.d-ml { font-family: var(--mono) !important; font-weight: 500; font-size: 11px !important; letter-spacing: 2px; text-transform: uppercase; }
.d-grid { display: flex; flex-wrap: wrap; margin-bottom: 4px; }
.d-grid.swap, .d-week.swap { animation: d-fade 0.3s ease; }
.d-gh { width: 14.2857%; padding: 4px 0; text-align: center; font-family: var(--mono); font-size: 9px; letter-spacing: 1px; text-transform: uppercase; color: var(--ink-mute); }
.d-gc { width: 14.2857%; height: 48px; margin: 2px 0 !important; position: relative; display: grid !important; place-items: center; border: 1px solid var(--line-soft) !important; border-radius: 8px; background: var(--paper) !important; font-size: 13px !important; text-align: center !important; transition: border-color 0.15s; }
.d-gc > span:first-child { margin-top: -6px; }
.d-gc.mute { background: transparent; border-color: transparent; color: var(--ink-mute); }
.d-gc.today { background: var(--ink) !important; border-color: var(--ink) !important; color: var(--paper) !important; }
.d-gc.today .d-mk span { color: var(--paper) !important; }
.d-gc.sel { border: 2px solid var(--accent) !important; }
.d-mk { position: absolute; bottom: 4px; left: 0; right: 0; display: flex; justify-content: center; gap: 2px; }
.d-mk .i { width: 9px; height: 9px; stroke-width: 2.2; }
.d-mk.sm .i { width: 8px; height: 8px; }
.d-week { display: flex; gap: 4px; margin-bottom: 14px; }
.d-wd { flex: 1; position: relative; display: flex !important; flex-direction: column; align-items: center; padding: 10px 2px 22px !important; border: 1px solid var(--line-soft) !important; border-radius: 10px; background: var(--paper) !important; }
.d-wn { font-family: var(--mono); font-size: 8px; letter-spacing: 1px; text-transform: uppercase; color: var(--ink-mute); margin-bottom: 2px; }
.d-wnum { font-weight: 500; font-size: 16px; line-height: 20px; }
.d-wd.today { background: var(--ink) !important; border-color: var(--ink) !important; color: var(--paper); }
.d-wd.today .d-wn, .d-wd.today .d-mk span { color: var(--paper) !important; }
.d-wd.sel { border: 2px solid var(--accent) !important; }
.d-rep { padding: 14px; }
.d-rstats { display: flex; justify-content: space-between; margin-bottom: 12px; }
.d-rstats b { display: block; font-weight: 500; font-style: italic; font-size: 20px; }
.d-rstats small { font-family: var(--mono); font-size: 8px; letter-spacing: 1px; text-transform: uppercase; color: var(--ink-mute); }
.d-bars { display: flex; gap: 8px; height: 74px; align-items: stretch; }
.d-bars > div { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; }
.d-bars span { width: 100%; background: var(--accent4); border-radius: 4px; min-height: 3px; opacity: 0.85; }
.d-bars small { font-family: var(--mono); font-size: 8px; color: var(--ink-mute); }
[data-f='cdetail'] { margin-top: 14px; }
[data-f='cdetail'].swap { animation: d-fade 0.3s ease; }
[data-f='cdetail'] .d-card, .d-scr .d-sleep { padding: 14px; margin-bottom: 10px; }
.d-cl { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-family: var(--mono); font-weight: 500; font-size: 9px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--ink-soft); }
.d-cl .i { width: 14px; height: 14px; color: var(--ink); }
.d-sleep { background: var(--ink) !important; color: var(--paper); }
.d-sleep .d-cl, .d-sleep .d-cl .i { color: var(--ink-mute); }
.d-sleep .d-cl .i { color: var(--paper); }
.d-sv { display: flex; align-items: baseline; gap: 12px; }
.d-sv b { font-weight: 500; font-style: italic; font-size: 30px; }
.d-sv span { font-family: var(--mono); font-size: 10px; letter-spacing: 1.5px; text-transform: uppercase; display: inline-flex; align-items: center; gap: 6px; }
.d-sv i { width: 7px; height: 7px; border-radius: 50%; }
.d-st { font-family: var(--mono); font-size: 10px; letter-spacing: 1px; color: var(--ink-mute); margin-top: 4px; }
.d-ctask { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px dashed var(--line-soft); }
.d-ctask:last-child { border-bottom: 0; }
.d-cbox { width: 14px; height: 14px; flex: none; border: 1.5px solid var(--line); border-radius: 4px; display: grid; place-items: center; color: var(--paper); }
.d-cbox .i { width: 10px; height: 10px; opacity: 0; stroke-width: 3; }
.d-ctask.done .d-cbox { background: var(--accent2); border-color: var(--accent2); }
.d-ctask.done .d-cbox .i { opacity: 1; }
.d-ctt { flex: 1; font-size: 13px; }
.d-ctask.done .d-ctt { text-decoration: line-through; color: var(--ink-mute); }
.d-ctime { font-family: var(--mono); font-size: 9px; color: var(--ink-mute); letter-spacing: 1px; }
.d-ctask > i { width: 5px; height: 5px; border-radius: 50%; }
.d-ev { display: flex; align-items: center; padding: 6px 0; }
.d-ev > i { width: 3px; height: 28px; border-radius: 2px; margin-right: 10px; flex: none; }
.d-ev > div { flex: 1; }
.d-ev b { display: block; font-weight: 500; font-size: 13px; }
.d-ev small { font-family: var(--mono); font-size: 9px; letter-spacing: 1px; color: var(--ink-mute); }
.d-ev > .i { width: 14px; height: 14px; color: var(--ink-mute); }
.d-ev.fresh { animation: d-slide 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.d-dtext { font-family: 'Lora', Georgia, serif; font-size: 13px; line-height: 19px; color: var(--ink-soft); }
.d-empty { text-align: center; padding: 22px 14px !important; }
.d-et { font-style: italic; font-size: 20px; color: var(--ink-soft); }
.d-es { font-family: var(--mono); font-size: 9px; letter-spacing: 1px; text-transform: uppercase; color: var(--ink-mute); margin: 4px 0 12px; }
.d-eadd { display: inline-flex !important; align-items: center; gap: 6px; border: 1.5px solid var(--line) !important; border-radius: 99px; padding: 7px 14px !important; font-family: var(--mono) !important; font-size: 10px !important; letter-spacing: 1.5px; text-transform: uppercase; }
.d-eadd .i { width: 12px; height: 12px; }
.d-cfab { bottom: 100px; width: 52px; height: 52px; }
.d-cfab .i { width: 22px; height: 22px; }

/* Bảng thêm sự kiện */
.d-sheet { position: absolute; inset: 0; z-index: 8; }
.d-shbg { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.5); animation: d-fade 0.25s ease; }
.d-shp { position: absolute; left: 0; right: 0; bottom: 0; padding: 20px 20px 40px; background: var(--paper); border: 2px solid var(--line); border-bottom: 0; border-radius: 20px 20px 0 0; animation: d-up 0.35s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.d-sheet.out .d-shp { animation: d-down 0.25s ease both; }
.d-sheet.out .d-shbg { opacity: 0; transition: opacity 0.25s; }
@keyframes d-up { from { transform: translateY(100%); } }
@keyframes d-down { to { transform: translateY(100%); } }
.d-shtitle { font-weight: 500; font-style: italic; font-size: 22px; margin-bottom: 14px; }
.d-fl { font-family: var(--mono); font-weight: 500; font-size: 10px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--ink-soft); margin: 4px 0 6px; }
.d-in { border: 1.5px solid var(--line); border-radius: 10px; padding: 12px; min-height: 46px; font-size: 15px; background: var(--bg); margin-bottom: 10px; }
.d-in.typing::after { content: ''; display: inline-block; width: 1.5px; height: 17px; margin-left: 1px; vertical-align: -3px; background: var(--accent); animation: d-blink 0.8s steps(1) infinite; }
.d-times { display: flex; gap: 8px; margin-bottom: 10px; }
.d-times > div { flex: 1; border: 1.5px solid var(--line); border-radius: 10px; padding: 8px 10px; background: var(--bg); }
.d-times small { display: block; font-family: var(--mono); font-size: 8px; letter-spacing: 1px; text-transform: uppercase; color: var(--ink-mute); }
.d-times b { font-family: var(--mono); font-weight: 500; font-size: 13px; letter-spacing: 1px; }
.d-colors { display: flex; gap: 10px; margin-bottom: 18px; }
.d-col { width: 30px; height: 30px; border-radius: 50%; border: 2px solid transparent !important; }
.d-col.on { border-color: var(--ink) !important; box-shadow: 0 0 0 2px var(--paper) inset; }
.d-shbtns { display: flex; gap: 10px; }
.d-shbtns button { flex: 1; text-align: center !important; padding: 12px 0 !important; border-radius: 99px; border: 1.5px solid var(--line) !important; font-family: var(--mono) !important; font-weight: 500; font-size: 11px !important; letter-spacing: 2px; text-transform: uppercase; color: var(--ink-soft) !important; }
.d-shbtns .d-ok { background: var(--accent) !important; border-width: 2px !important; color: var(--on-accent) !important; }

/* ── Những người ── */
.d-ptitle { display: flex; align-items: flex-start; }
.d-ptitle > div { flex: 1; }
.d-ptitle b, .d-mt b { display: block; font-weight: 400; font-style: italic; font-size: 28px; line-height: 34px; }
.d-ptitle small, .d-mt small { display: block; font-family: var(--mono); font-size: 10px; letter-spacing: 2px; text-transform: uppercase; color: var(--ink-mute); margin-bottom: 16px; }
.d-trash { width: 34px; height: 34px; margin-top: 4px; border-radius: 50%; border: 1.5px solid var(--line-soft) !important; display: grid; place-items: center; color: var(--ink-soft) !important; }
.d-trash .i { width: 15px; height: 15px; }
.d-psearch { display: flex !important; width: 100%; align-items: center; gap: 8px; margin-bottom: 12px; padding: 8px 14px !important; border: 1.5px solid var(--line) !important; border-radius: 99px; background: var(--paper) !important; box-shadow: 2px 2px 0 var(--ink); font-family: var(--mono) !important; font-size: 12px !important; }
.d-psearch .i { width: 13px; height: 13px; color: var(--ink-mute); }
.d-psearch .ph { color: var(--ink-mute); }
.d-psearch .typing::after { content: ''; display: inline-block; width: 1.5px; height: 13px; margin-left: 1px; vertical-align: -2px; background: var(--accent); animation: d-blink 0.8s steps(1) infinite; }
.d-pchips { display: flex; margin-bottom: 16px; white-space: nowrap; }
.d-pchip { flex: none; display: inline-flex !important; align-items: center; gap: 6px; margin-right: 8px !important; padding: 5px 12px !important; border: 1.5px solid var(--line) !important; border-radius: 99px; background: var(--paper) !important; font-family: var(--mono) !important; font-size: 9px !important; letter-spacing: 1px; text-transform: uppercase; transition: background-color 0.15s; }
.d-pchip i { width: 7px; height: 7px; border-radius: 50%; }
.d-pchip.on { background: var(--ink) !important; color: var(--paper) !important; }
.d-padd { padding: 5px 9px !important; }
.d-padd .i { width: 12px; height: 12px; }
.d-person { display: flex; gap: 12px; align-items: center; padding: 14px; margin-bottom: 10px; background: var(--paper); border: 1.5px solid var(--line); border-radius: 14px; box-shadow: 2px 2px 0 var(--ink); }
.d-person.fresh { animation: d-slide 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.d-av { position: relative; width: 46px; height: 46px; flex: none; border-radius: 50%; border: 1.5px solid var(--line); display: grid; place-items: center; font-weight: 500; font-style: italic; font-size: 16px; color: var(--paper); }
.d-av i { position: absolute; right: -1px; bottom: -1px; width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid var(--paper); }
.d-pinfo { flex: 1; min-width: 0; }
.d-pinfo b { display: block; font-weight: 500; font-size: 15px; }
.d-pinfo small { display: block; font-family: var(--mono); font-size: 9px; letter-spacing: 1px; text-transform: uppercase; color: var(--ink-mute); margin-top: 2px; }
.d-pinfo em { display: block; font-size: 14px; color: var(--accent); margin-top: 2px; }
.d-pr { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.d-last { font-family: var(--mono); font-size: 8px; letter-spacing: 0.5px; text-transform: uppercase; color: var(--ink-mute); }
.d-last.flash { color: var(--accent2); animation: d-pop 0.35s ease; }
.d-badge { border: 1px solid; border-radius: 99px; padding: 2px 6px; font-family: var(--mono); font-size: 8px; letter-spacing: 0.5px; text-transform: uppercase; }
.d-ping { display: inline-flex !important; align-items: center; gap: 3px; padding: 3px 7px !important; border: 1px solid var(--line-soft) !important; border-radius: 99px; font-family: var(--mono) !important; font-size: 7px !important; letter-spacing: 0.5px; text-transform: uppercase; color: var(--ink-soft) !important; }
.d-ping .i { width: 10px; height: 10px; }
.d-ping.ok { border-color: var(--accent2) !important; color: var(--accent2) !important; }
.d-pnone { font-style: italic; font-size: 18px; color: var(--ink-mute); text-align: center; padding: 26px 0; }
.d-pfab { bottom: 100px; width: 50px; height: 50px; }

/* ── Khám phá ── */
.d-mgrid { display: flex; flex-wrap: wrap; gap: 12px; }
.d-mcard { width: calc(50% - 6px); display: flex !important; flex-direction: column; align-items: flex-start; padding: 18px !important; background: var(--paper) !important; border: 1.5px solid var(--line) !important; border-radius: 16px; box-shadow: 2px 2px 0 var(--ink); transition: transform 0.12s, box-shadow 0.12s; }
.d-mcard:active { transform: translate(2px, 2px); box-shadow: 0 0 0 var(--ink); }
.d-mi { width: 44px; height: 44px; border-radius: 12px; border: 1.5px solid var(--line); display: grid; place-items: center; margin-bottom: 12px; color: var(--paper); }
.d-mcard b { font-weight: 500; font-size: 15px; margin-bottom: 2px; }
.d-mcard small { font-family: var(--mono); font-size: 9px; letter-spacing: 1px; text-transform: uppercase; color: var(--ink-mute); text-align: left; }
.d-stats { overflow: hidden; }
.d-stats > div { display: flex; align-items: center; gap: 10px; padding: 14px; border-bottom: 1px solid var(--line-soft); }
.d-stats > div:last-child { border-bottom: 0; }
.d-stats i { width: 8px; height: 8px; border-radius: 50%; }
.d-stats span { flex: 1; font-size: 13px; }
.d-stats b { font-family: var(--mono); font-weight: 500; font-size: 11px; color: var(--ink-soft); }
.d-back { display: block; margin: 0 0 10px; padding: 0 0 4px !important; font-family: var(--mono) !important; font-size: 12px !important; letter-spacing: 1px; text-transform: uppercase; color: var(--accent) !important; }
[data-sub]:not([hidden]) { animation: d-in 0.32s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.d-notes { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.d-note { border: 1.5px solid var(--line); border-radius: 14px; padding: 14px; box-shadow: 2px 2px 0 var(--ink); min-height: 120px; color: #1a1714; }
.d-note b { display: block; font-weight: 500; font-size: 15px; margin-bottom: 6px; }
.d-note p { font-style: italic; font-size: 13px; line-height: 18px; color: #4a423a; }
.d-note.n1 { background: #fff8e0; } .d-note.n2 { background: #ffe8d6; } .d-note.n3 { background: #d6f0e0; } .d-note.n4 { background: #e8d6f0; }
.phone.dk .d-note, .d-native .d-note.dark { color: #f4efe6; }
.phone.dk .d-note p { color: #c8bfae; }
.phone.dk .d-note.n1 { background: #3a3520; } .phone.dk .d-note.n2 { background: #3a2820; } .phone.dk .d-note.n3 { background: #1f3a28; } .phone.dk .d-note.n4 { background: #2a1f3a; }
.d-set { overflow: hidden; }
.d-set > div, .d-set > button { display: flex !important; width: 100%; align-items: center; gap: 12px; padding: 14px !important; }
.d-set span { flex: 1; text-align: left; }
.d-set b { display: block; font-weight: 500; font-size: 15px; }
.d-set small { display: block; font-family: var(--mono); font-size: 9px; letter-spacing: 1px; text-transform: uppercase; color: var(--ink-mute); margin-top: 2px; }
.d-set .i { width: 16px; height: 16px; color: var(--ink-mute); }
.d-sw { width: 50px; height: 30px; flex: none; border-radius: 99px; background: var(--line-soft) !important; position: relative; transition: background-color 0.2s; }
.d-sw i { position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); transition: transform 0.2s; }
.d-sw.on { background: var(--accent2) !important; }
.d-sw.on i { transform: translateX(20px); }

@media (prefers-reduced-motion: reduce) {
  .d-native *, .d-native *::before, .d-native *::after { animation: none !important; transition: none !important; }
}
