/* ==========================================================================
   ホームページAI化 — Design System & Layout
   Normalized weights: 400 / 500 / 600 / 700
   Minimum legible size: 12px
   ========================================================================== */

:root {
  color-scheme: light;
  --paper: #ffffff;
  --soft: #f5f7f9;
  --surface: #f8f9fb;
  --white: #ffffff;
  --ink: #132234;
  --text: #2c3f52;
  --muted: #506170;
  --dark: #1a406d;
  --action: #17549c;
  --action-hover: #124078;
  --selected: #edf4fc;
  --line: #dbe3ec;
  --control-line: #8694a3;

  --draft-ink: #724600;
  --draft-bg: #fff5d9;
  --draft-line: #e4c67b;

  --published-ink: #165e44;
  --published-bg: #e7f5ed;
  --published-line: #a7d7bc;

  --error-ink: #a32626;
  --error-bg: #fdf1f1;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius: 14px;
  --shadow-sm: 0 1px 2px rgba(19, 34, 52, 0.06);
  --shadow-md: 0 10px 30px -10px rgba(19, 34, 52, 0.12), 0 2px 6px rgba(19, 34, 52, 0.04);

  font-family: "Noto Sans JP", "Hiragino Sans", "Yu Gothic", system-ui, sans-serif;
  background: var(--paper);
  color: var(--ink);
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: 24px; }
body { margin: 0; line-height: 1.7; font-size: 15px; color: var(--ink); }
#app { min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1 0 auto; }
#app:has(.flow-content) { background: var(--soft); }
main p { word-break: auto-phrase; }

h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; }
h1, h2, h3, h4 { line-height: 1.35; font-weight: 700; color: var(--ink); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
:focus-visible { outline: 2px solid var(--action); outline-offset: 3px; }
button:disabled { opacity: 0.48; cursor: default; }
::selection { background: var(--selected); color: var(--dark); }

.frame { width: min(1120px, calc(100% - 80px)); margin-inline: auto; }
.icon { width: 18px; height: 18px; vertical-align: middle; flex: 0 0 auto; }
.sr, .skip:not(:focus) {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap;
}
.skip:focus {
  position: absolute; z-index: 20; top: 12px; left: 12px; padding: 10px 14px;
  background: var(--white); border: 1px solid var(--dark); border-radius: var(--radius-sm);
}

/* Buttons & Controls */
.btn {
  display: inline-flex; justify-content: center; align-items: center; gap: 8px;
  min-height: 46px; padding: 10px 20px; border: 1px solid transparent;
  border-radius: var(--radius-md); font-weight: 700; font-size: 14px;
  text-align: center; line-height: 1.4;
  transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}
.btn .icon { width: 17px; height: 17px; }
.btn.dark { background: var(--action); color: var(--white); box-shadow: var(--shadow-sm); }
.btn.dark:not(:disabled):hover { background: var(--action-hover); }
.btn.light { background: var(--paper); border-color: var(--control-line); color: var(--dark); }
.btn.light:not(:disabled):hover { background: var(--soft); border-color: var(--dark); }
.btn.small { min-height: 38px; padding: 7px 13px; font-size: 13px; }
.btn.full { width: 100%; }

.text-btn {
  color: var(--dark); font-size: 14px; border: 0; background: none; padding: 0;
  font-weight: 600; display: inline-flex; align-items: center; gap: 6px;
  text-align: left; width: fit-content;
}
.text-btn:hover { text-decoration: underline; text-underline-offset: 4px; }
.text-btn .icon { width: 16px; height: 16px; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--dark); font-size: 12px; font-weight: 700; letter-spacing: 0.06em;
}
.muted { color: var(--muted); }
.micro { font-size: 13px; line-height: 1.65; color: var(--muted); }
.middot { color: var(--muted); }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  min-height: 24px; padding: 2px 9px; border-radius: 5px;
  font-size: 12px; font-weight: 700; line-height: 1.3;
  color: var(--text); background: var(--soft);
  white-space: nowrap; vertical-align: middle;
}
.badge.green { color: var(--published-ink); background: var(--published-bg); }
.badge.amber { color: var(--draft-ink); background: var(--draft-bg); }
.badge.blue { color: var(--dark); background: var(--selected); }
.badge .icon { width: 13px; height: 13px; }

/* ==========================================================================
   Header & Footer
   ========================================================================== */

.site-head { background: var(--paper); border-bottom: 1px solid var(--line); }
.header-row {
  min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 20px;
}
.brand { display: inline-flex; align-items: center; gap: 8px; flex: 0 0 auto; color: var(--ink); }
.brand img { width: 32px; height: 32px; }
.brand span { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.25; }

.site-head nav, .head-actions { display: flex; align-items: center; gap: 24px; }
.site-head nav a, .head-portal {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px;
  color: var(--muted); font-size: 14px; font-weight: 600; white-space: nowrap;
}
.site-head nav a:hover, .head-portal:hover { color: var(--dark); text-decoration: underline; text-underline-offset: 5px; }
.site-head nav a[aria-current] { color: var(--dark); box-shadow: inset 0 -2px 0 var(--dark); }
.head-portal { color: var(--dark); }
.head-portal .icon { width: 16px; height: 16px; }
.header-portal-actions { display: flex; align-items: center; gap: 18px; }

@media (min-width: 851px) {
  .home-head .header-row { justify-content: flex-start; gap: 24px; }
  .home-head nav { margin-left: auto; }
  .home-head .head-actions { border-left: 1px solid var(--line); padding-left: 20px; }
}

.site-footer {
  padding: 40px 0 24px; margin-top: auto;
  border-top: 1px solid var(--line); background: var(--soft);
}
.footer-top { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.footer-top > div {
  margin-left: auto; display: flex; flex-wrap: wrap; gap: 22px;
  font-size: 13px; font-weight: 600; color: var(--text);
}
.footer-top a:hover { color: var(--dark); text-decoration: underline; text-underline-offset: 4px; }
.footer-bottom {
  margin-top: 28px; border-top: 1px solid var(--line); padding-top: 16px;
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  font-size: 12px; color: var(--muted);
}

/* ==========================================================================
   Landing Page (#home)
   ========================================================================== */

.home-content { font-size: 16px; }
.home-content h2 { font-size: clamp(24px, 2.7vw, 32px); letter-spacing: -0.02em; line-height: 1.38; }
.home-content h3 { font-size: 17px; letter-spacing: -0.01em; }
.home-content p, .home-content li, .home-example dd { line-height: 1.75; }

.home-hero {
  padding-block: clamp(32px, 4.8vw, 64px) clamp(36px, 5vw, 68px);
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.home-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  align-items: center;
  gap: clamp(28px, 4vw, 56px);
}
.home-intro { text-align: left; }
.home-intro h1 {
  font-size: clamp(30px, 3.6vw, 46px); line-height: 1.26; letter-spacing: -0.022em;
  font-weight: 700; text-wrap: balance;
}
.home-intro p {
  margin: 18px 0 0; max-width: 34em; color: var(--text); font-size: 16px;
}
.home-trial {
  margin-top: 28px; display: flex; justify-content: flex-start; align-items: center;
  flex-wrap: wrap; gap: 12px;
}
.home-trial .btn { min-height: 50px; padding-inline: 20px; font-size: 15px; }
.home-trial-note {
  margin-top: 12px; font-size: 13px; color: var(--muted); text-align: left;
}

/* Plan A: 4-industry photo + conversation carousel (5s calm crossfade, no app-UI chrome) */
.home-carousel { display: grid; gap: 10px; min-width: 0; }
.home-visual {
  position: relative; margin: 0; border-radius: var(--radius);
  overflow: hidden; background: var(--soft);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
  display: grid;
}
.home-visual-slide {
  grid-area: 1 / 1; position: relative; margin: 0;
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity 0.55s ease, visibility 0s 0.55s;
}
.home-visual-slide.is-active {
  opacity: 1; visibility: visible; pointer-events: auto; z-index: 1;
  transition: opacity 0.55s ease, visibility 0s 0s;
}
.home-visual-slide > img {
  width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; object-position: center 48%;
}
.home-visual-scrim {
  position: absolute; inset: auto 0 0 0;
  padding: 40px 16px 16px;
  background: linear-gradient(transparent, rgba(16, 26, 38, 0.72) 45%, rgba(16, 26, 38, 0.88));
  display: grid; gap: 8px;
}
.home-scene-nav {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.home-scene-btn {
  flex: 1 0 auto;
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  min-height: 36px; padding: 5px 10px; border-radius: 7px;
  border: 1px solid var(--line); background: var(--paper);
  color: var(--muted); font-size: 12px; font-weight: 600;
  white-space: nowrap;
  transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}
.home-scene-btn .icon { width: 14px; height: 14px; color: var(--muted); flex-shrink: 0; }
.home-scene-btn:hover { background: var(--soft); color: var(--ink); border-color: var(--control-line); }
.home-scene-btn:hover .icon { color: var(--dark); }
.home-scene-btn[aria-pressed="true"] {
  background: var(--selected); border-color: var(--action); color: var(--dark); font-weight: 700;
}
.home-scene-btn[aria-pressed="true"] .icon { color: var(--action); }
.home-bubble {
  max-width: 88%; padding: 8px 13px; border-radius: 12px;
  font-size: 13.5px; line-height: 1.45;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.2);
}
.home-bubble.is-owner {
  justify-self: end;
  background: var(--action); color: var(--white); font-weight: 600;
  border-bottom-right-radius: 4px;
}
.home-ai-stack {
  justify-self: start; display: grid; justify-items: start; gap: 5px;
  max-width: 88%;
}
.home-bubble-ai-label {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 700; color: rgba(255, 255, 255, 0.95);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
  padding-left: 2px;
}
.home-bubble-ai-label img {
  width: 20px; height: 20px; padding: 2px;
  border-radius: 50%; background: var(--white);
}
.home-bubble.is-ai {
  max-width: 100%;
  background: rgba(255, 255, 255, 0.97); color: var(--ink);
  border-bottom-left-radius: 4px;
}
.home-bubble-link {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 13px; font-weight: 700; color: var(--action);
  text-decoration: underline; text-underline-offset: 3px;
}
.home-bubble-link .icon { width: 13px; height: 13px; }

/* Home Sections */
.home-section { padding-block: clamp(40px, 5.5vw, 72px); }
.home-section h2 + p { margin-top: 10px; max-width: 44em; }
.home-section p { color: var(--text); }
.home-split { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: clamp(20px, 4vw, 48px); }

/* 3 Steps — open columns with subtle vertical rules instead of boxed cards */
.home-steps {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0; padding: 0; margin-top: 28px; list-style: none;
}
.home-steps li {
  padding: 4px clamp(16px, 2.6vw, 28px); border-left: 1px solid var(--line);
  display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 0 12px; align-items: start;
}
.home-steps li:first-child { border-left: 0; padding-left: 0; }
.home-step-num {
  display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  background: var(--selected); color: var(--dark); font-size: 13px; font-weight: 700;
}
.home-steps h3 { font-size: 16px; line-height: 1.45; margin-top: 3px; }
.home-steps p { font-size: 14px; color: var(--text); line-height: 1.7; margin-top: 6px; }

/* Trust Band — clean typographic 3-column grid without boxed card soup */
.home-trust { background: var(--surface); border-top: 1px solid var(--line); }
.trust-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(20px, 3vw, 36px); margin-top: 24px;
}
.trust-grid article {
  padding: 0;
  display: grid; align-content: start; gap: 8px;
}
.trust-grid h3 { display: flex; align-items: center; gap: 8px; font-size: 16px; }
.trust-grid h3 .icon { width: 18px; height: 18px; color: var(--dark); flex-shrink: 0; }
.trust-grid p { font-size: 14px; color: var(--text); line-height: 1.7; }

/* Cost Diagnosis Band */
.home-diagnosis { background: var(--soft); border-block: 1px solid var(--line); }
.home-diagnosis .home-section { align-items: center; }
.home-diagnosis-form { display: grid; min-width: 0; gap: 8px; }
.home-diagnosis-form label { font-size: 14px; font-weight: 700; color: var(--ink); }
.home-url-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
.home-url-row input {
  min-width: 0; min-height: 48px; border: 1px solid var(--control-line);
  color: var(--ink); padding: 10px 14px; border-radius: var(--radius-md);
  background: var(--white); font-size: 15px;
}
.home-url-row .btn { min-height: 48px; }

/* Pricing */
.standard-price {
  display: grid; grid-template-columns: minmax(190px, 0.42fr) 1fr;
  gap: clamp(20px, 4vw, 48px); margin-top: 24px; padding: clamp(22px, 3vw, 34px);
  border: 1px solid var(--line);
  border-radius: var(--radius); background: var(--paper);
}
.standard-price strong {
  display: block; margin-top: 4px; font-size: 44px; line-height: 1.2;
  letter-spacing: -0.02em; color: var(--dark); font-variant-numeric: tabular-nums;
}
.standard-price strong span { font-size: 20px; margin-left: 3px; font-weight: 700; }
.standard-price .price-sub { margin-top: 6px; font-size: 13px; color: var(--muted); }
.standard-price p { margin-top: 8px; max-width: 42em; font-size: 15px; }
.pricing-note { margin-top: 12px; font-size: 14px; color: var(--muted); }

.home-hosting {
  margin-top: 24px; padding: clamp(20px, 2.8vw, 28px);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.home-hosting h3 { display: flex; align-items: center; gap: 8px; font-size: 18px; }
.home-hosting h3 .icon { color: var(--dark); }
.home-hosting dl { margin: 14px 0 0; }
.home-hosting dl > div {
  display: grid; grid-template-columns: 10rem minmax(0, 1fr);
  gap: 12px; padding: 13px 0; border-top: 1px solid var(--line);
}
.home-hosting dt { font-weight: 700; font-size: 14px; color: var(--ink); }
.home-hosting dd { font-size: 15px; color: var(--text); }
.home-hosting summary { color: var(--dark); cursor: pointer; font-size: 14px; font-weight: 600; margin-top: 6px; }
.home-hosting details p { margin-block: 8px 4px; font-size: 14px; }
.home-hosting a { color: var(--dark); text-decoration: underline; text-underline-offset: 3px; }
.pricing-cta {
  margin-top: 24px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
}

/* FAQ */
.home-faq { background: var(--soft); border-top: 1px solid var(--line); }
.faq-list details { border-bottom: 1px solid var(--line); }
.faq-list details:first-child { border-top: 1px solid var(--line); }
.faq-list summary {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  cursor: pointer; padding: 16px 0; font-weight: 700; font-size: 15px; list-style: none;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary .icon { width: 18px; height: 18px; color: var(--dark); transition: transform 0.16s ease; }
.faq-list details[open] summary .icon { transform: rotate(180deg); }
.faq-list details p { padding-bottom: 16px; max-width: 62ch; font-size: 15px; color: var(--text); }

/* ==========================================================================
   App Flow Shared Styles (#diagnose, #result, #order, #portal, #access)
   ========================================================================== */

.flow-content { padding-block: 36px 68px; }
.flow-title { margin-bottom: 24px; }
.flow-title h1 { font-size: clamp(24px, 2.8vw, 34px); font-weight: 700; letter-spacing: -0.02em; margin-bottom: 6px; }
.flow-title p { max-width: 48em; font-size: 15px; color: var(--muted); overflow-wrap: anywhere; }

.output-head { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.flow-grid { display: grid; grid-template-columns: minmax(200px, 0.3fr) minmax(0, 1fr); gap: 16px 24px; align-items: start; }
.flow-aside {
  padding: 14px; grid-row: 1 / span 3;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
}
.flow-main-col { grid-column: 2; display: grid; gap: 14px; min-width: 0; }
.diagnostic-note { margin-top: 2px; }

.step-list { padding: 0; margin: 0; list-style: none; display: grid; gap: 4px; }
.step-list li {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: var(--radius-md);
  color: var(--muted); transition: background-color 0.16s ease;
}
.step-list li:not(:last-child)::after {
  content: ""; position: absolute; left: 26px; top: 42px; bottom: -14px;
  width: 2px; background: var(--line); z-index: 0;
}
.step-list li.complete:not(:last-child)::after { background: var(--published-line); }
.step-list li > span, .milestones li > span {
  position: relative; z-index: 1;
  display: grid; place-items: center; width: 30px; height: 30px; flex-shrink: 0;
  border-radius: 50%; background: var(--paper); border: 1.5px solid var(--line);
  color: var(--muted); font-size: 13px; font-weight: 700;
}
.step-list li .step-meta { display: grid; gap: 1px; min-width: 0; text-align: left; }
.step-list li strong { font-size: 14px; font-weight: 600; color: inherit; line-height: 1.35; }
.step-list li small { font-size: 12px; color: var(--muted); line-height: 1.4; }
.step-list li.complete { color: var(--text); }
.step-list li.complete:has(button) { padding: 0; }
.step-list li .step-jump {
  width: 100%; display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border: 0; background: transparent; border-radius: var(--radius-md);
  color: inherit; text-align: left;
}
.step-list li .step-jump:hover { background: var(--soft); }
.step-list li .step-jump > span {
  position: relative; z-index: 1;
  display: grid; place-items: center; width: 30px; height: 30px; flex-shrink: 0;
  border-radius: 50%; background: var(--published-bg); border: 1.5px solid var(--published-line);
  color: var(--published-ink); font-size: 13px; font-weight: 700;
}
.step-list li.active, .milestones li.active { color: var(--dark); font-weight: 700; }
.step-list li.active { background: var(--selected); }
.step-list li.active strong { font-weight: 700; color: var(--dark); }
.step-list li.active > span, .milestones li.active > span { background: var(--action); border-color: var(--action); color: var(--white); }
.step-list li.complete > span, .milestones li.complete > span {
  background: var(--published-bg); border-color: var(--published-line); color: var(--published-ink);
}
.step-list .icon, .milestones .icon { width: 15px; height: 15px; }

.aside-tip {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 18px; color: var(--ink);
}
.aside-tip strong { font-size: 14px; }
.aside-tip p { font-size: 13px; line-height: 1.6; margin-top: 2px; color: var(--muted); }

.panel { padding: 24px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
.panel h2 { font-size: 20px; letter-spacing: -0.015em; }
.panel h3 { font-size: 15px; }
.form-panel { padding: clamp(20px, 3.2vw, 36px); }
.form-panel > h2 { font-size: clamp(20px, 2vw, 26px); }
.form-panel > p:not(.form-error) { color: var(--muted); margin: 8px 0 20px; font-size: 14px; }

.field { display: grid; align-content: start; min-width: 0; gap: 6px; margin-bottom: 16px; font-size: 14px; font-weight: 700; }
.field small { font-weight: 400; line-height: 1.6; color: var(--muted); font-size: 13px; }
.field input, .field select, .field textarea, .edit-form textarea, .help-form input {
  min-width: 0; border: 1px solid var(--control-line); background: var(--white);
  color: var(--ink); border-radius: var(--radius-md); width: 100%; min-height: 44px;
  padding: 9px 12px; font-weight: 400; font-size: 15px;
}
.field select { overflow: hidden; text-overflow: ellipsis; padding-right: 12px; }
.field textarea, .edit-form textarea { resize: vertical; }
.field input:focus, .field textarea:focus, .edit-form textarea:focus, .help-form input:focus { outline-offset: 0; }
.fields-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.unit-input { position: relative; display: block; max-width: 15rem; }
.unit-input input { padding-right: 78px; -moz-appearance: textfield; appearance: textfield; font-variant-numeric: tabular-nums; }
.unit-input input::-webkit-outer-spin-button,
.unit-input input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.unit-input > span {
  color: var(--muted); position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  font-weight: 500; font-size: 13px; pointer-events: none;
}
.field-inline-action { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.field-inline-action .text-btn { font-size: 13px; }

.update-numbers { display: grid; gap: 4px; margin: 16px 0; }
.update-numbers .field {
  display: grid; grid-template-columns: minmax(0, 1fr) 10rem;
  align-items: center; gap: 10px; margin: 0; padding: 10px 0; border-top: 1px solid var(--line);
}
.update-numbers .unit-input input { padding-right: 64px; }

.checks { display: grid; grid-template-columns: 1fr 1fr; padding: 0; border: 0; margin: 0 0 20px; gap: 10px; }
.checks label {
  position: relative; cursor: pointer; user-select: none;
  border: 1px solid var(--line); background: var(--white);
  padding: 12px 14px; border-radius: var(--radius-md); min-height: 50px;
  font-size: 14px; font-weight: 600; color: var(--text);
  display: flex; align-items: center; gap: 10px;
  box-shadow: 0 1px 2px rgba(19, 34, 52, 0.06);
  transition: background-color 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease, transform 0.08s ease;
}
.checks label:hover { background: var(--surface); border-color: var(--control-line); }
.checks label:active { transform: translateY(1px); box-shadow: none; }
.checks label:has(input:focus-visible) { outline: 2px solid var(--action); outline-offset: 2px; }
.checks label:has(input:checked) {
  background: var(--selected); border-color: var(--action); color: var(--dark); font-weight: 700;
  box-shadow: inset 0 2px 4px rgba(19, 34, 52, 0.11);
}
.checks input[type="checkbox"] {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap;
}
.checks .check-icon { display: inline-flex; width: 18px; height: 18px; color: var(--muted); flex-shrink: 0; }
.checks label:has(input:checked) .check-icon { color: var(--action); }
.checks .check-mark {
  margin-left: auto; display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 50%;
  color: transparent; background: transparent;
  transition: background-color 0.14s ease, color 0.14s ease;
}
.checks .check-mark .icon { width: 13px; height: 13px; }
.checks label:has(input:checked) .check-mark { background: var(--action); color: var(--white); }
input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--action); flex: 0 0 auto; }

.heading-with-icon { display: flex; align-items: center; gap: 9px; }
.heading-with-icon .icon { width: 20px; height: 20px; color: var(--action); flex-shrink: 0; }
.field-label-icon { display: inline-flex; align-items: center; gap: 6px; }
.field-label-icon .icon { width: 15px; height: 15px; color: var(--dark); }
.aside-tip-body { display: flex; align-items: start; gap: 10px; }
.aside-tip-body > .icon { width: 18px; height: 18px; color: var(--dark); margin-top: 2px; flex-shrink: 0; }

.form-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 20px; }
.form-error {
  color: var(--error-ink); background: var(--error-bg); padding: 9px 12px;
  border-radius: var(--radius-sm); font-size: 13px; font-weight: 600;
}
.form-error:empty, .editor-feedback:empty, #help-answer:empty { display: none; }

/* ==========================================================================
   Diagnostic Report (#result)
   ========================================================================== */

.result-content { display: grid; gap: 18px; }
.result-content .flow-title { margin-bottom: 4px; }

/* 1. Benefits Hero */
.result-benefits {
  padding: clamp(20px, 2.8vw, 28px);
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
}
.result-benefits-head { margin-bottom: 18px; }
.result-benefits-head h2 { font-size: clamp(20px, 2.4vw, 26px); letter-spacing: -0.02em; }
.result-benefits-head p { color: var(--muted); font-size: 14px; margin-top: 6px; }

.benefit-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.benefit-card {
  display: flex; flex-direction: column; gap: 8px; padding: 18px;
  border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface);
}
.benefit-card.is-highlight {
  background: var(--published-bg); border-color: var(--published-line);
}
.benefit-label {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 700; color: var(--muted);
}
.benefit-card.is-highlight .benefit-label { color: var(--published-ink); }
.benefit-label .icon { width: 16px; height: 16px; color: var(--dark); }
.benefit-card.is-highlight .benefit-label .icon { color: var(--published-ink); }
.benefit-value {
  font-size: clamp(21px, 2.3vw, 27px); font-weight: 700; line-height: 1.3;
  letter-spacing: -0.015em; color: var(--ink); font-variant-numeric: tabular-nums;
}
.benefit-card.is-highlight .benefit-value { color: var(--published-ink); }
.benefit-compare {
  display: inline-flex; align-items: center; flex-wrap: wrap; gap: 6px;
  font-size: 13px; font-weight: 600; color: var(--text);
}
.benefit-compare .before { color: var(--muted); text-decoration: line-through; text-decoration-color: #9aa7b4; font-weight: 500; }
.benefit-compare .after { color: var(--dark); font-weight: 700; }
.benefit-card.is-highlight .benefit-compare .after { color: var(--published-ink); }
.benefit-card small { font-size: 13px; color: var(--muted); line-height: 1.6; margin-top: auto; }

/* 2. Breakdown & Scope */
.report-detail { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.scope-panel > p, .economics-panel > p.panel-lead { font-size: 13px; color: var(--muted); margin: 6px 0 12px; }
.scope-list { padding: 0; list-style: none; }
.scope-list li { padding: 12px 0; border-top: 1px solid var(--line); }
.scope-list li > div { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 14px; }
.scope-list li p { font-size: 13px; color: var(--muted); margin-top: 5px; line-height: 1.6; }

.economics-panel dl, .checkout dl {
  display: grid; grid-template-columns: 1fr auto; align-items: center;
  gap: 10px 14px; margin: 14px 0; font-size: 14px;
}
.economics-panel dt, .checkout dt { color: var(--muted); }
.economics-panel dd, .checkout dd {
  font-weight: 700; text-align: right; overflow-wrap: anywhere;
  min-width: 0; font-variant-numeric: tabular-nums;
}
.economics-panel .econ-total {
  padding-top: 10px; border-top: 1px solid var(--line);
  color: var(--ink); font-weight: 700;
}
.economics-panel p, .checkout p { font-size: 13px; color: var(--muted); line-height: 1.65; margin-top: 10px; }

/* 3. Cost & ROI Card */
.result-cost {
  display: grid; grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.18fr);
  gap: 22px; padding: clamp(20px, 2.8vw, 28px);
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  align-items: stretch;
}
.result-cost-main {
  display: flex; flex-direction: column; gap: 8px;
  padding-right: 22px; border-right: 1px solid var(--line);
}
.result-cost-main h2 { font-size: 19px; margin-top: 4px; }
.result-cost-price {
  font-size: clamp(32px, 3.6vw, 44px); font-weight: 700; line-height: 1.2;
  letter-spacing: -0.02em; color: var(--dark); font-variant-numeric: tabular-nums;
}
.result-cost-price span { font-size: 16px; font-weight: 700; margin-left: 6px; color: var(--text); }
.result-cost-main p { font-size: 14px; color: var(--text); line-height: 1.7; }
.result-cost-main .micro { font-size: 13px; color: var(--muted); margin-top: auto; }

.result-roi {
  display: flex; flex-direction: column; gap: 14px; justify-content: center;
}
.roi-banner {
  padding: 16px 18px; border-radius: var(--radius-md);
  background: var(--selected); border: 1px solid #c4daf5;
}
.roi-banner.is-savings {
  background: var(--published-bg); border-color: var(--published-line);
}
.roi-banner strong {
  display: block; font-size: clamp(17px, 1.8vw, 20px); color: var(--ink); line-height: 1.4;
}
.roi-banner.is-savings strong { color: var(--published-ink); }
.roi-banner p { font-size: 13px; color: var(--text); margin-top: 4px; line-height: 1.6; }

.roi-merits { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.roi-merits li {
  display: flex; align-items: start; gap: 8px;
  font-size: 14px; color: var(--text); line-height: 1.55;
}
.roi-merits .icon { width: 16px; height: 16px; color: var(--published-ink); margin-top: 3px; flex-shrink: 0; }

.toggle {
  display: inline-flex; background: var(--soft); padding: 3px; gap: 3px;
  border: 1px solid var(--line); border-radius: var(--radius-md);
}
.toggle button {
  min-height: 36px; font-size: 13px; color: var(--text); border: 1px solid transparent;
  border-radius: 7px; padding: 5px 11px; background: transparent; font-weight: 600;
}
.toggle button[aria-pressed="true"] {
  background: var(--white); border-color: var(--control-line); color: var(--dark);
  box-shadow: var(--shadow-sm); font-weight: 700;
}

.next-card {
  margin-top: 2px; border: 1px solid #c4daf5; padding: 22px 26px;
  border-radius: var(--radius); background: var(--selected);
  display: flex; gap: 18px; align-items: center; justify-content: space-between;
}
.next-card h2 { font-size: clamp(19px, 2.1vw, 24px); margin: 0 0 4px; letter-spacing: -0.015em; }
.next-card p { color: var(--text); font-size: 14px; }

/* ==========================================================================
   Sample Trial (#trial) & Portal Editor (#portal-edit)
   ========================================================================== */

.trial-content { padding-block: 22px 24px; }
.trial-header {
  display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap;
  gap: 12px 20px; margin-bottom: 18px;
}
.trial-header-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.trial-header-copy { display: grid; gap: 3px; }
.trial-header h1 { font-size: clamp(20px, 2vw, 24px); letter-spacing: -0.02em; line-height: 1.3; }
.trial-header p { font-size: 13px; color: var(--muted); line-height: 1.5; }

.trial-grid {
  display: grid; grid-template-columns: minmax(0, 1.24fr) minmax(0, 0.76fr);
  align-items: start; gap: 16px;
}
.trial-content .trial-grid { align-items: stretch; }
.trial-content .sample-preview-shell,
.trial-content .editor-panel {
  height: clamp(520px, calc(100dvh - 190px), 660px);
  display: flex; flex-direction: column;
}
.sample-preview-shell { gap: 10px; min-width: 0; }
.sample-controls-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px 12px; flex-wrap: wrap; flex: 0 0 auto;
}
.sample-sector-tabs { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-width: 0; }
.sector-switch-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  min-height: 36px; padding: 6px 11px;
  border: 1px solid var(--line); border-radius: var(--radius-md);
  background: var(--white); color: var(--text);
  font-size: 12px; font-weight: 600; white-space: nowrap;
  transition: background-color 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}
.sector-switch-btn .icon { width: 14px; height: 14px; color: var(--muted); flex-shrink: 0; }
.sector-switch-btn:hover { background: var(--surface); border-color: var(--control-line); color: var(--ink); }
.sector-switch-btn[aria-pressed="true"] {
  background: var(--selected); border-color: var(--action); color: var(--dark);
  font-weight: 700; box-shadow: inset 0 0 0 1px var(--action);
}
.sector-switch-btn[aria-pressed="true"] .icon { color: var(--action); }
.sample-device-stage {
  flex: 1 1 0; min-height: 0; display: flex; flex-direction: column;
}
.trial-content .coffee-browser {
  flex: 1 1 0; min-height: 0; display: flex; flex-direction: column;
}
.trial-content .coffee-browser .preview-stage {
  flex: 1 1 0; min-height: 0; display: flex; flex-direction: column;
}
.trial-content .chat-editor {
  flex: 1 1 0; min-height: 0; display: flex; flex-direction: column;
}
.trial-content .chat-log {
  flex: 1 1 0; min-height: 160px; height: auto;
}
.trial-content .edit-form { flex: 0 0 auto; }
.editor-panel { padding: 18px; }
.editor-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.editor-heading h2 { display: flex; align-items: center; gap: 7px; font-size: 16px; }
.editor-heading h2 .icon { color: var(--dark); }
.editor-heading p { color: var(--muted); font-size: 13px; margin-top: 4px; }
.editor-toggle { margin: 0 0 12px; }

.chat-log {
  height: clamp(210px, calc(100dvh - 485px), 305px);
  overflow: auto; border: 1px solid var(--line); background: var(--soft);
  border-radius: var(--radius-md); list-style: none; padding: 10px;
  display: grid; grid-auto-rows: max-content; gap: 8px; margin-bottom: 10px; align-content: start;
}
.chat-log[hidden] { display: none; }
.chat-turn { display: flex; gap: 7px; font-size: 14px; align-items: flex-start; scroll-margin-block: 12px; }
.chat-turn > div {
  padding: 8px 11px; border-radius: var(--radius-md);
  background: var(--white); border: 1px solid var(--line); max-width: 92%; min-width: 0;
}
.chat-turn strong { color: var(--muted); font-size: 12px; font-weight: 700; display: block; margin-bottom: 3px; }
.chat-turn.assistant strong { color: var(--dark); display: flex; align-items: center; gap: 6px; }
.ai-avatar { width: 20px; height: 20px; }
.chat-turn p { line-height: 1.55; overflow-wrap: anywhere; white-space: pre-wrap; font-size: 14px; }
.chat-turn.user { justify-content: flex-end; }
.chat-turn.user > div { background: #dfeefa; border-color: #c2d9ee; }
.chat-typing { font-size: 13px; color: var(--muted); padding: 2px 4px; }
.chat-turn.arriving > div { border-color: #6485a4; }

.edit-form { display: grid; align-content: start; gap: 8px; }
.edit-form > label:not(.field), .help-form > label { font-size: 13px; font-weight: 700; }
.edit-form textarea { font-size: 14px; line-height: 1.55; min-height: 54px; padding: 8px 10px; }
.manual-form { gap: 0; }
.manual-form .field { margin-bottom: 11px; }
.manual-form > .btn.light { width: fit-content; min-height: 36px; margin: 0 0 12px; padding-block: 5px; }

.chips { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0 0 4px; }
.chips button {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  min-height: 38px; border: 1px solid var(--line); color: var(--dark);
  background: var(--soft); border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600; padding: 5px 7px; white-space: nowrap;
  transition: background-color 0.14s ease, border-color 0.14s ease;
}
.chips button .icon { width: 14px; height: 14px; color: var(--action); opacity: 0.85; }
.chips button:hover { background: var(--selected); border-color: var(--control-line); }
.chips button[aria-pressed="true"] {
  background: var(--selected); border-color: var(--action); color: var(--dark);
  font-weight: 700; box-shadow: inset 0 0 0 1px var(--action);
}
.chips button[aria-pressed="true"] .icon { opacity: 1; }
.chips button:focus-visible { outline-offset: 1px; }

.chat-compose { display: grid; gap: 8px; }
.compose-field { position: relative; }
.chat-compose textarea { width: 100%; min-width: 0; display: block; }
.chat-compose textarea[readonly] { resize: none; cursor: text; background: var(--white); }
.chat-compose textarea[readonly]:focus:not(:focus-visible) { outline: none; }
.readonly-hint {
  position: absolute; left: 0; bottom: calc(100% + 8px); z-index: 5;
  max-width: 100%; padding: 7px 11px; border-radius: var(--radius-sm);
  background: var(--ink); color: var(--white);
  font-size: 12px; font-weight: 600; line-height: 1.5;
  box-shadow: 0 8px 20px rgba(19, 34, 52, 0.24);
  pointer-events: none;
}
.readonly-hint::after {
  content: ""; position: absolute; left: 16px; top: 100%;
  border: 6px solid transparent; border-top-color: var(--ink);
}
.chat-compose .btn { justify-self: end; min-height: 42px; margin: 0; padding: 8px 16px; gap: 7px; white-space: nowrap; }
.chat-input[inert] { opacity: 0.65; }
.editor-feedback { font-size: 13px; color: var(--dark); font-weight: 700; margin-top: 10px; }
.draft-jump { margin-top: 10px; }
.draft-jump .text-btn { min-height: 36px; text-decoration: underline; text-underline-offset: 3px; }

/* Post-experience CTA banner inside #trial */
.trial-next-banner {
  margin-top: 14px; padding: 16px 20px; border-radius: var(--radius);
  background: var(--selected); border: 1px solid #c4daf5;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px;
}
.trial-next-banner strong { display: block; font-size: 15px; color: var(--ink); }
.trial-next-banner p { font-size: 13px; color: var(--text); margin-top: 2px; }
.trial-next-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* Preview Panel */
.preview-panel { padding: 0; overflow: hidden; }
.preview-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 16px; }
.preview-head h2 { display: flex; align-items: center; gap: 7px; font-size: 15px; font-weight: 700; letter-spacing: normal; }
.preview-head .icon, .draft-comparison h3 .icon { width: 16px; height: 16px; color: var(--dark); }
.preview-head [data-id="publish"][aria-pressed="true"] { color: var(--published-ink); background: var(--published-bg); border-color: var(--published-line); }
.preview-head [data-id="draft"][aria-pressed="true"] { color: var(--draft-ink); background: var(--draft-bg); border-color: var(--draft-line); }

.preview-address {
  background: var(--soft); border-block: 1px solid var(--line);
  display: flex; min-height: 34px; align-items: center; padding-inline: 12px;
}
.preview-address > span { color: var(--muted); font-size: 13px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.preview-views { display: flex; gap: 14px; padding: 6px 14px; border-bottom: 1px solid var(--line); background: var(--paper); }
.preview-views .text-btn { color: var(--muted); font-size: 13px; min-height: 34px; }
.preview-views .text-btn[aria-pressed="true"] { color: var(--dark); box-shadow: inset 0 -2px 0 var(--dark); }
.preview-stage { position: relative; }
.preview-overlay {
  position: absolute; inset: 0; z-index: 4;
  display: grid; place-items: center; padding: 20px;
  background: rgba(16, 28, 42, 0.66);
  backdrop-filter: blur(2px);
  color: var(--white);
}
.preview-overlay-card {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  max-width: 300px; padding: 20px 24px; text-align: center;
  border-radius: var(--radius);
  background: rgba(16, 28, 42, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.35);
}
.preview-overlay-badge {
  position: relative; display: grid; place-items: center;
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--white);
}
.preview-overlay-badge img { width: 28px; height: 28px; }
.preview-spinner {
  position: absolute; inset: -4px; border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.28);
  border-top-color: #7cc4ff;
}
.preview-overlay-card strong { font-size: 15px; line-height: 1.45; color: var(--white); }
.preview-overlay-card span { font-size: 13px; color: #d5e4f5; }

/* Coffee Browser Mockup */
.coffee-browser { container-type: inline-size; min-width: 0; overflow: hidden; }
.coffee-browser.panel { border: 1px solid #b4c0cc; border-radius: var(--radius); box-shadow: var(--shadow-md); }
.coffee-titlebar {
  display: flex; align-items: flex-end; gap: 10px;
  min-height: 40px; padding: 6px 10px 0 12px;
  background: #dce3ea; flex: 0 0 auto;
}
.window-dots { display: flex; gap: 5px; align-self: center; padding-bottom: 4px; flex: 0 0 auto; }
.window-dots i { width: 8px; height: 8px; border-radius: 50%; background: #9aa6b2; }
.coffee-tabs { display: flex; align-items: flex-end; gap: 4px; flex: 1; min-width: 0; flex-wrap: wrap; }
.coffee-tab-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  min-height: 34px; padding: 6px 12px;
  border: 0; border-radius: 8px 8px 0 0;
  background: rgba(255, 255, 255, 0.42);
  color: var(--muted); font-size: 12px; font-weight: 600; white-space: nowrap;
  transition: background-color 0.14s ease, color 0.14s ease;
}
.coffee-tab-btn .icon { width: 14px; height: 14px; color: var(--muted); flex-shrink: 0; }
.coffee-tab-btn:hover { background: rgba(255, 255, 255, 0.78); color: var(--ink); }
.coffee-tab-btn:hover .icon { color: var(--dark); }
.coffee-tab-btn[aria-pressed="true"] {
  background: #f4f7fa; color: var(--dark); font-weight: 700;
  box-shadow: 0 -1px 0 rgba(19, 34, 52, 0.08);
}
.coffee-tab-btn[aria-pressed="true"] .icon { color: var(--action); }
.coffee-tab-btn:focus-visible { outline-offset: -2px; }
.coffee-toolbar { display: flex; align-items: center; gap: 10px; padding: 6px 12px; background: #f4f7fa; border-bottom: 1px solid var(--line); flex: 0 0 auto; }
.coffee-address {
  display: flex; align-items: center; justify-content: center; gap: 6px; flex: 1; min-width: 0;
  border-radius: 6px; background: var(--white); border: 1px solid #d5dee7;
  font: 12px/2 system-ui, sans-serif; color: #495667;
}
.coffee-address .icon { width: 13px; height: 13px; flex-shrink: 0; }
.compact-browser-bar { background: #e8eef4; border-bottom: 1px solid #cdd7e2; padding: 7px 12px; }
.compact-browser-bar .window-dots { padding-bottom: 0; }
.device-toggle { flex-shrink: 0; }
.device-toggle button {
  display: inline-flex; align-items: center; gap: 4px;
  min-height: 28px; padding: 3px 9px; font-size: 12px;
}
.device-toggle button .icon { width: 13px; height: 13px; }

/* Smartphone Hardware Frame (shown only when .is-mobile-view is active) */
.phone-chrome,
.phone-home-bar { display: none; }
.phone-status {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 8px 18px 6px; background: var(--white);
}
.phone-time { font-size: 12px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.phone-notch { width: 76px; height: 18px; border-radius: 999px; background: #132234; }
.phone-indicators { display: inline-flex; align-items: center; justify-self: end; gap: 6px; }
.phone-sig {
  display: inline-block; width: 14px; height: 10px;
  background: linear-gradient(90deg, #132234 0 2px, transparent 2px 4px, #132234 4px 6px, transparent 6px 8px, #132234 8px 10px, transparent 10px 12px, #132234 12px 14px);
  clip-path: polygon(0 100%, 0 65%, 100% 0, 100% 100%);
}
.phone-bat {
  display: inline-block; width: 20px; height: 10px; position: relative;
  border: 1.5px solid #132234; border-radius: 3px; padding: 1.5px;
  background: #132234; background-clip: content-box;
}
.phone-bat::after {
  content: ""; position: absolute; right: -3.5px; top: 2px;
  width: 2px; height: 4px; border-radius: 0 1px 1px 0; background: #132234;
}
.phone-address {
  display: flex; align-items: center; justify-content: center; gap: 5px;
  margin: 0 12px 8px; padding: 5px 10px;
  border-radius: 8px; background: #f1f5f9; border: 1px solid #e2e8f0;
  font: 12px/1.3 system-ui, sans-serif; color: #475569;
}
.phone-address .icon { width: 12px; height: 12px; flex-shrink: 0; color: #64748b; }
.phone-address span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.phone-home-bar {
  justify-content: center; padding: 8px 0 6px;
  background: var(--white); border-top: 1px solid #edf2f7; flex: 0 0 auto;
}
.phone-home-bar span { display: block; width: 112px; height: 4px; border-radius: 999px; background: #cbd5e1; }

/* Mobile Device Preview Mode (Sample #trial / /sample) */
.sample-preview-shell.is-mobile-view .sample-device-stage {
  background: #e9eef4; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 16px; align-items: center; justify-content: center;
}
.sample-preview-shell.is-mobile-view .device-frame.coffee-browser {
  flex: 1 1 0; width: min(375px, 100%); max-height: 100%;
  border: 9px solid #1e293b; border-radius: 36px; background: var(--white);
  box-shadow: 0 18px 36px rgba(19, 34, 52, 0.2), 0 2px 6px rgba(19, 34, 52, 0.1);
}
.sample-preview-shell.is-mobile-view .browser-chrome { display: none; }
.sample-preview-shell.is-mobile-view .phone-chrome { display: block; flex: 0 0 auto; }
.sample-preview-shell.is-mobile-view .phone-home-bar { display: flex; }
.sample-preview-shell.is-mobile-view .coffee-items { grid-template-columns: 1fr; }
.sample-preview-shell.is-mobile-view .sample-site { container-type: inline-size; }

/* Sample Site Interior */
.sample-site { background: var(--white); display: flex; flex-direction: column; }
.coffee-browser .sample-site {
  --soft: #ffffff; --line: #e2dfd8; --dark: #463828;
  font-size: clamp(13px, 2.3cqi, 15px);
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.coffee-card-list {
  margin: 0 4%; padding: 12px 0; border-bottom: 1px solid var(--line);
}
.coffee-card-list h4 {
  font-family: "Hiragino Mincho ProN", "Yu Mincho", serif;
  font-size: 13px; letter-spacing: 0.06em; color: var(--dark); margin-bottom: 8px;
}
.coffee-items {
  list-style: none; padding: 0; margin: 0;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 16px;
  font-size: 13px; color: var(--ink);
}
.coffee-items li {
  display: flex; justify-content: space-between; align-items: baseline; gap: 8px;
  padding-bottom: 5px; border-bottom: 1px dotted #e6e2da;
}
.coffee-items li span:last-child { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.coffee-access {
  padding: 12px 4% 14px; display: grid; gap: 4px; font-size: 13px; color: var(--text);
}
.coffee-access h4 {
  font-family: "Hiragino Mincho ProN", "Yu Mincho", serif;
  font-size: 13px; letter-spacing: 0.06em; color: var(--dark); margin-bottom: 4px;
}
.coffee-access dl {
  display: grid; grid-template-columns: 5.5em minmax(0, 1fr); gap: 5px 10px;
}
.coffee-access dt { color: var(--muted); font-weight: 600; font-size: 12px; }
.coffee-access dd { color: var(--ink); font-size: 13px; overflow-wrap: anywhere; }
.sample-footer {
  margin-top: auto; padding: 14px 4% 16px;
  border-top: 1px solid var(--line); background: #f6f4ee;
  display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 6px 12px;
  color: var(--muted); font-size: 12px;
}
.sample-footer > div { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.sample-footer strong {
  font-family: "Hiragino Mincho ProN", "Yu Mincho", serif;
  color: var(--ink); font-size: 13px; letter-spacing: 0.06em;
}
.sample-footer small { font-size: 12px; color: var(--muted); }
.sample-nav {
  border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between;
  gap: 9px; padding: 9px 4%; color: var(--ink);
}
.sample-nav b { font-family: "Hiragino Mincho ProN", "Yu Mincho", serif; letter-spacing: 0.08em; font-size: clamp(15px, 2.8cqi, 18px); }
.sample-nav .text-btn { font-size: 13px; }

.sample-hero { position: relative; min-height: clamp(175px, 28cqi, 228px); display: flex; align-items: end; color: #ffffff; overflow: hidden; }
.sample-hero > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.sample-hero > div {
  position: relative; z-index: 1; width: 100%;
  background: linear-gradient(transparent, rgba(16, 16, 16, 0.84));
  padding: 36px 20px 16px; overflow-wrap: anywhere;
}
.sample-hero.no-photo { color: var(--ink); background: var(--soft); min-height: 170px; }
.sample-hero.no-photo > div { background: none; }
.sample-hero > div > span { letter-spacing: 0.1em; font-size: 12px; opacity: 0.92; }
.sample-hero h3 {
  font-family: "Hiragino Mincho ProN", "Yu Mincho", serif; color: inherit;
  font-size: clamp(19px, 3.8cqi, 28px); margin: 4px 0 6px;
}
.sample-hero p { font-size: clamp(12px, 2.1cqi, 14px); line-height: 1.55; white-space: pre-wrap; color: inherit; }
.sample-hero img.preview-highlight { outline-offset: -4px; outline-width: 4px; }

.sample-notice {
  margin: 10px 4%; padding: 10px 13px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); background: var(--surface); overflow-wrap: anywhere;
}
.coffee-browser .sample-notice { background: #fbfaf7; }
.sample-notice small { color: var(--dark); font-weight: 700; font-size: 12px; display: block; }
.sample-notice h4 { font-size: 14px; margin: 2px 0; }
.sample-notice .text-btn { font-size: inherit; }
.sample-notice p { color: var(--muted); font-size: 13px; white-space: pre-wrap; }

.coffee-menu { margin: 0 4%; padding: 10px 0; border-block: 1px solid var(--line); display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; }
.coffee-menu strong { font-size: 12px; color: var(--muted); }
.coffee-menu p { font-size: 14px; font-weight: 600; color: var(--ink); }

.sample-hours {
  padding: 10px 4% 12px; display: flex; flex-wrap: wrap; align-items: center;
  gap: 8px; font-size: 13px; overflow-wrap: anywhere;
}
.sample-subpage { min-height: 220px; padding: 22px 20px; border-top: 1px solid var(--line); }
.sample-subpage h3 { font-size: 19px; margin: 6px 0 12px; overflow-wrap: anywhere; }
.sample-subpage p { font-size: 14px; line-height: 1.75; margin: 9px 0 16px; white-space: pre-wrap; overflow-wrap: anywhere; }
.sample-subpage time { color: var(--muted); font-size: 12px; flex-shrink: 0; }
.sample-subpage ul { list-style: none; padding: 0; }
.sample-subpage li { border-top: 1px solid var(--line); padding: 9px 0; }
.sample-subpage li button { width: 100%; overflow-wrap: anywhere; }

/* Draft Comparison & History */
.draft-comparison { background: var(--soft); border-top: 1px solid var(--line); padding: 16px; }
.draft-comparison h3 { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; font-size: 14px; scroll-margin-top: 16px; }
.draft-comparison > p { font-size: 13px; }
.diff-field + .diff-field { margin-top: 12px; }
.diff-field h4 { font-size: 13px; margin-bottom: 5px; }
.diff-field dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0; }
.diff-field dl > div { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 9px 11px; }
.diff-field dl > div:last-child { background: var(--draft-bg); border-color: var(--draft-line); }
.diff-field dt { color: var(--muted); font-size: 12px; font-weight: 700; margin-bottom: 3px; }
.diff-field dl > div:last-child dt { color: var(--draft-ink); }
.diff-field dd { margin: 0; font-size: 13px; line-height: 1.55; overflow-wrap: anywhere; white-space: pre-wrap; }

.preview-actions {
  padding: 12px 16px; border-top: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.preview-actions > span { color: var(--muted); font-size: 13px; }
.preview-actions > .btn { min-height: 42px; flex-shrink: 0; font-size: 14px; padding-inline: 14px; }

.revision { border-top: 1px solid var(--line); padding: 12px 16px; }
.revision h3 { font-size: 13px; margin-bottom: 6px; }
.revision > div { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 0; font-size: 13px; }
.revision small { color: var(--muted); }
.revision .text-btn { font-size: 12px; }

.preview-highlight {
  background: #ffe5a1; color: #372b12; outline: 2px solid #ba8124;
  border-radius: 3px; box-decoration-break: clone;
}

/* ==========================================================================
   Order & Portal (#order, #portal*)
   ========================================================================== */

.order-flow { font-size: 14px; padding-left: 1.4em; margin-top: 8px; }
.order-flow li { margin-bottom: 6px; }
.checkout .btn { margin: 14px 0 10px; }

.portal-wrap:has(.trial-grid, .agent-grid) { width: min(1400px, calc(100% - 48px)); }
.portal-grid { display: grid; grid-template-columns: minmax(205px, 232px) minmax(0, 1fr); gap: 18px; align-items: start; }
.portal-sidebar { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.portal-sidebar nav { display: grid; gap: 6px; }
.portal-nav-group { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 4px; }
.portal-nav-group p {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  padding: 3px 10px 5px; color: var(--muted); font-weight: 700; font-size: 12px;
}
.portal-nav-group.is-locked a { color: var(--muted); opacity: 0.78; }
.portal-nav-group.is-locked a:hover { opacity: 1; }
.portal-mobile-nav { display: none; }
.portal-sidebar nav a {
  display: flex; align-items: center; gap: 9px; padding: 9px 10px; border-radius: var(--radius-sm);
  min-height: 40px; font-size: 14px; font-weight: 600; color: var(--text);
}
.portal-sidebar nav a:hover { color: var(--dark); background: var(--soft); }
.portal-sidebar nav a[aria-current] { color: var(--dark); background: var(--selected); font-weight: 700; }
.portal-sidebar nav a .icon { width: 16px; height: 16px; }

.portal-account {
  display: flex; align-items: center; gap: 10px; padding: 4px 4px 12px;
  margin-bottom: 8px; border-bottom: 1px solid var(--line);
}
.account-mark {
  display: grid; place-items: center; width: 32px; height: 32px;
  background: var(--selected); border-radius: var(--radius-sm); color: var(--dark); flex: 0 0 auto;
}
.portal-account strong, .portal-account small { display: block; }
.portal-account strong { font-size: 13px; overflow-wrap: anywhere; }
.portal-account small { font-size: 12px; color: var(--muted); }

.portal-main { display: grid; grid-template-columns: minmax(0, 1fr); align-items: start; gap: 16px; min-width: 0; }
.portal-hero {
  padding: clamp(20px, 2.8vw, 30px); background: var(--selected);
  border: 1px solid #c4daf5; border-radius: var(--radius);
}
.portal-hero h2 { font-size: clamp(21px, 2.5vw, 28px); letter-spacing: -0.02em; margin: 6px 0 8px; }
.portal-hero p { color: var(--text); max-width: 44em; font-size: 15px; margin-bottom: 14px; }

.portal-card > p { margin: 8px 0 12px; }
.portal-card > h3 { margin: 14px 0 8px; }
.portal-card > .muted { font-size: 14px; }
.portal-card dd { overflow-wrap: anywhere; }

.milestones { margin-top: 10px; list-style: none; padding: 0; }
.milestones li { display: flex; gap: 10px; align-items: center; min-height: 52px; border-bottom: 1px solid var(--line); padding-block: 6px; }
.milestones li:last-child { border-bottom: 0; }
.milestones strong, .milestones small { display: block; }
.milestones strong { font-size: 14px; }
.milestones small { color: var(--muted); font-size: 13px; }

.activity { padding: 0; list-style: none; margin-top: 8px; }
.activity li {
  display: flex; justify-content: space-between; align-items: start; gap: 14px;
  border-bottom: 1px solid var(--line); padding: 9px 0; font-size: 14px;
}
.activity li:last-child { border-bottom: 0; }
.activity time { color: var(--muted); font-size: 12px; white-space: nowrap; }

.progress-label { display: flex; justify-content: space-between; align-items: center; margin-top: 16px; font-size: 13px; }
progress { width: 100%; accent-color: var(--action); height: 12px; margin-bottom: 10px; }

.setup-list, .document-list { border-top: 1px solid var(--line); }
.setup-list > div, .document-list > div {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 12px 2px; border-bottom: 1px solid var(--line);
}
.setup-list label { display: flex; align-items: center; gap: 10px; cursor: pointer; flex: 1; }
.setup-list strong, .setup-list small, .document-list strong, .document-list small { display: block; font-size: 14px; }
.setup-list small, .document-list small { color: var(--muted); font-size: 12px; margin-top: 2px; }
.document-list > div > span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.portal-actions { margin-top: 14px; }

.billing-dl { display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; font-size: 14px; margin: 14px 0; }
.billing-dl dd { font-weight: 700; }
.billing-dl dt { color: var(--muted); }
.receipt-list { padding-left: 1.2em; margin: 8px 0 14px; font-size: 14px; color: var(--text); }

.button-row, .help-prompts { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 10px 0; }
.help-prompts .btn { min-height: 36px; font-size: 13px; padding: 6px 12px; }
.help-form { margin-top: 16px; }
.help-form > div { display: flex; gap: 8px; margin: 6px 0; }
#help-answer {
  background: var(--soft); border-left: 3px solid var(--action);
  border-radius: var(--radius-sm); padding: 12px 14px; margin-top: 10px; font-size: 14px;
}

.agent-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.agent-steps { padding: 0; list-style: none; margin-top: 16px; }
.agent-steps li {
  display: grid; grid-template-columns: 32px minmax(0, 1fr);
  align-items: start; gap: 12px; padding: 14px 0; border-top: 1px solid var(--line);
}
.agent-steps li > span {
  display: grid; place-items: center; width: 30px; height: 30px;
  border-radius: var(--radius-sm); background: var(--selected); color: var(--dark);
  font-size: 13px; font-weight: 700;
}
.agent-steps h3 { margin: 2px 0 8px; }
.agent-steps p, .agent-side p, .portal-update-grid p { font-size: 14px; color: var(--muted); line-height: 1.65; }
.agent-steps .agent-picker { margin-bottom: 10px; }
.agent-side { background: var(--surface); }
.agent-side h2 { margin: 0 0 8px; }
.agent-side ul { padding: 0; list-style: none; margin: 14px 0; }
.agent-side li { font-size: 13px; padding: 7px 0; border-top: 1px solid var(--line); }
.agent-file { position: relative; overflow: hidden; cursor: pointer; }
.agent-file:focus-within { outline: 2px solid var(--action); outline-offset: 2px; }
.agent-file input { position: absolute; inset: 0; height: 100%; width: 100%; opacity: 0; cursor: pointer; }
.agent-copy-text { width: 100%; resize: vertical; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--white); font-size: 13px; }
.next-link { margin-top: 12px; }

.portal-update-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 12px; }
.portal-update-grid article { padding: 12px 0; }
.portal-update-grid article + article { border-left: 1px solid var(--line); padding-left: 18px; }
.portal-update-grid h3 { display: flex; align-items: center; gap: 7px; }
.portal-update-grid h3 .icon { color: var(--dark); }
.portal-update-grid p { margin: 6px 0 14px; }
.portal-update-grid .btn { min-height: 40px; white-space: normal; }
.portal-notice { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.portal-notice h2 { margin-bottom: 4px; }

.setup-compare { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.setup-compare > div { padding: 14px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--soft); overflow-wrap: anywhere; }
.setup-compare > div:first-child { background: var(--draft-bg); border-color: var(--draft-line); }
.setup-compare span { display: block; font-size: 12px; font-weight: 700; color: var(--dark); margin-bottom: 5px; }
.setup-compare > div:first-child span { color: var(--draft-ink); }
.setup-compare strong { display: block; margin-bottom: 5px; font-size: 14px; }
.setup-compare p, .notification-list p { font-size: 13px; color: var(--text); }

.setup-response, .notification-list details { border: 1px solid var(--line); border-radius: var(--radius-md); padding: 11px 14px; margin-top: 10px; background: var(--paper); }
.setup-response summary, .notification-list summary { font-size: 14px; font-weight: 700; cursor: pointer; }
.setup-response pre { margin: 10px 0 0; overflow: auto; padding: 12px; border-radius: var(--radius-sm); background: var(--soft); font-size: 12px; }
.notification-list p { margin: 8px 0 12px; }
.ai-setup-next .micro { margin: 10px 0 0; }

/* Access / Login / Mail Preview */
.frame.access-page {
  width: min(440px, calc(100% - 32px));
  display: flex; flex-direction: column; justify-content: center;
  padding-block: clamp(24px, 4vh, 40px) clamp(32px, 5vh, 48px);
}
.panel.access-card {
  width: 100%;
  padding: clamp(24px, 4vw, 32px);
  box-shadow: var(--shadow-md);
}
.access-head h1 {
  font-size: clamp(18px, 4.6vw, 22px);
  letter-spacing: -0.02em;
  line-height: 1.35;
  word-break: auto-phrase;
  text-wrap: balance;
}
.access-lead {
  margin-top: 8px;
  font-size: 14px;
  line-height: 1.65;
  color: var(--muted);
}
.access-email { color: var(--ink); font-weight: 700; overflow-wrap: anywhere; }
.access-form {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}
.access-form .field {
  margin-bottom: 0;
  gap: 6px;
  font-size: 13px;
}
.access-form .btn.dark {
  margin-top: 4px;
  min-height: 46px;
  font-size: 15px;
}
.access-form .code-input {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.access-note {
  margin-top: 14px;
  text-align: center;
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
}
.access-alt {
  margin-top: 18px;
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap;
  gap: 4px 8px;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}
.access-alt .text-btn { font-size: 13px; gap: 4px; }
.access-alt .text-btn .icon { width: 14px; height: 14px; }
.access-cta { margin-top: 20px; min-height: 46px; font-size: 15px; }
.mail-preview {
  margin-top: 20px; padding: 18px 20px;
  border: 1px solid var(--line); border-radius: var(--radius-md);
  background: var(--surface); display: grid; gap: 8px;
}
.mail-meta { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.mail-preview h2 { font-size: 16px; letter-spacing: -0.01em; }
.mail-preview p { font-size: 13px; color: var(--text); line-height: 1.6; }
.mail-code-box {
  margin-top: 4px;
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 12px 16px; border-radius: var(--radius-sm);
  background: var(--white); border: 1px solid var(--line);
}
.mail-code-box span { font-size: 12px; color: var(--muted); }
.mail-code { font-size: 26px; font-weight: 700; letter-spacing: 0.18em; color: var(--dark); font-variant-numeric: tabular-nums; line-height: 1.2; }
.roi-banner strong { display: flex; align-items: center; gap: 8px; }
.roi-banner strong .icon { width: 20px; height: 20px; flex-shrink: 0; }
.showcase-callout .icon { width: 14px; height: 14px; flex-shrink: 0; }

/* Dialog & Toast */
.dialog {
  max-width: min(440px, calc(100% - 32px)); border: 1px solid var(--line);
  background: var(--paper); color: var(--ink); border-radius: 16px;
  padding: 24px; box-shadow: 0 20px 50px rgba(19, 34, 52, 0.25);
}
.dialog::backdrop { background: rgba(19, 34, 52, 0.48); }
.dialog h2 { font-size: 19px; }
.dialog p { font-size: 14px; color: var(--text); margin: 10px 0; line-height: 1.65; }

#toast {
  display: none; position: fixed; z-index: 20; inset: auto 18px 18px auto;
  max-width: calc(100% - 36px); background: var(--ink); color: var(--white);
  padding: 11px 16px; border-radius: var(--radius-md);
  box-shadow: 0 10px 28px rgba(19, 34, 52, 0.26); font-size: 13px; font-weight: 600;
}
#toast.visible { display: block; }

/* Mobile Bottom Sheet Controls (hidden on desktop) */
.sheet-trigger, .sheet-close, .sheet-backdrop, .sheet-handle { display: none; }

/* ==========================================================================
   Motion
   ========================================================================== */

@media (prefers-reduced-motion: no-preference) {
  .draft-comparison { animation: show-draft 0.18s ease-out; }
  @keyframes show-draft { from { opacity: 0.65; transform: translateY(3px); } to { opacity: 1; transform: translateY(0); } }
  .preview-highlight { animation: preview-field-fade 1.6s ease-out forwards; }
  @keyframes preview-field-fade {
    0%, 65% { background-color: #ffe5a1; color: #372b12; outline-color: #ba8124; }
    100% { background-color: transparent; color: inherit; outline-color: transparent; }
  }
  .chat-turn.arriving > div { animation: chat-arrival 0.24s ease-out both; }
  @keyframes chat-arrival { from { opacity: 0.4; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
  .preview-overlay { animation: overlay-in 0.18s ease-out both; }
  @keyframes overlay-in { from { opacity: 0; } to { opacity: 1; } }
  .preview-spinner { animation: spin 0.9s linear infinite; }
  @keyframes spin { to { transform: rotate(360deg); } }
  .selected-request.is-updated { animation: prompt-filled-flash 0.85s ease-out; }
  @keyframes prompt-filled-flash {
    0%, 22% {
      background-color: #dcebfa;
      border-color: var(--action);
      box-shadow: 0 0 0 2px rgba(23, 84, 156, 0.22);
    }
    100% {
      background-color: var(--white);
      border-color: var(--control-line);
      box-shadow: none;
    }
  }
  .readonly-hint.is-open { animation: hint-pop 0.16s ease-out both; }
  @keyframes hint-pop {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}

/* ==========================================================================
   Responsive Breakpoints (strict descending order)
   ========================================================================== */

@media (max-width: 1100px) {
  .frame { width: calc(100% - 64px); }
  .site-head nav, .head-actions { gap: 16px; }
}

@media (max-width: 1000px) {
  .portal-grid { grid-template-columns: minmax(0, 1fr); }
  .portal-sidebar nav, .portal-account { display: none; }
  .portal-mobile-nav { display: grid; gap: 5px; font-size: 13px; font-weight: 700; }
  .portal-mobile-nav select {
    width: 100%; min-height: 44px; padding: 8px 10px; border: 1px solid var(--control-line);
    border-radius: var(--radius-md); background: var(--paper); color: var(--ink); font-size: 16px;
  }
}

@media (max-width: 850px) {
  .frame { width: calc(100% - 40px); }
  .header-row { min-height: 60px; flex-wrap: wrap; gap: 6px 12px; padding-block: 8px; }
  .site-head nav { order: 3; width: 100%; justify-content: center; gap: 14px; }
  .site-head nav a, .head-portal { font-size: 13px; min-height: 36px; }
  .panel { padding: 18px; }
  .preview-panel { padding: 0; }
  .trial-grid { grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr); gap: 12px; }
  .home-hero-grid { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .trust-grid, .benefit-grid { grid-template-columns: 1fr; }
  .result-cost { grid-template-columns: 1fr; }
  .result-cost-main { padding-right: 0; padding-bottom: 16px; border-right: 0; border-bottom: 1px solid var(--line); }
}

@media (max-width: 760px) {
  .brand span { font-size: 18px; }
  .brand img { width: 28px; height: 28px; }
  .home-split { grid-template-columns: minmax(0, 1fr); }
  .home-steps { grid-template-columns: minmax(0, 1fr); gap: 0; margin-top: 18px; }
  .home-steps li, .home-steps li:first-child { border-left: 0; border-top: 1px solid var(--line); padding: 16px 0; }
  .standard-price { grid-template-columns: 1fr; gap: 16px; }
  .home-hosting dl > div { grid-template-columns: minmax(0, 1fr); gap: 4px; }
}

@media (max-width: 680px) {
  .frame { width: calc(100% - 32px); }
  .head-actions { margin-left: auto; }
  .footer-top { gap: 12px; }
  .footer-top > div { margin-left: 0; width: 100%; gap: 14px; }
  .footer-bottom { flex-direction: column; gap: 6px; }

  .flow-content { padding-block: 24px 44px; }
  .flow-title { margin-bottom: 16px; }
  .flow-title h1 { text-wrap: balance; }
  .flow-grid, .report-detail, .trial-grid, .agent-grid { grid-template-columns: 1fr; gap: 12px; }
  .flow-aside { grid-row: auto; padding: 8px; }
  .flow-main-col { grid-column: 1; }

  .step-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
  .step-list li { min-height: 44px; line-height: 1.3; padding: 6px 4px; font-size: 12px; gap: 5px; justify-content: center; }
  .step-list li::after { display: none; }
  .step-list li .step-jump { padding: 6px 4px; gap: 5px; justify-content: center; }
  .step-list li small { display: none; }
  .step-list li strong { font-size: 12px; }
  .step-list li > span, .step-list li .step-jump > span { width: 22px; height: 22px; font-size: 12px; }

  .form-panel { padding: 18px; }
  .frame.access-page { padding-block: 24px 40px; }
  .panel.access-card { padding: 24px 20px; }
  .fields-2, .checks { grid-template-columns: 1fr; gap: 8px; }
  .update-numbers .field { grid-template-columns: minmax(0, 1fr) 8.5rem; }
  .field input, .field select, .field textarea, .edit-form textarea, .help-form input { font-size: 16px; }

  .benefit-grid { grid-template-columns: 1fr; gap: 10px; }
  .result-cost { grid-template-columns: 1fr; gap: 16px; }
  .result-cost-main { padding-right: 0; padding-bottom: 16px; border-right: 0; border-bottom: 1px solid var(--line); }
  .next-card, .output-head { align-items: start; flex-direction: column; }
  .portal-update-grid { grid-template-columns: 1fr; gap: 8px; }
  .portal-update-grid article + article { border-left: 0; border-top: 1px solid var(--line); padding-left: 0; padding-top: 14px; }
  .setup-compare { grid-template-columns: 1fr; }
  .portal-wrap:has(.trial-grid, .agent-grid) { width: calc(100% - 24px); padding-bottom: 84px; }

  /* Mobile Bottom Sheet for Chat Editor */
  .device-toggle { display: none; }
  .sample-preview-shell,
  .trial-content .sample-preview-shell { height: auto; }
  .sample-preview-shell.is-mobile-view .sample-device-stage { background: transparent; border: 0; padding: 0; align-items: stretch; }
  .sample-preview-shell.is-mobile-view .device-frame.coffee-browser {
    width: 100%; max-height: none; border: 1px solid #b4c0cc; border-radius: var(--radius); box-shadow: var(--shadow-md);
  }
  .sample-preview-shell.is-mobile-view .browser-chrome { display: block; }
  .sample-preview-shell.is-mobile-view .phone-chrome,
  .sample-preview-shell.is-mobile-view .phone-home-bar { display: none; }
  .trial-content .coffee-browser { height: auto; flex: none; }
  .trial-content .coffee-browser .preview-stage { flex: none; }
  .trial-content .editor-panel { height: auto; }
  .trial-content .chat-editor { flex: none; }
  .trial-content .chat-log { flex: none; min-height: 0; }
  .coffee-browser .sample-site { flex: none; height: auto; overflow-y: visible; }
  .coffee-items { grid-template-columns: 1fr; }
  .trial-content { padding-bottom: 84px; }
  .sheet-trigger {
    display: inline-flex; position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom));
    z-index: 8; box-shadow: 0 6px 20px rgba(19, 34, 52, 0.28);
  }
  .sheet-trigger[aria-expanded="true"] { visibility: hidden; }
  .sheet-backdrop {
    display: block; position: fixed; inset: 0; z-index: 9;
    background: rgba(19, 34, 52, 0.42); opacity: 0; visibility: hidden;
    transition: opacity 0.2s ease, visibility 0s 0.2s;
  }
  .sheet-backdrop.sheet-open { opacity: 1; visibility: visible; transition-delay: 0s; }
  .trial-grid .editor-panel {
    position: fixed; z-index: 10; inset: auto 0 0; max-height: 86dvh; overflow: auto;
    overscroll-behavior: contain; padding: 12px 16px calc(16px + env(safe-area-inset-bottom));
    border-radius: 18px 18px 0 0; box-shadow: 0 -8px 32px rgba(19, 34, 52, 0.22);
    visibility: hidden; transform: translateY(102%);
    transition: transform 0.22s ease, visibility 0s 0.22s;
  }
  .editor-panel.sheet-open { visibility: visible; transform: translateY(0); transition-delay: 0s; }
  .sheet-handle {
    display: block; width: 38px; height: 4px; border-radius: 999px;
    background: #c8d2dc; margin: 0 auto 10px;
  }
  .sheet-close { display: inline-flex; min-height: 36px; padding: 0 6px; font-size: 13px; }
  .editor-panel .chat-log { height: clamp(180px, calc(86dvh - 375px), 340px); }
}

@media (max-width: 480px) {
  .desktop-break { display: none; }
  .home-intro h1 { font-size: clamp(27px, 7.6vw, 34px); }
  .home-trial { display: grid; justify-items: stretch; }
  .home-scene-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .coffee-titlebar { padding: 8px 8px 6px; }
  .window-dots { display: none; }
  .coffee-tabs,
  .sample-sector-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; width: 100%; }
  .coffee-tab-btn,
  .sector-switch-btn { border-radius: 7px; padding: 6px 8px; }
  .home-url-row { grid-template-columns: minmax(0, 1fr); }
  .site-head.home-head nav { justify-content: space-between; gap: 6px; flex-wrap: wrap; }
}

@media (max-width: 380px) {
  .frame { width: calc(100% - 24px); }
}
