/* FavoritosAI — folha de estilo única, sem dependências externas. */

/* ------------------------------------------------------------------ tokens */
/* Cores, raios e tipografia vêm de shared/design-tokens.json via
   public/generated-tokens.css. Este bloco guarda apenas o que é específico da web. */
:root {
  --shadow-sm: 0 1px 2px rgba(27, 26, 23, 0.05);
  --shadow-md: 0 10px 30px -18px rgba(27, 26, 23, 0.45);
  --shadow-lg: 0 30px 80px -40px rgba(27, 26, 23, 0.55);
  --serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "Cascadia Code", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --rail: 264px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

[data-theme="dark"] {
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 12px 32px -20px rgba(0, 0, 0, 0.9);
  --shadow-lg: 0 40px 90px -50px rgba(0, 0, 0, 0.95);
}

/* ------------------------------------------------------------------- reset */
*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: radial-gradient(circle at 15% 5%, rgba(180, 69, 31, 0.06), transparent 42%),
    radial-gradient(circle at 90% 0%, rgba(47, 107, 79, 0.05), transparent 38%);
}

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.15;
  margin: 0;
  color: var(--ink);
}

p { margin: 0; }
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; display: block; }
kbd { font-family: var(--mono); }
svg { flex: none; }
[hidden] { display: none !important; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

::selection { background: var(--accent-soft); color: var(--accent-ink); }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--paper);
  padding: 10px 16px;
  border-radius: 0 0 var(--radius-sm) 0;
  z-index: 100;
}
.skip-link:focus { left: 0; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* -------------------------------------------------------------------- boot */
.boot {
  position: fixed;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 10px;
  text-align: center;
  background: var(--paper);
  z-index: 50;
}
.boot-mark {
  font-family: var(--serif);
  font-size: 30px;
  letter-spacing: -0.02em;
}
.boot-mark em { color: var(--accent); font-style: normal; }
.boot p { color: var(--muted); font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; }

/* -------------------------------------------------------------------- auth */
.auth {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(380px, 0.85fr);
  gap: clamp(24px, 6vw, 96px);
  padding: clamp(28px, 5vw, 72px);
  align-items: center;
  max-width: 1280px;
  margin: 0 auto;
}

.auth-story { max-width: 620px; }

.auth-story h1 {
  font-size: clamp(38px, 5.4vw, 68px);
  margin: 30px 0 22px;
  line-height: 1.02;
}
.auth-story h1 em { color: var(--accent); font-style: italic; }

.auth-lede {
  font-size: 17px;
  color: var(--ink-soft);
  max-width: 52ch;
}

.auth-points {
  list-style: none;
  padding: 0;
  margin: 30px 0 0;
  display: grid;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding-top: 22px;
}
.auth-points li {
  color: var(--muted);
  font-size: 14px;
  padding-left: 22px;
  position: relative;
}
.auth-points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1.5px solid var(--accent);
}
.auth-points strong { color: var(--ink); font-weight: 600; }

.auth-panel {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(24px, 3vw, 38px);
  box-shadow: var(--shadow-lg);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 19px;
  letter-spacing: -0.01em;
}
.brand:hover { text-decoration: none; }
.brand-name em { color: var(--accent); font-style: normal; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--ink);
  color: var(--paper);
  font-size: 17px;
  font-weight: 600;
}
.brand-large { font-size: 22px; }
.brand-large .brand-mark { width: 38px; height: 38px; font-size: 20px; }

.auth-tabs {
  display: flex;
  gap: 6px;
  padding: 4px;
  background: var(--paper-sunken);
  border-radius: var(--radius-pill);
  margin-bottom: 26px;
}
.auth-tab {
  flex: 1;
  border: 0;
  background: transparent;
  padding: 9px 14px;
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}
.auth-tab.is-active {
  background: var(--paper-raised);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

.stack { display: grid; gap: 16px; }

.field { display: grid; gap: 7px; }
.field > span {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.field input,
.field textarea,
.field select,
.input,
.select,
.textarea {
  width: 100%;
  background: var(--paper);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  font-size: 15px;
  color: var(--ink);
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.field input::placeholder,
.textarea::placeholder { color: var(--faint); }
.field input:focus,
.field textarea:focus,
.field select:focus,
.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.textarea { resize: vertical; min-height: 90px; line-height: 1.5; }
.field input[readonly] {
  background: var(--paper-sunken);
  color: var(--muted);
  cursor: not-allowed;
}

.check {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13.5px;
  color: var(--muted);
}
.check input { width: 16px; height: 16px; accent-color: var(--accent); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 550;
  background: var(--paper-sunken);
  color: var(--ink);
  transition: transform 0.12s var(--ease), background 0.15s var(--ease),
    border-color 0.15s var(--ease), color 0.15s var(--ease);
}
.btn:hover { background: var(--line); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: #fff8f2; border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-ink); border-color: var(--accent-ink); }
.btn-ghost { background: transparent; border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--paper-sunken); }
.btn-danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn-danger:hover { background: var(--danger-soft); }
.btn-block { width: 100%; padding: 12px 18px; font-size: 15px; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-icon { padding: 8px; width: 36px; height: 36px; border-radius: 50%; }

.form-note {
  min-height: 18px;
  font-size: 13px;
  color: var(--danger);
}
.form-note.is-ok { color: var(--ok); }

.auth-foot {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--faint);
  line-height: 1.6;
}

/* --------------------------------------------------------------------- app */
.app {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr);
  min-height: 100vh;
}

.rail {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 26px 20px 18px;
  border-right: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper) 82%, var(--paper-raised));
  backdrop-filter: blur(6px);
}

.add-button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 1px solid var(--accent-line);
  background: var(--accent-soft);
  color: var(--accent-ink);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  font-size: 14px;
  font-weight: 550;
  transition: background 0.15s var(--ease), transform 0.12s var(--ease);
}
.add-button:hover { background: var(--accent); color: #fff8f2; border-color: var(--accent); }
.add-button:active { transform: translateY(1px); }
.add-button .icon { width: 17px; height: 17px; }
.add-button-secondary {
  background: var(--paper-raised);
  color: var(--ink);
  border-color: var(--line);
}
.add-button-secondary:hover { background: var(--paper-sunken); color: var(--ink); border-color: var(--line-strong); }
.add-button[hidden], .icon-button[hidden] { display: none !important; }

.voice-stage { display: grid; gap: 14px; justify-items: center; padding: 8px 0 2px; }
.voice-stage .form-note { text-align: center; }
.voice-timer { font-size: 34px; font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }
.voice-level { display: flex; align-items: center; gap: 4px; height: 40px; }
.voice-level i {
  width: 4px;
  height: 6px;
  border-radius: 999px;
  background: var(--accent);
  opacity: 0.65;
  transition: height 0.12s linear;
}
.voice-actions { display: flex; gap: 8px; align-items: center; justify-content: center; flex-wrap: wrap; }
.voice-record { min-width: 190px; justify-content: center; border-radius: 999px; padding: 13px 22px; }
.voice-record.is-recording { background: var(--danger); border-color: var(--danger); color: var(--paper-raised); }
.voice-audio { width: 100%; }
.voice-note-card {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--paper-sunken);
  border-radius: var(--radius-sm);
  padding: 13px;
  display: grid;
  gap: 9px;
}
.voice-note-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.voice-note-head strong { font-size: 14px; }
.voice-transcript {
  font-size: 13.5px;
  line-height: 1.55;
  white-space: pre-wrap;
  color: var(--ink-soft);
}
.voice-last { width: 100%; display: grid; gap: 6px; padding-top: 8px; border-top: 1px solid var(--line); }
.voice-last-item { justify-content: flex-start; text-align: left; width: 100%; }
.voice-detail { display: grid; gap: 11px; }
.voice-transcript-block { display: grid; gap: 7px; padding-top: 4px; border-top: 1px solid var(--line); }

.rail-nav { display: grid; gap: 3px; }
.rail-nav a {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 500;
}
.rail-nav a:hover { background: var(--paper-sunken); text-decoration: none; }
.rail-nav a.is-active {
  background: var(--paper-raised);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line), var(--shadow-sm);
}
.rail-nav a.is-active .icon { color: var(--accent); }

.rail-foot { margin-top: auto; display: grid; gap: 12px; }
.rail-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  padding: 12px 0 0;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--faint);
}
.rail-stats strong { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 7px 8px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  text-align: left;
}
.user-chip:hover { background: var(--paper-sunken); border-color: var(--line); }
.avatar {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}
.user-text { display: grid; min-width: 0; line-height: 1.25; }
.user-text strong { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-text small { font-size: 11.5px; color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip .icon { margin-left: auto; width: 15px; height: 15px; color: var(--faint); }

.menu {
  position: absolute;
  left: 18px;
  bottom: 66px;
  min-width: 180px;
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  padding: 5px;
  z-index: 30;
}
.menu button {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  border: 0;
  background: transparent;
  padding: 9px 10px;
  border-radius: 6px;
  font-size: 13.5px;
  text-align: left;
}
.menu button:hover { background: var(--paper-sunken); }

/* ------------------------------------------------------------------- main */
.main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(180px, auto) minmax(220px, 560px) auto;
  align-items: center;
  gap: 18px;
  padding: 18px clamp(18px, 3vw, 34px);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-title h2 { font-size: 21px; }
.topbar-title p { font-size: 12.5px; color: var(--faint); margin-top: 2px; }

.global-search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  background: var(--paper-raised);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  padding: 8px 12px 8px 14px;
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.global-search:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.global-search .icon { color: var(--faint); width: 17px; height: 17px; }
.global-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  font-size: 14px;
  outline: none;
}
.kbd {
  font-size: 10.5px;
  color: var(--faint);
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 1px 5px;
  background: var(--paper);
  white-space: nowrap;
}

.topbar-actions { display: flex; align-items: center; gap: 10px; }
.icon-button {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--paper-raised);
  color: var(--ink-soft);
}
.icon-button:hover { background: var(--paper-sunken); }
.queue-badge[hidden] {
  display: none !important;
}

.queue-badge {
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  color: var(--warn);
  background: var(--warn-soft);
  border: 1px solid color-mix(in srgb, var(--warn) 30%, transparent);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

.view {
  flex: 1;
  padding: clamp(20px, 3vw, 34px);
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
  outline: none;
}

/* ------------------------------------------------------------- biblioteca */
.library-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}
.library-lead { max-width: 58ch; }
.library-lead h3 { font-size: clamp(24px, 3vw, 34px); margin-bottom: 6px; }
.library-lead p { color: var(--muted); font-size: 14px; }
.library-count { color: var(--faint); font-size: 12.5px; }

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  border: 1px solid var(--line);
  background: var(--paper-raised);
  color: var(--ink-soft);
  border-radius: var(--radius-pill);
  padding: 6px 13px;
  font-size: 13px;
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease), color 0.15s var(--ease);
}
.chip:hover { border-color: var(--line-strong); background: var(--paper-sunken); }
.chip.is-active { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.chip .count { opacity: 0.6; margin-left: 6px; font-variant-numeric: tabular-nums; }

.toolbar-right { margin-left: auto; display: flex; align-items: center; gap: 9px; }
.select-compact {
  border: 1px solid var(--line);
  background: var(--paper-raised);
  border-radius: var(--radius-pill);
  padding: 6px 10px;
  font-size: 13px;
  color: var(--ink-soft);
}


.sponsor-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px;
  border: 1px dashed var(--line-strong, var(--line));
  border-radius: var(--radius-lg, 16px);
  background: var(--surface, var(--paper));
  color: inherit;
  text-decoration: none;
}

.sponsor-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
  gap: 16px;
}

.link-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0;
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.18s var(--ease), border-color 0.18s var(--ease),
    box-shadow 0.18s var(--ease);
  text-align: left;
  padding: 0;
  color: inherit;
  font: inherit;
}
.link-card:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-md);
}
.link-card.family-reproduction .card-cover { height: 172px; }
.link-card.family-reproduction .card-title { font-size: 17px; }
.link-card.family-transaction .card-cover { height: 158px; }
.link-card.family-transaction .card-title { font-size: 16.5px; }
.link-card.family-editorial .card-title { font-size: 19px; }
.link-card.family-listing .card-title { font-size: 16.5px; }
.link-card.family-document .card-cover { height: 112px; }
.link-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.card-cover {
  height: 132px;
  background: var(--paper-sunken);
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  position: relative;
}
.card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.92);
  transition: transform 0.35s var(--ease);
}
.link-card:hover .card-cover img { transform: scale(1.03); }
.card-cover.is-empty {
  display: grid;
  place-items: center;
  position: relative;
  background-image: linear-gradient(135deg, var(--cover-a, var(--paper-sunken)), var(--cover-b, var(--paper-raised)));
}
.card-cover.tone-0 { --cover-a: var(--accent-soft); --cover-b: var(--paper-sunken); }
.card-cover.tone-1 { --cover-a: var(--warn-soft); --cover-b: var(--paper-sunken); }
.card-cover.tone-2 { --cover-a: var(--ok-soft); --cover-b: var(--paper-sunken); }
.card-cover.tone-3 { --cover-a: var(--accent-soft); --cover-b: var(--warn-soft); }
.card-cover.is-empty::after {
  content: "";
  position: absolute;
  width: 170px;
  height: 170px;
  right: -48px;
  top: -72px;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--paper-raised) 70%, transparent), transparent 68%);
  pointer-events: none;
}
.card-cover.is-empty .cover-letter {
  position: relative;
  z-index: 1;
  font-family: var(--serif);
  font-size: 40px;
  color: var(--ink-soft);
  opacity: 0.62;
}

.card-body { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px 16px; flex: 1; }
.card-top { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--faint); }
.card-domain {
  text-transform: lowercase;
  letter-spacing: 0.02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.video-flag {
  margin-left: auto;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent-ink);
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  border-radius: var(--radius-pill);
  padding: 1px 7px;
  white-space: nowrap;
}
.card-title {
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.25;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-summary {
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
  font-size: 11.5px;
  color: var(--faint);
}
.card-foot .star { color: var(--accent); }
.card-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.tag {
  font-size: 11px;
  color: var(--ink-soft);
  background: var(--paper-sunken);
  border: 1px solid var(--line);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}
.tag.is-topic { background: transparent; border-style: dashed; color: var(--muted); }

.status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.status-ready { color: var(--ok); }
.status-pending, .status-capturing, .status-analyzing { color: var(--warn); }
.status-failed { color: var(--danger); }

/* ------------------------------------------------------------ esqueletos */
.skeleton { pointer-events: none; }
.skeleton .sk {
  background: linear-gradient(90deg, var(--paper-sunken) 25%, var(--line) 37%, var(--paper-sunken) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.3s ease infinite;
  border-radius: 6px;
}
.sk-cover { height: 132px; border-radius: 0; }
.sk-line { height: 12px; margin: 8px 0; }
.sk-line.w60 { width: 60%; }
.sk-line.w40 { width: 40%; }
@keyframes shimmer {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

/* -------------------------------------------------------------- detalhes */
.detail {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: min(560px, 100vw);
  background: var(--paper-raised);
  border-left: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  z-index: 40;
  display: flex;
  flex-direction: column;
  animation: slide-in 0.24s var(--ease);
}
@keyframes slide-in {
  from { transform: translateX(24px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.detail-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--paper-raised);
}
.detail-head-main { min-width: 0; flex: 1; }
.detail-domain { font-size: 11.5px; color: var(--faint); text-transform: lowercase; letter-spacing: 0.03em; }
.detail-title { font-size: 24px; line-height: 1.2; margin: 5px 0 0; }
.detail-tools { display: flex; gap: 4px; }

.detail-scroll { overflow-y: auto; padding: 20px 20px 120px; display: grid; gap: 22px; }

.pull-refresh {
  position: absolute;
  inset: 0 0 auto;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  overflow: hidden;
  height: 0;
  opacity: 0;
  pointer-events: none;
  color: var(--muted);
  background: linear-gradient(180deg, var(--paper-raised), color-mix(in srgb, var(--paper-raised) 86%, transparent));
  border-bottom: 1px solid transparent;
  transition: height 0.12s ease, opacity 0.12s ease;
}
.pull-refresh[data-ready="true"] {
  color: var(--accent-ink);
  border-bottom-color: var(--line);
}
.pull-refresh-icon {
  display: inline-flex;
  font-size: 18px;
  line-height: 1;
  transition: transform 0.1s linear;
}
.pull-refresh-label { font-size: 12.5px; letter-spacing: 0.01em; }
@media (prefers-reduced-motion: reduce) {
  .pull-refresh, .pull-refresh-icon { transition: none; }
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-size: 12.5px;
  color: var(--faint);
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.detail-meta a { color: var(--accent-ink); }




.profile-cover {
  width: 100%;
  max-height: 320px;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 10px;
}

.section-pending {
  opacity: 0.75;
}

.section-pending-line {
  height: 12px;
  width: min(280px, 70%);
  border-radius: 999px;
  background: linear-gradient(90deg, var(--line) 25%, var(--line-strong, var(--line)) 50%, var(--line) 75%);
  background-size: 200% 100%;
  animation: section-pending-shimmer 1.4s linear infinite;
  margin-bottom: 10px;
}

.section-pending p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 13px;
}

@keyframes section-pending-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.detail-progress {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

.detail-progress li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ink-soft);
}

.detail-progress li small {
  margin-left: auto;
  font-size: 11px;
  opacity: 0.8;
}

.detail-progress-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--line-strong, var(--line));
  flex: none;
}

.detail-progress .is-done .detail-progress-dot {
  background: var(--accent, #2e7d5b);
}

.detail-progress .is-pending .detail-progress-dot {
  animation: detail-progress-pulse 1.2s ease-in-out infinite;
}

@keyframes detail-progress-pulse {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 1; }
}

.summary-box {
  background: linear-gradient(180deg, var(--accent-soft), transparent);
  border: 1px solid var(--accent-line);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.summary-box h4,
.section-title {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}
.summary-box p { font-size: 14.5px; line-height: 1.6; color: var(--ink-soft); }

.section { display: grid; gap: 10px; }
.review-stage { max-width: 760px; display: grid; gap: 14px; }
.review-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-raised);
  padding: 22px;
  display: grid;
  gap: 16px;
}
.review-meta { display: flex; justify-content: space-between; gap: 12px; }
.review-meta a { color: var(--accent-ink); text-decoration: none; }
.review-question { font-family: var(--serif); font-size: 23px; line-height: 1.35; margin: 0; }
.review-options { display: grid; gap: 8px; }
.review-option {
  text-align: left;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  padding: 11px 13px;
  cursor: pointer;
}
.review-option:hover:not(:disabled) { border-color: var(--line-strong); }
.review-option:disabled { cursor: default; opacity: 0.72; }
.review-option.is-correct { border-color: var(--ok); background: var(--ok-soft); opacity: 1; }
.review-option.is-wrong { border-color: var(--danger); background: var(--danger-soft); }
.review-feedback {
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: grid;
  gap: 6px;
}
.review-feedback.is-ok { background: var(--ok-soft); }
.review-feedback.is-error { background: var(--danger-soft); }
.review-feedback p { margin: 0; }
.quality-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-sunken);
  padding: 12px 14px;
  display: grid;
  gap: 9px;
}
.quality-stats { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.quality-stats strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.setting-line {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}
.setting-line:last-child { border-bottom: 0; padding-bottom: 0; }
.setting-line > div:first-child { display: grid; gap: 3px; min-width: 0; }
.check-inline {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--muted);
  cursor: pointer;
}
.check-inline input { margin-top: 2px; accent-color: var(--accent); }
.highlight-list { display: grid; gap: 8px; }
.highlight-card {
  border-left: 3px solid var(--accent);
  background: var(--paper-raised);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 9px 12px;
  display: grid;
  gap: 5px;
}
.highlight-card blockquote {
  margin: 0;
  font-family: var(--serif);
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--ink);
}
.highlight-note { margin: 0; font-size: 12.5px; color: var(--muted); }
.highlight-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.highlight-pop {
  position: fixed;
  z-index: 90;
  width: 320px;
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--paper-raised);
  box-shadow: var(--shadow-lg);
}
.highlight-pop .hint { margin: 0; }
.highlight-note-input { min-height: 54px; }
.kv { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; }
.kv li {
  position: relative;
  padding-left: 18px;
  font-size: 14px;
  color: var(--ink-soft);
  line-height: 1.55;
}
.kv li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 9px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.65;
}
.quote-list { display: grid; gap: 8px; }
.quote-list blockquote {
  margin: 0;
  border-left: 2px solid var(--accent);
  padding: 2px 0 2px 14px;
  font-family: var(--serif);
  font-size: 15px;
  color: var(--ink-soft);
}
.entity-list { display: flex; flex-wrap: wrap; gap: 6px; }
.entity {
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 4px 10px;
  font-size: 12px;
  color: var(--ink-soft);
}
.entity small { color: var(--faint); margin-left: 5px; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.05em; }

.content-body {
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink-soft);
  border-top: 1px solid var(--line);
  padding-top: 18px;
}
.content-body[hidden] { display: none; }
.prose > * + * { margin-top: 0.9em; }
.prose h1, .prose h2, .prose h3, .prose h4 { color: var(--ink); margin-top: 1.6em; }
.prose h2 { font-size: 21px; }
.prose h3 { font-size: 17px; }
.prose ul, .prose ol { padding-left: 1.35em; }
.prose li + li { margin-top: 0.3em; }
.prose blockquote {
  margin: 1em 0;
  padding: 2px 16px;
  border-left: 3px solid var(--accent-line);
  color: var(--muted);
  font-style: italic;
}
.prose code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: var(--paper-sunken);
  padding: 1px 5px;
  border-radius: var(--radius-sm);
}
.prose pre {
  background: var(--paper-sunken);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  overflow-x: auto;
}
.prose pre code { background: none; padding: 0; font-size: 12.5px; }
.prose img { border-radius: var(--radius-sm); margin: 1em 0; }
.prose a { text-decoration: underline; text-underline-offset: 2px; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 1.6em 0; }

.detail-foot {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  gap: 8px;
  padding: 14px 20px;
  background: color-mix(in srgb, var(--paper-raised) 92%, transparent);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--line);
}

.note-editor { display: grid; gap: 8px; }
.inline-list { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.link-button {
  border: 0;
  background: transparent;
  color: var(--accent-ink);
  padding: 0;
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ------------------------------------------------------------------- chat */
.chat-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 16px;
  height: calc(100vh - 150px);
  min-height: 480px;
}
.chat-sidebar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-raised);
  padding: 12px;
  overflow: hidden;
}
.chat-sidebar-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.chat-sidebar-head h3 { font-size: 15px; }
.chat-list { overflow-y: auto; display: grid; gap: 3px; margin: 0 -4px; padding: 0 4px; }
.chat-item {
  display: grid;
  gap: 2px;
  text-align: left;
  border: 1px solid transparent;
  background: transparent;
  border-radius: var(--radius-sm);
  padding: 9px 10px;
  color: var(--ink-soft);
}
.chat-item:hover { background: var(--paper-sunken); }
.chat-item.is-active { background: var(--paper-sunken); border-color: var(--line); color: var(--ink); }
.chat-item strong { font-size: 13px; font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-item small { font-size: 11px; color: var(--faint); }

.chat-main {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-raised);
  min-height: 0;
  overflow: hidden;
}
.chat-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}
.chat-head h3 { font-size: 16px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-scroll { flex: 1; overflow-y: auto; padding: 20px 16px; display: flex; flex-direction: column; gap: 18px; }

.message { display: flex; gap: 10px; max-width: 780px; }
.message-avatar {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--paper-sunken);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  flex: none;
}
.message.assistant .message-avatar { background: var(--accent); color: #fff8f2; }
.message-body { min-width: 0; display: grid; gap: 6px; }
.message.user { margin-left: auto; flex-direction: row-reverse; }
.message.user .message-body {
  background: var(--paper-sunken);
  border: 1px solid var(--line);
  border-radius: var(--radius) var(--radius) 4px var(--radius);
  padding: 10px 14px;
}
.message.assistant .message-body { padding: 2px 0; }
.message-text { font-size: 14.5px; line-height: 1.65; color: var(--ink-soft); overflow-wrap: anywhere; }
.message.user .message-text { color: var(--ink); }
.message-text p + p { margin-top: 0.7em; }
.message-text pre { background: var(--paper-sunken); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; overflow-x: auto; }
.message-text code { font-family: var(--mono); font-size: 0.88em; background: var(--paper-sunken); padding: 1px 4px; border-radius: var(--radius-sm); }
.message-text pre code { background: none; padding: 0; }
.message-text ul, .message-text ol { padding-left: 1.3em; margin: 0.5em 0; }
.message-text h3, .message-text h4 { font-family: var(--sans); font-size: 14px; margin: 0.9em 0 0.3em; }
.message-text a { text-decoration: underline; }

.cite {
  display: inline-grid;
  place-items: center;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  margin: 0 1px;
  border-radius: 5px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 10.5px;
  font-weight: 700;
  border: 1px solid var(--accent-line);
  vertical-align: 1px;
}
.cite:hover { background: var(--accent); color: #fff8f2; }

.citations { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 2px; }
.citation {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: var(--radius-pill);
  padding: 3px 9px 3px 4px;
  font-size: 11.5px;
  color: var(--muted);
}
.citation:hover { border-color: var(--accent-line); color: var(--accent-ink); }
.citation-n {
  display: grid;
  place-items: center;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 10px;
  font-weight: 700;
}
.citation span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ------------------------------------------------------- evidências do chat */
.chat-evidence {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-sunken);
  padding: 0 12px;
  margin-top: 2px;
}
.chat-evidence[open] { padding: 4px 14px 12px; }
.chat-evidence summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 0;
  cursor: pointer;
  list-style: none;
  font-size: 12px;
  color: var(--muted);
}
.chat-evidence summary::-webkit-details-marker { display: none; }
.chat-evidence summary::before {
  content: "▸";
  color: var(--faint);
  font-size: 10px;
  transition: transform 0.15s var(--ease);
}
.chat-evidence[open] summary::before { transform: rotate(90deg); }
.chat-evidence-label { flex: 1; font-weight: 600; color: var(--ink-soft); }
.chat-evidence-count {
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: var(--radius-pill);
  padding: 1px 8px;
  font-size: 10.5px;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}
.chat-evidence-body { display: grid; gap: 10px; }
.chat-evidence-focus {
  display: grid;
  gap: 3px;
  border-left: 2px solid var(--accent-line);
  padding-left: 10px;
}
.chat-evidence-focus strong {
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 500;
}
.chat-evidence-focus p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}
.chat-evidence-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.chat-evidence-item {
  display: flex;
  gap: 8px;
  padding: 9px 0;
  border-top: 1px solid var(--line);
}
.chat-evidence-item:first-child { border-top: 0; padding-top: 2px; }
.chat-evidence-copy { display: grid; gap: 3px; min-width: 0; }
.chat-evidence-top { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.chat-evidence-title {
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.chat-evidence-title:hover { color: var(--accent-ink); text-decoration: underline; }
.chat-evidence-kind {
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 1px 7px;
  font-size: 9.5px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--faint);
}
.chat-evidence-kind.is-graph { border-color: var(--accent-line); color: var(--accent-ink); }
.chat-evidence-kind.is-web { border-color: var(--line-strong); color: var(--ink-soft); }
.chat-evidence-kind.is-focus { border-color: var(--accent); color: var(--accent-ink); }
.chat-evidence-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 11px;
  color: var(--faint);
}
.chat-evidence-heading { font-style: italic; }
.chat-evidence-snippet {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}
.chat-evidence-neighbors {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  border-top: 1px dashed var(--line);
  padding-top: 8px;
}
.chat-evidence-tag {
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: var(--radius-pill);
  padding: 1px 8px;
  font-size: 11px;
  color: var(--muted);
}
.chat-evidence-note { margin: 0; font-size: 11px; }

.chat-empty {
  margin: auto;
  max-width: 520px;
  text-align: center;
  display: grid;
  gap: 14px;
  padding: 30px 10px;
}
.chat-empty h3 { font-size: 26px; }
.chat-empty p { color: var(--muted); font-size: 14px; }
.suggestions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.suggestion {
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: var(--radius-pill);
  padding: 7px 13px;
  font-size: 13px;
  color: var(--ink-soft);
}
.suggestion:hover { border-color: var(--accent-line); color: var(--accent-ink); background: var(--accent-soft); }

.composer {
  display: grid;
  gap: 8px;
  padding: 12px 16px 14px;
  border-top: 1px solid var(--line);
  background: var(--paper-raised);
}
.composer-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--paper);
  padding: 8px 8px 8px 14px;
}
.composer-row:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.composer textarea {
  flex: 1;
  border: 0;
  background: transparent;
  resize: none;
  min-height: 26px;
  max-height: 180px;
  font-size: 14.5px;
  line-height: 1.5;
  outline: none;
  padding: 4px 0;
}
.composer-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 11.5px; color: var(--faint); }
.scope-select {
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: var(--radius-pill);
  padding: 3px 9px;
  font-size: 11.5px;
  color: var(--muted);
}

.typing { display: inline-flex; gap: 4px; align-items: center; color: var(--faint); font-size: 12px; }
.typing i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  animation: blink 1.2s infinite;
}
.typing i:nth-child(2) { animation-delay: 0.15s; }
.typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes blink { 0%, 80%, 100% { opacity: 0.25; } 40% { opacity: 1; } }

/* -------------------------------------------------------------- coleções */
.collections-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}
.collection-card {
  display: grid;
  gap: 8px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-raised);
  text-align: left;
  transition: transform 0.16s var(--ease), border-color 0.16s var(--ease), box-shadow 0.16s var(--ease);
}
.collection-card:hover { transform: translateY(-2px); border-color: var(--line-strong); box-shadow: var(--shadow-md); }
.collection-card h3 { font-size: 19px; display: flex; align-items: center; gap: 8px; }
.color-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); flex: none; }
.collection-card p { font-size: 13px; color: var(--muted); min-height: 20px; }
.collection-card small { font-size: 11.5px; color: var(--faint); }
.collection-new {
  border: 1px dashed var(--line-strong);
  background: transparent;
  display: grid;
  place-content: center;
  gap: 6px;
  min-height: 132px;
  color: var(--muted);
  font-size: 13px;
}
.collection-new:hover { border-color: var(--accent); color: var(--accent-ink); background: var(--accent-soft); }

/* --------------------------------------------------------------- ajustes */
.settings-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; max-width: 900px; }
.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-raised);
  padding: 20px;
  display: grid;
  gap: 14px;
}
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.panel-head h3 { font-size: 19px; }
.panel-head p { font-size: 13px; color: var(--muted); margin-top: 4px; max-width: 60ch; }
.panel-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.panel-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.provider-profiles-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.provider-profiles-head strong { font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.provider-profiles { display: flex; flex-wrap: wrap; gap: 8px; }
.provider-profile {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  padding: 7px 9px;
  min-width: 0;
}
.provider-profile.is-active { border-color: var(--accent-line); background: var(--accent-soft); }
.provider-profile-main {
  border: 0;
  background: transparent;
  color: var(--accent-ink);
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 2px 4px;
}
.provider-profile-main:disabled { cursor: default; }
.provider-profile-copy { display: grid; min-width: 0; }
.provider-profile-copy strong { font-size: 13px; }
.provider-profile-copy small { color: var(--faint); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 240px; }
.provider-profile-remove {
  border: 0;
  background: transparent;
  color: var(--danger);
  font: inherit;
  font-size: 11px;
  cursor: pointer;
  padding: 3px;
}
.provider-profile-remove:hover { text-decoration: underline; }
.provider-profile .badge { font-size: 9px; padding: 2px 6px; }
.hint { font-size: 12px; color: var(--faint); }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-radius: var(--radius-pill);
  padding: 3px 9px;
  background: var(--paper-sunken);
  color: var(--muted);
}
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; }
.stat {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  background: var(--paper);
}
.stat strong { display: block; font-family: var(--serif); font-size: 24px; font-variant-numeric: tabular-nums; }
.stat span { font-size: 11.5px; color: var(--faint); text-transform: uppercase; letter-spacing: 0.07em; }
.danger-zone { border-color: color-mix(in srgb, var(--danger) 35%, var(--line)); }
.danger-zone .panel-head h3 { color: var(--danger); }

/* ----------------------------------------------------------------- modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(20, 18, 15, 0.5);
  backdrop-filter: blur(3px);
  animation: fade 0.16s var(--ease);
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal-card {
  width: min(560px, 100%);
  max-height: min(86vh, 760px);
  overflow-y: auto;
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 22px;
  display: grid;
  gap: 16px;
  animation: pop 0.18s var(--ease);
}
@keyframes pop { from { transform: translateY(8px) scale(0.99); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-head { display: flex; align-items: flex-start; gap: 12px; }
.modal-head h3 { font-size: 22px; flex: 1; }
.modal-head p { font-size: 13px; color: var(--muted); margin-top: 4px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding-top: 4px; }
.modal-tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); }
.modal-tab {
  border: 0;
  background: transparent;
  padding: 8px 12px;
  font-size: 13.5px;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.modal-tab.is-active { color: var(--ink); border-bottom-color: var(--accent); }

.dropzone {
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: 26px 18px;
  text-align: center;
  color: var(--muted);
  font-size: 13.5px;
  display: grid;
  gap: 8px;
  justify-items: center;
  transition: border-color 0.15s var(--ease), background 0.15s var(--ease);
}
.dropzone:hover, .dropzone.is-over { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); }
.dropzone .icon { width: 24px; height: 24px; }
.dropzone input[type="file"] { display: none; }

/* -------------------------------------------------------------- importação */
.import-source-block { gap: 10px; }
.import-label {
  font-size: 11.5px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--faint);
  font-weight: 600;
}
.import-sources { gap: 6px; }
.import-sources .chip { padding: 6px 11px; font-size: 12.5px; }
.import-dropzone { padding: 30px 18px; gap: 6px; }
.import-dropzone strong {
  color: var(--ink);
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 500;
}
.import-dropzone .icon { color: var(--accent); }
.import-dropzone.has-file {
  border-color: var(--accent-line);
  background: var(--accent-soft);
}
.import-preview {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  display: grid;
  gap: 12px;
  background: var(--paper-sunken);
}
.import-preview-head { align-items: center; }
.import-badge {
  border: 1px solid var(--accent-line);
  background: var(--accent-soft);
  color: var(--accent-ink);
  border-radius: var(--radius-pill);
  padding: 3px 10px;
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.import-stats { grid-template-columns: repeat(auto-fit, minmax(86px, 1fr)); gap: 8px; }
.import-stats .stat {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 9px 11px;
}
.import-stats .stat strong { font-size: 21px; }
.import-stats .stat span { font-size: 10px; }
.import-items { display: grid; }
.import-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-top: 1px solid var(--line);
  align-items: center;
}
.import-item:first-child { border-top: none; }
.import-item-text { display: grid; gap: 2px; min-width: 0; }
.import-item-text strong {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.import-item-text small { color: var(--faint); font-size: 11.5px; }
.import-item-tags {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.import-tag {
  background: var(--paper-sunken);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 1px 8px;
  font-size: 11px;
  color: var(--muted);
}
.import-existing { color: var(--accent-ink); font-size: 11px; }
.import-status { margin: 0; }
.import-guide { font-size: 12.5px; color: var(--muted); }
.import-guide:hover { color: var(--accent-ink); }
.import-success {
  text-align: center;
  display: grid;
  gap: 10px;
  justify-items: center;
  padding: 18px 10px;
}
.import-success-mark {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 24px;
  border: 1px solid var(--accent-line);
}
.import-success strong {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
}
.import-success p { color: var(--muted); margin: 0; }
@media (max-width: 620px) {
  .import-item { flex-direction: column; align-items: flex-start; gap: 5px; }
  .import-item-tags { justify-content: flex-start; }
}

/* --------------------------------------------------------------- toasts */
.toasts {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 80;
  display: grid;
  gap: 8px;
  justify-items: end;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  min-width: 240px;
  max-width: 380px;
  background: var(--ink);
  color: var(--paper);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  font-size: 13.5px;
  box-shadow: var(--shadow-md);
  animation: toast-in 0.2s var(--ease);
}
.toast.is-error { background: var(--danger); color: #fff; }
.toast.is-ok { background: var(--ok); color: #fff; }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ------------------------------------------------------------ utilitários */
.empty-state {
  display: grid;
  gap: 10px;
  justify-items: center;
  text-align: center;
  padding: 56px 20px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--muted);
  background: color-mix(in srgb, var(--paper-raised) 60%, transparent);
}
.empty-state h3 { font-size: 22px; color: var(--ink); }
.empty-state p { font-size: 13.5px; max-width: 46ch; }
.empty-state .empty-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.empty-state .empty-glyph {
  font-family: var(--serif);
  font-size: 34px;
  color: var(--accent);
  line-height: 1;
}
.load-more { display: grid; place-items: center; padding: 22px 0 8px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12px; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.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;
}
.search-recent { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 2px 0 14px; }
.search-recent-label { font-size: 11.5px; color: var(--faint); }
.search-recent-chip { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-recent-clear { margin-left: auto; }
.search-results { display: grid; gap: 14px; }
.search-result {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-raised);
  padding: 16px 18px;
}
.search-result-head { display: flex; align-items: baseline; gap: 10px; }
.search-result-head h3 { font-size: 18px; }
.search-result-head span { font-size: 11.5px; color: var(--faint); }
.search-result-title {
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.25;
  color: var(--ink);
  text-align: left;
  text-decoration: none;
}
.search-result-title:hover { color: var(--accent-ink); }
.match {
  font-size: 13px;
  color: var(--muted);
  border-left: 2px solid var(--line-strong);
  padding-left: 12px;
  line-height: 1.55;
}
.match + .match { margin-top: 6px; }
mark { background: var(--accent-soft); color: var(--accent-ink); padding: 0 2px; border-radius: 3px; }

.mobile-nav { display: none; }

/* ------------------------------------------------------------ responsivo */
@media (max-width: 1100px) {
  .app { grid-template-columns: 84px minmax(0, 1fr); }
  .rail { padding: 22px 12px 14px; align-items: center; }
  .brand-name, .add-button span, .rail-nav a span, .user-text, .user-chip .icon, .rail-stats { display: none; }
  .add-button { justify-content: center; padding: 10px; }
  .rail-nav a { justify-content: center; padding: 10px; }
  .user-chip { justify-content: center; }
  .menu { left: 12px; bottom: 60px; }
  .topbar { grid-template-columns: minmax(0, 1fr) auto; }
  .global-search { grid-column: 1 / -1; order: 3; }
  .chat-layout { grid-template-columns: 220px minmax(0, 1fr); }
}

@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; gap: 28px; padding: 26px 20px 40px; }
  .auth-story h1 { font-size: clamp(32px, 8vw, 44px); margin: 20px 0 16px; }
  .auth-points { display: none; }
  .auth-lede { font-size: 15px; }
  .detail { width: 100vw; }
  .chat-layout { grid-template-columns: 1fr; height: auto; }
  .chat-sidebar { max-height: 220px; }
  .chat-main { min-height: 62vh; }
}

@media (max-width: 720px) {
  .app { grid-template-columns: minmax(0, 1fr); padding-bottom: 66px; }
  .rail { display: none; }
  .topbar { padding: 12px 14px; gap: 10px; }
  .topbar-title p { display: none; }
  .topbar-title h2 { font-size: 18px; }
  .kbd { display: none; }
  .view { padding: 16px 14px 24px; }
  .card-grid { grid-template-columns: 1fr; }
  .library-head { gap: 8px; }
  .toolbar { gap: 8px; }
  .chips { width: 100%; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; }
  .chip { flex: none; }
  .toolbar-right { margin-left: 0; width: 100%; }
  .mobile-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 45;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    background: color-mix(in srgb, var(--paper-raised) 96%, transparent);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--line);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
  }
  .mobile-nav a, .mobile-nav button {
    display: grid;
    justify-items: center;
    gap: 3px;
    border: 0;
    background: transparent;
    color: var(--faint);
    font-size: 9.5px;
    padding: 6px 1px;
    border-radius: var(--radius-sm);
  }
  .mobile-nav a.is-active { color: var(--accent); }
  .mobile-nav .icon { width: 19px; height: 19px; }
  .detail-head { padding: 14px 16px; }
  .detail-title { font-size: 20px; }
  .detail-scroll { padding: 16px 16px 110px; }
  .detail-foot { padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px)); }
  .toasts { left: 14px; right: 14px; bottom: 74px; justify-items: stretch; }
  .toast { max-width: none; }
  .modal { padding: 12px; }
  .modal-card { padding: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

@media (prefers-contrast: more) {
  :root { --line: #b8ad99; --line-strong: #8e8471; --muted: #4f483d; }
}

/* ------------------------------------------------------- vídeo e transcrição */
.video-block {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  padding: 14px;
}
.video-head { display: flex; gap: 14px; align-items: flex-start; }
.video-thumb {
  position: relative;
  width: 190px;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--paper-sunken);
  flex: none;
  display: block;
}
.video-thumb img { width: 100%; height: 100%; object-fit: cover; }
.video-thumb.is-empty { display: grid; place-items: center; font-size: 26px; color: var(--faint); }
.video-duration {
  position: absolute;
  right: 6px;
  bottom: 6px;
  background: rgba(12, 12, 12, 0.76);
  color: #fff;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  padding: 1px 6px;
  border-radius: 5px;
}
.video-info { display: grid; gap: 6px; min-width: 0; }
.video-info .section-title { margin-bottom: 0; }
.transcript {
  position: relative;
  z-index: 2;
  margin-top: 12px;
  max-height: 420px;
  overflow-y: auto;
  overscroll-behavior: contain;
  border-top: 1px solid var(--line);
  padding-top: 10px;
  background: var(--paper);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}
.transcript-lines { display: grid; gap: 6px; }
.transcript-line {
  display: flex;
  gap: 10px;
  margin: 0;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--ink-soft);
}
.transcript-time {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--accent-ink);
  flex: none;
  padding-top: 1px;
  text-decoration: none;
}
.transcript-time:hover { text-decoration: underline; }
.transcript-plain { font-size: 14px; line-height: 1.65; color: var(--ink-soft); white-space: pre-wrap; }

/* -------------------------------------------------------- tokens e ajustes */
.steps { margin: 0; padding-left: 1.2em; display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
.steps li::marker { color: var(--accent); font-weight: 600; }
.steps code { font-family: var(--mono); font-size: 12px; background: var(--paper-sunken); padding: 1px 4px; border-radius: var(--radius-sm); color: var(--ink-soft); }
.token-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
}
.token-row.is-revoked { opacity: 0.55; }
.token-main { display: grid; gap: 2px; min-width: 0; }
.token-main strong { font-size: 13.5px; }
.token-prefix { font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
.token-value { font-family: var(--mono); font-size: 13px; }
.code-block {
  display: grid;
  gap: 4px;
  background: var(--paper-sunken);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  overflow-x: auto;
}
.code-block code { font-family: var(--mono); font-size: 12px; color: var(--ink-soft); white-space: pre; }

@media (max-width: 720px) {
  .video-head { flex-direction: column; }
  .video-thumb { width: 100%; }
}

/* ----------------------------------------------------- página da extensão */
.site-header {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px clamp(20px, 5vw, 64px);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper) 92%, transparent);
}
.site-nav { display: flex; gap: 18px; font-size: 13.5px; }
.site-nav a { color: var(--muted); text-decoration: none; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--ink); }
.site-nav a[aria-current="page"] { font-weight: 600; }

.download-page {
  position: relative;
  z-index: 1;
  max-width: 1080px;
  margin: 0 auto;
  padding: clamp(32px, 6vw, 72px) clamp(20px, 5vw, 40px) 60px;
  display: grid;
  gap: clamp(28px, 5vw, 48px);
}
.download-hero { max-width: 760px; }
.download-hero h1 {
  font-size: clamp(38px, 6vw, 64px);
  line-height: 1.02;
  margin: 14px 0 20px;
}
.download-hero h1 em { color: var(--accent); font-style: italic; }
.download-lede { font-size: 17px; color: var(--ink-soft); max-width: 56ch; }
.download-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 26px 0 14px; }
.btn-download { padding: 13px 22px; font-size: 15px; }
.download-meta { font-size: 12.5px; color: var(--faint); }

.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
}
.step-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-raised);
  padding: 18px;
  display: grid;
  gap: 8px;
  align-content: start;
}
.step-number {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--accent);
  font-weight: 700;
}
.step-card h2 { font-size: 17px; }
.step-card p { font-size: 13px; color: var(--muted); line-height: 1.55; }
.step-card code, .download-note code, .download-list code {
  font-family: var(--mono);
  font-size: 0.9em;
  background: var(--paper-sunken);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 1px 5px;
}

.download-panel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 26px;
  border-top: 1px solid var(--line);
  padding-top: 28px;
}
.download-panel h2 { font-size: 22px; margin-bottom: 12px; }
.download-list { margin: 0; padding-left: 1.15em; display: grid; gap: 8px; font-size: 14px; color: var(--ink-soft); }
.download-list li::marker { color: var(--accent); }
.download-muted { font-size: 13.5px; color: var(--muted); line-height: 1.65; }
.download-muted + .download-muted { margin-top: 10px; }

.download-note {
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: 20px;
  display: grid;
  gap: 10px;
  background: color-mix(in srgb, var(--paper-raised) 60%, transparent);
}
.download-note h2 { font-size: 19px; }
.download-note p { font-size: 13.5px; color: var(--ink-soft); line-height: 1.65; }

.site-footer {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  padding: 22px clamp(20px, 5vw, 64px) 28px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--faint);
}

.auth-foot a { color: var(--accent-ink); }

@media (max-width: 720px) {
  .site-header { padding: 16px 18px; }
  .site-nav { gap: 12px; font-size: 12.5px; }
  .download-page { padding-top: 28px; }
  .download-hero h1 { font-size: clamp(32px, 9vw, 42px); }
}

/* ------------------------------------------------------------- organizar */
.organize-head { align-items: flex-start; gap: 18px; }
.organize-head-actions { gap: 8px; flex-wrap: wrap; }
.organize-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(115deg, var(--paper-raised), var(--paper-sunken));
  padding: 18px 20px;
  margin-bottom: 14px;
}
.organize-summary-copy { display: grid; gap: 4px; }
.organize-summary-copy strong { font-family: var(--serif); font-size: 20px; }
.organize-summary-copy span { color: var(--muted); font-size: 13px; }
.organize-prefs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 20px;
}
.switch-row { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.switch-row input { margin-top: 4px; accent-color: var(--accent); }
.switch-row span { display: grid; gap: 2px; }
.switch-row strong { font-size: 14px; }
.switch-row small { color: var(--muted); font-size: 12px; }
.confidence-row { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.confidence-row select {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  padding: 7px 9px;
  font: inherit;
}
.suggestions-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.suggestion-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-raised);
  padding: 18px;
  display: grid;
  gap: 10px;
  align-content: start;
}
.suggestion-card.is-add { border-color: color-mix(in srgb, var(--accent) 25%, var(--line)); }
.suggestion-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.suggestion-kind { display: inline-flex; align-items: center; gap: 6px; font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.suggestion-kind .icon { width: 14px; height: 14px; }
.suggestion-score { font-family: var(--mono); font-size: 11px; border: 1px solid var(--line); border-radius: var(--radius-pill); padding: 3px 8px; color: var(--accent-ink); background: var(--accent-soft); }
.suggestion-card h3 { font-family: var(--serif); font-size: 24px; line-height: 1.1; }
.suggestion-reason { font-size: 13px; color: var(--muted); line-height: 1.55; }
.suggestion-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; border-top: 1px solid var(--line); padding-top: 10px; }
.suggestion-links li { display: grid; gap: 1px; font-size: 12.5px; line-height: 1.35; }
.suggestion-links li small { color: var(--faint); font-size: 11px; }
.suggestion-more { color: var(--faint); font-size: 11.5px; }
.suggestion-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.suggestions-empty, .graph-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 48px 24px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  display: grid;
  justify-items: center;
  gap: 10px;
  color: var(--muted);
}
.suggestions-empty h3, .graph-empty h3 { font-family: var(--serif); font-size: 30px; color: var(--ink); }
.suggestions-empty p, .graph-empty p { max-width: 48ch; line-height: 1.6; }
.suggestions-empty-mark { color: var(--accent); display: grid; place-items: center; }
.suggestions-empty-mark .icon { width: 40px; height: 40px; }
.organize-loading { color: var(--muted); padding: 40px 0; font-size: 14px; }

/* ---------------------------------------------------------- grafo 3D */
.nav-badge {
  margin-left: auto;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: #fff8ef;
  font-family: var(--mono);
  font-size: 10px;
  display: grid;
  place-items: center;
}
.graph-page { display: grid; gap: 14px; }
.graph-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; }
.graph-head-copy { max-width: 62ch; display: grid; gap: 6px; }
.graph-head-copy h3 { font-family: var(--serif); font-size: clamp(30px, 4vw, 42px); line-height: 1.02; }
.graph-head-copy p:last-child { color: var(--muted); font-size: 14px; line-height: 1.6; }
.graph-head-stats { display: flex; gap: 22px; flex-wrap: wrap; }
.graph-stat { display: grid; gap: 2px; }
.graph-stat strong { font-family: var(--serif); font-size: 26px; line-height: 1; }
.graph-stat span { font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.graph-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper-raised);
}
.graph-search-wrap { display: flex; align-items: center; gap: 7px; flex: 1 1 220px; min-width: 180px; padding: 0 10px; border-right: 1px solid var(--line); }
.graph-search-wrap .icon { width: 16px; height: 16px; color: var(--muted); }
.graph-search { border: 0; background: transparent; color: var(--ink); font: inherit; font-size: 13.5px; padding: 9px 0; width: 100%; outline: none; }
.graph-select {
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: 12.5px;
  padding: 8px 9px;
  max-width: 220px;
}
.graph-kinds { display: flex; gap: 4px; flex-wrap: wrap; }
.graph-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--muted);
  border-radius: var(--radius-pill);
  padding: 6px 9px;
  font: inherit;
  font-size: 11.5px;
  cursor: pointer;
}
.graph-chip[aria-pressed="true"] { color: var(--ink); border-color: var(--line-strong); background: var(--paper-sunken); }
.graph-chip-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
.graph-chip-dot.kind-link { background: var(--accent); }
.graph-chip-dot.kind-topic { background: #e8b96a; }
.graph-chip-dot.kind-collection { background: #8b9cf5; }
.graph-chip-dot.kind-tag { background: #7fb7a4; }
.graph-favorite { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--muted); }
.graph-favorite input { accent-color: var(--accent); }
.graph-toolbar-end { display: flex; gap: 4px; margin-left: auto; }
.graph-tally { font-size: 11.5px; color: var(--faint); margin: 0; }
.graph-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 330px); gap: 14px; align-items: stretch; }
.graph-stage {
  position: relative;
  min-height: 600px;
  height: clamp(520px, 64vh, 700px);
  border-radius: 22px;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(900px 500px at 70% 20%, rgba(35, 40, 90, .58) 0%, transparent 60%),
    radial-gradient(700px 500px at 20% 80%, rgba(28, 43, 74, .52) 0%, transparent 65%),
    radial-gradient(500px 400px at 55% 55%, rgba(58, 42, 77, .46) 0%, transparent 70%),
    rgba(10, 14, 30, .76);
  -webkit-backdrop-filter: blur(18px) saturate(1.15);
  backdrop-filter: blur(18px) saturate(1.15);
  border: 1px solid rgba(210, 216, 255, .18);
  box-shadow:
    inset 0 0 80px rgba(5, 7, 15, .55),
    0 24px 50px -40px rgba(0, 0, 0, .65);
}
#graph-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; outline: none; }
#graph-canvas:active { cursor: grabbing; }
#graph-canvas:focus-visible { outline: 2px solid #d2d8ff; outline-offset: -3px; }
.graph-nodes { position: absolute; inset: 0; pointer-events: none; }
.graph-node {
  position: absolute;
  left: 0;
  top: 0;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  pointer-events: auto;
  opacity: 0;
  transition: opacity .25s ease;
  will-change: transform;
}
.graph-node:focus-visible { outline: none; }
.graph-dot {
  width: calc(9px * var(--node-scale, 1));
  height: calc(9px * var(--node-scale, 1));
  border-radius: 50%;
  background: var(--node-color);
  box-shadow: 0 0 10px 2px var(--node-color), 0 0 26px 6px color-mix(in srgb, var(--node-color) 35%, transparent);
}
.graph-node.kind-topic .graph-dot { width: calc(6px * var(--node-scale, 1)); height: calc(6px * var(--node-scale, 1)); }
.graph-node.kind-tag .graph-dot { width: calc(6px * var(--node-scale, 1)); height: calc(6px * var(--node-scale, 1)); }
.graph-node.kind-collection .graph-dot { width: calc(13px * var(--node-scale, 1)); height: calc(13px * var(--node-scale, 1)); box-shadow: 0 0 16px 4px var(--node-color), 0 0 44px 12px color-mix(in srgb, var(--node-color) 40%, transparent); }
.graph-label {
  position: absolute;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: #0b1024e6;
  color: #edf0ff;
  border: 1px solid #ffffff1f;
  border-radius: 6px;
  padding: 3px 7px;
  font-size: 10.5px;
  line-height: 1.35;
  opacity: 0;
  transition: opacity .18s ease;
  pointer-events: none;
}
.graph-node.show-label .graph-label, .graph-node:hover .graph-label, .graph-node:focus-visible .graph-label { opacity: 1; }
.graph-node.is-selected .graph-label { opacity: 1; white-space: normal; max-width: 210px; border-color: #d2d8ff66; }
.graph-node.is-selected .graph-dot { outline: 2px solid #f6f3ec; outline-offset: 3px; }
.graph-caption { position: absolute; top: 14px; left: 16px; display: grid; gap: 2px; color: #c8cfee; pointer-events: none; }
.graph-caption span { font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: #8e99c4; }
.graph-caption strong { font-family: var(--mono); font-size: 11px; font-weight: 500; color: #dfe5ff; }
.graph-orientation { position: absolute; top: 14px; right: 16px; display: grid; justify-items: center; gap: 2px; color: #9aa6d4; font-size: 9px; pointer-events: none; }
.graph-orientation b { font-size: 10px; font-weight: 500; }
.graph-orientation span { display: block; width: 34px; text-align: center; font-size: 22px; border: 1px solid #ffffff26; border-radius: 50%; line-height: 30px; }
.graph-controls { position: absolute; right: 14px; bottom: 14px; display: flex; gap: 4px; }
.graph-control { width: 36px; height: 36px; border-radius: 9px; border: 1px solid #ffffff24; background: #0d1430cc; color: #e8ecff; font-size: 16px; cursor: pointer; backdrop-filter: blur(6px); }
.graph-control:hover { background: #1d2752; }
.graph-inspector {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--paper-raised);
  padding: 20px;
  overflow: auto;
  max-height: clamp(520px, 64vh, 700px);
  display: grid;
  align-content: start;
  gap: 10px;
}
.graph-inspector-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.graph-kind-badge { display: inline-flex; align-items: center; gap: 5px; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); border: 1px solid var(--line); border-radius: var(--radius-pill); padding: 4px 8px; }
.graph-kind-badge .icon { width: 13px; height: 13px; }
.graph-degree { font-family: var(--mono); font-size: 10.5px; color: var(--faint); }
.graph-inspector h2 { font-family: var(--serif); font-size: 28px; line-height: 1.08; }
.graph-inspector p { font-size: 13px; line-height: 1.6; color: var(--muted); }
.graph-domain { font-family: var(--mono); font-size: 11px !important; color: var(--accent-ink) !important; }
.graph-meta { font-size: 11.5px !important; color: var(--faint) !important; }
.graph-inspector-actions { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0; }
.graph-members { display: grid; gap: 5px; border-top: 1px solid var(--line); padding-top: 10px; }
.graph-member { display: grid; gap: 2px; text-align: left; border: 1px solid var(--line); border-radius: 9px; background: var(--paper); padding: 8px 10px; font: inherit; font-size: 12px; color: var(--ink); cursor: pointer; }
.graph-member:hover { border-color: var(--line-strong); }
.graph-member small { color: var(--faint); font-size: 10.5px; }
.graph-overview-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.graph-overview-row { display: flex; align-items: center; justify-content: space-between; border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; font-size: 11.5px; color: var(--muted); }
.graph-overview-row strong { font-family: var(--serif); font-size: 18px; color: var(--ink); }
.graph-list { border: 1px solid var(--line); border-radius: 20px; background: var(--paper-raised); padding: 10px; overflow: auto; max-height: clamp(520px, 64vh, 700px); display: grid; gap: 5px; align-content: start; }
.graph-list-row { display: grid; grid-template-columns: 8px 1fr auto; align-items: center; gap: 10px; text-align: left; border: 1px solid var(--line); border-radius: 10px; padding: 10px; background: var(--paper); color: var(--ink); font: inherit; cursor: pointer; }
.graph-list-row:hover { border-color: var(--line-strong); }
.graph-list-mark { width: 8px; height: 8px; border-radius: 50%; background: var(--dot); box-shadow: 0 0 8px var(--dot); }
.graph-list-copy { display: grid; gap: 2px; min-width: 0; }
.graph-list-copy strong { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.graph-list-copy small { font-size: 10.5px; color: var(--faint); }
.graph-list-degree { font-family: var(--mono); font-size: 9.5px; color: var(--faint); }
.graph-list-empty { padding: 24px; text-align: center; color: var(--muted); font-size: 13px; }
.graph-legend { border-top: 1px solid var(--line); padding-top: 10px; }
.graph-legend summary { cursor: pointer; font-size: 12px; color: var(--muted); }
.graph-legend p { font-size: 12px; color: var(--muted); line-height: 1.65; margin-top: 8px; max-width: 90ch; }
.graph-ask { display: flex; gap: 8px; align-items: center; border: 1px solid var(--line); border-radius: 16px; background: var(--paper-raised); padding: 8px 8px 8px 16px; box-shadow: var(--shadow-sm); }
.graph-ask input { flex: 1; border: 0; background: transparent; color: var(--ink); font: inherit; font-size: 14px; padding: 8px 0; outline: none; }
.graph-ask-send { width: 42px; height: 42px; padding: 0; display: grid; place-items: center; }
.graph-loading { min-height: 320px; display: grid; place-items: center; align-content: center; gap: 12px; color: var(--muted); font-size: 13px; }
.graph-loading-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 var(--accent); animation: graph-pulse 1.6s ease-out infinite; }
@keyframes graph-pulse { 70% { box-shadow: 0 0 0 14px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.graph-empty { min-height: 380px; align-content: center; }
.graph-empty-orbit { width: 90px; height: 90px; border: 1px solid var(--line-strong); border-radius: 50%; position: relative; }
.graph-empty-orbit::before, .graph-empty-orbit::after { content: ""; position: absolute; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px var(--accent); }
.graph-empty-orbit::before { width: 8px; height: 8px; top: 8px; left: 50%; }
.graph-empty-orbit::after { width: 5px; height: 5px; bottom: 14px; right: 12px; background: #e8b96a; box-shadow: 0 0 10px #e8b96a; }

@media (max-width: 1000px) {
  .graph-layout { grid-template-columns: 1fr; }
  .graph-stage { min-height: 480px; height: 58vh; }
  .graph-inspector { max-height: none; }
}
@media (max-width: 720px) {
  .graph-head { align-items: flex-start; }
  .graph-head-stats { gap: 16px; }
  .graph-stat strong { font-size: 22px; }
  .graph-toolbar { padding: 6px; }
  .graph-search-wrap { flex-basis: 100%; border-right: 0; border-bottom: 1px solid var(--line); padding-bottom: 4px; }
  .graph-select { max-width: 100%; flex: 1; }
  .graph-toolbar-end { margin-left: 0; }
  .graph-stage { min-height: 420px; height: 56vh; border-radius: 16px; }
  .graph-caption { max-width: 60%; }
  .graph-controls { right: 8px; bottom: 8px; }
  .graph-control { width: 42px; height: 42px; }
  .graph-ask { position: sticky; bottom: 8px; }
  .organize-head { flex-direction: column; }
  .suggestions-grid { grid-template-columns: 1fr; }
}

/* qualidade da captura no detalhe */
.capture-quality { display: inline-flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--muted); margin: 4px 0 12px; }
.capture-quality-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 7px var(--ok); }
.capture-quality.quality-parcial .capture-quality-dot { background: #c08a3e; box-shadow: 0 0 7px #c08a3e; }
.capture-quality.quality-baixa .capture-quality-dot { background: var(--danger); box-shadow: 0 0 7px var(--danger); }
.crawl-status { font-size: 11.5px; color: var(--muted); border-left: 2px solid var(--line-strong); padding-left: 10px; margin: 0 0 12px; line-height: 1.55; }
.collections-suggestion-banner { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; border: 1px solid var(--accent-line); background: var(--accent-soft); border-radius: var(--radius); padding: 14px 18px; margin-bottom: 18px; }
.collections-suggestion-banner strong { font-family: var(--serif); font-size: 19px; }
.collections-suggestion-banner p { font-size: 12.5px; color: var(--muted); margin-top: 3px; }

/* rótulos em posições diferentes por tipo reduzem a colisão no céu */
.graph-node.kind-collection .graph-label { top: -23px; }
.graph-node.kind-topic .graph-label { left: 16px; top: -7px; transform: none; }
.graph-node.kind-tag .graph-label { left: 14px; top: -7px; transform: none; }
.graph-node.kind-collection.is-selected .graph-label { top: -24px; }

/* O grafo em canvas desenha todos os nós; o DOM guarda só os rótulos
   prioritários (orçamento fixo). Assim o custo de interação não cresce com
   o tamanho da biblioteca. */
.graph-label-button {
  position: absolute;
  left: 0;
  top: 0;
  width: 1px;
  height: 1px;
  padding: 0;
  border: 0;
  background: none;
  overflow: visible;
  pointer-events: none;
  contain: layout style;
}
.graph-label-button .graph-label {
  position: absolute;
  left: 0;
  top: 0;
  transform: translate(-50%, -50%);
  opacity: 1;
  pointer-events: auto;
}
.graph-label-button.is-selected .graph-label { border-color: #d2d8ff66; }
.graph-label-button:focus-visible { outline: none; }
.graph-label-button:focus-visible .graph-label { border-color: #d2d8ffcc; box-shadow: 0 0 0 2px #d2d8ff44; }
.graph-label-button.is-hovered .graph-label { border-color: #d2d8ff55; }

/* Ajustes de leitura do grafo: força, distância, raio, profundidade etc. */
.graph-settings {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 24;
  width: min(430px, calc(100% - 32px));
  max-height: calc(100% - 32px);
  overflow: auto;
  border: 1px solid color-mix(in srgb, var(--line) 78%, transparent);
  border-radius: 16px;
  background: color-mix(in srgb, var(--paper-raised) 82%, transparent);
  -webkit-backdrop-filter: blur(18px) saturate(1.15);
  backdrop-filter: blur(18px) saturate(1.15);
  box-shadow: var(--shadow-sm);
  padding: 14px;
  display: grid;
  gap: 12px;
}
.graph-settings[hidden], .graph-setting[hidden] { display: none; }
.graph-settings.is-expanded { width: min(640px, calc(100% - 32px)); }
.graph-settings.is-expanded .graph-settings-grid { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.graph-settings-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.graph-settings-title { display: grid; gap: 2px; }
.graph-settings-heading { display: flex; align-items: center; gap: 8px; }
.graph-settings-drag {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--faint);
  cursor: grab;
  touch-action: none;
  user-select: none;
  font-size: 15px;
  line-height: 1;
}
.graph-settings-drag:hover { border-color: var(--line-strong); color: var(--ink-soft); }
.graph-settings-drag:active { cursor: grabbing; }
.graph-settings-drag:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.graph-settings-title strong { font-family: var(--serif); font-size: 19px; color: var(--ink); }
.graph-settings-note { font-size: 10.5px; color: var(--faint); }
.graph-settings-presets { display: flex; flex-wrap: wrap; gap: 6px; }
.graph-settings-preset { cursor: pointer; }
.graph-settings-preset.is-active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); }
.graph-settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px 18px; }
.graph-setting { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: center; font-size: 12px; color: var(--muted); }
.graph-setting > span:first-child { color: var(--ink); font-size: 12px; }
.graph-setting output { font-family: var(--mono); font-size: 11px; color: var(--accent-ink); }
.graph-setting input[type="range"] { grid-column: 1 / -1; width: 100%; margin: 4px 0 0; accent-color: var(--accent); cursor: pointer; }
.graph-setting small { grid-column: 1 / -1; color: var(--faint); font-size: 10.5px; line-height: 1.4; }
.graph-settings-labels { display: flex; align-items: flex-start; gap: 18px; flex-wrap: wrap; }
.graph-settings-toggle { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); }
.graph-settings-toggle input { accent-color: var(--accent); }
.graph-settings-hint { font-size: 11px; color: var(--faint); line-height: 1.5; margin: 0; }
.graph-toolbar-end .btn.is-active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); }

/* ------------------------------------------------- organizar: diagnóstico */
.organize-head-side { display: grid; gap: 10px; justify-items: end; }
.organize-provider {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 6px 11px;
  font-size: 11.5px;
  color: var(--muted);
  text-decoration: none;
  background: var(--paper);
}
.organize-provider.is-ready { border-color: var(--ok); color: var(--ok); background: var(--ok-soft); }
.organize-provider .icon { width: 14px; height: 14px; }
.organize-provider small { color: var(--faint); font-size: 9.5px; letter-spacing: .04em; }
.organize-provider.is-ready small { color: inherit; opacity: .8; }
.organize-status {
  margin: 0 0 4px;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--paper-sunken);
  font-size: 12px;
  color: var(--muted);
  min-height: 20px;
}
.organize-status.tone-ok { border-color: var(--ok); background: var(--ok-soft); color: var(--ok); }
.organize-status.tone-error { border-color: var(--danger); background: var(--danger-soft); color: var(--danger); }
.organize-status.tone-info { border-style: dashed; }
.organize-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 350px); gap: 16px; align-items: start; }
.organize-main { display: grid; gap: 12px; min-width: 0; }
.organize-suggestions { grid-template-columns: 1fr; }
.organize-library {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-raised);
  padding: 18px;
  display: grid;
  gap: 8px;
  align-content: start;
  position: sticky;
  top: 16px;
  max-height: calc(100vh - 120px);
  overflow: auto;
}
.organize-library h3 { font-family: var(--serif); font-size: 24px; line-height: 1.1; }
.organize-library-count { font-size: 11.5px; color: var(--faint); }
.organize-pages { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 4px; }
.organize-page {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--paper);
  padding: 8px 9px;
  font: inherit;
  color: var(--ink);
  cursor: pointer;
}
.organize-page:hover { border-color: var(--line-strong); background: var(--paper-sunken); }
.organize-page-copy { display: grid; gap: 2px; min-width: 0; }
.organize-page-copy strong { font-size: 11.5px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.organize-page-copy small { font-size: 10px; color: var(--faint); }
.organize-page-topics { font-family: var(--mono); font-size: 9px; color: var(--faint); white-space: nowrap; }
.organize-library-empty { display: grid; gap: 8px; padding: 10px 0; }
.organize-library-empty p { font-size: 12px; color: var(--muted); line-height: 1.55; }
.organize-diagnostic {
  border-top: 1px solid var(--line);
  margin-top: 8px;
  padding-top: 12px;
  display: grid;
  gap: 6px;
}
.organize-diagnostic strong { font-size: 12.5px; }
.organize-diagnostic p { font-size: 11.5px; color: var(--muted); line-height: 1.55; }
.organize-diagnostic-line { border-left: 2px solid var(--line-strong); padding-left: 8px; }
.organize-diagnostic-actions { margin-top: 4px; }
.suggestion-card.is-fallback { border-style: dashed; opacity: .94; }
.btn.is-busy { opacity: .55; cursor: progress; }
@media (max-width: 1000px) {
  .organize-layout { grid-template-columns: 1fr; }
  .organize-library { position: static; max-height: none; order: -1; }
  .organize-head-side { justify-items: start; }
}

/* ------------------------------------------- coleções + organizar juntos */
.collections-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  margin: 8px 0 18px;
}
.collections-tabs a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 12px;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  font-size: 13px;
}
.collections-tabs a:hover { color: var(--ink); }
.collections-tabs a.is-active { color: var(--ink); border-bottom-color: var(--accent); font-weight: 600; }
.collections-tabs .icon { width: 16px; height: 16px; }
.collections-tabs small {
  font-family: var(--mono);
  font-size: 9.5px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 1px 5px;
  color: var(--faint);
}
.collections-tabs .tabs-badge { background: var(--accent-soft); color: var(--accent-ink); border-color: var(--accent-line); }
.collections-organize { display: grid; gap: 12px; }
.organize-embedded-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-raised);
  padding: 14px 16px;
}
.organize-embedded-copy { display: grid; gap: 2px; max-width: 62ch; }
.organize-embedded-copy strong { font-family: var(--serif); font-size: 20px; }
.organize-embedded-copy p { font-size: 12px; color: var(--muted); line-height: 1.5; }

/* ------------------------------------------------------ agente no composer */
.composer-save {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--paper);
  color: var(--muted);
  cursor: pointer;
}
.composer-save:hover { color: var(--accent); border-color: var(--accent-line); }
.composer-save .icon { width: 16px; height: 16px; }
.save-link-panel {
  display: grid;
  gap: 6px;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  padding: 10px;
  background: var(--paper-sunken);
}
.save-link-panel[hidden] { display: none; }
.save-link-title {
  font-size: 9.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--faint);
}
.save-link-panel input,
.save-link-panel select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  padding: 7px 9px;
  font: inherit;
  font-size: 12.5px;
  min-width: 0;
}
.save-link-row { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.save-link-actions { justify-content: flex-end; }
.chat-empty-hint { font-size: 12px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 12px; }
.mobile-only-add { display: none; }

/* --------------------------------------------------- dock mobile 5 botões */
@media (max-width: 720px) {
  .mobile-nav {
    grid-template-columns: repeat(5, 1fr);
    align-items: end;
    padding: 16px 4px calc(6px + env(safe-area-inset-bottom, 0px));
  }
  .mobile-nav a, .mobile-nav button {
    position: relative;
    padding: 4px 2px 6px;
    gap: 2px;
  }
  .mobile-nav .agent-tab { gap: 0; align-content: end; }
  .agent-orb {
    width: 54px;
    height: 54px;
    margin-top: -24px;
    border-radius: 50%;
    background: var(--ink);
    color: var(--paper);
    display: grid;
    place-items: center;
    border: 4px solid var(--paper-raised);
    box-shadow: 0 12px 26px -10px rgba(27, 26, 23, .55);
  }
  .agent-orb .icon { width: 23px; height: 23px; }
  .agent-tab .agent-label { font-size: 9.5px; color: var(--muted); margin-top: 2px; }
  .agent-tab.is-active .agent-orb { background: var(--accent); color: #fff8ef; }
  .agent-tab.is-active .agent-label { color: var(--accent); }
  .mobile-nav .nav-badge {
    position: absolute;
    top: -1px;
    right: 10px;
    margin: 0;
  }
  .mobile-only-add { display: grid; }
  .save-link-row { grid-template-columns: 1fr; }
}

/* ajustes finais do dock de 5 botões no mobile */
@media (max-width: 720px) {
  .app { padding-bottom: 96px; }
  .chat-layout { height: calc(100svh - 188px); min-height: 400px; }
  .chat-sidebar { max-height: 150px; }
  .chat-main { min-height: 0; }
  .composer { padding-bottom: 12px; }
  .organize-library { order: 0; }
}

/* ============================================================ chat novo */
.chat-page {
  display: grid;
  grid-template-columns: 292px minmax(0, 1fr);
  gap: 14px;
  height: calc(100svh - 132px);
  min-height: 540px;
}
.chat-drawer {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-raised);
  overflow: hidden;
}
.chat-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 14px 14px 10px;
}
.chat-drawer-title { display: grid; gap: 2px; }
.chat-drawer-title h3 { font-family: var(--serif); font-size: 22px; line-height: 1; }
.chat-search {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 12px 10px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  color: var(--muted);
}
.chat-search .icon { width: 15px; height: 15px; flex: none; }
.chat-search-input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 12.5px;
  padding: 8px 0;
  outline: none;
}
.chat-groups { flex: 1; min-height: 0; overflow-y: auto; padding: 2px 10px 12px; }
.chat-group { display: grid; gap: 2px; margin-bottom: 8px; }
.chat-group-label {
  font-size: 9.5px;
  letter-spacing: .11em;
  text-transform: uppercase;
  color: var(--faint);
  padding: 8px 4px 4px;
}
.chat-item {
  display: grid;
  gap: 2px;
  width: 100%;
  text-align: left;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 9px;
  padding: 9px 10px;
  color: var(--ink-soft);
  cursor: pointer;
}
.chat-item:hover { background: var(--paper-sunken); }
.chat-item.is-active { background: var(--paper-sunken); border-color: var(--line); color: var(--ink); }
.chat-item-title {
  font-size: 12.5px;
  font-weight: 550;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chat-item-meta { font-size: 10.5px; color: var(--faint); }
.chat-groups-empty { font-size: 12px; color: var(--muted); padding: 16px 8px; line-height: 1.55; }
.chat-drawer-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  border-top: 1px solid var(--line);
  padding: 8px 10px;
}
.chat-foot-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 10.5px;
  text-decoration: none;
  padding: 5px;
  cursor: pointer;
}
.chat-foot-link .icon { width: 14px; height: 14px; }
.chat-foot-link:hover { color: var(--ink); }
.chat-backdrop { display: none; }
.chat-drawer-toggle { display: none; }

.chat-main {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-raised);
  overflow: hidden;
}
.chat-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  min-height: 62px;
}
.chat-head-avatar {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff8f2;
  font-size: 11px;
  font-weight: 700;
  flex: none;
}
.chat-head-copy { display: grid; gap: 1px; min-width: 0; flex: 1; }
.chat-head-title {
  font-size: 15px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chat-head-subtitle { font-size: 10.5px; color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-head-actions { display: flex; gap: 2px; align-items: center; }
.chat-head-actions .icon-button { width: 34px; height: 34px; }
.chat-scroll { flex: 1; overflow-y: auto; padding: 22px 18px; display: flex; flex-direction: column; gap: 18px; scroll-behavior: smooth; }

.chat-welcome {
  margin: auto;
  max-width: 620px;
  display: grid;
  justify-items: center;
  gap: 10px;
  text-align: center;
  padding: 24px 12px;
}
.chat-welcome-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  border: 1px solid var(--accent-line);
}
.chat-welcome h3 { font-family: var(--serif); font-size: clamp(26px, 5vw, 34px); line-height: 1.05; }
.chat-welcome p { font-size: 13px; color: var(--muted); line-height: 1.6; max-width: 52ch; }
.chat-welcome-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 4px; }
.chat-suggestions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 8px; }
.chat-suggestion {
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink-soft);
  border-radius: var(--radius-pill);
  padding: 7px 11px;
  font: inherit;
  font-size: 11.5px;
  cursor: pointer;
}
.chat-suggestion:hover { border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent-ink); }

.composer {
  display: grid;
  gap: 6px;
  padding: 10px 12px 12px;
  border-top: 1px solid var(--line);
  background: var(--paper-raised);
}
.composer-row {
  display: flex;
  align-items: flex-end;
  gap: 7px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--paper);
  padding: 6px 7px;
}
.composer-row:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.composer textarea {
  flex: 1;
  border: 0;
  background: transparent;
  resize: none;
  min-height: 28px;
  max-height: 180px;
  font-size: 14.5px;
  line-height: 1.45;
  padding: 5px 4px;
  color: var(--ink);
  outline: none;
}
.composer-attach {
  flex: none;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--paper-raised);
  color: var(--muted);
  cursor: pointer;
}
.composer-attach:hover { color: var(--accent); border-color: var(--accent-line); }
.composer-attach .icon { width: 16px; height: 16px; }
.composer .btn-icon { width: 38px; height: 38px; flex: none; }
.composer-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 10.5px;
  color: var(--faint);
  padding: 0 2px;
  min-height: 20px;
}
.composer-scope { display: inline-flex; align-items: center; gap: 6px; }
.composer-scope > span { color: var(--faint); }
.composer-scope .scope-select { font-size: 11px; padding: 3px 6px; max-width: 180px; }
.composer-hint { white-space: nowrap; }
.composer-meta .typing { margin-left: auto; }

.chat-save-form { display: grid; gap: 10px; }
.chat-save-form .field { display: grid; gap: 4px; }
.chat-save-form .field > span { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.chat-save-form input,
.chat-save-form textarea,
.chat-save-form select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  padding: 8px 10px;
  min-width: 0;
}
.chat-save-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.modal-card.modal-sm { max-width: 520px; }

@media (max-width: 1000px) {
  .chat-page { grid-template-columns: 250px minmax(0, 1fr); }
}

@media (max-width: 720px) {
  body[data-route="chat"] .topbar { display: none; }
  body[data-route="chat"] .view { padding: 0; max-width: none; }
  body[data-route="chat"] .app { padding-bottom: 0; }
  .chat-page { display: block; height: calc(100svh - 92px); min-height: 0; }
  .chat-main { height: 100%; border: 0; border-radius: 0; }
  .chat-head { min-height: 54px; padding: 8px 10px; gap: 7px; }
  .chat-head-avatar { width: 28px; height: 28px; font-size: 10px; }
  .chat-head-title { font-size: 14px; }
  .chat-head-subtitle { font-size: 9.5px; }
  .chat-drawer-toggle { display: grid; }
  .chat-head-actions .icon-button { width: 32px; height: 32px; }
  .chat-scroll { padding: 14px 12px 18px; gap: 14px; }
  .message { max-width: 100%; }
  .message.user .message-body { max-width: 88%; }
  .message-text { font-size: 14px; }
  .chat-welcome { padding: 10px 4px; gap: 8px; }
  .chat-welcome h3 { font-size: 28px; }
  .chat-welcome p { font-size: 12.5px; }
  .chat-suggestions { gap: 5px; }
  .chat-suggestion { font-size: 10.5px; padding: 6px 9px; }
  .composer { padding: 7px 9px calc(7px + env(safe-area-inset-bottom)); }
  .composer-row { border-radius: 13px; }
  .composer textarea { font-size: 16px; min-height: 26px; }
  .composer-hint { display: none; }
  .composer-meta { font-size: 10px; }
  .chat-drawer {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: min(86vw, 340px);
    z-index: 70;
    border-radius: 0 18px 18px 0;
    border-left: 0;
    box-shadow: 18px 0 50px -30px rgba(20, 18, 15, .6);
    transform: translateX(-104%);
    transition: transform .22s ease;
    padding-top: env(safe-area-inset-top);
    background: var(--paper-raised);
  }
  .chat-drawer.is-open { transform: none; }
  .chat-backdrop {
    position: fixed;
    inset: 0;
    z-index: 65;
    display: block;
    background: rgba(20, 18, 15, .45);
    backdrop-filter: blur(2px);
  }
  .chat-backdrop[hidden] { display: none; }
  body.chat-drawer-open { overflow: hidden; }
  .chat-save-row { grid-template-columns: 1fr; }
}

.chat-item-preview {
  font-size: 10.5px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
body.chat-drawer-open .mobile-nav { opacity: 0; pointer-events: none; }
@media (max-width: 720px) {
  body[data-route="chat"] .toasts {
    top: calc(env(safe-area-inset-top, 0px) + 64px);
    bottom: auto;
    left: 10px;
    right: 10px;
  }
  body.chat-drawer-open .mobile-nav { opacity: 0; pointer-events: none; }
}

@media (max-width: 720px) {
  .chat-head { padding-top: calc(8px + env(safe-area-inset-top, 0px)); }
}

/* ------------------------------------------------------ share target/PWA */
.share-body {
  min-height: 100svh;
  margin: 0;
  display: grid;
  place-items: center;
  padding: max(18px, env(safe-area-inset-top)) 18px max(18px, env(safe-area-inset-bottom));
  background:
    radial-gradient(700px 420px at 80% 0%, color-mix(in srgb, var(--accent-soft) 55%, transparent), transparent 65%),
    radial-gradient(600px 380px at 10% 100%, color-mix(in srgb, var(--paper-sunken) 80%, transparent), transparent 70%),
    var(--paper);
}
.share-page {
  width: min(560px, 100%);
  display: grid;
  gap: 16px;
  justify-items: center;
}
.share-brand { justify-self: start; }
.share-card {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--paper-raised);
  box-shadow: var(--shadow-lg);
  padding: clamp(22px, 5vw, 34px);
}
.share-state {
  display: grid;
  justify-items: center;
  gap: 10px;
  text-align: center;
}
.share-state h1 {
  font-family: var(--serif);
  font-size: clamp(28px, 6vw, 38px);
  line-height: 1.04;
}
.share-state > p {
  max-width: 46ch;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}
.share-mark,
.share-success-mark {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  color: var(--accent-ink);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
}
.share-success-mark { background: var(--ok-soft); border-color: var(--ok); color: var(--ok); }
.share-success-mark .icon { width: 26px; height: 26px; }
.share-spinner {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid var(--line);
  border-top-color: var(--accent);
  animation: share-spin .75s linear infinite;
}
@keyframes share-spin { to { transform: rotate(360deg); } }
.share-link {
  width: 100%;
  display: grid;
  gap: 3px;
  text-align: left;
  margin: 8px 0 4px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
}
.share-link-domain {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent-ink);
}
.share-link strong { font-size: 13px; line-height: 1.4; overflow-wrap: anywhere; }
.share-link-url {
  font-size: 10.5px;
  color: var(--faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.share-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 8px; }
.share-actions .btn { text-decoration: none; }
.share-form { width: 100%; display: grid; gap: 8px; margin-top: 8px; }
.share-form input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  padding: 10px 12px;
}
.share-note { font-size: 10.5px !important; color: var(--faint) !important; }
.share-foot {
  margin: 0;
  font-size: 11px;
  color: var(--faint);
  text-align: center;
  line-height: 1.6;
}
.share-foot a { color: var(--accent-ink); }
@media (max-width: 520px) {
  .share-body { padding: 16px 12px 24px; align-items: start; }
  .share-page { gap: 12px; }
  .share-card { border-radius: 18px; padding: 22px 18px; }
  .share-actions { display: grid; width: 100%; }
  .share-actions .btn { justify-content: center; }
}

.share-brand .brand-name { display: inline; }

/* ------------------------------------------------------------- legal */
.legal-page {
  width: min(760px, calc(100% - 32px));
  margin: 0 auto;
  padding: 48px 0 72px;
}
.legal-page h1 {
  font-family: var(--serif);
  font-size: clamp(38px, 6vw, 58px);
  line-height: 1.02;
  letter-spacing: -1px;
  margin: 8px 0 6px;
}
.legal-page h2 {
  font-family: var(--serif);
  font-size: 26px;
  margin: 34px 0 8px;
}
.legal-page p, .legal-page li {
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.7;
}
.legal-page ul { padding-left: 20px; display: grid; gap: 6px; }
.legal-page a { color: var(--accent-ink); }
.legal-updated { color: var(--faint); font-size: 11px; }
.legal-note {
  margin-top: 36px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
  color: var(--faint);
  font-size: 11px !important;
}
@media (max-width: 720px) {
  .legal-page { padding-top: 28px; }
  .legal-page h2 { font-size: 22px; }
}
.podcast-script { max-height: 280px; overflow: auto; white-space: pre-line; font-size: 13px; line-height: 1.65; color: var(--ink-soft); }
.podcast-chapters { margin: 0; padding-left: 20px; display: grid; gap: 5px; font-size: 12.5px; }
.podcast-chapters a { margin-left: 8px; }
.capability-list { display: grid; gap: 10px; }
.capability-row { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-soft); }
.capability-copy { display: grid; gap: 3px; }
.capability-copy p { margin: 0; font-size: 12px; color: var(--muted); }
.capability-controls { display: grid; grid-template-columns: minmax(150px, 1.1fr) minmax(150px, 1.4fr) minmax(110px, .8fr); gap: 8px; }
.capability-controls .input, .capability-controls .select { width: 100%; }
.capability-note { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 4px; }
@media (max-width: 720px) { .capability-controls { grid-template-columns: 1fr; } }
.badge-info { background: var(--accent-soft); color: var(--accent-ink); }

@media (max-width: 720px) {
  .graph-settings {
    top: auto !important;
    bottom: 12px !important;
    right: 12px !important;
    left: 12px !important;
    width: auto !important;
    max-height: min(62vh, 520px);
  }
  .graph-settings.is-expanded { width: auto !important; max-height: min(84vh, 720px); }
  .graph-settings-drag { display: none; }
}
.portal-card { align-content: start; }
.portal-card .portal-actions { flex-wrap: wrap; gap: 6px; }
.portal-item { display: grid; gap: 4px; border-bottom: 1px solid var(--line); padding: 8px 0; }
.portal-item:last-child { border-bottom: 0; }
.message-actions { display: flex; align-items: center; gap: 8px; margin-top: 5px; flex-wrap: wrap; }
.media-moments { margin: 0; padding-left: 20px; display: grid; gap: 10px; }
.media-moments li { padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.media-moments li:last-child { border-bottom: 0; }
.media-moments .spread { gap: 8px; align-items: center; }
.composer-web.is-active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); }
.research-results { max-height: 300px; overflow: auto; }
.research-source { display: grid; gap: 4px; border-bottom: 1px solid var(--line); padding: 8px 0; }
.research-source:last-child { border-bottom: 0; }
.research-source-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.research-evidence {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-sunken);
  padding: 12px;
  display: grid;
  gap: 9px;
  margin-bottom: 8px;
}
.research-evidence-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.research-evidence-stats .stat {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 7px 8px;
}
.research-evidence-stats .stat strong { font-size: 18px; }
.research-evidence-stats .stat span { font-size: 9.5px; }
.research-evidence .hint { margin: 0; }

/* ------------------------------------------------------- serviços e cookies */
.service-cookie {
  margin: 6px 0 12px;
  padding: 14px 16px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: var(--paper-sunken);
  display: grid;
  gap: 8px;
}
.service-cookie strong { font-size: 14px; }
.service-cookie-actions { flex-wrap: wrap; }
.service-cookie .hint.is-ok { color: var(--accent-ink); }
.settings-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px;
  margin: 0 0 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--paper-sunken);
  position: sticky;
  top: 76px;
  z-index: 15;
  backdrop-filter: blur(12px);
}
.settings-tab {
  flex: 1 1 auto;
  min-height: 38px;
  padding: 8px 14px;
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.settings-tab.is-active {
  background: var(--paper);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}
.settings-section { display: grid; gap: 16px; }
.settings-section[hidden] { display: none; }
.settings-section-hint { margin: 0 0 2px; color: var(--muted); font-size: 13px; }
@media (max-width: 900px) {
  .settings-tabs { position: static; border-radius: var(--radius); }
  .settings-tab { flex: 1 1 45%; }
}
.device-list { display: grid; gap: 8px; }
.device-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  background: var(--paper-sunken);
  display: grid;
  gap: 6px;
}
.device-card.is-current { border-color: var(--accent-line); background: var(--accent-soft); }
.device-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.device-head strong { font-size: 14px; }
.action-feedback {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-sunken);
  padding: 10px 12px;
  margin-top: 10px;
}
.action-feedback[hidden] { display: none; }
.action-feedback-icon {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  display: grid;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
}
.action-feedback-copy { display: grid; gap: 2px; }
.action-feedback-copy strong { font-size: 12.5px; }
.action-feedback-copy p { margin: 0; font-size: 12px; color: var(--muted); }
.action-feedback.is-progress { border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent-ink); }
.action-feedback.is-progress { position: relative; overflow: hidden; }
.action-feedback.is-progress .action-feedback-icon {
  border-color: var(--accent-line);
  border-top-color: transparent;
  animation: fai-spin 0.8s linear infinite;
}
.action-feedback.is-progress::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  animation: fai-progress 1.2s ease-in-out infinite;
}
@keyframes fai-progress { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }
.action-feedback.is-success { border-color: var(--ok); background: var(--ok-soft); color: var(--ok); }
.action-feedback.is-error { border-color: var(--danger); background: var(--danger-soft); color: var(--danger); }
@keyframes fai-spin { to { transform: rotate(360deg); } }
.media-atlas {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 2px 0 8px;
  scroll-snap-type: x proximity;
}
.media-frame {
  flex: 0 0 190px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--paper-sunken);
  color: inherit;
  text-decoration: none;
  scroll-snap-align: start;
}
.media-frame img { display: block; width: 100%; height: 110px; object-fit: cover; }
.media-frame-copy { display: grid; gap: 3px; padding: 8px 10px 10px; }
.media-frame-copy strong { font-size: 11px; color: var(--accent-ink); letter-spacing: 0.04em; }
.media-frame-copy small { font-size: 11.5px; line-height: 1.35; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.chat-status {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}
.chat-status::before {
  content: "";
  width: 13px;
  height: 13px;
  border: 2px solid var(--accent-line);
  border-top-color: transparent;
  border-radius: 50%;
  animation: fai-spin 0.8s linear infinite;
}
.portal-feedback { margin: 0 0 14px; }
.portal-preview { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-top: 4px; }
.portal-thumb { position: relative; display: block; aspect-ratio: 4 / 3; overflow: hidden; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--paper-sunken); text-decoration: none; }
.portal-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.portal-thumb-title { position: absolute; inset: auto 0 0; padding: 5px 6px; color: #fff; font-size: 10px; line-height: 1.25; background: linear-gradient(transparent, rgba(0,0,0,.72)); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.portal-thumb-fallback { display: grid; place-items: center; width: 100%; height: 100%; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .04em; }
.portal-captures { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.portal-capture { display: grid; grid-template-rows: 132px auto; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--paper); }
.portal-capture-media { position: relative; display: block; overflow: hidden; background: var(--paper-sunken); }
.portal-capture-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.portal-capture-domain { position: absolute; left: 8px; bottom: 8px; padding: 3px 7px; border-radius: var(--radius-pill); background: rgba(0,0,0,.62); color: #fff; font-size: 10px; }
.portal-capture-copy { display: grid; gap: 5px; padding: 10px; }
.portal-capture-copy strong { font-size: 13px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.portal-capture-actions { flex-wrap: wrap; gap: 4px; }
.portal-select { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 12px; }
.portal-selection-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding-bottom: 4px; }
@media (max-width: 640px) { .portal-preview { grid-template-columns: repeat(2, minmax(0, 1fr)); } .portal-captures { grid-template-columns: 1fr; } }
.platform-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.platform-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); padding: 14px; display: grid; gap: 8px; align-content: start; }
.platform-card h3 { margin: 0; font-size: 18px; }
.platform-preview { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.platform-thumb { position: relative; display: block; aspect-ratio: 1; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--line); background: var(--paper-sunken); text-decoration: none; }
.platform-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.platform-thumb span:last-child { position: absolute; inset: auto 0 0; padding: 4px 5px; color: #fff; font-size: 9.5px; line-height: 1.2; background: linear-gradient(transparent, rgba(0,0,0,.78)); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.platform-thumb-fallback { display: grid; place-items: center; width: 100%; height: 100%; color: var(--muted); font-size: 18px; }
.platform-groups { display: grid; gap: 5px; }
.platform-groups strong { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.platform-groups .tag { cursor: pointer; border: 1px solid var(--line); background: var(--paper-sunken); border-radius: var(--radius-pill); padding: 3px 8px; font: inherit; font-size: 11px; color: var(--ink-soft); }
.platform-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; max-height: 62vh; overflow-y: auto; }
.platform-item { display: grid; gap: 5px; align-content: start; text-decoration: none; color: inherit; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px; background: var(--paper); }
.platform-item img, .platform-item .platform-thumb-fallback { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 6px; }
.platform-item strong { font-size: 12px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media (max-width: 720px) { .platform-preview { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.music-section { display: grid; gap: 10px; }
.music-head { display: flex; align-items: center; gap: 12px; }
.music-cover { width: 82px; height: 82px; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--line); }
.music-copy { display: grid; gap: 3px; }
.music-copy h4 { margin: 0; }
.music-copy p { margin: 0; }
.music-links { display: flex; flex-wrap: wrap; gap: 6px; }
.music-preview { width: 100%; height: 38px; }
.music-lyrics { max-height: 340px; overflow-y: auto; white-space: pre-wrap; font: inherit; font-size: 13px; line-height: 1.55; margin: 0; padding: 10px; border-top: 1px solid var(--line); background: var(--paper-sunken); border-radius: var(--radius-sm); }
.music-preview-text { font-size: 13px; line-height: 1.55; color: var(--ink-soft); margin: 0; white-space: pre-wrap; }
.related-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; max-height: 62vh; overflow-y: auto; }
.related-card { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px; display: grid; gap: 5px; color: inherit; text-decoration: none; background: var(--paper); }
.related-card img, .related-fallback { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 6px; background: var(--paper-sunken); display: grid; place-items: center; color: var(--muted); }
.related-card strong { font-size: 12.5px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.entity-button { border: 1px solid var(--line); background: var(--paper-sunken); border-radius: var(--radius-pill); padding: 5px 9px; font: inherit; color: inherit; cursor: pointer; }
.entity-button:hover { border-color: var(--accent-line); }
.gallery-filters { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 14px; }
.gallery-filters .is-active { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-ink); }
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.gallery-card { margin: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--paper); display: grid; align-content: start; }
.gallery-image, .gallery-card video, .gallery-card audio, .gallery-embed { width: 100%; display: block; }
.gallery-image { aspect-ratio: 4 / 3; overflow: hidden; background: var(--paper-sunken); }
.gallery-image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery-card video { aspect-ratio: 16 / 10; object-fit: cover; background: #000; }
.gallery-card audio { padding: 10px; }
.gallery-embed { padding: 28px 10px; text-align: center; text-decoration: none; color: var(--accent-ink); background: var(--paper-sunken); }
.gallery-card figcaption { padding: 8px 10px; display: grid; gap: 3px; font-size: 11.5px; color: var(--muted); line-height: 1.3; }
.gallery-source { color: var(--accent-ink); font-size: 10.5px; text-decoration: none; }
.gallery-count { margin: 0 0 10px; }
.gallery-more { display: flex; justify-content: center; padding: 14px 0 30px; }
.link-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.link-gallery a, .link-gallery .gallery-image { border-radius: var(--radius-sm); overflow: hidden; }
.link-gallery img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
@media (max-width: 640px) { .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.contact-row { display: flex; gap: 8px; flex-wrap: wrap; }
.contact-row .btn { text-decoration: none; }
.contact-row { align-items: flex-start; }
.contact-action { display: inline-flex; align-items: center; gap: 6px; }
.contact-icon {
  display: inline-grid;
  place-items: center;
  width: 17px;
  height: 17px;
  border-radius: var(--radius-pill);
  background: rgba(255,255,255,.18);
  font-size: 8px;
  font-weight: 700;
  line-height: 1;
}
.contact-icon svg { width: 15px; height: 15px; display: block; }
.contact-icon-whatsapp { background: #25d366; color: #063d1d; }
.contact-icon-telegram { background: #229ed9; color: #fff; }
.contact-menu { position: relative; }
.contact-menu > summary { list-style: none; cursor: pointer; }
.contact-menu > summary::-webkit-details-marker { display: none; }
.contact-caret { font-size: 9px; opacity: .8; }
.contact-menu-list {
  position: absolute;
  z-index: 8;
  top: calc(100% + 6px);
  left: 0;
  min-width: 220px;
  max-width: min(320px, 82vw);
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  box-shadow: 0 18px 50px -24px rgba(20,18,15,.6);
}
.contact-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-radius: 8px;
  color: var(--ink);
  text-decoration: none;
}
.contact-menu-item:hover { background: var(--surface-2, rgba(0,0,0,.045)); }
.contact-menu-item .contact-icon { background: var(--accent-soft, rgba(196,74,38,.12)); color: var(--accent-ink, #8f2f16); }
.contact-menu-value { margin-left: auto; color: var(--muted); font-size: 11px; }


/* ---------------- detalhe responsivo / mídia ---------------- */
body.detail-open .app { padding-right: min(560px, 42vw); transition: padding-right .28s var(--ease); }
body.detail-open .topbar { padding-right: min(560px, 42vw); transition: padding-right .28s var(--ease); }
@media (max-width: 900px) { body.detail-open .app, body.detail-open .topbar { padding-right: 0; } }
.detail { background: var(--paper); box-shadow: -30px 0 80px -60px rgba(20,18,15,.8); }
.media-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.media-tab { border: 1px solid var(--line); background: transparent; color: var(--muted); border-radius: var(--radius-pill); padding: 5px 10px; font-size: 11px; cursor: pointer; }
.media-tab.is-active { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-ink); }
.link-gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.gallery-tile { border: 0; padding: 0; margin: 0; aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: var(--paper-sunken); cursor: pointer; position: relative; }
.gallery-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery-video-thumb, .gallery-audio-thumb { width: 100%; height: 100%; display: grid; place-items: center; background: #14110f; color: #fff; font-size: 24px; position: relative; }
.gallery-video-thumb img { position: absolute; inset: 0; opacity: .7; }
.gallery-video-thumb span { position: relative; z-index: 1; font-size: 20px; }
.media-viewer { position: fixed; inset: 0; z-index: 120; background: rgba(12,10,8,.94); color: #fff; display: grid; grid-template-rows: auto 1fr auto; padding: 16px; gap: 10px; }
.media-viewer-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 12px; flex-wrap: wrap; }
.media-viewer-body { min-height: 0; display: grid; grid-template-columns: 44px minmax(0,1fr) 44px; align-items: center; gap: 6px; }
.media-stage { min-height: 0; height: 100%; display: grid; place-items: center; overflow: hidden; }
.media-stage img, .media-stage video { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; }
.media-zoom { width: 100%; height: 100%; overflow: auto; display: flex; align-items: center; justify-content: center; }
.media-zoom img { width: 100%; max-width: none; max-height: none; object-fit: contain; border-radius: 6px; }
.media-zoom-controls { gap: 4px; }
.media-nav { border: 0; background: rgba(255,255,255,.1); color: #fff; font-size: 30px; height: 54px; border-radius: 27px; cursor: pointer; }
.media-strip { display: flex; gap: 6px; overflow-x: auto; padding: 4px 0; }
.media-strip-item { flex: 0 0 62px; width: 62px; height: 62px; border-radius: 6px; overflow: hidden; padding: 0; border: 2px solid transparent; background: #221d19; color: #fff; cursor: pointer; }
.media-strip-item.is-active { border-color: #fff; }
.media-strip-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.media-audio { display: grid; justify-items: center; gap: 18px; width: min(420px,100%); }
.media-audio-art { width: 160px; height: 160px; border-radius: 18px; display: grid; place-items: center; font-size: 60px; background: rgba(255,255,255,.1); }
.profile-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px,1fr)); gap: 8px; }
.profile-fact { border: 1px solid var(--line); border-radius: 10px; padding: 9px 10px; display: grid; gap: 3px; background: var(--surface-soft); }
.profile-fact span { font-size: 10px; text-transform: uppercase; letter-spacing: .05em; color: var(--faint); }
.profile-fact strong { font-size: 13px; line-height: 1.35; }
.profile-block { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 10px; }
.profile-block h5 { margin: 0 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.profile-rows { display: grid; grid-template-columns: max-content minmax(0,1fr); gap: 3px 12px; margin: 0; font-size: 12.5px; }
.profile-rows dt { color: var(--faint); }
.profile-rows dd { margin: 0; color: var(--ink-soft); }
.profile-text { white-space: pre-line; font-size: 13px; line-height: 1.6; color: var(--ink-soft); }
.profile-items { margin: 0; padding-left: 18px; font-size: 12.5px; line-height: 1.5; color: var(--ink-soft); }
.vertical-hero { border: 1px solid var(--line); border-radius: 16px; background: var(--surface); padding: 16px; display: grid; gap: 16px; }
.vertical-hero--transaction { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); align-items: start; }
.vertical-hero--editorial { gap: 8px; }
.hero-media { border-radius: 12px; overflow: hidden; background: var(--surface-soft); aspect-ratio: 4 / 3; }
.hero-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-copy { display: grid; gap: 10px; align-content: start; }
.hero-kicker { margin: 0; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); }
.hero-price { margin: 0; font-size: 30px; line-height: 1.1; font-weight: 700; color: var(--ink); }
.hero-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }
.hero-fact { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; display: grid; gap: 2px; background: var(--surface-soft); }
.hero-fact span { font-size: 10px; text-transform: uppercase; letter-spacing: .05em; color: var(--faint); }
.hero-fact strong { font-size: 13px; line-height: 1.35; }
.hero-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.hero-dek { margin: 0; font-size: 16px; line-height: 1.55; color: var(--ink-soft); }
.hero-byline { margin: 0; font-size: 12px; color: var(--faint); }
.hero-image { width: 100%; max-height: 340px; object-fit: cover; border-radius: 12px; }
.music-hero { border: 1px solid var(--line); border-radius: 16px; padding: 16px; background: var(--surface); }
@media (max-width: 720px) { .vertical-hero--transaction { grid-template-columns: 1fr; } .hero-price { font-size: 26px; } }
@media (max-width: 720px) { .link-gallery { grid-template-columns: repeat(2, minmax(0,1fr)); } .media-viewer { padding: 10px; } .media-viewer-body { grid-template-columns: 32px minmax(0,1fr) 32px; } .media-nav { height: 40px; border-radius: 20px; font-size: 22px; } }
.card-wrap { position: relative; min-width: 0; }
.card-actions { position: absolute; top: 8px; right: 8px; display: flex; gap: 4px; opacity: 0; transform: translateY(-3px); transition: opacity .18s var(--ease), transform .18s var(--ease); z-index: 3; }
.card-wrap:hover .card-actions, .card-wrap:focus-within .card-actions { opacity: 1; transform: none; }
.card-action { width: 28px; height: 28px; border-radius: 50%; border: 1px solid color-mix(in srgb, var(--line) 70%, transparent); background: color-mix(in srgb, var(--paper-raised) 92%, transparent); color: var(--ink-soft); display: grid; place-items: center; cursor: pointer; backdrop-filter: blur(8px); }
.card-action .icon { width: 14px; height: 14px; }
.card-action:hover { color: var(--accent-ink); border-color: var(--accent-line); }
.card-action.is-danger:hover { color: var(--danger); }
@media (hover: none) { .card-actions { opacity: 1; transform: none; } }
.card-wrap .link-card { width: 100%; }
.gallery-image { border: 0; padding: 0; cursor: pointer; }
.queue-list { display: grid; gap: 8px; max-height: 55vh; overflow: auto; }
.queue-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; text-align: left; border: 1px solid var(--line); background: var(--paper-raised); border-radius: 10px; padding: 10px 12px; cursor: pointer; }
.queue-item:hover { border-color: var(--line-strong); background: var(--paper-sunken); }
.queue-item-main { display: grid; gap: 3px; min-width: 0; }
.queue-item-main strong { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.queue-item-main small { color: var(--muted); font-size: 11px; }
.queue-error { color: var(--danger); font-size: 10.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.queue-item-arrow { color: var(--faint); }
.queue-section-title { margin: 10px 0 0; color: var(--muted); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.queue-item-failed { cursor: default; align-items: flex-start; }
.queue-item-open { flex: 1; border: 0; background: transparent; padding: 0; color: inherit; text-align: left; cursor: pointer; }
.media-viewer-copy { display: grid; gap: 3px; min-width: 0; }
.media-source { color: #e6b8a0; font-size: 11px; text-decoration: underline; text-underline-offset: 2px; }
.profile-reason { margin: -2px 0 8px; color: var(--faint); font-size: 10.5px; line-height: 1.4; }
.profile-lens { margin: 0 0 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); }
.profile-lens p { margin: 0; font-size: 12px; }
.profile-lens p + p { margin-top: 5px; }
.profile-risk { color: var(--muted); font-size: 11px !important; }
.profile-calendar { margin: 0 0 12px; }
.profile-calendar summary { cursor: pointer; color: var(--accent-ink); font-size: 12px; }
.profile-calendar-links { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.profile-calendar-links a { border: 1px solid var(--line); border-radius: 999px; padding: 5px 10px; font-size: 11.5px; color: var(--ink); text-decoration: none; }
.profile-fipe { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0 0 12px; }
.profile-fipe .hint { margin: 0; }
.profile-override { display: flex; align-items: center; gap: 8px; margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line); }
.profile-override label { font-size: 11px; color: var(--muted); }
.profile-override-select { max-width: 230px; font-size: 11px; padding: 5px 8px; }
.portal-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 12px 0 14px; }
.portal-category-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.portal-region { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); }
.portal-catalog { border: 1px solid var(--line); border-radius: 14px; padding: 12px; margin-bottom: 14px; background: var(--paper-raised); }
.portal-catalog h4 { margin: 0 0 8px; font-size: 13px; }
.portal-catalog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; }
.portal-suggestion { border: 1px solid var(--line); border-radius: 10px; padding: 9px; display: grid; gap: 5px; background: var(--paper); }
.portal-suggestion strong { font-size: 12.5px; }
.portal-suggestion .hint { font-size: 10.5px; line-height: 1.35; }
@media (max-width: 720px) { .portal-catalog-grid { grid-template-columns: 1fr; } .portal-toolbar { align-items: flex-start; } }

/* ------------------------------------------------- guia de importação */
.section-kicker {
  margin: 0;
  font-size: var(--text-caption);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
  font-weight: 600;
}
.import-page {
  max-width: 1080px;
  margin: 0 auto;
  padding: clamp(32px, 6vw, 72px) clamp(20px, 5vw, 40px) 64px;
  display: grid;
  gap: clamp(38px, 6vw, 64px);
}
.import-hero { max-width: 780px; }
.import-hero h1 {
  font-family: var(--serif);
  font-size: clamp(40px, 7vw, 68px);
  line-height: 1;
  letter-spacing: -1.5px;
  margin: 12px 0 18px;
}
.import-hero h1 em { color: var(--accent); font-style: italic; }
.import-lede {
  max-width: 60ch;
  color: var(--ink-soft);
  font-size: 17px;
  line-height: 1.6;
}
.import-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 24px 0 12px; }
.import-meta { color: var(--faint); font-size: 12px; line-height: 1.6; }
.import-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
}
.import-step {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--paper-raised);
  padding: 22px 20px 18px;
  display: grid;
  gap: 8px;
  align-content: start;
}
.import-step-number {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent-ink);
  border: 1px solid var(--accent-line);
  font-size: 12px;
  font-weight: 600;
}
.import-step h2 { font-family: var(--serif); font-size: 21px; margin: 2px 0 0; }
.import-step p { margin: 0; color: var(--muted); font-size: 13.5px; line-height: 1.6; }
.import-section-head { display: grid; gap: 6px; margin-bottom: 18px; }
.import-section-head h2 { font-family: var(--serif); font-size: clamp(26px, 4vw, 34px); margin: 0; letter-spacing: -0.5px; }
.import-source-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}
.import-source-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--paper-raised);
  padding: 20px;
  display: grid;
  gap: 8px;
  align-content: start;
}
.import-source-card h3 { font-family: var(--serif); font-size: 22px; margin: 0; font-weight: 500; }
.import-source-card p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.65; }
.import-source-card a { color: var(--accent-ink); }
.import-source-card code {
  font-family: var(--mono);
  font-size: 11.5px;
  background: var(--paper-sunken);
  border-radius: var(--radius-sm);
  padding: 1px 5px;
}
.import-format {
  justify-self: start;
  margin-top: 4px;
  border: 1px solid var(--line);
  background: var(--paper-sunken);
  border-radius: var(--radius-pill);
  padding: 2px 9px;
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.import-source-cta {
  justify-self: start;
  margin-top: 6px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--accent-ink);
}
.import-source-cta:hover { text-decoration: underline; text-underline-offset: 2px; }
.import-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--paper-raised); }
.import-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.import-table th, .import-table td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
.import-table th { font-size: 11px; letter-spacing: 0.07em; text-transform: uppercase; color: var(--faint); background: var(--paper-sunken); }
.import-table tr:last-child td { border-bottom: 0; }
.import-table td:first-child { color: var(--ink); font-weight: 500; white-space: nowrap; }
.import-table td:last-child { color: var(--muted); line-height: 1.6; }
.import-note { margin: 14px 0 0; color: var(--faint); font-size: 12.5px; line-height: 1.7; max-width: 72ch; }
.import-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border: 1px solid var(--accent-line);
  background: var(--accent-soft);
  border-radius: var(--radius-lg);
  padding: clamp(22px, 4vw, 34px);
}
.import-cta h2 { font-family: var(--serif); font-size: clamp(24px, 4vw, 30px); margin: 4px 0 6px; }
.import-cta p { margin: 0; color: var(--ink-soft); font-size: 13.5px; max-width: 60ch; line-height: 1.6; }
@media (max-width: 720px) {
  .import-page { padding-top: 28px; gap: 36px; }
  .import-hero h1 { font-size: clamp(36px, 11vw, 46px); }
  .import-lede { font-size: 15px; }
  .import-step { padding: 18px; }
  .import-table th, .import-table td { padding: 10px 12px; }
  .import-table td:first-child { white-space: normal; }
}

/* --- Administração (master admin) ---------------------------------------- */
.admin-layout { max-width: 1100px; }
.admin-key-row {
  display: grid;
  gap: 10px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.admin-key-row:last-child { border-bottom: 0; }
.admin-key-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.admin-key-head code {
  font-size: 12.5px;
  color: var(--muted);
  background: var(--paper-sunken);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}
.admin-form { display: grid; gap: 12px; }
.admin-search { display: flex; gap: 8px; margin-bottom: 12px; }
.admin-search .input { flex: 1; }
.admin-matrix td { vertical-align: top; min-width: 180px; }
.admin-cell { display: grid; gap: 4px; justify-items: start; }
.admin-cell-model { font-size: 13px; color: var(--ink); word-break: break-word; }
.admin-cell-provider { font-size: 11.5px; color: var(--muted); }
.admin-route-row {
  display: grid;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.admin-route-row:last-of-type { border-bottom: 0; }
.admin-route-fields {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) minmax(180px, 1.4fr);
  gap: 10px;
}
.admin-model-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 55vh;
  overflow: auto;
}
.admin-model { font-size: 12px; }
@media (max-width: 720px) {
  .admin-route-fields { grid-template-columns: minmax(0, 1fr); }
  .admin-search { flex-direction: column; }
}

.usage-row summary { cursor: pointer; }
.usage-receipt { margin: 4px 0 8px; }
