* { margin:0; padding:0; box-sizing:border-box; }
body { font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif; color:#111827; background:#ffffff; line-height:1.6; }
.shell { max-width:900px; margin:0 auto; padding:0 24px; }
header { display:flex; justify-content:space-between; align-items:center; padding:20px 0; border-bottom:1px solid #f3f4f6; }
.logo { font-weight:700; font-size:20px; letter-spacing:-0.02em; }
.logo span { color:#6366f1; }
nav a { margin-left:24px; color:#374151; text-decoration:none; font-size:14px; }
.hero { padding:64px 0 40px; text-align:center; }
h1 { font-size:42px; line-height:1.15; letter-spacing:-0.03em; font-weight:800; }
.grad { background:linear-gradient(90deg,#6366f1,#8b5cf6); -webkit-background-clip:text; -webkit-text-fill-color:transparent; }
.sub { font-size:18px; color:#4b5563; max-width:620px; margin:20px auto 0; }
.gen-form { margin-top:36px; display:flex; flex-direction:column; gap:12px; max-width:520px; margin-left:auto; margin-right:auto; text-align:left; }
.gen-form input, .gen-form textarea { padding:12px 16px; border:1px solid #d1d5db; border-radius:8px; font-size:15px; font-family:inherit; resize:vertical; }
.gen-form input:focus, .gen-form textarea:focus { outline:none; border-color:#6366f1; }
.gen-form button { padding:14px; background:#4f46e5; color:#fff; border:none; border-radius:8px; font-size:16px; font-weight:600; cursor:pointer; }
.gen-form button:disabled { background:#c7d2fe; cursor:not-allowed; }
.tiny { margin-top:14px; font-size:13px; color:#6b7280; text-align:center; }
.status { margin-top:10px; font-size:14px; color:#b45309; min-height:20px; }
.status.upgrade { color:#4338ca; font-weight:600; }

.results { margin-top:32px; padding-bottom:64px; }
.results.visible {
  margin-top: 24px;
  padding: 20px 22px;
  border: 2px solid #c7d2fe;
  border-radius: 14px;
  background: linear-gradient(180deg, #f5f3ff 0%, #ffffff 50%);
  box-shadow: 0 6px 24px rgba(99, 102, 241, 0.12);
}
.results-label {
  font-size: 12px;
  font-weight: 600;
  color: #4338ca;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 10px;
}
/* Brand trailer: visible (so users see the name and remember it) but NOT
   selectable/copyable - pasting the result must never drag the ad line along. */
.result-brand {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px dashed #e0e7ff;
  font-size: 11.5px;
  color: #94a3b8;
  text-align: center;
  letter-spacing: 0.01em;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}
html[dir="rtl"] .result-brand { text-align: center; }
html { scroll-behavior: smooth; }
/* Hint shown when the humanize engine determines input was already natural. */
.humanize-hint {
  margin-top: 8px;
  color: #4338ca;
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12.5px;
}
.hidden { display: none; }
.results-head { display:flex; justify-content:space-between; align-items:center; gap:12px; border-bottom:1px solid #e5e7eb; padding-bottom:8px; }
.tabs { display:flex; gap:8px; flex-wrap:wrap; }
.tab { padding:8px 16px; border:1px solid #e5e7eb; background:#fff; border-radius:8px; cursor:pointer; font-size:14px; color:#374151; }
.tab.active { background:#4f46e5; color:#fff; border-color:#4f46e5; }
.copy-btn { padding:8px 16px; border:1px solid #d1d5db; background:#fff; border-radius:8px; cursor:pointer; font-size:14px; }
.copy-btn:hover { background:#f9fafb; }
.result-body { margin-top:20px; }
.result-body h1, .result-body h2, .result-body h3 { margin:18px 0 8px; letter-spacing:-0.01em; }
.result-body h1 { font-size:22px; }
.result-body h2 { font-size:18px; }
.result-body h3 { font-size:15px; color:#374151; }
.result-body p { margin:8px 0; }
.result-body ul { margin:8px 0 8px 22px; }
.result-body li { margin:4px 0; }
.footer { max-width:900px; margin:0 auto; padding:24px; border-top:1px solid #f3f4f6; display:flex; gap:20px; align-items:center; justify-content:center; font-size:13px; color:#6b7280; }
.footer a { color:#6b7280; text-decoration:none; }
.footer a:hover { color:#4f46e5; }
.footer-note { color:#9ca3af; font-size:11.5px; flex-basis:100%; text-align:center; }

/* Beta tester badge */
.beta-badge {
  background: #eef2ff;
  color: #4338ca;
  border: 1px solid #c7d2fe;
  border-radius: 999px;
  padding: 6px 14px;
  margin: 12px auto 0;
  width: fit-content;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
}

/* --- Mode switch (Write launch copy / Remove AI voice) --- */
.mode-switch {
  display: flex;
  gap: 10px;
  margin: 22px 0 18px;
  flex-wrap: wrap;
}
.mode-btn {
  flex: 1 1 220px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 12px 16px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  color: #0f172a;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: border-color .15s, background .15s;
}
.mode-btn:hover { border-color: #c7d2fe; }
.mode-btn.active {
  border-color: #6366f1;
  background: #eef2ff;
}
.mode-hint {
  font-size: 12.5px;
  font-weight: 400;
  color: #64748b;
  line-height: 1.4;
}
.mode-btn.active .mode-hint { color: #4338ca; }
.mode-panel.hidden { display: none; }

/* Humanize output: plain text, preserve line breaks and paragraphs */
pre.humanized {
  white-space: pre-wrap;
  word-wrap: break-word;
  font-family: inherit;
  font-size: 15px;
  line-height: 1.75;
  color: #0f172a;
  margin: 0;
}

/* --- Three-mode switch, written in plain words (no jargon) --- */
.mode-switch {
  display: flex;
  gap: 10px;
  margin: 22px 0 18px;
  flex-wrap: wrap;
}
.mode-btn {
  flex: 1 1 190px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  padding: 13px 15px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  text-align: left;
  transition: border-color .15s, background .15s;
}
.mode-btn:hover { border-color: #c7d2fe; }
.mode-btn.active { border-color: #6366f1; background: #eef2ff; }
.mode-name {
  font-size: 14.5px;
  font-weight: 500;
  color: #0f172a;
  line-height: 1.3;
}
.mode-plain {
  font-size: 12.5px;
  color: #475569;
  line-height: 1.45;
}
.mode-for {
  font-size: 11.5px;
  color: #94a3b8;
  line-height: 1.4;
  margin-top: 2px;
}
.mode-btn.active .mode-name { color: #3730a3; }
.mode-btn.active .mode-plain { color: #4338ca; }
.mode-btn.active .mode-for { color: #6366f1; }
.mode-panel.hidden { display: none; }

/* --- UI language switch (dropdown of 13 languages) --- */
.ui-lang {
  display: inline-flex;
  align-items: center;
  margin-left: 10px;
}
.ui-lang-sel {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 12.5px;
  color: #0f172a;
  background: #fff;
  cursor: pointer;
  max-width: 110px;
}
.ui-lang-sel:hover { border-color: #c7d2fe; }
.ui-lang-sel:focus { outline: none; border-color: #6366f1; }

/* --- Output language row --- */
.lang-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  flex-wrap: wrap;
}
.lang-row label { font-size: 13px; color: #475569; }
.lang-row select {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 13px;
  color: #0f172a;
  background: #fff;
  cursor: pointer;
}

/* Character counter: users must see the limit BEFORE submitting, not after
   waiting 20s for an English server error. */
.char-count {
  font-size: 12px;
  color: #94a3b8;
  text-align: right;
  margin-top: -6px;
}
.char-count.warn { color: #b45309; }
.char-count.over { color: #dc2626; font-weight: 600; }
/* Remaining free uses - shown so users never hit a surprise 402. */
.quota-left {
  font-size: 12.5px;
  color: #64748b;
  background: #f1f5f9;
  border-radius: 999px;
  padding: 3px 10px;
}
.quota-left.low { color: #b45309; background: #fef3c7; }

/* --- RTL languages (Arabic): right-to-left text flow --- */
[dir="rtl"] {
  text-align: right;
  direction: rtl;
}
/* UI-level RTL: mirror forms, nav and pricing when the whole interface is RTL */
html[dir="rtl"] .gen-form { text-align: right; }
html[dir="rtl"] .mode-btn,
html[dir="rtl"] .plan { text-align: right; }
html[dir="rtl"] .plan ul { padding-left: 0; padding-right: 18px; }
html[dir="rtl"] .lang-row,
html[dir="rtl"] .results-head { justify-content: flex-end; }
html[dir="rtl"] .result-body h1,
html[dir="rtl"] .result-body h2,
html[dir="rtl"] .result-body h3,
html[dir="rtl"] .result-body ul {
  text-align: right;
}
/* Keep Latin words/numbers inside RTL text readable (bidi isolation). */
[dir="rtl"] bdi { unicode-bidi: isolate; }

/* --- Pricing section (visible plan price, required by Creem review) --- */
.pricing { max-width: 720px; margin: 48px auto; padding: 0 20px; text-align: center; }
.pricing h2 { font-size: 1.6rem; margin-bottom: 24px; }
.plans { display: flex; gap: 20px; justify-content: center; flex-wrap: wrap; }
.plan { flex: 1; min-width: 240px; max-width: 320px; border: 1px solid #ddd; border-radius: 12px; padding: 24px; text-align: left; }
.plan.featured { border: 2px solid #7c3aed; }
.plan h3 { margin: 0 0 8px; }
.plan-price { font-size: 2rem; font-weight: 700; }
.plan-price span { font-size: 1rem; font-weight: 400; color: #666; }
.plan ul { padding-left: 18px; color: #555; margin: 12px 0 0; }
