/* Universal Office — site estático (landing + docs). Sem dependências. */

/* Tema via light-dark(): color-scheme decide o valor. Default = light dark
   (segue o SO → "Auto"); o seletor força light/dark via [data-theme]. */
:root {
  color-scheme: light dark;
  --bg: light-dark(#ffffff, #0d1117);
  --bg-soft: light-dark(#f6f8fa, #161b22);
  --bg-code: light-dark(#f6f8fa, #161b22);
  --border: light-dark(#d9dee3, #30363d);
  --text: light-dark(#1f2328, #e6edf3);
  --text-soft: light-dark(#57606a, #9198a1);
  --accent: light-dark(#1a56db, #6ea8fe);
  --accent-soft: light-dark(#e8efff, #12233f);
  --write: light-dark(#185abd, #6ea8fe);
  --sheet: light-dark(#107c41, #4cc38a);
  --slides: light-dark(#c43e1c, #f0836a);
  --diff: light-dark(#6b4fbb, #b197fc);
  --ok: light-dark(#107c41, #4cc38a);
  --warn: light-dark(#9a6700, #d4a72c);
  --radius: 10px;
  --maxw: 1080px;
  --sidebar-w: 260px;
  --topbar-h: 56px;
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"]  { color-scheme: dark; }

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--topbar-h) + 16px); }

body {
  margin: 0;
  font-family: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

code, pre {
  font-family: ui-monospace, "Cascadia Code", "Segoe UI Mono", Consolas, monospace;
  font-size: 0.9em;
}

code {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 0.1em 0.35em;
}

pre {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  overflow-x: auto;
  line-height: 1.5;
}

pre code { background: none; border: none; padding: 0; }

/* ---------- Topbar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 24px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.topbar .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 16px;
  color: var(--text);
}

.topbar .brand:hover { text-decoration: none; }

.brand-mark {
  width: 26px; height: 26px;
  border-radius: 7px;
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  overflow: hidden;
  flex: none;
}
.brand-mark span:nth-child(1) { background: var(--write); }
.brand-mark span:nth-child(2) { background: var(--sheet); }
.brand-mark span:nth-child(3) { background: var(--slides); }
.brand-mark span:nth-child(4) { background: var(--diff); }

.brand-logo { width: 34px; height: 34px; flex: none; display: block; margin: -4px 0; }

.beta {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: 1;
  color: #fff;
  background: var(--accent);
  padding: 3px 6px;
  border-radius: 999px;
  vertical-align: middle;
}
.topbar .brand .beta { margin-left: 7px; }

.topbar nav { display: flex; gap: 18px; margin-left: auto; }
.topbar nav a { color: var(--text-soft); font-size: 14px; font-weight: 500; white-space: nowrap; }
.topbar nav a:hover { color: var(--text); text-decoration: none; }
.topbar nav a.active { color: var(--text); }

.theme-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: 999px;
  flex: none;
}
.theme-switch button {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: none;
  background: none;
  border-radius: 999px;
  color: var(--text-soft);
  cursor: pointer;
}
.theme-switch button:hover { color: var(--text); background: var(--bg-soft); }
.theme-switch button.active { color: #fff; background: var(--accent); }
.theme-switch svg {
  width: 15px; height: 15px;
  fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}

/* Phones and narrow windows, like Google's mobile apps: below 760px the top bar
   keeps "☰" and the brand; the nav links, the docs sidebar and the theme switch
   live in a navigation drawer (built by assets/theme.js). Docs pages switch at
   900px, where the sidebar would otherwise stack above the content. */
.nav-toggle {
  display: none;
  place-items: center;
  width: 40px; height: 40px;
  margin-left: -8px;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: none;
  color: var(--text);
  cursor: pointer;
  flex: none;
}
.nav-toggle:hover { background: var(--bg-soft); }
.nav-toggle svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
@media (max-width: 760px) {
  .topbar .nav-toggle { display: inline-grid; }
  .topbar { gap: 8px; padding: 0 12px; }
  .topbar > nav, .topbar > .theme-switch { display: none; }
}
@media (max-width: 900px) {
  .has-sidebar .nav-toggle { display: inline-grid; }
  .has-sidebar .sidebar { display: none; }
}

.drawer-scrim { position: fixed; inset: 0; z-index: 99; background: rgba(0, 0, 0, 0.4); }
.drawer {
  position: fixed; top: 0; bottom: 0; left: 0; z-index: 100;
  width: min(320px, 86vw);
  display: flex; flex-direction: column;
  overflow-y: auto; overscroll-behavior: contain;
  padding: 12px 12px calc(16px + env(safe-area-inset-bottom, 0px));
  background: var(--bg);
  border-radius: 0 16px 16px 0;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.24);
  font-size: 14px;
}
.drawer[hidden], .drawer-scrim[hidden] { display: none; }
html.drawer-open, html.drawer-open body { overflow: hidden; }
.drawer .drawer-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 16px 14px;
  font-weight: 700; font-size: 16px; color: var(--text);
}
.drawer .drawer-brand:hover { text-decoration: none; }
.drawer-brand img { width: 30px; height: 30px; margin: 0; }
.drawer-links { display: flex; flex-direction: column; padding-bottom: 8px; margin-bottom: 8px; border-bottom: 1px solid var(--border); }
.drawer-group { margin-bottom: 8px; }
.drawer-group > .title {
  display: flex; align-items: center; gap: 8px;
  margin: 10px 16px 4px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--text-soft);
}
.drawer-group .nav-ico { width: 16px; height: 16px; }
.drawer-group ul { list-style: none; margin: 0; padding: 0; }
.drawer-links a, .drawer-group li a, .drawer-group li span.soon-item {
  display: flex; align-items: center;
  min-height: 44px; padding: 0 16px;
  border-radius: 999px;
  color: var(--text); font-weight: 500;
}
.drawer-links a:hover, .drawer-group li a:hover { background: var(--bg-soft); text-decoration: none; }
.drawer-links a.active, .drawer-group li a.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.drawer-group li span.soon-item { color: var(--text-soft); opacity: 0.6; }
.drawer-group .soon-tag { font-size: 10.5px; font-weight: 600; border: 1px solid var(--border); border-radius: 999px; padding: 1px 7px; margin-left: 6px; }
.drawer-theme {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: auto; padding: 14px 16px 4px;
  border-top: 1px solid var(--border);
  color: var(--text-soft);
}

/* ---------- Live editors (live.html, live-sheet.html, live-slides.html) ---------- */

html.live-page, html.live-page body { height: 100%; margin: 0; }
html.live-page body { display: flex; flex-direction: column; overflow: hidden; }
.live-bar {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 16px; border-bottom: 1px solid var(--border);
  background: var(--bg); flex: none;
}
.live-bar .brand { display: flex; align-items: center; gap: 9px; font-weight: 700; color: var(--text); }
.live-bar .brand:hover { text-decoration: none; }
.live-bar .brand img { width: 28px; height: 28px; display: block; }
.live-bar .tag {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  color: var(--accent); background: var(--accent-soft); padding: 3px 9px; border-radius: 999px;
}
/* Write · Sheet · Slides: the editor in use, and the other two one click away */
.live-switch {
  display: inline-flex; gap: 2px; padding: 3px;
  border: 1px solid var(--border); border-radius: 999px;
}
.live-switch a {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 4px 13px 4px 8px; border-radius: 999px;
  color: var(--text-soft); font-size: 13.5px; font-weight: 600;
}
.live-switch a img { width: 18px; height: 18px; display: block; }
.live-switch a:hover { color: var(--text); background: var(--bg-soft); text-decoration: none; }
.live-switch a[aria-current="page"] { color: var(--text); background: var(--accent-soft); }
.live-bar .spacer { flex: 1; }
.live-bar nav { display: flex; gap: 16px; align-items: center; }
.live-bar nav a { color: var(--text-soft); font-size: 14px; font-weight: 600; white-space: nowrap; }
.live-bar nav a:hover { color: var(--text); text-decoration: none; }
.live-editor { display: block; flex: 1; min-height: 0; }
/* phones: one bar only, like Google's apps — the editor's, with "←" back to the site */
.live-editor::part(leading) { display: none; }
/* narrower windows: the switcher and the theme stay; the logo still leads home */
@media (max-width: 900px) {
  .live-bar .tag, .live-bar > nav:not(.live-switch) { display: none; }
}
@media (max-width: 760px) { .live-bar .brand { font-size: 0; gap: 0; } }
@media (max-width: 640px) {
  .live-bar { display: none; }
  .live-editor::part(leading) { display: flex; }
}

/* ---------- Landing ---------- */

.hero {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 88px 24px 56px;
  text-align: center;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 20px;
  font-size: 13.5px;
  color: var(--text-soft);
}

.hero h1 {
  font-size: clamp(34px, 5vw, 52px);
  line-height: 1.15;
  margin: 0 0 18px;
  letter-spacing: -0.02em;
}

.hero h1 .grad {
  background: linear-gradient(90deg, var(--write), var(--diff));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero p.lead {
  font-size: 19px;
  color: var(--text-soft);
  max-width: 720px;
  margin: 0 auto 30px;
}

.hero .cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.btn {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 15px;
  border: 1px solid var(--border);
  color: var(--text);
}
.btn:hover { text-decoration: none; background: var(--bg-soft); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { filter: brightness(1.1); background: var(--accent); }
.btn svg { width: 16px; height: 16px; vertical-align: -3px; margin-right: 7px; }
.hero .cta .btn { padding: 12px 24px; font-size: 16px; }

/* the three editors live in the browser: one pill per editor, in its color */
.try {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 10px; margin-top: 18px;
}
.try-label { color: var(--text-soft); font-size: 14.5px; }
.try-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 16px 7px 10px; border-radius: 999px;
  border: 1px solid var(--border); color: var(--text);
  font-size: 15px; font-weight: 600;
}
.try-btn img { width: 22px; height: 22px; display: block; }
.try-btn:hover { text-decoration: none; background: var(--bg-soft); }
.try-btn.write:hover { border-color: var(--write); }
.try-btn.sheet:hover { border-color: var(--sheet); }
.try-btn.slides:hover { border-color: var(--slides); }
@media (max-width: 640px) { .try-label { flex-basis: 100%; text-align: center; } }

/* build, packages and license (shields), under the web components' intro */
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin: -12px 0 24px; }
.badges a { display: inline-flex; }
.badges img { display: block; height: 20px; }

/* the browsers the editors were tested on */
.browsers-title { margin: 36px 0 6px; font-size: 18px; }
.browsers-sub { margin: 0 0 14px; color: var(--text-soft); font-size: 14.5px; }
.browsers {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px;
}
.browsers li {
  display: flex; flex-direction: column; gap: 2px;
  padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 15px; color: var(--text);
}
.browsers li span { font-size: 12.5px; color: var(--text-soft); }

/* inside an editor's card, above its download badges */
.try-live {
  display: inline-flex; align-items: center; gap: 6px;
  margin: 2px 0 10px; font-size: 14px; font-weight: 600;
}
.try-live svg { width: 18px; height: 18px; }
/* the link and the badges line up across the three cards, whatever the text above */
#download .card .try-live { margin-top: auto; align-self: flex-start; }
.card.write .try-live { color: var(--write); }
.card.sheet .try-live { color: var(--sheet); }
.card.slides .try-live { color: var(--slides); }

.hero-note { margin-top: 14px; font-size: 13.5px; color: var(--text-soft); }
.section-eyebrow {
  font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--accent);
  margin: 0 0 8px;
}

.section {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 40px 24px;
}

.section > h2 {
  font-size: 26px;
  margin: 0 0 6px;
  letter-spacing: -0.01em;
}

.section > p.sub { color: var(--text-soft); margin: 0 0 28px; }

/* Cards de produto */

.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
/* três colunas só cabem com os selos de download inteiros (não quebram linha) */
@media (max-width: 1060px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
  .cards:not(.two) > .card:last-child:nth-child(odd) { grid-column: 1 / -1; }
}
.cards.two { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 860px) { .cards, .cards.two { grid-template-columns: 1fr; } }

.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
}

.card.soon { opacity: 0.75; }

.card .icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 20px;
  color: #fff;
  margin-bottom: 4px;
}
.card.write .icon { background: var(--write); }
.card.sheet .icon { background: var(--sheet); }
.card.slides .icon { background: var(--slides); }
.card.diff .icon { background: var(--diff); }
.card .icon svg { width: 26px; height: 26px; display: block; }

/* Full-color app icons (Write/Sheet/Slides) — no tile, the icon carries its own color */
.card .icon.app {
  width: 54px; height: 54px;
  background: none;
  border-radius: 0;
  margin-bottom: 0;
}
.card .icon.app img { width: 100%; height: 100%; display: block; }

.card h3 { margin: 0; font-size: 19px; }
.card p { margin: 0; color: var(--text-soft); font-size: 14.5px; flex: 1; }

.card .links { display: flex; gap: 14px; flex-wrap: wrap; font-size: 14px; font-weight: 600; }

.card .btn { text-align: center; margin-top: 4px; }
.card-note { margin: 0; font-size: 12.5px; color: var(--text-soft); opacity: 0.8; }

.badge {
  position: absolute;
  top: 20px; right: 20px;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-soft);
  background: var(--bg-soft);
}
.badge.live { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, transparent); background: color-mix(in srgb, var(--ok) 10%, transparent); }

/* Downloads dos apps desktop: os selos são montados por assets/downloads.js */

.downloads { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 0; }
.dl-badge {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  color: var(--text);
}
.dl-badge > span { display: inline-flex; align-items: center; padding: 6px 9px; }
@media (max-width: 380px) { .dl-badge { white-space: normal; } }
.dl-badge .dl-k { background: var(--bg-soft); color: var(--text-soft); font-weight: 500; }
.dl-badge .dl-v { background: var(--accent); color: light-dark(#fff, #0d1117); }
a.dl-badge:hover { text-decoration: none; filter: brightness(1.08); }
.card.write .dl-badge .dl-v { background: var(--write); }
.card.sheet .dl-badge .dl-v { background: var(--sheet); }
.card.slides .dl-badge .dl-v { background: var(--slides); }
.dl-badge.soon { cursor: default; border-style: dashed; }
.dl-badge.soon .dl-v,
.card .dl-badge.soon .dl-v { background: var(--bg); color: var(--text-soft); font-weight: 500; }

/* Pilares */

.pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 860px) { .pillars { grid-template-columns: 1fr; } }

.pillar {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-soft);
  padding: 20px 22px;
}
.pillar h3 { margin: 0 0 6px; font-size: 16px; }
.pillar p { margin: 0; font-size: 14px; color: var(--text-soft); }

/* Faixa de código na landing */

.code-strip {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.code-strip .bar {
  display: flex;
  gap: 6px;
  padding: 10px 14px;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--border);
}
.code-strip .bar i {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--border); display: block;
}
.code-strip pre { margin: 0; border: none; border-radius: 0; }

footer.site-footer {
  border-top: 1px solid var(--border);
  padding: 28px 24px;
  text-align: center;
  color: var(--text-soft);
  font-size: 13.5px;
  margin-top: 40px;
}

/* ---------- Docs ---------- */

.docs-layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  max-width: 1240px;
  margin: 0 auto;
}

.sidebar {
  position: sticky;
  top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
  padding: 24px 8px 40px 24px;
  border-right: 1px solid var(--border);
  font-size: 14px;
}

.sidebar .group { margin-bottom: 22px; }
.sidebar .group > .title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-soft);
  margin: 0 0 8px;
}
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar li a {
  display: block;
  padding: 5px 10px;
  border-radius: 6px;
  color: var(--text-soft);
}
.sidebar li a:hover { color: var(--text); background: var(--bg-soft); text-decoration: none; }
.sidebar li a.active { color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.sidebar li span.soon-item {
  display: block;
  padding: 5px 10px;
  color: var(--text-soft);
  opacity: 0.6;
}
.sidebar .soon-tag {
  font-size: 10.5px;
  font-weight: 600;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 1px 7px;
  margin-left: 6px;
  vertical-align: 1px;
}
.sidebar .nav-ico { width: 16px; height: 16px; margin-right: 8px; vertical-align: -3px; }
.sidebar .group > .title.with-ico { display: flex; align-items: center; }
.sidebar .group > .title.with-ico .nav-ico { width: 15px; height: 15px; vertical-align: 0; }

.content {
  padding: 36px 40px 80px;
  min-width: 0;
  max-width: 860px;
}

.content h1 { font-size: 30px; letter-spacing: -0.01em; margin: 0 0 8px; }
.content h2 {
  font-size: 21px;
  margin: 40px 0 12px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.content h3 { font-size: 16.5px; margin: 26px 0 8px; }
.content p.lead-doc { color: var(--text-soft); font-size: 16.5px; margin: 0 0 24px; }

.content table {
  border-collapse: collapse;
  width: 100%;
  font-size: 13.5px;
  margin: 14px 0;
  display: block;
  overflow-x: auto;
}
.content th, .content td {
  border: 1px solid var(--border);
  padding: 7px 11px;
  text-align: left;
  vertical-align: top;
}
.content th { background: var(--bg-soft); font-weight: 600; white-space: nowrap; }
.content td code { white-space: nowrap; }
.content td:last-child code { white-space: normal; }

.callout {
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  background: var(--bg-soft);
  padding: 12px 16px;
  margin: 16px 0;
  font-size: 14.5px;
}
.callout.warn { border-left-color: var(--warn); }
.callout p { margin: 0; }
.callout .downloads { margin-top: 10px; }
.callout p + p { margin-top: 8px; }

.status-ok { color: var(--ok); font-weight: 600; }
.status-partial { color: var(--warn); font-weight: 600; }
.status-no { color: var(--text-soft); font-weight: 600; }

/* ---------- Live demo widgets ---------- */

/* Inline Material Symbols SVG icons used by the live-demo buttons. Sized here;
   `fill: currentColor` lets each icon inherit its button's text color. */
.micon {
  width: 20px;
  height: 20px;
  display: inline-block;
  flex: none;
  fill: currentColor;
  pointer-events: none;
}

.demo {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 18px 0 8px;
}
.demo-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 10px 12px;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--border);
}
.demo-toolbar button,
.demo-toolbar select {
  font: inherit;
  font-size: 13px;
  line-height: 1.2;
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
}
.demo-toolbar button:hover { background: var(--accent-soft); border-color: var(--accent); }
.demo-toolbar button:active { transform: translateY(1px); }
.demo-toolbar .sep { width: 1px; align-self: stretch; background: var(--border); margin: 2px 4px; }
.demo-toolbar .spacer { flex: 1 1 auto; }
.demo-toolbar .lbl { font-size: 12px; font-weight: 600; color: var(--text-soft); }
.demo-toolbar u-icon-button,
.demo-toolbar u-button { vertical-align: middle; }
.demo-stage {
  height: 520px;
  background: #eceef1;
  overflow: hidden;
}
.demo-stage universal-write,
.demo-stage universal-write-diff { display: block; width: 100%; height: 100%; }
.demo-status {
  padding: 8px 12px;
  font-size: 12.5px;
  color: var(--text-soft);
  border-top: 1px solid var(--border);
  background: var(--bg-soft);
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
}
.demo-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 6px 0 0;
  font-size: 13px;
}
.demo-controls .lbl { font-size: 12px; font-weight: 600; color: var(--text-soft); }
.demo-controls button {
  font: inherit;
  font-size: 12.5px;
  padding: 4px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
}
.demo-controls button:hover { background: var(--bg-soft); }
.demo-controls button.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.demo-controls .uw-sep2 { width: 1px; height: 18px; background: var(--border); margin: 0 6px; }
.demo-controls .uw-note { color: var(--text-soft); font-size: 12px; margin-left: auto; }

.demo + details { margin: 0 0 26px; font-size: 14px; }
.demo + details > summary { cursor: pointer; color: var(--accent); padding: 4px 0; }
.demo + details > summary:hover { text-decoration: underline; }
.demo + details pre { margin-top: 10px; }
.demo-note {
  border: 1px dashed var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--text-soft);
  background: var(--bg-soft);
  margin: 10px 0 0;
}

.pager {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 56px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 14px;
}
.pager a {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 16px;
  color: var(--text);
  max-width: 48%;
}
.pager a:hover { text-decoration: none; border-color: var(--accent); }
.pager a small { display: block; color: var(--text-soft); font-size: 12px; }
.pager .next { margin-left: auto; text-align: right; }

@media (max-width: 900px) {
  .docs-layout { grid-template-columns: 1fr; }
  .sidebar {
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 20px 24px;
  }
  .content { padding: 28px 24px 60px; }
}

/* GIFs de demonstração nas páginas de docs (gerados por tools/gifs/record.mjs) */
.content img.doc-demo {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 18px 0 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12);
}
