:root {
  --ink: #252238;
  --cream: #f8f4ec;
  --coral: #e8654d;
  --lilac: #d9d0f4;
  --mint: #dceee5;
  --border: rgba(37, 34, 56, 0.12);
}

* { box-sizing: border-box; }
html { background: var(--cream); overflow-x: hidden; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  padding-bottom: env(safe-area-inset-bottom);
  background:
    radial-gradient(circle at 8% 80%, rgba(232, 101, 77, 0.1), transparent 28%),
    radial-gradient(circle at 90% 15%, rgba(217, 208, 244, 0.38), transparent 30%),
    var(--cream);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-tap-highlight-color: transparent;
}
button, textarea { font: inherit; }
button { cursor: pointer; touch-action: manipulation; }
.wrap { width: min(1152px, calc(100% - 32px)); margin-inline: auto; }
.site-header { display: flex; align-items: center; justify-content: space-between; padding-block: 16px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; border: 0; background: transparent; color: var(--ink); padding: 0; font-size: 18px; font-weight: 750; letter-spacing: -0.02em; }
.brand-icon, .card-icon, .message-icon { display: grid; place-items: center; background: var(--ink); color: var(--cream); }
.brand-icon { width: 36px; height: 36px; border-radius: 12px; }
.tagline { max-width: 145px; border: 1px solid rgba(37, 34, 56, 0.1); border-radius: 999px; background: rgba(255, 255, 255, 0.62); padding: 6px 12px; text-align: center; color: rgba(37, 34, 56, 0.62); font-size: 11px; font-weight: 600; line-height: 1.45; }
.hero { padding-block: 34px 38px; text-align: center; }
.eyebrow, .card-label { margin: 0; color: var(--coral); font-size: 12px; font-weight: 800; letter-spacing: 0.19em; text-transform: uppercase; }
.hero h1 { max-width: 900px; margin: 16px auto 0; font-size: clamp(40px, 8vw, 88px); line-height: 0.96; letter-spacing: -0.055em; }
em { color: var(--coral); font-family: Georgia, "Times New Roman", serif; font-weight: 400; }
.hero-copy { max-width: 690px; margin: 22px auto 0; color: rgba(37, 34, 56, 0.66); font-size: 17px; line-height: 1.75; }
.mini-formula, .result-formula { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; }
.mini-formula { max-width: 700px; margin: 28px auto 0; font-size: 15px; font-weight: 650; }
.mini-formula span, .result-formula span { border: 1px solid rgba(37, 34, 56, 0.1); border-radius: 999px; background: rgba(255, 255, 255, 0.7); padding: 9px 14px; }
.mini-formula b, .result-formula b { color: var(--coral); }
.mini-formula .dark-chip, .result-formula .dark-chip { background: var(--ink); color: var(--cream); }
.form-section { padding-bottom: 80px; }
.input-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.input-card { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 28px; padding: 28px; box-shadow: 0 18px 50px rgba(37, 34, 56, 0.06); transition: border-color 0.2s ease, transform 0.2s ease; }
.input-card:focus-within { border-color: rgba(37, 34, 56, 0.27); transform: translateY(-2px); }
.input-card.invalid { border-color: var(--coral); }
.input-card.coral { background: #f5d7ce; }
.input-card.lilac { background: #e5ddf7; }
.input-card.mint { background: var(--mint); }
.card-top { display: flex; align-items: center; justify-content: space-between; }
.card-icon, .message-icon { width: 44px; height: 44px; border-radius: 16px; background: rgba(255, 255, 255, 0.66); color: var(--ink); font-size: 20px; }
.number { color: rgba(37, 34, 56, 0.37); font-size: 14px; font-weight: 650; }
.input-card .card-label { margin-top: 24px; color: rgba(37, 34, 56, 0.52); }
.input-card h2 { margin: 8px 0 0; font-size: 24px; line-height: 1.15; letter-spacing: -0.025em; }
.card-copy { min-height: 78px; margin: 12px 0 0; color: rgba(37, 34, 56, 0.62); font-size: 14px; line-height: 1.7; }
textarea { width: 100%; border: 1px solid rgba(37, 34, 56, 0.1); border-radius: 16px; outline: none; background: rgba(255, 255, 255, 0.67); color: var(--ink); }
.input-card textarea { min-height: 176px; margin-top: 20px; padding: 16px; resize: vertical; font-size: 16px; line-height: 1.5; }
textarea::placeholder { color: rgba(37, 34, 56, 0.38); font-size: 14px; line-height: 1.65; }
textarea:focus { border-color: rgba(37, 34, 56, 0.3); box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.5); }
.error { display: none; margin: 12px 0 0; color: var(--coral); font-size: 14px; font-weight: 650; }
.invalid .error { display: block; }
.contact-card { max-width: 820px; margin: 24px auto 0; overflow: hidden; border: 1px solid var(--border); border-radius: 28px; background: linear-gradient(135deg, rgba(220, 238, 229, 0.78), rgba(229, 221, 247, 0.74)); padding: 28px; box-shadow: 0 18px 50px rgba(37, 34, 56, 0.07); transition: border-color 0.2s ease, transform 0.2s ease; }
.contact-card:focus-within { border-color: rgba(37, 34, 56, 0.27); transform: translateY(-2px); }
.contact-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.contact-badge { border: 1px solid rgba(37, 34, 56, 0.1); border-radius: 999px; background: rgba(255, 255, 255, 0.65); padding: 7px 12px; color: rgba(37, 34, 56, 0.56); font-size: 11px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; }
.contact-heading .card-label { color: var(--coral); }
.contact-heading .card-label { margin-top: 22px; }
.contact-heading h3 { margin: 8px 0 0; font-size: clamp(24px, 4vw, 32px); line-height: 1.12; letter-spacing: -0.035em; }
.contact-heading > p:last-child { margin: 12px 0 0; color: rgba(37, 34, 56, 0.62); font-size: 14px; line-height: 1.65; }
.contact-fields { display: grid; grid-template-columns: 1fr; gap: 20px; max-height: 360px; margin-top: 18px; overflow: hidden; border: 1px solid rgba(37, 34, 56, 0.1); border-radius: 24px; background: rgba(255, 255, 255, 0.72); padding: 22px; box-shadow: 0 12px 34px rgba(37, 34, 56, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.8); opacity: 1; transform: translateY(0); transition: max-height 0.28s ease, margin 0.28s ease, padding 0.28s ease, opacity 0.2s ease, transform 0.28s ease, border-color 0.2s ease; }
.contact-fields.is-disabled { max-height: 0; margin-top: 0; border-color: transparent; padding-top: 0; padding-bottom: 0; box-shadow: none; opacity: 0; transform: translateY(-8px); pointer-events: none; }
.contact-field { display: block; }
.contact-field + .contact-field { border-top: 1px solid rgba(37, 34, 56, 0.09); padding-top: 20px; }
.contact-fields label > span { display: block; margin: 0 0 10px; color: rgba(37, 34, 56, 0.58); font-size: 11px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; }
.contact-fields input { width: 100%; min-height: 66px; border: 1px solid rgba(37, 34, 56, 0.11); border-radius: 18px; outline: none; background: rgba(248, 244, 236, 0.78); padding: 17px 19px; color: var(--ink); font: inherit; font-size: 17px; letter-spacing: -0.01em; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85), 0 8px 24px rgba(37, 34, 56, 0.04); transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease; }
.contact-fields input:disabled { cursor: not-allowed; }
.contact-fields input::placeholder { color: rgba(37, 34, 56, 0.36); }
.contact-fields input:focus { border-color: rgba(232, 101, 77, 0.62); background: white; box-shadow: 0 0 0 4px rgba(232, 101, 77, 0.12), 0 12px 30px rgba(37, 34, 56, 0.07); }
.contact-consent { display: flex; align-items: flex-start; gap: 13px; margin-top: 20px; border: 1px solid rgba(37, 34, 56, 0.1); border-radius: 18px; background: rgba(255, 255, 255, 0.72); padding: 16px; color: rgba(37, 34, 56, 0.68); font-size: 13px; line-height: 1.5; cursor: pointer; }
.contact-consent input { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; }
.checkmark { display: grid; place-items: center; width: 26px; height: 26px; flex: 0 0 auto; border: 1px solid rgba(37, 34, 56, 0.24); border-radius: 9px; background: white; color: transparent; font-size: 15px; font-weight: 900; transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease; }
.contact-consent input:checked + .checkmark { background: var(--ink); color: white; transform: scale(1.04); }
.contact-consent input:focus-visible + .checkmark { box-shadow: 0 0 0 3px rgba(232, 101, 77, 0.28); }
.contact-consent strong { display: block; color: var(--ink); }
.contact-consent small { display: block; margin-top: 4px; color: rgba(37, 34, 56, 0.56); font-size: 11px; line-height: 1.55; }
.contact-consent a { color: var(--ink); font-weight: 700; }
.save-status { min-height: 19px; margin: 8px auto 0; color: rgba(37, 34, 56, 0.6); font-size: 12px; text-align: center; }
.save-status.success { color: #317254; }
.save-status.failure { color: #a23f31; }
.submit-wrap { display: flex; flex-direction: column; align-items: center; margin-top: 28px; }
.submit-wrap p { margin: 12px 0 0; color: rgba(37, 34, 56, 0.43); font-size: 12px; text-align: center; }
.submit-wrap .sharing-note { max-width: 650px; line-height: 1.55; }
.sharing-note a { color: var(--ink); font-weight: 700; }
.primary, .secondary, .reset-button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; border: 0; border-radius: 999px; font-weight: 700; transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease; }
.primary { min-height: 48px; background: var(--ink); color: var(--cream); padding: 12px 22px; }
.primary:hover { background: var(--coral); }
.submit-button { min-height: 56px; padding-inline: 32px; font-size: 16px; box-shadow: 0 12px 35px rgba(37, 34, 56, 0.18); }
.result-section { border-top: 1px solid rgba(37, 34, 56, 0.1); background: rgba(255, 255, 255, 0.46); padding-block: 72px; }
.result-title { max-width: 780px; margin: 12px 0 0; font-size: clamp(38px, 6vw, 60px); line-height: 1.02; letter-spacing: -0.04em; }
.result-formula { justify-content: flex-start; margin-top: 30px; border: 1px solid rgba(37, 34, 56, 0.1); border-radius: 24px; background: rgba(255, 255, 255, 0.76); padding: 26px; font-weight: 600; }
.result-formula span { color: rgba(37, 34, 56, 0.74); overflow-wrap: anywhere; }
.ai-panel { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: 20px; margin-top: 32px; border: 1px solid rgba(37, 34, 56, 0.1); border-radius: 32px; background: rgba(217, 208, 244, 0.56); padding: 32px; }
.ai-intro { display: flex; flex-direction: column; justify-content: space-between; }
.ai-intro .card-label { margin-top: 24px; color: rgba(37, 34, 56, 0.48); }
.ai-intro h3 { margin: 8px 0 0; font-size: 30px; line-height: 1.1; letter-spacing: -0.035em; }
.ai-intro p:not(.card-label) { margin: 16px 0 0; color: rgba(37, 34, 56, 0.66); font-size: 14px; line-height: 1.7; }
.actions { display: flex; flex-direction: column; gap: 10px; margin-top: 28px; }
.secondary { min-height: 42px; background: transparent; color: rgba(37, 34, 56, 0.62); padding: 8px 16px; font-size: 14px; }
.secondary:hover { background: rgba(255, 255, 255, 0.5); }
.prompt-card { border: 1px solid rgba(37, 34, 56, 0.1); border-radius: 22px; background: rgba(255, 255, 255, 0.72); padding: 20px; }
.prompt-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; color: rgba(37, 34, 56, 0.46); font-size: 12px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; }
.copied-badge { border-radius: 999px; background: var(--mint); padding: 5px 12px; color: var(--ink); font-size: 12px; letter-spacing: 0; text-transform: none; }
#prepared-prompt { min-height: 385px; border: 0; border-radius: 0; background: transparent; padding: 0; resize: none; color: rgba(37, 34, 56, 0.74); font-size: 14px; line-height: 1.72; box-shadow: none; }
.footer-note { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px; margin-top: 32px; border-radius: 16px; background: var(--ink); padding: 20px 28px; color: var(--cream); }
.footer-note strong { display: block; }
.footer-note p { margin: 5px 0 0; color: rgba(248, 244, 236, 0.62); font-size: 14px; }
.reset-button { min-height: 40px; background: var(--cream); color: var(--ink); padding: 10px 20px; }
.reset-button:hover { background: var(--coral); color: white; }
[hidden] { display: none !important; }

@media (max-width: 900px) {
  .input-grid { grid-template-columns: 1fr; }
  .card-copy { min-height: 0; }
  .ai-panel { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .wrap { width: min(100% - 32px, 1152px); }
  .hero { padding-block: 28px 36px; }
  .hero h1 { font-size: clamp(40px, 12vw, 56px); }
  .hero-copy { font-size: 15px; line-height: 1.6; }
  .mini-formula { gap: 6px; font-size: 12px; }
  .mini-formula span { padding: 7px 10px; }
  .form-section { padding-bottom: 64px; }
  .input-card { border-radius: 24px; padding: 20px; box-shadow: 0 12px 30px rgba(37, 34, 56, 0.06); }
  .input-card textarea { min-height: 140px; }
  .contact-card { padding: 20px; }
  .contact-fields { padding: 18px; }
  .contact-fields input { min-height: 62px; padding: 16px 17px; }
  .submit-button { width: 100%; padding-inline: 18px; }
  .result-section { padding-block: 56px; }
  .result-formula { gap: 7px; padding: 16px; font-size: 12px; }
  .result-formula span { max-width: 100%; padding: 8px 11px; }
  .ai-panel { border-radius: 28px; padding: 20px; }
  #prepared-prompt { min-height: 320px; }
  .footer-note { padding: 20px; }
  .reset-button { width: 100%; }
}

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