/* Osint Instagram · layout de app com abas laterais.
   Design system herdado do Osint TikTok (ref. TRACE): monocromático, corpo 14px,
   títulos 22px, números 28px, rótulos em mono caixa alta. Cada resultado é uma rota própria (#/r/N). */
:root {
  color-scheme: dark;
  --bg: #0b0b0b;
  --side: #0f0f0f;
  --surface: #141414;
  --line: #222;
  --line-2: #333;
  --text: #ededed;
  --muted: #9a9a9a;
  --faint: #666;
  --err: #ff6b5e;
  --sans: "Helvetica Neue", Inter, "Segoe UI", Arial, system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --side-w: 232px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scrollbar-color: var(--line-2) var(--bg); -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.55 var(--sans); -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums; }
::selection { background: var(--text); color: var(--bg); }
:focus-visible { outline: 1px solid var(--text); outline-offset: 2px; }
h1:focus { outline: none; }
a { color: inherit; text-underline-offset: 0.2em; text-decoration-color: var(--faint); }
a:hover { text-decoration-color: currentColor; }
button { font: inherit; color: inherit; }
code { font: 12px var(--mono); padding: 1px 4px; background: var(--surface); }
.muted { color: var(--faint); }
.visually-hidden { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* rótulos mono */
.side-h, .crumb, .lbl, .group-name, .chip, .seg label, .run, .fig-k, dt, .data-table th, .matrix th, .hm-hour, .hm-day, .side-status, .side-foot, .ghost, .show-more, .more summary, .tabs .n, .tabs .i, .table-tools, .pager {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
}

/* ================= layout ================= */
.app { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-block-size: 100dvh; }
.side {
  position: sticky; inset-block-start: 0; block-size: 100dvh; overflow-y: auto;
  display: flex; flex-direction: column; gap: 4px; padding: 20px 12px;
  background: var(--side); border-inline-end: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; text-decoration: none; font-weight: 500; }
.logo { font: 13px var(--mono); }
.side-h { margin: 18px 10px 6px; color: var(--faint); font-size: 10px; }
.side-h span { text-transform: none; letter-spacing: 0.02em; }
.tabs { margin: 0; padding: 0; list-style: none; display: grid; gap: 1px; }
.tabs a {
  display: flex; align-items: center; gap: 8px; min-block-size: 34px; padding: 6px 10px;
  color: var(--muted); text-decoration: none; border-inline-start: 2px solid transparent;
}
.tabs a:hover { color: var(--text); background: var(--surface); }
.tabs a[aria-current="page"] { color: var(--text); background: var(--surface); border-inline-start-color: var(--text); }
.tabs a[aria-disabled="true"] { color: var(--faint); }
.tabs .i { color: var(--faint); font-size: 10px; }
.tabs .n { margin-inline-start: auto; color: var(--faint); font-size: 10px; }
.tabs .n.err { color: var(--err); }
.dot { margin-inline-start: auto; inline-size: 6px; block-size: 6px; border-radius: 50%; background: var(--muted); }
@media (prefers-reduced-motion: no-preference) { .dot { animation: blink 1s ease-in-out infinite; } }
@keyframes blink { 50% { opacity: 0.2; } }
.side-status { margin: auto 10px 0; padding-block-start: 16px; display: grid; gap: 8px; color: var(--muted); font-size: 10px; }
.side-status progress { inline-size: 100%; block-size: 2px; appearance: none; border: 0; background: var(--line); }
.side-status progress::-webkit-progress-bar { background: var(--line); }
.side-status progress::-webkit-progress-value { background: var(--text); }
.side-status progress::-moz-progress-bar { background: var(--text); }
.side-foot { margin: 16px 10px 0; color: var(--faint); font-size: 10px; }
.side-status:not([hidden]) + .side-foot { margin-block-start: 12px; }
.side-status[hidden] + .side-foot { margin-block-start: auto; }

main { min-inline-size: 0; padding: 40px clamp(20px, 5vw, 64px) 80px; }
.view { max-inline-size: 960px; }
.view[data-view="search"], .view[data-view="log"], .view[data-view="sobre"] { max-inline-size: 720px; }

/* celular: abas viram faixa horizontal no topo */
@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; }
  .side { position: sticky; z-index: 10; block-size: auto; flex-direction: row; align-items: center; gap: 0; padding: 8px 12px; overflow-x: auto; overflow-y: hidden; border-inline-end: 0; border-block-end: 1px solid var(--line); }
  .side nav { display: flex; align-items: center; gap: 4px; }
  .side nav > div { display: flex; align-items: center; }
  .brand { padding: 0 12px 0 0; flex: none; }
  .brand { white-space: nowrap; }
  .side-h, .side-foot, .side-status { display: none; }
  .tabs { display: flex; gap: 2px; }
  .tabs a { white-space: nowrap; min-block-size: 32px; border-inline-start: 0; border-block-end: 2px solid transparent; }
  .tabs a[aria-current="page"] { border-block-end-color: var(--text); }
  main { padding-block-start: 24px; }
}

/* ================= cabeçalho de cada tela ================= */
.view-head { margin-block-end: 28px; padding-block-end: 20px; border-block-end: 1px solid var(--line); }
.crumb { margin: 0 0 8px; color: var(--faint); font-size: 10px; }
.view-head h1 { margin: 0; font-size: 22px; font-weight: 500; line-height: 1.2; letter-spacing: -0.01em; }
.head-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.lead { margin: 8px 0 0; color: var(--muted); max-inline-size: 56ch; }
.meta { margin: 6px 0 0; color: var(--faint); font-size: 13px; }
.actions { display: flex; flex-wrap: wrap; gap: 6px; }
.ghost, .show-more {
  display: inline-flex; align-items: center; gap: 8px; min-block-size: 30px; padding: 0 12px;
  border: 1px solid var(--line-2); background: none; color: var(--muted); text-decoration: none; cursor: pointer; font-size: 10px;
}
.ghost:hover, .show-more:hover, .ghost[aria-pressed="true"] { color: var(--text); border-color: var(--text); }
.show-more { margin-block-start: 16px; }
.show-more span { color: var(--faint); }
.pager { display: flex; justify-content: space-between; gap: 12px; margin-block-start: 32px; padding-block-start: 16px; border-block-start: 1px solid var(--line); font-size: 10px; }
.pager a { color: var(--muted); text-decoration: none; padding-block: 6px; }
.pager a:hover { color: var(--text); }
.empty { margin: 0; color: var(--muted); display: flex; align-items: center; gap: 10px; }
.empty.err, .err { color: var(--err); }

/* ================= formulário ================= */
.form { display: grid; gap: 28px; }
.field { margin: 0; padding: 0; border: 0; min-inline-size: 0; }
.lbl { display: flex; gap: 10px; align-items: baseline; padding: 0; margin-block-end: 10px; color: var(--muted); font-size: 10px; }
.lbl span { color: var(--faint); text-transform: none; letter-spacing: 0.02em; font-size: 12px; }
.target {
  inline-size: 100%; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 0; background: var(--surface);
  color: var(--text); font: 16px var(--sans); outline: none;
}
.target::placeholder { color: var(--faint); }
.target:focus { border-color: var(--text); }
.target:user-invalid { border-color: var(--err); }
.groups { display: grid; gap: 8px; }
.group { display: grid; grid-template-columns: 84px 1fr; align-items: baseline; gap: 12px; }
.group-name { color: var(--faint); font-size: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chip { position: relative; display: inline-flex; align-items: center; min-block-size: 28px; padding: 0 10px; border: 1px solid var(--line-2); cursor: pointer; color: var(--muted); user-select: none; font-size: 10px; }
.chip input, .seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chip:hover { color: var(--text); border-color: var(--muted); }
.chip:has(input:checked), .seg label:has(input:checked) { background: var(--text); color: var(--bg); border-color: var(--text); }
.chip:has(input:focus-visible), .seg label:has(input:focus-visible) { outline: 1px solid var(--text); outline-offset: 2px; }
@media (max-width: 560px) { .group { grid-template-columns: 1fr; gap: 4px; } }

/* opção + "?" grudados; o "?" é o alvo de toque no celular */
.chip-wrap { display: inline-flex; }
.chip-wrap .chip { border-inline-end: 0; }
.tip-btn { min-inline-size: 26px; min-block-size: 28px; padding: 0 6px; border: 1px solid var(--line-2); border-inline-start: 1px dotted var(--line-2); background: none; color: var(--faint); font: 11px var(--mono); cursor: help; }
.tip-btn:hover, .tip-btn[aria-expanded="true"] { color: var(--text); }
.chip-wrap:has(input:checked) .tip-btn { border-color: var(--text); color: var(--muted); }
.chip-wrap:hover .chip:not(:has(input:checked)) { color: var(--text); border-color: var(--muted); }
.chip-wrap:hover .tip-btn { border-color: var(--muted); }
@media (pointer: coarse) { .tip-btn { min-inline-size: 32px; min-block-size: 32px; } .chip { min-block-size: 32px; } }
.tip {
  position: fixed; inset: auto; margin: 0; max-inline-size: min(300px, calc(100vw - 16px));
  padding: 10px 12px; border: 1px solid var(--line-2); background: var(--side); color: var(--text);
  font: 13px/1.45 var(--sans); box-shadow: 0 6px 24px rgb(0 0 0 / .5);
}
.run-row { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 16px; padding-block-start: 20px; border-block-start: 1px solid var(--line); }
.limit { margin: 0; padding: 0; border: 0; }
.seg { display: flex; }
.seg label { position: relative; display: inline-flex; align-items: center; min-block-size: 30px; padding: 0 12px; border: 1px solid var(--line-2); margin-inline-start: -1px; cursor: pointer; color: var(--muted); font-size: 10px; }
.run {
  display: inline-flex; align-items: center; justify-content: space-between; gap: 32px; min-inline-size: 168px; min-block-size: 40px; padding: 0 14px;
  border: 1px solid var(--text); background: var(--text); color: var(--bg); cursor: pointer; font-weight: 600;
}
.run .arrow { font: 16px var(--sans); }
.run:hover:not(:disabled) { background: transparent; color: var(--text); }
.run:disabled { opacity: 0.35; cursor: default; }
.run.loading { opacity: 1; }
.run.loading .arrow { display: none; }

/* spinner (guia "spinner"): <progress> sem value */
@property --spin { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
progress.loading-spinner {
  display: none; appearance: none; inline-size: 14px; block-size: 14px; border: 0; border-radius: 50%;
  background: conic-gradient(from var(--spin), currentColor 0.3turn, transparent 0);
  mask: radial-gradient(farthest-side, transparent calc(100% - 1.5px), #000 calc(100% - 1px));
}
progress.loading-spinner::-webkit-progress-bar, progress.loading-spinner::-webkit-progress-value { background: none; }
progress.loading-spinner::-moz-progress-bar { background: none; }
.run.loading progress.loading-spinner, progress.loading-spinner.on { display: inline-block; }
@media (prefers-reduced-motion: no-preference) { progress.loading-spinner { animation: spin .8s linear infinite; } }
@keyframes spin { to { --spin: 1turn; } }
@media (forced-colors: active) { progress.loading-spinner { forced-color-adjust: none; color: CanvasText; } }

/* ================= conteúdo dos resultados ================= */
.figures { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; margin-block-end: 24px; }
.figure { display: grid; gap: 4px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); }
.fig-v { font-size: 28px; line-height: 1.1; letter-spacing: -0.02em; }
.fig-k { color: var(--faint); font-size: 10px; }
[data-full] { cursor: help; }

/* "mais detalhes": só abre por clique (guia "accordion") */
.more { margin-block: 8px 24px; border-block: 1px solid var(--line); }
.more summary { display: flex; align-items: center; gap: 8px; min-block-size: 40px; cursor: pointer; list-style: none; color: var(--muted); font-size: 10px; }
.more summary::-webkit-details-marker { display: none; }
.more summary::before { content: "+"; inline-size: 1ch; font-size: 13px; }
.more[open] summary::before { content: "−"; }
.more summary:hover { color: var(--text); }
.more::details-content { interpolate-size: allow-keywords; overflow: clip; contain: layout; }
.more:not([open])::details-content { block-size: 0; }
@media (prefers-reduced-motion: no-preference) {
  .more::details-content { transition: block-size .25s ease-in-out, content-visibility .25s allow-discrete, display .25s allow-discrete; }
}
.more-body { padding-block-end: 16px; }

.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0 24px; margin: 0; }
.facts div { padding: 8px 0; border-block-end: 1px solid var(--line); }
dt { color: var(--faint); font-size: 10px; }
dd { margin: 0; overflow-wrap: anywhere; }
dd.id { font: 12px var(--mono); color: var(--muted); user-select: all; }

.who { display: flex; align-items: center; gap: 12px; margin-block-end: 12px; }
.avatar { flex: none; display: grid; place-items: center; inline-size: 48px; block-size: 48px; overflow: hidden; border-radius: 50%; background: var(--surface); filter: grayscale(1); text-decoration: none; font: 10px var(--mono); color: var(--muted); }
.avatar:hover { filter: none; }
.avatar.sm { inline-size: 28px; block-size: 28px; }
.avatar img { inline-size: 100%; block-size: 100%; object-fit: cover; }
.uname { font-weight: 500; }
.fname { color: var(--muted); font-size: 13px; }
.tag { font: 10px var(--mono); color: var(--muted); letter-spacing: 0.06em; }
.bio { margin: 0 0 20px; color: var(--muted); max-inline-size: 60ch; }

.list-filter { inline-size: min(100%, 300px); margin-block-end: 8px; padding: 7px 10px; border: 1px solid var(--line-2); background: var(--surface); color: var(--text); font: 13px var(--sans); outline: none; }
.list-filter:focus { border-color: var(--text); }
.rows { margin: 0; padding: 0; list-style: none; border-block-start: 1px solid var(--line); }
.rows li { display: grid; grid-template-columns: auto minmax(0, 14rem) minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 7px 0; border-block-end: 1px solid var(--line); }
.rows .num { font: 12px var(--mono); color: var(--muted); }
.rows .fname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rows.comments li { grid-template-columns: auto 1fr; gap: 2px 12px; padding-block: 10px; }
.rows.comments .meta { margin: 0; justify-self: end; font-size: 12px; }
.rows.comments p { grid-column: 1 / -1; margin: 0; color: var(--muted); }
@media (max-width: 560px) { .rows li { grid-template-columns: auto 1fr auto; } .rows li .fname { display: none; } }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 4px; }
.gallery a { position: relative; display: block; aspect-ratio: 9 / 16; overflow: hidden; background: var(--surface); }
.gallery img { inline-size: 100%; block-size: 100%; object-fit: cover; display: block; filter: grayscale(1); transition: filter .2s; }
.gallery a:hover img, .gallery a:focus-visible img { filter: none; }
.ov { position: absolute; inset: auto 0 0; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0 6px; padding: 20px 7px 6px; font: 10px var(--mono); color: #fff; white-space: nowrap; background: linear-gradient(transparent, rgb(0 0 0 / .85)); }

.ranking { margin: 0 0 8px; padding: 0; list-style: none; display: grid; gap: 2px; max-inline-size: 560px; counter-reset: r var(--start, 0); }
.ranking li { display: grid; grid-template-columns: 10rem 1fr 3ch; align-items: center; gap: 12px; padding: 6px 0; }
.ranking .bar { block-size: 4px; inline-size: var(--w); background: var(--muted); }
.ranking .num { font: 12px var(--mono); color: var(--muted); text-align: end; }

.heatmap-wrap { overflow-x: auto; }
.heatmap { display: grid; grid-template-columns: 32px repeat(24, minmax(12px, 1fr)); gap: 3px; min-inline-size: 480px; }
.hm-hour, .hm-day { font-size: 9px; color: var(--faint); }
.hm-day { align-self: center; }
.hm-cell { aspect-ratio: 1; background: color-mix(in srgb, #fff var(--p, 0%), #191919); }

.matrix { inline-size: 100%; max-inline-size: 560px; border-collapse: collapse; }
.matrix th, .matrix td { padding: 8px 0; border-block-end: 1px solid var(--line); text-align: end; font-weight: 400; }
.matrix thead th { color: var(--faint); font-size: 10px; }
.matrix tbody th { text-align: start; color: var(--muted); font-size: 10px; }
.matrix td { font-size: 15px; }
.matrix td + td { color: var(--muted); }

/* tabela: poucas colunas por padrão (guias "sortable-table", "responsive-table", "scrollability-affordance-hints") */
.table-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-block-end: 10px; font-size: 10px; }
.table-wrap { container-type: scroll-state; max-block-size: 62dvh; overflow: auto; border: 1px solid var(--line); background: var(--bg); }
.data-table { min-inline-size: 100%; border-collapse: collapse; font-size: 13px; white-space: nowrap; }
.data-table:not(.all) [data-opt] { display: none; }
.data-table th, .data-table td { padding: 7px 12px; border-block-end: 1px solid var(--line); text-align: start; }
.data-table th { position: sticky; inset-block-start: 0; z-index: 2; background: var(--side); color: var(--muted); font-size: 10px; font-weight: 400; }
.data-table th:has(> button) { padding: 0; }
.data-table th > button { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 6px; inline-size: 100%; min-block-size: 32px; padding: 7px 12px; cursor: pointer; }
.data-table th > button:hover { color: var(--text); }
.data-table th > button:focus-visible { outline: 1px solid var(--text); outline-offset: -1px; }
.data-table th > button::after { content: "↕"; opacity: .3; }
.data-table th[aria-sort] { color: var(--text); }
.data-table th[aria-sort="ascending"] > button::after { content: "↑"; opacity: 1; }
.data-table th[aria-sort="descending"] > button::after { content: "↓"; opacity: 1; }
.data-table td.num, .data-table th.num > button { text-align: end; justify-content: flex-end; }
.data-table td.num { font: 12px var(--mono); }
.data-table td.cap { max-inline-size: 320px; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
.data-table tbody tr:hover td { background: var(--surface); }
.table-wrap::after { content: ""; display: block; position: sticky; inset-block-end: 0; block-size: 2rem; margin-block-start: -2rem; z-index: 4; pointer-events: none; opacity: 0; transition: opacity .2s; background: linear-gradient(transparent, var(--bg)); }
@container scroll-state(scrollable: block-end) { .table-wrap::after { opacity: 1; } }

pre.json { margin: 0; padding: 16px; max-block-size: 70dvh; overflow: auto; border: 1px solid var(--line); background: var(--surface); font: 12px/1.5 var(--mono); color: var(--muted); }

/* log e aviso */
.log { margin: 0; padding: 0; list-style: none; font: 12px/1.8 var(--mono); color: var(--muted); }
.log li.err { color: var(--err); }
.log li.ok { color: var(--text); }
.small { font-size: 12px; }
.tabs .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ================= avisos (inline, não toast: guia "persistent-toast-notifications" pede banner para o que importa) ================= */
.msg { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-block-start: 10px; padding: 10px 12px; border: 1px solid var(--line-2); border-inline-start-width: 3px; background: var(--surface); }
.msg p { margin: 0; flex: 1 1 100%; }
.msg.error { border-color: var(--err); color: var(--text); }
.msg.error p:first-child::before { content: "! "; color: var(--err); font-weight: 700; }
.msg.warn { border-inline-start-color: #d9b45a; }
.msg.info, .msg.neutral { border-inline-start-color: var(--muted); color: var(--muted); }
.msg.neutral { margin-block-start: 0; }
.notice { margin: 0 0 16px; padding: 8px 12px; border-inline-start: 3px solid var(--muted); background: var(--surface); color: var(--muted); }
.hint-line, .note { margin: 8px 0 0; color: var(--faint); font-size: 12px; max-inline-size: 56ch; }
.target[aria-invalid] { border-color: var(--err); }

/* "Mais opções": funções que podem vir vazias ficam discretas */
.more-opts { margin-block-start: 14px; }
.more-opts summary { display: inline-flex; gap: 8px; align-items: baseline; cursor: pointer; list-style: none; color: var(--faint); font: 10px var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.more-opts summary::-webkit-details-marker { display: none; }
.more-opts summary::before { content: "+"; }
.more-opts[open] summary::before { content: "−"; }
.more-opts summary span { text-transform: none; letter-spacing: 0; font-family: var(--sans); font-size: 12px; }
.more-opts summary:hover { color: var(--text); }
.more-opts .groups { margin-block-start: 10px; }

/* ================= dialog (guia "dialog": modal nativo, sem travar scroll do body) ================= */
dialog.sheet { inline-size: min(760px, calc(100vw - 32px)); max-block-size: min(86dvh, 900px); padding: 20px 22px; border: 1px solid var(--line-2); background: var(--side); color: var(--text); }
dialog:modal { overscroll-behavior: contain; }
dialog::backdrop { background: rgb(0 0 0 / .6); overflow: hidden; overscroll-behavior: contain; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-block-end: 16px; }
.sheet-head h2 { margin: 0; font-size: 18px; font-weight: 500; }
.sheet-head form { margin: 0; }
.sheet-foot { display: flex; justify-content: flex-end; margin-block-start: 18px; }
.sheet-links { margin: 16px 0 0; }
.sub { margin: 20px 0 10px; font: 11px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--faint); font-weight: 400; }
.facts.one { grid-template-columns: 1fr; }
.facts.one dd { color: var(--muted); }
.table-wrap.short { max-block-size: 320px; }
#job-form { display: grid; gap: 18px; }
.target.sm { font-size: 14px; padding: 8px 10px; }
textarea.target { resize: vertical; font-family: var(--sans); }
.row2 { display: flex; flex-wrap: wrap; gap: 24px; align-items: end; }
.check { display: inline-flex; gap: 8px; align-items: center; color: var(--muted); }
.check input, .chip input[type=checkbox] { accent-color: var(--text); }
.link { all: unset; cursor: pointer; text-decoration: underline; text-decoration-color: var(--faint); text-transform: none; letter-spacing: 0; font: 12px var(--sans); color: var(--muted); }
.link:hover { color: var(--text); }
.chip-btn { border: 1px dashed var(--line-2); background: none; color: var(--muted); font: 11px var(--mono); padding: 4px 8px; cursor: pointer; }
.chip-btn:hover { color: var(--text); border-color: var(--muted); }
#job-recent { margin-block-start: 8px; align-items: center; }

/* ================= histórico e automações ================= */
.hist, .jobs { margin: 0; padding: 0; list-style: none; border-block-start: 1px solid var(--line); }
.hist li, .jobs li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding: 12px 0; border-block-end: 1px solid var(--line); }
.hist-main { display: grid; gap: 2px; min-inline-size: 0; }
.hist-main a.uname { text-decoration: none; }
.hist-main a.uname:hover { text-decoration: underline; }
.job.off .hist-main { opacity: .55; }
.ghost.quiet { border-color: transparent; color: var(--faint); }
.ghost.quiet:hover { color: var(--text); border-color: var(--line-2); }
.ghost:disabled { opacity: .4; cursor: default; }

/* =====================================================================
   Osint Instagram: peças próprias (mesmos tokens do design system acima)
   ===================================================================== */
.brand svg { flex: none; }
.side-foot a { color: var(--muted); text-decoration: none; }
.side-foot a:hover { color: var(--text); }
.side-status .ghost { justify-content: center; }

/* campo do alvo com "@" fixo (o @ não vai junto no texto, igual ao app antigo) */
.input-shell { display: flex; align-items: stretch; border: 1px solid var(--line-2); background: var(--surface); }
.input-shell:focus-within { border-color: var(--text); }
.input-shell:has(.target[aria-invalid]) { border-color: var(--err); }
.input-shell .at { display: grid; place-items: center; padding-inline: 12px 0; color: var(--faint); font: 16px var(--mono); }
.input-shell .target { border: 0; background: none; }
textarea.target { min-block-size: 84px; line-height: 1.5; }
.recents { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-block-start: 10px; }
.recents .lbl-s { color: var(--faint); font: 10px var(--mono); letter-spacing: .08em; text-transform: uppercase; margin-inline-end: 4px; }
.recent { display: inline-flex; align-items: stretch; border: 1px solid var(--line-2); }
.recent button { all: unset; cursor: pointer; padding: 3px 8px; font: 12px var(--sans); color: var(--muted); }
.recent button:hover, .recent button:focus-visible { color: var(--text); }
.recent button:focus-visible { outline: 1px solid var(--text); }
.recent .x { padding-inline: 6px; border-inline-start: 1px solid var(--line); color: var(--faint); }
.kbd { font: 11px var(--mono); color: var(--faint); }
.kbd kbd { font: inherit; padding: 0 4px; border: 1px solid var(--line-2); }

/* parâmetros dos comandos escolhidos */
.params { display: grid; gap: 10px; margin-block-start: 16px; padding-block-start: 14px; border-block-start: 1px dashed var(--line-2); }
.params:not(:has(.param-row:not([hidden]))) { display: none; }
.param-row { display: grid; grid-template-columns: 140px 1fr; gap: 12px; align-items: center; }
.param-fields { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; }
.param { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.param .param-value { inline-size: 9rem; }
.param .param-value[type=text] { inline-size: min(22rem, 60vw); }
.param select.param-value { inline-size: auto; }
.param .param-value:disabled { opacity: .4; }
select.target { appearance: auto; }
@media (max-width: 560px) { .param-row { grid-template-columns: 1fr; gap: 4px; } }

.run-actions { display: flex; align-items: center; gap: 8px; }
.cost { margin: 10px 0 0; color: var(--faint); font-size: 12px; }
.cost.warn { color: #d9b45a; }
.cost strong { color: var(--text); font-weight: 500; }
.opts-body { display: grid; gap: 18px; margin-block-start: 14px; }

/* resposta da IA */
.answer { max-inline-size: 68ch; margin-block-end: 24px; padding: 16px 18px; border: 1px solid var(--line); border-inline-start: 3px solid var(--text); background: var(--surface); }
.answer p { margin: 0 0 8px; }
.answer p:last-child { margin: 0; }
.answer ul { margin: 0 0 8px; padding-inline-start: 18px; }

/* listas de etiquetas (hashtags, links da bio, usuários antigos) */
.pills { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 16px; padding: 0; list-style: none; }
.pills li, .pills a { display: inline-flex; gap: 6px; padding: 3px 8px; border: 1px solid var(--line-2); color: var(--muted); font-size: 13px; text-decoration: none; }
.pills a:hover { color: var(--text); border-color: var(--muted); }

/* grade de posts (prévias), stories, destaques */
.post-filter { margin-block-end: 10px; }
.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(116px, 1fr)); gap: 4px; grid-auto-flow: dense; }
.post-tile { all: unset; box-sizing: border-box; position: relative; display: block; aspect-ratio: 1; overflow: hidden; background: var(--surface); cursor: pointer; }
.post-tile:focus-visible { outline: 1px solid var(--text); outline-offset: 1px; }
.post-tile img { inline-size: 100%; block-size: 100%; object-fit: cover; display: block; filter: grayscale(1); transition: filter .2s; }
.post-tile:hover img, .post-tile:focus-visible img { filter: none; }
.post-tile .ty { position: absolute; inset: 6px 6px auto auto; font: 10px var(--mono); color: #fff; text-shadow: 0 0 3px #000; }
.post-tile[aria-expanded="true"] { outline: 1px solid var(--text); }
.post-slides { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 4px; padding: 6px; border: 1px dashed var(--line-2); }
.story-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 4px; }
.story { position: relative; aspect-ratio: 9 / 16; overflow: hidden; background: var(--surface); }
.story img, .story video { inline-size: 100%; block-size: 100%; object-fit: cover; display: block; filter: grayscale(1); transition: filter .2s; }
.story:hover img, .story:hover video, .story:focus-within img, .story:focus-within video { filter: none; }
.story .ov { pointer-events: none; }
.story .open { position: absolute; inset: 6px 6px auto auto; font: 10px var(--mono); color: #fff; text-decoration: none; padding: 2px 5px; background: rgb(0 0 0 / .6); }
.story.broken img, .story.broken video { display: none; }
.story .fallback { display: none; position: absolute; inset: 0; place-content: center; gap: 6px; text-align: center; color: var(--faint); font-size: 12px; }
.story.broken .fallback { display: grid; }
.hl-grid { display: flex; flex-wrap: wrap; gap: 18px; margin-block-end: 16px; }
.hl { display: grid; justify-items: center; gap: 6px; inline-size: 84px; text-align: center; text-decoration: none; color: var(--muted); font-size: 12px; }
.hl .avatar { inline-size: 64px; block-size: 64px; border: 1px solid var(--line-2); }
.hl:hover { color: var(--text); }

/* locais e mapa */
.rows.addrs li { grid-template-columns: auto 1fr auto; }
.rows.quotes li { grid-template-columns: auto 1fr; align-items: start; }
.rows.quotes p { margin: 0; color: var(--muted); white-space: pre-line; }
.map { block-size: 360px; border: 1px solid var(--line); filter: grayscale(1) contrast(1.05); }

/* comparação e diferenças */
.diff { margin: 0 0 20px; padding: 0; list-style: none; font: 13px/1.8 var(--mono); }
.diff .added { color: var(--text); }
.diff .removed { color: var(--faint); text-decoration: line-through; }
.diff .changed s { color: var(--faint); }

/* menu "↓ Baixar" (popover) */
.menu { margin: 0; padding: 4px; border: 1px solid var(--line-2); background: var(--side); color: var(--text); min-inline-size: 220px; }
.menu:popover-open { display: grid; gap: 2px; }
.menu button { all: unset; box-sizing: border-box; display: block; padding: 8px 10px; cursor: pointer; color: var(--muted); font-size: 13px; }
.menu button:hover, .menu button:focus-visible { background: var(--surface); color: var(--text); }
.menu button span { color: var(--faint); font-size: 12px; }
@supports (position-anchor: --a) {
  .menu { position-area: block-end span-inline-start; inset: auto; margin: 4px 0 0; }
}

/* sobre e ajustes */
.libs { margin: 0; padding: 0; list-style: none; border-block-start: 1px solid var(--line); }
.libs li { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; padding: 8px 0; border-block-end: 1px solid var(--line); }
.libs .muted { font-size: 12px; }
.section { margin-block-end: 36px; }
.section h2 { margin: 0 0 12px; font-size: 16px; font-weight: 500; }
.key-row { display: flex; flex-wrap: wrap; gap: 8px; }
.key-row .target { flex: 1 1 260px; }
.status-ok { color: var(--text); }

/* desempenho: linhas fora da tela não são desenhadas (guia "defer-rendering-heavy-content") */
.data-table tbody tr { content-visibility: auto; contain-intrinsic-size: auto 34px; }
.log li { content-visibility: auto; contain-intrinsic-size: auto 22px; }

/* relatório HTML exportado */
.report main { max-inline-size: 960px; margin: 0 auto; padding: 40px 24px; }
.report section.rep { margin-block-end: 40px; padding-block-start: 20px; border-block-start: 1px solid var(--line); }
.report h2 { font-size: 18px; font-weight: 500; margin: 0 0 4px; }
.more + .more { margin-block-start: -24px; border-block-start: 0; }
/* revisão BMAD (UX + QA) */
.bio { white-space: pre-line; }
.kbd { white-space: nowrap; }
.sample { margin: -8px 0 16px; }
.filter-status:empty { display: none; }
.data-table th > button::after { content: "↕" / ""; }
.data-table th[aria-sort="ascending"] > button::after { content: "↑" / ""; }
.data-table th[aria-sort="descending"] > button::after { content: "↓" / ""; }
.hist .actions .quiet { margin-inline-start: 8px; }
@media (max-width: 760px) {
  .app { grid-template-rows: auto 1fr; }
  .side { mask-image: linear-gradient(90deg, #000 88%, transparent); }
  .side nav { padding-inline-end: 32px; }
  .hide-m { display: none; }
  .figures { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 8px; }
  .fig-v { font-size: 22px; }
}

/* limite "Personalizado" */
.seg { flex-wrap: wrap; }
.custom-limit { display: flex; align-items: center; gap: 10px; margin-block-start: 8px; }
.custom-limit input { inline-size: 120px; font-variant-numeric: tabular-nums; }
.custom-limit input[aria-invalid] { border-color: var(--err); }
.hint-line.err { color: var(--err); }
