:root {
  --ink: #17202a;
  --muted: #5f6b76;
  --line: #dfe4e8;
  --soft: #f4f6f8;
  --panel: #ffffff;
  --accent: #1267e9;
  --accent-dark: #0b4eaf;
  --green: #16805a;
  --amber: #9a5b00;
  --danger: #b42318;
  --shadow: 0 16px 45px rgba(25, 35, 45, .12);
  --radius: 8px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--soft); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; line-height: 1.55; letter-spacing: 0; }
button, input, textarea, select { font: inherit; letter-spacing: 0; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: var(--accent-dark); }
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid rgba(18, 103, 233, .35); outline-offset: 2px; }

.site-header { min-height: 86px; padding: 4px 28px; display: flex; align-items: center; justify-content: space-between; gap: 24px; background: #fff; border-bottom: 1px solid var(--line); }
.brand { color: var(--ink); text-decoration: none; display: inline-flex; align-items: center; font-weight: 750; }
.brand-logo { width: 172px; height: auto; display: block; }
.footer-logo { width: 190px; }
.site-header nav, footer nav { display: flex; align-items: center; gap: 22px; }
.site-header nav a, footer nav a { color: #46515c; text-decoration: none; font-size: 14px; font-weight: 650; }
.site-header nav a:hover, footer nav a:hover { color: var(--accent); }

main { width: min(1520px, 100%); margin: 0 auto; }
.tool-intro { padding: 42px clamp(20px, 4vw, 64px) 26px; max-width: 900px; }
.eyebrow, .panel-kicker { margin: 0 0 6px; color: var(--accent-dark); font-size: 12px; font-weight: 800; text-transform: uppercase; }
.tool-intro h1 { margin: 0; font-size: clamp(32px, 5vw, 54px); line-height: 1.08; }
.tool-intro .tool-lede { max-width: 760px; margin: 14px 0 0; color: var(--muted); font-size: 18px; }
.tool-intro .tool-disclaimer { margin-top: 10px; color: #6c7781; font-size: 12px; }

.studio { margin: 0 clamp(14px, 3vw, 44px) 36px; display: grid; grid-template-columns: minmax(320px, 420px) minmax(0, 1fr); min-height: 760px; background: #fff; border: 1px solid #d9dfe4; border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.control-panel { padding: 24px; border-right: 1px solid var(--line); background: #fff; }
.panel-head, .preview-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.panel-head h2, .preview-toolbar h2 { margin: 0; font-size: 20px; line-height: 1.2; }
.quiet-button, .secondary-button, .primary-button, .device-button { min-height: 42px; padding: 9px 14px; border-radius: 6px; cursor: pointer; font-weight: 750; }
.quiet-button, .secondary-button, .device-button { color: #34404c; background: #fff; border: 1px solid #cfd6dc; }
.quiet-button:hover, .secondary-button:hover, .device-button:hover { background: #f1f4f6; }
.primary-button { color: #fff; background: var(--accent); border: 1px solid var(--accent); text-decoration: none; display: inline-grid; place-items: center; }
.primary-button:hover { background: var(--accent-dark); border-color: var(--accent-dark); }

.control-tabs { margin: 22px 0; display: grid; grid-template-columns: repeat(3, 1fr); padding: 4px; background: #eef1f3; border-radius: 7px; }
.control-tabs button { min-height: 40px; border: 0; border-radius: 5px; color: #59636c; background: transparent; font-weight: 700; cursor: pointer; }
.control-tabs button[aria-selected="true"] { color: var(--ink); background: #fff; box-shadow: 0 1px 5px rgba(30, 40, 50, .14); }
.tab-panel { display: grid; gap: 18px; }
.field-row, .field-row > div { min-width: 0; display: grid; gap: 7px; }
.field-row label, .upload-block > label, fieldset legend { font-size: 13px; font-weight: 750; }
.count { float: right; color: #7b858e; font-size: 11px; font-weight: 600; }
input[type="text"], input[type="number"], textarea, select { width: 100%; min-height: 44px; padding: 10px 11px; color: var(--ink); background: #fff; border: 1px solid #cbd3da; border-radius: 6px; }
textarea { resize: vertical; min-height: 118px; }
input:hover, textarea:hover, select:hover { border-color: #9da8b2; }
.two-up { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.help, .media-status { margin: 6px 0 0; color: var(--muted); font-size: 12px; }

.upload-line { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.upload-avatar { width: 44px; height: 44px; flex: 0 0 auto; display: grid; place-items: center; color: #fff; background: #1f6b58; border-radius: 50%; font-size: 12px; font-weight: 800; overflow: hidden; }
.upload-avatar img { width: 100%; height: 100%; object-fit: cover; }
.file-button { display: inline-flex; align-items: center; min-height: 40px; padding: 8px 12px; border: 1px solid #cbd3da; border-radius: 6px; cursor: pointer; font-size: 13px; font-weight: 750; }
.drop-zone { min-height: 128px; margin-top: 8px; display: grid; place-items: center; align-content: center; text-align: center; padding: 22px; border: 1px dashed #9aa7b3; border-radius: 7px; background: #f8fafb; cursor: pointer; }
.drop-zone:hover, .drop-zone.dragging { border-color: var(--accent); background: #f0f6ff; }
.drop-zone span { color: var(--muted); font-size: 12px; }
.media-status.warning { color: var(--amber); }
.media-status.error { color: var(--danger); }
.creative-strip { margin-top: 10px; display: flex; gap: 8px; overflow-x: auto; }
.creative-chip { position: relative; flex: 0 0 62px; height: 62px; padding: 0; background: #eee; border: 2px solid transparent; border-radius: 6px; overflow: hidden; cursor: pointer; }
.creative-chip.active { border-color: var(--accent); }
.creative-chip img { width: 100%; height: 100%; object-fit: cover; }
.segmented-field { margin: 0; padding: 0; border: 0; }
.segmented { display: grid; grid-template-columns: 1fr 1fr; margin-top: 8px; }
.segmented input,
.placement-tabs input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.segmented span { display: grid; place-items: center; min-height: 42px; border: 1px solid #cbd3da; cursor: pointer; font-weight: 700; font-size: 13px; }
.segmented label:first-child span { border-radius: 6px 0 0 6px; }
.segmented label:last-child span { border-radius: 0 6px 6px 0; border-left: 0; }
.segmented input:checked + span { color: var(--accent-dark); background: #eaf2ff; border-color: var(--accent); }
.toggle-row { display: flex; align-items: flex-start; gap: 10px; padding: 12px 0; border-bottom: 1px solid #edf0f2; cursor: pointer; }
.toggle-row input { width: 18px; height: 18px; margin: 3px 0 0; accent-color: var(--accent); }
.toggle-row span { display: grid; }
.toggle-row small { color: var(--muted); }
.privacy-note { display: grid; gap: 4px; padding: 13px; color: #194f3e; background: #e9f5f0; border-left: 3px solid var(--green); border-radius: 4px; font-size: 13px; }

.preview-workspace { min-width: 0; display: flex; flex-direction: column; background: #eef1f3; }
.preview-toolbar { min-height: 78px; padding: 16px 22px; background: #fff; border-bottom: 1px solid var(--line); }
.toolbar-actions { display: flex; gap: 8px; }
.placement-tabs { padding: 12px 16px; display: flex; gap: 8px; overflow-x: auto; background: #fff; border-bottom: 1px solid var(--line); }
.placement-tabs { scrollbar-width: none; }
.placement-tabs::-webkit-scrollbar { display: none; }
.placement-tabs label { flex: 0 0 auto; }
.placement-tabs span { min-height: 38px; padding: 8px 13px; display: grid; place-items: center; color: #53606b; background: #fff; border: 1px solid #d2d9df; border-radius: 6px; cursor: pointer; font-size: 13px; font-weight: 750; }
.placement-tabs input:checked + span { color: #fff; background: var(--ink); border-color: var(--ink); }
.placement-tabs input:focus-visible + span,
.segmented input:focus-visible + span { outline: 3px solid rgba(18, 103, 233, .35); outline-offset: 2px; }
.preview-stage { position: relative; flex: 1; min-height: 580px; padding: 70px 30px 46px; display: grid; place-items: center; overflow: auto; background-color: #e9edf0; background-image: linear-gradient(#dfe4e8 1px, transparent 1px), linear-gradient(90deg, #dfe4e8 1px, transparent 1px); background-size: 24px 24px; }
.device-controls { position: absolute; top: 16px; right: 18px; display: flex; }
.device-button { min-height: 36px; padding: 6px 11px; border-radius: 0; font-size: 12px; }
.device-button:first-child { border-radius: 5px 0 0 5px; }
.device-button:last-child { border-radius: 0 5px 5px 0; border-left: 0; }
.device-button.active { color: #fff; background: #34404c; border-color: #34404c; }
.quality-bar { min-height: 48px; padding: 10px 18px; display: flex; justify-content: space-between; gap: 16px; color: #5c6872; background: #fff; border-top: 1px solid var(--line); font-size: 11px; }

.mockup { width: 500px; max-width: 100%; color: #17191c; background: #fff; border: 1px solid #d8dde2; border-radius: 7px; box-shadow: 0 10px 28px rgba(22, 31, 40, .17); overflow: hidden; transform-origin: center top; }
.mockup.mobile { width: 375px; }
.ad-header { min-height: 66px; padding: 12px 14px; display: flex; align-items: center; gap: 10px; }
.ad-avatar { width: 42px; height: 42px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; color: #fff; background: #1f6b58; font-size: 11px; font-weight: 850; overflow: hidden; }
.ad-avatar img { width: 100%; height: 100%; object-fit: cover; }
.identity { min-width: 0; flex: 1; line-height: 1.2; }
.identity strong { display: inline; font-size: 14px; }
.verified-mark { display: inline-grid; place-items: center; width: 14px; height: 14px; margin-left: 4px; border-radius: 50%; color: #fff; background: #1687f8; font-size: 9px; vertical-align: 1px; }
.identity small { margin-top: 4px; display: block; color: #68727c; font-size: 11px; }
.more-dot { color: #56616b; font-size: 22px; letter-spacing: 2px; }
.ad-copy { margin: 0; padding: 0 14px 12px; font-size: 14px; line-height: 1.42; white-space: pre-wrap; overflow-wrap: anywhere; }
.creative-frame { position: relative; width: 100%; aspect-ratio: 4 / 5; display: grid; place-items: center; overflow: hidden; background: #dfe9e4; }
.creative-frame img { width: 100%; height: 100%; object-fit: cover; }
.creative-frame.contain img { object-fit: contain; }
.sample-creative { position: absolute; inset: 0; padding: 42px; display: flex; flex-direction: column; justify-content: space-between; background: #d8e5df; }
.sample-tag { align-self: flex-start; padding: 7px 10px; color: #174b3b; background: #fff; border-radius: 4px; font-size: 11px; font-weight: 800; text-transform: uppercase; }
.sample-cup { width: 54%; aspect-ratio: 1; align-self: center; position: relative; border-radius: 50% 50% 44% 44%; background: #f7f3e9; border: 12px solid #fff; box-shadow: 0 20px 36px rgba(37, 66, 56, .2); }
.sample-cup:before { content: ""; position: absolute; inset: 12%; border-radius: 50%; background: #5a3524; box-shadow: inset 0 0 0 8px #9b6548; }
.sample-cup:after { content: ""; position: absolute; width: 24%; height: 34%; right: -27%; top: 33%; border: 12px solid #fff; border-left: 0; border-radius: 0 50% 50% 0; }
.sample-copy strong { display: block; max-width: 330px; color: #17382f; font-family: Georgia, serif; font-size: 31px; line-height: 1.05; }
.sample-copy span { display: block; margin-top: 8px; color: #315e50; font-size: 13px; }
.link-panel { min-height: 78px; padding: 10px 12px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; background: #f2f3f5; border-bottom: 1px solid #dddfe2; }
.link-copy { min-width: 0; line-height: 1.25; }
.link-copy small { display: block; color: #6c747c; font-size: 10px; text-transform: uppercase; overflow-wrap: anywhere; }
.link-copy strong { display: block; margin: 4px 0 2px; font-size: 15px; overflow-wrap: anywhere; }
.link-copy span { color: #5f6871; font-size: 12px; overflow-wrap: anywhere; }
.ad-cta { min-width: 92px; min-height: 36px; padding: 7px 10px; display: grid; place-items: center; border: 1px solid #ccd1d6; border-radius: 5px; color: #26313b; background: #e4e6eb; font-size: 12px; font-weight: 750; }
.engagement { padding: 9px 13px 7px; display: flex; justify-content: space-between; color: #65707a; font-size: 11px; }
.reaction-summary { display: inline-flex; align-items: center; gap: 3px; }
.reaction-icons { display: inline-flex; align-items: center; }
.reaction-badge { width: 19px; height: 19px; display: inline-grid; place-items: center; color: #fff; border: 2px solid #fff; border-radius: 50%; font-family: "Segoe UI Symbol", Arial, sans-serif; font-size: 11px; line-height: 1; }
.reaction-badge + .reaction-badge { margin-left: -4px; }
.reaction-like { background: #1877f2; }
.reaction-love { background: #f55368; font-family: Arial, sans-serif; font-size: 13px; font-weight: 800; }
.action-row { padding: 5px 12px; display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid #e5e8eb; }
.action-row span { min-height: 32px; display: grid; place-items: center; color: #59636c; font-size: 12px; font-weight: 700; }

.mockup.instagram { width: 470px; }
.instagram .creative-frame { aspect-ratio: 4 / 5; }
.instagram .ad-copy { order: 6; padding-top: 10px; }
.instagram .link-panel { min-height: 52px; grid-template-columns: 1fr; padding: 8px 13px; background: #fff; border-bottom: 1px solid #e7eaed; }
.instagram .link-copy { display: none; }
.instagram .ad-cta { width: 100%; color: #1267e9; background: #fff; border: 0; text-align: left; padding: 5px 0; }
.instagram .action-row { order: 4; border: 0; grid-template-columns: repeat(3, 58px) 1fr; justify-content: start; }
.instagram .action-row span:last-child { justify-self: end; }
.instagram .engagement { order: 5; }

.mockup.story { width: min(360px, 100%); aspect-ratio: 9 / 16; position: relative; border: 0; border-radius: 8px; color: #fff; background: #1b2325; }
.story .creative-frame { position: absolute; inset: 0; aspect-ratio: auto; }
.story .creative-frame:after { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(0,0,0,.55), transparent 24%, transparent 62%, rgba(0,0,0,.7)); pointer-events: none; }
.story .sample-tag, .story .sample-copy { display: none; }
.story .ad-header { position: absolute; z-index: 2; inset: 15px 6px auto; }
.story .ad-avatar { width: 34px; height: 34px; }
.story .identity strong, .story .identity small, .story .more-dot { color: #fff; }
.story .story-progress { position: absolute; z-index: 3; top: 8px; left: 10px; right: 10px; height: 3px; background: rgba(255,255,255,.42); border-radius: 2px; }
.story .story-progress:before { content: ""; display: block; width: 62%; height: 100%; background: #fff; }
.story .ad-copy { position: absolute; z-index: 2; left: 22px; right: 22px; bottom: 98px; padding: 0; color: #fff; font-size: 18px; font-weight: 750; text-shadow: 0 1px 4px rgba(0,0,0,.5); }
.story .link-panel { position: absolute; z-index: 2; left: 20px; right: 20px; bottom: 27px; min-height: 50px; display: block; padding: 0; background: transparent; border: 0; }
.story .link-copy { display: none; }
.story .ad-cta { width: 100%; min-height: 46px; color: #17202a; background: rgba(255,255,255,.95); border: 0; border-radius: 6px; }
.story .engagement, .story .action-row { display: none; }

.mockup.carousel { width: 580px; background: transparent; border: 0; box-shadow: none; overflow: visible; }
.carousel > .ad-header, .carousel > .ad-copy, .carousel > .engagement, .carousel > .action-row { background: #fff; }
.carousel > .ad-header { border-radius: 7px 7px 0 0; }
.carousel-track { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 0 18px 10px 0; background: #fff; }
.carousel-card { flex: 0 0 78%; scroll-snap-align: start; border: 1px solid #d9dee2; background: #fff; border-radius: 5px; overflow: hidden; }
.carousel-card .creative-frame { aspect-ratio: 1; }
.carousel-card .link-panel { border-bottom: 0; }

.value-strip { margin: 0 clamp(14px, 3vw, 44px); padding: 24px clamp(20px, 4vw, 52px); display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; color: #fff; background: #17202a; }
.value-strip div { display: grid; gap: 3px; }
.value-strip strong { font-size: 15px; }
.value-strip span { color: #c7d0d7; font-size: 13px; }
.guide { width: min(1120px, calc(100% - 40px)); margin: 0 auto; padding: 80px 0; }
.guide-header { max-width: 850px; margin-bottom: 50px; }
.guide h2 { margin: 0 0 14px; font-size: clamp(25px, 4vw, 38px); line-height: 1.15; }
.guide h3 { margin: 0 0 8px; font-size: 18px; }
.guide p { color: #4f5d68; }
.guide > section { padding: 40px 0; border-top: 1px solid #d9dfe4; }
.guide > section > p { max-width: 850px; }
.review-list { margin: 22px 0 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; list-style: none; counter-reset: review; }
.review-list li { min-width: 0; padding: 18px; background: #fff; border-top: 3px solid var(--accent); counter-increment: review; }
.review-list li:before { content: "0" counter(review); display: block; margin-bottom: 18px; color: #7a858e; font-size: 12px; font-weight: 800; }
.review-list strong { display: block; margin-bottom: 6px; }
.spec-section { display: grid; grid-template-columns: .75fr 1.25fr; gap: 50px; align-items: start; }
.spec-table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: #fff; font-size: 14px; }
th, td { padding: 14px; text-align: left; border-bottom: 1px solid #e2e6e9; }
th { color: #fff; background: #24303a; }
.test-grid { margin-top: 24px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.test-grid article { padding: 20px; background: #fff; border: 1px solid var(--line); border-radius: 6px; }
.test-grid p { margin-bottom: 0; }
.workflow-band { padding: 38px !important; display: flex; justify-content: space-between; align-items: center; gap: 36px; color: #fff; background: #1d463a; border: 0 !important; }
.workflow-band > div { max-width: 780px; }
.workflow-band h2, .workflow-band p, .workflow-band a { color: #fff; }
.workflow-band p { margin-bottom: 0; }
.workflow-band .primary-button { flex: 0 0 auto; background: #fff; color: #17382f; border-color: #fff; }
.faq-list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
details { background: #fff; border: 1px solid var(--line); border-radius: 6px; }
summary { padding: 17px 18px; cursor: pointer; font-weight: 750; }
details p { margin: 0; padding: 0 18px 18px; }

footer { width: min(1520px, 100%); margin: 0 auto; padding: 34px clamp(20px, 4vw, 64px); display: flex; justify-content: space-between; gap: 30px; background: #fff; border-top: 1px solid var(--line); }
footer p { margin: 8px 0 0; color: var(--muted); font-size: 13px; }
.toast { position: fixed; z-index: 20; left: 50%; bottom: 24px; transform: translate(-50%, 20px); padding: 11px 16px; color: #fff; background: #17202a; border-radius: 6px; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: .2s ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 1100px) {
  .studio { grid-template-columns: 350px minmax(0, 1fr); }
  .review-list { grid-template-columns: repeat(3, 1fr); }
  .test-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 820px) {
  .site-header { min-height: 76px; padding: 0 18px; }
  .brand-logo { width: 148px; }
  .site-header nav { display: none; }
  .studio { grid-template-columns: 1fr; margin: 0 10px 28px; }
  .control-panel { border-right: 0; border-bottom: 1px solid var(--line); }
  .preview-stage { min-height: 620px; padding-inline: 12px; }
  .quality-bar { flex-direction: column; }
  .value-strip { margin: 0 10px; grid-template-columns: 1fr; gap: 14px; }
  .spec-section { grid-template-columns: 1fr; gap: 16px; }
  .faq-list { grid-template-columns: 1fr; }
  .workflow-band { align-items: flex-start; flex-direction: column; }
  footer { flex-direction: column; }
}

@media (max-width: 560px) {
  .tool-intro { padding-top: 30px; }
  .tool-intro .tool-lede { font-size: 16px; }
  .control-panel { padding: 18px; }
  .preview-toolbar { align-items: flex-start; flex-direction: column; }
  .toolbar-actions { width: 100%; }
  .toolbar-actions button { flex: 1; }
  .two-up { grid-template-columns: 1fr; }
  .preview-stage { min-height: 560px; padding-top: 68px; }
  .mockup.facebook, .mockup.instagram { width: 100%; }
  .sample-creative { padding: 28px; }
  .sample-copy strong { font-size: 25px; }
  .review-list, .test-grid { grid-template-columns: 1fr; }
  .guide { width: min(100% - 28px, 1120px); padding: 56px 0; }
  .workflow-band { padding: 24px !important; }
  footer nav { flex-wrap: wrap; gap: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *:before, *:after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
