:root{
  /* SKRYPT — arquivo (base) */
  --bg:#E6E1D6;
  --surface:#F2EFE9;
  --surface-2:#EAE4D6;
  --border:#ddd6c6;
  --border-strong:#c9bfa8;
  --text:#1B1E27;
  --text-2:#5c5646;
  --text-3:#8B8576;
  /* SKRYPT — assinatura (cursor) */
  --accent:#FF7A52;
  --accent-2:#FF9470;
  --accent-soft:rgba(255,122,82,.14);
  /* SKRYPT — tokens de sintaxe (amber/warn, mint/ok) */
  --warn:#8a5a12;
  --warn-soft:#FFF6E0;
  --warn-line:#FFC857;
  --danger:#E5635A;
  --danger-soft:#FCE9E7;
  --ok:#2f7d52;
  --shadow:0 1px 2px rgba(27,30,39,.06), 0 4px 16px rgba(27,30,39,.07);
  --shadow-lg:0 -2px 24px rgba(27,30,39,.1);
  --r:12px; --r-sm:8px;
  --mono:'JetBrains Mono',ui-monospace,"SF Mono",Menlo,Consolas,monospace;
  --sans:'Inter',-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;
}
@media (prefers-color-scheme:dark){
  :root{
    /* SKRYPT — arquivo (base), tema escuro nativo da marca */
    --bg:#11141B;
    --surface:#171B25;
    --surface-2:#1E2430;
    --border:#262C3A;
    --border-strong:#333B4D;
    --text:#ECE9E2;
    --text-2:#b7b3a8;
    --text-3:#6E7681;
    /* SKRYPT — assinatura (cursor), mesma cor nos dois temas */
    --accent:#FF7A52;
    --accent-2:#FF9470;
    --accent-soft:rgba(255,122,82,.18);
    /* SKRYPT — tokens de sintaxe (amber/warn, mint/ok) */
    --warn:#FFC857;
    --warn-soft:rgba(255,200,87,.12);
    --warn-line:#FFC857;
    --danger:#E5635A;
    --danger-soft:rgba(229,99,90,.16);
    --ok:#6FCF97;
    --shadow:0 1px 2px rgba(0,0,0,.35), 0 4px 16px rgba(0,0,0,.3);
    --shadow-lg:0 -2px 24px rgba(0,0,0,.5);
  }
}
*{box-sizing:border-box;margin:0;padding:0;}
html,body{height:100%;overflow:hidden;}
body{
  background:var(--bg);color:var(--text);
  font:14px/1.45 var(--sans);
  -webkit-font-smoothing:antialiased;
}
button,input,select{font:inherit;color:inherit;}
::-webkit-scrollbar{width:11px;height:11px;}
::-webkit-scrollbar-track{background:transparent;}
::-webkit-scrollbar-thumb{background:var(--border-strong);border-radius:99px;border:3px solid var(--bg);}
::-webkit-scrollbar-thumb:hover{background:var(--text-3);}

/* ---------- shell ---------- */
.app{display:flex;flex-direction:column;height:100vh;height:100dvh;}
.topbar{
  flex:none;display:flex;align-items:center;gap:14px;
  padding:0 18px;height:52px;
  background:var(--surface);border-bottom:1px solid var(--border);
}
.brand{display:flex;align-items:center;gap:11px;font-weight:650;letter-spacing:-.01em;}
.brand-link{display:flex;align-items:center;flex:none;}
.brand-logo{
  font-family:var(--mono);font-weight:700;font-size:19px;letter-spacing:-.01em;
  color:var(--text);display:block;text-decoration:none;
}
.brand-logo .cursor{color:var(--accent);animation:brandBlink 1.1s step-end infinite;}
@media (prefers-reduced-motion: reduce){.brand-logo .cursor{animation:none;}}
.brand-divider{width:1px;height:24px;background:var(--border-strong);flex:none;}
.brand-name{
  font-family:var(--mono);
  font-size:16px;font-weight:700;color:var(--text);letter-spacing:-.01em;
  text-decoration:none;transition:color .13s;
}
.brand-name:hover,.brand-name:focus-visible{color:var(--accent);}
.brand-name .cursor{color:var(--accent);animation:brandBlink 1.1s step-end infinite;}
.brand-name .tool{color:var(--accent);}
@keyframes brandBlink{50%{opacity:0;}}
@media (prefers-reduced-motion: reduce){.brand-name .cursor{animation:none;}}
.topbar .sep{width:1px;height:22px;background:var(--border);flex:none;}
.topbar .spacer{flex:1;}
.hint{color:var(--text-3);font-size:12.5px;}

/* Sidebar-drawer toggle (hamburger): only ever shown below the 760px mobile breakpoint
   below, where the sidebar switches from a static grid column to an off-canvas drawer (see
   CLAUDE.md, "Mobile layout"). Hidden here so it never appears on desktop. #btnSidebarToggle
   (an ID selector, not just .sidebar-toggle) is used so this reliably beats .iconbtn's own
   later, equal-specificity display:grid rule regardless of source order. */
#btnSidebarToggle.sidebar-toggle{display:none;}

.body{flex:1;display:grid;grid-template-columns:272px 1fr;min-height:0;}
@media (max-width:880px){.body{grid-template-columns:224px 1fr;}}

/* #sideBackdrop must be position:fixed UNCONDITIONALLY, not just inside the 760px query
   below — it's a direct child of .body (a grid container), and a real regression was caught
   on desktop from getting this wrong: while it was only position:fixed inside the media
   query, at desktop widths it stayed a normal in-flow block element, which made it consume
   .body's first grid track as an actual (invisible) grid item, bumping .side into the 1fr
   track and knocking the whole two-column layout out of order. position:fixed removes an
   element from grid flow at any viewport width, which is what actually fixes it — scoping to
   a media query was never the right lever here. Hidden by default (opacity:0;visibility:
   hidden) so even though it now always exists in the layout, it's inert everywhere except
   while .side's mobile drawer is open (see the .show class below).  */
#sideBackdrop{
  position:fixed;top:52px;left:0;right:0;bottom:0;z-index:50;
  background:rgba(0,0,0,.45);
  opacity:0;visibility:hidden;transition:opacity .2s ease,visibility .2s ease;
  pointer-events:none;
}
#sideBackdrop.show{opacity:1;visibility:visible;pointer-events:auto;}
/* Same grid-participation trap as #sideBackdrop above, and the same fix philosophy: #mobileRail
   is also a direct child of .body (a grid container), so it needs to be taken out of grid flow
   unconditionally, not just styled for the mobile breakpoint. Unlike the backdrop (which needs
   to keep existing, invisibly, for its opacity transition), the rail has nothing to transition,
   so the simpler `display:none` by default is enough here — it generates no box at all outside
   the media query below, where it's switched to `display:flex`. */
#mobileRail{display:none;}

/* ---------- mobile layout (<=760px): sidebar becomes an off-canvas drawer ---------- */
@media (max-width:760px){
  .topbar{padding:0 10px;gap:8px;}
  /* the privacy blurb and the divider after it are the least essential thing in the bar;
     dropping them is what leaves room for the hamburger without crowding the brand. */
  .topbar .hint-desc{display:none;}
  .topbar .sep{display:none;}
  #btnSidebarToggle.sidebar-toggle{display:grid;}
  /* .side becomes position:fixed below (out of grid flow entirely), so without collapsing
     to a single track here .main would auto-place into the still-defined first (sidebar-
     width) column instead of using the full width — this is required, not cosmetic. */
  .body{grid-template-columns:1fr;}
  .side{
    position:fixed;top:52px;left:0;bottom:0;width:min(86vw,300px);z-index:55;
    border-right:1px solid var(--border-strong);
    box-shadow:0 12px 40px rgba(0,0,0,.4);
    transform:translateX(-100%);transition:transform .2s ease;
  }
  .side.open{transform:translateX(0);}
  /* Persistent icon-only rail, docked left, always visible at this breakpoint regardless of
     drawer state — a quicker, ambient way in beyond the topbar hamburger ("também" abrir a
     barra lateral, per the request). Sits behind the drawer/backdrop in stacking order
     (z-index 45 < backdrop's 50 < .side's 55), so opening the full drawer naturally covers
     it with no extra JS needed to hide it. */
  #mobileRail{
    display:flex;flex-direction:column;align-items:center;gap:2px;
    position:fixed;top:52px;left:0;bottom:0;width:44px;z-index:45;overflow-y:auto;
    background:var(--surface);border-right:1px solid var(--border);padding:6px 0;
  }
  .rail-btn{
    display:flex;flex-direction:column;align-items:center;gap:2px;
    width:100%;padding:8px 2px;border:none;background:transparent;color:var(--text-3);
    cursor:pointer;
  }
  .rail-btn:active{background:var(--surface-2);color:var(--accent);}
  .rail-btn svg{flex:none;}
  .rail-btn span{font-size:8.5px;font-weight:600;text-align:center;line-height:1.15;}
  /* .main gets the matching left inset so its content (toolbar/table/pager/dup panel) never
     sits underneath the fixed rail — a single padding here, rather than on each child, since
     .main is the shared ancestor all of them flow through. */
  .main{padding-left:44px;}
  .toolbar{padding-left:12px;padding-right:12px;}
  /* .foot is NOT inside .main (it's a sibling of .body at the .app level, per the app-shell
     layout invariant), and the rail's bottom:0 makes it as tall as the viewport, so it
     overlaps .foot's row too. A left-padding equal to the rail's width was tried first (avoid
     the overlap by keeping content clear of it) and was a real reported bug: it left the
     footer's text still rendering partly underneath the rail on an actual phone. Simpler and
     more robust, per that report: don't try to dodge the rail at all — give .foot a higher
     stacking order than the rail (z-index 46, just above the rail's 45, still below the
     backdrop/drawer/other popovers at 50/55/60 so those still correctly cover the footer while
     open) so its own opaque background (`background:var(--surface)`, unchanged) simply paints
     over whatever part of the rail it would otherwise overlap. `position:relative` is what
     lets a z-index apply at all to an otherwise statically-positioned element; it has no
     layout side effects on its own (no offset given). */
  .foot{position:relative;z-index:46;padding-left:12px;padding-right:12px;}
  /* below 16px, iOS Safari auto-zooms the page on focus; scoped to this breakpoint only so
     desktop's tuned 13px sizing is untouched */
  .inp,.sel{font-size:16px;}
  /* best-effort safety net for the two popovers (#colPanel, #dlFormatPanel) that aren't
     JS-clamped to the viewport like #columnFilterPanel/#frConfirmBox already are — see
     CLAUDE.md for why those two didn't need the same treatment */
  .colpanel{max-width:calc(100vw - 24px);}

  /* Duplicate-check panel (part 5): .dup-key's fixed 190px and .tile's fixed 128px are an
     intentional desktop invariant (documented in CLAUDE.md — they keep every stacked .dup-row
     aligned into columns) that simply doesn't fit a ~300-340px mobile row: 190px alone leaves
     less width than a single 128px tile needs, so every tile ends up on its own line, and
     with the dedupe checkbox/download button after them a single checked column's real
     content came out well over 3x the panel's 230px cap — a real reported bug ("occupies all
     the visible space"), confirmed by measuring the actual rendered rects on a forced-mobile
     page (a single-column stack of 128px-wide tiles overflowing a ~97px-wide .dup-body). Fixed
     by letting the row wrap into a deliberate, compact mobile layout instead of trying to fit
     the desktop column arrangement into a narrower row: the key becomes its own full-width
     line (it reads naturally as a small header for the stats below it), the tiles form a
     3-per-row grid instead of a single column (5 tiles → 2 rows: 3 then 2 — tried 2-per-row
     first, an explicit follow-up request asked for 3 since it's shorter still and the tiles'
     own content, a short label + a short number, comfortably fits a narrower tile), and the
     dedupe checkbox/download button each get their own full-width line to match. None of this
     touches the desktop-only fixed widths — they're only overridden here, inside the media
     query.
     Every selector below is scoped with the #dupPanel prefix — NOT just .dup-row/.dup-key/
     .tile/etc on their own. This is required, not decoration: the plain, unconditional
     desktop declarations for all of these (.dup, .dup-row, .dup-key, .dup-body, .tiles,
     .tile — see their own rules further down the file) sit LATER in this stylesheet than this
     media query block, and at equal specificity CSS resolves ties by source order, not by
     whether a media query happens to be active. A real bug caught after shipping (the exact
     same class of mistake as the #btnSidebarToggle/.iconbtn specificity bug above): every one
     of these mobile overrides was being silently discarded by the later desktop rule, so the
     panel kept rendering as the old broken single-column stack even though the media query
     itself was correctly matching. The #dupPanel prefix raises specificity instead of relying
     on staying below those desktop rules in source order — the same fix shape as that earlier
     bug, applied here for the same reason. If any of this is ever refactored, keep it
     ID-scoped rather than reverting to bare class selectors. */
  #dupPanel .dup-row{flex-wrap:wrap;row-gap:8px;padding:10px 12px;}
  #dupPanel .dup-key{width:100%;flex:0 0 100%;}
  #dupPanel .dup-body{row-gap:8px;}
  #dupPanel .tiles{width:100%;flex:0 0 100%;gap:6px;}
  #dupPanel .tile{width:calc((100% - 12px) / 3);flex:0 0 calc((100% - 12px) / 3);padding:4px 6px;}
  #dupPanel .dup-row .dedupe,#dupPanel .dup-row .dlDupCol{width:100%;flex:0 0 100%;box-sizing:border-box;justify-content:center;}
  /* one column's stats now run shorter than desktop's own 230px cap (2 tile-rows instead of
     3), but the cap is kept a bit taller than desktop's anyway — comfortable headroom, no
     downside since it's a ceiling, not a fixed height. Checking 2-3 columns still scrolls
     within the panel, same as desktop's own "if 3 rows don't fit, scroll" behavior.
     flex:0 1 auto (shrink allowed, unlike desktop's flex:none) is paired with #workArea
     .tablewrap's own min-height just below — an explicit request that checking more columns
     must never squeeze the table itself down below a usable minimum. Without shrink allowed
     here, .tablewrap (the only flex:1 sibling in #workArea's column) would be the sole thing
     absorbing the overflow when the dup panel grows, toward zero height if needed — hiding
     the table entirely behind an ever-taller stack of duplicate-check panels. With shrink
     allowed, this panel gives up space first (down to whatever's left after the table's floor
     and the toolbar/pager are satisfied), still fully reachable via its own existing
     overflow-y:auto regardless of how little height it ends up with. */
  #dupPanel.dup{max-height:300px;flex:0 1 auto;}
  /* Guarantees the header row + at least ~3 data rows stay visible on mobile no matter how
     tall the toolbar/pager/dup panel above and below it grow — an explicit request, so
     checking several columns for duplicates can never scroll the table itself out of view.
     ~31px per data row + ~33px header (measured from tbody td's padding/line-height and
     .th-in's padding at this font-size) ≈ 126px for header+3 rows; 150px adds a small margin.
     #workArea-scoped (not bare .tablewrap) for the same reason every other override in this
     section is ID/parent-scoped: .tablewrap{min-height:0} is declared unconditionally later
     in this stylesheet (part 4's CSS) and would otherwise win the cascade at equal
     specificity regardless of this media query being active — see the cascade-order lesson
     earlier in this section. */
  #workArea .tablewrap{min-height:150px;}

  /* Declutter: several inline text blocks (toolbar legend, the pager's full sentence, the
     duplicate panel's idle instructions) read fine on desktop but wrap into several full
     lines on a narrow phone, pushing the actual table down. Below 760px each gets replaced
     by a single tap-to-reveal info icon (.mobile-info, a native <details>/<summary> — chosen
     specifically over this file's usual custom .info-ic/.info-tip popover because the
     duplicate panel's content is *regenerated* via innerHTML on every renderDupPanel() call;
     a native element needs no JS re-wiring after being recreated, where the custom popover's
     one-time enableInfoTips() wiring would silently miss it). The original full text/legend
     stays completely unchanged on desktop. */
  .toolbar > .legend{display:none;}
  #pagerInfo{display:none;}
  .dup-idle-full{display:none;}
  .mobile-info{display:inline-flex;}
}
.mobile-info{display:none;position:relative;vertical-align:middle;}
.mobile-info summary{
  list-style:none;cursor:pointer;
  display:inline-flex;align-items:center;justify-content:center;
  width:22px;height:22px;border-radius:50%;flex:none;
  background:var(--surface-2);color:var(--text-3);border:1px solid var(--border-strong);
}
.mobile-info summary::-webkit-details-marker{display:none;}
.mobile-info summary:hover{color:var(--accent);border-color:var(--accent);}
.mobile-info[open] summary{color:var(--accent);border-color:var(--accent);background:var(--accent-soft);}
.mobile-info-body{
  position:absolute;z-index:35;margin-top:6px;width:240px;max-width:calc(100vw - 24px);
  padding:9px 11px;border-radius:var(--r-sm);
  background:var(--surface);border:1px solid var(--border-strong);
  box-shadow:0 10px 28px rgba(0,0,0,.28);
  font-size:12px;line-height:1.5;color:var(--text-2);
}
.mobile-info-body .legend{color:var(--text-2);margin:3px 0;}
@media (max-width:480px){
  .brand-logo{font-size:16px;}
  .brand-divider{height:18px;}
  .brand-name{font-size:14px;}
  #svcCta{display:none;}
  .foot{flex-wrap:wrap;row-gap:8px;}
  .foot .outwrap{margin-left:0;width:100%;justify-content:space-between;}
}

/* ---------- sidebar ---------- */
.side{
  background:var(--surface);border-right:1px solid var(--border);
  display:flex;flex-direction:column;min-height:0;overflow-y:auto;
}
/* same thicker, always-visible scrollbar treatment as .tablewrap, for visual consistency
   between the two panes that scroll internally within the app shell */
.side{scrollbar-width:auto;scrollbar-color:var(--border-strong) var(--surface-2);}
.side::-webkit-scrollbar{width:15px;}
.side::-webkit-scrollbar-track{background:var(--surface-2);}
.side::-webkit-scrollbar-thumb{background:var(--border-strong);border-radius:99px;border:3px solid var(--surface-2);}
.side::-webkit-scrollbar-thumb:hover{background:var(--text-3);}
.side section{padding:15px 16px;border-bottom:1px solid var(--border);}
.side section:last-child{border-bottom:none;}
.side-title{
  position:relative;
  font-family:var(--mono);
  font-size:11px;font-weight:600;letter-spacing:.03em;text-transform:none;
  color:var(--text);display:flex;align-items:center;gap:6px;
  padding:4px 6px;margin:-4px -6px 7px;border-radius:6px;
  background:transparent;transition:background-color .13s ease;
}
/* Subtle hover highlight on every section title (not just the collapsible ones), so a
   sweeping mouse pass makes each header in the sidebar easy to pick out at a glance. A direct
   background on .side-title itself, NOT a ::before pseudo-element with z-index:-1 (the first
   attempt) — that needed .side-title to also carry an explicit z-index to contain the negative
   child in its own stacking context, and doing that had a real, serious side effect that only
   showed up later: #info-tip is a CHILD of .side-title (see below), so it got trapped in that
   same local stacking context too — its own z-index:30 stopped competing globally and started
   losing to *later* .side-title elements (e.g. Localizar e Substituir's title rendering on top
   of Telefone's open tooltip, both effectively pinned to z-index:0 as a single unit from the
   outside) and to the table. This background+padding approach needs no z-index anywhere, so
   .side-title never becomes a stacking-context root and #info-tip keeps escaping to compete
   freely at the document level, same as before either bug existed.
   The padding:4px 6px + margin:-4px -6px 7px combination keeps the *visual* box-model
   identical to the old margin-bottom:11px/no-padding version: horizontally the negative
   margin exactly cancels the new padding (net 0, so text still sits flush with the section's
   own 16px inset); vertically -4px+4px=0 at the top (unchanged text position) and 4px+7px=11px
   at the bottom (same total gap as before). section.collapsible.collapsed's own override below
   was adjusted the same way. */
.side-title:hover{background:var(--surface-2);}
/* One per section, matching the icon used for that same section's #mobileRail shortcut
   (part "Mobile layout") — reused rather than invented separately, so the icon language
   stays consistent whether the user is looking at the sidebar itself or its mobile rail
   shortcut. .side-title's own flex `gap` already spaces it from the title text and the "?"
   info icon that follow, so no margin is needed here. */
.side-title-ic{flex:none;color:inherit;}
.side-title .cmt{color:var(--text-3);font-weight:500;}
/* Collapsible sidebar sections (Nomes/Telefone/Localizar e Substituir — Arquivo/Templates
   stay always open, see CLAUDE.md). The whole .side-title bar is the click/keyboard target
   (role="button" tabindex="0", wired in initCollapsibleSections()), not just the chevron —
   #info-ic's own click handler already calls stopPropagation(), so the "?" help icon doesn't
   also toggle the section when clicked. */
section.collapsible .side-title{cursor:pointer;user-select:none;}
.side-collapse-chev{margin-left:auto;flex:none;display:flex;color:var(--text-3);transition:transform .15s ease;}
section.collapsible.collapsed .side-collapse-chev{transform:rotate(-90deg);}
/* the title stays visible either way — only the body collapses — so every section name is
   always scannable in the sidebar without needing to open it first. -4px (not 0) because
   .side-title now carries padding-bottom:4px (see above, the hover-highlight box model) —
   margin:-4px cancels that padding to net 0 total trailing space, matching this rule's
   original intent before that padding existed. */
section.collapsible.collapsed .side-title{margin-bottom:-4px;}
section.collapsible.collapsed .stack{display:none;}
.side-title .count{
  margin-left:auto;background:var(--surface-2);color:var(--text-2);
  border-radius:99px;padding:1px 7px;font-size:10px;letter-spacing:0;
}
.info-ic{
  display:inline-flex;color:var(--text-3);cursor:pointer;flex:none;
  border-radius:4px;transition:color .13s;
}
.info-ic:hover,.info-ic:focus-visible{color:var(--accent);}
.info-ic:focus-visible{outline:2px solid var(--accent);outline-offset:2px;}

/* custom tooltip popover: shows on hover/focus, pins open on click/tap until
   dismissed via outside click or its own close button (see enableInfoTips).
   position:fixed with JS-computed top/left (enableInfoTips' own position()), NOT position:
   absolute;top:100% off .side-title — that was tried twice and broke twice: it depends on
   .side-title never becoming a stacking-context root, which is exactly what an unrelated
   hover-highlight fix did as a side effect (see CLAUDE.md), trapping the tooltip behind later
   sidebar sections and the table. position:fixed sidesteps the whole bug class: a fixed
   element with an explicit z-index participates directly in the ROOT stacking context,
   bypassing every ancestor regardless of what stacking contexts they do or don't establish —
   the same reasoning, and the same getBoundingClientRect()-based positioning technique,
   #columnFilterPanel/#frConfirmBox already use elsewhere in this file for the same reason.
   Fixed width (~2x the sidebar's own usable ~240px content width) — a request for more
   breathing room for the now-more-detailed copy below; max-width is a viewport safety clamp,
   and enableInfoTips()'s own position() clamps `left` the same way openFrConfirm() does, so
   the box can never run past either edge of the viewport regardless of which section it's
   attached to. */
.info-tip{
  position:fixed;z-index:30;
  width:480px;max-width:calc(100vw - 24px);
  /* .info-tip previously used var(--accent-soft) directly, which is a translucent rgba() —
     fine as a subtle highlight tint elsewhere, but here it let whatever was scrolling
     underneath (table rows, sidebar text) show through and made the tooltip's own text hard
     to read (real reported bug). color-mix against the opaque --surface bakes the same tint
     into a fully solid color instead, so the box is always legible regardless of what's
     behind it, while still reading as "accent-tinted", not a plain surface popover. */
  background:color-mix(in srgb, var(--accent) 14%, var(--surface));border:1px solid var(--accent);
  border-radius:var(--r-sm);box-shadow:0 10px 28px rgba(0,0,0,.28);
  padding:10px 28px 10px 12px;
  font-size:12px;font-weight:400;letter-spacing:0;text-transform:none;
  line-height:1.5;color:var(--text);
  opacity:0;visibility:hidden;transform:translateY(-4px);
  transition:opacity .14s ease,transform .14s ease,visibility .14s;
  pointer-events:none;
}
.info-tip.show{opacity:1;visibility:visible;transform:translateY(0);pointer-events:auto;}
/* .up = position() (below) decided to flip the tip above its title instead, since there wasn't
   enough room left before the bottom of the viewport — same naming convention as .colpanel.up
   elsewhere in this file for the same "opens upward" concept. Only the initial (pre-.show)
   transform direction needs flipping, so the slide-in animation matches which way the tip
   actually travels into place instead of sliding down when it opened upward. */
.info-tip.up{transform:translateY(4px);}
.info-tip-close{
  display:none;position:absolute;top:6px;right:6px;
  border:none;background:transparent;color:var(--text-2);cursor:pointer;
  padding:3px;border-radius:5px;place-items:center;
}
.info-tip-close:hover{background:color-mix(in srgb,var(--accent) 20%,transparent);color:var(--accent);}
.info-tip.pinned .info-tip-close{display:grid;}
.stack{display:flex;flex-direction:column;gap:8px;}

/* ---------- controls ---------- */
.btn{
  display:inline-flex;align-items:center;justify-content:center;gap:6px;
  padding:7px 12px;border-radius:var(--r-sm);
  border:1px solid var(--border-strong);background:var(--surface);
  cursor:pointer;font-size:13px;font-weight:500;white-space:nowrap;
  transition:background .13s,border-color .13s,color .13s;
}
.btn:hover{background:var(--surface-2);border-color:var(--text-3);}
.btn:active{transform:translateY(.5px);}
.btn:disabled{opacity:.42;cursor:not-allowed;transform:none;}
.btn:disabled:hover{background:var(--surface);border-color:var(--border-strong);}
.btn.primary{background:var(--accent);border-color:var(--accent);color:#fff;font-weight:600;}
.btn.primary:hover{background:var(--accent-2);border-color:var(--accent-2);}
.btn.ghost{border-color:transparent;background:transparent;color:var(--text-2);}
.btn.ghost:hover{background:var(--surface-2);border-color:transparent;color:var(--text);}
.btn.sm{padding:5px 9px;font-size:12px;}
.btn.block{width:100%;}
.btn svg{flex:none;}
/* #btnPick loses its primary/accent treatment once a file is loaded — with a file already
   in place (the file card, preview, etc. below it) it shouldn't keep competing for
   attention as if it were still the main call to action */
#btnPick.loaded{
  background:transparent;border-color:var(--border-strong);color:var(--text-2);font-weight:500;
}
#btnPick.loaded:hover{background:var(--surface-2);border-color:var(--text-3);color:var(--text);}
/* nudges toward exporting after a template is created/updated — cleared on click, not a timer */
.btn.needs-export{position:relative;border-color:var(--accent);color:var(--accent);}
.btn.needs-export::after{
  content:"";position:absolute;top:-4px;right:-4px;width:8px;height:8px;border-radius:50%;
  background:var(--accent);border:2px solid var(--surface);
}
/* generic pressed/active state for a toggle-style .btn (as opposed to a one-shot action button) */
.btn.on{background:var(--accent-soft);border-color:var(--accent);color:var(--accent);}
.btn.on:hover{background:var(--accent-soft);}
/* very light permanent tint marking this one as a view toggle rather than a one-shot action —
   much subtler than .colpanel-trigger's fuller box treatment or .on's active state above.
   Scoped to :not(.on) since #btnOnlySelected's ID specificity would otherwise beat .btn.on
   and mask the (intentionally stronger) active-state background when the toggle is on. */
#btnOnlySelected:not(.on){background:color-mix(in srgb, var(--accent) 6%, var(--surface));border-color:color-mix(in srgb, var(--accent) 30%, var(--border-strong));}
#btnOnlySelected:not(.on):hover{background:color-mix(in srgb, var(--accent) 12%, var(--surface));}
/* #btnTestRow gets the warn (amber) palette instead of accent, both while off and while on
   (overriding the generic .btn.on above, via ID+class specificity) — it's the same color
   language the test row itself uses (tr.test-row below), so the button visually previews
   what toggling it turns on, rather than looking like a plain accent-tinted view filter. */
#btnTestRow:not(.on){background:color-mix(in srgb, var(--warn-line) 12%, var(--surface));border-color:color-mix(in srgb, var(--warn-line) 40%, var(--border-strong));}
#btnTestRow:not(.on):hover{background:color-mix(in srgb, var(--warn-line) 20%, var(--surface));}
#btnTestRow.on{background:var(--warn-soft);border-color:var(--warn-line);color:var(--warn);}
#btnTestRow.on:hover{background:var(--warn-soft);}

.inp,.sel{
  width:100%;padding:7px 10px;border-radius:var(--r-sm);
  border:1px solid var(--border-strong);background:var(--surface-2);color:var(--text);
  font-size:13px;font-family:inherit;transition:border-color .13s,box-shadow .13s;
}
.inp:focus,.sel:focus{
  outline:none;border-color:var(--accent);
  box-shadow:0 0 0 3px color-mix(in srgb,var(--accent) 18%,transparent);
}
.inp::placeholder{color:var(--text-3);}
.sel{cursor:pointer;appearance:none;
  background-image:linear-gradient(45deg,transparent 50%,var(--text-3) 50%),linear-gradient(135deg,var(--text-3) 50%,transparent 50%);
  background-position:calc(100% - 15px) 50%,calc(100% - 10px) 50%;
  background-size:5px 5px,5px 5px;background-repeat:no-repeat;padding-right:28px;}
.lbl{font-size:11px;font-weight:600;color:var(--text-3);margin-bottom:4px;display:block;letter-spacing:.02em;}
.field{flex:1;min-width:0;}
input[type=file]{display:none;}
input[type=checkbox]{accent-color:var(--accent);cursor:pointer;}

.switch-row{display:flex;align-items:center;gap:9px;font-size:12.5px;cursor:pointer;user-select:none;color:var(--text-2);transition:color .13s,opacity .13s;}
.switch-row:hover{color:var(--text);}
.switch-row.disabled{opacity:.42;cursor:not-allowed;color:var(--text-3);}
.switch-row.disabled:hover{color:var(--text-3);}
.switch{position:relative;flex:none;width:34px;height:20px;}
.switch input{position:absolute;inset:0;margin:0;opacity:0;cursor:pointer;z-index:1;}
.switch-row.disabled .switch input{cursor:not-allowed;}
.switch-track{
  position:absolute;inset:0;border-radius:99px;background:var(--border-strong);
  transition:background .15s;pointer-events:none;
}
.switch-track::after{
  content:"";position:absolute;top:2px;left:2px;width:16px;height:16px;border-radius:50%;
  background:var(--surface);box-shadow:0 1px 2px rgba(0,0,0,.3);transition:transform .15s;
}
.switch input:checked ~ .switch-track{background:var(--accent);}
.switch input:checked ~ .switch-track::after{transform:translateX(14px);}
.switch input:focus-visible ~ .switch-track{box-shadow:0 0 0 3px color-mix(in srgb,var(--accent) 30%,transparent);}

.warn-box{
  background:var(--warn-soft);border:1px solid var(--warn-line);border-radius:var(--r-sm);
  padding:9px 10px;font-size:12px;color:var(--warn);line-height:1.4;
  min-width:0;overflow-wrap:anywhere;
}
.warn-box b{font-family:var(--mono);}
.warn-actions{display:flex;gap:6px;margin-top:7px;}
/* both button labels are kept short on purpose (full column names live in the
   wrappable message text above instead) so neither ever needs to wrap here */
.warn-actions .btn{min-width:0;white-space:nowrap;text-align:center;padding:8px 10px;}
/* "Ignorar" only needs its own short label's width; shrinking it to fit-content
   frees up more of the row for "Criar coluna extra" to have generous side padding */
.warn-actions .btn:first-child{flex:0 0 auto;}
.warn-actions .btn:last-child{flex:1;padding-left:16px;padding-right:16px;}

/* ---------- file card ---------- */
.filecard{
  background:var(--surface-2);border:1px solid var(--border);border-radius:var(--r-sm);
  padding:10px 11px;display:flex;align-items:center;gap:9px;
}
.filecard .ic{color:var(--accent);flex:none;}
.filecard .meta{min-width:0;flex:1;overflow:hidden;}
/* these are spans: they must be blockified for ellipsis to apply */
.filecard .nm,.filecard .sub{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.filecard .nm{font-weight:600;font-size:12.5px;}
.filecard .sub{font-size:11px;color:var(--text-3);margin-top:1px;}
.iconbtn{
  border:none;background:transparent;color:var(--text-3);cursor:pointer;
  padding:4px;border-radius:6px;display:grid;place-items:center;flex:none;
  transition:background .13s,color .13s;
}
.iconbtn:hover{background:var(--border);color:var(--text);}
.iconbtn.del:hover{background:var(--danger-soft);color:var(--danger);}

/* ---------- template chips ---------- */
.tpl-list{display:flex;flex-direction:column;gap:5px;}
.tpl{
  display:flex;align-items:center;gap:6px;border-radius:var(--r-sm);
  border:1px solid var(--border);background:var(--surface-2);padding:6px 6px 6px 10px;
  transition:border-color .13s,background .13s;
}
.tpl:hover{border-color:var(--accent);background:var(--accent-soft);}
.tpl .go{
  flex:1;min-width:0;text-align:left;border:none;background:none;cursor:pointer;
  font-size:12.5px;font-weight:550;padding:1px 0;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
.tpl .colbadge{
  display:inline-flex;align-items:center;gap:3px;flex:none;
  background:var(--accent-soft);color:var(--accent);border:1px solid var(--accent);
  border-radius:99px;padding:0 6px;font-size:10px;font-weight:700;line-height:16px;
}
.tpl .dupbadge{
  display:inline-flex;align-items:center;gap:3px;flex:none;
  background:var(--warn-soft);color:var(--warn);border:1px solid var(--warn-line);
  border-radius:99px;padding:0 6px;font-size:10px;font-weight:700;line-height:16px;
}
.tpl.active{border-color:var(--accent);background:var(--accent-soft);}
.tpl.active .go{color:var(--accent);}
.iconbtn.upd:hover{background:var(--accent-soft);color:var(--accent);}

/* two-step inline confirmation, so no blocking native dialog is needed */
.tpl.confirming{border-color:var(--danger);background:var(--danger-soft);}
.tpl.confirming.upd-mode{border-color:var(--accent);background:var(--accent-soft);}
.tpl .ask{
  flex:1;min-width:0;font-size:11.5px;font-weight:600;color:var(--danger);
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
.tpl.upd-mode .ask{color:var(--accent);}
.tpl .yes,.tpl .no{
  flex:none;border:1px solid transparent;border-radius:6px;cursor:pointer;
  padding:3px 8px;font-size:11px;font-weight:700;
}
.tpl .yes{background:var(--danger);color:#fff;}
.tpl.upd-mode .yes{background:var(--accent);}
.tpl .no{background:transparent;color:var(--text-2);border-color:var(--border-strong);}
.tpl .no:hover{background:var(--surface);}
.tpl-empty{color:var(--text-3);font-size:12px;font-style:italic;padding:2px 0;}

/* ---------- main ---------- */
/* min-width:0 all the way down, otherwise the implicit min-width:auto of grid/flex
   items lets the table push the layout wider instead of scrolling inside .tablewrap */
.main{display:flex;flex-direction:column;min-height:0;min-width:0;background:var(--bg);}
#workArea{min-width:0;}
.toolbar{
  flex:none;display:flex;align-items:center;gap:8px;flex-wrap:wrap;min-width:0;
  padding:11px 18px;border-bottom:1px solid var(--border);background:var(--surface);
}
.legend{display:flex;align-items:center;gap:5px;font-size:11.5px;color:var(--text-3);}
.legend .sw{width:9px;height:9px;border-radius:3px;flex:none;}

.pager{
  flex:none;display:flex;align-items:center;justify-content:center;gap:8px;
  padding:5px 18px;border-top:1px solid var(--border);background:var(--surface);
}
.pager .hint{font-size:11.5px;color:var(--text-3);text-align:center;}
.pager .btn.sm{padding:3px 8px;}

/* column-picker dropdown: an alternative to selecting columns via the table's own header
   checkboxes, for wide tables where scrolling horizontally to find a column is annoying */
.colpanel-anchor{position:relative;display:flex;flex:none;max-width:100%;min-width:0;}
/* deliberately not a plain .btn — a permanently-tinted "embedded box" so it reads as a
   distinct control from the neutral Todas/Nenhuma/Inverter action buttons next to it,
   not just another button in the row */
.colpanel-trigger{
  display:inline-flex;align-items:center;gap:6px;flex:none;
  max-width:100%;min-width:0;
  padding:6px 12px;border-radius:var(--r-sm);
  background:var(--accent-soft);border:1px solid var(--accent);color:var(--accent);
  font-size:12px;font-weight:650;cursor:pointer;white-space:nowrap;
  transition:background .13s,color .13s;
}
.colpanel-trigger:hover{background:color-mix(in srgb, var(--accent) 22%, var(--accent-soft));}
.colpanel-trigger.on{background:var(--accent);border-color:var(--accent);color:#fff;}
.colpanel-trigger .chev{flex:none;margin-left:1px;opacity:.75;}
/* the variable-length part (the active sheet's name) is the only thing that should
   truncate — the icon/label/chevron around it stay fixed size. flex:1 + min-width:0 is
   what lets it truncate at all inside a flex row instead of forcing the button wider */
#sheetPickLabel{flex:1;min-width:0;display:inline-block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:left;}
.colpanel{
  position:absolute;top:calc(100% + 6px);left:0;z-index:40;
  width:260px;max-height:340px;display:flex;flex-direction:column;min-height:0;
  background:var(--surface);border:1px solid var(--border-strong);border-radius:var(--r-sm);
  box-shadow:0 14px 32px rgba(0,0,0,.28);
  opacity:0;visibility:hidden;transform:translateY(-4px);
  transition:opacity .13s ease,transform .13s ease,visibility .13s;
  pointer-events:none;
}
.colpanel.show{opacity:1;visibility:visible;transform:translateY(0);pointer-events:auto;}
.colpanel-head{flex:none;padding:8px;border-bottom:1px solid var(--border);}
.colpanel-head .inp{padding:6px 9px;font-size:12.5px;}
.colpanel-actions{display:flex;gap:6px;margin-top:6px;}
.colpanel-actions .btn{flex:1;}
.colpanel-list{flex:1;min-height:0;overflow-y:auto;padding:4px;}
.colpanel-row{
  display:flex;align-items:center;gap:8px;padding:6px 8px;border-radius:6px;
  font-size:12.5px;cursor:pointer;user-select:none;
}
.colpanel-row:hover{background:var(--surface-2);}
.colpanel-row input{accent-color:var(--accent);cursor:pointer;flex:none;}
.colpanel-row span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.colpanel-empty{padding:16px 9px;text-align:center;color:var(--text-3);font-size:12px;}
/* .colpanel-row is a <label> everywhere else (wrapping a checkbox); the sheet-picker and
   the save-format popover use it as a plain <button> instead (click = the action, no
   checkbox), so browser button chrome needs resetting to match the label's look */
button.colpanel-row{display:flex;width:100%;background:none;border:none;font:inherit;color:inherit;text-align:left;}
.colpanel-row.active{background:var(--accent-soft);color:var(--accent);font-weight:650;}
/* #sheetPickPanel needed noticeably more contrast than the plain .colpanel look — a
   heavy accent border plus a colored glow (not just a shadow) so it clearly reads as
   "floating above" the sidebar and grabs attention, instead of blending into it, plus
   bolder/higher-contrast row text and a solid (not soft-tinted) accent fill for the
   active sheet so it's unambiguous which one is open */
/* Shown only while a just-loaded multi-sheet workbook has no sheet chosen yet (see
   handleExcelWorkerMessage's "sheets" branch) — sits directly above #sheetPickAnchor so the
   down-arrow icon visually points at the trigger button right below it. Reuses .warn-box's
   existing warn palette (same one #sheetPickPanel below already uses for its own emphasis)
   rather than inventing a new color language for "needs your attention" in this sidebar. */
.warn-box.sheet-hint{display:flex;align-items:center;gap:7px;margin-bottom:2px;}
.warn-box.sheet-hint svg{flex:none;}
#sheetPickAnchor{width:100%;}
#btnSheetPick{width:100%;justify-content:space-between;}
/* Same "needs a decision" emphasis as #sheetPickHint above, kept on the trigger itself so it
   still reads as unresolved even if the auto-opened popover gets dismissed (click-outside/
   Escape) before a sheet is picked — cleared the instant a sheet is chosen. */
#btnSheetPick.pending{border-color:var(--warn-line);box-shadow:0 0 0 3px var(--warn-soft);}
#sheetPickPanel{
  width:100%;
  border:2px solid var(--warn-line);
  box-shadow:0 0 0 4px var(--warn-soft), 0 20px 44px rgba(0,0,0,.45);
}
#sheetPickPanel .colpanel-list{padding:6px;}
#sheetPickPanel .colpanel-row{color:var(--text);font-weight:600;border:1px solid transparent;}
#sheetPickPanel .colpanel-row + .colpanel-row{margin-top:2px;}
#sheetPickPanel .colpanel-row:hover{background:var(--accent-soft);color:var(--accent);border-color:var(--accent);}
#sheetPickPanel .colpanel-row.active{background:var(--accent);color:#fff;font-weight:700;}
/* the save-format popover lives in the footer, at the bottom of the viewport, so unlike
   #colPanel/#sheetPickPanel (which open downward off a toolbar/sidebar) it must open
   upward — .up flips the anchor edge and the initial slide direction to match */
.colpanel.up{top:auto;bottom:calc(100% + 6px);transform:translateY(4px);}
.colpanel.up.show{transform:translateY(0);}
.colpanel.right{left:auto;right:0;}

/* Services CTA popover (#svcPanel), a self-promo "fale comigo" form off a topbar icon
   button — reuses .colpanel/.colpanel-anchor/.colpanel.right as-is (same shape as
   #btnDownloadFormat/#dlFormatPanel), so this block only adds what's genuinely new: the
   honeypot and a bit of internal form spacing. */
.hp{position:absolute;left:-9999px;top:-9999px;width:1px;height:1px;opacity:0;pointer-events:none;}
.svc-head p{margin:4px 0 0;font-size:12px;font-weight:400;color:var(--text-3);line-height:1.4;}
/* .colpanel's shared max-height:340px (above) is tuned for the OTHER popovers reusing that
   class, which are scrollable lists — but #svcMensagem's textarea has resize:vertical, and
   dragging it taller than the fixed 340px used to just spill the textarea out past the panel's
   own rounded border (max-height caps the box, but nothing scrolled, so the enlarged textarea
   visually stuck out below the card instead of the card growing with it — a real reported
   bug). Raising the cap to a viewport-relative size gives the panel real room to grow with a
   resized textarea, and overflow-y:auto is the fallback once even that generous cap is hit,
   so the submit button always stays reachable via scroll instead of running off-screen. */
#svcPanel{max-height:calc(100vh - 90px);overflow-y:auto;}

/* Phone field with a DDI/country picker — a shared createPhoneField() factory (see the JS
   below) drives both the sidebar's own phone-adjustment feature's format preview and this
   form's field. */
.phone-group{
  display:flex;align-items:stretch;border:1px solid var(--border-strong);
  border-radius:var(--r-sm);background:var(--surface-2);
  transition:border-color .13s,box-shadow .13s;
}
.phone-group:focus-within{
  border-color:var(--accent);box-shadow:0 0 0 3px color-mix(in srgb,var(--accent) 18%,transparent);
}
.phone-group.bad{border-color:var(--danger);box-shadow:0 0 0 3px color-mix(in srgb,var(--danger) 16%,transparent);}
.ddi-anchor{position:relative;flex:none;display:flex;}
.ddi-trigger{
  display:flex;align-items:center;gap:6px;border:none;background:transparent;
  color:var(--text);font-family:inherit;font-size:13px;font-weight:600;
  padding:9px 9px 9px 10px;cursor:pointer;white-space:nowrap;
  border-radius:var(--r-sm) 0 0 var(--r-sm);
}
.ddi-trigger:hover{background:color-mix(in srgb,var(--accent) 7%,transparent);}
.ddi-trigger:focus-visible{outline:2px solid var(--accent);outline-offset:-2px;}
.ddi-caret{color:var(--text-3);flex:none;}
.ddi-flag{
  width:20px;height:14px;object-fit:cover;border-radius:2px;flex:none;display:block;
  box-shadow:0 0 0 1px rgba(0,0,0,.12);
}
.ddi-panel{
  position:absolute;top:calc(100% + 7px);left:0;z-index:60;width:270px;
  background:var(--surface);border:1px solid var(--border-strong);border-radius:var(--r-sm);
  box-shadow:0 16px 40px rgba(0,0,0,.28);
  display:none;flex-direction:column;max-height:280px;overflow:hidden;
}
.ddi-panel.show{display:flex;}
.ddi-search{
  flex:none;margin:8px;padding:8px 10px;border-radius:6px;font-size:13px;font-family:inherit;
  border:1px solid var(--border-strong);background:var(--surface-2);color:var(--text);
}
.ddi-search:focus{outline:none;border-color:var(--accent);box-shadow:0 0 0 3px color-mix(in srgb,var(--accent) 18%,transparent);}
.ddi-list{flex:1;min-height:0;overflow-y:auto;padding:0 4px 6px;}
.ddi-opt{
  display:flex;align-items:center;gap:9px;width:100%;padding:8px 9px;border:none;
  background:none;font:inherit;font-size:13px;color:var(--text);text-align:left;
  cursor:pointer;border-radius:6px;
}
.ddi-opt:hover,.ddi-opt.active{background:var(--accent-soft);color:var(--accent);}
.ddi-opt[aria-selected="true"]{background:var(--accent);color:#fff;font-weight:650;}
.ddi-opt .nm{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.ddi-opt .dc{color:var(--text-3);font-size:12px;flex:none;}
.ddi-opt:hover .dc,.ddi-opt.active .dc{color:inherit;opacity:.8;}
.ddi-opt[aria-selected="true"] .dc{color:#fff;opacity:.85;}
.ddi-empty{padding:16px 10px;text-align:center;color:var(--text-3);font-size:12px;}
.phone-num{
  flex:1;min-width:0;border:none;border-left:1px solid var(--border);background:transparent;
  color:var(--text);font-family:inherit;font-size:13px;padding:9px 10px;
  border-radius:0 var(--r-sm) var(--r-sm) 0;
}
.phone-num:focus{outline:none;}

/* Rotating self-promo CTA that replaces the old #topStats row/column count in the topbar —
   only ever shown once a file is loaded. Kept as a plain text-style button (not .iconbtn/
   .btn) so it reads as a quiet inline message, not another chrome control competing with
   #btnServicos beside it. */
.svc-cta{
  display:flex;align-items:center;gap:5px;background:none;border:none;cursor:pointer;
  color:var(--accent);font-size:12.5px;font-weight:600;font-family:inherit;padding:0;
  max-width:280px;
}
.svc-cta:hover{color:var(--accent-2);}
.svc-cta .msg{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;transition:opacity .25s;}
.svc-cta .arrow{flex:none;transition:transform .13s;}
.svc-cta:hover .arrow{transform:translateX(2px);}

/* Gives #btnServicos a bit more visual weight than the plain hamburger-style .iconbtn it
   started as, so this self-promo entry point is easier to notice. Reuses .colpanel-trigger's
   exact accent-soft/accent-border/accent-text language rather than inventing a new color
   story; .on mirrors that component's own solid-fill open state. */
#btnServicos{
  background:var(--accent-soft);border:1px solid var(--accent);color:var(--accent);
  border-radius:var(--r-sm);
}
#btnServicos:hover{background:color-mix(in srgb, var(--accent) 22%, var(--accent-soft));}
#btnServicos.on{background:var(--accent);border-color:var(--accent);color:#fff;}

/* split "Baixar CSV/XLSX" button: two joined .btn.primary elements sharing one visual
   pill, so the format choice reads as an extension of the download button, not a second
   separate control competing for footer space */
.dl-anchor{position:relative;display:flex;flex:none;}
.dl-anchor .btn{border-radius:0;}
/* the main download action gets extra weight/size and an accent glow so it's clearly
   the most prominent control in the footer, not just another .btn.primary */
.dl-anchor .btn:first-child{
  border-top-left-radius:var(--r-sm);border-bottom-left-radius:var(--r-sm);
  padding:9px 18px;font-size:14px;font-weight:700;
  box-shadow:0 4px 16px color-mix(in srgb, var(--accent) 45%, transparent);
}
.dl-anchor .btn:first-child:hover{box-shadow:0 6px 20px color-mix(in srgb, var(--accent) 55%, transparent);}
.dl-anchor .btn:last-child{border-top-right-radius:var(--r-sm);border-bottom-right-radius:var(--r-sm);padding:9px 10px;border-left:1px solid rgba(255,255,255,.3);}

.tablewrap{flex:1;min-height:0;min-width:0;overflow:auto;background:var(--surface);}
/* dedicated click-and-drag handle for horizontal scroll, separate from the table itself —
   whole-table drag-to-scroll was tried and removed: it occasionally fought with the native
   scrollbar (grabbing the thumb could get reinterpreted as a table-drag). This rail is a
   thin strip with nothing else on it, so there's no ambiguity about what a pointerdown means. */
.drag-rail{
  flex:none;height:11px;display:flex;align-items:center;justify-content:center;
  background:var(--surface-2);border-bottom:1px solid var(--border);
  cursor:grab;touch-action:none;
}
.drag-rail:hover{background:var(--border);}
.drag-rail.dragging{cursor:grabbing;background:var(--border-strong);}
.drag-rail .grip{
  width:32px;height:4px;border-radius:2px;flex:none;
  background:repeating-linear-gradient(90deg, var(--text-3) 0 3px, transparent 3px 6px);
}
/* thicker, always-visible scrollbars just for the wide data table — a constant
   groove (not the page's transparent track) so the horizontal bar reads as a
   permanent UI element instead of something that only appears on hover/scroll */
.tablewrap{scrollbar-width:auto;scrollbar-color:var(--border-strong) var(--surface-2);}
.tablewrap::-webkit-scrollbar{height:15px;width:15px;}
.tablewrap::-webkit-scrollbar-track{background:var(--surface-2);}
.tablewrap::-webkit-scrollbar-thumb{background:var(--border-strong);border-radius:99px;border:3px solid var(--surface-2);}
.tablewrap::-webkit-scrollbar-thumb:hover{background:var(--text-3);}
table{border-collapse:separate;border-spacing:0;width:max-content;min-width:100%;font-size:12.5px;}
thead th{
  position:sticky;top:0;z-index:3;background:var(--surface-2);
  border-bottom:1px solid var(--border-strong);border-right:1px solid var(--border);
  padding:0;vertical-align:bottom;
}
.th-in{display:flex;align-items:center;gap:2px;padding:7px 8px 7px 10px;min-width:120px;}
.th-in label{
  display:flex;align-items:center;gap:7px;cursor:pointer;user-select:none;
  min-width:0;flex:1;font-weight:600;font-size:12.5px;
}
.th-in label span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.th-in input{flex:none;}
.dupbtn{
  border:1px solid transparent;background:transparent;color:var(--text-3);
  cursor:pointer;padding:3px;border-radius:6px;display:grid;place-items:center;flex:none;
  transition:all .13s;opacity:.5;
}
th:hover .dupbtn{opacity:1;}
.dupbtn:hover{background:var(--warn-soft);color:var(--warn);}
.dupbtn.on{opacity:1;background:var(--warn-soft);color:var(--warn);border-color:var(--warn-line);}
.dupbtn.capped{opacity:.25;cursor:not-allowed;}
th:hover .dupbtn.capped{opacity:.25;}
.dupbtn.capped:hover{background:transparent;color:var(--text-3);}
th.dupmark{box-shadow:inset 0 -3px 0 var(--warn-line);}
/* same shape as .dupbtn above, accent-colored (like .colpanel-trigger.on) instead of
   warn — a different concept (view-only row filter, not duplicate-check) so it gets its
   own color language rather than overloading the warn/amber "duplicate-check" meaning */
.filterbtn{
  border:1px solid transparent;background:transparent;color:var(--text-3);
  cursor:pointer;padding:3px;border-radius:6px;display:grid;place-items:center;flex:none;
  transition:all .13s;opacity:.5;
}
th:hover .filterbtn{opacity:1;}
.filterbtn:hover{background:var(--accent-soft);color:var(--accent);}
.filterbtn.on{opacity:1;background:var(--accent-soft);color:var(--accent);border-color:var(--accent);}
/* .colpanel's own base positioning is position:absolute off a position:relative anchor —
   this popover instead opens off a <th> inside .tablewrap (overflow:auto), so an absolute
   position would get clipped by that scroll container the same way the phone-picker bug
   (documented elsewhere in this file) clipped a popover to its own small field. position:fixed
   plus JS-computed top/left (from the trigger button's getBoundingClientRect(), see
   openColumnFilterPanel()) escapes that clipping entirely. */
#columnFilterPanel{position:fixed;top:0;left:0;width:260px;z-index:60;}

/* Find & Replace's confirm box (part 10): the sidebar (.side) scrolls internally, and this
   box used to be a plain in-flow .warn-box below #btnFindReplace — easy to trigger and then
   lose track of below the fold. position:fixed plus the same getBoundingClientRect()-based
   JS positioning as #columnFilterPanel above turns it into a floating popup that's always
   visible over the sidebar's own content regardless of scroll, closed the same way (outside
   click/Escape/scroll — see openFrConfirm()/hideFrConfirm()). Keeps .warn-box's own
   background/border/text color (this is still a warning-style confirmation), just adds the
   floating position and the .show-driven fade/slide transition every other popover uses.*/
#frConfirmBox{
  position:fixed;top:0;left:0;z-index:60;width:280px;
  box-shadow:0 14px 32px rgba(0,0,0,.28);
  opacity:0;visibility:hidden;transform:translateY(-4px);
  transition:opacity .13s ease,transform .13s ease,visibility .13s;
  pointer-events:none;
}
#frConfirmBox.show{opacity:1;visibility:visible;transform:translateY(0);pointer-events:auto;}
/* opened above #btnFindReplace instead of below it (see openFrConfirm()'s own flip logic) —
   same .up naming convention as .colpanel.up/.info-tip.up elsewhere in this file, only
   flipping the initial pre-.show transform direction so the slide animates in correctly. */
#frConfirmBox.up{transform:translateY(4px);}

/* Capitalização column-picker popover: same reasoning as #columnFilterPanel/#frConfirmBox
   above — its trigger (#btnTextCasePanel) lives inside .side, which is overflow-y:auto, so
   the usual .colpanel position:absolute-off-a-relative-anchor pattern (fine for #colPanel,
   whose trigger sits in the un-scrolling .toolbar) would get clipped by the sidebar's own
   scroll. position:fixed plus the same getBoundingClientRect()-based JS positioning as
   #frConfirmBox (including its "flip above the trigger if there's no room below" logic)
   escapes that clipping. Only the positioning is borrowed from #frConfirmBox; the list/search
   mechanics inside are modeled on #colPanel instead (see renderTextCaseList()). */
#textCasePanel{
  position:fixed;top:0;left:0;z-index:60;width:300px;max-height:340px;
  display:flex;flex-direction:column;min-height:0;
  background:var(--surface);border:1px solid var(--border-strong);border-radius:var(--r-sm);
  box-shadow:0 14px 32px rgba(0,0,0,.28);
  opacity:0;visibility:hidden;transform:translateY(-4px);
  transition:opacity .13s ease,transform .13s ease,visibility .13s;
  pointer-events:none;
}
#textCasePanel.show{opacity:1;visibility:visible;transform:translateY(0);pointer-events:auto;}
#textCasePanel.up{transform:translateY(4px);}
/* each row is a plain div (not a <label> wrapping a checkbox like .colpanel-row normally is —
   a <select> inside a <label> click-through behaves oddly) with the column name plus a mode
   <select>; .tc-mode-sel overrides .sel's default width:100% so it sizes to its own content
   instead of fighting the column-name label for space in the row. */
.tc-row{cursor:default;}
.tc-row span{flex:1;min-width:0;}
.tc-mode-sel{width:auto;flex:none;padding:5px 22px 5px 8px;font-size:11.5px;}
#btnTextCasePanel .tc-count{
  margin-left:8px;background:var(--surface-2);color:var(--text-2);
  border-radius:99px;padding:1px 7px;font-size:10px;font-weight:700;
}
#btnTextCasePanel.on .tc-count{background:rgba(255,255,255,.25);color:#fff;}

tbody td{
  border-bottom:1px solid var(--border);border-right:1px solid var(--border);
  padding:6px 10px;white-space:nowrap;max-width:340px;overflow:hidden;text-overflow:ellipsis;
}
tbody tr:hover td{background:var(--surface-2);}
td.off{opacity:.3;}
/* th itself keeps the sticky header's opaque background — only its content dims —
   otherwise `opacity` on the th makes the whole sticky cell translucent and rows
   scrolling underneath bleed through it */
th.off .th-in{opacity:.3;}
th.off .th-in label span{text-decoration:line-through;}
/* red/danger, not the warn/amber the rest of the duplicate-check UI (the header toggle
   button, the column-header underline, the toolbar legend) uses — that amber marks "this
   column is under duplicate-check", while red here marks "this specific value/row actually
   is one", a deliberately different meaning kept in a different color. */
td.dupcell{background:var(--danger-soft);}
tbody tr.duprow td:first-child{box-shadow:inset 3px 0 0 var(--danger);}
.num{font-variant-numeric:tabular-nums;}

/* synthetic preview-only column(s) (first-name output, phone-derived columns)
   appended after the real headers — never part of `headers`, just a read-only
   look at what download will add. Base rule is just the accent tint + badge;
   `.pinned` (only the first-name column uses it) additionally sticks the
   column to the right edge, like a frozen spreadsheet column, so it stays
   visible while scrolling horizontally through wide tables — needs an opaque
   background (not a translucent one) or scrolled cells would bleed through it.
   Non-pinned preview columns (phone-derived ones) just scroll normally; only
   one column can occupy the true right edge, so it must stay last in the DOM. */
th.previewcol{background:var(--accent-soft);box-shadow:inset 0 -3px 0 var(--accent);}
th.previewcol.pinned{
  position:sticky;right:0;z-index:4;
  box-shadow:inset 0 -3px 0 var(--accent),-6px 0 6px -6px rgba(0,0,0,.18);
}
.prev-badge{
  flex:none;background:var(--accent);color:#fff;font-size:9px;font-weight:700;
  text-transform:uppercase;letter-spacing:.04em;border-radius:99px;padding:2px 7px;margin-right:4px;
}
td.previewcol{
  background:color-mix(in srgb,var(--accent-soft) 55%,var(--surface));color:var(--accent);font-weight:600;
}
td.previewcol.pinned{position:sticky;right:0;z-index:2;box-shadow:-6px 0 6px -6px rgba(0,0,0,.18);}
tbody tr:hover td.previewcol{background:color-mix(in srgb,var(--accent-soft) 75%,var(--surface));}
/* nameCol's / phoneCol's own header + cells while their "adjust on download" toggle is on
   and being previewed. .textcase-active is the same visual for any column configured in the
   Capitalização feature (textCaseCols) — same accent-2 tint, grouped into these selector
   lists rather than duplicated as separate rules, since the look is identical. */
th.namecol-active,th.phonecol-active,th.textcase-active{box-shadow:inset 0 -3px 0 var(--accent-2);}
td.namecol-active,td.phonecol-active,td.textcase-active{background:color-mix(in srgb,var(--accent-soft) 45%,transparent);}
tbody tr:hover td.namecol-active,tbody tr:hover td.phonecol-active,tbody tr:hover td.textcase-active{background:color-mix(in srgb,var(--accent-soft) 65%,var(--surface-2));}
/* nameCol's/phoneCol's own cell when its "adjust" toggle changed what's displayed vs. the raw value */
td.normalized{color:var(--accent);font-weight:600;}
/* phoneCol's own cell when the value could NOT be automatically adjusted — shares the same
   danger palette `.dupcell` uses below (both are red by product decision), so if phoneCol is
   also a duplicate-checked column, a value that's both unadjustable and a duplicate reads the
   same as either state alone; not disambiguated further since this is a display-only overlay */
td.phone-flagged{background:var(--danger-soft);color:var(--danger);font-weight:600;}
tbody tr:hover td.phone-flagged{background:color-mix(in srgb,var(--danger-soft) 75%,var(--surface-2));}

/* ---------- edit mode ----------
   Real (non-synthetic) cells swap their plain text for an <input> while editModeOn is on
   (#btnEditMode). td.cell-edited (the accent tint marking "this value differs from the loaded
   file") applies whether or not edit mode is currently on, so past edits stay visible/legible
   after leaving edit mode — only the input/revert-button affordance itself is edit-mode-only. */
td.editing{padding:3px 5px;}
.cell-edit-wrap{display:flex;align-items:center;gap:3px;}
.cell-edit-input{
  flex:1;min-width:50px;width:100%;border:1px solid transparent;background:transparent;
  font:inherit;color:inherit;padding:3px 5px;border-radius:5px;
}
.cell-edit-input:hover{border-color:var(--border-strong);}
.cell-edit-input:focus{outline:none;border-color:var(--accent);background:var(--surface);box-shadow:0 0 0 2px var(--accent-soft);}
.cell-revert-btn{
  flex:none;border:none;background:var(--accent-soft);color:var(--accent);
  width:16px;height:16px;border-radius:50%;font-size:12px;line-height:1;cursor:pointer;
  display:grid;place-items:center;padding:0;
}
.cell-revert-btn:hover{background:var(--accent);color:#fff;}
/* visible "after adjustment" preview under an edit-mode input (see the JS comment at its
   creation site) — the input itself always shows the raw/override text, never the
   name/phone/text-case-transformed one, so this is the only in-view cue the transform applied */
.cell-preview-hint{font-size:11px;line-height:1.3;color:var(--accent);font-weight:600;padding:0 5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
td.cell-edited{background:color-mix(in srgb, var(--accent-soft) 55%, var(--surface));}
tbody tr:hover td.cell-edited{background:color-mix(in srgb, var(--accent-soft) 75%, var(--surface-2));}

/* ---------- test row ----------
   An optional, editable "sample data" row pinned to the bottom of the preview (toggled via
   #btnTestRow), for trying column selection / name / phone settings against the user's own
   made-up values without needing a real matching row in the file. It's never added to
   `rows`/`headers` themselves, so it can't disturb selection/index-based logic elsewhere in
   the file — but it DOES reach both duplicate-check verification (computeDuplicates() folds
   it in as a virtual extra row when testRowOn, see that function and the `.dupcell` override
   below) and the actual download (buildOutputRows() appends it, via `testRowAsArray()`, as
   the export's last row, subject to the exact same column-selection/normalize/phone-adjust/
   dedupe-skip pipeline any real row goes through). Every
   cell is position:sticky;bottom:0, the same technique `thead th{position:sticky;top:0}`
   already uses — sticky-bottom on a trailing last row behaves symmetrically to sticky-top on
   a leading first row (both stay pinned through the *entire* scroll range, not just at the
   very end), so no separate tfoot/whole-table restructuring is needed to satisfy "fica fixo".
*/
tr.test-row td{
  position:sticky;bottom:0;z-index:3;
  background:color-mix(in srgb, var(--warn-soft) 80%, var(--surface));
  border-top:2px solid var(--warn-line);
}
tr.test-row td.previewcol{background:color-mix(in srgb, var(--warn-soft) 55%, var(--accent-soft));}
/* corner-pinned (bottom+right): must out-rank both the plain sticky-bottom row (3) and the
   ordinary right-pinned column (2) so it renders on top when both axes scroll at once */
tr.test-row td.previewcol.pinned{z-index:5;}
/* the test row's own version of a duplicate hit — needs its own rule (not just plain
   `td.dupcell`) because `tr.test-row td`'s background above is more specific (two type
   selectors) than `td.dupcell` (one) and would otherwise win and hide it. Red/danger, same
   as the real table's `.dupcell` above (and for the same reason: distinct from this row's
   own amber base tint, and from the amber "under duplicate-check" indicators elsewhere). */
tr.test-row td.dupcell{background:var(--danger);color:#fff;font-weight:700;}
/* .off normally just dims the cell via opacity (td.off{opacity:.3}), but these cells are
   sticky with a background meant to hide rows scrolling underneath — opacity on the sticky
   element itself would let them bleed through (the exact bug th.off's own fix documents
   above), so dim only the input inside instead. */
tr.test-row td.off{opacity:1;}
tr.test-row td.off .test-row-input{opacity:.4;}
/* The "TESTE" badge and the flex layout it needs live on an inner wrapper span
   (.test-row-cell), never on the <td> itself — a <td> is position:sticky above, and earlier
   this badge was `td:first-child::before` with `display:flex` on the <td>. That silently
   broke the sticky behavior for exactly that one cell: overriding a table cell's box type
   away from `display:table-cell` changes how it's laid out inside the table and, in turn,
   how its sticky containing block is resolved, so only the first column failed to pin while
   every other (unmodified) `<td>` pinned correctly. Keep flex/display changes on a wrapper
   *inside* a sticky `<th>`/`<td>`, never on the sticky cell itself — `.th-in` inside `<th>`
   already follows this same rule; this is the second instance of the same fix. */
.test-row-cell{display:flex;align-items:center;gap:5px;}
.test-row-badge{
  flex:none;background:var(--warn-line);color:#1a1200;font-size:9px;font-weight:700;
  text-transform:uppercase;letter-spacing:.04em;border-radius:99px;padding:2px 7px;
}
/* the badge's sibling (an <input> or a computed-value <span>) fills whatever room the
   badge leaves inside .test-row-cell, instead of sizing to its own content/default width */
.test-row-cell .test-row-input{flex:1;width:auto;min-width:0;}
.test-row-cell .test-row-value{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.test-row-input{
  width:100%;border:1px solid transparent;background:transparent;font:inherit;color:inherit;
  padding:3px 5px;border-radius:5px;min-width:60px;
}
.test-row-input:hover{border-color:var(--border-strong);}
.test-row-input:focus{
  outline:none;border-color:var(--warn-line);background:var(--surface);
  box-shadow:0 0 0 3px color-mix(in srgb, var(--warn-line) 25%, transparent);
}
.test-row-input::placeholder{color:var(--text-3);}

/* ---------- compact checkbox list (phone extra-column picker) ---------- */
.chk-list{display:flex;flex-direction:column;gap:6px;}
.chk-row{display:flex;align-items:center;gap:7px;font-size:12.5px;color:var(--text-2);cursor:pointer;user-select:none;transition:color .13s;}
.chk-row:hover{color:var(--text);}
.chk-row:has(input:disabled){opacity:.45;cursor:not-allowed;color:var(--text-3);}

/* ---------- duplicates panel ---------- */
/* the panel itself is a plain stack — no card chrome; each checked column gets
   its own full-width row (data + controls), stacked instead of side by side */
.dup{
  flex:none;background:var(--surface);border-top:1px solid var(--border);
  display:flex;flex-direction:column;min-width:0;
  max-height:230px;overflow-y:auto;
}
.dup.idle{
  color:var(--text-3);font-size:12.5px;
  flex-direction:row;align-items:center;justify-content:center;
  padding:11px 18px;min-height:54px;
}
.dup-row{
  display:flex;align-items:center;gap:12px;flex:none;
  padding:10px 18px;min-height:54px;
}
.dup-row + .dup-row{border-top:1px solid var(--border);}
.dup-body{display:flex;align-items:center;gap:12px;flex-wrap:wrap;flex:1;min-width:0;}
.tiles{display:flex;gap:8px;flex-wrap:wrap;}
.tile{
  background:var(--surface-2);border:1px solid var(--border);border-radius:var(--r-sm);
  padding:4px 10px;width:128px;flex:0 0 128px;
}
.tile .k{
  display:block;font-size:9px;font-weight:600;letter-spacing:.03em;text-transform:uppercase;color:var(--text-3);
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
.tile .v{display:block;font-size:15px;font-weight:650;font-variant-numeric:tabular-nums;line-height:1.2;}
.tile.hot{background:var(--warn-soft);border-color:var(--warn-line);}
.tile.hot .v{color:var(--warn);}
.tile.good .v{color:var(--ok);}
.dup-key{
  font-size:11.5px;color:var(--text-2);display:flex;align-items:center;gap:6px;flex-wrap:wrap;
  width:190px;flex:0 0 190px;min-width:0;
}
.keychip{
  background:var(--warn-soft);color:var(--warn);border:1px solid var(--warn-line);
  border-radius:99px;padding:1px 9px;font-size:11px;font-weight:600;font-family:var(--mono);
  max-width:110px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;vertical-align:bottom;
}
.dedupe{
  display:flex;align-items:center;gap:7px;font-size:12.5px;cursor:pointer;user-select:none;
  padding:6px 11px;border-radius:var(--r-sm);border:1px solid var(--border-strong);
  background:var(--surface-2);transition:border-color .13s,opacity .13s;
}
.dedupe:hover{border-color:var(--accent);}
.dedupe input{accent-color:var(--warn);}
/* dedupe is only actionable when its column has duplicates — dim it hard so
   "can't select this" reads clearly instead of looking identical to enabled */
.dedupe.dedupe-off{
  opacity:.4;cursor:not-allowed;color:var(--text-3);
  background:transparent;border-style:dashed;border-color:var(--border);
}
.dedupe.dedupe-off:hover{border-color:var(--border);}
.dl-opt{flex:none;padding:7px 8px;border-top:1px solid var(--border);}
.dl-opt .dedupe{width:100%;box-sizing:border-box;font-size:12px;}

/* ---------- footer ---------- */
.foot{
  flex:none;display:flex;align-items:center;gap:12px;
  padding:11px 18px;background:var(--surface);
  border-top:1px solid var(--border);box-shadow:var(--shadow-lg);
}
.foot .sum{font-size:12.5px;color:var(--text-2);white-space:nowrap;min-width:0;overflow:hidden;text-overflow:ellipsis;}
.foot .sum b{color:var(--text);font-variant-numeric:tabular-nums;}
.foot .outwrap{margin-left:auto;display:flex;align-items:center;gap:9px;min-width:0;}
/* Width is set inline by resizeOutName() (JS, sized to fit the current filename via a hidden
   #outNameMirror measuring span) rather than fixed here — this rule only supplies the floor
   flexbox falls back to once the row runs out of room. flex:0 1 auto (the default, spelled
   out for clarity) is what lets it shrink below its JS-set width and start ellipsizing only
   then; .dl-anchor below is flex:none specifically so all of that shrinking pressure lands on
   the input, never on the download buttons. */
#outName{width:190px;min-width:70px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
/* Off-screen twin of #outName used only to measure text width (see resizeOutName()) — never
   shown, never interactive. white-space:pre so it doesn't collapse/wrap the measured text. */
#outNameMirror{position:absolute;left:-9999px;top:-9999px;visibility:hidden;white-space:pre;pointer-events:none;}

/* ---------- empty state ---------- */
.empty{flex:1;display:grid;place-items:center;padding:28px;min-height:0;}
.drop{
  width:min(560px,100%);border:2px dashed var(--border-strong);border-radius:16px;
  background:var(--surface);padding:44px 32px;text-align:center;cursor:pointer;
  transition:border-color .16s,background .16s,transform .16s;
}
.drop:hover{border-color:var(--accent);background:var(--accent-soft);}
body.dragging .drop{border-color:var(--accent);background:var(--accent-soft);transform:scale(1.012);}
/* dropping is allowed at any time — show a hint over the table too */
body.dragging .tablewrap::after{
  content:"Solte o arquivo .csv para carregar";
  position:fixed;inset:52px 0 108px 272px;z-index:40;
  display:grid;place-items:center;pointer-events:none;
  background:color-mix(in srgb,var(--accent-soft) 92%,transparent);
  border:2px dashed var(--accent);color:var(--accent);font-weight:650;
}
@media (max-width:880px){body.dragging .tablewrap::after{left:224px;}}
.drop .ico{
  width:52px;height:52px;margin:0 auto 16px;border-radius:15px;display:grid;place-items:center;
  background:var(--accent-soft);color:var(--accent);
}
.drop h2{font-size:16.5px;font-weight:650;margin-bottom:6px;letter-spacing:-.01em;}
.drop p{color:var(--text-3);font-size:13px;}
/* Takes over #emptyState's centered card (in place of the plain drop-zone .drop) for as
   long as a just-loaded multi-sheet workbook has no sheet chosen yet — this is the single
   biggest, hardest-to-miss placement in the app (the main content area, exactly where a
   user's attention already is right after loading a file), so the sidebar's own smaller
   #sheetPickHint/.pending cues (still shown too, for after a sheet is picked and the user
   might reopen the picker to switch) don't have to carry this alone. Solid warn-colored
   border+background+glow (not the plain drop-zone's neutral dashed border) is what marks it
   as "needs a decision" rather than just another empty state.*/
.sheet-pick-card{
  border-style:solid;border-color:var(--warn-line);background:var(--warn-soft);
  box-shadow:0 0 0 6px color-mix(in srgb, var(--warn) 14%, transparent), 0 20px 44px rgba(0,0,0,.22);
  cursor:default;
}
.sheet-pick-card:hover{border-color:var(--warn-line);background:var(--warn-soft);transform:none;}
.sheet-pick-card .ico{background:var(--warn-line);color:#fff;}
.sheet-pick-card h2{color:var(--warn);font-size:19px;}
.sheet-pick-card p{color:var(--warn);opacity:.85;}
.sheet-pick-grid{display:flex;flex-wrap:wrap;gap:9px;justify-content:center;margin-top:20px;max-width:100%;}
.sheet-pick-grid button{
  padding:10px 18px;border-radius:10px;border:1.5px solid var(--warn-line);
  background:var(--surface);color:var(--text);font-size:13.5px;font-weight:650;cursor:pointer;
  transition:background .13s,border-color .13s,color .13s,transform .13s;
}
.sheet-pick-grid button:hover{background:var(--warn);border-color:var(--warn);color:#fff;transform:translateY(-1px);}

/* ---------- toast ---------- */
.toast{
  position:fixed;bottom:74px;left:50%;transform:translateX(-50%) translateY(10px);
  background:var(--text);color:var(--surface);
  padding:9px 17px;border-radius:99px;font-size:12.5px;font-weight:500;
  box-shadow:0 8px 28px rgba(0,0,0,.28);max-width:min(560px,88vw);text-align:center;
  opacity:0;pointer-events:none;transition:opacity .19s,transform .19s;z-index:50;
}
.toast.show{opacity:1;transform:translateX(-50%) translateY(0);}
.hidden{display:none !important;}