* {
  box-sizing: border-box;
}

html {
  background: var(--dai-bg);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--dai-text);
  background:
    radial-gradient(circle at 12% 8%, rgba(245, 226, 255, .74), transparent 26rem),
    radial-gradient(circle at 88% 12%, rgba(255, 230, 207, .60), transparent 24rem),
    linear-gradient(180deg, #fffaf4 0%, #fff8f2 55%, #fffaf6 100%);
}

button,
textarea,
select {
  font: inherit;
}

button:focus-visible,
textarea:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(124, 58, 237, .20);
  outline-offset: 2px;
}


/* ============================================================
   HEADER
   ============================================================ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid rgba(220, 205, 232, .82);
  background: rgba(255, 251, 246, .93);
  backdrop-filter: blur(18px);
}

.header-inner {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--dai-text);
  text-decoration: none;
  font-weight: 800;
  font-size: .94rem;
}

.brand-main {
  color: var(--dai-purple);
}

.brand-divider {
  color: #b9abc7;
}

.brand-product {
  color: var(--dai-text);
}

.language-switch {
  box-shadow: 0 6px 18px rgba(94, 56, 119, .06);
}

.language-switch button {
  border: 0;
  padding: 4px 6px;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  opacity: .48;
}

.language-switch button[aria-pressed="true"] {
  opacity: 1;
  background: var(--dai-purple-soft);
}


/* ============================================================
   HERO — more compact and warmer
   ============================================================ */

.tool-hero {
  padding: 42px 0 22px;
}

.hero-inner {
  max-width: 820px;
}

.tool-hero .dai-eyebrow {
  padding: 6px 10px;
  background: rgba(242, 235, 255, .92);
}

.tool-hero h1 {
  max-width: 700px;
  margin: 13px 0 12px;
  font-size: clamp(2.35rem, 5vw, 4rem);
  line-height: .98;
}

.hero-subtitle {
  max-width: 690px;
  margin: 0;
  font-size: clamp(1rem, 1.8vw, 1.16rem);
  line-height: 1.55;
}


/* ============================================================
   INTRO
   ============================================================ */

.intro-section {
  padding: 6px 0 18px;
}

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

.explainer-card {
  position: relative;
  padding: 18px 20px;
  overflow: hidden;
  box-shadow: 0 12px 30px rgba(92, 52, 132, .06);
}

.explainer-card:first-child {
  background:
    linear-gradient(135deg, #ffffff 0%, #f8f2ff 100%);
}

.explainer-card:last-child {
  background:
    linear-gradient(135deg, #ffffff 0%, #fff2e7 100%);
}

.explainer-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(
    180deg,
    #9b67f7,
    #e2b0ff
  );
}

.explainer-card:last-child::before {
  background: linear-gradient(
    180deg,
    #f0a66f,
    #f5c6a5
  );
}

.explainer-card h2 {
  margin: 0 0 6px;
  font-size: 1.02rem;
}

.explainer-card p {
  margin: 0;
  font-size: .92rem;
  line-height: 1.5;
}


/* ============================================================
   WORKSPACE
   ============================================================ */

.workspace-section {
  padding: 10px 0 30px;
}

.workspace-grid {
  display: grid;
  grid-template-columns:
    minmax(0, .96fr)
    minmax(0, 1.04fr);
  gap: 16px;
  align-items: start;
}

.tool-panel {
  padding: 22px;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 15px 38px rgba(92, 52, 132, .075);
}

.result-panel {
  position: sticky;
  top: 76px;
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 18px;
}

.panel-heading h2 {
  margin: 0;
  font-size: 1.28rem;
}

.panel-heading p {
  margin: 4px 0 0;
  font-size: .9rem;
  line-height: 1.45;
}

.step-pill {
  display: inline-flex;
  width: 27px;
  height: 27px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: linear-gradient(
    135deg,
    #f0e5ff,
    #f8efff
  );
  color: var(--dai-purple);
  font-size: .82rem;
  font-weight: 800;
}


/* ============================================================
   FORM
   ============================================================ */

.field {
  margin-bottom: 15px;
}

.field label {
  display: block;
  margin-bottom: 6px;
  color: var(--dai-text);
  font-size: .9rem;
  font-weight: 800;
}

.field textarea,
.field select,
.generated-prompt {
  width: 100%;
  border: 1px solid #ddceed;
  border-radius: 13px;
  background: #fffefd;
  color: var(--dai-text);
  transition:
    border-color .18s ease,
    box-shadow .18s ease,
    background .18s ease;
}

.field textarea {
  min-height: 82px;
  padding: 11px 13px;
  resize: vertical;
  font-size: .9rem;
  line-height: 1.48;
}

.field select {
  min-height: 42px;
  padding: 0 12px;
  font-size: .9rem;
}

.field textarea:focus,
.field select:focus,
.generated-prompt:focus {
  outline: 0;
  border-color: #a77aef;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(124, 58, 237, .08);
}

.field-help {
  margin: 5px 0 0;
  font-size: .76rem;
  line-height: 1.4;
}

.form-actions {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
  padding-top: 2px;
}

.build-button {
  min-width: 160px;
}

.form-actions .dai-button-primary,
.form-actions .dai-button-secondary {
  padding: 10px 14px;
  min-height: 40px;
}


/* ============================================================
   RESULT
   ============================================================ */

.result-empty {
  min-height: 290px;
  display: grid;
  place-content: center;
  text-align: center;
  padding: 24px;
}

.empty-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 13px;
  display: grid;
  place-content: center;
  border-radius: 15px;
  background:
    linear-gradient(
      135deg,
      #f2e8ff,
      #ffece0
    );
  color: var(--dai-purple);
  font-size: 1.25rem;
}

.result-empty h3 {
  margin: 0 0 6px;
  font-size: 1rem;
}

.result-empty p {
  max-width: 320px;
  margin: 0 auto;
  font-size: .9rem;
  line-height: 1.5;
}

.result-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
  color: #6c5a78;
  font-size: .78rem;
  font-weight: 800;
}

.copy-button {
  border: 1px solid #ded1ec;
  border-radius: 10px;
  padding: 7px 10px;
  background: #fff;
  color: var(--dai-purple);
  font-size: .8rem;
  font-weight: 800;
  cursor: pointer;
}

.generated-prompt {
  min-height: 230px;
  padding: 15px;
  resize: vertical;
  font-size: .9rem;
  line-height: 1.55;
}

.why-panel,
.next-panel,
.technical-details {
  margin-top: 13px;
  padding: 14px 15px;
  border: 1px solid var(--dai-border);
  border-radius: 14px;
}

.why-panel {
  background:
    linear-gradient(
      135deg,
      #fbf8ff,
      #f5efff
    );
}

.next-panel {
  background:
    linear-gradient(
      135deg,
      #fffaf6,
      #fff0e4
    );
}

.technical-details {
  background: #fffdfb;
}

.why-panel h3,
.next-panel h3 {
  margin: 0 0 7px;
  font-size: .94rem;
}

.why-panel ul {
  margin: 0;
  padding-left: 19px;
  color: var(--dai-muted);
  font-size: .88rem;
}

.why-panel li + li {
  margin-top: 5px;
}

.next-panel p,
.technical-details p {
  margin: 0;
  font-size: .88rem;
  line-height: 1.5;
}

.technical-details summary {
  color: var(--dai-purple);
  font-size: .88rem;
  font-weight: 800;
  cursor: pointer;
}

.technical-details-content {
  padding-top: 9px;
}


/* ============================================================
   PRIVACY
   ============================================================ */

.privacy-strip {
  padding: 0 0 28px;
}

.privacy-note {
  display: flex;
  gap: 8px;
  padding: 12px 15px;
  border: 1px solid #e0d1ec;
  border-radius: 14px;
  background:
    linear-gradient(
      90deg,
      rgba(249, 243, 255, .92),
      rgba(255, 246, 238, .92)
    );
  color: var(--dai-muted);
  font-size: .84rem;
  line-height: 1.45;
}

.privacy-note strong {
  flex: 0 0 auto;
  color: var(--dai-text);
}


/* ============================================================
   FOOTER
   ============================================================ */

.site-footer {
  border-top: 1px solid rgba(225, 211, 235, .9);
  padding: 20px 0;
  background: rgba(255, 252, 248, .74);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 26px;
  align-items: center;
  font-size: .83rem;
}

.footer-inner p {
  max-width: 440px;
  margin: 4px 0 0;
  font-size: .8rem;
}

.footer-links {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--dai-purple);
  font-weight: 700;
  text-decoration: none;
}


/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 900px) {
  .workspace-grid {
    grid-template-columns: 1fr;
  }

  .result-panel {
    position: static;
  }
}

@media (max-width: 680px) {
  .header-inner {
    min-height: 54px;
  }

  .tool-hero {
    padding: 34px 0 18px;
  }

  .tool-hero h1 {
    font-size: clamp(2.15rem, 10vw, 3rem);
  }

  .intro-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .tool-panel {
    padding: 18px;
  }

  .privacy-note,
  .footer-inner {
    display: block;
  }

  .privacy-note strong {
    display: block;
    margin-bottom: 4px;
  }

  .footer-links {
    margin-top: 14px;
  }

  .form-actions {
    display: grid;
  }

  .form-actions button {
    width: 100%;
  }
}

/* ============================================================
   COMPACT PASS — MATCH WORDS.DOOKUN.COM DENSITY
   ============================================================ */

.tool-hero {
  padding: 24px 0 12px;
}

.hero-inner {
  max-width: 760px;
}

.tool-hero .dai-eyebrow {
  margin-bottom: 6px;
}

.tool-hero h1 {
  max-width: 680px;
  margin: 8px 0 8px;
  font-size: clamp(2.15rem, 4vw, 3.35rem);
  line-height: .98;
}

.hero-subtitle {
  max-width: 660px;
  font-size: .98rem;
  line-height: 1.48;
}

.intro-section {
  padding: 0 0 10px;
}

.intro-grid {
  gap: 10px;
}

.explainer-card {
  padding: 13px 16px;
  border-radius: 16px;
}

.explainer-card h2 {
  margin-bottom: 3px;
  font-size: .92rem;
}

.explainer-card p {
  font-size: .82rem;
  line-height: 1.42;
}

.workspace-section {
  padding: 6px 0 20px;
}

.workspace-grid {
  gap: 14px;
}

.tool-panel {
  padding: 18px;
  border-radius: 18px;
}

.panel-heading {
  gap: 9px;
  margin-bottom: 14px;
}

.panel-heading h2 {
  font-size: 1.12rem;
}

.panel-heading p {
  margin-top: 2px;
  font-size: .82rem;
  line-height: 1.4;
}

.step-pill {
  width: 24px;
  height: 24px;
  font-size: .74rem;
}

.field {
  margin-bottom: 11px;
}

.field label {
  margin-bottom: 4px;
  font-size: .82rem;
}

.field textarea {
  min-height: 64px;
  padding: 9px 11px;
  font-size: .82rem;
  line-height: 1.4;
}

.field select {
  min-height: 38px;
  padding: 0 10px;
  font-size: .82rem;
}

.field-help {
  margin-top: 3px;
  font-size: .69rem;
  line-height: 1.35;
}

.form-actions {
  gap: 7px;
  padding-top: 0;
}

.form-actions .dai-button-primary,
.form-actions .dai-button-secondary {
  min-height: 36px;
  padding: 8px 12px;
  font-size: .8rem;
}

.result-empty {
  min-height: 220px;
  padding: 18px;
}

.empty-icon {
  width: 42px;
  height: 42px;
  margin-bottom: 10px;
}

.result-empty h3 {
  font-size: .92rem;
}

.result-empty p {
  max-width: 285px;
  font-size: .8rem;
  line-height: 1.42;
}

.generated-prompt {
  min-height: 180px;
  padding: 12px;
  font-size: .82rem;
  line-height: 1.48;
}

.why-panel,
.next-panel,
.technical-details {
  margin-top: 10px;
  padding: 11px 12px;
  border-radius: 12px;
}

.why-panel h3,
.next-panel h3 {
  margin-bottom: 5px;
  font-size: .86rem;
}

.why-panel ul,
.next-panel p,
.technical-details p,
.technical-details summary {
  font-size: .78rem;
}

.privacy-strip {
  padding: 0 0 18px;
}

.privacy-note {
  padding: 9px 12px;
  font-size: .76rem;
}

.site-footer {
  padding: 14px 0;
}

.footer-inner {
  font-size: .76rem;
}

.footer-inner p {
  font-size: .72rem;
}

/* ============================================================
   WORDS-LIKE COMPACT STRUCTURE
   ============================================================ */

.tool-hero {
  padding: 20px 0 10px !important;
}

.hero-inner {
  max-width: 720px !important;
}

.tool-hero h1 {
  margin: 8px 0 7px !important;
  max-width: 620px !important;
  font-size: clamp(2rem, 3.6vw, 3.05rem) !important;
}

.hero-subtitle {
  max-width: 640px !important;
  font-size: .94rem !important;
  line-height: 1.42 !important;
}

.compact-explainer {
  padding: 0 0 10px;
}

.compact-explainer-inner {
  display: flex;
  gap: 6px;
  align-items: baseline;
  padding: 9px 12px;
  border: 1px solid #e5d8ef;
  border-radius: 13px;
  background:
    linear-gradient(
      90deg,
      rgba(247,240,255,.9),
      rgba(255,244,235,.9)
    );
  font-size: .8rem;
  line-height: 1.4;
}

.compact-explainer-inner strong {
  color: var(--dai-text);
  white-space: nowrap;
}

.compact-explainer-inner span {
  color: var(--dai-muted);
}

.workspace-section {
  padding: 2px 0 18px !important;
}

.workspace-grid {
  gap: 12px !important;
}

.tool-panel {
  padding: 16px !important;
}

.panel-heading {
  margin-bottom: 12px !important;
}

.field {
  margin-bottom: 9px !important;
}

.field textarea {
  min-height: 56px !important;
}

.field-help {
  display: none;
}

.result-empty {
  min-height: 190px !important;
}

.privacy-strip {
  padding-top: 2px !important;
}

@media (min-width: 901px) {
  .workspace-grid {
    grid-template-columns: 1fr 1fr !important;
  }
}

/* ============================================================
   HERO ALIGNMENT — MATCH WORDS.DOOKUN.COM
   ============================================================ */

.hero-inner {
  max-width: none !important;
  width: min(calc(100% - 40px), var(--dai-shell)) !important;
  margin-inline: auto !important;
}

.tool-hero .dai-eyebrow,
.tool-hero h1,
.tool-hero .hero-subtitle {
  margin-left: 0 !important;
}

.tool-hero h1 {
  max-width: 720px !important;
}

.hero-subtitle {
  max-width: 720px !important;
}

@media (max-width: 780px) {
  .hero-inner {
    width: min(calc(100% - 24px), var(--dai-shell)) !important;
  }
}

/* ============================================================
   SPEECH TO TEXT
   ============================================================ */

.speech-field-wrapper {
  position: relative;
}

.speech-field-wrapper textarea {
  padding-right: 48px !important;
}

.speech-button {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid #e1d3ef;
  border-radius: 10px;
  background: rgba(255,255,255,.94);
  cursor: pointer;
  transition:
    transform .15s ease,
    background .15s ease,
    border-color .15s ease,
    box-shadow .15s ease;
}

.speech-button:hover {
  border-color: #b692ef;
  background: #faf6ff;
}

.speech-button.is-listening {
  border-color: #9c67ee;
  background: #f0e5ff;
  box-shadow:
    0 0 0 4px
    rgba(124,58,237,.10);
  animation:
    speechPulse
    1.25s ease-in-out
    infinite;
}

.speech-button-icon {
  font-size: 1rem;
  line-height: 1;
}

@keyframes speechPulse {
  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.07);
  }
}

/* ============================================================
   SHARED DOOKUN AI HEADER
   ============================================================ */

.header-inner {
  min-height: 72px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
}

.brand-logo {
  display: block;
  width: 175px;
  height: 50px;
  object-fit: contain;
  object-position: left center;
}

.brand-product {
  color: var(--dai-text);
  font-size: 1.02rem;
  font-weight: 800;
  white-space: nowrap;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 26px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 26px;
}

.site-nav a {
  color: var(--dai-text);
  text-decoration: none;
  font-size: .95rem;
  font-weight: 800;
}

.site-nav a:hover {
  color: var(--dai-purple);
}

@media (max-width: 760px) {
  .header-inner {
    min-height: 62px;
  }

  .brand-logo {
    width: 132px;
    height: 40px;
  }

  .brand-product {
    font-size: .88rem;
  }

  .site-nav {
    display: none;
  }

  .header-actions {
    gap: 10px;
  }
}

/* ============================================================
   HEADER LOGO SIZE FIX
   ============================================================ */

.brand-logo {
  width: 145px !important;
  height: 40px !important;
  object-fit: contain !important;
  object-position: left center !important;
}

.header-inner {
  min-height: 62px !important;
}

.brand {
  gap: 11px !important;
}

.brand-product {
  font-size: .95rem !important;
}

@media (max-width: 760px) {
  .brand-logo {
    width: 118px !important;
    height: 34px !important;
  }

  .header-inner {
    min-height: 56px !important;
  }
}
