/* ===== Google Ads Preview Tool ===== */
.tool-page .header { position: sticky; }
.tool-page svg { flex: none; }
.tool-page [hidden] { display: none !important; }
.tool-hero { padding: 60px 0 36px; text-align: center; background: radial-gradient(circle at 85% 10%, rgba(111,45,189,.14), transparent 45%), var(--brand-tint); border-bottom: 1px solid var(--line); }
.tool-hero h1 { font-size: clamp(2rem, 4.6vw, 2.9rem); }
.tool-lead { max-width: 640px; margin: 12px auto 0; font-size: 1.02rem; }
.cat-tabs { display: inline-flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 26px; padding: 5px; background: var(--white); border: 1px solid var(--line); border-radius: 14px; }
.cat-tab { font: inherit; font-size: .9rem; font-weight: 500; border: 0; background: none; padding: 8px 16px; border-radius: 10px; color: var(--text); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.cat-tab.active { background: var(--brand); color: #fff; }
.cat-tab:disabled { cursor: not-allowed; color: var(--muted); }
.cat-tab em { font-style: normal; font-size: .66rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; background: var(--brand-soft); color: var(--brand); padding: 1px 7px; border-radius: 999px; }

.tool-body { padding: 44px 0 90px; }
.tool-grid { display: grid; gap: 44px; }
.tool-form { max-width: 860px; width: 100%; margin: 0 auto; display: grid; gap: 22px; }

.panel { border: 1px solid var(--line); border-radius: 18px; padding: 24px 26px 26px; background: var(--white); min-width: 0; }
.panel legend { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; padding: 0 8px; margin-left: -8px; font-weight: 600; color: var(--ink); font-size: 1.05rem; }
.panel legend small { font-weight: 400; color: var(--muted); font-size: .84rem; }
.step { width: 26px; height: 26px; border-radius: 8px; background: var(--brand); color: #fff; display: grid; place-items: center; font-size: .82rem; font-weight: 700; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 10px; }
.field-list { display: grid; gap: 12px; margin-top: 10px; }
.field { display: grid; gap: 6px; }
.field-top { display: flex; justify-content: space-between; align-items: baseline; font-size: .86rem; font-weight: 500; color: var(--ink); }
.count { font-size: .78rem; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.count.near { color: #B45309; }
.count.full { color: var(--brand); }
.field input {
  font: inherit; font-size: .95rem; width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--brand-tint); color: var(--ink); transition: border-color .2s, box-shadow .2s;
}
.field input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); background: #fff; }
.field input.invalid { border-color: #DC2626; }
.field .warn { font-size: .78rem; color: #B45309; }
.field .warn:empty { display: none; }

.hint { display: flex; gap: 8px; align-items: flex-start; margin-top: 14px; font-size: .82rem; color: var(--text); background: var(--brand-tint); border-radius: 10px; padding: 10px 12px; }
.hint svg { width: 16px; height: 16px; margin-top: 2px; fill: none; stroke: var(--brand); stroke-width: 2; stroke-linecap: round; }

.uploads { display: grid; grid-template-columns: 1fr 1fr 2fr; gap: 16px; margin-top: 12px; }
.upload { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.up-title { font-size: .88rem; font-weight: 600; color: var(--ink); }
.up-spec { font-size: .74rem; color: var(--muted); }
.drop { position: relative; display: grid; place-items: center; margin-top: 6px; aspect-ratio: 1; border: 2px dashed #D7C6EF; border-radius: 14px; background: var(--brand-tint); cursor: pointer; overflow: hidden; transition: border-color .2s, background .2s; }
.upload-wide .drop { aspect-ratio: 1.91; }
.drop:hover, .drop.dragover { border-color: var(--brand); background: var(--brand-soft); }
.drop-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: .84rem; font-weight: 500; color: var(--brand); text-align: center; padding: 8px; }
.drop-empty svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.drop img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.upload[data-slot="logo"] .drop img { object-fit: contain; padding: 10px; background: #fff; }
.drop.has-img { border-style: solid; border-color: var(--line); }
.remove { align-self: flex-start; display: inline-flex; align-items: center; gap: 4px; font: inherit; font-size: .78rem; font-weight: 500; color: var(--text); background: none; border: 0; cursor: pointer; padding: 4px 0; }
.remove:hover { color: #DC2626; }
.remove svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.up-msg { font-size: .76rem; line-height: 1.4; }
.up-msg.ok { color: #15803D; }
.up-msg.warn { color: #B45309; }
.up-msg.err { color: #DC2626; }

.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.actions .btn svg, .preview-head .btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

/* ===== Previews ===== */
.preview { scroll-margin-top: 90px; }
.preview-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.preview-head h2 { margin-bottom: 4px; }
.format-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 22px 0 26px; }
.format-tab { font: inherit; font-size: .86rem; font-weight: 500; padding: 7px 16px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--ink); cursor: pointer; transition: all .2s; }
.format-tab:hover { border-color: var(--brand); color: var(--brand); }
.format-tab.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.ads-grid { columns: 3 320px; column-gap: 22px; }
.ad-wrap { break-inside: avoid; margin-bottom: 22px; }
.ad-label { display: flex; justify-content: space-between; font-size: .74rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.ad { background: #fff; border: 1px solid #E5E7EB; border-radius: 14px; overflow: hidden; box-shadow: 0 6px 20px rgba(17,24,39,.06); font-family: Roboto, Arial, "Helvetica Neue", sans-serif; color: #202124; line-height: 1.4; }
.ad img { display: block; }
.ad .ph { background: repeating-linear-gradient(45deg, #EEF0F3 0 10px, #F6F7F9 10px 20px); display: grid; place-items: center; color: #9AA0A6; font-size: 12px; }
.ad-logo { width: 28px; height: 28px; border-radius: 50%; object-fit: contain; background: #fff; border: 1px solid #E8EAED; flex: none; }
.ad-logo.ph { font-size: 11px; font-weight: 700; color: #fff; background: #6F2DBD; border: 0; }
.spons { font-size: 12px; font-weight: 700; color: #202124; }
.muted { color: #5F6368; font-size: 12px; }
.cta { display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 500; border-radius: 999px; padding: 7px 16px; }

/* Search */
.ad-search { padding: 16px 18px; }
.ad-search .src { display: flex; align-items: center; gap: 10px; }
.ad-search .src-txt { display: flex; flex-direction: column; min-width: 0; }
.ad-search .src-name { font-size: 14px; color: #202124; }
.ad-search .src-url { font-size: 12px; color: #4D5156; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ad-search h3 { font-family: inherit; color: #1A0DAB; font-size: 18px; font-weight: 400; line-height: 1.3; margin: 10px 0 4px; }
.ad-search p { font-size: 14px; color: #4D5156; }

/* Display landscape */
.ad-display .media { aspect-ratio: 1.91; width: 100%; object-fit: cover; }
.ad-display .body { padding: 14px 16px 16px; }
.ad-display h3 { font-family: inherit; font-size: 17px; font-weight: 500; line-height: 1.3; }
.ad-display p { font-size: 13px; color: #5F6368; margin-top: 6px; }
.ad-display .foot { display: flex; align-items: center; gap: 8px; margin-top: 14px; }
.ad-display .foot .muted { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ad-display .cta { background: #1A73E8; color: #fff; }

/* Display square / native */
.ad-native { display: grid; grid-template-columns: 112px 1fr; }
.ad-native .media { width: 112px; height: 100%; min-height: 112px; aspect-ratio: 1; object-fit: cover; }
.ad-native .body { padding: 12px 14px; min-width: 0; }
.ad-native h3 { font-family: inherit; font-size: 15px; font-weight: 500; line-height: 1.3; }
.ad-native p { font-size: 12.5px; color: #5F6368; margin-top: 4px; }
.ad-native .muted { display: block; margin-top: 8px; }

/* YouTube */
.ad-yt .media { aspect-ratio: 16/9; width: 100%; object-fit: cover; }
.ad-yt .body { display: flex; gap: 12px; padding: 12px 14px 14px; }
.ad-yt .ad-logo { width: 36px; height: 36px; }
.ad-yt h3 { font-family: inherit; font-size: 15px; font-weight: 500; line-height: 1.35; }
.ad-yt .yt-meta { font-size: 12px; color: #606060; margin-top: 4px; }
.ad-yt .cta { margin: 0 14px 14px; display: flex; background: #065FD4; color: #fff; }

/* Gmail */
.ad-gmail .row { display: flex; gap: 12px; padding: 14px 16px; align-items: flex-start; }
.ad-gmail .ad-logo { width: 40px; height: 40px; }
.ad-gmail .txt { min-width: 0; flex: 1; }
.ad-gmail .top { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 700; }
.ad-gmail .gm-badge { font-size: 11px; font-weight: 700; color: #202124; border: 1px solid #DADCE0; border-radius: 4px; padding: 0 4px; }
.ad-gmail h3 { font-family: inherit; font-size: 14px; font-weight: 700; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ad-gmail p { font-size: 13px; color: #5F6368; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ad-gmail .open { border-top: 1px solid #F1F3F4; }
.ad-gmail .open .media { aspect-ratio: 1.91; width: 100%; object-fit: cover; }
.ad-gmail .open .body { padding: 12px 16px 16px; }
.ad-gmail .open p { white-space: normal; }
.ad-gmail .cta { background: #1A73E8; color: #fff; margin-top: 12px; }

/* Discover */
.ad-discover .media { aspect-ratio: 1.91; width: 100%; object-fit: cover; }
.ad-discover .body { padding: 12px 16px 16px; }
.ad-discover .src { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #5F6368; }
.ad-discover .ad-logo { width: 20px; height: 20px; }
.ad-discover h3 { font-family: inherit; font-size: 17px; font-weight: 500; line-height: 1.35; margin-top: 8px; }
.ad-discover .cta { margin-top: 12px; background: #E8F0FE; color: #1967D2; }

.preview-note { text-align: center; font-size: .82rem; color: var(--muted); margin-top: 8px; }

@media (max-width: 760px) {
  .two-col { grid-template-columns: 1fr; }
  .uploads { grid-template-columns: 1fr 1fr; }
  .upload-wide { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
  .tool-hero { padding: 44px 0 28px; }
  .panel { padding: 18px 16px 20px; }
  .actions .btn { flex: 1; }
  .ads-grid { columns: 1; }
}

.field-long { margin-top: 18px; padding-top: 18px; border-top: 1px dashed var(--line); }
.tag-rec { font-style: normal; font-size: .66rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; background: var(--brand-soft); color: var(--brand); padding: 1px 7px; border-radius: 999px; margin-left: 6px; vertical-align: 2px; }
.ad-gmail .open h3.gm-long { white-space: normal; font-size: 15px; margin: 0 0 6px; }

/* Over-limit and checklist */
.count.over { color: #DC2626; }
.field input.over { border-color: #F87171; background: #FEF2F2; }
.field .warn { color: #B45309; }
.checklist { border-radius: 16px; padding: 18px 20px; margin: 0 0 26px; border: 1px solid; }
.checklist.has-req { background: #FEF2F2; border-color: #FECACA; }
.checklist.has-rec { background: #FFFBEB; border-color: #FDE68A; }
.checklist.has-demo { background: var(--brand-tint); border-color: var(--line); }
.checklist.ok { background: #F0FDF4; border-color: #BBF7D0; }
.cl-head { font-weight: 600; color: var(--ink); }
.checklist.ok .cl-head { color: #15803D; }
.checklist ul { list-style: none; display: grid; gap: 8px; margin-top: 12px; }
.checklist li { display: flex; align-items: flex-start; gap: 10px; font-size: .88rem; color: var(--ink); line-height: 1.5; }
.cl-tag { flex: none; font-size: .66rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: 2px 8px; border-radius: 999px; margin-top: 2px; min-width: 112px; text-align: center; }
.cl-req .cl-tag { background: #FEE2E2; color: #B91C1C; }
.cl-rec .cl-tag { background: #FEF3C7; color: #92400E; }
.cl-demo .cl-tag { background: var(--brand-soft); color: var(--brand); }
@media (max-width: 600px) { .checklist li { flex-direction: column; gap: 4px; } .cl-tag { min-width: 0; } }
