/* The free ad writer (views/site/pages/free-ad-writer.php, js/adwriter.js) */
.aw section.block { padding-block: 96px 0; }
.aw section.block:last-child { padding-bottom: 96px; }

/* hero */
.aw-hero { padding-block: 36px 0; background: radial-gradient(900px 360px at 85% -10%, var(--accent-soft), transparent 70%); }
.aw-hero .wrap { display: grid; gap: 14px; justify-items: start; }
.aw-crumbs { display: flex; flex-wrap: wrap; gap: 8px; font-size: 14px; color: var(--ink-muted); }
.aw-crumbs a { color: inherit; text-decoration: none; }
.aw-crumbs a:hover { color: var(--ink); }
.aw-hero h1 { font-size: clamp(36px, 5vw, 60px); font-weight: 800; letter-spacing: -.045em; line-height: 1.03; max-width: 18ch; }
.aw-hero .lead { max-width: 62ch; }
.aw-trust { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 2px 0 0; padding: 0; list-style: none; }
.aw-trust li { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-muted); font: 500 14px/1.3 var(--body); }
.aw-trust li::before { content: ""; width: 18px; height: 18px; border-radius: 50%; background: var(--success-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 6.2l2.3 2.3 4.7-5' fill='none' stroke='%23157347' stroke-width='1.8'/%3E%3C/svg%3E") center/11px no-repeat; flex: none; }

/* the tool: form left, results right */
.aw-tool-wrap { padding-top: 28px; }
.aw-tool { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); box-shadow: var(--shadow-lg); overflow: clip; }
.aw-form { display: grid; gap: 22px; padding: 30px; align-content: start; }
/* the form stays in view next to a long result (it scrolls inside itself on short screens) */
@media (min-width: 961px) { .aw-tool.has-result .aw-form { position: sticky; top: 76px; align-self: start; max-height: calc(100vh - 92px); overflow-y: auto; scrollbar-width: thin; } }
.aw-field { position: relative; display: grid; gap: 10px; margin: 0; padding: 0; border: 0; min-width: 0; }
.aw-text-count { position: absolute; top: 4px; inset-inline-end: 0; font: 500 12px/1 var(--mono); color: var(--ink-faint); }
.aw-text-count.is-near { color: var(--warning); }
.aw-label { display: flex; align-items: center; gap: 10px; font: 600 16px/1.3 var(--body); color: var(--ink); padding: 0; }
.aw-label em { font-style: normal; font-weight: 400; font-size: 13px; color: var(--ink-faint); }
.aw-num { width: 24px; height: 24px; flex: none; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font: 700 12px/24px var(--body); text-align: center; }

.aw-form textarea, .aw-form input:not([type=checkbox]):not([type=file]), .aw-form select,
.aw-out-title, .aw-out-desc, .aw-q input {
  width: 100%; box-sizing: border-box; font: 400 15px/1.5 var(--body); color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-md); padding: 11px 13px; transition: border-color .15s, box-shadow .15s;
}
.aw-form textarea { resize: vertical; min-height: 110px; }
.aw-form select { appearance: none; padding-inline-end: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%235B6472' stroke-width='1.6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 13px center; }
[dir=rtl] .aw-form select { background-position: left 13px center; }
.aw-form textarea:focus, .aw-form input:focus, .aw-form select:focus, .aw-out-title:focus, .aw-out-desc:focus, .aw-q input:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }

.aw-examples { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-faint); }
.aw-examples button { font: 500 13px/1 var(--body); color: var(--accent); background: var(--accent-soft); border: 0; border-radius: var(--r-pill); padding: 7px 11px; cursor: pointer; }
.aw-examples button:hover { background: #E1E8FF; }

.aw-drop { display: block; cursor: pointer; border: 1.5px dashed var(--line-strong); border-radius: var(--r-lg); background: var(--ground); transition: border-color .15s, background .15s; }
.aw-drop:hover, .aw-drop.is-over { border-color: var(--accent); background: var(--accent-soft); }
.aw-drop-empty { display: grid; justify-items: center; gap: 4px; padding: 20px; text-align: center; }
.aw-drop-empty svg { width: 30px; height: 30px; color: var(--accent); margin-bottom: 4px; }
.aw-drop-empty b { font-weight: 600; font-size: 15px; }
.aw-drop-empty small { color: var(--ink-muted); font-size: 13px; }
.aw-drop-full { position: relative; display: block; padding: 10px; }
.aw-drop-full img { display: block; max-height: 220px; max-width: 100%; margin: 0 auto; border-radius: var(--r-md); }
.aw-remove { position: absolute; top: 16px; inset-inline-end: 16px; width: 32px; height: 32px; border-radius: 50%; border: 0; background: rgba(14,17,22,.75); color: #fff; font-size: 20px; line-height: 1; cursor: pointer; }

.aw-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.aw-grid label { display: grid; gap: 6px; min-width: 0; }
.aw-grid label > span { font-size: 13px; font-weight: 500; color: var(--ink-muted); }

.aw-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.aw-chip { position: relative; }
.aw-chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.aw-chip span { display: inline-flex; align-items: center; gap: 6px; padding: 8px 13px; border-radius: var(--r-pill); border: 1px solid var(--line); background: var(--surface); font: 500 14px/1.2 var(--body); color: var(--ink); transition: all .15s; }
.aw-chip span::before { content: ""; width: 14px; height: 14px; border-radius: 4px; border: 1.5px solid var(--line-strong); box-sizing: border-box; transition: all .15s; }
.aw-chip input:checked + span { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-hover); }
.aw-chip input:checked + span::before { background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 6.2l2.3 2.3 4.7-5' fill='none' stroke='%23fff' stroke-width='1.8'/%3E%3C/svg%3E") center/10px no-repeat; border-color: var(--accent); }
.aw-chip input:focus-visible + span { box-shadow: var(--ring); }

.aw-more { border-top: 1px solid var(--line); padding-top: 16px; }
.aw-more summary { cursor: pointer; font-weight: 600; font-size: 15px; list-style: none; display: flex; align-items: center; gap: 8px; }
.aw-more summary::-webkit-details-marker { display: none; }
.aw-more summary::before { content: "+"; width: 20px; height: 20px; border-radius: 50%; background: var(--panel); text-align: center; line-height: 20px; font-weight: 600; }
.aw-more[open] summary::before { content: "–"; }
.aw-more summary small { font-weight: 400; color: var(--ink-faint); }
.aw-more .aw-grid { margin-top: 14px; }
.aw-switch { display: flex !important; align-items: center; gap: 10px !important; align-self: end; min-height: 46px; cursor: pointer; }
.aw-switch input { width: 18px; height: 18px; accent-color: var(--accent); }
.aw-switch span { font-size: 15px !important; color: var(--ink) !important; font-weight: 400 !important; }

.aw-go { width: 100%; }
.aw-go svg { width: 20px; height: 20px; }
.aw-go.is-busy { opacity: .7; pointer-events: none; }
.aw-fine { margin: -10px 0 0; text-align: center; font-size: 13px; color: var(--ink-faint); }
.aw-kbd { margin-inline-start: 6px; white-space: nowrap; }
.aw-kbd kbd { font: 500 11px/1 var(--mono); padding: 3px 5px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; background: var(--surface); color: var(--ink-muted); }
@media (hover: none) { .aw-kbd { display: none; } }
.aw-error { margin: 0; padding: 11px 14px; border-radius: var(--r-md); background: var(--warning-soft); color: var(--warning); font-size: 14px; }
#aw-turnstile:empty { display: none; }
#aw-turnstile.is-waiting { padding: 8px; border-radius: 12px; outline: 2px solid var(--accent); outline-offset: 2px; scroll-margin: 96px; }

.aw-flash { animation: aw-flash .6s; }
@keyframes aw-flash { 0%, 100% { transform: none; } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }

/* results */
.aw-out { padding: 30px; background: var(--ground); border-inline-start: 1px solid var(--line); min-height: 520px; display: grid; align-content: start; scroll-margin-top: 80px; }
.aw-empty { display: grid; gap: 18px; }
.aw-tag { justify-self: start; font: 600 11px/1 var(--body); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-faint); background: var(--panel); border-radius: var(--r-pill); padding: 6px 10px; }
.aw-sample { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; display: grid; gap: 10px; opacity: .92; }
.aw-sample b { font-size: 17px; line-height: 1.3; }
.aw-sample p { margin: 0; color: var(--ink-muted); font-size: 14px; }
.aw-sample-tabs { display: flex; gap: 6px; margin-bottom: 4px; }
.aw-sample-tabs span { font-size: 12px; font-weight: 600; padding: 6px 10px; border-radius: var(--r-pill); background: var(--panel); color: var(--ink-muted); }
.aw-sample-tabs span.on { background: var(--ink); color: #fff; }
.aw-sample-price { display: flex; justify-content: space-between; align-items: baseline; border-top: 1px solid var(--line); padding-top: 10px; margin-top: 4px; font-size: 13px; color: var(--ink-muted); }
.aw-sample-price b { color: var(--success); font-size: 18px; }
.aw-gets { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.aw-gets li { position: relative; padding-inline-start: 26px; color: var(--ink-muted); font-size: 15px; }
.aw-gets li::before { content: ""; position: absolute; inset-inline-start: 0; top: 4px; width: 16px; height: 16px; border-radius: 50%; background: var(--success-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 6.2l2.3 2.3 4.7-5' fill='none' stroke='%23157347' stroke-width='1.8'/%3E%3C/svg%3E") center/10px no-repeat; }

.aw-busy { display: grid; gap: 14px; align-content: start; }
.aw-busy-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.aw-busy-head b { font-size: 16px; }
.aw-busy-head small { color: var(--ink-faint); font-size: 13px; white-space: nowrap; }
.aw-bar { height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; }
.aw-bar span { display: block; height: 100%; width: 0; border-radius: 4px; background: var(--accent); }
.aw-skel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; display: grid; gap: 12px; }
.aw-skel i { display: block; height: 12px; border-radius: 6px; background: linear-gradient(90deg, var(--panel) 25%, #E9ECF2 50%, var(--panel) 75%); background-size: 200% 100%; animation: aw-shimmer 1.4s linear infinite; }
.aw-skel-tabs { display: flex; gap: 6px; margin-bottom: 4px; }
.aw-skel-tabs i { width: 90px; height: 26px; border-radius: 13px; }
.aw-skel .w40 { width: 40%; } .aw-skel .w60 { width: 60%; height: 18px; } .aw-skel .w70 { width: 70%; } .aw-skel .w80 { width: 80%; } .aw-skel .w90 { width: 90%; }
.aw-skel-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@keyframes aw-shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .aw-skel i { animation: none; } .aw-flash { animation: none; } .aw-result { animation: none; } }

.aw-result { display: grid; gap: 18px; animation: aw-in .35s ease-out; }
@keyframes aw-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.aw-read { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.aw-read p { margin: 0; font-size: 15px; color: var(--ink-muted); }
.aw-redo { flex: none; display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: 600 13px/1 var(--body); padding: 8px 12px; border-radius: var(--r-pill); cursor: pointer; }
.aw-redo::before { content: "↻"; font-size: 15px; color: var(--accent); }
.aw-redo:hover { border-color: var(--accent); color: var(--accent); }
.aw-read b { color: var(--ink); }
.aw-read small { display: block; margin-top: 4px; color: var(--warning); font-size: 13px; }

.aw-ads { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.aw-tabs { display: flex; gap: 4px; padding: 8px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.aw-tab { flex: none; border: 0; background: transparent; padding: 9px 13px; border-radius: var(--r-pill); font: 600 13px/1 var(--body); color: var(--ink-muted); cursor: pointer; }
.aw-tab:hover { background: var(--panel); color: var(--ink); }
.aw-tab.is-on { background: var(--ink); color: #fff; }
.aw-pane { padding: 18px; display: grid; gap: 16px; }
.aw-out-field { display: grid; gap: 7px; }
.aw-out-label { display: flex; align-items: center; gap: 10px; font: 600 12px/1 var(--body); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-faint); }
.aw-out-label > span:first-child { flex: 1; }
.aw-count { font: 500 12px/1 var(--mono); letter-spacing: 0; text-transform: none; color: var(--ink-faint); }
.aw-count.is-over { color: #B42318; font-weight: 600; }
.aw-out-title { font-weight: 600 !important; font-size: 16px !important; resize: none; overflow: hidden; line-height: 1.4 !important; }
.aw-out-desc { resize: vertical; min-height: 160px; overflow: hidden; }
.aw-copy { border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: 600 12px/1 var(--body); letter-spacing: 0; text-transform: none; padding: 7px 11px; border-radius: var(--r-pill); cursor: pointer; transition: all .15s; }
.aw-copy:hover { border-color: var(--accent); color: var(--accent); }
.aw-copy.is-done { background: var(--success-soft); border-color: var(--success-soft); color: var(--success); }
.aw-pane-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.aw-post { font: 600 13px/1.2 var(--body); color: var(--accent); text-decoration: none; padding: 6px 0; }
.aw-post:hover { text-decoration: underline; }
.aw-copy-main { margin-inline-start: auto; background: var(--accent); border-color: var(--accent); color: #fff; padding: 10px 16px; font-size: 13px; }
.aw-copy-main:hover { background: var(--accent-hover); color: #fff; }
.aw-copy-main.is-done { background: var(--success); border-color: var(--success); color: #fff; }

.aw-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; display: grid; gap: 10px; align-content: start; }
.aw-card h3 { font: 600 15px/1.3 var(--body); letter-spacing: 0; }
.aw-card p { margin: 0; font-size: 14px; color: var(--ink-muted); }
.aw-card small { color: var(--ink-faint); font-size: 12px; }
.aw-sub { margin-top: -4px !important; }
.aw-better { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.aw-q { display: grid; gap: 6px; }
.aw-q span { font-size: 14px; font-weight: 500; }
.aw-q input { padding: 9px 12px; font-size: 14px; }
.aw-refine { justify-self: start; min-height: 42px; font-size: 14px; }

.aw-help { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.aw-price-n { font: 700 28px/1.1 var(--display); color: var(--success); letter-spacing: -.02em; }
.aw-quote { padding: 10px 12px; background: var(--panel); border-radius: var(--r-md); color: var(--ink) !important; }
.aw-card .aw-copy { justify-self: start; }
.aw-check { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.aw-check label { display: flex; gap: 9px; align-items: flex-start; font-size: 14px; color: var(--ink-muted); cursor: pointer; }
.aw-check input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--success); flex: none; }
.aw-check input:checked + span { text-decoration: line-through; color: var(--ink-faint); }
.aw-faq-item { display: grid; gap: 2px; }
.aw-faq-item b { font-size: 14px; }
.aw-safe { grid-column: 1 / -1; }
.aw-safe ul { margin: 0; padding-inline-start: 18px; display: grid; gap: 6px; font-size: 14px; color: var(--ink-muted); }

.aw-cta { display: flex; align-items: center; gap: 16px; justify-content: space-between; padding: 18px 20px; border-radius: var(--r-lg); background: var(--hero); color: var(--on-hero); }
.aw-cta div { display: grid; gap: 3px; }
.aw-cta b { font: 700 18px/1.25 var(--display); letter-spacing: -.02em; }
.aw-cta span { color: var(--on-hero-muted); font-size: 14px; }
.aw-cta .btn { flex: none; min-height: 44px; }
.aw-again { justify-self: center; border: 0; background: none; color: var(--accent); font: 600 14px/1 var(--body); cursor: pointer; padding: 10px; }
.aw-again:hover { text-decoration: underline; }
.aw-refusal { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px; display: grid; gap: 6px; }
.aw-refusal p { margin: 0; color: var(--ink-muted); }

/* sections below the tool */
.aw-steps { margin: 0; padding: 0; list-style: none; counter-reset: s; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.aw-steps li { counter-increment: s; display: grid; gap: 8px; align-content: start; padding: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); }
.aw-steps li::before { content: counter(s); width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: #fff; font: 700 15px/34px var(--body); text-align: center; margin-bottom: 4px; }
.aw-steps b { font: 700 20px/1.2 var(--display); letter-spacing: -.02em; }
.aw-steps span { color: var(--ink-muted); font-size: 15px; }
.aw-tips { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.aw-tips .card h3 { font-size: 19px; }

.aw-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.aw-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.aw-table th, .aw-table td { text-align: start; padding: 14px 18px; border-bottom: 1px solid var(--line); vertical-align: top; }
.aw-table th { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-faint); background: var(--ground); }
.aw-table tr:last-child td { border-bottom: 0; }
.aw-table td:first-child { font-weight: 600; white-space: nowrap; }
.aw-table td:nth-child(2) { white-space: nowrap; }
.aw-table td:last-child { color: var(--ink-muted); }
.aw-note { margin: 12px 0 0; font-size: 13px; color: var(--ink-faint); }

.aw-faq { display: grid; gap: 10px; max-width: 820px; }
.aw-faq details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px 20px; }
.aw-faq summary { cursor: pointer; font-weight: 600; font-size: 17px; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.aw-faq summary::-webkit-details-marker { display: none; }
.aw-faq summary::after { content: "+"; color: var(--accent); font-size: 22px; line-height: 1; }
.aw-faq details[open] summary::after { content: "–"; }
.aw-faq p { margin: 10px 0 0; color: var(--ink-muted); }

.aw-band { display: grid; grid-template-columns: minmax(0, 1.4fr) auto; gap: 32px; align-items: center; padding: 44px; border-radius: var(--r-xl); background: var(--hero); color: var(--on-hero); }
.aw-band .eyebrow { color: #9DB4FF; }
.aw-band h2 { font-size: clamp(28px, 3.4vw, 40px); margin: 10px 0 12px; }
.aw-band p { margin: 0; color: var(--on-hero-muted); max-width: 60ch; }
.aw-band-cta { display: grid; gap: 10px; }
.aw-band .btn-ghost { color: #fff; border-color: rgba(255,255,255,.25); }
.aw-band .btn-ghost:hover { background: rgba(255,255,255,.08); }

@media (max-width: 960px) {
  .aw-tool { grid-template-columns: 1fr; }
  .aw-out { border-inline-start: 0; border-top: 1px solid var(--line); }
  .aw-out { min-height: 0; }
  .aw-steps, .aw-tips { grid-template-columns: 1fr; }
  .aw-band { grid-template-columns: 1fr; padding: 30px; }
}
@media (max-width: 560px) {
  .aw section.block { padding-top: 64px; }
  .aw-form, .aw-out { padding: 20px 16px; }
  .aw-grid, .aw-help, .aw-skel-row { grid-template-columns: 1fr; }
  .aw-read { flex-direction: column; }
  .aw-copy-main { width: 100%; padding: 13px 16px; font-size: 14px; }
  .aw-pane-foot { flex-direction: column-reverse; align-items: stretch; text-align: center; }
  .aw-cta { flex-direction: column; align-items: stretch; text-align: start; }
  .aw-tool-wrap .wrap { padding-inline: 12px; }
  .aw-table td:nth-child(2) { white-space: normal; }
}
