:root {
  color-scheme: dark;
  --oc-bg: #0a1012;
  --oc-surface: #10191c;
  --oc-raised: #152125;
  --oc-line: #2a393d;
  --oc-text: #f2f7f6;
  --oc-muted: #a3b2b4;
  --oc-brand: #4bd5c8;
  --oc-brand-strong: #21b7ab;
  --oc-brand-soft: rgba(75, 213, 200, .1);
  --oc-success: #c3ed83;
}

html { max-width: 100%; overflow-x: clip; scroll-behavior: smooth; }
*, *::before, *::after { box-sizing: border-box; }
body {
  width: 100%; max-width: 100%; overflow-x: clip; touch-action: manipulation;
  background: radial-gradient(ellipse at 52% -28%, rgba(75, 213, 200, .10), transparent 48%), var(--oc-bg) !important;
  color: var(--oc-text); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button, a { -webkit-tap-highlight-color: rgba(75, 213, 200, .12); }
:focus-visible { outline: 2px solid var(--oc-brand) !important; outline-offset: 3px; }
header { border-color: rgba(194, 226, 226, .12) !important; background: rgba(10, 16, 18, .9); }
header nav { min-height: 68px; }
header nav > a:first-child { gap: 10px; }
header nav > a:first-child img { display: block; width: 36px; height: 36px; }
header nav > a:first-child span { color: var(--oc-text); font-size: 16px; letter-spacing: -.035em; }
header nav > a:first-child span span { color: var(--oc-brand) !important; }

/* Keep legacy utility classes but give the brand accent one consistent role. */
body .bg-indigo-500 { background-color: var(--oc-brand-strong) !important; }
body .hover\:bg-indigo-400:hover { background-color: var(--oc-brand) !important; }
body .text-indigo-100, body .text-indigo-200, body .text-indigo-300 { color: var(--oc-brand) !important; }
body .border-indigo-300\/\[\.12\], body .border-indigo-400\/15, body .border-indigo-400\/20 { border-color: rgba(75, 213, 200, .22) !important; }
body .bg-indigo-400\/\[\.05\], body .bg-indigo-400\/\[\.07\], body .bg-indigo-400\/10, body .bg-indigo-500\/15 { background-color: var(--oc-brand-soft) !important; }
body .ring-indigo-400\/25 { --tw-ring-color: rgba(75, 213, 200, .25) !important; }
body .focus\:border-indigo-400\/60:focus { border-color: rgba(75, 213, 200, .72) !important; }
body .focus\:ring-indigo-500\/20:focus { --tw-ring-color: rgba(75, 213, 200, .2) !important; }

#inicio > section:first-child { max-width: 54rem; text-align: left; }
#inicio > section:first-child > div:first-child { color: var(--oc-brand) !important; border-color: rgba(75, 213, 200, .22); background: var(--oc-brand-soft); }
#inicio > section:first-child h1 { max-width: 13ch; font-size: clamp(2.25rem, 5.6vw, 4.25rem); line-height: 1.04; letter-spacing: -.055em; text-wrap: balance; }
#inicio > section:first-child h1 span { color: var(--oc-brand) !important; }
#inicio > section:first-child p { max-width: 41rem; margin-left: 0; font-size: clamp(.98rem, 1.6vw, 1.125rem); line-height: 1.65; }
#inicio > section:first-child > a { color: var(--oc-text); border-color: var(--oc-line); background: var(--oc-surface); }

#ferramenta { margin-top: 1.75rem; border-color: var(--oc-line) !important; border-radius: 20px; background: linear-gradient(145deg, rgba(20, 31, 34, .98), rgba(13, 20, 22, .98)); box-shadow: 0 28px 70px rgba(0,0,0,.3); }
#ferramenta > div[role="tablist"] { background: rgba(4, 9, 10, .55); border: 1px solid rgba(181, 215, 215, .07); }
#tab-download, #tab-convert, #tab-pdf { min-height: 48px; border-radius: 12px; }
#tab-download[aria-selected="true"], #tab-convert[aria-selected="true"], #tab-pdf[aria-selected="true"] { color: #041311 !important; background: var(--oc-brand) !important; box-shadow: none !important; }
#tab-download[aria-selected="false"], #tab-convert[aria-selected="false"], #tab-pdf[aria-selected="false"] { color: var(--oc-muted) !important; }
#panel-download > div:first-child { border-radius: 14px; background: rgba(75, 213, 200, .055) !important; }
#panel-download > div:first-child > div { min-width: 0; }
input[type="url"], input[type="search"], input[type="text"], select { min-height: 50px; border-color: var(--oc-line) !important; border-radius: 12px; background-color: #0b1214 !important; font-size: 16px; }
input::placeholder { color: #748386 !important; opacity: 1; }
#download-button, #convert-button { min-height: 52px; border-radius: 12px; color: #051412; background: var(--oc-brand) !important; box-shadow: none !important; font-size: 15px; }
#download-button:hover, #convert-button:hover { background: #6ae5d7 !important; }
#download-button:disabled, #convert-button:disabled { color: #b8c3c3; }
.gold-button { color: #211807 !important; background: linear-gradient(125deg, #f6d77e, #e9b548 52%, #f8dc8c) !important; box-shadow: 0 5px 18px rgba(234, 185, 73, .12) !important; }
#open-upgrade { min-height: 42px; padding: 9px 13px; font-size: 12px; white-space: nowrap; }

.ad-slot { position: relative; overflow: hidden; contain: layout paint; border: 1px solid rgba(163, 178, 180, .16) !important; border-radius: 10px !important; background: rgba(16, 25, 28, .45) !important; }
.ad-slot iframe, .ad-slot img { display: block; max-width: 100% !important; margin-inline: auto; }
.ad-slot iframe { border: 0; }
.ad-label { position: absolute; top: 2px; left: 8px; z-index: 2; padding: 2px 5px; color: #819094; background: rgba(10, 16, 18, .8); font-size: 9px; letter-spacing: .08em; text-transform: uppercase; }
#ad-slot-top { width: min(728px, 100%); }
#ad-slot-bottom { width: min(300px, 100%); }

#popular-tools-title { scroll-margin-top: 86px; }
#tool-search { width: 100%; max-width: 34rem; }
.model-preview { width: 100%; height: 300px; touch-action: none; }
.model-canvas { display: block; width: 100%; height: 100%; }
.pdf-action[aria-pressed="true"] { color: #061311; border-color: var(--oc-brand); background: var(--oc-brand); }
.tool-filter[aria-pressed="true"] { color: #061311 !important; border-color: var(--oc-brand) !important; background: var(--oc-brand) !important; }
.tool-card { min-width: 0; border-color: var(--oc-line) !important; background: rgba(16, 25, 28, .62) !important; }
.tool-card:hover { border-color: rgba(75, 213, 200, .48) !important; background: rgba(21, 33, 37, .92) !important; }
.tool-card[hidden] { display: none !important; }

#upgrade-modal { overscroll-behavior: contain; padding-bottom: max(1rem, env(safe-area-inset-bottom)); }
body.modal-open { overflow: hidden; }
#upgrade-modal > div { max-height: min(88dvh, 760px); overflow-y: auto; overscroll-behavior: contain; }
#close-modal { min-width: 44px; min-height: 44px; }

@media (max-width: 640px) {
  html, body { overflow-x: hidden; }
  header, header nav { width: 100%; max-width: 100%; min-width: 0; }
  header nav { min-height: 62px; gap: 8px; padding-inline: 14px !important; }
  header nav > a:first-child { min-width: 0; gap: 8px; }
  header nav > a:first-child img { width: 32px; height: 32px; }
  header nav > a:first-child span { font-size: 13px; white-space: nowrap; }
  #open-upgrade { flex: 0 0 auto; min-height: 40px; max-width: 142px; padding: 8px 9px; font-size: 10px; line-height: 1.2; white-space: normal; }
  #inicio { padding: 24px 16px 44px !important; }
  #inicio > section { width: 100%; min-width: 0; }
  #inicio > section:first-child p { width: 100%; }
  #inicio > section:first-child h1 { max-width: 12ch; font-size: clamp(2.05rem, 8vw, 2.75rem); line-height: 1.08; }
  #inicio > section:first-child > a { min-height: 44px; }
  #ferramenta { width: 100%; min-width: 0; margin-top: 22px; padding: 14px !important; border-radius: 17px; }
  #ferramenta > div[role="tablist"] { position: sticky; top: 4px; z-index: 3; margin-bottom: 18px; padding: 4px; }
  #tab-download, #tab-convert, #tab-pdf { min-width: 0; padding-inline: 4px; font-size: 11px; }
  .model-preview { height: 240px; }
  #panel-download > div:first-child { padding: 12px; }
  #ad-slot-top { display: none !important; }
  #ad-slot-bottom { margin-top: 26px !important; }
  #upgrade-modal { align-items: flex-end; padding: 0; }
  #upgrade-modal > div { width: 100%; max-width: none; max-height: 88dvh; padding: 24px 20px max(24px, env(safe-area-inset-bottom)); border-radius: 22px 22px 0 0; }
}

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