:root {
  --viewport-height: 100dvh;
  color-scheme: dark;
  --background: #0D0D0F;
  --surface: #16161A;
  --surface-raised: #1D1D23;
  --border: #2D2D34;
  --text: #F4F4F5;
  --muted: #A1A1AA;
  --subtle: #71767b;
  --primary: #6D5DFB;
  --primary-hover: #5D4BEF;
  --primary-light: #A39AFF;
  --accent-tint: rgba(109, 93, 251, .10);
  --focus-ring: rgba(109, 93, 251, .2);
  --hero-surface: #1C1C24;
  --hero-text: #F4F4F5;
  --hero-muted: #B6B6C4;
  --shadow-soft: 0 8px 26px rgba(0, 0, 0, .14);
}

@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --background: #F7F7F8;
    --surface: #FFFFFF;
    --surface-raised: #F2F2F5;
    --border: #E3E3E7;
    --text: #18181B;
    --muted: #71717A;
    --subtle: #71717A;
    --primary-light: #5143D5;
    --accent-tint: rgba(109, 93, 251, .08);
    --focus-ring: rgba(109, 93, 251, .18);
    --hero-surface: #ECEBFF;
    --hero-text: #18181B;
    --hero-muted: #52525B;
    --shadow-soft: 0 8px 26px rgba(24, 24, 27, .05);
  }
}

* { box-sizing: border-box; }
html, body { width: 100%; overflow-x: hidden; }
html:has(body .app-shell), body:has(.app-shell) { overflow: hidden; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: var(--viewport-height);
  background: var(--background);
  color: var(--text);
  font-family: "Plus Jakarta Sans", Arial, sans-serif;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}
body[data-theme="escuro"] {
  color-scheme: dark;
  --background: #0D0D0F;
  --surface: #16161A;
  --surface-raised: #1D1D23;
  --border: #2D2D34;
  --text: #F4F4F5;
  --muted: #A1A1AA;
  --subtle: #71767b;
  --primary-light: #A39AFF;
}
body[data-theme="claro"] {
  color-scheme: light;
  --background: #F7F7F8;
  --surface: #FFFFFF;
  --surface-raised: #F2F2F5;
  --border: #E3E3E7;
  --text: #18181B;
  --muted: #71717A;
  --subtle: #71717A;
  --primary-light: #5143D5;
  --accent-tint: rgba(109, 93, 251, .08);
  --focus-ring: rgba(109, 93, 251, .18);
}
body[data-font-size="pequena"] { font-size: 14px; }
body[data-font-size="grande"] { font-size: 16px; }
body.reduce-motion *,
body.reduce-motion *::before,
body.reduce-motion *::after {
  scroll-behavior: auto !important;
  transition-duration: .001ms !important;
  animation-duration: .001ms !important;
  animation-iteration-count: 1 !important;
}
body[data-density="compacta"] .post { padding-top: 17px; padding-bottom: 17px; }
body.home-feed-page { overflow: hidden; }
html:has(body.home-feed-page) { overflow: hidden; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--primary-light);
  outline-offset: 3px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.material-symbols-outlined {
  font-family: "Material Symbols Outlined";
  font-weight: normal;
  font-style: normal;
  font-size: 22px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  direction: ltr;
  -webkit-font-feature-settings: "liga";
  -webkit-font-smoothing: antialiased;
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 800; letter-spacing: -.04em; }
.brand-mark {
  display: block;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  object-fit: contain;
}
.avatar {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid #6d43ae;
  border-radius: 50%;
  background: #2a2140;
  object-fit: cover;
  color: #e5d8ff;
  font-size: 15px;
  font-weight: 800;
  text-transform: uppercase;
}
.avatar-small { width: 32px; height: 32px; font-size: 12px; }
.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px 22px;
  border: 0;
  border-radius: 0;
  background: var(--primary);
  color: white;
  font-weight: 800;
  white-space: nowrap;
  box-shadow: 0 8px 25px rgba(124, 58, 237, .19);
  transition: background .15s, transform .15s;
}
.primary-button:hover { background: var(--primary-hover); transform: translateY(-1px); }
.primary-button.small {
  min-height: 32px;
  padding: 7px 14px;
  font-size: 12px;
}
.action-icon { display: block; flex: 0 0 18px; width: 18px; height: 18px; object-fit: contain; filter: invert(1); }
.eyebrow { margin: 0 0 5px; color: var(--primary-light); font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.toast-region {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 100;
  display: grid;
  gap: 10px;
  width: min(390px, calc(100vw - 32px));
  pointer-events: none;
}
.global-toast {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  min-height: 54px;
  padding: 11px 11px 11px 14px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--primary);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-soft);
  pointer-events: auto;
  animation: toast-enter .18s ease-out both;
}
.global-toast--success { border-left-color: #4fb27a; }
.global-toast--warning { border-left-color: #d7a43b; }
.global-toast--error { border-left-color: #d85b6d; }
.global-toast-icon { color: var(--primary-light); font-size: 21px; }
.global-toast--success .global-toast-icon { color: #69cb91; }
.global-toast--warning .global-toast-icon { color: #efbe55; }
.global-toast--error .global-toast-icon { color: #ff8292; }
.global-toast-text { font-size: 12px; font-weight: 700; line-height: 1.45; overflow-wrap: anywhere; }
.global-toast-action { border: 0; background: transparent; color: var(--primary-light); font-size: 12px; font-weight: 800; cursor: pointer; }
.global-toast-action:hover { text-decoration: underline; }
.global-toast-close { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; background: transparent; color: var(--muted); }
.global-toast-close:hover { background: var(--surface-raised); color: var(--text); }
.global-toast-close .material-symbols-outlined { font-size: 18px; }
.global-toast.is-leaving { animation: toast-leave .16s ease-in both; }
@keyframes toast-enter { from { opacity: 0; transform: translateY(-8px); } }
@keyframes toast-leave { to { opacity: 0; transform: translateX(12px); } }
@media (max-width: 600px) {
  .toast-region { top: 72px; right: 12px; left: 12px; width: auto; }
}
