/* 會議記錄錄音版（/tools/meeting-notes/v4/）：分鏡 A「秘書的桌子」。
   一份 DOM 兩種樣子：一般是桌面＋便利貼＋資料夾；prefers-reduced-motion 時是分鏡 C 那樣的一列列文字（內容一字不少）。
   字：內文 17px 以上、標題 26px 以上、按鈕 56px 高（Atlas 10/18 無障礙）。 */
:root { --d4-wood: #E9E1D3; --d4-paper: #FBF8F2; --d4-memo: #FFF4B8; --d4-memo2: #FFE3D6; --d4-ink: #2b2118; --d4-soft: #6b5a48; --d4-line: #C7B79F; }
.d4 { position: relative; overflow: hidden; min-height: calc(100svh - 64px); padding: 22px 18px 26px; color: var(--d4-ink);
  background: repeating-linear-gradient(97deg, rgba(120, 90, 60, .05) 0 3px, transparent 3px 22px), radial-gradient(120% 80% at 50% 0%, #F3ECE1, #DCCFBC); }
.d4-desk { position: absolute; inset: 0; pointer-events: none; }
.d4-lamp { position: absolute; right: -80px; top: -110px; width: 340px; height: 340px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 236, 190, .8), transparent 65%); }
.d4 > * { position: relative; max-width: 620px; margin-left: auto; margin-right: auto; }
.d4-who { margin: 0 0 10px; font: 700 15px/1.3 var(--font-body); color: var(--d4-soft); letter-spacing: .04em; }
.d4-say { margin: 0; font: 900 clamp(28px, 7.6vw, 40px)/1.3 var(--font-head); letter-spacing: .01em; color: var(--d4-ink); }
.d4-say .w { display: inline-block; }
.d4-sub { margin: 10px 0 0; font: 500 17px/1.7 var(--font-body); color: var(--d4-soft); }
.d4-status { margin: 10px 0 0; min-height: 1.6em; font: 700 16px/1.5 var(--font-body); color: #02539C; }
.d4-status:empty { display: none; }

/* 托盤＝丟東西的地方 */
.d4-table { margin-top: 22px; }
.d4-tray { display: grid; place-items: center; gap: 10px; text-align: center; padding: 34px 18px; border-radius: 22px; background: var(--d4-paper); cursor: pointer;
  box-shadow: 0 30px 60px -30px rgba(70, 45, 20, .55), inset 0 0 0 2px rgba(140, 110, 80, .16); outline-offset: 4px; transition: transform .25s, box-shadow .25s; }
.d4-tray b { font: 900 23px/1.3 var(--font-head); }
.d4-tray > span:last-of-type { font: 500 16px/1.6 var(--font-body); color: var(--d4-soft); }
.d4-tray input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.d4-tray:focus-within { box-shadow: 0 0 0 4px #02539C, 0 30px 60px -30px rgba(70, 45, 20, .55); }
.d4-tray.over, .d4-tray:hover { transform: translateY(-3px) scale(1.01); box-shadow: 0 40px 70px -30px rgba(70, 45, 20, .6), inset 0 0 0 2.5px #02539C; }
.d4-mic { width: 72px; height: 72px; border-radius: 50%; background: #02539C; display: grid; place-items: center; box-shadow: 0 0 0 12px rgba(2, 83, 156, .12), 0 0 0 26px rgba(2, 83, 156, .06); animation: d4-breathe 2.6s ease-in-out infinite; }
.d4-mic i { width: 18px; height: 30px; border-radius: 10px; border: 3px solid #fff; position: relative; }
.d4-mic i::after { content: ""; position: absolute; left: 50%; bottom: -12px; width: 3px; height: 9px; background: #fff; transform: translateX(-50%); }
@keyframes d4-breathe { 50% { box-shadow: 0 0 0 16px rgba(2, 83, 156, .1), 0 0 0 34px rgba(2, 83, 156, .04); } }
.d4[data-state="idle"] .d4-tray { min-height: 290px; }
.d4:not([data-state="idle"]) .d4-tray { padding: 14px 16px; grid-template-columns: auto 1fr; text-align: left; justify-items: start; min-height: 0; }
.d4:not([data-state="idle"]) .d4-tray .d4-mic { width: 44px; height: 44px; grid-row: span 2; animation: none; box-shadow: none; }
.d4:not([data-state="idle"]) .d4-tray b { font-size: 17px; }
.d4:not([data-state="idle"]) .d4-tray > span:last-of-type { font-size: 14px; }
.d4[data-state="cooking"] .d4-tray, .d4[data-state="done"] .d4-tray { display: none; }

/* 桌上的紙（收到的檔案）與便利貼（聽到的事） */
.d4-papers, .d4-memos { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 12px; }
.d4-papers:empty, .d4-memos:empty { display: none; }
.d4-papers li { display: flex; align-items: center; gap: 10px; padding: 11px 14px; background: #fff; border-radius: 6px; box-shadow: 0 16px 26px -16px rgba(60, 40, 20, .5); font: 700 16px/1.35 var(--font-body); max-width: 100%; }
.d4-papers li:nth-child(odd) { transform: rotate(-2.5deg); } .d4-papers li:nth-child(even) { transform: rotate(2deg); }
.d4-papers li small { display: block; font-weight: 500; font-size: 14px; color: #7a6a58; }
.d4-papers .ic { flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: #02539C; color: #fff; font: 900 16px var(--font-body); }
.d4-papers .ic.doc { border-radius: 6px; background: #fff; color: #c8322b; box-shadow: inset 0 0 0 2px #c8322b; }
.d4-papers .bar { display: block; height: 4px; margin-top: 6px; border-radius: 2px; background: #EAE2D4; overflow: hidden; }
.d4-papers .bar i { display: block; height: 100%; width: 0; background: #02539C; transition: width .3s; }
.d4-memos li { width: calc(50% - 6px); padding: 12px 13px; background: var(--d4-memo); font: 800 17px/1.45 var(--font-body); color: #3d3420; box-shadow: 0 12px 20px -12px rgba(60, 40, 20, .5); }
.d4-memos li small { display: block; margin-top: 2px; font-weight: 500; font-size: 14px; color: #6f5f30; }
.d4-memos li.warn { background: var(--d4-memo2); }
.d4-memos li:nth-child(4n+1) { transform: rotate(-2deg); } .d4-memos li:nth-child(4n+2) { transform: rotate(2.4deg); }
.d4-memos li:nth-child(4n+3) { transform: rotate(1.2deg); } .d4-memos li:nth-child(4n) { transform: rotate(-1.4deg); }
@media (min-width: 640px) { .d4-memos li { width: calc(33.33% - 8px); } }

/* 一句話兩個按鈕（問問題） */
.d4-ask { margin: 18px auto 0; padding: 16px 18px; border-radius: 18px; background: #fff; box-shadow: 0 20px 40px -24px rgba(40, 30, 20, .55); }
.d4-ask[hidden] { display: none; }
.d4-ask p { margin: 0 0 12px; font: 800 18px/1.5 var(--font-body); }
.d4-ask .row { display: flex; flex-wrap: wrap; gap: 10px; }
.d4-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 56px; padding: 0 22px; border-radius: 999px; border: 2px solid #02539C; background: #fff; color: #02539C; font: 800 17px/1.2 var(--font-body); cursor: pointer; text-decoration: none; }
.d4-btn.main { background: #02539C; color: #fff; }
.d4-btn.line { background: #06C755; border-color: #06C755; color: #fff; }
.d4-btn:focus-visible, .d4-chip:focus-visible { outline: 3px solid #B3452B; outline-offset: 3px; }
.d4-btn[disabled] { opacity: .5; cursor: default; }

/* 資料夾 */
.d4-folder { margin: 22px auto 0; padding: 26px 14px 16px; border-radius: 6px 22px 22px 22px; background: #D9C39B; position: relative; box-shadow: 0 30px 50px -30px rgba(70, 45, 20, .6); }
.d4-folder[hidden] { display: none; }
.d4-folder::before { content: ""; position: absolute; left: 0; top: -20px; width: 46%; height: 28px; border-radius: 12px 12px 0 0; background: #D9C39B; }
.d4-folder .flap { position: absolute; inset: 0; border-radius: 6px 22px 22px 22px; background: linear-gradient(#E3CFAA, #D2B98D); transform-origin: top; z-index: 3; display: grid; place-items: center; font: 900 20px/1.4 var(--font-head); color: #6b5435; text-align: center; padding: 20px; }
.d4[data-state="done"] .d4-folder .flap { display: none; }
.d4-doc { position: relative; margin: 0 0 12px; padding: 14px 16px 16px; background: #fff; border-radius: 12px; box-shadow: 0 14px 26px -16px rgba(40, 30, 20, .55); }
.d4-doc:last-child { margin-bottom: 0; }
.d4-doc .k { display: inline-block; margin-bottom: 6px; padding: 2px 10px; border-radius: 999px; background: #EAF1F8; color: #02539C; font: 800 13px/1.6 var(--font-body); }
.d4-doc h3 { margin: 0 0 6px; font: 900 20px/1.4 var(--font-head); }
.d4-doc p, .d4-doc li { margin: 0; font: 500 17px/1.65 var(--font-body); color: #333d48; }
.d4-doc ul { margin: 6px 0 0; padding-left: 1.2em; }
.d4-doc .acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.d4-doc .acts .d4-btn { min-height: 48px; padding: 0 16px; font-size: 16px; }
.d4-doc.warn { box-shadow: inset 0 0 0 2px #F3C9B9, 0 14px 26px -16px rgba(40, 30, 20, .55); }
.d4-doc .flag { padding: 10px 0; border-top: 1px dashed #EBD9CF; }
.d4-doc .flag:first-of-type { border-top: 0; padding-top: 2px; }
.d4-doc .flag p { font-weight: 700; color: #7a2e17; }
.d4-doc .flag .row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.d4-doc .flag .row .d4-btn { min-height: 44px; padding: 0 14px; font-size: 15px; }
.d4-doc .flag.ok p { color: #2e7d4f; }
.d4-person { padding: 10px 0; border-top: 1px solid #EEF1F4; }
.d4-person:first-of-type { border-top: 0; }
.d4-person b { font: 900 18px/1.4 var(--font-head); }
.d4-play { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; padding: 0; border: 0; background: none; color: #02539C; font: 800 16px/1.4 var(--font-body); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.d4-doc details summary { cursor: pointer; font: 800 16px/1.6 var(--font-body); color: #02539C; margin-top: 8px; }
.d4-doc details .mn-doc { margin-top: 10px; box-shadow: none; border: 1px solid #E2E8EE; }
.d4-stamp { position: absolute; right: 14px; top: 12px; padding: 4px 10px; border: 2.5px solid #c8322b; color: #c8322b; font: 900 15px/1.2 var(--font-head); transform: rotate(-8deg); border-radius: 6px; }
audio.d4-audio { width: 100%; margin-top: 10px; }

/* 收下（最後才註冊） */
.d4-take { margin: 18px auto 0; padding: 18px; border-radius: 20px; background: #fff; box-shadow: 0 -10px 40px -18px rgba(40, 30, 20, .5); }
.d4-take h3 { margin: 0; font: 900 22px/1.4 var(--font-head); }
.d4-take p { margin: 6px 0 14px; font: 500 16px/1.6 var(--font-body); color: #4a5562; }
.d4-take .d4-btn { width: 100%; }

.d4-foot { margin-top: 22px; text-align: center; }
.d4:not([data-state="idle"]) .d4-foot { display: none; }
.d4-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 48px; padding: 0 16px; border-radius: 999px; background: #fff; border: 0; box-shadow: 0 6px 18px -8px rgba(2, 40, 80, .35); font: 700 15px/1.2 var(--font-body); color: var(--d4-ink); text-decoration: none; cursor: pointer; }
.d4-chip b { color: #02539C; }
.d4-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.d4-paste, .d4-note { margin: 12px 0 0; font: 500 15px/1.6 var(--font-body); color: var(--d4-soft); }

/* 教學、價目 */
.d4-how, .d4-price { max-width: 760px; margin: 0 auto; padding: 34px 18px 10px; }
.d4-how h2, .d4-price h2 { font: 900 26px/1.35 var(--font-head); margin: 0 0 6px; }
.d4-how-sub { margin: 0 0 16px; font-size: 16px; color: #4a5562; }
.d4-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; counter-reset: s; }
.d4-steps li { counter-increment: s; background: #fff; border-radius: 16px; padding: 12px 12px 14px; box-shadow: 0 10px 24px -16px rgba(2, 40, 80, .4); }
.d4-steps li b { display: block; margin-top: 8px; font: 800 17px/1.4 var(--font-body); }
.d4-steps li b::before { content: counter(s) "　"; color: #02539C; }
.d4-steps li > span:last-child { display: block; margin-top: 2px; font-size: 15px; line-height: 1.55; color: #4a5562; }
.d4-phone { display: block; height: 120px; border-radius: 18px; background: #0E141B; padding: 7px; position: relative; }
.d4-phone i { position: absolute; inset: 7px; border-radius: 12px; background: #F2F6FA; }
.d4-ph-1 i { background: linear-gradient(#F2F6FA, #F2F6FA) center 30%/44px 44px no-repeat, radial-gradient(circle at 50% 30%, #F3F3F3 0 30%, transparent 31%), #E8EEF4; }
.d4-ph-1 i::after, .d4-ph-2 i::after { content: ""; position: absolute; left: 50%; top: 50%; width: 30px; height: 30px; transform: translate(-50%, -50%); border-radius: 50%; background: #c8322b; box-shadow: 0 0 0 5px #fff, 0 0 0 7px #ddd; }
.d4-ph-2 i { background: repeating-linear-gradient(90deg, transparent 0 6px, #02539C33 6px 8px) center 25%/80% 24px no-repeat, #F2F6FA; }
.d4-ph-3 i::after { content: "♪✕"; position: absolute; inset: 0; display: grid; place-items: center; font: 900 30px var(--font-body); color: #c8322b; }
.d4-ph-4 i::after { content: ""; position: absolute; left: 50%; top: 50%; width: 26px; height: 26px; transform: translate(-50%, -50%); border-radius: 6px; background: #c8322b; box-shadow: 0 0 0 7px #fff, 0 0 0 9px #ddd; }
.d4-ph-5 i::after { content: "…　分享　儲存到檔案"; position: absolute; left: 8px; right: 8px; bottom: 10px; padding: 6px; border-radius: 8px; background: #fff; font: 700 11px/1.3 var(--font-body); color: #02539C; text-align: center; }
.d4-ph-6 i::after { content: "把錄音放這裡"; position: absolute; inset: 14px 10px; border: 2px dashed #C7B79F; border-radius: 10px; display: grid; place-items: center; font: 800 12px var(--font-body); color: #6b5a48; background: #FBF8F2; }
.d4-ph-7 i::after { content: "3 個案由　吳委員請假"; position: absolute; inset: 22px 12px auto; padding: 8px; background: #FFF4B8; font: 800 11px/1.4 var(--font-body); color: #3d3420; transform: rotate(-3deg); }
.d4-ph-8 i::after { content: ""; position: absolute; inset: 18px 14px; border-radius: 6px; background: #D9C39B; box-shadow: inset 0 14px 0 #fff, inset 0 28px 0 #D9C39B, inset 0 42px 0 #fff; }
.d4-ph-9 i::after { content: "用 LINE 收下"; position: absolute; left: 12px; right: 12px; bottom: 16px; padding: 7px; border-radius: 999px; background: #06C755; color: #fff; font: 800 12px var(--font-body); text-align: center; }
.d4-price ul { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 10px; }
.d4-price li { display: grid; grid-template-columns: 9em 1fr; gap: 12px; padding: 14px 16px; background: #fff; border-radius: 14px; box-shadow: 0 10px 24px -18px rgba(2, 40, 80, .4); font-size: 17px; }
.d4-price li b { font: 900 18px/1.5 var(--font-head); color: #02539C; }
@media (max-width: 420px) { .d4-price li { grid-template-columns: 1fr; gap: 2px; } }
.d4-fine { font-size: 15px; color: #4a5562; }
.d4-by { max-width: 760px; margin: 18px auto 30px; padding: 0 18px; font-size: 14px; color: #6b7684; text-align: right; }
.d4-print { display: none; }

/* 減少動態：分鏡 C 的文字版（一列一件，內容一樣） */
@media (prefers-reduced-motion: reduce) {
  .d4-memos li, .d4-papers li { width: 100%; transform: none !important; background: #fff; border-left: 5px solid #E8C84A; }
  .d4-memos li.warn { border-left-color: #E07B5A; }
  .d4-mic { animation: none; }
  .d4-tray, .d4-tray.over { transition: none; transform: none; }
}
@media print {
  body > *:not(main), main > *:not(.d4-print), .d4, .d4-how, .d4-price, .d4-by { display: none !important; }
  .d4-print { display: block !important; }
}
.d4-say { scroll-margin-top: 96px; } /* 頁首是 sticky，捲回這一句時不要被蓋住 */
