/* survey-web (2026-10-28, analysis-tab-survey-ui P-01..03; green since 2026-11-01, survey-look): the owner app's rules. The values are design/tokens.css
   (copied: the page has no build step and is served on its own origin); the ground, ink and the app's green. */
:root {
  --color-canvas: #f4f2f0;
  --color-surface: #ffffff;
  --color-ink: #1e2536;
  --color-ink-muted: #5e6470;
  --color-separator: #cfcdc7;
  --color-line: #e3dfd7;
  --color-on-accent: #ffffff;
  --color-pressed: #e4e2dd;
  --color-disabled-fill: #e8e6e1;
  --color-accent: #176855;
  --color-accent-text: #176855;
  --color-accent-pressed: #125445;
  --color-koro: #dd4d42;
  --color-danger: #c9342b;
  --font-body: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", Meiryo, "Noto Sans JP", system-ui, sans-serif;
  --weight-semibold: 600;
  --weight-bold: 700;
  --text-xs: 13px;
  --text-sm: 15px;
  --text-base: 17px;
  --text-lg: 21px;
  --text-xl: 28px;
  --leading-body: 1.5;
  --leading-heading: 1.25;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 20px;
  --space-5: 32px;
  --gutter: 16px;
  --radius-s: 8px;
  --radius-m: 10px;
  --radius-button: 12px;
  --control-height: 50px;
  --dur-fast: 120ms;
}
@media (prefers-reduced-motion: reduce) { :root { --dur-fast: 0ms; } }

* { box-sizing: border-box; }
body { margin: 0; background: var(--color-canvas); color: var(--color-ink); font: var(--text-base)/var(--leading-body) var(--font-body); }
main { max-width: 36rem; margin: 0 auto; padding: var(--space-4) var(--gutter) var(--space-5); }
h1 { font-size: var(--text-lg); line-height: var(--leading-heading); font-weight: var(--weight-bold); margin: 0 0 var(--space-2); }
h2 { font-size: var(--text-base); line-height: var(--leading-heading); margin: 0 0 var(--space-2); }
p { margin: var(--space-2) 0; }
.muted { color: var(--color-ink-muted); font-size: var(--text-sm); }
.privacy-note a { color: inherit; text-decoration: underline; }
/* W6: a link is never broken mid-word; it goes to the next line whole */
p.privacy-note a { white-space: nowrap; }
.error { color: var(--color-danger); font-size: var(--text-sm); }
.error:empty { display: none; }

/* ---- the head: the store's photo (when there is one) and its name ---- */
header.store { margin: 0 0 var(--space-3); }
header.store img.store-photo { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; margin: 0 0 var(--space-3);
  border-radius: var(--radius-m); background: var(--color-line); }
header.store h1 { font-size: var(--text-xl); margin: 0; overflow-wrap: anywhere; }

/* ---- Koro beside a line (the app's KoroSays): the 60px round face and the words, side by side, centred, no bubble ---- */
.koro-says { display: flex; align-items: center; gap: var(--space-3); margin: var(--space-2) 0; }
.koro-says > .koro-face { flex: none; display: block; width: 60px; height: 60px; }
.koro-says > .koro-face svg { display: block; width: 100%; height: 100%; }
.koro-says > :not(.koro-face) { flex: 1; min-width: 0; margin: 0; }
/* the thanks heading beside the face: no single character left on its own line */
.koro-says h1 { text-wrap: balance; }

/* ---- while the draft is written: three lines stretch one after another under the thinking face ---- */
.drafting { display: flex; flex-direction: column; gap: var(--space-3); min-height: 8rem; box-sizing: border-box; margin: var(--space-3) 0;
  padding: var(--space-2) var(--space-3); border: 1px solid var(--color-separator); border-radius: var(--radius-m); background: var(--color-surface); }
.drafting-line { display: block; height: 8px; border-radius: 4px; background: var(--color-separator); transform-origin: left;
  animation: drafting-line 4.8s ease-out infinite backwards; }
.drafting-line:nth-child(1) { width: 100%; }
.drafting-line:nth-child(2) { width: 85%; animation-delay: 1.2s; }
.drafting-line:nth-child(3) { width: 45%; animation-delay: 2.4s; }
@keyframes drafting-line { 0% { transform: scaleX(0); } 25% { transform: scaleX(1); } 90% { transform: scaleX(1); opacity: 1; } 100% { transform: scaleX(1); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .drafting-line { animation: none; } }

/* ---- language switch (mapumaru-legal-prerelease P-20): one combo box, the current language on a button, the list under it ---- */
div.lang-pick { position: relative; margin: 0 0 var(--space-3); }
button.lang-button { display: inline-flex; width: auto; min-height: 44px; margin: 0; padding: 0 var(--space-3); gap: var(--space-2);
  border: 1px solid var(--color-separator); border-radius: var(--radius-button); background: var(--color-surface); color: var(--color-ink);
  font-size: var(--text-sm); font-weight: var(--weight-semibold); }
button.lang-button .lang-globe, button.lang-button .lang-chev { display: inline-flex; color: var(--color-ink-muted); }
ul.lang-list { position: absolute; z-index: 5; top: calc(100% + 4px); left: 0; min-width: 12rem; margin: 0; padding: var(--space-1) 0; list-style: none;
  border: 1px solid var(--color-line); border-radius: var(--radius-m); background: var(--color-surface); box-shadow: 0 6px 20px rgba(30, 37, 54, .14); }
ul.lang-list[hidden] { display: none; }
ul.lang-list li { display: flex; align-items: center; justify-content: space-between; min-height: 44px; padding: 0 var(--space-3);
  font-size: var(--text-sm); color: var(--color-ink); cursor: pointer; }
ul.lang-list li:active { background: var(--color-pressed); }
/* the focus ring stays inside the list (the page-wide :focus-visible ring sits 2px outside and crossed the list's edge) */
ul.lang-list li:focus-visible { outline-offset: -2px; }
ul.lang-list li.current { color: var(--color-accent-text); font-weight: var(--weight-semibold); }
ul.lang-list li .lang-check { display: inline-flex; }

/* ---- buttons: green for the one step forward; the two ways in on the first screen share one look ---- */
button, a.button { display: flex; align-items: center; justify-content: center; width: 100%; min-height: var(--control-height);
  margin: var(--space-3) 0 0; padding: var(--space-2) var(--space-4); font: inherit; font-weight: var(--weight-semibold); text-align: center;
  border: 1px solid var(--color-line); border-radius: var(--radius-button); background: var(--color-surface); color: var(--color-accent-text);
  text-decoration: none; cursor: pointer; transition: background-color var(--dur-fast); }
button:active, a.button:active { background: var(--color-pressed); }
button.primary, a.button.primary { border-color: var(--color-accent); background: var(--color-accent); color: var(--color-on-accent); }
button.primary:active, a.button.primary:active { border-color: var(--color-accent-pressed); background: var(--color-accent-pressed); }
button[disabled] { background: var(--color-disabled-fill); border-color: var(--color-disabled-fill); color: var(--color-ink-muted); cursor: default; }
div.ways { display: grid; gap: var(--space-3); margin: var(--space-4) 0 0; }
div.ways button { margin: 0; }
/* a text-only button (「回答を直す」), under the draft and away from the copy button */
button.text { display: inline-flex; width: auto; min-height: 44px; margin: var(--space-1) 0 0; padding: var(--space-2) var(--space-1); border: 0;
  background: none; color: var(--color-accent-text); font-weight: 400; text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }

/* ---- the questions: each a white card of large choices that fill with green when chosen ---- */
form { margin: 0; }
fieldset { border: 0; margin: var(--space-3) 0 0; padding: var(--space-3) var(--space-3) var(--space-4); background: var(--color-surface);
  border-radius: var(--radius-m); min-width: 0; }
legend { float: left; width: 100%; padding: 0; margin: 0 0 var(--space-3); font-weight: var(--weight-semibold); }
legend + * { clear: both; }
legend .legend-tail { white-space: nowrap; }
fieldset > .muted { margin: 0 0 var(--space-2); }
/* P-08: the question 送る moved to, its line under the heading; the move leaves a little room above it */
fieldset { scroll-margin-top: var(--space-3); }
fieldset > p.missing-line { margin: 0 0 var(--space-2); }
/* mapumaru-voice-material P-06: 「受けた後、どうでしたか」 is closed while no worry is ticked */
fieldset[hidden] { display: none; }
/* survey-five-taps: the 「必須」 mark beside a required question (the app's accent, small, never the only cue: 送る says it) */
.required-mark {
  display: inline-block; margin-left: var(--space-2); padding: 0 var(--space-2); border-radius: var(--radius-s);
  background: var(--color-accent); color: var(--color-on-accent); font-size: var(--text-xs);
  font-weight: var(--weight-semibold); line-height: 1.6; vertical-align: middle;
}
.required-group .required-mark { margin: 0 var(--space-2) 0 0; }
div.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(7.5em, 1fr)); gap: var(--space-2); }
label.choice { position: relative; display: flex; align-items: center; justify-content: center; min-height: 48px; margin: 0;
  padding: var(--space-2) var(--space-3); border: 1px solid var(--color-separator); border-radius: var(--radius-button);
  background: var(--color-surface); color: var(--color-ink); text-align: center; line-height: var(--leading-heading); cursor: pointer;
  transition: background-color var(--dur-fast), color var(--dur-fast); -webkit-tap-highlight-color: transparent; }
label.choice input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
label.choice:active { background: var(--color-pressed); }
label.choice.on { border-color: var(--color-accent); background: var(--color-accent); color: var(--color-on-accent); font-weight: var(--weight-semibold); }
label.choice:focus-within { outline: 2px solid var(--color-accent); outline-offset: 2px; }
label.choice.extra:not(.on) { color: var(--color-ink-muted); }
/* survey-five-taps P-08: 「どんなふうに？」 under an aspect, opened by 「よかった」 / 「気になった」 */
div.details { margin: var(--space-3) 0 0; padding: var(--space-3) 0 0; border-top: 1px solid var(--color-separator); }
/* mapumaru-detail-words P-01: the words sit in boxes as wide as the word, side by side; a box that does not fit goes to the next row */
div.details div.choices { display: flex; flex-wrap: wrap; }
div.details label.choice { flex: 0 1 auto; min-width: 4.5em; }
div.details[hidden], div.details div.choices[hidden] { display: none; }
p.details-label { margin: 0 0 var(--space-1); font-weight: var(--weight-semibold); }
div.details > .muted, div.details > .error { margin: 0 0 var(--space-2); }
select { font: inherit; min-height: 44px; max-width: 100%; }
input[type="text"], textarea { display: block; width: 100%; font: inherit; padding: var(--space-2) var(--space-3); color: var(--color-ink);
  border: 1px solid var(--color-separator); border-radius: var(--radius-m); background: var(--color-surface); }
input[type="text"] { min-height: 48px; }
textarea { min-height: 8rem; box-sizing: border-box; max-width: 100%; overflow-y: hidden; resize: none; }
input.other-text { margin-top: var(--space-2); }
input.other-text[hidden] { display: none; }
/* the verification widget: apart from the card above it, centred like the note and the send button */
#turnstile-box { display: flex; justify-content: center; margin: var(--space-4) 0 0; }
p.send-note { margin: var(--space-4) 0 0; text-align: center; }
p.send-note + p.error { text-align: center; }

/* ---- the draft: one notice line, the text, the guide ---- */
.notice { margin: var(--space-3) 0; color: var(--color-ink-muted); font-size: var(--text-sm); }
.notice p { margin: 0; }
.longpress { white-space: pre-wrap; padding: var(--space-3); background: var(--color-surface); border: 1px dashed var(--color-separator);
  border-radius: var(--radius-m); user-select: all; -webkit-user-select: all; }

/* ---- the three steps (survey, check the text, post on Google) ---- */
nav.progress { margin: 0 0 var(--space-4); }
ol.steps { display: flex; gap: var(--space-1); list-style: none; margin: 0; padding: 0; font-size: var(--text-xs); }
/* number above the label so 「Googleに投稿」 fits one line at 375 wide */
ol.steps li.step { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px; border-top: 3px solid var(--color-line);
  color: var(--color-ink-muted); min-width: 0; text-align: center; line-height: 1.4; }
ol.steps li.step.done { border-top-color: var(--color-accent); }
ol.steps li.step.current { border-top-color: var(--color-accent); color: var(--color-ink); font-weight: var(--weight-semibold); }
ol.steps .step-num { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 1.5em; height: 1.5em; border-radius: 50%;
  border: 1px solid currentColor; font-size: var(--text-xs); }

/* ---- the posting guide (mapumaru-legal-prerelease P-19): Google's review screen as an iPhone shows it, the stars empty.
   The g- rules below draw another company's screen, so they keep that screen's own colors (the one place with colors that
   are not the app's tokens); the numbers beside it are the app's green. ---- */
section.guide { margin: var(--space-4) 0 0; padding: var(--space-3); border-radius: var(--radius-m); background: var(--color-surface); }
div.g-mock { margin: var(--space-2) 0 0; padding-left: 30px; }
div.g-screen { padding: 14px 14px 16px; border: 1px solid var(--color-separator); border-radius: 18px; background: var(--color-surface);
  color: #1f1f1f; font-family: var(--font-body); }
div.g-top { display: flex; align-items: center; gap: 8px; height: 36px; }
div.g-top .g-back { display: inline-flex; color: #444746; }
div.g-top .g-store { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: center; padding-right: 30px;
  font-size: 17px; font-weight: 400; }
div.g-who { display: flex; align-items: center; gap: 12px; margin: 14px 0 0 6px; }
div.g-who .g-avatar { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%;
  background: #4a5a66; color: var(--color-surface); font-size: 16px; }
div.g-who .g-name { font-size: 15px; line-height: 1.3; }
div.g-who .g-public { display: flex; align-items: center; gap: 4px; font-size: 12px; line-height: 1.4; color: #5f6368; }
div.g-who .g-info { display: inline-flex; color: #444746; }
div.g-row { position: relative; }
div.g-row .g-num { position: absolute; left: -44px; top: 50%; transform: translateY(-50%); display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%; background: var(--color-accent); color: var(--color-on-accent); font-size: 13px; font-weight: var(--weight-semibold); }
/* the gap above the stars is a margin, so the row (and its number) is only as tall as the stars */
div.g-stars { display: flex; justify-content: center; gap: 14px; margin: 18px 0 0; color: #80868b; }
div.g-stars .g-star { display: inline-flex; }
div.g-field { min-height: 76px; margin: 22px 0 0; padding: 10px 12px; border: 1px solid #79747e; border-radius: 4px; font-size: 14px; line-height: 1.6; color: #5f6368; }
div.g-photo { display: flex; align-items: center; justify-content: center; gap: 10px; height: 40px; margin: 12px 0 0; border-radius: 20px;
  background: #e9eef6; color: #1f1f1f; font-size: 14px; }
div.g-photo .g-camera { display: inline-flex; color: #1a73e8; }
div.g-space { height: 96px; }
div.g-post { display: flex; align-items: center; justify-content: center; height: 36px; border-radius: 18px; background: #3574de; color: var(--color-surface); font-size: 14px; }
ol.guide-steps { margin: var(--space-2) 0 0; padding-left: 1.5em; }

/* ---- the thank-you coupon (mapumaru-survey-coupon A-1..A-6): the offer on the first screen, the coupon to save ---- */
div.coupon-offer { margin: var(--space-3) 0 0; padding: var(--space-3); border-radius: var(--radius-m); background: var(--color-surface); }
div.coupon-offer p { margin: 0; }
div.coupon-offer p + p { margin-top: var(--space-1); }
p.coupon-offer-title { font-weight: var(--weight-semibold); }
p.coupon-note { margin-top: var(--space-3); text-wrap: balance; }
p.coupon-lead { text-wrap: balance; }
/* (mapumaru-coupon-screen-words A-01) a phrase of the coupon views breaks as one piece; a phrase wider than the line still wraps */
span.phrase { display: inline-block; max-width: 100%; }
div.coupon { margin: var(--space-4) 0 0; padding: var(--space-4) var(--space-3); border: 1px solid var(--color-line); border-radius: var(--radius-m);
  background: var(--color-surface); text-align: center; }
div.coupon p { margin: var(--space-1) 0; overflow-wrap: anywhere; text-wrap: balance; }
div.coupon .coupon-shop { margin-top: 0; color: var(--color-ink-muted); font-size: var(--text-xs); }
div.coupon .coupon-what { font-size: var(--text-xl); font-weight: var(--weight-bold); line-height: var(--leading-heading); }
div.coupon .coupon-cond { color: var(--color-ink-muted); font-size: var(--text-sm); }
/* the QR keeps the colors of its own SVG; the page only sizes it */
img.coupon-qr { display: block; width: 200px; height: 200px; margin: var(--space-3) auto; image-rendering: pixelated; }
div.coupon .coupon-code { margin-top: var(--space-3); font-size: var(--text-lg); font-weight: var(--weight-bold); line-height: var(--leading-heading);
  letter-spacing: 0.06em; font-variant-numeric: tabular-nums; }
div.coupon .coupon-code small { display: block; color: var(--color-ink-muted); font-size: var(--text-xs); font-weight: 400; letter-spacing: 0; }
div.coupon .coupon-when-label { margin: var(--space-3) 0 0; color: var(--color-ink-muted); font-size: var(--text-xs); }
div.coupon .coupon-when-label + .coupon-when { margin-top: 0; }
div.coupon .coupon-when, div.coupon .coupon-not-yet { font-weight: var(--weight-semibold); }
/* used or expired: the QR stays (used) but faded, and a plain stamp says when */
div.coupon.used img.coupon-qr { opacity: 0.3; }
span.coupon-stamp { display: inline-block; padding: var(--space-1) var(--space-3); border: 2px solid var(--color-ink-muted); border-radius: var(--radius-s);
  color: var(--color-ink-muted); font-weight: var(--weight-bold); }

/* ---- the owner's preview (mapumaru-survey-preview P-04, P-06): only on a page opened with `?preview=1` ---- */
/* the band: the wireframe's navy ground (the ink), white 13px, two lines split where the sentences end, on every view */
div.preview-band { position: sticky; top: 0; z-index: 10; padding: var(--space-2) var(--space-3); background: var(--color-ink);
  color: var(--color-on-accent); font-size: var(--text-xs); line-height: var(--leading-body); text-align: center; }
div.preview-band span { display: block; }
p.preview-line { margin: var(--space-2) 0 0; text-align: center; }
p.preview-line:empty { display: none; }
/* where the customer's coupon has its QR and number: a dashed box, 「見本」 and one line, the QR's size */
div.coupon-sample { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-2); width: 200px; height: 200px;
  box-sizing: border-box; margin: var(--space-3) auto; padding: var(--space-3); border: 1px dashed var(--color-separator); border-radius: var(--radius-s);
  color: var(--color-ink-muted); font-size: var(--text-xs); line-height: var(--leading-body); }
div.coupon-sample b { color: var(--color-ink); font-size: var(--text-lg); }
div.coupon-sample span span { display: inline-block; }
