/* /line-ai/demo/: try-it-yourself LINE AI demo (loaded on that page only), 2026-11-18 */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ld-hero { padding-bottom: clamp(40px, 5vw, 64px); }
.ld-hero .lede { max-width: 44em; }
.ld-steps { list-style: none; margin: 26px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border-top: 1.5px solid var(--ink); max-width: 860px; counter-reset: s; }
.ld-steps li { counter-increment: s; padding: 16px 20px 0 0; display: grid; gap: 2px; }
.ld-steps li::before { content: "0" counter(s); font: 600 12px/1 var(--mono); color: var(--accent-ink); margin-bottom: 6px; }
.ld-steps b { font-size: 16.5px; }
.ld-steps span { font-size: 14.5px; color: var(--ink2); }
.js .ld-steps li::before { color: var(--ink3); }
.js .ld-steps li.on::before { color: var(--accent-ink); }
.js .ld-steps li:not(.on):not(.done) b { color: var(--ink2); }
.js .ld-steps li.done::before { content: "✓"; color: #2c7a4b; }
.ld-steps li.done b { color: var(--ink2); }
@media (max-width: 640px) {
  .ld-steps { margin-top: 20px; }
  .ld-steps li { padding: 12px 10px 0 0; }
  .ld-steps b { font-size: 14.5px; line-height: 1.4; }
  .ld-steps span { display: none; }
}
.ld-demo-note { margin-top: 20px; display: flex; align-items: baseline; gap: 10px; font-size: 14.5px; color: var(--ink2); }
.ld-badge { flex: none; font-size: 12.5px; font-weight: 700; color: #8f3a12; background: #fbeee6; padding: 3px 10px; border-radius: 999px; }

/* layout: editor left, start + chat right (sticky on wide screens) */
.ld-main { padding-top: clamp(48px, 6vw, 80px); }
.ld-grid { display: grid; grid-template-columns: minmax(0, 1fr) 400px; grid-template-rows: auto 1fr; grid-template-areas: "pick side" "edit side"; gap: 44px 40px; align-items: start; }
.ld-pickbox { grid-area: pick; min-width: 0; }
.ld-side { grid-area: side; display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; min-width: 0; }
.ld-edit { grid-area: edit; min-width: 0; }
@media (max-width: 1000px) {
  .ld-grid { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; grid-template-areas: "pick" "side" "edit"; gap: 40px; }
  .ld-chat { justify-self: stretch; max-width: none; }
}
.ld-main .h2 { display: flex; align-items: center; gap: 12px; font-size: clamp(22px, 2.2vw, 27px); }
.ld-n { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: #fff; font: 700 16px/1 var(--sans); }
.ld-n.done { background: #2c7a4b; font-size: 0; }
.ld-n.done::before { content: "✓"; font-size: 17px; }
.ld-main .h2 small { font-size: 13px; font-weight: 600; color: var(--ink2); background: rgba(22,21,19,.07); padding: 4px 10px; border-radius: 999px; }
.ld-lead { margin-top: 10px; font-size: 15px; color: var(--ink2); }
.ld-again { margin-top: 18px; font-size: 15px; }
#ld-start, #ld-code, #ld-chat, #ld-edit { scroll-margin-top: 88px; }
.ld-help { font-size: 14px; color: var(--ink3); line-height: 1.65; margin-top: 6px; }
.ld-status { font-size: 14px; color: var(--ink2); min-height: 1.4em; }
.ld-status.err { color: #a12a1a; }

/* step 1: industry chips */
.ld-pick { margin-top: 16px; display: grid; gap: 16px; }
.ld-pick fieldset { border: 0; padding: 0; margin: 0; }
.ld-custom[hidden] { display: none; }
.ld-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.ld-chips label { position: relative; }
.ld-chips input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.ld-chips span { display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border-radius: 999px; border: 1px solid rgba(22,21,19,.22); background: #fff; font-size: 15px; font-weight: 600; cursor: pointer; }
.ld-chips input:checked + span { background: var(--ink); color: #fff; border-color: var(--ink); }
.ld-chips input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.ld-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.ld-row .ld-status { flex: 1 1 16em; }
.pill[disabled], .pill[aria-busy="true"] { opacity: .55; cursor: progress; }
.ld-edit[aria-busy="true"] .ld-card { opacity: .45; pointer-events: none; }
@media (prefers-reduced-motion: no-preference) { .ld-edit[aria-busy="true"] .ld-card { animation: ld-pulse 1.4s ease-in-out infinite; } }
@keyframes ld-pulse { 50% { opacity: .25; } }
.ld-status.busy::before { content: ""; display: inline-block; width: 12px; height: 12px; margin-right: 8px; vertical-align: -1px; border-radius: 50%; border: 2px solid rgba(22,21,19,.2); border-top-color: var(--ink); animation: ld-spin .8s linear infinite; }
@keyframes ld-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .ld-status.busy::before { animation: none; } }

/* step 3 editor: the admin's LINE 客服 → 標準問答 look (shiptolive-admin app/line/components/line-bot.css,
   tokens from app/globals.css), 2026-11-20. One white panel per block, hairline rows, text that becomes a field on focus. */
.ld-edit { --lb-card: #fff; --lb-line: #e7e0d4; --lb-line-soft: #efe9df; --lb-line-strong: #d6ccbb; --lb-ink2: #3b3833; --lb-muted: #67625a; --lb-faint: #8f897f;
  --lb-warn: #8a5100; --lb-warn-bg: #fdf3e2; --lb-focus: #b8501d; --lb-bad: #b42318; --lb-r: 12px; --lb-r-sm: 8px; }
.ld-card { margin-top: 28px; container-type: inline-size; }
.ld-card-h { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.ld-card h3 { font-size: 18px; }
.ld-count { font-size: 13px; color: var(--lb-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ld-card > .ld-help { margin-top: 4px; }
.ld-panel { margin-top: 12px; background: var(--lb-card); border: 1px solid var(--lb-line); border-radius: var(--lb-r); overflow: clip; }
.ld-panel:empty, .ld-qa-list:has(.ld-qa:empty), .ld-inv-list:has(.ld-inv:empty) { display: none; }
.ld-one { padding: 10px 14px 8px; }
.ld-card.ld-one { margin-top: 20px; }
.ld-f { display: grid; gap: 0; }
.ld-fl { padding-left: 10px; font-size: 12px; font-weight: 600; letter-spacing: .02em; color: var(--lb-muted); }

/* every field: plain text at rest, a white field with the orange focus ring while editing; grows with its text, no resize handle */
.ld-edit textarea, .ld-edit .ld-panel input { display: block; width: 100%; min-width: 0; min-height: 40px; max-height: 360px; margin: 0; padding: 8px 10px; border: 1px solid transparent; border-radius: var(--lb-r-sm);
  background: transparent; color: var(--lb-ink2); font: 400 15px/1.6 var(--sans); resize: none; overflow: hidden; field-sizing: content; box-shadow: none; transition: background .12s, border-color .12s; }
.ld-edit textarea:hover, .ld-edit .ld-panel input:hover { background: var(--lb-card); border-color: var(--lb-line); }
.ld-qrow.hand textarea:hover { background: color-mix(in oklab, var(--lb-card) 70%, transparent); }
.ld-edit textarea:focus, .ld-edit .ld-panel input:focus { background: var(--lb-card); border-color: var(--lb-line-strong); outline: 2px solid var(--lb-focus); outline-offset: 0; }
.ld-edit textarea::placeholder, .ld-edit .ld-panel input::placeholder { color: var(--lb-faint); font-weight: 400; }
.ld-edit input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
.ld-edit input[type="number"]::-webkit-inner-spin-button, .ld-edit input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
@media (pointer: coarse) { .ld-edit textarea, .ld-edit .ld-panel input { font-size: 16px; } } /* 16px+ keeps iOS from zooming in on focus */
.ld-custom textarea { width: 100%; min-height: 80px; font-size: 16px; }

/* Q&A table: # | question | answer | AI 回答 / 轉真人 pill + 刪除 */
.ld-qa-cols, .ld-qrow { display: grid; grid-template-columns: 26px minmax(0, 1fr) minmax(0, 1.8fr) 158px; gap: 4px 12px; align-items: start; }
.ld-qa-cols { padding: 10px 14px 8px; border-bottom: 1px solid var(--lb-line); font-size: 12px; font-weight: 600; letter-spacing: .02em; color: var(--lb-muted); }
.ld-qa-cols span:nth-child(1) { text-align: right; }
.ld-qa-cols span:nth-child(2), .ld-qa-cols span:nth-child(3) { padding-left: 11px; }
.ld-qa-cols span:nth-child(4) { text-align: right; padding-right: 54px; }
.ld-qa { list-style: none; margin: 0; padding: 0; }
.ld-qrow { padding: 8px 14px; border-top: 1px solid var(--lb-line-soft); transition: background .12s; }
.ld-qrow:first-child { border-top: 0; }
.ld-qrow.hand { background: var(--lb-warn-bg); }
.ld-qn { padding-top: 9px; text-align: right; font-size: 14px; color: var(--lb-muted); font-variant-numeric: tabular-nums; }
.ld-edit .ld-fq { font-weight: 600; color: var(--ink); }
.ld-qside { display: flex; align-items: center; justify-content: flex-end; gap: 2px; padding-top: 4px; }
.ld-hchip { position: relative; display: inline-flex; align-items: center; min-height: 32px; cursor: pointer; }
.ld-hchip input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.ld-hchip span { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 12px; border: 1px solid var(--lb-line); border-radius: 999px; background: var(--lb-card); color: var(--lb-muted);
  font-size: 13px; font-weight: 600; white-space: nowrap; transition: background .12s, border-color .12s, color .12s; }
.ld-hchip span::before { content: ""; width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid currentColor; }
.ld-hchip:hover span { border-color: var(--lb-line-strong); color: var(--lb-ink2); }
.ld-hchip input:checked + span { background: var(--lb-warn); border-color: var(--lb-warn); color: #fff; }
.ld-hchip input:checked + span::before { background: currentColor; }
.ld-hchip input:focus-visible + span { outline: 2px solid var(--lb-focus); outline-offset: 2px; }
.ld-del { flex: none; min-height: 32px; min-width: 32px; padding: 0 8px; border: 0; background: none; color: var(--lb-muted); font: inherit; font-size: 13px; cursor: pointer; opacity: 0; transition: opacity .12s, color .12s; }
:is(.ld-qrow, .ld-exrow, .ld-irow):is(:hover, :focus-within) .ld-del, .ld-del:focus-visible { opacity: 1; }
.ld-del:hover { color: var(--lb-bad); text-decoration: underline; text-underline-offset: 3px; }
.ld-del:focus-visible { outline: 2px solid var(--lb-focus); outline-offset: 2px; border-radius: 4px; }
@media (hover: none), (pointer: coarse) { .ld-del { opacity: 1; } }
.ld-add { display: block; width: 100%; min-height: 44px; margin-top: 8px; border: 1px dashed var(--lb-line-strong); border-radius: var(--lb-r); background: transparent; color: var(--lb-ink2); font: 600 14px/1.2 var(--sans); cursor: pointer; }
.ld-add:hover:not(:disabled) { background: var(--lb-card); border-color: var(--lb-ink2); }
.ld-add:focus-visible { outline: 2px solid var(--lb-focus); outline-offset: 2px; }
.ld-add:disabled { opacity: .45; cursor: default; }
/* narrow column (phones, or a squeezed desktop column): number + question, answer under it, pill + 刪除 under that */
@container (max-width: 600px) {
  .ld-qa-cols { display: none; }
  .ld-qrow { grid-template-columns: 20px minmax(0, 1fr); gap: 0 4px; padding: 8px 10px 8px 6px; }
  .ld-qrow > .ld-fq, .ld-qrow > .ld-fa, .ld-qrow > .ld-qside { grid-column: 2; }
  .ld-qside { justify-content: space-between; padding: 4px 0 2px 10px; }
  .ld-del { opacity: 1; }
}

/* example replies: one hairline list */
.ld-ex-h { display: flex; align-items: baseline; justify-content: space-between; margin-top: 18px; }
.ld-ex-h b { font-size: 14px; }
.ld-exrow { display: flex; gap: 6px; align-items: start; padding: 6px 8px 6px 6px; border-top: 1px solid var(--lb-line-soft); }
.ld-exrow:first-child { border-top: 0; }
.ld-exrow .ld-del { margin-top: 4px; }

/* inventory: a small table */
.ld-inv-cols, .ld-irow { display: grid; grid-template-columns: minmax(0, 1.7fr) 56px minmax(0, .7fr) minmax(0, 1.3fr) 52px; gap: 4px 6px; align-items: start; }
.ld-inv-cols { padding: 10px 10px 8px; border-bottom: 1px solid var(--lb-line); font-size: 12px; font-weight: 600; letter-spacing: .02em; color: var(--lb-muted); }
.ld-inv-cols span { padding-left: 11px; }
.ld-irow { padding: 6px 10px; border-top: 1px solid var(--lb-line-soft); }
.ld-irow:first-child { border-top: 0; }
.ld-irow > div { min-width: 0; }
.ld-irow .lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ld-irow .ld-del { margin-top: 4px; }
@container (max-width: 600px) {
  .ld-inv-cols { display: none; }
  .ld-irow { grid-template-columns: 84px minmax(0, 1fr) auto; padding: 8px 8px 8px 6px; }
  .ld-irow > div:nth-child(1) { grid-column: 1 / 3; grid-row: 1; }
  .ld-irow > .ld-del { grid-column: 3; grid-row: 1; }
  .ld-irow > div:nth-child(2) { grid-column: 1; grid-row: 2; }
  .ld-irow > div:nth-child(3) { grid-column: 2 / -1; grid-row: 2; }
  .ld-irow > div:nth-child(4) { grid-column: 1 / -1; grid-row: 3; }
  .ld-irow .lbl { position: static; width: auto; height: auto; overflow: visible; clip: auto; display: block; padding-left: 11px; font-size: 12px; font-weight: 600; color: var(--lb-muted); }
}

/* step 3: code + QR */
.ld-start { background: #fff; border: 1px solid var(--hair); border-radius: 22px; padding: 22px 22px 20px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.ld-start > .pill { justify-self: start; }
.ld-code { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; padding-top: 14px; border-top: 1px solid var(--hair); }
.ld-code[hidden] { display: none; }
.ld-code:focus { outline: none; }
.ld-code-top { display: grid; grid-template-columns: auto auto 1fr; align-items: center; gap: 4px 14px; }
.ld-code-top span { grid-column: 1 / -1; font-size: 13.5px; font-weight: 600; color: var(--ink2); }
.ld-code-top b { font: 800 44px/1.05 var(--sans); letter-spacing: .12em; font-variant-numeric: tabular-nums; }
.ld-copy { min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid rgba(22,21,19,.25); background: #fff; color: var(--ink); font: 600 14.5px/1 var(--sans); cursor: pointer; }
.ld-copy:hover { border-color: var(--ink); }
.ld-copy.ok { border-color: #2c7a4b; color: #2c7a4b; background: #eef7f0; }
.ld-code-top small { grid-column: 1 / -1; font-size: 13px; color: var(--ink3); }
.ld-code .pill { justify-self: start; }
.ld-qrf { margin: 0; display: grid; gap: 6px; justify-items: start; }
.ld-qrf figcaption { font-size: 13px; color: var(--ink3); }
.ld-qr { width: 184px; height: 184px; padding: 8px; border: 1px solid var(--hair); border-radius: 14px; background: #fff; }
.ld-code .ld-qrf { order: -1; }
.ld-code .ld-code-top { order: -2; }
.ld-qr svg { width: 100%; height: 100%; display: block; }
.ld-how { margin: 0; padding-left: 1.3em; display: grid; gap: 6px; font-size: 14.5px; line-height: 1.65; color: var(--ink2); }
.ld-code-inline { font-weight: 700; color: var(--ink); }
/* phones can't scan their own screen: the LINE button comes first, the QR goes last and smaller */
@media (max-width: 1000px) and (pointer: coarse), (max-width: 600px) {
  .ld-code .ld-qrf { order: 5; justify-items: center; text-align: center; padding-top: 12px; border-top: 1px solid var(--hair); }
  .ld-qr { width: 140px; height: 140px; }
}
@media (max-width: 600px) { .ld-start .pill { width: 100%; } .ld-start { padding: 20px 16px 18px; } }

/* web chat panel: reuses the /line-ai/ hero chat (.lc) */
.ld-chat { justify-self: stretch; max-width: none; }
.ld-chat .lc-top b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.ld-log { height: 380px; overflow-y: auto; align-content: start; overscroll-behavior: contain; }
@media (max-width: 600px) { .ld-log { height: 340px; } }
.ld-empty { justify-self: center; text-align: center; max-width: 18em; margin-top: 40px; font-size: 14px; color: #4f5d6b; }
.ld-log .lc-m { white-space: pre-wrap; word-break: break-word; }
.ld-log .lc-r.wait .lc-m { color: #5d6b79; }
.ld-log .lc-r.wait .lc-m i { display: inline-block; width: 6px; height: 6px; margin: 0 2px; border-radius: 50%; background: currentColor; animation: dot 1s infinite; }
.ld-log .lc-r.wait .lc-m i:nth-child(2) { animation-delay: .15s; } .ld-log .lc-r.wait .lc-m i:nth-child(3) { animation-delay: .3s; }
.ld-log .lc-note.hand { color: #8f3a12; background: #fbeee6; }
.ld-log .lc-note.err { color: #a12a1a; background: #f8e3df; }
.ld-chat .lc-oa { background: #067a35; }
.ld-sugg { min-width: 0; display: flex; gap: 8px; overflow-x: auto; padding: 10px 12px 2px; background: #fff; border-top: 1px solid var(--hair); scrollbar-width: none; }
.ld-sugg[hidden] { display: none; }
.ld-sugg span { flex: none; align-self: center; font-size: 13px; color: var(--ink3); }
.ld-sugg button { flex: none; min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid #b7dcc4; background: #f2faf5; color: #155d32; font: 600 14px/1.2 var(--sans); cursor: pointer; white-space: nowrap; }
.ld-sugg button:hover { border-color: #2c7a4b; }
.ld-sugg button[disabled] { opacity: .5; cursor: progress; }
.ld-sugg + .ld-in { border-top: 0; }
.ld-in { display: flex; gap: 8px; padding: 10px 12px 12px; border-top: 1px solid var(--hair); background: #fff; }
.ld-in input { flex: 1; min-width: 0; min-height: 44px; padding: 0 16px; border-radius: 999px; border: 0; background: #f1f1f1; font: 400 16px/1.4 var(--sans); color: var(--ink); }
.ld-in input:focus { outline: 2px solid #06c755; outline-offset: 0; }
.ld-in button { flex: none; width: 44px; height: 44px; border-radius: 50%; border: 0; background: #06c755; color: #fff; display: grid; place-items: center; cursor: pointer; }
.ld-in button[disabled], .ld-in input[disabled] { opacity: .5; cursor: not-allowed; }
.ld-in button svg { width: 20px; height: 20px; fill: currentColor; }
.ld-btns { margin-top: 24px; }
@media (prefers-reduced-motion: reduce) { .ld-log .lc-r.wait .lc-m i { animation: none; } }
/* the /line-ai/ hero chat fades its bubbles in on reveal; the live panel shows them at once */
.js .ld-chat .lc-r, .js .ld-chat .lc-note { opacity: 1; transform: none; transition: none; }

/* the floating LINE button and the phone CTA bar step aside while the visitor is building or chatting */
body.ld-quiet .line-fab, body.ld-quiet .mcta { visibility: hidden; opacity: 0; pointer-events: none; }
/* wide screens: keep 開始體驗 and the chat in view while editing, until the code card makes the column too tall */
@media (min-width: 1001px) and (min-height: 860px) { .ld-side:has(#ld-code[hidden]) { position: sticky; top: 88px; } }
