/* ===== Polish layer: loaded after style.css ===== */
:root{--ease-out:cubic-bezier(.2,.8,.2,1);--bezel:#0e1d16}
body{-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility}
h1,h2,h3,h4{font-feature-settings:"palt";text-wrap:balance;word-break:auto-phrase}
p,.stage-note{text-wrap:pretty;word-break:auto-phrase}
.hero h1{letter-spacing:-.02em}
.hero{background:radial-gradient(120% 160% at 100% 0,#2a5a42 0,transparent 55%),linear-gradient(135deg,#17392b,#10291f)}
.topbar{position:sticky;top:0;z-index:4;background:#fffdf8e6;backdrop-filter:saturate(1.4) blur(10px);-webkit-backdrop-filter:saturate(1.4) blur(10px)}
.present-toggle[aria-pressed="true"]{background:var(--forest);color:#fff;border-color:var(--forest)}
.desk{scroll-margin-top:84px}

/* Phone: device frame + status bar */
.phone{position:relative;border:9px solid var(--bezel);border-radius:42px;box-shadow:0 0 0 1px #2c4a3c,0 30px 60px -18px #0f2a1c66,0 12px 24px -12px #0f2a1c40}
.status-bar{height:30px;display:flex;align-items:center;justify-content:space-between;padding:0 22px 0 26px;background:#fffefa;font:700 12px/1 system-ui;color:#0e1d16}
.status-bar .notch{width:84px;height:22px;border-radius:14px;background:var(--bezel);margin-top:-2px}
.status-icons{display:flex;align-items:center;gap:6px}
.signal{display:flex;align-items:flex-end;gap:1.5px;height:10px}
.signal b{width:3px;background:#0e1d16;border-radius:1px}
.signal b:nth-child(1){height:4px}.signal b:nth-child(2){height:6px}.signal b:nth-child(3){height:8px}.signal b:nth-child(4){height:10px}
.battery{position:relative;width:22px;height:11px;border:1.5px solid #0e1d16;border-radius:3px}
.battery::before{content:"";position:absolute;inset:1.5px 5px 1.5px 1.5px;background:#0e1d16;border-radius:1px}
.battery::after{content:"";position:absolute;right:-4px;top:3px;width:2px;height:4px;background:#0e1d16;border-radius:0 1px 1px 0}
.phone-top{height:50px}
.chat{height:clamp(320px,calc(100svh - 430px),560px);background:linear-gradient(180deg,#d6e6de,#dbe9e2 40%,#d3e3db)}
.composer{border-top:1px solid #e3ebe3}
.rich-menu{padding-bottom:12px}
.phone::after{content:"";position:absolute;left:50%;bottom:4px;width:34%;height:4px;border-radius:4px;background:#0e1d1640;transform:translateX(-50%);pointer-events:none}

/* LINE-style messages */
.msg{display:flex;align-items:flex-end;gap:6px;margin:0 0 10px}
.msg .bubble{margin:0;max-width:76%}
.msg.out{justify-content:flex-end}
.msg-avatar{width:28px;height:28px;border-radius:50%;align-self:flex-start;flex:none;box-shadow:0 0 0 1px #ffffffb0}
.msg-meta{display:grid;gap:1px;font-size:9px;line-height:1.25;color:#48685a;flex:none;padding-bottom:1px}
.msg.out .msg-meta{text-align:right}
.bubble.typing{display:flex;gap:4px;align-items:center;padding:12px 13px}
.bubble.typing i{width:6px;height:6px;border-radius:50%;background:#7c9a8c;animation:typing 1s infinite ease-in-out}
.bubble.typing i:nth-child(2){animation-delay:.15s}
.bubble.typing i:nth-child(3){animation-delay:.3s}
@keyframes typing{0%,60%,100%{transform:translateY(0);opacity:.45}30%{transform:translateY(-3px);opacity:1}}
.chat-card{box-shadow:0 1px 1px #163d2308,0 4px 14px -6px #163d2330}
.card-button,.primary,.secondary,.small-button,.rich-btn,.nav-link,.hero-button,.pager-button{transition:background .15s,transform .12s var(--ease-out),box-shadow .15s}
.card-button:active,.primary:active,.secondary:active,.small-button:active,.rich-btn:active,.hero-button:active,.pager-button:active{transform:scale(.97)}
.hero-button:hover{box-shadow:0 3px 0 #92a54a,0 10px 24px -6px #dcf47880}

/* Motion */
@media (prefers-reduced-motion:no-preference){
  .enter{animation:msg-in .38s var(--ease-out) both}
  .msg.out.enter{animation-name:msg-in-right}
  .stage-enter{animation:stage-in .42s var(--ease-out) both}
  dialog[open]{animation:dialog-in .26s var(--ease-out)}
  dialog[open]::backdrop{animation:fade .26s ease}
  .toast:not([hidden]){animation:toast-in .3s var(--ease-out)}
  .trend-bar i{animation:grow .7s var(--ease-out) both}
  .trend-col:nth-child(2) i{animation-delay:.05s}
  .trend-col:nth-child(3) i{animation-delay:.1s}
  .trend-col:nth-child(4) i{animation-delay:.15s}
  .trend-col:nth-child(5) i{animation-delay:.2s}
  .trend-col:nth-child(6) i{animation-delay:.25s}
}
@keyframes msg-in{from{opacity:0;transform:translate(-6px,10px) scale(.98)}to{opacity:1;transform:none}}
@keyframes msg-in-right{from{opacity:0;transform:translate(6px,10px) scale(.98)}to{opacity:1;transform:none}}
@keyframes stage-in{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:none}}
@keyframes dialog-in{from{opacity:0;transform:translateY(14px) scale(.98)}to{opacity:1;transform:none}}
@keyframes fade{from{opacity:0}}
@keyframes toast-in{from{opacity:0;transform:translate(-50%,10px)}to{opacity:1;transform:translate(-50%,0)}}
@keyframes grow{from{transform:scaleY(0)}to{transform:scaleY(1)}}

/* Metrics + trend chart */
.metric{gap:4px;padding:9px 9px 8px;background:linear-gradient(180deg,#eef5ea,#e5efe1)}
.metric strong{font-variant-numeric:tabular-nums;letter-spacing:-.02em}
.metric-delta{justify-self:start;font-size:9px;font-weight:800;color:#1b6a43;background:#d4ecd2;border-radius:99px;padding:1px 6px;white-space:nowrap}
.trend-figure{margin:10px 0 0;padding:12px 12px 10px;background:#fff;border:1px solid #e2eae0;border-radius:12px}
.trend-figure figcaption{display:flex;justify-content:space-between;align-items:center;font-size:12px;margin-bottom:8px}
.trend-figure figcaption span{font-size:10px;color:var(--muted)}
.trend{display:grid;grid-template-columns:repeat(6,1fr);gap:8px;align-items:end;height:120px}
.trend-col{display:grid;grid-template-rows:auto 1fr auto;height:100%;text-align:center;gap:4px}
.trend-value{font:700 10px/1 system-ui;color:#5a7064;font-variant-numeric:tabular-nums}
.trend-bar{display:flex;align-items:flex-end;justify-content:center}
.trend-bar i{display:block;width:min(28px,100%);border-radius:6px 6px 2px 2px;background:#bcd8c2;transform-origin:bottom}
.trend-col.now .trend-bar i{background:linear-gradient(180deg,#2c8a5d,#206749)}
.trend-col.now .trend-value{color:#1a5a3b;font-size:11px}
.trend-month{font-size:10px;color:var(--muted);font-weight:700}

/* Stage pager */
.stage-pager{display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);align-items:center;gap:10px;margin-top:11px}
.pager-button{border:1px solid #d8e2d6;background:#fffdf8;border-radius:10px;padding:9px 12px;font-size:12px;font-weight:800;text-align:left;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.pager-button.next{text-align:right;background:var(--forest);color:#fff;border-color:var(--forest)}
.pager-button:hover:not(:disabled){background:#eaf2e7}
.pager-button.next:hover:not(:disabled){background:#0f2a1e}
.pager-count{display:flex;flex-wrap:wrap;justify-content:center;align-items:baseline;gap:2px;width:72px;font:700 11px/1 system-ui;color:var(--muted)}
.pager-count b{font-size:15px;color:var(--ink)}
.pager-progress{display:block;flex:0 0 100%;height:3px;margin-top:5px;border-radius:3px;background:#dfe7dc;overflow:hidden}
.pager-progress i{display:block;height:100%;background:#2c945f;transition:width .3s var(--ease-out)}
.key-hint{margin:9px 2px 0;color:var(--muted);font-size:10px}
kbd{display:inline-block;min-width:18px;padding:1px 5px;margin-right:2px;border:1px solid #cdd8cb;border-bottom-width:2px;border-radius:5px;background:#fff;font:700 10px/1.4 system-ui;text-align:center;color:var(--ink)}

/* Presenting mode */
body.presenting .hero,body.presenting footer,body.presenting .key-hint{display:none}
body.presenting .shell{padding-top:16px}
body.presenting .chat{height:clamp(320px,calc(100svh - 420px),640px)}
body.presenting .stage h2{font-size:clamp(28px,3vw,44px)}

@media(max-width:850px){.key-hint{display:none}}
@media(max-width:575px){
  .phone{border:1px solid #b8cfc0;border-radius:18px;box-shadow:var(--shadow)}
  .phone::after,.status-bar{display:none}
  .present-toggle{display:none}
  .chat{height:clamp(300px,52svh,460px)}
  .msg .bubble{max-width:80%}
  .stage-pager{grid-template-columns:1fr 1fr}
  .pager-count{display:none}
}

/* Review author line */
.review-meta{display:flex;align-items:center;gap:10px;margin:2px 0 6px}
.review-meta>span:last-child{display:grid;line-height:1.35}
.review-meta b{font-size:14px;color:#13281f}
.review-meta small{font-size:12px;color:#557064}
.review-avatar{display:grid;place-items:center;flex:none;width:34px;height:34px;border-radius:50%;background:#5b7fbf;color:#fff;font:800 15px/1 system-ui}
body.story-mode .review-meta b{font-size:16px}
body.story-mode .review-meta small{font-size:13px}

/* Survey chips */
.survey-chips{border:0;margin:0;padding:0;display:flex;flex-wrap:wrap;gap:8px}
.survey-chips legend{font-size:12px;font-weight:800;margin-bottom:6px;padding:0}
.chip{position:relative;display:inline-flex!important;align-items:center;cursor:pointer}
.chip input{position:absolute;opacity:0;width:1px!important;height:1px;margin:0!important}
.chip span{display:inline-block;padding:9px 14px;border-radius:99px;border:1.5px solid #c7d8ca;background:#fff;font-size:14px;font-weight:800;color:#2f4a3d}
.chip input:checked+span{background:#206749;border-color:#206749;color:#fff}
.chip input:checked+span::before{content:"✓ "}
.chip input:focus-visible+span{outline:3px solid #147d57;outline-offset:2px}

.dialog-content textarea{min-height:150px;line-height:1.7;font-size:15px}

/* Review text result (アンケート → 口コミ文) */
.rv-wrap{display:grid;gap:14px}
.rv-lead{font-size:16px;font-weight:700;color:#24493a}
.rv-card{background:#fff;border:1.5px solid #d6e2d3;border-radius:16px;padding:18px 18px 16px;box-shadow:0 6px 18px -12px #163d2366}
.rv-head{display:flex;align-items:center;gap:10px}
.rv-head>span:last-child{display:grid;line-height:1.35}
.rv-head b{font-size:16px;color:#13281f}
.rv-head small{font-size:13px;color:#557064}
.rv-stars{margin:10px 0 6px;font-size:24px;letter-spacing:.06em;color:#e6a400}
.rv-text{font-size:18px;line-height:1.95;color:#14261e;white-space:pre-wrap}
.dialog-content .rv-edit{display:block;width:100%;min-height:220px;margin:0;padding:12px;border:2px solid #f0a92b;border-radius:12px;font-size:18px;line-height:1.85;color:#14261e;background:#fffdf6;resize:vertical}
.rv-card.editing{border-color:#f0c26b}
.rv-actions{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.rv-copy,.rv-sub,.rv-back{min-height:56px;border-radius:14px;font-size:17px;font-weight:900}
.rv-copy{border:0;background:#206749;color:#fff}
.rv-copy:hover{background:#154e35}
.rv-sub{border:2px solid #b9cfba;background:#fff;color:#17392b}
.rv-sub:hover{background:#eef5ec}
.rv-note{font-size:14px;color:#5b5030;background:#fff6de;border-radius:10px;padding:10px 12px}
.rv-back{min-height:48px;border:0;background:transparent;color:#206749;text-decoration:underline;text-underline-offset:4px;font-size:16px}
dialog:has(.rv-wrap){width:min(560px,calc(100% - 24px))}
@media(max-width:575px){.rv-actions{grid-template-columns:1fr}.rv-text,.rv-edit{font-size:17px}}
.rv-status{font-size:15px;font-weight:800;color:#1b6a43;text-align:center;min-height:1px}
.rv-status:empty{display:none}

/* Search terms (report) */
.terms{margin:10px 0 0;padding:12px;background:#fff;border:1px solid #e2eae0;border-radius:12px}
.terms figcaption{display:flex;justify-content:space-between;align-items:center;font-size:12px;margin-bottom:8px}
.terms figcaption span{font-size:10px;color:var(--muted)}
.term-row{display:grid;grid-template-columns:minmax(0,1.3fr) minmax(0,1fr) auto;gap:8px;align-items:center;padding:4px 0}
.term-name{font-size:13px;font-weight:800;color:#1d3128;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.term-bar{height:8px;border-radius:8px;background:#e3ece0;overflow:hidden}
.term-bar i{display:block;height:100%;border-radius:8px;background:#2c945f}
.term-count{font:700 12px/1 system-ui;color:#3c5a4c;font-variant-numeric:tabular-nums}

/* ===== 来店アンケート（お客様が答える画面） ===== */
dialog:has(.sv){width:min(480px,calc(100% - 24px))}
.sv{display:grid;gap:14px}
.sv-head{display:flex;align-items:center;gap:12px}
.sv-logo{width:44px;height:44px;border-radius:50%;flex:none}
.sv-head>div{display:grid;line-height:1.4}
.sv-head b{font-size:18px;color:#13281f}
.sv-head small{font-size:13px;color:#557064;font-weight:700}
.sv-progress{height:6px;border-radius:6px;background:#e3ece0;overflow:hidden}
.sv-progress i{display:block;height:100%;border-radius:6px;background:#2c945f;transition:width .35s cubic-bezier(.2,.8,.2,1)}
.sv-q{display:grid;gap:12px;padding-top:4px}
.sv-num{font:900 13px/1 system-ui;letter-spacing:.12em;color:#2c945f}
.sv-q h3{margin:0;font-size:22px;line-height:1.45;color:#10241b}
.sv-hint{margin-top:-6px;font-size:14px;color:#557064;font-weight:700}
.sv-rating{display:grid;gap:8px}
.sv-rate{display:flex;align-items:center;gap:14px;width:100%;min-height:58px;padding:0 16px;border:2px solid #d6e2d3;border-radius:14px;background:#fff;text-align:left}
.sv-rate:hover{border-color:#9fc5a4;background:#f6faf4}
.sv-rate.on{border-color:#206749;background:#eaf5e8}
.sv-stars{font-size:22px;letter-spacing:.04em;color:#e6a400;white-space:nowrap}
.sv-rate b{font-size:17px;color:#1d3128}
.sv-options{display:grid;gap:8px}
.sv-option{min-height:58px;border:2px solid #d6e2d3;border-radius:14px;background:#fff;font-size:18px;font-weight:800;color:#1d3128}
.sv-option:hover{border-color:#9fc5a4;background:#f6faf4}
.sv-option.on{border-color:#206749;background:#eaf5e8}
.sv-chips{display:flex;flex-wrap:wrap;gap:10px}
.sv-chip{min-height:48px;padding:0 18px;border:2px solid #cfdccc;border-radius:99px;background:#fff;font-size:16px;font-weight:800;color:#2f4a3d}
.sv-chip.on{border-color:#206749;background:#206749;color:#fff}
.sv-chip.on::before{content:"✓ "}
.dialog-content .sv-text{min-height:130px;margin:0;padding:12px 14px;border:2px solid #cfdccc;border-radius:14px;font-size:17px;line-height:1.7;background:#fff}
.sv-next{width:100%;min-height:58px;border:0;border-radius:14px;background:#206749;color:#fff;font-size:18px;font-weight:900;margin-top:4px}
.sv-next:hover{background:#154e35}
.sv-back{justify-self:center;margin-top:6px;border:0;background:transparent;color:#3d5a4b;font-size:15px;font-weight:800;padding:8px}
.sv-done{display:grid;gap:12px;justify-items:center;text-align:center;padding:6px 0}
.sv-done-mark{display:grid;place-items:center;width:64px;height:64px;border-radius:50%;background:#e3f4e1;color:#1b6a43;font:900 32px/1 system-ui}
.sv-done h3{margin:0;font-size:22px}
.sv-done p{font-size:16px;line-height:1.8;color:#2f473b}
.sv-done .sv-next{margin-top:6px}
.sv-step{display:grid;gap:4px}
.rv-meo{font-size:14px;line-height:1.7;color:#1f3350;background:#eef4ff;border:1.5px solid #c4d6f5;border-radius:12px;padding:10px 12px}
.rv-meo b{color:#1f4f9a;font-weight:900}
