@layer reset, base, components, utilities;

@font-face {
  font-family: "LINE Seed Sans TH";
  src:
    url("fonts/WOFF2/LINESeedSansTH_W_Th.woff2") format("woff2"),
    url("fonts/WOFF/LINESeedSansTH_W_Th.woff") format("woff");
  font-style: normal;
  font-weight: 100;
  font-display: swap;
}

.admin-panel {
  background: var(--surface, #fff);
  border: 1px solid var(--line, #dbeafe);
  border-radius: 1.25rem;
  padding: 1.25rem;
  margin-top: 1.25rem;
  box-shadow: 0 12px 30px rgba(37, 99, 235, 0.06);
}
.admin-table-wrap {
  overflow-x: auto;
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px;
}
.admin-table th,
.admin-table td {
  padding: 0.85rem 0.65rem;
  border-bottom: 1px solid var(--line, #dbeafe);
  text-align: left;
  vertical-align: middle;
}
.admin-table th {
  color: var(--muted, #64748b);
  font-size: 0.82rem;
  font-weight: 700;
}
.admin-table small,
.muted {
  color: var(--muted, #64748b);
}
.impersonation-banner {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  padding: 0.65rem 1rem;
  background: #dbeafe;
  color: #1e3a8a;
  border-bottom: 1px solid #bfdbfe;
}
@media (max-width: 720px) {
  .admin-panel {
    padding: 0.8rem;
  }
  .impersonation-banner {
    align-items: stretch;
    flex-direction: column;
    text-align: center;
  }
}
.language-switcher {
  display: inline-flex;
  gap: 0.25rem;
  align-items: center;
  margin-left: 0.35rem;
}
.language-switcher a {
  color: var(--muted, #64748b);
  font-size: 0.78rem;
  text-decoration: none;
  padding: 0.2rem 0.35rem;
  border-radius: 0.35rem;
}
.language-switcher a.is-active {
  background: #dbeafe;
  color: #1d4ed8;
  font-weight: 700;
}
.locale-tabs,
.public-locale-picker {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin: 0 0 1rem;
}
.locale-tabs a,
.public-locale-picker a {
  min-block-size: 2.5rem;
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 0.85rem;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  color: #1d4ed8;
  background: #fff;
  text-decoration: none;
}
.locale-tabs a.is-active,
.public-locale-picker a.is-active {
  color: #fff;
  background: #2563eb;
  border-color: #2563eb;
  font-weight: 700;
}
.survey-language-control {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid #bfdbfe;
  border-radius: 0.8rem;
  background: #eff6ff;
}
.survey-language-control label {
  margin: 0;
  color: #1e3a8a;
  font-size: 0.82rem;
  font-weight: 700;
}
.survey-language-control select {
  min-width: 10rem;
  width: 10rem;
  margin-right: auto;
  padding: 0.55rem 0.75rem;
  border: 1px solid #93c5fd;
  border-radius: 0.55rem;
  background: #fff;
  color: #172554;
  font: inherit;
}
@media (max-width: 520px) {
  .survey-language-control {
    align-items: stretch;
    flex-direction: column;
  }
  .survey-language-control select {
    width: 100%;
    margin-left: 0;
  }
}
.public-locale-picker {
  justify-content: flex-end;
  align-items: center;
  gap: 0.15rem;
  min-height: 3.1rem;
  margin: 0;
  padding: 0.45rem clamp(1rem, 4vw, 1.5rem);
  border-bottom: 1px solid #dbeafe;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}
.public-locale-picker a {
  min-block-size: 2.15rem;
  padding: 0.4rem 0.9rem;
  border-color: transparent;
  color: #64748b;
  font-size: 0.82rem;
  font-weight: 600;
  transition:
    background-color 160ms ease,
    color 160ms ease,
    box-shadow 160ms ease;
}
.public-locale-picker a:hover {
  color: #1d4ed8;
  background: #eff6ff;
}
.public-locale-picker a:focus-visible {
  outline: 3px solid rgb(37 99 235 / 35%);
  outline-offset: 2px;
}
.public-locale-picker a.is-active {
  color: #fff;
  background: #2563eb;
  border-color: #2563eb;
  box-shadow: 0 4px 10px rgb(37 99 235 / 22%);
}
.template-filters {
  display: flex;
  gap: 0.55rem;
  overflow-x: auto;
  padding: 0.2rem 0 1rem;
  scrollbar-width: thin;
  scrollbar-color: #94a3b8 transparent;
  margin-bottom: 1rem;
}
.template-filters::-webkit-scrollbar {
  height: 5px;
}
.template-filters::-webkit-scrollbar-track {
  background: transparent;
}
.template-filters::-webkit-scrollbar-thumb {
  background: #94a3b8;
  border-radius: 999px;
}
.template-filters::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}
.template-filters a {
  white-space: nowrap;
  border: 1px solid var(--line, #dbeafe);
  color: var(--ink, #0f172a);
  border-radius: 999px;
  padding: 0.55rem 0.85rem;
  text-decoration: none;
  background: #fff;
}
.template-filters a.is-active,
.template-filters a:hover {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}
.template-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}
.template-card {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  padding: 1.2rem;
  border: 1px solid var(--line, #dbeafe);
  border-radius: 1rem;
  background: #fff;
  box-shadow: 0 10px 26px rgba(37, 99, 235, 0.05);
}
.template-card-top,
.template-meta,
.template-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
}
.template-category {
  color: #2563eb;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.template-card h2 {
  margin: 0;
  font-size: 1.15rem;
}
.template-card p {
  margin: 0;
  color: var(--muted, #64748b);
  min-height: 3.2rem;
}
.template-meta {
  color: var(--muted, #64748b);
  font-size: 0.85rem;
  margin-top: auto;
}
.template-actions {
  align-items: stretch;
}
.template-actions .button {
  flex: 1;
  text-align: center;
}
.template-modal {
  width: min(42rem, calc(100% - 2rem));
  max-height: min(42rem, calc(100dvh - 2rem));
  overflow: auto;
  overscroll-behavior: contain;
}
.template-modal::backdrop {
  overflow: hidden;
  overscroll-behavior: contain;
  background: rgba(15, 23, 42, 0.58);
}
.template-modal .dialog-card {
  padding: 1.5rem;
}
.template-modal .dialog-head {
  align-items: flex-start;
}
.template-modal .dialog-head h2 {
  margin: 0.45rem 0 0;
}
.template-modal-questions {
  margin: 1.25rem 0;
  padding-left: 1.4rem;
}
.template-modal-questions li {
  padding: 0.65rem 0;
}
.template-modal-questions small {
  display: block;
  margin-top: 0.25rem;
  color: var(--muted, #64748b);
}
.template-preview {
  margin: 0 0 1.25rem;
  padding: 1.25rem;
  border: 2px solid #bfdbfe;
  border-radius: 1rem;
  background: #eff6ff;
}
.template-preview h2 {
  margin: 0.8rem 0 0.35rem;
}
.template-preview p {
  margin: 0 0 0.8rem;
  color: var(--muted, #64748b);
}
.template-preview ol {
  margin: 0.8rem 0 1rem;
  padding-left: 1.4rem;
}
.template-preview li {
  padding: 0.55rem 0;
}
.template-preview li small {
  display: block;
  color: var(--muted, #64748b);
  margin-top: 0.2rem;
}
@media (max-width: 720px) {
  .template-grid {
    grid-template-columns: 1fr;
  }
  .template-actions {
    flex-direction: column;
  }
}

@font-face {
  font-family: "LINE Seed Sans TH";
  src:
    url("fonts/WOFF2/LINESeedSansTH_W_Rg.woff2") format("woff2"),
    url("fonts/WOFF/LINESeedSansTH_W_Rg.woff") format("woff");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "LINE Seed Sans TH";
  src:
    url("fonts/WOFF2/LINESeedSansTH_W_Bd.woff2") format("woff2"),
    url("fonts/WOFF/LINESeedSansTH_W_Bd.woff") format("woff");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "LINE Seed Sans TH";
  src:
    url("fonts/WOFF2/LINESeedSansTH_W_XBd.woff2") format("woff2"),
    url("fonts/WOFF/LINESeedSansTH_W_XBd.woff") format("woff");
  font-style: normal;
  font-weight: 800;
  font-display: swap;
}

@font-face {
  font-family: "LINE Seed Sans TH";
  src:
    url("fonts/WOFF2/LINESeedSansTH_W_He.woff2") format("woff2"),
    url("fonts/WOFF/LINESeedSansTH_W_He.woff") format("woff");
  font-style: normal;
  font-weight: 900;
  font-display: swap;
}

@layer reset {
  *,
  *::before,
  *::after {
    box-sizing: border-box;
  }
  body,
  h1,
  h2,
  h3,
  p {
    margin: 0;
  }
  button,
  input,
  select,
  textarea {
    font: inherit;
  }
  button,
  summary {
    cursor: pointer;
  }
}

@layer base {
  :root {
    --ink: #0f172a;
    --muted: #64748b;
    --paper: #eff6ff;
    --surface: #ffffff;
    --soft: #dbeafe;
    --line: #bfdbfe;
    --green: #2563eb;
    --green-dark: #1e3a8a;
    --lime: #93c5fd;
    --coral: #ef765e;
    --shadow: 0 18px 50px rgba(37, 99, 235, 0.12);
    --radius: 1.25rem;
  }

  html {
    scroll-behavior: smooth;
  }
  body {
    min-height: 100dvh;
    color: var(--ink);
    background: var(--paper);
    font-family: "LINE Seed Sans TH", "Leelawadee UI", "Segoe UI", sans-serif;
    font-size-adjust: from-font;
    line-height: 1.55;
  }
  a {
    color: inherit;
    text-decoration: none;
  }
  h1,
  h2,
  h3 {
    line-height: 1.2;
    letter-spacing: -0.025em;
  }
  h1 {
    font-size: clamp(1.8rem, 4vw, 2.2rem);
  }
  h2 {
    font-size: clamp(1.4rem, 2.5vw, 1.8rem);
  }
  input,
  select,
  textarea {
    width: 100%;
    min-height: 3rem;
    padding: 0.72rem 0.9rem;
    color: var(--ink);
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 0.72rem;
    font-size: 1rem;
    font-weight: 400;
  }
  textarea {
    resize: vertical;
  }
  input:focus-visible,
  select:focus-visible,
  textarea:focus-visible,
  button:focus-visible,
  a:focus-visible,
  summary:focus-visible {
    outline: 3px solid rgba(23, 107, 69, 0.28);
    outline-offset: 2px;
    border-color: var(--green);
  }
  label {
    display: grid;
    gap: 0.45rem;
    font-weight: 650;
  }
  label small {
    color: var(--muted);
    font-weight: 400;
  }
}

@layer components {
  .site-header {
    position: relative;
    z-index: 10;
    min-height: 4.5rem;
    padding: 0.8rem max(1.25rem, calc((100% - 74rem) / 2));
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    background: rgba(248, 250, 255, 0.94);
    border-bottom: 1px solid var(--line);
  }
  .site-header nav {
    display: flex;
    align-items: center;
    gap: 1.15rem;
  }
  .site-header nav > a:not(.button):hover {
    color: var(--green);
  }
  .mobile-nav-toggle {
    display: none;
    border: 1px solid var(--line);
    border-radius: 0.65rem;
    background: #fff;
    color: var(--ink);
    min-width: 2.75rem;
    min-height: 2.75rem;
    font-size: 1.25rem;
    cursor: pointer;
  }
  .brand {
    display: inline-flex;
    align-items: center;
  }
  .brand-logo {
    width: min(10rem, 38vw);
    height: auto;
    display: block;
  }
  .nav-user {
    color: var(--muted);
    font-size: 0.9rem;
  }
  .site-footer {
    max-width: 74rem;
    margin: 2rem auto 0;
    padding: 2rem 1.25rem;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    color: #334155;
    border-top: 1px solid var(--line);
    font-size: 0.88rem;
  }
  .site-footer > span {
    color: #334155;
    font-weight: 500;
  }
  .footer-links {
    display: inline-flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.6rem 1.2rem;
  }
  .footer-links a {
    color: var(--green-dark);
    font-weight: 700;
  }
  .footer-links a:hover {
    color: var(--green);
    text-decoration: underline;
    text-underline-offset: 0.2rem;
  }

  .button {
    min-height: 2.8rem;
    padding: 0.68rem 1.1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    color: #fff;
    background: var(--green);
    border: 1px solid var(--green);
    border-radius: 0.72rem;
    font-weight: 600;
    text-align: center;
    transition:
      transform 0.16s ease,
      background 0.16s ease;
  }
  .button:hover {
    background: var(--green-dark);
    transform: translateY(-1px);
  }
  .button-small {
    min-height: 2.35rem;
    padding: 0.45rem 0.8rem;
    font-size: 0.88rem;
  }
  .button-large {
    min-height: 3.25rem;
    padding-inline: 1.35rem;
  }
  .button-secondary {
    color: var(--green-dark);
    background: #fff;
    border-color: var(--line);
  }
  .button-secondary:hover,
  .button-quiet:hover {
    color: #fff;
  }
  .button-quiet {
    color: var(--green);
    background: transparent;
    border-color: transparent;
  }
  .button-light {
    color: var(--green-dark);
    background: #fff;
    border-color: #fff;
    font-weight: 700;
  }
  .button-light:hover {
    color: var(--green-dark);
    background: #f8fafc;
    border-color: #f8fafc;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  }
  .link-button {
    padding: 0;
    color: var(--green);
    background: none;
    border: 0;
    font-weight: 700;
  }
  .inline-form {
    display: inline-flex;
  }
  .icon-button {
    width: 2.5rem;
    aspect-ratio: 1;
    color: var(--muted);
    background: transparent;
    border: 0;
    border-radius: 50%;
    font-size: 1.6rem;
  }
  .danger {
    color: #b63b2a;
  }

  .landing-shell,
  .app-shell {
    width: min(74rem, calc(100% - 2.5rem));
    margin-inline: auto;
  }
  .hero {
    min-height: 39rem;
    padding-block: clamp(3rem, 8vw, 7rem);
    display: grid;
    grid-template-columns: 1.02fr 0.98fr;
    align-items: center;
    gap: clamp(2rem, 6vw, 5.5rem);
  }
  .hero-copy h1 {
    max-width: 11ch;
    font-size: clamp(3rem, 7vw, 4.8rem);
  }
  .hero-copy h1 span {
    color: var(--green);
  }
  .hero-copy > p {
    max-width: 38rem;
    margin-top: 1.5rem;
    color: var(--muted);
    font-size: 1.15rem;
  }
  .hero-copy small {
    display: block;
    margin-top: 1rem;
    color: var(--muted);
  }
  .hero-actions {
    margin-top: 1.8rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
  }
  .eyebrow {
    display: inline-block;
    margin-bottom: 0.65rem;
    color: var(--green);
    font-size: 0.76rem;
    font-weight: 850;
    letter-spacing: 0.12em;
    text-transform: uppercase;
  }

  .hero-preview {
    position: relative;
    padding: 1.25rem;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 1.7rem;
    box-shadow: var(--shadow);
    transform: rotate(1deg);
  }
  .hero-preview::before {
    position: absolute;
    z-index: -1;
    inset: -1rem 1rem 1rem -1rem;
    content: "";
    background: var(--lime);
    border-radius: inherit;
    transform: rotate(-4deg);
  }
  .preview-top,
  .mini-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
  }
  .preview-top {
    padding-bottom: 1rem;
    font-weight: 800;
    border-bottom: 1px solid var(--line);
  }
  .status-dot {
    padding: 0.35rem 0.6rem;
    color: var(--green-dark);
    background: var(--soft);
    border-radius: 99px;
    font-size: 0.72rem;
  }
  .score-card {
    margin-top: 1rem;
    padding: 1.5rem;
    display: grid;
    grid-template-columns: 0.6fr 1.4fr;
    align-items: end;
    gap: 1rem;
    background: var(--green-dark);
    border-radius: 1.1rem;
    color: #fff;
  }
  .score-card small {
    display: block;
    color: #bfdbfe;
  }
  .score-card strong {
    font-size: 3.8rem;
    line-height: 1;
  }
  .score-card span {
    color: #bfdbfe;
  }
  .spark-bars {
    height: 7rem;
    display: flex;
    align-items: end;
    gap: 0.45rem;
  }
  .spark-bars i {
    flex: 1;
    background: var(--lime);
    border-radius: 0.3rem 0.3rem 0 0;
    opacity: 0.88;
  }
  .insight {
    margin-top: 1rem;
    padding: 1rem;
    display: flex;
    gap: 0.85rem;
    background: #f8fbff;
    border: 1px solid var(--line);
    border-radius: 1rem;
  }
  .insight p {
    margin-top: 0.2rem;
    color: var(--muted);
  }
  .insight-icon {
    width: 2.3rem;
    height: 2.3rem;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    color: var(--green);
    background: var(--lime);
    border-radius: 0.7rem;
    font-weight: 900;
  }
  .mini-actions {
    padding: 1rem 0.35rem 0;
    color: var(--muted);
    font-size: 0.8rem;
  }
  .trust-strip {
    padding: 1.2rem max(1.25rem, calc((100% - 74rem) / 2));
    display: flex;
    justify-content: space-between;
    gap: 1.5rem;
    color: var(--green-dark);
    background: var(--soft);
    border-block: 1px solid var(--line);
  }
  .trust-strip span {
    color: var(--muted);
  }
  .section {
    padding-block: clamp(4rem, 8vw, 7rem);
  }
  .section-heading {
    max-width: 43rem;
  }
  .section-heading p {
    margin-top: 1rem;
    color: var(--muted);
    font-size: 1.08rem;
  }
  .feature-grid {
    margin-top: 2.5rem;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
  }
  .feature-grid article {
    min-height: 15rem;
    padding: 1.5rem;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
  }
  .feature-grid h3 {
    margin-top: 2.5rem;
    font-size: 1.25rem;
  }
  .feature-grid p {
    margin-top: 0.65rem;
    color: var(--muted);
  }
  .feature-number {
    color: var(--green);
    font-weight: 900;
  }
  .cta {
    margin-bottom: 4rem;
    padding: clamp(2rem, 5vw, 3.5rem);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    color: #fff;
    background: var(--green-dark);
    border-radius: 1.8rem;
  }
  .cta p {
    max-width: 42rem;
    margin-top: 0.8rem;
    color: #c7d2fe;
  }
  .cta .eyebrow {
    color: var(--lime);
  }

  .landing-page {
    --motion-ease-out: cubic-bezier(0.23, 1, 0.32, 1);
    --motion-ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
    overflow: clip;
    background:
      radial-gradient(
        circle at 8% 5%,
        rgba(147, 197, 253, 0.38),
        transparent 25rem
      ),
      radial-gradient(
        circle at 92% 18%,
        rgba(191, 219, 254, 0.5),
        transparent 28rem
      ),
      var(--paper);
  }

  .legal-page {
    padding-block: clamp(2.8rem, 7vw, 5.5rem);
  }
  .legal-hero {
    max-width: 52rem;
  }
  .legal-hero h1 {
    font-size: clamp(2.5rem, 6vw, 4.4rem);
    line-height: 1.05;
    letter-spacing: -0.04em;
  }
  .legal-hero > p {
    margin-top: 1.2rem;
    color: #475569;
    font-size: clamp(1rem, 2vw, 1.15rem);
    line-height: 1.8;
  }
  .legal-updated {
    margin-top: 1.15rem;
    display: inline-flex;
    padding: 0.4rem 0.7rem;
    color: #1e40af;
    background: #dbeafe;
    border-radius: 99px;
    font-size: 0.78rem;
    font-weight: 750;
  }
  .legal-layout {
    margin-top: clamp(2.5rem, 6vw, 4.5rem);
    display: grid;
    grid-template-columns: 15rem minmax(0, 1fr);
    align-items: start;
    gap: 1.4rem;
  }
  .legal-toc {
    position: sticky;
    top: 6rem;
    padding: 1.1rem;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--line);
    border-radius: 1rem;
    box-shadow: 0 12px 30px rgba(30, 58, 138, 0.05);
  }
  .legal-toc > strong {
    display: block;
    color: var(--green-dark);
    font-size: 0.82rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }
  .legal-toc nav {
    margin-top: 0.8rem;
    display: grid;
    gap: 0.15rem;
  }
  .legal-toc a {
    padding: 0.45rem 0.55rem;
    color: #64748b;
    border-radius: 0.5rem;
    font-size: 0.83rem;
    line-height: 1.4;
  }
  .legal-toc a:hover,
  .legal-toc a:focus-visible {
    color: #1d4ed8;
    background: #eff6ff;
  }
  .legal-content {
    min-width: 0;
    padding: clamp(1.4rem, 4vw, 2.7rem);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 1.4rem;
    box-shadow: 0 18px 50px rgba(30, 58, 138, 0.07);
  }
  .legal-content section {
    padding-block: 0 2rem;
    scroll-margin-top: 6rem;
  }
  .legal-content section + section {
    padding-top: 2rem;
    border-top: 1px solid #e2e8f0;
  }
  .legal-content section:last-child {
    padding-bottom: 0;
  }
  .legal-content h2 {
    color: #0f172a;
    font-size: clamp(1.3rem, 2.4vw, 1.65rem);
    line-height: 1.3;
  }
  .legal-content p,
  .legal-content li {
    color: #475569;
    font-size: 1rem;
    line-height: 1.85;
  }
  .legal-content p {
    margin-top: 0.85rem;
  }
  .legal-content ul {
    margin: 0.85rem 0 0;
    padding-left: 1.3rem;
    display: grid;
    gap: 0.45rem;
  }
  .legal-content a {
    color: #1d4ed8;
    font-weight: 750;
    overflow-wrap: anywhere;
  }

  @media (max-width: 850px) {
    .legal-layout {
      grid-template-columns: 1fr;
    }
    .legal-toc {
      position: static;
    }
    .legal-toc nav {
      display: flex;
      flex-wrap: wrap;
      gap: 0.25rem;
    }
  }
  .landing-hero {
    min-height: 43rem;
    padding-block: clamp(3.5rem, 8vw, 7rem);
    display: grid;
    grid-template-columns: minmax(0, 0.92fr) minmax(30rem, 1.08fr);
    align-items: center;
    gap: clamp(2.5rem, 6vw, 5.5rem);
  }
  .landing-pill {
    width: fit-content;
    padding: 0.48rem 0.8rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #1d4ed8;
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid #bfdbfe;
    border-radius: 99px;
    box-shadow: 0 6px 24px rgba(37, 99, 235, 0.08);
    font-size: 0.76rem;
    font-weight: 850;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }
  .landing-pill i {
    width: 0.5rem;
    aspect-ratio: 1;
    background: #2563eb;
    border-radius: 50%;
    box-shadow: 0 0 0 0.25rem rgba(37, 99, 235, 0.13);
  }
  .landing-hero-copy h1 {
    max-width: 20ch;
    margin-top: 1.25rem;
    font-size: clamp(2rem, 6vw, 3rem);
    line-height: 1.1;
    letter-spacing: -0.045em;
  }
  .landing-hero-copy h1 span {
    display: block;
    color: #2563eb;
  }
  .landing-hero-copy > p {
    max-width: 40rem;
    margin-top: 1.5rem;
    color: #475569;
    font-size: clamp(1rem, 1.8vw, 1.2rem);
    line-height: 1.75;
  }
  .landing-actions {
    margin-top: 1.9rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
  }
  .landing-proof {
    margin: 1.4rem 0 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem 1.25rem;
    color: #64748b;
    list-style: none;
    font-size: 0.83rem;
  }
  .landing-proof li::before {
    margin-right: 0.4rem;
    color: #2563eb;
    content: "✓";
    font-weight: 900;
  }
  .landing-product {
    --product-resting-transform: rotate(0.6deg);
    position: relative;
    min-width: 0;
    background: #fff;
    border: 1px solid #bfdbfe;
    border-radius: 1.5rem;
    box-shadow: 0 32px 80px rgba(30, 58, 138, 0.18);
    transform: var(--product-resting-transform);
  }
  .landing-product::before {
    position: absolute;
    z-index: -1;
    inset: 1rem -1rem -1rem 1rem;
    content: "";
    background: #2563eb;
    border-radius: inherit;
    opacity: 0.1;
  }
  .product-window-bar {
    min-width: 0;
    padding: 0.9rem 1rem;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid #dbeafe;
    font-size: 0.82rem;
  }
  .product-window-bar strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .product-dots {
    display: flex;
    gap: 0.28rem;
  }
  .product-dots i {
    width: 0.48rem;
    aspect-ratio: 1;
    background: #cbd5e1;
    border-radius: 50%;
  }
  .product-dots i:first-child {
    background: #93c5fd;
  }
  .product-live {
    padding: 0.25rem 0.55rem;
    color: #1d4ed8;
    background: #dbeafe;
    border-radius: 99px;
    font-size: 0.68rem;
    font-weight: 800;
  }
  .product-body {
    padding: clamp(1rem, 3vw, 1.4rem);
  }
  .product-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.7rem;
  }
  .product-metrics > div {
    min-width: 0;
    padding: 0.85rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.9rem;
  }
  .product-metrics small,
  .product-metrics strong,
  .product-metrics span {
    display: block;
  }
  .product-metrics small {
    overflow: hidden;
    color: #64748b;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.68rem;
  }
  .product-metrics strong {
    margin-top: 0.3rem;
    font-size: 1.65rem;
    line-height: 1;
  }
  .product-metrics span {
    margin-top: 0.25rem;
    color: #2563eb;
    font-size: 0.65rem;
  }
  .product-grid {
    margin-top: 0.7rem;
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    gap: 0.7rem;
  }
  .product-chart,
  .product-ai {
    min-width: 0;
    padding: 1rem;
    border-radius: 1rem;
  }
  .product-chart {
    border: 1px solid #dbeafe;
  }
  .product-card-head {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    font-size: 0.72rem;
  }
  .product-card-head span {
    color: #94a3b8;
    font-size: 0.62rem;
  }
  .product-bars {
    height: 7rem;
    margin-top: 0.9rem;
    display: flex;
    align-items: end;
    gap: 0.35rem;
    border-bottom: 1px solid #e2e8f0;
  }
  .product-bars i {
    height: var(--bar);
    flex: 1;
    background: linear-gradient(#60a5fa, #2563eb);
    border-radius: 0.35rem 0.35rem 0 0;
  }
  .product-chart-labels {
    margin-top: 0.35rem;
    display: flex;
    justify-content: space-between;
    color: #94a3b8;
    font-size: 0.58rem;
  }
  .product-ai {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    color: #fff;
    background: linear-gradient(145deg, #1e3a8a, #2563eb);
  }
  .product-ai-icon {
    width: 2.2rem;
    aspect-ratio: 1;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    color: #1e3a8a;
    background: #bfdbfe;
    border-radius: 0.7rem;
    font-weight: 900;
  }
  .product-ai small,
  .product-ai strong {
    display: block;
  }
  .product-ai small {
    color: #bfdbfe;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }
  .product-ai strong {
    margin-top: 0.55rem;
    font-size: 0.9rem;
    line-height: 1.35;
  }
  .product-ai p {
    margin-top: 0.65rem;
    color: #dbeafe;
    font-size: 0.7rem;
    line-height: 1.5;
  }
  .landing-audience {
    color: #1e3a8a;
    background: rgba(255, 255, 255, 0.72);
    border-block: 1px solid #bfdbfe;
  }
  .landing-audience .landing-shell {
    min-height: 5.2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem 1.5rem;
  }
  .landing-audience span {
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 700;
  }
  .landing-audience strong {
    font-size: 0.84rem;
  }
  .landing-section,
  .landing-ai {
    padding-block: clamp(4.5rem, 9vw, 7.5rem);
  }
  .landing-section-heading h2,
  .landing-ai h2,
  .landing-cta h2 {
    font-size: clamp(2rem, 4vw, 3.25rem);
    line-height: 1.12;
    letter-spacing: -0.035em;
  }
  .landing-section-heading p {
    margin-top: 1rem;
    color: #64748b;
    font-size: 1.05rem;
  }
  .landing-feature-grid {
    margin-top: 2.5rem;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
  }
  .landing-feature-grid article {
    min-height: 17rem;
    padding: 1.6rem;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #bfdbfe;
    border-radius: 1.25rem;
    box-shadow: 0 16px 40px rgba(30, 58, 138, 0.05);
    transition:
      transform 180ms ease,
      box-shadow 180ms ease,
      border-color 180ms ease;
  }
  .landing-feature-grid article:hover {
    border-color: #60a5fa;
    box-shadow: 0 22px 48px rgba(30, 58, 138, 0.11);
    transform: translateY(-4px);
  }
  .landing-feature-icon {
    width: 3rem;
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    color: #1d4ed8;
    background: #dbeafe;
    border-radius: 0.9rem;
    font-size: 1.15rem;
    font-weight: 900;
  }
  .landing-feature-grid h3 {
    margin-top: 2.4rem;
    font-size: 1.22rem;
  }
  .landing-feature-grid p {
    margin-top: 0.7rem;
    color: #64748b;
    line-height: 1.7;
  }
  .landing-workflow {
    padding-block: clamp(4rem, 8vw, 6.5rem);
    background: #fff;
    border-block: 1px solid #dbeafe;
  }
  .landing-steps {
    margin: 2.8rem 0 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    list-style: none;
  }
  .landing-steps li {
    position: relative;
    padding: 1.45rem;
    display: flex;
    gap: 1rem;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 1.2rem;
  }
  .landing-steps li > span {
    width: 2.5rem;
    aspect-ratio: 1;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    color: #fff;
    background: #2563eb;
    border-radius: 0.75rem;
    font-weight: 900;
  }
  .landing-steps h3 {
    font-size: 1.08rem;
  }
  .landing-steps p {
    margin-top: 0.45rem;
    color: #64748b;
    line-height: 1.6;
  }
  .landing-ai {
    display: grid;
    grid-template-columns: minmax(0, 0.92fr) minmax(30rem, 1.08fr);
    align-items: center;
    gap: clamp(2.5rem, 7vw, 6rem);
  }
  .landing-ai-copy > p {
    margin-top: 1.15rem;
    color: #64748b;
    font-size: 1.04rem;
    line-height: 1.75;
  }
  .provider-chips {
    margin-top: 1.4rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  .provider-chips span {
    padding: 0.4rem 0.68rem;
    color: #1e3a8a;
    background: #fff;
    border: 1px solid #bfdbfe;
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 800;
  }
  .landing-ai-copy ul {
    margin: 1.4rem 0 0;
    padding: 0;
    display: grid;
    gap: 0.7rem;
    list-style: none;
  }
  .landing-ai-copy li::before {
    margin-right: 0.55rem;
    color: #2563eb;
    content: "✓";
    font-weight: 900;
  }
  .landing-ai-card {
    padding: clamp(1.3rem, 4vw, 2rem);
    background: #fff;
    border: 1px solid #bfdbfe;
    border-radius: 1.5rem;
    box-shadow: 0 26px 65px rgba(30, 58, 138, 0.12);
  }
  .ai-card-head {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.8rem;
  }
  .ai-card-head small,
  .ai-card-head strong {
    display: block;
  }
  .ai-card-head small {
    color: #64748b;
  }
  .landing-ai-card > p {
    margin-top: 1.3rem;
    padding: 1rem;
    color: #334155;
    background: #eff6ff;
    border-radius: 0.9rem;
    line-height: 1.65;
  }
  .ai-recommendation {
    margin-top: 0.8rem;
    padding: 0.9rem 0;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.8rem;
    border-top: 1px solid #e2e8f0;
  }
  .ai-recommendation > span {
    height: fit-content;
    padding: 0.28rem 0.5rem;
    color: #b91c1c;
    background: #fee2e2;
    border-radius: 99px;
    font-size: 0.66rem;
    font-weight: 800;
  }
  .ai-recommendation > span.medium {
    color: #92400e;
    background: #fef3c7;
  }
  .ai-recommendation strong,
  .ai-recommendation small {
    display: block;
  }
  .ai-recommendation small {
    margin-top: 0.25rem;
    color: #64748b;
    line-height: 1.5;
  }
  /* Landing FAQ Section */
  .landing-faq {
    margin-bottom: clamp(3.5rem, 8vw, 6rem);
  }
  .landing-faq .landing-section-heading {
    text-align: center;
    max-width: 42rem;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 2.2rem;
  }
  .landing-faq-grid {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    max-width: 50rem;
    margin: 0 auto;
  }
  .faq-item {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    overflow: hidden;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
  }
  .faq-item:hover {
    border-color: #cbd5e1;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04);
  }
  .faq-item[open] {
    border-color: #93c5fd;
    box-shadow: 0 6px 20px rgba(30, 64, 175, 0.06);
  }
  .faq-item summary {
    padding: 1.15rem 1.4rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    cursor: pointer;
    list-style: none;
    user-select: none;
  }
  .faq-item summary::-webkit-details-marker {
    display: none;
  }
  .faq-item summary h3 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.45;
  }
  .faq-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: #f1f5f9;
    color: #475569;
    font-size: 1.25rem;
    line-height: 1;
    flex-shrink: 0;
    transition: transform 0.2s ease, background-color 0.2s ease, color 0.2s ease;
  }
  .faq-item summary:hover .faq-toggle {
    background: #e2e8f0;
    color: #0f172a;
  }
  .faq-item[open] .faq-toggle {
    transform: rotate(180deg);
    background: #eff6ff;
    color: #2563eb;
  }
  .faq-content {
    padding: 0 1.4rem 1.35rem;
    border-top: 1px solid #f1f5f9;
    margin-top: -0.2rem;
    padding-top: 0.9rem;
  }
  .faq-content p {
    margin: 0;
    color: #475569;
    line-height: 1.7;
    font-size: 0.98rem;
  }
  .landing-cta {
    margin-bottom: clamp(3rem, 7vw, 5rem);
    padding: clamp(2rem, 5vw, 3.5rem);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    color: #fff;
    background:
      radial-gradient(
        circle at 90% 15%,
        rgba(96, 165, 250, 0.35),
        transparent 20rem
      ),
      linear-gradient(135deg, #172554, #1e40af);
    border-radius: 1.75rem;
    box-shadow: 0 28px 65px rgba(30, 58, 138, 0.2);
  }
  .landing-cta > div:first-child {
    max-width: 44rem;
  }
  .landing-cta .eyebrow {
    color: #93c5fd;
  }
  .landing-cta p {
    margin-top: 0.85rem;
    color: #dbeafe;
    font-size: 1.02rem;
  }
  .landing-cta-actions {
    flex: 0 0 auto;
    display: grid;
    gap: 0.7rem;
    text-align: center;
  }
  .landing-cta-actions > a:last-child {
    color: #dbeafe;
    font-size: 0.83rem;
    transition: color 0.16s ease;
  }
  .landing-cta-actions > a:last-child:hover {
    color: #ffffff;
    text-decoration: underline;
  }

  .landing-page.motion-ready .landing-hero-copy > *,
  .landing-page.motion-ready .landing-product {
    opacity: 0;
    transition:
      opacity 520ms var(--motion-ease-out),
      transform 520ms var(--motion-ease-out);
  }
  .landing-page.motion-ready .landing-hero-copy > * {
    transform: translateY(1rem);
  }
  .landing-page.motion-ready .landing-product {
    transform: translateY(1.25rem) scale(0.97) var(--product-resting-transform);
    transition-delay: 180ms;
  }
  .landing-page.motion-ready.is-loaded .landing-hero-copy > *,
  .landing-page.motion-ready.is-loaded .landing-product {
    opacity: 1;
    transform: var(--product-resting-transform, none);
  }
  .landing-page.motion-ready.is-loaded .landing-hero-copy > :nth-child(1) {
    transition-delay: 40ms;
  }
  .landing-page.motion-ready.is-loaded .landing-hero-copy > :nth-child(2) {
    transition-delay: 100ms;
  }
  .landing-page.motion-ready.is-loaded .landing-hero-copy > :nth-child(3) {
    transition-delay: 160ms;
  }
  .landing-page.motion-ready.is-loaded .landing-hero-copy > :nth-child(4) {
    transition-delay: 220ms;
  }
  .landing-page.motion-ready.is-loaded .landing-hero-copy > :nth-child(5) {
    transition-delay: 280ms;
  }
  .landing-page.motion-ready .product-bars i {
    opacity: 0.45;
    transform: scaleY(0.06);
    transform-origin: bottom;
    transition:
      opacity 500ms var(--motion-ease-out),
      transform 700ms var(--motion-ease-out);
  }
  .landing-page.motion-ready.is-loaded .product-bars i {
    opacity: 1;
    transform: scaleY(1);
  }
  .landing-page.motion-ready.is-loaded .product-bars i:nth-child(1) {
    transition-delay: 360ms;
  }
  .landing-page.motion-ready.is-loaded .product-bars i:nth-child(2) {
    transition-delay: 400ms;
  }
  .landing-page.motion-ready.is-loaded .product-bars i:nth-child(3) {
    transition-delay: 440ms;
  }
  .landing-page.motion-ready.is-loaded .product-bars i:nth-child(4) {
    transition-delay: 480ms;
  }
  .landing-page.motion-ready.is-loaded .product-bars i:nth-child(5) {
    transition-delay: 520ms;
  }
  .landing-page.motion-ready.is-loaded .product-bars i:nth-child(6) {
    transition-delay: 560ms;
  }
  .landing-page.motion-ready.is-loaded .product-bars i:nth-child(7) {
    transition-delay: 600ms;
  }
  .landing-page.motion-ready .landing-reveal {
    opacity: 0;
    transform: translateY(1rem);
    transition:
      opacity 420ms var(--motion-ease-out) var(--reveal-delay, 0ms),
      transform 420ms var(--motion-ease-out) var(--reveal-delay, 0ms);
  }
  .landing-page.motion-ready .landing-reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
  }
  @media (hover: hover) and (pointer: fine) {
    .landing-page.motion-ready
      .landing-feature-grid
      article.landing-reveal.is-visible:hover {
      transform: translateY(-4px);
    }
  }
  @keyframes landing-icon-float {
    0%,
    100% {
      transform: translateY(0);
    }
    50% {
      transform: translateY(-0.28rem);
    }
  }
  .landing-page.motion-ready.is-loaded .product-ai-icon {
    animation: landing-icon-float 3.5s var(--motion-ease-in-out) 900ms infinite;
  }

  @media (max-width: 950px) {
    .landing-hero,
    .landing-ai {
      grid-template-columns: 1fr;
    }
    .landing-hero-copy h1 {
      max-width: 14ch;
    }
    .landing-product,
    .landing-ai-card {
      width: min(42rem, 100%);
      margin-inline: auto;
    }
    .landing-audience .landing-shell {
      padding-block: 1.2rem;
      flex-wrap: wrap;
      justify-content: flex-start;
    }
    .landing-feature-grid {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }
  }

  @media (max-width: 650px) {
    .landing-shell {
      width: min(100% - 2rem, 74rem);
    }
    .landing-hero {
      padding-block: 2.7rem 3.5rem;
    }
    .landing-hero-copy h1 {
      font-size: clamp(2.55rem, 13vw, 3.7rem);
    }
    .landing-actions {
      align-items: stretch;
      flex-direction: column;
    }
    .landing-actions .button {
      width: 100%;
    }
    .landing-proof {
      align-items: flex-start;
      flex-direction: column;
    }
    .landing-product {
      --product-resting-transform: none;
    }
    .landing-product::before {
      display: none;
    }
    .product-window-bar {
      grid-template-columns: auto minmax(0, 1fr);
    }
    .product-live {
      display: none;
    }
    .product-metrics {
      gap: 0.4rem;
    }
    .product-metrics > div {
      padding: 0.65rem 0.5rem;
    }
    .product-metrics strong {
      font-size: 1.3rem;
    }
    .product-grid {
      grid-template-columns: 1fr;
    }
    .product-ai {
      min-height: 8rem;
    }
    .landing-audience strong {
      flex: 1 1 42%;
    }
    .landing-section,
    .landing-ai {
      padding-block: 4rem;
    }
    .landing-feature-grid,
    .landing-steps {
      grid-template-columns: 1fr;
    }
    .landing-feature-grid article {
      min-height: 0;
    }
    .landing-feature-grid h3 {
      margin-top: 1.5rem;
    }
    .ai-card-head {
      grid-template-columns: auto minmax(0, 1fr);
    }
    .ai-card-head .badge {
      grid-column: 2;
      width: fit-content;
    }
    .ai-recommendation {
      grid-template-columns: 1fr;
    }
    .ai-recommendation > span {
      width: fit-content;
    }
    .landing-cta {
      align-items: stretch;
      flex-direction: column;
    }
    .landing-cta-actions {
      width: 100%;
    }
    .landing-cta-actions .button {
      width: 100%;
    }
  }

  .auth-shell {
    min-height: calc(100dvh - 9rem);
    padding: 3rem 1.25rem;
    display: grid;
    place-items: center;
    background:
      radial-gradient(circle at 20% 10%, #dbeafe, transparent 32%), var(--paper);
  }
  .auth-card {
    width: min(31rem, 100%);
    padding: clamp(1.5rem, 5vw, 2.5rem);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 1.5rem;
    box-shadow: var(--shadow);
  }
  .auth-card > p {
    margin-top: 0.75rem;
    color: var(--muted);
  }
  .auth-switch {
    text-align: center;
  }
  .auth-switch a {
    color: var(--green);
    font-weight: 600;
  }
  .oauth-providers {
    margin-top: 1.5rem;
  }
  .button-google {
    width: 100%;
    min-height: 3.1rem;
    padding: 0.7rem 1.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    background: #ffffff;
    color: #1e293b;
    border: 1px solid #cbd5e1;
    border-radius: 0.75rem;
    font-weight: 600;
    font-size: 0.98rem;
    text-decoration: none;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
    transition: all 0.16s ease;
  }
  .button-google:hover {
    background: #f8fafc;
    border-color: #94a3b8;
    color: #0f172a;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.1);
    transform: translateY(-1px);
  }
  .button-google:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
  }
  .button-google .google-icon {
    width: 1.2rem;
    height: 1.2rem;
    flex-shrink: 0;
  }
  .auth-divider {
    position: relative;
    text-align: center;
    margin: 1.25rem 0 0.5rem;
  }
  .auth-divider::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--line);
  }
  .auth-divider span {
    position: relative;
    display: inline-block;
    padding: 0 0.85rem;
    background: #ffffff;
    color: var(--muted);
    font-size: 0.85rem;
  }
  .stack-form {
    margin-top: 1rem;
    display: grid;
    gap: 1rem;
  }

  .app-shell {
    padding-block: 2.5rem 4rem;
  }
  .page-heading {
    margin-bottom: 1.8rem;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.5rem;
  }
  .page-heading > div:first-child {
    min-width: 0;
    flex: 1 1 auto;
  }
  .page-heading h1 {
    font-size: clamp(1.8rem, 3.5vw, 2.75rem);
    word-break: break-word;
  }
  .page-heading p {
    margin-top: 0.5rem;
    color: var(--muted);
  }
  .back-link {
    display: inline-block;
    margin-bottom: 0.7rem;
    color: var(--green);
    font-size: 0.9rem;
    font-weight: 700;
  }
  .heading-actions {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 0.65rem;
    flex-shrink: 0;
  }
  .heading-actions .button {
    white-space: nowrap;
  }
  .stats-row {
    margin-bottom: 1.5rem;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.8rem;
  }
  .stats-row > div {
    padding: 1.15rem 1.3rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--muted);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 1rem;
  }
  .stats-row strong {
    color: var(--ink);
    font-size: 1.8rem;
  }
  .survey-list {
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
  }
  .list-head {
    padding: 1.2rem 1.4rem;
    border-bottom: 1px solid var(--line);
  }
  .list-head h2 {
    font-size: 1.15rem;
  }
  .survey-row {
    padding: 1.1rem 1.3rem;
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    align-items: center;
    gap: 1rem;
    border-bottom: 1px solid var(--line);
  }
  .survey-row:last-child {
    border-bottom: 0;
  }
  .survey-icon {
    width: 2.7rem;
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    color: var(--green);
    background: var(--soft);
    border-radius: 0.8rem;
  }
  .survey-main p,
  .survey-count span {
    color: var(--muted);
    font-size: 0.8rem;
  }
  .row-title {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.6rem;
  }
  .row-title h3 {
    font-size: 1rem;
  }
  .survey-count {
    min-width: 4.5rem;
    display: grid;
    text-align: center;
  }
  .survey-count strong {
    font-size: 1.35rem;
  }
  .row-actions {
    display: flex;
    gap: 0.4rem;
  }
  .badge {
    display: inline-flex;
    padding: 0.25rem 0.55rem;
    border-radius: 99px;
    font-size: 0.7rem;
    font-weight: 800;
  }
  .badge-published {
    color: #1e3a8a;
    background: #dbeafe;
  }
  .badge-draft {
    color: #6d6657;
    background: #f2eee5;
  }
  .empty-state {
    padding: 4rem 1.5rem;
    text-align: center;
  }
  .empty-state p {
    margin: 0.5rem 0 1.2rem;
    color: var(--muted);
  }
  .empty-state.compact {
    padding: 2rem;
    background: #fff;
    border: 1px dashed #b9cbbb;
    border-radius: 1rem;
  }

  dialog {
    width: min(31rem, calc(100% - 2rem));
    padding: 0;
    border: 0;
    border-radius: 1.4rem;
    box-shadow: var(--shadow);
  }
  dialog::backdrop {
    background: rgba(10, 28, 18, 0.58);
    backdrop-filter: blur(3px);
  }
  .dialog-card {
    padding: 1.5rem;
  }
  .app-confirm-dialog {
    width: min(26rem, calc(100% - 2rem));
    padding: 0;
    border: 0;
    border-radius: 1.25rem;
    box-shadow: 0 1.5rem 4rem rgb(15 23 42 / 22%);
  }
  .app-confirm-dialog::backdrop {
    background: rgb(15 23 42 / 48%);
    backdrop-filter: blur(3px);
  }
  .app-confirm-card {
    padding: 1.75rem;
    text-align: center;
  }
  .app-confirm-icon {
    display: grid;
    place-items: center;
    width: 3rem;
    height: 3rem;
    margin: 0 auto 1rem;
    border-radius: 50%;
    color: #b45309;
    background: #fef3c7;
    font-size: 1.35rem;
    font-weight: 800;
  }
  .app-confirm-card h2 {
    margin: 0;
    color: #172554;
    font-size: 1.25rem;
  }
  .app-confirm-message {
    margin: 0.75rem 0 0;
    color: #64748b;
    line-height: 1.65;
  }
  .app-confirm-actions {
    display: flex;
    justify-content: center;
    gap: 0.65rem;
    margin-top: 1.5rem;
  }
  .button-danger {
    color: #fff;
    background: #dc2626;
    border-color: #dc2626;
  }
  .button-danger:hover {
    background: #b91c1c;
    border-color: #b91c1c;
  }
  .save-status {
    margin-left: 0.65rem;
    color: #15803d;
    font-size: 0.82rem;
    font-weight: 700;
  }
  .dialog-head,
  .dialog-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
  }
  .dialog-card > label {
    margin-top: 1.5rem;
  }
  .dialog-actions {
    margin-top: 1.5rem;
    justify-content: end;
  }

  .share-bar {
    margin-bottom: 1.2rem;
    padding: 1rem 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 1rem;
  }
  .share-bar > div {
    min-width: 0;
    margin-right: auto;
    display: grid;
  }
  .share-bar span {
    overflow: hidden;
    color: var(--muted);
    font-size: 0.82rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .qr-dialog {
    width: min(30rem, calc(100% - 2rem));
  }
  .qr-dialog-card {
    padding: 1.5rem;
  }
  .qr-content {
    padding: 1.25rem 0;
    display: grid;
    justify-items: center;
    gap: 0.9rem;
    text-align: center;
  }
  #qr-preview {
    min-width: 15rem;
    min-height: 15rem;
    padding: 0.75rem;
    display: grid;
    place-items: center;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 0.9rem;
  }
  #qr-preview img,
  #qr-preview canvas {
    display: block;
    width: 15rem !important;
    height: 15rem !important;
    image-rendering: pixelated;
  }
  .qr-hint {
    max-width: 24rem;
    color: var(--muted);
    font-size: 0.85rem;
  }
  .qr-error {
    max-width: 13rem;
    color: #b63b2a;
    font-size: 0.85rem;
    text-align: center;
  }
  .builder-layout {
    display: grid;
    grid-template-columns: 13rem 1fr;
    gap: 1.2rem;
    align-items: start;
  }
  .builder-side {
    position: sticky;
    top: 1rem;
  }
  .builder-side nav {
    padding: 0.6rem;
    display: grid;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 1rem;
  }
  .builder-side nav a {
    padding: 0.7rem 0.8rem;
    display: flex;
    justify-content: space-between;
    border-radius: 0.65rem;
    font-size: 0.9rem;
  }
  .builder-side nav a:hover,
  .builder-side nav a.active {
    color: var(--green-dark);
    background: var(--soft);
  }
  .tip-card {
    margin-top: 0.8rem;
    padding: 1rem;
    color: #dbeafe;
    background: var(--green-dark);
    border-radius: 1rem;
    font-size: 0.82rem;
  }
  .tip-card strong {
    color: var(--lime);
  }
  .tip-card p {
    margin-top: 0.35rem;
  }
  .builder-content {
    min-width: 0;
    display: grid;
    gap: 1.2rem;
  }
  .panel,
  .question-card,
  .result-card,
  .action-board {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
  }
  .panel {
    padding: 1.4rem;
  }
  .panel-head,
  .section-title {
    margin-bottom: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
  }
  .accent-panel {
    border-top: 4px solid var(--lime);
  }
  .section-title {
    margin-top: 0.5rem;
  }
  .question-card {
    margin-bottom: 0.7rem;
    overflow: hidden;
  }
  .question-card summary {
    padding: 1rem 1.15rem;
    display: grid;
    grid-template-columns: auto auto 1fr auto;
    align-items: center;
    gap: 0.75rem;
    list-style: none;
    cursor: pointer;
    user-select: none;
  }
  .drag-handle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    color: #94a3b8;
    background: transparent;
    border-radius: 0.5rem;
    cursor: grab;
    touch-action: none;
    user-select: none;
    transition: color 0.15s ease, background-color 0.15s ease, transform 0.15s ease;
  }
  .drag-handle:hover,
  .drag-handle:focus-visible {
    color: var(--text);
    background: var(--soft);
    outline: none;
  }
  .drag-handle:active,
  .question-card.is-dragging .drag-handle {
    cursor: grabbing;
    color: var(--green);
    background: rgba(34, 197, 94, 0.12);
  }
  .question-card.is-dragging {
    opacity: 0.45;
    border-style: dashed;
    border-color: #22c55e;
    background: #f8fafc;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
  }
  .drag-placeholder {
    min-height: 3.5rem;
    margin-bottom: 0.7rem;
    border: 2px dashed #22c55e;
    border-radius: var(--radius);
    background: rgba(34, 197, 94, 0.05);
    box-sizing: border-box;
    transition: all 0.15s ease;
    pointer-events: none;
  }
  .questions-sortable {
    min-height: 2.5rem;
    padding-bottom: 0.25rem;
    transition: background-color 0.15s ease;
  }
  .questions-sortable.drag-over-empty {
    background: rgba(34, 197, 94, 0.04);
    border-radius: var(--radius);
  }
  .question-card.drag-touch-active {
    position: fixed;
    z-index: 99999;
    pointer-events: none;
    opacity: 0.94;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.2);
    transform: scale(1.02);
    transition: none !important;
  }
  .question-card summary::-webkit-details-marker {
    display: none;
  }
  .question-card summary small {
    margin-top: 0.18rem;
    display: block;
    color: var(--muted);
  }
  .question-number {
    width: 2rem;
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    color: var(--green);
    background: var(--soft);
    border-radius: 0.6rem;
    font-weight: 850;
  }
  .question-card[open] .chevron {
    transform: rotate(180deg);
  }
  .question-edit {
    padding: 1rem 1.15rem 1.15rem;
    display: grid;
    gap: 1rem;
    border-top: 1px solid var(--line);
  }
  .form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
  }
  .check-label {
    display: flex;
    align-items: center;
    align-self: end;
    min-height: 3rem;
  }
  .check-label input {
    width: 1.1rem;
    min-height: auto;
    accent-color: var(--green);
  }
  .question-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  .delete-question {
    padding: 0 1.15rem 1.15rem;
  }
  .options-field.is-hidden,
  .is-hidden {
    display: none;
  }

  .response-shell {
    min-height: calc(100dvh - 9rem);
    padding: clamp(1.5rem, 5vw, 4rem) 1rem;
    background:
      radial-gradient(circle at 90% 0, #dbeafe, transparent 34%), var(--paper);
  }
  .response-card {
    width: min(47rem, 100%);
    margin-inline: auto;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 1.5rem;
    box-shadow: var(--shadow);
  }
  .response-intro {
    padding: clamp(1.5rem, 5vw, 2.6rem);
    background: var(--green-dark);
    color: #fff;
  }
  .response-intro .eyebrow {
    color: var(--lime);
  }
  .response-intro p {
    margin-top: 1rem;
    color: #dbeafe;
  }
  .privacy-note {
    margin-top: 1.2rem;
    padding: 0.75rem;
    color: #eff6ff;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 0.7rem;
    font-size: 0.8rem;
  }
  .response-form {
    padding: clamp(1.25rem, 5vw, 2.5rem);
  }
  .response-form fieldset {
    margin: 1rem 0;
    padding: 1.5rem 0;
    border: 0;
    border-bottom: 1px solid var(--line);
  }
  .response-form fieldset:first-of-type {
    padding-top: 0;
  }
  .response-form legend {
    width: 100%;
    margin-bottom: 0.9rem;
    font-size: 1.03rem;
    font-weight: 760;
  }
  .response-form legend span {
    margin-right: 0.45rem;
    color: var(--green);
  }
  .field-help {
    margin: -0.55rem 0 0.9rem;
    color: var(--muted);
    font-size: 0.85rem;
  }
  .choice-list {
    display: grid;
    gap: 0.55rem;
  }
  .choice-list label {
    position: relative;
    min-height: 3.25rem;
    padding: 0.8rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    border: 1px solid var(--line);
    border-radius: 0.8rem;
    font-weight: 500;
  }
  .choice-list label:has(input:checked) {
    color: var(--green-dark);
    background: var(--soft);
    border-color: #60a5fa;
  }
  .choice-list input {
    width: 1.15rem;
    min-height: auto;
    accent-color: var(--green);
  }
  .scale-input {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 0.8rem;
    color: var(--muted);
    font-size: 0.75rem;
  }
  .scale-input > div {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.4rem;
  }
  .scale-input label {
    display: block;
  }
  .scale-input input {
    position: absolute;
    inline-size: 1px;
    block-size: 1px;
    min-height: 0;
    margin: -1px;
    overflow: clip;
    clip-path: inset(50%);
    opacity: 0;
  }
  .scale-input label span {
    min-height: 3rem;
    display: grid;
    place-items: center;
    color: var(--ink);
    border: 1px solid var(--line);
    border-radius: 0.7rem;
    font-size: 1rem;
  }
  .scale-input label:has(input:checked) span {
    color: #fff;
    background: var(--green);
    border-color: var(--green);
  }
  .submit-response {
    width: 100%;
  }
  .form-footnote {
    margin-top: 0.7rem;
    color: var(--muted);
    text-align: center;
    font-size: 0.75rem;
  }
  .honeypot {
    position: absolute;
    inline-size: 1px;
    block-size: 1px;
    min-height: 0;
    margin: -1px;
    overflow: clip;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  .thanks-card {
    text-align: center;
  }
  .thanks-icon {
    width: 4rem;
    aspect-ratio: 1;
    margin: 0 auto 1rem;
    display: grid;
    place-items: center;
    color: #fff;
    background: var(--green);
    border-radius: 50%;
    font-size: 2rem;
  }

  .results-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 20rem;
    align-items: start;
    gap: 1.2rem;
  }

  .narrow-shell {
    max-width: 860px;
  }

  .settings-card,
  .ai-analysis-card,
  .ai-result-card {
    background: #fff;
    border: 1px solid var(--line, #bfdbfe);
    border-radius: 22px;
    padding: 28px;
    box-shadow: 0 12px 32px rgba(37, 99, 235, 0.06);
  }

  .profile-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
  }

  .profile-grid h2 {
    margin-top: 0;
  }

  .notice-info {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 14px;
    padding: 16px 18px;
    margin-bottom: 22px;
  }

  .notice-info p {
    margin: 6px 0 0;
  }

  .ai-analysis-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin: 24px 0;
  }

  .ai-analysis-card h2,
  .ai-result-card h2 {
    margin: 4px 0 6px;
  }

  .ai-analysis-card p {
    margin: 0;
  }

  .ai-loading-status {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-left: 12px;
    color: var(--muted);
    font-size: 0.92rem;
    vertical-align: middle;
  }

  .ai-loading-status[hidden] {
    display: none;
  }

  .ai-loading-status progress {
    width: 72px;
    height: 7px;
    accent-color: var(--primary, #2563eb);
  }

  .ai-result-card {
    margin: 24px 0;
  }

  .ai-result-card .section-title {
    margin-bottom: 18px;
  }

  .ai-summary {
    font-size: 1.08rem;
    line-height: 1.8;
    background: #eff6ff;
    border-radius: 14px;
    padding: 16px 18px;
  }

  .ai-result-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin-top: 22px;
  }

  .ai-result-grid h3,
  .ai-actions h3 {
    margin: 0 0 10px;
  }

  .ai-result-grid ul {
    margin: 0;
    padding-left: 20px;
  }

  .ai-result-grid li {
    margin: 0 0 8px;
  }

  .ai-actions {
    border-top: 1px solid var(--line, #bfdbfe);
    margin-top: 24px;
    padding-top: 22px;
  }

  .ai-actions article {
    border: 1px solid var(--line, #bfdbfe);
    border-radius: 14px;
    padding: 14px 16px;
    margin-top: 10px;
  }

  .ai-actions article strong {
    margin-left: 8px;
  }

  .ai-actions article p {
    margin: 8px 0 4px;
  }

  .badge-high {
    background: #fee2e2;
    color: #b91c1c;
  }
  .badge-medium {
    background: #fef3c7;
    color: #92400e;
  }
  .badge-low {
    background: #dcfce7;
    color: #166534;
  }
  .result-card {
    margin-bottom: 0.8rem;
    padding: 1.3rem;
  }
  .result-head {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 1rem;
  }
  .result-head h3 {
    font-size: 1rem;
  }
  .result-head span {
    color: var(--muted);
    font-size: 0.78rem;
  }
  .pill {
    flex: 0 0 auto;
    padding: 0.25rem 0.5rem;
    color: var(--green) !important;
    background: var(--soft);
    border-radius: 99px;
  }
  .average-score {
    margin-top: 1rem;
  }
  .average-score strong {
    color: var(--green);
    font-size: 3rem;
  }
  .average-score span {
    color: var(--muted);
  }
  .distribution {
    margin-top: 0.5rem;
    display: grid;
    gap: 0.4rem;
  }
  .distribution > div {
    display: grid;
    grid-template-columns: 1rem 1fr 2rem;
    align-items: center;
    gap: 0.6rem;
  }
  .distribution i,
  .option-result i {
    height: 0.55rem;
    overflow: hidden;
    background: #edf1ec;
    border-radius: 99px;
  }
  .distribution b,
  .option-result b {
    height: 100%;
    display: block;
    background: var(--green);
    border-radius: inherit;
  }
  .distribution small {
    color: var(--muted);
    text-align: right;
  }
  .option-result {
    margin-top: 1rem;
  }
  .option-result > div {
    margin-bottom: 0.3rem;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    font-size: 0.88rem;
  }
  .option-result i {
    display: block;
  }
  .text-answers {
    margin-top: 1rem;
    display: grid;
    gap: 0.55rem;
  }
  .text-answers blockquote {
    margin: 0;
    padding: 0.8rem 1rem;
    color: #334155;
    background: #f8fbff;
    border-left: 3px solid var(--lime);
    border-radius: 0 0.7rem 0.7rem 0;
  }
  .action-board {
    position: sticky;
    top: 1rem;
    padding: 1.25rem;
  }
  .action-board > p {
    margin-top: 0.5rem;
    color: var(--muted);
    font-size: 0.86rem;
  }
  .action-form {
    margin-top: 1.1rem;
    display: grid;
    gap: 0.75rem;
  }
  .action-list {
    margin-top: 1.1rem;
    display: grid;
    gap: 0.55rem;
  }
  .action-item {
    padding: 0.7rem;
    display: flex;
    align-items: start;
    gap: 0.7rem;
    background: #f8fbff;
    border: 1px solid var(--line);
    border-radius: 0.75rem;
  }
  .action-item button {
    width: 1.3rem;
    height: 1.3rem;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    color: #fff;
    background: #fff;
    border: 1px solid #aab9ad;
    border-radius: 0.35rem;
  }
  .action-item span {
    display: grid;
  }
  .action-item strong {
    font-size: 0.85rem;
  }
  .action-item small {
    color: var(--muted);
    font-size: 0.72rem;
  }
  .action-item.is-done {
    opacity: 0.6;
  }
  .action-item.is-done button {
    background: var(--green);
    border-color: var(--green);
  }
  .action-item.is-done strong {
    text-decoration: line-through;
  }

  /* ==========================================================================
     Toast Notifications (Top-Right)
     ========================================================================== */
  .toast-container {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    pointer-events: none;
    max-width: min(26rem, calc(100vw - 2rem));
  }

  .toast {
    pointer-events: auto;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 0.95rem 1.1rem;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 1rem;
    box-shadow:
      0 14px 34px -4px rgba(15, 23, 42, 0.16),
      0 4px 12px -2px rgba(15, 23, 42, 0.06);
    border: 1px solid rgba(226, 232, 240, 0.9);
    text-align: left;
    margin: 0;
    width: 100%;
    animation: toastSlideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    transition: transform 0.25s ease, opacity 0.25s ease;
  }

  @keyframes toastSlideIn {
    from {
      opacity: 0;
      transform: translate3d(0, -1rem, 0) scale(0.96);
    }
    to {
      opacity: 1;
      transform: translate3d(0, 0, 0) scale(1);
    }
  }

  .toast.is-hiding {
    opacity: 0;
    transform: translate3d(1.5rem, 0, 0) scale(0.95);
    transition: transform 0.28s cubic-bezier(0.4, 0, 1, 1), opacity 0.28s ease;
  }

  .toast-icon {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.65rem;
    margin-top: 0.05rem;
  }

  .toast-icon svg {
    display: block;
  }

  .toast-body {
    flex: 1 1 auto;
    min-width: 0;
    padding-top: 0.1rem;
  }

  .toast-title {
    display: block;
    font-size: 0.88rem;
    font-weight: 700;
    line-height: 1.25;
    margin-bottom: 0.2rem;
  }

  .toast-message {
    font-size: 0.92rem;
    line-height: 1.45;
    word-break: break-word;
    color: #334155;
  }

  .toast-close {
    flex-shrink: 0;
    padding: 0;
    width: 1.75rem;
    height: 1.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: #94a3b8;
    border-radius: 0.5rem;
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
  }

  .toast-close:hover {
    background: #f1f5f9;
    color: #1e293b;
  }

  /* Success Variant */
  .toast-success {
    border-left: 4px solid #10b981;
  }
  .toast-success .toast-icon {
    background: #ecfdf5;
    color: #059669;
  }
  .toast-success .toast-title {
    color: #065f46;
  }

  /* Error Variant */
  .toast-error {
    border-left: 4px solid #ef4444;
  }
  .toast-error .toast-icon {
    background: #fef2f2;
    color: #dc2626;
  }
  .toast-error .toast-title {
    color: #991b1b;
  }

  /* Progress Bar */
  .toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    width: 100%;
    transform-origin: left;
    animation: toastProgress 4.5s linear forwards;
  }

  .toast-success .toast-progress {
    background: #10b981;
  }

  .toast-error .toast-progress {
    background: #ef4444;
  }

  .toast:hover .toast-progress {
    animation-play-state: paused;
  }

  @keyframes toastProgress {
    from {
      transform: scaleX(1);
    }
    to {
      transform: scaleX(0);
    }
  }

  @media (max-width: 600px) {
    .toast-container {
      top: 1rem;
      right: 1rem;
      left: 1rem;
      max-width: none;
    }
  }

  .flash:not(.toast) {
    width: min(44rem, calc(100% - 2rem));
    margin: 1rem auto;
    padding: 0.8rem 1rem;
    border-radius: 0.8rem;
    text-align: center;
  }
  .flash-success:not(.toast) {
    color: #1e3a8a;
    background: #dbeafe;
    border: 1px solid #93c5fd;
  }
  .flash-error:not(.toast) {
    color: #8b2b20;
    background: #fde8e3;
    border: 1px solid #f2c6bc;
  }

  /* ==========================================================================
     Cookie Consent Banner (Bottom-Left) & Modal
     ========================================================================== */
  .footer-cookie-trigger {
    background: none;
    border: none;
    padding: 0;
    color: var(--green-dark);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
  }
  .footer-cookie-trigger:hover {
    color: var(--green);
    text-decoration: underline;
    text-underline-offset: 0.2rem;
  }

  .cookie-banner {
    position: fixed;
    bottom: 1.5rem;
    left: 1.5rem;
    z-index: 9998;
    max-width: 25rem;
    width: calc(100vw - 2rem);
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: 1.25rem;
    box-shadow:
      0 20px 40px -8px rgba(15, 23, 42, 0.18),
      0 6px 16px -4px rgba(15, 23, 42, 0.08);
    padding: 1.25rem;
    transform: translate3d(0, 0, 0);
    opacity: 1;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
  }

  .cookie-banner.is-hidden {
    opacity: 0;
    pointer-events: none;
    transform: translate3d(0, 1.5rem, 0);
  }

  .cookie-banner-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.5rem;
  }

  .cookie-banner-icon {
    font-size: 1.5rem;
    line-height: 1;
  }

  .cookie-banner-header strong {
    font-size: 0.98rem;
    font-weight: 700;
    color: var(--ink);
    line-height: 1.35;
  }

  .cookie-banner-text {
    font-size: 0.88rem;
    line-height: 1.55;
    color: #475569;
    margin: 0 0 1rem;
  }

  .cookie-banner-text a {
    color: var(--green);
    text-decoration: underline;
    text-underline-offset: 0.15rem;
    font-weight: 600;
  }

  .cookie-banner-actions {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
  }

  .cookie-banner-actions .button {
    font-size: 0.85rem;
  }

  @media (max-width: 600px) {
    .cookie-banner {
      bottom: 1rem;
      left: 1rem;
      right: 1rem;
      width: auto;
      max-width: none;
      padding: 1.1rem;
    }
    .cookie-banner-actions {
      flex-direction: column;
      align-items: stretch;
    }
    .cookie-banner-actions .button {
      width: 100%;
    }
  }

  /* Cookie Settings Dialog */
  .cookie-dialog {
    border: none;
    background: transparent;
    padding: 0;
    max-width: min(34rem, calc(100vw - 2rem));
    border-radius: 1.5rem;
  }

  .cookie-dialog::backdrop {
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
  }

  .cookie-dialog-inner {
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 1.5rem;
    padding: clamp(1.25rem, 4vw, 2rem);
    box-shadow: 0 25px 60px rgba(15, 23, 42, 0.22);
  }

  .cookie-dialog-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
  }

  .cookie-dialog-head h2 {
    font-size: 1.35rem;
    margin: 0;
  }

  .cookie-dialog-desc {
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.55;
    margin-bottom: 1.25rem;
  }

  .cookie-options-list {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
  }

  .cookie-option-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.15rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    transition: border-color 0.15s ease;
  }

  .cookie-option-card:hover {
    border-color: #cbd5e1;
  }

  .cookie-option-info {
    flex: 1 1 auto;
    min-width: 0;
  }

  .cookie-option-info strong,
  .cookie-option-info label strong {
    display: block;
    font-size: 0.92rem;
    color: var(--ink);
    margin-bottom: 0.2rem;
    cursor: pointer;
  }

  .cookie-option-info p {
    font-size: 0.82rem;
    color: #64748b;
    line-height: 1.45;
    margin: 0;
  }

  .cookie-option-switch {
    flex-shrink: 0;
  }

  .cookie-option-switch input[type="checkbox"] {
    width: 1.35rem;
    height: 1.35rem;
    min-height: unset;
    cursor: pointer;
    accent-color: var(--green);
  }

  .cookie-dialog-foot {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
    flex-wrap: wrap;
  }

  @media (max-width: 500px) {
    .cookie-dialog-foot {
      flex-direction: column-reverse;
      align-items: stretch;
    }
    .cookie-dialog-foot .button {
      width: 100%;
    }
  }

  /* ==========================================================================
     Section Blocks & Hierarchy in Builder
     ========================================================================== */
  .section-block {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 1.15rem;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.03);
  }
  .section-block-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e2e8f0;
  }
  .section-info h3 {
    margin: 0.25rem 0 0.15rem;
    font-size: 1.15rem;
    color: var(--ink);
  }
  .section-pill {
    display: inline-block;
    padding: 0.15rem 0.55rem;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: #e0e7ff;
    color: #3730a3;
    border-radius: 9999px;
  }
  .section-actions-inline {
    display: flex;
    align-items: center;
    gap: 0.35rem;
  }
  .sub-empty {
    padding: 1.5rem 1rem;
    background: #fff;
    border: 1px dashed #cbd5e1;
    border-radius: 0.75rem;
    text-align: center;
  }

  /* Question Card Depth / Nesting in Builder */
  .question-card.depth-1 {
    margin-left: 1.5rem;
    border-left: 4px solid #6366f1;
    background: #fbfbfe;
  }
  .question-card.depth-2 {
    margin-left: 3rem;
    border-left: 4px solid #8b5cf6;
    background: #faf8ff;
  }
  .question-card.depth-3 {
    margin-left: 4.5rem;
    border-left: 4px solid #a855f7;
    background: #faf5ff;
  }
  @media (max-width: 640px) {
    .question-card.depth-1 {
      margin-left: 0.75rem;
    }
    .question-card.depth-2 {
      margin-left: 1.25rem;
    }
    .question-card.depth-3 {
      margin-left: 1.75rem;
    }
  }

  /* Condition Badge in Question Card Header */
  .condition-badge {
    display: inline-block;
    margin-left: 0.5rem;
    padding: 0.15rem 0.5rem;
    background: #eef2ff;
    color: #4338ca;
    border: 1px solid #c7d2fe;
    border-radius: 0.5rem;
    font-size: 0.78rem;
    font-weight: 600;
  }

  /* Condition Builder Block inside Question Edit */
  .condition-builder-block {
    background: #f1f5f9;
    border: 1px dashed #cbd5e1;
    border-radius: 0.85rem;
    padding: 1rem;
    margin-top: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
  }
  .condition-options-wrapper {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 0.85rem;
  }
  .cond-hint {
    display: block;
    font-size: 0.85rem;
    color: var(--muted);
    font-weight: 600;
    margin-bottom: 0.5rem;
  }
  .cond-checkbox-list {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    max-height: 180px;
    overflow-y: auto;
    padding: 0.25rem 0;
  }
  .check-label-cond {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    font-size: 0.92rem;
    color: var(--ink);
    cursor: pointer;
  }
  .check-label-cond input[type="checkbox"] {
    width: 1.15rem;
    min-height: 1.15rem;
    margin: 0;
  }

  /* Public Form: Wizard Steps & Progress Bar */
  .wizard-progress-bar {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 9999px;
    overflow: hidden;
    margin-top: 1.25rem;
  }
  .wizard-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #2563eb, #3b82f6);
    border-radius: 9999px;
    transition: width 0.35s ease;
  }
  .wizard-step-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.65rem;
    font-size: 0.88rem;
    color: var(--muted);
  }
  .wizard-step-badge {
    background: #dbeafe;
    color: #1e40af;
    padding: 0.2rem 0.65rem;
    border-radius: 9999px;
    font-weight: 700;
    font-size: 0.82rem;
  }
  .wizard-step-title {
    font-weight: 700;
    color: var(--paper);
  }

  .form-step {
    display: none;
    animation: fadeInStep 0.3s ease;
  }
  .form-step.is-active {
    display: block;
  }
  @keyframes fadeInStep {
    from {
      opacity: 0;
      transform: translateY(6px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .step-header {
    margin-bottom: 1.5rem;
    padding-bottom: 0.85rem;
    border-bottom: 2px solid #eff6ff;
  }
  .step-header h2 {
    font-size: 1.45rem;
    color: var(--ink);
  }

  .wizard-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1.25rem;
    border-top: 1px solid #e2e8f0;
  }
  .wizard-actions .button {
    white-space: nowrap;
    margin: 0;
  }
  .wizard-actions [data-step-prev] {
    flex-shrink: 0;
    min-width: 8.5rem;
    padding-inline: 1.5rem;
  }
  .wizard-actions [data-step-next] {
    margin-left: auto;
    flex-shrink: 0;
    min-width: 8.5rem;
    padding-inline: 1.5rem;
  }
  .wizard-actions .submit-response {
    margin: 0 0 0 auto;
    width: auto;
    flex-shrink: 0;
    min-width: 11.5rem;
    padding-inline: 2rem;
  }
  .wizard-actions > .submit-response:only-child {
    width: 100%;
    margin-left: 0;
  }

  /* Public Form: Conditional Questions */
  .question-fieldset.is-conditional {
    border-left: 4px solid #3b82f6;
    padding-left: 1.25rem;
    background: #f8faff;
    border-radius: 0 0.85rem 0.85rem 0;
    transition: all 0.25s ease;
  }
  .question-fieldset.is-hidden {
    display: none !important;
  }

  /* Results Page: Section Grouping & Scores */
  .results-section-block {
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 1.25rem;
    padding: 1.5rem;
    margin-bottom: 1.75rem;
    box-shadow: 0 4px 20px rgba(37, 99, 235, 0.05);
  }
  .results-section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding-bottom: 1rem;
    margin-bottom: 1.25rem;
    border-bottom: 2px solid #f1f5f9;
  }
  .results-section-header h3 {
    margin: 0.35rem 0 0.2rem;
    font-size: 1.35rem;
  }
  .section-score-badge {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    padding: 0.5rem 0.9rem;
    border-radius: 0.85rem;
    text-align: right;
    white-space: nowrap;
  }
  .section-score-badge small {
    display: block;
    font-size: 0.72rem;
    color: var(--muted);
    font-weight: 600;
  }
  .section-score-badge strong {
    font-size: 1.35rem;
    color: #1e40af;
  }
  .section-score-badge span {
    font-size: 0.85rem;
    color: var(--muted);
  }
  .cond-result-info {
    font-size: 0.82rem;
    color: #4338ca;
    background: #eef2ff;
    padding: 0.2rem 0.55rem;
    border-radius: 0.4rem;
    display: inline-block;
    margin-top: 0.3rem;
  }
  .q-num-badge {
    display: inline-block;
    background: #e2e8f0;
    color: #334155;
    padding: 0.1rem 0.45rem;
    border-radius: 0.4rem;
    font-size: 0.85rem;
    margin-right: 0.35rem;
  }
}

@layer utilities {
  .muted {
    color: var(--muted);
  }
  @media (max-width: 850px) {
    .hero,
    .builder-layout,
    .results-layout,
    .profile-grid {
      grid-template-columns: 1fr;
    }
    .hero {
      padding-block: 3rem;
    }
    .hero-preview {
      max-width: 38rem;
    }
    .feature-grid {
      grid-template-columns: 1fr;
    }
    .trust-strip {
      overflow-x: auto;
      justify-content: start;
      white-space: nowrap;
    }
    .builder-side {
      position: static;
    }
    .builder-side nav {
      display: flex;
      overflow-x: auto;
    }
    .tip-card {
      display: none;
    }
    .action-board {
      position: static;
    }
    .ai-result-grid {
      grid-template-columns: 1fr;
    }
    .ai-analysis-card {
      align-items: stretch;
      flex-direction: column;
    }
  }
  @media (max-width: 620px) {
    .brand-logo {
      width: min(8.5rem, 37vw);
    }
    .legal-page {
      width: min(100% - 1.5rem, 74rem);
      padding-block: 2.2rem 3.5rem;
    }
    .legal-content {
      padding: 1.2rem;
      border-radius: 1rem;
    }
    .legal-toc {
      padding: 0.9rem;
    }
    .site-header {
      align-items: center;
      min-height: 4rem;
      flex-wrap: nowrap;
    }
    .mobile-nav-toggle {
      display: grid;
      place-items: center;
      order: 3;
      margin-left: auto;
    }
    .site-header nav {
      display: none;
      position: absolute;
      inset: 100% 1rem auto;
      z-index: 20;
      flex-direction: column;
      align-items: stretch;
      gap: 0.2rem;
      padding: 0.75rem;
      background: #fff;
      border: 1px solid var(--line);
      border-radius: 0 0 1rem 1rem;
      box-shadow: 0 14px 28px rgba(15, 23, 42, 0.14);
    }
    .site-header nav.is-open {
      display: flex;
    }
    .site-header nav > a,
    .site-header nav .link-button {
      width: 100%;
      padding: 0.7rem 0.8rem;
      text-align: left;
    }
    .site-header nav .language-switcher {
      justify-content: flex-start;
      padding: 0.45rem 0.8rem;
    }
    .site-header nav {
      gap: 0.65rem;
    }
    .nav-user {
      display: none;
    }
    .site-footer,
    .page-heading,
    .cta {
      align-items: stretch;
      flex-direction: column;
    }
    .heading-actions {
      flex-wrap: wrap;
    }
    .heading-actions .button {
      flex: 1 1 auto;
    }
    .wizard-actions {
      gap: 0.65rem;
    }
    .wizard-actions [data-step-prev] {
      min-width: 0;
      flex: 1;
      padding-inline: 0.8rem;
    }
    .wizard-actions [data-step-next],
    .wizard-actions .submit-response {
      min-width: 0;
      flex: 2;
      padding-inline: 1rem;
      margin-left: 0;
    }
    .stats-row {
      grid-template-columns: 1fr;
    }
    .survey-row {
      grid-template-columns: auto 1fr;
    }
    .survey-count {
      display: none;
    }
    .row-actions {
      grid-column: 1 / -1;
    }
    .row-actions .button {
      flex: 1;
    }
    .form-grid {
      grid-template-columns: 1fr;
    }
    .share-bar {
      align-items: stretch;
      flex-wrap: wrap;
    }
    .share-bar > div {
      width: 100%;
    }
    .share-bar .button {
      flex: 1 1 auto;
    }
    .scale-input {
      grid-template-columns: 1fr;
    }
    .scale-input > span {
      display: none;
    }
    .score-card {
      grid-template-columns: 1fr;
    }
  }
  @media print {
    body * {
      visibility: hidden !important;
    }
    #qr-dialog[open],
    #qr-dialog[open] * {
      visibility: visible !important;
    }
    #qr-dialog[open] {
      position: fixed;
      inset: 0;
      width: 100%;
      max-width: none;
      box-shadow: none;
    }
    .qr-actions,
    .qr-dialog .icon-button {
      display: none !important;
    }
  }

  @media (prefers-reduced-motion: reduce) {
    html {
      scroll-behavior: auto;
    }
    *,
    *::before,
    *::after {
      transition-duration: 0.01ms !important;
      animation-duration: 0.01ms !important;
    }
  }
}
