:root {
  --bg: #f5f5f5;
  --card: #ffffff;
  --text: #212121;
  --muted: #607d8b;
  --primary: #5b5ce2;
  --primary-dark: #4b4dbe;
  --primary-ghost: #ebe9ff;
  --border: #d9d9d9;
  --footer-bg: #5146c5;
  --nav-bg: #5b52d6;
  --hero: #212121;
  --shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
  --focus: #a5b4fc;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover,
a:focus-visible {
  text-decoration: underline;
}

img {
  max-width: 100%;
  display: block;
}

header {
  background: var(--nav-bg);
  color: #fff;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.26);
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 0.55rem;
  padding: 0.7rem 1rem 0.8rem;
}

.topbar .brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
}

.topbar .brand img {
  display: none;
}

.topbar h1 {
  margin: 0;
  font-size: 2rem;
  font-weight: 700;
}

.topbar .links {
  display: none;
  align-items: center;
  gap: 0.35rem 0.55rem;
  flex-wrap: wrap;
  justify-content: center;
}

.topbar a {
  text-decoration: none;
  color: #eaf4ff;
  font-weight: 600;
  font-size: 0.92rem;
  white-space: nowrap;
}

.topbar a:hover,
.topbar a:focus-visible {
  text-decoration: none;
  background: rgba(255, 255, 255, 0.14);
  border-radius: 2px;
}

main {
  max-width: 1280px;
  margin: 1.5rem auto;
  padding: 0 1rem 3rem;
  width: 90%;
}

h1,
h2,
h3 {
  line-height: 1.2;
  margin: 0;
}

h1 {
  font-size: clamp(2rem, 3.2vw, 2.8rem);
  margin-bottom: 0.75rem;
}

h2 {
  font-size: 2rem;
  margin-bottom: 0.75rem;
  font-weight: 700;
}

h3 {
  font-size: 1.55rem;
  margin-bottom: 0.65rem;
  font-weight: 700;
}

p {
  color: #334155;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 1.25rem;
  margin: 1rem 0;
  box-shadow: var(--shadow);
}

.card-headline {
  font-weight: 700;
  margin-bottom: 0.4rem;
  color: #111827;
}

label {
  display: block;
  margin-bottom: 0.55rem;
  font-weight: 600;
  color: #374151;
}

textarea,
input,
select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 0.7rem 0.75rem;
  font-size: 1rem;
  background: #fff;
  color: #0f172a;
}

textarea {
  resize: vertical;
  min-height: 140px;
}

#outputAnchor {
  scroll-margin-top: 7rem;
}

input[type="text"],
input[type="number"] {
  min-height: 3rem;
}

input:focus-visible,
textarea:focus-visible,
select:focus-visible,
button:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.settings {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, max-content)) minmax(180px, 280px);
  align-items: end;
  gap: 0.85rem 1rem;
  margin-top: 0.85rem;
}

.setting-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
  min-height: 42px;
}

.setting-row input[type="checkbox"] {
  width: auto;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1.1rem;
}

.btn {
  border: 0;
  border-radius: 2px;
  padding: 0.72rem 1.15rem;
  min-height: 42px;
  cursor: pointer;
  color: white;
  background: var(--primary);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1;
}

.btn:hover {
  background: var(--primary-dark);
}

.btn.secondary {
  background: #546e7a;
}

.btn.ghost {
  background: #fff;
  color: var(--primary-dark);
  border: 1px solid #cfd8dc;
}

.btn .icon {
  width: 1.1rem;
  height: 1.1rem;
  margin-right: 0.35rem;
}

.share-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 0.65rem;
}

.share-group select {
  width: auto;
  min-width: 130px;
}

.meta {
  color: var(--muted);
  margin-top: 0.45rem;
  font-size: 0.95rem;
}

.status {
  margin-top: 0.7rem;
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  min-height: 2.2rem;
  color: #334155;
  background: #fafafa;
  border: 1px dashed #d6d1fa;
}

.site-toast {
  position: fixed;
  left: 50%;
  bottom: 1.25rem;
  transform: translateX(-50%) translateY(1rem);
  background: rgba(33, 33, 33, 0.94);
  color: #fff;
  padding: 0.75rem 1rem;
  border-radius: 2px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
  z-index: 100;
}

.site-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.footer-callout {
  background: #f7effa;
  border: 1px dashed #d6d1fa;
  border-radius: 12px;
  padding: 0.75rem;
  margin-top: 0.8rem;
}

footer {
  background: var(--footer-bg);
  color: #fff;
  margin-top: 3rem;
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.05rem 1rem 1.2rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.96rem;
}

.footer-links {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.footer-links a {
  color: #ede9fe;
}

.footer-inner small {
  display: block;
  margin-top: 0.5rem;
  color: #ede9fe;
}

.tricks-list {
  display: grid;
  gap: 1rem;
}

.trick {
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 1rem;
}

.trick:last-child {
  border-bottom: 0;
}

.trick .media {
  border-radius: 10px;
  border: 1px solid var(--border);
  margin: 0.6rem 0 0.9rem;
  overflow: hidden;
  background: #f8fafc;
}

.trick .media img {
  width: 100%;
  height: auto;
  display: block;
}

.share-fab {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  display: flex;
  gap: 0.55rem;
  z-index: 30;
}

.share-fab a {
  border-radius: 999px;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  color: #fff;
  text-decoration: none;
  font-size: 1.15rem;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.2);
}

.share-fab a.wa {
  background: #25d366;
}

.share-fab a.fb {
  background: #5b5ce2;
}

.share-fab a:hover,
.share-fab a:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.24);
}

.share-fab img.icon {
  width: 20px;
  height: 20px;
  pointer-events: none;
}

.share-fab img.icon.invert {
  filter: brightness(0) invert(1);
}

.btn img.icon {
  width: 1rem;
  height: 1rem;
  margin-right: 0.5rem;
}

.btn img.icon.invert {
  filter: brightness(0) invert(1);
}

.btn.ghost img.icon {
  margin-right: 0;
  margin-left: 0;
}

.icon-action {
  vertical-align: middle;
}

.share-label {
  margin: 0;
}

.social-links {
  display: inline-flex;
  gap: 0.5rem;
  margin-top: 0.4rem;
  flex-wrap: wrap;
}

.meta + .actions {
  margin-top: 0.85rem;
}

.kicker {
  font-size: 0.86rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #5b52d6;
  font-weight: 700;
  margin-bottom: 0.35rem;
  display: inline-block;
}

.tip-return {
  margin: 1rem 0 0;
}

.sr-only {
  border: 0;
  clip: rect(0 0 0 0);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
}

.tricks-list {
  display: grid;
  gap: 1rem;
  margin-top: 0.3rem;
}

.trick-item {
  padding: 0.8rem 0;
  border-bottom: 1px dashed #cfd8dc;
}

.trick-item:last-child {
  border-bottom: 0;
}

.trick-item h3 {
  margin-bottom: 0.4rem;
}

.trick-item p {
  margin: 0 0 0.75rem;
}

.chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 1rem 0 0.2rem;
}

.chip {
  display: inline-block;
  padding: 0.28rem 0.62rem;
  border-radius: 999px;
  background: #f7effa;
  border: 1px solid #e1bee7;
  color: #334155;
  font-size: 0.82rem;
  font-weight: 600;
}

.page-title-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
}

.page-title-row h1 {
  margin-bottom: 0.3rem;
}

.ad-caption {
  margin-top: 0.5rem;
  color: #64748b;
  font-size: 0.84rem;
}

.lead {
  font-size: 1.08rem;
  line-height: 1.6;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  align-items: start;
}

.tool-panel {
  margin: 0;
}

.tool-panel h3 {
  font-size: 1.15rem;
  margin-bottom: 0.85rem;
}

.compact-actions {
  gap: 1rem;
}

.compact-actions .btn {
  min-width: 100px;
}

.output-actions {
  align-items: center;
}

.flat-copy {
  font-size: 1rem;
  line-height: 1.7;
}

.btn-primary {
  background: #5b5ce2;
}

.btn-primary:hover {
  background: #4b4dbe;
}

.btn-subtle {
  background: #f1efff;
  color: #5146c5;
  border: 1px solid #d6d1fa;
}

.btn-subtle:hover {
  background: #e3defe;
}

.whatsapp-btn {
  background: #43a047;
}

.whatsapp-btn:hover {
  background: #2e7d32;
}

@media (max-width: 760px) {
  .topbar {
    align-items: stretch;
    gap: 0.8rem;
  }

  .topbar .brand {
    justify-content: center;
  }

  .topbar .links {
    display: none;
  }

  .topbar .links a {
    font-size: 0.88rem;
    padding: 0.35rem 0.55rem;
  }

  .topbar {
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
    flex-wrap: wrap;
  }

  main {
    margin-top: 1rem;
    padding-bottom: 4.5rem;
  }

  .card {
    padding: 1rem;
  }

  .tool-grid {
    grid-template-columns: 1fr;
  }

  .compact-actions {
    gap: 0.75rem;
  }

  .settings {
    grid-template-columns: 1fr 1fr;
  }

  .settings > label:last-child {
    grid-column: 1 / -1;
  }

  .actions,
  .share-group {
    width: 100%;
  }

  .share-group {
    flex-direction: column;
  }

  .share-group select,
  .share-group .btn {
    width: 100%;
  }
}

@media (max-width: 520px) {
  .topbar .brand {
    gap: 0.55rem;
  }

  .topbar .brand img {
    height: 34px;
  }

  .topbar h1 {
    font-size: 1.4rem;
  }

  .settings {
    grid-template-columns: 1fr;
  }

  .setting-row {
    min-height: 0;
  }
}
