/* 問答 widget：顏色只吃 base.css 的變數（--accent --accent-ink --bg --surface --ink 與推導色），換皮不用改這支。
   要嵌進別的網站：載 base.css 的變數（或自己定義同名變數）＋這支＋widget.js。 */
.asst {
  --a-text: color-mix(in oklab, var(--accent) 58%, var(--ink));
  --a-r: var(--radius, 14px);
  --a-edge: max(20px, env(safe-area-inset-right));
  --a-foot: max(20px, env(safe-area-inset-bottom));
  --a-size: 56px;
  font-family: var(--font-sans);
}
.asst .ic { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.asst .ic--fill { fill: currentColor; stroke: none; }
/* :where 不加權重，各按鈕自己的顏色才蓋得過 */
:where(.asst) button { font: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }

/* ── 啟動鈕 ── */
.asst-launch {
  position: fixed; z-index: 96; right: var(--a-edge); bottom: var(--a-foot);
  width: var(--a-size); height: var(--a-size); border-radius: 50%; border: 0; padding: 0;
  display: grid; place-items: center; background: var(--accent); color: var(--accent-ink);
  box-shadow: 0 1px 2px rgb(0 0 0 / .12), 0 12px 28px -10px rgb(0 0 0 / .45);
  transition: transform .45s var(--spring);
  animation: asst-launch-in .7s var(--spring) .25s both;
}
.asst-launch .ic { grid-area: 1 / 1; width: 24px; height: 24px; transition: transform .45s var(--ease), opacity .3s var(--ease); }
.asst-launch__x { opacity: 0; transform: rotate(-90deg) scale(.5); }
.asst-launch[aria-expanded='true'] .asst-launch__chat { opacity: 0; transform: rotate(90deg) scale(.5); }
.asst-launch[aria-expanded='true'] .asst-launch__x { opacity: 1; transform: none; }
.asst-launch:active { transform: scale(.93); }
@media (hover: hover) and (pointer: fine) { .asst-launch:hover { transform: scale(1.06); } }
@keyframes asst-launch-in { from { opacity: 0; transform: scale(.6) translateY(12px); } }

/* ── 打招呼小氣泡 ── */
.asst-greet {
  position: fixed; z-index: 96; right: var(--a-edge); bottom: calc(var(--a-foot) + var(--a-size) + 12px);
  width: max-content; max-width: min(300px, calc(100% - 40px));
  display: flex; align-items: flex-start;
  background: var(--surface); color: var(--ink); border-radius: calc(var(--a-r) + 4px) calc(var(--a-r) + 4px) 4px calc(var(--a-r) + 4px);
  box-shadow: 0 0 0 1px var(--line), 0 18px 40px -18px rgb(0 0 0 / .4);
  transform-origin: 100% 100%;
  animation: asst-greet-in .6s var(--spring) both;
}
.asst-greet__body { display: flex; gap: 10px; align-items: flex-start; text-align: left; border: 0; background: none; padding: 12px 4px 12px 12px; font-size: 14px; line-height: 1.45; }
.asst-greet__av { width: 28px; height: 28px; font-size: 13px; }
.asst-greet__x { flex: none; width: 30px; height: 30px; margin: 6px 6px 0 0; border: 0; border-radius: 50%; background: none; color: var(--ink-3); display: grid; place-items: center; }
.asst-greet__x .ic { width: 15px; height: 15px; }
@media (hover: hover) and (pointer: fine) { .asst-greet__x:hover { background: var(--well); color: var(--ink); } }
@keyframes asst-greet-in { from { opacity: 0; transform: translateY(10px) scale(.92); } }

/* ── 頭像（字母章） ── */
.asst-av {
  display: inline-grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 50%;
  background: var(--accent); color: var(--accent-ink); font: 700 15px/1 var(--font-sans); letter-spacing: 0;
}
.asst-av[data-shape='squircle'] { border-radius: 32%; }
.asst-av[data-shape='square'] { border-radius: 4px; }

/* ── 面板 ── */
.asst-panel {
  position: fixed; z-index: 100; right: var(--a-edge); bottom: calc(var(--a-foot) + var(--a-size) + 14px);
  width: min(408px, calc(100% - 32px)); height: min(700px, calc(100dvh - var(--a-size) - 64px));
  display: flex; flex-direction: column; overflow: hidden; outline: none;
  background: var(--surface); color: var(--ink);
  border-radius: calc(var(--a-r) + 6px);
  box-shadow: 0 0 0 1px var(--line), 0 30px 70px -24px rgb(0 0 0 / .42);
}

.asst-head { display: flex; align-items: center; gap: 10px; padding: 12px 10px 12px 14px; border-bottom: 1px solid var(--line); }
.asst-head__who { min-width: 0; flex: 1; }
.asst-head__name { margin: 0; font: 650 15.5px/1.2 var(--font-sans); letter-spacing: -.005em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.asst-head__status { margin: 3px 0 0; display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.asst-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex: none; box-shadow: 0 0 0 2px var(--accent-soft); }
.asst-head__human {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 11px; border-radius: 999px;
  border: 1px solid var(--line-2); background: none; font-size: 13px; font-weight: 600; white-space: nowrap;
  transition: background-color .2s var(--ease);
}
.asst-head__human .ic { width: 16px; height: 16px; }
.asst-iconbtn { width: 34px; height: 34px; border: 0; border-radius: 50%; background: none; color: var(--ink-2); display: grid; place-items: center; flex: none; transition: background-color .2s var(--ease); }
@media (hover: hover) and (pointer: fine) {
  .asst-iconbtn:hover, .asst-head__human:hover { background: var(--well); color: var(--ink); }
}

/* ── 訊息區 ── */
.asst-log {
  flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; outline: none;
  display: flex; flex-direction: column; gap: 16px; padding: 18px 16px 10px;
  scrollbar-width: thin; scrollbar-color: var(--line-2) transparent;
}
.asst-log:focus-visible { box-shadow: inset 0 0 0 2px var(--accent-line); }
.msg { display: flex; gap: 10px; min-width: 0; }
.msg__av { width: 26px; height: 26px; font-size: 12px; margin-top: 1px; }
.msg__body { min-width: 0; flex: 1; font-size: 14.5px; line-height: 1.55; overflow-wrap: anywhere; }
.msg--user { align-self: flex-end; max-width: 84%; }
.msg__bubble {
  margin: 0; padding: 9px 14px; white-space: pre-wrap;
  background: var(--accent); color: var(--accent-ink); font-size: 14.5px; line-height: 1.5;
  border-radius: calc(var(--a-r) + 4px) calc(var(--a-r) + 4px) 5px calc(var(--a-r) + 4px);
}
/* 借 post-lab M02：使用者泡泡用低回彈彈簧落地 */
.msg.is-landing { transform-origin: 100% 100%; animation: asst-land .55s var(--spring) both; }
@keyframes asst-land { from { opacity: 0; transform: translateY(16px) scale(.94); } }

.md p { margin: 0 0 .55em; }
.md ul { margin: .2em 0 .6em; padding-left: 1.15em; }
.md li { margin: .18em 0; padding-left: .1em; }
.md li::marker { color: var(--ink-3); }
.md > :last-child { margin-bottom: 0; }
.md strong { font-weight: 650; }
.md-pending { display: none !important; }
/* 串流進來的每個 token 淡入＋去一點模糊 */
.tk { animation: asst-tk .36s var(--ease-out) both; }
@keyframes asst-tk { from { opacity: 0; filter: blur(2.5px); } }
.msg__stopped { margin: .35em 0 0; font-size: 12px; color: var(--ink-3); font-style: italic; }

/* 思考中（借 post-lab M03 goo）：三個點互相靠近時融成一團 */
.asst-goo { display: flex; align-items: center; height: 26px; padding: 0 8px; margin-left: -8px; filter: url(#asst-goo); }
.asst-goo i { width: 9px; height: 9px; border-radius: 50%; background: var(--ink-3); margin-right: 3px; animation: asst-goo-l 1.25s var(--ease) infinite; }
.asst-goo i:nth-child(2) { animation-name: asst-goo-m; }
.asst-goo i:nth-child(3) { animation-name: asst-goo-r; }
@keyframes asst-goo-l { 0%, 100% { transform: none; } 45% { transform: translateX(7px) scale(.9); } }
@keyframes asst-goo-m { 0%, 100% { transform: scale(.85); } 45% { transform: scale(1.3); } }
@keyframes asst-goo-r { 0%, 100% { transform: none; } 45% { transform: translateX(-7px) scale(.9); } }

/* 卡片依序冒出 */
.is-pop { animation: asst-pop .5s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 90ms + 60ms); }
@keyframes asst-pop { from { opacity: 0; transform: translateY(8px); } }
.msg--note.is-pop, .msg.is-pop { animation-delay: 0ms; }

/* 建議問題膠囊／快捷回覆 */
.asst-sugg, .asst-qr { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.asst-sugg__btn, .asst-qr__btn {
  border: 1px solid var(--accent-line); background: var(--surface); border-radius: 999px;
  padding: 7px 13px; font-size: 13.5px; font-weight: 500; line-height: 1.3; text-align: left;
  transition: background-color .2s var(--ease), transform .35s var(--spring);
}
.asst-qr__btn { font-size: 13px; padding: 6px 12px; border-color: var(--line-2); }
.asst-sugg__btn:active, .asst-qr__btn:active { transform: scale(.96); }
@media (hover: hover) and (pointer: fine) { .asst-sugg__btn:hover, .asst-qr__btn:hover { background: var(--accent-soft); } }
.asst[data-open] .asst-sugg__btn { animation: asst-pop .5s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 60ms + 160ms); }
.asst-qr.is-spent { display: none; }

/* 來源（借 post-lab U10 螢光筆連結：淡色底塊、box-decoration-break 讓換行兩段都有圓角） */
.asst-src { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 8px; margin-top: 12px; font-size: 13px; }
.asst-src__label { color: var(--ink-3); font-size: 12px; font-weight: 500; }
.asst-src__chip {
  color: var(--ink); text-decoration: none; border-radius: .22em; padding: .1em .35em; line-height: 1.5;
  background: color-mix(in oklab, var(--accent) 20%, var(--surface));
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
  transition: filter .2s var(--ease-out), scale .2s var(--ease-out);
}
@media (hover: hover) and (pointer: fine) { .asst-src__chip:hover { filter: saturate(1.6); scale: 1.03; } }

.asst-cta {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 12px; padding: 9px 12px 9px 11px;
  border: 1px solid var(--line-2); background: var(--well); border-radius: calc(var(--a-r) - 2px);
  font-size: 13.5px; font-weight: 600;
}
.asst-cta .ic { width: 16px; height: 16px; }
.asst-cta__arrow { transition: transform .35s var(--spring); color: var(--a-text); }
@media (hover: hover) and (pointer: fine) { .asst-cta:hover .asst-cta__arrow { transform: translateX(3px); } }

.asst-card__title { display: flex; align-items: center; gap: 7px; margin: 0 0 10px; font-size: 13px; font-weight: 600; }
.asst-card__title .ic { width: 16px; height: 16px; color: var(--a-text); }

/* 商品／方案推薦卡：橫向滑 */
.asst-prods { margin-top: 14px; }
.asst-prods__track {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(172px, 74%); gap: 10px;
  overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain;
  margin-right: -16px; padding: 2px 16px 8px 2px; scroll-padding-left: 2px;
  scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; outline: none;
}
.asst-prods__track:focus-visible { box-shadow: inset 0 0 0 2px var(--accent-line); border-radius: 8px; }
.prod {
  scroll-snap-align: start; display: flex; flex-direction: column; gap: 4px; min-width: 0;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--a-r); padding: 10px 12px 12px;
}
.prod__art { position: relative; height: 82px; margin: 0 -2px 6px; border-radius: max(4px, calc(var(--a-r) - 4px)); background: var(--well); overflow: hidden; }
.prod__art span { position: absolute; display: block; }
.prod__art span:first-child { background: var(--accent); }
.prod__art span:last-child { background: color-mix(in oklab, var(--accent) 35%, var(--surface)); }
.prod__art[data-shape='disc'] span:first-child { width: 54px; height: 54px; border-radius: 50%; left: 22%; top: 14px; }
.prod__art[data-shape='disc'] span:last-child { width: 54px; height: 54px; border-radius: 50%; left: calc(22% + 30px); top: 14px; mix-blend-mode: multiply; opacity: .8; }
.prod__art[data-shape='arch'] span:first-child { width: 46px; height: 62px; border-radius: 999px 999px 4px 4px; left: 50%; translate: -50% 0; bottom: 0; }
.prod__art[data-shape='arch'] span:last-child { width: 100%; height: 12px; left: 0; bottom: 0; }
.prod__art[data-shape='slab'] span:first-child { width: 62%; height: 18px; border-radius: 4px; left: 19%; top: 34px; }
.prod__art[data-shape='slab'] span:last-child { width: 50%; height: 26px; left: 25%; top: 52px; background: none; border-inline: 6px solid color-mix(in oklab, var(--accent) 35%, var(--surface)); }
.prod__art[data-shape='stack'] span:first-child { width: 42px; height: 42px; border-radius: 10px; left: calc(50% - 30px); top: 14px; rotate: -8deg; }
.prod__art[data-shape='stack'] span:last-child { width: 42px; height: 42px; border-radius: 10px; left: calc(50% - 8px); top: 26px; rotate: 6deg; }
.prod__art[data-shape='pill'] span:first-child { width: 70%; height: 30px; border-radius: 999px; left: 15%; top: 26px; }
.prod__art[data-shape='pill'] span:last-child { width: 30px; height: 30px; border-radius: 50%; left: calc(85% - 30px); top: 26px; background: var(--surface); scale: .62; }
:root[data-mode='dark'] .prod__art[data-shape='disc'] span:last-child { mix-blend-mode: screen; }
.prod__top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.prod__name { margin: 0; font: 600 14.5px/1.3 var(--font-display); min-width: 0; }
.prod__tag { flex: none; font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 999px; background: var(--accent-soft); color: var(--ink); }
.prod__price { margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 5px; }
.prod__price strong { font: 600 17px/1.2 var(--font-display); white-space: nowrap; }
.prod__price span { font-size: 12px; color: var(--ink-3); }
.prod__note { margin: 0; font-size: 12.5px; line-height: 1.45; color: var(--ink-2); flex: 1; }
.prod__btn { align-self: flex-start; display: inline-flex; align-items: center; gap: 4px; margin-top: 6px; border: 0; background: none; padding: 4px 0; font-size: 13px; font-weight: 600; color: var(--a-text); }
.prod__btn .ic { width: 15px; height: 15px; transition: transform .35s var(--spring); }
@media (hover: hover) and (pointer: fine) { .prod__btn:hover .ic { transform: translateX(3px); } }

/* 查訂單狀態卡 */
.asst-order { margin-top: 14px; padding: 14px; background: var(--well); border: 1px solid var(--line); border-radius: var(--a-r); }
.order-form__label { display: block; font-size: 12px; color: var(--ink-2); margin-bottom: 6px; }
.order-form__row { display: flex; gap: 6px; }
.order-form__input {
  flex: 1; min-width: 0; height: 38px; padding: 0 11px; font: 500 14px/1 var(--font-mono); letter-spacing: .02em; text-transform: uppercase;
  border: 1px solid var(--line-2); border-radius: max(6px, calc(var(--a-r) - 4px)); background: var(--surface); color: var(--ink); outline: none;
}
.order-form__input::placeholder { text-transform: none; color: var(--ink-3); font-family: var(--font-sans); letter-spacing: 0; }
.order-form__input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.order-form__input[aria-invalid='true'] { border-color: var(--accent); }
.order-form__btn { flex: none; height: 38px; padding: 0 14px; border: 0; border-radius: max(6px, calc(var(--a-r) - 4px)); background: var(--ink); color: var(--surface); font-size: 13.5px; font-weight: 600; }
.order-form__btn:active { transform: scale(.97); }
.order-form__err { margin: 6px 0 0; font-size: 12.5px; font-weight: 500; color: var(--a-text); }
.order-form__err:empty { display: none; }
.order-form__hint { margin: 6px 0 0; font-size: 11.5px; color: var(--ink-3); }
.order-res { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line-2); }
.order-res__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.order-res__id { font: 600 13px/1 var(--font-mono); }
.order-res__state { font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); }
.steps { --u: 380ms; list-style: none; margin: 16px 0 12px; padding: 0; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; }
.step { position: relative; display: grid; justify-items: center; gap: 7px; text-align: center; min-width: 0; }
.step__dot {
  position: relative; z-index: 1; width: 14px; height: 14px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--line-2);
  transition: background-color .25s var(--ease), border-color .25s var(--ease), box-shadow .25s var(--ease);
  transition-delay: calc(var(--i) * var(--u));
}
.step__seg { position: absolute; top: 5.5px; right: 50%; width: 100%; height: 3px; border-radius: 2px; background: var(--line-2); overflow: hidden; }
.step__seg::after { content: ''; position: absolute; inset: 0; background: var(--accent); transform: scaleX(0); transform-origin: 0 50%; transition: transform var(--u) var(--ease); transition-delay: calc((var(--i) - 1) * var(--u)); }
.step:first-child .step__seg { display: none; }
.step[data-state='done'] .step__dot { background: var(--accent); border-color: var(--accent); }
.step[data-state='current'] .step__dot { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.step:not([data-state='todo']) .step__seg::after { transform: none; }
.steps.is-pre .step__dot { background: var(--surface); border-color: var(--line-2); box-shadow: none; transition: none; }
.steps.is-pre .step__seg::after { transform: scaleX(0); transition: none; }
.step__lbl { font-size: 11.5px; line-height: 1.25; color: var(--ink-3); overflow-wrap: anywhere; padding: 0 2px; }
.step[data-state='current'] .step__lbl { color: var(--ink); font-weight: 600; }
.order-res__dl { margin: 0; display: grid; gap: 5px; font-size: 12.5px; }
.order-res__dl div { display: flex; justify-content: space-between; gap: 12px; }
.order-res__dl dt { color: var(--ink-3); flex: none; }
.order-res__dl dd { margin: 0; font-weight: 600; text-align: right; min-width: 0; }

/* 讚／倒讚／複製 */
.msg__tools { display: flex; align-items: center; gap: 2px; margin: 8px 0 0 -6px; }
.asst-tool { width: 30px; height: 30px; border: 0; border-radius: 8px; background: none; color: var(--ink-3); display: grid; place-items: center; transition: color .2s var(--ease), background-color .2s var(--ease), transform .35s var(--spring); }
.asst-tool .ic { width: 15px; height: 15px; grid-area: 1 / 1; transition: opacity .2s var(--ease), transform .35s var(--spring); }
.asst-tool:active { transform: scale(.88); }
.asst-tool[aria-pressed='true'] { color: var(--a-text); }
.asst-tool[aria-pressed='true'] .ic { fill: color-mix(in oklab, var(--accent) 28%, transparent); }
.asst-tool__ok { opacity: 0; transform: scale(.5); }
.asst-tool[data-done] { color: var(--a-text); }
.asst-tool[data-done] .asst-tool__copy { opacity: 0; transform: scale(.5); }
.asst-tool[data-done] .asst-tool__ok { opacity: 1; transform: none; }
@media (hover: hover) and (pointer: fine) { .asst-tool:hover { background: var(--well); color: var(--ink); } }
.msg__say { font-size: 12px; color: var(--ink-3); margin-left: 6px; opacity: 0; transform: translateX(-4px); transition: opacity .25s var(--ease), transform .35s var(--ease-out); }
.msg__say.is-on { opacity: 1; transform: none; }

.msg__notice { display: flex; gap: 8px; align-items: flex-start; margin: 0; padding: 10px 12px; border-radius: var(--a-r); background: var(--accent-soft); font-size: 14px; }
.msg__notice .ic { width: 16px; height: 16px; margin-top: 3px; color: var(--a-text); }

/* ── 輸入列 ── */
.asst-compose { display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px 8px; border-top: 1px solid var(--line); }
.asst-compose__input {
  flex: 1; min-width: 0; resize: none; margin: 0; padding: 9px 13px; border-radius: calc(var(--a-r) + 4px);
  border: 1px solid var(--line-2); background: var(--well); color: var(--ink);
  font: 400 15px/22px var(--font-sans); outline: none; max-height: 132px;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.asst-compose__input::placeholder { color: var(--ink-3); }
.asst-compose__input:focus { border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-soft); background: var(--surface); }
.asst-send {
  flex: none; width: 40px; height: 40px; border: 0; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink); transition: opacity .2s var(--ease), transform .35s var(--spring);
}
.asst-send .ic { grid-area: 1 / 1; width: 19px; height: 19px; transition: opacity .2s var(--ease), transform .3s var(--ease); }
.asst-send__stop { opacity: 0; transform: scale(.4); }
.asst-send[data-mode='stop'] { background: var(--ink); color: var(--surface); }
.asst-send[data-mode='stop'] .asst-send__up { opacity: 0; transform: translateY(-6px); }
.asst-send[data-mode='stop'] .asst-send__stop { opacity: 1; transform: none; }
.asst-compose[data-empty='true'] .asst-send[data-mode='send'] { opacity: .42; }
.asst-send:active { transform: scale(.92); }
.asst-note { margin: 0; padding: 0 16px 10px; font-size: 11px; line-height: 1.4; color: var(--ink-3); text-align: center; }

/* ── 轉真人表單（面板內的底部抽屜） ── */
.asst-sheet { position: absolute; inset: 0; z-index: 5; display: flex; flex-direction: column; justify-content: flex-end; }
.asst-sheet__scrim { position: absolute; inset: 0; background: color-mix(in oklab, var(--ink) 30%, transparent); animation: asst-fade .3s var(--ease) both; }
.asst-sheet__box {
  position: relative; max-height: 94%; overflow-y: auto; overscroll-behavior: contain;
  padding: 20px 18px max(16px, env(safe-area-inset-bottom)); background: var(--surface);
  border-radius: calc(var(--a-r) + 6px) calc(var(--a-r) + 6px) 0 0;
  box-shadow: 0 -18px 40px -20px rgb(0 0 0 / .35);
  animation: asst-sheet-up .46s var(--ease-out) both;
}
@keyframes asst-fade { from { opacity: 0; } }
@keyframes asst-sheet-up { from { transform: translateY(100%); } }
.asst-sheet__title { margin: 0; font: 600 19px/1.25 var(--font-display); }
.asst-sheet__intro { margin: 6px 0 14px; font-size: 13.5px; color: var(--ink-2); }
.fld { display: block; margin-bottom: 11px; }
.fld__label { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 5px; }
.fld__input {
  display: block; width: 100%; height: 42px; padding: 0 12px; border-radius: max(6px, calc(var(--a-r) - 4px));
  border: 1px solid var(--line-2); background: var(--bg); color: var(--ink); font: 400 15px/1.4 var(--font-sans); outline: none;
}
.fld__input--area { height: auto; padding: 9px 12px; resize: vertical; min-height: 70px; }
.fld__input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.fld__input[aria-invalid] { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.asst-sheet__err { margin: 0 0 8px; font-size: 13px; font-weight: 500; color: var(--a-text); }
.asst-sheet__err:empty { display: none; }
.asst-sheet__actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 6px; }
.asst-sheet__cancel { border: 0; background: none; padding: 10px 12px; font-size: 14px; font-weight: 600; color: var(--ink-2); border-radius: 999px; }
@media (hover: hover) and (pointer: fine) { .asst-sheet__cancel:hover { background: var(--well); } }

/* 借 post-lab M05 按鈕→讀取→打勾：改吃 --accent／--ink，曲線用 --ease */
.lc {
  position: relative; display: inline-grid; place-items: center; grid-template-columns: minmax(0, 1fr); overflow: hidden;
  height: 46px; width: 172px; border: 0; border-radius: 999px; padding: 0 16px;
  background: var(--accent); color: var(--accent-ink); font-size: 15px; font-weight: 600;
  transition: width .8s var(--ease), background-color .2s var(--ease), color .2s var(--ease);
}
.lc > * { grid-area: 1 / 1; }
.lc[data-state='loading'], .lc[data-state='done'] { width: 46px; pointer-events: none; }
.lc[data-state='done'] { background: var(--ink); color: var(--surface); }
.lc-label { transition: opacity .32s var(--ease); white-space: nowrap; }
.lc:not([data-state='idle']) .lc-label { opacity: 0; }
.lc svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; opacity: 0; transition: opacity .4s var(--ease) .4s; }
.lc-spin circle { stroke-dasharray: 40 100; transform-origin: center; animation: asst-rot .8s linear infinite; }
.lc[data-state='loading'] .lc-spin { opacity: 1; }
.lc[data-state='done'] .lc-spin { transition: opacity .12s linear; }
.lc-check path { stroke-dasharray: 24; stroke-dashoffset: 24; transition: stroke-dashoffset .5s var(--ease) .12s; }
.lc[data-state='done'] .lc-check { opacity: 1; transition-delay: 0s; }
.lc[data-state='done'] .lc-check path { stroke-dashoffset: 0; }
.lc:active { transform: scale(.97); }
@keyframes asst-rot { to { transform: rotate(360deg); } }

/* ── 手機：全螢幕（含 safe-area；高度跟 visualViewport，鍵盤出來輸入框不被蓋） ── */
@media (max-width: 560px) {
  .asst { --a-edge: max(16px, env(safe-area-inset-right)); --a-foot: max(16px, env(safe-area-inset-bottom)); --a-size: 54px; }
  .asst-panel {
    left: 0; right: 0; top: var(--vvt, 0px); bottom: auto; width: 100%; height: var(--vvh, 100dvh);
    border-radius: 0; box-shadow: none;
    padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right);
  }
  .asst-head { padding-top: max(10px, env(safe-area-inset-top)); }
  .asst-compose__input, .order-form__input, .fld__input { font-size: 16px; } /* iOS 小於 16px 會自動放大 */
  .asst-note { padding-bottom: max(10px, env(safe-area-inset-bottom)); }
  .asst-head__human span { max-width: 9em; overflow: hidden; text-overflow: ellipsis; }
}

@media (prefers-reduced-motion: reduce) {
  .tk, .is-pop, .msg.is-landing, .asst-greet, .asst-launch { animation: none; }
  .asst-goo i { animation: none; }
  .asst-goo i:nth-child(2) { transform: scale(1.1); }
}

/* 觸控：可點的東西至少 40px 高 */
@media (pointer: coarse) {
  .asst-iconbtn, .asst-tool, .asst-greet__x { width: 40px; height: 40px; }
  .asst-greet__x { margin: 2px 2px 0 0; }
  .asst-head__human { height: 40px; }
  .asst-sugg__btn, .asst-qr__btn { min-height: 40px; display: inline-flex; align-items: center; }
  .asst-src__chip { display: inline-flex; align-items: center; min-height: 40px; padding: 6px 10px; border-radius: 8px; }
  .asst-cta { min-height: 44px; }
  .order-form__input, .order-form__btn { height: 44px; }
  .prod__btn { min-height: 40px; }
  .asst-sheet__cancel { min-height: 44px; }
  .msg__tools { margin-left: -10px; }
}
