/* Biblioteca de publicidad — design system
   Tokens → base → layout → components → views → responsive.
   CSP: no inline styles, no external fonts, no data: URIs. */

/* ---------- Tokens ---------- */
:root {
  --font-sans: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, ui-serif, serif;
  --font-mono: ui-monospace, "Cascadia Code", "SF Mono", Consolas, monospace;

  --bg: #f5f4f0;
  --bg-elev: #faf9f6;
  --surface: #ffffff;
  --surface-2: #f1efe9;
  --surface-3: #e7e4dc;
  --ink: #13222a;
  --ink-2: #34444c;
  --muted: #64727a;
  --line: #e3e0d8;
  --line-strong: #cfcbc0;

  --brand: #145a72;
  --brand-2: #c9782f;
  --on-brand: #ffffff;
  --brand-text: color-mix(in oklab, var(--brand) 88%, black);
  --brand-soft: color-mix(in oklab, var(--brand) 10%, var(--surface));
  --ring: color-mix(in oklab, var(--brand) 40%, transparent);

  --ok: #1d7448; --ok-bg: #e2f2e8;
  --warn: #93560a; --warn-bg: #fbeed6;
  --danger: #ae3527; --danger-bg: #fbe3df;
  --info: #255d8e; --info-bg: #e2edf8;
  --neutral: #59656d; --neutral-bg: #ecebe6;
  --fav: #e0245e;

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 2px rgb(16 24 32 / .06), 0 1px 1px rgb(16 24 32 / .04);
  --shadow: 0 14px 34px -14px rgb(16 24 32 / .24), 0 2px 6px rgb(16 24 32 / .05);
  --shadow-lg: 0 40px 90px -24px rgb(6 16 22 / .5);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --pad: clamp(16px, 3.2vw, 44px);
  --sidebar: 264px;
  color-scheme: light;
}
html[data-business="tbu_seguros"] { --brand: #0073c1; --brand-2: #39a9e3; }
html[data-business="rinconcito_tipico"] { --brand: #a05742; --brand-2: #e8940a; }
/* Lucite: black serif on cream, like its logo. In dark mode the cream becomes the accent. */
html[data-business="lucite"] { --brand: #1f1b16; --brand-2: #a9824f; }
@media (prefers-color-scheme: dark) { html[data-business="lucite"]:not([data-theme="light"]) { --brand: #efe4d0; --brand-2: #c9a46e; --on-brand: #1f1b16; } }
html[data-theme="dark"][data-business="lucite"] { --brand: #efe4d0; --brand-2: #c9a46e; --on-brand: #1f1b16; }

@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) {
    --bg: #0d1215; --bg-elev: #11181c; --surface: #151d22; --surface-2: #1b252b; --surface-3: #25313a;
    --ink: #e8eef0; --ink-2: #c4ced2; --muted: #93a2a9; --line: #243038; --line-strong: #35444d;
    --brand-text: color-mix(in oklab, var(--brand) 55%, white);
    --brand-soft: color-mix(in oklab, var(--brand) 22%, var(--surface));
    --ok: #74d3a3; --ok-bg: #12301f; --warn: #f2be6c; --warn-bg: #33260f; --danger: #ff9e90; --danger-bg: #3a1b16;
    --info: #8fc5f3; --info-bg: #132a3d; --neutral: #aab5bb; --neutral-bg: #222c32; --fav: #ff5c8a;
    --shadow-sm: 0 1px 2px rgb(0 0 0 / .4);
    --shadow: 0 16px 38px -16px rgb(0 0 0 / .7), 0 2px 6px rgb(0 0 0 / .3);
    --shadow-lg: 0 40px 90px -20px rgb(0 0 0 / .8);
    color-scheme: dark;
  }
}
html[data-theme="dark"] {
  --bg: #0d1215; --bg-elev: #11181c; --surface: #151d22; --surface-2: #1b252b; --surface-3: #25313a;
  --ink: #e8eef0; --ink-2: #c4ced2; --muted: #93a2a9; --line: #243038; --line-strong: #35444d;
  --brand-text: color-mix(in oklab, var(--brand) 55%, white);
  --brand-soft: color-mix(in oklab, var(--brand) 22%, var(--surface));
  --ok: #74d3a3; --ok-bg: #12301f; --warn: #f2be6c; --warn-bg: #33260f; --danger: #ff9e90; --danger-bg: #3a1b16;
  --info: #8fc5f3; --info-bg: #132a3d; --neutral: #aab5bb; --neutral-bg: #222c32; --fav: #ff5c8a;
  --shadow-sm: 0 1px 2px rgb(0 0 0 / .4);
  --shadow: 0 16px 38px -16px rgb(0 0 0 / .7), 0 2px 6px rgb(0 0 0 / .3);
  --shadow-lg: 0 40px 90px -20px rgb(0 0 0 / .8);
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scrollbar-gutter: stable; scroll-padding-top: 96px; }
html:has(dialog[open]) { overflow: hidden; }
body {
  margin: 0; min-height: 100dvh; background: var(--bg); color: var(--ink);
  font: 15px/1.5 var(--font-sans); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  transition: background-color .3s, color .3s;
}
h1, h2, h3, p { margin: 0; }
a { color: inherit; }
img, video { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; touch-action: manipulation; }
button:disabled { cursor: default; opacity: .4; }
::selection { background: color-mix(in oklab, var(--brand) 28%, transparent); }
:focus-visible { outline: 2px solid var(--brand-text); outline-offset: 3px; border-radius: 6px; }
[hidden] { display: none !important; }
.icon { width: 1.15em; height: 1.15em; flex: none; fill: none; vertical-align: middle; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.muted { color: var(--muted); font-size: .82rem; }
.eyebrow { font-size: .7rem; letter-spacing: .14em; font-weight: 700; text-transform: uppercase; }
kbd { font: 600 .72rem/1 var(--font-mono); padding: 3px 6px; border-radius: 6px; border: 1px solid var(--line-strong); border-bottom-width: 2px; background: var(--surface); color: var(--ink-2); }
.skip-link { position: fixed; left: 16px; top: -60px; z-index: 200; padding: 10px 14px; border-radius: 10px; background: var(--ink); color: var(--bg); text-decoration: none; transition: top .2s; }
.skip-link:focus { top: 12px; }

/* ---------- Buttons & inputs ---------- */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 16px;
  border-radius: 12px; font-weight: 600; font-size: .86rem; text-decoration: none; white-space: nowrap;
  transition: transform .15s var(--ease), background-color .2s, box-shadow .2s, filter .2s, border-color .2s;
}
.button:active:not(:disabled) { transform: scale(.97); }
.button.primary { background: var(--brand); color: var(--on-brand); box-shadow: 0 10px 22px -12px var(--brand); }
.button.primary:hover { filter: brightness(1.08) saturate(1.05); }
.button.secondary { background: var(--surface); color: var(--ink); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.button.secondary:hover { background: var(--surface-2); border-color: var(--line-strong); }
.button.ghost { color: var(--ink-2); }
.button.ghost:hover { background: var(--surface-2); }
.button.small { height: 34px; padding: 0 12px; font-size: .8rem; border-radius: 10px; }
.button.block { width: 100%; }
.button.is-done { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.button[aria-busy="true"], .button.is-loading { opacity: .7; pointer-events: none; }
.button[aria-busy="true"]::after, .button.is-loading::after { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }

.icon-button {
  width: 40px; height: 40px; border-radius: 12px; display: inline-grid; place-items: center; flex: none;
  color: var(--ink-2); background: var(--surface); border: 1px solid var(--line);
  transition: background-color .2s, color .2s, transform .15s var(--ease);
}
.icon-button:hover:not(:disabled) { background: var(--surface-2); color: var(--ink); }
.icon-button:active:not(:disabled) { transform: scale(.94); }
.fav-toggle[aria-pressed="true"] { color: var(--fav); }
.fav-toggle[aria-pressed="true"] .icon { fill: currentColor; }

.input, .select select {
  width: 100%; height: 42px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font-size: .88rem;
  transition: border-color .2s, box-shadow .2s;
}
textarea.input { height: auto; min-height: 110px; padding: 12px; line-height: 1.6; resize: vertical; }
.input:focus, .select select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--ring); }
.select { position: relative; display: block; }
.select select { appearance: none; padding-right: 34px; cursor: pointer; text-overflow: ellipsis; }
.select::after {
  content: ""; position: absolute; right: 14px; top: 50%; width: 7px; height: 7px; margin-top: -6px;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); pointer-events: none;
}
.field { display: grid; gap: 5px; min-width: 0; }
.field > span:first-child, .field > label > span { font-size: .72rem; font-weight: 650; color: var(--muted); letter-spacing: .02em; }

/* Tone tags */
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; font-size: .72rem; font-weight: 650; white-space: nowrap; background: var(--neutral-bg); color: var(--neutral); max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.tag.plain::before { display: none; }
.tone-ok { background: var(--ok-bg); color: var(--ok); }
.tone-warn { background: var(--warn-bg); color: var(--warn); }
.tone-danger { background: var(--danger-bg); color: var(--danger); }
.tone-info { background: var(--info-bg); color: var(--info); }
.tone-neutral { background: var(--neutral-bg); color: var(--neutral); }

/* ---------- Layout ---------- */
.app-shell { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100dvh; }
.sidebar {
  position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; gap: 4px;
  padding: 20px 14px 16px; background: var(--bg-elev); border-right: 1px solid var(--line); overflow-y: auto;
}
.logo {
  width: 40px; height: 40px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; flex: none;
  background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff;
  font: 400 1.35rem/1 var(--font-display); letter-spacing: -.08em; box-shadow: 0 8px 18px -8px var(--brand);
  transition: background .5s;
}
.logo { white-space: nowrap; }
.logo span { font-size: .7em; }
.wordmark { display: flex; align-items: center; gap: 12px; padding: 4px 8px 16px; text-decoration: none; line-height: 1.2; font-size: .9rem; color: var(--ink-2); }
.wordmark strong { display: block; color: var(--ink); }
.side-label { margin: 12px 10px 6px; font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; font-weight: 700; color: var(--muted); }
.business-list { display: grid; gap: 4px; }
.business-button {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 10px; border-radius: 12px; text-align: left;
  color: var(--ink-2); border: 1px solid transparent; transition: background-color .2s, border-color .2s, box-shadow .2s;
}
.business-button:hover { background: var(--surface-2); }
.business-button[aria-current="true"] { background: var(--surface); border-color: var(--line); box-shadow: var(--shadow-sm); color: var(--ink); }
.business-button strong { display: block; font-size: .9rem; font-weight: 650; line-height: 1.25; }
.business-button small { display: block; font-size: .74rem; color: var(--muted); }
.biz-avatar { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none; font-size: .78rem; font-weight: 800; color: #fff; background: var(--muted); letter-spacing: .02em; }
.biz-avatar[data-biz="tbu_seguros"] { background: linear-gradient(135deg, #0073c1, #39a9e3); }
.biz-avatar[data-biz="rinconcito_tipico"] { background: linear-gradient(135deg, #a05742, #e8940a); }
.biz-avatar[data-biz="lucite"] { background: #f7efe2; color: #1f1b16; font: 600 1.05rem/1 var(--font-display); letter-spacing: .04em; box-shadow: inset 0 0 0 1px rgb(31 27 22 / .14); }
.side-bottom { margin-top: auto; display: grid; gap: 2px; padding-top: 14px; border-top: 1px solid var(--line); }
.side-bottom form { display: contents; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 4px 8px 10px; line-height: 1.25; }
.user-chip strong { display: block; font-size: .88rem; }
.user-chip small { display: block; font-size: .74rem; color: var(--muted); }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--brand-soft); color: var(--brand-text); font-weight: 750; }
.side-link {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 10px;
  color: var(--ink-2); text-decoration: none; font-size: .85rem; text-align: left; transition: background-color .2s, color .2s;
}
.side-link:hover { background: var(--surface-2); color: var(--ink); }
.side-link .icon { color: var(--muted); }

.main-content { min-width: 0; padding: 0 var(--pad) 32px; }
.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px;
  margin: 0 calc(var(--pad) * -1); padding: 14px var(--pad);
  background: color-mix(in oklab, var(--bg) 80%, transparent);
  -webkit-backdrop-filter: saturate(1.6) blur(16px); backdrop-filter: saturate(1.6) blur(16px);
  border-bottom: 1px solid transparent;
}
@supports (animation-timeline: scroll()) {
  .topbar { animation: topbar-elevate linear both; animation-timeline: scroll(); animation-range: 0 90px; }
}
@keyframes topbar-elevate { to { border-bottom-color: var(--line); box-shadow: 0 10px 30px -24px rgb(0 0 0 / .35); } }

.search { position: relative; flex: 1; max-width: 680px; display: block; }
.search > .icon { position: absolute; left: 16px; top: 50%; translate: 0 -50%; color: var(--muted); pointer-events: none; }
.search input {
  width: 100%; height: 48px; padding: 0 52px 0 46px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); font-size: .95rem;
  transition: border-color .2s, box-shadow .25s;
}
.search input::placeholder { color: var(--muted); }
.search input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 5px var(--ring), var(--shadow); }
.search input::-webkit-search-cancel-button { cursor: pointer; }
.search kbd { position: absolute; right: 16px; top: 50%; translate: 0 -50%; pointer-events: none; transition: opacity .2s; }
.search input:focus ~ kbd, .search input:not(:placeholder-shown) ~ kbd { opacity: 0; }

/* ---------- Hero & stats ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 28px; align-items: end; padding: 30px 0 26px; }
.hero .eyebrow { color: var(--brand-text); display: inline-flex; align-items: center; gap: 8px; }
.hero .eyebrow::before { content: ""; width: 18px; height: 2px; border-radius: 2px; background: currentColor; }
h1 { font: 400 clamp(2.3rem, 1.3rem + 3.2vw, 4rem)/1.02 var(--font-display); letter-spacing: -.035em; margin: 12px 0 14px; text-wrap: balance; }
h1 em {
  font-style: italic; color: var(--brand-text);
  background: linear-gradient(100deg, var(--brand-text), var(--brand-2)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.intro-copy { color: var(--muted); max-width: 46ch; text-wrap: pretty; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: 10px; }
.stat {
  display: grid; gap: 6px; padding: 14px 16px; text-align: left; border-radius: 16px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm);
  transition: transform .2s var(--ease), border-color .2s, background-color .2s, box-shadow .2s;
}
.stat:hover { transform: translateY(-2px); border-color: var(--line-strong); box-shadow: var(--shadow); }
.stat[aria-pressed="true"] { border-color: var(--brand); background: var(--brand-soft); }
.stat-top { display: flex; align-items: center; gap: 8px; font-size: .76rem; color: var(--muted); font-weight: 600; }
.stat-top .icon { color: var(--brand-text); }
.stat.tone-warn .stat-top .icon { color: var(--warn); }
.stat.tone-fav .stat-top .icon { color: var(--fav); fill: currentColor; }
.stat-value { font-size: 1.7rem; font-weight: 700; letter-spacing: -.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.stat.is-skeleton { height: 82px; }

/* ---------- Toolbar ---------- */
.toolbar { display: grid; gap: 12px; padding-bottom: 8px; }
.toolbar-top { display: flex; align-items: center; gap: 10px; min-width: 0; }
.toolbar-top .chips { flex: 1; min-width: 0; }
.filters-toggle { display: none; flex: none; }
.badge-count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; display: inline-grid; place-items: center; background: var(--brand); color: var(--on-brand); font-size: .7rem; }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px; margin: -2px; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px; flex: none;
  border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
  font-size: .85rem; font-weight: 550; transition: background-color .2s, color .2s, border-color .2s;
}
.chip:hover { border-color: var(--line-strong); color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.chip .count { font-size: .72rem; opacity: .6; font-variant-numeric: tabular-nums; }
.filter-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.filter-row .field { flex: 1 1 170px; }
.segmented { display: inline-flex; gap: 2px; padding: 3px; height: 42px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); flex: none; }
.segmented button { width: 36px; border-radius: 9px; display: grid; place-items: center; color: var(--muted); transition: background-color .2s, color .2s; }
.segmented button:hover { color: var(--ink); }
.segmented button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.active-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filter-tag { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 6px 0 12px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-text); font-size: .8rem; font-weight: 600; }
.filter-tag button { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; }
.filter-tag button:hover { background: color-mix(in oklab, var(--brand) 18%, transparent); }
.filter-tag .icon { width: 14px; height: 14px; }
.clear-all { font-size: .8rem; font-weight: 600; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; padding: 4px 6px; }
.clear-all:hover { color: var(--ink); }

/* ---------- Results & gallery ---------- */
.results-bar { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 14px 0 16px; }
.results-bar h2 { font-size: 1.05rem; font-weight: 700; }
.results-bar h2 span { margin-left: 6px; font-weight: 500; color: var(--muted); font-size: .85rem; }
#result-status { font-size: .8rem; color: var(--muted); text-align: right; }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 232px), 1fr)); gap: 18px; outline: none; }
.gallery[data-view="compact"] { grid-template-columns: repeat(auto-fill, minmax(min(100%, 158px), 1fr)); gap: 12px; }
.gallery[data-view="list"] { grid-template-columns: 1fr; gap: 8px; }

.piece-card {
  position: relative; container-type: inline-size; border-radius: 18px; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line);
  transition: transform .3s var(--ease), box-shadow .3s, border-color .3s;
  animation: card-in .5s var(--ease) both; animation-delay: calc(var(--i, 0) * 22ms);
}
.piece-card.no-anim { animation: none; }
.piece-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--line-strong); }
.piece-card:has(.card-open:focus-visible) { outline: 2px solid var(--brand-text); outline-offset: 3px; }
.card-open { display: block; width: 100%; text-align: left; color: inherit; outline: none; }
.card-media {
  position: relative; aspect-ratio: 4 / 5; overflow: hidden;
  background: color-mix(in oklab, var(--ambient, var(--surface-2)) 24%, var(--surface-2));
  transition: background-color .6s;
}
.card-media img { width: 100%; height: 100%; object-fit: contain; opacity: 0; transition: opacity .45s, transform .6s var(--ease); }
.card-media img.loaded { opacity: 1; }
.piece-card:hover .card-media img { transform: scale(1.04); }
.placeholder { height: 100%; display: grid; place-items: center; color: var(--muted); }
.placeholder .icon { width: 42px; height: 42px; opacity: .45; }
.format-pill, .review-flag {
  position: absolute; display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px; border-radius: 999px;
  font-size: .72rem; font-weight: 650; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.format-pill { left: 10px; bottom: 10px; background: rgb(255 255 255 / .88); color: #13222a; box-shadow: 0 2px 8px rgb(0 0 0 / .12); }
.format-pill .icon { width: 14px; height: 14px; }
.review-flag { left: 10px; top: 10px; background: color-mix(in oklab, var(--warn-bg) 92%, transparent); color: var(--warn); }
.fav-button {
  position: absolute; top: 10px; right: 10px; z-index: 2; width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center; background: rgb(255 255 255 / .88); color: #33434b;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); box-shadow: 0 2px 10px rgb(0 0 0 / .14);
  opacity: 0; transform: scale(.85); transition: opacity .2s, transform .25s var(--ease), color .2s;
}
.piece-card:hover .fav-button, .fav-button:focus-visible, .fav-button[aria-pressed="true"] { opacity: 1; transform: none; }
.fav-button[aria-pressed="true"] { color: var(--fav); }
.fav-button[aria-pressed="true"] .icon { fill: currentColor; }
.pop .icon { animation: pop .4s var(--ease); }
.card-body { display: grid; gap: 5px; padding: 13px 15px 15px; }
.card-body .eyebrow { font-size: .66rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-body h3 { font-size: .94rem; font-weight: 650; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; text-wrap: pretty; }
.card-meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 4px; font-size: .74rem; color: var(--muted); min-width: 0; }
.card-meta .tag { min-width: 0; }
.when { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; flex: none; }
.when .icon { width: 13px; height: 13px; }

@container (max-width: 200px) {
  .card-body { padding: 10px 11px 12px; }
  .card-body h3 { font-size: .8rem; }
  .card-body .eyebrow, .when { display: none; }
  .format-pill .label { display: none; }
  .format-pill { padding: 5px; }
  .card-meta .tag { font-size: .66rem; padding: 2px 7px; }
}

.gallery[data-view="list"] .piece-card:hover { transform: none; }
.gallery[data-view="list"] .card-open { display: grid; grid-template-columns: 84px minmax(0, 1fr); align-items: center; gap: 4px; padding: 8px; }
.gallery[data-view="list"] .card-media { aspect-ratio: 1; border-radius: 12px; }
.gallery[data-view="list"] .format-pill .label, .gallery[data-view="list"] .review-flag { display: none; }
.gallery[data-view="list"] .format-pill { left: 6px; bottom: 6px; padding: 4px; }
.gallery[data-view="list"] .card-body { padding: 4px 56px 4px 12px; }
.gallery[data-view="list"] .card-body h3 { -webkit-line-clamp: 1; }
.gallery[data-view="list"] .fav-button { top: 50%; right: 14px; translate: 0 -50%; opacity: 1; transform: none; box-shadow: none; background: var(--surface-2); }
.gallery[data-view="list"] .piece-card:hover .card-media img { transform: none; }
@container (min-width: 620px) {
  .gallery[data-view="list"] .card-body { grid-template-columns: minmax(0, 1fr) auto; column-gap: 20px; }
  .gallery[data-view="list"] .card-body .eyebrow, .gallery[data-view="list"] .card-body h3 { grid-column: 1; }
  .gallery[data-view="list"] .card-meta { grid-column: 2; grid-row: 1 / span 2; margin: 0; gap: 16px; }
}

/* Skeletons */
.skeleton { pointer-events: none; animation: none; }
.sk { border-radius: 8px; background: linear-gradient(90deg, var(--surface-2) 20%, var(--surface-3) 50%, var(--surface-2) 80%); background-size: 220% 100%; animation: shimmer 1.3s linear infinite; }
.skeleton .card-media { background: none; }
.skeleton .card-media .sk { position: absolute; inset: 0; border-radius: 0; }
.sk.line { height: 11px; }
.sk.w40 { width: 40%; } .sk.w70 { width: 70%; } .sk.w90 { width: 90%; }

.empty-state { display: grid; justify-items: center; gap: 10px; padding: 56px 22px; text-align: center; border-radius: 22px; border: 1px dashed var(--line-strong); background: var(--bg-elev); }
.empty-icon { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-text); }
.empty-icon .icon { width: 30px; height: 30px; }
.empty-state h2 { font-size: 1.15rem; }
.empty-state p { color: var(--muted); max-width: 46ch; }
.empty-state .button { margin-top: 6px; }
.sentinel { height: 1px; }
.load-more { display: flex; justify-content: center; margin: 24px 0 8px; }
footer { text-align: center; color: var(--muted); font-size: .74rem; margin: 40px 0 8px; }

.to-top {
  position: fixed; right: max(20px, env(safe-area-inset-right)); bottom: max(20px, env(safe-area-inset-bottom)); z-index: 40;
  width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center;
  background: var(--ink); color: var(--bg); box-shadow: var(--shadow); animation: fade-up .3s var(--ease);
}
.to-top:hover { transform: translateY(-2px); }

/* ---------- Toasts ---------- */
.toasts { position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); translate: -50% 0; z-index: 300; display: grid; gap: 8px; width: min(440px, calc(100vw - 32px)); pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 14px; pointer-events: auto;
  background: var(--ink); color: var(--bg); box-shadow: var(--shadow-lg); font-size: .86rem;
  animation: toast-in .35s var(--ease) both;
}
.toast .icon { flex: none; }
.toast.ok .icon { color: #74d3a3; }
.toast.error .icon { color: #ff9e90; }
html[data-theme="light"] .toast.ok .icon { color: #74d3a3; }
.toast button { margin-left: auto; padding: 6px 10px; border-radius: 8px; font-weight: 700; background: rgb(255 255 255 / .14); }
.toast.leaving { animation: toast-out .25s ease-in both; }

/* ---------- Detail dialog ---------- */
dialog { padding: 0; border: 0; color: var(--ink); background: transparent; max-width: none; max-height: none; }
.detail-dialog {
  width: min(1260px, calc(100vw - 48px)); height: min(900px, calc(100dvh - 48px));
  border-radius: 24px; background: var(--surface); box-shadow: var(--shadow-lg); overflow: hidden;
  opacity: 0; transform: translateY(18px) scale(.985);
  transition: opacity .28s var(--ease), transform .34s var(--ease), overlay .34s allow-discrete, display .34s allow-discrete;
}
.detail-dialog[open] { opacity: 1; transform: none; }
@starting-style { .detail-dialog[open] { opacity: 0; transform: translateY(18px) scale(.985); } }
dialog::backdrop { background: rgb(5 12 16 / 0); transition: background-color .3s, overlay .3s allow-discrete, display .3s allow-discrete; }
dialog[open]::backdrop { background: rgb(5 12 16 / .62); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
@starting-style { dialog[open]::backdrop { background: rgb(5 12 16 / 0); } }

.detail-shell { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; height: 100%; }
.dialog-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px 10px 22px; border-bottom: 1px solid var(--line); }
.dialog-crumbs { display: grid; min-width: 0; line-height: 1.3; }
.dialog-crumbs .eyebrow { color: var(--brand-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dialog-crumbs .muted { font-size: .76rem; }
.dialog-tools { display: flex; align-items: center; gap: 6px; }
.tool-sep { width: 1px; height: 24px; background: var(--line); margin: 0 4px; }
.detail-layout { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(360px, 1fr); min-height: 0; }
.preview-panel { display: flex; flex-direction: column; gap: 12px; padding: 16px; min-height: 0; overflow: auto; background: var(--surface-2); }
.viewer {
  position: relative; flex: 1 1 auto; min-height: 300px; border-radius: 18px; overflow: hidden;
  background: color-mix(in oklab, var(--ambient, #000) 32%, #0b1013); transition: background-color .6s; touch-action: pan-y;
}
.viewer-media { position: absolute; inset: 0; display: grid; place-items: center; }
.viewer-media img, .viewer-media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.viewer-media img { opacity: 0; transition: opacity .35s; user-select: none; -webkit-user-drag: none; }
.viewer-media img.loaded { opacity: 1; }
.viewer.is-loading::after { content: ""; position: absolute; left: 50%; top: 50%; width: 28px; height: 28px; margin: -14px; border-radius: 50%; border: 3px solid rgb(255 255 255 / .25); border-top-color: #fff; animation: spin .8s linear infinite; }
.viewer-empty { color: #c4ced2; font-size: .9rem; }
.stage-nav {
  position: absolute; top: 50%; translate: 0 -50%; z-index: 2; width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center; background: rgb(255 255 255 / .9); color: #13222a; box-shadow: 0 6px 18px rgb(0 0 0 / .25);
  transition: opacity .2s, transform .2s var(--ease);
}
.stage-nav:hover:not(:disabled) { transform: scale(1.06); }
.stage-nav:disabled { opacity: 0; pointer-events: none; }
.stage-nav.prev { left: 12px; } .stage-nav.next { right: 12px; }
.slide-count { position: absolute; top: 12px; right: 12px; z-index: 2; padding: 4px 10px; border-radius: 999px; background: rgb(0 0 0 / .55); color: #fff; font-size: .75rem; font-weight: 600; font-variant-numeric: tabular-nums; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.slide-count:empty { display: none; }
.thumb-strip { display: flex; gap: 8px; overflow-x: auto; padding: 3px; margin: -3px; scroll-snap-type: x proximity; scrollbar-width: thin; flex: none; }
.thumb-strip:empty { display: none; }
.thumb { flex: none; width: 60px; height: 60px; border-radius: 11px; overflow: hidden; border: 2px solid transparent; opacity: .6; background: var(--surface-3); scroll-snap-align: center; display: grid; place-items: center; font-size: .78rem; font-weight: 700; color: var(--muted); transition: opacity .2s, border-color .2s, transform .2s; }
.thumb:hover { opacity: .9; }
.thumb[aria-current="true"] { opacity: 1; border-color: var(--brand); transform: translateY(-1px); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.asset-meta { display: flex; flex-wrap: wrap; gap: 6px; flex: none; }
.asset-meta:empty { display: none; }
.meta-chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); color: var(--muted); font-size: .74rem; font-variant-numeric: tabular-nums; }
.download-actions { display: flex; flex-wrap: wrap; gap: 8px; flex: none; }

.detail-content { display: flex; flex-direction: column; gap: 18px; padding: 24px 26px 30px; overflow: auto; overscroll-behavior: contain; }
.detail-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.detail-content h2 { font: 400 clamp(1.6rem, 1.15rem + 1.3vw, 2.35rem)/1.08 var(--font-display); letter-spacing: -.02em; text-wrap: balance; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: 8px; }
.fact { padding: 10px 12px; border-radius: 12px; background: var(--surface-2); min-width: 0; }
.fact span { display: block; font-size: .66rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.fact strong { display: block; margin-top: 2px; font-size: .88rem; font-weight: 650; }
.fact small { display: block; font-size: .74rem; color: var(--muted); }
.reuse-card { display: grid; gap: 8px; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--bg-elev); }
.reuse-card p { font-size: .86rem; color: var(--ink-2); }
.review-checks { font-size: .82rem; color: var(--warn); }
.review-checks:empty { display: none; }
.review-checks ul { margin: 0; padding-left: 18px; display: grid; gap: 3px; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.section-head h3 { font-size: 1rem; font-weight: 700; }
.copy-tabs { display: flex; gap: 4px; padding: 4px; border-radius: 13px; background: var(--surface-2); margin-top: -8px; }
.copy-tabs button { flex: 1; height: 36px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-size: .84rem; color: var(--muted); transition: background-color .2s, color .2s; }
.copy-tabs button:hover { color: var(--ink); }
.copy-tabs button[aria-selected="true"] { background: var(--surface); color: var(--ink); font-weight: 650; box-shadow: var(--shadow-sm); }
.tab-count { min-width: 20px; padding: 1px 6px; border-radius: 999px; background: var(--surface-3); font-size: .7rem; font-variant-numeric: tabular-nums; }
.copy-list { display: grid; gap: 10px; }
.copy-empty { padding: 18px; border-radius: 14px; border: 1px dashed var(--line-strong); text-align: center; color: var(--muted); font-size: .86rem; }
.copy-card { display: grid; gap: 10px; padding: 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); animation: fade-up .3s var(--ease); }
.copy-card header { display: flex; flex-wrap: wrap; gap: 6px; }
.copy-text { white-space: pre-wrap; font-size: .9rem; line-height: 1.65; overflow-wrap: anywhere; }
.copy-text.clamped { max-height: 10.5em; overflow: hidden; -webkit-mask-image: linear-gradient(#000 65%, transparent); mask-image: linear-gradient(#000 65%, transparent); }
.expand { justify-self: start; font-size: .8rem; font-weight: 650; color: var(--brand-text); }
.copy-card textarea { width: 100%; min-height: 150px; max-height: 460px; field-sizing: content; resize: vertical; padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg-elev); line-height: 1.6; font-size: .88rem; }
.copy-card textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--ring); }
.copy-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; }
.counter { font-size: .74rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.counter.over { color: var(--danger); font-weight: 650; }
.copy-actions { display: flex; flex-wrap: wrap; gap: 6px; }

.history-panel { display: grid; gap: 12px; padding-top: 18px; border-top: 1px solid var(--line); }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; }
.timeline:empty { display: none; }
.timeline li { position: relative; padding: 0 0 14px 24px; font-size: .84rem; }
.timeline li::before { content: ""; position: absolute; left: 0; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 2px solid var(--brand); }
.timeline li.related::before { border-color: var(--line-strong); }
.timeline li::after { content: ""; position: absolute; left: 4px; top: 18px; bottom: 2px; width: 2px; border-radius: 2px; background: var(--line); }
.timeline li:last-child { padding-bottom: 0; }
.timeline li:last-child::after { display: none; }
.timeline strong { font-weight: 650; }
.timeline small { display: block; color: var(--muted); font-size: .78rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.disclosure summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; font-size: .86rem; font-weight: 650; color: var(--brand-text); padding: 4px 0; }
.disclosure summary::-webkit-details-marker { display: none; }
.disclosure summary::before { content: ""; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform .2s; }
.disclosure[open] summary::before { transform: rotate(45deg); }
.stack-form { display: grid; gap: 12px; margin-top: 10px; padding: 14px; border-radius: 14px; background: var(--bg-elev); border: 1px solid var(--line); }
.stack-form .button { justify-self: start; }
#notes-text { margin-top: 10px; white-space: pre-wrap; font-size: .84rem; color: var(--muted); line-height: 1.6; }
.admin-bar { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 16px 12px 22px; border-top: 1px solid var(--line); background: var(--bg-elev); }
.admin-bar p { display: flex; align-items: center; gap: 8px; font-size: .8rem; color: var(--muted); }
.admin-bar p .icon { color: var(--brand-text); }
.admin-buttons { display: flex; gap: 8px; flex: none; }

.sheet-dialog { width: min(480px, calc(100vw - 32px)); border-radius: 20px; background: var(--surface); box-shadow: var(--shadow-lg); padding: 20px 22px 22px; opacity: 0; transform: scale(.97); transition: opacity .2s, transform .25s var(--ease), overlay .25s allow-discrete, display .25s allow-discrete; }
.sheet-dialog[open] { opacity: 1; transform: none; }
@starting-style { .sheet-dialog[open] { opacity: 0; transform: scale(.97); } }
.sheet-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.sheet-head h2 { font-size: 1.1rem; }
.shortcuts { display: grid; gap: 2px; margin: 0; }
.shortcuts div { display: grid; grid-template-columns: 110px 1fr; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.shortcuts div:last-child { border-bottom: 0; }
.shortcuts dd { margin: 0; font-size: .86rem; color: var(--ink-2); }

/* ---------- Auth pages ---------- */
.auth-page { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); min-height: 100dvh; }
.auth-page.single { grid-template-columns: 1fr; }
.auth-art { position: relative; overflow: hidden; isolation: isolate; display: flex; flex-direction: column; justify-content: space-between; gap: 32px; padding: 40px clamp(28px, 5vw, 64px); color: #f3f6f7; background: #0b2530; }
.auth-art::before {
  content: ""; position: absolute; inset: -25%; z-index: -1; filter: blur(40px);
  background:
    radial-gradient(38% 38% at 22% 28%, rgb(0 115 193 / .75), transparent 70%),
    radial-gradient(32% 32% at 82% 18%, rgb(232 148 10 / .55), transparent 70%),
    radial-gradient(42% 42% at 62% 86%, rgb(160 87 66 / .7), transparent 70%);
  animation: drift 22s ease-in-out infinite alternate;
}
.auth-art::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, transparent 40%, rgb(5 16 22 / .55)); }
.auth-brand { display: flex; align-items: center; gap: 12px; line-height: 1.2; font-size: .92rem; }
.auth-brand strong { display: block; }
.auth-art .logo { --brand: #0b6fa8; --brand-2: #e8940a; }
.auth-art .eyebrow { color: rgb(255 255 255 / .7); }
.auth-headline { font: 400 clamp(2.4rem, 1.4rem + 3vw, 4.4rem)/1.02 var(--font-display); letter-spacing: -.035em; margin: 12px 0 26px; }
.auth-headline em { color: #f6c066; }
.auth-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; max-width: 420px; }
.auth-points li { display: flex; align-items: center; gap: 12px; font-size: .95rem; color: rgb(255 255 255 / .86); }
.auth-points .icon { width: 36px; height: 36px; padding: 8px; border-radius: 10px; background: rgb(255 255 255 / .1); border: 1px solid rgb(255 255 255 / .16); }
.auth-biz { display: flex; flex-wrap: wrap; gap: 8px; }
.auth-biz span { padding: 6px 12px; border-radius: 999px; font-size: .78rem; background: rgb(255 255 255 / .1); border: 1px solid rgb(255 255 255 / .16); }
.auth-main { display: grid; place-items: center; padding: 32px 20px; }
.auth-card { width: min(420px, 100%); display: grid; gap: 10px; animation: fade-up .5s var(--ease) both; }
.auth-card-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.auth-card-top .icon-button { margin-left: auto; }
.auth-card h1 { font-size: clamp(2.2rem, 1.8rem + 1.5vw, 3rem); margin: 0; }
.auth-card .eyebrow { color: var(--brand-text); }
.auth-lead { color: var(--muted); }
.auth-form { display: grid; gap: 14px; margin-top: 14px; }
.auth-form .input, .password-field input { height: 48px; font-size: .95rem; }
.password-field { position: relative; display: block; }
.password-field input { width: 100%; padding: 0 48px 0 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
.password-field input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--ring); }
.reveal { position: absolute; right: 6px; top: 50%; translate: 0 -50%; width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; color: var(--muted); }
.reveal:hover { background: var(--surface-2); color: var(--ink); }
.auth-form .button { height: 50px; margin-top: 4px; font-size: .95rem; }
.caps-warning { font-size: .8rem; color: var(--warn); }
.alert { padding: 12px 14px; border-radius: 12px; font-size: .86rem; }
.alert.error { background: var(--danger-bg); color: var(--danger); }
.alert ul, .field-error ul { margin: 0; padding-left: 18px; }
.field-error { font-size: .8rem; color: var(--danger); }
.help { font-size: .76rem; color: var(--muted); line-height: 1.55; }
.help ul { margin: 4px 0 0; padding-left: 18px; }
.auth-foot { margin-top: 18px; font-size: .74rem; color: var(--muted); text-align: center; }
.mobile-only { display: none; }

/* ---------- Selection & deletion ---------- */
.button.danger { background: var(--danger); color: #fff; box-shadow: 0 10px 22px -12px var(--danger); }
.button.danger:hover:not(:disabled) { filter: brightness(1.08); }
.button.danger:disabled { opacity: .45; box-shadow: none; }
.button.danger-text { color: var(--danger); }
.button.danger-text:hover { background: var(--danger-bg); }
.results-tools { display: flex; align-items: center; gap: 10px; min-width: 0; }
#select-toggle[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }

.select-mark {
  position: absolute; top: 10px; right: 10px; z-index: 3; width: 30px; height: 30px; border-radius: 50%;
  display: none; place-items: center; color: transparent; background: rgb(255 255 255 / .9);
  border: 2px solid rgb(19 34 42 / .35); box-shadow: 0 2px 8px rgb(0 0 0 / .18); pointer-events: none;
  transition: background-color .15s, border-color .15s, color .15s, transform .2s var(--ease);
}
.select-mark .icon { width: 16px; height: 16px; }
.gallery.selecting .select-mark { display: grid; }
.gallery.selecting .fav-button { display: none; }
.gallery.selecting .piece-card:hover { transform: none; }
.piece-card.is-selected { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand); }
.piece-card.is-selected .select-mark { background: var(--brand); border-color: var(--brand); color: #fff; transform: scale(1.06); }
.piece-card.is-selected .card-media img { opacity: .82; }
.piece-card.removing { animation: card-out .26s ease-in forwards; pointer-events: none; }
.gallery[data-view="list"] .select-mark { top: 50%; right: 14px; translate: 0 -50%; }

.group-head {
  grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 18px 2px 2px; border-top: 1px solid var(--line); animation: fade-up .3s var(--ease);
}
.gallery > .group-head:first-child { border-top: 0; padding-top: 0; }
.group-head h3 { font-size: 1rem; font-weight: 700; }
.group-count { font-size: .78rem; color: var(--muted); }

.selection-bar {
  position: fixed; left: 50%; bottom: max(18px, env(safe-area-inset-bottom)); translate: -50% 0; z-index: 60;
  display: flex; align-items: center; gap: 6px; padding: 8px 8px 8px 18px; border-radius: 999px;
  background: var(--ink); color: var(--bg); box-shadow: var(--shadow-lg); animation: toast-in .3s var(--ease);
  max-width: calc(100vw - 24px);
}
#selection-count { font-weight: 650; font-size: .88rem; margin-right: 6px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.selection-bar .button.ghost { color: var(--bg); }
.selection-bar .button.ghost:hover { background: rgb(255 255 255 / .12); }
html[data-theme="dark"] .selection-bar .button.ghost:hover { background: rgb(0 0 0 / .08); }
body:has(.selection-bar:not([hidden])) .to-top { bottom: 92px; }
body:has(.selection-bar:not([hidden])) .toasts { bottom: 92px; }

.danger-sheet form { display: grid; gap: 12px; }
.danger-icon { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--danger-bg); color: var(--danger); }
.danger-icon .icon { width: 24px; height: 24px; }
.danger-sheet h2 { font-size: 1.2rem; }
.delete-list { margin: 0; padding: 10px 12px 10px 30px; max-height: 190px; overflow: auto; border-radius: 12px; background: var(--surface-2); font-size: .86rem; display: grid; gap: 4px; }
.delete-list .more { list-style: none; margin-left: -18px; color: var(--muted); }
.check-row { display: flex; align-items: flex-start; gap: 10px; font-size: .86rem; cursor: pointer; }
.check-row input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--danger); flex: none; }
.sheet-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }

/* ---------- Social publishing: navigation ---------- */
:root { --wa: #25d366; --wa-dark: #128c4b; --fb: #1877f2; --ig: #e1306c; --ig-grad: linear-gradient(45deg, #f9b234 5%, #ee2a7b 45%, #6228d7 95%); --li: #0a66c2; --tt: #111111; }
.app-nav { display: grid; gap: 2px; }
.nav-links { display: grid; gap: 2px; }
.nav-link {
  position: relative; display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 10px;
  color: var(--ink-2); font-size: .88rem; font-weight: 550; text-align: left; transition: background-color .2s, color .2s;
}
.nav-link .icon { color: var(--muted); transition: color .2s; }
.nav-link:hover { background: var(--surface-2); color: var(--ink); }
.nav-link[aria-current="page"] { background: var(--brand-soft); color: var(--brand-text); font-weight: 650; }
.nav-link[aria-current="page"] .icon { color: var(--brand-text); }
.nav-badge { margin-left: auto; min-width: 22px; height: 20px; padding: 0 7px; border-radius: 999px; display: inline-grid; place-items: center; background: var(--brand); color: var(--on-brand); font-size: .7rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.nav-dot { margin-left: auto; width: 8px; height: 8px; border-radius: 50%; background: var(--warn); box-shadow: 0 0 0 3px var(--warn-bg); }

/* ---------- Social: shared pieces ---------- */
.view { animation: fade-up .3s var(--ease); }
.view-head { display: flex; justify-content: space-between; align-items: end; gap: 20px; flex-wrap: wrap; padding: 30px 0 22px; }
.view-copy { display: grid; gap: 4px; min-width: 0; }
.view-head .eyebrow { color: var(--brand-text); display: inline-flex; align-items: center; gap: 8px; }
.view-head .eyebrow::before { content: ""; width: 18px; height: 2px; border-radius: 2px; background: currentColor; }
.view-title { font: 400 clamp(2rem, 1.2rem + 2.4vw, 3.2rem)/1.04 var(--font-display); letter-spacing: -.03em; margin: 8px 0 6px; text-wrap: balance; }
.view-title em { font-style: italic; background: linear-gradient(100deg, var(--brand-text), var(--brand-2)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.view-aside { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.scheduler-pill { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 13px; border-radius: 999px; font-size: .78rem; font-weight: 650; background: var(--surface); border: 1px solid var(--line); color: var(--ink-2); }
.pulse-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); position: relative; }
.is-alive .pulse-dot::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--ok); opacity: 0; animation: pulse 2s ease-out infinite; }
.is-down { color: var(--warn); background: var(--warn-bg); border-color: transparent; }
.is-down .pulse-dot { background: var(--warn); }

.net-tile { width: 40px; height: 40px; border-radius: 12px; display: inline-grid; place-items: center; flex: none; color: #fff; background: var(--muted); box-shadow: inset 0 0 0 1px rgb(255 255 255 / .12); }
.net-tile .icon { width: 22px; height: 22px; }
.net-tile.small { width: 32px; height: 32px; border-radius: 10px; }
.net-tile.small .icon { width: 18px; height: 18px; }
[data-net="facebook"].net-tile, .net-badge[data-net="facebook"], .mini-net[data-net="facebook"] { background: var(--fb); }
[data-net="instagram"].net-tile, .net-badge[data-net="instagram"], .mini-net[data-net="instagram"] { background: var(--ig-grad); }
[data-net="linkedin"].net-tile, .net-badge[data-net="linkedin"], .mini-net[data-net="linkedin"] { background: var(--li); }
[data-net="whatsapp"].net-tile, .net-badge[data-net="whatsapp"], .mini-net[data-net="whatsapp"] { background: var(--wa); }
[data-net="tiktok"].net-tile, .net-badge[data-net="tiktok"], .mini-net[data-net="tiktok"] { background: var(--tt); box-shadow: inset 0 0 0 1px rgb(255 255 255 / .18), 2px 2px 0 -1px #25f4ee, -2px -2px 0 -1px #fe2c55; }
.net-stack { display: inline-flex; flex: none; }
.net-stack .net-tile + .net-tile { margin-left: -10px; box-shadow: 0 0 0 3px var(--surface); }
.mini-net { width: 18px; height: 18px; border-radius: 6px; display: inline-grid; place-items: center; color: #fff; flex: none; }
.mini-net .icon { width: 11px; height: 11px; }
.net-chip .icon { width: 15px; height: 15px; }
.net-chip[aria-pressed="true"][data-net="facebook"] { background: var(--fb); border-color: var(--fb); color: #fff; }
.net-chip[aria-pressed="true"][data-net="instagram"] { background: var(--ig); border-color: var(--ig); color: #fff; }
.net-chip[aria-pressed="true"][data-net="linkedin"] { background: var(--li); border-color: var(--li); color: #fff; }
.net-chip[aria-pressed="true"][data-net="tiktok"] { background: var(--tt); border-color: var(--tt); color: #fff; }
.brand-button { color: #fff; background: var(--ink); box-shadow: 0 10px 22px -12px rgb(0 0 0 / .5); }
.brand-button:hover { filter: brightness(1.1); }
.brand-button[data-net="facebook"] { background: var(--fb); }
.brand-button[data-net="linkedin"] { background: var(--li); }
.brand-button[data-net="tiktok"] { background: var(--tt); }
.brand-button[data-net="whatsapp"] { background: var(--wa-dark); }
.net-chip[aria-pressed="true"][data-net="whatsapp"] { background: var(--wa-dark); border-color: var(--wa-dark); color: #fff; }
.preview-tab[aria-selected="true"][data-net="whatsapp"] { background: var(--wa-dark); }
html[data-theme="dark"] .brand-button[data-net="tiktok"] { box-shadow: inset 0 0 0 1px rgb(255 255 255 / .2); }

.acct-avatar { position: relative; width: 42px; height: 42px; flex: none; }
.acct-avatar > img, .acct-initials { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-text); font-size: .78rem; font-weight: 750; }
.acct-avatar .net-badge { position: absolute; right: -3px; bottom: -3px; width: 19px; height: 19px; border-radius: 50%; display: grid; place-items: center; color: #fff; box-shadow: 0 0 0 2px var(--surface); }
.acct-avatar .net-badge .icon { width: 11px; height: 11px; }
.acct-avatar.small { width: 34px; height: 34px; }
.acct-avatar.small .net-badge { width: 16px; height: 16px; }
.thumb-ph { display: grid; place-items: center; background: var(--surface-3); color: var(--muted); }
.thumb-ph .icon { width: 40%; height: 40%; max-width: 28px; max-height: 28px; }
.spacer { flex: 1; }

/* ---------- Social: accounts view ---------- */
.connect-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 330px), 1fr)); gap: 16px; align-items: start; }
.connect-card { display: grid; gap: 16px; padding: 20px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); animation: card-in .45s var(--ease) both; }
.connect-card:nth-child(2) { animation-delay: 60ms; }
.connect-card:nth-child(3) { animation-delay: 120ms; }
.connect-card.is-skeleton { height: 260px; padding: 0; overflow: hidden; }
.connect-card.is-skeleton .sk { height: 100%; border-radius: 0; }
.connect-head { display: flex; gap: 14px; align-items: flex-start; }
.connect-head h2 { font-size: 1.08rem; font-weight: 700; margin-bottom: 2px; }
.connect-empty { padding: 14px; border-radius: 14px; border: 1px dashed var(--line-strong); color: var(--muted); font-size: .84rem; text-align: center; }
.account-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.account-row { display: flex; align-items: center; gap: 12px; padding: 10px; margin: 0 -10px; border-radius: 14px; transition: background-color .2s; }
.account-row:hover { background: var(--surface-2); }
.account-info { display: grid; min-width: 0; flex: 1; line-height: 1.3; }
.account-info strong { font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-info small { font-size: .76rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-info .tag { justify-self: start; margin-top: 4px; font-size: .68rem; padding: 2px 8px; }
.ghost-icon { background: transparent; border-color: transparent; color: var(--muted); }
.ghost-icon:hover:not(:disabled) { color: var(--danger); background: var(--danger-bg); }
.connect-foot { display: grid; gap: 8px; }
.connect-foot .button { width: 100%; height: 46px; }
.setup-box { text-align: left; display: grid; gap: 10px; padding: 14px 16px; border-radius: 14px; background: var(--bg-elev); border: 1px solid var(--line); font-size: .84rem; }
.setup-title { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.setup-title .icon { color: var(--warn); }
.setup-title .muted { flex-basis: 100%; }
.setup-box ol { margin: 0; padding-left: 20px; display: grid; gap: 8px; color: var(--ink-2); }
.setup-box a { color: var(--brand-text); font-weight: 650; }
.copy-field { display: flex; gap: 6px; margin-top: 6px; }
.copy-field .input { height: 38px; font-size: .74rem; }
.copy-field .icon-button { width: 38px; height: 38px; }
.mono { font-family: var(--font-mono); }
.how-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: 12px; margin-top: 24px; padding: 18px; border-radius: 20px; background: var(--bg-elev); border: 1px solid var(--line); }
.how-step { display: flex; gap: 12px; align-items: flex-start; }
.how-step strong { display: block; font-size: .9rem; margin-bottom: 2px; }
.how-icon { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--brand-soft); color: var(--brand-text); }

/* ---------- Social: calendar ---------- */
.onboard-card { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; padding: 20px 22px; margin-bottom: 18px; border-radius: 20px; color: var(--ink); background: linear-gradient(120deg, var(--brand-soft), var(--surface) 70%); border: 1px solid var(--line); }
.onboard-card > div { flex: 1 1 260px; }
.onboard-card h2 { font-size: 1.1rem; margin-bottom: 2px; }
.cal-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(0, 1.6fr); gap: 10px; margin-bottom: 18px; }
.cal-stat:hover { transform: none; box-shadow: var(--shadow-sm); border-color: var(--line); }
.cal-stat.tone-danger { background: var(--surface); }
.cal-stat.tone-danger .stat-value, .cal-stat.tone-danger .stat-top .icon { color: var(--danger); }
.cal-next { display: grid; gap: 4px; align-content: start; padding: 14px 16px; border-radius: 16px; text-align: left; background: var(--ink); color: var(--bg); box-shadow: var(--shadow-sm); min-width: 0; transition: transform .2s var(--ease); }
.cal-next:hover:not(:disabled) { transform: translateY(-2px); }
.cal-next:disabled { opacity: 1; cursor: default; }
.cal-next .stat-top { color: inherit; opacity: .7; }
.cal-next .stat-top .icon { color: inherit; }
.cal-next strong { font-size: 1.15rem; letter-spacing: -.01em; }
.cal-next strong.muted { color: inherit; opacity: .7; font-size: 1rem; }
.cal-next small { opacity: .75; font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.cal-toolbar .chips { flex: 1 1 auto; justify-content: center; min-width: 0; }
.cal-nav { display: flex; align-items: center; gap: 6px; }
.cal-nav h2 { min-width: 170px; text-align: center; font: 400 1.5rem/1 var(--font-display); letter-spacing: -.02em; }
.cal-nav .button { margin-left: 6px; }
.text-seg button { width: auto; padding: 0 14px; font-size: .82rem; font-weight: 600; }
.cal-month { border-radius: 20px; border: 1px solid var(--line); background: var(--surface); overflow: hidden; box-shadow: var(--shadow-sm); }
.cal-weekdays, .cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-weekdays span { padding: 10px 12px; font-size: .7rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); background: var(--bg-elev); border-bottom: 1px solid var(--line); }
.cal-day { position: relative; min-height: 128px; padding: 8px; display: flex; flex-direction: column; gap: 4px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); min-width: 0; transition: background-color .2s; }
.cal-day:nth-child(7n) { border-right: 0; }
.cal-day:nth-last-child(-n + 7) { border-bottom: 0; }
.cal-day.is-other { background: color-mix(in oklab, var(--bg-elev) 60%, transparent); }
.cal-day.is-other .cal-num { color: var(--muted); opacity: .6; }
.cal-day.is-past:not(.is-today) { background: repeating-linear-gradient(135deg, transparent 0 8px, color-mix(in oklab, var(--surface-2) 70%, transparent) 8px 9px); }
.cal-day.is-selected { background: var(--brand-soft); }
.cal-day.is-drop { background: color-mix(in oklab, var(--brand) 16%, var(--surface)); box-shadow: inset 0 0 0 2px var(--brand); }
.cal-day-top { display: flex; align-items: center; justify-content: space-between; }
.cal-num { min-width: 28px; height: 28px; padding: 0 6px; border-radius: 999px; font-size: .82rem; font-weight: 650; color: var(--ink-2); font-variant-numeric: tabular-nums; transition: background-color .2s; }
.cal-num:hover { background: var(--surface-2); }
.is-today .cal-num { background: var(--brand); color: var(--on-brand); }
.cal-add { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; color: var(--muted); opacity: 0; transition: opacity .15s, background-color .2s, color .2s; }
.cal-add .icon { width: 15px; height: 15px; }
.cal-day:hover .cal-add, .cal-add:focus-visible { opacity: 1; }
.cal-add:hover { background: var(--brand-soft); color: var(--brand-text); }
.cal-items { display: grid; gap: 4px; min-width: 0; }
.cal-chip {
  display: grid; grid-template-columns: 28px minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 6px; align-items: center; width: 100%; min-width: 0; padding: 4px 6px 4px 4px; border-radius: 9px; text-align: left;
  background: color-mix(in oklab, var(--tone) 10%, var(--surface)); border: 1px solid color-mix(in oklab, var(--tone) 22%, transparent);
  font-size: .72rem; line-height: 1.25; transition: transform .15s var(--ease), box-shadow .2s;
}
.cal-chip:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.cal-chip[draggable="true"] { cursor: grab; }
.cal-chip[draggable="true"]:active { cursor: grabbing; }
[data-status] { --tone: var(--info); }
[data-status="published"] { --tone: var(--ok); }
[data-status="publishing"] { --tone: var(--warn); }
[data-status="failed"], [data-status="partial"] { --tone: var(--danger); }
[data-status="cancelled"] { --tone: var(--neutral); }
.cal-chip[data-status="cancelled"] { opacity: .6; }
.cal-chip[data-status="cancelled"] .chip-title { text-decoration: line-through; }
.cal-chip[data-status="publishing"] { animation: breathe 1.6s ease-in-out infinite; }
.chip-thumb { grid-row: 1 / 3; width: 28px; height: 28px; border-radius: 6px; object-fit: cover; background: var(--surface-3); }
.chip-line { display: flex; align-items: center; gap: 4px; min-width: 0; }
.chip-line strong { font-size: .7rem; color: color-mix(in oklab, var(--tone) 75%, var(--ink)); font-variant-numeric: tabular-nums; white-space: nowrap; margin-right: auto; }
.chip-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); font-size: .7rem; }
.chip-nets { display: flex; gap: 2px; flex: none; }
.chip-nets .mini-net { width: 14px; height: 14px; border-radius: 4px; }
.chip-nets .mini-net .icon { width: 9px; height: 9px; }
.chip-nets .mini-net + .mini-net { margin-left: -5px; box-shadow: 0 0 0 1.5px var(--surface); }
.chip-line strong { overflow: hidden; }
.cal-chip { overflow: hidden; }
.cal-more { font-size: .72rem; font-weight: 650; color: var(--brand-text); text-align: left; padding: 2px 6px; border-radius: 6px; }
.cal-more:hover { background: var(--brand-soft); }
.cal-dots { display: none; }
body.is-dragging .cal-day:not(.is-past) { outline: 1px dashed color-mix(in oklab, var(--brand) 35%, transparent); outline-offset: -4px; }
.cal-hint { margin: 12px 4px 0; font-size: .78rem; color: var(--muted); }
.cal-loading { height: 560px; border-radius: 20px; overflow: hidden; }
.cal-loading .sk { height: 100%; border-radius: 0; }
.day-panel { margin-top: 16px; padding: 18px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); animation: fade-up .25s var(--ease); scroll-margin: 110px; }
.day-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.day-panel-head h3, .agenda-date { display: flex; align-items: center; gap: 8px; font-size: 1rem; font-weight: 700; }
.day-rel { padding: 2px 9px; border-radius: 999px; background: var(--brand); color: var(--on-brand); font-size: .72rem; font-weight: 700; }
.agenda { display: grid; gap: 22px; }
.agenda-day { display: grid; gap: 10px; }
.agenda-date { position: sticky; top: 76px; z-index: 5; padding: 8px 0; background: color-mix(in oklab, var(--bg) 88%, transparent); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.agenda-list { display: grid; gap: 8px; }
.agenda-item {
  display: grid; grid-template-columns: 64px 56px minmax(0, 1fr) auto; align-items: center; gap: 14px; width: 100%; padding: 10px 14px 10px 10px; text-align: left;
  border-radius: 16px; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--tone); transition: transform .2s var(--ease), box-shadow .2s;
}
.agenda-item:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.agenda-time { font-size: 1.02rem; font-weight: 700; font-variant-numeric: tabular-nums; text-align: center; color: color-mix(in oklab, var(--tone) 70%, var(--ink)); }
.agenda-thumb { width: 56px; height: 56px; border-radius: 12px; object-fit: cover; background: var(--surface-3); }
.agenda-main { display: grid; gap: 6px; min-width: 0; }
.agenda-main > strong { font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agenda-targets { display: flex; flex-wrap: wrap; gap: 6px; }
.target-pill { --tone: var(--info); display: inline-flex; align-items: center; gap: 5px; max-width: 100%; padding: 2px 9px 2px 6px; border-radius: 999px; font-size: .72rem; font-weight: 600; background: color-mix(in oklab, var(--tone) 12%, var(--surface)); color: color-mix(in oklab, var(--tone) 75%, var(--ink)); }
.target-pill .icon { width: 12px; height: 12px; }
.target-pill span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.target-pill[data-state="published"] { --tone: var(--ok); }
.target-pill[data-state="publishing"] { --tone: var(--warn); }
.target-pill[data-state="failed"] { --tone: var(--danger); }
.target-pill[data-state="cancelled"] { --tone: var(--neutral); text-decoration: line-through; }
.cal-empty { margin-top: 4px; }

/* ---------- Social: post sheet, picker, confirm ---------- */
.post-sheet { width: min(600px, calc(100vw - 32px)); padding: 0; max-height: calc(100dvh - 48px); overflow: auto; }
.post-body { display: grid; gap: 16px; padding: 20px 22px 22px; }
.post-head { display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; gap: 14px; align-items: start; }
.post-thumb { width: 72px; height: 72px; border-radius: 14px; object-fit: cover; }
.post-title { display: grid; gap: 6px; justify-items: start; min-width: 0; }
.post-title h2 { font: 400 1.4rem/1.1 var(--font-display); letter-spacing: -.01em; }
.post-title .muted { display: inline-flex; align-items: center; gap: 4px; }
.target-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.target-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 12px; border-radius: 14px; background: var(--bg-elev); border: 1px solid var(--line); }
.target-main { display: grid; gap: 6px; min-width: 0; }
.target-top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.target-top strong { font-size: .9rem; }
.target-error { display: flex; gap: 8px; align-items: flex-start; padding: 8px 10px; border-radius: 10px; background: var(--danger-bg); color: var(--danger); font-size: .8rem; line-height: 1.45; }
.target-error .icon { margin-top: 1px; }
.target-caption { display: grid; gap: 8px; margin-top: 6px; }
.caption-text { white-space: pre-wrap; font-size: .84rem; line-height: 1.6; color: var(--ink-2); max-height: 220px; overflow: auto; overflow-wrap: anywhere; }
.target-caption .button { justify-self: start; }
.resched { display: flex; align-items: end; gap: 10px; flex-wrap: wrap; padding: 14px; border-radius: 14px; background: var(--bg-elev); border: 1px solid var(--line); }
.resched .field { flex: 1 1 220px; }
.sheet-actions.spread { justify-content: flex-start; flex-wrap: wrap; align-items: center; }
.confirm-sheet form, .confirm-form { display: grid; gap: 12px; }
.confirm-icon { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-text); }
.confirm-icon .icon { width: 22px; height: 22px; }
.wide-sheet { width: min(860px, calc(100vw - 32px)); max-height: calc(100dvh - 48px); overflow: auto; }
.wide-sheet .sheet-head { align-items: flex-start; gap: 12px; }
.picker-body { display: grid; gap: 14px; }
.picker-tools { display: flex; gap: 10px; flex-wrap: wrap; }
.picker-tools .input { flex: 1 1 260px; }
.picker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; min-height: 200px; align-content: start; }
.pick-piece { display: grid; gap: 6px; align-content: start; text-align: left; padding: 6px 6px 10px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); transition: transform .2s var(--ease), box-shadow .2s, border-color .2s; }
.pick-piece:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--brand); }
.pick-piece.is-skeleton { height: 220px; padding: 0; overflow: hidden; }
.pick-piece.is-skeleton .sk { height: 100%; }
.pick-media { aspect-ratio: 4 / 5; border-radius: 10px; overflow: hidden; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); }
.pick-media img { width: 100%; height: 100%; object-fit: cover; }
.pick-title { font-size: .82rem; font-weight: 650; line-height: 1.3; padding: 0 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pick-piece small { padding: 0 4px; font-size: .72rem; }
.pick-empty { grid-column: 1 / -1; text-align: center; padding: 40px 0; }
.picker-form { display: grid; gap: 14px; }
.pick-list { display: grid; gap: 6px; max-height: 50dvh; overflow: auto; }
.pick-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--line); cursor: pointer; transition: border-color .2s, background-color .2s; }
.pick-row:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.pick-row input { width: 18px; height: 18px; accent-color: var(--brand); flex: none; }
.pick-row.nested { margin-left: 28px; }

/* ---------- Social: composer ---------- */
.compose-dialog {
  width: min(1240px, calc(100vw - 48px)); height: min(920px, calc(100dvh - 48px)); border-radius: 24px; background: var(--surface); box-shadow: var(--shadow-lg); overflow: hidden;
  opacity: 0; transform: translateY(18px) scale(.985); transition: opacity .28s var(--ease), transform .34s var(--ease), overlay .34s allow-discrete, display .34s allow-discrete;
}
.compose-dialog[open] { opacity: 1; transform: none; }
@starting-style { .compose-dialog[open] { opacity: 0; transform: translateY(18px) scale(.985); } }
.compose-shell { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; height: 100%; }
.compose-layout { display: grid; grid-template-columns: minmax(0, .95fr) minmax(400px, 1.05fr); min-height: 0; }
.compose-preview { display: flex; flex-direction: column; gap: 14px; padding: 18px; min-height: 0; overflow: auto; background: radial-gradient(120% 80% at 50% 0%, var(--surface-2), var(--bg)); }
.preview-tabs { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.preview-tabs:empty { display: none; }
.preview-tab { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 999px; font-size: .8rem; font-weight: 600; color: var(--ink-2); background: var(--surface); border: 1px solid var(--line); transition: all .2s; }
.preview-tab[aria-selected="true"] { color: #fff; border-color: transparent; }
.preview-tab[aria-selected="true"][data-net="facebook"] { background: var(--fb); }
.preview-tab[aria-selected="true"][data-net="instagram"] { background: var(--ig-grad); }
.preview-tab[aria-selected="true"][data-net="linkedin"] { background: var(--li); }
.preview-tab[aria-selected="true"][data-net="tiktok"] { background: var(--tt); }
.preview-stage { flex: 1; display: grid; justify-items: center; align-content: start; gap: 10px; }
.preview-note { font-size: .72rem; color: var(--muted); text-align: center; }
.preview-empty { display: grid; justify-items: center; gap: 8px; padding: 80px 20px; color: var(--muted); text-align: center; }
.preview-empty .icon { width: 36px; height: 36px; opacity: .5; }
.compose-form { display: flex; flex-direction: column; gap: 6px; padding: 8px 24px 24px; overflow: auto; overscroll-behavior: contain; }
.cmp-step { margin: 0; padding: 16px 0; border: 0; border-bottom: 1px solid var(--line); min-width: 0; display: grid; gap: 12px; }
.cmp-step legend { float: left; width: 100%; display: flex; align-items: center; gap: 10px; padding: 0; margin-bottom: 12px; font-size: .95rem; font-weight: 700; }
.cmp-step legend + * { clear: both; }
.step-num { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: var(--bg); font-size: .74rem; font-weight: 750; flex: none; }
.acct-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.acct-toggle { position: relative; display: flex; align-items: center; gap: 10px; padding: 9px 36px 9px 10px; border-radius: 14px; text-align: left; border: 1px solid var(--line); background: var(--surface); transition: border-color .2s, background-color .2s, box-shadow .2s; }
.acct-toggle:hover:not(:disabled) { border-color: var(--line-strong); }
.acct-toggle[aria-pressed="true"] { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 1px var(--brand) inset; }
.acct-text { display: grid; min-width: 0; line-height: 1.25; }
.acct-text strong { font-size: .84rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-text small { font-size: .72rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-check { position: absolute; right: 10px; top: 50%; translate: 0 -50%; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--line-strong); color: transparent; transition: all .2s; }
.acct-check .icon { width: 12px; height: 12px; }
.acct-toggle[aria-pressed="true"] .acct-check { background: var(--brand); border-color: var(--brand); color: #fff; }
.cmp-empty { display: grid; justify-items: start; gap: 10px; padding: 16px; border-radius: 14px; border: 1px dashed var(--line-strong); }
.asset-pick { display: flex; gap: 8px; overflow-x: auto; padding: 3px; margin: -3px; scrollbar-width: thin; }
.asset-toggle { position: relative; width: 74px; height: 92px; flex: none; border-radius: 12px; overflow: hidden; border: 2px solid transparent; background: var(--surface-2); opacity: .45; transition: opacity .2s, border-color .2s, transform .2s var(--ease); }
.asset-toggle img { width: 100%; height: 100%; object-fit: cover; }
.asset-toggle .thumb-ph { width: 100%; height: 100%; }
.asset-toggle[aria-pressed="true"] { opacity: 1; border-color: var(--brand); }
.asset-toggle:hover { opacity: .85; }
.asset-toggle[aria-pressed="true"]:hover { opacity: 1; transform: translateY(-2px); }
.asset-order { position: absolute; top: 5px; right: 5px; min-width: 20px; height: 20px; border-radius: 999px; display: grid; place-items: center; font-size: .7rem; font-weight: 750; background: var(--brand); color: #fff; }
.asset-order:empty { background: rgb(255 255 255 / .8); border: 2px solid rgb(19 34 42 / .3); }
.asset-kind { position: absolute; left: 5px; bottom: 5px; display: inline-flex; align-items: center; gap: 3px; padding: 2px 6px; border-radius: 999px; background: rgb(0 0 0 / .6); color: #fff; font-size: .64rem; font-weight: 650; }
.asset-kind .icon { width: 9px; height: 9px; }
.caption-stack { display: grid; gap: 10px; }
.caption-card { display: grid; gap: 10px; padding: 12px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); transition: border-color .2s, box-shadow .2s; }
.caption-card.is-active { border-color: color-mix(in oklab, var(--brand) 50%, var(--line)); box-shadow: 0 0 0 3px var(--ring); }
.caption-head { display: flex; align-items: center; gap: 10px; }
.caption-who { display: grid; line-height: 1.25; flex: 1; min-width: 0; }
.caption-who strong { font-size: .88rem; }
.caption-who small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmp-text { min-height: 120px; max-height: 340px; field-sizing: content; font-size: .88rem; }
.small-select select { height: 34px; font-size: .78rem; border-radius: 10px; max-width: 260px; }
.mini-seg { display: inline-flex; justify-self: start; gap: 2px; padding: 3px; border-radius: 11px; background: var(--surface-2); }
.mini-seg button { height: 30px; padding: 0 12px; border-radius: 8px; font-size: .8rem; font-weight: 600; color: var(--muted); }
.mini-seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.tt-box { display: grid; gap: 12px; padding: 12px; border-radius: 12px; background: var(--bg-elev); border: 1px solid var(--line); }
.tt-who { font-size: .84rem; }
.tt-checks { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.tt-checks .check-row input, .tt-brand .check-row input { accent-color: var(--brand); }
.check-row.is-disabled { opacity: .55; cursor: default; }
.switch-row { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; }
.switch-row span { display: grid; gap: 1px; font-size: .84rem; }
.switch-row input { appearance: none; width: 40px; height: 24px; flex: none; margin: 0; border-radius: 999px; background: var(--line-strong); position: relative; cursor: pointer; transition: background-color .2s; }
.switch-row input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / .3); transition: transform .2s var(--ease); }
.switch-row input:checked { background: var(--brand); }
.switch-row input:checked::after { transform: translateX(16px); }
.switch-row input:focus-visible { outline: 2px solid var(--brand-text); outline-offset: 2px; }
.tt-brand { display: grid; gap: 8px; padding-left: 52px; }
.tt-consent { font-size: .76rem; color: var(--muted); line-height: 1.55; }
.tt-consent a { color: var(--brand-text); font-weight: 650; }
.when-seg { display: inline-flex; gap: 4px; padding: 4px; border-radius: 13px; background: var(--surface-2); justify-self: start; }
.when-seg button { display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 16px; border-radius: 10px; font-size: .86rem; font-weight: 600; color: var(--muted); transition: all .2s; }
.when-seg button[aria-checked="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.when-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.when-row .input { width: auto; flex: 0 1 240px; }
.slot-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.slot-chip { height: 32px; padding: 0 12px; font-size: .78rem; }
.when-human { display: inline-flex; align-items: center; gap: 6px; font-size: .84rem; color: var(--ink-2); font-weight: 550; }
.when-human.is-past { color: var(--danger); }
.warn-line { display: flex; gap: 8px; align-items: flex-start; font-size: .8rem; color: var(--warn); }
.cmp-checks { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.check-item { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; font-size: .8rem; line-height: 1.5; }
.check-item .icon { margin-top: 2px; }
.compose-foot { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 16px 12px 22px; border-top: 1px solid var(--line); background: var(--bg-elev); }
.cmp-summary { min-width: 0; font-size: .84rem; }
.sum-problem, .sum-ok { display: inline-flex; align-items: center; gap: 8px; }
.sum-problem { color: var(--warn); }
.sum-ok { color: var(--ink-2); font-weight: 600; }
.sum-ok .icon { color: var(--ok); }
.compose-buttons { display: flex; gap: 8px; flex: none; }
.compose-buttons .button.primary { min-width: 160px; }

/* ---------- Social: network previews ---------- */
.pv { width: min(100%, 440px); border-radius: 14px; overflow: hidden; background: #fff; color: #1c1e21; box-shadow: 0 18px 40px -20px rgb(0 0 0 / .35), 0 0 0 1px rgb(0 0 0 / .06); font: 14px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; animation: fade-up .3s var(--ease); }
.pv-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; }
.pv-head > .icon { color: #65676b; }
.pv-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex: none; display: grid; place-items: center; background: #dfe3e8; color: #444; font-size: .74rem; font-weight: 750; }
.pv-who { display: grid; line-height: 1.25; flex: 1; min-width: 0; }
.pv-who strong { font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pv-who small { display: inline-flex; align-items: center; gap: 3px; color: #65676b; font-size: .75rem; }
.pv-who small .icon { width: 11px; height: 11px; }
.pv-text { padding: 0 14px 12px; white-space: pre-wrap; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }
.pv-media { position: relative; width: 100%; aspect-ratio: var(--ar, 1); overflow: hidden; background: #000; isolation: isolate; }
.pv-media .pv-blur { position: absolute; inset: -10%; width: 120%; height: 120%; object-fit: cover; filter: blur(22px) brightness(.82); z-index: -1; }
.pv-media .pv-fg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.pv-media > .thumb-ph { position: absolute; inset: 0; }
.pv-play { position: absolute; left: 50%; top: 50%; translate: -50% -50%; width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: rgb(0 0 0 / .5); color: #fff; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.pv-play .icon { width: 24px; height: 24px; margin-left: 3px; }
.pv-count { position: absolute; top: 10px; right: 10px; padding: 3px 9px; border-radius: 999px; background: rgb(0 0 0 / .6); color: #fff; font-size: .72rem; font-weight: 650; }
.pv-arrow { position: absolute; top: 50%; translate: 0 -50%; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: rgb(255 255 255 / .85); color: #222; box-shadow: 0 2px 8px rgb(0 0 0 / .25); }
.pv-arrow.prev { left: 8px; } .pv-arrow.next { right: 8px; }
.pv-dots { position: absolute; left: 0; right: 0; bottom: 10px; display: flex; justify-content: center; gap: 4px; }
.pv-dots span { width: 6px; height: 6px; border-radius: 50%; background: rgb(255 255 255 / .5); }
.pv-dots span.on { background: #fff; }
.pv-grid { display: grid; gap: 2px; grid-template-columns: 1fr 1fr; background: #fff; }
.pv-grid.n3 > :first-child { grid-row: span 2; }
.pv-grid .pv-media { aspect-ratio: 1; }
.pv-grid.n3 > :first-child { aspect-ratio: auto; height: 100%; }
.pv-more-count { position: absolute; inset: 0; display: grid; place-items: center; background: rgb(0 0 0 / .45); color: #fff; font-size: 1.6rem; font-weight: 700; }
.pv-bar { display: flex; justify-content: space-around; padding: 6px 8px; border-top: 1px solid #e4e6eb; margin: 0 12px; color: #65676b; font-size: .8rem; font-weight: 600; }
.pv-bar span { display: inline-flex; align-items: center; gap: 6px; padding: 6px 8px; }
.pv-bar .icon { width: 17px; height: 17px; }
.pv-ig .pv-head { padding: 10px 12px; }
.pv-ring { padding: 2px; border-radius: 50%; background: var(--ig-grad); flex: none; }
.pv-ring .pv-avatar { width: 32px; height: 32px; box-shadow: 0 0 0 2px #fff; }
.pv-icons { display: flex; gap: 14px; padding: 10px 14px 6px; color: #262626; }
.pv-icons .icon { width: 22px; height: 22px; }
.pv-ig .pv-text { padding: 0 14px 14px; -webkit-line-clamp: 3; }
.pv-li { color: rgb(0 0 0 / .9); }
.pv-li .pv-avatar { border-radius: 50%; }
.pv-li .pv-text { -webkit-line-clamp: 3; }
.pv-phone { position: relative; width: min(100%, 300px); aspect-ratio: 9 / 16; border-radius: 30px; overflow: hidden; background: #000; color: #fff; box-shadow: 0 0 0 8px #111, 0 0 0 9px #333, 0 30px 60px -20px rgb(0 0 0 / .6); animation: fade-up .3s var(--ease); font: 13px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.pv-phone > .pv-media { position: absolute; inset: 0; aspect-ratio: auto; height: 100%; }
.pv-phone .pv-dots { bottom: 90px; }
.pv-story-top { position: absolute; left: 0; right: 0; top: 0; padding: 12px; display: grid; gap: 10px; background: linear-gradient(rgb(0 0 0 / .45), transparent); }
.pv-progress { height: 3px; border-radius: 2px; background: rgb(255 255 255 / .9); }
.pv-story-top .pv-who { display: flex; align-items: center; gap: 8px; }
.pv-story-top .pv-avatar { width: 30px; height: 30px; }
.pv-story-top small { color: rgb(255 255 255 / .7); }
.pv-rail { position: absolute; right: 10px; bottom: 90px; display: grid; justify-items: center; gap: 16px; }
.pv-rail .pv-avatar { width: 40px; height: 40px; box-shadow: 0 0 0 2px #fff; }
.pv-rail span .icon { width: 28px; height: 28px; filter: drop-shadow(0 1px 2px rgb(0 0 0 / .5)); }
.pv-tt-text { position: absolute; left: 0; right: 56px; bottom: 0; padding: 40px 14px 18px; display: grid; gap: 4px; background: linear-gradient(transparent, rgb(0 0 0 / .55)); text-shadow: 0 1px 2px rgb(0 0 0 / .5); }
.pv-tt-text p { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-wrap; }
.pv-tt-text small { display: inline-flex; align-items: center; gap: 6px; font-size: .76rem; }
.pv-tt-text small .icon { width: 13px; height: 13px; }


/* ---------- WhatsApp: composer ---------- */
.wa-seg { flex-wrap: wrap; }
.wa-seg button { display: inline-flex; align-items: center; gap: 6px; }
.wa-seg .icon { width: 15px; height: 15px; }
.wa-recipients { display: grid; gap: 8px; padding: 10px 12px; border-radius: 12px; background: var(--bg-elev); border: 1px solid var(--line); }
.wa-recipients-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; font-size: .84rem; }
.wa-recipients-head input { accent-color: var(--wa-dark); }
.wa-chips { display: flex; flex-wrap: wrap; gap: 6px; max-height: 168px; overflow: auto; padding: 2px; }
.wa-chip { position: relative; display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px 0 4px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: .78rem; font-weight: 600; cursor: pointer; transition: border-color .2s, background-color .2s, opacity .2s; user-select: none; }
.wa-chip input { position: absolute; opacity: 0; pointer-events: none; }
.wa-chip:has(input:checked) { border-color: color-mix(in oklab, var(--wa-dark) 55%, transparent); background: color-mix(in oklab, var(--wa) 14%, var(--surface)); }
.wa-chip:not(:has(input:checked)) { opacity: .55; }
.wa-chip:has(input:focus-visible) { outline: 2px solid var(--brand-text); outline-offset: 2px; }
.wa-chip.is-warn .wa-chip-name { text-decoration: underline wavy var(--danger); text-underline-offset: 3px; }
.wa-chip-name { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wa-initial { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; flex: none; font-size: .62rem; font-weight: 800; color: #fff; background: hsl(calc(var(--h, 0) * 45deg) 45% 45%); }
.wa-initial.big { width: 42px; height: 42px; font-size: .8rem; }
.wa-initial[data-hue="0"] { --h: 0; } .wa-initial[data-hue="1"] { --h: 1; } .wa-initial[data-hue="2"] { --h: 2; } .wa-initial[data-hue="3"] { --h: 3; }
.wa-initial[data-hue="4"] { --h: 4; } .wa-initial[data-hue="5"] { --h: 5; } .wa-initial[data-hue="6"] { --h: 6; } .wa-initial[data-hue="7"] { --h: 7; }
.wa-chip:has(input:checked) .wa-initial::after { content: ""; }
.wa-box .input { height: 38px; font-size: .84rem; }
.wa-box .input:disabled { opacity: .5; }
.wa-note { display: flex; gap: 8px; align-items: flex-start; }
.wa-note code, .copy-actions code { font: 600 .78rem var(--font-mono); padding: 1px 5px; border-radius: 5px; background: var(--surface-2); }
.pv-wa { background: #efeae2; color: #111b21; display: flex; flex-direction: column; }
html[data-theme="dark"] .pv-wa { background: #0b141a; color: #e9edef; }
.wa-top { display: flex; align-items: center; gap: 8px; padding: 30px 10px 10px; background: #008069; color: #fff; flex: none; }
html[data-theme="dark"] .wa-top { background: #202c33; }
.wa-top .pv-avatar { width: 32px; height: 32px; font-size: .64rem; }
.wa-top small { color: rgb(255 255 255 / .8); font-size: .7rem; }
.wa-chat { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; padding: 12px 10px; overflow-y: auto; scrollbar-width: none; background-image: radial-gradient(rgb(0 0 0 / .045) 1px, transparent 1.5px); background-size: 14px 14px; }
.wa-day { align-self: center; margin-bottom: 4px; padding: 3px 10px; border-radius: 8px; background: rgb(255 255 255 / .9); color: #54656f; font-size: .66rem; font-weight: 600; box-shadow: 0 1px .5px rgb(0 0 0 / .13); }
html[data-theme="dark"] .wa-day { background: #182229; color: #8696a0; }
.wa-bubble { position: relative; max-width: 82%; padding: 4px 4px 18px; border-radius: 8px 0 8px 8px; background: #d9fdd3; box-shadow: 0 1px .5px rgb(0 0 0 / .13); font-size: .8rem; line-height: 1.35; animation: fade-up .25s var(--ease); }
html[data-theme="dark"] .wa-bubble { background: #005c4b; }
.wa-bubble p { padding: 4px 6px 0; white-space: pre-wrap; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 7; -webkit-box-orient: vertical; overflow: hidden; }
.wa-bubble.has-media { width: 82%; }
.wa-bubble .pv-media { border-radius: 6px; max-height: 240px; }
.wa-more { font-style: italic; color: #54656f; }
.wa-meta { position: absolute; right: 7px; bottom: 3px; display: inline-flex; align-items: center; gap: 3px; font-size: .62rem; color: #667781; }
html[data-theme="dark"] .wa-meta { color: rgb(233 237 239 / .6); }
.wa-ticks { display: inline-flex; color: #53bdeb; }
.wa-ticks .icon { width: 12px; height: 12px; }
.wa-ticks .icon + .icon { margin-left: -7px; }

/* ---------- WhatsApp: contacts section ---------- */
.wa-instance { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 6px 0 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: .8rem; font-weight: 650; }
.wa-instance > .icon { color: var(--wa-dark); }
.wa-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.wa-toolbar .text-seg button { display: inline-flex; align-items: center; gap: 6px; }
.wa-search { flex: 1 1 260px; max-width: 420px; }
.wa-search input { height: 42px; }
.wa-tip { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; margin-bottom: 14px; border-radius: 14px; background: color-mix(in oklab, var(--wa) 10%, var(--surface)); border: 1px solid color-mix(in oklab, var(--wa) 25%, transparent); font-size: .84rem; color: var(--ink-2); }
.wa-tip > .icon { color: var(--wa-dark); margin-top: 2px; }
.contact-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.contact-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto auto; align-items: center; gap: 14px; padding: 10px 12px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); transition: opacity .2s, box-shadow .2s; animation: fade-up .25s var(--ease); }
.contact-row:hover { box-shadow: var(--shadow-sm); }
.contact-row.is-off { opacity: .55; }
.contact-main { display: grid; min-width: 0; line-height: 1.3; }
.contact-main strong { font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contact-main .muted { font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contact-tags { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.switch-row.compact { gap: 0; }
.contact-row .switch-row input:checked, .wa-box .switch-row input:checked { background: var(--wa-dark); }
.wa-empty { list-style: none; }
.consent-row { padding: 10px 12px; border-radius: 12px; background: var(--info-bg); color: var(--ink-2); }
.consent-row input { accent-color: var(--wa-dark); }
.contact-sheet form .field .help { margin-top: 2px; }
.delivery-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; max-height: 220px; overflow: auto; }
.delivery-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 6px 8px; border-radius: 9px; background: var(--surface); font-size: .8rem; }
.delivery-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--neutral); flex: none; }
.delivery-list [data-state="sent"] .delivery-dot { background: var(--ok); }
.delivery-list [data-state="failed"] .delivery-dot { background: var(--danger); }
.delivery-list [data-state="pending"] .delivery-dot { background: var(--warn); }
.delivery-name { font-weight: 600; }
.delivery-error { flex-basis: 100%; padding-left: 18px; color: var(--danger); }

/* ---------- New piece upload ---------- */
.upload-sheet { width: min(980px, calc(100vw - 32px)); }
.upload-form { display: grid; gap: 16px; }
.upload-form .sheet-head { margin-bottom: 0; }
.upload-form .sheet-head .eyebrow { color: var(--brand-text); margin-bottom: 2px; }
.upload-layout { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.upload-media { display: grid; gap: 12px; position: sticky; top: 0; }
.upload-fields { display: grid; gap: 14px; }
.upload-drop { display: grid; justify-items: center; gap: 6px; padding: 34px 20px; text-align: center; border-radius: 18px; border: 1.5px dashed var(--line-strong); background: var(--bg-elev); cursor: pointer; transition: border-color .2s, background-color .2s; }
.upload-drop:hover, .upload-drop.is-over, .upload-media:has(input:focus-visible) .upload-drop { border-color: var(--brand); background: var(--brand-soft); }
.upload-media:has(input:focus-visible) .upload-drop { outline: 2px solid var(--brand-text); outline-offset: 2px; }
.upload-drop strong { font-size: .95rem; }
.upload-drop .muted { font-size: .8rem; max-width: 40ch; }
.upload-drop.has-files { grid-template-columns: auto 1fr; justify-items: start; text-align: left; padding: 12px 14px; column-gap: 12px; row-gap: 0; }
.upload-drop.has-files .upload-drop-icon { grid-row: span 2; width: 38px; height: 38px; border-radius: 12px; }
.upload-drop-icon { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: var(--surface); color: var(--brand-text); box-shadow: var(--shadow-sm); }
.upload-files { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(136px, 1fr)); gap: 10px; max-height: 52dvh; overflow: auto; }
.upload-file { display: grid; gap: 6px; min-width: 0; animation: fade-up .25s var(--ease); }
.upload-thumb { position: relative; aspect-ratio: 4 / 5; border-radius: 12px; overflow: hidden; background: var(--surface-3); border: 1px solid var(--line); }
.upload-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.upload-placeholder { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); }
.upload-cover, .upload-kind { position: absolute; left: 6px; z-index: 1; display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 999px; font-size: .68rem; font-weight: 700; color: #fff; background: rgb(0 0 0 / .62); backdrop-filter: blur(6px); }
.upload-cover { bottom: 6px; background: var(--brand); color: var(--on-brand); box-shadow: 0 2px 8px rgb(0 0 0 / .25); }
.upload-kind { top: 6px; }
.upload-file:not([data-status="ready"]):not([data-status="error"]) .upload-cover { display: none; }
.upload-kind .icon { width: 11px; height: 11px; }
.upload-tools { position: absolute; top: 6px; right: 6px; z-index: 2; display: flex; gap: 3px; opacity: 0; transition: opacity .2s; }
.upload-file:hover .upload-tools, .upload-tools:focus-within { opacity: 1; }
@media (hover: none) { .upload-tools { opacity: 1; } }
.upload-tool { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; color: #fff; background: rgb(0 0 0 / .6); backdrop-filter: blur(6px); }
.upload-tool:hover:not(:disabled) { background: rgb(0 0 0 / .8); }
.upload-tool:disabled { opacity: .35; }
.upload-tool .icon { width: 14px; height: 14px; }
.upload-progress { position: absolute; left: 8px; right: 8px; bottom: 8px; z-index: 1; height: 5px; border-radius: 3px; background: rgb(255 255 255 / .45); overflow: hidden; }
.upload-progress > span { display: block; height: 100%; width: 100%; border-radius: inherit; background: #fff; transform-origin: left; transform: scaleX(var(--p, 0)); transition: transform .2s linear; }
.upload-file[data-status="uploading"] .upload-thumb::after { content: ""; position: absolute; inset: 0; background: rgb(0 0 0 / .28); }
.upload-done { position: absolute; right: 6px; bottom: 6px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--ok); color: #fff; animation: pop .35s var(--ease); }
.upload-done .icon { width: 14px; height: 14px; }
.upload-file[data-status="done"] .upload-progress { display: none; }
.upload-file[data-status="error"] .upload-thumb { border-color: var(--danger); box-shadow: 0 0 0 1px var(--danger); }
.upload-name { display: grid; min-width: 0; line-height: 1.3; }
.upload-name span { font-size: .76rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-name small { font-size: .7rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-file[data-status="error"] .upload-name small { color: var(--danger); white-space: normal; }
.upload-copy-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.chips.wrap { flex-wrap: wrap; overflow: visible; }
.upload-copy-foot .chip { height: 32px; font-size: .78rem; }
.upload-form textarea { min-height: 120px; height: auto; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.upload-form.is-busy .upload-fields, .upload-form.is-busy .upload-drop { opacity: .6; pointer-events: none; }
.upload-actions { position: sticky; bottom: -22px; margin: 0 -22px -22px; padding: 14px 22px; background: color-mix(in oklab, var(--surface) 92%, transparent); backdrop-filter: blur(10px); border-top: 1px solid var(--line); }
#view-biblioteca.is-drop-target { outline: 2px dashed var(--brand); outline-offset: 8px; border-radius: 22px; }
@media (max-width: 760px) {
  .upload-layout { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .upload-media { position: static; }
  .upload-files { grid-template-columns: repeat(2, minmax(0, 1fr)); max-height: none; }
  .upload-actions #upload-summary { flex-basis: 100%; }
  .upload-actions .spacer { display: none; }
  .upload-actions .button { flex: 1; }
}
@media (max-width: 640px) {
  .results-tools #new-piece span { display: none; }
  .results-tools #new-piece { width: 34px; padding: 0; }
}

/* ---------- OAuth bounce page ---------- */
.bounce-page { display: grid; place-items: center; padding: 24px; }
.bounce-card { display: grid; justify-items: center; gap: 10px; text-align: center; animation: fade-up .4s var(--ease) both; }
.bounce-card h1 { font-size: 1.8rem; margin: 6px 0 0; }
.bounce-spinner { width: 40px; height: 40px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--brand); animation: spin .8s linear infinite; }

/* ---------- Animations ---------- */
@keyframes card-in { from { opacity: 0; transform: translateY(10px); } }
@keyframes fade-up { from { opacity: 0; transform: translateY(8px); } }
@keyframes card-out { to { opacity: 0; transform: scale(.94); } }
@keyframes pulse { 0% { opacity: .8; transform: scale(.6); } 100% { opacity: 0; transform: scale(1.8); } }
@keyframes breathe { 50% { opacity: .65; } }
@keyframes shimmer { to { background-position: -220% 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pop { 40% { transform: scale(1.35); } }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px) scale(.97); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px) scale(.97); } }
@keyframes drift { to { transform: translate(6%, -4%) rotate(8deg) scale(1.08); } }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .25s; }

/* ---------- Responsive ---------- */
@media (hover: none) {
  .fav-button { opacity: 1; transform: none; }
  .hide-touch { display: none !important; }
  .piece-card:hover { transform: none; box-shadow: none; }
  .piece-card:hover .card-media img { transform: none; }
}
@media (max-width: 1180px) {
  .hero { grid-template-columns: 1fr; align-items: start; gap: 22px; }
}
@media (max-width: 960px) {
  .app-shell { display: block; }
  .sidebar {
    position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px;
    padding: 12px var(--pad); border-right: 0; border-bottom: 1px solid var(--line); overflow: visible;
  }
  .wordmark { padding: 0; }
  .side-label, .user-chip { display: none; }
  .business-list { order: 3; width: 100%; display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
  .business-button { flex: 1 0 auto; width: auto; background: var(--surface); border-color: var(--line); padding: 7px 12px 7px 7px; }
  .business-button[aria-current="true"] { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand) inset; }
  .biz-avatar { width: 32px; height: 32px; }
  .side-bottom { margin: 0 0 0 auto; padding: 0; border: 0; display: flex; gap: 4px; }
  .side-link { width: 40px; height: 40px; padding: 0; justify-content: center; border-radius: 12px; }
  .side-link .label { display: none; }
  .detail-dialog { width: 100vw; height: 100dvh; border-radius: 0; margin: 0; inset: 0; transform: translateY(32px); }
  @starting-style { .detail-dialog[open] { transform: translateY(32px); } }
  .detail-layout { display: block; overflow-y: auto; overscroll-behavior: contain; }
  .preview-panel, .detail-content { overflow: visible; }
  .viewer { flex: none; height: min(64dvh, 620px); min-height: 260px; }
  .dialog-top { padding: 8px 10px 8px 16px; padding-top: max(8px, env(safe-area-inset-top)); }
  .admin-bar { padding-bottom: max(12px, env(safe-area-inset-bottom)); }
  .auth-page { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .auth-art { min-height: 0; padding: 28px 24px 26px; gap: 18px; }
  .auth-points, .auth-art .auth-biz { display: none; }
  .auth-headline { font-size: 2.3rem; margin: 8px 0 0; }
}
@media (max-width: 640px) {
  body { font-size: 14.5px; }
  .wordmark-text { display: none; }
  .hero { padding: 20px 0 18px; }
  .intro-copy { display: none; }
  h1 { font-size: 2.15rem; margin: 8px 0 0; }
  .filters-toggle { display: inline-flex; }
  .toolbar:not(.filters-open) .filter-row { display: none; }
  .toolbar.filters-open .filter-row { animation: fade-up .25s var(--ease); }
  .toolbar-top .chips { margin: 0 0 0 calc(var(--pad) * -1); padding-right: 4px; -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent); mask-image: linear-gradient(90deg, #000 88%, transparent); }
  .stats { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; margin: 0 calc(var(--pad) * -1); padding: 2px var(--pad) 6px; }
  .stats::-webkit-scrollbar { display: none; }
  .stat { flex: 0 0 136px; scroll-snap-align: start; padding: 12px 14px; }
  .stat-value { font-size: 1.45rem; }
  .filter-row .field { flex: 1 1 calc(50% - 5px); }
  .segmented { margin-left: auto; }
  .gallery[data-view="grid"] { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .gallery[data-view="compact"] { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .piece-card { border-radius: 14px; }
  .results-bar { align-items: center; }
  #result-status { max-width: 38vw; font-size: .74rem; }
  .dialog-tools { gap: 4px; }
  .dialog-tools .icon-button { width: 36px; height: 36px; border-radius: 10px; }
  .tool-sep { display: none; }
  .preview-panel { padding: 12px; }
  .viewer { height: min(58dvh, 560px); border-radius: 14px; }
  .download-actions .button { flex: 1 1 calc(50% - 4px); }
  .detail-content { padding: 20px 16px 28px; }
  .admin-bar { flex-direction: column; align-items: stretch; gap: 10px; padding: 12px 14px; }
  .admin-bar p { display: none; }
  .admin-buttons .button { flex: 1; }
  .admin-buttons .danger-text { flex: 0 0 auto; }
  .admin-buttons .danger-text span { display: none; }
  .selection-bar { gap: 2px; padding-left: 14px; }
  #selection-all { display: none; }
  .mobile-only { display: inline-grid; }
  .auth-card-top { margin-bottom: 8px; }
}

/* ---------- Social: responsive ---------- */
@media (max-width: 1180px) {
  .cal-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cal-next { grid-column: 1 / -1; }
}
@media (max-width: 960px) {
  .app-nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 70; display: block; padding: 6px 10px max(6px, env(safe-area-inset-bottom));
    background: color-mix(in oklab, var(--bg-elev) 88%, transparent); -webkit-backdrop-filter: saturate(1.6) blur(16px); backdrop-filter: saturate(1.6) blur(16px);
    border-top: 1px solid var(--line);
  }
  .app-nav .side-label { display: none; }
  .nav-links { grid-template-columns: repeat(4, 1fr); gap: 2px; }
  .nav-link { flex-direction: column; justify-content: center; gap: 2px; padding: 6px 4px; font-size: .7rem; text-align: center; border-radius: 12px; }
  .nav-link .icon { width: 22px; height: 22px; }
  .nav-link[aria-current="page"] { background: transparent; }
  .nav-link[aria-current="page"] .icon { background: var(--brand-soft); border-radius: 999px; width: 52px; padding: 2px 15px; box-sizing: border-box; }
  .nav-badge, .nav-dot { position: absolute; top: 2px; left: calc(50% + 10px); margin: 0; }
  .nav-badge { height: 18px; min-width: 18px; padding: 0 5px; font-size: .64rem; }
  body.has-nav { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
  body.has-nav .to-top, body.has-nav .toasts, body.has-nav .selection-bar { bottom: calc(80px + env(safe-area-inset-bottom)); }
  body.has-nav:has(.selection-bar:not([hidden])) .to-top, body.has-nav:has(.selection-bar:not([hidden])) .toasts { bottom: calc(150px + env(safe-area-inset-bottom)); }
  .compose-dialog { width: 100vw; height: 100dvh; border-radius: 0; margin: 0; inset: 0; transform: translateY(32px); }
  @starting-style { .compose-dialog[open] { transform: translateY(32px); } }
  .compose-layout { display: flex; flex-direction: column; overflow-y: auto; overscroll-behavior: contain; }
  .compose-form, .compose-preview { overflow: visible; }
  .compose-preview { order: 2; padding: 22px 16px 30px; }
  .compose-form { padding: 4px 16px 16px; }
  .compose-shell .dialog-top { padding-top: max(8px, env(safe-area-inset-top)); }
  .compose-foot { padding-bottom: max(12px, env(safe-area-inset-bottom)); }
  .post-sheet, .wide-sheet { width: 100vw; max-width: 100vw; max-height: 92dvh; margin: auto 0 0; border-radius: 22px 22px 0 0; }
  .wide-sheet { padding-bottom: max(22px, env(safe-area-inset-bottom)); }
}
@media (max-width: 640px) {
  .view-head { padding: 20px 0 16px; align-items: start; }
  .view-head .intro-copy { display: none; }
  .view-aside { width: 100%; }
  .view-aside .button.primary { margin-left: auto; }
  .cal-summary { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; margin: 0 calc(var(--pad) * -1) 14px; padding: 2px var(--pad) 6px; }
  .cal-summary::-webkit-scrollbar { display: none; }
  .cal-summary > * { flex: 0 0 150px; scroll-snap-align: start; }
  .cal-summary > .cal-next { flex-basis: 230px; }
  .cal-toolbar { gap: 10px; }
  .cal-nav { width: 100%; }
  .cal-nav h2 { flex: 1; min-width: 0; font-size: 1.3rem; }
  .cal-toolbar .chips { order: 3; justify-content: flex-start; flex-basis: 100%; }
  .cal-weekdays span { padding: 8px 0; text-align: center; letter-spacing: .04em; font-size: .64rem; }
  .cal-day { min-height: 58px; padding: 4px 2px; align-items: center; gap: 2px; cursor: pointer; }
  .cal-day-top { justify-content: center; }
  .cal-add, .cal-items { display: none; }
  .cal-num { min-width: 30px; height: 30px; font-size: .8rem; }
  .cal-dots { display: flex; gap: 3px; }
  .cal-dots span { width: 6px; height: 6px; border-radius: 50%; background: var(--tone); }
  .cal-month { border-radius: 16px; }
  .day-panel { padding: 14px; border-radius: 16px; }
  .agenda-item { grid-template-columns: 48px minmax(0, 1fr) auto; gap: 10px; padding: 10px; }
  .agenda-thumb { display: none; }
  .agenda-time { font-size: .9rem; }
  .agenda-item > .tag { display: none; }
  .agenda-date { top: 72px; }
  .connect-card { padding: 16px; }
  .how-steps { padding: 14px; }
  .post-head { grid-template-columns: 56px minmax(0, 1fr) auto; }
  .post-thumb { width: 56px; height: 56px; }
  .target-row { grid-template-columns: auto minmax(0, 1fr); }
  .target-row > a { grid-column: 2; justify-self: start; }
  .picker-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .compose-foot { flex-direction: column; align-items: stretch; gap: 10px; padding: 10px 14px; }
  .compose-buttons .button { flex: 1; }
  .compose-buttons .button.ghost { flex: 0 0 auto; }
  .acct-pick { grid-template-columns: 1fr; }
  .when-row .input { flex: 1 1 100%; }
  .tt-brand { padding-left: 0; }
  .contact-row { grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 10px; }
  .contact-tags { grid-column: 2; grid-row: 2; justify-content: flex-start; }
  .wa-toolbar .text-seg { flex: 1 1 100%; }
  .wa-toolbar .text-seg button { flex: 1; justify-content: center; }
  .wa-search { max-width: none; }
  .view-aside .wa-instance { flex-basis: 100%; justify-content: space-between; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ---------- Página web (news section of the business site) ---------- */
:root { --web: #3d2720; --web-accent: #a8441f; }
[data-net="web"].net-tile, .net-badge[data-net="web"], .mini-net[data-net="web"] { background: var(--web); }
.brand-button[data-net="web"] { background: var(--web); }
.net-chip[aria-pressed="true"][data-net="web"] { background: var(--web); border-color: var(--web); color: #fff; }
.preview-tab[aria-selected="true"][data-net="web"] { background: var(--web); }
.web-options { display: grid; gap: 8px; }
.web-options .field-label { margin: 0; font-size: .72rem; font-weight: 650; color: var(--muted); letter-spacing: .02em; }
.mini-seg.wrap { flex-wrap: wrap; }
.check-line { display: inline-flex; align-items: center; gap: 8px; min-height: 32px; font-size: .84rem; color: var(--ink-2); cursor: pointer; }
.check-line input { width: 18px; height: 18px; accent-color: var(--web); }
.web-state { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.web-live { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 600; color: var(--ok); }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px color-mix(in oklab, currentColor 22%, transparent); }
.pv-web { background: #f7edda; color: #3d2720; }
.pv-web-bar { display: flex; align-items: center; gap: 10px; padding: 9px 12px; background: #fffaf0; border-bottom: 1px solid rgb(61 39 32 / .14); font-size: 12px; }
.pv-web-dots { display: inline-flex; gap: 5px; }
.pv-web-dots i { width: 8px; height: 8px; border-radius: 50%; background: rgb(61 39 32 / .25); }
.pv-web-url { color: rgb(61 39 32 / .75); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pv-web-card { margin: 14px; border: 2px solid #1c1c1c; border-radius: 18px; overflow: hidden; background: #fffaf0; box-shadow: 5px 5px 0 #1c1c1c; }
.pv-web-body { display: grid; gap: 8px; padding: 14px 14px 16px; }
.pv-web-tags { display: flex; gap: 8px; align-items: center; font-size: 12px; font-weight: 700; }
.pv-web-tag { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; background: #154700; color: #f7edda; }
.pv-web-tag .icon { width: 12px; height: 12px; }
.pv-web-date { color: rgb(61 39 32 / .7); }
.pv-web-title { font: 800 19px/1.15 Georgia, "Times New Roman", serif; }
.pv-web .pv-text { padding: 0; -webkit-line-clamp: 4; }
.pv-web-cta { justify-self: start; display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; background: #3d2720; color: #f7edda; font-weight: 800; font-size: 13px; }
.pv-web-cta .icon { width: 15px; height: 15px; }
html[data-theme="dark"] .pv-web { box-shadow: 0 18px 40px -20px rgb(0 0 0 / .6), 0 0 0 1px rgb(255 255 255 / .08); }

/* ---------- Responsive refinements (2026-10): content first on every screen ---------- */
/* The hero is a header, not a landing page: the gallery has to show up in the first screen. */
.hero { padding: 22px 0 18px; gap: 24px; }
h1 { font-size: clamp(2rem, 1.2rem + 1.7vw, 2.9rem); margin: 8px 0 8px; }
.intro-copy { font-size: .9rem; }
.stat { padding: 12px 14px; gap: 4px; }
.stat-value { font-size: 1.5rem; }
.stat-top { min-width: 0; }
.results-bar { align-items: center; margin: 10px 0 14px; }
.results-bar h2 { white-space: nowrap; }
.results-tools { flex-wrap: nowrap; }
#result-status { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* The search only filters the library, so it steps aside in the other sections. */
body[data-view]:not([data-view="biblioteca"]) .topbar { display: none; }
body[data-view]:not([data-view="biblioteca"]) .view-head { padding-top: 26px; }
/* Bigger hit areas wherever the pointer is a finger. */
@media (pointer: coarse) {
  .chip { height: 40px; }
  .button.small { height: 40px; }
  .segmented { height: 44px; }
  .segmented button { width: 40px; }
  .icon-button { width: 42px; height: 42px; }
}
/* Detail: keep the shell inside the viewport whatever the buttons need. */
.detail-shell { grid-template-columns: minmax(0, 1fr); }
.admin-bar { flex-wrap: wrap; }
.admin-buttons { flex-wrap: wrap; justify-content: flex-end; min-width: 0; }

@media (max-width: 1180px) {
  .hero { gap: 16px; }
  .stats { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
  .stat-top { font-size: .72rem; }
  .stat-top span, .stat-top { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}
@media (max-width: 960px) {
  .hero { padding: 16px 0 14px; }
  .hero .intro-copy { display: none; }
  h1 { font-size: clamp(1.7rem, 1.2rem + 1.6vw, 2.2rem); margin: 6px 0 0; }
  h1 br { display: none; }
  h1 em { margin-left: .25em; }
  .sidebar { padding-top: max(10px, env(safe-area-inset-top)); padding-bottom: 10px; row-gap: 8px; }
  .business-list { scroll-padding-inline: var(--pad); margin: 0 calc(var(--pad) * -1); padding: 2px var(--pad); width: calc(100% + var(--pad) * 2); }
  .business-button { flex: 0 0 auto; padding: 6px 14px 6px 6px; border-radius: 14px; }
  .topbar { padding-block: 10px; }
  .search input { height: 44px; }
  .filter-row .field { flex: 1 1 128px; }
  .detail-dialog .admin-bar p { flex: 1 1 100%; }
  /* "Nueva pieza" becomes a floating button above the bottom navigation. */
  #new-piece:not([hidden]) {
    position: fixed; right: max(16px, env(safe-area-inset-right)); bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 65;
    height: 52px; padding: 0 20px 0 16px; border-radius: 18px; font-size: .9rem; box-shadow: 0 14px 30px -10px var(--brand), var(--shadow);
  }
  #new-piece .icon { width: 22px; height: 22px; }
  body:not([data-view="biblioteca"]) #new-piece, .gallery.selecting ~ * #new-piece, body:has(.selection-bar:not([hidden])) #new-piece { display: none; }
  body.has-nav .to-top { bottom: calc(148px + env(safe-area-inset-bottom)); }
  body.has-nav:has(#new-piece[hidden]) .to-top, body:not([data-view="biblioteca"]) .to-top { bottom: calc(80px + env(safe-area-inset-bottom)); }
  .gallery { padding-bottom: 72px; }
}
@media (max-width: 640px) {
  /* Phones: the business switcher already says where you are, so the hero is only the stats strip. */
  .hero { display: block; padding: 6px 0 12px; }
  .hero-copy { display: none; }
  .stats { display: flex; gap: 8px; scroll-padding-inline: var(--pad); }
  .stat { flex: 0 0 auto; min-width: 104px; padding: 9px 12px; border-radius: 14px; }
  .stat-value { font-size: 1.25rem; }
  .stat:hover { transform: none; }
  .cal-summary { scroll-padding-inline: var(--pad); }
  .business-button .biz-meta { display: none; }
  .business-button strong { font-size: .86rem; white-space: nowrap; }
  .business-button { padding: 5px 12px 5px 5px; gap: 8px; }
  .biz-avatar { width: 30px; height: 30px; border-radius: 9px; font-size: .7rem; }
  .side-bottom .side-link { width: 38px; height: 38px; }
  .logo { width: 36px; height: 36px; font-size: 1.2rem; }
  .topbar { padding-block: 8px; }
  .results-bar { margin: 4px 0 12px; }
  .results-bar h2 { font-size: 1rem; }
  #result-status { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  #select-toggle { width: 40px; padding: 0; }
  #select-toggle span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .results-tools #new-piece span { display: none; }
  #new-piece:not([hidden]) { width: 56px; height: 56px; padding: 0; border-radius: 18px; }
  .admin-bar { gap: 8px; }
  .admin-buttons { display: grid; grid-template-columns: auto 1fr 1fr; gap: 8px; }
  .admin-buttons #approve-next { grid-column: 1 / -1; }
  .admin-buttons .button { min-width: 0; padding: 0 10px; }
  .admin-buttons .button span, .admin-buttons .button { overflow: hidden; text-overflow: ellipsis; }
}
@media (max-width: 380px) {
  .gallery[data-view="grid"] { gap: 8px; }
  .card-body { padding: 10px; }
}
@media (max-width: 640px) {
  .toolbar-top .chips { padding-left: var(--pad); scroll-padding-inline: var(--pad); }
}
@media (min-width: 641px) and (max-width: 1180px) {
  /* One row of stats: drop the icon and let long labels take two lines instead of cutting them. */
  .stat-top { white-space: normal; overflow: visible; line-height: 1.2; min-height: 2.4em; align-items: flex-start; }
  .stat-top .icon { display: none; }
  .stat { align-content: space-between; }
}
@media (min-width: 641px) and (max-width: 1180px) {
  .gallery[data-view="grid"] { grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); gap: 14px; }
}
@media (max-width: 1180px) {
  :root { --sidebar: 232px; }
  .hero { padding: 18px 0 14px; }
  .hero .intro-copy { display: none; }
  h1 { font-size: clamp(1.7rem, 1.1rem + 1.5vw, 2.3rem); margin: 6px 0 0; }
  h1 br { display: none; }
  h1 em { margin-left: .25em; }
  .filter-row .field { flex: 1 1 128px; }
}

/* ---------- Perfil de Google (Google Business Profile) ---------- */
:root { --gbp: #1a73e8; }
[data-net="google"].net-tile, .net-badge[data-net="google"], .mini-net[data-net="google"] { background: var(--gbp); }
.brand-button[data-net="google"] { background: var(--gbp); }
.net-chip[aria-pressed="true"][data-net="google"] { background: var(--gbp); border-color: var(--gbp); color: #fff; }
.preview-tab[aria-selected="true"][data-net="google"] { background: var(--gbp); }
.pv-web.pv-google { background: #fff; color: #202124; }
.pv-google .pv-web-cta { background: var(--gbp); color: #fff; }
