.demo-nav, .gallery-nav, .case-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
}
.demo-nav { margin-left: auto; }
.top { padding-block: 12px; }
main:has(#line-demo) { padding-top: 18px; }
.demo-nav a, .gallery-nav a, .case-links a, #reset {
  color: var(--green);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.demo-nav a, #reset { padding: 10px 0; }
#reset { background: transparent; font: inherit; }
#demo-title { margin: 0 0 6px; font-size: clamp(24px, 3vw, 32px); }
.demo-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
  font-size: 13px;
}
.industry-label { color: var(--muted); }
.industry-options { display: flex; gap: 4px; }
.industry-options button {
  min-height: 44px;
  padding: 6px 12px;
  color: var(--muted);
  background: transparent;
  border-radius: 999px;
  font-size: inherit;
  line-height: 1.35;
  word-break: keep-all;
}
.industry-options button:hover { color: var(--green); }
.industry-options button[aria-pressed="true"] { background: #e5ede0; color: var(--green); font-weight: 650; }
.role-tabs {
  display: flex;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.role-tabs button {
  min-height: 44px;
  padding: 6px 16px;
  background: transparent;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}
.role-tabs button:hover { color: var(--green); }
.role-tabs button[aria-current="page"] { border-color: var(--green); color: var(--green); font-weight: 700; }
#line-demo .chat:not(:has(.receipt)) { min-height: 0; }
#line-demo .chat:not(:has(.receipt)) > .hint { display: none; }
.chat-example strong { color: var(--green); font-size: 12px; }
.chat-example p { margin: 3px 0 0; }
#materials { margin-top: 36px; border-top: 1px solid var(--line); padding-top: 22px; }
#materials [id], #references { scroll-margin-top: 16px; }

.guide-disclosure { border-bottom: 1px solid var(--line); }
.guide-disclosure > summary, .case-procedure > summary {
  padding: 12px 0;
  font-weight: 650;
  cursor: pointer;
}
#materials > .guide-disclosure > summary { font-size: 17px; }
.guide-disclosure > p { margin: 0 0 14px; }
#case-list, #salon-example { margin-left: 16px; }
#salon-example { margin-bottom: 14px; border-bottom: 0; }
.case-group:last-child { border-bottom: 0; }
.lp-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 12px;
}
.lp-card h3, .lp-card h4 { margin: 4px 0 8px; }
.lp-card p { margin: 0 0 8px; }
.case-role { color: var(--muted); font-size: 13px; }
.case-outcome { border-left: 3px solid #94ae7d; padding-left: 10px; }
.case-procedure > summary { color: var(--green); }
.case-procedure ol { margin: 0; padding-left: 24px; }
.case-procedure li { padding: 12px 0; border-top: 1px solid var(--line); }
.case-links { font-size: 14px; }
.page-top-link {
  position: fixed;
  right: max(12px, env(safe-area-inset-right));
  bottom: max(12px, env(safe-area-inset-bottom));
  z-index: 2;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: white;
  color: var(--green);
  font-size: 22px;
  line-height: 1;
  box-shadow: 0 2px 8px #243d371a;
}
.page-top-link:hover { background: #e5ede0; }
.template-editor { scroll-margin-top: 16px; }
.template-card-header {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 12px 8px;
}
.template-card-header .tile-icon { margin-bottom: 0; }
.template-card-header b { grid-area: 2 / 1 / 3 / -1; }
.template-selection {
  grid-area: 1 / 2;
  justify-self: end;
  display: grid;
  place-items: center;
  width: 23px;
  height: 23px;
  color: var(--green);
}
.template-selection svg { width: 100%; height: 100%; }
.template-settings { border: 0; margin: 0; padding: 0; min-width: 0; }
.template-settings:disabled .actions { display: none; }
.template-editor [data-action="try-template"] { margin-top: 14px; }

.lp-try {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
  margin-bottom: 14px;
}
.lp-try > section, .lp-try > form {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
  padding: 16px;
}
.lp-try input:not([type=checkbox]), .lp-try select {
  width: 100%;
  min-width: 0;
  font: inherit;
  padding: 7px;
  border: 1px solid #91a89b;
  border-radius: 5px;
}
.lp-try label, .lp-try .field-label { display: block; margin: 10px 0 3px; }
.lp-try button { margin-top: 12px; }
.lp-try [hidden] { display: none; }
.lp-card dl, .lp-try dl { margin: 0 0 10px; font-size: 14px; }
.lp-card dl div, .lp-try dl div {
  display: grid;
  grid-template-columns: minmax(85px, 1fr) 2fr;
  gap: 8px;
  border-top: 1px solid var(--line);
  padding: 4px 0;
}
.lp-card dd, .lp-try dd { margin: 0; overflow-wrap: anywhere; }

.gallery-nav { margin-bottom: 16px; }
.gallery-section { padding: 20px 0; border-top: 1px solid var(--line); }
.gallery-section > p, .gallery-grid p, .gallery-wide figcaption { color: var(--muted); font-size: 14px; }
.gallery-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.gallery-grid h4 { margin: 10px 0 4px; }
.screen-wrap { background: #e7ece2; border-radius: 14px; padding: 12px; }
.screen-wrap img, .gallery-wide img { display: block; width: 100%; height: auto; border-radius: 10px; }
.gallery-wide { margin: 20px 0; }
.gallery-wide img { border: 1px solid var(--line); }
.gallery-wide figcaption { margin-top: 10px; }
.gallery-note { border-top: 1px solid var(--line); font-size: 14px; }
.demo-resources { margin-top: 24px; border-top: 1px solid var(--line); }
.references { max-width: none; }
.references > summary { padding: 12px 0; color: var(--muted); font-size: 13px; cursor: pointer; }
.references article { max-width: 900px; }

@media (max-width: 720px) {
  .demo-nav { gap: 4px 8px; font-size: 12px; }
  .top .brand { gap: 6px; font-size: 15px; }
  .top .mark { width: 28px; height: 28px; }
  .industry-label { display: none; }
  .industry-options, .role-tabs { display: grid; width: 100%; }
  .industry-options { grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) minmax(0, 1fr); }
  .industry-options button { padding-inline: 4px; font-size: 12px; }
  .role-tabs { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .role-tabs button { padding-inline: 2px; font-size: 11px; }
  #line-demo .guide { order: 1; }
  #line-demo .stage-label { justify-content: center; margin-bottom: 6px; }
  #line-demo .stage-label > :first-child { display: none; }
  #line-demo .stage-team { color: var(--green); font-size: 12px; font-weight: 650; }
  #line-demo .chat { padding-block: 10px; }
  #line-demo .rich-item { padding-block: 10px; }
  .template-layout { gap: 16px; }
  .template-catalog { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .template-catalog .template-choice { display: grid; grid-template-rows: auto 1fr; min-height: 144px; margin: 0; padding: 7px 6px; }
  .template-card-header { grid-template-columns: minmax(0, 1fr); grid-template-rows: 18px minmax(33px, auto); row-gap: 0; }
  .template-card-header b { grid-area: 2 / 1; text-align: center; font-size: 12px; line-height: 1.35; word-break: keep-all; }
  .template-selection { grid-area: 1 / 1; width: 18px; height: 18px; }
  .template-catalog .tile-icon, .template-catalog p { display: none; }
  .template-catalog .field-chips { justify-content: center; align-content: start; gap: 3px; margin-top: 4px; }
  .template-catalog .field-chips span { max-width: 100%; padding: 2px 4px; font-size: 11px; line-height: 1.3; text-align: center; word-break: keep-all; overflow-wrap: anywhere; }
  #case-list, #salon-example { margin-left: 0; }
  .gallery-grid, .lp-try { grid-template-columns: 1fr; }
  .gallery-grid { max-width: 420px; }
}

@media (max-width: 360px) {
  #line-demo .phone:not(.liff-phone) .phone-status,
  #line-demo .phone:not(.liff-phone) .chat-input { display: none; }
}
